@genesislcap/grid-pro 14.501.0 → 15.0.0

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.
Files changed (50) hide show
  1. package/dist/custom-elements.json +14 -618
  2. package/dist/dts/datasource/base.datasource.d.ts +0 -1
  3. package/dist/dts/datasource/base.datasource.d.ts.map +1 -1
  4. package/dist/dts/datasource/base.types.d.ts +0 -1
  5. package/dist/dts/datasource/base.types.d.ts.map +1 -1
  6. package/dist/dts/datasource/client-side.datasource.d.ts +1 -1
  7. package/dist/dts/datasource/server-side.datasource.d.ts +1 -2
  8. package/dist/dts/datasource/server-side.datasource.d.ts.map +1 -1
  9. package/dist/dts/datasource/server-side.resource-base.d.ts +1 -10
  10. package/dist/dts/datasource/server-side.resource-base.d.ts.map +1 -1
  11. package/dist/dts/datasource/server-side.resource-dataserver.d.ts +1 -2
  12. package/dist/dts/datasource/server-side.resource-dataserver.d.ts.map +1 -1
  13. package/dist/dts/datasource/server-side.resource-reqrep.d.ts +2 -2
  14. package/dist/dts/datasource/server-side.resource-reqrep.d.ts.map +1 -1
  15. package/dist/dts/grid-pro-beta.d.ts +1 -23
  16. package/dist/dts/grid-pro-beta.d.ts.map +1 -1
  17. package/dist/dts/grid-pro-genesis-datasource/datasource-events.types.d.ts +1 -7
  18. package/dist/dts/grid-pro-genesis-datasource/datasource-events.types.d.ts.map +1 -1
  19. package/dist/dts/grid-pro-genesis-datasource/grid-pro-genesis-datasource.d.ts +1 -1
  20. package/dist/dts/grid-pro-genesis-datasource/grid-pro-genesis-datasource.d.ts.map +1 -1
  21. package/dist/dts/grid-pro.d.ts +1 -23
  22. package/dist/dts/grid-pro.d.ts.map +1 -1
  23. package/dist/dts/grid-pro.types.d.ts +0 -1
  24. package/dist/dts/grid-pro.types.d.ts.map +1 -1
  25. package/dist/dts/react.d.ts +4 -4
  26. package/dist/dts/status-bar-components/index.d.ts +0 -1
  27. package/dist/dts/status-bar-components/index.d.ts.map +1 -1
  28. package/dist/dts/status-bar-components/load-more.status-bar.d.ts +0 -2
  29. package/dist/dts/status-bar-components/load-more.status-bar.d.ts.map +1 -1
  30. package/dist/dts/status-bar-components/row-count.status-bar.d.ts +1 -2
  31. package/dist/dts/status-bar-components/row-count.status-bar.d.ts.map +1 -1
  32. package/dist/esm/datasource/base.datasource.js +1 -1
  33. package/dist/esm/datasource/client-side.datasource.js +1 -1
  34. package/dist/esm/datasource/server-side.datasource.js +3 -13
  35. package/dist/esm/datasource/server-side.resource-base.js +1 -26
  36. package/dist/esm/datasource/server-side.resource-dataserver.js +25 -150
  37. package/dist/esm/datasource/server-side.resource-reqrep.js +10 -37
  38. package/dist/esm/grid-pro-beta.js +8 -52
  39. package/dist/esm/grid-pro-genesis-datasource/grid-pro-genesis-datasource.js +2 -4
  40. package/dist/esm/grid-pro.js +8 -52
  41. package/dist/esm/grid-pro.types.js +0 -1
  42. package/dist/esm/status-bar-components/index.js +0 -1
  43. package/dist/esm/status-bar-components/load-more.status-bar.js +5 -19
  44. package/dist/esm/status-bar-components/row-count.status-bar.js +1 -2
  45. package/dist/grid-pro.api.json +12 -430
  46. package/dist/grid-pro.d.ts +7 -96
  47. package/package.json +14 -14
  48. package/dist/dts/status-bar-components/pagination.status-bar.d.ts +0 -32
  49. package/dist/dts/status-bar-components/pagination.status-bar.d.ts.map +0 -1
  50. package/dist/esm/status-bar-components/pagination.status-bar.js +0 -238
@@ -721,7 +721,7 @@ export declare interface DatasourceEvent<T = DatasourceEventDetail> extends Cust
721
721
  /**
722
722
  * Union type for all datasource event details
723
723
  */
724
- export declare type DatasourceEventDetail = InitializeEventDetail | DataLoadedEventDetail | DataChangedEventDetail | SchemaUpdatedEventDetail | MoreDataAvailableEventDetail | SizeChangedEventDetail | DataClearedEventDetail | DatasourceErrorEventDetail | DatasourceReadyEventDetail | RefreshServerSideEventDetail | GridCssClassEventDetail;
724
+ export declare type DatasourceEventDetail = InitializeEventDetail | DataLoadedEventDetail | DataChangedEventDetail | SchemaUpdatedEventDetail | MoreDataAvailableEventDetail | SizeChangedEventDetail | DataClearedEventDetail | DatasourceErrorEventDetail | RefreshServerSideEventDetail | GridCssClassEventDetail;
725
725
 
726
726
  /**
727
727
  * Event names for datasource-grid communication
@@ -750,13 +750,6 @@ export declare const datasourceEventNames: {
750
750
  readonly applyServerSideTransaction: "apply-server-side-transaction";
751
751
  };
752
752
 
753
- /**
754
- * Event detail for the host grid signalling that the datasource may start loading data.
755
- */
756
- export declare interface DatasourceReadyEventDetail {
757
- pagination: boolean;
758
- }
759
-
760
753
  /**
761
754
  * Available datasource types
762
755
  * @remarks - This type is used to define what kind of datasource will be used in components like entity manager.
@@ -2219,27 +2212,6 @@ export declare class GridPro extends GridPro_base {
2219
2212
  gridComponents: {
2220
2213
  [componentName: string]: any;
2221
2214
  };
2222
- /**
2223
- * Enable pagination for the grid.
2224
- * @remarks
2225
- * When enabled, the grid will automatically configure pagination settings.
2226
- * Note that AG Grid's full pagination functionality requires the Enterprise module.
2227
- * While basic pagination will work in Community edition, advanced features like
2228
- * custom pagination components require Enterprise.
2229
- * @see https://www.ag-grid.com/javascript-data-grid/row-pagination/
2230
- * @see https://www.ag-grid.com/javascript-data-grid/server-side-model-pagination/
2231
- */
2232
- pagination: boolean;
2233
- /**
2234
- * Number of rows per page when pagination is enabled.
2235
- * @remarks
2236
- * **Default Value:** `DatasourceDefaults.DEFAULT_PAGINATION_PAGE_SIZE (25)` (default MAX_ROWS divided by 10)
2237
- *
2238
- * **Only used when pagination is enabled on client-side, server-side pagination page size is fixed to MAX_ROWS.**
2239
- *
2240
- * Note that AG Grid's full pagination functionality requires the Enterprise module.
2241
- */
2242
- paginationPageSize: number;
2243
2215
  /**
2244
2216
  * Configuration for the grid status bar components.
2245
2217
  * @remarks
@@ -2535,8 +2507,7 @@ export declare class GridPro extends GridPro_base {
2535
2507
  private addMaxRowsPanel;
2536
2508
  private addAggregationPanel;
2537
2509
  private addDatasourcePanels;
2538
- private addPaginationPanel;
2539
- protected setupPaginationAndStatusBar(gridOptions: GridOptions): void;
2510
+ protected setupStatusBar(gridOptions: GridOptions): void;
2540
2511
  /**
2541
2512
  * Handles column sizing based on sizeColumnsToContent and sizeColumnsToFit attributes
2542
2513
  * @private
@@ -2967,7 +2938,6 @@ export declare class GridProBaseDatasource extends GenesisGridDatasourceElement
2967
2938
  * @returns The mapped transaction (if the row data mapper function exists), or the original transaction.
2968
2939
  */
2969
2940
  private mapTransaction;
2970
- protected pagination: boolean;
2971
2941
  loadMore(): void;
2972
2942
  /**
2973
2943
  * Notifies the datasource of the field names of the currently visible columns.
@@ -3079,27 +3049,6 @@ export declare class GridProBeta extends GridProBeta_base {
3079
3049
  gridComponents: {
3080
3050
  [componentName: string]: any;
3081
3051
  };
3082
- /**
3083
- * Enable pagination for the grid.
3084
- * @remarks
3085
- * When enabled, the grid will automatically configure pagination settings.
3086
- * Note that AG Grid's full pagination functionality requires the Enterprise module.
3087
- * While basic pagination will work in Community edition, advanced features like
3088
- * custom pagination components require Enterprise.
3089
- * @see https://www.ag-grid.com/javascript-data-grid/row-pagination/
3090
- * @see https://www.ag-grid.com/javascript-data-grid/server-side-model-pagination/
3091
- */
3092
- pagination: boolean;
3093
- /**
3094
- * Number of rows per page when pagination is enabled.
3095
- * @remarks
3096
- * **Default Value:** `DatasourceDefaults.DEFAULT_PAGINATION_PAGE_SIZE (25)` (default MAX_ROWS divided by 10)
3097
- *
3098
- * **Only used when pagination is enabled on client-side, server-side pagination page size is fixed to MAX_ROWS.**
3099
- *
3100
- * Note that AG Grid's full pagination functionality requires the Enterprise module.
3101
- */
3102
- paginationPageSize: number;
3103
3052
  /**
3104
3053
  * Configuration for the grid status bar components.
3105
3054
  * @remarks
@@ -3545,8 +3494,7 @@ export declare class GridProBeta extends GridProBeta_base {
3545
3494
  private addMaxRowsPanel;
3546
3495
  private addAggregationPanel;
3547
3496
  private addDatasourcePanels;
3548
- private addPaginationPanel;
3549
- protected setupPaginationAndStatusBar(gridOptions: GridOptions_2): void;
3497
+ protected setupStatusBar(gridOptions: GridOptions_2): void;
3550
3498
  get observedAttributes(): string[];
3551
3499
  agAttributeChangedCallback(attName: any, oldValue: any, newValue: any): void;
3552
3500
  globalEventListener(eventType: any, event: any): void;
@@ -3973,7 +3921,7 @@ export declare class GridProCell extends FoundationElement implements ICellRende
3973
3921
  * @fires datasource-data-loaded - Fired when a data payload is loaded for the grid. detail: `DataLoadedEventDetail`
3974
3922
  * @fires datasource-loading-started - Fired when a load or refresh starts
3975
3923
  * @fires datasource-more-data-available - Fired when more server rows can be requested. detail: `MoreDataAvailableEventDetail`
3976
- * @fires datasource-ready - Fired when the host grid is ready (detail includes pagination state). detail: `DatasourceReadyEventDetail`
3924
+ * @fires datasource-ready - Fired when the host grid is ready to start loading data
3977
3925
  * @fires datasource-init - Fired when initial grid data is ready for the client-side model
3978
3926
  * @fires more-rows-changed - Fired when MORE_ROWS availability changes. detail: `MoreRowsDetail`
3979
3927
  * @fires datasource-size-changed - Fired when layout or viewport sizing affects the datasource. detail: `GrigProGenesisDatasourceSizeChangedEventDetail`
@@ -4440,7 +4388,7 @@ export declare type GridProEventsListeners = [string, (event: Event) => void][];
4440
4388
  * @fires datasource-data-loaded - Fired when a data payload is loaded for the grid. detail: `DataLoadedEventDetail`
4441
4389
  * @fires datasource-loading-started - Fired when a load or refresh starts
4442
4390
  * @fires datasource-more-data-available - Fired when more server rows can be requested. detail: `MoreDataAvailableEventDetail`
4443
- * @fires datasource-ready - Fired when the host grid is ready (detail includes pagination state). detail: `DatasourceReadyEventDetail`
4391
+ * @fires datasource-ready - Fired when the host grid is ready to start loading data
4444
4392
  * @fires datasource-init - Fired when initial grid data is ready for the client-side model
4445
4393
  * @fires more-rows-changed - Fired when MORE_ROWS availability changes. detail: `MoreRowsDetail`
4446
4394
  * @fires datasource-size-changed - Fired when layout or viewport sizing affects the datasource. detail: `GrigProGenesisDatasourceSizeChangedEventDetail`
@@ -5054,7 +5002,7 @@ export declare enum GridProRendererTypes {
5054
5002
  * @fires datasource-filters-restored - Fired when persisted filters are reapplied
5055
5003
  * @fires datasource-data-cleared - Fired when server-side row data is cleared. detail: `DataClearedEventDetail`
5056
5004
  * @fires apply-server-side-transaction - Fired to apply a server-side row transaction
5057
- * @fires datasource-ready - Fired when the host grid is ready (detail includes pagination state). detail: `DatasourceReadyEventDetail`
5005
+ * @fires datasource-ready - Fired when the host grid is ready to start loading data
5058
5006
  */
5059
5007
  export declare class GridProServerSideDatasource extends GridProServerSideDatasource_base {
5060
5008
  serializer: JSONSerializer;
@@ -5104,7 +5052,6 @@ export declare class GridProServerSideDatasource extends GridProServerSideDataso
5104
5052
  */
5105
5053
  private removeServerSideSortIndicatorStyling;
5106
5054
  init(): Promise<void>;
5107
- onPaginationChanged(event: any): void;
5108
5055
  destroy(): Promise<void>;
5109
5056
  restart(): Promise<void>;
5110
5057
  private clearRowData;
@@ -5649,7 +5596,6 @@ export declare interface GridProStatusBarReloadConfig {
5649
5596
  */
5650
5597
  export declare enum GridProStatusBarTypes {
5651
5598
  labelValue = "labelValue",
5652
- pagination = "pagination",
5653
5599
  loadMore = "loadMore",
5654
5600
  reload = "reload",
5655
5601
  rowCount = "rowCount"
@@ -5843,8 +5789,6 @@ export declare class LoadMoreStatusBarComponent implements IStatusPanelComp {
5843
5789
  private params;
5844
5790
  private designSystemPrefix;
5845
5791
  private isLoading;
5846
- private isLeftAligned;
5847
- private gridApi;
5848
5792
  private clickHandler;
5849
5793
  init(params: IStatusPanelParams): void;
5850
5794
  private createProgressRing;
@@ -6485,37 +6429,6 @@ export declare enum OperationType {
6485
6429
  /** The CSS class to use for the options element's class in the dropdown */
6486
6430
  export declare const optionsClass = "options";
6487
6431
 
6488
- /**
6489
- * Pagination Status Bar Component for AG Grid
6490
- * Displays pagination controls and information about current page and total rows
6491
- * @public
6492
- */
6493
- export declare class PaginationStatusBarComponent implements IStatusPanelComp {
6494
- private element;
6495
- private api;
6496
- private paginationPanel;
6497
- private paginationSummaryPanel;
6498
- private firstPageButton;
6499
- private prevPageButton;
6500
- private descriptionPanel;
6501
- private pageStartDisplay;
6502
- private pageNumberDisplay;
6503
- private pageOfDisplay;
6504
- private pageNumberTotalDisplay;
6505
- private nextPageButton;
6506
- private lastPageButton;
6507
- private paginationChangedHandler;
6508
- init(params: IStatusPanelParams): void;
6509
- getGui(): HTMLElement;
6510
- private createPaginationPanel;
6511
- private addPaginationEventListeners;
6512
- private createPaginationButton;
6513
- private goToPage;
6514
- private updateDisplay;
6515
- private updateButtonState;
6516
- destroy(): void;
6517
- }
6518
-
6519
6432
  /**
6520
6433
  * Available paging modes for server-side datasources
6521
6434
  * @remarks - This type defines the paging approach used for server-side data fetching
@@ -6583,8 +6496,7 @@ export declare function resolveVisibleColumnFields(displayedColumns: DisplayedCo
6583
6496
 
6584
6497
  /**
6585
6498
  * Row Count Status Bar Component for Server-Side Infinite Scroll
6586
- * Displays current row count information for server-side grids without pagination.
6587
- * For pagination scenarios, use PaginationStatusBarComponent instead.
6499
+ * Displays current row count information for server-side grids.
6588
6500
  * @public
6589
6501
  */
6590
6502
  export declare class RowCountStatusBarComponent implements IStatusPanelComp {
@@ -6729,7 +6641,6 @@ export declare type ServerSideDatasourceOptions = {
6729
6641
  maxRows?: number;
6730
6642
  maxView?: number;
6731
6643
  rowId?: string;
6732
- pagination?: boolean;
6733
6644
  zeroBasedViewNumber?: boolean;
6734
6645
  pagingMode?: PagingMode | undefined;
6735
6646
  criteriaOnlyRequest?: boolean;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/grid-pro",
3
3
  "description": "Genesis Foundation AG Grid",
4
- "version": "14.501.0",
4
+ "version": "15.0.0",
5
5
  "sideEffects": false,
6
6
  "license": "SEE LICENSE IN license.txt",
7
7
  "main": "dist/esm/index.js",
@@ -40,20 +40,20 @@
40
40
  }
41
41
  },
42
42
  "devDependencies": {
43
- "@genesislcap/foundation-testing": "14.501.0",
44
- "@genesislcap/genx": "14.501.0",
45
- "@genesislcap/rollup-builder": "14.501.0",
46
- "@genesislcap/ts-builder": "14.501.0",
47
- "@genesislcap/uvu-playwright-builder": "14.501.0",
48
- "@genesislcap/vite-builder": "14.501.0",
49
- "@genesislcap/webpack-builder": "14.501.0"
43
+ "@genesislcap/foundation-testing": "15.0.0",
44
+ "@genesislcap/genx": "15.0.0",
45
+ "@genesislcap/rollup-builder": "15.0.0",
46
+ "@genesislcap/ts-builder": "15.0.0",
47
+ "@genesislcap/uvu-playwright-builder": "15.0.0",
48
+ "@genesislcap/vite-builder": "15.0.0",
49
+ "@genesislcap/webpack-builder": "15.0.0"
50
50
  },
51
51
  "dependencies": {
52
- "@genesislcap/foundation-comms": "14.501.0",
53
- "@genesislcap/foundation-criteria": "14.501.0",
54
- "@genesislcap/foundation-logger": "14.501.0",
55
- "@genesislcap/foundation-ui": "14.501.0",
56
- "@genesislcap/foundation-utils": "14.501.0",
52
+ "@genesislcap/foundation-comms": "15.0.0",
53
+ "@genesislcap/foundation-criteria": "15.0.0",
54
+ "@genesislcap/foundation-logger": "15.0.0",
55
+ "@genesislcap/foundation-ui": "15.0.0",
56
+ "@genesislcap/foundation-utils": "15.0.0",
57
57
  "@microsoft/fast-colors": "5.3.1",
58
58
  "@microsoft/fast-components": "2.30.6",
59
59
  "@microsoft/fast-element": "1.14.0",
@@ -91,5 +91,5 @@
91
91
  "require": "./dist/react.cjs"
92
92
  }
93
93
  },
94
- "gitHead": "4fccf90855cbd10b0289566a75a95120a2be4384"
94
+ "gitHead": "035852ede9f26ea4434f1b3dfaff98db41490246"
95
95
  }
@@ -1,32 +0,0 @@
1
- import { IStatusPanelComp, IStatusPanelParams } from 'ag-grid-community';
2
- /**
3
- * Pagination Status Bar Component for AG Grid
4
- * Displays pagination controls and information about current page and total rows
5
- * @public
6
- */
7
- export declare class PaginationStatusBarComponent implements IStatusPanelComp {
8
- private element;
9
- private api;
10
- private paginationPanel;
11
- private paginationSummaryPanel;
12
- private firstPageButton;
13
- private prevPageButton;
14
- private descriptionPanel;
15
- private pageStartDisplay;
16
- private pageNumberDisplay;
17
- private pageOfDisplay;
18
- private pageNumberTotalDisplay;
19
- private nextPageButton;
20
- private lastPageButton;
21
- private paginationChangedHandler;
22
- init(params: IStatusPanelParams): void;
23
- getGui(): HTMLElement;
24
- private createPaginationPanel;
25
- private addPaginationEventListeners;
26
- private createPaginationButton;
27
- private goToPage;
28
- private updateDisplay;
29
- private updateButtonState;
30
- destroy(): void;
31
- }
32
- //# sourceMappingURL=pagination.status-bar.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pagination.status-bar.d.ts","sourceRoot":"","sources":["../../../src/status-bar-components/pagination.status-bar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAW,MAAM,mBAAmB,CAAC;AAElF;;;;GAIG;AACH,qBAAa,4BAA6B,YAAW,gBAAgB;IACnE,OAAO,CAAC,OAAO,CAAc;IAC7B,OAAO,CAAC,GAAG,CAAU;IAGrB,OAAO,CAAC,eAAe,CAAc;IACrC,OAAO,CAAC,sBAAsB,CAAc;IAC5C,OAAO,CAAC,eAAe,CAAc;IACrC,OAAO,CAAC,cAAc,CAAc;IACpC,OAAO,CAAC,gBAAgB,CAAc;IACtC,OAAO,CAAC,gBAAgB,CAAc;IACtC,OAAO,CAAC,iBAAiB,CAAc;IACvC,OAAO,CAAC,aAAa,CAAc;IACnC,OAAO,CAAC,sBAAsB,CAAc;IAC5C,OAAO,CAAC,cAAc,CAAc;IACpC,OAAO,CAAC,cAAc,CAAc;IAEpC,OAAO,CAAC,wBAAwB,CAAa;IAE7C,IAAI,CAAC,MAAM,EAAE,kBAAkB;IAwB/B,MAAM;IAIN,OAAO,CAAC,qBAAqB;IA8G7B,OAAO,CAAC,2BAA2B;IAqCnC,OAAO,CAAC,sBAAsB;IA0B9B,OAAO,CAAC,QAAQ;IAiBhB,OAAO,CAAC,aAAa;IA8DrB,OAAO,CAAC,iBAAiB;IAYzB,OAAO;CASR"}
@@ -1,238 +0,0 @@
1
- /**
2
- * Pagination Status Bar Component for AG Grid
3
- * Displays pagination controls and information about current page and total rows
4
- * @public
5
- */
6
- export class PaginationStatusBarComponent {
7
- init(params) {
8
- this.api = params.api;
9
- this.element = document.createElement('div');
10
- this.element.className = 'ag-status-panel';
11
- this.element.setAttribute('data-test-id', 'grid-pagination-panel');
12
- this.element.setAttribute('role', 'navigation');
13
- this.element.setAttribute('aria-label', 'Pagination controls');
14
- this.element.style.display = 'flex';
15
- this.element.style.alignItems = 'center';
16
- this.element.style.justifyContent = 'flex-end';
17
- this.element.style.height = 'var(--ag-status-bar-height)';
18
- this.createPaginationPanel();
19
- // Initial update
20
- this.updateDisplay();
21
- // Listen to pagination changes
22
- this.paginationChangedHandler = () => {
23
- this.updateDisplay();
24
- };
25
- this.api.addEventListener('paginationChanged', this.paginationChangedHandler);
26
- }
27
- getGui() {
28
- return this.element;
29
- }
30
- createPaginationPanel() {
31
- // Create the main pagination panel
32
- this.paginationPanel = document.createElement('div');
33
- this.paginationPanel.className = 'ag-paging-panel ag-unselectable';
34
- this.paginationPanel.setAttribute('id', 'ag-pagination-clone');
35
- this.paginationPanel.setAttribute('data-test-id', 'grid-pagination-controls');
36
- // Row summary panel
37
- this.paginationSummaryPanel = document.createElement('span');
38
- this.paginationSummaryPanel.className = 'ag-paging-row-summary-panel';
39
- this.paginationSummaryPanel.setAttribute('role', 'status');
40
- this.paginationSummaryPanel.setAttribute('data-test-id', 'grid-pagination-summary');
41
- this.paginationSummaryPanel.setAttribute('aria-label', 'Row count summary');
42
- // First page button
43
- this.firstPageButton = this.createPaginationButton('btFirst', 'ag-paging-button ag-disabled', 'First Page', true);
44
- this.firstPageButton.setAttribute('data-test-id', 'grid-pagination-first');
45
- // Previous page button
46
- this.prevPageButton = this.createPaginationButton('btPrevious', 'ag-paging-button ag-disabled', 'Previous Page', true);
47
- this.prevPageButton.setAttribute('data-test-id', 'grid-pagination-previous');
48
- // Create the description panel
49
- this.descriptionPanel = document.createElement('span');
50
- this.descriptionPanel.className = 'ag-paging-description';
51
- this.descriptionPanel.setAttribute('role', 'status');
52
- this.descriptionPanel.setAttribute('data-test-id', 'grid-pagination-description');
53
- this.descriptionPanel.setAttribute('aria-label', 'Current page information');
54
- // Page information elements
55
- this.pageStartDisplay = document.createElement('span');
56
- this.pageStartDisplay.className = 'ag-paging-number';
57
- this.pageStartDisplay.setAttribute('id', 'ag-pagination-clone-start-page');
58
- this.pageStartDisplay.setAttribute('data-test-id', 'grid-pagination-page-label');
59
- this.pageStartDisplay.textContent = 'Page';
60
- this.pageNumberDisplay = document.createElement('span');
61
- this.pageNumberDisplay.className = 'ag-paging-number';
62
- this.pageNumberDisplay.setAttribute('id', 'ag-pagination-clone-start-page-number');
63
- this.pageNumberDisplay.setAttribute('ref', 'lbCurrent');
64
- this.pageNumberDisplay.setAttribute('data-test-id', 'grid-pagination-current-page');
65
- this.pageNumberDisplay.setAttribute('aria-label', 'Current page number');
66
- this.pageNumberDisplay.textContent = '1';
67
- this.pageOfDisplay = document.createElement('span');
68
- this.pageOfDisplay.className = 'ag-paging-number';
69
- this.pageOfDisplay.setAttribute('id', 'ag-pagination-clone-of-page');
70
- this.pageOfDisplay.setAttribute('data-test-id', 'grid-pagination-of-label');
71
- this.pageOfDisplay.textContent = 'of';
72
- this.pageNumberTotalDisplay = document.createElement('span');
73
- this.pageNumberTotalDisplay.className = 'ag-paging-number';
74
- this.pageNumberTotalDisplay.setAttribute('id', 'ag-pagination-clone-of-page-number');
75
- this.pageNumberTotalDisplay.setAttribute('ref', 'lbTotal');
76
- this.pageNumberTotalDisplay.setAttribute('data-test-id', 'grid-pagination-total-pages');
77
- this.pageNumberTotalDisplay.setAttribute('aria-label', 'Total number of pages');
78
- this.pageNumberTotalDisplay.textContent = '1';
79
- // Next page button
80
- this.nextPageButton = this.createPaginationButton('btNext', 'ag-paging-button', 'Next Page', false);
81
- this.nextPageButton.setAttribute('data-test-id', 'grid-pagination-next');
82
- // Last page button
83
- this.lastPageButton = this.createPaginationButton('btLast', 'ag-paging-button', 'Last Page', false);
84
- this.lastPageButton.setAttribute('data-test-id', 'grid-pagination-last');
85
- // Assemble the description panel
86
- this.descriptionPanel.appendChild(this.pageStartDisplay);
87
- this.descriptionPanel.appendChild(document.createTextNode(' '));
88
- this.descriptionPanel.appendChild(this.pageNumberDisplay);
89
- this.descriptionPanel.appendChild(document.createTextNode(' '));
90
- this.descriptionPanel.appendChild(this.pageOfDisplay);
91
- this.descriptionPanel.appendChild(document.createTextNode(' '));
92
- this.descriptionPanel.appendChild(this.pageNumberTotalDisplay);
93
- // Assemble the pagination panel
94
- this.paginationPanel.appendChild(this.paginationSummaryPanel);
95
- this.paginationPanel.appendChild(this.firstPageButton);
96
- this.paginationPanel.appendChild(this.prevPageButton);
97
- this.paginationPanel.appendChild(this.descriptionPanel);
98
- this.paginationPanel.appendChild(this.nextPageButton);
99
- this.paginationPanel.appendChild(this.lastPageButton);
100
- // Add to main container
101
- this.element.appendChild(this.paginationPanel);
102
- // Add event listeners with keyboard support
103
- this.addPaginationEventListeners();
104
- }
105
- addPaginationEventListeners() {
106
- // Click event listeners
107
- this.firstPageButton.addEventListener('click', () => this.goToPage('first'));
108
- this.prevPageButton.addEventListener('click', () => this.goToPage('previous'));
109
- this.nextPageButton.addEventListener('click', () => this.goToPage('next'));
110
- this.lastPageButton.addEventListener('click', () => this.goToPage('last'));
111
- // Keyboard event listeners for accessibility
112
- this.firstPageButton.addEventListener('keydown', (event) => {
113
- if (event.key === 'Enter' || event.key === ' ') {
114
- event.preventDefault();
115
- this.goToPage('first');
116
- }
117
- });
118
- this.prevPageButton.addEventListener('keydown', (event) => {
119
- if (event.key === 'Enter' || event.key === ' ') {
120
- event.preventDefault();
121
- this.goToPage('previous');
122
- }
123
- });
124
- this.nextPageButton.addEventListener('keydown', (event) => {
125
- if (event.key === 'Enter' || event.key === ' ') {
126
- event.preventDefault();
127
- this.goToPage('next');
128
- }
129
- });
130
- this.lastPageButton.addEventListener('keydown', (event) => {
131
- if (event.key === 'Enter' || event.key === ' ') {
132
- event.preventDefault();
133
- this.goToPage('last');
134
- }
135
- });
136
- }
137
- createPaginationButton(ref, className, ariaLabel, disabled) {
138
- const button = document.createElement('div');
139
- button.setAttribute('ref', ref);
140
- button.className = className;
141
- button.setAttribute('role', 'button');
142
- button.setAttribute('aria-label', ariaLabel);
143
- button.setAttribute('tabindex', disabled ? '-1' : '0');
144
- if (disabled) {
145
- button.setAttribute('aria-disabled', 'true');
146
- }
147
- const iconSpan = document.createElement('span');
148
- iconSpan.className = `ag-icon ag-icon-${ref.substring(2).toLowerCase()}`;
149
- iconSpan.setAttribute('unselectable', 'on');
150
- iconSpan.setAttribute('role', 'presentation');
151
- button.appendChild(iconSpan);
152
- return button;
153
- }
154
- goToPage(page) {
155
- var _a;
156
- const apiAny = this.api;
157
- const methodMap = {
158
- first: ['paginationGoToFirstPage', 'goToFirstPage'],
159
- previous: ['paginationGoToPreviousPage', 'goToPreviousPage'],
160
- next: ['paginationGoToNextPage', 'goToNextPage'],
161
- last: ['paginationGoToLastPage', 'goToLastPage'],
162
- };
163
- const [directMethod, proxyMethod] = methodMap[page];
164
- if (typeof apiAny[directMethod] === 'function') {
165
- apiAny[directMethod]();
166
- }
167
- else if (typeof ((_a = apiAny.paginationProxy) === null || _a === void 0 ? void 0 : _a[proxyMethod]) === 'function') {
168
- apiAny.paginationProxy[proxyMethod]();
169
- }
170
- }
171
- updateDisplay() {
172
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
173
- // Use compatibility layer for v34 pagination API
174
- const apiAny = this.api;
175
- const currentPage = ((_e = (_b = (_a = apiAny.paginationGetCurrentPage) === null || _a === void 0 ? void 0 : _a.call(apiAny)) !== null && _b !== void 0 ? _b : (_d = (_c = apiAny.paginationProxy) === null || _c === void 0 ? void 0 : _c.getCurrentPage) === null || _d === void 0 ? void 0 : _d.call(_c)) !== null && _e !== void 0 ? _e : 0) + 1; // 1-based for display
176
- const totalPages = (_k = (_g = (_f = apiAny.paginationGetTotalPages) === null || _f === void 0 ? void 0 : _f.call(apiAny)) !== null && _g !== void 0 ? _g : (_j = (_h = apiAny.paginationProxy) === null || _h === void 0 ? void 0 : _h.getTotalPages) === null || _j === void 0 ? void 0 : _j.call(_h)) !== null && _k !== void 0 ? _k : 1;
177
- const pageSize = (_m = (_l = apiAny.paginationGetPageSize) === null || _l === void 0 ? void 0 : _l.call(apiAny)) !== null && _m !== void 0 ? _m : (_p = (_o = apiAny.paginationProxy) === null || _o === void 0 ? void 0 : _o.getPageSize) === null || _p === void 0 ? void 0 : _p.call(_o);
178
- const rowCount = (_r = (_q = apiAny.paginationGetRowCount) === null || _q === void 0 ? void 0 : _q.call(apiAny)) !== null && _r !== void 0 ? _r : (_t = (_s = apiAny.paginationProxy) === null || _s === void 0 ? void 0 : _s.getMasterRowCount) === null || _t === void 0 ? void 0 : _t.call(_s);
179
- // Check if we're in server-side mode and if the total count is uncertain
180
- // Add null checks for test environment compatibility
181
- const isServerSide = ((_x = (_w = (_v = (_u = this.api).getModel) === null || _v === void 0 ? void 0 : _v.call(_u)) === null || _w === void 0 ? void 0 : _w.getType) === null || _x === void 0 ? void 0 : _x.call(_w)) === 'serverSide';
182
- const hasUncertainTotal = isServerSide && apiAny.paginationIsLastPageFound && !apiAny.paginationIsLastPageFound();
183
- // Update the page numbers
184
- this.pageNumberDisplay.textContent = currentPage.toString();
185
- this.pageNumberTotalDisplay.textContent = hasUncertainTotal ? 'more' : totalPages.toString();
186
- // Update accessibility attributes when showing "more"
187
- if (hasUncertainTotal) {
188
- this.pageNumberTotalDisplay.setAttribute('aria-label', 'More pages available');
189
- this.paginationSummaryPanel.setAttribute('aria-label', 'Row count summary with more data available');
190
- }
191
- else {
192
- this.pageNumberTotalDisplay.setAttribute('aria-label', 'Total number of pages');
193
- this.paginationSummaryPanel.setAttribute('aria-label', 'Row count summary');
194
- }
195
- // Update the row summary panel
196
- const startRow = (currentPage - 1) * pageSize + 1;
197
- const endRow = Math.min(currentPage * pageSize, rowCount);
198
- const totalDisplay = hasUncertainTotal ? 'more' : rowCount.toString();
199
- this.paginationSummaryPanel.textContent = `${rowCount > 0 ? startRow : 0} to ${endRow} of ${totalDisplay}`;
200
- // Update button states
201
- const isFirstPage = currentPage === 1;
202
- const isLastPage = hasUncertainTotal ? false : currentPage >= totalPages;
203
- this.updateButtonState(this.firstPageButton, isFirstPage);
204
- this.updateButtonState(this.prevPageButton, isFirstPage);
205
- this.updateButtonState(this.nextPageButton, isLastPage);
206
- // Disable "last page" button when we don't know the total (showing "more")
207
- this.updateButtonState(this.lastPageButton, hasUncertainTotal || isLastPage);
208
- // Update last page button accessibility when uncertain total
209
- if (hasUncertainTotal) {
210
- this.lastPageButton.setAttribute('aria-label', 'Last page unavailable - total number of pages unknown');
211
- this.lastPageButton.setAttribute('title', 'Cannot jump to last page when total is unknown');
212
- }
213
- else {
214
- this.lastPageButton.setAttribute('aria-label', 'Last Page');
215
- this.lastPageButton.removeAttribute('title');
216
- }
217
- }
218
- updateButtonState(button, disabled) {
219
- if (disabled) {
220
- button.classList.add('ag-disabled');
221
- button.setAttribute('aria-disabled', 'true');
222
- button.setAttribute('tabindex', '-1');
223
- }
224
- else {
225
- button.classList.remove('ag-disabled');
226
- button.setAttribute('aria-disabled', 'false');
227
- button.setAttribute('tabindex', '0');
228
- }
229
- }
230
- destroy() {
231
- // Remove event listeners
232
- if (this.api && this.paginationChangedHandler) {
233
- this.api.removeEventListener('paginationChanged', this.paginationChangedHandler);
234
- }
235
- this.api = null;
236
- this.paginationChangedHandler = null;
237
- }
238
- }