@acorex/components 20.2.4 → 20.2.6

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.
@@ -346,22 +346,29 @@ class AXDataPagerNumericSelectorComponent extends AXDataPagerChild {
346
346
  this._lastPage = this._parent.displayInfo.totalPages;
347
347
  //
348
348
  this._items = [];
349
- const start = Math.max(0, (Math.ceil(this._currentPage / this._displayCount) - 1) * this._displayCount + 1);
350
- const end = Math.min(start + this._displayCount - 1, this._lastPage);
351
- //
352
- if (start > this._displayCount) {
349
+ // Calculate the range to center the current page
350
+ const halfDisplayCount = Math.floor(this._displayCount / 2);
351
+ let start = Math.max(1, this._currentPage - halfDisplayCount);
352
+ const end = Math.min(this._lastPage, start + this._displayCount - 1);
353
+ // Adjust start if we're near the end to ensure we show the full display count
354
+ if (end - start + 1 < this._displayCount) {
355
+ start = Math.max(1, end - this._displayCount + 1);
356
+ }
357
+ // Add ellipsis button for previous pages if needed
358
+ if (start > 1) {
353
359
  this._items.push({
354
360
  iconClass: this.rtl ? 'ax-icon-chevron-right' : 'ax-icon-chevron-left',
355
361
  data: start - 1,
356
362
  });
357
363
  }
358
- //
364
+ // Add page number buttons
359
365
  for (let i = start; i <= end; i++) {
360
366
  this._items.push({
361
367
  text: i.toString(),
362
368
  data: i,
363
369
  });
364
370
  }
371
+ // Add ellipsis button for next pages if needed
365
372
  if (end < this._lastPage) {
366
373
  this._items.push({
367
374
  iconClass: this.rtl ? 'ax-icon-chevron-left' : 'ax-icon-chevron-right',
@@ -376,7 +383,12 @@ class AXDataPagerNumericSelectorComponent extends AXDataPagerChild {
376
383
  _handleOnItemClick(e) {
377
384
  if (this._parent.readonly || this._parent.disabled)
378
385
  return;
379
- this._parent.goToPage(Number(e.data));
386
+ if (e.iconClass) {
387
+ this._parent.goNextPage();
388
+ }
389
+ else {
390
+ this._parent.goToPage(Number(e.data));
391
+ }
380
392
  }
381
393
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXDataPagerNumericSelectorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
382
394
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.3", type: AXDataPagerNumericSelectorComponent, isStandalone: true, selector: "ax-data-pager-numeric-selector", providers: [