@esfaenza/es-table 15.2.27 → 15.2.29

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.
@@ -4343,8 +4343,12 @@ class EsTableComponent {
4343
4343
  registerOnTouched(fn) { }
4344
4344
  /** @ignore */
4345
4345
  changed(clearItems = false) {
4346
- if (clearItems && this.viewMode)
4347
- this.View.items = [];
4346
+ if (clearItems && this.viewMode) {
4347
+ if (!this.ItemSourceProperty)
4348
+ this.View.items = [];
4349
+ else
4350
+ this.View[this.ItemSourceProperty] = [];
4351
+ }
4348
4352
  this.propagateChange(this.View);
4349
4353
  }
4350
4354
  /** @ignore */
@@ -4378,6 +4382,9 @@ class EsTableComponent {
4378
4382
  // Se cambia l'oggetto intero significa che ho rimandato la ricerca
4379
4383
  this.setMode('view');
4380
4384
  let firstItemGroupOrNoGrouping = (((_a = this.View.requestedgroups) === null || _a === void 0 ? void 0 : _a.length) || 0) == 0;
4385
+ // Queste sono item source custom. Le valorizzo al default se non esistono
4386
+ if (this.ItemSourceProperty && !this.View[this.ItemSourceProperty])
4387
+ this.View[this.ItemSourceProperty] = [];
4381
4388
  // Se vengo da una ricerca interna mantengo lo stato di selezione precedente (quindi su cambio pagina, cambio ipp, ecc...)
4382
4389
  // se invece l'utente ha fatto una ricerca lui (quindi cambiando filtri), secco le info di selezione
4383
4390
  if (!this.View.selection || (!this.View.internalsearchrequest && firstItemGroupOrNoGrouping) || !this.UseSelectionCache)
@@ -4437,7 +4444,7 @@ class EsTableComponent {
4437
4444
  }
4438
4445
  // La paginazione devo farla solamente quando richiedo o un gruppo principale (se sono in row grouping) o se non richiedo gruppi (in tutti lgi altri casi)
4439
4446
  if (firstItemGroupOrNoGrouping)
4440
- this.arrayPulsanti = this.utilities_H.getPagesArray(6, this.View.page, this.View.pages || 1, this.View.items.length, this.View.itemsperpageoverride);
4447
+ this.arrayPulsanti = this.utilities_H.getPagesArray(6, this.View.page, this.View.pages || 1, (this.ItemSourceProperty ? this.View[this.ItemSourceProperty] : this.View.items).length, this.View.itemsperpageoverride);
4441
4448
  }
4442
4449
  else if (this.View && (this.View.length != null && this.View.length != undefined)) {
4443
4450
  this.setMode('array');
@@ -4593,7 +4600,7 @@ class EsTableComponent {
4593
4600
  // Molte cose sono ovviamente disponibili solo in modalità View
4594
4601
  if ((this.viewMode || this.arrayMode) && this.UseCustomCells) {
4595
4602
  let view = this.viewMode ? View : null;
4596
- let itemsAndGroups = this.viewMode ? [...(view.items || []), ...(view.groups || [])] : View;
4603
+ let itemsAndGroups = this.viewMode ? [...((this.ItemSourceProperty ? view[this.ItemSourceProperty] : view.items) || []), ...(view.groups || [])] : View;
4597
4604
  let si = this.viewMode ? view.selection : this.arraymodeSelection;
4598
4605
  // N.B: Rispettare l'ordine di queste 3 macrocategorie è VITALE
4599
4606
  // ************************************* Sistemazioni di TH, TD, e visibilità varie *************************************
@@ -4650,7 +4657,7 @@ class EsTableComponent {
4650
4657
  }
4651
4658
  else if ((this.viewMode || this.arrayMode) && !this.UseCustomCells) {
4652
4659
  // Riallineo le info di selezione degli elementi della View
4653
- let items = this.viewMode ? View.items : View;
4660
+ let items = this.viewMode ? (this.ItemSourceProperty ? View[this.ItemSourceProperty] : View.items) : View;
4654
4661
  let si = this.viewMode ? View.selection : this.arraymodeSelection;
4655
4662
  this.selection_H.evaluateSelection(items, si);
4656
4663
  }