@c8y/ngx-components 1018.0.102 → 1018.0.103

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.
@@ -25747,7 +25747,7 @@ class DataGridComponent {
25747
25747
  this.reloadConfiguration$
25748
25748
  .pipe(switchMap(() => this.configurationStrategy?.getConfig$() ?? of(null)), tap(config => {
25749
25749
  this.setColumns(config);
25750
- this.setPagination(config);
25750
+ this.setPageSize(config);
25751
25751
  this.triggerLoadData.emit(!!this.infiniteScroll);
25752
25752
  }), switchMap(() => this.dataSource.stats$), tap(stats => {
25753
25753
  this.createLoadMoreComponent(stats);
@@ -25760,6 +25760,10 @@ class DataGridComponent {
25760
25760
  set _rows(rows) {
25761
25761
  this.rows = rows || [];
25762
25762
  }
25763
+ /** Pagination settings, e.g. allows for setting current page or page size. */
25764
+ set _pagination(pagination) {
25765
+ this.pagination = pagination;
25766
+ }
25763
25767
  /** Sets load more mode. */
25764
25768
  set _infiniteScroll(infiniteScroll) {
25765
25769
  this.infiniteScroll = infiniteScroll;
@@ -25861,11 +25865,13 @@ class DataGridComponent {
25861
25865
  this.defaultColumns = this.columns || [];
25862
25866
  this.updateColumns();
25863
25867
  }
25864
- setPagination(config) {
25868
+ setPageSize(config) {
25865
25869
  if (!!config?.pagination) {
25866
- this.pagination = config.pagination;
25870
+ this.pagination = {
25871
+ ...this.pagination,
25872
+ pageSize: config.pagination.pageSize
25873
+ };
25867
25874
  }
25868
- this.pagination = this.pagination ?? this._pagination;
25869
25875
  const pageSize = get(this.pagination, 'pageSize');
25870
25876
  if (this.pagination &&
25871
25877
  !this.possiblePageSizes.find(possiblePageSize => possiblePageSize === pageSize)) {
@@ -26006,9 +26012,12 @@ class DataGridComponent {
26006
26012
  return !!(filterable && (filterPredicate || externalFilterQuery));
26007
26013
  }
26008
26014
  updatePagination({ itemsPerPage, page }) {
26015
+ const configChanged = this.pagination?.pageSize !== itemsPerPage;
26009
26016
  this.pagination = { ...this.pagination, pageSize: itemsPerPage, currentPage: page };
26010
26017
  this.loadData();
26011
- this.emitConfigChange('pagination');
26018
+ if (configChanged) {
26019
+ this.emitConfigChange('pagination');
26020
+ }
26012
26021
  this.triggerEvent({ action: PX_ACTIONS.CHANGE_PAGINATION, itemsPerPage, page });
26013
26022
  }
26014
26023
  clickReload() {
@@ -26400,7 +26409,7 @@ class DataGridComponent {
26400
26409
  }))))
26401
26410
  .pipe(map((columns) => ({
26402
26411
  columns,
26403
- pagination: this.pagination
26412
+ pagination: { pageSize: this.pagination.pageSize }
26404
26413
  })), filter(() => !!this.configurationStrategy), this.trimFilterConfigPipe(), this.trimSortConfigPipe(), this.trimCustomColumnConfigPipe(), this.ignoreColumnOrderPipe(), this.ignoreColumnVisibilityPipe(), concatMap((config) => this.configurationStrategy.saveConfig$(config)), takeUntil(this.unsubscribe$))
26405
26414
  .subscribe();
26406
26415
  }