@servicemind.tis/tis-smart-table-viewer 2.3.15 → 2.3.17

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.
@@ -2516,7 +2516,16 @@ class TisSmartTableViewerComponent {
2516
2516
  if (this.onlySingleSelection && status.checked) {
2517
2517
  this.selection.clear();
2518
2518
  }
2519
- this.selection.toggle(row);
2519
+ const found = this.selection?.selected.find((el) => {
2520
+ return el[this.selectedRowKey] == row[this.selectedRowKey];
2521
+ });
2522
+ if (found) {
2523
+ this.selection?.deselect(found);
2524
+ }
2525
+ else {
2526
+ this.selection?.select(row);
2527
+ }
2528
+ // this.selection.toggle(row);
2520
2529
  this.selectedRows = this.selection.selected;
2521
2530
  this.selectedRowsChange.emit(this.selectedRows);
2522
2531
  this.checkAllRowsSelected();
@@ -2528,7 +2537,7 @@ class TisSmartTableViewerComponent {
2528
2537
  this.allRowsSelectedChange.emit(this.isAllRowsSelected);
2529
2538
  return;
2530
2539
  }
2531
- this.isAllRowsSelected = this.selection.selected.length === this.dataSource.apiSubject.value.length;
2540
+ this.isAllRowsSelected = (this.selection.selected.length >= this.dataSource.apiSubject.value.length);
2532
2541
  this.allRowsSelectedChange.emit(this.isAllRowsSelected);
2533
2542
  }
2534
2543
  toggleAllRows() {