@datorama/core 21.4.0-rc.14 → 21.4.0-rc.17
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 +17 -25
- 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 +6 -3
- package/esm2015/lib/grid-v2/grid-store/grid.service.js +4 -11
- package/esm5/lib/grid-v2/grid-filter/filter-validator.js +10 -8
- package/esm5/lib/grid-v2/grid-filter/grid-filter.component.js +6 -3
- package/esm5/lib/grid-v2/grid-store/grid.service.js +4 -17
- package/fesm2015/datorama-core.js +15 -19
- package/fesm2015/datorama-core.js.map +1 -1
- package/fesm5/datorama-core.js +17 -25
- package/fesm5/datorama-core.js.map +1 -1
- package/lib/grid-v2/grid-filter/filter-validator.d.ts +4 -3
- package/lib/grid-v2/grid-store/grid.service.d.ts +0 -1
- 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);
|
|
@@ -12823,15 +12825,18 @@
|
|
|
12823
12825
|
var _this = this;
|
|
12824
12826
|
var _b = this.popover.data, gridService = _b.gridService, gridQuery = _b.gridQuery;
|
|
12825
12827
|
var _c = this.colDef, filter = _c.filter, _d = _c.filtersConfig, filtersConfig = _d === void 0 ? {} : _d, pivotValueColumn = _c.pivotValueColumn, pivotKeys = _c.pivotKeys;
|
|
12828
|
+
var colDefs = gridQuery.api.columns.getAllColumns().map(function (column) { return column.getColDef(); });
|
|
12826
12829
|
this.colField = getColField(this.colDef);
|
|
12830
|
+
var colDef = colDefs.find(function (colDef) { return colDef.field === _this.colField; });
|
|
12831
|
+
var colFilter = filter || colDef.filter;
|
|
12832
|
+
var filterOptions = DatoGridFilterOptionsMap[colFilter];
|
|
12827
12833
|
this.pivotColumn = gridQuery.api.columns.getSecondaryPivotColumn(pivotKeys, pivotValueColumn);
|
|
12828
12834
|
if (filtersConfig.sections) {
|
|
12829
12835
|
this.filterSections = (_a = {}, _a[filtersConfig.sections] = true, _a);
|
|
12830
12836
|
}
|
|
12831
12837
|
this.keepPredefinedListOriginalOrder =
|
|
12832
12838
|
filtersConfig.keepPredefinedListOriginalOrder && !isEmpty(filtersConfig.predefinedListValues);
|
|
12833
|
-
|
|
12834
|
-
this.filterType = filterOptions ? filter : exports.DatoGridFilterTypes.String;
|
|
12839
|
+
this.filterType = filterOptions ? colFilter : exports.DatoGridFilterTypes.String;
|
|
12835
12840
|
this.listLabelType = this.filterType.toLowerCase();
|
|
12836
12841
|
this.listSortByKey = this.filterType === exports.DatoGridFilterTypes.Number && this.colDef.valueFormatter ? 'id' : 'label';
|
|
12837
12842
|
this.gridQuery = gridQuery;
|
|
@@ -14911,27 +14916,14 @@
|
|
|
14911
14916
|
/**
|
|
14912
14917
|
* When pivoting,
|
|
14913
14918
|
* we add the field name to the column header class in order to access it through the auto generated pivot column.
|
|
14914
|
-
* @private
|
|
14915
14919
|
*/
|
|
14916
14920
|
GridService.prototype.initPivotSecondaryColsProcess = function (_a) {
|
|
14917
14921
|
var _this = this;
|
|
14918
14922
|
var gridOptions = _a.gridOptions;
|
|
14919
14923
|
gridOptions.processSecondaryColDef = function (colDef) {
|
|
14920
|
-
var
|
|
14921
|
-
if (
|
|
14922
|
-
|
|
14923
|
-
var originalColDef = valueColumns
|
|
14924
|
-
.map(function (_a) {
|
|
14925
|
-
var userProvidedColDef = _a.userProvidedColDef;
|
|
14926
|
-
return userProvidedColDef;
|
|
14927
|
-
})
|
|
14928
|
-
.find(function (_a) {
|
|
14929
|
-
var colId = _a.colId;
|
|
14930
|
-
return colId === colDef.pivotValueColumn.getColId();
|
|
14931
|
-
});
|
|
14932
|
-
if (originalColDef) {
|
|
14933
|
-
colDef.filter = originalColDef.filter;
|
|
14934
|
-
}
|
|
14924
|
+
var userProvidedColDef = colDef.pivotValueColumn.getUserProvidedColDef();
|
|
14925
|
+
if (userProvidedColDef) {
|
|
14926
|
+
colDef.filter = userProvidedColDef.filter;
|
|
14935
14927
|
}
|
|
14936
14928
|
if (colDef.pivotKeys) {
|
|
14937
14929
|
colDef.pivotKeys = colDef.pivotKeys.map(function (key) {
|