@datorama/core 21.4.0-rc.1 → 21.4.0-rc.12
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/bundle.scss +12 -1
- package/bundles/datorama-core.umd.js +137 -44
- package/bundles/datorama-core.umd.js.map +1 -1
- package/bundles/datorama-core.umd.min.js +49 -49
- package/bundles/datorama-core.umd.min.js.map +1 -1
- package/datorama-core.metadata.json +1 -1
- package/esm2015/lib/grid-v2/grid-controller/grid-controller.component.js +5 -2
- package/esm2015/lib/grid-v2/grid-filter/filter-validator.js +7 -14
- package/esm2015/lib/grid-v2/grid-filter/grid-filter.component.js +14 -5
- package/esm2015/lib/grid-v2/grid-filter/grid-filter.types.js +1 -1
- package/esm2015/lib/grid-v2/grid-store/grid.query.js +34 -9
- package/esm2015/lib/grid-v2/grid-store/grid.service.js +53 -11
- package/esm2015/lib/grid-v2/grid-store/grid.store.types.js +1 -1
- package/esm2015/lib/grid-v2/grid-store/public_api.js +2 -0
- package/esm2015/lib/grid-v2/grid-store/util.js +11 -1
- package/esm2015/lib/grid-v2/public_api.js +2 -2
- package/esm5/lib/grid-v2/grid-controller/grid-controller.component.js +5 -2
- package/esm5/lib/grid-v2/grid-filter/filter-validator.js +7 -14
- package/esm5/lib/grid-v2/grid-filter/grid-filter.component.js +13 -5
- package/esm5/lib/grid-v2/grid-filter/grid-filter.types.js +1 -1
- package/esm5/lib/grid-v2/grid-store/grid.query.js +34 -9
- package/esm5/lib/grid-v2/grid-store/grid.service.js +75 -20
- package/esm5/lib/grid-v2/grid-store/grid.store.types.js +1 -1
- package/esm5/lib/grid-v2/grid-store/public_api.js +2 -0
- package/esm5/lib/grid-v2/grid-store/util.js +11 -1
- package/esm5/lib/grid-v2/public_api.js +2 -2
- package/fesm2015/datorama-core.js +116 -36
- package/fesm2015/datorama-core.js.map +1 -1
- package/fesm5/datorama-core.js +137 -45
- package/fesm5/datorama-core.js.map +1 -1
- package/i18n/locale-en_US.json +2 -1
- package/lib/grid-v2/grid-controller/grid-controller.component.d.ts +3 -2
- package/lib/grid-v2/grid-filter/grid-filter.types.d.ts +7 -1
- package/lib/grid-v2/grid-store/grid.query.d.ts +3 -1
- package/lib/grid-v2/grid-store/grid.service.d.ts +4 -2
- package/lib/grid-v2/grid-store/grid.store.types.d.ts +4 -0
- package/lib/grid-v2/grid-store/public_api.d.ts +2 -0
- package/lib/grid-v2/grid-store/util.d.ts +2 -0
- package/lib/grid-v2/public_api.d.ts +1 -2
- package/package.json +1 -1
package/bundle.scss
CHANGED
|
@@ -14362,6 +14362,10 @@ dato-grid-v2 ag-grid-angular.pivot-mode .ag-cell {
|
|
|
14362
14362
|
color: themify(primary-500);
|
|
14363
14363
|
}
|
|
14364
14364
|
|
|
14365
|
+
dato-grid-v2 ag-grid-angular.pivot-mode .ag-header-row .ag-header-cell {
|
|
14366
|
+
border: none;
|
|
14367
|
+
}
|
|
14368
|
+
|
|
14365
14369
|
dato-grid-v2 ag-grid-angular.pivot-mode .ag-header-row .ag-header-cell dato-grid-column-header {
|
|
14366
14370
|
display: block;
|
|
14367
14371
|
height: 100%;
|
|
@@ -14382,7 +14386,6 @@ dato-grid-v2 ag-grid-angular.pivot-mode .ag-header-row .ag-header-group-cell .ag
|
|
|
14382
14386
|
|
|
14383
14387
|
dato-grid-v2 ag-grid-angular.pivot-mode .ag-header-row .ag-header-group-cell .ag-header-group-cell-label {
|
|
14384
14388
|
align-items: center;
|
|
14385
|
-
justify-content: center;
|
|
14386
14389
|
}
|
|
14387
14390
|
|
|
14388
14391
|
dato-grid-v2 ag-grid-angular.pivot-mode .ag-header-row .ag-header-group-cell .ag-header-group-cell-label span {
|
|
@@ -14398,6 +14401,14 @@ dato-grid-v2 ag-grid-angular.pivot-mode .ag-header-row .ag-header-group-cell.ag-
|
|
|
14398
14401
|
border-right: 1px solid themify(primary-200);
|
|
14399
14402
|
}
|
|
14400
14403
|
|
|
14404
|
+
dato-grid-v2 ag-grid-angular.pivot-mode .ag-header-row .ag-header-group-cell.ag-header-group-cell-with-group.empty-pivot-header {
|
|
14405
|
+
display: none;
|
|
14406
|
+
}
|
|
14407
|
+
|
|
14408
|
+
dato-grid-v2 ag-grid-angular.pivot-mode .ag-header-row .ag-header-group-cell.ag-header-group-cell-with-group.group-pivot-cell .ag-header-group-cell-label {
|
|
14409
|
+
justify-content: center;
|
|
14410
|
+
}
|
|
14411
|
+
|
|
14401
14412
|
.ag-dnd-ghost {
|
|
14402
14413
|
box-shadow: 0 0 10px -1px themify(primary-700, 0.3);
|
|
14403
14414
|
background-color: themify(primary-100) !important;
|
|
@@ -11466,6 +11466,16 @@
|
|
|
11466
11466
|
var field = colDef.field, showRowGroup = colDef.showRowGroup, pivotValueColumn = colDef.pivotValueColumn;
|
|
11467
11467
|
return pivotValueColumn ? pivotValueColumn.getColId() : field || showRowGroup;
|
|
11468
11468
|
}
|
|
11469
|
+
function tryParsePivotValue(str) {
|
|
11470
|
+
var value;
|
|
11471
|
+
try {
|
|
11472
|
+
value = JSON.parse(str);
|
|
11473
|
+
}
|
|
11474
|
+
catch (e) {
|
|
11475
|
+
// Do nothing
|
|
11476
|
+
}
|
|
11477
|
+
return value;
|
|
11478
|
+
}
|
|
11469
11479
|
|
|
11470
11480
|
var GridQuery = /** @class */ (function (_super) {
|
|
11471
11481
|
__extends(GridQuery, _super);
|
|
@@ -11565,14 +11575,23 @@
|
|
|
11565
11575
|
return settings;
|
|
11566
11576
|
};
|
|
11567
11577
|
GridQuery.prototype.getSort = function () {
|
|
11568
|
-
|
|
11569
|
-
|
|
11570
|
-
|
|
11571
|
-
|
|
11572
|
-
|
|
11573
|
-
|
|
11574
|
-
|
|
11575
|
-
|
|
11578
|
+
if (this.gridRef.gridOptions.pivotMode) {
|
|
11579
|
+
var _a = this.api.grid.getSortModel().pop() || {}, sort = _a.sort, colId = _a.colId;
|
|
11580
|
+
var column = this.api.columns.getColumn(colId);
|
|
11581
|
+
var pivotedColumn = this.getSecondaryColumn(colId);
|
|
11582
|
+
if (pivotedColumn) {
|
|
11583
|
+
var uniquePivotParents = uniq(this.api.columns.getSecondaryColumns().map(function (column) { return column.getParent(); }));
|
|
11584
|
+
var secondaryColumn = this.getSecondaryColumn(pivotedColumn.getColId());
|
|
11585
|
+
var pivotColIndex = uniquePivotParents.indexOf(secondaryColumn.getParent());
|
|
11586
|
+
return { colId: getColField(pivotedColumn.getColDef()), sort: sort, pivotColIndex: pivotColIndex };
|
|
11587
|
+
}
|
|
11588
|
+
else if (column) {
|
|
11589
|
+
return { colId: getColField(column.getColDef()), sort: sort };
|
|
11590
|
+
}
|
|
11591
|
+
}
|
|
11592
|
+
else {
|
|
11593
|
+
return this.api.grid.getSortModel().pop();
|
|
11594
|
+
}
|
|
11576
11595
|
};
|
|
11577
11596
|
GridQuery.prototype.selectSort = function () {
|
|
11578
11597
|
return this.select(function (state) { return state.settings.sort; });
|
|
@@ -11596,6 +11615,17 @@
|
|
|
11596
11615
|
GridQuery.prototype.selectFilter = function () {
|
|
11597
11616
|
return this.select(function (state) { return state.settings.filter; });
|
|
11598
11617
|
};
|
|
11618
|
+
GridQuery.prototype.filterChanged = function () {
|
|
11619
|
+
return this.selectFilter().pipe(operators.map(function (filter) {
|
|
11620
|
+
return Object.keys(filter).reduce(function (filters, field) {
|
|
11621
|
+
var datoFilter = filter[field];
|
|
11622
|
+
if (datoFilter) {
|
|
11623
|
+
filters.push({ field: field, filter: datoFilter });
|
|
11624
|
+
}
|
|
11625
|
+
return filters;
|
|
11626
|
+
}, []);
|
|
11627
|
+
}));
|
|
11628
|
+
};
|
|
11599
11629
|
GridQuery.prototype.getSearchTerm = function () {
|
|
11600
11630
|
return this.getValue().settings.searchTerm;
|
|
11601
11631
|
};
|
|
@@ -11656,6 +11686,10 @@
|
|
|
11656
11686
|
GridQuery.prototype.selectIsSelectAllRowsEnabled = function () {
|
|
11657
11687
|
return this.select(function (state) { return state.serverSidePagination.selectAllRowsEnabled; });
|
|
11658
11688
|
};
|
|
11689
|
+
GridQuery.prototype.getSecondaryColumn = function (colId) {
|
|
11690
|
+
var secondaryColumns = this.api.columns.getSecondaryColumns();
|
|
11691
|
+
return secondaryColumns && secondaryColumns.find(function (col) { return col.getColId() === colId; });
|
|
11692
|
+
};
|
|
11659
11693
|
GridQuery.prototype.filterCheckboxSelectionColumn = function (columns) {
|
|
11660
11694
|
return columns.filter(function (column) { return !column.getUserProvidedColDef() || !column.getUserProvidedColDef().checkboxSelection; });
|
|
11661
11695
|
};
|
|
@@ -11748,7 +11782,7 @@
|
|
|
11748
11782
|
function validateStringCondition(rowValue, _a) {
|
|
11749
11783
|
var condition = _a.condition, filterValue = _a.value;
|
|
11750
11784
|
var filterTextLowerCase = filterValue ? filterValue.toLowerCase() : '';
|
|
11751
|
-
var valueLowerCase = rowValue ? rowValue.toLowerCase() : '';
|
|
11785
|
+
var valueLowerCase = rowValue ? ("" + rowValue).toLowerCase() : '';
|
|
11752
11786
|
switch (condition) {
|
|
11753
11787
|
case exports.DatoFilterConditions.EQUALS:
|
|
11754
11788
|
return valueLowerCase === filterTextLowerCase;
|
|
@@ -11839,7 +11873,7 @@
|
|
|
11839
11873
|
var currentRowPivotKeys = row.parent.childrenMapped && getRowPivotKeys(row.parent.childrenMapped);
|
|
11840
11874
|
var rowValue = api.getValue(filter, row);
|
|
11841
11875
|
/** If value is under a pivoted column but doesn't match the filter pivot */
|
|
11842
|
-
if (pivotKeys && !isArrayValuesEqual(pivotKeys, currentRowPivotKeys)) {
|
|
11876
|
+
if (pivotKeys && pivotKeys.length > 0 && !isArrayValuesEqual(pivotKeys, currentRowPivotKeys)) {
|
|
11843
11877
|
return { value: true };
|
|
11844
11878
|
}
|
|
11845
11879
|
if (conditional) {
|
|
@@ -11879,17 +11913,9 @@
|
|
|
11879
11913
|
function getRowPivotKeys(childrenMapped, keys) {
|
|
11880
11914
|
if (keys === void 0) { keys = []; }
|
|
11881
11915
|
var key = Object.keys(childrenMapped)[0];
|
|
11882
|
-
var parsedKey;
|
|
11883
|
-
|
|
11884
|
-
|
|
11885
|
-
}
|
|
11886
|
-
catch (e) {
|
|
11887
|
-
console.error("Can't parse " + key + " from JSON");
|
|
11888
|
-
}
|
|
11889
|
-
finally {
|
|
11890
|
-
if (parsedKey) {
|
|
11891
|
-
keys = getRowPivotKeys(childrenMapped[key], __spread(keys, [parsedKey.value]));
|
|
11892
|
-
}
|
|
11916
|
+
var parsedKey = tryParsePivotValue(key);
|
|
11917
|
+
if (parsedKey) {
|
|
11918
|
+
keys = getRowPivotKeys(childrenMapped[key], __spread(keys, [parsedKey.value]));
|
|
11893
11919
|
}
|
|
11894
11920
|
return keys;
|
|
11895
11921
|
}
|
|
@@ -12840,7 +12866,7 @@
|
|
|
12840
12866
|
var columnValues = this.getColumnValues();
|
|
12841
12867
|
this.columnValues = columnValues.map(function (_a) {
|
|
12842
12868
|
var value = _a.value;
|
|
12843
|
-
return value;
|
|
12869
|
+
return _this.pivotColumn ? value[_this.colField] : value;
|
|
12844
12870
|
});
|
|
12845
12871
|
this.listOptions = columnValues.map(mapToListItemWithFormatted);
|
|
12846
12872
|
}
|
|
@@ -12880,6 +12906,7 @@
|
|
|
12880
12906
|
isEmpty(filter)
|
|
12881
12907
|
? this.gridService.clearColumnFilter(this.colField)
|
|
12882
12908
|
: this.gridService.setColumnFilter(column, filter);
|
|
12909
|
+
this.gridService.notifyFilterUpdate();
|
|
12883
12910
|
}
|
|
12884
12911
|
};
|
|
12885
12912
|
DatoGridFilterComponent.prototype.clearFilters = function () {
|
|
@@ -12930,11 +12957,17 @@
|
|
|
12930
12957
|
return this.columnValues.filter(function (value) { return !includedSet.has(value); });
|
|
12931
12958
|
};
|
|
12932
12959
|
DatoGridFilterComponent.prototype.buildFilter = function () {
|
|
12960
|
+
var _this = this;
|
|
12933
12961
|
var _a = this.filterForm.value, byValue = _a.byValue, conditional = _a.conditional;
|
|
12934
|
-
var filter = {};
|
|
12962
|
+
var filter = { colId: this.colDef.colId };
|
|
12935
12963
|
filter.pivotKeys = this.pivotKeys;
|
|
12936
12964
|
if (this.pivotColumn) {
|
|
12937
|
-
filter.
|
|
12965
|
+
filter.pivotFieldsMap = this.getPivotFields(this.pivotColumn.getParent()).reduce(function (fieldMap, field, index) {
|
|
12966
|
+
if (_this.pivotKeys[index]) {
|
|
12967
|
+
fieldMap[field] = _this.pivotKeys[index];
|
|
12968
|
+
}
|
|
12969
|
+
return fieldMap;
|
|
12970
|
+
}, {});
|
|
12938
12971
|
}
|
|
12939
12972
|
if (this.filterSections.Conditional) {
|
|
12940
12973
|
this.setConditionalFilter(filter, conditional);
|
|
@@ -13270,10 +13303,11 @@
|
|
|
13270
13303
|
DatoGridFilterComponent.prototype.getPivotFields = function (parent, fields) {
|
|
13271
13304
|
if (fields === void 0) { fields = []; }
|
|
13272
13305
|
var grandParent = parent.getParent();
|
|
13306
|
+
var headerClass = parent.getOriginalColumnGroup().getColGroupDef().headerClass;
|
|
13273
13307
|
if (grandParent) {
|
|
13274
13308
|
this.getPivotFields(grandParent, fields);
|
|
13275
13309
|
}
|
|
13276
|
-
fields.push(
|
|
13310
|
+
headerClass && fields.push(headerClass[0]);
|
|
13277
13311
|
return fields;
|
|
13278
13312
|
};
|
|
13279
13313
|
DatoGridFilterComponent.ctorParameters = function () { return [
|
|
@@ -14322,12 +14356,43 @@
|
|
|
14322
14356
|
});
|
|
14323
14357
|
this.notifyFilterUpdate();
|
|
14324
14358
|
};
|
|
14325
|
-
GridService.prototype.setColumnFilter = function (column, filter) {
|
|
14359
|
+
GridService.prototype.setColumnFilter = function (column, filter, notifyGrid) {
|
|
14360
|
+
if (notifyGrid === void 0) { notifyGrid = true; }
|
|
14326
14361
|
this._logEvent("Grids - Filter Applied" /* GRID_FILTER_APPLIED */, {
|
|
14327
14362
|
column: column.getColId(),
|
|
14328
14363
|
numOfConditions: (filter.conditional && filter.conditional.conditions.length) || 0,
|
|
14329
14364
|
byValue: !!filter.byValue ? 'Yes' : 'No'
|
|
14330
14365
|
});
|
|
14366
|
+
this.updateFilter(column, filter);
|
|
14367
|
+
if (notifyGrid) {
|
|
14368
|
+
this.notifyFilterUpdate();
|
|
14369
|
+
}
|
|
14370
|
+
};
|
|
14371
|
+
GridService.prototype.setGridFilters = function (filters) {
|
|
14372
|
+
var e_2, _a;
|
|
14373
|
+
try {
|
|
14374
|
+
for (var filters_1 = __values(filters), filters_1_1 = filters_1.next(); !filters_1_1.done; filters_1_1 = filters_1.next()) {
|
|
14375
|
+
var filter = filters_1_1.value.filter;
|
|
14376
|
+
var column = this.api.columns.getColumn(filter.colId);
|
|
14377
|
+
if (column) {
|
|
14378
|
+
this.setColumnFilter(column, filter);
|
|
14379
|
+
}
|
|
14380
|
+
else {
|
|
14381
|
+
var pivotColumn = this.gridQuery.getSecondaryColumn(filter.colId);
|
|
14382
|
+
this.setColumnFilter(pivotColumn, filter);
|
|
14383
|
+
}
|
|
14384
|
+
}
|
|
14385
|
+
}
|
|
14386
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
14387
|
+
finally {
|
|
14388
|
+
try {
|
|
14389
|
+
if (filters_1_1 && !filters_1_1.done && (_a = filters_1.return)) _a.call(filters_1);
|
|
14390
|
+
}
|
|
14391
|
+
finally { if (e_2) throw e_2.error; }
|
|
14392
|
+
}
|
|
14393
|
+
this.notifyFilterUpdate();
|
|
14394
|
+
};
|
|
14395
|
+
GridService.prototype.updateFilter = function (column, filter) {
|
|
14331
14396
|
var colField = getColField(column.getColDef());
|
|
14332
14397
|
this.store.update(function (state) {
|
|
14333
14398
|
var _a;
|
|
@@ -14335,7 +14400,6 @@
|
|
|
14335
14400
|
settings: __assign(__assign({}, state.settings), { filter: __assign(__assign({}, state.settings.filter), (_a = {}, _a[colField] = filter, _a)) })
|
|
14336
14401
|
};
|
|
14337
14402
|
});
|
|
14338
|
-
this.notifyFilterUpdate();
|
|
14339
14403
|
};
|
|
14340
14404
|
GridService.prototype.setSearchTerm = function (searchTerm) {
|
|
14341
14405
|
this.store.update(function (state) {
|
|
@@ -14628,7 +14692,7 @@
|
|
|
14628
14692
|
this.api.grid.onFilterChanged();
|
|
14629
14693
|
};
|
|
14630
14694
|
GridService.prototype.buildServerRequestFilters = function (filter) {
|
|
14631
|
-
var
|
|
14695
|
+
var e_3, _a;
|
|
14632
14696
|
var columnsFilters = {};
|
|
14633
14697
|
try {
|
|
14634
14698
|
for (var _b = __values(Object.entries(filter)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
@@ -14664,12 +14728,12 @@
|
|
|
14664
14728
|
}
|
|
14665
14729
|
}
|
|
14666
14730
|
}
|
|
14667
|
-
catch (
|
|
14731
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
14668
14732
|
finally {
|
|
14669
14733
|
try {
|
|
14670
14734
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
14671
14735
|
}
|
|
14672
|
-
finally { if (
|
|
14736
|
+
finally { if (e_3) throw e_3.error; }
|
|
14673
14737
|
}
|
|
14674
14738
|
return columnsFilters;
|
|
14675
14739
|
};
|
|
@@ -14722,7 +14786,7 @@
|
|
|
14722
14786
|
return { operator: exports.OperatorTypes.AND, filters: [columnFilter, searchFilter] };
|
|
14723
14787
|
};
|
|
14724
14788
|
GridService.prototype.buildServerColumnFilters_v2_1 = function (filter) {
|
|
14725
|
-
var
|
|
14789
|
+
var e_4, _a;
|
|
14726
14790
|
var columnFilters = [];
|
|
14727
14791
|
try {
|
|
14728
14792
|
for (var _b = __values(Object.entries(filter)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
@@ -14747,12 +14811,12 @@
|
|
|
14747
14811
|
columnFilters.push(columnFilter);
|
|
14748
14812
|
}
|
|
14749
14813
|
}
|
|
14750
|
-
catch (
|
|
14814
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
14751
14815
|
finally {
|
|
14752
14816
|
try {
|
|
14753
14817
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
14754
14818
|
}
|
|
14755
|
-
finally { if (
|
|
14819
|
+
finally { if (e_4) throw e_4.error; }
|
|
14756
14820
|
}
|
|
14757
14821
|
return columnFilters;
|
|
14758
14822
|
};
|
|
@@ -14848,9 +14912,10 @@
|
|
|
14848
14912
|
* @private
|
|
14849
14913
|
*/
|
|
14850
14914
|
GridService.prototype.initPivotSecondaryColsProcess = function (_a) {
|
|
14915
|
+
var _this = this;
|
|
14851
14916
|
var gridOptions = _a.gridOptions;
|
|
14852
14917
|
gridOptions.processSecondaryColDef = function (colDef) {
|
|
14853
|
-
var api = colDef.headerComponentParams.gridQuery.api;
|
|
14918
|
+
var api = colDef.headerComponentParams && colDef.headerComponentParams.gridQuery.api;
|
|
14854
14919
|
if (api) {
|
|
14855
14920
|
var valueColumns = colDef.headerComponentParams.gridQuery.api.columns.getValueColumns();
|
|
14856
14921
|
var originalColDef = valueColumns
|
|
@@ -14867,38 +14932,62 @@
|
|
|
14867
14932
|
}
|
|
14868
14933
|
}
|
|
14869
14934
|
if (colDef.pivotKeys) {
|
|
14870
|
-
colDef.pivotKeys = colDef.pivotKeys.map(function (key) {
|
|
14935
|
+
colDef.pivotKeys = colDef.pivotKeys.map(function (key) {
|
|
14936
|
+
var parsedKey = tryParsePivotValue(key);
|
|
14937
|
+
return (parsedKey && parsedKey.value) || '';
|
|
14938
|
+
});
|
|
14871
14939
|
}
|
|
14872
14940
|
};
|
|
14873
14941
|
gridOptions.processSecondaryColGroupDef = function (colGroupDef) {
|
|
14874
14942
|
if (colGroupDef.headerName) {
|
|
14875
|
-
var
|
|
14876
|
-
|
|
14877
|
-
|
|
14943
|
+
var parsedValue = tryParsePivotValue(colGroupDef.headerName);
|
|
14944
|
+
if (parsedValue) {
|
|
14945
|
+
var field = parsedValue.field, value = parsedValue.value;
|
|
14946
|
+
colGroupDef.headerClass = [field];
|
|
14947
|
+
colGroupDef.headerName = value;
|
|
14948
|
+
if (colGroupDef.children && colGroupDef.children.length > 1) {
|
|
14949
|
+
colGroupDef.headerClass.push('group-pivot-cell');
|
|
14950
|
+
}
|
|
14951
|
+
}
|
|
14952
|
+
}
|
|
14953
|
+
else if (colGroupDef.children) {
|
|
14954
|
+
var _a = __read(colGroupDef.children, 1), colChild = _a[0];
|
|
14955
|
+
var pivotTotalColumnIds = colChild && colChild.pivotTotalColumnIds;
|
|
14956
|
+
if (pivotTotalColumnIds && pivotTotalColumnIds.length > 0) {
|
|
14957
|
+
colGroupDef.headerClass = ['total-pivot-cell'];
|
|
14958
|
+
colGroupDef.headerName = _this.translate.transform('core.total');
|
|
14959
|
+
}
|
|
14960
|
+
}
|
|
14961
|
+
else {
|
|
14962
|
+
colGroupDef.headerClass = ['empty-pivot-header'];
|
|
14878
14963
|
}
|
|
14879
14964
|
if (colGroupDef.pivotKeys) {
|
|
14880
|
-
colGroupDef.pivotKeys = colGroupDef.pivotKeys.map(function (key) {
|
|
14965
|
+
colGroupDef.pivotKeys = colGroupDef.pivotKeys.map(function (key) {
|
|
14966
|
+
var parsedKey = tryParsePivotValue(key);
|
|
14967
|
+
return (parsedKey && parsedKey.value) || '';
|
|
14968
|
+
});
|
|
14881
14969
|
}
|
|
14882
14970
|
};
|
|
14883
14971
|
};
|
|
14884
14972
|
GridService.prototype.setPivotModeRows = function (data) {
|
|
14885
14973
|
var pivotColumns = this.gridQuery.getAllPivotColumns();
|
|
14886
14974
|
var convertedData = data.map(function (currentValue, index) {
|
|
14887
|
-
var
|
|
14975
|
+
var e_5, _a;
|
|
14888
14976
|
var mappedValues = __assign({}, currentValue);
|
|
14889
14977
|
try {
|
|
14890
14978
|
for (var pivotColumns_1 = __values(pivotColumns), pivotColumns_1_1 = pivotColumns_1.next(); !pivotColumns_1_1.done; pivotColumns_1_1 = pivotColumns_1.next()) {
|
|
14891
14979
|
var col = pivotColumns_1_1.value;
|
|
14892
14980
|
var field = col.getColDef().field;
|
|
14893
|
-
|
|
14981
|
+
var pivotValue = { field: field, value: currentValue[field] };
|
|
14982
|
+
mappedValues[field] = JSON.stringify(pivotValue);
|
|
14894
14983
|
}
|
|
14895
14984
|
}
|
|
14896
|
-
catch (
|
|
14985
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
14897
14986
|
finally {
|
|
14898
14987
|
try {
|
|
14899
14988
|
if (pivotColumns_1_1 && !pivotColumns_1_1.done && (_a = pivotColumns_1.return)) _a.call(pivotColumns_1);
|
|
14900
14989
|
}
|
|
14901
|
-
finally { if (
|
|
14990
|
+
finally { if (e_5) throw e_5.error; }
|
|
14902
14991
|
}
|
|
14903
14992
|
return mappedValues;
|
|
14904
14993
|
});
|
|
@@ -15417,8 +15506,11 @@
|
|
|
15417
15506
|
DatoGridControllerComponent.prototype.setGridRows = function (data) {
|
|
15418
15507
|
this.gridService.setRows(data);
|
|
15419
15508
|
};
|
|
15509
|
+
DatoGridControllerComponent.prototype.setGridFilters = function (filters) {
|
|
15510
|
+
this.gridService.setGridFilters(filters);
|
|
15511
|
+
};
|
|
15420
15512
|
DatoGridControllerComponent.prototype.onFilterChanged = function () {
|
|
15421
|
-
return this.gridQuery.
|
|
15513
|
+
return this.gridQuery.filterChanged();
|
|
15422
15514
|
};
|
|
15423
15515
|
DatoGridControllerComponent.prototype.onSortChanged = function () {
|
|
15424
15516
|
return this.gridQuery.selectSort();
|
|
@@ -25656,6 +25748,7 @@
|
|
|
25656
25748
|
exports.toString = toString;
|
|
25657
25749
|
exports.toggleClass = toggleClass;
|
|
25658
25750
|
exports.toolbarActionToContextAction = toolbarActionToContextAction;
|
|
25751
|
+
exports.tryParsePivotValue = tryParsePivotValue;
|
|
25659
25752
|
exports.unescape = unescape;
|
|
25660
25753
|
exports.union = union;
|
|
25661
25754
|
exports.uniq = uniq;
|