@trudb/tru-common-lib 0.2.487 → 0.2.488

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.
@@ -7546,19 +7546,6 @@ class TruDataGridHeader {
7546
7546
  columnMenuIsOpen = false;
7547
7547
  showFilterMenu = false;
7548
7548
  filterIsActive = false;
7549
- agInit(params) {
7550
- this.params = params;
7551
- this.params.api.addEventListener('cellFocused', this.onCellFocused.bind(this));
7552
- }
7553
- getHeaderParams() {
7554
- return this.params;
7555
- }
7556
- refresh(params) {
7557
- return false;
7558
- }
7559
- onSelectAllIconClicked() {
7560
- this.params.api.selectAll();
7561
- }
7562
7549
  onCellFocused(event) {
7563
7550
  var column = event.column;
7564
7551
  if (column?.getColDef().pinned) {
@@ -7573,6 +7560,23 @@ class TruDataGridHeader {
7573
7560
  }
7574
7561
  }
7575
7562
  }
7563
+ onSortChanged(event) {
7564
+ this.filterIsActive = this.params.column.isFilterActive();
7565
+ this.ascSort = this.params.column.isSortAscending();
7566
+ this.descSort = this.params.column.isSortDescending();
7567
+ this.showFilterMenu = this.isHovering && this.params.api.getDisplayedRowCount() > 0 || this.columnMenuIsOpen || this.params.column.isFilterActive() || this.ascSort || this.descSort;
7568
+ }
7569
+ agInit(params) {
7570
+ this.params = params;
7571
+ this.params.api.addEventListener('cellFocused', this.onCellFocused.bind(this));
7572
+ this.params.column.addEventListener('sortChanged', this.onSortChanged.bind(this));
7573
+ }
7574
+ getHeaderParams() {
7575
+ return this.params;
7576
+ }
7577
+ refresh(params) {
7578
+ return false;
7579
+ }
7576
7580
  onFilterMenuButtonClicked(event) {
7577
7581
  if (!this.columnMenuIsOpen) {
7578
7582
  this.params.column.getColDef().headerComponentParams = this.params;
@@ -7602,6 +7606,7 @@ class TruDataGridHeader {
7602
7606
  }
7603
7607
  ngOnDestroy() {
7604
7608
  this.params.api.removeEventListener('cellFocused', this.onCellFocused.bind(this));
7609
+ this.params.column.removeEventListener('sortChanged', this.onSortChanged.bind(this));
7605
7610
  }
7606
7611
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TruDataGridHeader, deps: [], target: i0.ɵɵFactoryTarget.Component });
7607
7612
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: TruDataGridHeader, isStandalone: true, selector: "ng-component", viewQueries: [{ propertyName: "headerRef", first: true, predicate: ["header"], descendants: true }], ngImport: i0, template: `