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