@jvsoft/components 1.0.0-alpha.16 → 1.0.0-alpha.18

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 (34) hide show
  1. package/.storybook/tema-demo.css +194 -0
  2. package/dialog-flotante/README.md +21 -1
  3. package/fesm2022/jvsoft-components-dialog-flotante.mjs +18 -12
  4. package/fesm2022/jvsoft-components-dialog-flotante.mjs.map +1 -1
  5. package/fesm2022/jvsoft-components-filtro-busqueda.mjs +11 -2
  6. package/fesm2022/jvsoft-components-filtro-busqueda.mjs.map +1 -1
  7. package/fesm2022/jvsoft-components-lista-arbol.mjs +58 -17
  8. package/fesm2022/jvsoft-components-lista-arbol.mjs.map +1 -1
  9. package/fesm2022/jvsoft-components-lista-detalle.mjs +70 -0
  10. package/fesm2022/jvsoft-components-lista-detalle.mjs.map +1 -0
  11. package/fesm2022/jvsoft-components-luces-navidad.mjs +2 -2
  12. package/fesm2022/jvsoft-components-luces-navidad.mjs.map +1 -1
  13. package/fesm2022/jvsoft-components-menu.mjs +4 -1
  14. package/fesm2022/jvsoft-components-menu.mjs.map +1 -1
  15. package/fesm2022/jvsoft-components-tabla-mantenimiento-components-progress-bar.mjs +2 -5
  16. package/fesm2022/jvsoft-components-tabla-mantenimiento-components-progress-bar.mjs.map +1 -1
  17. package/fesm2022/jvsoft-components-tabla-mantenimiento.mjs +2605 -394
  18. package/fesm2022/jvsoft-components-tabla-mantenimiento.mjs.map +1 -1
  19. package/fesm2022/jvsoft-components.mjs +1 -0
  20. package/fesm2022/jvsoft-components.mjs.map +1 -1
  21. package/lista-arbol/README.md +17 -1
  22. package/lista-detalle/README.md +85 -0
  23. package/package.json +6 -2
  24. package/src/styles/base-jvsoft-components.css +714 -15
  25. package/tabla-mantenimiento/README.md +628 -0
  26. package/tabla-mantenimiento/tabla-mantenimiento.component.scss +31 -0
  27. package/types/jvsoft-components-dialog-flotante.d.ts +2 -0
  28. package/types/jvsoft-components-filtro-busqueda.d.ts +6 -0
  29. package/types/jvsoft-components-lista-arbol.d.ts +19 -2
  30. package/types/jvsoft-components-lista-detalle.d.ts +44 -0
  31. package/types/jvsoft-components-menu.d.ts +1 -0
  32. package/types/jvsoft-components-tabla-mantenimiento-components-progress-bar.d.ts +1 -2
  33. package/types/jvsoft-components-tabla-mantenimiento.d.ts +1070 -21
  34. package/types/jvsoft-components.d.ts +1 -0
@@ -1,21 +1,21 @@
1
1
  import { trigger, state, style, transition, animate } from '@angular/animations';
2
2
  import { TemplatePortal } from '@angular/cdk/portal';
3
- import * as i1 from '@angular/common';
4
- import { CommonModule, DecimalPipe } from '@angular/common';
3
+ import * as i1$1 from '@angular/common';
4
+ import { CommonModule, DecimalPipe, NgTemplateOutlet } from '@angular/common';
5
5
  import * as i0 from '@angular/core';
6
- import { EventEmitter, HostListener, Output, Input, Directive, ViewChild, Optional, Component, inject, Pipe, NgModule, ContentChildren, ViewChildren, Injectable, DestroyRef, input, signal, ElementRef, HostBinding } from '@angular/core';
7
- import * as i1$2 from '@angular/forms';
6
+ import { InjectionToken, inject, input, Component, EventEmitter, HostListener, Output, Input, Directive, signal, ViewChild, Optional, Pipe, computed, isDevMode, NgModule, ContentChildren, ViewChildren, makeEnvironmentProviders, Injectable, DestroyRef, effect, untracked, ElementRef, forwardRef, HostBinding } from '@angular/core';
7
+ import * as i4$1 from '@angular/forms';
8
8
  import { Validators, FormControl, FormGroup, ReactiveFormsModule, FormsModule } from '@angular/forms';
9
- import * as i14 from '@angular/material/badge';
9
+ import * as i15 from '@angular/material/badge';
10
10
  import { MatBadgeModule } from '@angular/material/badge';
11
11
  import * as i3$1 from '@angular/material/checkbox';
12
12
  import { MatCheckboxModule } from '@angular/material/checkbox';
13
- import * as i5$1 from '@angular/material/core';
13
+ import * as i5 from '@angular/material/core';
14
14
  import { MatRipple, MatRippleModule } from '@angular/material/core';
15
- import * as i6 from '@angular/material/divider';
15
+ import * as i6$1 from '@angular/material/divider';
16
16
  import { MatDividerModule } from '@angular/material/divider';
17
- import * as i5 from '@angular/material/icon';
18
- import { MatIconRegistry, MatIcon, MatIconModule } from '@angular/material/icon';
17
+ import * as i1 from '@angular/material/icon';
18
+ import { MatIconModule, MatIconRegistry, MatIcon } from '@angular/material/icon';
19
19
  import * as i8 from '@angular/material/menu';
20
20
  import { MatMenuModule, MatMenuTrigger } from '@angular/material/menu';
21
21
  import * as i9 from '@angular/material/paginator';
@@ -23,20 +23,22 @@ import { MatPaginatorModule, MatPaginator, MAT_PAGINATOR_DEFAULT_OPTIONS } from
23
23
  import * as i3 from '@angular/material/sort';
24
24
  import { MatSortModule, MatSort } from '@angular/material/sort';
25
25
  import * as i2 from '@angular/material/table';
26
- import { MatColumnDef, MatTable, MatTableModule, MatTableDataSource, MatFooterRow, MatRow } from '@angular/material/table';
27
- import * as i4$1 from '@angular/material/tooltip';
26
+ import { MatTableDataSource, MatColumnDef, MatTable, MatTableModule, MatRow } from '@angular/material/table';
27
+ import * as i4 from '@angular/material/tooltip';
28
28
  import { MatTooltipModule } from '@angular/material/tooltip';
29
+ import * as i10 from '@angular/material/progress-bar';
30
+ import { MatProgressBarModule } from '@angular/material/progress-bar';
31
+ import * as i1$2 from '@angular/platform-browser';
32
+ import { DomSanitizer } from '@angular/platform-browser';
29
33
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
30
34
  import { addMinutes } from 'date-fns';
31
- import { Subject, takeUntil, startWith, of, fromEvent } from 'rxjs';
35
+ import { startWith, of, fromEvent } from 'rxjs';
32
36
  import { filter, map, take } from 'rxjs/operators';
33
- import * as i4 from '@jvsoft/utils';
34
- import { JvsPopoverDirective, JvsPopoverListenerDirective, simpleHash } from '@jvsoft/utils';
35
- import * as i1$1 from '@angular/platform-browser';
36
- import { DomSanitizer } from '@angular/platform-browser';
37
+ import * as i6 from '@jvsoft/utils';
38
+ import { claveNodoArbol, antepasadosArbol, indexarArbol, filtrarArbolConAntepasados, aplanarArbol, JvsPopoverDirective, JvsPopoverListenerDirective, normalizarTexto, simpleHash } from '@jvsoft/utils';
37
39
  import * as XLSX from 'xlsx';
38
40
  import { Router, ActivatedRoute, NavigationEnd } from '@angular/router';
39
- import * as i2$1 from '@angular/cdk/overlay';
41
+ import * as i1$3 from '@angular/cdk/overlay';
40
42
 
41
43
  function buscarEnArray(coleccion, idBuscar, dato) {
42
44
  if (!Array.isArray(coleccion) || coleccion.length === 0)
@@ -86,6 +88,124 @@ function getBrowserName() {
86
88
  return 'other';
87
89
  }
88
90
  }
91
+ /** Tipos de columna cuyo contenido se pinta centrado. */
92
+ const TIPOS_CENTRADOS = ['yes_no', 'icons', 'icon', 'icon_checkbox', 'checkbox', 'expandir', 'progress', 'estado', 'image', 'numeracion_automatica'];
93
+ /**
94
+ * Alineación de la cabecera de una columna: la que se pida en `alineacionCabecera`, o si no la
95
+ * de su celda, leída de `cssClasses` (`text-center`, `text-right`…), o la propia del tipo.
96
+ */
97
+ function alineacionCabecera(column) {
98
+ if (column?.alineacionCabecera) {
99
+ return column.alineacionCabecera;
100
+ }
101
+ const clases = ' ' + [].concat(column?.cssClasses ?? []).join(' ') + ' ';
102
+ if (/\s!?text-(right|end)\s/.test(clases)) {
103
+ return 'derecha';
104
+ }
105
+ if (/\s!?text-center\s/.test(clases)) {
106
+ return 'centro';
107
+ }
108
+ if (/\s!?text-(left|start)\s/.test(clases)) {
109
+ return 'izquierda';
110
+ }
111
+ return TIPOS_CENTRADOS.includes(column?.type) ? 'centro' : 'izquierda';
112
+ }
113
+ /**
114
+ * Un botón por registro, para filtros rápidos de la fila `secundario` (despachos, grupos…),
115
+ * con su conteo como badge y, si se pide, un botón "Todos" al inicio o al final.
116
+ *
117
+ * No pone colores: si se indica cuál es el elegido (`campoValor` + `valorActivo`),
118
+ * cada botón declara `activo` y la tabla pinta relleno el elegido y en tono claro los demás.
119
+ * Sin esas opciones los botones también declaran `activo` (en `false`), para que todos tengan
120
+ * el mismo aspecto de filtro.
121
+ */
122
+ function generarBotonesDinamicos(data, config) {
123
+ const leer = (item, campo) => typeof campo === 'function' ? campo(item) : (campo ? item?.[campo] : undefined);
124
+ const valorActual = () => typeof config.valorActivo === 'function' ? config.valorActivo() : config.valorActivo;
125
+ if ((config.campoValor === undefined) !== (config.valorActivo === undefined)) {
126
+ console.warn(`generarBotonesDinamicos('${config.tipo}'): \`campoValor\` y \`valorActivo\` van juntos; con uno solo ningún botón se marca como elegido.`);
127
+ }
128
+ const todosCfg = config.includeAll
129
+ ? (typeof config.includeAll === 'object' ? config.includeAll : {})
130
+ : null;
131
+ const esActivo = (item) => {
132
+ if (config.campoValor !== undefined && config.valorActivo !== undefined) {
133
+ const actual = valorActual();
134
+ if (item === null) {
135
+ const valorTodos = todosCfg?.valor ?? null;
136
+ return actual === valorTodos || (valorTodos === null && actual === undefined);
137
+ }
138
+ return item?.[config.campoValor] === actual;
139
+ }
140
+ return false;
141
+ };
142
+ const segmentado = config.estilo === 'segmentado';
143
+ const claseBase = config.class ?? (segmentado ? undefined : '!rounded-full');
144
+ const lista = Array.isArray(data) ? data : [];
145
+ /** Texto del contador; sin él si no hay valor o, con `ocultarCero`, si vale 0. */
146
+ const contador = (valor) => {
147
+ if (valor === undefined || valor === null) {
148
+ return undefined;
149
+ }
150
+ return config.ocultarCero && Number(valor) === 0 && `${valor}`.trim() !== '' ? undefined : `${valor}`;
151
+ };
152
+ const botones = lista.map(item => {
153
+ const label = leer(item, config.labelField);
154
+ const tooltip = config.tooltipField ? leer(item, config.tooltipField) : label;
155
+ const badge = config.badgeField ? leer(item, config.badgeField) : undefined;
156
+ return {
157
+ tipo: config.tipo,
158
+ label,
159
+ tooltip,
160
+ badge: contador(badge),
161
+ class: claseBase,
162
+ noContextual: true,
163
+ sinCondicion: true,
164
+ activo: () => esActivo(item),
165
+ ...(segmentado ? { grupo: config.tipo } : {}),
166
+ datosExtra: {
167
+ item: (config.extraDataField === 'all' || config.extraDataField === undefined) ? item : item?.[config.extraDataField],
168
+ },
169
+ };
170
+ });
171
+ if (todosCfg) {
172
+ let badge;
173
+ if (todosCfg.badge === true) {
174
+ const suma = lista.reduce((acc, item) => acc + (Number(config.badgeField ? leer(item, config.badgeField) : 0) || 0), 0);
175
+ badge = `${suma}`;
176
+ }
177
+ else if (todosCfg.badge !== undefined && todosCfg.badge !== null) {
178
+ badge = `${todosCfg.badge}`;
179
+ }
180
+ const todos = {
181
+ tipo: config.tipo,
182
+ label: todosCfg.label ?? 'Todos',
183
+ tooltip: todosCfg.tooltip,
184
+ badge: contador(badge),
185
+ class: claseBase,
186
+ sinCondicion: true,
187
+ noContextual: true,
188
+ activo: () => esActivo(null),
189
+ ...(segmentado ? { grupo: config.tipo } : {}),
190
+ datosExtra: { item: null },
191
+ };
192
+ if (todosCfg.posicion === 'fin') {
193
+ botones.push(todos);
194
+ }
195
+ else {
196
+ botones.unshift(todos);
197
+ }
198
+ }
199
+ if (!segmentado) {
200
+ // El margen va por posición, así sirve igual con "Todos" al inicio o al final.
201
+ botones.forEach((btn, i) => {
202
+ if (i > 0 && !/(^|\s)!?m[lx]-/.test(btn.class ?? '')) {
203
+ btn.class = `ml-1 ${btn.class ?? ''}`.trim();
204
+ }
205
+ });
206
+ }
207
+ return botones;
208
+ }
89
209
 
90
210
  class DataModel {
91
211
  modelosChk = {}; // Usar any para valores dinámicos
@@ -99,7 +219,32 @@ class DataModel {
99
219
  }
100
220
  return campoValor.map(data => row[data]).join(separador);
101
221
  }
102
- // Agrega controles al objeto modelosChk
222
+ /**
223
+ * Prepara una casilla por fila usando como clave el mismo identificador con el que la celda
224
+ * lee y escribe (`generarId`). `agregarControles` compone la clave de otra manera cuando el
225
+ * campo es un texto o un array sin separador, así que el modelo y la casilla acababan
226
+ * hablando de claves distintas: la casilla salía vacía y la lista de seleccionados
227
+ * devolvía filas que nadie había marcado.
228
+ *
229
+ * Con `limpiar` en false conserva lo ya marcado, que es lo que espera `chkFieldPersistente`
230
+ * cuando la selección tiene que sobrevivir al cambio de página.
231
+ */
232
+ prepararCasillas(lista, campoValor, separador = '', limpiar = true) {
233
+ if (limpiar) {
234
+ this.modelosChk = {};
235
+ }
236
+ lista.forEach(dat => {
237
+ const clave = this.generarId(dat, campoValor, separador);
238
+ if (!(clave in this.modelosChk)) {
239
+ this.modelosChk[clave] = false;
240
+ }
241
+ });
242
+ }
243
+ /**
244
+ * @deprecated Para las casillas de `tabla-mantenimiento` usar `prepararCasillas`, que
245
+ * compone la clave igual que la celda. Este método compone claves distintas según el tipo
246
+ * de `campoValor`, que es de donde venía el desajuste entre lo marcado y lo informado.
247
+ */
103
248
  agregarControles(lista, idLista, limpiar = true, campoValor = null, campoValorSeparador = '') {
104
249
  if (limpiar) {
105
250
  this.modelosChk = {};
@@ -192,20 +337,34 @@ class ForCheckboxModel {
192
337
  constructor(modeloCheck) {
193
338
  this.modeloCheck = modeloCheck;
194
339
  }
340
+ /**
341
+ * Cuenta casillas y marcadas en un solo recorrido. La cabecera consulta el estado en cada
342
+ * ciclo de detección de cambios, y antes cada consulta recorría el modelo dos veces
343
+ * creando dos arrays intermedios; con mil filas marcadas eso era trabajo y basura de sobra.
344
+ */
345
+ contar() {
346
+ let total = 0;
347
+ let activos = 0;
348
+ for (const clave in this.modeloCheck.modelosChk) {
349
+ total++;
350
+ if (this.modeloCheck.modelosChk[clave]) {
351
+ activos++;
352
+ }
353
+ }
354
+ return { total, activos };
355
+ }
195
356
  get cantidadActivos() {
196
- return Object.values(this.modeloCheck.modelosChk).filter(Boolean).length;
357
+ return this.contar().activos;
197
358
  }
198
359
  get existenActivados() {
199
- return this.cantidadActivos > 0;
360
+ return this.contar().activos > 0;
200
361
  }
201
362
  get todosActivos() {
202
- const total = Object.keys(this.modeloCheck.modelosChk).length;
203
- const activos = this.cantidadActivos;
363
+ const { total, activos } = this.contar();
204
364
  return activos > 0 && total === activos;
205
365
  }
206
366
  get algunosActivos() {
207
- const total = Object.keys(this.modeloCheck.modelosChk).length;
208
- const activos = this.cantidadActivos;
367
+ const { total, activos } = this.contar();
209
368
  return activos > 0 && total !== activos;
210
369
  }
211
370
  establecerTodos(activo) {
@@ -213,6 +372,275 @@ class ForCheckboxModel {
213
372
  }
214
373
  }
215
374
 
375
+ /**
376
+ * `MatTableDataSource` de la tabla de mantenimiento. Sin `arbol` se comporta igual que el de
377
+ * Material. Con `arbol` (ver {@link ConfigArbolTabla}):
378
+ *
379
+ * - **Árbol**: `filteredData` son las filas que se pintan, en orden de árbol: las coincidencias del
380
+ * buscador y del filtro propio, más sus antepasados, y de ellas solo las que cuelgan de nodos
381
+ * abiertos. El paginador cuenta esas filas. Ordenar por una columna reordena entre hermanos,
382
+ * sin romper la jerarquía.
383
+ * - **Plano**: solo las coincidencias, con el orden de columnas de siempre.
384
+ *
385
+ * La jerarquía se calcula sobre la lista completa: el nivel de un nodo no cambia al filtrar, y el
386
+ * que tiene el padre fuera de la lista sale como raíz.
387
+ */
388
+ class TablaMantenimientoDataSource extends MatTableDataSource {
389
+ _arbol = null;
390
+ /** Lo que el usuario abrió o cerró a mano, por id. Manda sobre los niveles por defecto. */
391
+ expansionElegida = new Map();
392
+ /** Si la última pasada estaba filtrando: al cambiar de modo se olvida lo abierto a mano. */
393
+ filtrandoAntes = false;
394
+ info = new Map();
395
+ /** Coincidencias + antepasados de la última pasada, sin plegar (para exportar y buscar). */
396
+ visiblesSinPlegar = [];
397
+ indice = null;
398
+ get arbol() {
399
+ return this._arbol;
400
+ }
401
+ set arbol(config) {
402
+ const cambiaModo = !!config?.plano !== !!this._arbol?.plano
403
+ || config?.campoId !== this._arbol?.campoId || config?.campoIdPadre !== this._arbol?.campoIdPadre;
404
+ this._arbol = config;
405
+ if (cambiaModo) {
406
+ this.expansionElegida.clear();
407
+ }
408
+ this.refrescar();
409
+ }
410
+ /** Árbol con sangría y plegado (no plano). */
411
+ get arbolActivo() {
412
+ return !!this._arbol && !this._arbol.plano;
413
+ }
414
+ /** Vuelve a filtrar con el mismo texto: tras abrir o cerrar nodos o cambiar el filtro propio. */
415
+ refrescar() {
416
+ // El setter emite aunque el valor sea el mismo, y eso recalcula filtro, orden y página.
417
+ this.filter = this.filter;
418
+ }
419
+ idDe(fila) {
420
+ return this._arbol ? claveNodoArbol(fila?.[this._arbol.campoId]) : null;
421
+ }
422
+ /** Lo que se sabe de la fila en la última pasada; `null` sin árbol o si no está a la vista. */
423
+ infoArbol(fila) {
424
+ if (!this._arbol) {
425
+ return null;
426
+ }
427
+ return this.info.get(fila) ?? null;
428
+ }
429
+ alternarNodo(fila) {
430
+ const id = this.idDe(fila);
431
+ if (id === null || !this.arbolActivo) {
432
+ return;
433
+ }
434
+ this.expansionElegida.set(id, !(this.info.get(fila)?.abierto ?? false));
435
+ this.refrescar();
436
+ }
437
+ /** Abre o cierra todos los nodos con hijos. */
438
+ expandirTodo(abrir = true) {
439
+ if (!this.arbolActivo) {
440
+ return;
441
+ }
442
+ this.expansionElegida.clear();
443
+ (this.data ?? []).forEach(fila => {
444
+ const id = this.idDe(fila);
445
+ if (id !== null) {
446
+ this.expansionElegida.set(id, abrir);
447
+ }
448
+ });
449
+ this.refrescar();
450
+ }
451
+ /**
452
+ * Abre los antepasados de la fila para que se vea. Devuelve `false` si la fila no pasa el
453
+ * buscador ni el filtro (no hay nada que abrir: no está a la vista).
454
+ */
455
+ abrirCaminoA(fila) {
456
+ if (!this.arbolActivo || !this.indice || !this.visiblesSinPlegar.includes(fila)) {
457
+ return false;
458
+ }
459
+ antepasadosArbol(this.indice, fila[this._arbol.campoId]).forEach(a => {
460
+ const id = this.idDe(a);
461
+ if (id !== null) {
462
+ this.expansionElegida.set(id, true);
463
+ }
464
+ });
465
+ this.refrescar();
466
+ return true;
467
+ }
468
+ /**
469
+ * Si la fila pasa el buscador y el filtro (en árbol, también si queda como camino de una
470
+ * coincidencia), aunque esté dentro de una rama plegada.
471
+ */
472
+ estaALaVista(fila) {
473
+ if (this.arbolActivo) {
474
+ return this.visiblesSinPlegar.includes(fila);
475
+ }
476
+ return (this.filteredData ?? []).includes(fila);
477
+ }
478
+ /**
479
+ * Filas que exporta el Excel. Sin árbol, `filteredData` (como siempre). En árbol, las
480
+ * coincidencias y sus antepasados en orden de árbol, aunque estén plegadas.
481
+ */
482
+ filasParaExportar() {
483
+ if (!this.arbolActivo) {
484
+ return this.filteredData;
485
+ }
486
+ return this.ordenarEnArbol(this.visiblesSinPlegar, () => true);
487
+ }
488
+ _filterData(data) {
489
+ const config = this._arbol;
490
+ if (!config) {
491
+ return super._filterData(data);
492
+ }
493
+ const lista = data ?? [];
494
+ const texto = this.filter;
495
+ const coincide = (fila) => (!config.filtro || config.filtro(fila))
496
+ && (texto == null || texto === '' || this.filterPredicate(fila, texto));
497
+ const info = new Map();
498
+ let resultado;
499
+ if (config.plano) {
500
+ resultado = lista.filter(coincide);
501
+ resultado.forEach(f => info.set(f, { nivel: 0, tieneHijos: false, abierto: false, contexto: false }));
502
+ this.visiblesSinPlegar = resultado;
503
+ this.indice = null;
504
+ }
505
+ else {
506
+ const opciones = { campoId: config.campoId, campoIdPadre: config.campoIdPadre };
507
+ const indice = indexarArbol(lista, opciones);
508
+ const filtrado = filtrarArbolConAntepasados(lista, opciones, coincide, indice);
509
+ // Con búsqueda se despliega todo. El filtro propio también, salvo que la pantalla diga
510
+ // que no cuenta (p. ej. "ocultar inactivos", que está siempre puesto).
511
+ const hayTexto = texto != null && texto !== '';
512
+ const filtrando = hayTexto || (config.filtroActivo ?? filtrado.coincidencias.size < lista.length);
513
+ if (filtrando !== this.filtrandoAntes) {
514
+ // Lo abierto a mano en el árbol completo no sirve para leer un resultado, ni al revés.
515
+ this.expansionElegida.clear();
516
+ this.filtrandoAntes = filtrando;
517
+ }
518
+ const niveles = config.nivelesAbiertos ?? 1;
519
+ const estaAbierto = (nodo, nivel) => this.expansionElegida.get(this.idDe(nodo) ?? '') ?? (filtrando || nivel < niveles);
520
+ const aplanado = aplanarArbol(filtrado.visibles, opciones, { estaAbierto, comparar: config.comparar ?? undefined });
521
+ aplanado.forEach(n => info.set(n.nodo, {
522
+ nivel: n.nivel,
523
+ tieneHijos: n.tieneHijos,
524
+ abierto: n.abierto,
525
+ contexto: filtrado.contexto.has(n.nodo),
526
+ }));
527
+ resultado = aplanado.map(n => n.nodo);
528
+ this.visiblesSinPlegar = filtrado.visibles;
529
+ this.indice = indice;
530
+ }
531
+ this.info = info;
532
+ this.filteredData = resultado;
533
+ if (this.paginator) {
534
+ this._updatePaginator(resultado.length);
535
+ }
536
+ return resultado;
537
+ }
538
+ _orderData(data) {
539
+ if (!this.arbolActivo) {
540
+ return super._orderData(data);
541
+ }
542
+ return this.ordenarEnArbol(data, nodo => this.info.get(nodo)?.abierto ?? true);
543
+ }
544
+ /**
545
+ * Pone las filas en orden de árbol. Con una columna ordenada, el orden de Material decide el
546
+ * lugar entre hermanos; si no, `comparar` de la configuración o el de la lista.
547
+ */
548
+ ordenarEnArbol(filas, estaAbierto) {
549
+ const config = this._arbol;
550
+ const opciones = { campoId: config.campoId, campoIdPadre: config.campoIdPadre };
551
+ let comparar = config.comparar ?? undefined;
552
+ if (this.sort?.active && this.sort.direction) {
553
+ const posicion = new Map();
554
+ this.sortData(filas.slice(), this.sort).forEach((f, i) => posicion.set(f, i));
555
+ comparar = (a, b) => (posicion.get(a) ?? 0) - (posicion.get(b) ?? 0);
556
+ }
557
+ return aplanarArbol(filas, opciones, { estaAbierto: n => estaAbierto(n), comparar }).map(n => n.nodo);
558
+ }
559
+ }
560
+
561
+ const CONTROL_ARBOL_TABLA = new InjectionToken('CONTROL_ARBOL_TABLA');
562
+ /**
563
+ * Sangría y botón de plegar/desplegar de una fila en modo árbol. La usa la columna `type: 'arbol'`
564
+ * y sirve también dentro de una columna `custom`, para que el consumidor ponga su propio contenido:
565
+ *
566
+ * ```html
567
+ * <td *matCellDef="let row" mat-cell>
568
+ * <jvs-tabla-arbol-celda [fila]="row">{{ row.cNombre }} <small>{{ row.cSigla }}</small></jvs-tabla-arbol-celda>
569
+ * </td>
570
+ * ```
571
+ *
572
+ * Fuera del modo árbol (o en modo plano) solo pinta el contenido. El botón no selecciona la fila:
573
+ * detiene el clic para que abrir una rama no cambie la selección.
574
+ */
575
+ class TablaArbolCeldaComponent {
576
+ control = inject(CONTROL_ARBOL_TABLA, { optional: true });
577
+ /** El registro de la fila. */
578
+ fila = input.required(...(ngDevMode ? [{ debugName: "fila" }] : /* istanbul ignore next */ []));
579
+ /** Se consulta en cada ciclo: el estado del árbol vive en la tabla y no es una señal. */
580
+ info() {
581
+ return this.control?.infoArbol(this.fila()) ?? null;
582
+ }
583
+ sangria() {
584
+ return this.control?.sangriaArbol() ?? 14;
585
+ }
586
+ alternar(evento) {
587
+ evento.stopPropagation();
588
+ this.control?.alternarNodo(this.fila());
589
+ }
590
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: TablaArbolCeldaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
591
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.18", type: TablaArbolCeldaComponent, isStandalone: true, selector: "jvs-tabla-arbol-celda", inputs: { fila: { classPropertyName: "fila", publicName: "fila", isSignal: true, isRequired: true, transformFunction: null } }, host: { classAttribute: "flex items-start min-w-0" }, ngImport: i0, template: `
592
+ @if (info(); as i) {
593
+ <span class="flex-none" [style.width.px]="i.nivel * sangria()" aria-hidden="true"></span>
594
+ @if (i.tieneHijos) {
595
+ <button type="button"
596
+ class="flex-none inline-flex items-center justify-center w-[14px] h-[14px] mr-[2px] p-0 border-0 bg-transparent rounded-sm cursor-pointer text-inherit hover:bg-black/10 focus-visible:outline focus-visible:outline-1"
597
+ [attr.aria-expanded]="i.abierto"
598
+ [attr.aria-label]="i.abierto ? 'Plegar' : 'Desplegar'"
599
+ (click)="alternar($event)"
600
+ (dblclick)="$event.stopPropagation()"
601
+ (keydown.enter)="$event.stopPropagation()"
602
+ (keydown.space)="$event.stopPropagation()">
603
+ <mat-icon class="!w-[14px] !h-[14px] transition-transform" [class.rotate-90]="i.abierto"
604
+ svgIcon="jvs_tabla:chevron" aria-hidden="true"></mat-icon>
605
+ </button>
606
+ } @else {
607
+ <span class="flex-none w-[14px] mr-[2px]" aria-hidden="true"></span>
608
+ }
609
+ }
610
+ <span class="min-w-0 flex-1"><ng-content></ng-content></span>
611
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
612
+ }
613
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: TablaArbolCeldaComponent, decorators: [{
614
+ type: Component,
615
+ args: [{
616
+ selector: 'jvs-tabla-arbol-celda',
617
+ standalone: true,
618
+ imports: [MatIconModule],
619
+ host: { class: 'flex items-start min-w-0' },
620
+ template: `
621
+ @if (info(); as i) {
622
+ <span class="flex-none" [style.width.px]="i.nivel * sangria()" aria-hidden="true"></span>
623
+ @if (i.tieneHijos) {
624
+ <button type="button"
625
+ class="flex-none inline-flex items-center justify-center w-[14px] h-[14px] mr-[2px] p-0 border-0 bg-transparent rounded-sm cursor-pointer text-inherit hover:bg-black/10 focus-visible:outline focus-visible:outline-1"
626
+ [attr.aria-expanded]="i.abierto"
627
+ [attr.aria-label]="i.abierto ? 'Plegar' : 'Desplegar'"
628
+ (click)="alternar($event)"
629
+ (dblclick)="$event.stopPropagation()"
630
+ (keydown.enter)="$event.stopPropagation()"
631
+ (keydown.space)="$event.stopPropagation()">
632
+ <mat-icon class="!w-[14px] !h-[14px] transition-transform" [class.rotate-90]="i.abierto"
633
+ svgIcon="jvs_tabla:chevron" aria-hidden="true"></mat-icon>
634
+ </button>
635
+ } @else {
636
+ <span class="flex-none w-[14px] mr-[2px]" aria-hidden="true"></span>
637
+ }
638
+ }
639
+ <span class="min-w-0 flex-1"><ng-content></ng-content></span>
640
+ `,
641
+ }]
642
+ }], propDecorators: { fila: [{ type: i0.Input, args: [{ isSignal: true, alias: "fila", required: true }] }] } });
643
+
216
644
  function tipoValorFuncion(datoParam, defaultValue, ...param) {
217
645
  if (datoParam === undefined || datoParam === null) {
218
646
  return defaultValue; // Retorna el valor por defecto si es undefined
@@ -223,83 +651,75 @@ function tipoValorFuncion(datoParam, defaultValue, ...param) {
223
651
  return datoParam;
224
652
  }
225
653
 
654
+ /** Campos donde las teclas son del usuario y no de la tabla. */
655
+ const CAMPOS_DE_ENTRADA = ['input', 'textarea', 'select'];
656
+ /**
657
+ * Navegación de filas con el teclado: flechas para moverse, Enter o Espacio para abrir.
658
+ *
659
+ * Se mueve por el DOM, de hermano en hermano, saltando las filas que no llevan id —las de
660
+ * detalle desplegable y el pie—. Antes guardaba una copia de los datos y una lista de todas
661
+ * las filas, que reconstruía consultando la tabla entera **por cada fila** cada vez que los
662
+ * datos cambiaban: con quinientas filas eso eran doscientas cincuenta mil consultas al DOM por
663
+ * recarga. Y esa copia se quedaba vieja en cuanto la tabla volvía a cargar, así que Enter
664
+ * acababa avisando sin registro.
665
+ */
226
666
  class MatRowKeyboardSelectionDirective {
227
667
  el;
228
- rows;
229
- renderedData;
230
- tabla; // Entrada: Referencia a la tabla
231
- rowModel; // Entrada: Modelo de fila actual
232
- seleccionarSiguiente = new EventEmitter(); // Salida: Evento al seleccionar siguiente
233
- unsubscriber$ = new Subject();
668
+ /** @deprecated Ya no se consulta; queda por el selector y se retirará en una versión mayor. */
669
+ tabla;
670
+ rowModel;
671
+ /** Enter sobre la fila: se avisa con su registro. */
672
+ seleccionarSiguiente = new EventEmitter();
673
+ /** Espacio sobre la fila: la tabla decide si marca la casilla o abre el registro. */
674
+ espacioEnFila = new EventEmitter();
675
+ /** Id del `<tr>` al que se movió el foco con las flechas, para que la tabla lo seleccione. */
676
+ filaEnfocada = new EventEmitter();
234
677
  constructor(el) {
235
678
  this.el = el;
236
679
  }
237
680
  ngOnInit() {
238
- // Asignar tabindex si no está definido
239
681
  if (this.el.nativeElement.tabIndex < 0) {
240
682
  this.el.nativeElement.tabIndex = 0;
241
683
  }
242
- // Obtener la fuente de datos de la tabla
243
- const dataSource = this.tabla.dataSource;
244
- // Suscribirse a los cambios en los datos
245
- dataSource.connect().pipe(takeUntil(this.unsubscriber$)).subscribe(data => {
246
- this.renderedData = data;
247
- this.rows = Array.from(this.getTableRows());
248
- });
249
- }
250
- ngOnDestroy() {
251
- // Finalizar la suscripción al destruir la directiva
252
- this.unsubscriber$.next(null);
253
- this.unsubscriber$.complete();
254
684
  }
255
685
  onKeydown(event) {
256
- var element = event.target;
257
- if (element.tagName === "INPUT") {
686
+ const origen = event.target;
687
+ const etiqueta = origen?.tagName?.toLowerCase() ?? '';
688
+ if (CAMPOS_DE_ENTRADA.includes(etiqueta) || origen?.isContentEditable) {
258
689
  event.stopPropagation();
690
+ return;
259
691
  }
260
- else {
261
- const currentIndex = this.renderedData.findIndex(row => row === this.rowModel);
262
- const eRef = event.target;
263
- this.rows = this.rows.filter(elem => elem.hasAttribute('id'));
264
- const arrayFilas = Array.from(this.rows);
265
- const fElem = arrayFilas.filter(elem => elem.id == eRef.id).pop();
266
- const cElemIdx = arrayFilas.findIndex(elem => elem == fElem);
267
- let newRow;
268
- // Controlar las teclas presionadas
269
- switch (event.key) {
270
- case 'ArrowDown':
271
- newRow = this.rows[cElemIdx + 1];
272
- break;
273
- case 'ArrowUp':
274
- newRow = this.rows[cElemIdx - 1];
275
- break;
276
- case 'Enter':
277
- case ' ':
278
- this.seleccionarSiguiente.next(this.renderedData[currentIndex]);
279
- event.preventDefault();
280
- break;
281
- }
282
- // Enfocar la nueva fila seleccionada
283
- if (newRow) {
284
- newRow.classList.add('estaFocus');
285
- newRow.focus();
286
- }
692
+ switch (event.key) {
693
+ case 'ArrowDown':
694
+ this.moverFoco('nextElementSibling');
695
+ break;
696
+ case 'ArrowUp':
697
+ this.moverFoco('previousElementSibling');
698
+ break;
699
+ case 'Enter':
700
+ this.seleccionarSiguiente.next(this.rowModel);
701
+ event.preventDefault();
702
+ break;
703
+ case ' ':
704
+ this.espacioEnFila.next(this.rowModel);
705
+ // Sin esto la página baja una pantalla, que es lo que hace el espacio por defecto.
706
+ event.preventDefault();
707
+ break;
287
708
  }
288
709
  }
289
- getTableRows() {
290
- let el = this.el.nativeElement;
291
- // Recorrer los elementos padres hasta encontrar la tabla
292
- while (el && el.parentNode) {
293
- el = el.parentNode;
294
- // Verificar si es una tabla de material
295
- if (el.tagName && el.tagName.toLowerCase() === 'mat-table' || el.hasAttribute('mat-table')) {
296
- return el.querySelectorAll('mat-row, tr[mat-row]');
710
+ moverFoco(direccion) {
711
+ let hermano = this.el.nativeElement[direccion];
712
+ while (hermano) {
713
+ if (hermano.matches('tr[mat-row][id], mat-row[id]')) {
714
+ hermano.focus();
715
+ this.filaEnfocada.emit(hermano.id);
716
+ return;
297
717
  }
718
+ hermano = hermano[direccion];
298
719
  }
299
- return undefined;
300
720
  }
301
721
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: MatRowKeyboardSelectionDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
302
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.18", type: MatRowKeyboardSelectionDirective, isStandalone: true, selector: "[matRowKeyboardSelection]", inputs: { tabla: ["matRowKeyboardSelection", "tabla"], rowModel: "rowModel" }, outputs: { seleccionarSiguiente: "seleccionarSiguiente" }, host: { listeners: { "keydown": "onKeydown($event)" } }, ngImport: i0 });
722
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.18", type: MatRowKeyboardSelectionDirective, isStandalone: true, selector: "[matRowKeyboardSelection]", inputs: { tabla: ["matRowKeyboardSelection", "tabla"], rowModel: "rowModel" }, outputs: { seleccionarSiguiente: "seleccionarSiguiente", espacioEnFila: "espacioEnFila", filaEnfocada: "filaEnfocada" }, host: { listeners: { "keydown": "onKeydown($event)" } }, ngImport: i0 });
303
723
  }
304
724
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: MatRowKeyboardSelectionDirective, decorators: [{
305
725
  type: Directive,
@@ -313,11 +733,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImpo
313
733
  type: Input
314
734
  }], seleccionarSiguiente: [{
315
735
  type: Output
736
+ }], espacioEnFila: [{
737
+ type: Output
738
+ }], filaEnfocada: [{
739
+ type: Output
316
740
  }], onKeydown: [{
317
741
  type: HostListener,
318
742
  args: ['keydown', ['$event']]
319
743
  }] } });
320
744
 
745
+ const CONFIG_CABECERAS_TABLA = new InjectionToken('CONFIG_CABECERAS_TABLA');
746
+ function crearConfigCabeceras() {
747
+ return { alinearConContenido: signal(false) };
748
+ }
749
+
321
750
  class ColumnTypeComponent {
322
751
  table;
323
752
  column;
@@ -335,6 +764,32 @@ class ColumnTypeComponent {
335
764
  this.table.addColumnDef(this.columnDef);
336
765
  }
337
766
  }
767
+ configCabeceras = inject(CONFIG_CABECERAS_TABLA, { optional: true });
768
+ /**
769
+ * Alineación de la cabecera, para `data-alineacion` en el `th`. Por defecto no hay (la
770
+ * cabecera va centrada, como siempre); la hay si la columna pide `alineacionCabecera` o si la
771
+ * tabla tiene `alinearCabecerasConContenido`, y entonces sigue a la de la celda.
772
+ */
773
+ get alineacionCabecera() {
774
+ if (this.column?.alineacionCabecera) {
775
+ return this.column.alineacionCabecera;
776
+ }
777
+ return this.configCabeceras?.alinearConContenido() ? alineacionCabecera(this.column) : null;
778
+ }
779
+ /**
780
+ * Clases de Tailwind de la cabecera según `alineacionCabecera` (vacío: centrada, como
781
+ * siempre). Con `!` porque la tabla centra las cabeceras con una regla más específica.
782
+ */
783
+ get claseCabecera() {
784
+ switch (this.alineacionCabecera) {
785
+ case 'izquierda':
786
+ return '!text-left [&_.mat-sort-header-content]:!text-left';
787
+ case 'derecha':
788
+ return '!text-right [&_.mat-sort-header-content]:!text-right';
789
+ default:
790
+ return '';
791
+ }
792
+ }
338
793
  accionClick(item, event) {
339
794
  if (this.column.click) {
340
795
  this.column.click(item);
@@ -343,11 +798,11 @@ class ColumnTypeComponent {
343
798
  return false;
344
799
  }
345
800
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ColumnTypeComponent, deps: [{ token: i2.MatTable, optional: true }], target: i0.ɵɵFactoryTarget.Component });
346
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.18", type: ColumnTypeComponent, isStandalone: false, selector: "jvs-column-type", inputs: { column: "column", columnTitleTemplate: "columnTitleTemplate", columnFooterTemplate: "columnFooterTemplate", cellTemplate: "cellTemplate" }, viewQueries: [{ propertyName: "columnDef", first: true, predicate: MatColumnDef, descendants: true, static: true }], ngImport: i0, template: "<ng-container matColumnDef=\"{{ column.property }}\">\n <!-- Definici\u00F3n del encabezado de la columna -->\n <th *matHeaderCellDef [ngClass]=\"column.cssClassesTH\" class=\"uppercase text-center\" mat-header-cell mat-sort-header\n [disabled]=\"column.sort === false\">\n @if (columnTitleTemplate) {\n <ng-container *ngTemplateOutlet=\"columnTitleTemplate; context: { column: column }\"></ng-container>\n } @else {\n <span [innerHTML]=\"column.label ?? ''\">{{ column.label }} </span>\n }\n </th>\n\n <!-- Cuerpo de la celda, definido por los hijos -->\n <td *matCellDef=\"let row\" [ngClass]=\"column.cssClasses\" mat-cell (click)=\"accionClick(row, $event)\">\n <ng-container *ngTemplateOutlet=\"cellTemplate; context: { row: row, column: column }\"></ng-container>\n </td>\n\n <th *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" mat-footer-cell>\n @if (columnFooterTemplate) {\n <ng-container *ngTemplateOutlet=\"columnFooterTemplate; context: { column: column }\"></ng-container>\n } @else {\n {{ column.transformarFooter ? column.transformarFooter() : '' }}\n }\n </th>\n</ng-container>\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i2.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i2.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i2.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i2.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i2.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i3.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }] });
801
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.18", type: ColumnTypeComponent, isStandalone: false, selector: "jvs-column-type", inputs: { column: "column", columnTitleTemplate: "columnTitleTemplate", columnFooterTemplate: "columnFooterTemplate", cellTemplate: "cellTemplate" }, viewQueries: [{ propertyName: "columnDef", first: true, predicate: MatColumnDef, descendants: true, static: true }], ngImport: i0, template: "<ng-container matColumnDef=\"{{ column.property }}\">\n <!-- Definici\u00F3n del encabezado de la columna -->\n <th *matHeaderCellDef [ngClass]=\"column.cssClassesTH\" class=\"uppercase\" [class]=\"claseCabecera\" [attr.data-alineacion]=\"alineacionCabecera\" [matTooltip]=\"column.labelTooltip ?? ''\" mat-header-cell mat-sort-header\n [disabled]=\"column.sort === false\">\n @if (columnTitleTemplate) {\n <ng-container *ngTemplateOutlet=\"columnTitleTemplate; context: { column: column }\"></ng-container>\n } @else {\n <span [innerHTML]=\"column.label ?? ''\">{{ column.label }} </span>\n }\n </th>\n\n <!-- Cuerpo de la celda, definido por los hijos -->\n <td *matCellDef=\"let row\" [ngClass]=\"column.cssClasses\" mat-cell (click)=\"accionClick(row, $event)\">\n <ng-container *ngTemplateOutlet=\"cellTemplate; context: { row: row, column: column }\"></ng-container>\n </td>\n\n <th *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" mat-footer-cell>\n @if (columnFooterTemplate) {\n <ng-container *ngTemplateOutlet=\"columnFooterTemplate; context: { column: column }\"></ng-container>\n } @else {\n {{ column.transformarFooter ? column.transformarFooter() : '' }}\n }\n </th>\n</ng-container>\n", dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i2.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i2.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i2.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i2.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i2.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i3.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }] });
347
802
  }
348
803
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ColumnTypeComponent, decorators: [{
349
804
  type: Component,
350
- args: [{ selector: 'jvs-column-type', standalone: false, template: "<ng-container matColumnDef=\"{{ column.property }}\">\n <!-- Definici\u00F3n del encabezado de la columna -->\n <th *matHeaderCellDef [ngClass]=\"column.cssClassesTH\" class=\"uppercase text-center\" mat-header-cell mat-sort-header\n [disabled]=\"column.sort === false\">\n @if (columnTitleTemplate) {\n <ng-container *ngTemplateOutlet=\"columnTitleTemplate; context: { column: column }\"></ng-container>\n } @else {\n <span [innerHTML]=\"column.label ?? ''\">{{ column.label }} </span>\n }\n </th>\n\n <!-- Cuerpo de la celda, definido por los hijos -->\n <td *matCellDef=\"let row\" [ngClass]=\"column.cssClasses\" mat-cell (click)=\"accionClick(row, $event)\">\n <ng-container *ngTemplateOutlet=\"cellTemplate; context: { row: row, column: column }\"></ng-container>\n </td>\n\n <th *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" mat-footer-cell>\n @if (columnFooterTemplate) {\n <ng-container *ngTemplateOutlet=\"columnFooterTemplate; context: { column: column }\"></ng-container>\n } @else {\n {{ column.transformarFooter ? column.transformarFooter() : '' }}\n }\n </th>\n</ng-container>\n" }]
805
+ args: [{ selector: 'jvs-column-type', standalone: false, template: "<ng-container matColumnDef=\"{{ column.property }}\">\n <!-- Definici\u00F3n del encabezado de la columna -->\n <th *matHeaderCellDef [ngClass]=\"column.cssClassesTH\" class=\"uppercase\" [class]=\"claseCabecera\" [attr.data-alineacion]=\"alineacionCabecera\" [matTooltip]=\"column.labelTooltip ?? ''\" mat-header-cell mat-sort-header\n [disabled]=\"column.sort === false\">\n @if (columnTitleTemplate) {\n <ng-container *ngTemplateOutlet=\"columnTitleTemplate; context: { column: column }\"></ng-container>\n } @else {\n <span [innerHTML]=\"column.label ?? ''\">{{ column.label }} </span>\n }\n </th>\n\n <!-- Cuerpo de la celda, definido por los hijos -->\n <td *matCellDef=\"let row\" [ngClass]=\"column.cssClasses\" mat-cell (click)=\"accionClick(row, $event)\">\n <ng-container *ngTemplateOutlet=\"cellTemplate; context: { row: row, column: column }\"></ng-container>\n </td>\n\n <th *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" mat-footer-cell>\n @if (columnFooterTemplate) {\n <ng-container *ngTemplateOutlet=\"columnFooterTemplate; context: { column: column }\"></ng-container>\n } @else {\n {{ column.transformarFooter ? column.transformarFooter() : '' }}\n }\n </th>\n</ng-container>\n" }]
351
806
  }], ctorParameters: () => [{ type: i2.MatTable, decorators: [{
352
807
  type: Optional
353
808
  }] }], propDecorators: { column: [{
@@ -367,11 +822,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImpo
367
822
  class ColumnTypeNumberComponent extends ColumnTypeComponent {
368
823
  column = {};
369
824
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ColumnTypeNumberComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
370
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.18", type: ColumnTypeNumberComponent, isStandalone: false, selector: "jvs-column-type-number", inputs: { column: "column" }, usesInheritance: true, ngImport: i0, template: "\n<ng-template #cellTemplate let-row=\"row\">\n @if (column.property) {\n <span class=\"!text-indigo-900 font-semibold\"\n [jvsPopover]=\"(column.popover?.template || column.popover?.content?.(row)) ?? null\"\n [context]=\"row\"\n [trigger]=\"column.popover?.trigger || 'hover'\"\n [position]=\"column.popover?.position || 'bottom'\"\n [customClass]=\"column.popover?.customClass || ''\">\n {{ row[column.property] | number: (column.format ? column.format : '1.0-2') }}\n </span>\n }\n</ng-template>\n\n<ng-container matColumnDef=\"{{ column.property }}\">\n <!-- Definici\u00F3n del encabezado de la columna -->\n <th *matHeaderCellDef [ngClass]=\"column.cssClassesTH\" class=\"uppercase text-center\" mat-header-cell mat-sort-header\n [disabled]=\"column.sort === false\">\n <span [innerHTML]=\"column.label\">{{ column.label }} </span>\n </th>\n\n <!-- Cuerpo de la celda, definido por los hijos -->\n <td *matCellDef=\"let row\" [ngClass]=\"column.cssClasses\" mat-cell (click)=\"accionClick(row, $event)\">\n\n <ng-container [ngTemplateOutlet]=\"cellTemplate\" [ngTemplateOutletContext]=\"{row}\"></ng-container>\n\n </td>\n\n <th *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" mat-footer-cell>\n {{ column.transformarFooter ? column.transformarFooter() : '' }}\n </th>\n</ng-container>\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i2.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i2.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i2.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i2.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i2.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i3.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "directive", type: i4.JvsPopoverDirective, selector: "[jvsPopover]", inputs: ["jvsPopover", "context", "trigger", "position", "customClass"] }, { kind: "pipe", type: i1.DecimalPipe, name: "number" }] });
825
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.18", type: ColumnTypeNumberComponent, isStandalone: false, selector: "jvs-column-type-number", inputs: { column: "column" }, usesInheritance: true, ngImport: i0, template: "\n<ng-template #cellTemplate let-row=\"row\">\n @if (column.property) {\n <span class=\"!text-indigo-900 font-semibold\"\n [jvsPopover]=\"(column.popover?.template || column.popover?.content?.(row)) ?? null\"\n [context]=\"row\"\n [trigger]=\"column.popover?.trigger || 'hover'\"\n [position]=\"column.popover?.position || 'bottom'\"\n [customClass]=\"column.popover?.customClass || ''\">\n {{ row[column.property] | number: (column.format ? column.format : '1.0-2') }}\n </span>\n }\n</ng-template>\n\n<ng-container matColumnDef=\"{{ column.property }}\">\n <!-- Definici\u00F3n del encabezado de la columna -->\n <th *matHeaderCellDef [ngClass]=\"column.cssClassesTH\" class=\"uppercase\" [class]=\"claseCabecera\" [attr.data-alineacion]=\"alineacionCabecera\" [matTooltip]=\"column.labelTooltip ?? ''\" mat-header-cell mat-sort-header\n [disabled]=\"column.sort === false\">\n <span [innerHTML]=\"column.label\">{{ column.label }} </span>\n </th>\n\n <!-- Cuerpo de la celda, definido por los hijos -->\n <td *matCellDef=\"let row\" [ngClass]=\"column.cssClasses\" mat-cell (click)=\"accionClick(row, $event)\">\n\n <ng-container [ngTemplateOutlet]=\"cellTemplate\" [ngTemplateOutletContext]=\"{row}\"></ng-container>\n\n </td>\n\n <th *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" mat-footer-cell>\n {{ column.transformarFooter ? column.transformarFooter() : '' }}\n </th>\n</ng-container>\n", dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i2.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i2.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i2.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i2.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i2.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i3.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: i6.JvsPopoverDirective, selector: "[jvsPopover]", inputs: ["jvsPopover", "context", "trigger", "position", "customClass"] }, { kind: "pipe", type: i1$1.DecimalPipe, name: "number" }] });
371
826
  }
372
827
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ColumnTypeNumberComponent, decorators: [{
373
828
  type: Component,
374
- args: [{ selector: 'jvs-column-type-number', standalone: false, template: "\n<ng-template #cellTemplate let-row=\"row\">\n @if (column.property) {\n <span class=\"!text-indigo-900 font-semibold\"\n [jvsPopover]=\"(column.popover?.template || column.popover?.content?.(row)) ?? null\"\n [context]=\"row\"\n [trigger]=\"column.popover?.trigger || 'hover'\"\n [position]=\"column.popover?.position || 'bottom'\"\n [customClass]=\"column.popover?.customClass || ''\">\n {{ row[column.property] | number: (column.format ? column.format : '1.0-2') }}\n </span>\n }\n</ng-template>\n\n<ng-container matColumnDef=\"{{ column.property }}\">\n <!-- Definici\u00F3n del encabezado de la columna -->\n <th *matHeaderCellDef [ngClass]=\"column.cssClassesTH\" class=\"uppercase text-center\" mat-header-cell mat-sort-header\n [disabled]=\"column.sort === false\">\n <span [innerHTML]=\"column.label\">{{ column.label }} </span>\n </th>\n\n <!-- Cuerpo de la celda, definido por los hijos -->\n <td *matCellDef=\"let row\" [ngClass]=\"column.cssClasses\" mat-cell (click)=\"accionClick(row, $event)\">\n\n <ng-container [ngTemplateOutlet]=\"cellTemplate\" [ngTemplateOutletContext]=\"{row}\"></ng-container>\n\n </td>\n\n <th *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" mat-footer-cell>\n {{ column.transformarFooter ? column.transformarFooter() : '' }}\n </th>\n</ng-container>\n" }]
829
+ args: [{ selector: 'jvs-column-type-number', standalone: false, template: "\n<ng-template #cellTemplate let-row=\"row\">\n @if (column.property) {\n <span class=\"!text-indigo-900 font-semibold\"\n [jvsPopover]=\"(column.popover?.template || column.popover?.content?.(row)) ?? null\"\n [context]=\"row\"\n [trigger]=\"column.popover?.trigger || 'hover'\"\n [position]=\"column.popover?.position || 'bottom'\"\n [customClass]=\"column.popover?.customClass || ''\">\n {{ row[column.property] | number: (column.format ? column.format : '1.0-2') }}\n </span>\n }\n</ng-template>\n\n<ng-container matColumnDef=\"{{ column.property }}\">\n <!-- Definici\u00F3n del encabezado de la columna -->\n <th *matHeaderCellDef [ngClass]=\"column.cssClassesTH\" class=\"uppercase\" [class]=\"claseCabecera\" [attr.data-alineacion]=\"alineacionCabecera\" [matTooltip]=\"column.labelTooltip ?? ''\" mat-header-cell mat-sort-header\n [disabled]=\"column.sort === false\">\n <span [innerHTML]=\"column.label\">{{ column.label }} </span>\n </th>\n\n <!-- Cuerpo de la celda, definido por los hijos -->\n <td *matCellDef=\"let row\" [ngClass]=\"column.cssClasses\" mat-cell (click)=\"accionClick(row, $event)\">\n\n <ng-container [ngTemplateOutlet]=\"cellTemplate\" [ngTemplateOutletContext]=\"{row}\"></ng-container>\n\n </td>\n\n <th *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" mat-footer-cell>\n {{ column.transformarFooter ? column.transformarFooter() : '' }}\n </th>\n</ng-container>\n" }]
375
830
  }], propDecorators: { column: [{
376
831
  type: Input,
377
832
  args: [{ required: true }]
@@ -380,11 +835,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImpo
380
835
  class ColumnTypeDateComponent extends ColumnTypeComponent {
381
836
  column = {};
382
837
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ColumnTypeDateComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
383
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.18", type: ColumnTypeDateComponent, isStandalone: false, selector: "jvs-column-type-date", inputs: { column: "column" }, usesInheritance: true, ngImport: i0, template: "<ng-template #cellTemplate let-row=\"row\">\n @if (column.property && row[column.property]) {\n <span [jvsPopover]=\"(column.popover?.template || column.popover?.content?.(row)) ?? null\"\n [context]=\"row\"\n [trigger]=\"column.popover?.trigger || 'hover'\"\n [position]=\"column.popover?.position || 'bottom'\"\n [customClass]=\"column.popover?.customClass || ''\"\n >\n {{ row[column.property] | date: (column.format ? column.format : 'dd/MM/yyyy') }}\n </span>\n }\n</ng-template>\n\n<ng-container matColumnDef=\"{{ column.property }}\">\n <!-- Definici\u00F3n del encabezado de la columna -->\n <th *matHeaderCellDef [ngClass]=\"column.cssClassesTH\" class=\"uppercase text-center\" mat-header-cell mat-sort-header\n [disabled]=\"column.sort === false\">\n <span [innerHTML]=\"column.label\">{{ column.label }} </span>\n </th>\n\n <!-- Cuerpo de la celda, definido por los hijos -->\n <td *matCellDef=\"let row\" [ngClass]=\"column.cssClasses\" mat-cell (click)=\"accionClick(row, $event)\">\n\n <ng-container [ngTemplateOutlet]=\"cellTemplate\" [ngTemplateOutletContext]=\"{row}\"></ng-container>\n\n </td>\n\n <th *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" mat-footer-cell>\n {{ column.transformarFooter ? column.transformarFooter() : '' }}\n </th>\n</ng-container>\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i2.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i2.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i2.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i2.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i2.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i3.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "directive", type: i4.JvsPopoverDirective, selector: "[jvsPopover]", inputs: ["jvsPopover", "context", "trigger", "position", "customClass"] }, { kind: "pipe", type: i1.DatePipe, name: "date" }] });
838
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.18", type: ColumnTypeDateComponent, isStandalone: false, selector: "jvs-column-type-date", inputs: { column: "column" }, usesInheritance: true, ngImport: i0, template: "<ng-template #cellTemplate let-row=\"row\">\n @if (column.property && row[column.property]) {\n <span [jvsPopover]=\"(column.popover?.template || column.popover?.content?.(row)) ?? null\"\n [context]=\"row\"\n [trigger]=\"column.popover?.trigger || 'hover'\"\n [position]=\"column.popover?.position || 'bottom'\"\n [customClass]=\"column.popover?.customClass || ''\"\n >\n {{ row[column.property] | date: (column.format ? column.format : 'dd/MM/yyyy') }}\n </span>\n }\n</ng-template>\n\n<ng-container matColumnDef=\"{{ column.property }}\">\n <!-- Definici\u00F3n del encabezado de la columna -->\n <th *matHeaderCellDef [ngClass]=\"column.cssClassesTH\" class=\"uppercase\" [class]=\"claseCabecera\" [attr.data-alineacion]=\"alineacionCabecera\" [matTooltip]=\"column.labelTooltip ?? ''\" mat-header-cell mat-sort-header\n [disabled]=\"column.sort === false\">\n <span [innerHTML]=\"column.label\">{{ column.label }} </span>\n </th>\n\n <!-- Cuerpo de la celda, definido por los hijos -->\n <td *matCellDef=\"let row\" [ngClass]=\"column.cssClasses\" mat-cell (click)=\"accionClick(row, $event)\">\n\n <ng-container [ngTemplateOutlet]=\"cellTemplate\" [ngTemplateOutletContext]=\"{row}\"></ng-container>\n\n </td>\n\n <th *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" mat-footer-cell>\n {{ column.transformarFooter ? column.transformarFooter() : '' }}\n </th>\n</ng-container>\n", dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i2.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i2.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i2.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i2.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i2.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i3.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: i6.JvsPopoverDirective, selector: "[jvsPopover]", inputs: ["jvsPopover", "context", "trigger", "position", "customClass"] }, { kind: "pipe", type: i1$1.DatePipe, name: "date" }] });
384
839
  }
385
840
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ColumnTypeDateComponent, decorators: [{
386
841
  type: Component,
387
- args: [{ selector: 'jvs-column-type-date', standalone: false, template: "<ng-template #cellTemplate let-row=\"row\">\n @if (column.property && row[column.property]) {\n <span [jvsPopover]=\"(column.popover?.template || column.popover?.content?.(row)) ?? null\"\n [context]=\"row\"\n [trigger]=\"column.popover?.trigger || 'hover'\"\n [position]=\"column.popover?.position || 'bottom'\"\n [customClass]=\"column.popover?.customClass || ''\"\n >\n {{ row[column.property] | date: (column.format ? column.format : 'dd/MM/yyyy') }}\n </span>\n }\n</ng-template>\n\n<ng-container matColumnDef=\"{{ column.property }}\">\n <!-- Definici\u00F3n del encabezado de la columna -->\n <th *matHeaderCellDef [ngClass]=\"column.cssClassesTH\" class=\"uppercase text-center\" mat-header-cell mat-sort-header\n [disabled]=\"column.sort === false\">\n <span [innerHTML]=\"column.label\">{{ column.label }} </span>\n </th>\n\n <!-- Cuerpo de la celda, definido por los hijos -->\n <td *matCellDef=\"let row\" [ngClass]=\"column.cssClasses\" mat-cell (click)=\"accionClick(row, $event)\">\n\n <ng-container [ngTemplateOutlet]=\"cellTemplate\" [ngTemplateOutletContext]=\"{row}\"></ng-container>\n\n </td>\n\n <th *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" mat-footer-cell>\n {{ column.transformarFooter ? column.transformarFooter() : '' }}\n </th>\n</ng-container>\n" }]
842
+ args: [{ selector: 'jvs-column-type-date', standalone: false, template: "<ng-template #cellTemplate let-row=\"row\">\n @if (column.property && row[column.property]) {\n <span [jvsPopover]=\"(column.popover?.template || column.popover?.content?.(row)) ?? null\"\n [context]=\"row\"\n [trigger]=\"column.popover?.trigger || 'hover'\"\n [position]=\"column.popover?.position || 'bottom'\"\n [customClass]=\"column.popover?.customClass || ''\"\n >\n {{ row[column.property] | date: (column.format ? column.format : 'dd/MM/yyyy') }}\n </span>\n }\n</ng-template>\n\n<ng-container matColumnDef=\"{{ column.property }}\">\n <!-- Definici\u00F3n del encabezado de la columna -->\n <th *matHeaderCellDef [ngClass]=\"column.cssClassesTH\" class=\"uppercase\" [class]=\"claseCabecera\" [attr.data-alineacion]=\"alineacionCabecera\" [matTooltip]=\"column.labelTooltip ?? ''\" mat-header-cell mat-sort-header\n [disabled]=\"column.sort === false\">\n <span [innerHTML]=\"column.label\">{{ column.label }} </span>\n </th>\n\n <!-- Cuerpo de la celda, definido por los hijos -->\n <td *matCellDef=\"let row\" [ngClass]=\"column.cssClasses\" mat-cell (click)=\"accionClick(row, $event)\">\n\n <ng-container [ngTemplateOutlet]=\"cellTemplate\" [ngTemplateOutletContext]=\"{row}\"></ng-container>\n\n </td>\n\n <th *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" mat-footer-cell>\n {{ column.transformarFooter ? column.transformarFooter() : '' }}\n </th>\n</ng-container>\n" }]
388
843
  }], propDecorators: { column: [{
389
844
  type: Input,
390
845
  args: [{ required: true }]
@@ -411,18 +866,17 @@ class ColumnTypeSinoComponent extends ColumnTypeComponent {
411
866
  // iconRegistry.addSvgIconLiteral('noIcon', sanitizer.bypassSecurityTrustHtml(NO_ICON));
412
867
  }
413
868
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ColumnTypeSinoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
414
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.18", type: ColumnTypeSinoComponent, isStandalone: false, selector: "jvs-column-type-sino", inputs: { column: "column" }, usesInheritance: true, ngImport: i0, template: "<ng-template #cellTemplate let-row=\"row\">\n <div class=\"flex items-center justify-center\"\n [jvsPopover]=\"(column.popover?.template || column.popover?.content?.(row)) ?? null\"\n [context]=\"row\"\n [trigger]=\"column.popover?.trigger || 'hover'\"\n [position]=\"column.popover?.position || 'bottom'\"\n [customClass]=\"column.popover?.customClass || ''\">\n @if ([column.yesValue, 1, true].includes(row[column.property])) {\n <mat-icon\n [svgIcon]=\"column.yesIcon ?? 'yes_no:yes'\" class=\"icon-sm\"\n [matTooltip]=\"column.yesTooltip ?? undefined\"\n ></mat-icon>\n }\n @if ([column.noValue, 0, false].includes(row[column.property])) {\n <mat-icon [svgIcon]=\"column.noIcon ?? 'yes_no:no'\"\n class=\"icon-sm\"\n [matTooltip]=\"column.noTooltip ?? undefined\"\n ></mat-icon>\n }\n <span class=\"cdk-visually-hidden\">{{ row[column.property] }}</span>\n </div>\n</ng-template>\n\n<ng-container matColumnDef=\"{{ column.property }}\">\n <!-- Definici\u00F3n del encabezado de la columna -->\n <th *matHeaderCellDef [ngClass]=\"column.cssClassesTH\" class=\"uppercase text-center\" mat-header-cell mat-sort-header\n [disabled]=\"column.sort === false\">\n <span [innerHTML]=\"column.label\">{{ column.label }} </span>\n </th>\n\n <!-- Cuerpo de la celda, definido por los hijos -->\n <td *matCellDef=\"let row\" [ngClass]=\"column.cssClasses\" mat-cell (click)=\"accionClick(row, $event)\">\n\n <ng-container [ngTemplateOutlet]=\"cellTemplate\" [ngTemplateOutletContext]=\"{row}\"></ng-container>\n\n </td>\n\n <th *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" mat-footer-cell>\n {{ column.transformarFooter ? column.transformarFooter() : '' }}\n </th>\n</ng-container>\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i2.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i2.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i2.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i2.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i2.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i3.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i4.JvsPopoverDirective, selector: "[jvsPopover]", inputs: ["jvsPopover", "context", "trigger", "position", "customClass"] }] });
869
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.18", type: ColumnTypeSinoComponent, isStandalone: false, selector: "jvs-column-type-sino", inputs: { column: "column" }, usesInheritance: true, ngImport: i0, template: "<ng-template #cellTemplate let-row=\"row\">\n <div class=\"flex items-center justify-center\"\n [class.leading-none]=\"column.compacto !== false\"\n [jvsPopover]=\"(column.popover?.template || column.popover?.content?.(row)) ?? null\"\n [context]=\"row\"\n [trigger]=\"column.popover?.trigger || 'hover'\"\n [position]=\"column.popover?.position || 'bottom'\"\n [customClass]=\"column.popover?.customClass || ''\">\n @if ([column.yesValue, 1, true].includes(row[column.property])) {\n <mat-icon\n [svgIcon]=\"column.yesIcon ?? 'yes_no:yes'\" [ngClass]=\"column.compacto === false ? 'icon-sm' : '!w-3 !h-3 !text-[12px] !leading-[12px]'\"\n [matTooltip]=\"column.yesTooltip ?? undefined\"\n ></mat-icon>\n }\n @if ([column.noValue, 0, false].includes(row[column.property])) {\n <mat-icon [svgIcon]=\"column.noIcon ?? 'yes_no:no'\"\n [ngClass]=\"column.compacto === false ? 'icon-sm' : '!w-3 !h-3 !text-[12px] !leading-[12px]'\"\n [matTooltip]=\"column.noTooltip ?? undefined\"\n ></mat-icon>\n }\n <span class=\"cdk-visually-hidden\">{{ row[column.property] }}</span>\n </div>\n</ng-template>\n\n<ng-container matColumnDef=\"{{ column.property }}\">\n <!-- Definici\u00F3n del encabezado de la columna -->\n <th *matHeaderCellDef [ngClass]=\"column.cssClassesTH\" class=\"uppercase\" [class]=\"claseCabecera\" [attr.data-alineacion]=\"alineacionCabecera\" [matTooltip]=\"column.labelTooltip ?? ''\" mat-header-cell mat-sort-header\n [disabled]=\"column.sort === false\">\n <span [innerHTML]=\"column.label\">{{ column.label }} </span>\n </th>\n\n <!-- Cuerpo de la celda, definido por los hijos -->\n <td *matCellDef=\"let row\" [ngClass]=\"column.cssClasses\" mat-cell (click)=\"accionClick(row, $event)\">\n\n <ng-container [ngTemplateOutlet]=\"cellTemplate\" [ngTemplateOutletContext]=\"{row}\"></ng-container>\n\n </td>\n\n <th *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" mat-footer-cell>\n {{ column.transformarFooter ? column.transformarFooter() : '' }}\n </th>\n</ng-container>\n", dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i2.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i2.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i2.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i2.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i2.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i3.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i6.JvsPopoverDirective, selector: "[jvsPopover]", inputs: ["jvsPopover", "context", "trigger", "position", "customClass"] }] });
415
870
  }
416
871
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ColumnTypeSinoComponent, decorators: [{
417
872
  type: Component,
418
- args: [{ selector: 'jvs-column-type-sino', standalone: false, template: "<ng-template #cellTemplate let-row=\"row\">\n <div class=\"flex items-center justify-center\"\n [jvsPopover]=\"(column.popover?.template || column.popover?.content?.(row)) ?? null\"\n [context]=\"row\"\n [trigger]=\"column.popover?.trigger || 'hover'\"\n [position]=\"column.popover?.position || 'bottom'\"\n [customClass]=\"column.popover?.customClass || ''\">\n @if ([column.yesValue, 1, true].includes(row[column.property])) {\n <mat-icon\n [svgIcon]=\"column.yesIcon ?? 'yes_no:yes'\" class=\"icon-sm\"\n [matTooltip]=\"column.yesTooltip ?? undefined\"\n ></mat-icon>\n }\n @if ([column.noValue, 0, false].includes(row[column.property])) {\n <mat-icon [svgIcon]=\"column.noIcon ?? 'yes_no:no'\"\n class=\"icon-sm\"\n [matTooltip]=\"column.noTooltip ?? undefined\"\n ></mat-icon>\n }\n <span class=\"cdk-visually-hidden\">{{ row[column.property] }}</span>\n </div>\n</ng-template>\n\n<ng-container matColumnDef=\"{{ column.property }}\">\n <!-- Definici\u00F3n del encabezado de la columna -->\n <th *matHeaderCellDef [ngClass]=\"column.cssClassesTH\" class=\"uppercase text-center\" mat-header-cell mat-sort-header\n [disabled]=\"column.sort === false\">\n <span [innerHTML]=\"column.label\">{{ column.label }} </span>\n </th>\n\n <!-- Cuerpo de la celda, definido por los hijos -->\n <td *matCellDef=\"let row\" [ngClass]=\"column.cssClasses\" mat-cell (click)=\"accionClick(row, $event)\">\n\n <ng-container [ngTemplateOutlet]=\"cellTemplate\" [ngTemplateOutletContext]=\"{row}\"></ng-container>\n\n </td>\n\n <th *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" mat-footer-cell>\n {{ column.transformarFooter ? column.transformarFooter() : '' }}\n </th>\n</ng-container>\n" }]
873
+ args: [{ selector: 'jvs-column-type-sino', standalone: false, template: "<ng-template #cellTemplate let-row=\"row\">\n <div class=\"flex items-center justify-center\"\n [class.leading-none]=\"column.compacto !== false\"\n [jvsPopover]=\"(column.popover?.template || column.popover?.content?.(row)) ?? null\"\n [context]=\"row\"\n [trigger]=\"column.popover?.trigger || 'hover'\"\n [position]=\"column.popover?.position || 'bottom'\"\n [customClass]=\"column.popover?.customClass || ''\">\n @if ([column.yesValue, 1, true].includes(row[column.property])) {\n <mat-icon\n [svgIcon]=\"column.yesIcon ?? 'yes_no:yes'\" [ngClass]=\"column.compacto === false ? 'icon-sm' : '!w-3 !h-3 !text-[12px] !leading-[12px]'\"\n [matTooltip]=\"column.yesTooltip ?? undefined\"\n ></mat-icon>\n }\n @if ([column.noValue, 0, false].includes(row[column.property])) {\n <mat-icon [svgIcon]=\"column.noIcon ?? 'yes_no:no'\"\n [ngClass]=\"column.compacto === false ? 'icon-sm' : '!w-3 !h-3 !text-[12px] !leading-[12px]'\"\n [matTooltip]=\"column.noTooltip ?? undefined\"\n ></mat-icon>\n }\n <span class=\"cdk-visually-hidden\">{{ row[column.property] }}</span>\n </div>\n</ng-template>\n\n<ng-container matColumnDef=\"{{ column.property }}\">\n <!-- Definici\u00F3n del encabezado de la columna -->\n <th *matHeaderCellDef [ngClass]=\"column.cssClassesTH\" class=\"uppercase\" [class]=\"claseCabecera\" [attr.data-alineacion]=\"alineacionCabecera\" [matTooltip]=\"column.labelTooltip ?? ''\" mat-header-cell mat-sort-header\n [disabled]=\"column.sort === false\">\n <span [innerHTML]=\"column.label\">{{ column.label }} </span>\n </th>\n\n <!-- Cuerpo de la celda, definido por los hijos -->\n <td *matCellDef=\"let row\" [ngClass]=\"column.cssClasses\" mat-cell (click)=\"accionClick(row, $event)\">\n\n <ng-container [ngTemplateOutlet]=\"cellTemplate\" [ngTemplateOutletContext]=\"{row}\"></ng-container>\n\n </td>\n\n <th *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" mat-footer-cell>\n {{ column.transformarFooter ? column.transformarFooter() : '' }}\n </th>\n</ng-container>\n" }]
419
874
  }], ctorParameters: () => [], propDecorators: { column: [{
420
875
  type: Input,
421
876
  args: [{ required: true }]
422
877
  }] } });
423
878
 
424
879
  class ProgressBarComponent {
425
- objThis;
426
880
  porcentaje = 0;
427
881
  textoCentrado = false;
428
882
  _textoMostrar = '';
@@ -475,7 +929,7 @@ class ProgressBarComponent {
475
929
  return objData.sort((a, b) => (a[propiedad] > b[propiedad]) ? 1 : ((b[propiedad] > a[propiedad]) ? -1 : 0));
476
930
  }
477
931
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ProgressBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
478
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.18", type: ProgressBarComponent, isStandalone: true, selector: "jvs-progress-bar", inputs: { objThis: "objThis", porcentaje: "porcentaje", textoCentrado: "textoCentrado", textoMostrar: "textoMostrar", formatoNumero: "formatoNumero", coloresValor: "coloresValor" }, host: { classAttribute: "jvs-progress-bar" }, ngImport: i0, template: "<div class=\"w-full bg-gray-200 text-gray-700 rounded-full\" [class.text-center]=\"textoCentrado\">\n <div class=\"text-xxs font-medium text-center p-1 leading-none rounded-full\"\n [ngClass]=\"colorEstilo().class ? colorEstilo().class : 'bg-blue-600 text-blue-100'\"\n [style]=\"colorEstilo().style ? colorEstilo().style : ''\"\n [style.width]=\"(textoCentrado ? 100 : porcentaje) + '%'\"\n >\n @if (textoMostrar) {\n <span class=\"whitespace-nowrap\">{{ textoMostrar }}</span>\n } @else {\n {{ porcentaje | number: formatoNumero }}%\n }\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: i1.DecimalPipe, name: "number" }] });
932
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.18", type: ProgressBarComponent, isStandalone: true, selector: "jvs-progress-bar", inputs: { porcentaje: "porcentaje", textoCentrado: "textoCentrado", textoMostrar: "textoMostrar", formatoNumero: "formatoNumero", coloresValor: "coloresValor" }, host: { classAttribute: "jvs-progress-bar" }, ngImport: i0, template: "<div class=\"w-full bg-gray-200 text-gray-700 rounded-full\" [class.text-center]=\"textoCentrado\">\n <div class=\"text-xxs font-medium text-center p-1 leading-none rounded-full\"\n [ngClass]=\"colorEstilo().class ? colorEstilo().class : 'bg-blue-600 text-blue-100'\"\n [style]=\"colorEstilo().style ? colorEstilo().style : ''\"\n [style.width]=\"(textoCentrado ? 100 : porcentaje) + '%'\"\n >\n @if (textoMostrar) {\n <span class=\"whitespace-nowrap\">{{ textoMostrar }}</span>\n } @else {\n {{ porcentaje | number: formatoNumero }}%\n }\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: i1$1.DecimalPipe, name: "number" }] });
479
933
  }
480
934
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ProgressBarComponent, decorators: [{
481
935
  type: Component,
@@ -485,9 +939,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImpo
485
939
  ], host: {
486
940
  class: 'jvs-progress-bar',
487
941
  }, template: "<div class=\"w-full bg-gray-200 text-gray-700 rounded-full\" [class.text-center]=\"textoCentrado\">\n <div class=\"text-xxs font-medium text-center p-1 leading-none rounded-full\"\n [ngClass]=\"colorEstilo().class ? colorEstilo().class : 'bg-blue-600 text-blue-100'\"\n [style]=\"colorEstilo().style ? colorEstilo().style : ''\"\n [style.width]=\"(textoCentrado ? 100 : porcentaje) + '%'\"\n >\n @if (textoMostrar) {\n <span class=\"whitespace-nowrap\">{{ textoMostrar }}</span>\n } @else {\n {{ porcentaje | number: formatoNumero }}%\n }\n </div>\n</div>\n" }]
488
- }], ctorParameters: () => [], propDecorators: { objThis: [{
489
- type: Input
490
- }], porcentaje: [{
942
+ }], ctorParameters: () => [], propDecorators: { porcentaje: [{
491
943
  type: Input
492
944
  }], textoCentrado: [{
493
945
  type: Input
@@ -502,11 +954,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImpo
502
954
  class ColumnTypeProgressbarComponent extends ColumnTypeComponent {
503
955
  column = {};
504
956
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ColumnTypeProgressbarComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
505
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.18", type: ColumnTypeProgressbarComponent, isStandalone: false, selector: "jvs-column-type-progressbar", inputs: { column: "column" }, usesInheritance: true, ngImport: i0, template: "<ng-template #cellTemplate let-row=\"row\">\n <jvs-progress-bar\n [textoCentrado]=\"!!column.progressbar.textoCentrado\"\n [porcentaje]=\"column.progressbar.porcentaje(row)\"\n [coloresValor]=\"column.progressbar.coloresValor\"\n [formatoNumero]=\"column.progressbar.formatoNumero\"\n [textoMostrar]=\"column.progressbar.textoMostrar ? column.progressbar.textoMostrar(row) : ''\"\n [jvsPopover]=\"(column.popover?.template || column.popover?.content?.(row)) ?? null\"\n [context]=\"row\"\n [trigger]=\"column.popover?.trigger || 'hover'\"\n [position]=\"column.popover?.position || 'bottom'\"\n [customClass]=\"column.popover?.customClass || ''\"\n ></jvs-progress-bar>\n</ng-template>\n\n<ng-container matColumnDef=\"{{ column.property }}\">\n <!-- Definici\u00F3n del encabezado de la columna -->\n <th *matHeaderCellDef [ngClass]=\"column.cssClassesTH\" class=\"uppercase text-center\" mat-header-cell mat-sort-header\n [disabled]=\"column.sort === false\">\n <span [innerHTML]=\"column.label\">{{ column.label }} </span>\n </th>\n\n <!-- Cuerpo de la celda, definido por los hijos -->\n <td *matCellDef=\"let row\" [ngClass]=\"column.cssClasses\" mat-cell (click)=\"accionClick(row, $event)\">\n\n <ng-container [ngTemplateOutlet]=\"cellTemplate\" [ngTemplateOutletContext]=\"{row}\"></ng-container>\n\n </td>\n\n <th *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" mat-footer-cell>\n {{ column.transformarFooter ? column.transformarFooter() : '' }}\n </th>\n</ng-container>\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i2.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i2.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i2.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i2.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i2.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i3.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "component", type: ProgressBarComponent, selector: "jvs-progress-bar", inputs: ["objThis", "porcentaje", "textoCentrado", "textoMostrar", "formatoNumero", "coloresValor"] }, { kind: "directive", type: i4.JvsPopoverDirective, selector: "[jvsPopover]", inputs: ["jvsPopover", "context", "trigger", "position", "customClass"] }] });
957
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.18", type: ColumnTypeProgressbarComponent, isStandalone: false, selector: "jvs-column-type-progressbar", inputs: { column: "column" }, usesInheritance: true, ngImport: i0, template: "<ng-template #cellTemplate let-row=\"row\">\n <jvs-progress-bar\n [textoCentrado]=\"!!column.progressbar.textoCentrado\"\n [porcentaje]=\"column.progressbar.porcentaje(row)\"\n [coloresValor]=\"column.progressbar.coloresValor\"\n [formatoNumero]=\"column.progressbar.formatoNumero\"\n [textoMostrar]=\"column.progressbar.textoMostrar ? column.progressbar.textoMostrar(row) : ''\"\n [jvsPopover]=\"(column.popover?.template || column.popover?.content?.(row)) ?? null\"\n [context]=\"row\"\n [trigger]=\"column.popover?.trigger || 'hover'\"\n [position]=\"column.popover?.position || 'bottom'\"\n [customClass]=\"column.popover?.customClass || ''\"\n ></jvs-progress-bar>\n</ng-template>\n\n<ng-container matColumnDef=\"{{ column.property }}\">\n <!-- Definici\u00F3n del encabezado de la columna -->\n <th *matHeaderCellDef [ngClass]=\"column.cssClassesTH\" class=\"uppercase\" [class]=\"claseCabecera\" [attr.data-alineacion]=\"alineacionCabecera\" [matTooltip]=\"column.labelTooltip ?? ''\" mat-header-cell mat-sort-header\n [disabled]=\"column.sort === false\">\n <span [innerHTML]=\"column.label\">{{ column.label }} </span>\n </th>\n\n <!-- Cuerpo de la celda, definido por los hijos -->\n <td *matCellDef=\"let row\" [ngClass]=\"column.cssClasses\" mat-cell (click)=\"accionClick(row, $event)\">\n\n <ng-container [ngTemplateOutlet]=\"cellTemplate\" [ngTemplateOutletContext]=\"{row}\"></ng-container>\n\n </td>\n\n <th *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" mat-footer-cell>\n {{ column.transformarFooter ? column.transformarFooter() : '' }}\n </th>\n</ng-container>\n", dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i2.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i2.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i2.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i2.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i2.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i3.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: ProgressBarComponent, selector: "jvs-progress-bar", inputs: ["porcentaje", "textoCentrado", "textoMostrar", "formatoNumero", "coloresValor"] }, { kind: "directive", type: i6.JvsPopoverDirective, selector: "[jvsPopover]", inputs: ["jvsPopover", "context", "trigger", "position", "customClass"] }] });
506
958
  }
507
959
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ColumnTypeProgressbarComponent, decorators: [{
508
960
  type: Component,
509
- args: [{ selector: 'jvs-column-type-progressbar', standalone: false, template: "<ng-template #cellTemplate let-row=\"row\">\n <jvs-progress-bar\n [textoCentrado]=\"!!column.progressbar.textoCentrado\"\n [porcentaje]=\"column.progressbar.porcentaje(row)\"\n [coloresValor]=\"column.progressbar.coloresValor\"\n [formatoNumero]=\"column.progressbar.formatoNumero\"\n [textoMostrar]=\"column.progressbar.textoMostrar ? column.progressbar.textoMostrar(row) : ''\"\n [jvsPopover]=\"(column.popover?.template || column.popover?.content?.(row)) ?? null\"\n [context]=\"row\"\n [trigger]=\"column.popover?.trigger || 'hover'\"\n [position]=\"column.popover?.position || 'bottom'\"\n [customClass]=\"column.popover?.customClass || ''\"\n ></jvs-progress-bar>\n</ng-template>\n\n<ng-container matColumnDef=\"{{ column.property }}\">\n <!-- Definici\u00F3n del encabezado de la columna -->\n <th *matHeaderCellDef [ngClass]=\"column.cssClassesTH\" class=\"uppercase text-center\" mat-header-cell mat-sort-header\n [disabled]=\"column.sort === false\">\n <span [innerHTML]=\"column.label\">{{ column.label }} </span>\n </th>\n\n <!-- Cuerpo de la celda, definido por los hijos -->\n <td *matCellDef=\"let row\" [ngClass]=\"column.cssClasses\" mat-cell (click)=\"accionClick(row, $event)\">\n\n <ng-container [ngTemplateOutlet]=\"cellTemplate\" [ngTemplateOutletContext]=\"{row}\"></ng-container>\n\n </td>\n\n <th *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" mat-footer-cell>\n {{ column.transformarFooter ? column.transformarFooter() : '' }}\n </th>\n</ng-container>\n" }]
961
+ args: [{ selector: 'jvs-column-type-progressbar', standalone: false, template: "<ng-template #cellTemplate let-row=\"row\">\n <jvs-progress-bar\n [textoCentrado]=\"!!column.progressbar.textoCentrado\"\n [porcentaje]=\"column.progressbar.porcentaje(row)\"\n [coloresValor]=\"column.progressbar.coloresValor\"\n [formatoNumero]=\"column.progressbar.formatoNumero\"\n [textoMostrar]=\"column.progressbar.textoMostrar ? column.progressbar.textoMostrar(row) : ''\"\n [jvsPopover]=\"(column.popover?.template || column.popover?.content?.(row)) ?? null\"\n [context]=\"row\"\n [trigger]=\"column.popover?.trigger || 'hover'\"\n [position]=\"column.popover?.position || 'bottom'\"\n [customClass]=\"column.popover?.customClass || ''\"\n ></jvs-progress-bar>\n</ng-template>\n\n<ng-container matColumnDef=\"{{ column.property }}\">\n <!-- Definici\u00F3n del encabezado de la columna -->\n <th *matHeaderCellDef [ngClass]=\"column.cssClassesTH\" class=\"uppercase\" [class]=\"claseCabecera\" [attr.data-alineacion]=\"alineacionCabecera\" [matTooltip]=\"column.labelTooltip ?? ''\" mat-header-cell mat-sort-header\n [disabled]=\"column.sort === false\">\n <span [innerHTML]=\"column.label\">{{ column.label }} </span>\n </th>\n\n <!-- Cuerpo de la celda, definido por los hijos -->\n <td *matCellDef=\"let row\" [ngClass]=\"column.cssClasses\" mat-cell (click)=\"accionClick(row, $event)\">\n\n <ng-container [ngTemplateOutlet]=\"cellTemplate\" [ngTemplateOutletContext]=\"{row}\"></ng-container>\n\n </td>\n\n <th *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" mat-footer-cell>\n {{ column.transformarFooter ? column.transformarFooter() : '' }}\n </th>\n</ng-container>\n" }]
510
962
  }], propDecorators: { column: [{
511
963
  type: Input,
512
964
  args: [{ required: true }]
@@ -520,7 +972,7 @@ class NoSanitizePipe {
520
972
  transform(html) {
521
973
  return this.domSanitizer.bypassSecurityTrustHtml(html);
522
974
  }
523
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: NoSanitizePipe, deps: [{ token: i1$1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
975
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: NoSanitizePipe, deps: [{ token: i1$2.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
524
976
  static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.18", ngImport: i0, type: NoSanitizePipe, isStandalone: true, name: "noSanitize" });
525
977
  }
526
978
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: NoSanitizePipe, decorators: [{
@@ -529,7 +981,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImpo
529
981
  name: 'noSanitize',
530
982
  standalone: true
531
983
  }]
532
- }], ctorParameters: () => [{ type: i1$1.DomSanitizer }] });
984
+ }], ctorParameters: () => [{ type: i1$2.DomSanitizer }] });
533
985
 
534
986
  class ZeroFillPipe {
535
987
  transform(value, digitos, ...args) {
@@ -555,14 +1007,421 @@ function zeroFill(value, digitos, ...args) {
555
1007
 
556
1008
  // export * from './progress-spinner.service';
557
1009
 
1010
+ /**
1011
+ * Celdas declarativas (`celda` en las columnas `text` y `arbol`): la pantalla dice qué piezas lleva
1012
+ * la celda y la librería las pinta con sus tamaños y tonos (`<jvs-tabla-celda>`). Los ayudantes
1013
+ * para armarlas (`texto`, `nota`, `badge`, `marca`, `icono`, `imagen`, `salto`) están en
1014
+ * `tabla-celda/piezas.ts`.
1015
+ */
1016
+ /** Tonos con su uso, en orden, para documentarlos (README, Storybook) o recorrerlos. */
1017
+ const TONOS = [
1018
+ { tono: 'neutro', uso: 'Clasificación sin juicio ("Otros módulos", "Oculto en trámite")' },
1019
+ { tono: 'exito', uso: 'Estado correcto o completo ("Activo", "Firmado")' },
1020
+ { tono: 'aviso', uso: 'Requiere atención, no bloquea ("Sigla repetida", "Sin firmante")' },
1021
+ { tono: 'error', uso: 'Estado negativo o bloqueante ("Inactivo", "Sin padre", "Anulado")' },
1022
+ { tono: 'info', uso: 'Dato informativo destacado ("Planilla", "Externo")' },
1023
+ { tono: 'primario', uso: 'Marca de la entidad o categoría principal (marcas E/I/S, ícono de tipo)' },
1024
+ ];
1025
+
1026
+ /**
1027
+ * Agrega a `fn` un atajo por tono (`fn.exito(…)` = `fn(…, {…opciones, tono: 'exito'})`). Las opciones
1028
+ * son el parámetro `posicion` de `fn` (1 en `texto`, `badge` e `icono`; 2 en `marca` y `marcaIcono`).
1029
+ */
1030
+ function conTonos(fn, posicion) {
1031
+ // Cada atajo reenvía los mismos argumentos que `fn`, así que tiene su misma firma.
1032
+ const atajos = Object.fromEntries(TONOS.map(({ tono }) => [tono, (...a) => fn(...a.slice(0, posicion), { ...a[posicion], tono })]));
1033
+ return Object.assign(fn, atajos);
1034
+ }
1035
+ /** Texto principal; con `negrita` o `tono`. Un texto suelto (`'Sí'`) equivale a `texto('Sí')`. */
1036
+ const texto = conTonos((t, o) => ({ tipo: 'texto', texto: t == null ? '' : String(t), ...o }), 1);
1037
+ /**
1038
+ * Nota gris; después de otra pieza va precedida de "·" ("ACTA · AC"), sola es solo texto gris
1039
+ * ("Sin usuarios"). Sin texto devuelve `false`, para escribir `nota(row.cCorto)` sin `@if`. No lleva tono.
1040
+ */
1041
+ const nota = (t, o) => t != null && String(t).trim() !== '' && { tipo: 'nota', texto: String(t), ...o };
1042
+ /**
1043
+ * Badge de estado ("Inactivo", "Oculto"…). Neutro si no se dice el tono; con `icono`, un ícono de
1044
+ * 10 px delante del texto (`badge.exito('Firmado', {icono: 'roundCheck'})`).
1045
+ */
1046
+ const badge = conTonos((t, o) => ({ tipo: 'badge', texto: t, ...o }), 1);
1047
+ /** Marca corta (abreviatura) con su significado en el tooltip. Primaria si no se dice el tono. */
1048
+ const marca = conTonos((t, tooltip, o) => ({ tipo: 'marca', texto: t, tooltip, ...o }), 2);
1049
+ /** Marca con un ícono en lugar de abreviatura. Primaria si no se dice el tono. */
1050
+ const marcaIcono = conTonos((icono, tooltip, o) => ({ tipo: 'marca', icono, tooltip, ...o }), 2);
1051
+ /**
1052
+ * Ícono de 12 px (14 px con `tamano: 'grande'`), del color del texto si no se dice el tono; con
1053
+ * `click`, es un botón que no selecciona la fila.
1054
+ */
1055
+ const icono = conTonos((nombre, o) => ({ tipo: 'icono', icono: nombre, ...o }), 1);
1056
+ /** Imagen de 20 px (avatar), redonda salvo `redonda: false`. */
1057
+ const imagen = (src, alt, o) => ({ tipo: 'imagen', src, alt, redonda: true, ...o });
1058
+ /** Cierra la línea: lo que sigue va debajo. */
1059
+ const salto = { tipo: 'salto' };
1060
+ /** Si un elemento es una pieza (y no texto suelto). */
1061
+ function esPieza(elemento) {
1062
+ return typeof elemento === 'object' && elemento !== null && 'tipo' in elemento;
1063
+ }
1064
+ /**
1065
+ * Lista plana de piezas: los textos y números sueltos pasan a `texto`, y se descartan `false`,
1066
+ * `null`, `undefined` y los textos vacíos.
1067
+ */
1068
+ function normalizarCelda(celda) {
1069
+ const lista = Array.isArray(celda) ? celda : [celda];
1070
+ const piezas = [];
1071
+ for (const elemento of lista) {
1072
+ if (elemento === false || elemento === null || elemento === undefined) {
1073
+ continue;
1074
+ }
1075
+ if (esPieza(elemento)) {
1076
+ piezas.push(elemento);
1077
+ }
1078
+ else if (String(elemento) !== '') {
1079
+ piezas.push({ tipo: 'texto', texto: String(elemento) });
1080
+ }
1081
+ }
1082
+ return piezas;
1083
+ }
1084
+ /**
1085
+ * Texto plano de una celda, para el Excel y las pruebas: textos, notas (con "·" si van en línea
1086
+ * después de otra pieza, como en pantalla), badges y marcas con texto, separados por un espacio.
1087
+ * Íconos, imágenes, saltos y las piezas con `soloPantalla` no cuentan.
1088
+ */
1089
+ function textoCelda(celda) {
1090
+ const partes = [];
1091
+ normalizarCelda(celda).forEach((pieza, i) => {
1092
+ if ('soloPantalla' in pieza && pieza.soloPantalla) {
1093
+ return;
1094
+ }
1095
+ let parte = '';
1096
+ switch (pieza.tipo) {
1097
+ case 'texto':
1098
+ case 'badge':
1099
+ parte = pieza.texto.trim();
1100
+ break;
1101
+ case 'nota':
1102
+ parte = pieza.texto.trim();
1103
+ if (parte && !pieza.bloque && i > 0) {
1104
+ parte = `· ${parte}`;
1105
+ }
1106
+ break;
1107
+ case 'marca':
1108
+ parte = (pieza.texto ?? '').trim();
1109
+ break;
1110
+ }
1111
+ if (parte) {
1112
+ partes.push(parte);
1113
+ }
1114
+ });
1115
+ return partes.join(' ');
1116
+ }
1117
+
1118
+ /*
1119
+ * Clases Tailwind de los tonos de `celda` (badges, marcas, textos e íconos con tono). Es la única
1120
+ * fuente: las pantallas que pintan algo con el mismo tono fuera de la tabla (la ficha del panel, una
1121
+ * leyenda) importan `CLASES_TONO` o `claseTono()` en vez de copiar las clases.
1122
+ *
1123
+ * Van completas (sin concatenar valores) para que el Tailwind de cada app las encuentre al escanear
1124
+ * `node_modules/@jvsoft/**` (`content` de los MF); por eso no hace falta tocar ningún
1125
+ * `tailwind.config.js`.
1126
+ *
1127
+ * - Fondo: el `-light` de cada color del Tailwind de la casa (`src/tailwind/colors.js`, 10 % de
1128
+ * opacidad de la paleta Material: `red.light` es #F44336 al 10 %). Sirve también en el tema oscuro.
1129
+ * - Texto: un tono oscuro de la paleta de Tailwind (`text-red-700` = #B91C1C), no el `DEFAULT`: sobre
1130
+ * su `-light`, el `DEFAULT` no llega al contraste mínimo para texto de 9–12 px (ámbar 1,5:1, verde
1131
+ * 2,5:1, rojo 3,2:1; los oscuros, 5,7–9,5:1). Fondo Material y texto Tailwind son familias
1132
+ * distintas a propósito: no "corregir" una con la otra sin recalcular el contraste.
1133
+ * - Tema oscuro de Vex (`.vex-style-dark` en un antepasado): el texto pasa al tono claro (300),
1134
+ * 5,0–6,3:1 sobre la tarjeta (#424242).
1135
+ * - `primario` depende del color de la entidad (`--color-primary`, tripleta RGB): el texto es ese
1136
+ * color mezclado con 30 % de negro (≥ 4,6:1 sobre su fondo aun con un primario naranja o teal) y,
1137
+ * en oscuro, con 65 % de blanco (≥ 5,2:1 aun con el azul oscuro de la casa). `color-mix` lo
1138
+ * soportan Chrome 111, Safari 16.2 y Firefox 113.
1139
+ */
1140
+ const CLASES_TONO = {
1141
+ neutro: { fondo: 'bg-gray-light', texto: 'text-gray-700 [.vex-style-dark_&]:text-gray-300' },
1142
+ exito: { fondo: 'bg-green-light', texto: 'text-green-800 [.vex-style-dark_&]:text-green-300' },
1143
+ aviso: { fondo: 'bg-amber-light', texto: 'text-amber-800 [.vex-style-dark_&]:text-amber-300' },
1144
+ error: { fondo: 'bg-red-light', texto: 'text-red-700 [.vex-style-dark_&]:text-red-300' },
1145
+ info: { fondo: 'bg-cyan-light', texto: 'text-cyan-800 [.vex-style-dark_&]:text-cyan-300' },
1146
+ primario: {
1147
+ fondo: 'bg-primary/10',
1148
+ texto: 'text-[color:color-mix(in_srgb,rgb(var(--color-primary))_70%,#000)] '
1149
+ + '[.vex-style-dark_&]:text-[color:color-mix(in_srgb,rgb(var(--color-primary))_35%,#fff)]',
1150
+ },
1151
+ };
1152
+ /** Clases de fondo y texto de un tono, para pintar con el mismo color fuera de la tabla (fichas, leyendas). */
1153
+ const claseTono = (tono) => `${CLASES_TONO[tono].fondo} ${CLASES_TONO[tono].texto}`;
1154
+ /*
1155
+ * Forma del badge (sin color). `BADGE_CELDA` es el de la fila (12 px, el que pinta `badge()`), con
1156
+ * `gap-0.5` y el ícono a 10 px para `badge(t, {icono})`; `jvs-badge` lo usa la medición de
1157
+ * `columnasSiNoCaben`. `BADGE_FICHA` es el de los paneles fuera de la tabla (18 px), el que tenían
1158
+ * Tipos de documento y Despachos.
1159
+ */
1160
+ const BADGE_CELDA = 'jvs-badge inline-flex items-center gap-0.5 h-3 px-[5px] rounded-full text-[9px] font-semibold leading-none '
1161
+ + 'align-text-top whitespace-nowrap [&_mat-icon]:w-[10px] [&_mat-icon]:h-[10px]';
1162
+ const BADGE_FICHA = 'inline-flex items-center rounded-full font-semibold leading-none align-text-top whitespace-nowrap h-[18px] px-2 text-[11px]';
1163
+ /**
1164
+ * Clases completas de un badge para HTML fuera de la tabla (la ficha de un panel, un contador):
1165
+ * `'celda'` (12 px, el de la fila) o `'ficha'` (18 px, paneles). Forma y tono juntos:
1166
+ *
1167
+ * ```ts
1168
+ * fichaExito: claseBadge('exito', 'ficha') // <span [class]="cls.fichaExito">Activo</span>
1169
+ * ```
1170
+ */
1171
+ const claseBadge = (tono, tamano = 'celda') => `${tamano === 'ficha' ? BADGE_FICHA : BADGE_CELDA} ${claseTono(tono)}`;
1172
+
1173
+ /*
1174
+ * Clases Tailwind de las piezas. Van completas (sin concatenar valores) para que el Tailwind de
1175
+ * cada app las encuentre al escanear `node_modules/@jvsoft/**`. Son las mismas medidas que tenían
1176
+ * Tipos de documento y Despachos: caben en la línea de una fila densa sin hacerla más alta. Las
1177
+ * medidas sin equivalente en la escala de Tailwind (`text-[9px]`, `px-[5px]`, `px-[3px]`,
1178
+ * `rounded-[3px]`: en los MF `rounded-sm` depende del `--border-radius` del tema) van en corchetes.
1179
+ * Ninguna pieza lleva margen hacia afuera salvo la marca (`mr-0.5`, porque entre marcas seguidas no va
1180
+ * espacio): la separación la pone el espacio entre piezas. Los colores y la forma del badge
1181
+ * (`BADGE_CELDA`, compartida con `claseBadge()`), en `tonos.ts`.
1182
+ */
1183
+ const MARCA = 'jvs-marca inline-flex items-center justify-center min-w-3 h-3 mr-0.5 rounded-[3px] text-[9px] font-bold leading-none align-text-top whitespace-nowrap [&_mat-icon]:w-[10px] [&_mat-icon]:h-[10px]';
1184
+ const ICONO = 'jvs-icono-celda !w-3 !h-3 !text-[12px] !leading-[12px] align-middle';
1185
+ /**
1186
+ * `tamano: 'grande'`: 14 px. La fila densa de los MF mide 15 px (línea de 12,5 más relleno y borde):
1187
+ * con 16 px crecía 3,5 px y no cabía dentro de la celda; con 14 px, `text-bottom` y `-my-px` (medido
1188
+ * en Chrome) la fila no crece y el ícono queda dentro de la celda.
1189
+ */
1190
+ const ICONO_GRANDE = 'jvs-icono-celda !w-3.5 !h-3.5 !text-[14px] !leading-[14px] -my-px align-text-bottom';
1191
+ /** Color de las notas; en oscuro, `gray-300` (5,9:1 sobre la tarjeta; `gray-400` daba 4,0). */
1192
+ const NOTA = 'text-gray-600 [.vex-style-dark_&]:text-gray-300';
1193
+ /**
1194
+ * Retardo (ms) de los tooltips de las piezas y del recorte: al pasar el cursor por una fila con
1195
+ * varias marcas no se abren y cierran tooltips sin pausa. Solo en `<jvs-tabla-celda>`: los botones
1196
+ * de la tabla siguen inmediatos.
1197
+ */
1198
+ const RETARDO_TOOLTIP_CELDA = 400;
1199
+ /** `lineas` → clase de recorte. */
1200
+ const RECORTE = {
1201
+ 1: 'line-clamp-1',
1202
+ 2: 'line-clamp-2',
1203
+ 3: 'line-clamp-3',
1204
+ 4: 'line-clamp-4',
1205
+ 5: 'line-clamp-5',
1206
+ 6: 'line-clamp-6',
1207
+ };
1208
+ /**
1209
+ * Pinta las piezas de una celda declarativa (`celda` en las columnas `text` y `arbol`). Sirve
1210
+ * también dentro de una columna `custom`, o fuera de la tabla (una leyenda), para que una pieza se
1211
+ * vea igual en todas partes:
1212
+ *
1213
+ * ```html
1214
+ * <jvs-tabla-celda [piezas]="[row.cNombre, nota(row.cSigla)]" [fila]="row"></jvs-tabla-celda>
1215
+ * ```
1216
+ *
1217
+ * Los tooltips son de Material y su texto se repite oculto (clase `jvs-celda-oculto`) para los
1218
+ * lectores de pantalla; la medición de `columnasSiNoCaben` no lo cuenta. Un ícono con `click` es un
1219
+ * botón que no selecciona la fila.
1220
+ */
1221
+ class TablaCeldaComponent {
1222
+ /** Lo que devolvió `celda(row)`: texto, pieza o lista de ellos. */
1223
+ piezas = input(null, ...(ngDevMode ? [{ debugName: "piezas" }] : /* istanbul ignore next */ []));
1224
+ /** El registro de la fila: lo recibe el `click` de los íconos. */
1225
+ fila = input(null, ...(ngDevMode ? [{ debugName: "fila" }] : /* istanbul ignore next */ []));
1226
+ /** Líneas máximas; con más, se recorta y el texto completo va al tooltip. */
1227
+ lineas = input(null, ...(ngDevMode ? [{ debugName: "lineas" }] : /* istanbul ignore next */ []));
1228
+ retardo = RETARDO_TOOLTIP_CELDA;
1229
+ pintadas = computed(() => {
1230
+ const piezas = normalizarCelda(this.piezas());
1231
+ return piezas.map((pieza, i) => ({
1232
+ pieza,
1233
+ espacio: i > 0 && necesitaEspacio(piezas[i - 1], pieza),
1234
+ clase: claseDe(pieza),
1235
+ oculto: textoOculto(pieza),
1236
+ punto: pieza.tipo === 'nota' && !pieza.bloque && i > 0,
1237
+ }));
1238
+ }, ...(ngDevMode ? [{ debugName: "pintadas" }] : /* istanbul ignore next */ []));
1239
+ claseRecorte = computed(() => {
1240
+ const lineas = this.lineas();
1241
+ return lineas ? RECORTE[Math.min(Math.max(Math.round(lineas), 1), 6)] : '';
1242
+ }, ...(ngDevMode ? [{ debugName: "claseRecorte" }] : /* istanbul ignore next */ []));
1243
+ textoCompleto = computed(() => this.claseRecorte() ? textoCelda(this.piezas()) : '', ...(ngDevMode ? [{ debugName: "textoCompleto" }] : /* istanbul ignore next */ []));
1244
+ pulsar(pieza, evento) {
1245
+ // Como el botón de plegar del árbol: el clic no llega a la fila.
1246
+ evento.stopPropagation();
1247
+ pieza.click?.(this.fila());
1248
+ }
1249
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: TablaCeldaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1250
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.18", type: TablaCeldaComponent, isStandalone: true, selector: "jvs-tabla-celda", inputs: { piezas: { classPropertyName: "piezas", publicName: "piezas", isSignal: true, isRequired: false, transformFunction: null }, fila: { classPropertyName: "fila", publicName: "fila", isSignal: true, isRequired: false, transformFunction: null }, lineas: { classPropertyName: "lineas", publicName: "lineas", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
1251
+ @if (claseRecorte(); as recorte) {
1252
+ <span [class]="recorte" [matTooltip]="textoCompleto()" [matTooltipShowDelay]="retardo">
1253
+ <ng-container *ngTemplateOutlet="contenido"></ng-container>
1254
+ </span>
1255
+ } @else {
1256
+ <ng-container *ngTemplateOutlet="contenido"></ng-container>
1257
+ }
1258
+ <ng-template #contenido>
1259
+ @for (p of pintadas(); track $index) {
1260
+ @if (p.espacio) {<ng-container>{{ ' ' }}</ng-container>}
1261
+ @switch (p.pieza.tipo) {
1262
+ @case ('texto') {
1263
+ @if (p.clase) {
1264
+ <span [class]="p.clase">{{ $any(p.pieza).texto }}</span>
1265
+ } @else {<ng-container>{{ $any(p.pieza).texto }}</ng-container>}
1266
+ }
1267
+ @case ('nota') {
1268
+ <span [class]="p.clase">{{ p.punto ? '· ' : '' }}{{ $any(p.pieza).texto }}</span>
1269
+ }
1270
+ @case ('badge') {
1271
+ <span [class]="p.clase" [matTooltip]="$any(p.pieza).tooltip ?? ''" [matTooltipShowDelay]="retardo">@if ($any(p.pieza).icono) {<mat-icon [svgIcon]="$any(p.pieza).icono" aria-hidden="true"></mat-icon>}{{ $any(p.pieza).texto }}@if (p.oculto) {<span class="cdk-visually-hidden jvs-celda-oculto">{{ ': ' + p.oculto }}</span>}</span>
1272
+ }
1273
+ @case ('marca') {
1274
+ <span [class]="p.clase" [matTooltip]="$any(p.pieza).tooltip ?? ''" [matTooltipShowDelay]="retardo">@if ($any(p.pieza).icono) {<mat-icon [svgIcon]="$any(p.pieza).icono" aria-hidden="true"></mat-icon>}<span aria-hidden="true">{{ $any(p.pieza).texto ?? '' }}</span>@if (p.oculto) {<span class="cdk-visually-hidden jvs-celda-oculto">{{ p.oculto }}</span>}</span>
1275
+ }
1276
+ @case ('icono') {
1277
+ @if ($any(p.pieza).click) {
1278
+ <button type="button" class="inline p-0 m-0 border-0 bg-transparent cursor-pointer text-inherit align-middle leading-none"
1279
+ [attr.aria-label]="p.oculto || $any(p.pieza).icono"
1280
+ [matTooltip]="$any(p.pieza).tooltip ?? ''"
1281
+ [matTooltipShowDelay]="retardo"
1282
+ (click)="pulsar($any(p.pieza), $event)"
1283
+ (dblclick)="$event.stopPropagation()">
1284
+ <mat-icon [class]="p.clase" [svgIcon]="$any(p.pieza).icono" aria-hidden="true"></mat-icon>
1285
+ </button>
1286
+ } @else {
1287
+ <mat-icon [class]="p.clase" [svgIcon]="$any(p.pieza).icono" aria-hidden="true"
1288
+ [matTooltip]="$any(p.pieza).tooltip ?? ''" [matTooltipShowDelay]="retardo"></mat-icon>@if (p.oculto) {<span class="cdk-visually-hidden jvs-celda-oculto">{{ p.oculto }}</span>}
1289
+ }
1290
+ }
1291
+ @case ('imagen') {
1292
+ <img [class]="p.clase" [src]="$any(p.pieza).src" [alt]="$any(p.pieza).alt" loading="lazy">
1293
+ }
1294
+ @case ('salto') {
1295
+ <br>
1296
+ }
1297
+ }
1298
+ }
1299
+ </ng-template>
1300
+ `, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }] });
1301
+ }
1302
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: TablaCeldaComponent, decorators: [{
1303
+ type: Component,
1304
+ args: [{
1305
+ selector: 'jvs-tabla-celda',
1306
+ standalone: true,
1307
+ imports: [NgTemplateOutlet, MatIconModule, MatTooltipModule],
1308
+ template: `
1309
+ @if (claseRecorte(); as recorte) {
1310
+ <span [class]="recorte" [matTooltip]="textoCompleto()" [matTooltipShowDelay]="retardo">
1311
+ <ng-container *ngTemplateOutlet="contenido"></ng-container>
1312
+ </span>
1313
+ } @else {
1314
+ <ng-container *ngTemplateOutlet="contenido"></ng-container>
1315
+ }
1316
+ <ng-template #contenido>
1317
+ @for (p of pintadas(); track $index) {
1318
+ @if (p.espacio) {<ng-container>{{ ' ' }}</ng-container>}
1319
+ @switch (p.pieza.tipo) {
1320
+ @case ('texto') {
1321
+ @if (p.clase) {
1322
+ <span [class]="p.clase">{{ $any(p.pieza).texto }}</span>
1323
+ } @else {<ng-container>{{ $any(p.pieza).texto }}</ng-container>}
1324
+ }
1325
+ @case ('nota') {
1326
+ <span [class]="p.clase">{{ p.punto ? '· ' : '' }}{{ $any(p.pieza).texto }}</span>
1327
+ }
1328
+ @case ('badge') {
1329
+ <span [class]="p.clase" [matTooltip]="$any(p.pieza).tooltip ?? ''" [matTooltipShowDelay]="retardo">@if ($any(p.pieza).icono) {<mat-icon [svgIcon]="$any(p.pieza).icono" aria-hidden="true"></mat-icon>}{{ $any(p.pieza).texto }}@if (p.oculto) {<span class="cdk-visually-hidden jvs-celda-oculto">{{ ': ' + p.oculto }}</span>}</span>
1330
+ }
1331
+ @case ('marca') {
1332
+ <span [class]="p.clase" [matTooltip]="$any(p.pieza).tooltip ?? ''" [matTooltipShowDelay]="retardo">@if ($any(p.pieza).icono) {<mat-icon [svgIcon]="$any(p.pieza).icono" aria-hidden="true"></mat-icon>}<span aria-hidden="true">{{ $any(p.pieza).texto ?? '' }}</span>@if (p.oculto) {<span class="cdk-visually-hidden jvs-celda-oculto">{{ p.oculto }}</span>}</span>
1333
+ }
1334
+ @case ('icono') {
1335
+ @if ($any(p.pieza).click) {
1336
+ <button type="button" class="inline p-0 m-0 border-0 bg-transparent cursor-pointer text-inherit align-middle leading-none"
1337
+ [attr.aria-label]="p.oculto || $any(p.pieza).icono"
1338
+ [matTooltip]="$any(p.pieza).tooltip ?? ''"
1339
+ [matTooltipShowDelay]="retardo"
1340
+ (click)="pulsar($any(p.pieza), $event)"
1341
+ (dblclick)="$event.stopPropagation()">
1342
+ <mat-icon [class]="p.clase" [svgIcon]="$any(p.pieza).icono" aria-hidden="true"></mat-icon>
1343
+ </button>
1344
+ } @else {
1345
+ <mat-icon [class]="p.clase" [svgIcon]="$any(p.pieza).icono" aria-hidden="true"
1346
+ [matTooltip]="$any(p.pieza).tooltip ?? ''" [matTooltipShowDelay]="retardo"></mat-icon>@if (p.oculto) {<span class="cdk-visually-hidden jvs-celda-oculto">{{ p.oculto }}</span>}
1347
+ }
1348
+ }
1349
+ @case ('imagen') {
1350
+ <img [class]="p.clase" [src]="$any(p.pieza).src" [alt]="$any(p.pieza).alt" loading="lazy">
1351
+ }
1352
+ @case ('salto') {
1353
+ <br>
1354
+ }
1355
+ }
1356
+ }
1357
+ </ng-template>
1358
+ `,
1359
+ }]
1360
+ }], propDecorators: { piezas: [{ type: i0.Input, args: [{ isSignal: true, alias: "piezas", required: false }] }], fila: [{ type: i0.Input, args: [{ isSignal: true, alias: "fila", required: false }] }], lineas: [{ type: i0.Input, args: [{ isSignal: true, alias: "lineas", required: false }] }] } });
1361
+ /** Entre dos piezas va un espacio, salvo entre marcas seguidas (llevan su margen) y junto a un salto. */
1362
+ function necesitaEspacio(anterior, actual) {
1363
+ if (anterior.tipo === 'salto' || actual.tipo === 'salto') {
1364
+ return false;
1365
+ }
1366
+ if (actual.tipo === 'nota' && actual.bloque) {
1367
+ return false;
1368
+ }
1369
+ return !(anterior.tipo === 'marca' && actual.tipo === 'marca');
1370
+ }
1371
+ /**
1372
+ * Clases de la pieza: las de la librería y, al final, las de `clase` de la pantalla. Con
1373
+ * `tono: false` la librería no pone color (solo la forma): los colores son los de `clase`.
1374
+ */
1375
+ function claseDe(pieza) {
1376
+ const extra = 'clase' in pieza ? pieza.clase : undefined;
1377
+ return [clasesLibreria(pieza), extra].filter(Boolean).join(' ');
1378
+ }
1379
+ function clasesLibreria(pieza) {
1380
+ switch (pieza.tipo) {
1381
+ case 'texto':
1382
+ return [pieza.negrita ? 'font-bold' : '', pieza.tono ? CLASES_TONO[pieza.tono].texto : ''].filter(Boolean).join(' ');
1383
+ case 'nota':
1384
+ return pieza.bloque
1385
+ ? `block text-[11px] leading-tight ${NOTA}`
1386
+ : NOTA;
1387
+ case 'badge':
1388
+ return pieza.tono === false ? BADGE_CELDA : `${BADGE_CELDA} ${claseTono(pieza.tono ?? 'neutro')}`;
1389
+ case 'marca': {
1390
+ const forma = `${MARCA} ${pieza.icono ? 'px-px' : 'px-[3px]'}`;
1391
+ return pieza.tono === false ? forma : `${forma} ${claseTono(pieza.tono ?? 'primario')}`;
1392
+ }
1393
+ case 'icono':
1394
+ // Del mismo color que el texto del tono: "Sin firmante" lleva un solo ámbar.
1395
+ return `${pieza.tamano === 'grande' ? ICONO_GRANDE : ICONO} ${pieza.tono ? CLASES_TONO[pieza.tono].texto : ''}`.trim();
1396
+ case 'imagen':
1397
+ return `jvs-imagen-celda inline-block w-5 h-5 align-middle border border-solid border-black/10 object-cover ${pieza.redonda === false ? 'rounded-[3px]' : 'rounded-full'}`;
1398
+ default:
1399
+ return '';
1400
+ }
1401
+ }
1402
+ /** Lo que lee el lector de pantalla de una pieza con tooltip (no se repite si ya es su texto). */
1403
+ function textoOculto(pieza) {
1404
+ if (pieza.tipo !== 'badge' && pieza.tipo !== 'marca' && pieza.tipo !== 'icono') {
1405
+ return '';
1406
+ }
1407
+ const texto = pieza.ariaLabel ?? pieza.tooltip ?? '';
1408
+ return pieza.tipo === 'badge' && texto === pieza.texto ? '' : texto;
1409
+ }
1410
+
558
1411
  class ColumnTypeTextComponent extends ColumnTypeComponent {
559
1412
  column = {}; // 🟢 Solución
1413
+ ngOnInit() {
1414
+ super.ngOnInit();
1415
+ if (isDevMode() && this.column.celda && this.column.innerHTML) {
1416
+ console.warn(`[jvs-tabla-mantenimiento] La columna "${this.column.property}" tiene \`celda\` e \`innerHTML\`: se pinta \`celda\`.`);
1417
+ }
1418
+ }
560
1419
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ColumnTypeTextComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
561
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.18", type: ColumnTypeTextComponent, isStandalone: false, selector: "jvs-column-type-text", inputs: { column: "column" }, usesInheritance: true, ngImport: i0, template: "<ng-template #cellTemplate let-row=\"row\">\n @if (column.innerHTML) {\n <div [class]=\"column.text?.cssContenedor\" [ngStyle]=\"column.text?.cssStyle\" class=\"hover:!max-h-max\"\n [innerHTML]=\"column.innerHTML(row) | noSanitize\"\n jvsPopoverListener [trigger]=\"column.popover?.trigger || 'hover'\">\n </div>\n } @else {\n @if (column.text && column.text?.separador) {\n <div [class]=\"column.text?.cssContenedor\">\n @for (itm of ((column.transformar ? column.transformar(row) : row[column.property]) ?? '').split(column.text.separador); track itm) {\n @if (column.property) {\n <ng-template [ngTemplateOutlet]=\"tipoDatoString\"\n [ngTemplateOutletContext]=\"{ fila: column, tipo: 'text', value: itm, class: column.textCss, row: row }\"></ng-template>\n }\n }\n </div>\n } @else {\n @if (column.property) {\n <ng-template [ngTemplateOutlet]=\"tipoDatoString\"\n [ngTemplateOutletContext]=\"{ fila: column, tipo: 'text', value: (column.transformar ? column.transformar(row) : row[column.property]), class: column.textCss, row: row }\"></ng-template>\n }\n }\n }\n</ng-template>\n\n<ng-container matColumnDef=\"{{ column.property }}\">\n <!-- Definici\u00F3n del encabezado de la columna -->\n <th *matHeaderCellDef [ngClass]=\"column.cssClassesTH\" class=\"uppercase text-center\" mat-header-cell mat-sort-header\n [disabled]=\"column.sort === false\">\n <span [innerHTML]=\"column.label\">{{ column.label }} </span>\n </th>\n\n <!-- Cuerpo de la celda, definido por los hijos -->\n <td *matCellDef=\"let row\" [ngClass]=\"column.cssClasses\" mat-cell (click)=\"accionClick(row, $event)\">\n\n <ng-container [ngTemplateOutlet]=\"cellTemplate\" [ngTemplateOutletContext]=\"{row}\"></ng-container>\n\n </td>\n\n <th *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" mat-footer-cell>\n {{ column.transformarFooter ? column.transformarFooter() : '' }}\n </th>\n</ng-container>\n\n\n<!--<ng-container matColumnDef=\"{{ column.property }}\">\n<th *matHeaderCellDef [ngClass]=\"column.cssClassesTH\" class=\"uppercase text-center\" mat-header-cell mat-sort-header\n [disabled]=\"column.sort === false\">\n <span [innerHTML]=\"column.label ?? ''\">{{ column.label }} </span>\n</th>\n<ng-container *ngIf=\"column.innerHTML; else sinInnerHTML\">\n <td *matCellDef=\"let row\" [ngClass]=\"column.cssClasses\" mat-cell (click)=\"accionClick(column, row, $event)\">\n <div [class]=\"column.text?.cssContenedor\" [ngStyle]=\"column.text?.cssStyle\" class=\"hover:!max-h-max\"\n [innerHTML]=\"column.innerHTML(row) | noSanitize\">\n\n </div>\n </td>\n</ng-container>\n<ng-template #sinInnerHTML>\n <td *matCellDef=\"let row\" [ngClass]=\"column.cssClasses\" mat-cell>\n <ng-container *ngIf=\"column.text && column.text?.separador else campoTextNormal\">\n <div [class]=\"column.text?.cssContenedor\">\n <ng-container\n *ngFor=\"let itm of ((column.transformar ? column.transformar(row) : row[column.property]) ?? '').split(column.text.separador)\">\n <ng-template *ngIf=\"column.property\" [ngTemplateOutlet]=\"tipoDatoString\"\n [ngTemplateOutletContext]=\"{ fila: column, tipo: 'text', value: itm, class: column.textCss, row: row }\"></ng-template>\n </ng-container>\n </div>\n </ng-container>\n <ng-template #campoTextNormal>\n <ng-template *ngIf=\"column.property\" [ngTemplateOutlet]=\"tipoDatoString\"\n [ngTemplateOutletContext]=\"{ fila: column, tipo: 'text', value: (column.transformar ? column.transformar(row) : row[column.property]), class: column.textCss, row: row }\"></ng-template>\n </ng-template>\n </td>\n</ng-template>\n<th *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" style=\"height: unset !important;\" mat-footer-cell\n [innerHTML]=\"column.transformarFooter ? column.transformarFooter() : ''\">\n</th>\n</ng-container>-->\n\n<ng-template #tipoDatoString let-row=\"row\" let-fila=\"fila\" let-tipo=\"tipo\" let-value=\"value\" let-format=\"format\"\n let-clase=\"class\">\n @switch (tipo) {\n @case ('text') {\n @if (value) {\n <span [ngClass]=\"clase\"\n (click)=\"accionClick(row, $event)\"\n [jvsPopover]=\"(column.popover?.template || column.popover?.content?.(row)) ?? null\"\n [context]=\"row\"\n [trigger]=\"column.popover?.trigger || 'hover'\"\n [position]=\"column.popover?.position || 'bottom'\"\n [customClass]=\"column.popover?.customClass || ''\">\n @if (!fila.zeroFill) {\n <span>{{ value }}</span>\n }\n @if (fila.zeroFill) {\n <span>{{ value | zeroFill: fila.zeroFill }}</span>\n }\n </span>\n }\n }\n @case ('date') {\n @if (value) {\n <span [ngClass]=\"clase\"\n (click)=\"accionClick(row, $event)\">{{ value | date: (format || 'dd/MM/yyyy') }}</span>\n }\n }\n @case ('number') {\n @if (value) {\n <span [ngClass]=\"clase\"\n (click)=\"accionClick(row, $event)\">{{ value | number: (format || '0.0-2') }}</span>\n }\n }\n @case ('money') {\n @if (value) {\n <span [ngClass]=\"clase\"\n [class.text-sky-700]=\"(value * 1) >= 0\" [class.text-red-700]=\"(value * 1) < 0\"\n (click)=\"accionClick(row, $event)\">{{ value | number: (format || '1.2-2') }}</span>\n }\n }\n <!--\t\t<span [ngClass]=\"class\" *ngSwitchCase=\"'date'\">{{ value | date: (format || 'dd/MM/yyyy') }}</span>-->\n <!--\t\t<span [ngClass]=\"class\" *ngSwitchCase=\"'number'\">{{ value | number: (format || '0.0-2') }}</span>-->\n }\n</ng-template>\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i2.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i2.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i2.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i2.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i2.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i3.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "directive", type: i4.JvsPopoverDirective, selector: "[jvsPopover]", inputs: ["jvsPopover", "context", "trigger", "position", "customClass"] }, { kind: "directive", type: i4.JvsPopoverListenerDirective, selector: "[jvsPopoverListener]", inputs: ["trigger"] }, { kind: "pipe", type: i1.DecimalPipe, name: "number" }, { kind: "pipe", type: i1.DatePipe, name: "date" }, { kind: "pipe", type: NoSanitizePipe, name: "noSanitize" }, { kind: "pipe", type: ZeroFillPipe, name: "zeroFill" }] });
1420
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.18", type: ColumnTypeTextComponent, isStandalone: false, selector: "jvs-column-type-text", inputs: { column: "column" }, usesInheritance: true, ngImport: i0, template: "<ng-template #cellTemplate let-row=\"row\">\n @if (column.celda) {\n <jvs-tabla-celda [piezas]=\"column.celda(row)\" [fila]=\"row\" [lineas]=\"column.lineas\"></jvs-tabla-celda>\n } @else if (column.innerHTML) {\n <div [class]=\"column.text?.cssContenedor\" [ngStyle]=\"column.text?.cssStyle\" class=\"hover:!max-h-max\"\n [innerHTML]=\"column.innerHTML(row) | noSanitize\"\n jvsPopoverListener [trigger]=\"column.popover?.trigger || 'hover'\">\n </div>\n } @else {\n @if (column.text && column.text?.separador) {\n <div [class]=\"column.text?.cssContenedor\">\n @for (itm of ((column.transformar ? column.transformar(row) : row[column.property]) ?? '').split(column.text.separador); track itm) {\n @if (column.property) {\n <ng-template [ngTemplateOutlet]=\"tipoDatoString\"\n [ngTemplateOutletContext]=\"{ fila: column, tipo: 'text', value: itm, class: column.textCss, row: row }\"></ng-template>\n }\n }\n </div>\n } @else {\n @if (column.property) {\n <ng-template [ngTemplateOutlet]=\"tipoDatoString\"\n [ngTemplateOutletContext]=\"{ fila: column, tipo: 'text', value: (column.transformar ? column.transformar(row) : row[column.property]), class: column.textCss, row: row }\"></ng-template>\n }\n }\n }\n</ng-template>\n\n<ng-container matColumnDef=\"{{ column.property }}\">\n <!-- Definici\u00F3n del encabezado de la columna -->\n <th *matHeaderCellDef [ngClass]=\"column.cssClassesTH\" class=\"uppercase\" [class]=\"claseCabecera\" [attr.data-alineacion]=\"alineacionCabecera\" [matTooltip]=\"column.labelTooltip ?? ''\" mat-header-cell mat-sort-header\n [disabled]=\"column.sort === false\">\n <span [innerHTML]=\"column.label\">{{ column.label }} </span>\n </th>\n\n <!-- Cuerpo de la celda, definido por los hijos -->\n <td *matCellDef=\"let row\" [ngClass]=\"column.cssClasses\" mat-cell (click)=\"accionClick(row, $event)\">\n\n <ng-container [ngTemplateOutlet]=\"cellTemplate\" [ngTemplateOutletContext]=\"{row}\"></ng-container>\n\n </td>\n\n <th *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" mat-footer-cell>\n {{ column.transformarFooter ? column.transformarFooter() : '' }}\n </th>\n</ng-container>\n\n\n<!--<ng-container matColumnDef=\"{{ column.property }}\">\n<th *matHeaderCellDef [ngClass]=\"column.cssClassesTH\" class=\"uppercase\" [class]=\"claseCabecera\" [attr.data-alineacion]=\"alineacionCabecera\" mat-header-cell mat-sort-header\n [disabled]=\"column.sort === false\">\n <span [innerHTML]=\"column.label ?? ''\">{{ column.label }} </span>\n</th>\n<ng-container *ngIf=\"column.innerHTML; else sinInnerHTML\">\n <td *matCellDef=\"let row\" [ngClass]=\"column.cssClasses\" mat-cell (click)=\"accionClick(column, row, $event)\">\n <div [class]=\"column.text?.cssContenedor\" [ngStyle]=\"column.text?.cssStyle\" class=\"hover:!max-h-max\"\n [innerHTML]=\"column.innerHTML(row) | noSanitize\">\n\n </div>\n </td>\n</ng-container>\n<ng-template #sinInnerHTML>\n <td *matCellDef=\"let row\" [ngClass]=\"column.cssClasses\" mat-cell>\n <ng-container *ngIf=\"column.text && column.text?.separador else campoTextNormal\">\n <div [class]=\"column.text?.cssContenedor\">\n <ng-container\n *ngFor=\"let itm of ((column.transformar ? column.transformar(row) : row[column.property]) ?? '').split(column.text.separador)\">\n <ng-template *ngIf=\"column.property\" [ngTemplateOutlet]=\"tipoDatoString\"\n [ngTemplateOutletContext]=\"{ fila: column, tipo: 'text', value: itm, class: column.textCss, row: row }\"></ng-template>\n </ng-container>\n </div>\n </ng-container>\n <ng-template #campoTextNormal>\n <ng-template *ngIf=\"column.property\" [ngTemplateOutlet]=\"tipoDatoString\"\n [ngTemplateOutletContext]=\"{ fila: column, tipo: 'text', value: (column.transformar ? column.transformar(row) : row[column.property]), class: column.textCss, row: row }\"></ng-template>\n </ng-template>\n </td>\n</ng-template>\n<th *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" style=\"height: unset !important;\" mat-footer-cell\n [innerHTML]=\"column.transformarFooter ? column.transformarFooter() : ''\">\n</th>\n</ng-container>-->\n\n<ng-template #tipoDatoString let-row=\"row\" let-fila=\"fila\" let-tipo=\"tipo\" let-value=\"value\" let-format=\"format\"\n let-clase=\"class\">\n @switch (tipo) {\n @case ('text') {\n @if (value) {\n <span [ngClass]=\"clase\"\n (click)=\"accionClick(row, $event)\"\n [jvsPopover]=\"(column.popover?.template || column.popover?.content?.(row)) ?? null\"\n [context]=\"row\"\n [trigger]=\"column.popover?.trigger || 'hover'\"\n [position]=\"column.popover?.position || 'bottom'\"\n [customClass]=\"column.popover?.customClass || ''\">\n @if (!fila.zeroFill) {\n <span>{{ value }}</span>\n }\n @if (fila.zeroFill) {\n <span>{{ value | zeroFill: fila.zeroFill }}</span>\n }\n </span>\n }\n }\n @case ('date') {\n @if (value) {\n <span [ngClass]=\"clase\"\n (click)=\"accionClick(row, $event)\">{{ value | date: (format || 'dd/MM/yyyy') }}</span>\n }\n }\n @case ('number') {\n @if (value) {\n <span [ngClass]=\"clase\"\n (click)=\"accionClick(row, $event)\">{{ value | number: (format || '0.0-2') }}</span>\n }\n }\n @case ('money') {\n @if (value) {\n <span [ngClass]=\"clase\"\n [class.text-sky-700]=\"(value * 1) >= 0\" [class.text-red-700]=\"(value * 1) < 0\"\n (click)=\"accionClick(row, $event)\">{{ value | number: (format || '1.2-2') }}</span>\n }\n }\n <!--\t\t<span [ngClass]=\"class\" *ngSwitchCase=\"'date'\">{{ value | date: (format || 'dd/MM/yyyy') }}</span>-->\n <!--\t\t<span [ngClass]=\"class\" *ngSwitchCase=\"'number'\">{{ value | number: (format || '0.0-2') }}</span>-->\n }\n</ng-template>\n", dependencies: [{ kind: "component", type: TablaCeldaComponent, selector: "jvs-tabla-celda", inputs: ["piezas", "fila", "lineas"] }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i2.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i2.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i2.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i2.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i2.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i3.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: i6.JvsPopoverDirective, selector: "[jvsPopover]", inputs: ["jvsPopover", "context", "trigger", "position", "customClass"] }, { kind: "directive", type: i6.JvsPopoverListenerDirective, selector: "[jvsPopoverListener]", inputs: ["trigger"] }, { kind: "pipe", type: i1$1.DecimalPipe, name: "number" }, { kind: "pipe", type: i1$1.DatePipe, name: "date" }, { kind: "pipe", type: NoSanitizePipe, name: "noSanitize" }, { kind: "pipe", type: ZeroFillPipe, name: "zeroFill" }] });
562
1421
  }
563
1422
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ColumnTypeTextComponent, decorators: [{
564
1423
  type: Component,
565
- args: [{ selector: 'jvs-column-type-text', standalone: false, template: "<ng-template #cellTemplate let-row=\"row\">\n @if (column.innerHTML) {\n <div [class]=\"column.text?.cssContenedor\" [ngStyle]=\"column.text?.cssStyle\" class=\"hover:!max-h-max\"\n [innerHTML]=\"column.innerHTML(row) | noSanitize\"\n jvsPopoverListener [trigger]=\"column.popover?.trigger || 'hover'\">\n </div>\n } @else {\n @if (column.text && column.text?.separador) {\n <div [class]=\"column.text?.cssContenedor\">\n @for (itm of ((column.transformar ? column.transformar(row) : row[column.property]) ?? '').split(column.text.separador); track itm) {\n @if (column.property) {\n <ng-template [ngTemplateOutlet]=\"tipoDatoString\"\n [ngTemplateOutletContext]=\"{ fila: column, tipo: 'text', value: itm, class: column.textCss, row: row }\"></ng-template>\n }\n }\n </div>\n } @else {\n @if (column.property) {\n <ng-template [ngTemplateOutlet]=\"tipoDatoString\"\n [ngTemplateOutletContext]=\"{ fila: column, tipo: 'text', value: (column.transformar ? column.transformar(row) : row[column.property]), class: column.textCss, row: row }\"></ng-template>\n }\n }\n }\n</ng-template>\n\n<ng-container matColumnDef=\"{{ column.property }}\">\n <!-- Definici\u00F3n del encabezado de la columna -->\n <th *matHeaderCellDef [ngClass]=\"column.cssClassesTH\" class=\"uppercase text-center\" mat-header-cell mat-sort-header\n [disabled]=\"column.sort === false\">\n <span [innerHTML]=\"column.label\">{{ column.label }} </span>\n </th>\n\n <!-- Cuerpo de la celda, definido por los hijos -->\n <td *matCellDef=\"let row\" [ngClass]=\"column.cssClasses\" mat-cell (click)=\"accionClick(row, $event)\">\n\n <ng-container [ngTemplateOutlet]=\"cellTemplate\" [ngTemplateOutletContext]=\"{row}\"></ng-container>\n\n </td>\n\n <th *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" mat-footer-cell>\n {{ column.transformarFooter ? column.transformarFooter() : '' }}\n </th>\n</ng-container>\n\n\n<!--<ng-container matColumnDef=\"{{ column.property }}\">\n<th *matHeaderCellDef [ngClass]=\"column.cssClassesTH\" class=\"uppercase text-center\" mat-header-cell mat-sort-header\n [disabled]=\"column.sort === false\">\n <span [innerHTML]=\"column.label ?? ''\">{{ column.label }} </span>\n</th>\n<ng-container *ngIf=\"column.innerHTML; else sinInnerHTML\">\n <td *matCellDef=\"let row\" [ngClass]=\"column.cssClasses\" mat-cell (click)=\"accionClick(column, row, $event)\">\n <div [class]=\"column.text?.cssContenedor\" [ngStyle]=\"column.text?.cssStyle\" class=\"hover:!max-h-max\"\n [innerHTML]=\"column.innerHTML(row) | noSanitize\">\n\n </div>\n </td>\n</ng-container>\n<ng-template #sinInnerHTML>\n <td *matCellDef=\"let row\" [ngClass]=\"column.cssClasses\" mat-cell>\n <ng-container *ngIf=\"column.text && column.text?.separador else campoTextNormal\">\n <div [class]=\"column.text?.cssContenedor\">\n <ng-container\n *ngFor=\"let itm of ((column.transformar ? column.transformar(row) : row[column.property]) ?? '').split(column.text.separador)\">\n <ng-template *ngIf=\"column.property\" [ngTemplateOutlet]=\"tipoDatoString\"\n [ngTemplateOutletContext]=\"{ fila: column, tipo: 'text', value: itm, class: column.textCss, row: row }\"></ng-template>\n </ng-container>\n </div>\n </ng-container>\n <ng-template #campoTextNormal>\n <ng-template *ngIf=\"column.property\" [ngTemplateOutlet]=\"tipoDatoString\"\n [ngTemplateOutletContext]=\"{ fila: column, tipo: 'text', value: (column.transformar ? column.transformar(row) : row[column.property]), class: column.textCss, row: row }\"></ng-template>\n </ng-template>\n </td>\n</ng-template>\n<th *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" style=\"height: unset !important;\" mat-footer-cell\n [innerHTML]=\"column.transformarFooter ? column.transformarFooter() : ''\">\n</th>\n</ng-container>-->\n\n<ng-template #tipoDatoString let-row=\"row\" let-fila=\"fila\" let-tipo=\"tipo\" let-value=\"value\" let-format=\"format\"\n let-clase=\"class\">\n @switch (tipo) {\n @case ('text') {\n @if (value) {\n <span [ngClass]=\"clase\"\n (click)=\"accionClick(row, $event)\"\n [jvsPopover]=\"(column.popover?.template || column.popover?.content?.(row)) ?? null\"\n [context]=\"row\"\n [trigger]=\"column.popover?.trigger || 'hover'\"\n [position]=\"column.popover?.position || 'bottom'\"\n [customClass]=\"column.popover?.customClass || ''\">\n @if (!fila.zeroFill) {\n <span>{{ value }}</span>\n }\n @if (fila.zeroFill) {\n <span>{{ value | zeroFill: fila.zeroFill }}</span>\n }\n </span>\n }\n }\n @case ('date') {\n @if (value) {\n <span [ngClass]=\"clase\"\n (click)=\"accionClick(row, $event)\">{{ value | date: (format || 'dd/MM/yyyy') }}</span>\n }\n }\n @case ('number') {\n @if (value) {\n <span [ngClass]=\"clase\"\n (click)=\"accionClick(row, $event)\">{{ value | number: (format || '0.0-2') }}</span>\n }\n }\n @case ('money') {\n @if (value) {\n <span [ngClass]=\"clase\"\n [class.text-sky-700]=\"(value * 1) >= 0\" [class.text-red-700]=\"(value * 1) < 0\"\n (click)=\"accionClick(row, $event)\">{{ value | number: (format || '1.2-2') }}</span>\n }\n }\n <!--\t\t<span [ngClass]=\"class\" *ngSwitchCase=\"'date'\">{{ value | date: (format || 'dd/MM/yyyy') }}</span>-->\n <!--\t\t<span [ngClass]=\"class\" *ngSwitchCase=\"'number'\">{{ value | number: (format || '0.0-2') }}</span>-->\n }\n</ng-template>\n" }]
1424
+ args: [{ selector: 'jvs-column-type-text', standalone: false, template: "<ng-template #cellTemplate let-row=\"row\">\n @if (column.celda) {\n <jvs-tabla-celda [piezas]=\"column.celda(row)\" [fila]=\"row\" [lineas]=\"column.lineas\"></jvs-tabla-celda>\n } @else if (column.innerHTML) {\n <div [class]=\"column.text?.cssContenedor\" [ngStyle]=\"column.text?.cssStyle\" class=\"hover:!max-h-max\"\n [innerHTML]=\"column.innerHTML(row) | noSanitize\"\n jvsPopoverListener [trigger]=\"column.popover?.trigger || 'hover'\">\n </div>\n } @else {\n @if (column.text && column.text?.separador) {\n <div [class]=\"column.text?.cssContenedor\">\n @for (itm of ((column.transformar ? column.transformar(row) : row[column.property]) ?? '').split(column.text.separador); track itm) {\n @if (column.property) {\n <ng-template [ngTemplateOutlet]=\"tipoDatoString\"\n [ngTemplateOutletContext]=\"{ fila: column, tipo: 'text', value: itm, class: column.textCss, row: row }\"></ng-template>\n }\n }\n </div>\n } @else {\n @if (column.property) {\n <ng-template [ngTemplateOutlet]=\"tipoDatoString\"\n [ngTemplateOutletContext]=\"{ fila: column, tipo: 'text', value: (column.transformar ? column.transformar(row) : row[column.property]), class: column.textCss, row: row }\"></ng-template>\n }\n }\n }\n</ng-template>\n\n<ng-container matColumnDef=\"{{ column.property }}\">\n <!-- Definici\u00F3n del encabezado de la columna -->\n <th *matHeaderCellDef [ngClass]=\"column.cssClassesTH\" class=\"uppercase\" [class]=\"claseCabecera\" [attr.data-alineacion]=\"alineacionCabecera\" [matTooltip]=\"column.labelTooltip ?? ''\" mat-header-cell mat-sort-header\n [disabled]=\"column.sort === false\">\n <span [innerHTML]=\"column.label\">{{ column.label }} </span>\n </th>\n\n <!-- Cuerpo de la celda, definido por los hijos -->\n <td *matCellDef=\"let row\" [ngClass]=\"column.cssClasses\" mat-cell (click)=\"accionClick(row, $event)\">\n\n <ng-container [ngTemplateOutlet]=\"cellTemplate\" [ngTemplateOutletContext]=\"{row}\"></ng-container>\n\n </td>\n\n <th *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" mat-footer-cell>\n {{ column.transformarFooter ? column.transformarFooter() : '' }}\n </th>\n</ng-container>\n\n\n<!--<ng-container matColumnDef=\"{{ column.property }}\">\n<th *matHeaderCellDef [ngClass]=\"column.cssClassesTH\" class=\"uppercase\" [class]=\"claseCabecera\" [attr.data-alineacion]=\"alineacionCabecera\" mat-header-cell mat-sort-header\n [disabled]=\"column.sort === false\">\n <span [innerHTML]=\"column.label ?? ''\">{{ column.label }} </span>\n</th>\n<ng-container *ngIf=\"column.innerHTML; else sinInnerHTML\">\n <td *matCellDef=\"let row\" [ngClass]=\"column.cssClasses\" mat-cell (click)=\"accionClick(column, row, $event)\">\n <div [class]=\"column.text?.cssContenedor\" [ngStyle]=\"column.text?.cssStyle\" class=\"hover:!max-h-max\"\n [innerHTML]=\"column.innerHTML(row) | noSanitize\">\n\n </div>\n </td>\n</ng-container>\n<ng-template #sinInnerHTML>\n <td *matCellDef=\"let row\" [ngClass]=\"column.cssClasses\" mat-cell>\n <ng-container *ngIf=\"column.text && column.text?.separador else campoTextNormal\">\n <div [class]=\"column.text?.cssContenedor\">\n <ng-container\n *ngFor=\"let itm of ((column.transformar ? column.transformar(row) : row[column.property]) ?? '').split(column.text.separador)\">\n <ng-template *ngIf=\"column.property\" [ngTemplateOutlet]=\"tipoDatoString\"\n [ngTemplateOutletContext]=\"{ fila: column, tipo: 'text', value: itm, class: column.textCss, row: row }\"></ng-template>\n </ng-container>\n </div>\n </ng-container>\n <ng-template #campoTextNormal>\n <ng-template *ngIf=\"column.property\" [ngTemplateOutlet]=\"tipoDatoString\"\n [ngTemplateOutletContext]=\"{ fila: column, tipo: 'text', value: (column.transformar ? column.transformar(row) : row[column.property]), class: column.textCss, row: row }\"></ng-template>\n </ng-template>\n </td>\n</ng-template>\n<th *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" style=\"height: unset !important;\" mat-footer-cell\n [innerHTML]=\"column.transformarFooter ? column.transformarFooter() : ''\">\n</th>\n</ng-container>-->\n\n<ng-template #tipoDatoString let-row=\"row\" let-fila=\"fila\" let-tipo=\"tipo\" let-value=\"value\" let-format=\"format\"\n let-clase=\"class\">\n @switch (tipo) {\n @case ('text') {\n @if (value) {\n <span [ngClass]=\"clase\"\n (click)=\"accionClick(row, $event)\"\n [jvsPopover]=\"(column.popover?.template || column.popover?.content?.(row)) ?? null\"\n [context]=\"row\"\n [trigger]=\"column.popover?.trigger || 'hover'\"\n [position]=\"column.popover?.position || 'bottom'\"\n [customClass]=\"column.popover?.customClass || ''\">\n @if (!fila.zeroFill) {\n <span>{{ value }}</span>\n }\n @if (fila.zeroFill) {\n <span>{{ value | zeroFill: fila.zeroFill }}</span>\n }\n </span>\n }\n }\n @case ('date') {\n @if (value) {\n <span [ngClass]=\"clase\"\n (click)=\"accionClick(row, $event)\">{{ value | date: (format || 'dd/MM/yyyy') }}</span>\n }\n }\n @case ('number') {\n @if (value) {\n <span [ngClass]=\"clase\"\n (click)=\"accionClick(row, $event)\">{{ value | number: (format || '0.0-2') }}</span>\n }\n }\n @case ('money') {\n @if (value) {\n <span [ngClass]=\"clase\"\n [class.text-sky-700]=\"(value * 1) >= 0\" [class.text-red-700]=\"(value * 1) < 0\"\n (click)=\"accionClick(row, $event)\">{{ value | number: (format || '1.2-2') }}</span>\n }\n }\n <!--\t\t<span [ngClass]=\"class\" *ngSwitchCase=\"'date'\">{{ value | date: (format || 'dd/MM/yyyy') }}</span>-->\n <!--\t\t<span [ngClass]=\"class\" *ngSwitchCase=\"'number'\">{{ value | number: (format || '0.0-2') }}</span>-->\n }\n</ng-template>\n" }]
566
1425
  }], propDecorators: { column: [{
567
1426
  type: Input,
568
1427
  args: [{ required: true }]
@@ -574,11 +1433,11 @@ class ColumnTypeMoneyComponent extends ColumnTypeComponent {
574
1433
  return (this.column.transformar ? this.column.transformar(row) : row[this.column.property]);
575
1434
  }
576
1435
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ColumnTypeMoneyComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
577
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.18", type: ColumnTypeMoneyComponent, isStandalone: false, selector: "jvs-column-type-money", inputs: { column: "column" }, usesInheritance: true, ngImport: i0, template: "<ng-template #cellTemplate let-row=\"row\">\n @if (value(row)) {\n <span [ngClass]=\"column.textCss\"\n [class.text-sky-700]=\"(value(row)) >= 0\" [class.text-red-700]=\"(value(row)) < 0\"\n [jvsPopover]=\"(column.popover?.template || column.popover?.content?.(row)) ?? null\"\n [context]=\"row\"\n [trigger]=\"column.popover?.trigger || 'hover'\"\n [position]=\"column.popover?.position || 'bottom'\"\n [customClass]=\"column.popover?.customClass || ''\"\n (click)=\"accionClick(row, $event)\">{{ value(row) | number: (column.format || '1.2-2') }}</span>\n }\n</ng-template>\n<ng-template #columnFooterTemplate let-row=\"row\">\n @if (column.transformarFooter) {\n <span\n [class.text-sky-700]=\"column.transformarFooter() >= 0\"\n [class.text-red-700]=\"column.transformarFooter() < 0\"\n >\n <span>{{ column.transformarFooter() | currency: column.simboloMoneda ?? 'S/' }}</span>\n </span>\n }\n</ng-template>\n\n<!--<jvs-column-type [column]=\"column\" [cellTemplate]=\"cellTemplate\" [columnFooterTemplate]=\"columnFooterTemplate\"></jvs-column-type>-->\n\n<ng-container matColumnDef=\"{{ column.property }}\">\n <!-- Definici\u00F3n del encabezado de la columna -->\n <th *matHeaderCellDef [ngClass]=\"column.cssClassesTH\" class=\"uppercase text-center\" mat-header-cell mat-sort-header\n [disabled]=\"column.sort === false\">\n <span [innerHTML]=\"column.label\">{{ column.label }} </span>\n </th>\n\n <!-- Cuerpo de la celda, definido por los hijos -->\n <td *matCellDef=\"let row\" [ngClass]=\"column.cssClasses\" mat-cell (click)=\"accionClick(row, $event)\">\n\n <ng-container [ngTemplateOutlet]=\"cellTemplate\" [ngTemplateOutletContext]=\"{row}\"></ng-container>\n\n </td>\n\n <th *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" mat-footer-cell>\n @if (column.transformarFooter) {\n <span\n [class.text-sky-700]=\"column.transformarFooter() >= 0\"\n [class.text-red-700]=\"column.transformarFooter() < 0\"\n >\n <span>{{ column.transformarFooter() | currency: column.simboloMoneda ?? 'S/' }}</span>\n </span>\n }\n </th>\n</ng-container>\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i2.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i2.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i2.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i2.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i2.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i3.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "directive", type: i4.JvsPopoverDirective, selector: "[jvsPopover]", inputs: ["jvsPopover", "context", "trigger", "position", "customClass"] }, { kind: "pipe", type: i1.DecimalPipe, name: "number" }, { kind: "pipe", type: i1.CurrencyPipe, name: "currency" }] });
1436
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.18", type: ColumnTypeMoneyComponent, isStandalone: false, selector: "jvs-column-type-money", inputs: { column: "column" }, usesInheritance: true, ngImport: i0, template: "<ng-template #cellTemplate let-row=\"row\">\n @if (value(row)) {\n <span [ngClass]=\"column.textCss\"\n [class.text-sky-700]=\"(value(row)) >= 0\" [class.text-red-700]=\"(value(row)) < 0\"\n [jvsPopover]=\"(column.popover?.template || column.popover?.content?.(row)) ?? null\"\n [context]=\"row\"\n [trigger]=\"column.popover?.trigger || 'hover'\"\n [position]=\"column.popover?.position || 'bottom'\"\n [customClass]=\"column.popover?.customClass || ''\"\n (click)=\"accionClick(row, $event)\">{{ value(row) | number: (column.format || '1.2-2') }}</span>\n }\n</ng-template>\n<ng-template #columnFooterTemplate let-row=\"row\">\n @if (column.transformarFooter) {\n <span\n [class.text-sky-700]=\"column.transformarFooter() >= 0\"\n [class.text-red-700]=\"column.transformarFooter() < 0\"\n >\n <span>{{ column.transformarFooter() | currency: column.simboloMoneda ?? 'S/' }}</span>\n </span>\n }\n</ng-template>\n\n<!--<jvs-column-type [column]=\"column\" [cellTemplate]=\"cellTemplate\" [columnFooterTemplate]=\"columnFooterTemplate\"></jvs-column-type>-->\n\n<ng-container matColumnDef=\"{{ column.property }}\">\n <!-- Definici\u00F3n del encabezado de la columna -->\n <th *matHeaderCellDef [ngClass]=\"column.cssClassesTH\" class=\"uppercase\" [class]=\"claseCabecera\" [attr.data-alineacion]=\"alineacionCabecera\" [matTooltip]=\"column.labelTooltip ?? ''\" mat-header-cell mat-sort-header\n [disabled]=\"column.sort === false\">\n <span [innerHTML]=\"column.label\">{{ column.label }} </span>\n </th>\n\n <!-- Cuerpo de la celda, definido por los hijos -->\n <td *matCellDef=\"let row\" [ngClass]=\"column.cssClasses\" mat-cell (click)=\"accionClick(row, $event)\">\n\n <ng-container [ngTemplateOutlet]=\"cellTemplate\" [ngTemplateOutletContext]=\"{row}\"></ng-container>\n\n </td>\n\n <th *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" mat-footer-cell>\n @if (column.transformarFooter) {\n <span\n [class.text-sky-700]=\"column.transformarFooter() >= 0\"\n [class.text-red-700]=\"column.transformarFooter() < 0\"\n >\n <span>{{ column.transformarFooter() | currency: column.simboloMoneda ?? 'S/' }}</span>\n </span>\n }\n </th>\n</ng-container>\n", dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i2.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i2.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i2.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i2.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i2.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i3.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: i6.JvsPopoverDirective, selector: "[jvsPopover]", inputs: ["jvsPopover", "context", "trigger", "position", "customClass"] }, { kind: "pipe", type: i1$1.DecimalPipe, name: "number" }, { kind: "pipe", type: i1$1.CurrencyPipe, name: "currency" }] });
578
1437
  }
579
1438
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ColumnTypeMoneyComponent, decorators: [{
580
1439
  type: Component,
581
- args: [{ selector: 'jvs-column-type-money', standalone: false, template: "<ng-template #cellTemplate let-row=\"row\">\n @if (value(row)) {\n <span [ngClass]=\"column.textCss\"\n [class.text-sky-700]=\"(value(row)) >= 0\" [class.text-red-700]=\"(value(row)) < 0\"\n [jvsPopover]=\"(column.popover?.template || column.popover?.content?.(row)) ?? null\"\n [context]=\"row\"\n [trigger]=\"column.popover?.trigger || 'hover'\"\n [position]=\"column.popover?.position || 'bottom'\"\n [customClass]=\"column.popover?.customClass || ''\"\n (click)=\"accionClick(row, $event)\">{{ value(row) | number: (column.format || '1.2-2') }}</span>\n }\n</ng-template>\n<ng-template #columnFooterTemplate let-row=\"row\">\n @if (column.transformarFooter) {\n <span\n [class.text-sky-700]=\"column.transformarFooter() >= 0\"\n [class.text-red-700]=\"column.transformarFooter() < 0\"\n >\n <span>{{ column.transformarFooter() | currency: column.simboloMoneda ?? 'S/' }}</span>\n </span>\n }\n</ng-template>\n\n<!--<jvs-column-type [column]=\"column\" [cellTemplate]=\"cellTemplate\" [columnFooterTemplate]=\"columnFooterTemplate\"></jvs-column-type>-->\n\n<ng-container matColumnDef=\"{{ column.property }}\">\n <!-- Definici\u00F3n del encabezado de la columna -->\n <th *matHeaderCellDef [ngClass]=\"column.cssClassesTH\" class=\"uppercase text-center\" mat-header-cell mat-sort-header\n [disabled]=\"column.sort === false\">\n <span [innerHTML]=\"column.label\">{{ column.label }} </span>\n </th>\n\n <!-- Cuerpo de la celda, definido por los hijos -->\n <td *matCellDef=\"let row\" [ngClass]=\"column.cssClasses\" mat-cell (click)=\"accionClick(row, $event)\">\n\n <ng-container [ngTemplateOutlet]=\"cellTemplate\" [ngTemplateOutletContext]=\"{row}\"></ng-container>\n\n </td>\n\n <th *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" mat-footer-cell>\n @if (column.transformarFooter) {\n <span\n [class.text-sky-700]=\"column.transformarFooter() >= 0\"\n [class.text-red-700]=\"column.transformarFooter() < 0\"\n >\n <span>{{ column.transformarFooter() | currency: column.simboloMoneda ?? 'S/' }}</span>\n </span>\n }\n </th>\n</ng-container>\n" }]
1440
+ args: [{ selector: 'jvs-column-type-money', standalone: false, template: "<ng-template #cellTemplate let-row=\"row\">\n @if (value(row)) {\n <span [ngClass]=\"column.textCss\"\n [class.text-sky-700]=\"(value(row)) >= 0\" [class.text-red-700]=\"(value(row)) < 0\"\n [jvsPopover]=\"(column.popover?.template || column.popover?.content?.(row)) ?? null\"\n [context]=\"row\"\n [trigger]=\"column.popover?.trigger || 'hover'\"\n [position]=\"column.popover?.position || 'bottom'\"\n [customClass]=\"column.popover?.customClass || ''\"\n (click)=\"accionClick(row, $event)\">{{ value(row) | number: (column.format || '1.2-2') }}</span>\n }\n</ng-template>\n<ng-template #columnFooterTemplate let-row=\"row\">\n @if (column.transformarFooter) {\n <span\n [class.text-sky-700]=\"column.transformarFooter() >= 0\"\n [class.text-red-700]=\"column.transformarFooter() < 0\"\n >\n <span>{{ column.transformarFooter() | currency: column.simboloMoneda ?? 'S/' }}</span>\n </span>\n }\n</ng-template>\n\n<!--<jvs-column-type [column]=\"column\" [cellTemplate]=\"cellTemplate\" [columnFooterTemplate]=\"columnFooterTemplate\"></jvs-column-type>-->\n\n<ng-container matColumnDef=\"{{ column.property }}\">\n <!-- Definici\u00F3n del encabezado de la columna -->\n <th *matHeaderCellDef [ngClass]=\"column.cssClassesTH\" class=\"uppercase\" [class]=\"claseCabecera\" [attr.data-alineacion]=\"alineacionCabecera\" [matTooltip]=\"column.labelTooltip ?? ''\" mat-header-cell mat-sort-header\n [disabled]=\"column.sort === false\">\n <span [innerHTML]=\"column.label\">{{ column.label }} </span>\n </th>\n\n <!-- Cuerpo de la celda, definido por los hijos -->\n <td *matCellDef=\"let row\" [ngClass]=\"column.cssClasses\" mat-cell (click)=\"accionClick(row, $event)\">\n\n <ng-container [ngTemplateOutlet]=\"cellTemplate\" [ngTemplateOutletContext]=\"{row}\"></ng-container>\n\n </td>\n\n <th *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" mat-footer-cell>\n @if (column.transformarFooter) {\n <span\n [class.text-sky-700]=\"column.transformarFooter() >= 0\"\n [class.text-red-700]=\"column.transformarFooter() < 0\"\n >\n <span>{{ column.transformarFooter() | currency: column.simboloMoneda ?? 'S/' }}</span>\n </span>\n }\n </th>\n</ng-container>\n" }]
582
1441
  }], propDecorators: { column: [{
583
1442
  type: Input,
584
1443
  args: [{ required: true }]
@@ -592,12 +1451,36 @@ class ColumnTypeIconsComponent extends ColumnTypeComponent {
592
1451
  }
593
1452
  return columna.items;
594
1453
  }
1454
+ /** Tooltip del ícono: `tooltip` (o el antiguo `toolTip`) o el campo `tooltipField` / `toolTipField` del registro. */
1455
+ tooltipIcono(icon, row) {
1456
+ return icon.tooltip ?? icon.toolTip ?? row?.[icon.tooltipField ?? icon.toolTipField ?? '_field_'];
1457
+ }
1458
+ tieneTooltip(icon) {
1459
+ return !!(icon.tooltip ?? icon.toolTip) || !!(icon.tooltipField ?? icon.toolTipField);
1460
+ }
595
1461
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ColumnTypeIconsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
596
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.18", type: ColumnTypeIconsComponent, isStandalone: false, selector: "jvs-column-type-icons", inputs: { column: "column" }, usesInheritance: true, ngImport: i0, template: "<ng-template #cellTemplate let-row=\"row\">\n <div class=\"flex items-center justify-center\" [ngClass]=\"{ '-space-x-1': !column.iconsDef.soloIcono }\"\n [jvsPopover]=\"(column.popover?.template || column.popover?.content?.(row)) ?? null\"\n [context]=\"row\"\n [trigger]=\"column.popover?.trigger || 'hover'\"\n [position]=\"column.popover?.position || 'bottom'\"\n [customClass]=\"column.popover?.customClass || ''\">\n @for (icon of obtenerItems(column.iconsDef, row); track icon) {\n @if (!column.iconsDef.soloIcono) {\n @if (!icon.esVisible || icon.esVisible(row)) {\n <button matRipple type=\"button\"\n (click)=\"icon.click ? icon.click(row) : false; $event.stopPropagation()\"\n class=\"flex items-center justify-center p-1 rounded border shadow-sm hover:shadow-lg\"\n [ngClass]=\"icon.contentCss\"\n [matTooltip]=\"icon.toolTip ?? row[icon.toolTipField ?? '_field_']\"\n [matTooltipDisabled]=\"!icon.toolTip && !icon.toolTipField\"\n >\n <ng-container [ngTemplateOutlet]=\"iconoConTamanio\"\n [ngTemplateOutletContext]=\"{icon: icon.icon, iconClass: icon.cssClass, size: (icon.iconSize ?? column.iconsDef?.iconSize)}\"></ng-container>\n </button>\n }\n } @else {\n @if (!icon.esVisible || icon.esVisible(row)) {\n <div [ngClass]=\"icon.contentCss\"\n class=\"flex items-center\"\n [matTooltip]=\"icon.toolTip ?? row[icon.toolTipField ?? '_field_']\"\n [matTooltipDisabled]=\"!icon.toolTip && !icon.toolTipField\"\n >\n <ng-container [ngTemplateOutlet]=\"iconoConTamanio\"\n [ngTemplateOutletContext]=\"{icon: icon.icon, iconClass: icon.cssClass, size: (icon.iconSize ?? column.iconsDef?.iconSize)}\"></ng-container>\n </div>\n }\n }\n }\n </div>\n</ng-template>\n\n<ng-container matColumnDef=\"{{ column.property }}\">\n <!-- Definici\u00F3n del encabezado de la columna -->\n <th *matHeaderCellDef [ngClass]=\"column.cssClassesTH\" class=\"uppercase text-center\" mat-header-cell mat-sort-header\n [disabled]=\"column.sort === false\">\n <span [innerHTML]=\"column.label\">{{ column.label }} </span>\n </th>\n\n <!-- Cuerpo de la celda, definido por los hijos -->\n <td *matCellDef=\"let row\" [ngClass]=\"column.cssClasses\" mat-cell (click)=\"accionClick(row, $event)\">\n\n <ng-container [ngTemplateOutlet]=\"cellTemplate\" [ngTemplateOutletContext]=\"{row}\"></ng-container>\n\n </td>\n\n <th *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" mat-footer-cell>\n {{ column.transformarFooter ? column.transformarFooter() : '' }}\n </th>\n</ng-container>\n\n\n<ng-template #iconoConTamanio let-icon=\"icon\" let-iconClass=\"iconClass\" let-size=\"size\">\n @if (size) {\n <mat-icon [svgIcon]=\"icon\" [ngClass]=\"iconClass\" [inline]=\"true\"\n [style.font-size]=\"size\"\n [style.height]=\"size\"\n [style.width]=\"size\"\n ></mat-icon>\n }\n @if (!size) {\n <mat-icon [svgIcon]=\"icon\" [ngClass]=\"iconClass\"></mat-icon>\n }\n</ng-template>\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i2.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i2.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i2.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i2.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i2.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i3.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: i5$1.MatRipple, selector: "[mat-ripple], [matRipple]", inputs: ["matRippleColor", "matRippleUnbounded", "matRippleCentered", "matRippleRadius", "matRippleAnimation", "matRippleDisabled", "matRippleTrigger"], exportAs: ["matRipple"] }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i4.JvsPopoverDirective, selector: "[jvsPopover]", inputs: ["jvsPopover", "context", "trigger", "position", "customClass"] }] });
1462
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.18", type: ColumnTypeIconsComponent, isStandalone: false, selector: "jvs-column-type-icons", inputs: { column: "column" }, usesInheritance: true, ngImport: i0, template: "<ng-template #cellTemplate let-row=\"row\">\n <div class=\"flex items-center justify-center\" [ngClass]=\"{ '-space-x-1': !column.iconsDef.soloIcono }\"\n [jvsPopover]=\"(column.popover?.template || column.popover?.content?.(row)) ?? null\"\n [context]=\"row\"\n [trigger]=\"column.popover?.trigger || 'hover'\"\n [position]=\"column.popover?.position || 'bottom'\"\n [customClass]=\"column.popover?.customClass || ''\">\n @for (icon of obtenerItems(column.iconsDef, row); track icon) {\n @if (!column.iconsDef.soloIcono) {\n @if (!icon.esVisible || icon.esVisible(row)) {\n <button matRipple type=\"button\"\n (click)=\"icon.click ? icon.click(row) : false; $event.stopPropagation()\"\n class=\"flex items-center justify-center p-1 rounded border shadow-sm hover:shadow-lg\"\n [ngClass]=\"icon.contentCss\"\n [matTooltip]=\"tooltipIcono(icon, row)\"\n [matTooltipDisabled]=\"!tieneTooltip(icon)\"\n >\n <ng-container [ngTemplateOutlet]=\"iconoConTamanio\"\n [ngTemplateOutletContext]=\"{icon: icon.icon, iconClass: icon.cssClass, size: (icon.iconSize ?? column.iconsDef?.iconSize)}\"></ng-container>\n </button>\n }\n } @else {\n @if (!icon.esVisible || icon.esVisible(row)) {\n <div [ngClass]=\"icon.contentCss\"\n class=\"flex items-center\"\n [matTooltip]=\"tooltipIcono(icon, row)\"\n [matTooltipDisabled]=\"!tieneTooltip(icon)\"\n >\n <ng-container [ngTemplateOutlet]=\"iconoConTamanio\"\n [ngTemplateOutletContext]=\"{icon: icon.icon, iconClass: icon.cssClass, size: (icon.iconSize ?? column.iconsDef?.iconSize)}\"></ng-container>\n </div>\n }\n }\n }\n </div>\n</ng-template>\n\n<ng-container matColumnDef=\"{{ column.property }}\">\n <!-- Definici\u00F3n del encabezado de la columna -->\n <th *matHeaderCellDef [ngClass]=\"column.cssClassesTH\" class=\"uppercase\" [class]=\"claseCabecera\" [attr.data-alineacion]=\"alineacionCabecera\" [matTooltip]=\"column.labelTooltip ?? ''\" mat-header-cell mat-sort-header\n [disabled]=\"column.sort === false\">\n <span [innerHTML]=\"column.label\">{{ column.label }} </span>\n </th>\n\n <!-- Cuerpo de la celda, definido por los hijos -->\n <td *matCellDef=\"let row\" [ngClass]=\"column.cssClasses\" mat-cell (click)=\"accionClick(row, $event)\">\n\n <ng-container [ngTemplateOutlet]=\"cellTemplate\" [ngTemplateOutletContext]=\"{row}\"></ng-container>\n\n </td>\n\n <th *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" mat-footer-cell>\n {{ column.transformarFooter ? column.transformarFooter() : '' }}\n </th>\n</ng-container>\n\n\n<ng-template #iconoConTamanio let-icon=\"icon\" let-iconClass=\"iconClass\" let-size=\"size\">\n @if (size) {\n <mat-icon [svgIcon]=\"icon\" [ngClass]=\"iconClass\" [inline]=\"true\"\n [style.font-size]=\"size\"\n [style.height]=\"size\"\n [style.width]=\"size\"\n ></mat-icon>\n }\n @if (!size) {\n <mat-icon [svgIcon]=\"icon\" [ngClass]=\"iconClass\"></mat-icon>\n }\n</ng-template>\n", dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i2.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i2.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i2.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i2.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i2.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i3.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: i5.MatRipple, selector: "[mat-ripple], [matRipple]", inputs: ["matRippleColor", "matRippleUnbounded", "matRippleCentered", "matRippleRadius", "matRippleAnimation", "matRippleDisabled", "matRippleTrigger"], exportAs: ["matRipple"] }, { kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i6.JvsPopoverDirective, selector: "[jvsPopover]", inputs: ["jvsPopover", "context", "trigger", "position", "customClass"] }] });
597
1463
  }
598
1464
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ColumnTypeIconsComponent, decorators: [{
599
1465
  type: Component,
600
- args: [{ selector: 'jvs-column-type-icons', standalone: false, template: "<ng-template #cellTemplate let-row=\"row\">\n <div class=\"flex items-center justify-center\" [ngClass]=\"{ '-space-x-1': !column.iconsDef.soloIcono }\"\n [jvsPopover]=\"(column.popover?.template || column.popover?.content?.(row)) ?? null\"\n [context]=\"row\"\n [trigger]=\"column.popover?.trigger || 'hover'\"\n [position]=\"column.popover?.position || 'bottom'\"\n [customClass]=\"column.popover?.customClass || ''\">\n @for (icon of obtenerItems(column.iconsDef, row); track icon) {\n @if (!column.iconsDef.soloIcono) {\n @if (!icon.esVisible || icon.esVisible(row)) {\n <button matRipple type=\"button\"\n (click)=\"icon.click ? icon.click(row) : false; $event.stopPropagation()\"\n class=\"flex items-center justify-center p-1 rounded border shadow-sm hover:shadow-lg\"\n [ngClass]=\"icon.contentCss\"\n [matTooltip]=\"icon.toolTip ?? row[icon.toolTipField ?? '_field_']\"\n [matTooltipDisabled]=\"!icon.toolTip && !icon.toolTipField\"\n >\n <ng-container [ngTemplateOutlet]=\"iconoConTamanio\"\n [ngTemplateOutletContext]=\"{icon: icon.icon, iconClass: icon.cssClass, size: (icon.iconSize ?? column.iconsDef?.iconSize)}\"></ng-container>\n </button>\n }\n } @else {\n @if (!icon.esVisible || icon.esVisible(row)) {\n <div [ngClass]=\"icon.contentCss\"\n class=\"flex items-center\"\n [matTooltip]=\"icon.toolTip ?? row[icon.toolTipField ?? '_field_']\"\n [matTooltipDisabled]=\"!icon.toolTip && !icon.toolTipField\"\n >\n <ng-container [ngTemplateOutlet]=\"iconoConTamanio\"\n [ngTemplateOutletContext]=\"{icon: icon.icon, iconClass: icon.cssClass, size: (icon.iconSize ?? column.iconsDef?.iconSize)}\"></ng-container>\n </div>\n }\n }\n }\n </div>\n</ng-template>\n\n<ng-container matColumnDef=\"{{ column.property }}\">\n <!-- Definici\u00F3n del encabezado de la columna -->\n <th *matHeaderCellDef [ngClass]=\"column.cssClassesTH\" class=\"uppercase text-center\" mat-header-cell mat-sort-header\n [disabled]=\"column.sort === false\">\n <span [innerHTML]=\"column.label\">{{ column.label }} </span>\n </th>\n\n <!-- Cuerpo de la celda, definido por los hijos -->\n <td *matCellDef=\"let row\" [ngClass]=\"column.cssClasses\" mat-cell (click)=\"accionClick(row, $event)\">\n\n <ng-container [ngTemplateOutlet]=\"cellTemplate\" [ngTemplateOutletContext]=\"{row}\"></ng-container>\n\n </td>\n\n <th *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" mat-footer-cell>\n {{ column.transformarFooter ? column.transformarFooter() : '' }}\n </th>\n</ng-container>\n\n\n<ng-template #iconoConTamanio let-icon=\"icon\" let-iconClass=\"iconClass\" let-size=\"size\">\n @if (size) {\n <mat-icon [svgIcon]=\"icon\" [ngClass]=\"iconClass\" [inline]=\"true\"\n [style.font-size]=\"size\"\n [style.height]=\"size\"\n [style.width]=\"size\"\n ></mat-icon>\n }\n @if (!size) {\n <mat-icon [svgIcon]=\"icon\" [ngClass]=\"iconClass\"></mat-icon>\n }\n</ng-template>\n" }]
1466
+ args: [{ selector: 'jvs-column-type-icons', standalone: false, template: "<ng-template #cellTemplate let-row=\"row\">\n <div class=\"flex items-center justify-center\" [ngClass]=\"{ '-space-x-1': !column.iconsDef.soloIcono }\"\n [jvsPopover]=\"(column.popover?.template || column.popover?.content?.(row)) ?? null\"\n [context]=\"row\"\n [trigger]=\"column.popover?.trigger || 'hover'\"\n [position]=\"column.popover?.position || 'bottom'\"\n [customClass]=\"column.popover?.customClass || ''\">\n @for (icon of obtenerItems(column.iconsDef, row); track icon) {\n @if (!column.iconsDef.soloIcono) {\n @if (!icon.esVisible || icon.esVisible(row)) {\n <button matRipple type=\"button\"\n (click)=\"icon.click ? icon.click(row) : false; $event.stopPropagation()\"\n class=\"flex items-center justify-center p-1 rounded border shadow-sm hover:shadow-lg\"\n [ngClass]=\"icon.contentCss\"\n [matTooltip]=\"tooltipIcono(icon, row)\"\n [matTooltipDisabled]=\"!tieneTooltip(icon)\"\n >\n <ng-container [ngTemplateOutlet]=\"iconoConTamanio\"\n [ngTemplateOutletContext]=\"{icon: icon.icon, iconClass: icon.cssClass, size: (icon.iconSize ?? column.iconsDef?.iconSize)}\"></ng-container>\n </button>\n }\n } @else {\n @if (!icon.esVisible || icon.esVisible(row)) {\n <div [ngClass]=\"icon.contentCss\"\n class=\"flex items-center\"\n [matTooltip]=\"tooltipIcono(icon, row)\"\n [matTooltipDisabled]=\"!tieneTooltip(icon)\"\n >\n <ng-container [ngTemplateOutlet]=\"iconoConTamanio\"\n [ngTemplateOutletContext]=\"{icon: icon.icon, iconClass: icon.cssClass, size: (icon.iconSize ?? column.iconsDef?.iconSize)}\"></ng-container>\n </div>\n }\n }\n }\n </div>\n</ng-template>\n\n<ng-container matColumnDef=\"{{ column.property }}\">\n <!-- Definici\u00F3n del encabezado de la columna -->\n <th *matHeaderCellDef [ngClass]=\"column.cssClassesTH\" class=\"uppercase\" [class]=\"claseCabecera\" [attr.data-alineacion]=\"alineacionCabecera\" [matTooltip]=\"column.labelTooltip ?? ''\" mat-header-cell mat-sort-header\n [disabled]=\"column.sort === false\">\n <span [innerHTML]=\"column.label\">{{ column.label }} </span>\n </th>\n\n <!-- Cuerpo de la celda, definido por los hijos -->\n <td *matCellDef=\"let row\" [ngClass]=\"column.cssClasses\" mat-cell (click)=\"accionClick(row, $event)\">\n\n <ng-container [ngTemplateOutlet]=\"cellTemplate\" [ngTemplateOutletContext]=\"{row}\"></ng-container>\n\n </td>\n\n <th *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" mat-footer-cell>\n {{ column.transformarFooter ? column.transformarFooter() : '' }}\n </th>\n</ng-container>\n\n\n<ng-template #iconoConTamanio let-icon=\"icon\" let-iconClass=\"iconClass\" let-size=\"size\">\n @if (size) {\n <mat-icon [svgIcon]=\"icon\" [ngClass]=\"iconClass\" [inline]=\"true\"\n [style.font-size]=\"size\"\n [style.height]=\"size\"\n [style.width]=\"size\"\n ></mat-icon>\n }\n @if (!size) {\n <mat-icon [svgIcon]=\"icon\" [ngClass]=\"iconClass\"></mat-icon>\n }\n</ng-template>\n" }]
1467
+ }], propDecorators: { column: [{
1468
+ type: Input,
1469
+ args: [{ required: true }]
1470
+ }] } });
1471
+
1472
+ /** Columna `type: 'arbol'`: sangría + plegar/desplegar + el texto de la columna. */
1473
+ class ColumnTypeArbolComponent extends ColumnTypeComponent {
1474
+ column = {};
1475
+ valor(row) {
1476
+ return this.column.transformar ? this.column.transformar(row) : row?.[this.column.property];
1477
+ }
1478
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ColumnTypeArbolComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1479
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.18", type: ColumnTypeArbolComponent, isStandalone: false, selector: "jvs-column-type-arbol", inputs: { column: "column" }, usesInheritance: true, ngImport: i0, template: "<ng-container matColumnDef=\"{{ column.property }}\">\n <th *matHeaderCellDef [ngClass]=\"column.cssClassesTH\" class=\"uppercase\" [class]=\"claseCabecera\" [attr.data-alineacion]=\"alineacionCabecera\" [matTooltip]=\"column.labelTooltip ?? ''\" mat-header-cell mat-sort-header\n [disabled]=\"column.sort === false\">\n <span [innerHTML]=\"column.label ?? ''\"></span>\n </th>\n <td *matCellDef=\"let row\" [ngClass]=\"column.cssClasses\" mat-cell (click)=\"accionClick(row, $event)\">\n <jvs-tabla-arbol-celda [fila]=\"row\">\n @if (column.celda) {\n <jvs-tabla-celda [piezas]=\"column.celda(row)\" [fila]=\"row\" [lineas]=\"column.lineas\"></jvs-tabla-celda>\n } @else {\n <ng-container>{{ valor(row) }}</ng-container>\n }\n </jvs-tabla-arbol-celda>\n </td>\n <th *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" mat-footer-cell>\n {{ column.transformarFooter ? column.transformarFooter() : '' }}\n </th>\n</ng-container>\n", dependencies: [{ kind: "component", type: TablaArbolCeldaComponent, selector: "jvs-tabla-arbol-celda", inputs: ["fila"] }, { kind: "component", type: TablaCeldaComponent, selector: "jvs-tabla-celda", inputs: ["piezas", "fila", "lineas"] }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i2.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i2.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i2.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i2.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i2.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i3.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }] });
1480
+ }
1481
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ColumnTypeArbolComponent, decorators: [{
1482
+ type: Component,
1483
+ args: [{ selector: 'jvs-column-type-arbol', standalone: false, template: "<ng-container matColumnDef=\"{{ column.property }}\">\n <th *matHeaderCellDef [ngClass]=\"column.cssClassesTH\" class=\"uppercase\" [class]=\"claseCabecera\" [attr.data-alineacion]=\"alineacionCabecera\" [matTooltip]=\"column.labelTooltip ?? ''\" mat-header-cell mat-sort-header\n [disabled]=\"column.sort === false\">\n <span [innerHTML]=\"column.label ?? ''\"></span>\n </th>\n <td *matCellDef=\"let row\" [ngClass]=\"column.cssClasses\" mat-cell (click)=\"accionClick(row, $event)\">\n <jvs-tabla-arbol-celda [fila]=\"row\">\n @if (column.celda) {\n <jvs-tabla-celda [piezas]=\"column.celda(row)\" [fila]=\"row\" [lineas]=\"column.lineas\"></jvs-tabla-celda>\n } @else {\n <ng-container>{{ valor(row) }}</ng-container>\n }\n </jvs-tabla-arbol-celda>\n </td>\n <th *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" mat-footer-cell>\n {{ column.transformarFooter ? column.transformarFooter() : '' }}\n </th>\n</ng-container>\n" }]
601
1484
  }], propDecorators: { column: [{
602
1485
  type: Input,
603
1486
  args: [{ required: true }]
@@ -612,7 +1495,10 @@ class ColumnTypeModule {
612
1495
  ColumnTypeDateComponent,
613
1496
  ColumnTypeIconsComponent,
614
1497
  ColumnTypeSinoComponent,
615
- ColumnTypeProgressbarComponent], imports: [CommonModule,
1498
+ ColumnTypeProgressbarComponent,
1499
+ ColumnTypeArbolComponent], imports: [TablaArbolCeldaComponent,
1500
+ TablaCeldaComponent,
1501
+ CommonModule,
616
1502
  MatTableModule,
617
1503
  MatSortModule,
618
1504
  MatTooltipModule,
@@ -628,8 +1514,11 @@ class ColumnTypeModule {
628
1514
  ColumnTypeDateComponent,
629
1515
  ColumnTypeIconsComponent,
630
1516
  ColumnTypeSinoComponent,
631
- ColumnTypeProgressbarComponent] });
632
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ColumnTypeModule, imports: [CommonModule,
1517
+ ColumnTypeProgressbarComponent,
1518
+ ColumnTypeArbolComponent] });
1519
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ColumnTypeModule, imports: [TablaArbolCeldaComponent,
1520
+ TablaCeldaComponent,
1521
+ CommonModule,
633
1522
  MatTableModule,
634
1523
  MatSortModule,
635
1524
  MatTooltipModule,
@@ -648,8 +1537,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImpo
648
1537
  ColumnTypeIconsComponent,
649
1538
  ColumnTypeSinoComponent,
650
1539
  ColumnTypeProgressbarComponent,
1540
+ ColumnTypeArbolComponent,
651
1541
  ],
652
1542
  imports: [
1543
+ TablaArbolCeldaComponent,
1544
+ TablaCeldaComponent,
653
1545
  CommonModule,
654
1546
  MatTableModule,
655
1547
  MatSortModule,
@@ -670,6 +1562,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImpo
670
1562
  ColumnTypeIconsComponent,
671
1563
  ColumnTypeSinoComponent,
672
1564
  ColumnTypeProgressbarComponent,
1565
+ ColumnTypeArbolComponent,
673
1566
  ]
674
1567
  }]
675
1568
  }] });
@@ -677,10 +1570,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImpo
677
1570
  class TablaMantenimientoColumnDefsComponent {
678
1571
  table;
679
1572
  cdRef;
680
- objThis;
681
1573
  nombreColeccion;
682
1574
  colDetalle;
683
1575
  chkLista; // = new DataModel();
1576
+ /** Si la fila está desplegada. Lo resuelve la tabla, que es donde vive ese estado. */
1577
+ estaExpandida = () => false;
1578
+ /** Pulsaron el botón de expandir: la tabla decide. */
1579
+ alternarExpansion = new EventEmitter();
684
1580
  chkListaChange = new EventEmitter();
685
1581
  columnDefLocales;
686
1582
  columnDefEnSubComponentes;
@@ -703,7 +1599,7 @@ class TablaMantenimientoColumnDefsComponent {
703
1599
  return column.property;
704
1600
  }
705
1601
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: TablaMantenimientoColumnDefsComponent, deps: [{ token: i2.MatTable, optional: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
706
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.18", type: TablaMantenimientoColumnDefsComponent, isStandalone: true, selector: "jvs-tabla-mantenimiento-column-defs", inputs: { objThis: "objThis", nombreColeccion: "nombreColeccion", colDetalle: "colDetalle", chkLista: "chkLista" }, outputs: { chkListaChange: "chkListaChange" }, queries: [{ propertyName: "columnDefEnSubComponentes", predicate: MatColumnDef, descendants: true }], viewQueries: [{ propertyName: "columnDefLocales", predicate: MatColumnDef, descendants: true }], ngImport: i0, template: "<ng-content></ng-content>\n\n\n\n@for (column of colDetalle; track trackByProperty($index, column)) {\n @if (column.type === 'expandir') {\n <ng-container [matColumnDef]=\"column.property\">\n <th *matHeaderCellDef class=\"w-4\" mat-header-cell> <span [innerHTML]=\"column.label ?? ''\">{{ column.label }} </span></th>\n <td *matCellDef=\"let row\" class=\"w-4 text-center\" mat-cell>\n @if (column.click) {\n <button type=\"button\" class=\"boton-circular text-primary-contrast bg-primary mat-elevation-z2\" matRipple\n (click)=\"column.click(row); row.isExpanded = !row.isExpanded; $event.stopPropagation()\"\n matTooltip=\"Expandir / Contraer\">\n <mat-icon class=\"icon-xs\" [svgIcon]=\"(row.isExpanded ? 'roundExpandLess' : 'roundExpandMore')\"></mat-icon>\n </button>\n }\n @if (!column.click) {\n <button type=\"button\" class=\"boton-circular text-primary-contrast bg-primary mat-elevation-z2\" matRipple\n (click)=\"row.isExpanded = !row.isExpanded; $event.stopPropagation()\"\n matTooltip=\"Expandir / Contraer\">\n <mat-icon class=\"icon-xs\" [svgIcon]=\"(row.isExpanded ? 'roundExpandLess' : 'roundExpandMore')\"></mat-icon>\n </button>\n }\n </td>\n <td *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" mat-footer-cell></td>\n </ng-container>\n }\n @if (column.type === 'checkbox') {\n <ng-container [matColumnDef]=\"column.property\">\n <th *matHeaderCellDef [ngClass]=\"column.cssClassesTH\" class=\"w-4 text-center\" mat-header-cell>\n @if (chkLista) {\n <mat-checkbox\n (click)=\"$event.stopPropagation()\"\n (change)=\"chkLista.checkbox.establecerTodos($event.checked)\"\n [indeterminate]=\"chkLista.checkbox.algunosActivos\"\n [checked]=\"chkLista.checkbox.todosActivos\"\n ></mat-checkbox>\n }\n </th>\n <td *matCellDef=\"let row\" class=\"w-4 text-center\" mat-cell>\n @if (chkLista) {\n <mat-checkbox\n (click)=\"$event.stopPropagation()\"\n [(ngModel)]=\"chkLista.modelosChk[chkLista.generarId(row, (column.chkField ?? column.property), column.chkFieldSeparador)]\"\n [ngModelOptions]=\"{standalone: true}\"\n ></mat-checkbox>\n }\n </td>\n <td *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" mat-footer-cell></td>\n </ng-container>\n }\n @if (column.type === 'estiloEstablecido') {\n <ng-container [matColumnDef]=\"column.property\">\n <th *matHeaderCellDef [ngClass]=\"column.cssClassesTH\" class=\"uppercase text-center\" mat-header-cell\n mat-sort-header\n [disabled]=\"column.sort === false\">\n <span [innerHTML]=\"column.label ?? ''\">{{ column.label }} </span>\n <span class=\"text-red-900 font-bold bg-white\">CONFIGURAR ESTILO ESTABLECIDO</span>\n </th>\n <td *matCellDef=\"let row\" [ngClass]=\"column.cssClasses\" mat-cell>\n {{ column.property }}\n <span class=\"text-red-900 font-bold bg-white\">CONFIGURAR ESTILO ESTABLECIDO</span>\n </td>\n <th *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" style=\"height: unset !important;\" mat-footer-cell\n [innerHTML]=\"column.transformarFooter ? column.transformarFooter() : ''\">\n </th>\n </ng-container>\n }\n @if (column.type == 'text') {\n <jvs-column-type-text [column]=\"column\"></jvs-column-type-text>\n }\n @if (column.type == 'money') {\n <jvs-column-type-money [column]=\"column\"></jvs-column-type-money>\n }\n @if (column.type == 'number') {\n <jvs-column-type-number [column]=\"column\"></jvs-column-type-number>\n }\n @if (column.type == 'date') {\n <jvs-column-type-date [column]=\"column\"></jvs-column-type-date>\n }\n @if (column.type == 'icons') {\n <jvs-column-type-icons [column]=\"column\"></jvs-column-type-icons>\n }\n @if (column.type == 'yes_no') {\n <jvs-column-type-sino [column]=\"column\"></jvs-column-type-sino>\n }\n @if (column.type == 'progress') {\n <jvs-column-type-progressbar [column]=\"column\"></jvs-column-type-progressbar>\n }\n}\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i3$1.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatRippleModule }, { kind: "directive", type: i5$1.MatRipple, selector: "[mat-ripple], [matRipple]", inputs: ["matRippleColor", "matRippleUnbounded", "matRippleCentered", "matRippleRadius", "matRippleAnimation", "matRippleDisabled", "matRippleTrigger"], exportAs: ["matRipple"] }, { kind: "ngmodule", type: MatSortModule }, { kind: "component", type: i3.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "ngmodule", type: MatTableModule }, { kind: "directive", type: i2.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i2.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i2.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i2.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i2.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i2.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: i2.MatFooterCell, selector: "mat-footer-cell, td[mat-footer-cell]" }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ColumnTypeModule }, { kind: "component", type: ColumnTypeTextComponent, selector: "jvs-column-type-text", inputs: ["column"] }, { kind: "component", type: ColumnTypeMoneyComponent, selector: "jvs-column-type-money", inputs: ["column"] }, { kind: "component", type: ColumnTypeNumberComponent, selector: "jvs-column-type-number", inputs: ["column"] }, { kind: "component", type: ColumnTypeDateComponent, selector: "jvs-column-type-date", inputs: ["column"] }, { kind: "component", type: ColumnTypeIconsComponent, selector: "jvs-column-type-icons", inputs: ["column"] }, { kind: "component", type: ColumnTypeSinoComponent, selector: "jvs-column-type-sino", inputs: ["column"] }, { kind: "component", type: ColumnTypeProgressbarComponent, selector: "jvs-column-type-progressbar", inputs: ["column"] }] });
1602
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.18", type: TablaMantenimientoColumnDefsComponent, isStandalone: true, selector: "jvs-tabla-mantenimiento-column-defs", inputs: { nombreColeccion: "nombreColeccion", colDetalle: "colDetalle", chkLista: "chkLista", estaExpandida: "estaExpandida" }, outputs: { alternarExpansion: "alternarExpansion", chkListaChange: "chkListaChange" }, queries: [{ propertyName: "columnDefEnSubComponentes", predicate: MatColumnDef, descendants: true }], viewQueries: [{ propertyName: "columnDefLocales", predicate: MatColumnDef, descendants: true }], ngImport: i0, template: "<ng-content></ng-content>\n\n\n\n@for (column of colDetalle; track trackByProperty($index, column)) {\n @if (column.type === 'expandir') {\n <ng-container [matColumnDef]=\"column.property\">\n <th *matHeaderCellDef class=\"w-4\" [matTooltip]=\"column.labelTooltip ?? ''\" mat-header-cell> <span [innerHTML]=\"column.label ?? ''\">{{ column.label }} </span></th>\n <td *matCellDef=\"let row\" class=\"w-4 text-center\" mat-cell>\n @if (column.click) {\n <button type=\"button\" class=\"boton-circular text-primary-contrast bg-primary mat-elevation-z2\" matRipple\n (click)=\"column.click(row); alternarExpansion.emit(row); $event.stopPropagation()\"\n matTooltip=\"Expandir / Contraer\">\n <mat-icon class=\"icon-xs\" [svgIcon]=\"(estaExpandida(row) ? 'roundExpandLess' : 'roundExpandMore')\"></mat-icon>\n </button>\n }\n @if (!column.click) {\n <button type=\"button\" class=\"boton-circular text-primary-contrast bg-primary mat-elevation-z2\" matRipple\n (click)=\"alternarExpansion.emit(row); $event.stopPropagation()\"\n matTooltip=\"Expandir / Contraer\">\n <mat-icon class=\"icon-xs\" [svgIcon]=\"(estaExpandida(row) ? 'roundExpandLess' : 'roundExpandMore')\"></mat-icon>\n </button>\n }\n </td>\n <td *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" mat-footer-cell></td>\n </ng-container>\n }\n @if (column.type === 'checkbox') {\n <ng-container [matColumnDef]=\"column.property\">\n <th *matHeaderCellDef [ngClass]=\"column.cssClassesTH\" class=\"w-4 text-center\" [matTooltip]=\"column.labelTooltip ?? ''\" mat-header-cell>\n @if (chkLista) {\n <mat-checkbox\n (click)=\"$event.stopPropagation()\"\n (change)=\"chkLista.checkbox.establecerTodos($event.checked)\"\n [indeterminate]=\"chkLista.checkbox.algunosActivos\"\n [checked]=\"chkLista.checkbox.todosActivos\"\n ></mat-checkbox>\n }\n </th>\n <td *matCellDef=\"let row\" class=\"w-4 text-center\" mat-cell>\n @if (chkLista) {\n <mat-checkbox\n (click)=\"$event.stopPropagation()\"\n [(ngModel)]=\"chkLista.modelosChk[chkLista.generarId(row, (column.chkField ?? column.property), column.chkFieldSeparador)]\"\n [ngModelOptions]=\"{standalone: true}\"\n ></mat-checkbox>\n }\n </td>\n <td *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" mat-footer-cell></td>\n </ng-container>\n }\n @if (column.type === 'estiloEstablecido') {\n <ng-container [matColumnDef]=\"column.property\">\n <th *matHeaderCellDef [ngClass]=\"column.cssClassesTH\" class=\"uppercase text-center\" [matTooltip]=\"column.labelTooltip ?? ''\" mat-header-cell\n mat-sort-header\n [disabled]=\"column.sort === false\">\n <span [innerHTML]=\"column.label ?? ''\">{{ column.label }} </span>\n <span class=\"text-red-900 font-bold bg-white\">CONFIGURAR ESTILO ESTABLECIDO</span>\n </th>\n <td *matCellDef=\"let row\" [ngClass]=\"column.cssClasses\" mat-cell>\n {{ column.property }}\n <span class=\"text-red-900 font-bold bg-white\">CONFIGURAR ESTILO ESTABLECIDO</span>\n </td>\n <th *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" style=\"height: unset !important;\" mat-footer-cell\n [innerHTML]=\"column.transformarFooter ? column.transformarFooter() : ''\">\n </th>\n </ng-container>\n }\n @if (column.type == 'text') {\n <jvs-column-type-text [column]=\"column\"></jvs-column-type-text>\n }\n @if (column.type == 'money') {\n <jvs-column-type-money [column]=\"column\"></jvs-column-type-money>\n }\n @if (column.type == 'number') {\n <jvs-column-type-number [column]=\"column\"></jvs-column-type-number>\n }\n @if (column.type == 'date') {\n <jvs-column-type-date [column]=\"column\"></jvs-column-type-date>\n }\n @if (column.type == 'icons') {\n <jvs-column-type-icons [column]=\"column\"></jvs-column-type-icons>\n }\n @if (column.type == 'yes_no') {\n <jvs-column-type-sino [column]=\"column\"></jvs-column-type-sino>\n }\n @if (column.type == 'arbol') {\n <jvs-column-type-arbol [column]=\"column\"></jvs-column-type-arbol>\n }\n @if (column.type == 'progress') {\n <jvs-column-type-progressbar [column]=\"column\"></jvs-column-type-progressbar>\n }\n}\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i3$1.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatRippleModule }, { kind: "directive", type: i5.MatRipple, selector: "[mat-ripple], [matRipple]", inputs: ["matRippleColor", "matRippleUnbounded", "matRippleCentered", "matRippleRadius", "matRippleAnimation", "matRippleDisabled", "matRippleTrigger"], exportAs: ["matRipple"] }, { kind: "ngmodule", type: MatSortModule }, { kind: "component", type: i3.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "ngmodule", type: MatTableModule }, { kind: "directive", type: i2.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i2.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i2.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i2.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i2.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i2.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: i2.MatFooterCell, selector: "mat-footer-cell, td[mat-footer-cell]" }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i4$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i4$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ColumnTypeModule }, { kind: "component", type: ColumnTypeTextComponent, selector: "jvs-column-type-text", inputs: ["column"] }, { kind: "component", type: ColumnTypeMoneyComponent, selector: "jvs-column-type-money", inputs: ["column"] }, { kind: "component", type: ColumnTypeNumberComponent, selector: "jvs-column-type-number", inputs: ["column"] }, { kind: "component", type: ColumnTypeDateComponent, selector: "jvs-column-type-date", inputs: ["column"] }, { kind: "component", type: ColumnTypeIconsComponent, selector: "jvs-column-type-icons", inputs: ["column"] }, { kind: "component", type: ColumnTypeSinoComponent, selector: "jvs-column-type-sino", inputs: ["column"] }, { kind: "component", type: ColumnTypeProgressbarComponent, selector: "jvs-column-type-progressbar", inputs: ["column"] }, { kind: "component", type: ColumnTypeArbolComponent, selector: "jvs-column-type-arbol", inputs: ["column"] }] });
707
1603
  }
708
1604
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: TablaMantenimientoColumnDefsComponent, decorators: [{
709
1605
  type: Component,
@@ -718,17 +1614,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImpo
718
1614
  ReactiveFormsModule,
719
1615
  FormsModule,
720
1616
  ColumnTypeModule,
721
- ], template: "<ng-content></ng-content>\n\n\n\n@for (column of colDetalle; track trackByProperty($index, column)) {\n @if (column.type === 'expandir') {\n <ng-container [matColumnDef]=\"column.property\">\n <th *matHeaderCellDef class=\"w-4\" mat-header-cell> <span [innerHTML]=\"column.label ?? ''\">{{ column.label }} </span></th>\n <td *matCellDef=\"let row\" class=\"w-4 text-center\" mat-cell>\n @if (column.click) {\n <button type=\"button\" class=\"boton-circular text-primary-contrast bg-primary mat-elevation-z2\" matRipple\n (click)=\"column.click(row); row.isExpanded = !row.isExpanded; $event.stopPropagation()\"\n matTooltip=\"Expandir / Contraer\">\n <mat-icon class=\"icon-xs\" [svgIcon]=\"(row.isExpanded ? 'roundExpandLess' : 'roundExpandMore')\"></mat-icon>\n </button>\n }\n @if (!column.click) {\n <button type=\"button\" class=\"boton-circular text-primary-contrast bg-primary mat-elevation-z2\" matRipple\n (click)=\"row.isExpanded = !row.isExpanded; $event.stopPropagation()\"\n matTooltip=\"Expandir / Contraer\">\n <mat-icon class=\"icon-xs\" [svgIcon]=\"(row.isExpanded ? 'roundExpandLess' : 'roundExpandMore')\"></mat-icon>\n </button>\n }\n </td>\n <td *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" mat-footer-cell></td>\n </ng-container>\n }\n @if (column.type === 'checkbox') {\n <ng-container [matColumnDef]=\"column.property\">\n <th *matHeaderCellDef [ngClass]=\"column.cssClassesTH\" class=\"w-4 text-center\" mat-header-cell>\n @if (chkLista) {\n <mat-checkbox\n (click)=\"$event.stopPropagation()\"\n (change)=\"chkLista.checkbox.establecerTodos($event.checked)\"\n [indeterminate]=\"chkLista.checkbox.algunosActivos\"\n [checked]=\"chkLista.checkbox.todosActivos\"\n ></mat-checkbox>\n }\n </th>\n <td *matCellDef=\"let row\" class=\"w-4 text-center\" mat-cell>\n @if (chkLista) {\n <mat-checkbox\n (click)=\"$event.stopPropagation()\"\n [(ngModel)]=\"chkLista.modelosChk[chkLista.generarId(row, (column.chkField ?? column.property), column.chkFieldSeparador)]\"\n [ngModelOptions]=\"{standalone: true}\"\n ></mat-checkbox>\n }\n </td>\n <td *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" mat-footer-cell></td>\n </ng-container>\n }\n @if (column.type === 'estiloEstablecido') {\n <ng-container [matColumnDef]=\"column.property\">\n <th *matHeaderCellDef [ngClass]=\"column.cssClassesTH\" class=\"uppercase text-center\" mat-header-cell\n mat-sort-header\n [disabled]=\"column.sort === false\">\n <span [innerHTML]=\"column.label ?? ''\">{{ column.label }} </span>\n <span class=\"text-red-900 font-bold bg-white\">CONFIGURAR ESTILO ESTABLECIDO</span>\n </th>\n <td *matCellDef=\"let row\" [ngClass]=\"column.cssClasses\" mat-cell>\n {{ column.property }}\n <span class=\"text-red-900 font-bold bg-white\">CONFIGURAR ESTILO ESTABLECIDO</span>\n </td>\n <th *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" style=\"height: unset !important;\" mat-footer-cell\n [innerHTML]=\"column.transformarFooter ? column.transformarFooter() : ''\">\n </th>\n </ng-container>\n }\n @if (column.type == 'text') {\n <jvs-column-type-text [column]=\"column\"></jvs-column-type-text>\n }\n @if (column.type == 'money') {\n <jvs-column-type-money [column]=\"column\"></jvs-column-type-money>\n }\n @if (column.type == 'number') {\n <jvs-column-type-number [column]=\"column\"></jvs-column-type-number>\n }\n @if (column.type == 'date') {\n <jvs-column-type-date [column]=\"column\"></jvs-column-type-date>\n }\n @if (column.type == 'icons') {\n <jvs-column-type-icons [column]=\"column\"></jvs-column-type-icons>\n }\n @if (column.type == 'yes_no') {\n <jvs-column-type-sino [column]=\"column\"></jvs-column-type-sino>\n }\n @if (column.type == 'progress') {\n <jvs-column-type-progressbar [column]=\"column\"></jvs-column-type-progressbar>\n }\n}\n" }]
1617
+ ], template: "<ng-content></ng-content>\n\n\n\n@for (column of colDetalle; track trackByProperty($index, column)) {\n @if (column.type === 'expandir') {\n <ng-container [matColumnDef]=\"column.property\">\n <th *matHeaderCellDef class=\"w-4\" [matTooltip]=\"column.labelTooltip ?? ''\" mat-header-cell> <span [innerHTML]=\"column.label ?? ''\">{{ column.label }} </span></th>\n <td *matCellDef=\"let row\" class=\"w-4 text-center\" mat-cell>\n @if (column.click) {\n <button type=\"button\" class=\"boton-circular text-primary-contrast bg-primary mat-elevation-z2\" matRipple\n (click)=\"column.click(row); alternarExpansion.emit(row); $event.stopPropagation()\"\n matTooltip=\"Expandir / Contraer\">\n <mat-icon class=\"icon-xs\" [svgIcon]=\"(estaExpandida(row) ? 'roundExpandLess' : 'roundExpandMore')\"></mat-icon>\n </button>\n }\n @if (!column.click) {\n <button type=\"button\" class=\"boton-circular text-primary-contrast bg-primary mat-elevation-z2\" matRipple\n (click)=\"alternarExpansion.emit(row); $event.stopPropagation()\"\n matTooltip=\"Expandir / Contraer\">\n <mat-icon class=\"icon-xs\" [svgIcon]=\"(estaExpandida(row) ? 'roundExpandLess' : 'roundExpandMore')\"></mat-icon>\n </button>\n }\n </td>\n <td *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" mat-footer-cell></td>\n </ng-container>\n }\n @if (column.type === 'checkbox') {\n <ng-container [matColumnDef]=\"column.property\">\n <th *matHeaderCellDef [ngClass]=\"column.cssClassesTH\" class=\"w-4 text-center\" [matTooltip]=\"column.labelTooltip ?? ''\" mat-header-cell>\n @if (chkLista) {\n <mat-checkbox\n (click)=\"$event.stopPropagation()\"\n (change)=\"chkLista.checkbox.establecerTodos($event.checked)\"\n [indeterminate]=\"chkLista.checkbox.algunosActivos\"\n [checked]=\"chkLista.checkbox.todosActivos\"\n ></mat-checkbox>\n }\n </th>\n <td *matCellDef=\"let row\" class=\"w-4 text-center\" mat-cell>\n @if (chkLista) {\n <mat-checkbox\n (click)=\"$event.stopPropagation()\"\n [(ngModel)]=\"chkLista.modelosChk[chkLista.generarId(row, (column.chkField ?? column.property), column.chkFieldSeparador)]\"\n [ngModelOptions]=\"{standalone: true}\"\n ></mat-checkbox>\n }\n </td>\n <td *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" mat-footer-cell></td>\n </ng-container>\n }\n @if (column.type === 'estiloEstablecido') {\n <ng-container [matColumnDef]=\"column.property\">\n <th *matHeaderCellDef [ngClass]=\"column.cssClassesTH\" class=\"uppercase text-center\" [matTooltip]=\"column.labelTooltip ?? ''\" mat-header-cell\n mat-sort-header\n [disabled]=\"column.sort === false\">\n <span [innerHTML]=\"column.label ?? ''\">{{ column.label }} </span>\n <span class=\"text-red-900 font-bold bg-white\">CONFIGURAR ESTILO ESTABLECIDO</span>\n </th>\n <td *matCellDef=\"let row\" [ngClass]=\"column.cssClasses\" mat-cell>\n {{ column.property }}\n <span class=\"text-red-900 font-bold bg-white\">CONFIGURAR ESTILO ESTABLECIDO</span>\n </td>\n <th *matFooterCellDef [ngClass]=\"column.cssFooterClasses\" style=\"height: unset !important;\" mat-footer-cell\n [innerHTML]=\"column.transformarFooter ? column.transformarFooter() : ''\">\n </th>\n </ng-container>\n }\n @if (column.type == 'text') {\n <jvs-column-type-text [column]=\"column\"></jvs-column-type-text>\n }\n @if (column.type == 'money') {\n <jvs-column-type-money [column]=\"column\"></jvs-column-type-money>\n }\n @if (column.type == 'number') {\n <jvs-column-type-number [column]=\"column\"></jvs-column-type-number>\n }\n @if (column.type == 'date') {\n <jvs-column-type-date [column]=\"column\"></jvs-column-type-date>\n }\n @if (column.type == 'icons') {\n <jvs-column-type-icons [column]=\"column\"></jvs-column-type-icons>\n }\n @if (column.type == 'yes_no') {\n <jvs-column-type-sino [column]=\"column\"></jvs-column-type-sino>\n }\n @if (column.type == 'arbol') {\n <jvs-column-type-arbol [column]=\"column\"></jvs-column-type-arbol>\n }\n @if (column.type == 'progress') {\n <jvs-column-type-progressbar [column]=\"column\"></jvs-column-type-progressbar>\n }\n}\n" }]
722
1618
  }], ctorParameters: () => [{ type: i2.MatTable, decorators: [{
723
1619
  type: Optional
724
- }] }, { type: i0.ChangeDetectorRef }], propDecorators: { objThis: [{
725
- type: Input
726
- }], nombreColeccion: [{
1620
+ }] }, { type: i0.ChangeDetectorRef }], propDecorators: { nombreColeccion: [{
727
1621
  type: Input
728
1622
  }], colDetalle: [{
729
1623
  type: Input
730
1624
  }], chkLista: [{
731
1625
  type: Input
1626
+ }], estaExpandida: [{
1627
+ type: Input
1628
+ }], alternarExpansion: [{
1629
+ type: Output
732
1630
  }], chkListaChange: [{
733
1631
  type: Output
734
1632
  }], columnDefLocales: [{
@@ -740,7 +1638,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImpo
740
1638
  }] } });
741
1639
 
742
1640
  class TablaMantenimientoMenuComponent {
743
- objThis;
744
1641
  nombreColeccion;
745
1642
  item;
746
1643
  derechosActuales;
@@ -755,7 +1652,7 @@ class TablaMantenimientoMenuComponent {
755
1652
  ngOnInit() {
756
1653
  }
757
1654
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: TablaMantenimientoMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
758
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.18", type: TablaMantenimientoMenuComponent, isStandalone: true, selector: "jvs-tabla-mantenimiento-menu", inputs: { objThis: "objThis", nombreColeccion: "nombreColeccion", item: "item", derechosActuales: "derechosActuales", subItems: "subItems", botonTemplate: "botonTemplate" }, outputs: { opcionSelecionada: "opcionSelecionada" }, viewQueries: [{ propertyName: "menu", first: true, predicate: ["menu"], descendants: true, static: true }], ngImport: i0, template: "<mat-menu #menu=\"matMenu\">\n <div class=\"mat-menu bg-white rounded mat-elevation-z8 shadow botonesContextual w-full\">\n @for (btn of subItems; track btn) {\n <ng-container *ngTemplateOutlet=\"botonTemplate; context:{btn: btn, item: item, barraSuperior: false}\"></ng-container>\n }\n </div>\n</mat-menu>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i8.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }] });
1655
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.18", type: TablaMantenimientoMenuComponent, isStandalone: true, selector: "jvs-tabla-mantenimiento-menu", inputs: { nombreColeccion: "nombreColeccion", item: "item", derechosActuales: "derechosActuales", subItems: "subItems", botonTemplate: "botonTemplate" }, outputs: { opcionSelecionada: "opcionSelecionada" }, viewQueries: [{ propertyName: "menu", first: true, predicate: ["menu"], descendants: true, static: true }], ngImport: i0, template: "<mat-menu #menu=\"matMenu\">\n <div class=\"mat-menu bg-white rounded mat-elevation-z8 shadow botonesContextual w-full\">\n @for (btn of subItems; track btn) {\n <ng-container *ngTemplateOutlet=\"botonTemplate; context:{btn: btn, item: item, barraSuperior: false}\"></ng-container>\n }\n </div>\n</mat-menu>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i8.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }] });
759
1656
  }
760
1657
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: TablaMantenimientoMenuComponent, decorators: [{
761
1658
  type: Component,
@@ -763,9 +1660,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImpo
763
1660
  CommonModule,
764
1661
  MatMenuModule,
765
1662
  ], template: "<mat-menu #menu=\"matMenu\">\n <div class=\"mat-menu bg-white rounded mat-elevation-z8 shadow botonesContextual w-full\">\n @for (btn of subItems; track btn) {\n <ng-container *ngTemplateOutlet=\"botonTemplate; context:{btn: btn, item: item, barraSuperior: false}\"></ng-container>\n }\n </div>\n</mat-menu>\n" }]
766
- }], ctorParameters: () => [], propDecorators: { objThis: [{
767
- type: Input
768
- }], nombreColeccion: [{
1663
+ }], ctorParameters: () => [], propDecorators: { nombreColeccion: [{
769
1664
  type: Input
770
1665
  }], item: [{
771
1666
  type: Input
@@ -796,7 +1691,6 @@ const getFileName = (name) => {
796
1691
  class TableUtil {
797
1692
  static exportTableToExcelV2(targetTableElm, name) {
798
1693
  const { sheetName, fileName } = getFileName(name);
799
- console.log(targetTableElm);
800
1694
  const wb = XLSX.utils.table_to_book(targetTableElm, {
801
1695
  sheet: sheetName
802
1696
  });
@@ -805,16 +1699,18 @@ class TableUtil {
805
1699
  static exportTableToExcel(tableId, name) {
806
1700
  const { sheetName, fileName } = getFileName(name);
807
1701
  const targetTableElm = document.getElementById(tableId);
808
- console.log(targetTableElm);
809
1702
  const wb = XLSX.utils.table_to_book(targetTableElm, {
810
1703
  sheet: sheetName
811
1704
  });
812
1705
  // XLSX.writeFile(wb, `${fileName}.xlsx`);
813
1706
  }
814
- static exportArrayToExcel(arr, name) {
1707
+ static exportArrayToExcel(arr, name, anchos) {
815
1708
  const { sheetName, fileName } = getFileName(name);
816
1709
  const wb = XLSX.utils.book_new();
817
1710
  const ws = XLSX.utils.json_to_sheet(arr, { dateNF: 'dd/MM/yyyy' });
1711
+ if (anchos) {
1712
+ ws['!cols'] = anchos;
1713
+ }
818
1714
  XLSX.utils.book_append_sheet(wb, ws, sheetName);
819
1715
  XLSX.writeFile(wb, `${fileName}.xlsx`);
820
1716
  }
@@ -827,6 +1723,273 @@ class TableUtil {
827
1723
  }
828
1724
  }
829
1725
 
1726
+ /**
1727
+ * Columnas que caben en el ancho de la tabla (`columnasSiNoCaben="ocultar"`). Funciones puras, sin
1728
+ * DOM: la medición la hace `tabla-mantenimiento-medidor.ts` y aquí solo se decide.
1729
+ *
1730
+ * Es el modelo de DataTables Responsive: cada columna tiene un ancho "natural" (título y contenido,
1731
+ * con mínimos y topes por tipo) y se ocultan las de menor prioridad hasta que el resto quepa. Los
1732
+ * mínimos y topes son de la librería, como la densidad y la tipografía: la pantalla no pone px.
1733
+ */
1734
+ /** Ancho fijo de las columnas utilitarias (casilla, expandir, numeración, íconos). */
1735
+ const ANCHO_MINIMO_POR_TIPO = {
1736
+ checkbox: 28,
1737
+ icon_checkbox: 28,
1738
+ icon: 28,
1739
+ icons: 28,
1740
+ yes_no: 28,
1741
+ expandir: 32,
1742
+ numeracion_automatica: 32,
1743
+ };
1744
+ /** Tipos que no se parten nunca: su ancho es el de su contenido más largo. */
1745
+ const TIPOS_SIN_PARTIR = ['number', 'money', 'date', 'estado', 'progress'];
1746
+ /** Mínimo de una columna de texto (`text`, `custom`, `arbol`…), aunque su contenido sea corto. */
1747
+ const MINIMO_TEXTO = 64;
1748
+ /** Por encima de esto el texto se parte en líneas, como siempre. Incluye íconos y sangría del árbol. */
1749
+ const TOPE_TEXTO = 200;
1750
+ /** Relleno horizontal y borde de la celda. */
1751
+ const RELLENO_CELDA = 10;
1752
+ /** Flecha de orden junto al título de una columna que ordena. */
1753
+ const ANCHO_FLECHA_ORDEN = 18;
1754
+ /** Cada `mat-icon` dentro de una celda. */
1755
+ const ANCHO_ICONO_CELDA = 20;
1756
+ /** El ícono de un badge de `celda` (`badge(t, {icono})`): 10 px y su separación (2). */
1757
+ const ANCHO_ICONO_PIEZA = 12;
1758
+ /** Lo que un badge de `celda` ocupa además de su texto: su relleno (5 + 5). El espacio previo es texto. */
1759
+ const ANCHO_BADGE_EXTRA = 10;
1760
+ /** Lo que una marca de texto de `celda` ocupa además de su texto: relleno (3 + 3) y margen (2). */
1761
+ const ANCHO_MARCA_EXTRA = 8;
1762
+ /** Una imagen (avatar) de `celda`, con su espacio. */
1763
+ const ANCHO_IMAGEN_CELDA = 24;
1764
+ /** Casilla, expandir, numeración, íconos y sí/no: nunca se ocultan y miden poco. */
1765
+ function esColumnaUtilitaria(columna) {
1766
+ return columna.property === 'numeracion_automatica' || columna.type in ANCHO_MINIMO_POR_TIPO;
1767
+ }
1768
+ /**
1769
+ * La principal: la primera columna de datos, que nunca se oculta. Si declara una `prioridad` mayor
1770
+ * que 1, deja de serlo (la pantalla eligió otro orden) y no hay principal implícita.
1771
+ */
1772
+ function columnaPrincipal(columnas) {
1773
+ const primera = columnas.find(columna => !esColumnaUtilitaria(columna)) ?? null;
1774
+ return primera && (primera.prioridad ?? 1) <= 1 ? primera : null;
1775
+ }
1776
+ /** Orden en que se conservan: primero las de `prioridad` (de menor a mayor), luego el resto por posición. */
1777
+ function ordenarPorPrioridad(columnas) {
1778
+ return columnas
1779
+ .map((columna, posicion) => ({ columna, posicion }))
1780
+ .sort((a, b) => (a.columna.prioridad ?? Infinity) - (b.columna.prioridad ?? Infinity) || a.posicion - b.posicion)
1781
+ .map(({ columna }) => columna);
1782
+ }
1783
+ /** Ancho natural de la columna (px), con relleno. Sin medida, el del título y el mínimo del tipo. */
1784
+ function anchoNecesario(columna, medida) {
1785
+ const titulo = medida.titulo + (medida.ordena ? ANCHO_FLECHA_ORDEN : 0);
1786
+ const contenido = medida.contenido ?? 0;
1787
+ if (esColumnaUtilitaria(columna)) {
1788
+ const fijo = ANCHO_MINIMO_POR_TIPO[columna.type] ?? ANCHO_MINIMO_POR_TIPO['numeracion_automatica'];
1789
+ return Math.max(fijo, contenido + medida.extra + RELLENO_CELDA);
1790
+ }
1791
+ if (TIPOS_SIN_PARTIR.includes(columna.type)) {
1792
+ return Math.max(titulo, contenido + medida.extra) + RELLENO_CELDA;
1793
+ }
1794
+ // La sangría del árbol y los íconos cuentan dentro del tope: en un nodo profundo el texto se
1795
+ // parte antes, en vez de pedir más ancho y empujar fuera las demás columnas.
1796
+ return Math.max(titulo, MINIMO_TEXTO, Math.min(contenido + medida.extra, TOPE_TEXTO)) + RELLENO_CELDA;
1797
+ }
1798
+ /**
1799
+ * Qué columnas no caben. `candidatas` son las que se pintarían (en la lista y con `visible`
1800
+ * verdadero), en su orden; `elegidas`, las que el usuario marcó en el menú, que van fijas como la
1801
+ * principal, las de prioridad 1 y las utilitarias.
1802
+ *
1803
+ * El corte es acumulativo, como en DataTables: en cuanto una no cabe, las de menor prioridad
1804
+ * tampoco se pintan, aunque alguna fuera estrecha. Si ni las fijas caben, se ocultan todas las
1805
+ * demás y el texto de las fijas se parte, como hoy.
1806
+ */
1807
+ function calcularColumnasOcultas(candidatas, necesario, disponible, elegidas = new Set()) {
1808
+ const principal = columnaPrincipal(candidatas);
1809
+ const esFija = (columna) => esColumnaUtilitaria(columna)
1810
+ || columna === principal
1811
+ || columna.prioridad === 1
1812
+ || elegidas.has(columna.property);
1813
+ const ancho = (columna) => necesario.get(columna.property) ?? 0;
1814
+ let acumulado = candidatas.filter(esFija).reduce((suma, columna) => suma + ancho(columna), 0);
1815
+ const ocultas = new Set();
1816
+ let cortado = false;
1817
+ for (const columna of ordenarPorPrioridad(candidatas.filter(columna => !esFija(columna)))) {
1818
+ if (!cortado && acumulado + ancho(columna) <= disponible) {
1819
+ acumulado += ancho(columna);
1820
+ }
1821
+ else {
1822
+ cortado = true;
1823
+ ocultas.add(columna.property);
1824
+ }
1825
+ }
1826
+ return ocultas;
1827
+ }
1828
+ /** Si dos conjuntos tienen lo mismo (para no reescribir la señal sin cambios). */
1829
+ function mismoConjunto(a, b) {
1830
+ return a.size === b.size && [...a].every(valor => b.has(valor));
1831
+ }
1832
+
1833
+ /** Filas que se miden como máximo. */
1834
+ const FILAS_MEDIDAS = 30;
1835
+ /** Mide con un canvas; sin canvas (SSR), 7 px por carácter. */
1836
+ function crearMedidorCanvas() {
1837
+ const contexto = typeof document === 'undefined' ? null : document.createElement('canvas').getContext('2d');
1838
+ return (texto, fuente) => {
1839
+ if (!contexto) {
1840
+ return texto.length * 7;
1841
+ }
1842
+ contexto.font = fuente;
1843
+ return contexto.measureText(texto).width;
1844
+ };
1845
+ }
1846
+ /** Cómo mide la tabla los textos. Se sustituye en las pruebas por uno fijo por carácter. */
1847
+ const MEDIR_TEXTO_TABLA = new InjectionToken('MEDIR_TEXTO_TABLA', {
1848
+ providedIn: 'root',
1849
+ factory: crearMedidorCanvas,
1850
+ });
1851
+ /** Fuente de un elemento, armada a mano: el atajo `font` puede venir vacío. */
1852
+ function fuenteDe(elemento) {
1853
+ const estilo = getComputedStyle(elemento);
1854
+ return `${estilo.fontStyle} ${estilo.fontWeight} ${estilo.fontSize} ${estilo.fontFamily}`;
1855
+ }
1856
+ /** Clase que pone el CDK en las celdas de la columna (`cdk-column-<nombre>`). */
1857
+ function claseColumna(property) {
1858
+ return `cdk-column-${property.replace(/[^a-z0-9_-]/gi, '-')}`;
1859
+ }
1860
+ /** Texto visible de un elemento en una sola línea. */
1861
+ function textoDe(elemento) {
1862
+ return textoSinOculto(elemento).replace(/\s+/g, ' ').trim();
1863
+ }
1864
+ /**
1865
+ * `textContent` sin el texto para lectores de pantalla de `<jvs-tabla-celda>` (clase
1866
+ * `jvs-celda-oculto`), que no ocupa espacio. Sin esa clase en la celda, es `textContent` tal cual.
1867
+ */
1868
+ function textoSinOculto(elemento) {
1869
+ if (!elemento.querySelector('.jvs-celda-oculto')) {
1870
+ return elemento.textContent ?? '';
1871
+ }
1872
+ let texto = '';
1873
+ const recorrer = (nodo) => {
1874
+ nodo.childNodes.forEach(hijo => {
1875
+ if (hijo.nodeType === Node.TEXT_NODE) {
1876
+ texto += hijo.textContent ?? '';
1877
+ }
1878
+ else if (hijo.nodeType === Node.ELEMENT_NODE && !hijo.classList.contains('jvs-celda-oculto')) {
1879
+ recorrer(hijo);
1880
+ }
1881
+ });
1882
+ };
1883
+ recorrer(elemento);
1884
+ return texto;
1885
+ }
1886
+ /**
1887
+ * Lo que ocupa una celda además del texto: sus íconos, la sangría del árbol y, en las de `celda`,
1888
+ * el relleno de badges y marcas y las imágenes.
1889
+ */
1890
+ function extraDe(celda) {
1891
+ let extra = 0;
1892
+ const arbol = celda.querySelector('jvs-tabla-arbol-celda');
1893
+ if (arbol) {
1894
+ // Sangría (ancho en línea, sin leer el layout) + botón o espacio de plegar (14 + 2).
1895
+ const sangria = arbol.firstElementChild;
1896
+ extra += (parseFloat(sangria?.style.width ?? '') || 0) + 16;
1897
+ }
1898
+ celda.querySelectorAll('mat-icon').forEach(icono => {
1899
+ if (icono.closest('.jvs-badge')) {
1900
+ // El ícono de un badge mide 10 px, no 20. (El de una marca sigue contando 20, como antes.)
1901
+ extra += ANCHO_ICONO_PIEZA;
1902
+ }
1903
+ else if (!arbol || !icono.closest('button')) {
1904
+ extra += ANCHO_ICONO_CELDA;
1905
+ }
1906
+ });
1907
+ extra += celda.querySelectorAll('.jvs-badge').length * ANCHO_BADGE_EXTRA;
1908
+ // Una marca con ícono ya cuenta por su `mat-icon`.
1909
+ celda.querySelectorAll('.jvs-marca').forEach(marca => {
1910
+ if (!marca.querySelector('mat-icon')) {
1911
+ extra += ANCHO_MARCA_EXTRA;
1912
+ }
1913
+ });
1914
+ extra += celda.querySelectorAll('.jvs-imagen-celda').length * ANCHO_IMAGEN_CELDA;
1915
+ return extra;
1916
+ }
1917
+ /** Lee las fuentes de la primera cabecera y la primera celda (dos `getComputedStyle`). */
1918
+ function leerFuentes(tabla) {
1919
+ const th = tabla.querySelector('thead th.mat-mdc-header-cell');
1920
+ if (!th) {
1921
+ return null;
1922
+ }
1923
+ const td = tabla.querySelector('td.mat-mdc-cell') ?? th;
1924
+ return {
1925
+ cabecera: fuenteDe(th),
1926
+ celda: fuenteDe(td),
1927
+ cabeceraMayusculas: getComputedStyle(th).textTransform === 'uppercase',
1928
+ };
1929
+ }
1930
+ /** Título de una columna que no está pintada, a partir de su `label` (sin HTML). */
1931
+ function medirTitulo(label, fuentes, medir) {
1932
+ let texto = (label ?? '').replace(/<br\s*\/?>/gi, ' ').replace(/<[^>]*>/g, '').replace(/\s+/g, ' ').trim();
1933
+ if (fuentes?.cabeceraMayusculas) {
1934
+ texto = texto.toUpperCase();
1935
+ }
1936
+ return medir(texto, fuentes?.cabecera ?? '');
1937
+ }
1938
+ /**
1939
+ * Mide las columnas pintadas de `properties` en la tabla. Las que no tienen cabecera en el DOM
1940
+ * (ocultas) no salen en el resultado: la tabla usa la última medida que guardó de ellas.
1941
+ */
1942
+ function medirColumnas(tabla, properties, medir, fuentes, filas = FILAS_MEDIDAS) {
1943
+ const medidas = new Map();
1944
+ for (const property of properties) {
1945
+ const clase = claseColumna(property);
1946
+ const th = tabla.querySelector(`thead th.${clase}`);
1947
+ if (!th) {
1948
+ continue;
1949
+ }
1950
+ const tituloTexto = fuentes.cabeceraMayusculas ? textoDe(th).toUpperCase() : textoDe(th);
1951
+ const celdas = Array.from(tabla.querySelectorAll(`tbody td.mat-mdc-cell.${clase}`)).slice(0, filas);
1952
+ let contenido = null;
1953
+ let extra = 0;
1954
+ for (const celda of celdas) {
1955
+ const texto = textoDe(celda);
1956
+ const extraCelda = extraDe(celda);
1957
+ const ancho = texto ? medir(texto, fuentes.celda) : 0;
1958
+ if (contenido === null || ancho + extraCelda > contenido + extra) {
1959
+ contenido = ancho;
1960
+ extra = extraCelda;
1961
+ }
1962
+ }
1963
+ medidas.set(property, {
1964
+ titulo: medir(tituloTexto, fuentes.cabecera),
1965
+ contenido,
1966
+ extra,
1967
+ ordena: !!th.querySelector('.mat-sort-header-container') && !th.classList.contains('mat-sort-header-disabled'),
1968
+ });
1969
+ }
1970
+ return medidas;
1971
+ }
1972
+
1973
+ /**
1974
+ * Configuración global de `jvs-tabla-mantenimiento` para toda la app. Sin proveerla, la tabla
1975
+ * usa sus valores por defecto (p. ej. colores estándar).
1976
+ */
1977
+ const TABLA_MANTENIMIENTO_CONFIG = new InjectionToken('TABLA_MANTENIMIENTO_CONFIG');
1978
+ /**
1979
+ * Cablea `TABLA_MANTENIMIENTO_CONFIG` en el `app.config` de la app.
1980
+ *
1981
+ * @example
1982
+ * // Todas las tablas con los colores del tema de la entidad (`--color-primary`):
1983
+ * provideTablaMantenimiento({coloresTema: true})
1984
+ *
1985
+ * @example
1986
+ * // Un MF que prefiere el comportamiento de antes en todas sus tablas:
1987
+ * provideTablaMantenimiento({exportacionArriba: false, seguirSeleccion: false})
1988
+ */
1989
+ function provideTablaMantenimiento(config) {
1990
+ return makeEnvironmentProviders([{ provide: TABLA_MANTENIMIENTO_CONFIG, useValue: config }]);
1991
+ }
1992
+
830
1993
  class TablaMantenimientoService {
831
1994
  get templateBotonesComunes() {
832
1995
  return [
@@ -869,8 +2032,58 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImpo
869
2032
  }]
870
2033
  }] });
871
2034
 
2035
+ // Clases de Tailwind. Van escritas enteras (no armadas por partes) para que Tailwind las
2036
+ // encuentre al escanear el código, tanto aquí como en la app que usa la librería.
2037
+ /**
2038
+ * Botón que declara `activo` y no lo está: tono claro del color de acento de la tabla, con
2039
+ * borde. El acento (`--tabla-mantenimiento-acento`, tripleta "r, g, b") es el azul estándar o el
2040
+ * primario del tema según `coloresTema`. Va con valores arbitrarios para que cualquier Tailwind
2041
+ * 3.4 los genere, también el de la app. Manda sobre la `class` del botón (de ahí los `!`); la
2042
+ * variante `aria-[pressed=false]:disabled:` vence al gris de deshabilitado de la barra
2043
+ * (`disabled:!bg-gray-300`), que también es `!important`.
2044
+ */
2045
+ const CLASES_BOTON_INACTIVO = '!border !border-solid !border-[rgba(var(--tabla-mantenimiento-acento),0.4)] !bg-[rgba(var(--tabla-mantenimiento-acento),0.1)] !text-[rgb(var(--tabla-mantenimiento-acento))] !shadow-none enabled:hover:!bg-[rgba(var(--tabla-mantenimiento-acento),0.2)] aria-[pressed=false]:disabled:!bg-[rgba(var(--tabla-mantenimiento-acento),0.1)]';
2046
+ /** Botón elegido de su grupo: relleno con el acento. */
2047
+ const CLASES_BOTON_ACTIVO = '!border !border-solid !border-[rgb(var(--tabla-mantenimiento-acento))] !bg-[rgb(var(--tabla-mantenimiento-acento))] !text-[rgb(var(--tabla-mantenimiento-acento-contraste))] !shadow-none aria-pressed:disabled:!bg-[rgb(var(--tabla-mantenimiento-acento))]';
2048
+ /**
2049
+ * Ítem de menú elegido de su grupo. Los menús se abren en un panel flotante fuera de la tabla,
2050
+ * donde no llega la variable de acento de la tabla: por eso hay una versión para cada modo.
2051
+ */
2052
+ const CLASES_ITEM_MENU_ACTIVO = '!font-bold shadow-[inset_2px_0_0_rgb(var(--tabla-mantenimiento-acento))]';
2053
+ const CLASES_ITEM_MENU_ACTIVO_TEMA = '!font-bold shadow-[inset_2px_0_0_rgb(var(--color-primary))]';
2054
+ /** Con `alinearCabecerasConContenido`, el `th` de una columna custom respeta `text-left`/`text-right`. */
2055
+ const CLASES_CABECERAS_CON_CONTENIDO = '[&_th.mat-mdc-header-cell.text-left]:!text-left [&_th.mat-mdc-header-cell.text-left_.mat-sort-header-content]:!text-left [&_th.mat-mdc-header-cell.text-right]:!text-right [&_th.mat-mdc-header-cell.text-right_.mat-sort-header-content]:!text-right';
2056
+ /**
2057
+ * Tipos de botón que son exportaciones. Con `exportacionArriba` se dibujan junto a Recargar
2058
+ * (sección `herramientas`) aunque la pantalla los declare en `inferior`.
2059
+ */
2060
+ const TIPOS_EXPORTACION_TABLA = [
2061
+ 'exportar_pdf', 'ver_pdf', 'exportar_excel', 'descargar_excel',
2062
+ 'ver_resumen_pdf', 'ver_resumen_excel', 'exportar_jasper', 'exportacion_avanzada',
2063
+ ];
2064
+ /**
2065
+ * Resalte breve de la fila a la que la tabla acaba de llevar al usuario (ver `seguirSeleccion`):
2066
+ * un ciclo del `pulse` de Tailwind (2 s) y se quita. Se añade al `<tr>` directamente, sin pasar
2067
+ * por la plantilla, para no sumar una evaluación por fila en cada ciclo.
2068
+ */
2069
+ const CLASE_RESALTE_FILA = 'animate-pulse';
2070
+ const DURACION_RESALTE_MS = 2000;
2071
+ // Íconos de las exportaciones, en línea para no depender del CDN de íconos. PDF y Excel son los
2072
+ // `file-pdf` y `file-excel` de Font Awesome Regular (CC BY 4.0), los mismos `fa5FilePdf` y
2073
+ // `fa5FileExcel` que las pantallas usaban en la barra inferior; el menú "Exportar" usa
2074
+ // `file-download` de Material Icons Round (Apache 2.0).
2075
+ const ICONO_PDF = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path fill="currentColor" d="M369.9 97.9L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34M332.1 128H256V51.9zM48 464V48h160v104c0 13.3 10.7 24 24 24h104v288zm250.2-143.7c-12.2-12-47-8.7-64.4-6.5c-17.2-10.5-28.7-25-36.8-46.3c3.9-16.1 10.1-40.6 5.4-56c-4.2-26.2-37.8-23.6-42.6-5.9c-4.4 16.1-.4 38.5 7 67.1c-10 23.9-24.9 56-35.4 74.4c-20 10.3-47 26.2-51 46.2c-3.3 15.8 26 55.2 76.1-31.2c22.4-7.4 46.8-16.5 68.4-20.1c18.9 10.2 41 17 55.8 17c25.5 0 28-28.2 17.5-38.7m-198.1 77.8c5.1-13.7 24.5-29.5 30.4-35c-19 30.3-30.4 35.7-30.4 35m81.6-190.6c7.4 0 6.7 32.1 1.8 40.8c-4.4-13.9-4.3-40.8-1.8-40.8m-24.4 136.6c9.7-16.9 18-37 24.7-54.7c8.3 15.1 18.9 27.2 30.1 35.5c-20.8 4.3-38.9 13.1-54.8 19.2m131.6-5s-5 6-37.3-7.8c35.1-2.6 40.9 5.4 37.3 7.8"/></svg>`;
2076
+ const ICONO_EXCEL = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path fill="currentColor" d="M369.9 97.9L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34M332.1 128H256V51.9zM48 464V48h160v104c0 13.3 10.7 24 24 24h104v288zm212-240h-28.8c-4.4 0-8.4 2.4-10.5 6.3c-18 33.1-22.2 42.4-28.6 57.7c-13.9-29.1-6.9-17.3-28.6-57.7c-2.1-3.9-6.2-6.3-10.6-6.3H124c-9.3 0-15 10-10.4 18l46.3 78l-46.3 78c-4.7 8 1.1 18 10.4 18h28.9c4.4 0 8.4-2.4 10.5-6.3c21.7-40 23-45 28.6-57.7c14.9 30.2 5.9 15.9 28.6 57.7c2.1 3.9 6.2 6.3 10.6 6.3H260c9.3 0 15-10 10.4-18L224 320c.7-1.1 30.3-50.5 46.3-78c4.7-8-1.1-18-10.3-18"/></svg>`;
2077
+ // Chevron del árbol: `chevron_right` de Material Icons Round (Apache 2.0), en línea como los anteriores.
2078
+ const ICONO_CHEVRON = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M9.29 6.71a.996.996 0 0 0 0 1.41L13.17 12l-3.88 3.88a.996.996 0 1 0 1.41 1.41l4.59-4.59a.996.996 0 0 0 0-1.41L10.7 6.7c-.38-.38-1.02-.38-1.41.01"/></svg>`;
2079
+ /** Fila que se ve solo como camino hacia una coincidencia (modo árbol con búsqueda o filtro). */
2080
+ const CLASE_FILA_CONTEXTO = 'jvs-arbol-contexto [&>td]:opacity-50';
2081
+ const ICONO_EXPORTAR = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M16.59 9H15V4c0-.55-.45-1-1-1h-4c-.55 0-1 .45-1 1v5H7.41c-.89 0-1.34 1.08-.71 1.71l4.59 4.59c.39.39 1.02.39 1.41 0l4.59-4.59c.63-.63.19-1.71-.7-1.71M5 19c0 .55.45 1 1 1h12c.55 0 1-.45 1-1s-.45-1-1-1H6c-.55 0-1 .45-1 1"/></svg>`;
2082
+ /** Bajo este ancho de banda (px, 36 rem) el buscador pasa a icono y los grupos de botones al menú ≡. */
2083
+ const BANDA_ANGOSTA_BAJO = 576;
2084
+ /** Bajo este ancho de banda (px, 48 rem) la banda es `media`; desde aquí, `amplia`. */
2085
+ const BANDA_MEDIA_BAJO = 768;
872
2086
  class TablaMantenimientoComponent {
873
- fb;
874
2087
  overlay;
875
2088
  viewContainerRef;
876
2089
  tablaMantenimientoService;
@@ -889,6 +2102,11 @@ class TablaMantenimientoComponent {
889
2102
  }
890
2103
  ;
891
2104
  dataSuscription;
2105
+ /**
2106
+ * @deprecated Componente que contiene la tabla. Solo sirve para el respaldo de selección
2107
+ * `objThis.seleccionados[nombreColeccion]`, que también se retirará: usa `[(selectionModel)]`.
2108
+ * Ya no es obligatorio; las pantallas que usan `selectionModel` no necesitan pasarlo.
2109
+ */
892
2110
  objThis;
893
2111
  nombreColeccion;
894
2112
  busquedaValor = input('', { ...(ngDevMode ? { debugName: "busquedaValor" } : /* istanbul ignore next */ {}), alias: 'ctrlBusquedaValue' });
@@ -900,6 +2118,7 @@ class TablaMantenimientoComponent {
900
2118
  filaExtraHeader;
901
2119
  filaFooter = false;
902
2120
  botonesCRUD = 'CUD';
2121
+ /** @deprecated El doble clic ya llega por `opcionSelecionada` con tipo `seleccionar`. */
903
2122
  dblclickItem = new EventEmitter();
904
2123
  objBotonesCRUD = [
905
2124
  { tipo: 'nuevo', sinCondicion: true },
@@ -907,30 +2126,196 @@ class TablaMantenimientoComponent {
907
2126
  { tipo: 'eliminar' },
908
2127
  ];
909
2128
  classSeleccionado = ['elemento-seleccionado', /*'!bg-primary-activo','text-primary-contrast', */ 'mat-elevation-z8', /*'dark:!bg-primary-dark-activo',*/ 'border-y-2 border-primary-contrast', 'font-bold', 'text-2xl'];
910
- // @Input() classAnulado = ['line-through', 'text-red', 'italic'];
911
2129
  classAnulado = ['elemento-anulado', /*'line-through', */ 'text-red-900', 'bg-red-200'];
912
2130
  campoAnulado = null;
913
2131
  campoAnuladoMensaje = null;
914
2132
  opcionSelecionada = new EventEmitter();
915
2133
  opcBusqueda = new EventEmitter();
916
2134
  accionRecargar = new EventEmitter();
2135
+ /**
2136
+ * Registro seleccionado. El nombre viene de cuando se pensó guardarlo en un
2137
+ * `SelectionModel` del CDK; lo que viaja es la fila, y así lo usan las apps con el enlace
2138
+ * de dos sentidos `[(selectionModel)]`.
2139
+ */
917
2140
  set selectionModel(val) {
2141
+ // Solo se sigue una selección que CAMBIA: el enlace de dos sentidos devuelve a la tabla
2142
+ // la misma fila que ella acaba de avisar (tras un clic o una recarga), y eso no es motivo
2143
+ // para mover la página (si `irASeleccion()` dejó algo pendiente, se respeta). `null`
2144
+ // cancela lo que hubiera pendiente.
2145
+ const idNuevo = val == null ? null : this.propiedadSeleccion(val);
2146
+ if (!idNuevo) {
2147
+ this.seleccionASeguir = null;
2148
+ }
2149
+ else if (idNuevo !== this._seleccionado) {
2150
+ this.seleccionASeguir = idNuevo;
2151
+ }
918
2152
  this.objSeleccionado = val;
2153
+ this.irAPaginaDeSeleccion();
919
2154
  }
920
2155
  selectionModelChange = new EventEmitter();
2156
+ /**
2157
+ * Cuando la selección cambia desde fuera (`[selectionModel]`, `seleccionarPorId()`,
2158
+ * `irASeleccion()`), la tabla lleva la fila a la vista: con paginación en cliente va a la
2159
+ * página que la contiene (según el orden y el filtro activos), limpia el buscador simple si la
2160
+ * ocultaba, la desplaza a la vista si hace falta y la resalta un instante. Un clic, el teclado
2161
+ * o una recarga que mantiene la misma fila no mueven nada. Con paginación en el servidor solo
2162
+ * la desplaza si viene en la página cargada. Con `false` no se hace nada de esto. Sin el
2163
+ * input, manda `provideTablaMantenimiento({seguirSeleccion})`, y si no hay, `true`.
2164
+ */
2165
+ seguirSeleccion = input(undefined, ...(ngDevMode ? [{ debugName: "seguirSeleccion" }] : /* istanbul ignore next */ []));
2166
+ /** Si la tabla sigue la selección: el input, si no la configuración global, si no `true`. */
2167
+ debeSeguirSeleccion = computed(() => this.seguirSeleccion() ?? this.configGlobal?.seguirSeleccion ?? true, ...(ngDevMode ? [{ debugName: "debeSeguirSeleccion" }] : /* istanbul ignore next */ []));
2168
+ /** Identificador (`propiedadSeleccion`) de la fila que falta llevar a la vista. */
2169
+ seleccionASeguir = null;
2170
+ /** Si al seguir la selección se cambió de página: entonces la fila se resalta aunque ya se vea. */
2171
+ seguimientoCambioPagina = false;
921
2172
  isRecargarUsed = false;
922
2173
  filaExtraTemplate;
923
2174
  paginator;
2175
+ /**
2176
+ * Estático: la tabla no está dentro de un bloque condicional, y así existe antes de que se
2177
+ * pinte la cabecera. Lo necesita el `provide: MatSort` del componente (columnas `custom`).
2178
+ */
924
2179
  sort;
925
2180
  exportarExcel = true;
926
- busquedaCompacta = input(false, ...(ngDevMode ? [{ debugName: "busquedaCompacta" }] : /* istanbul ignore next */ []));
2181
+ /**
2182
+ * Buscador reducido a un icono que abre un menú con el campo. `true` siempre, `false` nunca y
2183
+ * `'auto'` (por defecto) cuando la banda de la tabla es angosta: decide el ancho de la tabla,
2184
+ * no el de la ventana, así funciona también en paneles angostos.
2185
+ */
2186
+ busquedaCompacta = input('auto', ...(ngDevMode ? [{ debugName: "busquedaCompacta" }] : /* istanbul ignore next */ []));
2187
+ /** Ancho actual de la banda; lo mide un `ResizeObserver`. `null` mientras no se mide. */
2188
+ anchoBanda = signal(null, ...(ngDevMode ? [{ debugName: "anchoBanda" }] : /* istanbul ignore next */ []));
2189
+ /**
2190
+ * Tramo de ancho de la banda, con los tamaños de contenedor de Tailwind (`@xl` = 36 rem,
2191
+ * `@3xl` = 48 rem): `angosta` pasa el buscador a icono y los grupos de botones al menú ≡.
2192
+ * Sin medir (SSR, pruebas sin `ResizeObserver`) cuenta como `amplia`.
2193
+ */
2194
+ tramoBanda = computed(() => {
2195
+ const ancho = this.anchoBanda();
2196
+ if (ancho === null) {
2197
+ return 'amplia';
2198
+ }
2199
+ return ancho < BANDA_ANGOSTA_BAJO ? 'angosta' : ancho < BANDA_MEDIA_BAJO ? 'media' : 'amplia';
2200
+ }, ...(ngDevMode ? [{ debugName: "tramoBanda" }] : /* istanbul ignore next */ []));
2201
+ /** Si el buscador se muestra como icono en este momento. */
2202
+ busquedaEsCompacta = computed(() => {
2203
+ const modo = this.busquedaCompacta();
2204
+ return modo === 'auto' ? this.tramoBanda() === 'angosta' : !!modo;
2205
+ }, ...(ngDevMode ? [{ debugName: "busquedaEsCompacta" }] : /* istanbul ignore next */ []));
2206
+ bandaTabla;
2207
+ contenedorTabla;
2208
+ /**
2209
+ * Qué hace la tabla con las columnas cuando no caben en el ancho de su contenedor.
2210
+ * - `'ajustar'` (por defecto): todas se pintan y el texto se parte, como siempre.
2211
+ * - `'ocultar'`: oculta las de menor prioridad (ver `prioridad` en la columna) hasta que el
2212
+ * resto quepa; avisa en el botón de columnas y las sigue exportando al Excel.
2213
+ */
2214
+ columnasSiNoCaben = input('ajustar', ...(ngDevMode ? [{ debugName: "columnasSiNoCaben" }] : /* istanbul ignore next */ []));
2215
+ _columnasOcultasPorEspacio = signal(new Set(), ...(ngDevMode ? [{ debugName: "_columnasOcultasPorEspacio" }] : /* istanbul ignore next */ []));
2216
+ /** Columnas ocultas ahora mismo por falta de espacio (`property`), por si la pantalla quiere avisar. */
2217
+ columnasOcultasPorEspacio = this._columnasOcultasPorEspacio.asReadonly();
2218
+ /** Ancho útil del contenedor de la tabla (sin la barra de desplazamiento). `null` mientras no se mide. */
2219
+ anchoContenedor = signal(null, ...(ngDevMode ? [{ debugName: "anchoContenedor" }] : /* istanbul ignore next */ []));
2220
+ medirTexto = inject(MEDIR_TEXTO_TABLA);
2221
+ /** Última medida de cada columna: la que se oculta ya no tiene celdas que medir. */
2222
+ medidasColumnas = new Map();
2223
+ /** Fuentes de la tabla, leídas en la última medición que tuvo cabecera. */
2224
+ fuentesTabla = null;
2225
+ cuadroCalculoColumnas = null;
2226
+ /** Columnas candidatas del último cálculo, para notar cuándo cambia un `visible` dinámico. */
2227
+ firmaColumnas = '';
2228
+ recalcularAlCambiarModo = effect(() => {
2229
+ this.columnasSiNoCaben();
2230
+ this.anchoContenedor();
2231
+ untracked(() => this.programarCalculoColumnas());
2232
+ }, ...(ngDevMode ? [{ debugName: "recalcularAlCambiarModo" }] : /* istanbul ignore next */ []));
2233
+ inputBusquedaCompacta;
2234
+ /**
2235
+ * Ancho máximo del buscador (cualquier medida CSS). El alto no cambia. Por defecto, los
2236
+ * 150 px de siempre.
2237
+ */
2238
+ busquedaAncho = input('150px', { ...(ngDevMode ? { debugName: "busquedaAncho" } : /* istanbul ignore next */ {}), alias: 'ctrlBusquedaAncho' });
2239
+ /** Nombre de la hoja y del archivo del Excel. Por defecto, `nombreColeccion`. */
2240
+ nombreExcel = input(undefined, ...(ngDevMode ? [{ debugName: "nombreExcel" }] : /* istanbul ignore next */ []));
2241
+ /** Entrada animada de las filas, una por una. Con `false` aparecen de golpe. */
2242
+ animarFilas = input(true, ...(ngDevMode ? [{ debugName: "animarFilas" }] : /* istanbul ignore next */ []));
2243
+ /**
2244
+ * Barra de carga indeterminada entre la banda y la cabecera mientras es `true`. Sin el input
2245
+ * (`undefined`) no se dibuja nada; con él, el hueco de la barra queda reservado para que la
2246
+ * tabla no salte al cargar.
2247
+ */
2248
+ cargando = input(undefined, ...(ngDevMode ? [{ debugName: "cargando" }] : /* istanbul ignore next */ []));
2249
+ /**
2250
+ * Las exportaciones (`TIPOS_EXPORTACION_TABLA`) van junto a Recargar, como íconos, aunque
2251
+ * vengan en `inferior`. Con `false` se quedan donde la pantalla las puso. Sin el input, manda
2252
+ * `provideTablaMantenimiento({exportacionArriba})`, y si no hay, `true`.
2253
+ */
2254
+ exportacionArriba = input(undefined, ...(ngDevMode ? [{ debugName: "exportacionArriba" }] : /* istanbul ignore next */ []));
2255
+ /** Si las exportaciones suben junto a Recargar: el input, si no la configuración global, si no `true`. */
2256
+ subeExportacion = computed(() => this.exportacionArriba() ?? this.configGlobal?.exportacionArriba ?? true, ...(ngDevMode ? [{ debugName: "subeExportacion" }] : /* istanbul ignore next */ []));
2257
+ /**
2258
+ * Las cabeceras siguen la alineación de su contenido (texto a la izquierda, `text-right`
2259
+ * a la derecha…), y en las `custom` se respeta `text-left`/`text-right` del `th`. Por
2260
+ * defecto `false`: todas centradas, como siempre. Una columna puede pedirlo sola con
2261
+ * `alineacionCabecera`.
2262
+ */
2263
+ alinearCabecerasConContenido = input(false, ...(ngDevMode ? [{ debugName: "alinearCabecerasConContenido" }] : /* istanbul ignore next */ []));
2264
+ /**
2265
+ * Colores de la tabla (fila elegida, botones `activo`, segmentados): `false` usa los colores
2266
+ * estándar fijos; `true`, los del tema de la entidad (`--color-primary`). Sin definir, manda
2267
+ * lo que diga `provideTablaMantenimiento({coloresTema})`, y si no hay, estándar.
2268
+ */
2269
+ coloresTema = input(undefined, ...(ngDevMode ? [{ debugName: "coloresTema" }] : /* istanbul ignore next */ []));
2270
+ configGlobal = inject(TABLA_MANTENIMIENTO_CONFIG, { optional: true });
2271
+ usaColoresTema = computed(() => this.coloresTema() ?? this.configGlobal?.coloresTema ?? false, ...(ngDevMode ? [{ debugName: "usaColoresTema" }] : /* istanbul ignore next */ []));
2272
+ configCabeceras = inject(CONFIG_CABECERAS_TABLA);
2273
+ sincronizarCabeceras = effect(() => this.configCabeceras.alinearConContenido.set(this.alinearCabecerasConContenido()), ...(ngDevMode ? [{ debugName: "sincronizarCabeceras" }] : /* istanbul ignore next */ []));
927
2274
  alturaFull = input(false, ...(ngDevMode ? [{ debugName: "alturaFull" }] : /* istanbul ignore next */ []));
928
2275
  // MIO
929
2276
  pageSize = 25;
930
2277
  pageSizeOptions = [5, 10, 25, 50, 100, 500, 1000];
2278
+ /**
2279
+ * @deprecated Entrega la instancia interna del `MatTableDataSource`, que ahora se reutiliza
2280
+ * entre cargas: quien la guarde estará tocando el estado de la tabla por la espalda.
2281
+ */
931
2282
  dataSourceChange = new EventEmitter();
932
2283
  resultados = new EventEmitter();
933
- dataSource = new MatTableDataSource(); // or whatever type of datasource you have
2284
+ dataSource = TablaMantenimientoComponent.crearDataSource(() => this.busquedaCampos());
2285
+ /**
2286
+ * Jerarquía: la tabla recibe la lista plana completa y la pinta como árbol (ver
2287
+ * {@link ConfigArbolTabla}). Sin el input, nada cambia. La sangría y el botón de plegar van
2288
+ * en una columna `type: 'arbol'` o, dentro de una `custom`, con `<jvs-tabla-arbol-celda>`.
2289
+ */
2290
+ arbol = input(undefined, ...(ngDevMode ? [{ debugName: "arbol" }] : /* istanbul ignore next */ []));
2291
+ aplicarArbol = effect(() => {
2292
+ const config = this.arbol() ?? null;
2293
+ untracked(() => this.dataSource.arbol = config);
2294
+ }, ...(ngDevMode ? [{ debugName: "aplicarArbol" }] : /* istanbul ignore next */ []));
2295
+ /**
2296
+ * El buscador simple compara sin tildes ni mayúsculas. Es el mismo criterio que el de
2297
+ * `MatTableDataSource` (todos los valores del registro, uno tras otro), con el texto
2298
+ * normalizado a ambos lados. Quien quiera otro criterio puede cambiar `filterPredicate`.
2299
+ */
2300
+ static crearDataSource(campos = () => null) {
2301
+ const ds = new TablaMantenimientoDataSource();
2302
+ ds.filterPredicate = (data, filtro) => {
2303
+ const buscado = normalizarTexto(filtro).trim();
2304
+ if (!buscado) {
2305
+ return true;
2306
+ }
2307
+ const claves = campos() ?? Object.keys(data ?? {});
2308
+ const texto = claves.reduce((acumulado, clave) => acumulado + (data?.[clave] ?? '') + '◬', '');
2309
+ return normalizarTexto(texto).indexOf(buscado) !== -1;
2310
+ };
2311
+ return ds;
2312
+ }
2313
+ /**
2314
+ * Campos en los que busca el buscador simple. Por defecto, todos los del registro; conviene
2315
+ * limitarlo cuando el registro trae datos de otros (p. ej. el nombre del padre), que harían
2316
+ * coincidir filas por lo que no se ve.
2317
+ */
2318
+ busquedaCampos = input(null, { ...(ngDevMode ? { debugName: "busquedaCampos" } : /* istanbul ignore next */ {}), alias: 'ctrlBusquedaCampos' });
934
2319
  // this is where the magic happens:
935
2320
  table;
936
2321
  columnDefs;
@@ -945,10 +2330,22 @@ class TablaMantenimientoComponent {
945
2330
  };
946
2331
  // All that's left is to add them to the table ourselves:
947
2332
  ignorarDerechos = false;
948
- derechosActuales = null;
2333
+ derechosDelPadre = false;
2334
+ _derechosActuales = null;
2335
+ get derechosActuales() {
2336
+ return this._derechosActuales;
2337
+ }
2338
+ /**
2339
+ * Permisos con los que se habilitan los botones. Normalmente se leen solos del `data` de la
2340
+ * ruta, pero si la pantalla los pasa a mano, mandan los suyos: antes cada navegación
2341
+ * sobrescribía lo que el padre acababa de poner.
2342
+ */
2343
+ set derechosActuales(val) {
2344
+ this.derechosDelPadre = true;
2345
+ this._derechosActuales = val;
2346
+ }
949
2347
  // listaCRUD: BotonMantenimiento[] = [];
950
2348
  rows;
951
- rowFooter;
952
2349
  mouseEvent$;
953
2350
  overlayRef;
954
2351
  userMenu;
@@ -961,13 +2358,17 @@ class TablaMantenimientoComponent {
961
2358
  chkLista = new DataModel();
962
2359
  bDireccionOrden = signal(1, ...(ngDevMode ? [{ debugName: "bDireccionOrden" }] : /* istanbul ignore next */ []));
963
2360
  mostrarBotonOrden = input(false, ...(ngDevMode ? [{ debugName: "mostrarBotonOrden" }] : /* istanbul ignore next */ []));
964
- constructor(fb, overlay, viewContainerRef, tablaMantenimientoService, cdRef) {
965
- this.fb = fb;
2361
+ constructor(overlay, viewContainerRef, tablaMantenimientoService, cdRef) {
966
2362
  this.overlay = overlay;
967
2363
  this.viewContainerRef = viewContainerRef;
968
2364
  this.tablaMantenimientoService = tablaMantenimientoService;
969
2365
  this.cdRef = cdRef;
970
- // this._seleccionado[this.nombreColeccion] = null;
2366
+ const registro = inject(MatIconRegistry);
2367
+ const sanitizer = inject(DomSanitizer);
2368
+ registro.addSvgIconLiteralInNamespace('jvs_tabla', 'pdf', sanitizer.bypassSecurityTrustHtml(ICONO_PDF));
2369
+ registro.addSvgIconLiteralInNamespace('jvs_tabla', 'excel', sanitizer.bypassSecurityTrustHtml(ICONO_EXCEL));
2370
+ registro.addSvgIconLiteralInNamespace('jvs_tabla', 'exportar', sanitizer.bypassSecurityTrustHtml(ICONO_EXPORTAR));
2371
+ registro.addSvgIconLiteralInNamespace('jvs_tabla', 'chevron', sanitizer.bypassSecurityTrustHtml(ICONO_CHEVRON));
971
2372
  }
972
2373
  busquedaTipo = input('simple', { ...(ngDevMode ? { debugName: "busquedaTipo" } : /* istanbul ignore next */ {}), alias: 'ctrlBusqueda',
973
2374
  transform: (val) => {
@@ -975,7 +2376,6 @@ class TablaMantenimientoComponent {
975
2376
  return 'simple';
976
2377
  return val;
977
2378
  } });
978
- // @Input() leyenda;
979
2379
  _leyenda = undefined;
980
2380
  get leyenda() {
981
2381
  return this._leyenda;
@@ -988,88 +2388,91 @@ class TablaMantenimientoComponent {
988
2388
  this._leyenda = val;
989
2389
  }
990
2390
  }
991
- // @Input() idTabla: string[];
992
2391
  _idTabla = [];
993
2392
  get idTabla() {
994
2393
  return this._idTabla;
995
2394
  }
996
2395
  set idTabla(val) {
997
- if (Array.isArray(val)) {
998
- this._idTabla = val;
999
- }
1000
- else {
1001
- this._idTabla.push(val);
1002
- }
2396
+ // Un solo campo también reemplaza: antes se acumulaba sobre lo anterior, así que al
2397
+ // cambiar el valor la fila pasaba a identificarse por dos campos y se perdía la selección.
2398
+ this._idTabla = Array.isArray(val) ? val : [val];
1003
2399
  }
1004
2400
  _columnasTabla = [];
1005
2401
  get columnasTabla() {
1006
2402
  return this._columnasTabla ?? [];
1007
2403
  }
2404
+ /**
2405
+ * Columnas a pintar, mezcladas con el catálogo del servicio.
2406
+ *
2407
+ * Devuelve una lista nueva con copias: antes transformaba el array del consumidor en su
2408
+ * sitio, así que su definición quedaba con el tipo cambiado (`estado` pasa a `icons`) y las
2409
+ * columnas `custom` marcadas como no visibles. Reutilizar esa misma definición en otra
2410
+ * tabla dejaba la columna `custom` oculta para siempre, porque la segunda pasada guardaba
2411
+ * como visibilidad original el `false` que había dejado la primera.
2412
+ */
1008
2413
  set columnasTabla(val) {
1009
- const reemplazarConTemplate = (listaInicial = []) => {
1010
- listaInicial.forEach((btnActual, idx) => {
1011
- const btnEnTemplate = buscarEnArray(this.templateColumnasTabla, 'property', btnActual.property);
1012
- if (btnEnTemplate) {
1013
- listaInicial[idx] = {
1014
- ...btnEnTemplate,
1015
- ...btnActual
1016
- };
1017
- }
1018
- if (listaInicial[idx].type == 'text') {
1019
- if (!listaInicial[idx].text) {
1020
- listaInicial[idx].text = {
1021
- cssStyle: {}
1022
- };
1023
- }
1024
- else if (!listaInicial[idx].text.cssStyle) {
1025
- listaInicial[idx].text.cssStyle = {};
1026
- }
1027
- listaInicial[idx].text.cssStyle = { ...listaInicial[idx].text.cssStyle };
1028
- }
1029
- else if (listaInicial[idx].type == 'estado') {
1030
- const mutar = {
1031
- ...listaInicial[idx],
1032
- type: 'icons',
1033
- iconsDef: {
1034
- soloIcono: true,
1035
- iconSize: '16px',
1036
- items: [
1037
- // {
1038
- // icon: 'roundToggleOff', contentCss: 'text-gray-400',
1039
- // esVisible: (row) => row['iCredDepenTareaEstado'] == 0
1040
- // },
1041
- // {
1042
- // icon: 'roundToggleOn', contentCss: 'text-green-600',
1043
- // esVisible: (row) => row['iCredDepenTareaEstado'] == 1
1044
- // },
1045
- ]
1046
- },
1047
- };
1048
- if (listaInicial[idx].estados) {
1049
- listaInicial[idx].estados.forEach((estado) => {
1050
- if (Array.isArray(mutar.iconsDef.items)) {
1051
- mutar.iconsDef.items.push({
1052
- icon: estado.icon, contentCss: estado.cssClasses,
1053
- esVisible: (row) => row[listaInicial[idx].property] == estado.estado,
1054
- });
1055
- }
1056
- });
1057
- }
1058
- listaInicial[idx] = mutar;
1059
- }
1060
- if (btnActual.type == 'custom') {
1061
- listaInicial[idx].datosExtra = {
1062
- ...listaInicial[idx].datosExtra,
1063
- tabla_mantenimiento_config_visibleAlias: listaInicial[idx].visible == undefined ? true : listaInicial[idx].visible,
1064
- };
1065
- listaInicial[idx].visible = false;
2414
+ const conPlantilla = (listaInicial = []) => listaInicial.map(original => {
2415
+ const enPlantilla = buscarEnArray(this.templateColumnasTabla, 'property', original.property);
2416
+ let columna = enPlantilla ? { ...enPlantilla, ...original } : { ...original };
2417
+ if (columna.type == 'text') {
2418
+ columna.text = { ...(columna.text ?? {}), cssStyle: { ...(columna.text?.cssStyle ?? {}) } };
2419
+ }
2420
+ else if (columna.type == 'estado') {
2421
+ // `estado` es la forma antigua de `icons`: un icono por valor posible.
2422
+ const items = (columna.estados ?? []).map((estado) => ({
2423
+ icon: estado.icon,
2424
+ contentCss: estado.cssClasses,
2425
+ esVisible: (row) => row[columna.property] == estado.estado,
2426
+ }));
2427
+ columna = {
2428
+ ...columna,
2429
+ type: 'icons',
2430
+ iconsDef: { soloIcono: true, iconSize: '16px', items },
2431
+ };
2432
+ }
2433
+ if (original.type == 'custom') {
2434
+ // Las `custom` las pinta el consumidor con su plantilla, así que se ocultan
2435
+ // hasta que `ngAfterContentInit` confirme que esa plantilla existe.
2436
+ columna = {
2437
+ ...columna,
2438
+ datosExtra: {
2439
+ ...(columna.datosExtra ?? {}),
2440
+ tabla_mantenimiento_config_visibleAlias: original.visible === undefined ? true : original.visible,
2441
+ },
2442
+ visible: false,
2443
+ };
2444
+ }
2445
+ return columna;
2446
+ });
2447
+ this._columnasTabla = val ? conPlantilla(val) : [];
2448
+ if (this.componenteCargadoTotalmente) {
2449
+ // Columnas que llegan con la tabla ya iniciada: si su plantilla ya existe, se muestran
2450
+ // ahora; antes esperaban a `ngAfterContentInit`, que ya había pasado, y quedaban ocultas.
2451
+ this.confirmarColumnasCustom();
2452
+ }
2453
+ }
2454
+ /**
2455
+ * Las `custom` se ocultan hasta que aparece su `matColumnDef` en el contenido (si no, la tabla
2456
+ * fallaría al pintarlas). Aquí se registra cada definición en la tabla y se devuelve su
2457
+ * visibilidad a la columna. Se llama al iniciar el contenido, al cambiar las columnas y cuando
2458
+ * el consumidor agrega definiciones después (`columnDefs.changes`).
2459
+ */
2460
+ confirmarColumnasCustom() {
2461
+ if (!this.columnDefs || !this.table) {
2462
+ return;
2463
+ }
2464
+ this.columnDefs.forEach(columnDef => {
2465
+ this.table.addColumnDef(columnDef);
2466
+ const col = this.columnasTabla.find(c => c.property == columnDef.name);
2467
+ if (col && col.type == 'custom' && col.datosExtra && 'tabla_mantenimiento_config_visibleAlias' in col.datosExtra) {
2468
+ col.visible = col.datosExtra.tabla_mantenimiento_config_visibleAlias ?? col.visible;
2469
+ delete col.datosExtra.tabla_mantenimiento_config_visibleAlias;
2470
+ if (Object.keys(col.datosExtra).length < 1) {
2471
+ delete col.datosExtra;
1066
2472
  }
1067
- });
1068
- return listaInicial;
1069
- };
1070
- this._columnasTabla = val ? reemplazarConTemplate(val) : [];
2473
+ }
2474
+ });
1071
2475
  }
1072
- // @Input() botonesMenu: BotonMantenimiento[] = [];
1073
2476
  _botonesMenu = {
1074
2477
  crud: undefined,
1075
2478
  principal: [],
@@ -1077,26 +2480,41 @@ class TablaMantenimientoComponent {
1077
2480
  derecha: [],
1078
2481
  secundario: [],
1079
2482
  inferior: [],
2483
+ herramientas: [],
1080
2484
  };
1081
2485
  get botonesMenu() {
1082
2486
  return this._botonesMenu;
1083
2487
  }
2488
+ /**
2489
+ * Los botones que tocan pintar. En solo lectura quedan los marcados con `ignorarReadOnly`,
2490
+ * y de los que tienen submenú quedan sus opciones permitidas.
2491
+ *
2492
+ * Devuelve estructuras nuevas y no toca `botonesMenu`. Antes filtraba sobre el propio
2493
+ * estado, y como la plantilla lo consulta seis veces por ciclo, cada lectura se comía lo
2494
+ * que quedaba: en solo lectura la tabla acababa sin ningún botón, ni siquiera los CRUD.
2495
+ * La condición de los submenús estaba además al revés, así que descartaba justo los
2496
+ * botones cuyas opciones sí estaban permitidas.
2497
+ */
1084
2498
  get botonesMenuFinal() {
1085
- const nuevoBotonesMenu = this.botonesMenu;
1086
- // Iteramos sobre cada sección de botones
1087
- Object.keys(nuevoBotonesMenu).forEach(seccion => {
1088
- nuevoBotonesMenu[seccion] = nuevoBotonesMenu[seccion]?.filter((boton) => {
1089
- if (this.readOnly) {
1090
- if (boton.subItems) {
1091
- boton.subItems = boton.subItems.filter((subItem) => subItem.ignorarReadOnly === true);
1092
- return boton.subItems.length < 1;
2499
+ if (!this.readOnly) {
2500
+ return this.botonesMenu;
2501
+ }
2502
+ const resultado = {};
2503
+ Object.keys(this.botonesMenu).forEach(seccion => {
2504
+ resultado[seccion] = (this.botonesMenu[seccion] ?? []).reduce((permitidos, boton) => {
2505
+ if (boton.subItems) {
2506
+ const subItems = boton.subItems.filter((subItem) => subItem.ignorarReadOnly === true);
2507
+ if (subItems.length > 0) {
2508
+ permitidos.push({ ...boton, subItems });
1093
2509
  }
1094
- return boton.ignorarReadOnly === true;
1095
2510
  }
1096
- return true;
1097
- }); // Filtramos los botones nulos
2511
+ else if (boton.ignorarReadOnly === true) {
2512
+ permitidos.push(boton);
2513
+ }
2514
+ return permitidos;
2515
+ }, []);
1098
2516
  });
1099
- return nuevoBotonesMenu;
2517
+ return resultado;
1100
2518
  }
1101
2519
  set botonesMenu(val) {
1102
2520
  const reemplazarConTemplate = (listaInicial = []) => listaInicial.map((btnActual) => {
@@ -1124,6 +2542,14 @@ class TablaMantenimientoComponent {
1124
2542
  });
1125
2543
  this._botonesMenu = { ...this._botonesMenu, ...val };
1126
2544
  }
2545
+ /**
2546
+ * Botones del menú ≡ en pantallas angostas. La fila secundaria se ve también ahí, así que
2547
+ * no se repite dentro del menú.
2548
+ */
2549
+ get listaMenuMovil() {
2550
+ const secundarios = this.botonesMenu.secundario ?? [];
2551
+ return this.listaMenuCompleto.filter(btn => !secundarios.includes(btn));
2552
+ }
1127
2553
  get listaMenuCompleto() {
1128
2554
  let menuTotal = [];
1129
2555
  menuTotal = menuTotal.concat(this.botonesMenu.izquierda ?? []);
@@ -1132,47 +2558,194 @@ class TablaMantenimientoComponent {
1132
2558
  menuTotal = menuTotal.concat(this.botonesMenu.derecha ?? []);
1133
2559
  menuTotal = menuTotal.concat(this.botonesMenu.secundario ?? []);
1134
2560
  menuTotal = menuTotal.concat(this.botonesMenu.inferior ?? []);
2561
+ menuTotal = menuTotal.concat(this.botonesMenu.herramientas ?? []);
1135
2562
  return menuTotal;
1136
2563
  }
1137
- get objVisibleColumns() {
1138
- return this.columnasTabla.filter(column => {
1139
- if (column.noMostrar != undefined) {
1140
- column.noMostrarEnLista = column.noMostrar;
1141
- }
1142
- return !tipoValorFuncion(column.noMostrarEnLista, false);
1143
- }).filter(column => {
1144
- // SECCION MODIFICADOR
1145
- if (this.filaExtraTemplate) {
1146
- column.sort = false;
1147
- }
1148
- // Fin SECCION MODIFICADOR
1149
- column.visible = tipoValorFuncion(column.visible, true);
1150
- if (!column.visible && column.esVisible != undefined) {
1151
- column.visible = column.esVisible();
1152
- }
1153
- return column.visible;
2564
+ /** Si la columna se ofrece en el menú de columnas. `noMostrar` es el alias antiguo. */
2565
+ esColumnaEnLista(column) {
2566
+ return !tipoValorFuncion(column.noMostrarEnLista ?? column.noMostrar, false);
2567
+ }
2568
+ /**
2569
+ * Lo que el usuario eligió en el menú de columnas, por `property`. Va aparte para no pisar
2570
+ * la definición: antes se escribía `column.visible = true/false`, y una columna declarada
2571
+ * con una función (p. ej. visible según un filtro) dejaba de seguirla para siempre.
2572
+ */
2573
+ visibilidadElegida = new Map();
2574
+ /** Muestra u oculta la columna por elección del usuario. */
2575
+ elegirVisibilidadColumna(column, visible) {
2576
+ this.visibilidadElegida.set(column.property, visible);
2577
+ this.programarCalculoColumnas();
2578
+ }
2579
+ /**
2580
+ * Si la columna se pinta ahora mismo, sin escribir la respuesta dentro de la columna.
2581
+ * `paraExcel` no tiene en cuenta el ancho: lo que se oculta por falta de espacio se exporta.
2582
+ */
2583
+ esColumnaVisible(column, paraExcel = false) {
2584
+ if (this.visibilidadElegida.has(column.property)) {
2585
+ return !!this.visibilidadElegida.get(column.property);
2586
+ }
2587
+ if (!paraExcel && this._columnasOcultasPorEspacio().has(column.property)) {
2588
+ return false;
2589
+ }
2590
+ return this.visiblePorDefinicion(column);
2591
+ }
2592
+ /** `visible` (o el antiguo `esVisible()`) de la columna, sin elección del usuario ni espacio. */
2593
+ visiblePorDefinicion(column) {
2594
+ const visible = tipoValorFuncion(column.visible, true);
2595
+ if (!visible && column.esVisible != undefined) {
2596
+ return column.esVisible();
2597
+ }
2598
+ return !!visible;
2599
+ }
2600
+ /** Si la columna está oculta por falta de espacio (para el menú de columnas). */
2601
+ ocultaPorEspacio(column) {
2602
+ return this._columnasOcultasPorEspacio().has(column.property);
2603
+ }
2604
+ /** Tooltip del botón de columnas: con columnas ocultas por espacio, cuáles son. */
2605
+ tooltipColumnas() {
2606
+ const ocultas = this.columnasTabla.filter(column => this.ocultaPorEspacio(column));
2607
+ if (ocultas.length < 1) {
2608
+ return 'Columnas Filtro';
2609
+ }
2610
+ const nombres = ocultas.map(column => (column.labelLista ?? column.label).replace(/<br\s*\/?>/gi, ' ')).join(', ');
2611
+ return ocultas.length === 1
2612
+ ? `1 columna oculta por falta de espacio: ${nombres}`
2613
+ : `${ocultas.length} columnas ocultas por falta de espacio: ${nombres}`;
2614
+ }
2615
+ /** Columnas que se pintarían si hubiera espacio: en la lista, con `visible` o marcadas por el usuario. */
2616
+ columnasCandidatas() {
2617
+ return this.columnasTabla
2618
+ .filter(column => this.esColumnaEnLista(column))
2619
+ .filter(column => this.visibilidadElegida.has(column.property)
2620
+ ? !!this.visibilidadElegida.get(column.property)
2621
+ : this.visiblePorDefinicion(column));
2622
+ }
2623
+ /** Recalcula qué columnas caben en el siguiente cuadro (una vez por cuadro). */
2624
+ programarCalculoColumnas() {
2625
+ if (this.cuadroCalculoColumnas !== null || typeof requestAnimationFrame === 'undefined') {
2626
+ return;
2627
+ }
2628
+ this.cuadroCalculoColumnas = requestAnimationFrame(() => {
2629
+ this.cuadroCalculoColumnas = null;
2630
+ this.calcularColumnasPorEspacio();
1154
2631
  });
1155
2632
  }
2633
+ /**
2634
+ * Mide el ancho natural de las columnas candidatas y oculta las que no caben. Sin medida del
2635
+ * contenedor no oculta nada. Las medidas son del ancho natural, no del pintado: mostrar u
2636
+ * ocultar una columna no cambia la entrada del cálculo, así que no hay realimentación.
2637
+ */
2638
+ calcularColumnasPorEspacio() {
2639
+ const disponible = this.anchoContenedor();
2640
+ const candidatas = this.columnasCandidatas();
2641
+ this.firmaColumnas = candidatas.map(column => column.property).join('|');
2642
+ if (this.columnasSiNoCaben() !== 'ocultar' || disponible === null) {
2643
+ this.fijarOcultasPorEspacio(new Set());
2644
+ return;
2645
+ }
2646
+ const tabla = this.contenedorTabla?.nativeElement.querySelector(':scope > table.table-mantenimiento');
2647
+ if (tabla) {
2648
+ const fuentes = leerFuentes(tabla);
2649
+ if (fuentes) {
2650
+ this.fuentesTabla = fuentes;
2651
+ medirColumnas(tabla, candidatas.map(column => column.property), this.medirTexto, fuentes)
2652
+ .forEach((medida, property) => this.medidasColumnas.set(property, medida));
2653
+ }
2654
+ }
2655
+ const necesario = new Map(candidatas.map(column => {
2656
+ // Nunca pintada: su título y el mínimo del tipo, hasta que se pueda medir de verdad.
2657
+ const medida = this.medidasColumnas.get(column.property) ?? {
2658
+ titulo: medirTitulo(column.label, this.fuentesTabla, this.medirTexto),
2659
+ contenido: null,
2660
+ extra: 0,
2661
+ ordena: column.sort !== false && !this.filaExtraTemplate,
2662
+ };
2663
+ return [column.property, anchoNecesario(column, medida)];
2664
+ }));
2665
+ const elegidas = new Set([...this.visibilidadElegida].filter(([, visible]) => visible).map(([property]) => property));
2666
+ this.fijarOcultasPorEspacio(calcularColumnasOcultas(candidatas, necesario, disponible, elegidas));
2667
+ }
2668
+ fijarOcultasPorEspacio(ocultas) {
2669
+ if (!mismoConjunto(ocultas, this._columnasOcultasPorEspacio())) {
2670
+ this._columnasOcultasPorEspacio.set(ocultas);
2671
+ }
2672
+ }
2673
+ /**
2674
+ * Columnas que toca pintar. Consultarlo no escribe en las columnas del consumidor: antes
2675
+ * copiaba `noMostrar` a `noMostrarEnLista` y fijaba `visible`, de modo que una columna
2676
+ * declarada con una función dejaba de ser dinámica en cuanto se pintaba la tabla una vez.
2677
+ *
2678
+ * Sigue escribiendo `sort` cuando hay fila extra, porque es el único canal por el que la
2679
+ * definición de columnas se entera de que no debe ofrecer el ordenamiento.
2680
+ */
2681
+ get objVisibleColumns() {
2682
+ return this.columnasTabla
2683
+ .filter(column => this.esColumnaEnLista(column))
2684
+ .filter(column => this.esColumnaVisible(column));
2685
+ }
2686
+ /**
2687
+ * Columnas que recibe la definición de columnas. Con fila extra desplegable el
2688
+ * ordenamiento se bloquea, y eso se resuelve aquí entregando copias: antes se lograba
2689
+ * escribiendo `sort: false` dentro de la columna del consumidor, que quedaba marcada para
2690
+ * siempre aunque la tabla dejara de usar la fila extra.
2691
+ */
2692
+ get columnasParaDefinir() {
2693
+ if (!this.filaExtraTemplate) {
2694
+ return this.columnasTabla;
2695
+ }
2696
+ return this.columnasTabla.map(column => ({ ...column, sort: false }));
2697
+ }
2698
+ /**
2699
+ * Columnas del Excel: las visibles, menos las marcadas `excel.ocultar`, más las ocultas con
2700
+ * `excel.incluirOculta`, en el orden en que se declararon.
2701
+ */
2702
+ get columnasExcel() {
2703
+ const visibles = this.columnasTabla
2704
+ .filter(column => this.esColumnaEnLista(column))
2705
+ .filter(column => this.esColumnaVisible(column, true));
2706
+ return this.columnasTabla.filter(column => !column.excel?.ocultar && (visibles.includes(column) || !!column.excel?.incluirOculta));
2707
+ }
1156
2708
  get visibleColumns() {
1157
2709
  return this.objVisibleColumns.map(column => column.property);
1158
2710
  }
1159
2711
  get tieneCheckbox() {
1160
2712
  return this.columnasTabla && this.columnasTabla.length > 0 && this.columnasTabla.find(col => col.type === 'checkbox') || false;
1161
2713
  }
2714
+ /**
2715
+ * Última búsqueda del registro seleccionado, guardada para no repetirla. Vale mientras no
2716
+ * cambien ni la selección ni los datos: `classFila` consulta esto una vez por fila y por
2717
+ * ciclo, así que sin memoria una tabla de N filas hacía N búsquedas sobre N registros.
2718
+ */
2719
+ cacheSeleccionado = null;
1162
2720
  get buscarItemSeleccionado() {
1163
- if (!this.dataSource?.data || !Array.isArray(this.dataSource.data)) {
2721
+ const datos = this.dataSource?.data;
2722
+ if (!datos || !Array.isArray(datos)) {
1164
2723
  return null;
1165
2724
  }
1166
- const dRet = this.dataSource.data.find(itm => this._seleccionado === this.propiedadSeleccion(itm));
1167
- return dRet ?? null;
2725
+ if (this.cacheSeleccionado
2726
+ && this.cacheSeleccionado.seleccionado === this._seleccionado
2727
+ && this.cacheSeleccionado.datos === datos) {
2728
+ return this.cacheSeleccionado.item;
2729
+ }
2730
+ const dRet = datos.find(itm => this._seleccionado === this.propiedadSeleccion(itm)) ?? null;
2731
+ this.cacheSeleccionado = { seleccionado: this._seleccionado, datos, item: dRet };
2732
+ return dRet;
1168
2733
  }
1169
2734
  get objSeleccionado() {
2735
+ // `_seleccionado` en null es "aquí no hay nada seleccionado" —volver a pulsar la fila—,
2736
+ // distinto de "hay una selección que no está en los datos cargados", que es cuando vale
2737
+ // mirar lo que guarda el padre. Sin esa distinción, deseleccionar nunca llegaba al padre:
2738
+ // el respaldo devolvía el registro anterior y la fila seguía pintada.
2739
+ if (this._seleccionado === null) {
2740
+ return null;
2741
+ }
2742
+ // @deprecated El respaldo en `objThis.seleccionados[nombreColeccion]` se retirará: el
2743
+ // canal es `[(selectionModel)]`, que no obliga a que la pantalla nombre su propiedad
2744
+ // igual que la colección para que esto funcione.
1170
2745
  return this.buscarItemSeleccionado ?? this.objThis?.['seleccionados']?.[this.nombreColeccion];
1171
2746
  }
1172
2747
  set objSeleccionado(val) {
1173
- // if (val) {
1174
2748
  this.seleccionarItem(val, true);
1175
- // }
1176
2749
  /*if (this.objThis) {
1177
2750
  if (!this.objThis['seleccionados']) {
1178
2751
  this.objThis['seleccionados'] = {};
@@ -1196,7 +2769,12 @@ class TablaMantenimientoComponent {
1196
2769
  idTablaValor(data) {
1197
2770
  if (data) {
1198
2771
  if (this.idTabla.length < 1) {
1199
- return simpleHash(JSON.stringify({ data, claseFinal: undefined }));
2772
+ // Sin `idTabla` la fila se identifica por su contenido, así que hay que dejar
2773
+ // fuera lo que cambia mientras se mira la tabla: el estado de expansión (que
2774
+ // escriben el botón de expandir y varias pantallas) y las clases de la fila.
2775
+ // Si entraran, la fila cambiaría de identidad al expandirla y la selección se
2776
+ // perdería sola.
2777
+ return simpleHash(JSON.stringify({ ...data, claseFinal: undefined, isExpanded: undefined }));
1200
2778
  }
1201
2779
  return this.idTabla.map(d => data[d]).join('-');
1202
2780
  }
@@ -1206,62 +2784,284 @@ class TablaMantenimientoComponent {
1206
2784
  rowTooltip = (item) => '';
1207
2785
  soloIconos = false;
1208
2786
  ngOnInit() {
1209
- this.router.events.pipe(filter(event => event instanceof NavigationEnd), startWith(null), map(() => this.getDeepestRoute(this.route)), map(route => route.snapshot.data), takeUntilDestroyed(this.destroyRef)).subscribe(data => {
1210
- console.log(data);
1211
- this.derechosActuales = data['derechos'];
1212
- this.ignorarDerechos = data['ignorarDerechos'] ?? false;
1213
- });
2787
+ this.router.events.pipe(filter(event => event instanceof NavigationEnd), startWith(null), map(() => this.getDeepestRoute(this.route)), map(route => route.snapshot.data), takeUntilDestroyed(this.destroyRef)).subscribe(data => this.aplicarDerechosDeRuta(data));
1214
2788
  this.paginacion.pageSize = this.pageSize;
1215
2789
  this.paginacion.pageSizeOptions = this.pageSizeOptions;
1216
2790
  this.actualizarCrud();
1217
2791
  this.agregarBotonesExportacion();
1218
2792
  if (this.dataSuscription) {
1219
- this.dataSuscription.subscribe(res => {
2793
+ this.dataSuscription.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(res => {
1220
2794
  if (res) {
1221
- if (this.objSeleccionado) {
1222
- console.log('SELECCIONADO');
1223
- if (this.idTabla && this.idTabla.length > 0) {
1224
- console.log('ID TABLA');
1225
- const arrayData = this.idTabla.map(d => this.objSeleccionado[d]);
1226
- console.log(arrayData);
1227
- const busqueda = buscarEnArray(res, this.idTabla, arrayData);
1228
- console.log(busqueda);
1229
- if (busqueda) {
1230
- console.log(busqueda);
1231
- this.objSeleccionado = busqueda;
1232
- }
2795
+ // El registro que estaba seleccionado hay que buscarlo en los datos nuevos,
2796
+ // pero la restauración va DESPUÉS de `setData`: al avisar al padre se lee
2797
+ // `dataSource`, y si todavía tuviera la lista anterior emitiría el registro viejo.
2798
+ const anterior = this.objSeleccionado;
2799
+ this.setData(res);
2800
+ let renovado = null;
2801
+ if (anterior) {
2802
+ renovado = (this.idTabla && this.idTabla.length > 0)
2803
+ ? buscarEnArray(res, this.idTabla, this.idTabla.map(d => anterior[d]))
2804
+ : (Array.isArray(res)
2805
+ ? res.find((itm) => this.propiedadSeleccion(itm) === this.propiedadSeleccion(anterior))
2806
+ : null);
2807
+ if (renovado) {
2808
+ this.objSeleccionado = renovado;
1233
2809
  }
1234
- else {
1235
- console.log('eLSE ID TABLA');
1236
- const dataStr = Array.isArray(res) ? res.find((itm) => simpleHash(JSON.stringify({
1237
- ...itm, claseFinal: undefined
1238
- })) == simpleHash(JSON.stringify({ ...this.objSeleccionado, claseFinal: undefined }))) : null;
1239
- if (dataStr) {
1240
- this.objSeleccionado = dataStr;
1241
- }
2810
+ }
2811
+ if (!renovado) {
2812
+ // La selección se fijó antes de que llegaran los datos (`[selectionModel]`
2813
+ // o `seleccionarPorId()` justo después de guardar): si la fila ya viene,
2814
+ // se avisa al padre con el registro recién cargado.
2815
+ const encontrado = this.buscarItemSeleccionado;
2816
+ if (encontrado) {
2817
+ this.selectionModelChange.emit(encontrado);
1242
2818
  }
1243
2819
  }
1244
- this.setData(res);
2820
+ this.irAPaginaDeSeleccion();
1245
2821
  }
1246
2822
  });
1247
2823
  }
1248
2824
  this.isRecargarUsed = this.accionRecargar.observed;
1249
2825
  }
2826
+ /**
2827
+ * Si los datos llegaron antes de que existiera la vista (un `BehaviorSubject` con valor, una
2828
+ * señal con `toObservable`), `setData` no encontró paginador ni orden que enganchar y la tabla
2829
+ * pintaba todas las filas aunque el paginador dijera "1 – 25 de 100". Se enganchan aquí, salvo
2830
+ * que pagine el servidor (`iTotalRegistros`).
2831
+ */
2832
+ ngAfterViewInit() {
2833
+ this.observarAnchoBanda();
2834
+ // Página nueva, otro orden u otro filtro: cambian las celdas que se miden.
2835
+ this.dataSource.connect().pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => this.programarCalculoColumnas());
2836
+ // Con una fuente que carga tarde, las primeras medidas quedan cortas.
2837
+ if (typeof document !== 'undefined') {
2838
+ document.fonts?.ready.then(() => this.programarCalculoColumnas());
2839
+ }
2840
+ const datos = this.dataSource.data ?? [];
2841
+ if (datos.length < 1 || datos[0]?.['iTotalRegistros']) {
2842
+ return;
2843
+ }
2844
+ if (!this.dataSource.paginator && this.paginator) {
2845
+ this.dataSource.paginator = this.paginator;
2846
+ }
2847
+ if (!this.dataSource.sort && this.sort) {
2848
+ this.dataSource.sort = this.sort;
2849
+ }
2850
+ }
2851
+ ngAfterViewChecked() {
2852
+ this.desplazarASeleccion();
2853
+ // Una columna con `visible` como función puede encenderse o apagarse en cualquier ciclo.
2854
+ if (this.columnasSiNoCaben() === 'ocultar'
2855
+ && this.columnasCandidatas().map(column => column.property).join('|') !== this.firmaColumnas) {
2856
+ this.programarCalculoColumnas();
2857
+ }
2858
+ }
2859
+ /**
2860
+ * Selecciona la fila cuyo `idTabla` vale `valor` (uno o varios valores, en el orden de
2861
+ * `idTabla`) y la lleva a la vista. Pensado para después de guardar: el procedimiento devuelve
2862
+ * el id y la pantalla no tiene que buscar el registro. Si la fila todavía no está en los datos
2863
+ * (la recarga viene en camino), la selección queda fijada y se aplica, avisando al padre,
2864
+ * cuando lleguen. Devuelve si la fila ya estaba en los datos.
2865
+ */
2866
+ seleccionarPorId(valor) {
2867
+ if (!this.idTabla || this.idTabla.length < 1) {
2868
+ console.warn('[jvs-tabla-mantenimiento] seleccionarPorId necesita idTabla.');
2869
+ return false;
2870
+ }
2871
+ const valores = Array.isArray(valor) ? valor : [valor];
2872
+ const id = `${this.nombreColeccion}_${valores.join('-')}`;
2873
+ this.cacheSeleccionado = null;
2874
+ this._seleccionado = id;
2875
+ this.seleccionASeguir = id;
2876
+ const item = this.buscarItemSeleccionado;
2877
+ if (!item) {
2878
+ return false;
2879
+ }
2880
+ this.selectionModelChange.emit(item);
2881
+ this.irAPaginaDeSeleccion();
2882
+ return true;
2883
+ }
2884
+ /**
2885
+ * Lleva a la vista la fila seleccionada ahora, aunque sea la misma de antes. Para después de
2886
+ * editar un registro que puede haber cambiado de posición (la lista se ordena por un campo que
2887
+ * se editó): la tabla por sí sola no se mueve cuando la selección no cambia.
2888
+ */
2889
+ irASeleccion() {
2890
+ if (typeof this._seleccionado !== 'string') {
2891
+ return;
2892
+ }
2893
+ this.seleccionASeguir = this._seleccionado;
2894
+ this.irAPaginaDeSeleccion();
2895
+ }
2896
+ /**
2897
+ * Si hay una fila por seguir y está en los datos, pone el paginador en su página (paginación
2898
+ * en cliente, según el orden y el filtro activos). Si el buscador simple la oculta, lo limpia.
2899
+ * Con paginación en el servidor no hay página que calcular: solo se desplazará si viene en la
2900
+ * página cargada. Devuelve si cambió de página.
2901
+ *
2902
+ * Se llama al fijar la selección y al llegar datos, nunca desde `ngAfterViewChecked`: mover
2903
+ * el paginador después de comprobar la vista daría NG0100 en desarrollo.
2904
+ */
2905
+ irAPaginaDeSeleccion() {
2906
+ if (!this.seleccionASeguir || !this.debeSeguirSeleccion() || this._seleccionado !== this.seleccionASeguir) {
2907
+ return false;
2908
+ }
2909
+ const item = this.buscarItemSeleccionado;
2910
+ if (!item) {
2911
+ return false;
2912
+ }
2913
+ const ds = this.dataSource;
2914
+ let visibles = ds.filteredData ?? [];
2915
+ if (!visibles.includes(item) && ds.arbolActivo && ds.abrirCaminoA(item)) {
2916
+ // En árbol puede estar dentro de una rama plegada: se abre su camino.
2917
+ visibles = ds.filteredData ?? [];
2918
+ }
2919
+ if (!visibles.includes(item) && this.busquedaTipo() === 'simple' && this.textoBuscado) {
2920
+ // El filtro vive en el dataSource: al vaciar el texto, `filteredData` se recalcula al instante.
2921
+ this.cCampoBusqueda.setValue('');
2922
+ visibles = ds.filteredData ?? [];
2923
+ if (!visibles.includes(item) && ds.arbolActivo) {
2924
+ ds.abrirCaminoA(item);
2925
+ visibles = ds.filteredData ?? [];
2926
+ }
2927
+ }
2928
+ if (!ds.paginator || !this.paginator || !this.esTabla || !this.paginador) {
2929
+ return false;
2930
+ }
2931
+ const orden = ds.arbolActivo ? ds._orderData(visibles) : (ds.sort ? ds.sortData(visibles.slice(), ds.sort) : visibles);
2932
+ const indice = orden.indexOf(item);
2933
+ const tamano = this.paginator.pageSize || this.paginacion.pageSize || 1;
2934
+ const pagina = Math.floor(indice / tamano);
2935
+ if (indice < 0 || pagina === this.paginator.pageIndex) {
2936
+ return false;
2937
+ }
2938
+ this.paginator.pageIndex = pagina;
2939
+ // Volver a enganchar el paginador repinta con la página nueva sin emitir `page`: no es
2940
+ // una acción del usuario y no debe disparar `resultados`.
2941
+ ds.paginator = this.paginator;
2942
+ this.seguimientoCambioPagina = true;
2943
+ return true;
2944
+ }
2945
+ /**
2946
+ * Segunda parte del seguimiento, cuando la fila ya está pintada: si no se ve, se desplaza a
2947
+ * la vista; si hubo que desplazarla o cambiar de página, se resalta un instante. Si no está
2948
+ * pintada todavía (otra página, datos por llegar) se vuelve a intentar en el siguiente ciclo.
2949
+ */
2950
+ desplazarASeleccion() {
2951
+ if (!this.seleccionASeguir) {
2952
+ return;
2953
+ }
2954
+ if (!this.debeSeguirSeleccion() || this._seleccionado !== this.seleccionASeguir) {
2955
+ // Desactivado, o la selección cambió por otro camino (clic, teclado).
2956
+ this.seleccionASeguir = null;
2957
+ this.seguimientoCambioPagina = false;
2958
+ return;
2959
+ }
2960
+ const id = this.seleccionASeguir;
2961
+ const fila = this.rows?.find(r => r.nativeElement.id === id)?.nativeElement;
2962
+ if (!fila) {
2963
+ return;
2964
+ }
2965
+ this.seleccionASeguir = null;
2966
+ const cambioPagina = this.seguimientoCambioPagina;
2967
+ this.seguimientoCambioPagina = false;
2968
+ let movida = false;
2969
+ if (!this.filaALaVista(fila)) {
2970
+ fila.scrollIntoView({ block: 'center' });
2971
+ movida = true;
2972
+ }
2973
+ if (movida || cambioPagina) {
2974
+ this.resaltarFila(fila);
2975
+ }
2976
+ }
2977
+ /**
2978
+ * Si la fila se ve entera: dentro de la ventana, de cualquier contenedor con scroll propio
2979
+ * que la envuelva, y no tapada por la cabecera fija de la tabla.
2980
+ */
2981
+ filaALaVista(fila) {
2982
+ const r = fila.getBoundingClientRect();
2983
+ if (r.width === 0 && r.height === 0) {
2984
+ // Sin tamaño no hay a dónde desplazar (tabla oculta).
2985
+ return true;
2986
+ }
2987
+ const altoVentana = window.innerHeight || document.documentElement.clientHeight;
2988
+ if (r.top < 0 || r.bottom > altoVentana) {
2989
+ return false;
2990
+ }
2991
+ const cabecera = fila.closest('table')?.querySelector('tr[mat-header-row]');
2992
+ if (cabecera && r.top < cabecera.getBoundingClientRect().bottom - 1) {
2993
+ return false;
2994
+ }
2995
+ let padre = fila.parentElement;
2996
+ while (padre && padre !== document.body) {
2997
+ if (padre.scrollHeight > padre.clientHeight + 1) {
2998
+ const overflow = getComputedStyle(padre).overflowY;
2999
+ if (overflow === 'auto' || overflow === 'scroll') {
3000
+ const c = padre.getBoundingClientRect();
3001
+ if (r.top < c.top || r.bottom > c.bottom) {
3002
+ return false;
3003
+ }
3004
+ }
3005
+ }
3006
+ padre = padre.parentElement;
3007
+ }
3008
+ return true;
3009
+ }
3010
+ resaltarFila(fila) {
3011
+ fila.classList.add(CLASE_RESALTE_FILA);
3012
+ setTimeout(() => fila.classList.remove(CLASE_RESALTE_FILA), DURACION_RESALTE_MS);
3013
+ }
3014
+ /** Filas desplegadas, por su identificador. El estado es de la tabla, no del registro. */
3015
+ filasExpandidas = new Set();
3016
+ /** Se pasa a la definición de columnas, que pregunta por fila al pintar el icono. */
3017
+ estaExpandidaFn = (item) => this.estaExpandida(item);
3018
+ /**
3019
+ * Si la fila está desplegada. Además del estado propio se mira `isExpanded` dentro del
3020
+ * registro, porque varias pantallas lo traen puesto para abrir una fila de entrada
3021
+ * (archivo digital hace `firstRow.isExpanded = true` antes de entregar los datos).
3022
+ */
3023
+ estaExpandida(item) {
3024
+ if (this.filasExpandidas.has(this.propiedadSeleccion(item))) {
3025
+ return true;
3026
+ }
3027
+ return !!item?.['isExpanded'];
3028
+ }
3029
+ /**
3030
+ * Despliega o pliega la fila. El estado vive aquí.
3031
+ *
3032
+ * @deprecated El espejo `isExpanded` dentro del registro se mantiene solo por
3033
+ * compatibilidad y se retirará: las pantallas que lo leen (`*ngIf="row.isExpanded"`) o lo
3034
+ * escriben para abrir una fila de entrada deben pasar a `estaExpandida()` y
3035
+ * `alternarExpansion()`.
3036
+ */
3037
+ alternarExpansion(item) {
3038
+ const clave = this.propiedadSeleccion(item);
3039
+ const expandida = this.estaExpandida(item);
3040
+ if (expandida) {
3041
+ this.filasExpandidas.delete(clave);
3042
+ }
3043
+ else {
3044
+ this.filasExpandidas.add(clave);
3045
+ }
3046
+ if (item && typeof item === 'object') {
3047
+ item['isExpanded'] = !expandida;
3048
+ }
3049
+ }
3050
+ /** Toma del `data` de la ruta lo que la pantalla no haya pasado por entrada. */
3051
+ aplicarDerechosDeRuta(data) {
3052
+ if (!this.derechosDelPadre) {
3053
+ this._derechosActuales = data['derechos'];
3054
+ }
3055
+ this.ignorarDerechos = data['ignorarDerechos'] ?? false;
3056
+ }
1250
3057
  ngAfterContentInit() {
1251
3058
  this.componenteCargadoTotalmente = true;
1252
3059
  this.cdRef.detectChanges();
1253
- this.columnDefs.forEach(columnDef => {
1254
- this.table.addColumnDef(columnDef);
1255
- const col = this.columnasTabla.find(col => col.property == columnDef.name);
1256
- if (col && col.type == 'custom') {
1257
- col.visible = col.datosExtra?.tabla_mantenimiento_config_visibleAlias ?? col.visible;
1258
- delete col.datosExtra?.tabla_mantenimiento_config_visibleAlias;
1259
- if (Object.keys(col.datosExtra).length < 1) {
1260
- delete col.datosExtra;
1261
- }
1262
- }
3060
+ this.confirmarColumnasCustom();
3061
+ this.columnDefs.changes.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {
3062
+ this.confirmarColumnasCustom();
3063
+ this.cdRef.markForCheck();
1263
3064
  });
1264
- // console.log(a);
1265
3065
  if (this.busquedaValor()) {
1266
3066
  this.cCampoBusqueda.setValue(this.busquedaValor());
1267
3067
  }
@@ -1288,8 +3088,11 @@ class TablaMantenimientoComponent {
1288
3088
  const fnAddBoton = (condicion, tipoBoton) => {
1289
3089
  if (condicion) {
1290
3090
  const objBoton = buscarEnArray(this.templateBotonesComunes, 'tipo', tipoBoton);
1291
- const objBotonEnInferior = buscarEnArray((this.botonesMenu?.inferior ?? []), 'tipo', tipoBoton);
1292
- if (!objBotonEnInferior && objBoton) {
3091
+ // Se busca en todas las secciones, no solo en la inferior: una pantalla que
3092
+ // declare el botón donde quiera acababa viéndolo dos veces.
3093
+ const yaDeclarado = Object.values(this.botonesMenu ?? {})
3094
+ .some(seccion => (seccion ?? []).some((btn) => btn?.tipo === tipoBoton));
3095
+ if (!yaDeclarado && objBoton) {
1293
3096
  if (!this.botonesMenu.inferior) {
1294
3097
  this.botonesMenu.inferior = [];
1295
3098
  }
@@ -1351,15 +3154,38 @@ class TablaMantenimientoComponent {
1351
3154
  if (this.objSeleccionado == item || this.esSeleccionActual(item)) {
1352
3155
  claseFinal = claseFinal.concat(this.classSeleccionado);
1353
3156
  }
3157
+ if (this.dataSource.infoArbol(item)?.contexto) {
3158
+ claseFinal.push(CLASE_FILA_CONTEXTO);
3159
+ }
1354
3160
  claseFinal = claseFinal.concat(this.condicionesClaseFila(item));
1355
- item.claseFinal = claseFinal;
3161
+ // No se guarda en el registro: es dato del padre, y escribir aquí cambiaba el hash con
3162
+ // el que se identifica la fila cuando no hay `idTabla`, haciendo que la selección se
3163
+ // perdiera sola al repintarse.
1356
3164
  return claseFinal;
1357
3165
  }
3166
+ /**
3167
+ * Memoria del tooltip por registro. La plantilla lo pide tres veces por fila (texto,
3168
+ * `matTooltipDisabled` y la clase `regTooltip`), y cada llamada ejecuta el `rowTooltip` del
3169
+ * consumidor. Se recalcula cuando cambian los datos.
3170
+ */
3171
+ cacheTooltip = new WeakMap();
1358
3172
  procesarRowTooltip(item) {
3173
+ if (item && typeof item === 'object') {
3174
+ const guardado = this.cacheTooltip.get(item);
3175
+ if (guardado !== undefined) {
3176
+ return guardado;
3177
+ }
3178
+ }
3179
+ const texto = this.calcularRowTooltip(item);
3180
+ if (item && typeof item === 'object') {
3181
+ this.cacheTooltip.set(item, texto);
3182
+ }
3183
+ return texto;
3184
+ }
3185
+ calcularRowTooltip(item) {
1359
3186
  let txtTooptip = [];
1360
3187
  if (this.campoAnuladoMensaje && (item[this.campoAnulado] == 1)) {
1361
3188
  txtTooptip.push(item[this.campoAnuladoMensaje]);
1362
- // return item[this.campoAnuladoMensaje];
1363
3189
  }
1364
3190
  if (this.rowTooltip) {
1365
3191
  txtTooptip.push(this.rowTooltip(item));
@@ -1369,15 +3195,29 @@ class TablaMantenimientoComponent {
1369
3195
  subItemsActivos(btn, item) {
1370
3196
  return btn.subItems.filter((sub) => !sub.esVisible || sub.esVisible(item)).length > 0;
1371
3197
  }
3198
+ /** Se arma una sola vez: la plantilla lo consume con `async`, y devolver un observable nuevo
3199
+ * en cada ciclo hacía que la tubería se desuscribiera y volviera a suscribirse sin parar. */
3200
+ noData$ = null;
1372
3201
  get noData() {
1373
- if (!this.esTabla) {
3202
+ if (!this.esTabla || !this.dataSource) {
1374
3203
  return of(true);
1375
3204
  }
1376
- if (!this.dataSource || !this.table) {
1377
- return of(true);
3205
+ if (!this.noData$) {
3206
+ this.noData$ = this.dataSource.connect().pipe(map(data => (data?.length ?? 0) === 0));
3207
+ }
3208
+ return this.noData$;
3209
+ }
3210
+ /** Texto escrito en el buscador, sin espacios de los extremos. Vacío si no se busca nada. */
3211
+ get textoBuscado() {
3212
+ return String(this.cCampoBusqueda.value ?? '').trim();
3213
+ }
3214
+ /** Borra el texto del buscador: la tabla vuelve a filtrar (o a consultar) sin él. */
3215
+ limpiarBusqueda() {
3216
+ this.cCampoBusqueda.setValue('');
3217
+ // La búsqueda simple filtra al cambiar el texto; la de consulta pide los datos de nuevo.
3218
+ if (this.busquedaTipo() === 'query') {
3219
+ this.cargarData();
1378
3220
  }
1379
- // @ts-ignore
1380
- return this.table.dataSource?.connect().pipe(map(data => data?.length === 0));
1381
3221
  }
1382
3222
  onFilterChange(value) {
1383
3223
  if (!this.dataSource) {
@@ -1386,11 +3226,33 @@ class TablaMantenimientoComponent {
1386
3226
  value = value.trim();
1387
3227
  value = value.toLowerCase();
1388
3228
  this.dataSource.filter = value;
3229
+ this.soltarSeleccionOcultaPorBusqueda();
3230
+ }
3231
+ /**
3232
+ * Si el texto del buscador deja fuera la fila seleccionada, la selección se suelta y se avisa
3233
+ * al padre (`selectionModelChange` con `null`): así los botones no actúan sobre una fila que no
3234
+ * se ve. En árbol, una fila que queda como camino de una coincidencia (atenuada) sigue a la vista.
3235
+ *
3236
+ * Precedencia con `seguirSeleccion`: lo último que pasó manda. Si la pantalla fija una
3237
+ * selección que la búsqueda oculta, la tabla limpia la búsqueda (`irAPaginaDeSeleccion`); si
3238
+ * el usuario escribe un texto que oculta la selección, la selección se suelta. Una selección
3239
+ * fijada que aún no llegó en los datos no se suelta.
3240
+ */
3241
+ soltarSeleccionOcultaPorBusqueda() {
3242
+ if (!this.textoBuscado || this._seleccionado === null) {
3243
+ return;
3244
+ }
3245
+ const item = this.buscarItemSeleccionado;
3246
+ if (!item || this.dataSource.estaALaVista(item)) {
3247
+ return;
3248
+ }
3249
+ this.seleccionASeguir = null;
3250
+ this.seleccionarItem(null);
1389
3251
  }
1390
3252
  toggleColumnVisibility(column, event) {
1391
3253
  event.stopPropagation();
1392
3254
  event.stopImmediatePropagation();
1393
- column.visible = !column.visible;
3255
+ this.elegirVisibilidadColumna(column, !this.esColumnaVisible(column));
1394
3256
  }
1395
3257
  cargarData(retorno = false) {
1396
3258
  if (this.busquedaTipo() && this.busquedaTipo() == 'simple') {
@@ -1421,20 +3283,25 @@ class TablaMantenimientoComponent {
1421
3283
  toggleDireccionOrden() {
1422
3284
  this.bDireccionOrden.update((v) => v === 0 ? 1 : 0);
1423
3285
  this.emitirResultados();
1424
- // if (this.busquedaTipo() === 'query') {
1425
- // this.cargarData();
1426
- // } else {
1427
- // this.emitirAccionRecargar();
1428
- // }
1429
3286
  }
1430
3287
  // FIN FILTRO BUSQUEDA INTEGRAR
1431
3288
  setData(data) {
1432
3289
  if (!Array.isArray(data)) {
1433
3290
  data = [];
1434
3291
  }
1435
- this.dataSource = new MatTableDataSource(data);
3292
+ // Se reutiliza la misma instancia en vez de crear otra en cada carga. Crear una nueva
3293
+ // dejaba el texto del buscador sin efecto (el filtro vive en el dataSource), obligaba a
3294
+ // recablear orden y paginador, y dejaba colgada la suscripción que la navegación por
3295
+ // teclado toma de `connect()`, que entonces trabajaba con los datos anteriores.
3296
+ this.dataSource.data = data;
3297
+ this.filasExpandidas.clear();
3298
+ this.cacheSeleccionado = null;
3299
+ this.cacheTooltip = new WeakMap();
1436
3300
  this.dataSource.sortingDataAccessor = (item, property) => {
1437
3301
  const dColumn = buscarEnArray(this.columnasTabla, 'property', property);
3302
+ if (dColumn?.ordenarPor) {
3303
+ return dColumn.ordenarPor(item);
3304
+ }
1438
3305
  if (dColumn) {
1439
3306
  switch (dColumn.sortType ?? dColumn.type) {
1440
3307
  case 'number':
@@ -1452,14 +3319,10 @@ class TablaMantenimientoComponent {
1452
3319
  }
1453
3320
  }
1454
3321
  };
1455
- // this.paginator.length = (data && data[0] && data[0]['iTotalRegistros']) ? data[0]['iTotalRegistros'] : data.length;
1456
- // this.dataSource.paginator = this.paginator;
1457
3322
  if (this.sort) {
1458
3323
  this.dataSource.sort = this.sort;
1459
3324
  }
1460
- // this.dataSource.filter = this.filter;
1461
3325
  this.dataSourceChange.emit(this.dataSource);
1462
- // this.dataSource.paginator.pageSize = this.paginacion.pageSize;
1463
3326
  if (data && data[0] && data[0]['iPageNumber']) {
1464
3327
  this.paginacion.pageIndex = (data && data[0] && data[0]['iPageNumber']) ? data[0]['iPageNumber'] : 0;
1465
3328
  }
@@ -1467,11 +3330,16 @@ class TablaMantenimientoComponent {
1467
3330
  this.bDireccionOrden.set(data[0]['bDireccionOrden']);
1468
3331
  }
1469
3332
  this.paginacion.pageLength = (data && data[0] && data[0]['iTotalRegistros']) ? data[0]['iTotalRegistros'] : data.length;
1470
- if (data && data[0] && !data[0]['iTotalRegistros']) {
1471
- this.dataSource.paginator = this.paginator;
3333
+ if (data && data[0]) {
3334
+ // Con una sola instancia hay que decir las dos cosas: quién pagina en cliente y
3335
+ // quién no. Si el servidor ya manda la página (`iTotalRegistros`) y el paginador
3336
+ // siguiera enganchado de una carga anterior, recortaría esa página por el índice
3337
+ // que tuviera y la tabla saldría vacía.
3338
+ this.dataSource.paginator = data[0]['iTotalRegistros'] ? null : this.paginator;
1472
3339
  }
1473
3340
  if (this.tieneCheckbox) {
1474
- this.chkLista.agregarControles(data, this.tieneCheckbox.property, !this.tieneCheckbox.chkFieldPersistente, (this.tieneCheckbox.chkField ?? null), this.tieneCheckbox.chkFieldSeparador);
3341
+ const casilla = this.tieneCheckbox;
3342
+ this.chkLista.prepararCasillas(data, casilla.chkField ?? casilla.property, casilla.chkFieldSeparador ?? '', !casilla.chkFieldPersistente);
1475
3343
  }
1476
3344
  }
1477
3345
  botonDisabled(btn, item) {
@@ -1485,19 +3353,268 @@ class TablaMantenimientoComponent {
1485
3353
  }
1486
3354
  }
1487
3355
  if (!disabled && !btn.esIndependiente && !btn.ignorarDerecho && this.derechosActuales) {
1488
- // if (!this.usuarioService.esEquipoJVSoft()) {
1489
3356
  disabled = !(this.derechosActuales[btn.cDerechoCodigo ?? btn.tipo]);
1490
- // }
1491
3357
  }
1492
3358
  return disabled;
1493
3359
  }
3360
+ esExportacion(btn) {
3361
+ return TIPOS_EXPORTACION_TABLA.includes(btn?.tipo);
3362
+ }
3363
+ /**
3364
+ * Margen del control segmentado: las clases de margen (`ml-2`, `mx-1`…) del primer botón del
3365
+ * grupo, que dentro del segmento no tendrían efecto. Así un grupo se separa de lo anterior
3366
+ * igual que un botón suelto.
3367
+ */
3368
+ margenSegmentado(botones) {
3369
+ return (botones?.[0]?.class ?? '').split(/\s+/)
3370
+ .filter(c => /^!?m[lrxy]?-/.test(c))
3371
+ .join(' ');
3372
+ }
3373
+ /**
3374
+ * Parte una sección en tramos: los botones consecutivos con el mismo `grupo` forman un
3375
+ * control segmentado; los demás van solos, como siempre. Del grupo quedan los visibles
3376
+ * (`esVisible`); un botón con submenú no entra en un grupo.
3377
+ */
3378
+ segmentosBotones(botones) {
3379
+ const tramos = [];
3380
+ const item = this.objSeleccionado;
3381
+ for (const btn of botones ?? []) {
3382
+ if (btn.esVisible && !btn.esVisible(item, this)) {
3383
+ continue;
3384
+ }
3385
+ const grupo = (btn.grupo && !(btn.subItems && btn.subItems.length > 0)) ? btn.grupo : undefined;
3386
+ const ultimo = tramos[tramos.length - 1];
3387
+ if (grupo && ultimo?.grupo === grupo) {
3388
+ ultimo.botones.push(btn);
3389
+ }
3390
+ else {
3391
+ tramos.push({ grupo, botones: [btn], margen: '' });
3392
+ }
3393
+ }
3394
+ // Un segmentado se separa 4 px (`ml-1`) de lo que tenga al lado, para que dos grupos
3395
+ // seguidos no queden pegados. Si su primer botón trae un margen propio (`ml-2`…), ese
3396
+ // manda. Los botones sueltos entre sí siguen unidos, como siempre (Nuevo|Editar|Eliminar).
3397
+ tramos.forEach((tramo, i) => {
3398
+ if (tramo.grupo) {
3399
+ tramo.margen = this.margenSegmentado(tramo.botones) || (i > 0 ? 'ml-1' : '');
3400
+ }
3401
+ else if (i > 0 && tramos[i - 1].grupo) {
3402
+ tramo.margen = 'ml-1';
3403
+ }
3404
+ });
3405
+ return tramos;
3406
+ }
3407
+ /** Clases de un botón de la barra: las suyas y, si declara `activo`, el aspecto de filtro. */
3408
+ claseBotonBarra(btn, item) {
3409
+ const propia = btn.class ? btn.class : 'text-secondary';
3410
+ const activo = this.esBotonActivo(btn, item);
3411
+ if (activo === null) {
3412
+ return propia;
3413
+ }
3414
+ return `${propia} ${activo ? CLASES_BOTON_ACTIVO : CLASES_BOTON_INACTIVO}`;
3415
+ }
3416
+ /** Clases de un ítem de menú (≡ o contextual): el elegido de su grupo va en negrita con una marca. */
3417
+ claseItemMenu(btn, item) {
3418
+ const propia = btn.class ? btn.class.replace('text-white', '').replace('bg', 'text') : 'text-secondary';
3419
+ if (this.esBotonActivo(btn, item) !== true) {
3420
+ return propia;
3421
+ }
3422
+ return `${propia} ${this.usaColoresTema() ? CLASES_ITEM_MENU_ACTIVO_TEMA : CLASES_ITEM_MENU_ACTIVO}`;
3423
+ }
3424
+ /** Botones junto a Recargar: `herramientas` más las exportaciones de `inferior`. */
3425
+ get botonesHerramientas() {
3426
+ const finales = this.botonesMenuFinal;
3427
+ const propios = finales.herramientas ?? [];
3428
+ if (!this.subeExportacion()) {
3429
+ return propios;
3430
+ }
3431
+ return [...propios, ...(finales.inferior ?? []).filter(btn => this.esExportacion(btn))];
3432
+ }
3433
+ /** Los que quedan en la barra de abajo. */
3434
+ get botonesInferior() {
3435
+ const inferior = this.botonesMenuFinal.inferior ?? [];
3436
+ return this.subeExportacion() ? inferior.filter(btn => !this.esExportacion(btn)) : inferior;
3437
+ }
3438
+ /** Herramientas que se ven ahora (para decidir si se agrupan en el menú "Exportar"). */
3439
+ get botonesHerramientasVisibles() {
3440
+ const item = this.objSeleccionado;
3441
+ return this.botonesHerramientas.filter(btn => !btn.esVisible || btn.esVisible(item, this));
3442
+ }
3443
+ /**
3444
+ * Clases del botón de herramientas. Va solo con ícono, como Recargar: se quitan color, fondo,
3445
+ * borde y espaciado de la clase del botón (pensados para un botón con texto), y PDF va en rojo
3446
+ * y Excel en verde en todas las pantallas, para reconocerlos de un vistazo. El resto hereda el
3447
+ * color de la banda.
3448
+ */
3449
+ claseHerramienta(btn) {
3450
+ const clases = (btn.class ?? '').split(/\s+/)
3451
+ .filter(c => c && !/^(!)?(dark:|hover:)?(bg-|text-|border|rounded|px-|py-|p-|m[lrxy]?-)/.test(c));
3452
+ const icono = this.iconoHerramienta(btn);
3453
+ if (icono === 'jvs_tabla:pdf') {
3454
+ clases.push('text-pdf');
3455
+ }
3456
+ else if (icono === 'jvs_tabla:excel') {
3457
+ clases.push('text-excel');
3458
+ }
3459
+ return clases.join(' ');
3460
+ }
3461
+ /**
3462
+ * Ícono de un botón de herramientas. Los de PDF y Excel del catálogo (y las exportaciones
3463
+ * sin ícono) usan los de respaldo de la tabla, que no dependen del CDN de íconos.
3464
+ */
3465
+ iconoHerramienta(btn) {
3466
+ const icono = btn.icono;
3467
+ const tipo = btn.tipo ?? '';
3468
+ if (icono === 'fa5FilePdf' || (!icono && /pdf|jasper/.test(tipo))) {
3469
+ return 'jvs_tabla:pdf';
3470
+ }
3471
+ if (icono === 'fa5FileExcel' || (!icono && /excel/.test(tipo))) {
3472
+ return 'jvs_tabla:excel';
3473
+ }
3474
+ return icono || 'jvs_tabla:exportar';
3475
+ }
3476
+ /** Texto del botón: su `label`, el nombre del derecho o el tipo en palabras. */
3477
+ etiquetaBoton(btn) {
3478
+ if (btn.label) {
3479
+ return btn.label;
3480
+ }
3481
+ const derecho = this.derechosActuales?.[btn.cDerechoCodigo ?? btn.tipo];
3482
+ return derecho ? derecho['cDerechoNombre'] : capitalizarTexto(btn.tipo);
3483
+ }
3484
+ /** Si el botón está deshabilitado, con la misma regla que la plantilla. */
3485
+ estaBotonDeshabilitado(btn, item) {
3486
+ return !btn.esIndependiente && !!this.botonDisabled(btn, item);
3487
+ }
3488
+ /**
3489
+ * Por qué el botón está deshabilitado. Primero el `tooltipDeshabilitado` del botón; si no
3490
+ * hay, los casos que la tabla conoce. Vacío si no está deshabilitado o no se sabe.
3491
+ */
3492
+ motivoDeshabilitado(btn, item) {
3493
+ if (!this.estaBotonDeshabilitado(btn, item)) {
3494
+ return '';
3495
+ }
3496
+ const propio = tipoValorFuncion(btn.tooltipDeshabilitado, undefined, item, this);
3497
+ if (propio) {
3498
+ return propio;
3499
+ }
3500
+ if (!btn.sinCondicion && !btn.estaDeshabilitado && !this.objSeleccionado) {
3501
+ return 'Selecciona un registro';
3502
+ }
3503
+ if (!btn.ignorarDerecho && this.derechosActuales && !this.derechosActuales[btn.cDerechoCodigo ?? btn.tipo]) {
3504
+ return 'No tienes permiso para esta acción';
3505
+ }
3506
+ return '';
3507
+ }
3508
+ /** Tooltip del botón habilitado: el `tooltip` o, si no, su texto. */
3509
+ tooltipBoton(btn) {
3510
+ return btn.tooltip || this.etiquetaBoton(btn);
3511
+ }
3512
+ /**
3513
+ * Descripción del contador (`matBadgeDescription`) para lectores de pantalla: "3 registros"
3514
+ * ("1 registro") o con `badgeDescripcion`. Sin contador, vacía (Material no agrega nada).
3515
+ */
3516
+ descripcionContador(btn) {
3517
+ if (btn.badge === undefined || btn.badge === null || btn.badge === '') {
3518
+ return '';
3519
+ }
3520
+ return `${btn.badge} ${btn.badgeDescripcion ?? (btn.badge.trim() === '1' ? 'registro' : 'registros')}`;
3521
+ }
3522
+ /**
3523
+ * Si el botón es el elegido de su grupo. `null` cuando el botón no declara `activo`: así
3524
+ * no lleva `aria-pressed` y se pinta como siempre.
3525
+ */
3526
+ esBotonActivo(btn, item) {
3527
+ if (btn.activo === undefined || btn.activo === null) {
3528
+ return null;
3529
+ }
3530
+ return !!tipoValorFuncion(btn.activo, false, item, this);
3531
+ }
1494
3532
  propiedadSeleccion(item) {
1495
3533
  return `${this.nombreColeccion}_${this.idTablaValor(item)}`;
1496
3534
  }
1497
3535
  esSeleccionActual(item) {
1498
3536
  return this._seleccionado === this.propiedadSeleccion(item);
1499
3537
  }
3538
+ /**
3539
+ * `Supr` sobre la fila pide eliminar. Se ignora cuando la tecla viene de un campo de la
3540
+ * celda: ahí el usuario está borrando texto, no el registro.
3541
+ */
3542
+ teclaEliminarEnFila(item, evento) {
3543
+ if (this.readOnly) {
3544
+ return;
3545
+ }
3546
+ const origen = evento.target;
3547
+ const etiqueta = origen?.tagName?.toLowerCase();
3548
+ if (etiqueta === 'input' || etiqueta === 'textarea' || etiqueta === 'select' || origen?.isContentEditable) {
3549
+ return;
3550
+ }
3551
+ this.opcMenu(item, { seccion: this.nombreColeccion, tipo: 'eliminar' });
3552
+ }
3553
+ /**
3554
+ * Espacio sobre la fila enfocada. Con columna de casillas marca o desmarca la suya, que es
3555
+ * lo que se espera de esa tecla en una lista con selección múltiple; sin casillas se
3556
+ * comporta como Enter y abre el registro.
3557
+ */
3558
+ teclaEspacioEnFila(item) {
3559
+ const casilla = this.tieneCheckbox;
3560
+ if (!casilla) {
3561
+ this.opcMenu(item, { seccion: this.nombreColeccion, tipo: 'ver' });
3562
+ return;
3563
+ }
3564
+ const clave = this.chkLista.generarId(item, casilla.chkField ?? casilla.property, casilla.chkFieldSeparador);
3565
+ this.chkLista.setState(clave, !this.chkLista.getState(clave));
3566
+ }
3567
+ /**
3568
+ * El teclado movió el foco a otra fila: se selecciona, pero sin avisar `ver`. Recorrer la
3569
+ * tabla con las flechas dispararía un aviso por fila, y los padres suelen cargar datos con él.
3570
+ */
3571
+ seleccionarFilaPorId(id) {
3572
+ const item = (this.dataSource?.data ?? []).find((itm) => this.propiedadSeleccion(itm) === id);
3573
+ if (item) {
3574
+ this.seleccionarItem(item, true);
3575
+ }
3576
+ }
3577
+ /**
3578
+ * Clic sobre una fila. `evento.detail` es el contador de clics del navegador: en un clic
3579
+ * suelto vale 1 y la selección alterna, así que volver a pulsar la fila la deselecciona.
3580
+ * El segundo clic de un doble clic llega con 2: ahí la selección se fuerza —alternar dejaba
3581
+ * la fila apagada justo al abrir el registro— y no se vuelve a avisar `ver`, porque los
3582
+ * consumidores que alternan su propia selección con ese evento acababan en desacuerdo con
3583
+ * la tabla.
3584
+ */
3585
+ /**
3586
+ * Doble clic sobre la fila. En solo lectura no dispara la acción: `permitirSeleccion` deja
3587
+ * elegir la fila, pero ni ese modo ni el solo lectura completo ejecutan nada.
3588
+ */
3589
+ dobleClicFila(item) {
3590
+ if (this.readOnly) {
3591
+ return;
3592
+ }
3593
+ this.opcMenu(item, { seccion: this.nombreColeccion, tipo: 'seleccionar' });
3594
+ this.dblclickItem.emit(item);
3595
+ }
3596
+ clicFila(item, tableDataIndex, evento) {
3597
+ const esSegundoClic = evento.detail > 1;
3598
+ this.seleccionarItem(item, esSegundoClic);
3599
+ if (!esSegundoClic) {
3600
+ this.opcMenu(item, { seccion: this.nombreColeccion, tipo: 'ver', tableDataIndex });
3601
+ }
3602
+ }
1500
3603
  seleccionarItem(item, forzado = false) {
3604
+ this.cacheSeleccionado = null;
3605
+ if (item == null) {
3606
+ // Sin registro no hay selección. Antes se guardaba `coleccion_` a secas, y cualquier
3607
+ // fila cuyo campo identificador viniera vacío coincidía con ese valor.
3608
+ const habiaSeleccion = this.objSeleccionado != null;
3609
+ this._seleccionado = null;
3610
+ // Solo se avisa si de verdad había algo: al arrancar, el enlace de dos sentidos entra
3611
+ // aquí con `undefined`, y emitir entonces cambiaría el valor del padre a media
3612
+ // detección de cambios (NG0100).
3613
+ if (habiaSeleccion) {
3614
+ this.selectionModelChange.emit(null);
3615
+ }
3616
+ return;
3617
+ }
1501
3618
  const idItem = this.propiedadSeleccion(item);
1502
3619
  if (forzado) {
1503
3620
  this._seleccionado = idItem;
@@ -1505,7 +3622,13 @@ class TablaMantenimientoComponent {
1505
3622
  else {
1506
3623
  this._seleccionado = this._seleccionado === idItem ? null : idItem;
1507
3624
  }
1508
- this.selectionModelChange.emit(this.objSeleccionado);
3625
+ const actual = this.objSeleccionado;
3626
+ // Fijada desde fuera una fila que no está (aún) en los datos, no hay nada que devolver:
3627
+ // emitir `undefined` borraba la selección del padre a media detección de cambios (NG0100).
3628
+ if (forzado && actual == null) {
3629
+ return;
3630
+ }
3631
+ this.selectionModelChange.emit(actual);
1509
3632
  /*if (this.objThis) {
1510
3633
  if (!this.objThis['seleccionados']) {
1511
3634
  this.objThis['seleccionados'] = {};
@@ -1513,17 +3636,77 @@ class TablaMantenimientoComponent {
1513
3636
  this.objThis['seleccionados'][this.nombreColeccion] = this.objSeleccionado;
1514
3637
  }*/
1515
3638
  }
3639
+ /** Encabezado de una columna en el Excel. */
3640
+ tituloExcel(columna) {
3641
+ return columna.excel?.titulo ?? (columna.labelLista ?? columna.label).toUpperCase().replace('<BR>', ' ');
3642
+ }
3643
+ /**
3644
+ * Filas del Excel tal como saldrían al pulsar `exportar_excel` (un objeto por fila, con el
3645
+ * encabezado de cada columna como clave), sin descargar nada. Sirve también para revisar el
3646
+ * Excel desde la consola o en pruebas.
3647
+ */
3648
+ datosExcel() {
3649
+ const dataGeneradoPorHtml = TableUtil.getWorkBook('tabla_' + this.nombreColeccion, []);
3650
+ const columnasExcel = this.columnasExcel;
3651
+ // En árbol, las coincidencias y sus antepasados aunque estén plegados.
3652
+ return this.dataSource.filasParaExportar().map((objeto, idx) => columnasExcel.reduce((acumulador, columna) => {
3653
+ const nColumn = this.tituloExcel(columna);
3654
+ if (columna.excel?.valor) {
3655
+ acumulador[nColumn] = columna.excel.valor(objeto, idx);
3656
+ return acumulador;
3657
+ }
3658
+ switch (columna.type) {
3659
+ case 'date':
3660
+ // new Date(dateString.replace(/(\d{2}:\d{2}:\d{2}):\w{2}/, '$1'));
3661
+ let fecha = objeto[columna.property];
3662
+ if (objeto[columna.property]) {
3663
+ fecha = new Date(objeto[columna.property].replace(/(\d{2}:\d{2}:\d{2}):\w{2}/, '$1'));
3664
+ if (getBrowserName() == 'chrome') {
3665
+ fecha = addMinutes(new Date(objeto[columna.property]), 2);
3666
+ }
3667
+ }
3668
+ acumulador[nColumn] = fecha;
3669
+ break;
3670
+ case 'number':
3671
+ case 'money':
3672
+ acumulador[nColumn] = objeto[columna.property] * 1;
3673
+ break;
3674
+ default:
3675
+ if (columna.property == 'numeracion_automatica') {
3676
+ acumulador[nColumn] = idx + 1;
3677
+ }
3678
+ else {
3679
+ if (columna.type == 'custom') {
3680
+ // dataGeneradoPorHtml.sheetToJson
3681
+ acumulador[nColumn] = dataGeneradoPorHtml.sheetToJson[idx][columna.label];
3682
+ }
3683
+ else {
3684
+ if ((columna.type == 'text' || columna.type == 'arbol') && columna.celda) {
3685
+ // Celda declarativa: su texto (textos, notas, badges y marcas).
3686
+ acumulador[nColumn] = textoCelda(columna.celda(objeto));
3687
+ }
3688
+ else if (columna.type == 'text' && columna.innerHTML) {
3689
+ const convertirHtmlATexto = (html) => {
3690
+ const elementoTemporal = document.createElement('div');
3691
+ elementoTemporal.innerHTML = html;
3692
+ return elementoTemporal.textContent || "";
3693
+ };
3694
+ acumulador[nColumn] = convertirHtmlATexto(columna.innerHTML(objeto));
3695
+ }
3696
+ else if (columna.transformar) {
3697
+ acumulador[nColumn] = columna.transformar(objeto);
3698
+ }
3699
+ else {
3700
+ acumulador[nColumn] = objeto[columna.property];
3701
+ }
3702
+ }
3703
+ }
3704
+ break;
3705
+ }
3706
+ return acumulador;
3707
+ }, {}));
3708
+ }
1516
3709
  opcMenu(item, objMenu, modal = null, retorno = false) {
1517
- // console.log(this.buscarItemSeleccionado);
1518
- // console.log(objMenu);
1519
- // let salir = this.readOnly;
1520
- // if (salir && this.readOnly === 'permitirSeleccion' && ['ver', 'seleccionar'].includes(objMenu.tipo)) {
1521
- // salir = false;
1522
- // }
1523
- // if (salir) {
1524
- // return false;
1525
- // }
1526
- // console.warn(objMenu);
1527
3710
  if (objMenu.tipo == 'exportar_excel' && this.exportarExcel) {
1528
3711
  /*
1529
3712
  TableUtil.exportArrayToExcel(this.dataSource.data.map(x => {
@@ -1534,66 +3717,13 @@ class TablaMantenimientoComponent {
1534
3717
  return x;
1535
3718
  }), 'TEST');
1536
3719
  */
1537
- const dataGeneradoPorHtml = TableUtil.getWorkBook('tabla_' + this.nombreColeccion, []);
1538
- const objetosExtraidos = this.dataSource.filteredData.map((objeto, idx) => this.objVisibleColumns.reduce((acumulador, columna) => {
1539
- // console.log(propiedad);
1540
- const nColumn = (columna.labelLista ?? columna.label).toUpperCase().replace('<BR>', ' ');
1541
- switch (columna.type) {
1542
- case 'date':
1543
- // acumulador[nColumn] = (new DatePipe('es-PE')).transform(objeto[columna.property], 'dd/MM/yyyy' /*'yyyy-MM-dd'*/);
1544
- // new Date(dateString.replace(/(\d{2}:\d{2}:\d{2}):\w{2}/, '$1'));
1545
- // acumulador[nColumn] = new Date(objeto[columna.property].replace(/(\d{2}:\d{2}:\d{2}):\w{2}/, '$1'));
1546
- // acumulador[nColumn] = formatearFechaFormato(objeto[columna.property], 'dd/MM/yyyy');
1547
- // acumulador[nColumn] = formatearFechaTimezone(objeto[columna.property]);
1548
- // acumulador[nColumn] = new Date(objeto[columna.property]);
1549
- let fecha = objeto[columna.property];
1550
- if (objeto[columna.property]) {
1551
- fecha = new Date(objeto[columna.property].replace(/(\d{2}:\d{2}:\d{2}):\w{2}/, '$1'));
1552
- if (getBrowserName() == 'chrome') {
1553
- fecha = addMinutes(new Date(objeto[columna.property]), 2);
1554
- }
1555
- }
1556
- acumulador[nColumn] = fecha;
1557
- // acumulador[nColumn] = objeto[columna.property];
1558
- break;
1559
- case 'number':
1560
- case 'money':
1561
- acumulador[nColumn] = objeto[columna.property] * 1;
1562
- break;
1563
- default:
1564
- if (columna.property == 'numeracion_automatica') {
1565
- acumulador[nColumn] = idx + 1;
1566
- }
1567
- else {
1568
- if (columna.type == 'custom') {
1569
- // dataGeneradoPorHtml.sheetToJson
1570
- acumulador[nColumn] = dataGeneradoPorHtml.sheetToJson[idx][columna.label];
1571
- }
1572
- else {
1573
- if (columna.type == 'text' && columna.innerHTML) {
1574
- const convertirHtmlATexto = (html) => {
1575
- const elementoTemporal = document.createElement('div');
1576
- elementoTemporal.innerHTML = html;
1577
- return elementoTemporal.textContent || "";
1578
- };
1579
- acumulador[nColumn] = convertirHtmlATexto(columna.innerHTML(objeto));
1580
- }
1581
- else if (columna.transformar) {
1582
- acumulador[nColumn] = columna.transformar(objeto);
1583
- }
1584
- else {
1585
- acumulador[nColumn] = objeto[columna.property];
1586
- }
1587
- }
1588
- }
1589
- break;
1590
- }
1591
- return acumulador;
1592
- }, {}));
3720
+ const columnasExcel = this.columnasExcel;
3721
+ const objetosExtraidos = this.datosExcel();
1593
3722
  // TableUtil.exportTableToExcel('tabla_' + this.nombreColeccion);
1594
- // console.log(objetosExtraidos);
1595
- TableUtil.exportArrayToExcel(objetosExtraidos, this.nombreColeccion);
1596
- // this.tableExporter.exportTable('xlsx', {fileName: 'JVSoftExport'});
3723
+ const anchos = columnasExcel.some(columna => columna.excel?.ancho)
3724
+ ? columnasExcel.map(columna => ({ wch: columna.excel?.ancho ?? Math.max(8, this.tituloExcel(columna).length + 2) }))
3725
+ : undefined;
3726
+ TableUtil.exportArrayToExcel(objetosExtraidos, this.nombreExcel() ?? this.nombreColeccion, anchos);
1597
3727
  }
1598
3728
  const opAdic = { seccion: this.nombreColeccion };
1599
3729
  if (item) {
@@ -1610,19 +3740,18 @@ class TablaMantenimientoComponent {
1610
3740
  if (retorno) {
1611
3741
  return objMenu;
1612
3742
  }
1613
- // console.warn(objMenu);
1614
3743
  this.opcionSelecionada.emit(objMenu);
1615
3744
  return 1;
1616
3745
  }
1617
3746
  emitirResultados(evento = {}) {
1618
3747
  this.opcFiltroActual = { ...this.opcFiltroActual, ...evento, ...this.cargarData(true) };
1619
- // console.warn('resultadosFILTRO', this.opcFiltroActual);
1620
3748
  this.resultados.emit(this.opcFiltroActual);
1621
3749
  }
1622
3750
  abrirMenuContextual({ x, y }, user) {
1623
- // console.log(user);
1624
- // this.opcMenu(user, {tipo: 'ver'});
1625
3751
  this.objSeleccionado = user;
3752
+ // El aviso es lo que mantiene al padre en la misma fila que la tabla: sin él, los
3753
+ // botones del menú actuaban sobre el registro seleccionado antes del clic derecho.
3754
+ this.opcMenu(user, { seccion: this.nombreColeccion, tipo: 'ver' });
1626
3755
  this.cerrarMenuContextual();
1627
3756
  const positionStrategy = this.overlay.position().flexibleConnectedTo({ x, y }).withPositions([
1628
3757
  {
@@ -1652,6 +3781,50 @@ class TablaMantenimientoComponent {
1652
3781
  this.overlayRef = undefined;
1653
3782
  }
1654
3783
  }
3784
+ /**
3785
+ * Mide la banda (buscador y botones) y el contenedor de la tabla (columnas que caben). Sin
3786
+ * `ResizeObserver` (SSR, pruebas) la banda cuenta como amplia y no se oculta ninguna columna.
3787
+ */
3788
+ observarAnchoBanda() {
3789
+ const banda = this.bandaTabla?.nativeElement;
3790
+ const contenedor = this.contenedorTabla?.nativeElement;
3791
+ if (!banda || typeof ResizeObserver === 'undefined') {
3792
+ return;
3793
+ }
3794
+ const observador = new ResizeObserver(entradas => {
3795
+ for (const entrada of entradas) {
3796
+ if (entrada.target === banda) {
3797
+ const ancho = Math.round(entrada.contentRect.width);
3798
+ if (ancho > 0 && ancho !== this.anchoBanda()) {
3799
+ this.anchoBanda.set(ancho);
3800
+ }
3801
+ }
3802
+ else {
3803
+ // `clientWidth` descuenta la barra de desplazamiento vertical. Menos de 4 px no
3804
+ // cambia lo que cabe y evita recalcular por redondeos.
3805
+ const ancho = entrada.target.clientWidth;
3806
+ const anterior = this.anchoContenedor();
3807
+ if (ancho > 0 && (anterior === null || Math.abs(ancho - anterior) >= 4)) {
3808
+ this.anchoContenedor.set(ancho);
3809
+ }
3810
+ }
3811
+ }
3812
+ });
3813
+ observador.observe(banda);
3814
+ if (contenedor) {
3815
+ observador.observe(contenedor);
3816
+ }
3817
+ this.destroyRef.onDestroy(() => {
3818
+ observador.disconnect();
3819
+ if (this.cuadroCalculoColumnas !== null) {
3820
+ cancelAnimationFrame(this.cuadroCalculoColumnas);
3821
+ }
3822
+ });
3823
+ }
3824
+ /** Al abrir el menú del buscador compacto, el foco va al campo. */
3825
+ enfocarBusquedaCompacta() {
3826
+ setTimeout(() => this.inputBusquedaCompacta?.nativeElement.focus());
3827
+ }
1655
3828
  ejecutarBusquedaCompacta() {
1656
3829
  if (this.busquedaTipo() === 'query') {
1657
3830
  this.cargarData();
@@ -1659,17 +3832,38 @@ class TablaMantenimientoComponent {
1659
3832
  this.compactSearchMenuTrigger.closeMenu();
1660
3833
  }
1661
3834
  emitirAccionRecargar() {
1662
- if (!this.idTabla) {
1663
- this.objSeleccionado = null;
1664
- }
1665
3835
  this.accionRecargar.emit(this.opcFiltroActual);
1666
- // this.accionRecargar.emit({ ...this.opcFiltroActual, ...{seleccionado: this.objSeleccionado}});
3836
+ }
3837
+ // ---- Árbol ----
3838
+ /** Nivel, hijos, si está abierta y si es solo contexto. `null` sin `[arbol]`. */
3839
+ infoArbol(fila) {
3840
+ return this.dataSource.infoArbol(fila);
3841
+ }
3842
+ /** Pliega o despliega la fila. No cambia la selección. */
3843
+ alternarNodo(fila) {
3844
+ this.dataSource.alternarNodo(fila);
3845
+ }
3846
+ /** Despliega (o pliega, con `false`) todas las ramas. */
3847
+ expandirTodoArbol(abrir = true) {
3848
+ this.dataSource.expandirTodo(abrir);
3849
+ }
3850
+ sangriaArbol() {
3851
+ return this.arbol()?.sangria ?? 14;
1667
3852
  }
1668
3853
  tipoValorFuncion = tipoValorFuncion;
1669
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: TablaMantenimientoComponent, deps: [{ token: i1$2.FormBuilder }, { token: i2$1.Overlay }, { token: i0.ViewContainerRef }, { token: TablaMantenimientoService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1670
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.18", type: TablaMantenimientoComponent, isStandalone: true, selector: "jvs-tabla-mantenimiento", inputs: { dataSuscription: { classPropertyName: "dataSuscription", publicName: "dataSuscription", isSignal: false, isRequired: false, transformFunction: null }, objThis: { classPropertyName: "objThis", publicName: "objThis", isSignal: false, isRequired: true, transformFunction: null }, nombreColeccion: { classPropertyName: "nombreColeccion", publicName: "nombreColeccion", isSignal: false, isRequired: true, transformFunction: null }, busquedaValor: { classPropertyName: "busquedaValor", publicName: "ctrlBusquedaValue", isSignal: true, isRequired: false, transformFunction: null }, busquedaPlaceholder: { classPropertyName: "busquedaPlaceholder", publicName: "ctrlBusquedaPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, filtroCampos: { classPropertyName: "filtroCampos", publicName: "filtroCampos", isSignal: false, isRequired: false, transformFunction: null }, paginador: { classPropertyName: "paginador", publicName: "paginador", isSignal: false, isRequired: false, transformFunction: null }, esTabla: { classPropertyName: "esTabla", publicName: "esTabla", isSignal: false, isRequired: false, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: false, isRequired: false, transformFunction: null }, filaExtraHeader: { classPropertyName: "filaExtraHeader", publicName: "filaExtraHeader", isSignal: false, isRequired: false, transformFunction: null }, filaFooter: { classPropertyName: "filaFooter", publicName: "filaFooter", isSignal: false, isRequired: false, transformFunction: null }, botonesCRUD: { classPropertyName: "botonesCRUD", publicName: "botonesCRUD", isSignal: false, isRequired: false, transformFunction: null }, objBotonesCRUD: { classPropertyName: "objBotonesCRUD", publicName: "objBotonesCRUD", isSignal: false, isRequired: false, transformFunction: null }, classSeleccionado: { classPropertyName: "classSeleccionado", publicName: "classSeleccionado", isSignal: false, isRequired: false, transformFunction: null }, classAnulado: { classPropertyName: "classAnulado", publicName: "classAnulado", isSignal: false, isRequired: false, transformFunction: null }, campoAnulado: { classPropertyName: "campoAnulado", publicName: "campoAnulado", isSignal: false, isRequired: false, transformFunction: null }, campoAnuladoMensaje: { classPropertyName: "campoAnuladoMensaje", publicName: "campoAnuladoMensaje", isSignal: false, isRequired: false, transformFunction: null }, selectionModel: { classPropertyName: "selectionModel", publicName: "selectionModel", isSignal: false, isRequired: false, transformFunction: null }, filaExtraTemplate: { classPropertyName: "filaExtraTemplate", publicName: "filaExtraTemplate", isSignal: false, isRequired: false, transformFunction: null }, exportarExcel: { classPropertyName: "exportarExcel", publicName: "exportarExcel", isSignal: false, isRequired: false, transformFunction: null }, busquedaCompacta: { classPropertyName: "busquedaCompacta", publicName: "busquedaCompacta", isSignal: true, isRequired: false, transformFunction: null }, alturaFull: { classPropertyName: "alturaFull", publicName: "alturaFull", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: false, isRequired: false, transformFunction: null }, pageSizeOptions: { classPropertyName: "pageSizeOptions", publicName: "pageSizeOptions", isSignal: false, isRequired: false, transformFunction: null }, derechosActuales: { classPropertyName: "derechosActuales", publicName: "derechosActuales", isSignal: false, isRequired: false, transformFunction: null }, mostrarBotonOrden: { classPropertyName: "mostrarBotonOrden", publicName: "mostrarBotonOrden", isSignal: true, isRequired: false, transformFunction: null }, busquedaTipo: { classPropertyName: "busquedaTipo", publicName: "ctrlBusqueda", isSignal: true, isRequired: false, transformFunction: null }, leyenda: { classPropertyName: "leyenda", publicName: "leyenda", isSignal: false, isRequired: false, transformFunction: null }, idTabla: { classPropertyName: "idTabla", publicName: "idTabla", isSignal: false, isRequired: true, transformFunction: null }, columnasTabla: { classPropertyName: "columnasTabla", publicName: "columnasTabla", isSignal: false, isRequired: false, transformFunction: null }, botonesMenu: { classPropertyName: "botonesMenu", publicName: "botonesMenu", isSignal: false, isRequired: false, transformFunction: null }, condicionesClaseFila: { classPropertyName: "condicionesClaseFila", publicName: "condicionesClaseFila", isSignal: false, isRequired: false, transformFunction: null }, rowTooltip: { classPropertyName: "rowTooltip", publicName: "rowTooltip", isSignal: false, isRequired: false, transformFunction: null }, soloIconos: { classPropertyName: "soloIconos", publicName: "soloIconos", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { dblclickItem: "dblclickItem", opcionSelecionada: "opcionSelecionada", opcBusqueda: "opcBusqueda", accionRecargar: "accionRecargar", selectionModelChange: "selectionModelChange", dataSourceChange: "dataSourceChange", resultados: "resultados" }, host: { properties: { "class.h-full": "alturaFull()", "id": "this.id" }, classAttribute: "jvs-tabla-mantenimiento" }, providers: [
1671
- { provide: MAT_PAGINATOR_DEFAULT_OPTIONS, useValue: { formFieldAppearance: 'outline' } }
1672
- ], queries: [{ propertyName: "columnDefs", predicate: MatColumnDef, descendants: true }], viewQueries: [{ propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true }, { propertyName: "sort", first: true, predicate: MatSort, descendants: true }, { propertyName: "table", first: true, predicate: MatTable, descendants: true }, { propertyName: "rowFooter", first: true, predicate: MatFooterRow, descendants: true, read: ElementRef }, { propertyName: "userMenu", first: true, predicate: ["userMenu"], descendants: true }, { propertyName: "compactSearchMenuTrigger", first: true, predicate: ["compactSearchMenuTrigger"], descendants: true, read: MatMenuTrigger }, { propertyName: "rows", predicate: MatRow, descendants: true, read: ElementRef }], usesOnChanges: true, ngImport: i0, template: "<div class=\"flex flex-col\" [ngClass]=\"alturaFull() ? 'h-full' : 'h-fit'\">\n <div class=\"flex-none flex items-center justify-between bg-white\">\n <ng-content select=\"[filtro]\"></ng-content>\n </div>\n\n <div class=\"flex flex-col border-t\" [ngClass]=\"alturaFull() ? 'grow' : ''\">\n <div class=\"flex-none bg-app-bar flex items-center justify-between p-1\">\n <!-- <div class=\"hidden flex-1 sm:flex items-center flex-wrap gap-1\">-->\n <!-- </div>-->\n @if (leyenda) {\n <div class=\"flex items-center flex-wrap mr-1 h-full\">\n <span class=\"font-bold\" [class]=\"leyenda.class\">{{ leyenda.text }}</span>\n </div>\n }\n <div class=\"hidden flex-1 sm:flex items-center flex-wrap gap-1\">\n @if ((botonesMenuFinal.izquierda ?? []).length > 0 ) {\n <div class=\" flex items-center flex-wrap contenedor-botones\">\n @for (btn of botonesMenu.izquierda; track btn; let idx = $index) {\n <ng-container *ngTemplateOutlet=\"botonesSuperiores; context:{btn: btn, idx: {inicio: idx, fin: botonesMenu.izquierda?.length}}\"></ng-container>\n }\n </div>\n }\n\n @if ((botonesMenuFinal.crud ?? []).length > 0) {\n <div class=\" flex items-center flex-wrap contenedor-botones\">\n @for (btn of botonesMenu.crud; track btn; let idx = $index) {\n <ng-container *ngTemplateOutlet=\"botonesSuperiores; context:{btn: btn, idx: {inicio: idx, fin: botonesMenu.crud?.length}}\"></ng-container>\n }\n </div>\n }\n\n @if ((botonesMenuFinal.principal ?? []).length > 0) {\n <div class=\" flex items-center flex-wrap contenedor-botones\">\n @for (btn of botonesMenu.principal; track btn; let idx = $index) {\n <ng-container *ngTemplateOutlet=\"botonesSuperiores; context:{btn: btn, idx: {inicio: idx, fin: botonesMenu.principal?.length}}\"></ng-container>\n }\n </div>\n }\n\n @if ((botonesMenuFinal.derecha ?? []).length > 0) {\n <div class=\"flex-auto flex items-center justify-end contenedor-botones\">\n @for (btn of botonesMenu.derecha; track btn; let idx = $index) {\n <ng-container *ngTemplateOutlet=\"botonesSuperiores; context:{btn: btn, idx: {inicio: idx, fin: botonesMenu.derecha?.length}}\"></ng-container>\n }\n </div>\n }\n <ng-content select=\"[objetosMenuPegado]\"></ng-content>\n </div>\n <div class=\"flex flex-1 sm:hidden items-center flex-wrap gap-1\">\n <button class=\"flex items-center justify-center text-2xs leading-none rounded-full p-1\"\n matRipple\n matTooltip=\"Botones de Acci\u00F3n\"\n type=\"button\"\n [matMenuTriggerFor]=\"menuOpciones\"\n >\n <mat-icon class=\"icon-xs\" svgIcon=\"roundMenu\"></mat-icon>\n </button>\n </div>\n <div class=\"flex-none flex items-center justify-end border-l-2\">\n <div class=\"flex-1 sm:flex-none flex items-center justify-end\">\n <ng-content select=\"[objetosMenu]\"></ng-content>\n </div>\n </div>\n @if (busquedaTipo() && !busquedaCompacta()) {\n <div class=\"hidden flex-initial sm:flex items-center form-input max-w-[150px] bg-card rounded-full border m-1 px-1 border-l-2\"\n >\n <mat-icon svgIcon=\"roundSearch\" class=\"icon-xs\"></mat-icon>\n <input [formControl]=\"cCampoBusqueda\"\n class=\"text-xs px-1 py-1 border-0 outline-none w-full bg-transparent max-w-sm\"\n [placeholder]=\"busquedaPlaceholder()\"\n (keyup.enter)=\"busquedaTipo() == 'query' ? cargarData() : false;\"\n type=\"search\">\n </div>\n }\n\n\n <mat-menu #compactSearchMenu=\"matMenu\" class=\"compact-search-menu\">\n <div class=\"flex items-center gap-1\" (click)=\"$event.stopPropagation()\">\n <mat-icon svgIcon=\"roundSearch\" class=\"icon-xs text-gray-400\"></mat-icon>\n <input [formControl]=\"cCampoBusqueda\"\n class=\"text-xs px-2 py-1 border border-gray-200 rounded outline-none w-[180px] bg-white\"\n [placeholder]=\"busquedaPlaceholder()\"\n (keyup.enter)=\"ejecutarBusquedaCompacta()\"\n type=\"search\"\n (click)=\"$event.stopPropagation()\">\n </div>\n </mat-menu>\n <div class=\"flex-none flex items-center justify-end border-l-2\">\n <ng-content select=\"[botonesFiltro]\"></ng-content>\n <ng-content select=\"[botonesConfig]\"></ng-content>\n\n @if (busquedaTipo() && busquedaCompacta()) {\n <button matRipple\n class=\"flex items-center justify-center text-2xs leading-none rounded-full p-1\"\n matTooltip=\"Buscar...\"\n [matMenuTriggerFor]=\"compactSearchMenu\"\n #compactSearchMenuTrigger=\"matMenuTrigger\"\n type=\"button\">\n <mat-icon svgIcon=\"roundSearch\" class=\"icon-xs\"></mat-icon>\n </button>\n }\n\n @if (isRecargarUsed || busquedaTipo() == 'query') {\n <button matRipple\n class=\"flex items-center justify-center text-2xs leading-none rounded-full p-1 text-green-700\"\n matTooltip=\"Actualizar datos\"\n (click)=\"(busquedaTipo() == 'query' ? cargarData() : emitirAccionRecargar())\"\n type=\"button\">\n <mat-icon svgIcon=\"roundRefresh\" class=\"icon-xs\"></mat-icon>\n </button>\n }\n @if (mostrarBotonOrden()) {\n <button matRipple\n class=\"flex items-center justify-center text-2xs leading-none rounded-full p-1 text-blue-700\"\n [matTooltip]=\"bDireccionOrden() === 0 ? 'Orden Ascendente' : 'Orden Descendente'\"\n (click)=\"toggleDireccionOrden()\"\n type=\"button\">\n <mat-icon [svgIcon]=\"bDireccionOrden() === 0 ? 'roundArrowUpward' : 'roundArrowDownward'\" class=\"icon-xs\"></mat-icon>\n </button>\n }\n @if (filtroCampos) {\n <button matRipple [matMenuTriggerFor]=\"columnFilterMenu\"\n class=\"flex items-center justify-center text-2xs leading-none rounded-full p-1\"\n matTooltip=\"Columnas Filtro\"\n type=\"button\">\n <mat-icon svgIcon=\"roundFilterList\" class=\"icon-xs\"></mat-icon>\n </button>\n }\n </div>\n </div>\n\n @if ((botonesMenuFinal.secundario ?? []).length > 0) {\n <div class=\"flex-1 bg-app-bar flex items-center justify-between p-1 border-t\">\n <div class=\"hidden flex-1 sm:flex items-center flex-wrap gap-1\">\n <div class=\" flex items-center flex-wrap contenedor-botones\">\n @for (btn of botonesMenu.secundario; track btn; let idx = $index) {\n <ng-container *ngTemplateOutlet=\"botonesSuperiores; context:{btn: btn, idx: {inicio: idx, fin: botonesMenu.secundario?.length}}\"></ng-container>\n }\n </div>\n </div>\n </div>\n }\n <!--<div class=\"grow flex flex-col items-stretch contenedor-tabla\" [ngClass]=\"{'table-container overflow-auto': esTabla}\">\n <pre>{{ this.chkLista.modelosChk | json }}</pre>\n <pre>{{ this.chkLista.checkbox.cantidadActivos | json }}</pre>\n <pre>{{ this.chkLista.checkbox.algunosActivos | json }}</pre>\n</div>-->\n<div class=\"grow flex flex-col items-stretch contenedor-tabla\" [ngClass]=\"{'table-container overflow-auto': esTabla}\">\n <ng-content select=\"[cuerpo]\"></ng-content>\n\n <table [id]=\"'tabla_' + nombreColeccion\" [dataSource]=\"dataSource\" [multiTemplateDataRows]=\"true\"\n [hidden]=\"!esTabla\"\n class=\"table-mantenimiento table-auto h-fit\" mat-table matSort\n [trackBy]=\"trackByFn\"\n #tablaMantenimiento\n >\n\n <!--<table [dataSource]=\"dataSource\" class=\"table-mantenimiento table-auto h-auto w-full justify-center\" mat-table matSort>-->\n\n\n <ng-content select=\"[tableDefinitions]\"></ng-content>\n <ng-container matColumnDef=\"numeracion_automatica\">\n <th mat-header-cell *matHeaderCellDef style=\"width: 16px !important\">N\u00BA</th>\n <td mat-cell *matCellDef=\"let element; let i = dataIndex\" class=\"p-0 celda-numeracion-fila\">\n <div class=\"flex items-center justify-center font-bold numeracionFila\">\n @if (esTabla && paginador) {\n {{ (this.paginator?.pageIndex == 0 ? i + 1 : 1 + i + (this.paginator?.pageIndex ?? 1) * (this.paginator?.pageSize ?? 1)) }}\n }\n @if (!paginador) {\n {{ (i + 1) }}\n }\n </div>\n </td>\n <td mat-footer-cell *matFooterCellDef class=\"uppercase\"></td>\n </ng-container>\n <jvs-tabla-mantenimiento-column-defs [objThis]=\"this\" [colDetalle]=\"columnasTabla\"\n [nombreColeccion]=\"nombreColeccion\" [(chkLista)]=\"chkLista\"></jvs-tabla-mantenimiento-column-defs>\n\n <tr *matHeaderRowDef=\"visibleColumns; sticky: true\" mat-header-row class=\"title\" matHeader\n ></tr>\n\n @if (!!filaExtraHeader) {\n <tr mat-row *matRowDef=\"let row; columns: ['filaExtraHeader']\" class=\"student-detail-row\"\n [style.height.px]=\"0\"\n ></tr>\n <ng-container matColumnDef=\"filaExtraHeader\">\n <td mat-cell *matCellDef=\"let row; let i = dataIndex\" [attr.colspan]=\"visibleColumns.length\">\n <div class=\"row m-0 student-element-detail\"\n [@detailExpand]=\"(i == 0 && filaExtraHeader.esVisible && filaExtraHeader.esVisible()) ? 'expanded' : 'collapsed'\"\n [style.padding-right.px]=\"row.isExpanded ? 5 : 0\"\n [style.padding-left.px]=\"row.isExpanded ? 5 : 0\"\n >\n @if (filaExtraHeader.template) {\n <ng-container\n [ngTemplateOutlet]=\"filaExtraHeader.template\"\n [ngTemplateOutletContext]=\"{ row: row }\"></ng-container>\n }\n </div>\n </td>\n </ng-container>\n }\n @if (filaFooter) {\n <tr *matFooterRowDef=\"visibleColumns\" mat-footer-row\n [style.height.px]=\"0\"\n [id]=\"nombreColeccion + '_filaFooter'\"\n ></tr>\n }\n\n <!--\t<tr\n *matRowDef=\"let row; columns: visibleColumns;\"\n class=\"hover:bg-secondary trans-ease-out cursor-pointer\"\n mat-row></tr>-->\n <tr\n [matRowKeyboardSelection]=\"tablaMantenimiento\"\n [rowModel]=\"row\"\n (seleccionarSiguiente)=\"opcMenu($event, {seccion: nombreColeccion, tipo: 'ver'});\"\n\n *matRowDef=\"let row; let idxTabla = dataIndex; columns: visibleColumns;\"\n (click)=\"seleccionarItem(row); opcMenu(row, {seccion: nombreColeccion, tipo: 'ver', tableDataIndex: idxTabla });\"\n (dblclick)=\"opcMenu(row, {seccion: nombreColeccion, tipo: 'seleccionar'}); dblclickItem.emit(row)\"\n (contextmenu)=\"(abrirMenuContextual($event, row)); $event. preventDefault();\"\n [ngClass]=\"classFila(row)\"\n @fadeInUp\n class=\"trans-ease-out cursor-pointer h-auto\"\n [style.height.px]=\"0\"\n [id]=\"propiedadSeleccion(row)\"\n [matTooltip]=\"procesarRowTooltip(row)\"\n matTooltipPosition=\"below\"\n [matTooltipPositionAtOrigin]=\"true\"\n [matTooltipClass]=\"['bg-red-700', 'text-red-100', 'm-0']\"\n [matTooltipDisabled]=\"!procesarRowTooltip(row)\"\n [class.regAnulado]=\"row[campoAnulado] == 1\"\n [class.regTooltip]=\"!!procesarRowTooltip(row)\"\n (keyup.delete)=\"opcMenu(row, {seccion: nombreColeccion, tipo: 'eliminar'})\"\n mat-row></tr>\n @if (filaExtraTemplate) {\n <tr mat-row *matRowDef=\"let row; columns: ['expandedDetail']\" class=\"student-detail-row h-0\"></tr>\n <ng-container matColumnDef=\"expandedDetail\">\n <td mat-cell *matCellDef=\"let row\" [attr.colspan]=\"visibleColumns.length\">\n <div class=\"row m-0 student-element-detail\"\n [@detailExpand]=\"row.isExpanded ? 'expanded' : 'collapsed'\"\n [style.padding-right.px]=\"row.isExpanded ? 5 : 0\"\n [style.padding-left.px]=\"row.isExpanded ? 5 : 0\"\n >\n <ng-container [ngTemplateOutlet]=\"filaExtraTemplate\"\n [ngTemplateOutletContext]=\"{ row: row }\"></ng-container>\n </div>\n </td>\n </ng-container>\n }\n</table>\n\n@if (componenteCargadoTotalmente) {\n @if ((noData | async) && esTabla) {\n <div class=\"flex-1 text-center text-secondary font-medium\">\n No se encontraron datos\n </div>\n }\n}\n</div>\n<ng-content select=\"[appendTable]\"></ng-content>\n<div class=\"flex-none bg-app-bar flex flex-col sm:flex-row items-start justify-between p-1\">\n <div class=\"flex-1 flex items-start flex-wrap gap-1\">\n\n @if ((botonesMenuFinal.inferior ?? []).length > 0) {\n <div class=\"flex items-center contenedor-botones\">\n @for (btn of botonesMenu.inferior; track btn; let idx = $index) {\n <ng-container *ngTemplateOutlet=\"botonesSuperiores; context:{btn: btn, idx: {inicio: idx, fin: botonesMenu.inferior?.length}}\"></ng-container>\n }\n </div>\n }\n <!--<div *ngIf=\"(botonesMenuFinal.inferior ?? []).length > 0\" class=\" flex items-center flex-wrap\">\n <ng-container *ngFor=\"let btn of botonesMenu.inferior; let idx = index;\">\n <ng-container *ngTemplateOutlet=\"botonesSuperiores; context:{btn: btn, idx: {inicio: idx, fin: botonesMenu.inferior?.length}}\"></ng-container>\n </ng-container>\n </div>-->\n</div>\n\n@if (esTabla && paginador) {\n <div class=\"flex-1 sm:flex-none flex items-center justify-end\">\n <mat-paginator class=\"tabla-mantenimiento-paginador\" [pageSizeOptions]=\"paginacion.pageSizeOptions\" [pageIndex]=\"paginacion.pageIndex - 1\" [length]=\"paginacion.pageLength\" [pageSize]=\"paginacion.pageSize\" (page)=\"paginacion.pageCurrent = $event; emitirResultados();\" ></mat-paginator>\n </div>\n}\n</div>\n</div>\n\n</div>\n\n\n\n<!-- SECCION DE TEMPLATES O MENUS -->\n\n\n<mat-menu #columnFilterMenu=\"matMenu\" xPosition=\"before\" yPosition=\"below\">\n @for (column of columnasTabla; track column) {\n @if (!tipoValorFuncion(column.noMostrarEnLista, false)) {\n <button (click)=\"toggleColumnVisibility(column, $event)\"\n class=\"checkbox-item mat-menu-item\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" [(ngModel)]=\"column.visible\" [ngModelOptions]=\"{standalone: true}\" color=\"primary\">\n <span [innerHTML]=\"(column.labelLista ?? column.label).replace('<br>', ' ')\"></span>\n </mat-checkbox>\n </button>\n }\n }\n</mat-menu>\n\n\n\n\n\n\n<ng-template #botonesSuperiores let-btn=\"btn\" let-idx=\"idx\">\n <ng-container *ngTemplateOutlet=\"botonesContextual; context:{btn: btn, item: objSeleccionado, barraSuperior: true, idx: idx}\"></ng-container>\n</ng-template>\n\n<ng-template #botonesContextual let-btn=\"btn\" let-item=\"item\" let-barraSuperior=\"barraSuperior\" let-idx=\"idx\">\n\n @if (barraSuperior) {\n <!--\t\t<button mat-button style=\"min-width: unset; border: 1px !important;\" class=\"uppercase border border-gray rounded-none h-full px-1 disabled:opacity-50 disabled:text-secondary disabled:bg-transparent\">-->\n <!--\t\t\t<mat-icon *ngIf=\"btn.icono\" [svgIcon]=\"btn.icono\" size=\"15px\" class=\"icon-xs\"></mat-icon>-->\n <!--\t\t</button>-->\n @if (btn.subItems && btn.subItems.length > 0) {\n @if ((!btn.esVisible || btn.esVisible(item, this)) && subItemsActivos(btn, item)) {\n <button class=\"flex items-center justify-between uppercase text-2xs leading-none rounded-none px-2 py-1 bg-opacity-95 hover:bg-opacity-100 disabled:opacity-50 disabled:text-secondary disabled:!bg-gray-300 dark:disabled:!bg-gray-500 mat-elevation-z2\" type=\"button\"\n [class]=\"(btn.class?btn.class:'')\"\n (click)=\"opcMenu(item, btn)\"\n [style.min-width]=\"((btn.soloIcono ?? tipoValorFuncion(soloIconos)) ? 'unset' : '')\"\n [matTooltip]=\"btn.tooltip || (btn.label ? btn.label : ( (derechosActuales && derechosActuales[btn.cDerechoCodigo ?? btn.tipo]) ? derechosActuales[btn.cDerechoCodigo ?? btn.tipo]['cDerechoNombre'] : capitalizarTexto(btn.tipo))) \"\n [matMenuTriggerFor]=\"menuOtrosBarra.menu\"\n [matBadge]=\"btn.badge\"\n matBadgeSize=\"small\"\n >\n @if (btn.icono) {\n <mat-icon class=\"icon-xs\" [class.mr-0.5]=\"!(btn.soloIcono ?? tipoValorFuncion(soloIconos))\" [svgIcon]=\"btn.icono\" ></mat-icon>\n }\n @if (!(btn.soloIcono ?? tipoValorFuncion(soloIconos))) {\n <span class=\"whitespace-nowrap\">{{ btn.label ? btn.label : ( (derechosActuales && derechosActuales[btn.cDerechoCodigo ?? btn.tipo]) ? derechosActuales[btn.cDerechoCodigo ?? btn.tipo]['cDerechoNombre'] : capitalizarTexto(btn.tipo)) }}</span>\n }\n <mat-icon class=\"icon-xs\" svgIcon=\"fa5sCaretDown\" ></mat-icon>\n </button>\n }\n <jvs-tabla-mantenimiento-menu #menuOtrosBarra\n [objThis]=\"objThis\"\n [nombreColeccion]=\"nombreColeccion\"\n [item]=\"item\"\n [derechosActuales]=\"derechosActuales\"\n [subItems]=\"btn.subItems\"\n (opcionSelecionada)=\"opcMenu($event.item, $event.btn)\"\n [botonTemplate]=\"botonesContextual\"\n >\n </jvs-tabla-mantenimiento-menu>\n }\n @if (!btn.subItems || btn.subItems.length == 0) {\n @if (!btn.esVisible || btn.esVisible(item, this)) {\n <button class=\"flex items-center justify-between uppercase text-2xs leading-none rounded-none px-2 py-1 bg-opacity-95 hover:bg-opacity-100 disabled:opacity-50 disabled:text-secondary disabled:!bg-gray-300 dark:disabled:!bg-gray-500 mat-elevation-z2\" type=\"button\"\n [class]=\"(btn.class?btn.class:'text-secondary')\"\n [ngClass]=\"{'text-secondary italic': !ignorarDerechos && !btn.esIndependiente && (!btn.ignorarDerecho && (!derechosActuales || !derechosActuales[btn.cDerechoCodigo ?? btn.tipo])) && !(['nuevo', 'editar', 'eliminar'].includes(btn.tipo))}\"\n [disabled]=\"!btn.esIndependiente && botonDisabled(btn, item)\"\n (click)=\"opcMenu(item, btn)\"\n [style.min-width]=\"((btn.soloIcono ?? tipoValorFuncion(soloIconos)) ? 'unset' : '')\"\n [matTooltip]=\"btn.tooltip || (btn.label ? btn.label : ( (derechosActuales && derechosActuales[btn.cDerechoCodigo ?? btn.tipo]) ? derechosActuales[btn.cDerechoCodigo ?? btn.tipo]['cDerechoNombre'] : capitalizarTexto(btn.tipo))) \"\n [matBadge]=\"btn.badge\"\n matBadgeSize=\"small\"\n >\n @if (btn.icono) {\n <mat-icon class=\"icon-xs\" [class.mr-0.5]=\"!(btn.soloIcono ?? tipoValorFuncion(soloIconos))\" [svgIcon]=\"btn.icono\"></mat-icon>\n }\n @if (!(btn.soloIcono ?? tipoValorFuncion(soloIconos))) {\n <span class=\"whitespace-nowrap\">{{ btn.label ? btn.label : ( (derechosActuales && derechosActuales[btn.cDerechoCodigo ?? btn.tipo]) ? derechosActuales[btn.cDerechoCodigo ?? btn.tipo]['cDerechoNombre'] : capitalizarTexto(btn.tipo)) }}</span>\n }\n </button>\n }\n }\n} @else {\n @if (btn.subItems && btn.subItems.length > 0) {\n @if (!btn.noContextual && (!btn.esVisible || btn.esVisible(item, this))) {\n <button class=\"flex items-center justify-between uppercase w-full rounded-none px-2 disabled:opacity-50 disabled:text-secondary disabled:bg-transparent\" mat-menu-item type=\"button\"\n [class]=\"(btn.class?btn.class.replace('text-white', '').replace('bg', 'text'):'text-secondary')\"\n [ngClass]=\"{'text-secondary italic': !ignorarDerechos && !btn.esIndependiente && (!btn.ignorarDerecho && (!derechosActuales || !derechosActuales[btn.cDerechoCodigo ?? btn.tipo]))}\"\n [disabled]=\"!btn.esIndependiente && botonDisabled(btn, item)\"\n (click)=\"opcMenu(item, btn); $event.stopPropagation();\"\n [matMenuTriggerFor]=\"menuOtrosBarra.menu\"\n >\n <div class=\"flex w-full items-center justify-between uppercase text-2xs\"\n >\n @if (btn.icono) {\n <mat-icon [svgIcon]=\"btn.icono\"\n class=\"flex-none icon-xs\"\n ></mat-icon>\n }\n <span class=\"grow text-2xs\">{{ btn.label ? btn.label : ( (derechosActuales && derechosActuales[btn.cDerechoCodigo ?? btn.tipo]) ? derechosActuales[btn.cDerechoCodigo ?? btn.tipo]['cDerechoNombre'] : capitalizarTexto(btn.tipo)) }}</span>\n <mat-icon class=\"flex-none icon-xs\" svgIcon=\"fa5sCaretRight\"></mat-icon>\n </div>\n </button>\n }\n <jvs-tabla-mantenimiento-menu #menuOtrosBarra\n [objThis]=\"objThis\"\n [nombreColeccion]=\"nombreColeccion\"\n [item]=\"item\"\n [derechosActuales]=\"derechosActuales\"\n [subItems]=\"btn.subItems\"\n (opcionSelecionada)=\"opcMenu($event.item, $event.btn)\"\n [botonTemplate]=\"botonesContextual\"\n >\n </jvs-tabla-mantenimiento-menu>\n }\n @if (!btn.subItems || btn.subItems.length == 0) {\n @if (btn.tipo == '-#SEPARADOR#-') {\n <mat-divider></mat-divider>\n } @else {\n @if (!btn.noContextual && (!btn.esVisible || btn.esVisible(item, this))) {\n <button class=\"flex items-center justify-between uppercase w-full rounded-none px-2 disabled:opacity-50 disabled:text-secondary disabled:bg-transparent\" mat-menu-item type=\"button\"\n [class]=\"(btn.class?btn.class.replace('text-white', '').replace('bg', 'text'):'text-secondary')\"\n [ngClass]=\"{'text-secondary italic': !ignorarDerechos && !btn.esIndependiente && (!btn.ignorarDerecho && (!derechosActuales || !derechosActuales[btn.cDerechoCodigo ?? btn.tipo]))}\"\n [disabled]=\"!btn.esIndependiente && botonDisabled(btn, item)\"\n (click)=\"opcMenu(item, btn)\"\n >\n <div class=\"flex w-full items-center justify-between uppercase text-2xs\">\n @if (btn.icono) {\n <mat-icon [svgIcon]=\"btn.icono\" class=\"flex-none icon-xs\"\n ></mat-icon>\n }\n <span class=\"grow text-2xs\">{{ btn.label ? btn.label : ( (derechosActuales && derechosActuales[btn.cDerechoCodigo ?? btn.tipo]) ? derechosActuales[btn.cDerechoCodigo ?? btn.tipo]['cDerechoNombre'] : capitalizarTexto(btn.tipo)) }}</span>\n </div>\n </button>\n }\n }\n }\n}\n\n</ng-template>\n\n<ng-template #userMenu let-item=\"item\">\n <div class=\"mat-menu bg-white rounded mat-elevation-z8 shadow botonesContextual\">\n @for (btn of listaMenuCompleto; track btn) {\n <ng-container *ngTemplateOutlet=\"botonesContextual; context:{btn: btn, item: objSeleccionado, barraSuperior: false}\"></ng-container>\n }\n </div>\n</ng-template>\n\n\n<mat-menu #menuOpciones=\"matMenu\" xPosition=\"before\" yPosition=\"below\">\n @for (btn of listaMenuCompleto; track btn) {\n <ng-container\n *ngTemplateOutlet=\"botonesContextual; context:{btn: btn, item: objSeleccionado, barraSuperior: false}\"></ng-container>\n }\n</mat-menu>\n\n", styles: ["@charset \"UTF-8\";:root{--tabla-mantenimiento-seleccion-fondo: rgb(179, 217, 252);--tabla-mantenimiento-seleccion-texto: rgb(1, 84, 164);--mat-paginator-container-size: 30px}:root .table-mantenimiento .elemento-seleccionado{background-color:var(--tabla-mantenimiento-seleccion-fondo)!important;color:var(--tabla-mantenimiento-seleccion-texto)!important;border-color:var(--tabla-mantenimiento-seleccion-texto)!important}.jvs-tabla-mantenimiento{width:inherit;display:flex;flex-direction:column}.jvs-tabla-mantenimiento .contenedor-botones>*:first-child{@apply rounded-l;}.jvs-tabla-mantenimiento .contenedor-botones>*:last-child{@apply rounded-r;}.jvs-tabla-mantenimiento tr.regTooltip>td:first-child div:first-child:before,.jvs-tabla-mantenimiento tr.regTooltip>th:first-child div:first-child:before{content:\"\\26a0\\fe0f \";color:red;margin-right:4px;font-size:12px}.jvs-tabla-mantenimiento tr.regTooltip>td:first-child:not(:has(div)):before,.jvs-tabla-mantenimiento tr.regTooltip>th:first-child:not(:has(div)):before{content:\"\\26a0\\fe0f \";color:red;margin-right:4px;font-size:12px}.jvs-tabla-mantenimiento .mat-mdc-menu-content:not(:empty){@apply flex flex-col items-start;padding:0!important}.jvs-tabla-mantenimiento .mat-mdc-menu-item{line-height:24px!important;height:24px!important;min-height:24px!important}.jvs-tabla-mantenimiento .mat-mdc-menu-panel{min-height:auto!important}.jvs-tabla-mantenimiento .mat-mdc-table .mat-mdc-cell,.jvs-tabla-mantenimiento .mat-mdc-table .mat-mdc-header-cell .mat-mdc-footer-cell{white-space:unset}.jvs-tabla-mantenimiento .table-mantenimiento .mat-mdc-table-sticky-border-elem-right{border-left:1px solid #e0e0e0}.jvs-tabla-mantenimiento .table-mantenimiento .mat-mdc-table-sticky-border-elem-left{border-right:1px solid #e0e0e0}.jvs-tabla-mantenimiento .table-mantenimiento tr.regAnulado .mat-mdc-cell{color:unset!important}.jvs-tabla-mantenimiento .table-mantenimiento .bg-primary-activo .numeracionFila{@apply rounded-full bg-primary-contrast text-primary mx-1 p-1 w-6 h-6;}.jvs-tabla-mantenimiento .table-mantenimiento th .form-input{@apply w-auto;}.jvs-tabla-mantenimiento .table-mantenimiento th.mat-mdc-header-cell:not(.celda-numeracion-fila),.jvs-tabla-mantenimiento .table-mantenimiento td.mat-mdc-cell:not(.celda-numeracion-fila),.jvs-tabla-mantenimiento .table-mantenimiento td.mat-mdc-footer-cell:not(.celda-numeracion-fila){padding:.05rem .25rem}.jvs-tabla-mantenimiento .table-mantenimiento th.mat-mdc-header-cell,.jvs-tabla-mantenimiento .table-mantenimiento td.mat-mdc-cell,.jvs-tabla-mantenimiento .table-mantenimiento td.mat-mdc-footer-cell{border-width:1px;border-style:solid}.jvs-tabla-mantenimiento .table-mantenimiento th.mat-mdc-header-cell:first-of-type:not(.celda-numeracion-fila),.jvs-tabla-mantenimiento .table-mantenimiento th.mat-mdc-header-cell:last-of-type:not(.celda-numeracion-fila),.jvs-tabla-mantenimiento .table-mantenimiento td.mat-mdc-cell:first-of-type:not(.celda-numeracion-fila),.jvs-tabla-mantenimiento .table-mantenimiento td.mat-mdc-cell:last-of-type:not(.celda-numeracion-fila),.jvs-tabla-mantenimiento .table-mantenimiento td.mat-mdc-footer-cell:first-of-type:not(.celda-numeracion-fila),.jvs-tabla-mantenimiento .table-mantenimiento td.mat-mdc-footer-cell:last-of-type:not(.celda-numeracion-fila){padding:0 .25rem}.jvs-tabla-mantenimiento .table-mantenimiento .student-element-detail{overflow:hidden;display:flex;align-items:center;justify-content:center}.jvs-tabla-mantenimiento .table-mantenimiento .mat-mdc-header-row{height:25px!important;color:rgb(var(--color-primary))!important;background-color:rgb(var(--color-primary-contrast))!important}.jvs-tabla-mantenimiento .table-mantenimiento .mat-mdc-header-cell{padding:5px;font-size:10px;line-height:10px;font-weight:700!important;color:inherit}.jvs-tabla-mantenimiento .table-mantenimiento .mdc-data-table__row:not(.mdc-data-table__row--selected):not(.elemento-seleccionado):hover,.jvs-tabla-mantenimiento .table-mantenimiento .mdc-data-table__row:not(.mdc-data-table__row--selected):not(.elemento-seleccionado):focus{background-color:rgba(var(--color-primary-contrast),.04)}.jvs-tabla-mantenimiento .table-mantenimiento .mat-mdc-row .mat-mdc-cell,.jvs-tabla-mantenimiento .table-mantenimiento .mat-mdc-footer-row .mat-mdc-cell{font-size:10px}.jvs-tabla-mantenimiento .table-mantenimiento .mat-mdc-row .mat-mdc-footer-cell:empty,.jvs-tabla-mantenimiento .table-mantenimiento .mat-mdc-footer-row .mat-mdc-footer-cell:empty{border-width:0!important}.jvs-tabla-mantenimiento .table-mantenimiento .mat-mdc-cell{@apply leading-tight;}.jvs-tabla-mantenimiento .table-mantenimiento th.mat-mdc-header-cell{border-color:#d4d0d0;@apply text-center uppercase;}.jvs-tabla-mantenimiento .table-mantenimiento th.mat-mdc-header-cell .mat-sort-header-container{@apply flex items-center justify-between w-full;}.jvs-tabla-mantenimiento .table-mantenimiento th.mat-mdc-header-cell .mat-sort-header-container .mat-sort-header-content{@apply inline w-full text-center;}.jvs-tabla-mantenimiento .table-mantenimiento th.mat-mdc-header-cell .mat-sort-header-container .mat-sort-header-arrow{@apply flex-none;}.jvs-tabla-mantenimiento .table-mantenimiento .mat-mdc-sort-header-content{width:100%;text-align:center;display:unset;align-items:center}.compact-search-menu{min-width:200px!important;overflow:hidden}.compact-search-menu input:focus{@apply border-primary;}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i3$1.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatDividerModule }, { kind: "component", type: i6.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i8.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i8.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i8.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "ngmodule", type: MatPaginatorModule }, { kind: "component", type: i9.MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }, { kind: "ngmodule", type: MatRippleModule }, { kind: "directive", type: i5$1.MatRipple, selector: "[mat-ripple], [matRipple]", inputs: ["matRippleColor", "matRippleUnbounded", "matRippleCentered", "matRippleRadius", "matRippleAnimation", "matRippleDisabled", "matRippleTrigger"], exportAs: ["matRipple"] }, { kind: "ngmodule", type: MatSortModule }, { kind: "directive", type: i3.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i2.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i2.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i2.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i2.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i2.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i2.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i2.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i2.MatFooterRowDef, selector: "[matFooterRowDef]", inputs: ["matFooterRowDef", "matFooterRowDefSticky"] }, { kind: "directive", type: i2.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i2.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: i2.MatFooterCell, selector: "mat-footer-cell, td[mat-footer-cell]" }, { kind: "component", type: i2.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i2.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i2.MatFooterRow, selector: "mat-footer-row, tr[mat-footer-row]", exportAs: ["matFooterRow"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: TablaMantenimientoColumnDefsComponent, selector: "jvs-tabla-mantenimiento-column-defs", inputs: ["objThis", "nombreColeccion", "colDetalle", "chkLista"], outputs: ["chkListaChange"] }, { kind: "ngmodule", type: MatBadgeModule }, { kind: "directive", type: i14.MatBadge, selector: "[matBadge]", inputs: ["matBadgeColor", "matBadgeOverlap", "matBadgeDisabled", "matBadgePosition", "matBadge", "matBadgeDescription", "matBadgeSize", "matBadgeHidden"] }, { kind: "component", type: TablaMantenimientoMenuComponent, selector: "jvs-tabla-mantenimiento-menu", inputs: ["objThis", "nombreColeccion", "item", "derechosActuales", "subItems", "botonTemplate"], outputs: ["opcionSelecionada"] }, { kind: "directive", type: MatRowKeyboardSelectionDirective, selector: "[matRowKeyboardSelection]", inputs: ["matRowKeyboardSelection", "rowModel"], outputs: ["seleccionarSiguiente"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }], animations: [
3854
+ clasesCabecerasConContenido = CLASES_CABECERAS_CON_CONTENIDO;
3855
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: TablaMantenimientoComponent, deps: [{ token: i1$3.Overlay }, { token: i0.ViewContainerRef }, { token: TablaMantenimientoService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
3856
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.18", type: TablaMantenimientoComponent, isStandalone: true, selector: "jvs-tabla-mantenimiento", inputs: { dataSuscription: { classPropertyName: "dataSuscription", publicName: "dataSuscription", isSignal: false, isRequired: false, transformFunction: null }, objThis: { classPropertyName: "objThis", publicName: "objThis", isSignal: false, isRequired: false, transformFunction: null }, nombreColeccion: { classPropertyName: "nombreColeccion", publicName: "nombreColeccion", isSignal: false, isRequired: true, transformFunction: null }, busquedaValor: { classPropertyName: "busquedaValor", publicName: "ctrlBusquedaValue", isSignal: true, isRequired: false, transformFunction: null }, busquedaPlaceholder: { classPropertyName: "busquedaPlaceholder", publicName: "ctrlBusquedaPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, filtroCampos: { classPropertyName: "filtroCampos", publicName: "filtroCampos", isSignal: false, isRequired: false, transformFunction: null }, paginador: { classPropertyName: "paginador", publicName: "paginador", isSignal: false, isRequired: false, transformFunction: null }, esTabla: { classPropertyName: "esTabla", publicName: "esTabla", isSignal: false, isRequired: false, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: false, isRequired: false, transformFunction: null }, filaExtraHeader: { classPropertyName: "filaExtraHeader", publicName: "filaExtraHeader", isSignal: false, isRequired: false, transformFunction: null }, filaFooter: { classPropertyName: "filaFooter", publicName: "filaFooter", isSignal: false, isRequired: false, transformFunction: null }, botonesCRUD: { classPropertyName: "botonesCRUD", publicName: "botonesCRUD", isSignal: false, isRequired: false, transformFunction: null }, objBotonesCRUD: { classPropertyName: "objBotonesCRUD", publicName: "objBotonesCRUD", isSignal: false, isRequired: false, transformFunction: null }, classSeleccionado: { classPropertyName: "classSeleccionado", publicName: "classSeleccionado", isSignal: false, isRequired: false, transformFunction: null }, classAnulado: { classPropertyName: "classAnulado", publicName: "classAnulado", isSignal: false, isRequired: false, transformFunction: null }, campoAnulado: { classPropertyName: "campoAnulado", publicName: "campoAnulado", isSignal: false, isRequired: false, transformFunction: null }, campoAnuladoMensaje: { classPropertyName: "campoAnuladoMensaje", publicName: "campoAnuladoMensaje", isSignal: false, isRequired: false, transformFunction: null }, selectionModel: { classPropertyName: "selectionModel", publicName: "selectionModel", isSignal: false, isRequired: false, transformFunction: null }, seguirSeleccion: { classPropertyName: "seguirSeleccion", publicName: "seguirSeleccion", isSignal: true, isRequired: false, transformFunction: null }, filaExtraTemplate: { classPropertyName: "filaExtraTemplate", publicName: "filaExtraTemplate", isSignal: false, isRequired: false, transformFunction: null }, exportarExcel: { classPropertyName: "exportarExcel", publicName: "exportarExcel", isSignal: false, isRequired: false, transformFunction: null }, busquedaCompacta: { classPropertyName: "busquedaCompacta", publicName: "busquedaCompacta", isSignal: true, isRequired: false, transformFunction: null }, columnasSiNoCaben: { classPropertyName: "columnasSiNoCaben", publicName: "columnasSiNoCaben", isSignal: true, isRequired: false, transformFunction: null }, busquedaAncho: { classPropertyName: "busquedaAncho", publicName: "ctrlBusquedaAncho", isSignal: true, isRequired: false, transformFunction: null }, nombreExcel: { classPropertyName: "nombreExcel", publicName: "nombreExcel", isSignal: true, isRequired: false, transformFunction: null }, animarFilas: { classPropertyName: "animarFilas", publicName: "animarFilas", isSignal: true, isRequired: false, transformFunction: null }, cargando: { classPropertyName: "cargando", publicName: "cargando", isSignal: true, isRequired: false, transformFunction: null }, exportacionArriba: { classPropertyName: "exportacionArriba", publicName: "exportacionArriba", isSignal: true, isRequired: false, transformFunction: null }, alinearCabecerasConContenido: { classPropertyName: "alinearCabecerasConContenido", publicName: "alinearCabecerasConContenido", isSignal: true, isRequired: false, transformFunction: null }, coloresTema: { classPropertyName: "coloresTema", publicName: "coloresTema", isSignal: true, isRequired: false, transformFunction: null }, alturaFull: { classPropertyName: "alturaFull", publicName: "alturaFull", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: false, isRequired: false, transformFunction: null }, pageSizeOptions: { classPropertyName: "pageSizeOptions", publicName: "pageSizeOptions", isSignal: false, isRequired: false, transformFunction: null }, arbol: { classPropertyName: "arbol", publicName: "arbol", isSignal: true, isRequired: false, transformFunction: null }, busquedaCampos: { classPropertyName: "busquedaCampos", publicName: "ctrlBusquedaCampos", isSignal: true, isRequired: false, transformFunction: null }, derechosActuales: { classPropertyName: "derechosActuales", publicName: "derechosActuales", isSignal: false, isRequired: false, transformFunction: null }, mostrarBotonOrden: { classPropertyName: "mostrarBotonOrden", publicName: "mostrarBotonOrden", isSignal: true, isRequired: false, transformFunction: null }, busquedaTipo: { classPropertyName: "busquedaTipo", publicName: "ctrlBusqueda", isSignal: true, isRequired: false, transformFunction: null }, leyenda: { classPropertyName: "leyenda", publicName: "leyenda", isSignal: false, isRequired: false, transformFunction: null }, idTabla: { classPropertyName: "idTabla", publicName: "idTabla", isSignal: false, isRequired: true, transformFunction: null }, columnasTabla: { classPropertyName: "columnasTabla", publicName: "columnasTabla", isSignal: false, isRequired: false, transformFunction: null }, botonesMenu: { classPropertyName: "botonesMenu", publicName: "botonesMenu", isSignal: false, isRequired: false, transformFunction: null }, condicionesClaseFila: { classPropertyName: "condicionesClaseFila", publicName: "condicionesClaseFila", isSignal: false, isRequired: false, transformFunction: null }, rowTooltip: { classPropertyName: "rowTooltip", publicName: "rowTooltip", isSignal: false, isRequired: false, transformFunction: null }, soloIconos: { classPropertyName: "soloIconos", publicName: "soloIconos", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { dblclickItem: "dblclickItem", opcionSelecionada: "opcionSelecionada", opcBusqueda: "opcBusqueda", accionRecargar: "accionRecargar", selectionModelChange: "selectionModelChange", dataSourceChange: "dataSourceChange", resultados: "resultados" }, host: { properties: { "class.h-full": "alturaFull()", "class.jvs-colores-tema": "usaColoresTema()", "class.jvs-banda-angosta": "tramoBanda() === 'angosta'", "class.jvs-banda-media": "tramoBanda() === 'media'", "id": "this.id" }, classAttribute: "jvs-tabla-mantenimiento" }, providers: [
3857
+ { provide: MAT_PAGINATOR_DEFAULT_OPTIONS, useValue: { formFieldAppearance: 'outline' } },
3858
+ { provide: CONFIG_CABECERAS_TABLA, useFactory: crearConfigCabeceras },
3859
+ // `providers` (no `viewProviders`): las columnas `custom` del consumidor también lo ven.
3860
+ { provide: CONTROL_ARBOL_TABLA, useExisting: forwardRef(() => TablaMantenimientoComponent) },
3861
+ // El `MatSort` de la tabla está en su propia vista; un `mat-sort-header` en una columna
3862
+ // `custom` (declarada en la plantilla del consumidor) no lo alcanza por el árbol de
3863
+ // inyección y fallaba con "Cannot read properties of null (reading 'register')". Se le
3864
+ // entrega el mismo de la tabla.
3865
+ { provide: MatSort, useFactory: () => inject(TablaMantenimientoComponent).sort },
3866
+ ], queries: [{ propertyName: "columnDefs", predicate: MatColumnDef, descendants: true }], viewQueries: [{ propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true }, { propertyName: "sort", first: true, predicate: MatSort, descendants: true, static: true }, { propertyName: "bandaTabla", first: true, predicate: ["bandaTabla"], descendants: true, static: true }, { propertyName: "contenedorTabla", first: true, predicate: ["contenedorTabla"], descendants: true, static: true }, { propertyName: "inputBusquedaCompacta", first: true, predicate: ["inputBusquedaCompacta"], descendants: true }, { propertyName: "table", first: true, predicate: MatTable, descendants: true }, { propertyName: "userMenu", first: true, predicate: ["userMenu"], descendants: true }, { propertyName: "compactSearchMenuTrigger", first: true, predicate: ["compactSearchMenuTrigger"], descendants: true, read: MatMenuTrigger }, { propertyName: "rows", predicate: MatRow, descendants: true, read: ElementRef }], usesOnChanges: true, ngImport: i0, template: "<div class=\"flex flex-col\" [ngClass]=\"alturaFull() ? 'h-full' : 'h-fit'\">\n <div class=\"flex-none flex items-center justify-between bg-white\">\n <ng-content select=\"[filtro]\"></ng-content>\n </div>\n\n <div class=\"flex flex-col border-t\" [ngClass]=\"alturaFull() ? 'grow' : ''\">\n <div #bandaTabla class=\"flex-none bg-app-bar flex items-center justify-between p-1\">\n <!-- <div class=\"hidden flex-1 sm:flex items-center flex-wrap gap-1\">-->\n <!-- </div>-->\n @if (leyenda) {\n <div class=\"flex items-center flex-wrap mr-1 h-full\">\n <span class=\"font-bold\" [class]=\"leyenda.class\">{{ leyenda.text }}</span>\n </div>\n }\n <div class=\"flex flex-1 items-center flex-wrap gap-1 min-w-0\">\n <!-- Con la banda angosta (la tabla, no la ventana) los grupos pasan al men\u00FA \u2261; lo pegado sigue a la vista. -->\n @if (tramoBanda() === 'angosta') {\n <button class=\"flex items-center justify-center text-2xs leading-none rounded-full p-1\"\n matRipple\n matTooltip=\"Botones de Acci\u00F3n\"\n type=\"button\"\n [matMenuTriggerFor]=\"menuOpciones\"\n >\n <mat-icon class=\"icon-xs\" svgIcon=\"roundMenu\"></mat-icon>\n </button>\n } @else {\n <div class=\"contents\">\n @if ((botonesMenuFinal.izquierda ?? []).length > 0 ) {\n <div class=\" flex items-center flex-wrap contenedor-botones\">\n @for (seg of segmentosBotones(botonesMenuFinal.izquierda); track $index) {\n @if (seg.grupo) {\n <ng-container *ngTemplateOutlet=\"grupoSegmentado; context:{botones: seg.botones, soloIcono: false, margen: seg.margen}\"></ng-container>\n } @else {\n <ng-container *ngTemplateOutlet=\"botonesSuperiores; context:{btn: seg.botones[0], margen: seg.margen, idx: {inicio: $index, fin: botonesMenuFinal.izquierda?.length}}\"></ng-container>\n }\n }\n </div>\n }\n\n @if ((botonesMenuFinal.crud ?? []).length > 0) {\n <div class=\" flex items-center flex-wrap contenedor-botones\">\n @for (seg of segmentosBotones(botonesMenuFinal.crud); track $index) {\n @if (seg.grupo) {\n <ng-container *ngTemplateOutlet=\"grupoSegmentado; context:{botones: seg.botones, soloIcono: false, margen: seg.margen}\"></ng-container>\n } @else {\n <ng-container *ngTemplateOutlet=\"botonesSuperiores; context:{btn: seg.botones[0], margen: seg.margen, idx: {inicio: $index, fin: botonesMenuFinal.crud?.length}}\"></ng-container>\n }\n }\n </div>\n }\n\n @if ((botonesMenuFinal.principal ?? []).length > 0) {\n <div class=\" flex items-center flex-wrap contenedor-botones\">\n @for (seg of segmentosBotones(botonesMenuFinal.principal); track $index) {\n @if (seg.grupo) {\n <ng-container *ngTemplateOutlet=\"grupoSegmentado; context:{botones: seg.botones, soloIcono: false, margen: seg.margen}\"></ng-container>\n } @else {\n <ng-container *ngTemplateOutlet=\"botonesSuperiores; context:{btn: seg.botones[0], margen: seg.margen, idx: {inicio: $index, fin: botonesMenuFinal.principal?.length}}\"></ng-container>\n }\n }\n </div>\n }\n\n @if ((botonesMenuFinal.derecha ?? []).length > 0) {\n <div class=\"flex-auto flex items-center justify-end contenedor-botones\">\n @for (seg of segmentosBotones(botonesMenuFinal.derecha); track $index) {\n @if (seg.grupo) {\n <ng-container *ngTemplateOutlet=\"grupoSegmentado; context:{botones: seg.botones, soloIcono: false, margen: seg.margen}\"></ng-container>\n } @else {\n <ng-container *ngTemplateOutlet=\"botonesSuperiores; context:{btn: seg.botones[0], margen: seg.margen, idx: {inicio: $index, fin: botonesMenuFinal.derecha?.length}}\"></ng-container>\n }\n }\n </div>\n }\n </div>\n }\n <ng-content select=\"[objetosMenuPegado]\"></ng-content>\n </div>\n <div class=\"flex-none flex items-center justify-end border-l-2\">\n <div class=\"flex items-center justify-end\" [ngClass]=\"tramoBanda() === 'angosta' ? 'flex-1' : 'flex-none'\">\n <ng-content select=\"[objetosMenu]\"></ng-content>\n </div>\n </div>\n @if (busquedaTipo() && !busquedaEsCompacta()) {\n <div class=\"flex flex-initial items-center form-input bg-card rounded-full border m-1 px-1 border-l-2\"\n [style.max-width]=\"busquedaAncho()\"\n >\n <mat-icon svgIcon=\"roundSearch\" class=\"icon-xs\"></mat-icon>\n <input [formControl]=\"cCampoBusqueda\"\n class=\"text-xs px-1 py-1 border-0 outline-none w-full bg-transparent max-w-sm\"\n [placeholder]=\"busquedaPlaceholder()\"\n (keyup.enter)=\"busquedaTipo() == 'query' ? cargarData() : false;\"\n type=\"search\">\n </div>\n }\n\n\n <mat-menu #compactSearchMenu=\"matMenu\" class=\"compact-search-menu\">\n <div class=\"flex items-center gap-1\" (click)=\"$event.stopPropagation()\">\n <mat-icon svgIcon=\"roundSearch\" class=\"icon-xs text-gray-400\"></mat-icon>\n <input #inputBusquedaCompacta [formControl]=\"cCampoBusqueda\"\n class=\"text-xs px-2 py-1 border border-gray-200 rounded outline-none w-[180px] bg-white\"\n [placeholder]=\"busquedaPlaceholder()\"\n (keyup.enter)=\"ejecutarBusquedaCompacta()\"\n type=\"search\"\n (click)=\"$event.stopPropagation()\">\n </div>\n </mat-menu>\n <div class=\"flex-none flex items-center justify-end border-l-2\">\n <ng-content select=\"[botonesFiltro]\"></ng-content>\n <ng-content select=\"[botonesConfig]\"></ng-content>\n\n @if (busquedaTipo() && busquedaEsCompacta()) {\n <!-- Con texto buscado, el icono lleva un punto: hay un filtro aplicado aunque no se vea. -->\n <button matRipple\n class=\"relative flex items-center justify-center text-2xs leading-none rounded-full p-1\"\n [matTooltip]=\"cCampoBusqueda.value ? 'Buscando: ' + cCampoBusqueda.value : busquedaPlaceholder()\"\n [attr.aria-label]=\"busquedaPlaceholder()\"\n [matMenuTriggerFor]=\"compactSearchMenu\"\n (menuOpened)=\"enfocarBusquedaCompacta()\"\n #compactSearchMenuTrigger=\"matMenuTrigger\"\n type=\"button\">\n <mat-icon svgIcon=\"roundSearch\" class=\"icon-xs\"></mat-icon>\n @if (cCampoBusqueda.value) {\n <span class=\"absolute top-0 right-0 size-1.5 rounded-full bg-primary\" aria-hidden=\"true\"></span>\n }\n </button>\n }\n\n <!-- Herramientas (exportaciones): solo \u00EDcono, junto a Recargar. Con m\u00E1s de tres, un men\u00FA. -->\n @if (botonesHerramientasVisibles.length > 3) {\n <button matRipple\n class=\"flex items-center justify-center text-2xs leading-none rounded-full p-1\"\n matTooltip=\"Exportar\"\n aria-label=\"Exportar\"\n [matMenuTriggerFor]=\"menuHerramientas\"\n type=\"button\">\n <mat-icon svgIcon=\"jvs_tabla:exportar\" class=\"icon-xs\"></mat-icon>\n <span class=\"text-[9px] leading-none ml-px\" aria-hidden=\"true\">\u25BE</span>\n </button>\n <mat-menu #menuHerramientas=\"matMenu\" xPosition=\"before\" yPosition=\"below\">\n @for (btn of botonesHerramientasVisibles; track btn) {\n <ng-container *ngTemplateOutlet=\"botonesContextual; context:{btn: btn, item: objSeleccionado, barraSuperior: false}\"></ng-container>\n }\n </mat-menu>\n } @else {\n @for (seg of segmentosBotones(botonesHerramientasVisibles); track $index) {\n @if (seg.grupo) {\n <ng-container *ngTemplateOutlet=\"grupoSegmentado; context:{botones: seg.botones, soloIcono: true, margen: seg.margen}\"></ng-container>\n } @else {\n @let btn = seg.botones[0];\n @if (btn.subItems && btn.subItems.length > 0) {\n <button matRipple\n class=\"flex items-center justify-center text-2xs leading-none rounded-full p-1 jvs-boton-herramienta\"\n [class]=\"claseHerramienta(btn)\"\n [matTooltip]=\"tooltipBoton(btn)\"\n [attr.aria-label]=\"tooltipBoton(btn)\"\n [matMenuTriggerFor]=\"menuHerramienta.menu\"\n type=\"button\">\n <mat-icon [svgIcon]=\"iconoHerramienta(btn)\" class=\"icon-xs\"></mat-icon>\n </button>\n <jvs-tabla-mantenimiento-menu #menuHerramienta\n [nombreColeccion]=\"nombreColeccion\"\n [item]=\"objSeleccionado\"\n [derechosActuales]=\"derechosActuales\"\n [subItems]=\"btn.subItems\"\n (opcionSelecionada)=\"opcMenu($event.item, $event.btn)\"\n [botonTemplate]=\"botonesContextual\"\n >\n </jvs-tabla-mantenimiento-menu>\n } @else {\n <span class=\"jvs-boton-envoltura inline-flex [&>button:disabled]:pointer-events-none\"\n [ngClass]=\"seg.margen\"\n [matTooltip]=\"motivoDeshabilitado(btn, objSeleccionado) || tooltipBoton(btn)\"\n [matTooltipDisabled]=\"!estaBotonDeshabilitado(btn, objSeleccionado)\">\n <button matRipple\n class=\"flex items-center justify-center text-2xs leading-none rounded-full p-1 jvs-boton-herramienta disabled:opacity-50\"\n [class]=\"claseHerramienta(btn)\"\n [disabled]=\"estaBotonDeshabilitado(btn, objSeleccionado)\"\n [matTooltip]=\"tooltipBoton(btn)\"\n [matTooltipDisabled]=\"estaBotonDeshabilitado(btn, objSeleccionado)\"\n [attr.aria-label]=\"tooltipBoton(btn)\"\n (click)=\"opcMenu(objSeleccionado, $any(btn))\"\n type=\"button\">\n <mat-icon [svgIcon]=\"iconoHerramienta(btn)\" class=\"icon-xs\"></mat-icon>\n </button>\n </span>\n }\n }\n }\n }\n\n @if (isRecargarUsed || busquedaTipo() == 'query') {\n <button matRipple\n class=\"flex items-center justify-center text-2xs leading-none rounded-full p-1 text-green-700\"\n matTooltip=\"Actualizar datos\"\n (click)=\"(busquedaTipo() == 'query' ? cargarData() : emitirAccionRecargar())\"\n type=\"button\">\n <mat-icon svgIcon=\"roundRefresh\" class=\"icon-xs\"></mat-icon>\n </button>\n }\n @if (mostrarBotonOrden()) {\n <button matRipple\n class=\"flex items-center justify-center text-2xs leading-none rounded-full p-1 text-blue-700\"\n [matTooltip]=\"bDireccionOrden() === 0 ? 'Orden Ascendente' : 'Orden Descendente'\"\n (click)=\"toggleDireccionOrden()\"\n type=\"button\">\n <mat-icon [svgIcon]=\"bDireccionOrden() === 0 ? 'roundArrowUpward' : 'roundArrowDownward'\" class=\"icon-xs\"></mat-icon>\n </button>\n }\n @if (filtroCampos) {\n <!-- Con columnas ocultas por falta de espacio, \"+N\" y el tooltip dice cu\u00E1les. -->\n <button matRipple [matMenuTriggerFor]=\"columnFilterMenu\"\n class=\"flex items-center justify-center text-2xs leading-none rounded-full p-1\"\n [matTooltip]=\"tooltipColumnas()\"\n type=\"button\">\n <mat-icon svgIcon=\"roundFilterList\" class=\"icon-xs\"></mat-icon>\n @if (columnasOcultasPorEspacio().size > 0) {\n <span class=\"ml-px font-bold text-primary\">+{{ columnasOcultasPorEspacio().size }}</span>\n }\n </button>\n }\n </div>\n </div>\n\n @if ((botonesMenuFinal.secundario ?? []).length > 0) {\n <div class=\"flex-1 bg-app-bar flex items-center justify-between p-1 border-t\">\n <div class=\"flex flex-1 items-center flex-wrap gap-1 min-w-0\">\n <div class=\" flex items-center flex-wrap contenedor-botones\">\n @for (seg of segmentosBotones(botonesMenuFinal.secundario); track $index) {\n @if (seg.grupo) {\n <ng-container *ngTemplateOutlet=\"grupoSegmentado; context:{botones: seg.botones, soloIcono: false, margen: seg.margen}\"></ng-container>\n } @else {\n <ng-container *ngTemplateOutlet=\"botonesSuperiores; context:{btn: seg.botones[0], margen: seg.margen, idx: {inicio: $index, fin: botonesMenuFinal.secundario?.length}}\"></ng-container>\n }\n }\n </div>\n </div>\n </div>\n }\n <!--<div class=\"grow flex flex-col items-stretch contenedor-tabla\" [ngClass]=\"{'table-container overflow-auto': esTabla}\">\n <pre>{{ this.chkLista.modelosChk | json }}</pre>\n <pre>{{ this.chkLista.checkbox.cantidadActivos | json }}</pre>\n <pre>{{ this.chkLista.checkbox.algunosActivos | json }}</pre>\n</div>-->\n<!-- Barra de carga entre la banda y la cabecera. Solo si la pantalla usa `cargando`: el hueco\n de 4 px queda reservado para que la tabla no salte al aparecer y desaparecer. -->\n@if (cargando() !== undefined) {\n <div class=\"jvs-tabla-cargando h-1 shrink-0\" role=\"status\" [attr.aria-busy]=\"cargando()\">\n @if (cargando()) {\n <mat-progress-bar mode=\"indeterminate\" aria-label=\"Cargando datos\"></mat-progress-bar>\n }\n </div>\n}\n<div #contenedorTabla class=\"grow flex flex-col items-stretch contenedor-tabla\" [ngClass]=\"{'table-container overflow-auto': esTabla}\">\n <ng-content select=\"[cuerpo]\"></ng-content>\n\n <table [id]=\"'tabla_' + nombreColeccion\" [dataSource]=\"dataSource\" [multiTemplateDataRows]=\"true\"\n [hidden]=\"!esTabla\"\n class=\"table-mantenimiento table-auto h-fit\" mat-table matSort\n [ngClass]=\"alinearCabecerasConContenido() ? clasesCabecerasConContenido : ''\"\n [trackBy]=\"trackByFn\"\n #tablaMantenimiento\n >\n\n <!--<table [dataSource]=\"dataSource\" class=\"table-mantenimiento table-auto h-auto w-full justify-center\" mat-table matSort>-->\n\n\n <ng-content select=\"[tableDefinitions]\"></ng-content>\n <ng-container matColumnDef=\"numeracion_automatica\">\n <th mat-header-cell *matHeaderCellDef style=\"width: 16px !important\">N\u00BA</th>\n <td mat-cell *matCellDef=\"let element; let i = dataIndex\" class=\"p-0 celda-numeracion-fila\">\n <div class=\"flex items-center justify-center numeracionFila font-normal text-[var(--tabla-mantenimiento-numeracion-texto)] [.elemento-seleccionado_&]:text-inherit [.elemento-anulado_&]:text-inherit\">\n @if (esTabla && paginador) {\n {{ (this.paginator?.pageIndex == 0 ? i + 1 : 1 + i + (this.paginator?.pageIndex ?? 1) * (this.paginator?.pageSize ?? 1)) }}\n }\n @if (!paginador) {\n {{ (i + 1) }}\n }\n </div>\n </td>\n <td mat-footer-cell *matFooterCellDef class=\"uppercase\"></td>\n </ng-container>\n <jvs-tabla-mantenimiento-column-defs [colDetalle]=\"columnasParaDefinir\" [estaExpandida]=\"estaExpandidaFn\" (alternarExpansion)=\"alternarExpansion($event)\"\n [nombreColeccion]=\"nombreColeccion\" [(chkLista)]=\"chkLista\"></jvs-tabla-mantenimiento-column-defs>\n\n <tr *matHeaderRowDef=\"visibleColumns; sticky: true\" mat-header-row class=\"title\" matHeader\n ></tr>\n\n @if (!!filaExtraHeader) {\n <tr mat-row *matRowDef=\"let row; columns: ['filaExtraHeader']\" class=\"student-detail-row\"\n [style.height.px]=\"0\"\n ></tr>\n <ng-container matColumnDef=\"filaExtraHeader\">\n <td mat-cell *matCellDef=\"let row; let i = dataIndex\" [attr.colspan]=\"visibleColumns.length\">\n <div class=\"row m-0 student-element-detail\"\n [@detailExpand]=\"(i == 0 && filaExtraHeader.esVisible && filaExtraHeader.esVisible()) ? 'expanded' : 'collapsed'\"\n [style.padding-right.px]=\"estaExpandida(row) ? 5 : 0\"\n [style.padding-left.px]=\"estaExpandida(row) ? 5 : 0\"\n >\n @if (filaExtraHeader.template) {\n <ng-container\n [ngTemplateOutlet]=\"filaExtraHeader.template\"\n [ngTemplateOutletContext]=\"{ row: row }\"></ng-container>\n }\n </div>\n </td>\n </ng-container>\n }\n @if (filaFooter) {\n <tr *matFooterRowDef=\"visibleColumns\" mat-footer-row\n [style.height.px]=\"0\"\n [id]=\"nombreColeccion + '_filaFooter'\"\n ></tr>\n }\n\n <!--\t<tr\n *matRowDef=\"let row; columns: visibleColumns;\"\n class=\"hover:bg-secondary trans-ease-out cursor-pointer\"\n mat-row></tr>-->\n <tr\n [matRowKeyboardSelection]=\"tablaMantenimiento\"\n [rowModel]=\"row\"\n (seleccionarSiguiente)=\"opcMenu($event, {seccion: nombreColeccion, tipo: 'ver'});\"\n (filaEnfocada)=\"seleccionarFilaPorId($event)\"\n (espacioEnFila)=\"teclaEspacioEnFila($event)\"\n\n *matRowDef=\"let row; let idxTabla = dataIndex; columns: visibleColumns;\"\n (click)=\"clicFila(row, idxTabla, $event)\"\n (dblclick)=\"dobleClicFila(row)\"\n (contextmenu)=\"(abrirMenuContextual($event, row)); $event. preventDefault();\"\n [ngClass]=\"classFila(row)\"\n @fadeInUp\n [@.disabled]=\"!animarFilas()\"\n class=\"trans-ease-out cursor-pointer h-auto\"\n [style.height.px]=\"0\"\n [id]=\"propiedadSeleccion(row)\"\n [matTooltip]=\"procesarRowTooltip(row)\"\n matTooltipPosition=\"below\"\n [matTooltipPositionAtOrigin]=\"true\"\n [matTooltipClass]=\"['bg-red-700', 'text-red-100', 'm-0']\"\n [matTooltipDisabled]=\"!procesarRowTooltip(row)\"\n [class.regAnulado]=\"row[campoAnulado] == 1\"\n [class.regTooltip]=\"!!procesarRowTooltip(row)\"\n (keyup.delete)=\"teclaEliminarEnFila(row, $event)\"\n mat-row></tr>\n @if (filaExtraTemplate) {\n <tr mat-row *matRowDef=\"let row; columns: ['expandedDetail']\" class=\"student-detail-row h-0\"></tr>\n <ng-container matColumnDef=\"expandedDetail\">\n <td mat-cell *matCellDef=\"let row\" [attr.colspan]=\"visibleColumns.length\">\n <div class=\"row m-0 student-element-detail\"\n [@detailExpand]=\"estaExpandida(row) ? 'expanded' : 'collapsed'\"\n [style.padding-right.px]=\"estaExpandida(row) ? 5 : 0\"\n [style.padding-left.px]=\"estaExpandida(row) ? 5 : 0\"\n >\n <ng-container [ngTemplateOutlet]=\"filaExtraTemplate\"\n [ngTemplateOutletContext]=\"{ row: row }\"></ng-container>\n </div>\n </td>\n </ng-container>\n }\n</table>\n\n@if (componenteCargadoTotalmente && !cargando()) {\n @if ((noData | async) && esTabla) {\n <div class=\"jvs-tabla-sin-datos flex-1 text-center text-secondary font-medium\" role=\"status\">\n @if (textoBuscado) {\n Ning\u00FAn registro coincide con \"{{ textoBuscado }}\".\n <button type=\"button\" class=\"ml-1 underline text-primary\" (click)=\"limpiarBusqueda()\">Limpiar b\u00FAsqueda</button>\n } @else {\n No se encontraron datos\n }\n </div>\n }\n}\n</div>\n<ng-content select=\"[appendTable]\"></ng-content>\n<div class=\"flex-none bg-app-bar flex items-start justify-between p-1\" [ngClass]=\"tramoBanda() === 'angosta' ? 'flex-col' : 'flex-row'\">\n <div class=\"flex-1 flex items-start flex-wrap gap-1\">\n\n @if (botonesInferior.length > 0) {\n <div class=\"flex items-center contenedor-botones\">\n @for (seg of segmentosBotones(botonesInferior); track $index) {\n @if (seg.grupo) {\n <ng-container *ngTemplateOutlet=\"grupoSegmentado; context:{botones: seg.botones, soloIcono: false, margen: seg.margen}\"></ng-container>\n } @else {\n <ng-container *ngTemplateOutlet=\"botonesSuperiores; context:{btn: seg.botones[0], margen: seg.margen, idx: {inicio: $index, fin: botonesInferior.length}}\"></ng-container>\n }\n }\n </div>\n }\n <!--<div *ngIf=\"(botonesMenuFinal.inferior ?? []).length > 0\" class=\" flex items-center flex-wrap\">\n <ng-container *ngFor=\"let btn of botonesMenuFinal.inferior; let idx = index;\">\n <ng-container *ngTemplateOutlet=\"botonesSuperiores; context:{btn: btn, idx: {inicio: idx, fin: botonesMenuFinal.inferior?.length}}\"></ng-container>\n </ng-container>\n </div>-->\n</div>\n\n@if (esTabla && paginador) {\n <div class=\"flex items-center justify-end\" [ngClass]=\"tramoBanda() === 'angosta' ? 'flex-1' : 'flex-none'\">\n <mat-paginator class=\"tabla-mantenimiento-paginador\" [pageSizeOptions]=\"paginacion.pageSizeOptions\" [pageIndex]=\"paginacion.pageIndex - 1\" [length]=\"paginacion.pageLength\" [pageSize]=\"paginacion.pageSize\" (page)=\"paginacion.pageCurrent = $event; emitirResultados();\" ></mat-paginator>\n </div>\n}\n</div>\n</div>\n\n</div>\n\n\n\n<!-- SECCION DE TEMPLATES O MENUS -->\n\n\n<!-- Men\u00FA de columnas: una por l\u00EDnea (antes las casillas iban en l\u00EDnea y se amontonaban). -->\n<mat-menu #columnFilterMenu=\"matMenu\" xPosition=\"before\" yPosition=\"below\"\n class=\"[&_.mat-mdc-menu-content]:flex [&_.mat-mdc-menu-content]:flex-col [&_.mat-mdc-menu-content]:items-stretch [&_.mat-mdc-menu-content]:!py-1\">\n @for (column of columnasTabla; track column) {\n @if (esColumnaEnLista(column)) {\n <button (click)=\"toggleColumnVisibility(column, $event)\" type=\"button\"\n class=\"checkbox-item mat-menu-item flex items-center w-full min-h-[24px] pl-1 pr-3 border-0 bg-transparent text-left cursor-pointer hover:bg-black/[.04] [&_.mat-mdc-checkbox]:w-full [&_.mdc-label]:!text-[12px] [&_.mdc-label]:whitespace-nowrap\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" [ngModel]=\"esColumnaVisible(column)\" (ngModelChange)=\"elegirVisibilidadColumna(column, $event)\" [ngModelOptions]=\"{standalone: true}\" color=\"primary\">\n <span [innerHTML]=\"(column.labelLista ?? column.label).replace('<br>', ' ')\"></span>\n @if (ocultaPorEspacio(column)) {\n <span class=\"ml-1 text-gray-500\">(sin espacio)</span>\n }\n </mat-checkbox>\n </button>\n }\n }\n</mat-menu>\n\n\n\n\n\n\n<!-- Control segmentado: botones consecutivos con el mismo `grupo`. Un borde com\u00FAn, divisores\n finos, el `activo` relleno y el badge como texto dentro del bot\u00F3n. Cada opci\u00F3n conserva su\n tooltip, deshabilitado, derechos y evento, igual que un bot\u00F3n suelto. -->\n<ng-template #grupoSegmentado let-botones=\"botones\" let-soloIcono=\"soloIcono\" let-margen=\"margen\">\n <!-- Colores del acento de la tabla (est\u00E1ndar o tema, seg\u00FAn `coloresTema`): activo relleno, el resto en tono claro. Borde com\u00FAn con\n sombra interior (no suma alto); `!rounded-[4px]` vence al redondeo de un solo lado que la\n barra pone al primer y \u00FAltimo elemento de cada `contenedor-botones`. -->\n <div class=\"jvs-segmentado inline-flex items-stretch flex-none max-w-full overflow-x-auto overflow-y-hidden !rounded-[4px] shadow-[inset_0_0_0_1px_rgba(var(--tabla-mantenimiento-acento),0.4)] bg-[rgba(var(--tabla-mantenimiento-acento),0.1)] [scrollbar-width:thin]\"\n [ngClass]=\"margen\" role=\"group\">\n @for (btn of botones; track btn; let primero = $first) {\n <span class=\"inline-flex [&>button:disabled]:pointer-events-none\"\n [matTooltip]=\"motivoDeshabilitado(btn, objSeleccionado) || tooltipBoton(btn)\"\n [matTooltipDisabled]=\"!estaBotonDeshabilitado(btn, objSeleccionado)\">\n <button type=\"button\" matRipple\n class=\"jvs-segmento flex items-center uppercase text-2xs leading-none px-2 py-1 border-0 border-solid border-[rgba(var(--tabla-mantenimiento-acento),0.4)] rounded-none bg-transparent text-[rgb(var(--tabla-mantenimiento-acento))] cursor-pointer whitespace-nowrap enabled:hover:bg-[rgba(var(--tabla-mantenimiento-acento),0.2)] disabled:opacity-50 disabled:cursor-default\"\n [class.border-l]=\"!primero\"\n [ngClass]=\"{'!bg-[rgb(var(--tabla-mantenimiento-acento))] !text-[rgb(var(--tabla-mantenimiento-acento-contraste))]': esBotonActivo(btn, objSeleccionado) === true}\"\n [attr.aria-pressed]=\"esBotonActivo(btn, objSeleccionado)\"\n [disabled]=\"estaBotonDeshabilitado(btn, objSeleccionado)\"\n [matTooltip]=\"tooltipBoton(btn)\"\n [matTooltipDisabled]=\"estaBotonDeshabilitado(btn, objSeleccionado)\"\n [attr.aria-label]=\"soloIcono ? tooltipBoton(btn) : null\"\n (click)=\"opcMenu(objSeleccionado, $any(btn))\">\n @if (btn.icono || soloIcono) {\n <mat-icon class=\"icon-xs\" [class.mr-0.5]=\"!soloIcono\" [svgIcon]=\"soloIcono ? iconoHerramienta(btn) : btn.icono\"></mat-icon>\n }\n @if (!soloIcono) {\n <span class=\"whitespace-nowrap\">{{ etiquetaBoton(btn) }}</span>\n @if (btn.badge !== undefined && btn.badge !== null && btn.badge !== '') {\n <span class=\"jvs-segmento-badge ml-1 text-[9px] font-normal opacity-70\"\n [class.opacity-90]=\"esBotonActivo(btn, objSeleccionado) === true\">{{ btn.badge }}</span>\n }\n }\n </button>\n </span>\n }\n </div>\n</ng-template>\n\n<ng-template #botonesSuperiores let-btn=\"btn\" let-idx=\"idx\" let-margen=\"margen\">\n <ng-container *ngTemplateOutlet=\"botonesContextual; context:{btn: btn, item: objSeleccionado, barraSuperior: true, idx: idx, margen: margen}\"></ng-container>\n</ng-template>\n\n<ng-template #botonesContextual let-btn=\"btn\" let-item=\"item\" let-barraSuperior=\"barraSuperior\" let-idx=\"idx\" let-margen=\"margen\">\n\n @if (barraSuperior) {\n <!--\t\t<button mat-button style=\"min-width: unset; border: 1px !important;\" class=\"uppercase border border-gray rounded-none h-full px-1 disabled:opacity-50 disabled:text-secondary disabled:bg-transparent\">-->\n <!--\t\t\t<mat-icon *ngIf=\"btn.icono\" [svgIcon]=\"btn.icono\" size=\"15px\" class=\"icon-xs\"></mat-icon>-->\n <!--\t\t</button>-->\n @if (btn.subItems && btn.subItems.length > 0) {\n @if ((!btn.esVisible || btn.esVisible(item, this)) && subItemsActivos(btn, item)) {\n <button class=\"flex items-center justify-between uppercase text-2xs leading-none rounded-none px-2 py-1 bg-opacity-95 hover:bg-opacity-100 disabled:opacity-50 disabled:text-secondary disabled:!bg-gray-300 dark:disabled:!bg-gray-500 mat-elevation-z2\" type=\"button\"\n [class]=\"(btn.class?btn.class:'')\"\n [ngClass]=\"margen ?? ''\"\n (click)=\"opcMenu(item, btn)\"\n [style.min-width]=\"((btn.soloIcono ?? tipoValorFuncion(soloIconos)) ? 'unset' : '')\"\n [matTooltip]=\"btn.tooltip || (btn.label ? btn.label : ( (derechosActuales && derechosActuales[btn.cDerechoCodigo ?? btn.tipo]) ? derechosActuales[btn.cDerechoCodigo ?? btn.tipo]['cDerechoNombre'] : capitalizarTexto(btn.tipo))) \"\n [matMenuTriggerFor]=\"menuOtrosBarra.menu\"\n [matBadge]=\"btn.badge\"\n [matBadgeDescription]=\"descripcionContador(btn)\"\n matBadgeSize=\"small\"\n >\n @if (btn.icono) {\n <mat-icon class=\"icon-xs\" [class.mr-0.5]=\"!(btn.soloIcono ?? tipoValorFuncion(soloIconos))\" [svgIcon]=\"btn.icono\" ></mat-icon>\n }\n @if (!(btn.soloIcono ?? tipoValorFuncion(soloIconos))) {\n <span class=\"whitespace-nowrap\">{{ btn.label ? btn.label : ( (derechosActuales && derechosActuales[btn.cDerechoCodigo ?? btn.tipo]) ? derechosActuales[btn.cDerechoCodigo ?? btn.tipo]['cDerechoNombre'] : capitalizarTexto(btn.tipo)) }}</span>\n }\n <mat-icon class=\"icon-xs\" svgIcon=\"fa5sCaretDown\" ></mat-icon>\n </button>\n }\n <jvs-tabla-mantenimiento-menu #menuOtrosBarra\n [nombreColeccion]=\"nombreColeccion\"\n [item]=\"item\"\n [derechosActuales]=\"derechosActuales\"\n [subItems]=\"btn.subItems\"\n (opcionSelecionada)=\"opcMenu($event.item, $event.btn)\"\n [botonTemplate]=\"botonesContextual\"\n >\n </jvs-tabla-mantenimiento-menu>\n }\n @if (!btn.subItems || btn.subItems.length == 0) {\n @if (!btn.esVisible || btn.esVisible(item, this)) {\n <!-- La envoltura muestra el motivo cuando el bot\u00F3n est\u00E1 deshabilitado: un bot\u00F3n\n deshabilitado no recibe el cursor y su propio tooltip nunca aparece. -->\n <span class=\"jvs-boton-envoltura inline-flex [&>button:disabled]:pointer-events-none [&:first-child>button]:rounded-l [&:last-child>button]:rounded-r\"\n [ngClass]=\"margen ?? ''\"\n [matTooltip]=\"motivoDeshabilitado(btn, item) || tooltipBoton(btn)\"\n [matTooltipDisabled]=\"!estaBotonDeshabilitado(btn, item)\"\n >\n <button class=\"flex items-center justify-between uppercase text-2xs leading-none rounded-none px-2 py-1 bg-opacity-95 hover:bg-opacity-100 disabled:opacity-50 disabled:text-secondary disabled:!bg-gray-300 dark:disabled:!bg-gray-500 mat-elevation-z2\" type=\"button\"\n [class]=\"claseBotonBarra(btn, item)\"\n [ngClass]=\"{'text-secondary italic': !ignorarDerechos && !btn.esIndependiente && (!btn.ignorarDerecho && (!derechosActuales || !derechosActuales[btn.cDerechoCodigo ?? btn.tipo])) && !(['nuevo', 'editar', 'eliminar'].includes(btn.tipo))}\"\n [attr.aria-pressed]=\"esBotonActivo(btn, item)\"\n [disabled]=\"estaBotonDeshabilitado(btn, item)\"\n (click)=\"opcMenu(item, btn)\"\n [style.min-width]=\"((btn.soloIcono ?? tipoValorFuncion(soloIconos)) ? 'unset' : '')\"\n [matTooltip]=\"tooltipBoton(btn)\"\n [matTooltipDisabled]=\"estaBotonDeshabilitado(btn, item)\"\n [matBadge]=\"btn.badge\"\n [matBadgeDescription]=\"descripcionContador(btn)\"\n matBadgeSize=\"small\"\n >\n @if (btn.icono) {\n <mat-icon class=\"icon-xs\" [class.mr-0.5]=\"!(btn.soloIcono ?? tipoValorFuncion(soloIconos))\" [svgIcon]=\"btn.icono\"></mat-icon>\n }\n @if (!(btn.soloIcono ?? tipoValorFuncion(soloIconos))) {\n <span class=\"whitespace-nowrap\">{{ etiquetaBoton(btn) }}</span>\n }\n </button>\n </span>\n }\n }\n} @else {\n @if (btn.subItems && btn.subItems.length > 0) {\n @if (!btn.noContextual && (!btn.esVisible || btn.esVisible(item, this))) {\n <button class=\"flex items-center justify-between uppercase w-full rounded-none px-2 disabled:opacity-50 disabled:text-secondary disabled:bg-transparent\" mat-menu-item type=\"button\"\n [class]=\"(btn.class?btn.class.replace('text-white', '').replace('bg', 'text'):'text-secondary')\"\n [ngClass]=\"{'text-secondary italic': !ignorarDerechos && !btn.esIndependiente && (!btn.ignorarDerecho && (!derechosActuales || !derechosActuales[btn.cDerechoCodigo ?? btn.tipo]))}\"\n [disabled]=\"!btn.esIndependiente && botonDisabled(btn, item)\"\n (click)=\"opcMenu(item, btn); $event.stopPropagation();\"\n [matMenuTriggerFor]=\"menuOtrosBarra.menu\"\n >\n <div class=\"flex w-full items-center justify-between uppercase text-2xs\"\n >\n @if (btn.icono) {\n <mat-icon [svgIcon]=\"btn.icono\"\n class=\"flex-none icon-xs\"\n ></mat-icon>\n }\n <span class=\"grow text-2xs\">{{ btn.label ? btn.label : ( (derechosActuales && derechosActuales[btn.cDerechoCodigo ?? btn.tipo]) ? derechosActuales[btn.cDerechoCodigo ?? btn.tipo]['cDerechoNombre'] : capitalizarTexto(btn.tipo)) }}</span>\n <mat-icon class=\"flex-none icon-xs\" svgIcon=\"fa5sCaretRight\"></mat-icon>\n </div>\n </button>\n }\n <jvs-tabla-mantenimiento-menu #menuOtrosBarra\n [nombreColeccion]=\"nombreColeccion\"\n [item]=\"item\"\n [derechosActuales]=\"derechosActuales\"\n [subItems]=\"btn.subItems\"\n (opcionSelecionada)=\"opcMenu($event.item, $event.btn)\"\n [botonTemplate]=\"botonesContextual\"\n >\n </jvs-tabla-mantenimiento-menu>\n }\n @if (!btn.subItems || btn.subItems.length == 0) {\n @if (btn.tipo == '-#SEPARADOR#-') {\n <mat-divider></mat-divider>\n } @else {\n @if (!btn.noContextual && (!btn.esVisible || btn.esVisible(item, this))) {\n <span class=\"block w-full self-stretch [&>button:disabled]:pointer-events-none\"\n [matTooltip]=\"motivoDeshabilitado(btn, item)\"\n matTooltipPosition=\"left\"\n [matTooltipDisabled]=\"!motivoDeshabilitado(btn, item)\"\n >\n <button class=\"flex items-center justify-between uppercase w-full rounded-none px-2 disabled:opacity-50 disabled:text-secondary disabled:bg-transparent\" mat-menu-item type=\"button\"\n [class]=\"claseItemMenu(btn, item)\"\n [ngClass]=\"{'text-secondary italic': !ignorarDerechos && !btn.esIndependiente && (!btn.ignorarDerecho && (!derechosActuales || !derechosActuales[btn.cDerechoCodigo ?? btn.tipo]))}\"\n [attr.aria-pressed]=\"esBotonActivo(btn, item)\"\n [disabled]=\"estaBotonDeshabilitado(btn, item)\"\n (click)=\"opcMenu(item, btn)\"\n >\n <div class=\"flex w-full items-center justify-between uppercase text-2xs\">\n @if (btn.icono) {\n <mat-icon [svgIcon]=\"btn.icono\" class=\"flex-none icon-xs\"\n ></mat-icon>\n }\n <span class=\"grow text-2xs\">{{ etiquetaBoton(btn) }}</span>\n </div>\n </button>\n </span>\n }\n }\n }\n}\n\n</ng-template>\n\n<ng-template #userMenu let-item=\"item\">\n <div class=\"mat-menu bg-white rounded mat-elevation-z8 shadow botonesContextual\">\n @for (btn of listaMenuCompleto; track btn) {\n <ng-container *ngTemplateOutlet=\"botonesContextual; context:{btn: btn, item: objSeleccionado, barraSuperior: false}\"></ng-container>\n }\n </div>\n</ng-template>\n\n\n<mat-menu #menuOpciones=\"matMenu\" xPosition=\"before\" yPosition=\"below\">\n @for (btn of listaMenuMovil; track btn) {\n <ng-container\n *ngTemplateOutlet=\"botonesContextual; context:{btn: btn, item: objSeleccionado, barraSuperior: false}\"></ng-container>\n }\n</mat-menu>\n\n", styles: ["@charset \"UTF-8\";:root{--tabla-mantenimiento-seleccion-fondo: rgb(179, 217, 252);--tabla-mantenimiento-seleccion-texto: rgb(1, 84, 164);--tabla-mantenimiento-acento: 1, 84, 164;--tabla-mantenimiento-acento-contraste: 255, 255, 255;--mat-paginator-container-size: 30px;--tabla-mantenimiento-numeracion-texto: rgb(107, 114, 128)}:root .table-mantenimiento .elemento-seleccionado{background-color:var(--tabla-mantenimiento-seleccion-fondo)!important;color:var(--tabla-mantenimiento-seleccion-texto)!important;border-color:var(--tabla-mantenimiento-seleccion-texto)!important}.jvs-tabla-mantenimiento{width:inherit;display:flex;flex-direction:column}.jvs-tabla-mantenimiento .contenedor-botones>*:first-child{@apply rounded-l;}.jvs-tabla-mantenimiento .contenedor-botones>*:last-child{@apply rounded-r;}.jvs-tabla-mantenimiento .contenedor-botones button[aria-pressed] .mat-badge-content{background-color:rgb(var(--tabla-mantenimiento-acento))!important;color:rgb(var(--tabla-mantenimiento-acento-contraste))!important;box-shadow:0 0 0 1px #fff}.jvs-tabla-mantenimiento tr.regTooltip>td:first-child div:first-child:before,.jvs-tabla-mantenimiento tr.regTooltip>th:first-child div:first-child:before{content:\"\\26a0\\fe0f \";color:red;margin-right:4px;font-size:12px}.jvs-tabla-mantenimiento tr.regTooltip>td:first-child:not(:has(div)):before,.jvs-tabla-mantenimiento tr.regTooltip>th:first-child:not(:has(div)):before{content:\"\\26a0\\fe0f \";color:red;margin-right:4px;font-size:12px}.jvs-tabla-mantenimiento .mat-mdc-menu-content:not(:empty){@apply flex flex-col items-start;padding:0!important}.jvs-tabla-mantenimiento .mat-mdc-menu-item{line-height:24px!important;height:24px!important;min-height:24px!important}.jvs-tabla-mantenimiento .mat-mdc-menu-panel{min-height:auto!important}.jvs-tabla-mantenimiento .mat-mdc-table .mat-mdc-cell,.jvs-tabla-mantenimiento .mat-mdc-table .mat-mdc-header-cell .mat-mdc-footer-cell{white-space:unset}.jvs-tabla-mantenimiento .table-mantenimiento .mat-mdc-table-sticky-border-elem-right{border-left:1px solid #e0e0e0}.jvs-tabla-mantenimiento .table-mantenimiento .mat-mdc-table-sticky-border-elem-left{border-right:1px solid #e0e0e0}.jvs-tabla-mantenimiento .table-mantenimiento tr.regAnulado .mat-mdc-cell{color:unset!important}.jvs-tabla-mantenimiento .table-mantenimiento .bg-primary-activo .numeracionFila{@apply rounded-full bg-primary-contrast text-primary mx-1 p-1 w-6 h-6;}.jvs-tabla-mantenimiento .table-mantenimiento th .form-input{@apply w-auto;}.jvs-tabla-mantenimiento .table-mantenimiento th.mat-mdc-header-cell:not(.celda-numeracion-fila),.jvs-tabla-mantenimiento .table-mantenimiento td.mat-mdc-cell:not(.celda-numeracion-fila),.jvs-tabla-mantenimiento .table-mantenimiento td.mat-mdc-footer-cell:not(.celda-numeracion-fila){padding:.05rem .25rem}.jvs-tabla-mantenimiento .table-mantenimiento th.mat-mdc-header-cell,.jvs-tabla-mantenimiento .table-mantenimiento td.mat-mdc-cell,.jvs-tabla-mantenimiento .table-mantenimiento td.mat-mdc-footer-cell{border-width:1px;border-style:solid}.jvs-tabla-mantenimiento .table-mantenimiento th.mat-mdc-header-cell:first-of-type:not(.celda-numeracion-fila),.jvs-tabla-mantenimiento .table-mantenimiento th.mat-mdc-header-cell:last-of-type:not(.celda-numeracion-fila),.jvs-tabla-mantenimiento .table-mantenimiento td.mat-mdc-cell:first-of-type:not(.celda-numeracion-fila),.jvs-tabla-mantenimiento .table-mantenimiento td.mat-mdc-cell:last-of-type:not(.celda-numeracion-fila),.jvs-tabla-mantenimiento .table-mantenimiento td.mat-mdc-footer-cell:first-of-type:not(.celda-numeracion-fila),.jvs-tabla-mantenimiento .table-mantenimiento td.mat-mdc-footer-cell:last-of-type:not(.celda-numeracion-fila){padding:0 .25rem}.jvs-tabla-mantenimiento .table-mantenimiento .student-element-detail{overflow:hidden;display:flex;align-items:center;justify-content:center}.jvs-tabla-mantenimiento .table-mantenimiento .mat-mdc-header-row{height:25px!important;color:rgb(var(--color-primary))!important;background-color:rgb(var(--color-primary-contrast))!important}.jvs-tabla-mantenimiento .table-mantenimiento .mat-mdc-header-cell{padding:5px;font-size:10px;line-height:10px;font-weight:700!important;color:inherit}.jvs-tabla-mantenimiento .table-mantenimiento .mdc-data-table__row:not(.mdc-data-table__row--selected):not(.elemento-seleccionado):hover,.jvs-tabla-mantenimiento .table-mantenimiento .mdc-data-table__row:not(.mdc-data-table__row--selected):not(.elemento-seleccionado):focus{background-color:rgba(var(--color-primary-contrast),.04)}.jvs-tabla-mantenimiento .table-mantenimiento .mat-mdc-row .mat-mdc-cell,.jvs-tabla-mantenimiento .table-mantenimiento .mat-mdc-footer-row .mat-mdc-cell{font-size:10px}.jvs-tabla-mantenimiento .table-mantenimiento .mat-mdc-row .mat-mdc-footer-cell:empty,.jvs-tabla-mantenimiento .table-mantenimiento .mat-mdc-footer-row .mat-mdc-footer-cell:empty{border-width:0!important}.jvs-tabla-mantenimiento .table-mantenimiento .mat-mdc-cell{@apply leading-tight;}.jvs-tabla-mantenimiento .table-mantenimiento th.mat-mdc-header-cell{border-color:#d4d0d0;@apply text-center uppercase;}.jvs-tabla-mantenimiento .table-mantenimiento th.mat-mdc-header-cell .mat-sort-header-container{@apply flex items-center justify-between w-full;}.jvs-tabla-mantenimiento .table-mantenimiento th.mat-mdc-header-cell .mat-sort-header-container .mat-sort-header-content{@apply inline w-full text-center;}.jvs-tabla-mantenimiento .table-mantenimiento th.mat-mdc-header-cell .mat-sort-header-container .mat-sort-header-arrow{@apply flex-none;}.jvs-tabla-mantenimiento .table-mantenimiento .mat-mdc-sort-header-content{width:100%;text-align:center;display:unset;align-items:center}.compact-search-menu{min-width:200px!important;overflow:hidden}.compact-search-menu input:focus{@apply border-primary;}.jvs-tabla-mantenimiento.jvs-colores-tema{--tabla-mantenimiento-acento: var(--color-primary);--tabla-mantenimiento-acento-contraste: var(--color-primary-contrast);--tabla-mantenimiento-seleccion-fondo: rgba(var(--color-primary), .15);--tabla-mantenimiento-seleccion-texto: rgb(var(--color-primary))}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i4$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i4$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i3$1.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatDividerModule }, { kind: "component", type: i6$1.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i8.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i8.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i8.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "ngmodule", type: MatPaginatorModule }, { kind: "component", type: i9.MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }, { kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: i10.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "ngmodule", type: MatRippleModule }, { kind: "directive", type: i5.MatRipple, selector: "[mat-ripple], [matRipple]", inputs: ["matRippleColor", "matRippleUnbounded", "matRippleCentered", "matRippleRadius", "matRippleAnimation", "matRippleDisabled", "matRippleTrigger"], exportAs: ["matRipple"] }, { kind: "ngmodule", type: MatSortModule }, { kind: "directive", type: i3.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i2.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i2.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i2.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i2.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i2.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i2.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i2.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i2.MatFooterRowDef, selector: "[matFooterRowDef]", inputs: ["matFooterRowDef", "matFooterRowDefSticky"] }, { kind: "directive", type: i2.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i2.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: i2.MatFooterCell, selector: "mat-footer-cell, td[mat-footer-cell]" }, { kind: "component", type: i2.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i2.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i2.MatFooterRow, selector: "mat-footer-row, tr[mat-footer-row]", exportAs: ["matFooterRow"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i4$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: TablaMantenimientoColumnDefsComponent, selector: "jvs-tabla-mantenimiento-column-defs", inputs: ["nombreColeccion", "colDetalle", "chkLista", "estaExpandida"], outputs: ["alternarExpansion", "chkListaChange"] }, { kind: "ngmodule", type: MatBadgeModule }, { kind: "directive", type: i15.MatBadge, selector: "[matBadge]", inputs: ["matBadgeColor", "matBadgeOverlap", "matBadgeDisabled", "matBadgePosition", "matBadge", "matBadgeDescription", "matBadgeSize", "matBadgeHidden"] }, { kind: "component", type: TablaMantenimientoMenuComponent, selector: "jvs-tabla-mantenimiento-menu", inputs: ["nombreColeccion", "item", "derechosActuales", "subItems", "botonTemplate"], outputs: ["opcionSelecionada"] }, { kind: "directive", type: MatRowKeyboardSelectionDirective, selector: "[matRowKeyboardSelection]", inputs: ["matRowKeyboardSelection", "rowModel"], outputs: ["seleccionarSiguiente", "espacioEnFila", "filaEnfocada"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }], animations: [
1673
3867
  trigger('detailExpand', [
1674
3868
  state('collapsed', style({ height: '0px', minHeight: '0' })),
1675
3869
  state('expanded', style({ height: '*' })),
@@ -1700,6 +3894,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImpo
1700
3894
  MatMenuModule,
1701
3895
  MatMenuTrigger,
1702
3896
  MatPaginatorModule,
3897
+ MatProgressBarModule,
1703
3898
  MatRippleModule,
1704
3899
  MatSortModule,
1705
3900
  MatTableModule,
@@ -1712,6 +3907,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImpo
1712
3907
  ], host: {
1713
3908
  class: 'jvs-tabla-mantenimiento',
1714
3909
  '[class.h-full]': 'alturaFull()',
3910
+ '[class.jvs-colores-tema]': 'usaColoresTema()',
3911
+ '[class.jvs-banda-angosta]': "tramoBanda() === 'angosta'",
3912
+ '[class.jvs-banda-media]': "tramoBanda() === 'media'",
1715
3913
  }, animations: [
1716
3914
  trigger('detailExpand', [
1717
3915
  state('collapsed', style({ height: '0px', minHeight: '0' })),
@@ -1731,15 +3929,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImpo
1731
3929
  ])
1732
3930
  ]),
1733
3931
  ], providers: [
1734
- { provide: MAT_PAGINATOR_DEFAULT_OPTIONS, useValue: { formFieldAppearance: 'outline' } }
1735
- ], template: "<div class=\"flex flex-col\" [ngClass]=\"alturaFull() ? 'h-full' : 'h-fit'\">\n <div class=\"flex-none flex items-center justify-between bg-white\">\n <ng-content select=\"[filtro]\"></ng-content>\n </div>\n\n <div class=\"flex flex-col border-t\" [ngClass]=\"alturaFull() ? 'grow' : ''\">\n <div class=\"flex-none bg-app-bar flex items-center justify-between p-1\">\n <!-- <div class=\"hidden flex-1 sm:flex items-center flex-wrap gap-1\">-->\n <!-- </div>-->\n @if (leyenda) {\n <div class=\"flex items-center flex-wrap mr-1 h-full\">\n <span class=\"font-bold\" [class]=\"leyenda.class\">{{ leyenda.text }}</span>\n </div>\n }\n <div class=\"hidden flex-1 sm:flex items-center flex-wrap gap-1\">\n @if ((botonesMenuFinal.izquierda ?? []).length > 0 ) {\n <div class=\" flex items-center flex-wrap contenedor-botones\">\n @for (btn of botonesMenu.izquierda; track btn; let idx = $index) {\n <ng-container *ngTemplateOutlet=\"botonesSuperiores; context:{btn: btn, idx: {inicio: idx, fin: botonesMenu.izquierda?.length}}\"></ng-container>\n }\n </div>\n }\n\n @if ((botonesMenuFinal.crud ?? []).length > 0) {\n <div class=\" flex items-center flex-wrap contenedor-botones\">\n @for (btn of botonesMenu.crud; track btn; let idx = $index) {\n <ng-container *ngTemplateOutlet=\"botonesSuperiores; context:{btn: btn, idx: {inicio: idx, fin: botonesMenu.crud?.length}}\"></ng-container>\n }\n </div>\n }\n\n @if ((botonesMenuFinal.principal ?? []).length > 0) {\n <div class=\" flex items-center flex-wrap contenedor-botones\">\n @for (btn of botonesMenu.principal; track btn; let idx = $index) {\n <ng-container *ngTemplateOutlet=\"botonesSuperiores; context:{btn: btn, idx: {inicio: idx, fin: botonesMenu.principal?.length}}\"></ng-container>\n }\n </div>\n }\n\n @if ((botonesMenuFinal.derecha ?? []).length > 0) {\n <div class=\"flex-auto flex items-center justify-end contenedor-botones\">\n @for (btn of botonesMenu.derecha; track btn; let idx = $index) {\n <ng-container *ngTemplateOutlet=\"botonesSuperiores; context:{btn: btn, idx: {inicio: idx, fin: botonesMenu.derecha?.length}}\"></ng-container>\n }\n </div>\n }\n <ng-content select=\"[objetosMenuPegado]\"></ng-content>\n </div>\n <div class=\"flex flex-1 sm:hidden items-center flex-wrap gap-1\">\n <button class=\"flex items-center justify-center text-2xs leading-none rounded-full p-1\"\n matRipple\n matTooltip=\"Botones de Acci\u00F3n\"\n type=\"button\"\n [matMenuTriggerFor]=\"menuOpciones\"\n >\n <mat-icon class=\"icon-xs\" svgIcon=\"roundMenu\"></mat-icon>\n </button>\n </div>\n <div class=\"flex-none flex items-center justify-end border-l-2\">\n <div class=\"flex-1 sm:flex-none flex items-center justify-end\">\n <ng-content select=\"[objetosMenu]\"></ng-content>\n </div>\n </div>\n @if (busquedaTipo() && !busquedaCompacta()) {\n <div class=\"hidden flex-initial sm:flex items-center form-input max-w-[150px] bg-card rounded-full border m-1 px-1 border-l-2\"\n >\n <mat-icon svgIcon=\"roundSearch\" class=\"icon-xs\"></mat-icon>\n <input [formControl]=\"cCampoBusqueda\"\n class=\"text-xs px-1 py-1 border-0 outline-none w-full bg-transparent max-w-sm\"\n [placeholder]=\"busquedaPlaceholder()\"\n (keyup.enter)=\"busquedaTipo() == 'query' ? cargarData() : false;\"\n type=\"search\">\n </div>\n }\n\n\n <mat-menu #compactSearchMenu=\"matMenu\" class=\"compact-search-menu\">\n <div class=\"flex items-center gap-1\" (click)=\"$event.stopPropagation()\">\n <mat-icon svgIcon=\"roundSearch\" class=\"icon-xs text-gray-400\"></mat-icon>\n <input [formControl]=\"cCampoBusqueda\"\n class=\"text-xs px-2 py-1 border border-gray-200 rounded outline-none w-[180px] bg-white\"\n [placeholder]=\"busquedaPlaceholder()\"\n (keyup.enter)=\"ejecutarBusquedaCompacta()\"\n type=\"search\"\n (click)=\"$event.stopPropagation()\">\n </div>\n </mat-menu>\n <div class=\"flex-none flex items-center justify-end border-l-2\">\n <ng-content select=\"[botonesFiltro]\"></ng-content>\n <ng-content select=\"[botonesConfig]\"></ng-content>\n\n @if (busquedaTipo() && busquedaCompacta()) {\n <button matRipple\n class=\"flex items-center justify-center text-2xs leading-none rounded-full p-1\"\n matTooltip=\"Buscar...\"\n [matMenuTriggerFor]=\"compactSearchMenu\"\n #compactSearchMenuTrigger=\"matMenuTrigger\"\n type=\"button\">\n <mat-icon svgIcon=\"roundSearch\" class=\"icon-xs\"></mat-icon>\n </button>\n }\n\n @if (isRecargarUsed || busquedaTipo() == 'query') {\n <button matRipple\n class=\"flex items-center justify-center text-2xs leading-none rounded-full p-1 text-green-700\"\n matTooltip=\"Actualizar datos\"\n (click)=\"(busquedaTipo() == 'query' ? cargarData() : emitirAccionRecargar())\"\n type=\"button\">\n <mat-icon svgIcon=\"roundRefresh\" class=\"icon-xs\"></mat-icon>\n </button>\n }\n @if (mostrarBotonOrden()) {\n <button matRipple\n class=\"flex items-center justify-center text-2xs leading-none rounded-full p-1 text-blue-700\"\n [matTooltip]=\"bDireccionOrden() === 0 ? 'Orden Ascendente' : 'Orden Descendente'\"\n (click)=\"toggleDireccionOrden()\"\n type=\"button\">\n <mat-icon [svgIcon]=\"bDireccionOrden() === 0 ? 'roundArrowUpward' : 'roundArrowDownward'\" class=\"icon-xs\"></mat-icon>\n </button>\n }\n @if (filtroCampos) {\n <button matRipple [matMenuTriggerFor]=\"columnFilterMenu\"\n class=\"flex items-center justify-center text-2xs leading-none rounded-full p-1\"\n matTooltip=\"Columnas Filtro\"\n type=\"button\">\n <mat-icon svgIcon=\"roundFilterList\" class=\"icon-xs\"></mat-icon>\n </button>\n }\n </div>\n </div>\n\n @if ((botonesMenuFinal.secundario ?? []).length > 0) {\n <div class=\"flex-1 bg-app-bar flex items-center justify-between p-1 border-t\">\n <div class=\"hidden flex-1 sm:flex items-center flex-wrap gap-1\">\n <div class=\" flex items-center flex-wrap contenedor-botones\">\n @for (btn of botonesMenu.secundario; track btn; let idx = $index) {\n <ng-container *ngTemplateOutlet=\"botonesSuperiores; context:{btn: btn, idx: {inicio: idx, fin: botonesMenu.secundario?.length}}\"></ng-container>\n }\n </div>\n </div>\n </div>\n }\n <!--<div class=\"grow flex flex-col items-stretch contenedor-tabla\" [ngClass]=\"{'table-container overflow-auto': esTabla}\">\n <pre>{{ this.chkLista.modelosChk | json }}</pre>\n <pre>{{ this.chkLista.checkbox.cantidadActivos | json }}</pre>\n <pre>{{ this.chkLista.checkbox.algunosActivos | json }}</pre>\n</div>-->\n<div class=\"grow flex flex-col items-stretch contenedor-tabla\" [ngClass]=\"{'table-container overflow-auto': esTabla}\">\n <ng-content select=\"[cuerpo]\"></ng-content>\n\n <table [id]=\"'tabla_' + nombreColeccion\" [dataSource]=\"dataSource\" [multiTemplateDataRows]=\"true\"\n [hidden]=\"!esTabla\"\n class=\"table-mantenimiento table-auto h-fit\" mat-table matSort\n [trackBy]=\"trackByFn\"\n #tablaMantenimiento\n >\n\n <!--<table [dataSource]=\"dataSource\" class=\"table-mantenimiento table-auto h-auto w-full justify-center\" mat-table matSort>-->\n\n\n <ng-content select=\"[tableDefinitions]\"></ng-content>\n <ng-container matColumnDef=\"numeracion_automatica\">\n <th mat-header-cell *matHeaderCellDef style=\"width: 16px !important\">N\u00BA</th>\n <td mat-cell *matCellDef=\"let element; let i = dataIndex\" class=\"p-0 celda-numeracion-fila\">\n <div class=\"flex items-center justify-center font-bold numeracionFila\">\n @if (esTabla && paginador) {\n {{ (this.paginator?.pageIndex == 0 ? i + 1 : 1 + i + (this.paginator?.pageIndex ?? 1) * (this.paginator?.pageSize ?? 1)) }}\n }\n @if (!paginador) {\n {{ (i + 1) }}\n }\n </div>\n </td>\n <td mat-footer-cell *matFooterCellDef class=\"uppercase\"></td>\n </ng-container>\n <jvs-tabla-mantenimiento-column-defs [objThis]=\"this\" [colDetalle]=\"columnasTabla\"\n [nombreColeccion]=\"nombreColeccion\" [(chkLista)]=\"chkLista\"></jvs-tabla-mantenimiento-column-defs>\n\n <tr *matHeaderRowDef=\"visibleColumns; sticky: true\" mat-header-row class=\"title\" matHeader\n ></tr>\n\n @if (!!filaExtraHeader) {\n <tr mat-row *matRowDef=\"let row; columns: ['filaExtraHeader']\" class=\"student-detail-row\"\n [style.height.px]=\"0\"\n ></tr>\n <ng-container matColumnDef=\"filaExtraHeader\">\n <td mat-cell *matCellDef=\"let row; let i = dataIndex\" [attr.colspan]=\"visibleColumns.length\">\n <div class=\"row m-0 student-element-detail\"\n [@detailExpand]=\"(i == 0 && filaExtraHeader.esVisible && filaExtraHeader.esVisible()) ? 'expanded' : 'collapsed'\"\n [style.padding-right.px]=\"row.isExpanded ? 5 : 0\"\n [style.padding-left.px]=\"row.isExpanded ? 5 : 0\"\n >\n @if (filaExtraHeader.template) {\n <ng-container\n [ngTemplateOutlet]=\"filaExtraHeader.template\"\n [ngTemplateOutletContext]=\"{ row: row }\"></ng-container>\n }\n </div>\n </td>\n </ng-container>\n }\n @if (filaFooter) {\n <tr *matFooterRowDef=\"visibleColumns\" mat-footer-row\n [style.height.px]=\"0\"\n [id]=\"nombreColeccion + '_filaFooter'\"\n ></tr>\n }\n\n <!--\t<tr\n *matRowDef=\"let row; columns: visibleColumns;\"\n class=\"hover:bg-secondary trans-ease-out cursor-pointer\"\n mat-row></tr>-->\n <tr\n [matRowKeyboardSelection]=\"tablaMantenimiento\"\n [rowModel]=\"row\"\n (seleccionarSiguiente)=\"opcMenu($event, {seccion: nombreColeccion, tipo: 'ver'});\"\n\n *matRowDef=\"let row; let idxTabla = dataIndex; columns: visibleColumns;\"\n (click)=\"seleccionarItem(row); opcMenu(row, {seccion: nombreColeccion, tipo: 'ver', tableDataIndex: idxTabla });\"\n (dblclick)=\"opcMenu(row, {seccion: nombreColeccion, tipo: 'seleccionar'}); dblclickItem.emit(row)\"\n (contextmenu)=\"(abrirMenuContextual($event, row)); $event. preventDefault();\"\n [ngClass]=\"classFila(row)\"\n @fadeInUp\n class=\"trans-ease-out cursor-pointer h-auto\"\n [style.height.px]=\"0\"\n [id]=\"propiedadSeleccion(row)\"\n [matTooltip]=\"procesarRowTooltip(row)\"\n matTooltipPosition=\"below\"\n [matTooltipPositionAtOrigin]=\"true\"\n [matTooltipClass]=\"['bg-red-700', 'text-red-100', 'm-0']\"\n [matTooltipDisabled]=\"!procesarRowTooltip(row)\"\n [class.regAnulado]=\"row[campoAnulado] == 1\"\n [class.regTooltip]=\"!!procesarRowTooltip(row)\"\n (keyup.delete)=\"opcMenu(row, {seccion: nombreColeccion, tipo: 'eliminar'})\"\n mat-row></tr>\n @if (filaExtraTemplate) {\n <tr mat-row *matRowDef=\"let row; columns: ['expandedDetail']\" class=\"student-detail-row h-0\"></tr>\n <ng-container matColumnDef=\"expandedDetail\">\n <td mat-cell *matCellDef=\"let row\" [attr.colspan]=\"visibleColumns.length\">\n <div class=\"row m-0 student-element-detail\"\n [@detailExpand]=\"row.isExpanded ? 'expanded' : 'collapsed'\"\n [style.padding-right.px]=\"row.isExpanded ? 5 : 0\"\n [style.padding-left.px]=\"row.isExpanded ? 5 : 0\"\n >\n <ng-container [ngTemplateOutlet]=\"filaExtraTemplate\"\n [ngTemplateOutletContext]=\"{ row: row }\"></ng-container>\n </div>\n </td>\n </ng-container>\n }\n</table>\n\n@if (componenteCargadoTotalmente) {\n @if ((noData | async) && esTabla) {\n <div class=\"flex-1 text-center text-secondary font-medium\">\n No se encontraron datos\n </div>\n }\n}\n</div>\n<ng-content select=\"[appendTable]\"></ng-content>\n<div class=\"flex-none bg-app-bar flex flex-col sm:flex-row items-start justify-between p-1\">\n <div class=\"flex-1 flex items-start flex-wrap gap-1\">\n\n @if ((botonesMenuFinal.inferior ?? []).length > 0) {\n <div class=\"flex items-center contenedor-botones\">\n @for (btn of botonesMenu.inferior; track btn; let idx = $index) {\n <ng-container *ngTemplateOutlet=\"botonesSuperiores; context:{btn: btn, idx: {inicio: idx, fin: botonesMenu.inferior?.length}}\"></ng-container>\n }\n </div>\n }\n <!--<div *ngIf=\"(botonesMenuFinal.inferior ?? []).length > 0\" class=\" flex items-center flex-wrap\">\n <ng-container *ngFor=\"let btn of botonesMenu.inferior; let idx = index;\">\n <ng-container *ngTemplateOutlet=\"botonesSuperiores; context:{btn: btn, idx: {inicio: idx, fin: botonesMenu.inferior?.length}}\"></ng-container>\n </ng-container>\n </div>-->\n</div>\n\n@if (esTabla && paginador) {\n <div class=\"flex-1 sm:flex-none flex items-center justify-end\">\n <mat-paginator class=\"tabla-mantenimiento-paginador\" [pageSizeOptions]=\"paginacion.pageSizeOptions\" [pageIndex]=\"paginacion.pageIndex - 1\" [length]=\"paginacion.pageLength\" [pageSize]=\"paginacion.pageSize\" (page)=\"paginacion.pageCurrent = $event; emitirResultados();\" ></mat-paginator>\n </div>\n}\n</div>\n</div>\n\n</div>\n\n\n\n<!-- SECCION DE TEMPLATES O MENUS -->\n\n\n<mat-menu #columnFilterMenu=\"matMenu\" xPosition=\"before\" yPosition=\"below\">\n @for (column of columnasTabla; track column) {\n @if (!tipoValorFuncion(column.noMostrarEnLista, false)) {\n <button (click)=\"toggleColumnVisibility(column, $event)\"\n class=\"checkbox-item mat-menu-item\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" [(ngModel)]=\"column.visible\" [ngModelOptions]=\"{standalone: true}\" color=\"primary\">\n <span [innerHTML]=\"(column.labelLista ?? column.label).replace('<br>', ' ')\"></span>\n </mat-checkbox>\n </button>\n }\n }\n</mat-menu>\n\n\n\n\n\n\n<ng-template #botonesSuperiores let-btn=\"btn\" let-idx=\"idx\">\n <ng-container *ngTemplateOutlet=\"botonesContextual; context:{btn: btn, item: objSeleccionado, barraSuperior: true, idx: idx}\"></ng-container>\n</ng-template>\n\n<ng-template #botonesContextual let-btn=\"btn\" let-item=\"item\" let-barraSuperior=\"barraSuperior\" let-idx=\"idx\">\n\n @if (barraSuperior) {\n <!--\t\t<button mat-button style=\"min-width: unset; border: 1px !important;\" class=\"uppercase border border-gray rounded-none h-full px-1 disabled:opacity-50 disabled:text-secondary disabled:bg-transparent\">-->\n <!--\t\t\t<mat-icon *ngIf=\"btn.icono\" [svgIcon]=\"btn.icono\" size=\"15px\" class=\"icon-xs\"></mat-icon>-->\n <!--\t\t</button>-->\n @if (btn.subItems && btn.subItems.length > 0) {\n @if ((!btn.esVisible || btn.esVisible(item, this)) && subItemsActivos(btn, item)) {\n <button class=\"flex items-center justify-between uppercase text-2xs leading-none rounded-none px-2 py-1 bg-opacity-95 hover:bg-opacity-100 disabled:opacity-50 disabled:text-secondary disabled:!bg-gray-300 dark:disabled:!bg-gray-500 mat-elevation-z2\" type=\"button\"\n [class]=\"(btn.class?btn.class:'')\"\n (click)=\"opcMenu(item, btn)\"\n [style.min-width]=\"((btn.soloIcono ?? tipoValorFuncion(soloIconos)) ? 'unset' : '')\"\n [matTooltip]=\"btn.tooltip || (btn.label ? btn.label : ( (derechosActuales && derechosActuales[btn.cDerechoCodigo ?? btn.tipo]) ? derechosActuales[btn.cDerechoCodigo ?? btn.tipo]['cDerechoNombre'] : capitalizarTexto(btn.tipo))) \"\n [matMenuTriggerFor]=\"menuOtrosBarra.menu\"\n [matBadge]=\"btn.badge\"\n matBadgeSize=\"small\"\n >\n @if (btn.icono) {\n <mat-icon class=\"icon-xs\" [class.mr-0.5]=\"!(btn.soloIcono ?? tipoValorFuncion(soloIconos))\" [svgIcon]=\"btn.icono\" ></mat-icon>\n }\n @if (!(btn.soloIcono ?? tipoValorFuncion(soloIconos))) {\n <span class=\"whitespace-nowrap\">{{ btn.label ? btn.label : ( (derechosActuales && derechosActuales[btn.cDerechoCodigo ?? btn.tipo]) ? derechosActuales[btn.cDerechoCodigo ?? btn.tipo]['cDerechoNombre'] : capitalizarTexto(btn.tipo)) }}</span>\n }\n <mat-icon class=\"icon-xs\" svgIcon=\"fa5sCaretDown\" ></mat-icon>\n </button>\n }\n <jvs-tabla-mantenimiento-menu #menuOtrosBarra\n [objThis]=\"objThis\"\n [nombreColeccion]=\"nombreColeccion\"\n [item]=\"item\"\n [derechosActuales]=\"derechosActuales\"\n [subItems]=\"btn.subItems\"\n (opcionSelecionada)=\"opcMenu($event.item, $event.btn)\"\n [botonTemplate]=\"botonesContextual\"\n >\n </jvs-tabla-mantenimiento-menu>\n }\n @if (!btn.subItems || btn.subItems.length == 0) {\n @if (!btn.esVisible || btn.esVisible(item, this)) {\n <button class=\"flex items-center justify-between uppercase text-2xs leading-none rounded-none px-2 py-1 bg-opacity-95 hover:bg-opacity-100 disabled:opacity-50 disabled:text-secondary disabled:!bg-gray-300 dark:disabled:!bg-gray-500 mat-elevation-z2\" type=\"button\"\n [class]=\"(btn.class?btn.class:'text-secondary')\"\n [ngClass]=\"{'text-secondary italic': !ignorarDerechos && !btn.esIndependiente && (!btn.ignorarDerecho && (!derechosActuales || !derechosActuales[btn.cDerechoCodigo ?? btn.tipo])) && !(['nuevo', 'editar', 'eliminar'].includes(btn.tipo))}\"\n [disabled]=\"!btn.esIndependiente && botonDisabled(btn, item)\"\n (click)=\"opcMenu(item, btn)\"\n [style.min-width]=\"((btn.soloIcono ?? tipoValorFuncion(soloIconos)) ? 'unset' : '')\"\n [matTooltip]=\"btn.tooltip || (btn.label ? btn.label : ( (derechosActuales && derechosActuales[btn.cDerechoCodigo ?? btn.tipo]) ? derechosActuales[btn.cDerechoCodigo ?? btn.tipo]['cDerechoNombre'] : capitalizarTexto(btn.tipo))) \"\n [matBadge]=\"btn.badge\"\n matBadgeSize=\"small\"\n >\n @if (btn.icono) {\n <mat-icon class=\"icon-xs\" [class.mr-0.5]=\"!(btn.soloIcono ?? tipoValorFuncion(soloIconos))\" [svgIcon]=\"btn.icono\"></mat-icon>\n }\n @if (!(btn.soloIcono ?? tipoValorFuncion(soloIconos))) {\n <span class=\"whitespace-nowrap\">{{ btn.label ? btn.label : ( (derechosActuales && derechosActuales[btn.cDerechoCodigo ?? btn.tipo]) ? derechosActuales[btn.cDerechoCodigo ?? btn.tipo]['cDerechoNombre'] : capitalizarTexto(btn.tipo)) }}</span>\n }\n </button>\n }\n }\n} @else {\n @if (btn.subItems && btn.subItems.length > 0) {\n @if (!btn.noContextual && (!btn.esVisible || btn.esVisible(item, this))) {\n <button class=\"flex items-center justify-between uppercase w-full rounded-none px-2 disabled:opacity-50 disabled:text-secondary disabled:bg-transparent\" mat-menu-item type=\"button\"\n [class]=\"(btn.class?btn.class.replace('text-white', '').replace('bg', 'text'):'text-secondary')\"\n [ngClass]=\"{'text-secondary italic': !ignorarDerechos && !btn.esIndependiente && (!btn.ignorarDerecho && (!derechosActuales || !derechosActuales[btn.cDerechoCodigo ?? btn.tipo]))}\"\n [disabled]=\"!btn.esIndependiente && botonDisabled(btn, item)\"\n (click)=\"opcMenu(item, btn); $event.stopPropagation();\"\n [matMenuTriggerFor]=\"menuOtrosBarra.menu\"\n >\n <div class=\"flex w-full items-center justify-between uppercase text-2xs\"\n >\n @if (btn.icono) {\n <mat-icon [svgIcon]=\"btn.icono\"\n class=\"flex-none icon-xs\"\n ></mat-icon>\n }\n <span class=\"grow text-2xs\">{{ btn.label ? btn.label : ( (derechosActuales && derechosActuales[btn.cDerechoCodigo ?? btn.tipo]) ? derechosActuales[btn.cDerechoCodigo ?? btn.tipo]['cDerechoNombre'] : capitalizarTexto(btn.tipo)) }}</span>\n <mat-icon class=\"flex-none icon-xs\" svgIcon=\"fa5sCaretRight\"></mat-icon>\n </div>\n </button>\n }\n <jvs-tabla-mantenimiento-menu #menuOtrosBarra\n [objThis]=\"objThis\"\n [nombreColeccion]=\"nombreColeccion\"\n [item]=\"item\"\n [derechosActuales]=\"derechosActuales\"\n [subItems]=\"btn.subItems\"\n (opcionSelecionada)=\"opcMenu($event.item, $event.btn)\"\n [botonTemplate]=\"botonesContextual\"\n >\n </jvs-tabla-mantenimiento-menu>\n }\n @if (!btn.subItems || btn.subItems.length == 0) {\n @if (btn.tipo == '-#SEPARADOR#-') {\n <mat-divider></mat-divider>\n } @else {\n @if (!btn.noContextual && (!btn.esVisible || btn.esVisible(item, this))) {\n <button class=\"flex items-center justify-between uppercase w-full rounded-none px-2 disabled:opacity-50 disabled:text-secondary disabled:bg-transparent\" mat-menu-item type=\"button\"\n [class]=\"(btn.class?btn.class.replace('text-white', '').replace('bg', 'text'):'text-secondary')\"\n [ngClass]=\"{'text-secondary italic': !ignorarDerechos && !btn.esIndependiente && (!btn.ignorarDerecho && (!derechosActuales || !derechosActuales[btn.cDerechoCodigo ?? btn.tipo]))}\"\n [disabled]=\"!btn.esIndependiente && botonDisabled(btn, item)\"\n (click)=\"opcMenu(item, btn)\"\n >\n <div class=\"flex w-full items-center justify-between uppercase text-2xs\">\n @if (btn.icono) {\n <mat-icon [svgIcon]=\"btn.icono\" class=\"flex-none icon-xs\"\n ></mat-icon>\n }\n <span class=\"grow text-2xs\">{{ btn.label ? btn.label : ( (derechosActuales && derechosActuales[btn.cDerechoCodigo ?? btn.tipo]) ? derechosActuales[btn.cDerechoCodigo ?? btn.tipo]['cDerechoNombre'] : capitalizarTexto(btn.tipo)) }}</span>\n </div>\n </button>\n }\n }\n }\n}\n\n</ng-template>\n\n<ng-template #userMenu let-item=\"item\">\n <div class=\"mat-menu bg-white rounded mat-elevation-z8 shadow botonesContextual\">\n @for (btn of listaMenuCompleto; track btn) {\n <ng-container *ngTemplateOutlet=\"botonesContextual; context:{btn: btn, item: objSeleccionado, barraSuperior: false}\"></ng-container>\n }\n </div>\n</ng-template>\n\n\n<mat-menu #menuOpciones=\"matMenu\" xPosition=\"before\" yPosition=\"below\">\n @for (btn of listaMenuCompleto; track btn) {\n <ng-container\n *ngTemplateOutlet=\"botonesContextual; context:{btn: btn, item: objSeleccionado, barraSuperior: false}\"></ng-container>\n }\n</mat-menu>\n\n", styles: ["@charset \"UTF-8\";:root{--tabla-mantenimiento-seleccion-fondo: rgb(179, 217, 252);--tabla-mantenimiento-seleccion-texto: rgb(1, 84, 164);--mat-paginator-container-size: 30px}:root .table-mantenimiento .elemento-seleccionado{background-color:var(--tabla-mantenimiento-seleccion-fondo)!important;color:var(--tabla-mantenimiento-seleccion-texto)!important;border-color:var(--tabla-mantenimiento-seleccion-texto)!important}.jvs-tabla-mantenimiento{width:inherit;display:flex;flex-direction:column}.jvs-tabla-mantenimiento .contenedor-botones>*:first-child{@apply rounded-l;}.jvs-tabla-mantenimiento .contenedor-botones>*:last-child{@apply rounded-r;}.jvs-tabla-mantenimiento tr.regTooltip>td:first-child div:first-child:before,.jvs-tabla-mantenimiento tr.regTooltip>th:first-child div:first-child:before{content:\"\\26a0\\fe0f \";color:red;margin-right:4px;font-size:12px}.jvs-tabla-mantenimiento tr.regTooltip>td:first-child:not(:has(div)):before,.jvs-tabla-mantenimiento tr.regTooltip>th:first-child:not(:has(div)):before{content:\"\\26a0\\fe0f \";color:red;margin-right:4px;font-size:12px}.jvs-tabla-mantenimiento .mat-mdc-menu-content:not(:empty){@apply flex flex-col items-start;padding:0!important}.jvs-tabla-mantenimiento .mat-mdc-menu-item{line-height:24px!important;height:24px!important;min-height:24px!important}.jvs-tabla-mantenimiento .mat-mdc-menu-panel{min-height:auto!important}.jvs-tabla-mantenimiento .mat-mdc-table .mat-mdc-cell,.jvs-tabla-mantenimiento .mat-mdc-table .mat-mdc-header-cell .mat-mdc-footer-cell{white-space:unset}.jvs-tabla-mantenimiento .table-mantenimiento .mat-mdc-table-sticky-border-elem-right{border-left:1px solid #e0e0e0}.jvs-tabla-mantenimiento .table-mantenimiento .mat-mdc-table-sticky-border-elem-left{border-right:1px solid #e0e0e0}.jvs-tabla-mantenimiento .table-mantenimiento tr.regAnulado .mat-mdc-cell{color:unset!important}.jvs-tabla-mantenimiento .table-mantenimiento .bg-primary-activo .numeracionFila{@apply rounded-full bg-primary-contrast text-primary mx-1 p-1 w-6 h-6;}.jvs-tabla-mantenimiento .table-mantenimiento th .form-input{@apply w-auto;}.jvs-tabla-mantenimiento .table-mantenimiento th.mat-mdc-header-cell:not(.celda-numeracion-fila),.jvs-tabla-mantenimiento .table-mantenimiento td.mat-mdc-cell:not(.celda-numeracion-fila),.jvs-tabla-mantenimiento .table-mantenimiento td.mat-mdc-footer-cell:not(.celda-numeracion-fila){padding:.05rem .25rem}.jvs-tabla-mantenimiento .table-mantenimiento th.mat-mdc-header-cell,.jvs-tabla-mantenimiento .table-mantenimiento td.mat-mdc-cell,.jvs-tabla-mantenimiento .table-mantenimiento td.mat-mdc-footer-cell{border-width:1px;border-style:solid}.jvs-tabla-mantenimiento .table-mantenimiento th.mat-mdc-header-cell:first-of-type:not(.celda-numeracion-fila),.jvs-tabla-mantenimiento .table-mantenimiento th.mat-mdc-header-cell:last-of-type:not(.celda-numeracion-fila),.jvs-tabla-mantenimiento .table-mantenimiento td.mat-mdc-cell:first-of-type:not(.celda-numeracion-fila),.jvs-tabla-mantenimiento .table-mantenimiento td.mat-mdc-cell:last-of-type:not(.celda-numeracion-fila),.jvs-tabla-mantenimiento .table-mantenimiento td.mat-mdc-footer-cell:first-of-type:not(.celda-numeracion-fila),.jvs-tabla-mantenimiento .table-mantenimiento td.mat-mdc-footer-cell:last-of-type:not(.celda-numeracion-fila){padding:0 .25rem}.jvs-tabla-mantenimiento .table-mantenimiento .student-element-detail{overflow:hidden;display:flex;align-items:center;justify-content:center}.jvs-tabla-mantenimiento .table-mantenimiento .mat-mdc-header-row{height:25px!important;color:rgb(var(--color-primary))!important;background-color:rgb(var(--color-primary-contrast))!important}.jvs-tabla-mantenimiento .table-mantenimiento .mat-mdc-header-cell{padding:5px;font-size:10px;line-height:10px;font-weight:700!important;color:inherit}.jvs-tabla-mantenimiento .table-mantenimiento .mdc-data-table__row:not(.mdc-data-table__row--selected):not(.elemento-seleccionado):hover,.jvs-tabla-mantenimiento .table-mantenimiento .mdc-data-table__row:not(.mdc-data-table__row--selected):not(.elemento-seleccionado):focus{background-color:rgba(var(--color-primary-contrast),.04)}.jvs-tabla-mantenimiento .table-mantenimiento .mat-mdc-row .mat-mdc-cell,.jvs-tabla-mantenimiento .table-mantenimiento .mat-mdc-footer-row .mat-mdc-cell{font-size:10px}.jvs-tabla-mantenimiento .table-mantenimiento .mat-mdc-row .mat-mdc-footer-cell:empty,.jvs-tabla-mantenimiento .table-mantenimiento .mat-mdc-footer-row .mat-mdc-footer-cell:empty{border-width:0!important}.jvs-tabla-mantenimiento .table-mantenimiento .mat-mdc-cell{@apply leading-tight;}.jvs-tabla-mantenimiento .table-mantenimiento th.mat-mdc-header-cell{border-color:#d4d0d0;@apply text-center uppercase;}.jvs-tabla-mantenimiento .table-mantenimiento th.mat-mdc-header-cell .mat-sort-header-container{@apply flex items-center justify-between w-full;}.jvs-tabla-mantenimiento .table-mantenimiento th.mat-mdc-header-cell .mat-sort-header-container .mat-sort-header-content{@apply inline w-full text-center;}.jvs-tabla-mantenimiento .table-mantenimiento th.mat-mdc-header-cell .mat-sort-header-container .mat-sort-header-arrow{@apply flex-none;}.jvs-tabla-mantenimiento .table-mantenimiento .mat-mdc-sort-header-content{width:100%;text-align:center;display:unset;align-items:center}.compact-search-menu{min-width:200px!important;overflow:hidden}.compact-search-menu input:focus{@apply border-primary;}\n"] }]
1736
- }], ctorParameters: () => [{ type: i1$2.FormBuilder }, { type: i2$1.Overlay }, { type: i0.ViewContainerRef }, { type: TablaMantenimientoService }, { type: i0.ChangeDetectorRef }], propDecorators: { id: [{
3932
+ { provide: MAT_PAGINATOR_DEFAULT_OPTIONS, useValue: { formFieldAppearance: 'outline' } },
3933
+ { provide: CONFIG_CABECERAS_TABLA, useFactory: crearConfigCabeceras },
3934
+ // `providers` (no `viewProviders`): las columnas `custom` del consumidor también lo ven.
3935
+ { provide: CONTROL_ARBOL_TABLA, useExisting: forwardRef(() => TablaMantenimientoComponent) },
3936
+ // El `MatSort` de la tabla está en su propia vista; un `mat-sort-header` en una columna
3937
+ // `custom` (declarada en la plantilla del consumidor) no lo alcanza por el árbol de
3938
+ // inyección y fallaba con "Cannot read properties of null (reading 'register')". Se le
3939
+ // entrega el mismo de la tabla.
3940
+ { provide: MatSort, useFactory: () => inject(TablaMantenimientoComponent).sort },
3941
+ ], template: "<div class=\"flex flex-col\" [ngClass]=\"alturaFull() ? 'h-full' : 'h-fit'\">\n <div class=\"flex-none flex items-center justify-between bg-white\">\n <ng-content select=\"[filtro]\"></ng-content>\n </div>\n\n <div class=\"flex flex-col border-t\" [ngClass]=\"alturaFull() ? 'grow' : ''\">\n <div #bandaTabla class=\"flex-none bg-app-bar flex items-center justify-between p-1\">\n <!-- <div class=\"hidden flex-1 sm:flex items-center flex-wrap gap-1\">-->\n <!-- </div>-->\n @if (leyenda) {\n <div class=\"flex items-center flex-wrap mr-1 h-full\">\n <span class=\"font-bold\" [class]=\"leyenda.class\">{{ leyenda.text }}</span>\n </div>\n }\n <div class=\"flex flex-1 items-center flex-wrap gap-1 min-w-0\">\n <!-- Con la banda angosta (la tabla, no la ventana) los grupos pasan al men\u00FA \u2261; lo pegado sigue a la vista. -->\n @if (tramoBanda() === 'angosta') {\n <button class=\"flex items-center justify-center text-2xs leading-none rounded-full p-1\"\n matRipple\n matTooltip=\"Botones de Acci\u00F3n\"\n type=\"button\"\n [matMenuTriggerFor]=\"menuOpciones\"\n >\n <mat-icon class=\"icon-xs\" svgIcon=\"roundMenu\"></mat-icon>\n </button>\n } @else {\n <div class=\"contents\">\n @if ((botonesMenuFinal.izquierda ?? []).length > 0 ) {\n <div class=\" flex items-center flex-wrap contenedor-botones\">\n @for (seg of segmentosBotones(botonesMenuFinal.izquierda); track $index) {\n @if (seg.grupo) {\n <ng-container *ngTemplateOutlet=\"grupoSegmentado; context:{botones: seg.botones, soloIcono: false, margen: seg.margen}\"></ng-container>\n } @else {\n <ng-container *ngTemplateOutlet=\"botonesSuperiores; context:{btn: seg.botones[0], margen: seg.margen, idx: {inicio: $index, fin: botonesMenuFinal.izquierda?.length}}\"></ng-container>\n }\n }\n </div>\n }\n\n @if ((botonesMenuFinal.crud ?? []).length > 0) {\n <div class=\" flex items-center flex-wrap contenedor-botones\">\n @for (seg of segmentosBotones(botonesMenuFinal.crud); track $index) {\n @if (seg.grupo) {\n <ng-container *ngTemplateOutlet=\"grupoSegmentado; context:{botones: seg.botones, soloIcono: false, margen: seg.margen}\"></ng-container>\n } @else {\n <ng-container *ngTemplateOutlet=\"botonesSuperiores; context:{btn: seg.botones[0], margen: seg.margen, idx: {inicio: $index, fin: botonesMenuFinal.crud?.length}}\"></ng-container>\n }\n }\n </div>\n }\n\n @if ((botonesMenuFinal.principal ?? []).length > 0) {\n <div class=\" flex items-center flex-wrap contenedor-botones\">\n @for (seg of segmentosBotones(botonesMenuFinal.principal); track $index) {\n @if (seg.grupo) {\n <ng-container *ngTemplateOutlet=\"grupoSegmentado; context:{botones: seg.botones, soloIcono: false, margen: seg.margen}\"></ng-container>\n } @else {\n <ng-container *ngTemplateOutlet=\"botonesSuperiores; context:{btn: seg.botones[0], margen: seg.margen, idx: {inicio: $index, fin: botonesMenuFinal.principal?.length}}\"></ng-container>\n }\n }\n </div>\n }\n\n @if ((botonesMenuFinal.derecha ?? []).length > 0) {\n <div class=\"flex-auto flex items-center justify-end contenedor-botones\">\n @for (seg of segmentosBotones(botonesMenuFinal.derecha); track $index) {\n @if (seg.grupo) {\n <ng-container *ngTemplateOutlet=\"grupoSegmentado; context:{botones: seg.botones, soloIcono: false, margen: seg.margen}\"></ng-container>\n } @else {\n <ng-container *ngTemplateOutlet=\"botonesSuperiores; context:{btn: seg.botones[0], margen: seg.margen, idx: {inicio: $index, fin: botonesMenuFinal.derecha?.length}}\"></ng-container>\n }\n }\n </div>\n }\n </div>\n }\n <ng-content select=\"[objetosMenuPegado]\"></ng-content>\n </div>\n <div class=\"flex-none flex items-center justify-end border-l-2\">\n <div class=\"flex items-center justify-end\" [ngClass]=\"tramoBanda() === 'angosta' ? 'flex-1' : 'flex-none'\">\n <ng-content select=\"[objetosMenu]\"></ng-content>\n </div>\n </div>\n @if (busquedaTipo() && !busquedaEsCompacta()) {\n <div class=\"flex flex-initial items-center form-input bg-card rounded-full border m-1 px-1 border-l-2\"\n [style.max-width]=\"busquedaAncho()\"\n >\n <mat-icon svgIcon=\"roundSearch\" class=\"icon-xs\"></mat-icon>\n <input [formControl]=\"cCampoBusqueda\"\n class=\"text-xs px-1 py-1 border-0 outline-none w-full bg-transparent max-w-sm\"\n [placeholder]=\"busquedaPlaceholder()\"\n (keyup.enter)=\"busquedaTipo() == 'query' ? cargarData() : false;\"\n type=\"search\">\n </div>\n }\n\n\n <mat-menu #compactSearchMenu=\"matMenu\" class=\"compact-search-menu\">\n <div class=\"flex items-center gap-1\" (click)=\"$event.stopPropagation()\">\n <mat-icon svgIcon=\"roundSearch\" class=\"icon-xs text-gray-400\"></mat-icon>\n <input #inputBusquedaCompacta [formControl]=\"cCampoBusqueda\"\n class=\"text-xs px-2 py-1 border border-gray-200 rounded outline-none w-[180px] bg-white\"\n [placeholder]=\"busquedaPlaceholder()\"\n (keyup.enter)=\"ejecutarBusquedaCompacta()\"\n type=\"search\"\n (click)=\"$event.stopPropagation()\">\n </div>\n </mat-menu>\n <div class=\"flex-none flex items-center justify-end border-l-2\">\n <ng-content select=\"[botonesFiltro]\"></ng-content>\n <ng-content select=\"[botonesConfig]\"></ng-content>\n\n @if (busquedaTipo() && busquedaEsCompacta()) {\n <!-- Con texto buscado, el icono lleva un punto: hay un filtro aplicado aunque no se vea. -->\n <button matRipple\n class=\"relative flex items-center justify-center text-2xs leading-none rounded-full p-1\"\n [matTooltip]=\"cCampoBusqueda.value ? 'Buscando: ' + cCampoBusqueda.value : busquedaPlaceholder()\"\n [attr.aria-label]=\"busquedaPlaceholder()\"\n [matMenuTriggerFor]=\"compactSearchMenu\"\n (menuOpened)=\"enfocarBusquedaCompacta()\"\n #compactSearchMenuTrigger=\"matMenuTrigger\"\n type=\"button\">\n <mat-icon svgIcon=\"roundSearch\" class=\"icon-xs\"></mat-icon>\n @if (cCampoBusqueda.value) {\n <span class=\"absolute top-0 right-0 size-1.5 rounded-full bg-primary\" aria-hidden=\"true\"></span>\n }\n </button>\n }\n\n <!-- Herramientas (exportaciones): solo \u00EDcono, junto a Recargar. Con m\u00E1s de tres, un men\u00FA. -->\n @if (botonesHerramientasVisibles.length > 3) {\n <button matRipple\n class=\"flex items-center justify-center text-2xs leading-none rounded-full p-1\"\n matTooltip=\"Exportar\"\n aria-label=\"Exportar\"\n [matMenuTriggerFor]=\"menuHerramientas\"\n type=\"button\">\n <mat-icon svgIcon=\"jvs_tabla:exportar\" class=\"icon-xs\"></mat-icon>\n <span class=\"text-[9px] leading-none ml-px\" aria-hidden=\"true\">\u25BE</span>\n </button>\n <mat-menu #menuHerramientas=\"matMenu\" xPosition=\"before\" yPosition=\"below\">\n @for (btn of botonesHerramientasVisibles; track btn) {\n <ng-container *ngTemplateOutlet=\"botonesContextual; context:{btn: btn, item: objSeleccionado, barraSuperior: false}\"></ng-container>\n }\n </mat-menu>\n } @else {\n @for (seg of segmentosBotones(botonesHerramientasVisibles); track $index) {\n @if (seg.grupo) {\n <ng-container *ngTemplateOutlet=\"grupoSegmentado; context:{botones: seg.botones, soloIcono: true, margen: seg.margen}\"></ng-container>\n } @else {\n @let btn = seg.botones[0];\n @if (btn.subItems && btn.subItems.length > 0) {\n <button matRipple\n class=\"flex items-center justify-center text-2xs leading-none rounded-full p-1 jvs-boton-herramienta\"\n [class]=\"claseHerramienta(btn)\"\n [matTooltip]=\"tooltipBoton(btn)\"\n [attr.aria-label]=\"tooltipBoton(btn)\"\n [matMenuTriggerFor]=\"menuHerramienta.menu\"\n type=\"button\">\n <mat-icon [svgIcon]=\"iconoHerramienta(btn)\" class=\"icon-xs\"></mat-icon>\n </button>\n <jvs-tabla-mantenimiento-menu #menuHerramienta\n [nombreColeccion]=\"nombreColeccion\"\n [item]=\"objSeleccionado\"\n [derechosActuales]=\"derechosActuales\"\n [subItems]=\"btn.subItems\"\n (opcionSelecionada)=\"opcMenu($event.item, $event.btn)\"\n [botonTemplate]=\"botonesContextual\"\n >\n </jvs-tabla-mantenimiento-menu>\n } @else {\n <span class=\"jvs-boton-envoltura inline-flex [&>button:disabled]:pointer-events-none\"\n [ngClass]=\"seg.margen\"\n [matTooltip]=\"motivoDeshabilitado(btn, objSeleccionado) || tooltipBoton(btn)\"\n [matTooltipDisabled]=\"!estaBotonDeshabilitado(btn, objSeleccionado)\">\n <button matRipple\n class=\"flex items-center justify-center text-2xs leading-none rounded-full p-1 jvs-boton-herramienta disabled:opacity-50\"\n [class]=\"claseHerramienta(btn)\"\n [disabled]=\"estaBotonDeshabilitado(btn, objSeleccionado)\"\n [matTooltip]=\"tooltipBoton(btn)\"\n [matTooltipDisabled]=\"estaBotonDeshabilitado(btn, objSeleccionado)\"\n [attr.aria-label]=\"tooltipBoton(btn)\"\n (click)=\"opcMenu(objSeleccionado, $any(btn))\"\n type=\"button\">\n <mat-icon [svgIcon]=\"iconoHerramienta(btn)\" class=\"icon-xs\"></mat-icon>\n </button>\n </span>\n }\n }\n }\n }\n\n @if (isRecargarUsed || busquedaTipo() == 'query') {\n <button matRipple\n class=\"flex items-center justify-center text-2xs leading-none rounded-full p-1 text-green-700\"\n matTooltip=\"Actualizar datos\"\n (click)=\"(busquedaTipo() == 'query' ? cargarData() : emitirAccionRecargar())\"\n type=\"button\">\n <mat-icon svgIcon=\"roundRefresh\" class=\"icon-xs\"></mat-icon>\n </button>\n }\n @if (mostrarBotonOrden()) {\n <button matRipple\n class=\"flex items-center justify-center text-2xs leading-none rounded-full p-1 text-blue-700\"\n [matTooltip]=\"bDireccionOrden() === 0 ? 'Orden Ascendente' : 'Orden Descendente'\"\n (click)=\"toggleDireccionOrden()\"\n type=\"button\">\n <mat-icon [svgIcon]=\"bDireccionOrden() === 0 ? 'roundArrowUpward' : 'roundArrowDownward'\" class=\"icon-xs\"></mat-icon>\n </button>\n }\n @if (filtroCampos) {\n <!-- Con columnas ocultas por falta de espacio, \"+N\" y el tooltip dice cu\u00E1les. -->\n <button matRipple [matMenuTriggerFor]=\"columnFilterMenu\"\n class=\"flex items-center justify-center text-2xs leading-none rounded-full p-1\"\n [matTooltip]=\"tooltipColumnas()\"\n type=\"button\">\n <mat-icon svgIcon=\"roundFilterList\" class=\"icon-xs\"></mat-icon>\n @if (columnasOcultasPorEspacio().size > 0) {\n <span class=\"ml-px font-bold text-primary\">+{{ columnasOcultasPorEspacio().size }}</span>\n }\n </button>\n }\n </div>\n </div>\n\n @if ((botonesMenuFinal.secundario ?? []).length > 0) {\n <div class=\"flex-1 bg-app-bar flex items-center justify-between p-1 border-t\">\n <div class=\"flex flex-1 items-center flex-wrap gap-1 min-w-0\">\n <div class=\" flex items-center flex-wrap contenedor-botones\">\n @for (seg of segmentosBotones(botonesMenuFinal.secundario); track $index) {\n @if (seg.grupo) {\n <ng-container *ngTemplateOutlet=\"grupoSegmentado; context:{botones: seg.botones, soloIcono: false, margen: seg.margen}\"></ng-container>\n } @else {\n <ng-container *ngTemplateOutlet=\"botonesSuperiores; context:{btn: seg.botones[0], margen: seg.margen, idx: {inicio: $index, fin: botonesMenuFinal.secundario?.length}}\"></ng-container>\n }\n }\n </div>\n </div>\n </div>\n }\n <!--<div class=\"grow flex flex-col items-stretch contenedor-tabla\" [ngClass]=\"{'table-container overflow-auto': esTabla}\">\n <pre>{{ this.chkLista.modelosChk | json }}</pre>\n <pre>{{ this.chkLista.checkbox.cantidadActivos | json }}</pre>\n <pre>{{ this.chkLista.checkbox.algunosActivos | json }}</pre>\n</div>-->\n<!-- Barra de carga entre la banda y la cabecera. Solo si la pantalla usa `cargando`: el hueco\n de 4 px queda reservado para que la tabla no salte al aparecer y desaparecer. -->\n@if (cargando() !== undefined) {\n <div class=\"jvs-tabla-cargando h-1 shrink-0\" role=\"status\" [attr.aria-busy]=\"cargando()\">\n @if (cargando()) {\n <mat-progress-bar mode=\"indeterminate\" aria-label=\"Cargando datos\"></mat-progress-bar>\n }\n </div>\n}\n<div #contenedorTabla class=\"grow flex flex-col items-stretch contenedor-tabla\" [ngClass]=\"{'table-container overflow-auto': esTabla}\">\n <ng-content select=\"[cuerpo]\"></ng-content>\n\n <table [id]=\"'tabla_' + nombreColeccion\" [dataSource]=\"dataSource\" [multiTemplateDataRows]=\"true\"\n [hidden]=\"!esTabla\"\n class=\"table-mantenimiento table-auto h-fit\" mat-table matSort\n [ngClass]=\"alinearCabecerasConContenido() ? clasesCabecerasConContenido : ''\"\n [trackBy]=\"trackByFn\"\n #tablaMantenimiento\n >\n\n <!--<table [dataSource]=\"dataSource\" class=\"table-mantenimiento table-auto h-auto w-full justify-center\" mat-table matSort>-->\n\n\n <ng-content select=\"[tableDefinitions]\"></ng-content>\n <ng-container matColumnDef=\"numeracion_automatica\">\n <th mat-header-cell *matHeaderCellDef style=\"width: 16px !important\">N\u00BA</th>\n <td mat-cell *matCellDef=\"let element; let i = dataIndex\" class=\"p-0 celda-numeracion-fila\">\n <div class=\"flex items-center justify-center numeracionFila font-normal text-[var(--tabla-mantenimiento-numeracion-texto)] [.elemento-seleccionado_&]:text-inherit [.elemento-anulado_&]:text-inherit\">\n @if (esTabla && paginador) {\n {{ (this.paginator?.pageIndex == 0 ? i + 1 : 1 + i + (this.paginator?.pageIndex ?? 1) * (this.paginator?.pageSize ?? 1)) }}\n }\n @if (!paginador) {\n {{ (i + 1) }}\n }\n </div>\n </td>\n <td mat-footer-cell *matFooterCellDef class=\"uppercase\"></td>\n </ng-container>\n <jvs-tabla-mantenimiento-column-defs [colDetalle]=\"columnasParaDefinir\" [estaExpandida]=\"estaExpandidaFn\" (alternarExpansion)=\"alternarExpansion($event)\"\n [nombreColeccion]=\"nombreColeccion\" [(chkLista)]=\"chkLista\"></jvs-tabla-mantenimiento-column-defs>\n\n <tr *matHeaderRowDef=\"visibleColumns; sticky: true\" mat-header-row class=\"title\" matHeader\n ></tr>\n\n @if (!!filaExtraHeader) {\n <tr mat-row *matRowDef=\"let row; columns: ['filaExtraHeader']\" class=\"student-detail-row\"\n [style.height.px]=\"0\"\n ></tr>\n <ng-container matColumnDef=\"filaExtraHeader\">\n <td mat-cell *matCellDef=\"let row; let i = dataIndex\" [attr.colspan]=\"visibleColumns.length\">\n <div class=\"row m-0 student-element-detail\"\n [@detailExpand]=\"(i == 0 && filaExtraHeader.esVisible && filaExtraHeader.esVisible()) ? 'expanded' : 'collapsed'\"\n [style.padding-right.px]=\"estaExpandida(row) ? 5 : 0\"\n [style.padding-left.px]=\"estaExpandida(row) ? 5 : 0\"\n >\n @if (filaExtraHeader.template) {\n <ng-container\n [ngTemplateOutlet]=\"filaExtraHeader.template\"\n [ngTemplateOutletContext]=\"{ row: row }\"></ng-container>\n }\n </div>\n </td>\n </ng-container>\n }\n @if (filaFooter) {\n <tr *matFooterRowDef=\"visibleColumns\" mat-footer-row\n [style.height.px]=\"0\"\n [id]=\"nombreColeccion + '_filaFooter'\"\n ></tr>\n }\n\n <!--\t<tr\n *matRowDef=\"let row; columns: visibleColumns;\"\n class=\"hover:bg-secondary trans-ease-out cursor-pointer\"\n mat-row></tr>-->\n <tr\n [matRowKeyboardSelection]=\"tablaMantenimiento\"\n [rowModel]=\"row\"\n (seleccionarSiguiente)=\"opcMenu($event, {seccion: nombreColeccion, tipo: 'ver'});\"\n (filaEnfocada)=\"seleccionarFilaPorId($event)\"\n (espacioEnFila)=\"teclaEspacioEnFila($event)\"\n\n *matRowDef=\"let row; let idxTabla = dataIndex; columns: visibleColumns;\"\n (click)=\"clicFila(row, idxTabla, $event)\"\n (dblclick)=\"dobleClicFila(row)\"\n (contextmenu)=\"(abrirMenuContextual($event, row)); $event. preventDefault();\"\n [ngClass]=\"classFila(row)\"\n @fadeInUp\n [@.disabled]=\"!animarFilas()\"\n class=\"trans-ease-out cursor-pointer h-auto\"\n [style.height.px]=\"0\"\n [id]=\"propiedadSeleccion(row)\"\n [matTooltip]=\"procesarRowTooltip(row)\"\n matTooltipPosition=\"below\"\n [matTooltipPositionAtOrigin]=\"true\"\n [matTooltipClass]=\"['bg-red-700', 'text-red-100', 'm-0']\"\n [matTooltipDisabled]=\"!procesarRowTooltip(row)\"\n [class.regAnulado]=\"row[campoAnulado] == 1\"\n [class.regTooltip]=\"!!procesarRowTooltip(row)\"\n (keyup.delete)=\"teclaEliminarEnFila(row, $event)\"\n mat-row></tr>\n @if (filaExtraTemplate) {\n <tr mat-row *matRowDef=\"let row; columns: ['expandedDetail']\" class=\"student-detail-row h-0\"></tr>\n <ng-container matColumnDef=\"expandedDetail\">\n <td mat-cell *matCellDef=\"let row\" [attr.colspan]=\"visibleColumns.length\">\n <div class=\"row m-0 student-element-detail\"\n [@detailExpand]=\"estaExpandida(row) ? 'expanded' : 'collapsed'\"\n [style.padding-right.px]=\"estaExpandida(row) ? 5 : 0\"\n [style.padding-left.px]=\"estaExpandida(row) ? 5 : 0\"\n >\n <ng-container [ngTemplateOutlet]=\"filaExtraTemplate\"\n [ngTemplateOutletContext]=\"{ row: row }\"></ng-container>\n </div>\n </td>\n </ng-container>\n }\n</table>\n\n@if (componenteCargadoTotalmente && !cargando()) {\n @if ((noData | async) && esTabla) {\n <div class=\"jvs-tabla-sin-datos flex-1 text-center text-secondary font-medium\" role=\"status\">\n @if (textoBuscado) {\n Ning\u00FAn registro coincide con \"{{ textoBuscado }}\".\n <button type=\"button\" class=\"ml-1 underline text-primary\" (click)=\"limpiarBusqueda()\">Limpiar b\u00FAsqueda</button>\n } @else {\n No se encontraron datos\n }\n </div>\n }\n}\n</div>\n<ng-content select=\"[appendTable]\"></ng-content>\n<div class=\"flex-none bg-app-bar flex items-start justify-between p-1\" [ngClass]=\"tramoBanda() === 'angosta' ? 'flex-col' : 'flex-row'\">\n <div class=\"flex-1 flex items-start flex-wrap gap-1\">\n\n @if (botonesInferior.length > 0) {\n <div class=\"flex items-center contenedor-botones\">\n @for (seg of segmentosBotones(botonesInferior); track $index) {\n @if (seg.grupo) {\n <ng-container *ngTemplateOutlet=\"grupoSegmentado; context:{botones: seg.botones, soloIcono: false, margen: seg.margen}\"></ng-container>\n } @else {\n <ng-container *ngTemplateOutlet=\"botonesSuperiores; context:{btn: seg.botones[0], margen: seg.margen, idx: {inicio: $index, fin: botonesInferior.length}}\"></ng-container>\n }\n }\n </div>\n }\n <!--<div *ngIf=\"(botonesMenuFinal.inferior ?? []).length > 0\" class=\" flex items-center flex-wrap\">\n <ng-container *ngFor=\"let btn of botonesMenuFinal.inferior; let idx = index;\">\n <ng-container *ngTemplateOutlet=\"botonesSuperiores; context:{btn: btn, idx: {inicio: idx, fin: botonesMenuFinal.inferior?.length}}\"></ng-container>\n </ng-container>\n </div>-->\n</div>\n\n@if (esTabla && paginador) {\n <div class=\"flex items-center justify-end\" [ngClass]=\"tramoBanda() === 'angosta' ? 'flex-1' : 'flex-none'\">\n <mat-paginator class=\"tabla-mantenimiento-paginador\" [pageSizeOptions]=\"paginacion.pageSizeOptions\" [pageIndex]=\"paginacion.pageIndex - 1\" [length]=\"paginacion.pageLength\" [pageSize]=\"paginacion.pageSize\" (page)=\"paginacion.pageCurrent = $event; emitirResultados();\" ></mat-paginator>\n </div>\n}\n</div>\n</div>\n\n</div>\n\n\n\n<!-- SECCION DE TEMPLATES O MENUS -->\n\n\n<!-- Men\u00FA de columnas: una por l\u00EDnea (antes las casillas iban en l\u00EDnea y se amontonaban). -->\n<mat-menu #columnFilterMenu=\"matMenu\" xPosition=\"before\" yPosition=\"below\"\n class=\"[&_.mat-mdc-menu-content]:flex [&_.mat-mdc-menu-content]:flex-col [&_.mat-mdc-menu-content]:items-stretch [&_.mat-mdc-menu-content]:!py-1\">\n @for (column of columnasTabla; track column) {\n @if (esColumnaEnLista(column)) {\n <button (click)=\"toggleColumnVisibility(column, $event)\" type=\"button\"\n class=\"checkbox-item mat-menu-item flex items-center w-full min-h-[24px] pl-1 pr-3 border-0 bg-transparent text-left cursor-pointer hover:bg-black/[.04] [&_.mat-mdc-checkbox]:w-full [&_.mdc-label]:!text-[12px] [&_.mdc-label]:whitespace-nowrap\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" [ngModel]=\"esColumnaVisible(column)\" (ngModelChange)=\"elegirVisibilidadColumna(column, $event)\" [ngModelOptions]=\"{standalone: true}\" color=\"primary\">\n <span [innerHTML]=\"(column.labelLista ?? column.label).replace('<br>', ' ')\"></span>\n @if (ocultaPorEspacio(column)) {\n <span class=\"ml-1 text-gray-500\">(sin espacio)</span>\n }\n </mat-checkbox>\n </button>\n }\n }\n</mat-menu>\n\n\n\n\n\n\n<!-- Control segmentado: botones consecutivos con el mismo `grupo`. Un borde com\u00FAn, divisores\n finos, el `activo` relleno y el badge como texto dentro del bot\u00F3n. Cada opci\u00F3n conserva su\n tooltip, deshabilitado, derechos y evento, igual que un bot\u00F3n suelto. -->\n<ng-template #grupoSegmentado let-botones=\"botones\" let-soloIcono=\"soloIcono\" let-margen=\"margen\">\n <!-- Colores del acento de la tabla (est\u00E1ndar o tema, seg\u00FAn `coloresTema`): activo relleno, el resto en tono claro. Borde com\u00FAn con\n sombra interior (no suma alto); `!rounded-[4px]` vence al redondeo de un solo lado que la\n barra pone al primer y \u00FAltimo elemento de cada `contenedor-botones`. -->\n <div class=\"jvs-segmentado inline-flex items-stretch flex-none max-w-full overflow-x-auto overflow-y-hidden !rounded-[4px] shadow-[inset_0_0_0_1px_rgba(var(--tabla-mantenimiento-acento),0.4)] bg-[rgba(var(--tabla-mantenimiento-acento),0.1)] [scrollbar-width:thin]\"\n [ngClass]=\"margen\" role=\"group\">\n @for (btn of botones; track btn; let primero = $first) {\n <span class=\"inline-flex [&>button:disabled]:pointer-events-none\"\n [matTooltip]=\"motivoDeshabilitado(btn, objSeleccionado) || tooltipBoton(btn)\"\n [matTooltipDisabled]=\"!estaBotonDeshabilitado(btn, objSeleccionado)\">\n <button type=\"button\" matRipple\n class=\"jvs-segmento flex items-center uppercase text-2xs leading-none px-2 py-1 border-0 border-solid border-[rgba(var(--tabla-mantenimiento-acento),0.4)] rounded-none bg-transparent text-[rgb(var(--tabla-mantenimiento-acento))] cursor-pointer whitespace-nowrap enabled:hover:bg-[rgba(var(--tabla-mantenimiento-acento),0.2)] disabled:opacity-50 disabled:cursor-default\"\n [class.border-l]=\"!primero\"\n [ngClass]=\"{'!bg-[rgb(var(--tabla-mantenimiento-acento))] !text-[rgb(var(--tabla-mantenimiento-acento-contraste))]': esBotonActivo(btn, objSeleccionado) === true}\"\n [attr.aria-pressed]=\"esBotonActivo(btn, objSeleccionado)\"\n [disabled]=\"estaBotonDeshabilitado(btn, objSeleccionado)\"\n [matTooltip]=\"tooltipBoton(btn)\"\n [matTooltipDisabled]=\"estaBotonDeshabilitado(btn, objSeleccionado)\"\n [attr.aria-label]=\"soloIcono ? tooltipBoton(btn) : null\"\n (click)=\"opcMenu(objSeleccionado, $any(btn))\">\n @if (btn.icono || soloIcono) {\n <mat-icon class=\"icon-xs\" [class.mr-0.5]=\"!soloIcono\" [svgIcon]=\"soloIcono ? iconoHerramienta(btn) : btn.icono\"></mat-icon>\n }\n @if (!soloIcono) {\n <span class=\"whitespace-nowrap\">{{ etiquetaBoton(btn) }}</span>\n @if (btn.badge !== undefined && btn.badge !== null && btn.badge !== '') {\n <span class=\"jvs-segmento-badge ml-1 text-[9px] font-normal opacity-70\"\n [class.opacity-90]=\"esBotonActivo(btn, objSeleccionado) === true\">{{ btn.badge }}</span>\n }\n }\n </button>\n </span>\n }\n </div>\n</ng-template>\n\n<ng-template #botonesSuperiores let-btn=\"btn\" let-idx=\"idx\" let-margen=\"margen\">\n <ng-container *ngTemplateOutlet=\"botonesContextual; context:{btn: btn, item: objSeleccionado, barraSuperior: true, idx: idx, margen: margen}\"></ng-container>\n</ng-template>\n\n<ng-template #botonesContextual let-btn=\"btn\" let-item=\"item\" let-barraSuperior=\"barraSuperior\" let-idx=\"idx\" let-margen=\"margen\">\n\n @if (barraSuperior) {\n <!--\t\t<button mat-button style=\"min-width: unset; border: 1px !important;\" class=\"uppercase border border-gray rounded-none h-full px-1 disabled:opacity-50 disabled:text-secondary disabled:bg-transparent\">-->\n <!--\t\t\t<mat-icon *ngIf=\"btn.icono\" [svgIcon]=\"btn.icono\" size=\"15px\" class=\"icon-xs\"></mat-icon>-->\n <!--\t\t</button>-->\n @if (btn.subItems && btn.subItems.length > 0) {\n @if ((!btn.esVisible || btn.esVisible(item, this)) && subItemsActivos(btn, item)) {\n <button class=\"flex items-center justify-between uppercase text-2xs leading-none rounded-none px-2 py-1 bg-opacity-95 hover:bg-opacity-100 disabled:opacity-50 disabled:text-secondary disabled:!bg-gray-300 dark:disabled:!bg-gray-500 mat-elevation-z2\" type=\"button\"\n [class]=\"(btn.class?btn.class:'')\"\n [ngClass]=\"margen ?? ''\"\n (click)=\"opcMenu(item, btn)\"\n [style.min-width]=\"((btn.soloIcono ?? tipoValorFuncion(soloIconos)) ? 'unset' : '')\"\n [matTooltip]=\"btn.tooltip || (btn.label ? btn.label : ( (derechosActuales && derechosActuales[btn.cDerechoCodigo ?? btn.tipo]) ? derechosActuales[btn.cDerechoCodigo ?? btn.tipo]['cDerechoNombre'] : capitalizarTexto(btn.tipo))) \"\n [matMenuTriggerFor]=\"menuOtrosBarra.menu\"\n [matBadge]=\"btn.badge\"\n [matBadgeDescription]=\"descripcionContador(btn)\"\n matBadgeSize=\"small\"\n >\n @if (btn.icono) {\n <mat-icon class=\"icon-xs\" [class.mr-0.5]=\"!(btn.soloIcono ?? tipoValorFuncion(soloIconos))\" [svgIcon]=\"btn.icono\" ></mat-icon>\n }\n @if (!(btn.soloIcono ?? tipoValorFuncion(soloIconos))) {\n <span class=\"whitespace-nowrap\">{{ btn.label ? btn.label : ( (derechosActuales && derechosActuales[btn.cDerechoCodigo ?? btn.tipo]) ? derechosActuales[btn.cDerechoCodigo ?? btn.tipo]['cDerechoNombre'] : capitalizarTexto(btn.tipo)) }}</span>\n }\n <mat-icon class=\"icon-xs\" svgIcon=\"fa5sCaretDown\" ></mat-icon>\n </button>\n }\n <jvs-tabla-mantenimiento-menu #menuOtrosBarra\n [nombreColeccion]=\"nombreColeccion\"\n [item]=\"item\"\n [derechosActuales]=\"derechosActuales\"\n [subItems]=\"btn.subItems\"\n (opcionSelecionada)=\"opcMenu($event.item, $event.btn)\"\n [botonTemplate]=\"botonesContextual\"\n >\n </jvs-tabla-mantenimiento-menu>\n }\n @if (!btn.subItems || btn.subItems.length == 0) {\n @if (!btn.esVisible || btn.esVisible(item, this)) {\n <!-- La envoltura muestra el motivo cuando el bot\u00F3n est\u00E1 deshabilitado: un bot\u00F3n\n deshabilitado no recibe el cursor y su propio tooltip nunca aparece. -->\n <span class=\"jvs-boton-envoltura inline-flex [&>button:disabled]:pointer-events-none [&:first-child>button]:rounded-l [&:last-child>button]:rounded-r\"\n [ngClass]=\"margen ?? ''\"\n [matTooltip]=\"motivoDeshabilitado(btn, item) || tooltipBoton(btn)\"\n [matTooltipDisabled]=\"!estaBotonDeshabilitado(btn, item)\"\n >\n <button class=\"flex items-center justify-between uppercase text-2xs leading-none rounded-none px-2 py-1 bg-opacity-95 hover:bg-opacity-100 disabled:opacity-50 disabled:text-secondary disabled:!bg-gray-300 dark:disabled:!bg-gray-500 mat-elevation-z2\" type=\"button\"\n [class]=\"claseBotonBarra(btn, item)\"\n [ngClass]=\"{'text-secondary italic': !ignorarDerechos && !btn.esIndependiente && (!btn.ignorarDerecho && (!derechosActuales || !derechosActuales[btn.cDerechoCodigo ?? btn.tipo])) && !(['nuevo', 'editar', 'eliminar'].includes(btn.tipo))}\"\n [attr.aria-pressed]=\"esBotonActivo(btn, item)\"\n [disabled]=\"estaBotonDeshabilitado(btn, item)\"\n (click)=\"opcMenu(item, btn)\"\n [style.min-width]=\"((btn.soloIcono ?? tipoValorFuncion(soloIconos)) ? 'unset' : '')\"\n [matTooltip]=\"tooltipBoton(btn)\"\n [matTooltipDisabled]=\"estaBotonDeshabilitado(btn, item)\"\n [matBadge]=\"btn.badge\"\n [matBadgeDescription]=\"descripcionContador(btn)\"\n matBadgeSize=\"small\"\n >\n @if (btn.icono) {\n <mat-icon class=\"icon-xs\" [class.mr-0.5]=\"!(btn.soloIcono ?? tipoValorFuncion(soloIconos))\" [svgIcon]=\"btn.icono\"></mat-icon>\n }\n @if (!(btn.soloIcono ?? tipoValorFuncion(soloIconos))) {\n <span class=\"whitespace-nowrap\">{{ etiquetaBoton(btn) }}</span>\n }\n </button>\n </span>\n }\n }\n} @else {\n @if (btn.subItems && btn.subItems.length > 0) {\n @if (!btn.noContextual && (!btn.esVisible || btn.esVisible(item, this))) {\n <button class=\"flex items-center justify-between uppercase w-full rounded-none px-2 disabled:opacity-50 disabled:text-secondary disabled:bg-transparent\" mat-menu-item type=\"button\"\n [class]=\"(btn.class?btn.class.replace('text-white', '').replace('bg', 'text'):'text-secondary')\"\n [ngClass]=\"{'text-secondary italic': !ignorarDerechos && !btn.esIndependiente && (!btn.ignorarDerecho && (!derechosActuales || !derechosActuales[btn.cDerechoCodigo ?? btn.tipo]))}\"\n [disabled]=\"!btn.esIndependiente && botonDisabled(btn, item)\"\n (click)=\"opcMenu(item, btn); $event.stopPropagation();\"\n [matMenuTriggerFor]=\"menuOtrosBarra.menu\"\n >\n <div class=\"flex w-full items-center justify-between uppercase text-2xs\"\n >\n @if (btn.icono) {\n <mat-icon [svgIcon]=\"btn.icono\"\n class=\"flex-none icon-xs\"\n ></mat-icon>\n }\n <span class=\"grow text-2xs\">{{ btn.label ? btn.label : ( (derechosActuales && derechosActuales[btn.cDerechoCodigo ?? btn.tipo]) ? derechosActuales[btn.cDerechoCodigo ?? btn.tipo]['cDerechoNombre'] : capitalizarTexto(btn.tipo)) }}</span>\n <mat-icon class=\"flex-none icon-xs\" svgIcon=\"fa5sCaretRight\"></mat-icon>\n </div>\n </button>\n }\n <jvs-tabla-mantenimiento-menu #menuOtrosBarra\n [nombreColeccion]=\"nombreColeccion\"\n [item]=\"item\"\n [derechosActuales]=\"derechosActuales\"\n [subItems]=\"btn.subItems\"\n (opcionSelecionada)=\"opcMenu($event.item, $event.btn)\"\n [botonTemplate]=\"botonesContextual\"\n >\n </jvs-tabla-mantenimiento-menu>\n }\n @if (!btn.subItems || btn.subItems.length == 0) {\n @if (btn.tipo == '-#SEPARADOR#-') {\n <mat-divider></mat-divider>\n } @else {\n @if (!btn.noContextual && (!btn.esVisible || btn.esVisible(item, this))) {\n <span class=\"block w-full self-stretch [&>button:disabled]:pointer-events-none\"\n [matTooltip]=\"motivoDeshabilitado(btn, item)\"\n matTooltipPosition=\"left\"\n [matTooltipDisabled]=\"!motivoDeshabilitado(btn, item)\"\n >\n <button class=\"flex items-center justify-between uppercase w-full rounded-none px-2 disabled:opacity-50 disabled:text-secondary disabled:bg-transparent\" mat-menu-item type=\"button\"\n [class]=\"claseItemMenu(btn, item)\"\n [ngClass]=\"{'text-secondary italic': !ignorarDerechos && !btn.esIndependiente && (!btn.ignorarDerecho && (!derechosActuales || !derechosActuales[btn.cDerechoCodigo ?? btn.tipo]))}\"\n [attr.aria-pressed]=\"esBotonActivo(btn, item)\"\n [disabled]=\"estaBotonDeshabilitado(btn, item)\"\n (click)=\"opcMenu(item, btn)\"\n >\n <div class=\"flex w-full items-center justify-between uppercase text-2xs\">\n @if (btn.icono) {\n <mat-icon [svgIcon]=\"btn.icono\" class=\"flex-none icon-xs\"\n ></mat-icon>\n }\n <span class=\"grow text-2xs\">{{ etiquetaBoton(btn) }}</span>\n </div>\n </button>\n </span>\n }\n }\n }\n}\n\n</ng-template>\n\n<ng-template #userMenu let-item=\"item\">\n <div class=\"mat-menu bg-white rounded mat-elevation-z8 shadow botonesContextual\">\n @for (btn of listaMenuCompleto; track btn) {\n <ng-container *ngTemplateOutlet=\"botonesContextual; context:{btn: btn, item: objSeleccionado, barraSuperior: false}\"></ng-container>\n }\n </div>\n</ng-template>\n\n\n<mat-menu #menuOpciones=\"matMenu\" xPosition=\"before\" yPosition=\"below\">\n @for (btn of listaMenuMovil; track btn) {\n <ng-container\n *ngTemplateOutlet=\"botonesContextual; context:{btn: btn, item: objSeleccionado, barraSuperior: false}\"></ng-container>\n }\n</mat-menu>\n\n", styles: ["@charset \"UTF-8\";:root{--tabla-mantenimiento-seleccion-fondo: rgb(179, 217, 252);--tabla-mantenimiento-seleccion-texto: rgb(1, 84, 164);--tabla-mantenimiento-acento: 1, 84, 164;--tabla-mantenimiento-acento-contraste: 255, 255, 255;--mat-paginator-container-size: 30px;--tabla-mantenimiento-numeracion-texto: rgb(107, 114, 128)}:root .table-mantenimiento .elemento-seleccionado{background-color:var(--tabla-mantenimiento-seleccion-fondo)!important;color:var(--tabla-mantenimiento-seleccion-texto)!important;border-color:var(--tabla-mantenimiento-seleccion-texto)!important}.jvs-tabla-mantenimiento{width:inherit;display:flex;flex-direction:column}.jvs-tabla-mantenimiento .contenedor-botones>*:first-child{@apply rounded-l;}.jvs-tabla-mantenimiento .contenedor-botones>*:last-child{@apply rounded-r;}.jvs-tabla-mantenimiento .contenedor-botones button[aria-pressed] .mat-badge-content{background-color:rgb(var(--tabla-mantenimiento-acento))!important;color:rgb(var(--tabla-mantenimiento-acento-contraste))!important;box-shadow:0 0 0 1px #fff}.jvs-tabla-mantenimiento tr.regTooltip>td:first-child div:first-child:before,.jvs-tabla-mantenimiento tr.regTooltip>th:first-child div:first-child:before{content:\"\\26a0\\fe0f \";color:red;margin-right:4px;font-size:12px}.jvs-tabla-mantenimiento tr.regTooltip>td:first-child:not(:has(div)):before,.jvs-tabla-mantenimiento tr.regTooltip>th:first-child:not(:has(div)):before{content:\"\\26a0\\fe0f \";color:red;margin-right:4px;font-size:12px}.jvs-tabla-mantenimiento .mat-mdc-menu-content:not(:empty){@apply flex flex-col items-start;padding:0!important}.jvs-tabla-mantenimiento .mat-mdc-menu-item{line-height:24px!important;height:24px!important;min-height:24px!important}.jvs-tabla-mantenimiento .mat-mdc-menu-panel{min-height:auto!important}.jvs-tabla-mantenimiento .mat-mdc-table .mat-mdc-cell,.jvs-tabla-mantenimiento .mat-mdc-table .mat-mdc-header-cell .mat-mdc-footer-cell{white-space:unset}.jvs-tabla-mantenimiento .table-mantenimiento .mat-mdc-table-sticky-border-elem-right{border-left:1px solid #e0e0e0}.jvs-tabla-mantenimiento .table-mantenimiento .mat-mdc-table-sticky-border-elem-left{border-right:1px solid #e0e0e0}.jvs-tabla-mantenimiento .table-mantenimiento tr.regAnulado .mat-mdc-cell{color:unset!important}.jvs-tabla-mantenimiento .table-mantenimiento .bg-primary-activo .numeracionFila{@apply rounded-full bg-primary-contrast text-primary mx-1 p-1 w-6 h-6;}.jvs-tabla-mantenimiento .table-mantenimiento th .form-input{@apply w-auto;}.jvs-tabla-mantenimiento .table-mantenimiento th.mat-mdc-header-cell:not(.celda-numeracion-fila),.jvs-tabla-mantenimiento .table-mantenimiento td.mat-mdc-cell:not(.celda-numeracion-fila),.jvs-tabla-mantenimiento .table-mantenimiento td.mat-mdc-footer-cell:not(.celda-numeracion-fila){padding:.05rem .25rem}.jvs-tabla-mantenimiento .table-mantenimiento th.mat-mdc-header-cell,.jvs-tabla-mantenimiento .table-mantenimiento td.mat-mdc-cell,.jvs-tabla-mantenimiento .table-mantenimiento td.mat-mdc-footer-cell{border-width:1px;border-style:solid}.jvs-tabla-mantenimiento .table-mantenimiento th.mat-mdc-header-cell:first-of-type:not(.celda-numeracion-fila),.jvs-tabla-mantenimiento .table-mantenimiento th.mat-mdc-header-cell:last-of-type:not(.celda-numeracion-fila),.jvs-tabla-mantenimiento .table-mantenimiento td.mat-mdc-cell:first-of-type:not(.celda-numeracion-fila),.jvs-tabla-mantenimiento .table-mantenimiento td.mat-mdc-cell:last-of-type:not(.celda-numeracion-fila),.jvs-tabla-mantenimiento .table-mantenimiento td.mat-mdc-footer-cell:first-of-type:not(.celda-numeracion-fila),.jvs-tabla-mantenimiento .table-mantenimiento td.mat-mdc-footer-cell:last-of-type:not(.celda-numeracion-fila){padding:0 .25rem}.jvs-tabla-mantenimiento .table-mantenimiento .student-element-detail{overflow:hidden;display:flex;align-items:center;justify-content:center}.jvs-tabla-mantenimiento .table-mantenimiento .mat-mdc-header-row{height:25px!important;color:rgb(var(--color-primary))!important;background-color:rgb(var(--color-primary-contrast))!important}.jvs-tabla-mantenimiento .table-mantenimiento .mat-mdc-header-cell{padding:5px;font-size:10px;line-height:10px;font-weight:700!important;color:inherit}.jvs-tabla-mantenimiento .table-mantenimiento .mdc-data-table__row:not(.mdc-data-table__row--selected):not(.elemento-seleccionado):hover,.jvs-tabla-mantenimiento .table-mantenimiento .mdc-data-table__row:not(.mdc-data-table__row--selected):not(.elemento-seleccionado):focus{background-color:rgba(var(--color-primary-contrast),.04)}.jvs-tabla-mantenimiento .table-mantenimiento .mat-mdc-row .mat-mdc-cell,.jvs-tabla-mantenimiento .table-mantenimiento .mat-mdc-footer-row .mat-mdc-cell{font-size:10px}.jvs-tabla-mantenimiento .table-mantenimiento .mat-mdc-row .mat-mdc-footer-cell:empty,.jvs-tabla-mantenimiento .table-mantenimiento .mat-mdc-footer-row .mat-mdc-footer-cell:empty{border-width:0!important}.jvs-tabla-mantenimiento .table-mantenimiento .mat-mdc-cell{@apply leading-tight;}.jvs-tabla-mantenimiento .table-mantenimiento th.mat-mdc-header-cell{border-color:#d4d0d0;@apply text-center uppercase;}.jvs-tabla-mantenimiento .table-mantenimiento th.mat-mdc-header-cell .mat-sort-header-container{@apply flex items-center justify-between w-full;}.jvs-tabla-mantenimiento .table-mantenimiento th.mat-mdc-header-cell .mat-sort-header-container .mat-sort-header-content{@apply inline w-full text-center;}.jvs-tabla-mantenimiento .table-mantenimiento th.mat-mdc-header-cell .mat-sort-header-container .mat-sort-header-arrow{@apply flex-none;}.jvs-tabla-mantenimiento .table-mantenimiento .mat-mdc-sort-header-content{width:100%;text-align:center;display:unset;align-items:center}.compact-search-menu{min-width:200px!important;overflow:hidden}.compact-search-menu input:focus{@apply border-primary;}.jvs-tabla-mantenimiento.jvs-colores-tema{--tabla-mantenimiento-acento: var(--color-primary);--tabla-mantenimiento-acento-contraste: var(--color-primary-contrast);--tabla-mantenimiento-seleccion-fondo: rgba(var(--color-primary), .15);--tabla-mantenimiento-seleccion-texto: rgb(var(--color-primary))}\n"] }]
3942
+ }], ctorParameters: () => [{ type: i1$3.Overlay }, { type: i0.ViewContainerRef }, { type: TablaMantenimientoService }, { type: i0.ChangeDetectorRef }], propDecorators: { id: [{
1737
3943
  type: HostBinding
1738
3944
  }], dataSuscription: [{
1739
3945
  type: Input
1740
3946
  }], objThis: [{
1741
- type: Input,
1742
- args: [{ required: true }]
3947
+ type: Input
1743
3948
  }], nombreColeccion: [{
1744
3949
  type: Input,
1745
3950
  args: [{ required: true }]
@@ -1779,17 +3984,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImpo
1779
3984
  type: Input
1780
3985
  }], selectionModelChange: [{
1781
3986
  type: Output
1782
- }], filaExtraTemplate: [{
3987
+ }], seguirSeleccion: [{ type: i0.Input, args: [{ isSignal: true, alias: "seguirSeleccion", required: false }] }], filaExtraTemplate: [{
1783
3988
  type: Input
1784
3989
  }], paginator: [{
1785
3990
  type: ViewChild,
1786
3991
  args: [MatPaginator]
1787
3992
  }], sort: [{
1788
3993
  type: ViewChild,
1789
- args: [MatSort]
3994
+ args: [MatSort, { static: true }]
1790
3995
  }], exportarExcel: [{
1791
3996
  type: Input
1792
- }], busquedaCompacta: [{ type: i0.Input, args: [{ isSignal: true, alias: "busquedaCompacta", required: false }] }], alturaFull: [{ type: i0.Input, args: [{ isSignal: true, alias: "alturaFull", required: false }] }], pageSize: [{
3997
+ }], busquedaCompacta: [{ type: i0.Input, args: [{ isSignal: true, alias: "busquedaCompacta", required: false }] }], bandaTabla: [{
3998
+ type: ViewChild,
3999
+ args: ['bandaTabla', { static: true }]
4000
+ }], contenedorTabla: [{
4001
+ type: ViewChild,
4002
+ args: ['contenedorTabla', { static: true }]
4003
+ }], columnasSiNoCaben: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnasSiNoCaben", required: false }] }], inputBusquedaCompacta: [{
4004
+ type: ViewChild,
4005
+ args: ['inputBusquedaCompacta']
4006
+ }], busquedaAncho: [{ type: i0.Input, args: [{ isSignal: true, alias: "ctrlBusquedaAncho", required: false }] }], nombreExcel: [{ type: i0.Input, args: [{ isSignal: true, alias: "nombreExcel", required: false }] }], animarFilas: [{ type: i0.Input, args: [{ isSignal: true, alias: "animarFilas", required: false }] }], cargando: [{ type: i0.Input, args: [{ isSignal: true, alias: "cargando", required: false }] }], exportacionArriba: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportacionArriba", required: false }] }], alinearCabecerasConContenido: [{ type: i0.Input, args: [{ isSignal: true, alias: "alinearCabecerasConContenido", required: false }] }], coloresTema: [{ type: i0.Input, args: [{ isSignal: true, alias: "coloresTema", required: false }] }], alturaFull: [{ type: i0.Input, args: [{ isSignal: true, alias: "alturaFull", required: false }] }], pageSize: [{
1793
4007
  type: Input
1794
4008
  }], pageSizeOptions: [{
1795
4009
  type: Input
@@ -1797,7 +4011,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImpo
1797
4011
  type: Output
1798
4012
  }], resultados: [{
1799
4013
  type: Output
1800
- }], table: [{
4014
+ }], arbol: [{ type: i0.Input, args: [{ isSignal: true, alias: "arbol", required: false }] }], busquedaCampos: [{ type: i0.Input, args: [{ isSignal: true, alias: "ctrlBusquedaCampos", required: false }] }], table: [{
1801
4015
  type: ViewChild,
1802
4016
  args: [MatTable, { static: false }]
1803
4017
  }], columnDefs: [{
@@ -1808,9 +4022,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImpo
1808
4022
  }], rows: [{
1809
4023
  type: ViewChildren,
1810
4024
  args: [MatRow, { read: ElementRef }]
1811
- }], rowFooter: [{
1812
- type: ViewChild,
1813
- args: [MatFooterRow, { read: ElementRef }]
1814
4025
  }], userMenu: [{
1815
4026
  type: ViewChild,
1816
4027
  args: ['userMenu']
@@ -1838,5 +4049,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImpo
1838
4049
  * Generated bundle index. Do not edit.
1839
4050
  */
1840
4051
 
1841
- export { ProgressBarComponent, TablaMantenimientoComponent, TablaMantenimientoService };
4052
+ export { CLASES_TONO, CONTROL_ARBOL_TABLA, ProgressBarComponent, RETARDO_TOOLTIP_CELDA, TABLA_MANTENIMIENTO_CONFIG, TONOS, TablaArbolCeldaComponent, TablaCeldaComponent, TablaMantenimientoComponent, TablaMantenimientoDataSource, TablaMantenimientoService, badge, claseBadge, claseTono, generarBotonesDinamicos, icono, imagen, marca, marcaIcono, normalizarCelda, nota, provideTablaMantenimiento, salto, texto, textoCelda };
1842
4053
  //# sourceMappingURL=jvsoft-components-tabla-mantenimiento.mjs.map