@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.
@@ -3968,11 +3968,8 @@ class EsTableComponent {
3968
3968
  let firstItemGroupOrNoGrouping = (((_a = this.View.requestedgroups) === null || _a === void 0 ? void 0 : _a.length) || 0) == 0;
3969
3969
  // Se vengo da una ricerca interna mantengo lo stato di selezione precedente (quindi su cambio pagina, cambio ipp, ecc...)
3970
3970
  // se invece l'utente ha fatto una ricerca lui (quindi cambiando filtri), secco le info di selezione
3971
- if (!this.View.selection || (!this.View.internalsearchrequest && firstItemGroupOrNoGrouping) || !this.UseSelectionCache) {
3972
- this.selection_H.clearSelectionCaches();
3973
- this.View.selection = new ItemsSelection([]);
3974
- this.onSelectionChanged.emit(this.View.selection);
3975
- }
3971
+ if (!this.View.selection || (!this.View.internalsearchrequest && firstItemGroupOrNoGrouping) || !this.UseSelectionCache)
3972
+ this.resetSelection(true);
3976
3973
  this.View.internalsearchrequest = false;
3977
3974
  // Recupero Preference
3978
3975
  if (this.SavePreferences) {
@@ -4032,11 +4029,8 @@ class EsTableComponent {
4032
4029
  }
4033
4030
  else if (this.View && (this.View.length != null && this.View.length != undefined)) {
4034
4031
  this.setMode('array');
4035
- if (!this.UseSelectionCache || !this.arraymodeSelection) {
4036
- this.selection_H.clearSelectionCaches();
4037
- this.arraymodeSelection = new ItemsSelection([]);
4038
- this.onSelectionChanged.emit(this.arraymodeSelection);
4039
- }
4032
+ if (!this.UseSelectionCache || !this.arraymodeSelection)
4033
+ this.resetSelection(true);
4040
4034
  // Recupero Preference
4041
4035
  if (this.SavePreferences) {
4042
4036
  if (!this.ngControl.name)
@@ -4322,6 +4316,23 @@ class EsTableComponent {
4322
4316
  this.selection_H.handleItemsSelection(items, select);
4323
4317
  this.cdr.markForCheck();
4324
4318
  }
4319
+ /**
4320
+ * Effettua un hard reset della selezione
4321
+ */
4322
+ resetSelection(emit = false) {
4323
+ var _a;
4324
+ this.selection_H.clearSelectionCaches();
4325
+ if ((_a = this.View) === null || _a === void 0 ? void 0 : _a.selection) {
4326
+ this.View.selection = new ItemsSelection([]);
4327
+ if (emit)
4328
+ this.onSelectionChanged.emit(this.View.selection);
4329
+ }
4330
+ else if (this.arraymodeSelection) {
4331
+ this.arraymodeSelection = new ItemsSelection([]);
4332
+ if (emit)
4333
+ this.onSelectionChanged.emit(this.arraymodeSelection);
4334
+ }
4335
+ }
4325
4336
  /**
4326
4337
  * Metodo che gestisce il cambio di Ordinamento di una colonna
4327
4338
  *