@c8y/ngx-components 1017.0.244 → 1017.0.246
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/core/data-grid/data-grid.component.d.ts +2 -2
- package/core/data-grid/data-grid.model.d.ts +1 -1
- package/esm2020/core/data-grid/data-grid.component.mjs +16 -7
- package/esm2020/core/data-grid/data-grid.model.mjs +1 -1
- package/fesm2015/c8y-ngx-components.mjs +13 -7
- package/fesm2015/c8y-ngx-components.mjs.map +1 -1
- package/fesm2020/c8y-ngx-components.mjs +15 -6
- package/fesm2020/c8y-ngx-components.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -24274,7 +24274,7 @@ class DataGridComponent {
|
|
|
24274
24274
|
this.reloadConfiguration$
|
|
24275
24275
|
.pipe(switchMap(() => this.configurationStrategy?.getConfig$() ?? of(null)), tap(config => {
|
|
24276
24276
|
this.setColumns(config);
|
|
24277
|
-
this.
|
|
24277
|
+
this.setPageSize(config);
|
|
24278
24278
|
this.triggerLoadData.emit(!!this.infiniteScroll);
|
|
24279
24279
|
}), switchMap(() => this.dataSource.stats$), tap(stats => {
|
|
24280
24280
|
this.createLoadMoreComponent(stats);
|
|
@@ -24287,6 +24287,10 @@ class DataGridComponent {
|
|
|
24287
24287
|
set _rows(rows) {
|
|
24288
24288
|
this.rows = rows || [];
|
|
24289
24289
|
}
|
|
24290
|
+
/** Pagination settings, e.g. allows for setting current page or page size. */
|
|
24291
|
+
set _pagination(pagination) {
|
|
24292
|
+
this.pagination = pagination;
|
|
24293
|
+
}
|
|
24290
24294
|
/** Sets load more mode. */
|
|
24291
24295
|
set _infiniteScroll(infiniteScroll) {
|
|
24292
24296
|
this.infiniteScroll = infiniteScroll;
|
|
@@ -24388,11 +24392,13 @@ class DataGridComponent {
|
|
|
24388
24392
|
this.defaultColumns = this.columns || [];
|
|
24389
24393
|
this.updateColumns();
|
|
24390
24394
|
}
|
|
24391
|
-
|
|
24395
|
+
setPageSize(config) {
|
|
24392
24396
|
if (!!config?.pagination) {
|
|
24393
|
-
this.pagination =
|
|
24397
|
+
this.pagination = {
|
|
24398
|
+
...this.pagination,
|
|
24399
|
+
pageSize: config.pagination.pageSize
|
|
24400
|
+
};
|
|
24394
24401
|
}
|
|
24395
|
-
this.pagination = this.pagination ?? this._pagination;
|
|
24396
24402
|
const pageSize = get(this.pagination, 'pageSize');
|
|
24397
24403
|
if (this.pagination &&
|
|
24398
24404
|
!this.possiblePageSizes.find(possiblePageSize => possiblePageSize === pageSize)) {
|
|
@@ -24533,9 +24539,12 @@ class DataGridComponent {
|
|
|
24533
24539
|
return !!(filterable && (filterPredicate || externalFilterQuery));
|
|
24534
24540
|
}
|
|
24535
24541
|
updatePagination({ itemsPerPage, page }) {
|
|
24542
|
+
const configChanged = this.pagination?.pageSize !== itemsPerPage;
|
|
24536
24543
|
this.pagination = { ...this.pagination, pageSize: itemsPerPage, currentPage: page };
|
|
24537
24544
|
this.loadData();
|
|
24538
|
-
|
|
24545
|
+
if (configChanged) {
|
|
24546
|
+
this.emitConfigChange('pagination');
|
|
24547
|
+
}
|
|
24539
24548
|
this.triggerEvent({ action: PX_ACTIONS.CHANGE_PAGINATION, itemsPerPage, page });
|
|
24540
24549
|
}
|
|
24541
24550
|
clickReload() {
|
|
@@ -24927,7 +24936,7 @@ class DataGridComponent {
|
|
|
24927
24936
|
}))))
|
|
24928
24937
|
.pipe(map((columns) => ({
|
|
24929
24938
|
columns,
|
|
24930
|
-
pagination: this.pagination
|
|
24939
|
+
pagination: { pageSize: this.pagination.pageSize }
|
|
24931
24940
|
})), filter(() => !!this.configurationStrategy), this.trimFilterConfigPipe(), this.trimSortConfigPipe(), this.trimCustomColumnConfigPipe(), this.ignoreColumnOrderPipe(), this.ignoreColumnVisibilityPipe(), concatMap((config) => this.configurationStrategy.saveConfig$(config)), takeUntil(this.unsubscribe$))
|
|
24932
24941
|
.subscribe();
|
|
24933
24942
|
}
|