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

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.
@@ -11603,9 +11603,9 @@ function validateStringCondition(rowValue, _a) {
11603
11603
  return !isEmpty(valueLowerCase);
11604
11604
  }
11605
11605
  }
11606
- function validateNumberCondition(unparsedRowValue, _a) {
11606
+ function validateNumberCondition(unparsedRowValue, _a, filterKey) {
11607
11607
  var condition = _a.condition, value = _a.value, rangeEnd = _a.rangeEnd;
11608
- var rowValue = !!unparsedRowValue ? parseFloat(unparsedRowValue) : null;
11608
+ var rowValue = !!unparsedRowValue ? parseFloat(unparsedRowValue[filterKey] || unparsedRowValue) : null;
11609
11609
  var filterValue = parseFloat(value);
11610
11610
  switch (condition) {
11611
11611
  case DatoFilterConditions.EQUALS:
@@ -11653,14 +11653,14 @@ function validateDateCondition(rowValue, _a) {
11653
11653
  }
11654
11654
  }
11655
11655
  function validateCondition(_a) {
11656
- var rowValue = _a.rowValue, filter = _a.filter, type = _a.type;
11656
+ var rowValue = _a.rowValue, condition = _a.condition, type = _a.type, filterKey = _a.filterKey;
11657
11657
  switch (type) {
11658
11658
  case DatoGridFilterTypes.Date:
11659
- return validateDateCondition(rowValue, filter);
11659
+ return validateDateCondition(rowValue, condition);
11660
11660
  case DatoGridFilterTypes.Number:
11661
- return validateNumberCondition(rowValue, filter);
11661
+ return validateNumberCondition(rowValue, condition, filterKey);
11662
11662
  default:
11663
- return validateStringCondition(rowValue, filter);
11663
+ return validateStringCondition(rowValue, condition);
11664
11664
  }
11665
11665
  }
11666
11666
  function validateFilter(_a, activeFilters) {
@@ -11680,7 +11680,9 @@ function validateFilter(_a, activeFilters) {
11680
11680
  if (conditional) {
11681
11681
  var operator = conditional.operator, conditions = conditional.conditions, type_1 = conditional.type;
11682
11682
  var conditionsRelation = operator === OperatorTypes.AND ? 'every' : 'some';
11683
- filterPasses = conditions[conditionsRelation](function (filter) { return validateCondition({ rowValue: rowValue, filter: filter, type: type_1 }); });
11683
+ filterPasses = conditions[conditionsRelation](function (condition) {
11684
+ return validateCondition({ rowValue: rowValue, condition: condition, type: type_1, filterKey: filter });
11685
+ });
11684
11686
  }
11685
11687
  if (filterPasses && byValue) {
11686
11688
  var includesValue = byValue.values.includes(rowValue);
@@ -12623,10 +12625,11 @@ var DatoGridFilterComponent = /** @class */ (function () {
12623
12625
  var _a;
12624
12626
  var _this = this;
12625
12627
  var _b = this.popover.data, gridService = _b.gridService, gridQuery = _b.gridQuery;
12626
- var _c = this.colDef, filter = _c.filter, _d = _c.filtersConfig, filtersConfig = _d === void 0 ? {} : _d, pivotValueColumn = _c.pivotValueColumn, pivotKeys = _c.pivotKeys;
12628
+ var _c = this.colDef, filter = _c.filter, pivotValueColumn = _c.pivotValueColumn, pivotKeys = _c.pivotKeys;
12627
12629
  var colDefs = gridQuery.api.columns.getAllColumns().map(function (column) { return column.getColDef(); });
12628
12630
  this.colField = getColField(this.colDef);
12629
12631
  var colDef = colDefs.find(function (colDef) { return colDef.field === _this.colField; });
12632
+ var filtersConfig = colDef.filtersConfig;
12630
12633
  this.pivotColumn = gridQuery.api.columns.getSecondaryPivotColumn(pivotKeys, pivotValueColumn);
12631
12634
  if (filtersConfig.sections) {
12632
12635
  this.filterSections = (_a = {}, _a[filtersConfig.sections] = true, _a);