@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
|
@@ -10099,13 +10099,19 @@ let GridQuery = class GridQuery extends Query {
|
|
|
10099
10099
|
if (this.gridRef.gridOptions.pivotMode) {
|
|
10100
10100
|
const { sort, colId } = this.api.grid.getSortModel().pop() || {};
|
|
10101
10101
|
const column = this.api.columns.getColumn(colId);
|
|
10102
|
+
const allColumns = this.api.columns.getAllGridColumns();
|
|
10102
10103
|
if (column) {
|
|
10103
|
-
return { colId, sort,
|
|
10104
|
+
return { colId, sort, field: getColField(column.getColDef()), sortIndex: allColumns.indexOf(column) };
|
|
10104
10105
|
}
|
|
10105
10106
|
else {
|
|
10106
10107
|
const secondaryColumn = this.getSecondaryColumn(colId);
|
|
10107
10108
|
if (secondaryColumn) {
|
|
10108
|
-
return {
|
|
10109
|
+
return {
|
|
10110
|
+
colId,
|
|
10111
|
+
sort,
|
|
10112
|
+
field: getColField(secondaryColumn.getColDef()),
|
|
10113
|
+
sortIndex: allColumns.indexOf(secondaryColumn)
|
|
10114
|
+
};
|
|
10109
10115
|
}
|
|
10110
10116
|
}
|
|
10111
10117
|
}
|
|
@@ -10133,16 +10139,18 @@ let GridQuery = class GridQuery extends Query {
|
|
|
10133
10139
|
selectFilter() {
|
|
10134
10140
|
return this.select(state => state.settings.filter);
|
|
10135
10141
|
}
|
|
10136
|
-
|
|
10137
|
-
|
|
10138
|
-
|
|
10139
|
-
|
|
10140
|
-
|
|
10141
|
-
|
|
10142
|
+
getExternalFilter() {
|
|
10143
|
+
const gridFilters = this.getFilter();
|
|
10144
|
+
if (gridFilters) {
|
|
10145
|
+
return Object.keys(gridFilters).reduce((filters, field) => {
|
|
10146
|
+
const filter = gridFilters[field];
|
|
10147
|
+
if (filter) {
|
|
10148
|
+
filters.push({ field, filter });
|
|
10142
10149
|
}
|
|
10143
10150
|
return filters;
|
|
10144
10151
|
}, []);
|
|
10145
|
-
}
|
|
10152
|
+
}
|
|
10153
|
+
return [];
|
|
10146
10154
|
}
|
|
10147
10155
|
getSearchTerm() {
|
|
10148
10156
|
return this.getValue().settings.searchTerm;
|
|
@@ -12674,35 +12682,33 @@ let GridService = class GridService {
|
|
|
12674
12682
|
}
|
|
12675
12683
|
}
|
|
12676
12684
|
setGridFilters(filters) {
|
|
12677
|
-
if (this.api) {
|
|
12678
|
-
|
|
12679
|
-
|
|
12680
|
-
|
|
12681
|
-
this.setColumnFilter(column, filter, false);
|
|
12682
|
-
}
|
|
12683
|
-
else {
|
|
12684
|
-
const secondaryColumn = this.gridQuery.getSecondaryColumn(filter.colId);
|
|
12685
|
-
if (secondaryColumn) {
|
|
12686
|
-
this.setColumnFilter(secondaryColumn, filter, false);
|
|
12687
|
-
}
|
|
12688
|
-
}
|
|
12685
|
+
if (this.api && filters) {
|
|
12686
|
+
let appliedFilter = {};
|
|
12687
|
+
for (const { filter, field } of filters) {
|
|
12688
|
+
appliedFilter[field] = filter;
|
|
12689
12689
|
}
|
|
12690
|
+
this.updateSettings({ filter: appliedFilter });
|
|
12690
12691
|
this.api.grid.onFilterChanged();
|
|
12691
12692
|
}
|
|
12692
12693
|
}
|
|
12693
|
-
setGridSort(
|
|
12694
|
-
if (this.api) {
|
|
12695
|
-
const
|
|
12696
|
-
if (
|
|
12697
|
-
|
|
12694
|
+
setGridSort(gridSort) {
|
|
12695
|
+
if (this.api && gridSort) {
|
|
12696
|
+
const { sort, sortIndex } = gridSort;
|
|
12697
|
+
if (!isNil(sortIndex)) {
|
|
12698
|
+
const columns = this.api.columns.getAllGridColumns();
|
|
12699
|
+
if (columns) {
|
|
12700
|
+
const column = columns[sortIndex];
|
|
12701
|
+
if (column) {
|
|
12702
|
+
const sortToApply = { colId: column.getColId(), sort };
|
|
12703
|
+
this.updateSettings({ sort: sortToApply });
|
|
12704
|
+
this.api.grid.setSortModel([sortToApply]);
|
|
12705
|
+
}
|
|
12706
|
+
}
|
|
12698
12707
|
}
|
|
12699
12708
|
else {
|
|
12700
|
-
|
|
12701
|
-
|
|
12702
|
-
secondaryColumn.setSort(sort);
|
|
12703
|
-
}
|
|
12709
|
+
this.updateSettings({ sort: gridSort });
|
|
12710
|
+
this.api.grid.setSortModel([gridSort]);
|
|
12704
12711
|
}
|
|
12705
|
-
this.api.grid.onSortChanged();
|
|
12706
12712
|
}
|
|
12707
12713
|
}
|
|
12708
12714
|
updateFilter(column, filter) {
|
|
@@ -13722,12 +13728,6 @@ let DatoGridControllerComponent = class DatoGridControllerComponent {
|
|
|
13722
13728
|
setGridSort(sort) {
|
|
13723
13729
|
this.gridService.setGridSort(sort);
|
|
13724
13730
|
}
|
|
13725
|
-
onFilterChanged() {
|
|
13726
|
-
return this.gridQuery.filterChanged();
|
|
13727
|
-
}
|
|
13728
|
-
onSortChanged() {
|
|
13729
|
-
return this.gridQuery.selectSort();
|
|
13730
|
-
}
|
|
13731
13731
|
getGridIcons() {
|
|
13732
13732
|
const moveColumnIcon = `<span class="da-grid-icon pointer d-flex column-move">${this.iconRegistry.getSvg('move-column')}</span>`;
|
|
13733
13733
|
return {
|
|
@@ -13766,8 +13766,8 @@ let DatoGridControllerComponent = class DatoGridControllerComponent {
|
|
|
13766
13766
|
});
|
|
13767
13767
|
}
|
|
13768
13768
|
listenToGridEvents(agGrid) {
|
|
13769
|
-
const { columnVisible, sortChanged, columnRowGroupChanged, columnPinned, dragStopped } = agGrid;
|
|
13770
|
-
merge$1(columnVisible, sortChanged, columnRowGroupChanged, columnPinned, dragStopped)
|
|
13769
|
+
const { columnVisible, sortChanged, columnRowGroupChanged, columnPinned, dragStopped, filterChanged } = agGrid;
|
|
13770
|
+
merge$1(columnVisible, sortChanged, columnRowGroupChanged, columnPinned, dragStopped, filterChanged)
|
|
13771
13771
|
.pipe(
|
|
13772
13772
|
/* Skip the initial sorting event fired by the grid when adding rows */
|
|
13773
13773
|
skip(1), untilDestroyed(this))
|
|
@@ -13775,10 +13775,8 @@ let DatoGridControllerComponent = class DatoGridControllerComponent {
|
|
|
13775
13775
|
const settingsDiff = this.gridService.getSettingsDiff();
|
|
13776
13776
|
this.gridService.updateSettings(settingsDiff);
|
|
13777
13777
|
const data = this.getGridData();
|
|
13778
|
-
this.onGridChange.emit({
|
|
13779
|
-
|
|
13780
|
-
data
|
|
13781
|
-
});
|
|
13778
|
+
this.onGridChange.emit(Object.assign(Object.assign({}, settingsDiff), { filter: this.gridQuery.getExternalFilter(), type,
|
|
13779
|
+
data }));
|
|
13782
13780
|
});
|
|
13783
13781
|
}
|
|
13784
13782
|
listenToStoreSettingsChanges() {
|
|
@@ -14371,6 +14369,7 @@ let DatoGridPaginationV2Component = class DatoGridPaginationV2Component {
|
|
|
14371
14369
|
// Show fit cell content and collapse/expand row groups controls
|
|
14372
14370
|
this.showBottomControls = false;
|
|
14373
14371
|
this.isExpanded = true;
|
|
14372
|
+
this.hasRowGroupColumns = false;
|
|
14374
14373
|
this.isServerSidePagination = false;
|
|
14375
14374
|
// The number of pages displayed in the navigation panel for each view as defined by product.
|
|
14376
14375
|
this.MINI_DISPLAY_LENGTH = 2;
|
|
@@ -14406,8 +14405,10 @@ let DatoGridPaginationV2Component = class DatoGridPaginationV2Component {
|
|
|
14406
14405
|
});
|
|
14407
14406
|
this.gridQuery.gridReady$
|
|
14408
14407
|
.pipe(tap(() => {
|
|
14408
|
+
const rowGroupColumns = this.gridQuery.api.columns.getRowGroupColumns();
|
|
14409
14409
|
this.gridApi = this.gridQuery.api.grid;
|
|
14410
14410
|
this.showBottomControls = this.gridQuery.getGridOptions().showBottomControls;
|
|
14411
|
+
this.hasRowGroupColumns = rowGroupColumns && rowGroupColumns.length > 0;
|
|
14411
14412
|
}), switchMap(() => {
|
|
14412
14413
|
this.isServerSidePagination = this.gridQuery.isServerSide;
|
|
14413
14414
|
return this.isServerSidePagination ? this.gridQuery.serverDataLoaded$ : this.gridQuery.rowDataChanged$;
|
|
@@ -14620,7 +14621,7 @@ DatoGridPaginationV2Component = __decorate([
|
|
|
14620
14621
|
Component({
|
|
14621
14622
|
selector: 'dato-grid-pagination-v2',
|
|
14622
14623
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
14623
|
-
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\"
|
|
14624
|
+
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",
|
|
14624
14625
|
providers: [DecimalPipe],
|
|
14625
14626
|
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}"]
|
|
14626
14627
|
}),
|
|
@@ -22645,7 +22646,7 @@ function fixNgLeaks() {
|
|
|
22645
22646
|
};
|
|
22646
22647
|
}
|
|
22647
22648
|
|
|
22648
|
-
window.coreVersion = '22.2.
|
|
22649
|
+
window.coreVersion = '22.2.5';
|
|
22649
22650
|
|
|
22650
22651
|
/**
|
|
22651
22652
|
* @license
|