@datorama/core 22.2.0 → 22.2.5
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 +3 -4
- package/bundles/datorama-core.umd.js +46 -46
- package/bundles/datorama-core.umd.js.map +1 -1
- package/bundles/datorama-core.umd.min.js +4 -4
- 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.types.js +1 -1
- package/esm2015/lib/grid-v2/grid-controller/grid-controller.component.js +5 -13
- package/esm2015/lib/grid-v2/grid-filter/grid-filter.types.js +1 -1
- package/esm2015/lib/grid-v2/grid-pagination/grid-pagination.component.js +5 -2
- package/esm2015/lib/grid-v2/grid-store/grid.query.js +18 -10
- package/esm2015/lib/grid-v2/grid-store/grid.service.js +21 -23
- package/esm2015/lib/version.js +2 -2
- package/esm5/lib/grid-v2/grid/grid-v2.types.js +1 -1
- package/esm5/lib/grid-v2/grid-controller/grid-controller.component.js +5 -13
- package/esm5/lib/grid-v2/grid-filter/grid-filter.types.js +1 -1
- package/esm5/lib/grid-v2/grid-pagination/grid-pagination.component.js +5 -2
- package/esm5/lib/grid-v2/grid-store/grid.query.js +18 -10
- package/esm5/lib/grid-v2/grid-store/grid.service.js +21 -24
- package/esm5/lib/version.js +2 -2
- package/fesm2015/datorama-core.js +46 -45
- package/fesm2015/datorama-core.js.map +1 -1
- package/fesm5/datorama-core.js +46 -46
- package/fesm5/datorama-core.js.map +1 -1
- package/lib/grid-v2/grid/grid-v2.types.d.ts +8 -2
- package/lib/grid-v2/grid-controller/grid-controller.component.d.ts +2 -4
- package/lib/grid-v2/grid-filter/grid-filter.types.d.ts +0 -1
- package/lib/grid-v2/grid-pagination/grid-pagination.component.d.ts +1 -0
- package/lib/grid-v2/grid-store/grid.query.d.ts +1 -1
- package/lib/grid-v2/grid-store/grid.service.d.ts +1 -1
- package/package.json +1 -1
package/fesm5/datorama-core.js
CHANGED
|
@@ -11384,13 +11384,19 @@ var GridQuery = /** @class */ (function (_super) {
|
|
|
11384
11384
|
if (this.gridRef.gridOptions.pivotMode) {
|
|
11385
11385
|
var _a = this.api.grid.getSortModel().pop() || {}, sort = _a.sort, colId = _a.colId;
|
|
11386
11386
|
var column = this.api.columns.getColumn(colId);
|
|
11387
|
+
var allColumns = this.api.columns.getAllGridColumns();
|
|
11387
11388
|
if (column) {
|
|
11388
|
-
return { colId: colId, sort: sort,
|
|
11389
|
+
return { colId: colId, sort: sort, field: getColField(column.getColDef()), sortIndex: allColumns.indexOf(column) };
|
|
11389
11390
|
}
|
|
11390
11391
|
else {
|
|
11391
11392
|
var secondaryColumn = this.getSecondaryColumn(colId);
|
|
11392
11393
|
if (secondaryColumn) {
|
|
11393
|
-
return {
|
|
11394
|
+
return {
|
|
11395
|
+
colId: colId,
|
|
11396
|
+
sort: sort,
|
|
11397
|
+
field: getColField(secondaryColumn.getColDef()),
|
|
11398
|
+
sortIndex: allColumns.indexOf(secondaryColumn)
|
|
11399
|
+
};
|
|
11394
11400
|
}
|
|
11395
11401
|
}
|
|
11396
11402
|
}
|
|
@@ -11418,16 +11424,18 @@ var GridQuery = /** @class */ (function (_super) {
|
|
|
11418
11424
|
GridQuery.prototype.selectFilter = function () {
|
|
11419
11425
|
return this.select(function (state) { return state.settings.filter; });
|
|
11420
11426
|
};
|
|
11421
|
-
GridQuery.prototype.
|
|
11422
|
-
|
|
11423
|
-
|
|
11424
|
-
|
|
11425
|
-
|
|
11426
|
-
|
|
11427
|
+
GridQuery.prototype.getExternalFilter = function () {
|
|
11428
|
+
var gridFilters = this.getFilter();
|
|
11429
|
+
if (gridFilters) {
|
|
11430
|
+
return Object.keys(gridFilters).reduce(function (filters, field) {
|
|
11431
|
+
var filter = gridFilters[field];
|
|
11432
|
+
if (filter) {
|
|
11433
|
+
filters.push({ field: field, filter: filter });
|
|
11427
11434
|
}
|
|
11428
11435
|
return filters;
|
|
11429
11436
|
}, []);
|
|
11430
|
-
}
|
|
11437
|
+
}
|
|
11438
|
+
return [];
|
|
11431
11439
|
};
|
|
11432
11440
|
GridQuery.prototype.getSearchTerm = function () {
|
|
11433
11441
|
return this.getValue().settings.searchTerm;
|
|
@@ -14200,20 +14208,12 @@ var GridService = /** @class */ (function () {
|
|
|
14200
14208
|
};
|
|
14201
14209
|
GridService.prototype.setGridFilters = function (filters) {
|
|
14202
14210
|
var e_2, _a;
|
|
14203
|
-
if (this.api) {
|
|
14211
|
+
if (this.api && filters) {
|
|
14212
|
+
var appliedFilter = {};
|
|
14204
14213
|
try {
|
|
14205
14214
|
for (var filters_1 = __values(filters), filters_1_1 = filters_1.next(); !filters_1_1.done; filters_1_1 = filters_1.next()) {
|
|
14206
|
-
var
|
|
14207
|
-
|
|
14208
|
-
if (column) {
|
|
14209
|
-
this.setColumnFilter(column, filter, false);
|
|
14210
|
-
}
|
|
14211
|
-
else {
|
|
14212
|
-
var secondaryColumn = this.gridQuery.getSecondaryColumn(filter.colId);
|
|
14213
|
-
if (secondaryColumn) {
|
|
14214
|
-
this.setColumnFilter(secondaryColumn, filter, false);
|
|
14215
|
-
}
|
|
14216
|
-
}
|
|
14215
|
+
var _b = filters_1_1.value, filter = _b.filter, field = _b.field;
|
|
14216
|
+
appliedFilter[field] = filter;
|
|
14217
14217
|
}
|
|
14218
14218
|
}
|
|
14219
14219
|
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
@@ -14223,23 +14223,28 @@ var GridService = /** @class */ (function () {
|
|
|
14223
14223
|
}
|
|
14224
14224
|
finally { if (e_2) throw e_2.error; }
|
|
14225
14225
|
}
|
|
14226
|
+
this.updateSettings({ filter: appliedFilter });
|
|
14226
14227
|
this.api.grid.onFilterChanged();
|
|
14227
14228
|
}
|
|
14228
14229
|
};
|
|
14229
|
-
GridService.prototype.setGridSort = function (
|
|
14230
|
-
|
|
14231
|
-
|
|
14232
|
-
|
|
14233
|
-
|
|
14234
|
-
|
|
14230
|
+
GridService.prototype.setGridSort = function (gridSort) {
|
|
14231
|
+
if (this.api && gridSort) {
|
|
14232
|
+
var sort = gridSort.sort, sortIndex = gridSort.sortIndex;
|
|
14233
|
+
if (!isNil(sortIndex)) {
|
|
14234
|
+
var columns = this.api.columns.getAllGridColumns();
|
|
14235
|
+
if (columns) {
|
|
14236
|
+
var column = columns[sortIndex];
|
|
14237
|
+
if (column) {
|
|
14238
|
+
var sortToApply = { colId: column.getColId(), sort: sort };
|
|
14239
|
+
this.updateSettings({ sort: sortToApply });
|
|
14240
|
+
this.api.grid.setSortModel([sortToApply]);
|
|
14241
|
+
}
|
|
14242
|
+
}
|
|
14235
14243
|
}
|
|
14236
14244
|
else {
|
|
14237
|
-
|
|
14238
|
-
|
|
14239
|
-
secondaryColumn.setSort(sort);
|
|
14240
|
-
}
|
|
14245
|
+
this.updateSettings({ sort: gridSort });
|
|
14246
|
+
this.api.grid.setSortModel([gridSort]);
|
|
14241
14247
|
}
|
|
14242
|
-
this.api.grid.onSortChanged();
|
|
14243
14248
|
}
|
|
14244
14249
|
};
|
|
14245
14250
|
GridService.prototype.updateFilter = function (column, filter) {
|
|
@@ -15357,12 +15362,6 @@ var DatoGridControllerComponent = /** @class */ (function () {
|
|
|
15357
15362
|
DatoGridControllerComponent.prototype.setGridSort = function (sort) {
|
|
15358
15363
|
this.gridService.setGridSort(sort);
|
|
15359
15364
|
};
|
|
15360
|
-
DatoGridControllerComponent.prototype.onFilterChanged = function () {
|
|
15361
|
-
return this.gridQuery.filterChanged();
|
|
15362
|
-
};
|
|
15363
|
-
DatoGridControllerComponent.prototype.onSortChanged = function () {
|
|
15364
|
-
return this.gridQuery.selectSort();
|
|
15365
|
-
};
|
|
15366
15365
|
DatoGridControllerComponent.prototype.getGridIcons = function () {
|
|
15367
15366
|
var moveColumnIcon = "<span class=\"da-grid-icon pointer d-flex column-move\">" + this.iconRegistry.getSvg('move-column') + "</span>";
|
|
15368
15367
|
return {
|
|
@@ -15410,8 +15409,8 @@ var DatoGridControllerComponent = /** @class */ (function () {
|
|
|
15410
15409
|
};
|
|
15411
15410
|
DatoGridControllerComponent.prototype.listenToGridEvents = function (agGrid) {
|
|
15412
15411
|
var _this = this;
|
|
15413
|
-
var columnVisible = agGrid.columnVisible, sortChanged = agGrid.sortChanged, columnRowGroupChanged = agGrid.columnRowGroupChanged, columnPinned = agGrid.columnPinned, dragStopped = agGrid.dragStopped;
|
|
15414
|
-
merge$1(columnVisible, sortChanged, columnRowGroupChanged, columnPinned, dragStopped)
|
|
15412
|
+
var columnVisible = agGrid.columnVisible, sortChanged = agGrid.sortChanged, columnRowGroupChanged = agGrid.columnRowGroupChanged, columnPinned = agGrid.columnPinned, dragStopped = agGrid.dragStopped, filterChanged = agGrid.filterChanged;
|
|
15413
|
+
merge$1(columnVisible, sortChanged, columnRowGroupChanged, columnPinned, dragStopped, filterChanged)
|
|
15415
15414
|
.pipe(
|
|
15416
15415
|
/* Skip the initial sorting event fired by the grid when adding rows */
|
|
15417
15416
|
skip(1), untilDestroyed(this))
|
|
@@ -15420,10 +15419,8 @@ var DatoGridControllerComponent = /** @class */ (function () {
|
|
|
15420
15419
|
var settingsDiff = _this.gridService.getSettingsDiff();
|
|
15421
15420
|
_this.gridService.updateSettings(settingsDiff);
|
|
15422
15421
|
var data = _this.getGridData();
|
|
15423
|
-
_this.onGridChange.emit({
|
|
15424
|
-
|
|
15425
|
-
data: data
|
|
15426
|
-
});
|
|
15422
|
+
_this.onGridChange.emit(__assign(__assign({}, settingsDiff), { filter: _this.gridQuery.getExternalFilter(), type: type,
|
|
15423
|
+
data: data }));
|
|
15427
15424
|
});
|
|
15428
15425
|
};
|
|
15429
15426
|
DatoGridControllerComponent.prototype.listenToStoreSettingsChanges = function () {
|
|
@@ -16095,6 +16092,7 @@ var DatoGridPaginationV2Component = /** @class */ (function () {
|
|
|
16095
16092
|
// Show fit cell content and collapse/expand row groups controls
|
|
16096
16093
|
this.showBottomControls = false;
|
|
16097
16094
|
this.isExpanded = true;
|
|
16095
|
+
this.hasRowGroupColumns = false;
|
|
16098
16096
|
this.isServerSidePagination = false;
|
|
16099
16097
|
// The number of pages displayed in the navigation panel for each view as defined by product.
|
|
16100
16098
|
this.MINI_DISPLAY_LENGTH = 2;
|
|
@@ -16143,8 +16141,10 @@ var DatoGridPaginationV2Component = /** @class */ (function () {
|
|
|
16143
16141
|
});
|
|
16144
16142
|
this.gridQuery.gridReady$
|
|
16145
16143
|
.pipe(tap(function () {
|
|
16144
|
+
var rowGroupColumns = _this.gridQuery.api.columns.getRowGroupColumns();
|
|
16146
16145
|
_this.gridApi = _this.gridQuery.api.grid;
|
|
16147
16146
|
_this.showBottomControls = _this.gridQuery.getGridOptions().showBottomControls;
|
|
16147
|
+
_this.hasRowGroupColumns = rowGroupColumns && rowGroupColumns.length > 0;
|
|
16148
16148
|
}), switchMap(function () {
|
|
16149
16149
|
_this.isServerSidePagination = _this.gridQuery.isServerSide;
|
|
16150
16150
|
return _this.isServerSidePagination ? _this.gridQuery.serverDataLoaded$ : _this.gridQuery.rowDataChanged$;
|
|
@@ -16362,7 +16362,7 @@ var DatoGridPaginationV2Component = /** @class */ (function () {
|
|
|
16362
16362
|
Component({
|
|
16363
16363
|
selector: 'dato-grid-pagination-v2',
|
|
16364
16364
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
16365
|
-
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\"
|
|
16365
|
+
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 *ngIf=\"hasRowGroupColumns\" [icon]=\"isExpanded ? 'collapse' : 'expand'\" datoType=\"secondary\"\n datoSize=\"md\" (click)=\"toggleGroupsState()\" data-auto-id=\"pagination-expand-collapse\"\n [datoTooltipV2]=\"isExpanded ? 'core.collapse-rows' : 'core.expand-rows'\">\n </dato-icon-button>\n\n <dato-icon-button class=\"mx-4\" icon=\"maximize-horizontal\" datoType=\"secondary\" datoSize=\"md\"\n (click)=\"autoFitGrid('content')\" [datoTooltipV2]=\"'core.fit-to-content'\"\n data-auto-id=\"pagination-fit-to-content\">\n </dato-icon-button>\n\n <dato-icon-button icon=\"minimize-horizontal\" datoType=\"secondary\" datoSize=\"md\"\n (click)=\"autoFitGrid('container')\" [datoTooltipV2]=\"'core.fit-to-container'\"\n data-auto-id=\"pagination-fit-to-container\">\n </dato-icon-button>\n </div>\n</div>\n",
|
|
16366
16366
|
providers: [DecimalPipe],
|
|
16367
16367
|
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}"]
|
|
16368
16368
|
}),
|
|
@@ -25183,7 +25183,7 @@ function fixNgLeaks() {
|
|
|
25183
25183
|
};
|
|
25184
25184
|
}
|
|
25185
25185
|
|
|
25186
|
-
window.coreVersion = '22.2.
|
|
25186
|
+
window.coreVersion = '22.2.5';
|
|
25187
25187
|
|
|
25188
25188
|
/**
|
|
25189
25189
|
* @license
|