@esfaenza/es-table 19.2.22 → 19.2.23

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.
@@ -9,7 +9,7 @@ import * as i1 from '@angular/forms';
9
9
  import { FormsModule } from '@angular/forms';
10
10
  import * as i5$1 from 'primeng/select';
11
11
  import { SelectModule } from 'primeng/select';
12
- import { Subject, forkJoin, fromEvent, takeUntil } from 'rxjs';
12
+ import { ReplaySubject, Subject, forkJoin, fromEvent, takeUntil } from 'rxjs';
13
13
  import * as i13 from '@angular/cdk/drag-drop';
14
14
  import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
15
15
  import * as i2$1 from '@esfaenza/preferences';
@@ -474,7 +474,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
474
474
 
475
475
  class ThTdProvider {
476
476
  constructor() {
477
- this.LoadedSignal = new Subject();
477
+ this.LoadedSignal = new ReplaySubject();
478
478
  }
479
479
  setLoaded() {
480
480
  requestAnimationFrame(() => {
@@ -4404,6 +4404,11 @@ class EsTableComponent {
4404
4404
  /** @ignore */
4405
4405
  async writeValue(obj, throttle = true) {
4406
4406
  this.View = obj ? obj : null;
4407
+ // Qui il concetto è "devo aspettare che l'afterViewInit venga eseguito prima di eseguire questo"
4408
+ // E dato che entrambi aspettano sui provider li faccio così
4409
+ let thsTdsProviders = [...(this.EsThTdProvider ? [this.EsThTdProvider] : []), ...(this.ThTdProvider || [])];
4410
+ if (thsTdsProviders?.length > 0)
4411
+ await forkJoin(thsTdsProviders.map(t => t.LoadedSignal)).toPromise();
4407
4412
  if (this.EsTableHandledSearch() && throttle) {
4408
4413
  if (this.callTimeout)
4409
4414
  clearTimeout(this.callTimeout);
@@ -4638,9 +4643,6 @@ class EsTableComponent {
4638
4643
  let isp = this.ItemSourceProperty();
4639
4644
  let customCells = this.UseCustomCells();
4640
4645
  let dynColDefs = this.DynamicRowColumnsDefinition();
4641
- let thsTdsProviders = [...(this.EsThTdProvider ? [this.EsThTdProvider] : []), ...this.ThTdProvider];
4642
- if (thsTdsProviders?.length > 0)
4643
- await forkJoin(thsTdsProviders.map(t => t.LoadedSignal)).toPromise();
4644
4646
  // Se non ho colonne dinamiche ma sono in modalità dinamica (lo capisco perché c'è una view piena di genericitem) metto il default delle colonne
4645
4647
  this.dynamicMode_H.eventuallyReviewDynamicColumns();
4646
4648
  // Gestisce la richiesta per gruppi o per singoli oggetti
@@ -5278,9 +5280,9 @@ class EsTableComponent {
5278
5280
  * Helper per effettuare chiamate interne di allineamento alla funzione **writeValue**,
5279
5281
  * impostando prima **internalWriteCall** in modo da non effettuare operazioni inutili
5280
5282
  */
5281
- internalWriteValue() {
5283
+ async internalWriteValue() {
5282
5284
  this.internalWriteCall = true;
5283
- this.writeValue(this.View);
5285
+ await this.writeValue(this.View);
5284
5286
  this.internalWriteCall = false;
5285
5287
  }
5286
5288
  /** Metodo eventualmente richiamabile anche dal componente esterno che permette di forzare un refresh della tabella */