@esfaenza/es-table 11.2.146 → 11.2.147

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.
@@ -4488,11 +4488,8 @@
4488
4488
  firstItemGroupOrNoGrouping = (((_a = this.View.requestedgroups) === null || _a === void 0 ? void 0 : _a.length) || 0) == 0;
4489
4489
  // Se vengo da una ricerca interna mantengo lo stato di selezione precedente (quindi su cambio pagina, cambio ipp, ecc...)
4490
4490
  // se invece l'utente ha fatto una ricerca lui (quindi cambiando filtri), secco le info di selezione
4491
- if (!this.View.selection || (!this.View.internalsearchrequest && firstItemGroupOrNoGrouping) || !this.UseSelectionCache) {
4492
- this.selection_H.clearSelectionCaches();
4493
- this.View.selection = new ItemsSelection([]);
4494
- this.onSelectionChanged.emit(this.View.selection);
4495
- }
4491
+ if (!this.View.selection || (!this.View.internalsearchrequest && firstItemGroupOrNoGrouping) || !this.UseSelectionCache)
4492
+ this.resetSelection(true);
4496
4493
  this.View.internalsearchrequest = false;
4497
4494
  if (!this.SavePreferences) return [3 /*break*/, 4];
4498
4495
  if (!!this.ngControl.name) return [3 /*break*/, 1];
@@ -4556,11 +4553,8 @@
4556
4553
  case 5:
4557
4554
  if (!(this.View && (this.View.length != null && this.View.length != undefined))) return [3 /*break*/, 10];
4558
4555
  this.setMode('array');
4559
- if (!this.UseSelectionCache || !this.arraymodeSelection) {
4560
- this.selection_H.clearSelectionCaches();
4561
- this.arraymodeSelection = new ItemsSelection([]);
4562
- this.onSelectionChanged.emit(this.arraymodeSelection);
4563
- }
4556
+ if (!this.UseSelectionCache || !this.arraymodeSelection)
4557
+ this.resetSelection(true);
4564
4558
  if (!this.SavePreferences) return [3 /*break*/, 9];
4565
4559
  if (!!this.ngControl.name) return [3 /*break*/, 6];
4566
4560
  console.error("Non posso utilizzare le preference senza avere un 'name' per questa tabella");
@@ -4853,6 +4847,24 @@
4853
4847
  this.selection_H.handleItemsSelection(items, select);
4854
4848
  this.cdr.markForCheck();
4855
4849
  };
4850
+ /**
4851
+ * Effettua un hard reset della selezione
4852
+ */
4853
+ EsTableComponent.prototype.resetSelection = function (emit) {
4854
+ if (emit === void 0) { emit = false; }
4855
+ var _a;
4856
+ this.selection_H.clearSelectionCaches();
4857
+ if ((_a = this.View) === null || _a === void 0 ? void 0 : _a.selection) {
4858
+ this.View.selection = new ItemsSelection([]);
4859
+ if (emit)
4860
+ this.onSelectionChanged.emit(this.View.selection);
4861
+ }
4862
+ else if (this.arraymodeSelection) {
4863
+ this.arraymodeSelection = new ItemsSelection([]);
4864
+ if (emit)
4865
+ this.onSelectionChanged.emit(this.arraymodeSelection);
4866
+ }
4867
+ };
4856
4868
  /**
4857
4869
  * Metodo che gestisce il cambio di Ordinamento di una colonna
4858
4870
  *