@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.
@@ -11802,9 +11802,9 @@
11802
11802
  return !isEmpty(valueLowerCase);
11803
11803
  }
11804
11804
  }
11805
- function validateNumberCondition(unparsedRowValue, _a) {
11805
+ function validateNumberCondition(unparsedRowValue, _a, filterKey) {
11806
11806
  var condition = _a.condition, value = _a.value, rangeEnd = _a.rangeEnd;
11807
- var rowValue = !!unparsedRowValue ? parseFloat(unparsedRowValue) : null;
11807
+ var rowValue = !!unparsedRowValue ? parseFloat(unparsedRowValue[filterKey] || unparsedRowValue) : null;
11808
11808
  var filterValue = parseFloat(value);
11809
11809
  switch (condition) {
11810
11810
  case exports.DatoFilterConditions.EQUALS:
@@ -11852,14 +11852,14 @@
11852
11852
  }
11853
11853
  }
11854
11854
  function validateCondition(_a) {
11855
- var rowValue = _a.rowValue, filter = _a.filter, type = _a.type;
11855
+ var rowValue = _a.rowValue, condition = _a.condition, type = _a.type, filterKey = _a.filterKey;
11856
11856
  switch (type) {
11857
11857
  case exports.DatoGridFilterTypes.Date:
11858
- return validateDateCondition(rowValue, filter);
11858
+ return validateDateCondition(rowValue, condition);
11859
11859
  case exports.DatoGridFilterTypes.Number:
11860
- return validateNumberCondition(rowValue, filter);
11860
+ return validateNumberCondition(rowValue, condition, filterKey);
11861
11861
  default:
11862
- return validateStringCondition(rowValue, filter);
11862
+ return validateStringCondition(rowValue, condition);
11863
11863
  }
11864
11864
  }
11865
11865
  function validateFilter(_a, activeFilters) {
@@ -11879,7 +11879,9 @@
11879
11879
  if (conditional) {
11880
11880
  var operator = conditional.operator, conditions = conditional.conditions, type_1 = conditional.type;
11881
11881
  var conditionsRelation = operator === exports.OperatorTypes.AND ? 'every' : 'some';
11882
- filterPasses = conditions[conditionsRelation](function (filter) { return validateCondition({ rowValue: rowValue, filter: filter, type: type_1 }); });
11882
+ filterPasses = conditions[conditionsRelation](function (condition) {
11883
+ return validateCondition({ rowValue: rowValue, condition: condition, type: type_1, filterKey: filter });
11884
+ });
11883
11885
  }
11884
11886
  if (filterPasses && byValue) {
11885
11887
  var includesValue = byValue.values.includes(rowValue);
@@ -12822,10 +12824,11 @@
12822
12824
  var _a;
12823
12825
  var _this = this;
12824
12826
  var _b = this.popover.data, gridService = _b.gridService, gridQuery = _b.gridQuery;
12825
- var _c = this.colDef, filter = _c.filter, _d = _c.filtersConfig, filtersConfig = _d === void 0 ? {} : _d, pivotValueColumn = _c.pivotValueColumn, pivotKeys = _c.pivotKeys;
12827
+ var _c = this.colDef, filter = _c.filter, pivotValueColumn = _c.pivotValueColumn, pivotKeys = _c.pivotKeys;
12826
12828
  var colDefs = gridQuery.api.columns.getAllColumns().map(function (column) { return column.getColDef(); });
12827
12829
  this.colField = getColField(this.colDef);
12828
12830
  var colDef = colDefs.find(function (colDef) { return colDef.field === _this.colField; });
12831
+ var filtersConfig = colDef.filtersConfig;
12829
12832
  this.pivotColumn = gridQuery.api.columns.getSecondaryPivotColumn(pivotKeys, pivotValueColumn);
12830
12833
  if (filtersConfig.sections) {
12831
12834
  this.filterSections = (_a = {}, _a[filtersConfig.sections] = true, _a);