@datorama/core 21.3.1-rc.5 → 21.4.0-rc.11
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 +94 -2
- package/bundles/datorama-core.umd.js +314 -32
- package/bundles/datorama-core.umd.js.map +1 -1
- package/bundles/datorama-core.umd.min.js +58 -58
- package/bundles/datorama-core.umd.min.js.map +1 -1
- package/datorama-core.metadata.json +1 -1
- package/esm2015/lib/grid-v2/grid/grid-v2.component.js +5 -2
- package/esm2015/lib/grid-v2/grid/grid-v2.types.js +1 -1
- package/esm2015/lib/grid-v2/grid-column-header/grid-column-header.component.js +8 -7
- package/esm2015/lib/grid-v2/grid-controller/grid-controller.component.js +14 -1
- package/esm2015/lib/grid-v2/grid-filter/filter-validator.js +21 -3
- package/esm2015/lib/grid-v2/grid-filter/grid-filter.component.js +37 -7
- package/esm2015/lib/grid-v2/grid-filter/grid-filter.types.js +1 -1
- package/esm2015/lib/grid-v2/grid-pagination/grid-pagination.component.js +16 -3
- package/esm2015/lib/grid-v2/grid-store/grid.query.js +48 -4
- package/esm2015/lib/grid-v2/grid-store/grid.service.js +102 -6
- 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 +20 -1
- package/esm2015/lib/grid-v2/public_api.js +2 -2
- package/esm2015/lib/icon/icon.types.js +1 -1
- package/esm2015/lib/utils/array.js +10 -1
- package/esm5/lib/grid-v2/grid/grid-v2.component.js +9 -2
- package/esm5/lib/grid-v2/grid/grid-v2.types.js +1 -1
- package/esm5/lib/grid-v2/grid-column-header/grid-column-header.component.js +8 -11
- package/esm5/lib/grid-v2/grid-controller/grid-controller.component.js +14 -1
- package/esm5/lib/grid-v2/grid-filter/filter-validator.js +23 -4
- package/esm5/lib/grid-v2/grid-filter/grid-filter.component.js +43 -7
- package/esm5/lib/grid-v2/grid-filter/grid-filter.types.js +1 -1
- package/esm5/lib/grid-v2/grid-pagination/grid-pagination.component.js +16 -3
- package/esm5/lib/grid-v2/grid-store/grid.query.js +48 -4
- package/esm5/lib/grid-v2/grid-store/grid.service.js +139 -12
- 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 +20 -1
- package/esm5/lib/grid-v2/public_api.js +2 -2
- package/esm5/lib/icon/icon.types.js +1 -1
- package/esm5/lib/utils/array.js +12 -1
- package/fesm2015/datorama-core.js +263 -23
- package/fesm2015/datorama-core.js.map +1 -1
- package/fesm5/datorama-core.js +313 -33
- package/fesm5/datorama-core.js.map +1 -1
- package/i18n/locale-en_US.json +2 -1
- package/lib/grid-v2/grid/grid-v2.component.d.ts +1 -0
- package/lib/grid-v2/grid/grid-v2.types.d.ts +2 -0
- package/lib/grid-v2/grid-column-header/grid-column-header.component.d.ts +0 -2
- package/lib/grid-v2/grid-controller/grid-controller.component.d.ts +6 -1
- package/lib/grid-v2/grid-filter/grid-filter.component.d.ts +6 -0
- package/lib/grid-v2/grid-filter/grid-filter.types.d.ts +9 -0
- package/lib/grid-v2/grid-pagination/grid-pagination.component.d.ts +4 -0
- package/lib/grid-v2/grid-store/grid.query.d.ts +8 -2
- package/lib/grid-v2/grid-store/grid.service.d.ts +13 -3
- 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 +9 -1
- package/lib/grid-v2/public_api.d.ts +1 -2
- package/lib/utils/array.d.ts +5 -0
- package/package.json +2 -2
|
@@ -1383,6 +1383,17 @@
|
|
|
1383
1383
|
if (n === void 0) { n = 1; }
|
|
1384
1384
|
return array.filter(function (e, index) { return index >= n; });
|
|
1385
1385
|
}
|
|
1386
|
+
/**
|
|
1387
|
+
* Compares 2 array and return whether their inner values are the same,
|
|
1388
|
+
* without considering their order
|
|
1389
|
+
*/
|
|
1390
|
+
function isArrayValuesEqual(arrA, arrB) {
|
|
1391
|
+
if (arrA === void 0) { arrA = []; }
|
|
1392
|
+
if (arrB === void 0) { arrB = []; }
|
|
1393
|
+
var aInb = arrA.every(function (valA) { return arrB.find(function (valB) { return valB === valA; }); });
|
|
1394
|
+
var bIna = arrB.every(function (valB) { return arrA.find(function (valA) { return valA === valB; }); });
|
|
1395
|
+
return aInb && bIna && arrA.length === arrB.length;
|
|
1396
|
+
}
|
|
1386
1397
|
|
|
1387
1398
|
function toBoolean(value, includeZero) {
|
|
1388
1399
|
if (includeZero === void 0) { includeZero = false; }
|
|
@@ -11446,6 +11457,25 @@
|
|
|
11446
11457
|
return sizeMap;
|
|
11447
11458
|
}, {});
|
|
11448
11459
|
}
|
|
11460
|
+
/**
|
|
11461
|
+
* Take pivoted value field if pivot column,
|
|
11462
|
+
* or field of the colDef,
|
|
11463
|
+
* or group field form showRowGroup if its agg column
|
|
11464
|
+
*/
|
|
11465
|
+
function getColField(colDef) {
|
|
11466
|
+
var field = colDef.field, showRowGroup = colDef.showRowGroup, pivotValueColumn = colDef.pivotValueColumn;
|
|
11467
|
+
return pivotValueColumn ? pivotValueColumn.getColId() : field || showRowGroup;
|
|
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
|
+
}
|
|
11449
11479
|
|
|
11450
11480
|
var GridQuery = /** @class */ (function (_super) {
|
|
11451
11481
|
__extends(GridQuery, _super);
|
|
@@ -11520,7 +11550,7 @@
|
|
|
11520
11550
|
};
|
|
11521
11551
|
GridQuery.prototype.getCurrentGridSettings = function () {
|
|
11522
11552
|
var toColId = function (column) { return column.getColId(); };
|
|
11523
|
-
var
|
|
11553
|
+
var columns = this.api.columns;
|
|
11524
11554
|
var groupedColumns = columns.getRowGroupColumns();
|
|
11525
11555
|
var columnsOrder = columns.getAllColumns();
|
|
11526
11556
|
var allGridColumns = columns.getAllGridColumns();
|
|
@@ -11530,7 +11560,7 @@
|
|
|
11530
11560
|
var storeSettings = this.getValue().settings;
|
|
11531
11561
|
var settings = {
|
|
11532
11562
|
gridAlignment: storeSettings.gridAlignment,
|
|
11533
|
-
sort:
|
|
11563
|
+
sort: this.getSort(),
|
|
11534
11564
|
hiddenColumns: hiddenColumns,
|
|
11535
11565
|
groupedColumns: groupedColumns.map(toColId),
|
|
11536
11566
|
filter: this.getFilter(),
|
|
@@ -11544,6 +11574,28 @@
|
|
|
11544
11574
|
}
|
|
11545
11575
|
return settings;
|
|
11546
11576
|
};
|
|
11577
|
+
GridQuery.prototype.getSort = function () {
|
|
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
|
+
}
|
|
11595
|
+
};
|
|
11596
|
+
GridQuery.prototype.selectSort = function () {
|
|
11597
|
+
return this.select(function (state) { return state.settings.sort; });
|
|
11598
|
+
};
|
|
11547
11599
|
/* @internal */
|
|
11548
11600
|
GridQuery.prototype._setApi = function (api, gridRef) {
|
|
11549
11601
|
this.api = api;
|
|
@@ -11560,6 +11612,20 @@
|
|
|
11560
11612
|
GridQuery.prototype.getFilter = function () {
|
|
11561
11613
|
return this.getValue().settings.filter;
|
|
11562
11614
|
};
|
|
11615
|
+
GridQuery.prototype.selectFilter = function () {
|
|
11616
|
+
return this.select(function (state) { return state.settings.filter; });
|
|
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({ colId: datoFilter.colId, field: field, filter: datoFilter });
|
|
11624
|
+
}
|
|
11625
|
+
return filters;
|
|
11626
|
+
}, []);
|
|
11627
|
+
}));
|
|
11628
|
+
};
|
|
11563
11629
|
GridQuery.prototype.getSearchTerm = function () {
|
|
11564
11630
|
return this.getValue().settings.searchTerm;
|
|
11565
11631
|
};
|
|
@@ -11614,9 +11680,16 @@
|
|
|
11614
11680
|
GridQuery.prototype.getAllDisplayedColumns = function () {
|
|
11615
11681
|
return this.filterCheckboxSelectionColumn(this.api.columns.getAllDisplayedColumns());
|
|
11616
11682
|
};
|
|
11683
|
+
GridQuery.prototype.getAllPivotColumns = function () {
|
|
11684
|
+
return this.getAllColumns().filter(function (column) { return column.isPivotActive(); });
|
|
11685
|
+
};
|
|
11617
11686
|
GridQuery.prototype.selectIsSelectAllRowsEnabled = function () {
|
|
11618
11687
|
return this.select(function (state) { return state.serverSidePagination.selectAllRowsEnabled; });
|
|
11619
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
|
+
};
|
|
11620
11693
|
GridQuery.prototype.filterCheckboxSelectionColumn = function (columns) {
|
|
11621
11694
|
return columns.filter(function (column) { return !column.getUserProvidedColDef() || !column.getUserProvidedColDef().checkboxSelection; });
|
|
11622
11695
|
};
|
|
@@ -11709,7 +11782,7 @@
|
|
|
11709
11782
|
function validateStringCondition(rowValue, _a) {
|
|
11710
11783
|
var condition = _a.condition, filterValue = _a.value;
|
|
11711
11784
|
var filterTextLowerCase = filterValue ? filterValue.toLowerCase() : '';
|
|
11712
|
-
var valueLowerCase = rowValue ? rowValue.toLowerCase() : '';
|
|
11785
|
+
var valueLowerCase = rowValue ? ("" + rowValue).toLowerCase() : '';
|
|
11713
11786
|
switch (condition) {
|
|
11714
11787
|
case exports.DatoFilterConditions.EQUALS:
|
|
11715
11788
|
return valueLowerCase === filterTextLowerCase;
|
|
@@ -11796,8 +11869,13 @@
|
|
|
11796
11869
|
var orderedFilters = Object.keys(activeFilters);
|
|
11797
11870
|
var _loop_1 = function (filter) {
|
|
11798
11871
|
var filterPasses = true;
|
|
11799
|
-
var _a = activeFilters[filter], byValue = _a.byValue, conditional = _a.conditional;
|
|
11872
|
+
var _a = activeFilters[filter], byValue = _a.byValue, conditional = _a.conditional, pivotKeys = _a.pivotKeys;
|
|
11873
|
+
var currentRowPivotKeys = row.parent.childrenMapped && getRowPivotKeys(row.parent.childrenMapped);
|
|
11800
11874
|
var rowValue = api.getValue(filter, row);
|
|
11875
|
+
/** If value is under a pivoted column but doesn't match the filter pivot */
|
|
11876
|
+
if (pivotKeys && pivotKeys.length > 0 && !isArrayValuesEqual(pivotKeys, currentRowPivotKeys)) {
|
|
11877
|
+
return { value: true };
|
|
11878
|
+
}
|
|
11801
11879
|
if (conditional) {
|
|
11802
11880
|
var operator = conditional.operator, conditions = conditional.conditions, type_1 = conditional.type;
|
|
11803
11881
|
var conditionsRelation = operator === exports.OperatorTypes.AND ? 'every' : 'some';
|
|
@@ -11829,6 +11907,18 @@
|
|
|
11829
11907
|
}
|
|
11830
11908
|
return true;
|
|
11831
11909
|
}
|
|
11910
|
+
/**
|
|
11911
|
+
* Get pivot keys from a row parent
|
|
11912
|
+
*/
|
|
11913
|
+
function getRowPivotKeys(childrenMapped, keys) {
|
|
11914
|
+
if (keys === void 0) { keys = []; }
|
|
11915
|
+
var key = Object.keys(childrenMapped)[0];
|
|
11916
|
+
var parsedKey = tryParsePivotValue(key);
|
|
11917
|
+
if (parsedKey) {
|
|
11918
|
+
keys = getRowPivotKeys(childrenMapped[key], __spread(keys, [parsedKey.value]));
|
|
11919
|
+
}
|
|
11920
|
+
return keys;
|
|
11921
|
+
}
|
|
11832
11922
|
|
|
11833
11923
|
|
|
11834
11924
|
(function (GridActionType) {
|
|
@@ -12708,7 +12798,8 @@
|
|
|
12708
12798
|
});
|
|
12709
12799
|
Object.defineProperty(DatoGridFilterComponent.prototype, "colFilter", {
|
|
12710
12800
|
get: function () {
|
|
12711
|
-
|
|
12801
|
+
var filter = this.gridQuery.getFilter()[this.colField];
|
|
12802
|
+
return filter && isArrayValuesEqual(this.pivotKeys, filter.pivotKeys) ? filter : null;
|
|
12712
12803
|
},
|
|
12713
12804
|
enumerable: true,
|
|
12714
12805
|
configurable: true
|
|
@@ -12720,12 +12811,20 @@
|
|
|
12720
12811
|
enumerable: true,
|
|
12721
12812
|
configurable: true
|
|
12722
12813
|
});
|
|
12814
|
+
Object.defineProperty(DatoGridFilterComponent.prototype, "pivotKeys", {
|
|
12815
|
+
get: function () {
|
|
12816
|
+
return this.colDef.pivotKeys || [];
|
|
12817
|
+
},
|
|
12818
|
+
enumerable: true,
|
|
12819
|
+
configurable: true
|
|
12820
|
+
});
|
|
12723
12821
|
DatoGridFilterComponent.prototype.ngOnInit = function () {
|
|
12724
12822
|
var _a;
|
|
12725
12823
|
var _this = this;
|
|
12726
12824
|
var _b = this.popover.data, gridService = _b.gridService, gridQuery = _b.gridQuery;
|
|
12727
|
-
var _c = this.colDef,
|
|
12728
|
-
this.colField =
|
|
12825
|
+
var _c = this.colDef, filter = _c.filter, _d = _c.filtersConfig, filtersConfig = _d === void 0 ? {} : _d, pivotValueColumn = _c.pivotValueColumn, pivotKeys = _c.pivotKeys;
|
|
12826
|
+
this.colField = getColField(this.colDef);
|
|
12827
|
+
this.pivotColumn = gridQuery.api.columns.getSecondaryPivotColumn(pivotKeys, pivotValueColumn);
|
|
12729
12828
|
if (filtersConfig.sections) {
|
|
12730
12829
|
this.filterSections = (_a = {}, _a[filtersConfig.sections] = true, _a);
|
|
12731
12830
|
}
|
|
@@ -12737,7 +12836,11 @@
|
|
|
12737
12836
|
this.listSortByKey = this.filterType === exports.DatoGridFilterTypes.Number && this.colDef.valueFormatter ? 'id' : 'label';
|
|
12738
12837
|
this.gridQuery = gridQuery;
|
|
12739
12838
|
this.gridService = gridService;
|
|
12740
|
-
this.hasFilter$ = this.gridQuery
|
|
12839
|
+
this.hasFilter$ = this.gridQuery
|
|
12840
|
+
.select(function (state) { return state.settings.filter[_this.colField]; })
|
|
12841
|
+
.pipe(operators.map(function (filter) {
|
|
12842
|
+
return !isNil(filter) && isArrayValuesEqual(filter.pivotKeys, _this.pivotKeys);
|
|
12843
|
+
}));
|
|
12741
12844
|
if (this.filterSections.Conditional) {
|
|
12742
12845
|
var filterConditions = filterOptions || DatoGridStringFilterOptions;
|
|
12743
12846
|
if (filtersConfig.showEmptyConditions) {
|
|
@@ -12803,6 +12906,7 @@
|
|
|
12803
12906
|
isEmpty(filter)
|
|
12804
12907
|
? this.gridService.clearColumnFilter(this.colField)
|
|
12805
12908
|
: this.gridService.setColumnFilter(column, filter);
|
|
12909
|
+
this.gridService.notifyFilterUpdate();
|
|
12806
12910
|
}
|
|
12807
12911
|
};
|
|
12808
12912
|
DatoGridFilterComponent.prototype.clearFilters = function () {
|
|
@@ -12853,8 +12957,16 @@
|
|
|
12853
12957
|
return this.columnValues.filter(function (value) { return !includedSet.has(value); });
|
|
12854
12958
|
};
|
|
12855
12959
|
DatoGridFilterComponent.prototype.buildFilter = function () {
|
|
12960
|
+
var _this = this;
|
|
12856
12961
|
var _a = this.filterForm.value, byValue = _a.byValue, conditional = _a.conditional;
|
|
12857
|
-
var filter = {};
|
|
12962
|
+
var filter = { colId: this.colDef.colId };
|
|
12963
|
+
filter.pivotKeys = this.pivotKeys;
|
|
12964
|
+
if (this.pivotColumn) {
|
|
12965
|
+
filter.pivotFieldsMap = this.getPivotFields(this.pivotColumn.getParent()).reduce(function (fieldMap, field, index) {
|
|
12966
|
+
fieldMap[field] = _this.pivotKeys[index];
|
|
12967
|
+
return fieldMap;
|
|
12968
|
+
}, {});
|
|
12969
|
+
}
|
|
12858
12970
|
if (this.filterSections.Conditional) {
|
|
12859
12971
|
this.setConditionalFilter(filter, conditional);
|
|
12860
12972
|
}
|
|
@@ -13183,6 +13295,19 @@
|
|
|
13183
13295
|
var _this = this;
|
|
13184
13296
|
return data.filter(function (v) { return !_this.excludedValues.has(v); });
|
|
13185
13297
|
};
|
|
13298
|
+
/**
|
|
13299
|
+
* Get pivot dimensions as defined in the parent group column header class.
|
|
13300
|
+
*/
|
|
13301
|
+
DatoGridFilterComponent.prototype.getPivotFields = function (parent, fields) {
|
|
13302
|
+
if (fields === void 0) { fields = []; }
|
|
13303
|
+
var grandParent = parent.getParent();
|
|
13304
|
+
var headerClass = parent.getOriginalColumnGroup().getColGroupDef().headerClass;
|
|
13305
|
+
if (grandParent) {
|
|
13306
|
+
this.getPivotFields(grandParent, fields);
|
|
13307
|
+
}
|
|
13308
|
+
headerClass && fields.push(headerClass[0]);
|
|
13309
|
+
return fields;
|
|
13310
|
+
};
|
|
13186
13311
|
DatoGridFilterComponent.ctorParameters = function () { return [
|
|
13187
13312
|
{ type: core.ElementRef },
|
|
13188
13313
|
{ type: PopoverRef },
|
|
@@ -13271,10 +13396,9 @@
|
|
|
13271
13396
|
var colDef = params.column.getColDef();
|
|
13272
13397
|
this.headerInfo = colDef.info;
|
|
13273
13398
|
this.headerName = colDef.headerName;
|
|
13274
|
-
this.aggColumn = this.column.getColId().indexOf('ag-Grid-AutoColumn') !== -1;
|
|
13275
13399
|
this.showFilter = colDef.filter !== exports.DatoGridFilterTypes.None;
|
|
13276
13400
|
this.showMoreMenu = isNil(colDef.moreMenuActions) || colDef.moreMenuActions.length > 0;
|
|
13277
|
-
this.field =
|
|
13401
|
+
this.field = getColField(colDef);
|
|
13278
13402
|
this.context = {
|
|
13279
13403
|
api: {
|
|
13280
13404
|
grid: params.api,
|
|
@@ -13286,7 +13410,10 @@
|
|
|
13286
13410
|
this.customTemplates = gridService.getCustomHeader(this.field);
|
|
13287
13411
|
this.filterActive$ = gridQuery
|
|
13288
13412
|
.select(function (state) { return state.settings.filter[_this.field]; })
|
|
13289
|
-
.pipe(operators.map(function (filter) {
|
|
13413
|
+
.pipe(operators.map(function (filter) {
|
|
13414
|
+
var isPivotColumnMatchFilter = filter && isArrayValuesEqual(filter.pivotKeys, colDef.pivotKeys);
|
|
13415
|
+
return size(filter) > 0 && isPivotColumnMatchFilter;
|
|
13416
|
+
}));
|
|
13290
13417
|
if (this.params.enableSorting) {
|
|
13291
13418
|
rxjs.fromEvent(this.host.nativeElement, 'click')
|
|
13292
13419
|
.pipe(ngxTakeUntilDestroy.untilDestroyed(this))
|
|
@@ -13348,13 +13475,6 @@
|
|
|
13348
13475
|
});
|
|
13349
13476
|
};
|
|
13350
13477
|
DatoGridColumnHeaderComponent.prototype.ngOnDestroy = function () { };
|
|
13351
|
-
Object.defineProperty(DatoGridColumnHeaderComponent.prototype, "groupField", {
|
|
13352
|
-
get: function () {
|
|
13353
|
-
return this.column.getColDef().showRowGroup;
|
|
13354
|
-
},
|
|
13355
|
-
enumerable: true,
|
|
13356
|
-
configurable: true
|
|
13357
|
-
});
|
|
13358
13478
|
DatoGridColumnHeaderComponent.ctorParameters = function () { return [
|
|
13359
13479
|
{ type: core.ViewContainerRef },
|
|
13360
13480
|
{ type: CustomHeaderControllerService },
|
|
@@ -13853,8 +13973,8 @@
|
|
|
13853
13973
|
this.svgRegistry = svgRegistry;
|
|
13854
13974
|
this.storageAPI = storageAPI;
|
|
13855
13975
|
this.logger = logger;
|
|
13856
|
-
this.pageNumberToReturnAfterRefresh = -1;
|
|
13857
13976
|
this.treeConfig = defaultGridTreeLabel;
|
|
13977
|
+
this.pageNumberToReturnAfterRefresh = -1;
|
|
13858
13978
|
this.CHECKBOX_SELECTION_COL_ID = 'grid-checkbox-selection';
|
|
13859
13979
|
}
|
|
13860
13980
|
Object.defineProperty(GridService.prototype, "treeData", {
|
|
@@ -13920,6 +14040,9 @@
|
|
|
13920
14040
|
var treeDate = convertToTreeData(data, _this.treeConfig);
|
|
13921
14041
|
_this.api.grid.setRowData(treeDate);
|
|
13922
14042
|
}
|
|
14043
|
+
else if (_this.isPivotMode) {
|
|
14044
|
+
_this.setPivotModeRows(data);
|
|
14045
|
+
}
|
|
13923
14046
|
else {
|
|
13924
14047
|
_this.api.grid.setRowData(data);
|
|
13925
14048
|
}
|
|
@@ -14040,6 +14163,12 @@
|
|
|
14040
14163
|
params.gridOptions.saveSettings = saveSettings !== false && !isNil(gridName);
|
|
14041
14164
|
/** Server Side Pagination for select all option */
|
|
14042
14165
|
this.initOnRowSelectedForServerSidePagination(params);
|
|
14166
|
+
/** Add pivot specific required settings */
|
|
14167
|
+
if (params.gridOptions.pivotMode) {
|
|
14168
|
+
this.initPivotSecondaryColsProcess(params);
|
|
14169
|
+
params.gridOptions.enableV2_1 = true;
|
|
14170
|
+
params.gridOptions.saveSettings = false;
|
|
14171
|
+
}
|
|
14043
14172
|
return params.gridOptions;
|
|
14044
14173
|
};
|
|
14045
14174
|
GridService.prototype.normalizeColumns = function (colDefs, gridOptions) {
|
|
@@ -14225,19 +14354,50 @@
|
|
|
14225
14354
|
});
|
|
14226
14355
|
this.notifyFilterUpdate();
|
|
14227
14356
|
};
|
|
14228
|
-
GridService.prototype.setColumnFilter = function (column, filter) {
|
|
14357
|
+
GridService.prototype.setColumnFilter = function (column, filter, notifyGrid) {
|
|
14358
|
+
if (notifyGrid === void 0) { notifyGrid = true; }
|
|
14229
14359
|
this._logEvent("Grids - Filter Applied" /* GRID_FILTER_APPLIED */, {
|
|
14230
14360
|
column: column.getColId(),
|
|
14231
14361
|
numOfConditions: (filter.conditional && filter.conditional.conditions.length) || 0,
|
|
14232
14362
|
byValue: !!filter.byValue ? 'Yes' : 'No'
|
|
14233
14363
|
});
|
|
14364
|
+
this.updateFilter(column, filter);
|
|
14365
|
+
if (notifyGrid) {
|
|
14366
|
+
this.notifyFilterUpdate();
|
|
14367
|
+
}
|
|
14368
|
+
};
|
|
14369
|
+
GridService.prototype.setGridFilters = function (filters) {
|
|
14370
|
+
var e_2, _a;
|
|
14371
|
+
try {
|
|
14372
|
+
for (var filters_1 = __values(filters), filters_1_1 = filters_1.next(); !filters_1_1.done; filters_1_1 = filters_1.next()) {
|
|
14373
|
+
var _b = filters_1_1.value, colId = _b.colId, filter = _b.filter;
|
|
14374
|
+
var column = this.api.columns.getColumn(colId);
|
|
14375
|
+
if (column) {
|
|
14376
|
+
this.setColumnFilter(column, filter);
|
|
14377
|
+
}
|
|
14378
|
+
else {
|
|
14379
|
+
var pivotColumn = this.gridQuery.getSecondaryColumn(colId);
|
|
14380
|
+
this.setColumnFilter(pivotColumn, filter);
|
|
14381
|
+
}
|
|
14382
|
+
}
|
|
14383
|
+
}
|
|
14384
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
14385
|
+
finally {
|
|
14386
|
+
try {
|
|
14387
|
+
if (filters_1_1 && !filters_1_1.done && (_a = filters_1.return)) _a.call(filters_1);
|
|
14388
|
+
}
|
|
14389
|
+
finally { if (e_2) throw e_2.error; }
|
|
14390
|
+
}
|
|
14391
|
+
this.notifyFilterUpdate();
|
|
14392
|
+
};
|
|
14393
|
+
GridService.prototype.updateFilter = function (column, filter) {
|
|
14394
|
+
var colField = getColField(column.getColDef());
|
|
14234
14395
|
this.store.update(function (state) {
|
|
14235
14396
|
var _a;
|
|
14236
14397
|
return {
|
|
14237
|
-
settings: __assign(__assign({}, state.settings), { filter: __assign(__assign({}, state.settings.filter), (_a = {}, _a[
|
|
14398
|
+
settings: __assign(__assign({}, state.settings), { filter: __assign(__assign({}, state.settings.filter), (_a = {}, _a[colField] = filter, _a)) })
|
|
14238
14399
|
};
|
|
14239
14400
|
});
|
|
14240
|
-
this.notifyFilterUpdate();
|
|
14241
14401
|
};
|
|
14242
14402
|
GridService.prototype.setSearchTerm = function (searchTerm) {
|
|
14243
14403
|
this.store.update(function (state) {
|
|
@@ -14530,7 +14690,7 @@
|
|
|
14530
14690
|
this.api.grid.onFilterChanged();
|
|
14531
14691
|
};
|
|
14532
14692
|
GridService.prototype.buildServerRequestFilters = function (filter) {
|
|
14533
|
-
var
|
|
14693
|
+
var e_3, _a;
|
|
14534
14694
|
var columnsFilters = {};
|
|
14535
14695
|
try {
|
|
14536
14696
|
for (var _b = __values(Object.entries(filter)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
@@ -14566,12 +14726,12 @@
|
|
|
14566
14726
|
}
|
|
14567
14727
|
}
|
|
14568
14728
|
}
|
|
14569
|
-
catch (
|
|
14729
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
14570
14730
|
finally {
|
|
14571
14731
|
try {
|
|
14572
14732
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
14573
14733
|
}
|
|
14574
|
-
finally { if (
|
|
14734
|
+
finally { if (e_3) throw e_3.error; }
|
|
14575
14735
|
}
|
|
14576
14736
|
return columnsFilters;
|
|
14577
14737
|
};
|
|
@@ -14624,7 +14784,7 @@
|
|
|
14624
14784
|
return { operator: exports.OperatorTypes.AND, filters: [columnFilter, searchFilter] };
|
|
14625
14785
|
};
|
|
14626
14786
|
GridService.prototype.buildServerColumnFilters_v2_1 = function (filter) {
|
|
14627
|
-
var
|
|
14787
|
+
var e_4, _a;
|
|
14628
14788
|
var columnFilters = [];
|
|
14629
14789
|
try {
|
|
14630
14790
|
for (var _b = __values(Object.entries(filter)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
@@ -14649,12 +14809,12 @@
|
|
|
14649
14809
|
columnFilters.push(columnFilter);
|
|
14650
14810
|
}
|
|
14651
14811
|
}
|
|
14652
|
-
catch (
|
|
14812
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
14653
14813
|
finally {
|
|
14654
14814
|
try {
|
|
14655
14815
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
14656
14816
|
}
|
|
14657
|
-
finally { if (
|
|
14817
|
+
finally { if (e_4) throw e_4.error; }
|
|
14658
14818
|
}
|
|
14659
14819
|
return columnFilters;
|
|
14660
14820
|
};
|
|
@@ -14744,6 +14904,93 @@
|
|
|
14744
14904
|
this.setServerSidePagination({ selectAllRowsEnabled: false, excludedFromSelectAll: [] });
|
|
14745
14905
|
}
|
|
14746
14906
|
};
|
|
14907
|
+
/**
|
|
14908
|
+
* When pivoting,
|
|
14909
|
+
* we add the field name to the column header class in order to access it through the auto generated pivot column.
|
|
14910
|
+
* @private
|
|
14911
|
+
*/
|
|
14912
|
+
GridService.prototype.initPivotSecondaryColsProcess = function (_a) {
|
|
14913
|
+
var _this = this;
|
|
14914
|
+
var gridOptions = _a.gridOptions;
|
|
14915
|
+
gridOptions.processSecondaryColDef = function (colDef) {
|
|
14916
|
+
var api = colDef.headerComponentParams && colDef.headerComponentParams.gridQuery.api;
|
|
14917
|
+
if (api) {
|
|
14918
|
+
var valueColumns = colDef.headerComponentParams.gridQuery.api.columns.getValueColumns();
|
|
14919
|
+
var originalColDef = valueColumns
|
|
14920
|
+
.map(function (_a) {
|
|
14921
|
+
var userProvidedColDef = _a.userProvidedColDef;
|
|
14922
|
+
return userProvidedColDef;
|
|
14923
|
+
})
|
|
14924
|
+
.find(function (_a) {
|
|
14925
|
+
var colId = _a.colId;
|
|
14926
|
+
return colId === colDef.pivotValueColumn.getColId();
|
|
14927
|
+
});
|
|
14928
|
+
if (originalColDef) {
|
|
14929
|
+
colDef.filter = originalColDef.filter;
|
|
14930
|
+
}
|
|
14931
|
+
}
|
|
14932
|
+
if (colDef.pivotKeys) {
|
|
14933
|
+
colDef.pivotKeys = colDef.pivotKeys.map(function (key) {
|
|
14934
|
+
var parsedKey = tryParsePivotValue(key);
|
|
14935
|
+
return (parsedKey && parsedKey.value) || '';
|
|
14936
|
+
});
|
|
14937
|
+
}
|
|
14938
|
+
};
|
|
14939
|
+
gridOptions.processSecondaryColGroupDef = function (colGroupDef) {
|
|
14940
|
+
if (colGroupDef.headerName) {
|
|
14941
|
+
var parsedValue = tryParsePivotValue(colGroupDef.headerName);
|
|
14942
|
+
if (parsedValue) {
|
|
14943
|
+
var field = parsedValue.field, value = parsedValue.value;
|
|
14944
|
+
colGroupDef.headerClass = [field];
|
|
14945
|
+
colGroupDef.headerName = value;
|
|
14946
|
+
if (colGroupDef.children && colGroupDef.children.length > 1) {
|
|
14947
|
+
colGroupDef.headerClass.push('group-pivot-cell');
|
|
14948
|
+
}
|
|
14949
|
+
}
|
|
14950
|
+
}
|
|
14951
|
+
else if (colGroupDef.children) {
|
|
14952
|
+
var _a = __read(colGroupDef.children, 1), colChild = _a[0];
|
|
14953
|
+
var pivotTotalColumnIds = colChild && colChild.pivotTotalColumnIds;
|
|
14954
|
+
if (pivotTotalColumnIds && pivotTotalColumnIds.length > 0) {
|
|
14955
|
+
colGroupDef.headerClass = ['total-pivot-cell'];
|
|
14956
|
+
colGroupDef.headerName = _this.translate.transform('core.total');
|
|
14957
|
+
}
|
|
14958
|
+
}
|
|
14959
|
+
else {
|
|
14960
|
+
colGroupDef.headerClass = ['empty-pivot-header'];
|
|
14961
|
+
}
|
|
14962
|
+
if (colGroupDef.pivotKeys) {
|
|
14963
|
+
colGroupDef.pivotKeys = colGroupDef.pivotKeys.map(function (key) {
|
|
14964
|
+
var parsedKey = tryParsePivotValue(key);
|
|
14965
|
+
return (parsedKey && parsedKey.value) || '';
|
|
14966
|
+
});
|
|
14967
|
+
}
|
|
14968
|
+
};
|
|
14969
|
+
};
|
|
14970
|
+
GridService.prototype.setPivotModeRows = function (data) {
|
|
14971
|
+
var pivotColumns = this.gridQuery.getAllPivotColumns();
|
|
14972
|
+
var convertedData = data.map(function (currentValue, index) {
|
|
14973
|
+
var e_5, _a;
|
|
14974
|
+
var mappedValues = __assign({}, currentValue);
|
|
14975
|
+
try {
|
|
14976
|
+
for (var pivotColumns_1 = __values(pivotColumns), pivotColumns_1_1 = pivotColumns_1.next(); !pivotColumns_1_1.done; pivotColumns_1_1 = pivotColumns_1.next()) {
|
|
14977
|
+
var col = pivotColumns_1_1.value;
|
|
14978
|
+
var field = col.getColDef().field;
|
|
14979
|
+
var pivotValue = { field: field, value: currentValue[field] };
|
|
14980
|
+
mappedValues[field] = JSON.stringify(pivotValue);
|
|
14981
|
+
}
|
|
14982
|
+
}
|
|
14983
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
14984
|
+
finally {
|
|
14985
|
+
try {
|
|
14986
|
+
if (pivotColumns_1_1 && !pivotColumns_1_1.done && (_a = pivotColumns_1.return)) _a.call(pivotColumns_1);
|
|
14987
|
+
}
|
|
14988
|
+
finally { if (e_5) throw e_5.error; }
|
|
14989
|
+
}
|
|
14990
|
+
return mappedValues;
|
|
14991
|
+
});
|
|
14992
|
+
this.api.grid.setRowData(convertedData);
|
|
14993
|
+
};
|
|
14747
14994
|
GridService.ctorParameters = function () { return [
|
|
14748
14995
|
{ type: GridStore },
|
|
14749
14996
|
{ type: GridQuery },
|
|
@@ -15178,6 +15425,7 @@
|
|
|
15178
15425
|
set: function (gridOptions) {
|
|
15179
15426
|
this._gridOptions = gridOptions;
|
|
15180
15427
|
this.gridService.treeData = gridOptions.treeData;
|
|
15428
|
+
this.gridService.isPivotMode = gridOptions.pivotMode;
|
|
15181
15429
|
if (this.agGridEl) {
|
|
15182
15430
|
if (gridOptions.treeData) {
|
|
15183
15431
|
!this.agGridEl.classList.contains(this.treeGridClass) && this.agGridEl.classList.add(this.treeGridClass);
|
|
@@ -15253,6 +15501,18 @@
|
|
|
15253
15501
|
var defaults = __assign(__assign(__assign({}, defaultGridOptions), (this.gridOptions.treeData ? defaultTreeOptions : {})), { icons: this.getGridIcons() });
|
|
15254
15502
|
return deepmerge(defaults, normalized);
|
|
15255
15503
|
};
|
|
15504
|
+
DatoGridControllerComponent.prototype.setGridRows = function (data) {
|
|
15505
|
+
this.gridService.setRows(data);
|
|
15506
|
+
};
|
|
15507
|
+
DatoGridControllerComponent.prototype.setGridFilters = function (filters) {
|
|
15508
|
+
this.gridService.setGridFilters(filters);
|
|
15509
|
+
};
|
|
15510
|
+
DatoGridControllerComponent.prototype.onFilterChanged = function () {
|
|
15511
|
+
return this.gridQuery.filterChanged();
|
|
15512
|
+
};
|
|
15513
|
+
DatoGridControllerComponent.prototype.onSortChanged = function () {
|
|
15514
|
+
return this.gridQuery.selectSort();
|
|
15515
|
+
};
|
|
15256
15516
|
DatoGridControllerComponent.prototype.getGridIcons = function () {
|
|
15257
15517
|
var moveColumnIcon = "<span class=\"da-grid-icon pointer d-flex column-move\">" + this.iconRegistry.getSvg('move-column') + "</span>";
|
|
15258
15518
|
return {
|
|
@@ -15662,6 +15922,13 @@
|
|
|
15662
15922
|
enumerable: true,
|
|
15663
15923
|
configurable: true
|
|
15664
15924
|
});
|
|
15925
|
+
Object.defineProperty(DatoGridV2Component.prototype, "isPivotMode", {
|
|
15926
|
+
get: function () {
|
|
15927
|
+
return this.gridOptions ? this.gridOptions.pivotMode : false;
|
|
15928
|
+
},
|
|
15929
|
+
enumerable: true,
|
|
15930
|
+
configurable: true
|
|
15931
|
+
});
|
|
15665
15932
|
DatoGridV2Component.ctorParameters = function () { return [
|
|
15666
15933
|
{ type: DatoGridControllerComponent },
|
|
15667
15934
|
{ type: core.ElementRef }
|
|
@@ -15674,7 +15941,7 @@
|
|
|
15674
15941
|
DatoGridV2Component = __decorate([
|
|
15675
15942
|
core.Component({
|
|
15676
15943
|
selector: 'dato-grid-v2',
|
|
15677
|
-
template: "<ag-grid-angular data-auto-id=\"grid\" class=\"dato-grid ag-theme-material\" [class.has-background]=\"enableBackground\" [class.enable-v2_1]=\"enableV2_1\"\n [class.with-multi-selection-col]=\"gridOptions?.showMultiSelectionCheckboxes\">\n</ag-grid-angular>\n<dato-grid-pagination-v2 [class.has-background]=\"enableBackground\"></dato-grid-pagination-v2>\n",
|
|
15944
|
+
template: "<ag-grid-angular data-auto-id=\"grid\" class=\"dato-grid ag-theme-material\" [class.has-background]=\"enableBackground\" [class.enable-v2_1]=\"enableV2_1\"\n [class.with-multi-selection-col]=\"gridOptions?.showMultiSelectionCheckboxes\" [class.pivot-mode]=\"isPivotMode\">\n</ag-grid-angular>\n<dato-grid-pagination-v2 [class.has-background]=\"enableBackground\"></dato-grid-pagination-v2>\n",
|
|
15678
15945
|
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
15679
15946
|
encapsulation: core.ViewEncapsulation.None,
|
|
15680
15947
|
styles: ["dato-grid-v2{flex-grow:1;display:flex;flex-direction:column;position:relative}dato-grid-v2 .dato-grid,dato-grid-v2 dato-grid-pagination-v2{position:absolute;left:0;right:0;bottom:0}dato-grid-v2 .dato-grid{top:0;bottom:50px}dato-grid-v2 .grid-hover-actions{position:absolute;z-index:2;transition:opacity .2s ease-in-out}dato-grid-v2 .ag-row-drag{width:initial!important}dato-grid-v2 .da-grid-icon{display:inline-block;line-height:31px;vertical-align:middle;width:initial;height:initial}dato-grid-v2 .da-grid-icon.drag{width:14px;height:14px;margin-right:6px;opacity:0;transition:opacity .3s;transform:translateY(-50%)}dato-grid-v2 .da-grid-icon.folder{width:18px;height:35px;margin:0 8px}dato-grid-v2 .ag-row.ag-row-hover .da-grid-icon.drag{opacity:1}dato-grid-v2 ag-grid-angular.tree .ag-group-contracted,dato-grid-v2 ag-grid-angular.tree .ag-group-expanded{display:inline-block;width:18px;text-align:center}dato-grid-v2 ag-grid-angular.tree .ag-group-checkbox{display:none}dato-grid-v2 ag-grid-angular.tree .ag-row.ag-empty-folder .folder{margin-left:26px}dato-grid-v2 ag-grid-angular.tree .ag-row.ag-row-level-1 .ag-cell-wrapper .ag-row-drag{padding-right:calc(55px * 1)}dato-grid-v2 ag-grid-angular.tree .ag-row .ag-row-group-indent-1{margin-left:0!important;padding-left:0!important}dato-grid-v2 ag-grid-angular.tree .ag-row.ag-row-level-2 .ag-cell-wrapper .ag-row-drag{padding-right:calc(55px * 2)}dato-grid-v2 ag-grid-angular.tree .ag-row .ag-row-group-indent-2{margin-left:0!important;padding-left:0!important}dato-grid-v2 ag-grid-angular.tree .ag-row.ag-row-level-3 .ag-cell-wrapper .ag-row-drag{padding-right:calc(55px * 3)}dato-grid-v2 ag-grid-angular.tree .ag-row .ag-row-group-indent-3{margin-left:0!important;padding-left:0!important}dato-grid-v2 ag-grid-angular.tree .ag-row.ag-row-level-4 .ag-cell-wrapper .ag-row-drag{padding-right:calc(55px * 4)}dato-grid-v2 ag-grid-angular.tree .ag-row .ag-row-group-indent-4{margin-left:0!important;padding-left:0!important}dato-grid-v2 ag-grid-angular.tree .ag-row div[col-id=ag-Grid-AutoColumn]{padding-left:0}dato-grid-v2 ag-grid-angular.tree .ag-row .ag-cell{display:flex;align-items:center}dato-grid-v2 ag-grid-angular.tree .ag-row .ag-cell .ag-group-value>span{display:inline-block;vertical-align:middle}dato-grid-v2 ag-grid-angular.tree .ag-row .ag-cell .initials{border-radius:50%;padding:4px;margin-right:8px;margin-left:20px;width:28px;height:28px;display:inline-block;text-align:center}dato-grid-v2 ag-grid-angular.tree .ag-row-group-leaf-indent{margin-left:0!important}dato-grid-v2 ag-grid-angular.tree .ag-selection-checkbox .ag-icon-checkbox-indeterminate:before{text-align:center;content:'-';display:inline-block;position:absolute;top:0;left:0;right:0;bottom:0;line-height:.5;color:#fff}dato-grid-v2 ag-grid-angular.row-height-35 .ag-cell{line-height:33px}dato-grid-v2 ag-grid-angular.row-height-35 .ag-cell.dato-editable-cell{line-height:29px}dato-grid-v2 ag-grid-angular.row-height-35 .ag-cell.ag-cell-inline-editing{height:35px}dato-grid-v2 ag-grid-angular.row-height-44 .ag-cell{line-height:42px}dato-grid-v2 ag-grid-angular.row-height-44 .ag-cell.dato-editable-cell{line-height:38px}dato-grid-v2 ag-grid-angular.row-height-44 .ag-cell.ag-cell-inline-editing{height:44px}dato-grid-v2 ag-grid-angular.row-height-50 .ag-cell{line-height:48px}dato-grid-v2 ag-grid-angular.row-height-50 .ag-cell.dato-editable-cell{line-height:44px}dato-grid-v2 ag-grid-angular.row-height-50 .ag-cell.ag-cell-inline-editing{height:50px}dato-grid-v2 ag-grid-angular.row-height-59 .ag-cell{line-height:57px}dato-grid-v2 ag-grid-angular.row-height-59 .ag-cell.dato-editable-cell{line-height:53px}dato-grid-v2 ag-grid-angular.row-height-59 .ag-cell.ag-cell-inline-editing{height:59px}dato-grid-v2 ag-grid-angular .ag-cell.checkbox-selection-cell{display:flex}dato-grid-v2 .ag-menu .da-grid-icon svg{vertical-align:middle}dato-grid-v2 .ag-header-cell-sortable .ag-sort-none-icon{opacity:0;transition:opacity .2s}dato-grid-v2 .ag-header-cell-sortable:hover .ag-sort-none-icon{opacity:1}dato-grid-v2 .group-contracted-icon,dato-grid-v2 .group-expanded-icon{width:7px}dato-grid-v2 .group-expanded-icon{transform:rotate(90deg)}dato-grid-v2 .dato-grid .ag-cell{border-top:0;border-bottom:0}.ag-dnd-ghost{min-width:100px;border:none;display:flex;justify-content:flex-start;align-content:center;align-items:center;cursor:-webkit-grabbing;cursor:grabbing;z-index:10000000}.ag-dnd-ghost .da-grid-icon.column-move-hide svg{height:18px;width:18px}.ag-dnd-ghost .da-grid-icon.column-move svg,.ag-dnd-ghost .da-grid-icon.column-move-pin svg{height:16px;width:16px}"]
|
|
@@ -15975,6 +16242,9 @@
|
|
|
15975
16242
|
showFirstEllipsis: false,
|
|
15976
16243
|
showLastPage: false
|
|
15977
16244
|
};
|
|
16245
|
+
// Show fit cell content and collapse/expand row groups controls
|
|
16246
|
+
this.showBottomControls = false;
|
|
16247
|
+
this.isExpanded = true;
|
|
15978
16248
|
this.isServerSidePagination = false;
|
|
15979
16249
|
// The number of pages displayed in the navigation panel for each view as defined by product.
|
|
15980
16250
|
this.MINI_DISPLAY_LENGTH = 2;
|
|
@@ -16022,7 +16292,10 @@
|
|
|
16022
16292
|
_this.initPagination();
|
|
16023
16293
|
});
|
|
16024
16294
|
this.gridQuery.gridReady$
|
|
16025
|
-
.pipe(operators.tap(function () {
|
|
16295
|
+
.pipe(operators.tap(function () {
|
|
16296
|
+
_this.gridApi = _this.gridQuery.api.grid;
|
|
16297
|
+
_this.showBottomControls = _this.gridQuery.getGridOptions().showBottomControls;
|
|
16298
|
+
}), operators.switchMap(function () {
|
|
16026
16299
|
_this.isServerSidePagination = _this.gridQuery.isServerSide;
|
|
16027
16300
|
return _this.isServerSidePagination ? _this.gridQuery.serverDataLoaded$ : _this.gridQuery.rowDataChanged$;
|
|
16028
16301
|
}), operators.throttleTime(100), tapOnce(function () { return _this.initPagination(); }), ngxTakeUntilDestroy.untilDestroyed(this))
|
|
@@ -16144,6 +16417,13 @@
|
|
|
16144
16417
|
DatoGridPaginationV2Component.prototype.trackByPage = function (index, page) {
|
|
16145
16418
|
return page;
|
|
16146
16419
|
};
|
|
16420
|
+
DatoGridPaginationV2Component.prototype.toggleGroupsState = function () {
|
|
16421
|
+
this.isExpanded ? this.gridApi.collapseAll() : this.gridApi.expandAll();
|
|
16422
|
+
this.isExpanded = !this.isExpanded;
|
|
16423
|
+
};
|
|
16424
|
+
DatoGridPaginationV2Component.prototype.autoFitGrid = function (type) {
|
|
16425
|
+
this.gridService.fitGrid(type);
|
|
16426
|
+
};
|
|
16147
16427
|
DatoGridPaginationV2Component.prototype.ngOnDestroy = function () { };
|
|
16148
16428
|
/**
|
|
16149
16429
|
* Sets the rows display string
|
|
@@ -16232,7 +16512,7 @@
|
|
|
16232
16512
|
core.Component({
|
|
16233
16513
|
selector: 'dato-grid-pagination-v2',
|
|
16234
16514
|
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
16235
|
-
template: "<div class=\"d-flex-row d-flex-auto d-flex-wrap container\" [class.small]=\"smallVersion\"\n [attr.data-pages-count]=\"totalPages\"\n [attr.data-current-page]=\"pageNumbersDisplay.currentPage\"\n [attr.data-page-size]=\"rowsPerPage\"\n [attr.data-rows-count]=\"rowCount\">\n <div *ngIf=\"totalPages > 1\" #navigation\n class=\"navigation d-flex-row d-flex-0-0-auto align-center\">\n\n <!-- First Page -->\n <dato-icon-button *ngIf=\"!disableButtons\"\n class=\"mr-4\" data-auto-id=\"pagiantion-first-page\"\n icon=\"chevron-left-double\"\n datoType=\"secondary\"\n datoSize=\"md\"\n [disabled]=\"prevPageDisabled\"\n (click)=\"navigateFirstPage()\">\n </dato-icon-button>\n\n <!-- Previous Page -->\n <dato-icon-button icon=\"arrow-left\" datoType=\"secondary\" datoSize=\"md\"\n [disabled]=\"prevPageDisabled\" data-auto-id=\"pagiantion-previous-page\"\n (click)=\"navigatePrevPage()\">\n </dato-icon-button>\n\n\n <div class=\"d-flex mx-5 align-center number-container\">\n <dato-link class=\"page-number mx-5\" datoType=\"secondary\" datoSize=\"sm\" data-auto-id=\"pagiantion-previous-batch\"\n *ngIf=\"pageNumbersDisplay.showFirstEllipsis && !smallVersion\"\n (click)=\"showPreviousBatch()\">...\n </dato-link>\n <dato-link class=\"page-number mx-5\" [datoType]=\"page === pageNumbersDisplay.currentPage ? 'primary' : 'secondary'\" datoSize=\"sm\"\n *ngFor=\"let page of pageNumbersDisplay.pages; index as i; trackBy: trackByPage;\" [attr.data-auto-id]=\"'pagiantion-page-' + i\"\n (click)=\"navigatePage(page - 1)\">\n {{page}}\n </dato-link>\n\n <div class=\"d-flex\" *ngIf=\"pageNumbersDisplay.showLastPage && !smallVersion\">\n <dato-link class=\"page-number mx-5\" datoType=\"secondary\" datoSize=\"sm\" data-auto-id=\"pagiantion-next-batch\"\n (click)=\"showNextBatch()\">...</dato-link>\n <dato-link class=\"page-number mx-5\" datoType=\"secondary\" datoSize=\"sm\"\n [attr.data-auto-id]=\"'pagiantion-page-' + totalPages\"\n (click)=\"navigatePage(totalPages - 1)\">\n {{totalPages}}\n </dato-link>\n </div>\n\n </div>\n\n <!-- Next Page -->\n <dato-icon-button icon=\"arrow-right\" datoType=\"secondary\" datoSize=\"md\"\n (click)=\"navigateNextPage()\" data-auto-id=\"pagiantion-next-page\"\n [disabled]=\"nextPageDisabled\">\n </dato-icon-button>\n\n <!-- Last Page -->\n <dato-icon-button *ngIf=\"!disableButtons\"\n class=\"ml-4\" icon=\"chevron-right-double\"\n datoType=\"secondary\" datoSize=\"md\" data-auto-id=\"pagiantion-last-page\"\n [disabled]=\"nextPageDisabled\"\n (click)=\"navigatePage(totalPages - 1)\">\n </dato-icon-button>\n\n </div>\n\n <div *ngIf=\"totalPages > 1 && !smallVersion\"\n class=\"separator mx-10 my-auto primary-100-background-color\">\n </div>\n\n <div class=\"total d-flex-0-0-auto d-flex-row align-center\">\n <span class=\"dato-note primary-300-color\">{{rowsRange}}</span>\n </div>\n\n</div>\n",
|
|
16515
|
+
template: "<div class=\"d-flex-row d-flex-auto d-flex-wrap container\" [class.small]=\"smallVersion\"\n [attr.data-pages-count]=\"totalPages\"\n [attr.data-current-page]=\"pageNumbersDisplay.currentPage\"\n [attr.data-page-size]=\"rowsPerPage\"\n [attr.data-rows-count]=\"rowCount\">\n <div *ngIf=\"totalPages > 1\" #navigation\n class=\"navigation d-flex-row d-flex-0-0-auto align-center\">\n\n <!-- First Page -->\n <dato-icon-button *ngIf=\"!disableButtons\"\n class=\"mr-4\" data-auto-id=\"pagiantion-first-page\"\n icon=\"chevron-left-double\"\n datoType=\"secondary\"\n datoSize=\"md\"\n [disabled]=\"prevPageDisabled\"\n (click)=\"navigateFirstPage()\">\n </dato-icon-button>\n\n <!-- Previous Page -->\n <dato-icon-button icon=\"arrow-left\" datoType=\"secondary\" datoSize=\"md\"\n [disabled]=\"prevPageDisabled\" data-auto-id=\"pagiantion-previous-page\"\n (click)=\"navigatePrevPage()\">\n </dato-icon-button>\n\n\n <div class=\"d-flex mx-5 align-center number-container\">\n <dato-link class=\"page-number mx-5\" datoType=\"secondary\" datoSize=\"sm\" data-auto-id=\"pagiantion-previous-batch\"\n *ngIf=\"pageNumbersDisplay.showFirstEllipsis && !smallVersion\"\n (click)=\"showPreviousBatch()\">...\n </dato-link>\n <dato-link class=\"page-number mx-5\" [datoType]=\"page === pageNumbersDisplay.currentPage ? 'primary' : 'secondary'\" datoSize=\"sm\"\n *ngFor=\"let page of pageNumbersDisplay.pages; index as i; trackBy: trackByPage;\" [attr.data-auto-id]=\"'pagiantion-page-' + i\"\n (click)=\"navigatePage(page - 1)\">\n {{page}}\n </dato-link>\n\n <div class=\"d-flex\" *ngIf=\"pageNumbersDisplay.showLastPage && !smallVersion\">\n <dato-link class=\"page-number mx-5\" datoType=\"secondary\" datoSize=\"sm\" data-auto-id=\"pagiantion-next-batch\"\n (click)=\"showNextBatch()\">...</dato-link>\n <dato-link class=\"page-number mx-5\" datoType=\"secondary\" datoSize=\"sm\"\n [attr.data-auto-id]=\"'pagiantion-page-' + totalPages\"\n (click)=\"navigatePage(totalPages - 1)\">\n {{totalPages}}\n </dato-link>\n </div>\n\n </div>\n\n <!-- Next Page -->\n <dato-icon-button icon=\"arrow-right\" datoType=\"secondary\" datoSize=\"md\"\n (click)=\"navigateNextPage()\" data-auto-id=\"pagiantion-next-page\"\n [disabled]=\"nextPageDisabled\">\n </dato-icon-button>\n\n <!-- Last Page -->\n <dato-icon-button *ngIf=\"!disableButtons\"\n class=\"ml-4\" icon=\"chevron-right-double\"\n datoType=\"secondary\" datoSize=\"md\" data-auto-id=\"pagiantion-last-page\"\n [disabled]=\"nextPageDisabled\"\n (click)=\"navigatePage(totalPages - 1)\">\n </dato-icon-button>\n\n </div>\n\n <div *ngIf=\"totalPages > 1 && !smallVersion\"\n class=\"separator mx-10 my-auto primary-100-background-color\">\n </div>\n\n <div class=\"total d-flex-0-0-auto d-flex-row align-center\">\n <span class=\"dato-note primary-300-color\">{{rowsRange}}</span>\n </div>\n\n <div *ngIf=\"showBottomControls\" class=\"grid-controls d-flex d-flex-1 justify-end\">\n <dato-icon-button [icon]=\"isExpanded ? 'collapse' : 'expand'\" datoType=\"secondary\" datoSize=\"md\"\n (click)=\"toggleGroupsState()\" data-auto-id=\"pagiantion-next-page\">\n </dato-icon-button>\n\n <dato-icon-button class=\"mx-4\" icon=\"maximize-horizontal\" datoType=\"secondary\" datoSize=\"md\"\n (click)=\"autoFitGrid('container')\" data-auto-id=\"pagiantion-next-page\">\n </dato-icon-button>\n\n <dato-icon-button icon=\"minimize-horizontal\" datoType=\"secondary\" datoSize=\"md\"\n (click)=\"autoFitGrid('content')\" data-auto-id=\"pagiantion-next-page\">\n </dato-icon-button>\n </div>\n</div>\n",
|
|
16236
16516
|
providers: [common.DecimalPipe],
|
|
16237
16517
|
styles: [":host{padding:12px 0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;min-height:25px}:host .container{height:25px}:host .navigation .page-number{transition:color .3s ease-in-out}:host .navigation .page-number:first-of-type{margin-left:7px}:host .navigation .page-number:last-of-type{margin-right:7px}:host .separator{width:1px;height:25px}:host .container.small .navigation,:host .container.small .total{margin-top:8px;margin-left:auto;margin-right:auto}"]
|
|
16238
16518
|
}),
|
|
@@ -25387,6 +25667,7 @@
|
|
|
25387
25667
|
exports.inView = inView;
|
|
25388
25668
|
exports.intersection = intersection;
|
|
25389
25669
|
exports.invert = invert;
|
|
25670
|
+
exports.isArrayValuesEqual = isArrayValuesEqual;
|
|
25390
25671
|
exports.isArrowUpDown = isArrowUpDown;
|
|
25391
25672
|
exports.isBoolean = isBoolean;
|
|
25392
25673
|
exports.isEmpty = isEmpty;
|
|
@@ -25465,6 +25746,7 @@
|
|
|
25465
25746
|
exports.toString = toString;
|
|
25466
25747
|
exports.toggleClass = toggleClass;
|
|
25467
25748
|
exports.toolbarActionToContextAction = toolbarActionToContextAction;
|
|
25749
|
+
exports.tryParsePivotValue = tryParsePivotValue;
|
|
25468
25750
|
exports.unescape = unescape;
|
|
25469
25751
|
exports.union = union;
|
|
25470
25752
|
exports.uniq = uniq;
|