@trudb/tru-common-lib 0.1.955 → 0.1.956

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.
@@ -6021,34 +6021,35 @@ class TruDataGridHeaderFilter {
6021
6021
  filterParams;
6022
6022
  gui;
6023
6023
  filterText = '';
6024
- typesOfSort = [
6025
- {
6026
- value: 'asc',
6027
- label: 'Sort A to Z',
6028
- selected: false,
6029
- display: true,
6030
- icon: 'asc-sort-icon'
6031
- },
6032
- {
6033
- value: 'desc',
6034
- label: 'Sort Z to A',
6035
- selected: false,
6036
- display: true,
6037
- icon: 'desc-sort-icon'
6038
- },
6039
- {
6040
- value: 'clear',
6041
- label: 'Clear Sort',
6042
- selected: false,
6043
- display: true,
6044
- icon: 'no-sort-icon'
6045
- }
6046
- ];
6024
+ typesOfSort = [];
6047
6025
  values = [];
6048
6026
  filterInputControl = new FormControl('', []);
6049
6027
  constructor() { }
6050
6028
  agInit(params) {
6051
6029
  this.filterParams = params;
6030
+ this.typesOfSort = [
6031
+ {
6032
+ value: 'asc',
6033
+ label: 'Sort A to Z',
6034
+ selected: false,
6035
+ display: !this.filterParams.column.isSortAscending(),
6036
+ icon: 'asc-sort-icon'
6037
+ },
6038
+ {
6039
+ value: 'desc',
6040
+ label: 'Sort Z to A',
6041
+ selected: false,
6042
+ display: !this.filterParams.column.isSortDescending(),
6043
+ icon: 'desc-sort-icon'
6044
+ },
6045
+ {
6046
+ value: 'clear',
6047
+ label: 'Clear Sort',
6048
+ selected: false,
6049
+ display: this.filterParams.column.isSortAscending() || this.filterParams.column.isSortDescending(),
6050
+ icon: 'no-sort-icon'
6051
+ }
6052
+ ];
6052
6053
  }
6053
6054
  isFilterActive() {
6054
6055
  return this.filterText != null && this.filterText !== '';
@@ -6079,6 +6080,8 @@ class TruDataGridHeaderFilter {
6079
6080
  this.filterParams.filterChangedCallback();
6080
6081
  }
6081
6082
  onSortSelection = (event) => {
6083
+ let value = event.options[0].value === 'clear' ? null : event.options[0].value;
6084
+ this.filterParams.colDef.headerComponentParams.setSort(value, false);
6082
6085
  };
6083
6086
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: TruDataGridHeaderFilter, deps: [], target: i0.ɵɵFactoryTarget.Component });
6084
6087
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.3", type: TruDataGridHeaderFilter, isStandalone: true, selector: "ng-component", ngImport: i0, template: `