@datorama/core 21.4.0-rc.14 → 21.4.0-rc.15

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.
@@ -12624,15 +12624,18 @@ var DatoGridFilterComponent = /** @class */ (function () {
12624
12624
  var _this = this;
12625
12625
  var _b = this.popover.data, gridService = _b.gridService, gridQuery = _b.gridQuery;
12626
12626
  var _c = this.colDef, filter = _c.filter, _d = _c.filtersConfig, filtersConfig = _d === void 0 ? {} : _d, pivotValueColumn = _c.pivotValueColumn, pivotKeys = _c.pivotKeys;
12627
+ var colDefs = gridQuery.api.columns.getAllColumns().map(function (column) { return column.getColDef(); });
12627
12628
  this.colField = getColField(this.colDef);
12629
+ var colDef = colDefs.find(function (colDef) { return colDef.field === _this.colField; });
12628
12630
  this.pivotColumn = gridQuery.api.columns.getSecondaryPivotColumn(pivotKeys, pivotValueColumn);
12629
12631
  if (filtersConfig.sections) {
12630
12632
  this.filterSections = (_a = {}, _a[filtersConfig.sections] = true, _a);
12631
12633
  }
12632
12634
  this.keepPredefinedListOriginalOrder =
12633
12635
  filtersConfig.keepPredefinedListOriginalOrder && !isEmpty(filtersConfig.predefinedListValues);
12634
- var filterOptions = DatoGridFilterOptionsMap[filter];
12635
- this.filterType = filterOptions ? filter : DatoGridFilterTypes.String;
12636
+ var colFilter = filter || colDef.filter;
12637
+ var filterOptions = DatoGridFilterOptionsMap[colFilter];
12638
+ this.filterType = filterOptions ? colFilter : DatoGridFilterTypes.String;
12636
12639
  this.listLabelType = this.filterType.toLowerCase();
12637
12640
  this.listSortByKey = this.filterType === DatoGridFilterTypes.Number && this.colDef.valueFormatter ? 'id' : 'label';
12638
12641
  this.gridQuery = gridQuery;
@@ -14712,27 +14715,14 @@ var GridService = /** @class */ (function () {
14712
14715
  /**
14713
14716
  * When pivoting,
14714
14717
  * we add the field name to the column header class in order to access it through the auto generated pivot column.
14715
- * @private
14716
14718
  */
14717
14719
  GridService.prototype.initPivotSecondaryColsProcess = function (_a) {
14718
14720
  var _this = this;
14719
14721
  var gridOptions = _a.gridOptions;
14720
14722
  gridOptions.processSecondaryColDef = function (colDef) {
14721
- var api = colDef.headerComponentParams && colDef.headerComponentParams.gridQuery.api;
14722
- if (api) {
14723
- var valueColumns = colDef.headerComponentParams.gridQuery.api.columns.getValueColumns();
14724
- var originalColDef = valueColumns
14725
- .map(function (_a) {
14726
- var userProvidedColDef = _a.userProvidedColDef;
14727
- return userProvidedColDef;
14728
- })
14729
- .find(function (_a) {
14730
- var colId = _a.colId;
14731
- return colId === colDef.pivotValueColumn.getColId();
14732
- });
14733
- if (originalColDef) {
14734
- colDef.filter = originalColDef.filter;
14735
- }
14723
+ var userProvidedColDef = colDef.pivotValueColumn.getUserProvidedColDef();
14724
+ if (userProvidedColDef) {
14725
+ colDef.filter = userProvidedColDef.filter;
14736
14726
  }
14737
14727
  if (colDef.pivotKeys) {
14738
14728
  colDef.pivotKeys = colDef.pivotKeys.map(function (key) {