@jvsoft/components 0.0.13-alpha.2 → 0.0.13-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/jvsoft-components-lista-arbol.mjs +2 -14
- package/fesm2022/jvsoft-components-lista-arbol.mjs.map +1 -1
- package/fesm2022/jvsoft-components-tabla-mantenimiento.mjs +18 -4
- package/fesm2022/jvsoft-components-tabla-mantenimiento.mjs.map +1 -1
- package/fesm2022/jvsoft-components.mjs +20 -18
- package/fesm2022/jvsoft-components.mjs.map +1 -1
- package/lista-arbol/lista-arbol.component.d.ts +0 -1
- package/package.json +8 -8
- package/tabla-mantenimiento/interfaces/global/otros.d.ts +1 -0
- package/tabla-mantenimiento/tabla-mantenimiento.component.d.ts +4 -0
|
@@ -32,12 +32,13 @@ import * as i4$1 from '@angular/material/tooltip';
|
|
|
32
32
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
33
33
|
import { untilDestroyed, UntilDestroy } from '@ngneat/until-destroy';
|
|
34
34
|
import moment from 'moment';
|
|
35
|
-
import { Subject, takeUntil, of, fromEvent } from 'rxjs';
|
|
36
|
-
import {
|
|
35
|
+
import { Subject, takeUntil, startWith, of, fromEvent } from 'rxjs';
|
|
36
|
+
import { filter, map, take } from 'rxjs/operators';
|
|
37
37
|
import shortHash from 'shorthash2';
|
|
38
38
|
import * as i1$1 from '@angular/platform-browser';
|
|
39
39
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
40
40
|
import * as XLSX from 'xlsx';
|
|
41
|
+
import { Router, ActivatedRoute, NavigationEnd } from '@angular/router';
|
|
41
42
|
import * as i2$2 from '@angular/cdk/overlay';
|
|
42
43
|
import * as i3$2 from '@angular/material/tree';
|
|
43
44
|
import { MatTreeModule } from '@angular/material/tree';
|
|
@@ -864,14 +865,14 @@ class TablaMantenimientoMenuComponent {
|
|
|
864
865
|
ngOnInit() {
|
|
865
866
|
}
|
|
866
867
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TablaMantenimientoMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
867
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: TablaMantenimientoMenuComponent, isStandalone: true, selector: "jvs-tabla-mantenimiento-menu", inputs: { objThis: "objThis", nombreColeccion: "nombreColeccion", item: "item", derechosActuales: "derechosActuales", subItems: "subItems", botonTemplate: "botonTemplate" }, outputs: { opcionSelecionada: "opcionSelecionada" }, viewQueries: [{ propertyName: "menu", first: true, predicate: ["menu"], descendants: true, static: true }], ngImport: i0, template: "<mat-menu #menu=\"matMenu\">\n <div class=\"mat-menu bg-white rounded mat-elevation-z8 shadow botonesContextual w-full\">\n <ng-container *ngFor=\"let btn of subItems\">\n <ng-container *ngTemplateOutlet=\"botonTemplate; context:{btn: btn, item:
|
|
868
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: TablaMantenimientoMenuComponent, isStandalone: true, selector: "jvs-tabla-mantenimiento-menu", inputs: { objThis: "objThis", nombreColeccion: "nombreColeccion", item: "item", derechosActuales: "derechosActuales", subItems: "subItems", botonTemplate: "botonTemplate" }, outputs: { opcionSelecionada: "opcionSelecionada" }, viewQueries: [{ propertyName: "menu", first: true, predicate: ["menu"], descendants: true, static: true }], ngImport: i0, template: "<mat-menu #menu=\"matMenu\">\n <div class=\"mat-menu bg-white rounded mat-elevation-z8 shadow botonesContextual w-full\">\n <ng-container *ngFor=\"let btn of subItems\">\n <ng-container *ngTemplateOutlet=\"botonTemplate; context:{btn: btn, item: item, barraSuperior: false}\"></ng-container>\n </ng-container>\n </div>\n</mat-menu>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i2$1.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }] });
|
|
868
869
|
}
|
|
869
870
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TablaMantenimientoMenuComponent, decorators: [{
|
|
870
871
|
type: Component,
|
|
871
872
|
args: [{ selector: 'jvs-tabla-mantenimiento-menu', standalone: true, imports: [
|
|
872
873
|
CommonModule,
|
|
873
874
|
MatMenuModule,
|
|
874
|
-
], template: "<mat-menu #menu=\"matMenu\">\n <div class=\"mat-menu bg-white rounded mat-elevation-z8 shadow botonesContextual w-full\">\n <ng-container *ngFor=\"let btn of subItems\">\n <ng-container *ngTemplateOutlet=\"botonTemplate; context:{btn: btn, item:
|
|
875
|
+
], template: "<mat-menu #menu=\"matMenu\">\n <div class=\"mat-menu bg-white rounded mat-elevation-z8 shadow botonesContextual w-full\">\n <ng-container *ngFor=\"let btn of subItems\">\n <ng-container *ngTemplateOutlet=\"botonTemplate; context:{btn: btn, item: item, barraSuperior: false}\"></ng-container>\n </ng-container>\n </div>\n</mat-menu>\n" }]
|
|
875
876
|
}], ctorParameters: () => [], propDecorators: { objThis: [{
|
|
876
877
|
type: Input
|
|
877
878
|
}], nombreColeccion: [{
|
|
@@ -988,6 +989,8 @@ let TablaMantenimientoComponent = class TablaMantenimientoComponent {
|
|
|
988
989
|
cdRef;
|
|
989
990
|
static nextId = 0;
|
|
990
991
|
id = `jvs-tabla-mantenimiento-id-${TablaMantenimientoComponent_1.nextId++}`;
|
|
992
|
+
router = inject(Router);
|
|
993
|
+
route = inject(ActivatedRoute);
|
|
991
994
|
get templateBotonesComunes() {
|
|
992
995
|
return this.tablaMantenimientoService.templateBotonesComunes;
|
|
993
996
|
}
|
|
@@ -1301,6 +1304,11 @@ let TablaMantenimientoComponent = class TablaMantenimientoComponent {
|
|
|
1301
1304
|
rowTooltip = (item) => '';
|
|
1302
1305
|
soloIconos = false;
|
|
1303
1306
|
ngOnInit() {
|
|
1307
|
+
this.router.events.pipe(filter(event => event instanceof NavigationEnd), startWith(null), map(() => this.getDeepestRoute(this.route)), map(route => route.snapshot.data), untilDestroyed(this)).subscribe(data => {
|
|
1308
|
+
console.log(data);
|
|
1309
|
+
this.derechosActuales = data['derechos'];
|
|
1310
|
+
this.ignorarDerechos = data['ignorarDerechos'] ?? false;
|
|
1311
|
+
});
|
|
1304
1312
|
// this.sharedService.dataRutaActual$.pipe(untilDestroyed(this)).subscribe(datRouteData => {
|
|
1305
1313
|
// if (datRouteData) {
|
|
1306
1314
|
// this.derechosActuales = datRouteData['derechos'];
|
|
@@ -1376,6 +1384,12 @@ let TablaMantenimientoComponent = class TablaMantenimientoComponent {
|
|
|
1376
1384
|
trackByFn = (index, item) => {
|
|
1377
1385
|
return this.propiedadSeleccion(item);
|
|
1378
1386
|
};
|
|
1387
|
+
getDeepestRoute(route) {
|
|
1388
|
+
while (route.firstChild) {
|
|
1389
|
+
route = route.firstChild;
|
|
1390
|
+
}
|
|
1391
|
+
return route;
|
|
1392
|
+
}
|
|
1379
1393
|
agregarBotonesExportacion() {
|
|
1380
1394
|
const fnAddBoton = (condicion, tipoBoton) => {
|
|
1381
1395
|
if (condicion) {
|
|
@@ -2237,18 +2251,6 @@ class ListaArbolComponent {
|
|
|
2237
2251
|
}
|
|
2238
2252
|
return false;
|
|
2239
2253
|
}
|
|
2240
|
-
classFila2(item) {
|
|
2241
|
-
let clases = [];
|
|
2242
|
-
if (this.campoAnulado && item[this.campoAnulado] === 1) {
|
|
2243
|
-
clases = clases.concat(this.classAnulado);
|
|
2244
|
-
}
|
|
2245
|
-
if (item?.seleccionado) {
|
|
2246
|
-
clases = clases.concat(this.classSeleccionado);
|
|
2247
|
-
}
|
|
2248
|
-
clases = clases.concat(this.condicionesClaseFila(item));
|
|
2249
|
-
item.claseFinal = clases;
|
|
2250
|
-
return clases;
|
|
2251
|
-
}
|
|
2252
2254
|
classFila(item) {
|
|
2253
2255
|
let claseFinal = [];
|
|
2254
2256
|
if (this.campoAnulado && (item[this.campoAnulado] == 1)) {
|
|
@@ -2262,7 +2264,7 @@ class ListaArbolComponent {
|
|
|
2262
2264
|
return claseFinal;
|
|
2263
2265
|
}
|
|
2264
2266
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ListaArbolComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2265
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: ListaArbolComponent, isStandalone: true, selector: "jvs-lista-arbol", inputs: { listaSuscription: "listaSuscription", nombreColeccion: "nombreColeccion", checkbox: "checkbox", expandirRecursivo: "expandirRecursivo", checkboxSeleccionados: "checkboxSeleccionados", campoId: "campoId", campoIdPadre: "campoIdPadre", campoStr: "campoStr", campoOrden: "campoOrden", strHijoContainer: "strHijoContainer", menuContextual: "menuContextual", classSeleccionado: "classSeleccionado", classAnulado: "classAnulado", campoAnulado: "campoAnulado", templateTxtData: "templateTxtData", condicionMostrar: "condicionMostrar", condicionesClaseFila: "condicionesClaseFila", selectionModel: "selectionModel", idTabla: "idTabla" }, outputs: { selectionModelChange: "selectionModelChange", seleccionado: "seleccionado", listaCheck: "listaCheck", listaCheckObj: "listaCheckObj" }, ngImport: i0, template: "<mat-tree [dataSource]=\"listaMuestraArbol\" [treeControl]=\"treeControl\">\n <mat-nested-tree-node *matTreeNodeDef=\"let node; when: hasChild\">\n <div class=\"flex flex-col trans-ease-out cursor-pointer\" matTreeNodeToggle\n [matTreeNodeToggleRecursive]=\"expandirRecursivo\">\n <ng-container [ngTemplateOutlet]=\"liDat\"\n [ngTemplateOutletContext]=\"{ node: node, nested: true }\"></ng-container>\n <div class=\"pl-4\" [class.tree-invisible]=\"!treeControl.isExpanded(node)\">\n <ng-container matTreeNodeOutlet></ng-container>\n </div>\n </div>\n </mat-nested-tree-node>\n\n <!-- Cambiar mat-tree-node plano por mat-nested-tree-node sin hijos -->\n <mat-nested-tree-node *matTreeNodeDef=\"let node\">\n <div class=\"flex flex-col trans-ease-out
|
|
2267
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: ListaArbolComponent, isStandalone: true, selector: "jvs-lista-arbol", inputs: { listaSuscription: "listaSuscription", nombreColeccion: "nombreColeccion", checkbox: "checkbox", expandirRecursivo: "expandirRecursivo", checkboxSeleccionados: "checkboxSeleccionados", campoId: "campoId", campoIdPadre: "campoIdPadre", campoStr: "campoStr", campoOrden: "campoOrden", strHijoContainer: "strHijoContainer", menuContextual: "menuContextual", classSeleccionado: "classSeleccionado", classAnulado: "classAnulado", campoAnulado: "campoAnulado", templateTxtData: "templateTxtData", condicionMostrar: "condicionMostrar", condicionesClaseFila: "condicionesClaseFila", selectionModel: "selectionModel", idTabla: "idTabla" }, outputs: { selectionModelChange: "selectionModelChange", seleccionado: "seleccionado", listaCheck: "listaCheck", listaCheckObj: "listaCheckObj" }, ngImport: i0, template: "<mat-tree [dataSource]=\"listaMuestraArbol\" [treeControl]=\"treeControl\">\n <mat-nested-tree-node *matTreeNodeDef=\"let node; when: hasChild\">\n <div class=\"flex flex-col trans-ease-out cursor-pointer\" matTreeNodeToggle\n [matTreeNodeToggleRecursive]=\"expandirRecursivo\">\n <ng-container [ngTemplateOutlet]=\"liDat\"\n [ngTemplateOutletContext]=\"{ node: node, nested: true }\"></ng-container>\n <div class=\"pl-4\" [class.tree-invisible]=\"!treeControl.isExpanded(node)\">\n <ng-container matTreeNodeOutlet></ng-container>\n </div>\n </div>\n </mat-nested-tree-node>\n\n <!-- Cambiar mat-tree-node plano por mat-nested-tree-node sin hijos -->\n <mat-nested-tree-node *matTreeNodeDef=\"let node\">\n <div class=\"flex flex-col trans-ease-out\">\n <ng-container [ngTemplateOutlet]=\"liDat\"\n [ngTemplateOutletContext]=\"{ node: node, nested: false }\"></ng-container>\n </div>\n </mat-nested-tree-node>\n</mat-tree>\n\n<ng-template #liDat let-node=\"node\" let-nested=\"nested\">\n <div class=\"flex items-center gap-0 text-sm trans-ease-out cursor-pointer p-0 w-full\"\n (contextmenu)=\"menuContextual?.abrirMenuContextual($event, node); $event.preventDefault();\"\n (click)=\"seleccionarItem(node); opcMenu({ seccion: nombreColeccion, tipo: 'ver', item: node }); menuContextual?.cerrarMenuContextual(); (nested === false) && $event.stopPropagation();\"\n [ngClass]=\"classFila(node)\">\n <mat-icon *ngIf=\"!nested\"></mat-icon>\n <mat-icon *ngIf=\"nested\"\n [svgIcon]=\"treeControl.isExpanded(node) ? 'roundExpandMore' : 'roundChevronRight'\"></mat-icon>\n\n <mat-checkbox *ngIf=\"checkbox\"\n [(ngModel)]=\"chkLista.modelosChk[node[campoId]]\"\n [ngModelOptions]=\"{ standalone: true }\"\n (click)=\"$event.stopPropagation()\"\n (change)=\"cambiarCheck(node, $event.checked); emitirModeloCheck()\"\n [checked]=\"nested ? hijosActivos('checked', node) : false\"\n [indeterminate]=\"nested ? hijosActivos('indeterminate', node) : false\">\n </mat-checkbox>\n\n <span *ngIf=\"!templateTxtData\" class=\"w-full\">{{ node[campoStr] }}</span>\n <ng-container *ngIf=\"templateTxtData\" [ngTemplateOutlet]=\"templateTxtData\"\n [ngTemplateOutletContext]=\"{ data: node, treeControl }\"></ng-container>\n </div>\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: MatTreeModule }, { kind: "directive", type: i3$2.MatNestedTreeNode, selector: "mat-nested-tree-node", inputs: ["matNestedTreeNode", "disabled", "tabIndex"], outputs: ["activation", "expandedChange"], exportAs: ["matNestedTreeNode"] }, { kind: "directive", type: i3$2.MatTreeNodeDef, selector: "[matTreeNodeDef]", inputs: ["matTreeNodeDefWhen", "matTreeNode"] }, { kind: "directive", type: i3$2.MatTreeNodeToggle, selector: "[matTreeNodeToggle]", inputs: ["matTreeNodeToggleRecursive"] }, { kind: "component", type: i3$2.MatTree, selector: "mat-tree", exportAs: ["matTree"] }, { kind: "directive", type: i3$2.MatTreeNodeOutlet, selector: "[matTreeNodeOutlet]" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i5$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"] }] });
|
|
2266
2268
|
}
|
|
2267
2269
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ListaArbolComponent, decorators: [{
|
|
2268
2270
|
type: Component,
|
|
@@ -2272,7 +2274,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
2272
2274
|
MatTreeModule,
|
|
2273
2275
|
MatIconModule,
|
|
2274
2276
|
MatCheckboxModule,
|
|
2275
|
-
], template: "<mat-tree [dataSource]=\"listaMuestraArbol\" [treeControl]=\"treeControl\">\n <mat-nested-tree-node *matTreeNodeDef=\"let node; when: hasChild\">\n <div class=\"flex flex-col trans-ease-out cursor-pointer\" matTreeNodeToggle\n [matTreeNodeToggleRecursive]=\"expandirRecursivo\">\n <ng-container [ngTemplateOutlet]=\"liDat\"\n [ngTemplateOutletContext]=\"{ node: node, nested: true }\"></ng-container>\n <div class=\"pl-4\" [class.tree-invisible]=\"!treeControl.isExpanded(node)\">\n <ng-container matTreeNodeOutlet></ng-container>\n </div>\n </div>\n </mat-nested-tree-node>\n\n <!-- Cambiar mat-tree-node plano por mat-nested-tree-node sin hijos -->\n <mat-nested-tree-node *matTreeNodeDef=\"let node\">\n <div class=\"flex flex-col trans-ease-out
|
|
2277
|
+
], template: "<mat-tree [dataSource]=\"listaMuestraArbol\" [treeControl]=\"treeControl\">\n <mat-nested-tree-node *matTreeNodeDef=\"let node; when: hasChild\">\n <div class=\"flex flex-col trans-ease-out cursor-pointer\" matTreeNodeToggle\n [matTreeNodeToggleRecursive]=\"expandirRecursivo\">\n <ng-container [ngTemplateOutlet]=\"liDat\"\n [ngTemplateOutletContext]=\"{ node: node, nested: true }\"></ng-container>\n <div class=\"pl-4\" [class.tree-invisible]=\"!treeControl.isExpanded(node)\">\n <ng-container matTreeNodeOutlet></ng-container>\n </div>\n </div>\n </mat-nested-tree-node>\n\n <!-- Cambiar mat-tree-node plano por mat-nested-tree-node sin hijos -->\n <mat-nested-tree-node *matTreeNodeDef=\"let node\">\n <div class=\"flex flex-col trans-ease-out\">\n <ng-container [ngTemplateOutlet]=\"liDat\"\n [ngTemplateOutletContext]=\"{ node: node, nested: false }\"></ng-container>\n </div>\n </mat-nested-tree-node>\n</mat-tree>\n\n<ng-template #liDat let-node=\"node\" let-nested=\"nested\">\n <div class=\"flex items-center gap-0 text-sm trans-ease-out cursor-pointer p-0 w-full\"\n (contextmenu)=\"menuContextual?.abrirMenuContextual($event, node); $event.preventDefault();\"\n (click)=\"seleccionarItem(node); opcMenu({ seccion: nombreColeccion, tipo: 'ver', item: node }); menuContextual?.cerrarMenuContextual(); (nested === false) && $event.stopPropagation();\"\n [ngClass]=\"classFila(node)\">\n <mat-icon *ngIf=\"!nested\"></mat-icon>\n <mat-icon *ngIf=\"nested\"\n [svgIcon]=\"treeControl.isExpanded(node) ? 'roundExpandMore' : 'roundChevronRight'\"></mat-icon>\n\n <mat-checkbox *ngIf=\"checkbox\"\n [(ngModel)]=\"chkLista.modelosChk[node[campoId]]\"\n [ngModelOptions]=\"{ standalone: true }\"\n (click)=\"$event.stopPropagation()\"\n (change)=\"cambiarCheck(node, $event.checked); emitirModeloCheck()\"\n [checked]=\"nested ? hijosActivos('checked', node) : false\"\n [indeterminate]=\"nested ? hijosActivos('indeterminate', node) : false\">\n </mat-checkbox>\n\n <span *ngIf=\"!templateTxtData\" class=\"w-full\">{{ node[campoStr] }}</span>\n <ng-container *ngIf=\"templateTxtData\" [ngTemplateOutlet]=\"templateTxtData\"\n [ngTemplateOutletContext]=\"{ data: node, treeControl }\"></ng-container>\n </div>\n</ng-template>\n" }]
|
|
2276
2278
|
}], propDecorators: { listaSuscription: [{
|
|
2277
2279
|
type: Input
|
|
2278
2280
|
}], nombreColeccion: [{
|