@trudb/tru-common-lib 0.1.969 → 0.1.970

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.
@@ -3348,26 +3348,10 @@ const SELECT_ALL_ICON = `
3348
3348
  <svg height="20px" fill="#000000" width="20px" x="0px" y="0px" viewBox="0 -10 100 125" enable-background="new 0 0 100 100" xml:space="preserve"><g><path d="M99,99H2.598L99,2.598V99z"/></g></svg>
3349
3349
  `;
3350
3350
  const DESC_SORT_ICON = `
3351
- <svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
3352
- <!-- "Z" shape in gray -->
3353
- <text x="2" y="8" font-family="Segoe UI, Arial" font-size="7" fill="#444" font-weight="bold">Z</text>
3354
- <!-- "A" shape in blue -->
3355
- <text x="2" y="15" font-family="Segoe UI, Arial" font-size="7" fill="#1976D2" font-weight="bold">A</text>
3356
- <!-- Downward arrow in gray -->
3357
- <path d="M12.5 3V14" stroke="#444" stroke-width="1.5" stroke-linecap="round"/>
3358
- <path d="M10.5 12L12.5 14L14.5 12" stroke="#444" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
3359
- </svg>
3351
+ <svg height="20px" viewBox="0 -960 960 960" width="20px" fill="#e3e3e3"><path d="M480-96 216-360l51-51 177 177v-630h72v630l177-177 51 51L480-96Z"/></svg>
3360
3352
  `;
3361
3353
  const ASC_SORT_ICON = `
3362
- <svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
3363
- <!-- A -->
3364
- <text x="2" y="8" font-family="Segoe UI, Arial" font-size="7" fill="#1976D2" font-weight="bold">A</text>
3365
- <!-- Z -->
3366
- <text x="2" y="16" font-family="Segoe UI, Arial" font-size="7" fill="#444" font-weight="bold">Z</text>
3367
- <!-- Down Arrow -->
3368
- <line x1="12.5" y1="3" x2="12.5" y2="14" stroke="#444" stroke-width="1.5" stroke-linecap="round"/>
3369
- <polyline points="10,12 12.5,15 15,12" fill="none" stroke="#444" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
3370
- </svg>
3354
+ <svg height="20px" viewBox="0 -960 960 960" width="20px" fill="#e3e3e3"><path d="M444-144v-534l-57 57-51-51 144-144 144 144-51 51-57-57v534h-72Z"/></svg>
3371
3355
  `;
3372
3356
  const NO_SORT_ICON = `
3373
3357
  <svg height="20px" viewBox="0 -960 960 960" width="20px" fill="#949494">
@@ -5900,18 +5884,15 @@ var TruDataGridTypes;
5900
5884
  class TruDataGridHeader {
5901
5885
  headerRef;
5902
5886
  params;
5903
- ascSort = 'inactive';
5904
- descSort = 'inactive';
5905
- noSort = 'inactive';
5887
+ ascSort = false;
5888
+ descSort = false;
5906
5889
  isHovering = false;
5907
5890
  columnMenuIsOpen = false;
5908
5891
  showFilterMenu = false;
5909
5892
  filterIsActive = false;
5910
5893
  agInit(params) {
5911
5894
  this.params = params;
5912
- this.params.column.addEventListener('sortChanged', this.onSortChanged.bind(this));
5913
5895
  this.params.api.addEventListener('cellFocused', this.onCellFocused.bind(this));
5914
- this.onSortChanged();
5915
5896
  }
5916
5897
  getHeaderParams() {
5917
5898
  return this.params;
@@ -5919,31 +5900,6 @@ class TruDataGridHeader {
5919
5900
  refresh(params) {
5920
5901
  return false;
5921
5902
  }
5922
- onSortChanged() {
5923
- this.ascSort = this.descSort = this.noSort = 'inactive';
5924
- if (this.params.column.isSortAscending()) {
5925
- this.ascSort = 'active';
5926
- }
5927
- else if (this.params.column.isSortDescending()) {
5928
- this.descSort = 'active';
5929
- }
5930
- else {
5931
- this.noSort = 'active';
5932
- }
5933
- }
5934
- onSortRequested(event) {
5935
- var order = null;
5936
- if (this.params.column.isSortAscending()) {
5937
- order = 'desc';
5938
- }
5939
- else if (this.params.column.isSortDescending()) {
5940
- order = null;
5941
- }
5942
- else {
5943
- order = 'asc';
5944
- }
5945
- this.params.setSort(order, event.shiftKey);
5946
- }
5947
5903
  onSelectAllIconClicked() {
5948
5904
  this.params.api.selectAll();
5949
5905
  }
@@ -5968,6 +5924,8 @@ class TruDataGridHeader {
5968
5924
  this.columnMenuIsOpen = false;
5969
5925
  this.showFilterMenu = this.isHovering && this.params.api.getDisplayedRowCount() > 0 || this.columnMenuIsOpen || this.params.column.isFilterActive();
5970
5926
  this.filterIsActive = this.params.column.isFilterActive();
5927
+ this.ascSort = this.params.column.isSortAscending();
5928
+ this.descSort = this.params.column.isSortDescending();
5971
5929
  });
5972
5930
  this.columnMenuIsOpen = true;
5973
5931
  }
@@ -5987,7 +5945,6 @@ class TruDataGridHeader {
5987
5945
  this.filterIsActive = this.params.column.isFilterActive();
5988
5946
  }
5989
5947
  ngOnDestroy() {
5990
- this.params.column.removeEventListener('sortChanged', this.onSortChanged.bind(this));
5991
5948
  this.params.api.removeEventListener('cellFocused', this.onCellFocused.bind(this));
5992
5949
  }
5993
5950
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: TruDataGridHeader, deps: [], target: i0.ɵɵFactoryTarget.Component });
@@ -6000,8 +5957,10 @@ class TruDataGridHeader {
6000
5957
  </div>
6001
5958
  <div class="ag-header-control-filter-container" *ngIf="showFilterMenu">
6002
5959
  <span ref="eFilterButton" class="ag-filter-icon" (click)="onFilterMenuButtonClicked($event)">
6003
- <mat-icon class="ag-header-more" [svgIcon]="'more-icon'" *ngIf="!filterIsActive;"></mat-icon>
6004
- <mat-icon class="ag-header-filter" [svgIcon]="'filter-icon'" *ngIf="filterIsActive;"></mat-icon>
5960
+ <mat-icon class="ag-header-more" [svgIcon]="'more-icon'" *ngIf="!filterIsActive && !ascSort && !descSort"></mat-icon>
5961
+ <mat-icon class="ag-header-asc" [svgIcon]="'asc-sort-icon'" *ngIf="ascSort"></mat-icon>
5962
+ <mat-icon class="ag-header-desc" [svgIcon]="'desc-sort-icon'" *ngIf="descSort"></mat-icon>
5963
+ <mat-icon class="ag-header-filter" [svgIcon]="'filter-icon'" *ngIf="filterIsActive"></mat-icon>
6005
5964
  </span>
6006
5965
  </div>
6007
5966
  </div>
@@ -6019,8 +5978,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
6019
5978
  </div>
6020
5979
  <div class="ag-header-control-filter-container" *ngIf="showFilterMenu">
6021
5980
  <span ref="eFilterButton" class="ag-filter-icon" (click)="onFilterMenuButtonClicked($event)">
6022
- <mat-icon class="ag-header-more" [svgIcon]="'more-icon'" *ngIf="!filterIsActive;"></mat-icon>
6023
- <mat-icon class="ag-header-filter" [svgIcon]="'filter-icon'" *ngIf="filterIsActive;"></mat-icon>
5981
+ <mat-icon class="ag-header-more" [svgIcon]="'more-icon'" *ngIf="!filterIsActive && !ascSort && !descSort"></mat-icon>
5982
+ <mat-icon class="ag-header-asc" [svgIcon]="'asc-sort-icon'" *ngIf="ascSort"></mat-icon>
5983
+ <mat-icon class="ag-header-desc" [svgIcon]="'desc-sort-icon'" *ngIf="descSort"></mat-icon>
5984
+ <mat-icon class="ag-header-filter" [svgIcon]="'filter-icon'" *ngIf="filterIsActive"></mat-icon>
6024
5985
  </span>
6025
5986
  </div>
6026
5987
  </div>