@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
package/fesm5/datorama-core.js
CHANGED
|
@@ -12480,12 +12480,12 @@ var mapToValue = function (_a) {
|
|
|
12480
12480
|
var ɵ0$1 = mapToValue;
|
|
12481
12481
|
var mapToListItem = function (val) { return ({ id: val, label: isNil(val) ? "(Empty)" : ("" + val).trim(), value: val }); };
|
|
12482
12482
|
var ɵ1$1 = mapToListItem;
|
|
12483
|
-
var mapToListItemWithFormatted = function (_a) {
|
|
12483
|
+
var mapToListItemWithFormatted = function (_a, key) {
|
|
12484
12484
|
var value = _a.value, formattedValue = _a.formattedValue;
|
|
12485
12485
|
return ({
|
|
12486
|
-
id: value,
|
|
12487
|
-
label: isNil(formattedValue) ? "(Empty)" : ("" + formattedValue).trim(),
|
|
12488
|
-
value: value
|
|
12486
|
+
id: key && value ? value[key] : value,
|
|
12487
|
+
label: isNil(formattedValue) ? "(Empty)" : ("" + (key ? formattedValue[key] : formattedValue)).trim(),
|
|
12488
|
+
value: key && value ? value[key] : value
|
|
12489
12489
|
});
|
|
12490
12490
|
};
|
|
12491
12491
|
var ɵ2$1 = mapToListItemWithFormatted;
|
|
@@ -12624,15 +12624,18 @@ var DatoGridFilterComponent = /** @class */ (function () {
|
|
|
12624
12624
|
var _this = this;
|
|
12625
12625
|
var _b = this.popover.data, gridService = _b.gridService, gridQuery = _b.gridQuery;
|
|
12626
12626
|
var _c = this.colDef, filter = _c.filter, _d = _c.filtersConfig, filtersConfig = _d === void 0 ? {} : _d, pivotValueColumn = _c.pivotValueColumn, pivotKeys = _c.pivotKeys;
|
|
12627
|
+
var colDefs = gridQuery.api.columns.getAllColumns().map(function (column) { return column.getColDef(); });
|
|
12627
12628
|
this.colField = getColField(this.colDef);
|
|
12629
|
+
var colDef = colDefs.find(function (colDef) { return colDef.field === _this.colField; });
|
|
12628
12630
|
this.pivotColumn = gridQuery.api.columns.getSecondaryPivotColumn(pivotKeys, pivotValueColumn);
|
|
12629
12631
|
if (filtersConfig.sections) {
|
|
12630
12632
|
this.filterSections = (_a = {}, _a[filtersConfig.sections] = true, _a);
|
|
12631
12633
|
}
|
|
12632
12634
|
this.keepPredefinedListOriginalOrder =
|
|
12633
12635
|
filtersConfig.keepPredefinedListOriginalOrder && !isEmpty(filtersConfig.predefinedListValues);
|
|
12634
|
-
var
|
|
12635
|
-
|
|
12636
|
+
var colFilter = filter || colDef.filter;
|
|
12637
|
+
var filterOptions = DatoGridFilterOptionsMap[colFilter];
|
|
12638
|
+
this.filterType = filterOptions ? colFilter : DatoGridFilterTypes.String;
|
|
12636
12639
|
this.listLabelType = this.filterType.toLowerCase();
|
|
12637
12640
|
this.listSortByKey = this.filterType === DatoGridFilterTypes.Number && this.colDef.valueFormatter ? 'id' : 'label';
|
|
12638
12641
|
this.gridQuery = gridQuery;
|
|
@@ -12667,9 +12670,11 @@ var DatoGridFilterComponent = /** @class */ (function () {
|
|
|
12667
12670
|
var columnValues = this.getColumnValues();
|
|
12668
12671
|
this.columnValues = columnValues.map(function (_a) {
|
|
12669
12672
|
var value = _a.value;
|
|
12670
|
-
return _this.pivotColumn ? value[_this.colField] : value;
|
|
12673
|
+
return !isNil(_this.pivotColumn) && value ? value[_this.colField] : value;
|
|
12674
|
+
});
|
|
12675
|
+
this.listOptions = columnValues.map(function (colValue) {
|
|
12676
|
+
return mapToListItemWithFormatted(colValue, !isNil(_this.pivotColumn) && _this.colField);
|
|
12671
12677
|
});
|
|
12672
|
-
this.listOptions = columnValues.map(mapToListItemWithFormatted);
|
|
12673
12678
|
}
|
|
12674
12679
|
}
|
|
12675
12680
|
else {
|
|
@@ -14710,27 +14715,14 @@ var GridService = /** @class */ (function () {
|
|
|
14710
14715
|
/**
|
|
14711
14716
|
* When pivoting,
|
|
14712
14717
|
* we add the field name to the column header class in order to access it through the auto generated pivot column.
|
|
14713
|
-
* @private
|
|
14714
14718
|
*/
|
|
14715
14719
|
GridService.prototype.initPivotSecondaryColsProcess = function (_a) {
|
|
14716
14720
|
var _this = this;
|
|
14717
14721
|
var gridOptions = _a.gridOptions;
|
|
14718
14722
|
gridOptions.processSecondaryColDef = function (colDef) {
|
|
14719
|
-
var
|
|
14720
|
-
if (
|
|
14721
|
-
|
|
14722
|
-
var originalColDef = valueColumns
|
|
14723
|
-
.map(function (_a) {
|
|
14724
|
-
var userProvidedColDef = _a.userProvidedColDef;
|
|
14725
|
-
return userProvidedColDef;
|
|
14726
|
-
})
|
|
14727
|
-
.find(function (_a) {
|
|
14728
|
-
var colId = _a.colId;
|
|
14729
|
-
return colId === colDef.pivotValueColumn.getColId();
|
|
14730
|
-
});
|
|
14731
|
-
if (originalColDef) {
|
|
14732
|
-
colDef.filter = originalColDef.filter;
|
|
14733
|
-
}
|
|
14723
|
+
var userProvidedColDef = colDef.pivotValueColumn.getUserProvidedColDef();
|
|
14724
|
+
if (userProvidedColDef) {
|
|
14725
|
+
colDef.filter = userProvidedColDef.filter;
|
|
14734
14726
|
}
|
|
14735
14727
|
if (colDef.pivotKeys) {
|
|
14736
14728
|
colDef.pivotKeys = colDef.pivotKeys.map(function (key) {
|