@datorama/core 21.4.0-rc.15 → 21.4.0-rc.18
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 +12 -10
- 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 -3
- package/esm2015/lib/grid-v2/grid-store/grid.service.js +2 -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 -3
- package/esm5/lib/grid-v2/grid-store/grid.service.js +2 -2
- package/fesm2015/datorama-core.js +10 -10
- package/fesm2015/datorama-core.js.map +1 -1
- package/fesm5/datorama-core.js +12 -10
- 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
|
@@ -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,
|
|
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,
|
|
11858
|
+
return validateDateCondition(rowValue, condition);
|
|
11859
11859
|
case exports.DatoGridFilterTypes.Number:
|
|
11860
|
-
return validateNumberCondition(rowValue,
|
|
11860
|
+
return validateNumberCondition(rowValue, condition, filterKey);
|
|
11861
11861
|
default:
|
|
11862
|
-
return validateStringCondition(rowValue,
|
|
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 (
|
|
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);
|
|
@@ -12826,14 +12828,14 @@
|
|
|
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 colFilter = filter || colDef.filter;
|
|
12832
|
+
var filterOptions = DatoGridFilterOptionsMap[colFilter];
|
|
12829
12833
|
this.pivotColumn = gridQuery.api.columns.getSecondaryPivotColumn(pivotKeys, pivotValueColumn);
|
|
12830
12834
|
if (filtersConfig.sections) {
|
|
12831
12835
|
this.filterSections = (_a = {}, _a[filtersConfig.sections] = true, _a);
|
|
12832
12836
|
}
|
|
12833
12837
|
this.keepPredefinedListOriginalOrder =
|
|
12834
12838
|
filtersConfig.keepPredefinedListOriginalOrder && !isEmpty(filtersConfig.predefinedListValues);
|
|
12835
|
-
var colFilter = filter || colDef.filter;
|
|
12836
|
-
var filterOptions = DatoGridFilterOptionsMap[colFilter];
|
|
12837
12839
|
this.filterType = filterOptions ? colFilter : exports.DatoGridFilterTypes.String;
|
|
12838
12840
|
this.listLabelType = this.filterType.toLowerCase();
|
|
12839
12841
|
this.listSortByKey = this.filterType === exports.DatoGridFilterTypes.Number && this.colDef.valueFormatter ? 'id' : 'label';
|
|
@@ -14919,7 +14921,7 @@
|
|
|
14919
14921
|
var _this = this;
|
|
14920
14922
|
var gridOptions = _a.gridOptions;
|
|
14921
14923
|
gridOptions.processSecondaryColDef = function (colDef) {
|
|
14922
|
-
var userProvidedColDef = colDef.pivotValueColumn.getUserProvidedColDef();
|
|
14924
|
+
var userProvidedColDef = colDef.pivotValueColumn && colDef.pivotValueColumn.getUserProvidedColDef();
|
|
14923
14925
|
if (userProvidedColDef) {
|
|
14924
14926
|
colDef.filter = userProvidedColDef.filter;
|
|
14925
14927
|
}
|