@genesislcap/grid-pro 14.501.0 → 15.0.0-FUI-2567.2
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/dist/custom-elements.json +1069 -1673
- package/dist/dts/datasource/base.datasource.d.ts +0 -1
- package/dist/dts/datasource/base.datasource.d.ts.map +1 -1
- package/dist/dts/datasource/base.types.d.ts +0 -1
- package/dist/dts/datasource/base.types.d.ts.map +1 -1
- package/dist/dts/datasource/client-side.datasource.d.ts +1 -1
- package/dist/dts/datasource/server-side.datasource.d.ts +1 -2
- package/dist/dts/datasource/server-side.datasource.d.ts.map +1 -1
- package/dist/dts/datasource/server-side.resource-base.d.ts +1 -10
- package/dist/dts/datasource/server-side.resource-base.d.ts.map +1 -1
- package/dist/dts/datasource/server-side.resource-dataserver.d.ts +1 -2
- package/dist/dts/datasource/server-side.resource-dataserver.d.ts.map +1 -1
- package/dist/dts/datasource/server-side.resource-reqrep.d.ts +2 -2
- package/dist/dts/datasource/server-side.resource-reqrep.d.ts.map +1 -1
- package/dist/dts/grid-pro-beta.d.ts +1 -23
- package/dist/dts/grid-pro-beta.d.ts.map +1 -1
- package/dist/dts/grid-pro-genesis-datasource/datasource-events.types.d.ts +1 -7
- package/dist/dts/grid-pro-genesis-datasource/datasource-events.types.d.ts.map +1 -1
- package/dist/dts/grid-pro-genesis-datasource/grid-pro-genesis-datasource.d.ts +1 -1
- package/dist/dts/grid-pro-genesis-datasource/grid-pro-genesis-datasource.d.ts.map +1 -1
- package/dist/dts/grid-pro.d.ts +1 -23
- package/dist/dts/grid-pro.d.ts.map +1 -1
- package/dist/dts/grid-pro.types.d.ts +0 -1
- package/dist/dts/grid-pro.types.d.ts.map +1 -1
- package/dist/dts/react.d.ts +49 -49
- package/dist/dts/status-bar-components/index.d.ts +0 -1
- package/dist/dts/status-bar-components/index.d.ts.map +1 -1
- package/dist/dts/status-bar-components/load-more.status-bar.d.ts +0 -2
- package/dist/dts/status-bar-components/load-more.status-bar.d.ts.map +1 -1
- package/dist/dts/status-bar-components/row-count.status-bar.d.ts +1 -2
- package/dist/dts/status-bar-components/row-count.status-bar.d.ts.map +1 -1
- package/dist/esm/datasource/base.datasource.js +1 -1
- package/dist/esm/datasource/client-side.datasource.js +1 -1
- package/dist/esm/datasource/server-side.datasource.js +3 -13
- package/dist/esm/datasource/server-side.resource-base.js +1 -26
- package/dist/esm/datasource/server-side.resource-dataserver.js +25 -150
- package/dist/esm/datasource/server-side.resource-reqrep.js +10 -37
- package/dist/esm/grid-pro-beta.js +8 -52
- package/dist/esm/grid-pro-genesis-datasource/grid-pro-genesis-datasource.js +2 -4
- package/dist/esm/grid-pro.js +8 -52
- package/dist/esm/grid-pro.types.js +0 -1
- package/dist/esm/status-bar-components/index.js +0 -1
- package/dist/esm/status-bar-components/load-more.status-bar.js +5 -19
- package/dist/esm/status-bar-components/row-count.status-bar.js +1 -2
- package/dist/grid-pro.api.json +12 -430
- package/dist/grid-pro.d.ts +7 -96
- package/dist/react.cjs +30 -30
- package/dist/react.mjs +25 -25
- package/package.json +14 -14
- package/dist/dts/status-bar-components/pagination.status-bar.d.ts +0 -32
- package/dist/dts/status-bar-components/pagination.status-bar.d.ts.map +0 -1
- package/dist/esm/status-bar-components/pagination.status-bar.js +0 -238
|
@@ -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
|
-
}
|