@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.
- package/bundles/datorama-core.umd.js +11 -8
- package/bundles/datorama-core.umd.js.map +1 -1
- package/bundles/datorama-core.umd.min.js +2 -2
- package/bundles/datorama-core.umd.min.js.map +1 -1
- package/esm2015/lib/grid-v2/grid-filter/filter-validator.js +8 -8
- package/esm2015/lib/grid-v2/grid-filter/grid-filter.component.js +3 -2
- package/esm5/lib/grid-v2/grid-filter/filter-validator.js +10 -8
- package/esm5/lib/grid-v2/grid-filter/grid-filter.component.js +3 -2
- package/fesm2015/datorama-core.js +9 -8
- package/fesm2015/datorama-core.js.map +1 -1
- package/fesm5/datorama-core.js +11 -8
- package/fesm5/datorama-core.js.map +1 -1
- package/lib/grid-v2/grid-filter/filter-validator.d.ts +4 -3
- package/package.json +1 -1
package/fesm5/datorama-core.js
CHANGED
|
@@ -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,
|
|
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,
|
|
11659
|
+
return validateDateCondition(rowValue, condition);
|
|
11660
11660
|
case DatoGridFilterTypes.Number:
|
|
11661
|
-
return validateNumberCondition(rowValue,
|
|
11661
|
+
return validateNumberCondition(rowValue, condition, filterKey);
|
|
11662
11662
|
default:
|
|
11663
|
-
return validateStringCondition(rowValue,
|
|
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 (
|
|
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,
|
|
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);
|