@jvsoft/components 1.0.0-alpha.17 → 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.
- package/.storybook/tema-demo.css +21 -15
- package/fesm2022/jvsoft-components-filtro-busqueda.mjs +11 -2
- package/fesm2022/jvsoft-components-filtro-busqueda.mjs.map +1 -1
- package/fesm2022/jvsoft-components-lista-arbol.mjs +57 -17
- package/fesm2022/jvsoft-components-lista-arbol.mjs.map +1 -1
- package/fesm2022/jvsoft-components-lista-detalle.mjs +70 -0
- package/fesm2022/jvsoft-components-lista-detalle.mjs.map +1 -0
- package/fesm2022/jvsoft-components-tabla-mantenimiento-components-progress-bar.mjs +2 -5
- package/fesm2022/jvsoft-components-tabla-mantenimiento-components-progress-bar.mjs.map +1 -1
- package/fesm2022/jvsoft-components-tabla-mantenimiento.mjs +2160 -148
- package/fesm2022/jvsoft-components-tabla-mantenimiento.mjs.map +1 -1
- package/fesm2022/jvsoft-components.mjs +1 -0
- package/fesm2022/jvsoft-components.mjs.map +1 -1
- package/lista-arbol/README.md +16 -0
- package/lista-detalle/README.md +85 -0
- package/package.json +6 -2
- package/src/styles/base-jvsoft-components.css +715 -15
- package/tabla-mantenimiento/README.md +430 -6
- package/tabla-mantenimiento/tabla-mantenimiento.component.scss +31 -0
- package/types/jvsoft-components-filtro-busqueda.d.ts +6 -0
- package/types/jvsoft-components-lista-arbol.d.ts +17 -1
- package/types/jvsoft-components-lista-detalle.d.ts +44 -0
- package/types/jvsoft-components-tabla-mantenimiento-components-progress-bar.d.ts +1 -2
- package/types/jvsoft-components-tabla-mantenimiento.d.ts +921 -14
- 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,
|
|
7
|
-
import * as i4$
|
|
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
|
|
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
|
|
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
|
|
18
|
-
import { MatIconRegistry, MatIcon
|
|
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,
|
|
27
|
-
import * as i4
|
|
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
35
|
import { startWith, of, fromEvent } from 'rxjs';
|
|
32
36
|
import { filter, map, take } from 'rxjs/operators';
|
|
33
|
-
import * as
|
|
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 i1$
|
|
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
|
|
@@ -252,6 +372,275 @@ class ForCheckboxModel {
|
|
|
252
372
|
}
|
|
253
373
|
}
|
|
254
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
|
+
|
|
255
644
|
function tipoValorFuncion(datoParam, defaultValue, ...param) {
|
|
256
645
|
if (datoParam === undefined || datoParam === null) {
|
|
257
646
|
return defaultValue; // Retorna el valor por defecto si es undefined
|
|
@@ -353,6 +742,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImpo
|
|
|
353
742
|
args: ['keydown', ['$event']]
|
|
354
743
|
}] } });
|
|
355
744
|
|
|
745
|
+
const CONFIG_CABECERAS_TABLA = new InjectionToken('CONFIG_CABECERAS_TABLA');
|
|
746
|
+
function crearConfigCabeceras() {
|
|
747
|
+
return { alinearConContenido: signal(false) };
|
|
748
|
+
}
|
|
749
|
+
|
|
356
750
|
class ColumnTypeComponent {
|
|
357
751
|
table;
|
|
358
752
|
column;
|
|
@@ -370,6 +764,32 @@ class ColumnTypeComponent {
|
|
|
370
764
|
this.table.addColumnDef(this.columnDef);
|
|
371
765
|
}
|
|
372
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
|
+
}
|
|
373
793
|
accionClick(item, event) {
|
|
374
794
|
if (this.column.click) {
|
|
375
795
|
this.column.click(item);
|
|
@@ -378,11 +798,11 @@ class ColumnTypeComponent {
|
|
|
378
798
|
return false;
|
|
379
799
|
}
|
|
380
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 });
|
|
381
|
-
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
|
|
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"] }] });
|
|
382
802
|
}
|
|
383
803
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ColumnTypeComponent, decorators: [{
|
|
384
804
|
type: Component,
|
|
385
|
-
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
|
|
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" }]
|
|
386
806
|
}], ctorParameters: () => [{ type: i2.MatTable, decorators: [{
|
|
387
807
|
type: Optional
|
|
388
808
|
}] }], propDecorators: { column: [{
|
|
@@ -402,11 +822,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImpo
|
|
|
402
822
|
class ColumnTypeNumberComponent extends ColumnTypeComponent {
|
|
403
823
|
column = {};
|
|
404
824
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ColumnTypeNumberComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
405
|
-
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
|
|
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" }] });
|
|
406
826
|
}
|
|
407
827
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ColumnTypeNumberComponent, decorators: [{
|
|
408
828
|
type: Component,
|
|
409
|
-
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
|
|
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" }]
|
|
410
830
|
}], propDecorators: { column: [{
|
|
411
831
|
type: Input,
|
|
412
832
|
args: [{ required: true }]
|
|
@@ -415,11 +835,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImpo
|
|
|
415
835
|
class ColumnTypeDateComponent extends ColumnTypeComponent {
|
|
416
836
|
column = {};
|
|
417
837
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ColumnTypeDateComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
418
|
-
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
|
|
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" }] });
|
|
419
839
|
}
|
|
420
840
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ColumnTypeDateComponent, decorators: [{
|
|
421
841
|
type: Component,
|
|
422
|
-
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
|
|
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" }]
|
|
423
843
|
}], propDecorators: { column: [{
|
|
424
844
|
type: Input,
|
|
425
845
|
args: [{ required: true }]
|
|
@@ -446,18 +866,17 @@ class ColumnTypeSinoComponent extends ColumnTypeComponent {
|
|
|
446
866
|
// iconRegistry.addSvgIconLiteral('noIcon', sanitizer.bypassSecurityTrustHtml(NO_ICON));
|
|
447
867
|
}
|
|
448
868
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ColumnTypeSinoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
449
|
-
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'\"
|
|
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"] }] });
|
|
450
870
|
}
|
|
451
871
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ColumnTypeSinoComponent, decorators: [{
|
|
452
872
|
type: Component,
|
|
453
|
-
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'\"
|
|
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" }]
|
|
454
874
|
}], ctorParameters: () => [], propDecorators: { column: [{
|
|
455
875
|
type: Input,
|
|
456
876
|
args: [{ required: true }]
|
|
457
877
|
}] } });
|
|
458
878
|
|
|
459
879
|
class ProgressBarComponent {
|
|
460
|
-
objThis;
|
|
461
880
|
porcentaje = 0;
|
|
462
881
|
textoCentrado = false;
|
|
463
882
|
_textoMostrar = '';
|
|
@@ -510,7 +929,7 @@ class ProgressBarComponent {
|
|
|
510
929
|
return objData.sort((a, b) => (a[propiedad] > b[propiedad]) ? 1 : ((b[propiedad] > a[propiedad]) ? -1 : 0));
|
|
511
930
|
}
|
|
512
931
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ProgressBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
513
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.18", type: ProgressBarComponent, isStandalone: true, selector: "jvs-progress-bar", inputs: {
|
|
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" }] });
|
|
514
933
|
}
|
|
515
934
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ProgressBarComponent, decorators: [{
|
|
516
935
|
type: Component,
|
|
@@ -520,9 +939,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImpo
|
|
|
520
939
|
], host: {
|
|
521
940
|
class: 'jvs-progress-bar',
|
|
522
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" }]
|
|
523
|
-
}], ctorParameters: () => [], propDecorators: {
|
|
524
|
-
type: Input
|
|
525
|
-
}], porcentaje: [{
|
|
942
|
+
}], ctorParameters: () => [], propDecorators: { porcentaje: [{
|
|
526
943
|
type: Input
|
|
527
944
|
}], textoCentrado: [{
|
|
528
945
|
type: Input
|
|
@@ -537,11 +954,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImpo
|
|
|
537
954
|
class ColumnTypeProgressbarComponent extends ColumnTypeComponent {
|
|
538
955
|
column = {};
|
|
539
956
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ColumnTypeProgressbarComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
540
|
-
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
|
|
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"] }] });
|
|
541
958
|
}
|
|
542
959
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ColumnTypeProgressbarComponent, decorators: [{
|
|
543
960
|
type: Component,
|
|
544
|
-
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
|
|
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" }]
|
|
545
962
|
}], propDecorators: { column: [{
|
|
546
963
|
type: Input,
|
|
547
964
|
args: [{ required: true }]
|
|
@@ -555,7 +972,7 @@ class NoSanitizePipe {
|
|
|
555
972
|
transform(html) {
|
|
556
973
|
return this.domSanitizer.bypassSecurityTrustHtml(html);
|
|
557
974
|
}
|
|
558
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: NoSanitizePipe, deps: [{ token: i1$
|
|
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 });
|
|
559
976
|
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.18", ngImport: i0, type: NoSanitizePipe, isStandalone: true, name: "noSanitize" });
|
|
560
977
|
}
|
|
561
978
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: NoSanitizePipe, decorators: [{
|
|
@@ -564,7 +981,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImpo
|
|
|
564
981
|
name: 'noSanitize',
|
|
565
982
|
standalone: true
|
|
566
983
|
}]
|
|
567
|
-
}], ctorParameters: () => [{ type: i1$
|
|
984
|
+
}], ctorParameters: () => [{ type: i1$2.DomSanitizer }] });
|
|
568
985
|
|
|
569
986
|
class ZeroFillPipe {
|
|
570
987
|
transform(value, digitos, ...args) {
|
|
@@ -590,14 +1007,421 @@ function zeroFill(value, digitos, ...args) {
|
|
|
590
1007
|
|
|
591
1008
|
// export * from './progress-spinner.service';
|
|
592
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
|
+
|
|
593
1411
|
class ColumnTypeTextComponent extends ColumnTypeComponent {
|
|
594
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
|
+
}
|
|
595
1419
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ColumnTypeTextComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
596
|
-
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
|
|
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" }] });
|
|
597
1421
|
}
|
|
598
1422
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ColumnTypeTextComponent, decorators: [{
|
|
599
1423
|
type: Component,
|
|
600
|
-
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
|
|
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" }]
|
|
601
1425
|
}], propDecorators: { column: [{
|
|
602
1426
|
type: Input,
|
|
603
1427
|
args: [{ required: true }]
|
|
@@ -609,11 +1433,11 @@ class ColumnTypeMoneyComponent extends ColumnTypeComponent {
|
|
|
609
1433
|
return (this.column.transformar ? this.column.transformar(row) : row[this.column.property]);
|
|
610
1434
|
}
|
|
611
1435
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ColumnTypeMoneyComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
612
|
-
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
|
|
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" }] });
|
|
613
1437
|
}
|
|
614
1438
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ColumnTypeMoneyComponent, decorators: [{
|
|
615
1439
|
type: Component,
|
|
616
|
-
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
|
|
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" }]
|
|
617
1441
|
}], propDecorators: { column: [{
|
|
618
1442
|
type: Input,
|
|
619
1443
|
args: [{ required: true }]
|
|
@@ -627,12 +1451,36 @@ class ColumnTypeIconsComponent extends ColumnTypeComponent {
|
|
|
627
1451
|
}
|
|
628
1452
|
return columna.items;
|
|
629
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
|
+
}
|
|
630
1461
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ColumnTypeIconsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
631
|
-
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
|
|
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"] }] });
|
|
632
1463
|
}
|
|
633
1464
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ColumnTypeIconsComponent, decorators: [{
|
|
634
1465
|
type: Component,
|
|
635
|
-
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
|
|
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" }]
|
|
636
1484
|
}], propDecorators: { column: [{
|
|
637
1485
|
type: Input,
|
|
638
1486
|
args: [{ required: true }]
|
|
@@ -647,7 +1495,10 @@ class ColumnTypeModule {
|
|
|
647
1495
|
ColumnTypeDateComponent,
|
|
648
1496
|
ColumnTypeIconsComponent,
|
|
649
1497
|
ColumnTypeSinoComponent,
|
|
650
|
-
ColumnTypeProgressbarComponent
|
|
1498
|
+
ColumnTypeProgressbarComponent,
|
|
1499
|
+
ColumnTypeArbolComponent], imports: [TablaArbolCeldaComponent,
|
|
1500
|
+
TablaCeldaComponent,
|
|
1501
|
+
CommonModule,
|
|
651
1502
|
MatTableModule,
|
|
652
1503
|
MatSortModule,
|
|
653
1504
|
MatTooltipModule,
|
|
@@ -663,8 +1514,11 @@ class ColumnTypeModule {
|
|
|
663
1514
|
ColumnTypeDateComponent,
|
|
664
1515
|
ColumnTypeIconsComponent,
|
|
665
1516
|
ColumnTypeSinoComponent,
|
|
666
|
-
ColumnTypeProgressbarComponent
|
|
667
|
-
|
|
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,
|
|
668
1522
|
MatTableModule,
|
|
669
1523
|
MatSortModule,
|
|
670
1524
|
MatTooltipModule,
|
|
@@ -683,8 +1537,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImpo
|
|
|
683
1537
|
ColumnTypeIconsComponent,
|
|
684
1538
|
ColumnTypeSinoComponent,
|
|
685
1539
|
ColumnTypeProgressbarComponent,
|
|
1540
|
+
ColumnTypeArbolComponent,
|
|
686
1541
|
],
|
|
687
1542
|
imports: [
|
|
1543
|
+
TablaArbolCeldaComponent,
|
|
1544
|
+
TablaCeldaComponent,
|
|
688
1545
|
CommonModule,
|
|
689
1546
|
MatTableModule,
|
|
690
1547
|
MatSortModule,
|
|
@@ -705,6 +1562,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImpo
|
|
|
705
1562
|
ColumnTypeIconsComponent,
|
|
706
1563
|
ColumnTypeSinoComponent,
|
|
707
1564
|
ColumnTypeProgressbarComponent,
|
|
1565
|
+
ColumnTypeArbolComponent,
|
|
708
1566
|
]
|
|
709
1567
|
}]
|
|
710
1568
|
}] });
|
|
@@ -712,7 +1570,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImpo
|
|
|
712
1570
|
class TablaMantenimientoColumnDefsComponent {
|
|
713
1571
|
table;
|
|
714
1572
|
cdRef;
|
|
715
|
-
objThis;
|
|
716
1573
|
nombreColeccion;
|
|
717
1574
|
colDetalle;
|
|
718
1575
|
chkLista; // = new DataModel();
|
|
@@ -742,7 +1599,7 @@ class TablaMantenimientoColumnDefsComponent {
|
|
|
742
1599
|
return column.property;
|
|
743
1600
|
}
|
|
744
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 });
|
|
745
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.18", type: TablaMantenimientoColumnDefsComponent, isStandalone: true, selector: "jvs-tabla-mantenimiento-column-defs", inputs: {
|
|
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"] }] });
|
|
746
1603
|
}
|
|
747
1604
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: TablaMantenimientoColumnDefsComponent, decorators: [{
|
|
748
1605
|
type: Component,
|
|
@@ -757,12 +1614,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImpo
|
|
|
757
1614
|
ReactiveFormsModule,
|
|
758
1615
|
FormsModule,
|
|
759
1616
|
ColumnTypeModule,
|
|
760
|
-
], 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); 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\" 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" }]
|
|
761
1618
|
}], ctorParameters: () => [{ type: i2.MatTable, decorators: [{
|
|
762
1619
|
type: Optional
|
|
763
|
-
}] }, { type: i0.ChangeDetectorRef }], propDecorators: {
|
|
764
|
-
type: Input
|
|
765
|
-
}], nombreColeccion: [{
|
|
1620
|
+
}] }, { type: i0.ChangeDetectorRef }], propDecorators: { nombreColeccion: [{
|
|
766
1621
|
type: Input
|
|
767
1622
|
}], colDetalle: [{
|
|
768
1623
|
type: Input
|
|
@@ -783,7 +1638,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImpo
|
|
|
783
1638
|
}] } });
|
|
784
1639
|
|
|
785
1640
|
class TablaMantenimientoMenuComponent {
|
|
786
|
-
objThis;
|
|
787
1641
|
nombreColeccion;
|
|
788
1642
|
item;
|
|
789
1643
|
derechosActuales;
|
|
@@ -798,7 +1652,7 @@ class TablaMantenimientoMenuComponent {
|
|
|
798
1652
|
ngOnInit() {
|
|
799
1653
|
}
|
|
800
1654
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: TablaMantenimientoMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
801
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.18", type: TablaMantenimientoMenuComponent, isStandalone: true, selector: "jvs-tabla-mantenimiento-menu", inputs: {
|
|
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"] }] });
|
|
802
1656
|
}
|
|
803
1657
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: TablaMantenimientoMenuComponent, decorators: [{
|
|
804
1658
|
type: Component,
|
|
@@ -806,9 +1660,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImpo
|
|
|
806
1660
|
CommonModule,
|
|
807
1661
|
MatMenuModule,
|
|
808
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" }]
|
|
809
|
-
}], ctorParameters: () => [], propDecorators: {
|
|
810
|
-
type: Input
|
|
811
|
-
}], nombreColeccion: [{
|
|
1663
|
+
}], ctorParameters: () => [], propDecorators: { nombreColeccion: [{
|
|
812
1664
|
type: Input
|
|
813
1665
|
}], item: [{
|
|
814
1666
|
type: Input
|
|
@@ -852,10 +1704,13 @@ class TableUtil {
|
|
|
852
1704
|
});
|
|
853
1705
|
// XLSX.writeFile(wb, `${fileName}.xlsx`);
|
|
854
1706
|
}
|
|
855
|
-
static exportArrayToExcel(arr, name) {
|
|
1707
|
+
static exportArrayToExcel(arr, name, anchos) {
|
|
856
1708
|
const { sheetName, fileName } = getFileName(name);
|
|
857
1709
|
const wb = XLSX.utils.book_new();
|
|
858
1710
|
const ws = XLSX.utils.json_to_sheet(arr, { dateNF: 'dd/MM/yyyy' });
|
|
1711
|
+
if (anchos) {
|
|
1712
|
+
ws['!cols'] = anchos;
|
|
1713
|
+
}
|
|
859
1714
|
XLSX.utils.book_append_sheet(wb, ws, sheetName);
|
|
860
1715
|
XLSX.writeFile(wb, `${fileName}.xlsx`);
|
|
861
1716
|
}
|
|
@@ -868,6 +1723,273 @@ class TableUtil {
|
|
|
868
1723
|
}
|
|
869
1724
|
}
|
|
870
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
|
+
|
|
871
1993
|
class TablaMantenimientoService {
|
|
872
1994
|
get templateBotonesComunes() {
|
|
873
1995
|
return [
|
|
@@ -910,6 +2032,57 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImpo
|
|
|
910
2032
|
}]
|
|
911
2033
|
}] });
|
|
912
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;
|
|
913
2086
|
class TablaMantenimientoComponent {
|
|
914
2087
|
overlay;
|
|
915
2088
|
viewContainerRef;
|
|
@@ -929,6 +2102,11 @@ class TablaMantenimientoComponent {
|
|
|
929
2102
|
}
|
|
930
2103
|
;
|
|
931
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
|
+
*/
|
|
932
2110
|
objThis;
|
|
933
2111
|
nombreColeccion;
|
|
934
2112
|
busquedaValor = input('', { ...(ngDevMode ? { debugName: "busquedaValor" } : /* istanbul ignore next */ {}), alias: 'ctrlBusquedaValue' });
|
|
@@ -955,20 +2133,144 @@ class TablaMantenimientoComponent {
|
|
|
955
2133
|
opcBusqueda = new EventEmitter();
|
|
956
2134
|
accionRecargar = new EventEmitter();
|
|
957
2135
|
/**
|
|
958
|
-
* Registro seleccionado. El nombre viene de cuando se pensó guardarlo en un
|
|
959
|
-
* `SelectionModel` del CDK; lo que viaja es la fila, y así lo usan las apps con el enlace
|
|
960
|
-
* de dos sentidos `[(selectionModel)]`.
|
|
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
|
+
*/
|
|
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
|
+
}
|
|
2152
|
+
this.objSeleccionado = val;
|
|
2153
|
+
this.irAPaginaDeSeleccion();
|
|
2154
|
+
}
|
|
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;
|
|
2172
|
+
isRecargarUsed = false;
|
|
2173
|
+
filaExtraTemplate;
|
|
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
|
+
*/
|
|
2179
|
+
sort;
|
|
2180
|
+
exportarExcel = true;
|
|
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.
|
|
961
2268
|
*/
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
}
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
filaExtraTemplate;
|
|
968
|
-
paginator;
|
|
969
|
-
sort;
|
|
970
|
-
exportarExcel = true;
|
|
971
|
-
busquedaCompacta = input(false, ...(ngDevMode ? [{ debugName: "busquedaCompacta" }] : /* istanbul ignore next */ []));
|
|
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 */ []));
|
|
972
2274
|
alturaFull = input(false, ...(ngDevMode ? [{ debugName: "alturaFull" }] : /* istanbul ignore next */ []));
|
|
973
2275
|
// MIO
|
|
974
2276
|
pageSize = 25;
|
|
@@ -979,7 +2281,41 @@ class TablaMantenimientoComponent {
|
|
|
979
2281
|
*/
|
|
980
2282
|
dataSourceChange = new EventEmitter();
|
|
981
2283
|
resultados = new EventEmitter();
|
|
982
|
-
dataSource =
|
|
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' });
|
|
983
2319
|
// this is where the magic happens:
|
|
984
2320
|
table;
|
|
985
2321
|
columnDefs;
|
|
@@ -1027,6 +2363,12 @@ class TablaMantenimientoComponent {
|
|
|
1027
2363
|
this.viewContainerRef = viewContainerRef;
|
|
1028
2364
|
this.tablaMantenimientoService = tablaMantenimientoService;
|
|
1029
2365
|
this.cdRef = cdRef;
|
|
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));
|
|
1030
2372
|
}
|
|
1031
2373
|
busquedaTipo = input('simple', { ...(ngDevMode ? { debugName: "busquedaTipo" } : /* istanbul ignore next */ {}), alias: 'ctrlBusqueda',
|
|
1032
2374
|
transform: (val) => {
|
|
@@ -1103,6 +2445,33 @@ class TablaMantenimientoComponent {
|
|
|
1103
2445
|
return columna;
|
|
1104
2446
|
});
|
|
1105
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;
|
|
2472
|
+
}
|
|
2473
|
+
}
|
|
2474
|
+
});
|
|
1106
2475
|
}
|
|
1107
2476
|
_botonesMenu = {
|
|
1108
2477
|
crud: undefined,
|
|
@@ -1111,6 +2480,7 @@ class TablaMantenimientoComponent {
|
|
|
1111
2480
|
derecha: [],
|
|
1112
2481
|
secundario: [],
|
|
1113
2482
|
inferior: [],
|
|
2483
|
+
herramientas: [],
|
|
1114
2484
|
};
|
|
1115
2485
|
get botonesMenu() {
|
|
1116
2486
|
return this._botonesMenu;
|
|
@@ -1172,6 +2542,14 @@ class TablaMantenimientoComponent {
|
|
|
1172
2542
|
});
|
|
1173
2543
|
this._botonesMenu = { ...this._botonesMenu, ...val };
|
|
1174
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
|
+
}
|
|
1175
2553
|
get listaMenuCompleto() {
|
|
1176
2554
|
let menuTotal = [];
|
|
1177
2555
|
menuTotal = menuTotal.concat(this.botonesMenu.izquierda ?? []);
|
|
@@ -1180,19 +2558,117 @@ class TablaMantenimientoComponent {
|
|
|
1180
2558
|
menuTotal = menuTotal.concat(this.botonesMenu.derecha ?? []);
|
|
1181
2559
|
menuTotal = menuTotal.concat(this.botonesMenu.secundario ?? []);
|
|
1182
2560
|
menuTotal = menuTotal.concat(this.botonesMenu.inferior ?? []);
|
|
2561
|
+
menuTotal = menuTotal.concat(this.botonesMenu.herramientas ?? []);
|
|
1183
2562
|
return menuTotal;
|
|
1184
2563
|
}
|
|
1185
2564
|
/** Si la columna se ofrece en el menú de columnas. `noMostrar` es el alias antiguo. */
|
|
1186
2565
|
esColumnaEnLista(column) {
|
|
1187
2566
|
return !tipoValorFuncion(column.noMostrarEnLista ?? column.noMostrar, false);
|
|
1188
2567
|
}
|
|
1189
|
-
/**
|
|
1190
|
-
|
|
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) {
|
|
1191
2594
|
const visible = tipoValorFuncion(column.visible, true);
|
|
1192
2595
|
if (!visible && column.esVisible != undefined) {
|
|
1193
2596
|
return column.esVisible();
|
|
1194
2597
|
}
|
|
1195
|
-
return visible;
|
|
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();
|
|
2631
|
+
});
|
|
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
|
+
}
|
|
1196
2672
|
}
|
|
1197
2673
|
/**
|
|
1198
2674
|
* Columnas que toca pintar. Consultarlo no escribe en las columnas del consumidor: antes
|
|
@@ -1219,6 +2695,16 @@ class TablaMantenimientoComponent {
|
|
|
1219
2695
|
}
|
|
1220
2696
|
return this.columnasTabla.map(column => ({ ...column, sort: false }));
|
|
1221
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
|
+
}
|
|
1222
2708
|
get visibleColumns() {
|
|
1223
2709
|
return this.objVisibleColumns.map(column => column.property);
|
|
1224
2710
|
}
|
|
@@ -1311,8 +2797,9 @@ class TablaMantenimientoComponent {
|
|
|
1311
2797
|
// `dataSource`, y si todavía tuviera la lista anterior emitiría el registro viejo.
|
|
1312
2798
|
const anterior = this.objSeleccionado;
|
|
1313
2799
|
this.setData(res);
|
|
2800
|
+
let renovado = null;
|
|
1314
2801
|
if (anterior) {
|
|
1315
|
-
|
|
2802
|
+
renovado = (this.idTabla && this.idTabla.length > 0)
|
|
1316
2803
|
? buscarEnArray(res, this.idTabla, this.idTabla.map(d => anterior[d]))
|
|
1317
2804
|
: (Array.isArray(res)
|
|
1318
2805
|
? res.find((itm) => this.propiedadSeleccion(itm) === this.propiedadSeleccion(anterior))
|
|
@@ -1321,11 +2808,209 @@ class TablaMantenimientoComponent {
|
|
|
1321
2808
|
this.objSeleccionado = renovado;
|
|
1322
2809
|
}
|
|
1323
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);
|
|
2818
|
+
}
|
|
2819
|
+
}
|
|
2820
|
+
this.irAPaginaDeSeleccion();
|
|
1324
2821
|
}
|
|
1325
2822
|
});
|
|
1326
2823
|
}
|
|
1327
2824
|
this.isRecargarUsed = this.accionRecargar.observed;
|
|
1328
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
|
+
}
|
|
1329
3014
|
/** Filas desplegadas, por su identificador. El estado es de la tabla, no del registro. */
|
|
1330
3015
|
filasExpandidas = new Set();
|
|
1331
3016
|
/** Se pasa a la definición de columnas, que pregunta por fila al pintar el icono. */
|
|
@@ -1372,16 +3057,10 @@ class TablaMantenimientoComponent {
|
|
|
1372
3057
|
ngAfterContentInit() {
|
|
1373
3058
|
this.componenteCargadoTotalmente = true;
|
|
1374
3059
|
this.cdRef.detectChanges();
|
|
1375
|
-
this.
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
col.visible = col.datosExtra?.tabla_mantenimiento_config_visibleAlias ?? col.visible;
|
|
1380
|
-
delete col.datosExtra?.tabla_mantenimiento_config_visibleAlias;
|
|
1381
|
-
if (Object.keys(col.datosExtra).length < 1) {
|
|
1382
|
-
delete col.datosExtra;
|
|
1383
|
-
}
|
|
1384
|
-
}
|
|
3060
|
+
this.confirmarColumnasCustom();
|
|
3061
|
+
this.columnDefs.changes.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {
|
|
3062
|
+
this.confirmarColumnasCustom();
|
|
3063
|
+
this.cdRef.markForCheck();
|
|
1385
3064
|
});
|
|
1386
3065
|
if (this.busquedaValor()) {
|
|
1387
3066
|
this.cCampoBusqueda.setValue(this.busquedaValor());
|
|
@@ -1475,6 +3154,9 @@ class TablaMantenimientoComponent {
|
|
|
1475
3154
|
if (this.objSeleccionado == item || this.esSeleccionActual(item)) {
|
|
1476
3155
|
claseFinal = claseFinal.concat(this.classSeleccionado);
|
|
1477
3156
|
}
|
|
3157
|
+
if (this.dataSource.infoArbol(item)?.contexto) {
|
|
3158
|
+
claseFinal.push(CLASE_FILA_CONTEXTO);
|
|
3159
|
+
}
|
|
1478
3160
|
claseFinal = claseFinal.concat(this.condicionesClaseFila(item));
|
|
1479
3161
|
// No se guarda en el registro: es dato del padre, y escribir aquí cambiaba el hash con
|
|
1480
3162
|
// el que se identifica la fila cuando no hay `idTabla`, haciendo que la selección se
|
|
@@ -1525,6 +3207,18 @@ class TablaMantenimientoComponent {
|
|
|
1525
3207
|
}
|
|
1526
3208
|
return this.noData$;
|
|
1527
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();
|
|
3220
|
+
}
|
|
3221
|
+
}
|
|
1528
3222
|
onFilterChange(value) {
|
|
1529
3223
|
if (!this.dataSource) {
|
|
1530
3224
|
return;
|
|
@@ -1532,11 +3226,33 @@ class TablaMantenimientoComponent {
|
|
|
1532
3226
|
value = value.trim();
|
|
1533
3227
|
value = value.toLowerCase();
|
|
1534
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);
|
|
1535
3251
|
}
|
|
1536
3252
|
toggleColumnVisibility(column, event) {
|
|
1537
3253
|
event.stopPropagation();
|
|
1538
3254
|
event.stopImmediatePropagation();
|
|
1539
|
-
column
|
|
3255
|
+
this.elegirVisibilidadColumna(column, !this.esColumnaVisible(column));
|
|
1540
3256
|
}
|
|
1541
3257
|
cargarData(retorno = false) {
|
|
1542
3258
|
if (this.busquedaTipo() && this.busquedaTipo() == 'simple') {
|
|
@@ -1583,6 +3299,9 @@ class TablaMantenimientoComponent {
|
|
|
1583
3299
|
this.cacheTooltip = new WeakMap();
|
|
1584
3300
|
this.dataSource.sortingDataAccessor = (item, property) => {
|
|
1585
3301
|
const dColumn = buscarEnArray(this.columnasTabla, 'property', property);
|
|
3302
|
+
if (dColumn?.ordenarPor) {
|
|
3303
|
+
return dColumn.ordenarPor(item);
|
|
3304
|
+
}
|
|
1586
3305
|
if (dColumn) {
|
|
1587
3306
|
switch (dColumn.sortType ?? dColumn.type) {
|
|
1588
3307
|
case 'number':
|
|
@@ -1638,6 +3357,178 @@ class TablaMantenimientoComponent {
|
|
|
1638
3357
|
}
|
|
1639
3358
|
return disabled;
|
|
1640
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
|
+
}
|
|
1641
3532
|
propiedadSeleccion(item) {
|
|
1642
3533
|
return `${this.nombreColeccion}_${this.idTablaValor(item)}`;
|
|
1643
3534
|
}
|
|
@@ -1731,7 +3622,13 @@ class TablaMantenimientoComponent {
|
|
|
1731
3622
|
else {
|
|
1732
3623
|
this._seleccionado = this._seleccionado === idItem ? null : idItem;
|
|
1733
3624
|
}
|
|
1734
|
-
this.
|
|
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);
|
|
1735
3632
|
/*if (this.objThis) {
|
|
1736
3633
|
if (!this.objThis['seleccionados']) {
|
|
1737
3634
|
this.objThis['seleccionados'] = {};
|
|
@@ -1739,6 +3636,76 @@ class TablaMantenimientoComponent {
|
|
|
1739
3636
|
this.objThis['seleccionados'][this.nombreColeccion] = this.objSeleccionado;
|
|
1740
3637
|
}*/
|
|
1741
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
|
+
}
|
|
1742
3709
|
opcMenu(item, objMenu, modal = null, retorno = false) {
|
|
1743
3710
|
if (objMenu.tipo == 'exportar_excel' && this.exportarExcel) {
|
|
1744
3711
|
/*
|
|
@@ -1750,57 +3717,13 @@ class TablaMantenimientoComponent {
|
|
|
1750
3717
|
return x;
|
|
1751
3718
|
}), 'TEST');
|
|
1752
3719
|
*/
|
|
1753
|
-
const
|
|
1754
|
-
const objetosExtraidos = this.
|
|
1755
|
-
const nColumn = (columna.labelLista ?? columna.label).toUpperCase().replace('<BR>', ' ');
|
|
1756
|
-
switch (columna.type) {
|
|
1757
|
-
case 'date':
|
|
1758
|
-
// new Date(dateString.replace(/(\d{2}:\d{2}:\d{2}):\w{2}/, '$1'));
|
|
1759
|
-
let fecha = objeto[columna.property];
|
|
1760
|
-
if (objeto[columna.property]) {
|
|
1761
|
-
fecha = new Date(objeto[columna.property].replace(/(\d{2}:\d{2}:\d{2}):\w{2}/, '$1'));
|
|
1762
|
-
if (getBrowserName() == 'chrome') {
|
|
1763
|
-
fecha = addMinutes(new Date(objeto[columna.property]), 2);
|
|
1764
|
-
}
|
|
1765
|
-
}
|
|
1766
|
-
acumulador[nColumn] = fecha;
|
|
1767
|
-
break;
|
|
1768
|
-
case 'number':
|
|
1769
|
-
case 'money':
|
|
1770
|
-
acumulador[nColumn] = objeto[columna.property] * 1;
|
|
1771
|
-
break;
|
|
1772
|
-
default:
|
|
1773
|
-
if (columna.property == 'numeracion_automatica') {
|
|
1774
|
-
acumulador[nColumn] = idx + 1;
|
|
1775
|
-
}
|
|
1776
|
-
else {
|
|
1777
|
-
if (columna.type == 'custom') {
|
|
1778
|
-
// dataGeneradoPorHtml.sheetToJson
|
|
1779
|
-
acumulador[nColumn] = dataGeneradoPorHtml.sheetToJson[idx][columna.label];
|
|
1780
|
-
}
|
|
1781
|
-
else {
|
|
1782
|
-
if (columna.type == 'text' && columna.innerHTML) {
|
|
1783
|
-
const convertirHtmlATexto = (html) => {
|
|
1784
|
-
const elementoTemporal = document.createElement('div');
|
|
1785
|
-
elementoTemporal.innerHTML = html;
|
|
1786
|
-
return elementoTemporal.textContent || "";
|
|
1787
|
-
};
|
|
1788
|
-
acumulador[nColumn] = convertirHtmlATexto(columna.innerHTML(objeto));
|
|
1789
|
-
}
|
|
1790
|
-
else if (columna.transformar) {
|
|
1791
|
-
acumulador[nColumn] = columna.transformar(objeto);
|
|
1792
|
-
}
|
|
1793
|
-
else {
|
|
1794
|
-
acumulador[nColumn] = objeto[columna.property];
|
|
1795
|
-
}
|
|
1796
|
-
}
|
|
1797
|
-
}
|
|
1798
|
-
break;
|
|
1799
|
-
}
|
|
1800
|
-
return acumulador;
|
|
1801
|
-
}, {}));
|
|
3720
|
+
const columnasExcel = this.columnasExcel;
|
|
3721
|
+
const objetosExtraidos = this.datosExcel();
|
|
1802
3722
|
// TableUtil.exportTableToExcel('tabla_' + this.nombreColeccion);
|
|
1803
|
-
|
|
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);
|
|
1804
3727
|
}
|
|
1805
3728
|
const opAdic = { seccion: this.nombreColeccion };
|
|
1806
3729
|
if (item) {
|
|
@@ -1858,6 +3781,50 @@ class TablaMantenimientoComponent {
|
|
|
1858
3781
|
this.overlayRef = undefined;
|
|
1859
3782
|
}
|
|
1860
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
|
+
}
|
|
1861
3828
|
ejecutarBusquedaCompacta() {
|
|
1862
3829
|
if (this.busquedaTipo() === 'query') {
|
|
1863
3830
|
this.cargarData();
|
|
@@ -1867,11 +3834,36 @@ class TablaMantenimientoComponent {
|
|
|
1867
3834
|
emitirAccionRecargar() {
|
|
1868
3835
|
this.accionRecargar.emit(this.opcFiltroActual);
|
|
1869
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;
|
|
3852
|
+
}
|
|
1870
3853
|
tipoValorFuncion = tipoValorFuncion;
|
|
1871
|
-
|
|
1872
|
-
static
|
|
1873
|
-
|
|
1874
|
-
], 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: "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 botonesMenuFinal.izquierda; track btn; let idx = $index) {\n <ng-container *ngTemplateOutlet=\"botonesSuperiores; context:{btn: btn, idx: {inicio: idx, fin: botonesMenuFinal.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 botonesMenuFinal.crud; track btn; let idx = $index) {\n <ng-container *ngTemplateOutlet=\"botonesSuperiores; context:{btn: btn, idx: {inicio: idx, fin: botonesMenuFinal.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 botonesMenuFinal.principal; track btn; let idx = $index) {\n <ng-container *ngTemplateOutlet=\"botonesSuperiores; context:{btn: btn, idx: {inicio: idx, fin: botonesMenuFinal.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 botonesMenuFinal.derecha; track btn; let idx = $index) {\n <ng-container *ngTemplateOutlet=\"botonesSuperiores; context:{btn: btn, idx: {inicio: idx, fin: botonesMenuFinal.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 botonesMenuFinal.secundario; track btn; let idx = $index) {\n <ng-container *ngTemplateOutlet=\"botonesSuperiores; context:{btn: btn, idx: {inicio: idx, fin: botonesMenuFinal.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]=\"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 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) {\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 botonesMenuFinal.inferior; track btn; let idx = $index) {\n <ng-container *ngTemplateOutlet=\"botonesSuperiores; context:{btn: btn, idx: {inicio: idx, fin: botonesMenuFinal.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 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-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 (esColumnaEnLista(column)) {\n <button (click)=\"toggleColumnVisibility(column, $event)\"\n class=\"checkbox-item mat-menu-item\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" [ngModel]=\"esColumnaVisible(column)\" (ngModelChange)=\"column.visible = $event\" [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: i4$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: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4$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: i4$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", "estaExpandida"], outputs: ["alternarExpansion", "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", "espacioEnFila", "filaEnfocada"] }, { 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: [
|
|
1875
3867
|
trigger('detailExpand', [
|
|
1876
3868
|
state('collapsed', style({ height: '0px', minHeight: '0' })),
|
|
1877
3869
|
state('expanded', style({ height: '*' })),
|
|
@@ -1902,6 +3894,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImpo
|
|
|
1902
3894
|
MatMenuModule,
|
|
1903
3895
|
MatMenuTrigger,
|
|
1904
3896
|
MatPaginatorModule,
|
|
3897
|
+
MatProgressBarModule,
|
|
1905
3898
|
MatRippleModule,
|
|
1906
3899
|
MatSortModule,
|
|
1907
3900
|
MatTableModule,
|
|
@@ -1914,6 +3907,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImpo
|
|
|
1914
3907
|
], host: {
|
|
1915
3908
|
class: 'jvs-tabla-mantenimiento',
|
|
1916
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'",
|
|
1917
3913
|
}, animations: [
|
|
1918
3914
|
trigger('detailExpand', [
|
|
1919
3915
|
state('collapsed', style({ height: '0px', minHeight: '0' })),
|
|
@@ -1933,15 +3929,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImpo
|
|
|
1933
3929
|
])
|
|
1934
3930
|
]),
|
|
1935
3931
|
], providers: [
|
|
1936
|
-
{ provide: MAT_PAGINATOR_DEFAULT_OPTIONS, useValue: { formFieldAppearance: 'outline' } }
|
|
1937
|
-
], 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 botonesMenuFinal.izquierda; track btn; let idx = $index) {\n <ng-container *ngTemplateOutlet=\"botonesSuperiores; context:{btn: btn, idx: {inicio: idx, fin: botonesMenuFinal.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 botonesMenuFinal.crud; track btn; let idx = $index) {\n <ng-container *ngTemplateOutlet=\"botonesSuperiores; context:{btn: btn, idx: {inicio: idx, fin: botonesMenuFinal.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 botonesMenuFinal.principal; track btn; let idx = $index) {\n <ng-container *ngTemplateOutlet=\"botonesSuperiores; context:{btn: btn, idx: {inicio: idx, fin: botonesMenuFinal.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 botonesMenuFinal.derecha; track btn; let idx = $index) {\n <ng-container *ngTemplateOutlet=\"botonesSuperiores; context:{btn: btn, idx: {inicio: idx, fin: botonesMenuFinal.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 botonesMenuFinal.secundario; track btn; let idx = $index) {\n <ng-container *ngTemplateOutlet=\"botonesSuperiores; context:{btn: btn, idx: {inicio: idx, fin: botonesMenuFinal.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]=\"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 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) {\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 botonesMenuFinal.inferior; track btn; let idx = $index) {\n <ng-container *ngTemplateOutlet=\"botonesSuperiores; context:{btn: btn, idx: {inicio: idx, fin: botonesMenuFinal.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 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-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 (esColumnaEnLista(column)) {\n <button (click)=\"toggleColumnVisibility(column, $event)\"\n class=\"checkbox-item mat-menu-item\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" [ngModel]=\"esColumnaVisible(column)\" (ngModelChange)=\"column.visible = $event\" [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"] }]
|
|
1938
|
-
|
|
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: [{
|
|
1939
3943
|
type: HostBinding
|
|
1940
3944
|
}], dataSuscription: [{
|
|
1941
3945
|
type: Input
|
|
1942
3946
|
}], objThis: [{
|
|
1943
|
-
type: Input
|
|
1944
|
-
args: [{ required: true }]
|
|
3947
|
+
type: Input
|
|
1945
3948
|
}], nombreColeccion: [{
|
|
1946
3949
|
type: Input,
|
|
1947
3950
|
args: [{ required: true }]
|
|
@@ -1981,17 +3984,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImpo
|
|
|
1981
3984
|
type: Input
|
|
1982
3985
|
}], selectionModelChange: [{
|
|
1983
3986
|
type: Output
|
|
1984
|
-
}], filaExtraTemplate: [{
|
|
3987
|
+
}], seguirSeleccion: [{ type: i0.Input, args: [{ isSignal: true, alias: "seguirSeleccion", required: false }] }], filaExtraTemplate: [{
|
|
1985
3988
|
type: Input
|
|
1986
3989
|
}], paginator: [{
|
|
1987
3990
|
type: ViewChild,
|
|
1988
3991
|
args: [MatPaginator]
|
|
1989
3992
|
}], sort: [{
|
|
1990
3993
|
type: ViewChild,
|
|
1991
|
-
args: [MatSort]
|
|
3994
|
+
args: [MatSort, { static: true }]
|
|
1992
3995
|
}], exportarExcel: [{
|
|
1993
3996
|
type: Input
|
|
1994
|
-
}], busquedaCompacta: [{ type: i0.Input, args: [{ isSignal: true, alias: "busquedaCompacta", required: false }] }],
|
|
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: [{
|
|
1995
4007
|
type: Input
|
|
1996
4008
|
}], pageSizeOptions: [{
|
|
1997
4009
|
type: Input
|
|
@@ -1999,7 +4011,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImpo
|
|
|
1999
4011
|
type: Output
|
|
2000
4012
|
}], resultados: [{
|
|
2001
4013
|
type: Output
|
|
2002
|
-
}], 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: [{
|
|
2003
4015
|
type: ViewChild,
|
|
2004
4016
|
args: [MatTable, { static: false }]
|
|
2005
4017
|
}], columnDefs: [{
|
|
@@ -2037,5 +4049,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImpo
|
|
|
2037
4049
|
* Generated bundle index. Do not edit.
|
|
2038
4050
|
*/
|
|
2039
4051
|
|
|
2040
|
-
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 };
|
|
2041
4053
|
//# sourceMappingURL=jvsoft-components-tabla-mantenimiento.mjs.map
|