@jvsoft/components 0.0.13-alpha.1 → 0.0.13-alpha.2
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/dialog-flotante/dialog-flotante.component.d.ts +32 -0
- package/dialog-flotante/dialog-flotante.interface.d.ts +11 -0
- package/dialog-flotante/index.d.ts +5 -0
- package/fesm2022/jvsoft-components-dialog-flotante.mjs +129 -0
- package/fesm2022/jvsoft-components-dialog-flotante.mjs.map +1 -0
- package/fesm2022/jvsoft-components-lista-arbol.mjs +294 -0
- package/fesm2022/jvsoft-components-lista-arbol.mjs.map +1 -0
- package/fesm2022/jvsoft-components-luces-navidad.mjs +33 -0
- package/fesm2022/jvsoft-components-luces-navidad.mjs.map +1 -0
- package/fesm2022/jvsoft-components-mat-suffix-search-button.mjs +47 -0
- package/fesm2022/jvsoft-components-mat-suffix-search-button.mjs.map +1 -0
- package/fesm2022/jvsoft-components-menu.mjs +102 -0
- package/fesm2022/jvsoft-components-menu.mjs.map +1 -0
- package/fesm2022/jvsoft-components-tabla-mantenimiento-components-progress-bar.mjs +91 -0
- package/fesm2022/jvsoft-components-tabla-mantenimiento-components-progress-bar.mjs.map +1 -0
- package/fesm2022/jvsoft-components-tabla-mantenimiento.mjs +1798 -0
- package/fesm2022/jvsoft-components-tabla-mantenimiento.mjs.map +1 -0
- package/fesm2022/jvsoft-components.mjs +2333 -0
- package/fesm2022/jvsoft-components.mjs.map +1 -0
- package/{index.ts → index.d.ts} +1 -8
- package/lista-arbol/index.d.ts +5 -0
- package/lista-arbol/lista-arbol.component.d.ts +59 -0
- package/lista-arbol/lista-arbol.functions.d.ts +8 -0
- package/luces-navidad/index.d.ts +5 -0
- package/luces-navidad/luces-navidad.component.d.ts +11 -0
- package/mat-suffix-search-button/index.d.ts +5 -0
- package/mat-suffix-search-button/mat-suffix-search-button.component.d.ts +12 -0
- package/menu/index.d.ts +5 -0
- package/menu/menu.component.d.ts +25 -0
- package/menu/menu.interface.d.ts +16 -0
- package/package.json +43 -6
- package/tabla-mantenimiento/classes/data-model.d.ts +25 -0
- package/tabla-mantenimiento/components/progress-bar/index.d.ts +5 -0
- package/tabla-mantenimiento/components/progress-bar/progress-bar.component.d.ts +30 -0
- package/tabla-mantenimiento/components/progress-bar/public-api.d.ts +1 -0
- package/tabla-mantenimiento/index.d.ts +5 -0
- package/tabla-mantenimiento/interfaces/{archivo.ts → archivo.d.ts} +4 -7
- package/tabla-mantenimiento/interfaces/global/{boton-mantenimiento.ts → boton-mantenimiento.d.ts} +3 -9
- package/tabla-mantenimiento/interfaces/global/{columnas-tabla.ts → columnas-tabla.d.ts} +12 -89
- package/tabla-mantenimiento/interfaces/global/no-export.d.ts +2 -0
- package/tabla-mantenimiento/interfaces/global/{otros.ts → otros.d.ts} +3 -15
- package/tabla-mantenimiento/interfaces/implements/{incluye-tabla-mantenimiento.ts → incluye-tabla-mantenimiento.d.ts} +4 -6
- package/tabla-mantenimiento/interfaces/implements/{index.ts → index.d.ts} +0 -1
- package/tabla-mantenimiento/mat-row-keyboard-selection.directive.d.ts +19 -0
- package/tabla-mantenimiento/pipes/no-sanitize.pipe.d.ts +10 -0
- package/tabla-mantenimiento/pipes/zero-fill.pipe.d.ts +8 -0
- package/tabla-mantenimiento/{public-api.ts → public-api.d.ts} +2 -3
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-date/column-type-date.component.d.ts +8 -0
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-icons/column-type-icons.component.d.ts +9 -0
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-money/column-type-money.component.d.ts +9 -0
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-number/column-type-number.component.d.ts +8 -0
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-progressbar/column-type-progressbar.component.d.ts +8 -0
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-sino/column-type-sino.component.d.ts +9 -0
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-text/column-type-text.component.d.ts +8 -0
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type.component.d.ts +18 -0
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type.module.d.ts +23 -0
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/tabla-mantenimiento-column-defs.component.d.ts +21 -0
- package/tabla-mantenimiento/tabla-mantenimiento-menu/tabla-mantenimiento-menu.component.d.ts +18 -0
- package/tabla-mantenimiento/tabla-mantenimiento.component.d.ts +147 -0
- package/tabla-mantenimiento/tabla-mantenimiento.functions.d.ts +5 -0
- package/tabla-mantenimiento/tabla-mantenimiento.service.d.ts +8 -0
- package/tabla-mantenimiento/table-util.d.ts +11 -0
- package/CHANGELOG.md +0 -15
- package/build.js +0 -20
- package/dialog-flotante/dialog-flotante.component.html +0 -66
- package/dialog-flotante/dialog-flotante.component.ts +0 -115
- package/dialog-flotante/dialog-flotante.interface.ts +0 -13
- package/dialog-flotante/index.ts +0 -1
- package/dialog-flotante/ng-package.json +0 -5
- package/lista-arbol/lista-arbol.component.html +0 -66
- package/lista-arbol/lista-arbol.component.ts +0 -238
- package/lista-arbol/lista-arbol.functions.ts +0 -46
- package/lista-arbol/ng-package.json +0 -5
- package/luces-navidad/christmas-tree.png +0 -0
- package/luces-navidad/index.ts +0 -1
- package/luces-navidad/luces-navidad.component.html +0 -6
- package/luces-navidad/luces-navidad.component.ts +0 -24
- package/luces-navidad/ng-package.json +0 -5
- package/mat-suffix-search-button/index.ts +0 -1
- package/mat-suffix-search-button/mat-suffix-search-button.component.html +0 -5
- package/mat-suffix-search-button/mat-suffix-search-button.component.ts +0 -36
- package/mat-suffix-search-button/ng-package.json +0 -5
- package/menu/index.ts +0 -1
- package/menu/menu.component.html +0 -40
- package/menu/menu.component.ts +0 -88
- package/menu/menu.interface.ts +0 -16
- package/menu/ng-package.json +0 -5
- package/ng-package.json +0 -17
- package/progress-spinner.zip +0 -0
- package/tabla-mantenimiento/classes/data-model.ts +0 -150
- package/tabla-mantenimiento/components/progress-bar/index.ts +0 -1
- package/tabla-mantenimiento/components/progress-bar/ng-package.json +0 -5
- package/tabla-mantenimiento/components/progress-bar/progress-bar.component.html +0 -10
- package/tabla-mantenimiento/components/progress-bar/progress-bar.component.ts +0 -85
- package/tabla-mantenimiento/components/progress-bar/public-api.ts +0 -2
- package/tabla-mantenimiento/index.ts +0 -1
- package/tabla-mantenimiento/interfaces/global/export-excel-servidor.ts +0 -0
- package/tabla-mantenimiento/interfaces/global/no-export.ts +0 -11
- package/tabla-mantenimiento/mat-row-keyboard-selection.directive.ts +0 -97
- package/tabla-mantenimiento/ng-package.json +0 -5
- package/tabla-mantenimiento/pipes/no-sanitize.pipe.ts +0 -12
- package/tabla-mantenimiento/pipes/zero-fill.pipe.ts +0 -19
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-date/column-type-date.component.html +0 -22
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-date/column-type-date.component.ts +0 -12
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-icons/column-type-icons.component.html +0 -58
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-icons/column-type-icons.component.ts +0 -19
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-money/column-type-money.component.html +0 -40
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-money/column-type-money.component.ts +0 -17
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-number/column-type-number.component.html +0 -25
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-number/column-type-number.component.ts +0 -14
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-progressbar/column-type-progressbar.component.html +0 -28
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-progressbar/column-type-progressbar.component.ts +0 -13
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-sino/column-type-sino.component.html +0 -30
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-sino/column-type-sino.component.ts +0 -38
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-text/column-type-text.component.html +0 -97
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type-text/column-type-text.component.ts +0 -43
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type.component.html +0 -26
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type.component.ts +0 -36
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/column-type/column-type.module.ts +0 -54
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/tabla-mantenimiento-column-defs.component.html +0 -76
- package/tabla-mantenimiento/tabla-mantenimiento-column-defs/tabla-mantenimiento-column-defs.component.ts +0 -67
- package/tabla-mantenimiento/tabla-mantenimiento-menu/tabla-mantenimiento-menu.component.html +0 -7
- package/tabla-mantenimiento/tabla-mantenimiento-menu/tabla-mantenimiento-menu.component.ts +0 -39
- package/tabla-mantenimiento/tabla-mantenimiento.component.html +0 -385
- package/tabla-mantenimiento/tabla-mantenimiento.component.ts +0 -951
- package/tabla-mantenimiento/tabla-mantenimiento.functions.ts +0 -57
- package/tabla-mantenimiento/tabla-mantenimiento.service.ts +0 -44
- package/tabla-mantenimiento/table-util.ts +0 -49
- package/tabla-mantenimiento.zip +0 -0
- package/tsconfig.lib.json +0 -21
- package/tsconfig.lib.prod.json +0 -11
- package/tsconfig.spec.json +0 -15
- package/yarn-error.log +0 -68
- /package/dialog-flotante/{public-api.ts → public-api.d.ts} +0 -0
- /package/lista-arbol/{public-api.ts → public-api.d.ts} +0 -0
- /package/luces-navidad/{public-api.ts → public-api.d.ts} +0 -0
- /package/mat-suffix-search-button/{public-api.ts → public-api.d.ts} +0 -0
- /package/menu/{public-api.ts → public-api.d.ts} +0 -0
- /package/tabla-mantenimiento/interfaces/global/{index.ts → index.d.ts} +0 -0
- /package/tabla-mantenimiento/interfaces/{index.ts → index.d.ts} +0 -0
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export interface DialogFlotanteInterface {
|
|
2
|
-
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
type TiposOpciones = 'ver' | 'nuevo' | 'editar' | 'guardar' | 'eliminar' | 'seleccionar' | 'editar_item' | 'detalle' |
|
|
6
|
-
'ver_archivos' | 'eliminar_fila' | 'imprimir' | 'descargar' | 'exportar_pdf' | 'exportar_excel' | string;
|
|
7
|
-
export interface BotonDialog {
|
|
8
|
-
tipo?: TiposOpciones;
|
|
9
|
-
class?: string;
|
|
10
|
-
icono?: string;
|
|
11
|
-
label?: string;
|
|
12
|
-
sinCondicion?: boolean;
|
|
13
|
-
}
|
package/dialog-flotante/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './public-api'
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
<mat-tree [dataSource]="listaMuestraArbol" [treeControl]="treeControl">
|
|
2
|
-
<mat-nested-tree-node *matTreeNodeDef="let node; when: hasChild">
|
|
3
|
-
<div class="flex flex-col trans-ease-out cursor-pointer" matTreeNodeToggle
|
|
4
|
-
[matTreeNodeToggleRecursive]="expandirRecursivo">
|
|
5
|
-
<ng-container [ngTemplateOutlet]="liDat"
|
|
6
|
-
[ngTemplateOutletContext]="{ node: node, nested: true }"></ng-container>
|
|
7
|
-
<div class="pl-4" [class.tree-invisible]="!treeControl.isExpanded(node)">
|
|
8
|
-
<ng-container matTreeNodeOutlet></ng-container>
|
|
9
|
-
</div>
|
|
10
|
-
</div>
|
|
11
|
-
</mat-nested-tree-node>
|
|
12
|
-
|
|
13
|
-
<!-- Cambiar mat-tree-node plano por mat-nested-tree-node sin hijos -->
|
|
14
|
-
<mat-nested-tree-node *matTreeNodeDef="let node">
|
|
15
|
-
<div class="flex flex-col trans-ease-out cursor-pointer">
|
|
16
|
-
<ng-container [ngTemplateOutlet]="liDat"
|
|
17
|
-
[ngTemplateOutletContext]="{ node: node, nested: false }"></ng-container>
|
|
18
|
-
</div>
|
|
19
|
-
</mat-nested-tree-node>
|
|
20
|
-
</mat-tree>
|
|
21
|
-
|
|
22
|
-
<!--
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
<mat-tree [dataSource]="listaMuestraArbol" [treeControl]="treeControl">
|
|
26
|
-
<mat-tree-node class="!pl-0 min-h-0" *matTreeNodeDef="let node" matTreeNodeToggle matTreeNodePadding
|
|
27
|
-
[matTreeNodeToggleRecursive]="expandirRecursivo">
|
|
28
|
-
<ng-container [ngTemplateOutlet]="liDat"
|
|
29
|
-
[ngTemplateOutletContext]="{ node: node, nested: false }"></ng-container>
|
|
30
|
-
</mat-tree-node>
|
|
31
|
-
|
|
32
|
-
<mat-nested-tree-node *matTreeNodeDef="let node; when: hasChild">
|
|
33
|
-
<div class="flex flex-col trans-ease-out cursor-pointer" matTreeNodeToggle [matTreeNodeToggleRecursive]="expandirRecursivo">
|
|
34
|
-
<ng-container [ngTemplateOutlet]="liDat"
|
|
35
|
-
[ngTemplateOutletContext]="{ node: node, nested: true }"></ng-container>
|
|
36
|
-
<div class="pl-4" [class.tree-invisible]="!treeControl.isExpanded(node)">
|
|
37
|
-
<ng-container matTreeNodeOutlet></ng-container>
|
|
38
|
-
</div>
|
|
39
|
-
</div>
|
|
40
|
-
</mat-nested-tree-node>
|
|
41
|
-
</mat-tree>
|
|
42
|
-
-->
|
|
43
|
-
|
|
44
|
-
<ng-template #liDat let-node="node" let-nested="nested">
|
|
45
|
-
<div class="flex items-center gap-0 text-sm trans-ease-out cursor-pointer p-0 w-full"
|
|
46
|
-
(contextmenu)="menuContextual?.abrirMenuContextual($event, node); $event.preventDefault();"
|
|
47
|
-
(click)="seleccionarItem(node); opcMenu({ seccion: nombreColeccion, tipo: 'ver', item: node }); menuContextual?.cerrarMenuContextual();"
|
|
48
|
-
[ngClass]="classFila(node)">
|
|
49
|
-
<mat-icon *ngIf="!nested"></mat-icon>
|
|
50
|
-
<mat-icon *ngIf="nested"
|
|
51
|
-
[svgIcon]="treeControl.isExpanded(node) ? 'roundExpandMore' : 'roundChevronRight'"></mat-icon>
|
|
52
|
-
|
|
53
|
-
<mat-checkbox *ngIf="checkbox"
|
|
54
|
-
[(ngModel)]="chkLista.modelosChk[node[campoId]]"
|
|
55
|
-
[ngModelOptions]="{ standalone: true }"
|
|
56
|
-
(click)="$event.stopPropagation()"
|
|
57
|
-
(change)="cambiarCheck(node, $event.checked); emitirModeloCheck()"
|
|
58
|
-
[checked]="nested ? hijosActivos('checked', node) : false"
|
|
59
|
-
[indeterminate]="nested ? hijosActivos('indeterminate', node) : false">
|
|
60
|
-
</mat-checkbox>
|
|
61
|
-
|
|
62
|
-
<span *ngIf="!templateTxtData" class="w-full">{{ node[campoStr] }}</span>
|
|
63
|
-
<ng-container *ngIf="templateTxtData" [ngTemplateOutlet]="templateTxtData"
|
|
64
|
-
[ngTemplateOutletContext]="{ data: node, treeControl }"></ng-container>
|
|
65
|
-
</div>
|
|
66
|
-
</ng-template>
|
|
@@ -1,238 +0,0 @@
|
|
|
1
|
-
import {Component, EventEmitter, Input, OnInit, Output, TemplateRef} from '@angular/core';
|
|
2
|
-
import {CommonModule} from '@angular/common';
|
|
3
|
-
import {MatTreeModule} from '@angular/material/tree';
|
|
4
|
-
import {MatIconModule} from '@angular/material/icon';
|
|
5
|
-
import {MatCheckboxModule} from '@angular/material/checkbox';
|
|
6
|
-
import {FormsModule} from '@angular/forms';
|
|
7
|
-
import {Observable} from 'rxjs';
|
|
8
|
-
import {NestedTreeControl} from '@angular/cdk/tree';
|
|
9
|
-
import {generarArbol} from './lista-arbol.functions';
|
|
10
|
-
import {DataModel} from '@jvsoft/utils/src/public-api';
|
|
11
|
-
import {SelectionModel} from '@angular/cdk/collections';
|
|
12
|
-
import shortHash from 'shorthash2';
|
|
13
|
-
|
|
14
|
-
@Component({
|
|
15
|
-
selector: 'jvs-lista-arbol',
|
|
16
|
-
standalone: true,
|
|
17
|
-
imports: [
|
|
18
|
-
CommonModule,
|
|
19
|
-
FormsModule,
|
|
20
|
-
MatTreeModule,
|
|
21
|
-
MatIconModule,
|
|
22
|
-
MatCheckboxModule,
|
|
23
|
-
],
|
|
24
|
-
templateUrl: './lista-arbol.component.html',
|
|
25
|
-
})
|
|
26
|
-
export class ListaArbolComponent<T = any> implements OnInit {
|
|
27
|
-
@Input() listaSuscription!: Observable<T[]>;
|
|
28
|
-
@Input() nombreColeccion!: string;
|
|
29
|
-
@Input() checkbox = false;
|
|
30
|
-
@Input() expandirRecursivo = false;
|
|
31
|
-
@Input() checkboxSeleccionados: T[] = [];
|
|
32
|
-
|
|
33
|
-
@Input() campoId!: string;
|
|
34
|
-
@Input() campoIdPadre!: string;
|
|
35
|
-
@Input() campoStr!: string;
|
|
36
|
-
@Input() campoOrden?: string;
|
|
37
|
-
@Input() strHijoContainer = 'hijos';
|
|
38
|
-
@Input() menuContextual?: { abrirMenuContextual: Function; cerrarMenuContextual: Function };
|
|
39
|
-
@Input() classSeleccionado: string[] = ['bg-primary-activo', 'text-primary', 'dark:!bg-primary-dark-activo'];
|
|
40
|
-
@Input() classAnulado: string[] = ['line-through', 'text-red', 'italic'];
|
|
41
|
-
@Input() campoAnulado?: string | null;
|
|
42
|
-
@Input() templateTxtData?: TemplateRef<any>;
|
|
43
|
-
@Input() condicionMostrar?: (item: T) => boolean;
|
|
44
|
-
@Input() condicionesClaseFila: (item: T) => string[] = () => [];
|
|
45
|
-
|
|
46
|
-
@Input() set selectionModel(val: SelectionModel<any>) {
|
|
47
|
-
this.objSeleccionado = val;
|
|
48
|
-
}
|
|
49
|
-
@Output() selectionModelChange = new EventEmitter<SelectionModel<any>>();
|
|
50
|
-
|
|
51
|
-
@Output() seleccionado = new EventEmitter<any>();
|
|
52
|
-
@Output() listaCheck = new EventEmitter<T[]>();
|
|
53
|
-
@Output() listaCheckObj = new EventEmitter<Record<string, any>>();
|
|
54
|
-
|
|
55
|
-
private _idTabla: string[] = [];
|
|
56
|
-
|
|
57
|
-
get idTabla(): string[] {
|
|
58
|
-
return this._idTabla;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
@Input({required: true}) set idTabla(val: string[] | string) {
|
|
62
|
-
if (Array.isArray(val)) {
|
|
63
|
-
this._idTabla = val;
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
this._idTabla.push(val);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
get buscarItemSeleccionado(): any {
|
|
71
|
-
const dRet = this.listaOriginal.find(itm => this._seleccionado === this.propiedadSeleccion(itm));
|
|
72
|
-
return dRet ?? null;
|
|
73
|
-
}
|
|
74
|
-
get objSeleccionado() {
|
|
75
|
-
return this.buscarItemSeleccionado; // ?? this.objThis?.['seleccionados']?.[this.nombreColeccion];
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
set objSeleccionado(val: any) {
|
|
79
|
-
this.seleccionarItem(val, true);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
chkLista = new DataModel();
|
|
83
|
-
listaMuestraArbol: T[] = [];
|
|
84
|
-
listaOriginal: T[] = [];
|
|
85
|
-
|
|
86
|
-
treeControl = new NestedTreeControl((node: any) => node[this.strHijoContainer]);
|
|
87
|
-
|
|
88
|
-
_seleccionado: any = {};
|
|
89
|
-
|
|
90
|
-
ngOnInit(): void {
|
|
91
|
-
this.listaSuscription.subscribe(res => {
|
|
92
|
-
if (res) {
|
|
93
|
-
this.listaOriginal = res;
|
|
94
|
-
const listaAs = generarArbol({
|
|
95
|
-
lista: res,
|
|
96
|
-
campoId: this.campoId,
|
|
97
|
-
campoIdPadre: this.campoIdPadre,
|
|
98
|
-
idPadre: null,
|
|
99
|
-
strChildren: this.strHijoContainer,
|
|
100
|
-
campoOrden: this.campoOrden
|
|
101
|
-
});
|
|
102
|
-
this.listaMuestraArbol = [];
|
|
103
|
-
setTimeout(() => {
|
|
104
|
-
this.listaMuestraArbol = listaAs;
|
|
105
|
-
}, 1);
|
|
106
|
-
if (this.checkbox) {
|
|
107
|
-
this.chkLista.agregarControles(res, this.campoId);
|
|
108
|
-
this.checkboxSeleccionados.forEach((chkSel: any) => {
|
|
109
|
-
this.chkLista.setState(chkSel[this.campoId], true);
|
|
110
|
-
});
|
|
111
|
-
this.emitirModeloCheck();
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
idTablaValor(data: any): string {
|
|
119
|
-
if (data) {
|
|
120
|
-
if (this.idTabla.length < 1) {
|
|
121
|
-
return shortHash(JSON.stringify({data, claseFinal: undefined}))
|
|
122
|
-
}
|
|
123
|
-
return this.idTabla.map(d => data[d]).join('-');
|
|
124
|
-
}
|
|
125
|
-
return '';
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
propiedadSeleccion(item: any): string {
|
|
129
|
-
return `${this.nombreColeccion}_${this.idTablaValor(item)}`;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
esSeleccionActual(item: any): boolean {
|
|
133
|
-
return this._seleccionado === this.propiedadSeleccion(item);
|
|
134
|
-
}
|
|
135
|
-
seleccionarItem(item?: any, forzado: boolean = false): void {
|
|
136
|
-
const idItem = this.propiedadSeleccion(item);
|
|
137
|
-
if (forzado) {
|
|
138
|
-
this._seleccionado = idItem;
|
|
139
|
-
}
|
|
140
|
-
else {
|
|
141
|
-
this._seleccionado = this._seleccionado === idItem ? null:idItem;
|
|
142
|
-
}
|
|
143
|
-
this.selectionModelChange.emit(this.objSeleccionado);
|
|
144
|
-
this.seleccionado.emit(this.objSeleccionado);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
hasChild = (_: number, node: any) => !!node[this.strHijoContainer] && node[this.strHijoContainer].length > 0;
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
opcMenu(v: any) {
|
|
152
|
-
// console.warn(v);
|
|
153
|
-
// console.warn(this.objSeleccionado);
|
|
154
|
-
const opAdic: any = {seccion: this.nombreColeccion};
|
|
155
|
-
opAdic['itemSeleccionado'] = this.objSeleccionado;
|
|
156
|
-
// v = {...v, ...opAdic};
|
|
157
|
-
// this.seleccionado.emit(v);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
emitirModeloCheck() {
|
|
161
|
-
this.listaCheck.emit(<any[]>this.chkLista.generarLista());
|
|
162
|
-
this.listaCheckObj.emit(<object>this.chkLista.generarLista('object'));
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
cambiarPadre(checkActual: T, estado: boolean): void {
|
|
167
|
-
const parentId = (checkActual as any)[this.campoIdPadre];
|
|
168
|
-
if (parentId) {
|
|
169
|
-
const padreAct = this.listaMuestraArbol.find((itm: any) => itm[this.campoId] == parentId);
|
|
170
|
-
if (padreAct) {
|
|
171
|
-
this.chkLista.setState(parentId, this.hijosActivos('checked', padreAct) || this.hijosActivos('indeterminate', padreAct));
|
|
172
|
-
this.cambiarPadre(padreAct, estado);
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
cambiarCheck(checkActual: T, estado: boolean): void {
|
|
178
|
-
if (this.hasChild(0, checkActual)) {
|
|
179
|
-
(this.treeControl.getChildren(checkActual) ?? []).forEach((vas: any) => {
|
|
180
|
-
this.cambiarCheck(vas, estado);
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
this.cambiarPadre(checkActual, estado);
|
|
184
|
-
this.chkLista.setState((checkActual as any)[this.campoId], estado);
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
hijosActivos(tipo: 'checked' | 'indeterminate', checkActual: T): boolean {
|
|
188
|
-
let totalHijos = 0;
|
|
189
|
-
let cantActivo = 0;
|
|
190
|
-
if (this.hasChild(0, checkActual)) {
|
|
191
|
-
(this.treeControl.getChildren(checkActual) ?? []).forEach((vas: any) => {
|
|
192
|
-
if (this.chkLista.getState(vas[this.campoId] + '')) {
|
|
193
|
-
cantActivo++;
|
|
194
|
-
}
|
|
195
|
-
totalHijos++;
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
switch (tipo) {
|
|
200
|
-
case 'checked':
|
|
201
|
-
return (cantActivo == totalHijos);
|
|
202
|
-
case 'indeterminate':
|
|
203
|
-
if (cantActivo == totalHijos) {
|
|
204
|
-
this.chkLista.setState((checkActual as any)[this.campoId], true);
|
|
205
|
-
}
|
|
206
|
-
return ((cantActivo > 0) && (cantActivo != totalHijos));
|
|
207
|
-
}
|
|
208
|
-
return false;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
classFila2(item: T): string[] {
|
|
213
|
-
let clases: string[] = [];
|
|
214
|
-
if (this.campoAnulado && (item as any)[this.campoAnulado] === 1) {
|
|
215
|
-
clases = clases.concat(this.classAnulado);
|
|
216
|
-
}
|
|
217
|
-
if ((item as any)?.seleccionado) {
|
|
218
|
-
clases = clases.concat(this.classSeleccionado);
|
|
219
|
-
}
|
|
220
|
-
clases = clases.concat(this.condicionesClaseFila(item));
|
|
221
|
-
(item as any).claseFinal = clases;
|
|
222
|
-
return clases;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
classFila(item: any) {
|
|
226
|
-
let claseFinal: any[] = [];
|
|
227
|
-
if (this.campoAnulado && (item[this.campoAnulado] == 1)) {
|
|
228
|
-
claseFinal = claseFinal.concat(this.classAnulado);
|
|
229
|
-
}
|
|
230
|
-
if (this.objSeleccionado == item || this.esSeleccionActual(item)) {
|
|
231
|
-
claseFinal = claseFinal.concat(this.classSeleccionado);
|
|
232
|
-
}
|
|
233
|
-
claseFinal = claseFinal.concat(this.condicionesClaseFila(item));
|
|
234
|
-
item.claseFinal = claseFinal;
|
|
235
|
-
return claseFinal;
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
export function generarArbol(params: {
|
|
2
|
-
lista: any[],
|
|
3
|
-
campoId: string,
|
|
4
|
-
campoIdPadre: string,
|
|
5
|
-
idPadre?: any,
|
|
6
|
-
strChildren?: string,
|
|
7
|
-
campoOrden?: string
|
|
8
|
-
}): any[] {
|
|
9
|
-
const {
|
|
10
|
-
lista,
|
|
11
|
-
campoId,
|
|
12
|
-
campoIdPadre,
|
|
13
|
-
idPadre = null,
|
|
14
|
-
strChildren = 'hijos',
|
|
15
|
-
campoOrden,
|
|
16
|
-
} = params;
|
|
17
|
-
|
|
18
|
-
const hijos = lista.filter(n => n[campoIdPadre] === idPadre);
|
|
19
|
-
|
|
20
|
-
if (campoOrden) {
|
|
21
|
-
hijos.sort((a, b) => {
|
|
22
|
-
const va = a[campoOrden];
|
|
23
|
-
const vb = b[campoOrden];
|
|
24
|
-
|
|
25
|
-
if (typeof va === 'string' && typeof vb === 'string') {
|
|
26
|
-
return va.localeCompare(vb);
|
|
27
|
-
}
|
|
28
|
-
if (typeof va === 'number' && typeof vb === 'number') {
|
|
29
|
-
return va - vb;
|
|
30
|
-
}
|
|
31
|
-
return 0;
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return hijos.map(n => ({
|
|
36
|
-
...n,
|
|
37
|
-
[strChildren]: generarArbol({
|
|
38
|
-
lista,
|
|
39
|
-
campoId,
|
|
40
|
-
campoIdPadre,
|
|
41
|
-
idPadre: n[campoId],
|
|
42
|
-
strChildren,
|
|
43
|
-
campoOrden,
|
|
44
|
-
}),
|
|
45
|
-
}));
|
|
46
|
-
}
|
|
Binary file
|
package/luces-navidad/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './public-api'
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import {Component, Input, OnInit} from '@angular/core';
|
|
2
|
-
import {NgForOf, NgIf} from '@angular/common';
|
|
3
|
-
|
|
4
|
-
@Component({
|
|
5
|
-
selector: 'jvs-luces-navidad, [jvsLucesNavidad]',
|
|
6
|
-
templateUrl: './luces-navidad.component.html',
|
|
7
|
-
imports: [
|
|
8
|
-
NgIf,
|
|
9
|
-
NgForOf
|
|
10
|
-
],
|
|
11
|
-
styleUrls: ['./luces-navidad.component.scss']
|
|
12
|
-
})
|
|
13
|
-
export class LucesNavidadComponent implements OnInit {
|
|
14
|
-
@Input() enProduccion = true;
|
|
15
|
-
@Input() forzarMuestra = false;
|
|
16
|
-
mesActual = new Date().getMonth() + 1;
|
|
17
|
-
|
|
18
|
-
constructor() {
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
ngOnInit(): void {
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './public-api'
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import {Component, EventEmitter, Input, Output} from '@angular/core';
|
|
2
|
-
import {FormControl} from '@angular/forms';
|
|
3
|
-
import {MatRipple} from '@angular/material/core';
|
|
4
|
-
import {MatIcon} from '@angular/material/icon';
|
|
5
|
-
|
|
6
|
-
@Component({
|
|
7
|
-
selector: 'div[matSuffix][matSuffixSearchButton]',
|
|
8
|
-
imports: [
|
|
9
|
-
MatRipple,
|
|
10
|
-
MatIcon
|
|
11
|
-
],
|
|
12
|
-
templateUrl: './mat-suffix-search-button.component.html',
|
|
13
|
-
host: {
|
|
14
|
-
class: 'flex items-center justify-start',
|
|
15
|
-
}
|
|
16
|
-
})
|
|
17
|
-
export class MatSuffixSearchButtonComponent {
|
|
18
|
-
@Input({required: true}) fControl: any;
|
|
19
|
-
@Output() eventLimpiar: EventEmitter<any> = new EventEmitter();
|
|
20
|
-
@Output() eventBuscar: EventEmitter<any> = new EventEmitter();
|
|
21
|
-
|
|
22
|
-
get control(): FormControl {
|
|
23
|
-
return this.fControl;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
emitirClick() {
|
|
27
|
-
if (this.control.value) {
|
|
28
|
-
this.control.reset();
|
|
29
|
-
this.eventLimpiar.emit(true);
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
this.eventBuscar.emit(true);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
}
|
package/menu/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './public-api'
|
package/menu/menu.component.html
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
<ng-container *ngIf="yet">
|
|
2
|
-
<button matRipple [matMenuTriggerFor]="matmenus.first"
|
|
3
|
-
[disabled]="disabled"
|
|
4
|
-
type="button" [class]="cssBoton ?? 'boton-circular boton-circular-red border-0'"
|
|
5
|
-
(click)="$event.preventDefault(); $event.stopImmediatePropagation()"
|
|
6
|
-
[matTooltip]="title"
|
|
7
|
-
>
|
|
8
|
-
<ng-content></ng-content>
|
|
9
|
-
</button>
|
|
10
|
-
</ng-container>
|
|
11
|
-
|
|
12
|
-
<!--<pre class="text-indigo-900">{{_submenus | json}}</pre>-->
|
|
13
|
-
<ng-container *ngFor="let menu of _submenus">
|
|
14
|
-
<!--<pre class="text-red-700">{{menu | json}}</pre>-->
|
|
15
|
-
<mat-menu xPosition="before" yPosition="below" class="max-w-none">
|
|
16
|
-
<ng-container *ngFor="let item of menu">
|
|
17
|
-
<!--<pre *ngIf="menu$" class="text-orange-700">{{item | json}}</pre>-->
|
|
18
|
-
<!--<span>{{ [item.label, item.idxOpcionCalc!=-1 , yet , (!item.esVisible || item.esVisible({itemMenu: item, archivo: itemSeleccion})), [!item.esVisible , (item.esVisible ? item.esVisible({itemMenu: item, archivo: itemSeleccion}) : 'NO HAY')]] | json }}</span>-->
|
|
19
|
-
<button mat-menu-item *ngIf="item.idxOpcionCalc!=-1 && yet && (!item.esVisible || item.esVisible({itemMenu: item, archivo: itemSeleccion}))"
|
|
20
|
-
class="flex items-center justify-items-center uppercase w-full rounded-none px-2 "
|
|
21
|
-
[matMenuTriggerFor]="getMenu(item.idxOpcionCalc)">
|
|
22
|
-
<mat-icon *ngIf="item.icono"
|
|
23
|
-
class="flex-none flex items-center justify-center !text-red-700 !mr-1 icon-2xs"
|
|
24
|
-
[svgIcon]="item.icono ?? 'fa5sFileSignature'"
|
|
25
|
-
></mat-icon>
|
|
26
|
-
<span class="grow text-2xs" [innerHTML]="item.label">{{item.label}}</span>
|
|
27
|
-
</button>
|
|
28
|
-
<button mat-menu-item *ngIf="item.idxOpcionCalc==-1 && (!item.esVisible || item.esVisible(item))" (click)="onClick(item.valorSeleccion)"
|
|
29
|
-
class="flex items-center justify-items-center uppercase w-full rounded-none px-2 "
|
|
30
|
-
>
|
|
31
|
-
<mat-icon *ngIf="item.icono"
|
|
32
|
-
class="flex-none flex items-center justify-center !text-red-700 !mr-1 icon-2xs"
|
|
33
|
-
[svgIcon]="item.icono ?? 'fa5sFileSignature'"
|
|
34
|
-
></mat-icon>
|
|
35
|
-
<span class="grow text-2xs" [innerHTML]="item.label">{{item.label}} </span>
|
|
36
|
-
</button>
|
|
37
|
-
|
|
38
|
-
</ng-container>
|
|
39
|
-
</mat-menu>
|
|
40
|
-
</ng-container>
|
package/menu/menu.component.ts
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import {AfterViewInit, Component, EventEmitter, Input, OnInit, Output, QueryList, ViewChildren} from '@angular/core';
|
|
2
|
-
import {CommonModule} from '@angular/common';
|
|
3
|
-
import {MatMenu, MatMenuModule} from '@angular/material/menu';
|
|
4
|
-
import {MatIconModule} from '@angular/material/icon';
|
|
5
|
-
import {MatRippleModule} from '@angular/material/core';
|
|
6
|
-
import {MatTooltipModule} from '@angular/material/tooltip';
|
|
7
|
-
import {BotonMenu} from './menu.interface';
|
|
8
|
-
|
|
9
|
-
@Component({
|
|
10
|
-
selector: 'jvs-menu',
|
|
11
|
-
standalone: true,
|
|
12
|
-
imports: [
|
|
13
|
-
CommonModule,
|
|
14
|
-
MatMenuModule,
|
|
15
|
-
MatIconModule,
|
|
16
|
-
MatRippleModule,
|
|
17
|
-
MatTooltipModule,
|
|
18
|
-
],
|
|
19
|
-
templateUrl: './menu.component.html',
|
|
20
|
-
})
|
|
21
|
-
export class MenuComponent implements OnInit, AfterViewInit {
|
|
22
|
-
@Input() cssBoton?: string;
|
|
23
|
-
@Input() title?: string;
|
|
24
|
-
@Input() disabled: boolean = false;
|
|
25
|
-
@Input() itemSeleccion?: string;
|
|
26
|
-
@Input() menu: BotonMenu[] = [];
|
|
27
|
-
@Output() action: EventEmitter<string> = new EventEmitter<string>();
|
|
28
|
-
|
|
29
|
-
@ViewChildren(MatMenu) matmenus!: QueryList<MatMenu>;
|
|
30
|
-
|
|
31
|
-
menuItems: string[] = [];
|
|
32
|
-
yet: boolean = false;
|
|
33
|
-
_submenus: BotonMenu[][] = []; // 🔥 Tipo explícito como Array de Array de BotonMenu
|
|
34
|
-
|
|
35
|
-
get submenus(): BotonMenu[][] {
|
|
36
|
-
return this._submenus.filter(() => true); // Mantiene la estructura, aunque no hace filtro real
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
ngOnInit(): void {
|
|
40
|
-
this.createSubmenus(this.menu, 's0', 1);
|
|
41
|
-
this.reindex();
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
ngAfterViewInit(): void {
|
|
45
|
-
// Previene errores de Angular al repintar el menú
|
|
46
|
-
setTimeout(() => {
|
|
47
|
-
this.yet = true;
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
onClick(value: string): void {
|
|
52
|
-
this.action.emit(value);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
getMenu(index: number): MatMenu | null {
|
|
56
|
-
return index >= 0 && this.matmenus ? this.matmenus.get(index) ?? null:null;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
reindex(): void {
|
|
60
|
-
// Asigna el índice del ítem del menú
|
|
61
|
-
this._submenus.forEach((menu: BotonMenu[]) => {
|
|
62
|
-
menu.forEach((item: BotonMenu) => {
|
|
63
|
-
if (item.idxOpcionCalc !== -1) {
|
|
64
|
-
item.idxOpcionCalc = this.menuItems.indexOf(item.valorSeleccion ?? '');
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
createSubmenus(menu: BotonMenu[], prefix: string, count: number): void {
|
|
71
|
-
this.menuItems.push(prefix);
|
|
72
|
-
|
|
73
|
-
this._submenus.push(
|
|
74
|
-
menu.map((item, index): BotonMenu => ({
|
|
75
|
-
...item,
|
|
76
|
-
valorSeleccion: item.subItems ? `${prefix}${index}`:item.valorSeleccion,
|
|
77
|
-
idxOpcionCalc: item.subItems ? 0:-1,
|
|
78
|
-
}))
|
|
79
|
-
);
|
|
80
|
-
|
|
81
|
-
// Llamada recursiva para crear submenús
|
|
82
|
-
menu.forEach((item, index) => {
|
|
83
|
-
if (item.subItems) {
|
|
84
|
-
this.createSubmenus(item.subItems, `${prefix}${index}`, count + 1);
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
}
|
package/menu/menu.interface.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export interface BotonMenu {
|
|
2
|
-
idUnico?: string,
|
|
3
|
-
class?: string;
|
|
4
|
-
icono?: string;
|
|
5
|
-
label?: string;
|
|
6
|
-
soloIcono?: boolean;
|
|
7
|
-
sinCondicion?: boolean;
|
|
8
|
-
badge?: string;
|
|
9
|
-
tooltip?: string;
|
|
10
|
-
idxOpcionCalc?: any,
|
|
11
|
-
subItems?: BotonMenu[];
|
|
12
|
-
datosExtra?: any;
|
|
13
|
-
valorSeleccion?: any;
|
|
14
|
-
esVisible?(dataValid?: any): boolean;
|
|
15
|
-
estaDeshabilitado?(item?: any): boolean;
|
|
16
|
-
}
|
package/menu/ng-package.json
DELETED
package/ng-package.json
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
|
|
3
|
-
"dest": "../../dist/components",
|
|
4
|
-
"lib": {
|
|
5
|
-
"entryFile": "./index.ts",
|
|
6
|
-
"styleIncludePaths": [
|
|
7
|
-
"./src"
|
|
8
|
-
]
|
|
9
|
-
},
|
|
10
|
-
"assets": [
|
|
11
|
-
"**/*.scss",
|
|
12
|
-
"**/*.css"
|
|
13
|
-
],
|
|
14
|
-
"allowedNonPeerDependencies": [
|
|
15
|
-
"."
|
|
16
|
-
]
|
|
17
|
-
}
|
package/progress-spinner.zip
DELETED
|
Binary file
|