@datorama/core 22.0.6 → 22.2.0

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.
@@ -11583,20 +11583,17 @@
11583
11583
  if (this.gridRef.gridOptions.pivotMode) {
11584
11584
  var _a = this.api.grid.getSortModel().pop() || {}, sort = _a.sort, colId = _a.colId;
11585
11585
  var column = this.api.columns.getColumn(colId);
11586
- var pivotedColumn = this.getSecondaryColumn(colId);
11587
- if (pivotedColumn) {
11588
- var uniquePivotParents = uniq(this.api.columns.getSecondaryColumns().map(function (column) { return column.getParent(); }));
11589
- var secondaryColumn = this.getSecondaryColumn(pivotedColumn.getColId());
11590
- var pivotColIndex = uniquePivotParents.indexOf(secondaryColumn.getParent());
11591
- return { colId: colId, sort: sort, pivotColIndex: pivotColIndex, colField: getColField(pivotedColumn.getColDef()) };
11592
- }
11593
- else if (column) {
11586
+ if (column) {
11594
11587
  return { colId: colId, sort: sort, colField: getColField(column.getColDef()) };
11595
11588
  }
11589
+ else {
11590
+ var secondaryColumn = this.getSecondaryColumn(colId);
11591
+ if (secondaryColumn) {
11592
+ return { colId: colId, sort: sort, colField: getColField(secondaryColumn.getColDef()) };
11593
+ }
11594
+ }
11596
11595
  }
11597
- else {
11598
- return this.api.grid.getSortModel().pop();
11599
- }
11596
+ return this.api.grid.getSortModel().pop();
11600
11597
  };
11601
11598
  GridQuery.prototype.selectSort = function () {
11602
11599
  return this.select(function (state) { return state.settings.sort; });
@@ -11693,7 +11690,10 @@
11693
11690
  };
11694
11691
  GridQuery.prototype.getSecondaryColumn = function (colId) {
11695
11692
  var secondaryColumns = this.api.columns.getSecondaryColumns();
11696
- return secondaryColumns && secondaryColumns.find(function (col) { return col.getColId() === colId; });
11693
+ if (secondaryColumns) {
11694
+ return secondaryColumns.find(function (col) { return col.getColId() === colId; });
11695
+ }
11696
+ return null;
11697
11697
  };
11698
11698
  GridQuery.prototype.filterCheckboxSelectionColumn = function (columns) {
11699
11699
  return columns.filter(function (column) { return !column.getUserProvidedColDef() || !column.getUserProvidedColDef().checkboxSelection; });
@@ -14405,11 +14405,13 @@
14405
14405
  var filter = filters_1_1.value.filter;
14406
14406
  var column = this.api.columns.getColumn(filter.colId);
14407
14407
  if (column) {
14408
- this.setColumnFilter(column, filter);
14408
+ this.setColumnFilter(column, filter, false);
14409
14409
  }
14410
14410
  else {
14411
- var pivotColumn = this.gridQuery.getSecondaryColumn(filter.colId);
14412
- this.setColumnFilter(pivotColumn, filter);
14411
+ var secondaryColumn = this.gridQuery.getSecondaryColumn(filter.colId);
14412
+ if (secondaryColumn) {
14413
+ this.setColumnFilter(secondaryColumn, filter, false);
14414
+ }
14413
14415
  }
14414
14416
  }
14415
14417
  }
@@ -14420,7 +14422,23 @@
14420
14422
  }
14421
14423
  finally { if (e_2) throw e_2.error; }
14422
14424
  }
14423
- this.notifyFilterUpdate();
14425
+ this.api.grid.onFilterChanged();
14426
+ }
14427
+ };
14428
+ GridService.prototype.setGridSort = function (_a) {
14429
+ var colId = _a.colId, sort = _a.sort;
14430
+ if (this.api) {
14431
+ var column = this.api.columns.getColumn(colId);
14432
+ if (column) {
14433
+ column.setSort(sort);
14434
+ }
14435
+ else {
14436
+ var secondaryColumn = this.gridQuery.getSecondaryColumn(colId);
14437
+ if (secondaryColumn) {
14438
+ secondaryColumn.setSort(sort);
14439
+ }
14440
+ }
14441
+ this.api.grid.onSortChanged();
14424
14442
  }
14425
14443
  };
14426
14444
  GridService.prototype.updateFilter = function (column, filter) {
@@ -15535,6 +15553,9 @@
15535
15553
  DatoGridControllerComponent.prototype.setGridFilters = function (filters) {
15536
15554
  this.gridService.setGridFilters(filters);
15537
15555
  };
15556
+ DatoGridControllerComponent.prototype.setGridSort = function (sort) {
15557
+ this.gridService.setGridSort(sort);
15558
+ };
15538
15559
  DatoGridControllerComponent.prototype.onFilterChanged = function () {
15539
15560
  return this.gridQuery.filterChanged();
15540
15561
  };
@@ -25361,7 +25382,7 @@
25361
25382
  };
25362
25383
  }
25363
25384
 
25364
- window.coreVersion = '22.0.6';
25385
+ window.coreVersion = '22.2.0';
25365
25386
 
25366
25387
  exports.APP_TRANSLATE = APP_TRANSLATE;
25367
25388
  exports.AceService = AceService;