@jvsoft/components 1.0.0-alpha.6 → 1.0.0-alpha.7

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.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { EventEmitter, Input, Output, Component } from '@angular/core';
2
+ import { input, output, signal, computed, effect, untracked, Component } from '@angular/core';
3
3
  import * as i1 from '@angular/common';
4
4
  import { CommonModule } from '@angular/common';
5
5
  import * as i3 from '@angular/material/tree';
@@ -10,9 +10,11 @@ import * as i5 from '@angular/material/checkbox';
10
10
  import { MatCheckboxModule } from '@angular/material/checkbox';
11
11
  import * as i2 from '@angular/forms';
12
12
  import { FormsModule } from '@angular/forms';
13
+ import { switchMap } from 'rxjs/operators';
13
14
  import { NestedTreeControl } from '@angular/cdk/tree';
14
15
  import { DataModel } from '@jvsoft/utils';
15
16
  import shortHash from 'shorthash2';
17
+ import { toObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
16
18
 
17
19
  function generarArbol(params) {
18
20
  const { lista, campoId, campoIdPadre, idPadre = null, strChildren = 'hijos', campoOrden, } = params;
@@ -44,77 +46,94 @@ function generarArbol(params) {
44
46
  }
45
47
 
46
48
  class ListaArbolComponent {
47
- listaSuscription;
48
- nombreColeccion;
49
- checkbox = false;
50
- expandirRecursivo = false;
51
- checkboxSeleccionados = [];
52
- campoId;
53
- campoIdPadre;
54
- campoStr;
55
- campoOrden;
56
- strHijoContainer = 'hijos';
57
- menuContextual;
58
- classSeleccionado = ['bg-primary-activo', 'text-primary', 'dark:!bg-primary-dark-activo'];
59
- classAnulado = ['line-through', 'text-red', 'italic'];
60
- campoAnulado;
61
- templateTxtData;
62
- condicionMostrar;
63
- condicionesClaseFila = () => [];
64
- set selectionModel(val) {
65
- this.objSeleccionado = val;
66
- }
67
- selectionModelChange = new EventEmitter();
68
- seleccionado = new EventEmitter();
69
- listaCheck = new EventEmitter();
70
- listaCheckObj = new EventEmitter();
71
- _idTabla = [];
72
- get idTabla() {
73
- return this._idTabla;
74
- }
75
- set idTabla(val) {
76
- if (Array.isArray(val)) {
77
- this._idTabla = val;
78
- }
79
- else {
80
- this._idTabla.push(val);
49
+ // Inputs
50
+ listaSuscription = input.required();
51
+ nombreColeccion = input.required();
52
+ checkbox = input(false);
53
+ expandirRecursivo = input(false);
54
+ checkboxSeleccionados = input([]);
55
+ campoId = input.required();
56
+ campoIdPadre = input.required();
57
+ campoStr = input(''); // Optional - can use templateTxtData instead
58
+ campoOrden = input();
59
+ strHijoContainer = input('hijos');
60
+ menuContextual = input();
61
+ classSeleccionado = input(['bg-primary-activo', 'text-primary', 'dark:!bg-primary-dark-activo']);
62
+ classAnulado = input(['line-through', 'text-red', 'italic']);
63
+ campoAnulado = input();
64
+ templateTxtData = input();
65
+ condicionMostrar = input();
66
+ condicionesClaseFila = input(() => []);
67
+ // idTabla input with transform to support both string and string[]
68
+ idTabla = input.required({
69
+ transform: (val) => {
70
+ if (Array.isArray(val)) {
71
+ this._idTabla.set(val);
72
+ return val;
73
+ }
74
+ else {
75
+ this._idTabla.update(current => [...current, val]);
76
+ return [val];
77
+ }
81
78
  }
82
- }
83
- get buscarItemSeleccionado() {
84
- const dRet = this.listaOriginal.find(itm => this._seleccionado === this.propiedadSeleccion(itm));
85
- return dRet ?? null;
86
- }
87
- get objSeleccionado() {
88
- return this.buscarItemSeleccionado; // ?? this.objThis?.['seleccionados']?.[this.nombreColeccion];
89
- }
90
- set objSeleccionado(val) {
91
- this.seleccionarItem(val, true);
92
- }
79
+ });
80
+ // selectionModel input for backward compatibility
81
+ selectionModel = input();
82
+ // Outputs
83
+ selectionModelChange = output();
84
+ seleccionado = output();
85
+ listaCheck = output();
86
+ listaCheckObj = output();
87
+ // Internal state as signals
88
+ _idTabla = signal([]);
89
+ _seleccionado = signal(null);
90
+ listaMuestraArbol = signal([]);
91
+ listaOriginal = signal([]);
93
92
  chkLista = new DataModel();
94
- listaMuestraArbol = [];
95
- listaOriginal = [];
96
- treeControl = new NestedTreeControl((node) => node[this.strHijoContainer]);
97
- _seleccionado = {};
98
- ngOnInit() {
99
- this.listaSuscription.subscribe(res => {
93
+ // Computed values
94
+ idTablaValue = computed(() => this._idTabla());
95
+ buscarItemSeleccionado = computed(() => {
96
+ const selId = this._seleccionado();
97
+ const lista = this.listaOriginal();
98
+ if (!selId)
99
+ return null;
100
+ return lista.find(itm => selId === this.propiedadSeleccion(itm)) ?? null;
101
+ });
102
+ objSeleccionado = computed(() => this.buscarItemSeleccionado());
103
+ treeControl = new NestedTreeControl((node) => node[this.strHijoContainer()]);
104
+ // Convert signal to observable for proper subscription management
105
+ listaSuscription$ = toObservable(this.listaSuscription);
106
+ constructor() {
107
+ // Watch selectionModel input for backward compatibility
108
+ effect(() => {
109
+ const selModel = this.selectionModel();
110
+ if (selModel) {
111
+ untracked(() => this.seleccionarItem(selModel, true));
112
+ }
113
+ });
114
+ // Setup subscription with automatic cleanup using switchMap
115
+ // switchMap automatically unsubscribes from previous observable when a new one arrives
116
+ this.listaSuscription$
117
+ .pipe(switchMap(obs => obs), takeUntilDestroyed())
118
+ .subscribe(res => {
100
119
  if (res) {
101
- this.listaOriginal = res;
120
+ this.listaOriginal.set(res);
102
121
  const listaAs = generarArbol({
103
122
  lista: res,
104
- campoId: this.campoId,
105
- campoIdPadre: this.campoIdPadre,
123
+ campoId: this.campoId(),
124
+ campoIdPadre: this.campoIdPadre(),
106
125
  idPadre: null,
107
- strChildren: this.strHijoContainer,
108
- campoOrden: this.campoOrden
126
+ strChildren: this.strHijoContainer(),
127
+ campoOrden: this.campoOrden(),
128
+ });
129
+ // Use untracked to avoid unnecessary re-renders
130
+ untracked(() => {
131
+ this.listaMuestraArbol.set(listaAs);
109
132
  });
110
- this.listaMuestraArbol = [];
111
- setTimeout(() => {
112
- this.listaMuestraArbol = listaAs;
113
- }, 1);
114
- if (this.checkbox) {
115
- this.chkLista.agregarControles(res, this.campoId);
116
- this.checkboxSeleccionados.forEach((chkSel) => {
117
- this.chkLista.setState(chkSel[this.campoId], true);
133
+ if (this.checkbox()) {
134
+ this.chkLista.agregarControles(res, this.campoId());
135
+ this.checkboxSeleccionados().forEach((chkSel) => {
136
+ this.chkLista.setState(chkSel[this.campoId()], true);
118
137
  });
119
138
  this.emitirModeloCheck();
120
139
  }
@@ -123,47 +142,50 @@ class ListaArbolComponent {
123
142
  }
124
143
  idTablaValor(data) {
125
144
  if (data) {
126
- if (this.idTabla.length < 1) {
145
+ const idTablaVal = this._idTabla();
146
+ if (idTablaVal.length < 1) {
127
147
  return shortHash(JSON.stringify({ data, claseFinal: undefined }));
128
148
  }
129
- return this.idTabla.map(d => data[d]).join('-');
149
+ return idTablaVal.map(d => data[d]).join('-');
130
150
  }
131
151
  return '';
132
152
  }
133
153
  propiedadSeleccion(item) {
134
- return `${this.nombreColeccion}_${this.idTablaValor(item)}`;
154
+ return `${this.nombreColeccion()}_${this.idTablaValor(item)}`;
135
155
  }
136
156
  esSeleccionActual(item) {
137
- return this._seleccionado === this.propiedadSeleccion(item);
157
+ return this._seleccionado() === this.propiedadSeleccion(item);
138
158
  }
139
159
  seleccionarItem(item, forzado = false) {
140
160
  const idItem = this.propiedadSeleccion(item);
141
161
  if (forzado) {
142
- this._seleccionado = idItem;
162
+ this._seleccionado.set(idItem);
143
163
  }
144
164
  else {
145
- this._seleccionado = this._seleccionado === idItem ? null : idItem;
165
+ this._seleccionado.update(current => current === idItem ? null : idItem);
146
166
  }
147
- this.selectionModelChange.emit(this.objSeleccionado);
148
- this.seleccionado.emit(this.objSeleccionado);
167
+ const objSel = this.objSeleccionado();
168
+ this.selectionModelChange.emit(objSel);
169
+ this.seleccionado.emit(objSel);
149
170
  }
150
- hasChild = (_, node) => !!node[this.strHijoContainer] && node[this.strHijoContainer].length > 0;
171
+ hasChild = (_, node) => {
172
+ const strHijo = this.strHijoContainer();
173
+ return !!node[strHijo] && node[strHijo].length > 0;
174
+ };
151
175
  opcMenu(v) {
152
- // console.warn(v);
153
- // console.warn(this.objSeleccionado);
154
- const opAdic = { seccion: this.nombreColeccion };
155
- opAdic['itemSeleccionado'] = this.objSeleccionado;
156
- // v = {...v, ...opAdic};
157
- // this.seleccionado.emit(v);
176
+ const opAdic = { seccion: this.nombreColeccion() };
177
+ opAdic['itemSeleccionado'] = this.objSeleccionado();
158
178
  }
159
179
  emitirModeloCheck() {
160
180
  this.listaCheck.emit(this.chkLista.generarLista());
161
181
  this.listaCheckObj.emit(this.chkLista.generarLista('object'));
162
182
  }
163
183
  cambiarPadre(checkActual, estado) {
164
- const parentId = checkActual[this.campoIdPadre];
184
+ const parentId = checkActual[this.campoIdPadre()];
165
185
  if (parentId) {
166
- const padreAct = this.listaMuestraArbol.find((itm) => itm[this.campoId] == parentId);
186
+ // Fix: buscar en listaOriginal en lugar de listaMuestraArbol
187
+ const listaOrig = this.listaOriginal();
188
+ const padreAct = listaOrig.find((itm) => itm[this.campoId()] === parentId);
167
189
  if (padreAct) {
168
190
  this.chkLista.setState(parentId, this.hijosActivos('checked', padreAct) || this.hijosActivos('indeterminate', padreAct));
169
191
  this.cambiarPadre(padreAct, estado);
@@ -177,14 +199,14 @@ class ListaArbolComponent {
177
199
  });
178
200
  }
179
201
  this.cambiarPadre(checkActual, estado);
180
- this.chkLista.setState(checkActual[this.campoId], estado);
202
+ this.chkLista.setState(checkActual[this.campoId()], estado);
181
203
  }
182
204
  hijosActivos(tipo, checkActual) {
183
205
  let totalHijos = 0;
184
206
  let cantActivo = 0;
185
207
  if (this.hasChild(0, checkActual)) {
186
208
  (this.treeControl.getChildren(checkActual) ?? []).forEach((vas) => {
187
- if (this.chkLista.getState(vas[this.campoId] + '')) {
209
+ if (this.chkLista.getState(vas[this.campoId()] + '')) {
188
210
  cantActivo++;
189
211
  }
190
212
  totalHijos++;
@@ -192,29 +214,30 @@ class ListaArbolComponent {
192
214
  }
193
215
  switch (tipo) {
194
216
  case 'checked':
195
- return (cantActivo == totalHijos);
217
+ return (cantActivo === totalHijos);
196
218
  case 'indeterminate':
197
- if (cantActivo == totalHijos) {
198
- this.chkLista.setState(checkActual[this.campoId], true);
199
- }
200
- return ((cantActivo > 0) && (cantActivo != totalHijos));
219
+ // Fix: remover efecto secundario
220
+ return ((cantActivo > 0) && (cantActivo !== totalHijos));
201
221
  }
202
222
  return false;
203
223
  }
204
224
  classFila(item) {
205
225
  let claseFinal = [];
206
- if (this.campoAnulado && (item[this.campoAnulado] == 1)) {
207
- claseFinal = claseFinal.concat(this.classAnulado);
226
+ const campoAnul = this.campoAnulado();
227
+ if (campoAnul && (item[campoAnul] === 1)) {
228
+ claseFinal = claseFinal.concat(this.classAnulado());
208
229
  }
209
- if (this.objSeleccionado == item || this.esSeleccionActual(item)) {
210
- claseFinal = claseFinal.concat(this.classSeleccionado);
230
+ const objSel = this.objSeleccionado();
231
+ if (objSel === item || this.esSeleccionActual(item)) {
232
+ claseFinal = claseFinal.concat(this.classSeleccionado());
211
233
  }
212
- claseFinal = claseFinal.concat(this.condicionesClaseFila(item));
213
- item.claseFinal = claseFinal;
234
+ const condClases = this.condicionesClaseFila();
235
+ claseFinal = claseFinal.concat(condClases(item));
236
+ // Fix: no mutar el objeto original
214
237
  return claseFinal;
215
238
  }
216
239
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ListaArbolComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
217
- 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: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: MatTreeModule }, { kind: "directive", type: i3.MatNestedTreeNode, selector: "mat-nested-tree-node", inputs: ["matNestedTreeNode", "disabled", "tabIndex"], outputs: ["activation", "expandedChange"], exportAs: ["matNestedTreeNode"] }, { kind: "directive", type: i3.MatTreeNodeDef, selector: "[matTreeNodeDef]", inputs: ["matTreeNodeDefWhen", "matTreeNode"] }, { kind: "directive", type: i3.MatTreeNodeToggle, selector: "[matTreeNodeToggle]", inputs: ["matTreeNodeToggleRecursive"] }, { kind: "component", type: i3.MatTree, selector: "mat-tree", exportAs: ["matTree"] }, { kind: "directive", type: i3.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.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"] }] });
240
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.14", type: ListaArbolComponent, isStandalone: true, selector: "jvs-lista-arbol", inputs: { listaSuscription: { classPropertyName: "listaSuscription", publicName: "listaSuscription", isSignal: true, isRequired: true, transformFunction: null }, nombreColeccion: { classPropertyName: "nombreColeccion", publicName: "nombreColeccion", isSignal: true, isRequired: true, transformFunction: null }, checkbox: { classPropertyName: "checkbox", publicName: "checkbox", isSignal: true, isRequired: false, transformFunction: null }, expandirRecursivo: { classPropertyName: "expandirRecursivo", publicName: "expandirRecursivo", isSignal: true, isRequired: false, transformFunction: null }, checkboxSeleccionados: { classPropertyName: "checkboxSeleccionados", publicName: "checkboxSeleccionados", isSignal: true, isRequired: false, transformFunction: null }, campoId: { classPropertyName: "campoId", publicName: "campoId", isSignal: true, isRequired: true, transformFunction: null }, campoIdPadre: { classPropertyName: "campoIdPadre", publicName: "campoIdPadre", isSignal: true, isRequired: true, transformFunction: null }, campoStr: { classPropertyName: "campoStr", publicName: "campoStr", isSignal: true, isRequired: false, transformFunction: null }, campoOrden: { classPropertyName: "campoOrden", publicName: "campoOrden", isSignal: true, isRequired: false, transformFunction: null }, strHijoContainer: { classPropertyName: "strHijoContainer", publicName: "strHijoContainer", isSignal: true, isRequired: false, transformFunction: null }, menuContextual: { classPropertyName: "menuContextual", publicName: "menuContextual", isSignal: true, isRequired: false, transformFunction: null }, classSeleccionado: { classPropertyName: "classSeleccionado", publicName: "classSeleccionado", isSignal: true, isRequired: false, transformFunction: null }, classAnulado: { classPropertyName: "classAnulado", publicName: "classAnulado", isSignal: true, isRequired: false, transformFunction: null }, campoAnulado: { classPropertyName: "campoAnulado", publicName: "campoAnulado", isSignal: true, isRequired: false, transformFunction: null }, templateTxtData: { classPropertyName: "templateTxtData", publicName: "templateTxtData", isSignal: true, isRequired: false, transformFunction: null }, condicionMostrar: { classPropertyName: "condicionMostrar", publicName: "condicionMostrar", isSignal: true, isRequired: false, transformFunction: null }, condicionesClaseFila: { classPropertyName: "condicionesClaseFila", publicName: "condicionesClaseFila", isSignal: true, isRequired: false, transformFunction: null }, idTabla: { classPropertyName: "idTabla", publicName: "idTabla", isSignal: true, isRequired: true, transformFunction: null }, selectionModel: { classPropertyName: "selectionModel", publicName: "selectionModel", isSignal: true, isRequired: false, transformFunction: null } }, 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.hidden]=\"!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 [indeterminate]=\"hasChild(0, node) && hijosActivos('indeterminate', node)\"\n [checked]=\"hasChild(0, node) ? hijosActivos('checked', node) : chkLista.modelosChk[node[campoId()]]\">\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: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: MatTreeModule }, { kind: "directive", type: i3.MatNestedTreeNode, selector: "mat-nested-tree-node", inputs: ["matNestedTreeNode", "disabled", "tabIndex"], outputs: ["activation", "expandedChange"], exportAs: ["matNestedTreeNode"] }, { kind: "directive", type: i3.MatTreeNodeDef, selector: "[matTreeNodeDef]", inputs: ["matTreeNodeDefWhen", "matTreeNode"] }, { kind: "directive", type: i3.MatTreeNodeToggle, selector: "[matTreeNodeToggle]", inputs: ["matTreeNodeToggleRecursive"] }, { kind: "component", type: i3.MatTree, selector: "mat-tree", exportAs: ["matTree"] }, { kind: "directive", type: i3.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.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"] }] });
218
241
  }
219
242
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ListaArbolComponent, decorators: [{
220
243
  type: Component,
@@ -224,55 +247,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
224
247
  MatTreeModule,
225
248
  MatIconModule,
226
249
  MatCheckboxModule,
227
- ], 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" }]
228
- }], propDecorators: { listaSuscription: [{
229
- type: Input
230
- }], nombreColeccion: [{
231
- type: Input
232
- }], checkbox: [{
233
- type: Input
234
- }], expandirRecursivo: [{
235
- type: Input
236
- }], checkboxSeleccionados: [{
237
- type: Input
238
- }], campoId: [{
239
- type: Input
240
- }], campoIdPadre: [{
241
- type: Input
242
- }], campoStr: [{
243
- type: Input
244
- }], campoOrden: [{
245
- type: Input
246
- }], strHijoContainer: [{
247
- type: Input
248
- }], menuContextual: [{
249
- type: Input
250
- }], classSeleccionado: [{
251
- type: Input
252
- }], classAnulado: [{
253
- type: Input
254
- }], campoAnulado: [{
255
- type: Input
256
- }], templateTxtData: [{
257
- type: Input
258
- }], condicionMostrar: [{
259
- type: Input
260
- }], condicionesClaseFila: [{
261
- type: Input
262
- }], selectionModel: [{
263
- type: Input
264
- }], selectionModelChange: [{
265
- type: Output
266
- }], seleccionado: [{
267
- type: Output
268
- }], listaCheck: [{
269
- type: Output
270
- }], listaCheckObj: [{
271
- type: Output
272
- }], idTabla: [{
273
- type: Input,
274
- args: [{ required: true }]
275
- }] } });
250
+ ], 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.hidden]=\"!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 [indeterminate]=\"hasChild(0, node) && hijosActivos('indeterminate', node)\"\n [checked]=\"hasChild(0, node) ? hijosActivos('checked', node) : chkLista.modelosChk[node[campoId()]]\">\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" }]
251
+ }], ctorParameters: () => [] });
276
252
 
277
253
  /**
278
254
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"jvsoft-components-lista-arbol.mjs","sources":["../../../projects/components/lista-arbol/lista-arbol.functions.ts","../../../projects/components/lista-arbol/lista-arbol.component.ts","../../../projects/components/lista-arbol/lista-arbol.component.html","../../../projects/components/lista-arbol/jvsoft-components-lista-arbol.ts"],"sourcesContent":["export function generarArbol(params: {\n lista: any[],\n campoId: string,\n campoIdPadre: string,\n idPadre?: any,\n strChildren?: string,\n campoOrden?: string\n}): any[] {\n const {\n lista,\n campoId,\n campoIdPadre,\n idPadre = null,\n strChildren = 'hijos',\n campoOrden,\n } = params;\n\n const hijos = lista.filter(n => n[campoIdPadre] === idPadre);\n\n if (campoOrden) {\n hijos.sort((a, b) => {\n const va = a[campoOrden];\n const vb = b[campoOrden];\n\n if (typeof va === 'string' && typeof vb === 'string') {\n return va.localeCompare(vb);\n }\n if (typeof va === 'number' && typeof vb === 'number') {\n return va - vb;\n }\n return 0;\n });\n }\n\n return hijos.map(n => ({\n ...n,\n [strChildren]: generarArbol({\n lista,\n campoId,\n campoIdPadre,\n idPadre: n[campoId],\n strChildren,\n campoOrden,\n }),\n }));\n}\n","import {Component, EventEmitter, Input, OnInit, Output, TemplateRef} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {MatTreeModule} from '@angular/material/tree';\nimport {MatIconModule} from '@angular/material/icon';\nimport {MatCheckboxModule} from '@angular/material/checkbox';\nimport {FormsModule} from '@angular/forms';\nimport {Observable} from 'rxjs';\nimport {NestedTreeControl} from '@angular/cdk/tree';\nimport {generarArbol} from './lista-arbol.functions';\nimport {DataModel} from '@jvsoft/utils';\nimport {SelectionModel} from '@angular/cdk/collections';\nimport shortHash from 'shorthash2';\n\n@Component({\n selector: 'jvs-lista-arbol',\n standalone: true,\n imports: [\n CommonModule,\n FormsModule,\n MatTreeModule,\n MatIconModule,\n MatCheckboxModule,\n ],\n templateUrl: './lista-arbol.component.html',\n})\nexport class ListaArbolComponent<T = any> implements OnInit {\n @Input() listaSuscription!: Observable<T[]>;\n @Input() nombreColeccion!: string;\n @Input() checkbox = false;\n @Input() expandirRecursivo = false;\n @Input() checkboxSeleccionados: T[] = [];\n\n @Input() campoId!: string;\n @Input() campoIdPadre!: string;\n @Input() campoStr!: string;\n @Input() campoOrden?: string;\n @Input() strHijoContainer = 'hijos';\n @Input() menuContextual?: { abrirMenuContextual: Function; cerrarMenuContextual: Function };\n @Input() classSeleccionado: string[] = ['bg-primary-activo', 'text-primary', 'dark:!bg-primary-dark-activo'];\n @Input() classAnulado: string[] = ['line-through', 'text-red', 'italic'];\n @Input() campoAnulado?: string | null;\n @Input() templateTxtData?: TemplateRef<any>;\n @Input() condicionMostrar?: (item: T) => boolean;\n @Input() condicionesClaseFila: (item: T) => string[] = () => [];\n\n @Input() set selectionModel(val: SelectionModel<any>) {\n this.objSeleccionado = val;\n }\n @Output() selectionModelChange = new EventEmitter<SelectionModel<any>>();\n\n @Output() seleccionado = new EventEmitter<any>();\n @Output() listaCheck = new EventEmitter<T[]>();\n @Output() listaCheckObj = new EventEmitter<Record<string, any>>();\n\n private _idTabla: string[] = [];\n\n get idTabla(): string[] {\n return this._idTabla;\n }\n\n @Input({required: true}) set idTabla(val: string[] | string) {\n if (Array.isArray(val)) {\n this._idTabla = val;\n }\n else {\n this._idTabla.push(val);\n }\n }\n\n get buscarItemSeleccionado(): any {\n const dRet = this.listaOriginal.find(itm => this._seleccionado === this.propiedadSeleccion(itm));\n return dRet ?? null;\n }\n get objSeleccionado() {\n return this.buscarItemSeleccionado; // ?? this.objThis?.['seleccionados']?.[this.nombreColeccion];\n }\n\n set objSeleccionado(val: any) {\n this.seleccionarItem(val, true);\n }\n\n chkLista = new DataModel();\n listaMuestraArbol: T[] = [];\n listaOriginal: T[] = [];\n\n treeControl = new NestedTreeControl((node: any) => node[this.strHijoContainer]);\n\n _seleccionado: any = {};\n\n ngOnInit(): void {\n this.listaSuscription.subscribe(res => {\n if (res) {\n this.listaOriginal = res;\n const listaAs = generarArbol({\n lista: res,\n campoId: this.campoId,\n campoIdPadre: this.campoIdPadre,\n idPadre: null,\n strChildren: this.strHijoContainer,\n campoOrden: this.campoOrden\n });\n this.listaMuestraArbol = [];\n setTimeout(() => {\n this.listaMuestraArbol = listaAs;\n }, 1);\n if (this.checkbox) {\n this.chkLista.agregarControles(res, this.campoId);\n this.checkboxSeleccionados.forEach((chkSel: any) => {\n this.chkLista.setState(chkSel[this.campoId], true);\n });\n this.emitirModeloCheck();\n }\n }\n });\n }\n\n\n idTablaValor(data: any): string {\n if (data) {\n if (this.idTabla.length < 1) {\n return shortHash(JSON.stringify({data, claseFinal: undefined}))\n }\n return this.idTabla.map(d => data[d]).join('-');\n }\n return '';\n }\n\n propiedadSeleccion(item: any): string {\n return `${this.nombreColeccion}_${this.idTablaValor(item)}`;\n }\n\n esSeleccionActual(item: any): boolean {\n return this._seleccionado === this.propiedadSeleccion(item);\n }\n seleccionarItem(item?: any, forzado: boolean = false): void {\n const idItem = this.propiedadSeleccion(item);\n if (forzado) {\n this._seleccionado = idItem;\n }\n else {\n this._seleccionado = this._seleccionado === idItem ? null:idItem;\n }\n this.selectionModelChange.emit(this.objSeleccionado);\n this.seleccionado.emit(this.objSeleccionado);\n }\n\n\n hasChild = (_: number, node: any) => !!node[this.strHijoContainer] && node[this.strHijoContainer].length > 0;\n\n\n opcMenu(v: any) {\n // console.warn(v);\n // console.warn(this.objSeleccionado);\n const opAdic: any = {seccion: this.nombreColeccion};\n opAdic['itemSeleccionado'] = this.objSeleccionado;\n // v = {...v, ...opAdic};\n // this.seleccionado.emit(v);\n }\n\n emitirModeloCheck() {\n this.listaCheck.emit(<any[]>this.chkLista.generarLista());\n this.listaCheckObj.emit(<object>this.chkLista.generarLista('object'));\n }\n\n\n cambiarPadre(checkActual: T, estado: boolean): void {\n const parentId = (checkActual as any)[this.campoIdPadre];\n if (parentId) {\n const padreAct = this.listaMuestraArbol.find((itm: any) => itm[this.campoId] == parentId);\n if (padreAct) {\n this.chkLista.setState(parentId, this.hijosActivos('checked', padreAct) || this.hijosActivos('indeterminate', padreAct));\n this.cambiarPadre(padreAct, estado);\n }\n }\n }\n\n cambiarCheck(checkActual: T, estado: boolean): void {\n if (this.hasChild(0, checkActual)) {\n (this.treeControl.getChildren(checkActual) ?? []).forEach((vas: any) => {\n this.cambiarCheck(vas, estado);\n });\n }\n this.cambiarPadre(checkActual, estado);\n this.chkLista.setState((checkActual as any)[this.campoId], estado);\n }\n\n hijosActivos(tipo: 'checked' | 'indeterminate', checkActual: T): boolean {\n let totalHijos = 0;\n let cantActivo = 0;\n if (this.hasChild(0, checkActual)) {\n (this.treeControl.getChildren(checkActual) ?? []).forEach((vas: any) => {\n if (this.chkLista.getState(vas[this.campoId] + '')) {\n cantActivo++;\n }\n totalHijos++;\n });\n }\n\n switch (tipo) {\n case 'checked':\n return (cantActivo == totalHijos);\n case 'indeterminate':\n if (cantActivo == totalHijos) {\n this.chkLista.setState((checkActual as any)[this.campoId], true);\n }\n return ((cantActivo > 0) && (cantActivo != totalHijos));\n }\n return false;\n }\n\n classFila(item: any) {\n let claseFinal: any[] = [];\n if (this.campoAnulado && (item[this.campoAnulado] == 1)) {\n claseFinal = claseFinal.concat(this.classAnulado);\n }\n if (this.objSeleccionado == item || this.esSeleccionActual(item)) {\n claseFinal = claseFinal.concat(this.classSeleccionado);\n }\n claseFinal = claseFinal.concat(this.condicionesClaseFila(item));\n item.claseFinal = claseFinal;\n return claseFinal;\n }\n}\n\n","<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","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAM,SAAU,YAAY,CAAC,MAO5B,EAAA;AACG,IAAA,MAAM,EACF,KAAK,EACL,OAAO,EACP,YAAY,EACZ,OAAO,GAAG,IAAI,EACd,WAAW,GAAG,OAAO,EACrB,UAAU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AA,q+EAAA,EAAA;8BAIQ,gBAAgB,EAAA,CAAA;sBAAxB;gBACQ,eAAe,EAAA,CAAA;sBAAvB;gBACQ,QAAQ,EAAA,CAAA;sBAAhB;gBACQ,iBAAiB,EAAA,CAAA;sBAAzB;gBACQ,qBAAqB,EAAA,CAAA;sBAA7B;gBAEQ,OAAO,EAAA,CAAA;sBAAf;gBACQ,YAAY,EAAA,CAAA;sBAApB;gBACQ,QAAQ,EAAA,CAAA;sBAAhB;gBACQ,UAAU,EAAA,CAAA;sBAAlB;gBACQ,gBAAgB,EAAA,CAAA;sBAAxB;gBACQ,cAAc,EAAA,CAAA;sBAAtB;gBACQ,iBAAiB,EAAA,CAAA;sBAAzB;gBACQ,YAAY,EAAA,CAAA;sBAApB;gBACQ,YAAY,EAAA,CAAA;sBAApB;gBACQ,eAAe,EAAA,CAAA;sBAAvB;gBACQ,gBAAgB,EAAA,CAAA;sBAAxB;gBACQ,oBAAoB,EAAA,CAAA;sBAA5B;gBAEY,cAAc,EAAA,CAAA;sBAA1B;gBAGS,oBAAoB,EAAA,CAAA;sBAA7B;gBAES,YAAY,EAAA,CAAA;sBAArB;gBACS,UAAU,EAAA,CAAA;sBAAnB;gBACS,aAAa,EAAA,CAAA;sBAAtB;gBAQ4B,OAAO,EAAA,CAAA;sBAAnC,KAAK;uBAAC,EAAC,QAAQ,EAAE,IAAI,EAAC;;;AE5D3B;;AAEG;;;;"}
1
+ {"version":3,"file":"jvsoft-components-lista-arbol.mjs","sources":["../../../projects/components/lista-arbol/lista-arbol.functions.ts","../../../projects/components/lista-arbol/lista-arbol.component.ts","../../../projects/components/lista-arbol/lista-arbol.component.html","../../../projects/components/lista-arbol/jvsoft-components-lista-arbol.ts"],"sourcesContent":["export function generarArbol(params: {\n lista: any[],\n campoId: string,\n campoIdPadre: string,\n idPadre?: any,\n strChildren?: string,\n campoOrden?: string\n}): any[] {\n const {\n lista,\n campoId,\n campoIdPadre,\n idPadre = null,\n strChildren = 'hijos',\n campoOrden,\n } = params;\n\n const hijos = lista.filter(n => n[campoIdPadre] === idPadre);\n\n if (campoOrden) {\n hijos.sort((a, b) => {\n const va = a[campoOrden];\n const vb = b[campoOrden];\n\n if (typeof va === 'string' && typeof vb === 'string') {\n return va.localeCompare(vb);\n }\n if (typeof va === 'number' && typeof vb === 'number') {\n return va - vb;\n }\n return 0;\n });\n }\n\n return hijos.map(n => ({\n ...n,\n [strChildren]: generarArbol({\n lista,\n campoId,\n campoIdPadre,\n idPadre: n[campoId],\n strChildren,\n campoOrden,\n }),\n }));\n}\n","import {Component, TemplateRef, computed, effect, input, output, signal, inject, untracked} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {MatTreeModule} from '@angular/material/tree';\nimport {MatIconModule} from '@angular/material/icon';\nimport {MatCheckboxModule} from '@angular/material/checkbox';\nimport {FormsModule} from '@angular/forms';\nimport {Observable} from 'rxjs';\nimport {switchMap} from 'rxjs/operators';\nimport {NestedTreeControl} from '@angular/cdk/tree';\nimport {generarArbol} from './lista-arbol.functions';\nimport {DataModel} from '@jvsoft/utils';\nimport {SelectionModel} from '@angular/cdk/collections';\nimport shortHash from 'shorthash2';\nimport {takeUntilDestroyed, toObservable} from '@angular/core/rxjs-interop';\n\n@Component({\n selector: 'jvs-lista-arbol',\n standalone: true,\n imports: [\n CommonModule,\n FormsModule,\n MatTreeModule,\n MatIconModule,\n MatCheckboxModule,\n ],\n templateUrl: './lista-arbol.component.html',\n})\nexport class ListaArbolComponent<T = any> {\n // Inputs\n listaSuscription = input.required<Observable<T[]>>();\n nombreColeccion = input.required<string>();\n checkbox = input(false);\n expandirRecursivo = input(false);\n checkboxSeleccionados = input<T[]>([]);\n\n campoId = input.required<string>();\n campoIdPadre = input.required<string>();\n campoStr = input<string>(''); // Optional - can use templateTxtData instead\n campoOrden = input<string>();\n strHijoContainer = input('hijos');\n menuContextual = input<{ abrirMenuContextual: Function; cerrarMenuContextual: Function }>();\n classSeleccionado = input<string[]>(['bg-primary-activo', 'text-primary', 'dark:!bg-primary-dark-activo']);\n classAnulado = input<string[]>(['line-through', 'text-red', 'italic']);\n campoAnulado = input<string | null>();\n templateTxtData = input<TemplateRef<any>>();\n condicionMostrar = input<(item: T) => boolean>();\n condicionesClaseFila = input<(item: T) => string[]>(() => []);\n \n // idTabla input with transform to support both string and string[]\n idTabla = input.required<string[] | string, string[] | string>({\n transform: (val: string[] | string) => {\n if (Array.isArray(val)) {\n this._idTabla.set(val);\n return val;\n } else {\n this._idTabla.update(current => [...current, val]);\n return [val];\n }\n }\n });\n\n // selectionModel input for backward compatibility \n selectionModel = input<any>();\n\n // Outputs\n selectionModelChange = output<any>();\n seleccionado = output<any>();\n listaCheck = output<T[]>();\n listaCheckObj = output<Record<string, any>>();\n\n // Internal state as signals\n private _idTabla = signal<string[]>([]);\n private _seleccionado = signal<string | null>(null);\n listaMuestraArbol = signal<T[]>([]);\n listaOriginal = signal<T[]>([]);\n chkLista = new DataModel();\n\n // Computed values\n idTablaValue = computed(() => this._idTabla());\n\n buscarItemSeleccionado = computed(() => {\n const selId = this._seleccionado();\n const lista = this.listaOriginal();\n if (!selId) return null;\n return lista.find(itm => selId === this.propiedadSeleccion(itm)) ?? null;\n });\n\n objSeleccionado = computed(() => this.buscarItemSeleccionado());\n\n treeControl = new NestedTreeControl((node: any) => node[this.strHijoContainer()]);\n\n // Convert signal to observable for proper subscription management\n private listaSuscription$ = toObservable(this.listaSuscription);\n\n constructor() {\n // Watch selectionModel input for backward compatibility\n effect(() => {\n const selModel = this.selectionModel();\n if (selModel) {\n untracked(() => this.seleccionarItem(selModel, true));\n }\n });\n\n // Setup subscription with automatic cleanup using switchMap\n // switchMap automatically unsubscribes from previous observable when a new one arrives\n this.listaSuscription$\n .pipe(\n switchMap(obs => obs),\n takeUntilDestroyed()\n )\n .subscribe(res => {\n if (res) {\n this.listaOriginal.set(res);\n const listaAs = generarArbol({\n lista: res,\n campoId: this.campoId(),\n campoIdPadre: this.campoIdPadre(),\n idPadre: null,\n strChildren: this.strHijoContainer(),\n campoOrden: this.campoOrden(),\n });\n \n // Use untracked to avoid unnecessary re-renders\n untracked(() => {\n this.listaMuestraArbol.set(listaAs);\n });\n\n if (this.checkbox()) {\n this.chkLista.agregarControles(res, this.campoId());\n this.checkboxSeleccionados().forEach((chkSel: any) => {\n this.chkLista.setState(chkSel[this.campoId()], true);\n });\n this.emitirModeloCheck();\n }\n }\n });\n }\n\n idTablaValor(data: any): string {\n if (data) {\n const idTablaVal = this._idTabla();\n if (idTablaVal.length < 1) {\n return shortHash(JSON.stringify({data, claseFinal: undefined}));\n }\n return idTablaVal.map(d => data[d]).join('-');\n }\n return '';\n }\n\n propiedadSeleccion(item: any): string {\n return `${this.nombreColeccion()}_${this.idTablaValor(item)}`;\n }\n\n esSeleccionActual(item: any): boolean {\n return this._seleccionado() === this.propiedadSeleccion(item);\n }\n\n seleccionarItem(item?: any, forzado: boolean = false): void {\n const idItem = this.propiedadSeleccion(item);\n if (forzado) {\n this._seleccionado.set(idItem);\n } else {\n this._seleccionado.update(current => current === idItem ? null : idItem);\n }\n const objSel = this.objSeleccionado();\n this.selectionModelChange.emit(objSel);\n this.seleccionado.emit(objSel);\n }\n\n hasChild = (_: number, node: any) => {\n const strHijo = this.strHijoContainer();\n return !!node[strHijo] && node[strHijo].length > 0;\n };\n\n opcMenu(v: any) {\n const opAdic: any = {seccion: this.nombreColeccion()};\n opAdic['itemSeleccionado'] = this.objSeleccionado();\n }\n\n emitirModeloCheck() {\n this.listaCheck.emit(<any[]>this.chkLista.generarLista());\n this.listaCheckObj.emit(<object>this.chkLista.generarLista('object'));\n }\n\n cambiarPadre(checkActual: T, estado: boolean): void {\n const parentId = (checkActual as any)[this.campoIdPadre()];\n if (parentId) {\n // Fix: buscar en listaOriginal en lugar de listaMuestraArbol\n const listaOrig = this.listaOriginal();\n const padreAct = listaOrig.find((itm: any) => itm[this.campoId()] === parentId);\n if (padreAct) {\n this.chkLista.setState(parentId, this.hijosActivos('checked', padreAct) || this.hijosActivos('indeterminate', padreAct));\n this.cambiarPadre(padreAct, estado);\n }\n }\n }\n\n cambiarCheck(checkActual: T, estado: boolean): void {\n if (this.hasChild(0, checkActual)) {\n (this.treeControl.getChildren(checkActual) ?? []).forEach((vas: any) => {\n this.cambiarCheck(vas, estado);\n });\n }\n this.cambiarPadre(checkActual, estado);\n this.chkLista.setState((checkActual as any)[this.campoId()], estado);\n }\n\n hijosActivos(tipo: 'checked' | 'indeterminate', checkActual: T): boolean {\n let totalHijos = 0;\n let cantActivo = 0;\n if (this.hasChild(0, checkActual)) {\n (this.treeControl.getChildren(checkActual) ?? []).forEach((vas: any) => {\n if (this.chkLista.getState(vas[this.campoId()] + '')) {\n cantActivo++;\n }\n totalHijos++;\n });\n }\n\n switch (tipo) {\n case 'checked':\n return (cantActivo === totalHijos);\n case 'indeterminate':\n // Fix: remover efecto secundario\n return ((cantActivo > 0) && (cantActivo !== totalHijos));\n }\n return false;\n }\n\n classFila(item: any): string[] {\n let claseFinal: any[] = [];\n const campoAnul = this.campoAnulado();\n if (campoAnul && (item[campoAnul] === 1)) {\n claseFinal = claseFinal.concat(this.classAnulado());\n }\n const objSel = this.objSeleccionado();\n if (objSel === item || this.esSeleccionActual(item)) {\n claseFinal = claseFinal.concat(this.classSeleccionado());\n }\n const condClases = this.condicionesClaseFila();\n claseFinal = claseFinal.concat(condClases(item));\n // Fix: no mutar el objeto original\n return claseFinal;\n }\n}\n","<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.hidden]=\"!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 [indeterminate]=\"hasChild(0, node) && hijosActivos('indeterminate', node)\"\n [checked]=\"hasChild(0, node) ? hijosActivos('checked', node) : chkLista.modelosChk[node[campoId()]]\">\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","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAM,SAAU,YAAY,CAAC,MAO5B,EAAA;AAC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