@datorama/core 21.4.0-rc.13 → 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 +27 -32
- 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 +14 -10
- 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 +16 -10
- package/esm5/lib/grid-v2/grid-store/grid.service.js +4 -17
- package/fesm2015/datorama-core.js +23 -26
- package/fesm2015/datorama-core.js.map +1 -1
- package/fesm5/datorama-core.js +27 -32
- 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);
|
|
@@ -12679,12 +12681,12 @@
|
|
|
12679
12681
|
var ɵ0$1 = mapToValue;
|
|
12680
12682
|
var mapToListItem = function (val) { return ({ id: val, label: isNil(val) ? "(Empty)" : ("" + val).trim(), value: val }); };
|
|
12681
12683
|
var ɵ1$1 = mapToListItem;
|
|
12682
|
-
var mapToListItemWithFormatted = function (_a) {
|
|
12684
|
+
var mapToListItemWithFormatted = function (_a, key) {
|
|
12683
12685
|
var value = _a.value, formattedValue = _a.formattedValue;
|
|
12684
12686
|
return ({
|
|
12685
|
-
id: value,
|
|
12686
|
-
label: isNil(formattedValue) ? "(Empty)" : ("" + formattedValue).trim(),
|
|
12687
|
-
value: value
|
|
12687
|
+
id: key && value ? value[key] : value,
|
|
12688
|
+
label: isNil(formattedValue) ? "(Empty)" : ("" + (key ? formattedValue[key] : formattedValue)).trim(),
|
|
12689
|
+
value: key && value ? value[key] : value
|
|
12688
12690
|
});
|
|
12689
12691
|
};
|
|
12690
12692
|
var ɵ2$1 = mapToListItemWithFormatted;
|
|
@@ -12822,16 +12824,20 @@
|
|
|
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,
|
|
12827
|
+
var _c = this.colDef, filter = _c.filter, 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 filtersConfig = colDef.filtersConfig;
|
|
12827
12832
|
this.pivotColumn = gridQuery.api.columns.getSecondaryPivotColumn(pivotKeys, pivotValueColumn);
|
|
12828
12833
|
if (filtersConfig.sections) {
|
|
12829
12834
|
this.filterSections = (_a = {}, _a[filtersConfig.sections] = true, _a);
|
|
12830
12835
|
}
|
|
12831
12836
|
this.keepPredefinedListOriginalOrder =
|
|
12832
12837
|
filtersConfig.keepPredefinedListOriginalOrder && !isEmpty(filtersConfig.predefinedListValues);
|
|
12833
|
-
var
|
|
12834
|
-
|
|
12838
|
+
var colFilter = filter || colDef.filter;
|
|
12839
|
+
var filterOptions = DatoGridFilterOptionsMap[colFilter];
|
|
12840
|
+
this.filterType = filterOptions ? colFilter : exports.DatoGridFilterTypes.String;
|
|
12835
12841
|
this.listLabelType = this.filterType.toLowerCase();
|
|
12836
12842
|
this.listSortByKey = this.filterType === exports.DatoGridFilterTypes.Number && this.colDef.valueFormatter ? 'id' : 'label';
|
|
12837
12843
|
this.gridQuery = gridQuery;
|
|
@@ -12866,9 +12872,11 @@
|
|
|
12866
12872
|
var columnValues = this.getColumnValues();
|
|
12867
12873
|
this.columnValues = columnValues.map(function (_a) {
|
|
12868
12874
|
var value = _a.value;
|
|
12869
|
-
return _this.pivotColumn && value ? value[_this.colField] : value;
|
|
12875
|
+
return !isNil(_this.pivotColumn) && value ? value[_this.colField] : value;
|
|
12876
|
+
});
|
|
12877
|
+
this.listOptions = columnValues.map(function (colValue) {
|
|
12878
|
+
return mapToListItemWithFormatted(colValue, !isNil(_this.pivotColumn) && _this.colField);
|
|
12870
12879
|
});
|
|
12871
|
-
this.listOptions = columnValues.map(mapToListItemWithFormatted);
|
|
12872
12880
|
}
|
|
12873
12881
|
}
|
|
12874
12882
|
else {
|
|
@@ -14909,27 +14917,14 @@
|
|
|
14909
14917
|
/**
|
|
14910
14918
|
* When pivoting,
|
|
14911
14919
|
* we add the field name to the column header class in order to access it through the auto generated pivot column.
|
|
14912
|
-
* @private
|
|
14913
14920
|
*/
|
|
14914
14921
|
GridService.prototype.initPivotSecondaryColsProcess = function (_a) {
|
|
14915
14922
|
var _this = this;
|
|
14916
14923
|
var gridOptions = _a.gridOptions;
|
|
14917
14924
|
gridOptions.processSecondaryColDef = function (colDef) {
|
|
14918
|
-
var
|
|
14919
|
-
if (
|
|
14920
|
-
|
|
14921
|
-
var originalColDef = valueColumns
|
|
14922
|
-
.map(function (_a) {
|
|
14923
|
-
var userProvidedColDef = _a.userProvidedColDef;
|
|
14924
|
-
return userProvidedColDef;
|
|
14925
|
-
})
|
|
14926
|
-
.find(function (_a) {
|
|
14927
|
-
var colId = _a.colId;
|
|
14928
|
-
return colId === colDef.pivotValueColumn.getColId();
|
|
14929
|
-
});
|
|
14930
|
-
if (originalColDef) {
|
|
14931
|
-
colDef.filter = originalColDef.filter;
|
|
14932
|
-
}
|
|
14925
|
+
var userProvidedColDef = colDef.pivotValueColumn.getUserProvidedColDef();
|
|
14926
|
+
if (userProvidedColDef) {
|
|
14927
|
+
colDef.filter = userProvidedColDef.filter;
|
|
14933
14928
|
}
|
|
14934
14929
|
if (colDef.pivotKeys) {
|
|
14935
14930
|
colDef.pivotKeys = colDef.pivotKeys.map(function (key) {
|