@jvsoft/components 0.0.10 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/build.js +20 -0
- package/dialog-flotante/dialog-flotante.component.html +66 -0
- package/dialog-flotante/dialog-flotante.component.ts +115 -0
- package/dialog-flotante/dialog-flotante.interface.ts +13 -0
- package/dialog-flotante/index.ts +1 -0
- package/dialog-flotante/ng-package.json +5 -0
- package/{index.d.ts → index.ts} +8 -1
- package/lista-arbol/lista-arbol.component.html +66 -0
- package/lista-arbol/lista-arbol.component.ts +238 -0
- package/lista-arbol/lista-arbol.functions.ts +46 -0
- package/lista-arbol/ng-package.json +5 -0
- package/luces-navidad/christmas-tree.png +0 -0
- package/luces-navidad/index.ts +1 -0
- package/luces-navidad/luces-navidad.component.html +6 -0
- package/luces-navidad/luces-navidad.component.ts +24 -0
- package/luces-navidad/ng-package.json +5 -0
- package/mat-suffix-search-button/index.ts +1 -0
- package/mat-suffix-search-button/mat-suffix-search-button.component.html +5 -0
- package/mat-suffix-search-button/mat-suffix-search-button.component.ts +36 -0
- package/mat-suffix-search-button/ng-package.json +5 -0
- package/menu/index.ts +1 -0
- package/menu/menu.component.html +40 -0
- package/menu/menu.component.ts +88 -0
- package/menu/menu.interface.ts +16 -0
- package/menu/ng-package.json +5 -0
- package/ng-package.json +17 -0
- package/package.json +17 -42
- package/progress-spinner.zip +0 -0
- package/tabla-mantenimiento/classes/data-model.ts +150 -0
- package/tabla-mantenimiento/components/progress-bar/index.ts +1 -0
- package/tabla-mantenimiento/components/progress-bar/ng-package.json +5 -0
- package/tabla-mantenimiento/components/progress-bar/progress-bar.component.html +10 -0
- package/tabla-mantenimiento/components/progress-bar/progress-bar.component.ts +85 -0
- package/tabla-mantenimiento/components/progress-bar/public-api.ts +2 -0
- package/tabla-mantenimiento/index.ts +1 -0
- package/tabla-mantenimiento/interfaces/{archivo.d.ts → archivo.ts} +7 -4
- package/tabla-mantenimiento/interfaces/global/{boton-mantenimiento.d.ts → boton-mantenimiento.ts} +9 -3
- package/tabla-mantenimiento/interfaces/global/{columnas-tabla.d.ts → columnas-tabla.ts} +90 -13
- package/tabla-mantenimiento/interfaces/global/export-excel-servidor.ts +0 -0
- package/tabla-mantenimiento/interfaces/global/no-export.ts +11 -0
- package/tabla-mantenimiento/interfaces/global/{otros.d.ts → otros.ts} +15 -3
- package/tabla-mantenimiento/interfaces/implements/{incluye-tabla-mantenimiento.d.ts → incluye-tabla-mantenimiento.ts} +6 -4
- package/tabla-mantenimiento/interfaces/implements/{index.d.ts → index.ts} +1 -0
- package/tabla-mantenimiento/mat-row-keyboard-selection.directive.ts +97 -0
- package/tabla-mantenimiento/ng-package.json +5 -0
- package/tabla-mantenimiento/pipes/no-sanitize.pipe.ts +12 -0
- package/tabla-mantenimiento/pipes/zero-fill.pipe.ts +19 -0
- package/tabla-mantenimiento/{public-api.d.ts → public-api.ts} +3 -2
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-date/column-type-date.component.html +22 -0
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-date/column-type-date.component.ts +12 -0
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-icons/column-type-icons.component.html +58 -0
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-icons/column-type-icons.component.ts +19 -0
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-money/column-type-money.component.html +40 -0
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-money/column-type-money.component.ts +17 -0
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-number/column-type-number.component.html +25 -0
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-number/column-type-number.component.ts +14 -0
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-progressbar/column-type-progressbar.component.html +28 -0
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-progressbar/column-type-progressbar.component.ts +13 -0
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-sino/column-type-sino.component.html +30 -0
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-sino/column-type-sino.component.ts +38 -0
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-text/column-type-text.component.html +97 -0
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-text/column-type-text.component.ts +43 -0
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type.component.html +26 -0
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type.component.ts +36 -0
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type.module.ts +54 -0
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/tabla-mantenimiento-column-defs.component.html +76 -0
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/tabla-mantenimiento-column-defs.component.ts +67 -0
- package/tabla-mantenimiento/tabla-mantenimiento-menu/tabla-mantenimiento-menu.component.html +7 -0
- package/tabla-mantenimiento/tabla-mantenimiento-menu/tabla-mantenimiento-menu.component.ts +39 -0
- package/tabla-mantenimiento/tabla-mantenimiento.component.html +385 -0
- package/tabla-mantenimiento/tabla-mantenimiento.component.ts +951 -0
- package/tabla-mantenimiento/tabla-mantenimiento.functions.ts +57 -0
- package/tabla-mantenimiento/tabla-mantenimiento.service.ts +44 -0
- package/tabla-mantenimiento/table-util.ts +49 -0
- package/tabla-mantenimiento.zip +0 -0
- package/tsconfig.lib.json +16 -0
- package/tsconfig.lib.prod.json +11 -0
- package/tsconfig.spec.json +15 -0
- package/yarn-error.log +68 -0
- package/dialog-flotante/dialog-flotante.component.d.ts +0 -32
- package/dialog-flotante/dialog-flotante.interface.d.ts +0 -11
- package/dialog-flotante/index.d.ts +0 -5
- package/fesm2022/jvsoft-components-dialog-flotante.mjs +0 -130
- package/fesm2022/jvsoft-components-dialog-flotante.mjs.map +0 -1
- package/fesm2022/jvsoft-components-lista-arbol.mjs +0 -266
- package/fesm2022/jvsoft-components-lista-arbol.mjs.map +0 -1
- package/fesm2022/jvsoft-components-luces-navidad.mjs +0 -33
- package/fesm2022/jvsoft-components-luces-navidad.mjs.map +0 -1
- package/fesm2022/jvsoft-components-mat-suffix-search-button.mjs +0 -47
- package/fesm2022/jvsoft-components-mat-suffix-search-button.mjs.map +0 -1
- package/fesm2022/jvsoft-components-menu.mjs +0 -102
- package/fesm2022/jvsoft-components-menu.mjs.map +0 -1
- package/fesm2022/jvsoft-components-tabla-mantenimiento-components-progress-bar.mjs +0 -91
- package/fesm2022/jvsoft-components-tabla-mantenimiento-components-progress-bar.mjs.map +0 -1
- package/fesm2022/jvsoft-components-tabla-mantenimiento.mjs +0 -1801
- package/fesm2022/jvsoft-components-tabla-mantenimiento.mjs.map +0 -1
- package/fesm2022/jvsoft-components.mjs +0 -2309
- package/fesm2022/jvsoft-components.mjs.map +0 -1
- package/lista-arbol/index.d.ts +0 -5
- package/lista-arbol/lista-arbol.component.d.ts +0 -58
- package/lista-arbol/lista-arbol.functions.d.ts +0 -1
- package/luces-navidad/index.d.ts +0 -5
- package/luces-navidad/luces-navidad.component.d.ts +0 -11
- package/mat-suffix-search-button/index.d.ts +0 -5
- package/mat-suffix-search-button/mat-suffix-search-button.component.d.ts +0 -12
- package/menu/index.d.ts +0 -5
- package/menu/menu.component.d.ts +0 -25
- package/menu/menu.interface.d.ts +0 -16
- package/src/styles/base-jvsoft-components.css +0 -9
- package/tabla-mantenimiento/classes/data-model.d.ts +0 -25
- package/tabla-mantenimiento/components/progress-bar/index.d.ts +0 -5
- package/tabla-mantenimiento/components/progress-bar/progress-bar.component.d.ts +0 -30
- package/tabla-mantenimiento/components/progress-bar/public-api.d.ts +0 -1
- package/tabla-mantenimiento/index.d.ts +0 -5
- package/tabla-mantenimiento/interfaces/global/no-export.d.ts +0 -2
- package/tabla-mantenimiento/mat-row-keyboard-selection.directive.d.ts +0 -19
- package/tabla-mantenimiento/pipes/no-sanitize.pipe.d.ts +0 -10
- package/tabla-mantenimiento/pipes/zero-fill.pipe.d.ts +0 -8
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-date/column-type-date.component.d.ts +0 -8
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-icons/column-type-icons.component.d.ts +0 -9
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-money/column-type-money.component.d.ts +0 -9
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-number/column-type-number.component.d.ts +0 -8
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-progressbar/column-type-progressbar.component.d.ts +0 -8
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-sino/column-type-sino.component.d.ts +0 -9
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-text/column-type-text.component.d.ts +0 -8
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type.component.d.ts +0 -18
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type.module.d.ts +0 -23
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/tabla-mantenimiento-column-defs.component.d.ts +0 -21
- package/tabla-mantenimiento/tabla-mantenimiento-menu/tabla-mantenimiento-menu.component.d.ts +0 -18
- package/tabla-mantenimiento/tabla-mantenimiento.component.d.ts +0 -147
- package/tabla-mantenimiento/tabla-mantenimiento.functions.d.ts +0 -5
- package/tabla-mantenimiento/tabla-mantenimiento.service.d.ts +0 -8
- package/tabla-mantenimiento/table-util.d.ts +0 -11
- /package/dialog-flotante/{public-api.d.ts → public-api.ts} +0 -0
- /package/lista-arbol/{public-api.d.ts → public-api.ts} +0 -0
- /package/luces-navidad/{public-api.d.ts → public-api.ts} +0 -0
- /package/mat-suffix-search-button/{public-api.d.ts → public-api.ts} +0 -0
- /package/menu/{public-api.d.ts → public-api.ts} +0 -0
- /package/tabla-mantenimiento/interfaces/global/{index.d.ts → index.ts} +0 -0
- /package/tabla-mantenimiento/interfaces/{index.d.ts → index.ts} +0 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<ng-template #cellTemplate let-row="row">
|
|
2
|
+
<jvs-progress-bar
|
|
3
|
+
[textoCentrado]="!!column.progressbar.textoCentrado"
|
|
4
|
+
[porcentaje]="column.progressbar.porcentaje(row)"
|
|
5
|
+
[coloresValor]="column.progressbar.coloresValor"
|
|
6
|
+
[formatoNumero]="column.progressbar.formatoNumero"
|
|
7
|
+
[textoMostrar]="column.progressbar.textoMostrar ? column.progressbar.textoMostrar(row) : ''"
|
|
8
|
+
></jvs-progress-bar>
|
|
9
|
+
</ng-template>
|
|
10
|
+
|
|
11
|
+
<ng-container matColumnDef="{{ column.property }}">
|
|
12
|
+
<!-- Definición del encabezado de la columna -->
|
|
13
|
+
<th *matHeaderCellDef [ngClass]="column.cssClassesTH" class="uppercase text-center" mat-header-cell mat-sort-header
|
|
14
|
+
[disabled]="column.sort === false">
|
|
15
|
+
<span [innerHTML]="column.label ?? ''">{{ column.label }} </span>
|
|
16
|
+
</th>
|
|
17
|
+
|
|
18
|
+
<!-- Cuerpo de la celda, definido por los hijos -->
|
|
19
|
+
<td *matCellDef="let row" [ngClass]="column.cssClasses" mat-cell (click)="accionClick(row, $event)">
|
|
20
|
+
|
|
21
|
+
<ng-container [ngTemplateOutlet]="cellTemplate" [ngTemplateOutletContext]="{row}"></ng-container>
|
|
22
|
+
|
|
23
|
+
</td>
|
|
24
|
+
|
|
25
|
+
<th *matFooterCellDef [ngClass]="column.cssFooterClasses" mat-footer-cell>
|
|
26
|
+
{{ column.transformarFooter ? column.transformarFooter() : '' }}
|
|
27
|
+
</th>
|
|
28
|
+
</ng-container>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {Component, Input} from '@angular/core';
|
|
2
|
+
import {ColumnaProgress} from '../../../interfaces';
|
|
3
|
+
import {ColumnTypeComponent} from '../column-type.component';
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
selector: 'jvs-column-type-progressbar',
|
|
7
|
+
standalone: false,
|
|
8
|
+
templateUrl: './column-type-progressbar.component.html'
|
|
9
|
+
})
|
|
10
|
+
export class ColumnTypeProgressbarComponent<T> extends ColumnTypeComponent<T> {
|
|
11
|
+
@Input({required: true}) override column: ColumnaProgress<T> = {} as ColumnaProgress<T>;
|
|
12
|
+
|
|
13
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<ng-template #cellTemplate let-row="row">
|
|
2
|
+
<mat-icon *ngIf="[column.yesValue, 1, true].includes(row[column.property])"
|
|
3
|
+
[svgIcon]="column.yesIcon ?? 'yes_no:yes'" class="icon-sm"
|
|
4
|
+
[matTooltip]="column.yesTooltip ?? undefined"
|
|
5
|
+
></mat-icon>
|
|
6
|
+
<mat-icon *ngIf="[column.noValue, 0, false].includes(row[column.property])" [svgIcon]="column.noIcon ?? 'yes_no:no'"
|
|
7
|
+
class="icon-sm"
|
|
8
|
+
[matTooltip]="column.noTooltip ?? undefined"
|
|
9
|
+
></mat-icon>
|
|
10
|
+
<span class="cdk-visually-hidden">{{ row[column.property] }}</span>
|
|
11
|
+
</ng-template>
|
|
12
|
+
|
|
13
|
+
<ng-container matColumnDef="{{ column.property }}">
|
|
14
|
+
<!-- Definición del encabezado de la columna -->
|
|
15
|
+
<th *matHeaderCellDef [ngClass]="column.cssClassesTH" class="uppercase text-center" mat-header-cell mat-sort-header
|
|
16
|
+
[disabled]="column.sort === false">
|
|
17
|
+
<span [innerHTML]="column.label ?? ''">{{ column.label }} </span>
|
|
18
|
+
</th>
|
|
19
|
+
|
|
20
|
+
<!-- Cuerpo de la celda, definido por los hijos -->
|
|
21
|
+
<td *matCellDef="let row" [ngClass]="column.cssClasses" mat-cell (click)="accionClick(row, $event)">
|
|
22
|
+
|
|
23
|
+
<ng-container [ngTemplateOutlet]="cellTemplate" [ngTemplateOutletContext]="{row}"></ng-container>
|
|
24
|
+
|
|
25
|
+
</td>
|
|
26
|
+
|
|
27
|
+
<th *matFooterCellDef [ngClass]="column.cssFooterClasses" mat-footer-cell>
|
|
28
|
+
{{ column.transformarFooter ? column.transformarFooter() : '' }}
|
|
29
|
+
</th>
|
|
30
|
+
</ng-container>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import {Component, inject, Input} from '@angular/core';
|
|
2
|
+
|
|
3
|
+
import {MatIconRegistry} from '@angular/material/icon';
|
|
4
|
+
import {DomSanitizer} from '@angular/platform-browser';
|
|
5
|
+
import {ColumnaYesNo} from '../../../interfaces';
|
|
6
|
+
import {ColumnTypeComponent} from '../column-type.component';
|
|
7
|
+
import {MatTable} from '@angular/material/table';
|
|
8
|
+
|
|
9
|
+
const YES_ICON = `
|
|
10
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M21 7L9 19l-5.5-5.5l1.41-1.41L9 16.17L19.59 5.59z"/></svg>
|
|
11
|
+
`;
|
|
12
|
+
const NO_ICON = `
|
|
13
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12z"/></svg>
|
|
14
|
+
`;
|
|
15
|
+
|
|
16
|
+
@Component({
|
|
17
|
+
selector: 'jvs-column-type-sino',
|
|
18
|
+
standalone: false,
|
|
19
|
+
templateUrl: './column-type-sino.component.html'
|
|
20
|
+
})
|
|
21
|
+
export class ColumnTypeSinoComponent<T> extends ColumnTypeComponent<T> {
|
|
22
|
+
@Input({required: true}) override column: ColumnaYesNo<T> = {} as ColumnaYesNo<T>; // 🟢 Solución
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
constructor() {
|
|
26
|
+
super(inject(MatTable)); // 🟢 Llamar al constructor del padre
|
|
27
|
+
const iconRegistry = inject(MatIconRegistry);
|
|
28
|
+
const sanitizer = inject(DomSanitizer);
|
|
29
|
+
|
|
30
|
+
// Note that we provide the icon here as a string literal here due to a limitation in
|
|
31
|
+
// Stackblitz. If you want to provide the icon from a URL, you can use:
|
|
32
|
+
// `iconRegistry.addSvgIcon('thumbs-up', sanitizer.bypassSecurityTrustResourceUrl('icon.svg'));`
|
|
33
|
+
iconRegistry.addSvgIconLiteralInNamespace('yes_no', 'yes', sanitizer.bypassSecurityTrustHtml(YES_ICON));
|
|
34
|
+
iconRegistry.addSvgIconLiteralInNamespace('yes_no', 'no', sanitizer.bypassSecurityTrustHtml(NO_ICON));
|
|
35
|
+
// iconRegistry.addSvgIconLiteral('yesIcon', sanitizer.bypassSecurityTrustHtml(YES_ICON));
|
|
36
|
+
// iconRegistry.addSvgIconLiteral('noIcon', sanitizer.bypassSecurityTrustHtml(NO_ICON));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
<ng-template #cellTemplate let-row="row">
|
|
2
|
+
<div *ngIf="column.innerHTML; else sinInnerHTML" [class]="column.text?.cssContenedor" [ngStyle]="column.text?.cssStyle" class="hover:!max-h-max"
|
|
3
|
+
[innerHTML]="column.innerHTML(row) | noSanitize">
|
|
4
|
+
</div>
|
|
5
|
+
<ng-template #sinInnerHTML>
|
|
6
|
+
<ng-container *ngIf="column.text && column.text?.separador else campoTextNormal">
|
|
7
|
+
<div [class]="column.text?.cssContenedor">
|
|
8
|
+
<ng-container
|
|
9
|
+
*ngFor="let itm of ((column.transformar ? column.transformar(row) : row[column.property]) ?? '').split(column.text.separador)">
|
|
10
|
+
<ng-template *ngIf="column.property" [ngTemplateOutlet]="tipoDatoString"
|
|
11
|
+
[ngTemplateOutletContext]="{ fila: column, tipo: 'text', value: itm, class: column.textCss, row: row }"></ng-template>
|
|
12
|
+
</ng-container>
|
|
13
|
+
</div>
|
|
14
|
+
</ng-container>
|
|
15
|
+
<ng-template #campoTextNormal>
|
|
16
|
+
<ng-template *ngIf="column.property" [ngTemplateOutlet]="tipoDatoString"
|
|
17
|
+
[ngTemplateOutletContext]="{ fila: column, tipo: 'text', value: (column.transformar ? column.transformar(row) : row[column.property]), class: column.textCss, row: row }"></ng-template>
|
|
18
|
+
</ng-template>
|
|
19
|
+
</ng-template>
|
|
20
|
+
</ng-template>
|
|
21
|
+
|
|
22
|
+
<ng-container matColumnDef="{{ column.property }}">
|
|
23
|
+
<!-- Definición del encabezado de la columna -->
|
|
24
|
+
<th *matHeaderCellDef [ngClass]="column.cssClassesTH" class="uppercase text-center" mat-header-cell mat-sort-header
|
|
25
|
+
[disabled]="column.sort === false">
|
|
26
|
+
<span [innerHTML]="column.label ?? ''">{{ column.label }} </span>
|
|
27
|
+
</th>
|
|
28
|
+
|
|
29
|
+
<!-- Cuerpo de la celda, definido por los hijos -->
|
|
30
|
+
<td *matCellDef="let row" [ngClass]="column.cssClasses" mat-cell (click)="accionClick(row, $event)">
|
|
31
|
+
|
|
32
|
+
<ng-container [ngTemplateOutlet]="cellTemplate" [ngTemplateOutletContext]="{row}"></ng-container>
|
|
33
|
+
|
|
34
|
+
</td>
|
|
35
|
+
|
|
36
|
+
<th *matFooterCellDef [ngClass]="column.cssFooterClasses" mat-footer-cell>
|
|
37
|
+
{{ column.transformarFooter ? column.transformarFooter() : '' }}
|
|
38
|
+
</th>
|
|
39
|
+
</ng-container>
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
<!--<ng-container matColumnDef="{{ column.property }}">
|
|
43
|
+
<th *matHeaderCellDef [ngClass]="column.cssClassesTH" class="uppercase text-center" mat-header-cell mat-sort-header
|
|
44
|
+
[disabled]="column.sort === false">
|
|
45
|
+
<span [innerHTML]="column.label ?? ''">{{ column.label }} </span>
|
|
46
|
+
</th>
|
|
47
|
+
<ng-container *ngIf="column.innerHTML; else sinInnerHTML">
|
|
48
|
+
<td *matCellDef="let row" [ngClass]="column.cssClasses" mat-cell (click)="accionClick(column, row, $event)">
|
|
49
|
+
<div [class]="column.text?.cssContenedor" [ngStyle]="column.text?.cssStyle" class="hover:!max-h-max"
|
|
50
|
+
[innerHTML]="column.innerHTML(row) | noSanitize">
|
|
51
|
+
|
|
52
|
+
</div>
|
|
53
|
+
</td>
|
|
54
|
+
</ng-container>
|
|
55
|
+
<ng-template #sinInnerHTML>
|
|
56
|
+
<td *matCellDef="let row" [ngClass]="column.cssClasses" mat-cell>
|
|
57
|
+
<ng-container *ngIf="column.text && column.text?.separador else campoTextNormal">
|
|
58
|
+
<div [class]="column.text?.cssContenedor">
|
|
59
|
+
<ng-container
|
|
60
|
+
*ngFor="let itm of ((column.transformar ? column.transformar(row) : row[column.property]) ?? '').split(column.text.separador)">
|
|
61
|
+
<ng-template *ngIf="column.property" [ngTemplateOutlet]="tipoDatoString"
|
|
62
|
+
[ngTemplateOutletContext]="{ fila: column, tipo: 'text', value: itm, class: column.textCss, row: row }"></ng-template>
|
|
63
|
+
</ng-container>
|
|
64
|
+
</div>
|
|
65
|
+
</ng-container>
|
|
66
|
+
<ng-template #campoTextNormal>
|
|
67
|
+
<ng-template *ngIf="column.property" [ngTemplateOutlet]="tipoDatoString"
|
|
68
|
+
[ngTemplateOutletContext]="{ fila: column, tipo: 'text', value: (column.transformar ? column.transformar(row) : row[column.property]), class: column.textCss, row: row }"></ng-template>
|
|
69
|
+
</ng-template>
|
|
70
|
+
</td>
|
|
71
|
+
</ng-template>
|
|
72
|
+
<th *matFooterCellDef [ngClass]="column.cssFooterClasses" style="height: unset !important;" mat-footer-cell
|
|
73
|
+
[innerHTML]="column.transformarFooter ? column.transformarFooter() : ''">
|
|
74
|
+
</th>
|
|
75
|
+
</ng-container>-->
|
|
76
|
+
|
|
77
|
+
<ng-template #tipoDatoString let-row="row" let-fila="fila" let-tipo="tipo" let-value="value" let-format="format"
|
|
78
|
+
let-clase="class">
|
|
79
|
+
<ng-container [ngSwitch]="tipo">
|
|
80
|
+
<ng-container *ngSwitchCase="'text'"><span [ngClass]="clase" *ngIf="value"
|
|
81
|
+
(click)="accionClick(row, $event)">
|
|
82
|
+
<span *ngIf="!fila.zeroFill">{{ value }}</span>
|
|
83
|
+
<span *ngIf="fila.zeroFill">{{ value | zeroFill: fila.zeroFill }}</span>
|
|
84
|
+
</span></ng-container>
|
|
85
|
+
<ng-container *ngSwitchCase="'date'"><span [ngClass]="clase" *ngIf="value"
|
|
86
|
+
(click)="accionClick(row, $event)">{{ value | date: (format || 'dd/MM/yyyy') }}</span></ng-container>
|
|
87
|
+
<ng-container *ngSwitchCase="'number'"><span [ngClass]="clase" *ngIf="value"
|
|
88
|
+
(click)="accionClick(row, $event)">{{ value | number: (format || '0.0-2') }}</span></ng-container>
|
|
89
|
+
<ng-container *ngSwitchCase="'money'"><span [ngClass]="clase"
|
|
90
|
+
[class.text-sky-700]="(value * 1) >= 0" [class.text-red-700]="(value * 1) < 0"
|
|
91
|
+
*ngIf="value" (click)="accionClick(row, $event)">{{ value | number: (format || '1.2-2') }}</span>
|
|
92
|
+
</ng-container>
|
|
93
|
+
|
|
94
|
+
<!-- <span [ngClass]="class" *ngSwitchCase="'date'">{{ value | date: (format || 'dd/MM/yyyy') }}</span>-->
|
|
95
|
+
<!-- <span [ngClass]="class" *ngSwitchCase="'number'">{{ value | number: (format || '0.0-2') }}</span>-->
|
|
96
|
+
</ng-container>
|
|
97
|
+
</ng-template>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import {Component, Input} from '@angular/core';
|
|
2
|
+
import {ColumnTypeComponent} from '../column-type.component';
|
|
3
|
+
import {ColumnaTexto} from '../../../interfaces';
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
selector: 'jvs-column-type-text',
|
|
7
|
+
templateUrl: './column-type-text.component.html',
|
|
8
|
+
standalone: false,
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
export class ColumnTypeTextComponent<T> extends ColumnTypeComponent<T> {
|
|
12
|
+
@Input({required: true}) override column: ColumnaTexto<T> = {} as ColumnaTexto<T>; // 🟢 Solución
|
|
13
|
+
|
|
14
|
+
// @ViewChild('titleTemplate', {static: true}) titleTemplateRef!: TemplateRef<any>;
|
|
15
|
+
// @ViewChild('cellTemplate', {static: true}) cellTemplateRef!: TemplateRef<any>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// export class ColumnTypeTextComponent implements OnInit, AfterViewInit {
|
|
19
|
+
// @Input({required: true}) column!: ColumnaTexto<any>;
|
|
20
|
+
// @ViewChild(MatColumnDef, {static: true}) columnDef!: MatColumnDef;
|
|
21
|
+
//
|
|
22
|
+
// constructor(
|
|
23
|
+
// @Optional() public table: MatTable<any>,
|
|
24
|
+
// ) {
|
|
25
|
+
// }
|
|
26
|
+
//
|
|
27
|
+
// ngOnInit() {
|
|
28
|
+
// }
|
|
29
|
+
//
|
|
30
|
+
// ngAfterViewInit() {
|
|
31
|
+
// if (this.columnDef) {
|
|
32
|
+
// this.table.addColumnDef(this.columnDef);
|
|
33
|
+
// }
|
|
34
|
+
// }
|
|
35
|
+
//
|
|
36
|
+
// accionClick(column: any, item: any, event: any) {
|
|
37
|
+
// if (column.click) {
|
|
38
|
+
// column.click(item);
|
|
39
|
+
// event.stopPropagation();
|
|
40
|
+
// }
|
|
41
|
+
// return false;
|
|
42
|
+
// }
|
|
43
|
+
// }
|
package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type.component.html
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<ng-container matColumnDef="{{ column.property }}">
|
|
2
|
+
<!-- Definición del encabezado de la columna -->
|
|
3
|
+
<th *matHeaderCellDef [ngClass]="column.cssClassesTH" class="uppercase text-center" mat-header-cell mat-sort-header
|
|
4
|
+
[disabled]="column.sort === false">
|
|
5
|
+
<ng-container *ngIf="columnTitleTemplate; else defaultTitle">
|
|
6
|
+
<ng-container *ngTemplateOutlet="columnTitleTemplate; context: { column: column }"></ng-container>
|
|
7
|
+
</ng-container>
|
|
8
|
+
<ng-template #defaultTitle>
|
|
9
|
+
<span [innerHTML]="column.label ?? ''">{{ column.label }} </span>
|
|
10
|
+
</ng-template>
|
|
11
|
+
</th>
|
|
12
|
+
|
|
13
|
+
<!-- Cuerpo de la celda, definido por los hijos -->
|
|
14
|
+
<td *matCellDef="let row" [ngClass]="column.cssClasses" mat-cell (click)="accionClick(row, $event)">
|
|
15
|
+
<ng-container *ngTemplateOutlet="cellTemplate; context: { row: row, column: column }"></ng-container>
|
|
16
|
+
</td>
|
|
17
|
+
|
|
18
|
+
<th *matFooterCellDef [ngClass]="column.cssFooterClasses" mat-footer-cell>
|
|
19
|
+
<ng-container *ngIf="columnFooterTemplate; else defaultFooter">
|
|
20
|
+
<ng-container *ngTemplateOutlet="columnFooterTemplate; context: { column: column }"></ng-container>
|
|
21
|
+
</ng-container>
|
|
22
|
+
<ng-template #defaultFooter>
|
|
23
|
+
{{ column.transformarFooter ? column.transformarFooter() : '' }}
|
|
24
|
+
</ng-template>
|
|
25
|
+
</th>
|
|
26
|
+
</ng-container>
|
package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type.component.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {AfterViewInit, Component, Input, OnInit, Optional, TemplateRef, ViewChild} from '@angular/core';
|
|
2
|
+
import {MatColumnDef, MatTable} from '@angular/material/table';
|
|
3
|
+
import {ColumnaTabla} from '../../interfaces';
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
selector: 'jvs-column-type',
|
|
7
|
+
templateUrl: './column-type.component.html',
|
|
8
|
+
standalone: false,
|
|
9
|
+
})
|
|
10
|
+
export class ColumnTypeComponent<T> implements OnInit, AfterViewInit {
|
|
11
|
+
@Input({required: true}) column!: ColumnaTabla<T>;
|
|
12
|
+
@ViewChild(MatColumnDef, {static: true}) columnDef!: MatColumnDef;
|
|
13
|
+
@Input() columnTitleTemplate?: TemplateRef<any>; // Permite personalizar títulos
|
|
14
|
+
@Input() columnFooterTemplate?: TemplateRef<any>; // Permite personalizar footer
|
|
15
|
+
@Input() cellTemplate!: TemplateRef<any>; // Se usa para el contenido de las celdas
|
|
16
|
+
|
|
17
|
+
constructor(@Optional() private table: MatTable<T>) {
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
ngOnInit() {
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
ngAfterViewInit() {
|
|
24
|
+
if (this.columnDef) {
|
|
25
|
+
this.table.addColumnDef(this.columnDef);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
accionClick(item: T, event: Event) {
|
|
30
|
+
if (this.column.click) {
|
|
31
|
+
this.column.click(item);
|
|
32
|
+
event.stopPropagation();
|
|
33
|
+
}
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import {NgModule} from '@angular/core';
|
|
2
|
+
import {CommonModule} from '@angular/common';
|
|
3
|
+
import {MatTableModule} from '@angular/material/table';
|
|
4
|
+
import {MatSortModule} from '@angular/material/sort';
|
|
5
|
+
import {ColumnTypeNumberComponent} from './column-type-number/column-type-number.component';
|
|
6
|
+
import {ColumnTypeDateComponent} from './column-type-date/column-type-date.component';
|
|
7
|
+
import {MatRipple} from '@angular/material/core';
|
|
8
|
+
import {MatTooltipModule} from '@angular/material/tooltip';
|
|
9
|
+
import {MatIcon} from '@angular/material/icon';
|
|
10
|
+
import {ColumnTypeSinoComponent} from './column-type-sino/column-type-sino.component';
|
|
11
|
+
import {ColumnTypeProgressbarComponent} from './column-type-progressbar/column-type-progressbar.component';
|
|
12
|
+
import {NoSanitizePipe} from '../../pipes/no-sanitize.pipe';
|
|
13
|
+
import {ZeroFillPipe} from '../../pipes/zero-fill.pipe';
|
|
14
|
+
import {ProgressBarComponent} from '../../components/progress-bar';
|
|
15
|
+
import {ColumnTypeTextComponent} from './column-type-text/column-type-text.component';
|
|
16
|
+
import {ColumnTypeMoneyComponent} from './column-type-money/column-type-money.component';
|
|
17
|
+
import {ColumnTypeIconsComponent} from './column-type-icons/column-type-icons.component';
|
|
18
|
+
import {ColumnTypeComponent} from './column-type.component';
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@NgModule({
|
|
22
|
+
declarations: [
|
|
23
|
+
ColumnTypeComponent,
|
|
24
|
+
ColumnTypeTextComponent,
|
|
25
|
+
ColumnTypeMoneyComponent,
|
|
26
|
+
ColumnTypeNumberComponent,
|
|
27
|
+
ColumnTypeDateComponent,
|
|
28
|
+
ColumnTypeIconsComponent,
|
|
29
|
+
ColumnTypeSinoComponent,
|
|
30
|
+
ColumnTypeProgressbarComponent,
|
|
31
|
+
],
|
|
32
|
+
imports: [
|
|
33
|
+
CommonModule,
|
|
34
|
+
MatTableModule,
|
|
35
|
+
MatSortModule,
|
|
36
|
+
MatTooltipModule,
|
|
37
|
+
NoSanitizePipe,
|
|
38
|
+
ZeroFillPipe,
|
|
39
|
+
MatRipple,
|
|
40
|
+
MatIcon,
|
|
41
|
+
ProgressBarComponent,
|
|
42
|
+
],
|
|
43
|
+
exports: [
|
|
44
|
+
ColumnTypeTextComponent,
|
|
45
|
+
ColumnTypeMoneyComponent,
|
|
46
|
+
ColumnTypeNumberComponent,
|
|
47
|
+
ColumnTypeDateComponent,
|
|
48
|
+
ColumnTypeIconsComponent,
|
|
49
|
+
ColumnTypeSinoComponent,
|
|
50
|
+
ColumnTypeProgressbarComponent,
|
|
51
|
+
]
|
|
52
|
+
})
|
|
53
|
+
export class ColumnTypeModule {
|
|
54
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
<ng-content></ng-content>
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
<ng-container *ngFor="let column of colDetalle; trackBy: trackByProperty">
|
|
6
|
+
|
|
7
|
+
<ng-container *ngIf="column.type === 'expandir'" [matColumnDef]="column.property">
|
|
8
|
+
|
|
9
|
+
<th *matHeaderCellDef class="w-4" mat-header-cell> <span [innerHTML]="column.label ?? ''">{{ column.label }} </span></th>
|
|
10
|
+
<td *matCellDef="let row" class="w-4 text-center" mat-cell>
|
|
11
|
+
<button type="button" class="boton-circular text-primary-contrast bg-primary mat-elevation-z2" matRipple
|
|
12
|
+
*ngIf="column.click"
|
|
13
|
+
(click)="column.click(row); row.isExpanded = !row.isExpanded; $event.stopPropagation()"
|
|
14
|
+
matTooltip="Expandir / Contraer">
|
|
15
|
+
<mat-icon class="icon-xs" [svgIcon]="(row.isExpanded ? 'roundExpandLess' : 'roundExpandMore')"></mat-icon>
|
|
16
|
+
</button>
|
|
17
|
+
<button type="button" class="boton-circular text-primary-contrast bg-primary mat-elevation-z2" matRipple
|
|
18
|
+
*ngIf="!column.click"
|
|
19
|
+
(click)="row.isExpanded = !row.isExpanded; $event.stopPropagation()"
|
|
20
|
+
matTooltip="Expandir / Contraer">
|
|
21
|
+
<mat-icon class="icon-xs" [svgIcon]="(row.isExpanded ? 'roundExpandLess' : 'roundExpandMore')"></mat-icon>
|
|
22
|
+
</button>
|
|
23
|
+
</td>
|
|
24
|
+
<td *matFooterCellDef [ngClass]="column.cssFooterClasses" mat-footer-cell></td>
|
|
25
|
+
|
|
26
|
+
</ng-container>
|
|
27
|
+
<ng-container *ngIf="column.type === 'checkbox'" [matColumnDef]="column.property">
|
|
28
|
+
|
|
29
|
+
<th *matHeaderCellDef [ngClass]="column.cssClassesTH" class="w-4 text-center" mat-header-cell>
|
|
30
|
+
<mat-checkbox *ngIf="chkLista"
|
|
31
|
+
(click)="$event.stopPropagation()"
|
|
32
|
+
(change)="chkLista.checkbox.establecerTodos($event.checked)"
|
|
33
|
+
[indeterminate]="chkLista.checkbox.algunosActivos"
|
|
34
|
+
[checked]="chkLista.checkbox.todosActivos"
|
|
35
|
+
></mat-checkbox>
|
|
36
|
+
</th>
|
|
37
|
+
<td *matCellDef="let row" class="w-4 text-center" mat-cell>
|
|
38
|
+
<mat-checkbox *ngIf="chkLista"
|
|
39
|
+
(click)="$event.stopPropagation()"
|
|
40
|
+
[(ngModel)]="chkLista.modelosChk[chkLista.generarId(row, (column.chkField ?? column.property), column.chkFieldSeparador)]"
|
|
41
|
+
[ngModelOptions]="{standalone: true}"
|
|
42
|
+
></mat-checkbox>
|
|
43
|
+
|
|
44
|
+
</td>
|
|
45
|
+
<td *matFooterCellDef [ngClass]="column.cssFooterClasses" mat-footer-cell></td>
|
|
46
|
+
|
|
47
|
+
</ng-container>
|
|
48
|
+
<ng-container *ngIf="column.type === 'estiloEstablecido'" [matColumnDef]="column.property">
|
|
49
|
+
|
|
50
|
+
<th *matHeaderCellDef [ngClass]="column.cssClassesTH" class="uppercase text-center" mat-header-cell
|
|
51
|
+
mat-sort-header
|
|
52
|
+
[disabled]="column.sort === false">
|
|
53
|
+
<span [innerHTML]="column.label ?? ''">{{ column.label }} </span>
|
|
54
|
+
<span class="text-red-900 font-bold bg-white">CONFIGURAR ESTILO ESTABLECIDO</span>
|
|
55
|
+
</th>
|
|
56
|
+
<td *matCellDef="let row" [ngClass]="column.cssClasses" mat-cell>
|
|
57
|
+
{{ column.property }}
|
|
58
|
+
<span class="text-red-900 font-bold bg-white">CONFIGURAR ESTILO ESTABLECIDO</span>
|
|
59
|
+
</td>
|
|
60
|
+
<th *matFooterCellDef [ngClass]="column.cssFooterClasses" style="height: unset !important;" mat-footer-cell
|
|
61
|
+
[innerHTML]="column.transformarFooter ? column.transformarFooter() : ''">
|
|
62
|
+
</th>
|
|
63
|
+
|
|
64
|
+
</ng-container>
|
|
65
|
+
|
|
66
|
+
<jvs-column-type-text *ngIf="column.type == 'text'" [column]="column"></jvs-column-type-text>
|
|
67
|
+
<jvs-column-type-money *ngIf="column.type == 'money'" [column]="column"></jvs-column-type-money>
|
|
68
|
+
<jvs-column-type-number *ngIf="column.type == 'number'" [column]="column"></jvs-column-type-number>
|
|
69
|
+
<jvs-column-type-date *ngIf="column.type == 'date'" [column]="column"></jvs-column-type-date>
|
|
70
|
+
<jvs-column-type-icons *ngIf="column.type == 'icons'" [column]="column"></jvs-column-type-icons>
|
|
71
|
+
<jvs-column-type-sino *ngIf="column.type == 'yes_no'" [column]="column"></jvs-column-type-sino>
|
|
72
|
+
<jvs-column-type-progressbar *ngIf="column.type == 'progress'" [column]="column"></jvs-column-type-progressbar>
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
</ng-container>
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import {AfterContentInit, ChangeDetectorRef, Component, ContentChildren, EventEmitter, Input, Optional, Output, QueryList, ViewChildren} from '@angular/core';
|
|
2
|
+
import {CommonModule} from '@angular/common';
|
|
3
|
+
import {MatColumnDef, MatTable, MatTableModule} from '@angular/material/table';
|
|
4
|
+
import {MatCheckboxModule} from '@angular/material/checkbox';
|
|
5
|
+
import {MatIconModule} from '@angular/material/icon';
|
|
6
|
+
import {MatRippleModule} from '@angular/material/core';
|
|
7
|
+
import {MatSortModule} from '@angular/material/sort';
|
|
8
|
+
import {MatTooltipModule} from '@angular/material/tooltip';
|
|
9
|
+
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
|
|
10
|
+
import {ColumnaTabla} from '../interfaces/global';
|
|
11
|
+
import {DataModel} from '../classes/data-model';
|
|
12
|
+
import {ColumnTypeModule} from './column-type/column-type.module';
|
|
13
|
+
|
|
14
|
+
@Component({
|
|
15
|
+
selector: 'jvs-tabla-mantenimiento-column-defs',
|
|
16
|
+
standalone: true,
|
|
17
|
+
imports: [
|
|
18
|
+
CommonModule,
|
|
19
|
+
MatCheckboxModule,
|
|
20
|
+
MatIconModule,
|
|
21
|
+
MatRippleModule,
|
|
22
|
+
MatSortModule,
|
|
23
|
+
MatTableModule,
|
|
24
|
+
MatTooltipModule,
|
|
25
|
+
ReactiveFormsModule,
|
|
26
|
+
FormsModule,
|
|
27
|
+
ColumnTypeModule,
|
|
28
|
+
|
|
29
|
+
],
|
|
30
|
+
templateUrl: './tabla-mantenimiento-column-defs.component.html',
|
|
31
|
+
styleUrls: ['./tabla-mantenimiento-column-defs.component.scss']
|
|
32
|
+
})
|
|
33
|
+
export class TablaMantenimientoColumnDefsComponent implements AfterContentInit {
|
|
34
|
+
|
|
35
|
+
@Input() objThis: any;
|
|
36
|
+
@Input() nombreColeccion: any;
|
|
37
|
+
@Input() colDetalle!: ColumnaTabla<any>[];
|
|
38
|
+
|
|
39
|
+
@Input() chkLista!: DataModel; // = new DataModel();
|
|
40
|
+
@Output() chkListaChange = new EventEmitter<DataModel>();
|
|
41
|
+
|
|
42
|
+
@ViewChildren(MatColumnDef) columnDefLocales!: QueryList<MatColumnDef>;
|
|
43
|
+
@ContentChildren(MatColumnDef, {descendants: true}) columnDefEnSubComponentes!: QueryList<MatColumnDef>;
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
constructor(
|
|
47
|
+
@Optional() public table: MatTable<any>, private cdRef: ChangeDetectorRef,
|
|
48
|
+
) {
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
ngAfterContentInit() {
|
|
52
|
+
if (this.table) {
|
|
53
|
+
this.cdRef.detectChanges();
|
|
54
|
+
this.columnDefEnSubComponentes.forEach(refCol => {
|
|
55
|
+
this.table.addColumnDef(refCol);
|
|
56
|
+
});
|
|
57
|
+
this.columnDefLocales.forEach(refCol => {
|
|
58
|
+
this.table.addColumnDef(refCol);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
trackByProperty<T>(index: number, column: ColumnaTabla<T>) {
|
|
64
|
+
return column.property;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<mat-menu #menu="matMenu">
|
|
2
|
+
<div class="mat-menu bg-white rounded mat-elevation-z8 shadow botonesContextual w-full">
|
|
3
|
+
<ng-container *ngFor="let btn of subItems">
|
|
4
|
+
<ng-container *ngTemplateOutlet="botonTemplate; context:{btn: btn, item: objThis['seleccionados'][nombreColeccion], barraSuperior: false}"></ng-container>
|
|
5
|
+
</ng-container>
|
|
6
|
+
</div>
|
|
7
|
+
</mat-menu>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import {Component, EventEmitter, Input, OnInit, Output, TemplateRef, ViewChild} from '@angular/core';
|
|
2
|
+
import {CommonModule} from '@angular/common';
|
|
3
|
+
import {MatMenu, MatMenuModule} from '@angular/material/menu';
|
|
4
|
+
import {BotonMantenimiento} from '../interfaces/global';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'jvs-tabla-mantenimiento-menu',
|
|
8
|
+
standalone: true,
|
|
9
|
+
imports: [
|
|
10
|
+
CommonModule,
|
|
11
|
+
MatMenuModule,
|
|
12
|
+
],
|
|
13
|
+
templateUrl: './tabla-mantenimiento-menu.component.html',
|
|
14
|
+
styleUrls: ['./tabla-mantenimiento-menu.component.scss']
|
|
15
|
+
})
|
|
16
|
+
export class TablaMantenimientoMenuComponent implements OnInit {
|
|
17
|
+
@Input() objThis: any;
|
|
18
|
+
@Input() nombreColeccion!: string;
|
|
19
|
+
@Input() item: any;
|
|
20
|
+
@Input() derechosActuales: any;
|
|
21
|
+
// @Input() modalPrincipal;
|
|
22
|
+
// @Input() botonDisabled = (btn: BotonMantenimiento, item: any) => [];
|
|
23
|
+
|
|
24
|
+
@Output() opcionSelecionada = new EventEmitter();
|
|
25
|
+
|
|
26
|
+
@ViewChild('menu', {static: true}) public menu!: MatMenu;
|
|
27
|
+
@Input({required: true}) subItems!: BotonMantenimiento[];
|
|
28
|
+
|
|
29
|
+
@Input({required: true}) botonTemplate!: TemplateRef<any>;
|
|
30
|
+
|
|
31
|
+
constructor(
|
|
32
|
+
) {
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
ngOnInit(): void {
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
}
|