cypress-ag-grid 3.3.1 → 3.3.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/app/ag-grid.css +6356 -6674
- package/app/ag-theme-alpine.css +562 -322
- package/app/grid-basic.js +23 -16
- package/app/grid-grouped.js +4 -4
- package/app/index.html +6 -2
- package/cypress/e2e/ag-grid-data.cy.js +45 -2
- package/package.json +1 -1
- package/src/agGrid/agGridInteractions.js +45 -27
- package/src/agGrid/filterOperator.enum.js +1 -1
- package/src/index.d.ts +121 -94
package/app/grid-basic.js
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
// specify the columns
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
function getColumnDefs(floatingFilter) {
|
|
3
|
+
return [
|
|
4
|
+
{ field: "year", pinned: "left", floatingFilter },
|
|
5
|
+
{ field: "make", rowGroup: false, pinned: "left", floatingFilter },
|
|
6
|
+
{ field: "model", filter: true, floatingFilter },
|
|
7
|
+
{ field: "condition", filter: "agTextColumnFilter", floatingFilter, filterParams: { numAlwaysVisibleConditions: 2, defaultJoinOperator: 'OR', } },
|
|
8
|
+
{
|
|
9
|
+
field: "price",
|
|
10
|
+
pinned: "right",
|
|
11
|
+
floatingFilter: false,
|
|
12
|
+
sortable: false,
|
|
13
|
+
editable: true,
|
|
14
|
+
cellEditor: "agTextCellEditor",
|
|
15
|
+
},
|
|
16
|
+
];
|
|
17
|
+
}
|
|
16
18
|
|
|
17
19
|
const autoGroupColumnDef = {
|
|
18
20
|
headerName: "Model",
|
|
@@ -38,10 +40,11 @@ const gridOptions = {
|
|
|
38
40
|
},
|
|
39
41
|
autoGroupColumnDef: autoGroupColumnDef,
|
|
40
42
|
groupSelectsChildren: true,
|
|
41
|
-
columnDefs:
|
|
43
|
+
columnDefs: getColumnDefs(true),
|
|
42
44
|
rowSelection: "multiple",
|
|
43
45
|
domLayout: "normal",
|
|
44
46
|
pagination: true,
|
|
47
|
+
paginationPageSizeSelector: [5, 10, 20],
|
|
45
48
|
paginationPageSize: 5,
|
|
46
49
|
sideBar: true,
|
|
47
50
|
};
|
|
@@ -49,6 +52,10 @@ const gridOptions = {
|
|
|
49
52
|
// lookup the container we want the Grid to use
|
|
50
53
|
const eGridDiv = document.querySelector("#myGrid");
|
|
51
54
|
|
|
55
|
+
function MakeFloating(floating) {
|
|
56
|
+
gridOptions.api.setGridOption('columnDefs', getColumnDefs(floating));
|
|
57
|
+
}
|
|
58
|
+
|
|
52
59
|
// create the grid passing in the div to use together with the columns & data we want to use
|
|
53
60
|
new agGrid.Grid(eGridDiv, gridOptions);
|
|
54
61
|
|
|
@@ -61,7 +68,7 @@ fetch("./data.json")
|
|
|
61
68
|
|
|
62
69
|
function autoSizeAllColumns() {
|
|
63
70
|
var allColumnIds = [];
|
|
64
|
-
gridOptions.api.
|
|
71
|
+
gridOptions.api.getColumns().forEach(function (column) {
|
|
65
72
|
allColumnIds.push(column.colId);
|
|
66
73
|
});
|
|
67
74
|
gridOptions.api.autoSizeColumns(allColumnIds);
|
package/app/grid-grouped.js
CHANGED
|
@@ -3,7 +3,7 @@ const columnDefsGrouped = [
|
|
|
3
3
|
{ field: "year", pivot: true, },
|
|
4
4
|
{ field: "make", rowGroup: true, enableRowGroup: true },
|
|
5
5
|
{ field: "model", filter: true },
|
|
6
|
-
{ field: "price", editable: true, cellEditor: 'agTextCellEditor'
|
|
6
|
+
{ field: "price", editable: true, cellEditor: 'agTextCellEditor' },
|
|
7
7
|
];
|
|
8
8
|
|
|
9
9
|
const autoGroupColumnDefGrouped = {
|
|
@@ -54,7 +54,7 @@ fetch("./data.json")
|
|
|
54
54
|
|
|
55
55
|
function autoSizeAllColumns() {
|
|
56
56
|
var allColumnIds = [];
|
|
57
|
-
gridOptionsGrouped.api.
|
|
57
|
+
gridOptionsGrouped.api.getColumns().forEach(function (column) {
|
|
58
58
|
allColumnIds.push(column.colId);
|
|
59
59
|
});
|
|
60
60
|
gridOptionsGrouped.api.autoSizeColumns(allColumnIds);
|
|
@@ -64,6 +64,6 @@ function autoSizeAllColumns() {
|
|
|
64
64
|
if (window.Cypress) {
|
|
65
65
|
gridOptionsGrouped.api.sizeColumnsToFit();
|
|
66
66
|
} else {
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
// Otherwise auto-size columns the way we wish to view the grid in production.
|
|
68
|
+
autoSizeAllColumns();
|
|
69
69
|
}
|
package/app/index.html
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html>
|
|
3
|
+
|
|
3
4
|
<head>
|
|
4
|
-
<script src="https://unpkg.com/ag-grid-enterprise/dist/ag-grid-enterprise.min.noStyle.js"></script>
|
|
5
|
+
<script src="https://unpkg.com/ag-grid-enterprise@32.2.1/dist/ag-grid-enterprise.min.noStyle.js"></script>
|
|
5
6
|
<link rel="stylesheet" href="./ag-grid.css">
|
|
6
7
|
<link rel="stylesheet" href="./ag-theme-alpine.css">
|
|
7
8
|
</head>
|
|
9
|
+
|
|
8
10
|
<body>
|
|
9
11
|
<div id="myGrid" style="height: 600px;width:900px;" class="ag-theme-alpine" sideBar="true"></div>
|
|
10
12
|
<script src="grid-basic.js" type="text/javascript" charset="utf-8"></script>
|
|
11
|
-
|
|
13
|
+
<button onclick="MakeFloating(true)" id="floating">Floating</button>
|
|
14
|
+
<button onclick="MakeFloating(false)" id="nonFloating">Non Floating</button>
|
|
12
15
|
<div id="myGrid2" style="height: 600px;width:900px;" class="ag-theme-alpine" sideBar="true"></div>
|
|
13
16
|
<script src="grid-grouped.js" type="text/javascript" charset="utf-8"></script>
|
|
14
17
|
</body>
|
|
18
|
+
|
|
15
19
|
</html>
|
|
@@ -44,6 +44,7 @@ describe("ag-grid get data scenarios", () => {
|
|
|
44
44
|
beforeEach(() => {
|
|
45
45
|
cy.visit("../app/index.html");
|
|
46
46
|
cy.get(".ag-cell", { timeout: 10000 }).should("be.visible");
|
|
47
|
+
cy.get('#floating').click()
|
|
47
48
|
});
|
|
48
49
|
|
|
49
50
|
it("verify paginated table data - any order - include all columns", () => {
|
|
@@ -113,13 +114,14 @@ describe("ag-grid get data scenarios", () => {
|
|
|
113
114
|
const expectedTableData = [
|
|
114
115
|
{ Year: "2020", Make: "BMW", Model: "2002", Condition: "excellent", Price: "88001" },
|
|
115
116
|
];
|
|
116
|
-
cy.get(agGridSelector).
|
|
117
|
+
cy.get(agGridSelector).agGridColumnFilterTextFloating({
|
|
117
118
|
searchCriteria: {
|
|
118
119
|
columnName: "Model",
|
|
119
120
|
filterValue: "2002",
|
|
120
121
|
},
|
|
121
|
-
selectAllLocaleText: "Select All", // This is optional if you are using localText for ag grid
|
|
122
|
+
selectAllLocaleText: "(Select All)", // This is optional if you are using localText for ag grid
|
|
122
123
|
hasApplyButton: true,
|
|
124
|
+
|
|
123
125
|
});
|
|
124
126
|
cy.get(agGridSelector)
|
|
125
127
|
.getAgGridData()
|
|
@@ -129,6 +131,7 @@ describe("ag-grid get data scenarios", () => {
|
|
|
129
131
|
});
|
|
130
132
|
|
|
131
133
|
it("able to filter by checkbox - multiple columns", () => {
|
|
134
|
+
cy.get('#nonFloating').click()
|
|
132
135
|
const expectedTableData = [
|
|
133
136
|
{ Year: "2020", Make: "BMW", Model: "3-series", Condition: "fair", Price: "45000" },
|
|
134
137
|
{ Year: "2020", Make: "BMW", Model: "3-series", Condition: "poor", Price: "32000" },
|
|
@@ -182,6 +185,7 @@ describe("ag-grid get data scenarios", () => {
|
|
|
182
185
|
});
|
|
183
186
|
|
|
184
187
|
it("able to filter by text - menu - multiple columns", () => {
|
|
188
|
+
cy.get('#nonFloating').click()
|
|
185
189
|
const expectedTableData = [
|
|
186
190
|
{ Year: "2020", Make: "BMW", Model: "3-series", Condition: "poor", Price: "32000" },
|
|
187
191
|
];
|
|
@@ -470,6 +474,45 @@ describe("ag-grid get data scenarios", () => {
|
|
|
470
474
|
|
|
471
475
|
});
|
|
472
476
|
|
|
477
|
+
it("able to filter by 'Not blank'", () => {
|
|
478
|
+
const expectedTableData = [
|
|
479
|
+
{ Year: "2020", Make: "Toyota", Model: "Celica", Condition: "fair", Price: "35000" },
|
|
480
|
+
{ Year: "2020", Make: "Ford", Model: "Mondeo", Condition: "excellent", Price: "32000" },
|
|
481
|
+
{ Year: "2020", Make: "Porsche", Model: "Boxter", Condition: "good", Price: "72000" },
|
|
482
|
+
{ Year: "2020", Make: "BMW", Model: "3-series", Condition: "fair", Price: "45000" },
|
|
483
|
+
{ Year: "2020", Make: "Mercedes", Model: "GLC300", Condition: "good", Price: "53000" },
|
|
484
|
+
{ Year: "2020", Make: "Honda", Model: "Civic", Condition: "poor", Price: "22000" },
|
|
485
|
+
{ Year: "2020", Make: "Honda", Model: "Accord", Condition: "poor", Price: "32000" },
|
|
486
|
+
{ Year: "2020", Make: "Ford", Model: "Taurus", Condition: "excellent", Price: "19000" },
|
|
487
|
+
{ Year: "2020", Make: "Hyundai", Model: "Elantra", Condition: "good", Price: "22000" },
|
|
488
|
+
{ Year: "2020", Make: "Toyota", Model: "Celica", Condition: "poor", Price: "5000" },
|
|
489
|
+
{ Year: "2020", Make: "Ford", Model: "Mondeo", Condition: "good", Price: "25000" },
|
|
490
|
+
{ Year: "2020", Make: "Porsche", Model: "Boxter", Condition: "good", Price: "99000" },
|
|
491
|
+
{ Year: "2020", Make: "BMW", Model: "3-series", Condition: "poor", Price: "32000" },
|
|
492
|
+
{ Year: "2020", Make: "Mercedes", Model: "GLC300", Condition: "excellent", Price: "35000" },
|
|
493
|
+
{ Year: "2011", Make: "Honda", Model: "Civic", Condition: "good", Price: "9000" },
|
|
494
|
+
{ Year: "2020", Make: "Honda", Model: "Accord", Condition: "good", Price: "34000" },
|
|
495
|
+
{ Year: "1990", Make: "Ford", Model: "Taurus", Condition: "excellent", Price: "900" },
|
|
496
|
+
{ Year: "2020", Make: "Hyundai", Model: "Elantra", Condition: "fair", Price: "3000" },
|
|
497
|
+
{ Year: "2020", Make: "BMW", Model: "2002", Condition: "excellent", Price: "88001" }
|
|
498
|
+
]
|
|
499
|
+
|
|
500
|
+
cy.get('.ag-picker-field-display').eq(0).type('{downArrow}{downArrow}{downArrow}{enter}')
|
|
501
|
+
|
|
502
|
+
cy.get(agGridSelector).agGridColumnFilterTextMenu({
|
|
503
|
+
searchCriteria: {
|
|
504
|
+
columnName: "Price",
|
|
505
|
+
operator: filterOperator.notBlank,
|
|
506
|
+
},
|
|
507
|
+
hasApplyButton: true,
|
|
508
|
+
});
|
|
509
|
+
cy.get(agGridSelector)
|
|
510
|
+
.getAgGridData()
|
|
511
|
+
.then((actualTableData) => {
|
|
512
|
+
cy.agGridValidateRowsSubset(actualTableData, expectedTableData);
|
|
513
|
+
});
|
|
514
|
+
});
|
|
515
|
+
|
|
473
516
|
it('able to filter by agTextColumnFilter with join operator', () => {
|
|
474
517
|
const expectedTableData = [
|
|
475
518
|
{ Year: "2020", Make: "Toyota", Model: "Celica", Condition: "fair", Price: "35000" },
|
package/package.json
CHANGED
|
@@ -244,16 +244,22 @@ function getMenuTabElement(agGridElement, tab) {
|
|
|
244
244
|
* @param tab
|
|
245
245
|
*/
|
|
246
246
|
function selectMenuTab(agGridElement, tab) {
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
.
|
|
250
|
-
|
|
251
|
-
.then(($
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
247
|
+
cy.get(agGridElement).then((agGr) => {
|
|
248
|
+
if (agGr.find('.ag-menu-list').length > 0) {
|
|
249
|
+
cy.log('Menu uses a list, not tabs');
|
|
250
|
+
} else {
|
|
251
|
+
getMenuTabElement(agGridElement, tab).then(($ele) => {
|
|
252
|
+
cy.wrap($ele)
|
|
253
|
+
.parent("span")
|
|
254
|
+
.invoke("attr", "class")
|
|
255
|
+
.then(($attr) => {
|
|
256
|
+
if (!$attr.includes("selected")) {
|
|
257
|
+
cy.wrap($ele).click();
|
|
258
|
+
}
|
|
259
|
+
});
|
|
255
260
|
});
|
|
256
|
-
|
|
261
|
+
}
|
|
262
|
+
})
|
|
257
263
|
}
|
|
258
264
|
|
|
259
265
|
/**
|
|
@@ -286,7 +292,7 @@ function getFilterColumnButtonElement(
|
|
|
286
292
|
else
|
|
287
293
|
return getColumnHeaderElement(agGridElement, columnName)
|
|
288
294
|
.parent()
|
|
289
|
-
.siblings(".ag-header-cell-
|
|
295
|
+
.siblings(".ag-header-cell-filter-button");
|
|
290
296
|
}
|
|
291
297
|
|
|
292
298
|
/**
|
|
@@ -303,9 +309,9 @@ function filterBySearchTerm(agGridElement, options) {
|
|
|
303
309
|
const noMenuTabs = options.noMenuTabs;
|
|
304
310
|
|
|
305
311
|
// Navigate to the filter tab
|
|
306
|
-
if (!noMenuTabs) {
|
|
307
|
-
|
|
308
|
-
}
|
|
312
|
+
// if (!noMenuTabs) {
|
|
313
|
+
// selectMenuTab(agGridElement, filterTab.filter);
|
|
314
|
+
// }
|
|
309
315
|
|
|
310
316
|
if (operator) {
|
|
311
317
|
const elem = cy
|
|
@@ -323,15 +329,20 @@ function filterBySearchTerm(agGridElement, options) {
|
|
|
323
329
|
.click();
|
|
324
330
|
}
|
|
325
331
|
// Input filter term and allow grid a moment to render the results
|
|
326
|
-
|
|
327
|
-
.
|
|
328
|
-
.
|
|
329
|
-
|
|
330
|
-
.
|
|
332
|
+
if (
|
|
333
|
+
operator !== filterOperator.blank &&
|
|
334
|
+
operator !== filterOperator.notBlank
|
|
335
|
+
) {
|
|
336
|
+
cy.get(agGridElement)
|
|
337
|
+
.find(".ag-popup-child")
|
|
338
|
+
.find("input")
|
|
339
|
+
.filter(":visible")
|
|
340
|
+
.as("filterInput");
|
|
341
|
+
}
|
|
331
342
|
|
|
332
343
|
// If it's a multi filter, de-select the 'select-all' checkbox
|
|
333
344
|
if (isMultiFilter) {
|
|
334
|
-
const selectAllText = options.selectAllLocaleText || "Select All";
|
|
345
|
+
const selectAllText = options.selectAllLocaleText || "(Select All)";
|
|
335
346
|
toggleColumnCheckboxFilter(agGridElement, selectAllText, false, true);
|
|
336
347
|
}
|
|
337
348
|
|
|
@@ -341,7 +352,7 @@ function filterBySearchTerm(agGridElement, options) {
|
|
|
341
352
|
operator !== filterOperator.notBlank
|
|
342
353
|
) {
|
|
343
354
|
cy.get("@filterInput").then(($ele) => {
|
|
344
|
-
cy.wrap($ele).eq(searchInputIndex).clear().type(filterValue);
|
|
355
|
+
cy.wrap($ele).eq(searchInputIndex).clear().type(filterValue + '{enter}');
|
|
345
356
|
});
|
|
346
357
|
}
|
|
347
358
|
|
|
@@ -359,7 +370,14 @@ function applyColumnFilter(agGridElement, hasApplyButton, noMenuTabs) {
|
|
|
359
370
|
.click();
|
|
360
371
|
}
|
|
361
372
|
if (!noMenuTabs) {
|
|
362
|
-
|
|
373
|
+
cy.get(agGridElement).then((agGr) => {
|
|
374
|
+
if (agGr.find('.ag-tab').length === 0) {
|
|
375
|
+
cy.log('Menu uses a list, not tabs');
|
|
376
|
+
cy.get(agGridElement).agGridWaitForAnimation();
|
|
377
|
+
} else {
|
|
378
|
+
getMenuTabElement(agGridElement, filterTab.filter).click();
|
|
379
|
+
}
|
|
380
|
+
})
|
|
363
381
|
}
|
|
364
382
|
}
|
|
365
383
|
|
|
@@ -375,9 +393,9 @@ function toggleColumnCheckboxFilter(
|
|
|
375
393
|
doSelect,
|
|
376
394
|
noMenuTabs = false
|
|
377
395
|
) {
|
|
378
|
-
if (!noMenuTabs) {
|
|
379
|
-
|
|
380
|
-
}
|
|
396
|
+
// if (!noMenuTabs) {
|
|
397
|
+
// selectMenuTab(agGridElement, filterTab.filter);
|
|
398
|
+
// }
|
|
381
399
|
cy.get(agGridElement)
|
|
382
400
|
.find(".ag-input-field-label")
|
|
383
401
|
.contains(filterValue)
|
|
@@ -393,7 +411,7 @@ function populateSearchCriteria(
|
|
|
393
411
|
searchCriteria,
|
|
394
412
|
hasApplyButton = false,
|
|
395
413
|
noMenuTabs = false,
|
|
396
|
-
selectAllLocaleText = "Select All"
|
|
414
|
+
selectAllLocaleText = "(Select All)"
|
|
397
415
|
) {
|
|
398
416
|
const options = {};
|
|
399
417
|
options.searchCriteria = { ...searchCriteria };
|
|
@@ -487,7 +505,7 @@ function _filterBySearchTextColumnMenu(agGridElement, options) {
|
|
|
487
505
|
* @param options.searchCriteria.operator [Optional] Use if using a search operator (i.e. Less Than, Equals, etc...use filterOperator.enum values).
|
|
488
506
|
* @param options.hasApplyButton [Optional] True if "Apply" button is used, false if filters by text input automatically.
|
|
489
507
|
* @param options.noMenuTabs [Optional] True if you use, for example, the community edition of ag-grid, which has no menu tabs
|
|
490
|
-
* @param options.selectAllLocaleText [Optional] Pass in the locale text value of "Select All" for when you are filtering by checkbox - this wil first deselect the "Select All" option before selecting your filter value
|
|
508
|
+
* @param options.selectAllLocaleText [Optional] Pass in the locale text value of "(Select All)" for when you are filtering by checkbox - this wil first deselect the "(Select All)" option before selecting your filter value
|
|
491
509
|
*/
|
|
492
510
|
export function filterBySearchTextColumnFloatingFilter(agGridElement, options) {
|
|
493
511
|
// Check if there are multiple search criteria provided by attempting to access the columnName
|
|
@@ -554,7 +572,7 @@ function _filterByCheckboxColumnMenu(agGridElement, options) {
|
|
|
554
572
|
agGridElement,
|
|
555
573
|
options.searchCriteria.columnName
|
|
556
574
|
).click();
|
|
557
|
-
const selectAllText = options.selectAllLocaleText || "Select All";
|
|
575
|
+
const selectAllText = options.selectAllLocaleText || "(Select All)";
|
|
558
576
|
toggleColumnCheckboxFilter(
|
|
559
577
|
agGridElement,
|
|
560
578
|
selectAllText,
|
package/src/index.d.ts
CHANGED
|
@@ -1,98 +1,125 @@
|
|
|
1
1
|
/// <reference types="cypress" />
|
|
2
2
|
|
|
3
3
|
declare namespace Cypress {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
*/
|
|
93
|
-
agGridToggleColumnsSideBar<E extends Node = HTMLElement>(
|
|
94
|
-
columnName: string,
|
|
95
|
-
doRemove: boolean
|
|
96
|
-
): Chainable<JQuery<E>>;
|
|
97
|
-
}
|
|
4
|
+
interface Chainable<Subject> {
|
|
5
|
+
/**
|
|
6
|
+
* Retrieves the values from the *displayed* page in ag grid and assigns each value to its respective column name.
|
|
7
|
+
* @param options Provide an array of columns you wish to exclude from the table retrieval.
|
|
8
|
+
*/
|
|
9
|
+
getAgGridData(options?: getAgGridElementsOptions): Chainable<Array<Record<string, string>>>;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Retrieves the values from the *displayed* page in ag grid and assigns each value to its respective column name.
|
|
13
|
+
* @param options Provide an array of columns you wish to exclude from the table retrieval.
|
|
14
|
+
*/
|
|
15
|
+
getAgGridElements<E extends Node = HTMLElement>(options?: getAgGridElementsOptions): Chainable<JQuery<E>>;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* * Performs sorting operation on the specified column
|
|
19
|
+
* @param {*} subject The get() selector for which ag grid table you wish to retrieve.
|
|
20
|
+
* @param columnName The name of the column you wish to sort
|
|
21
|
+
* @param sortDirection sort enum value
|
|
22
|
+
*/
|
|
23
|
+
agGridSortColumn<E extends Node = HTMLElement>(columnName: string, sortDirection: string): Chainable<JQuery<E>>;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* * Performs a filter operation on the specified column and selects only the provided filterValue
|
|
27
|
+
* @param subject The get() selector for which ag grid table you wish to retrieve.
|
|
28
|
+
* @param options Column filter options to filter on
|
|
29
|
+
*/
|
|
30
|
+
agGridColumnFilterCheckboxMenu<E extends Node = HTMLElement>(options: agGridColumnFilterOptions<agGridColumnFilterSearchCriteriaOptions>): Chainable<JQuery<E>>;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* * Performs a filter operation on the specified column via the context menu using plain text search
|
|
34
|
+
* @param subject The get() selector for which ag grid table you wish to retrieve.
|
|
35
|
+
* @param options Column filter options to filter on
|
|
36
|
+
*/
|
|
37
|
+
agGridColumnFilterTextMenu<E extends Node = HTMLElement>(options: agGridColumnFilterOptions<agGridColumnFilterSearchCriteriaOptionsWithOperator>): Chainable<JQuery<E>>;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* * Performs a filter operation on the specified column via the column's floating filter field using plain text search
|
|
41
|
+
* @param subject The get() selector for which ag grid table you wish to retrieve.
|
|
42
|
+
* @param options Column filter options to filter on
|
|
43
|
+
*/
|
|
44
|
+
agGridColumnFilterTextFloating<E extends Node = HTMLElement>(options: agGridColumnFilterOptions<agGridColumnFilterSearchCriteriaOptionsWithMultiFilter>): Chainable<JQuery<E>>;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* * Validates the grid data across its pages. Performs a validation that the data exists on each page, not accounting for order.
|
|
48
|
+
* @param {*} expectedPaginatedTableData Your paginated array to match the grid data.
|
|
49
|
+
* @param {*} onlyColumns If specified, ONLY these columns will be validated. If left blank, all columns are validated.
|
|
50
|
+
*/
|
|
51
|
+
agGridValidatePaginatedTable<E extends Node = HTMLElement>(
|
|
52
|
+
expectedPaginatedTableData: any,
|
|
53
|
+
onlyColumns?: string[]
|
|
54
|
+
): Chainable<JQuery<E>>;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* * Performs an exact validation to verify the data exists within the displayed grid page.
|
|
58
|
+
* @param {*} actualTableData The actual page data returned from the getAgGridData() command.
|
|
59
|
+
* @param {*} expectedTableData The expected data to exist within the current grid page. Requires all columns and values exactly as shown in the grid, in the same order as shown in the grid.
|
|
60
|
+
*/
|
|
61
|
+
agGridValidateRowsExactOrder<E extends Node = HTMLElement>(
|
|
62
|
+
actualTableData: {},
|
|
63
|
+
expectedTableData: {}
|
|
64
|
+
): Chainable<JQuery<E>>;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* * Performs a deep include validation to verify the data exists within the displayed grid page
|
|
68
|
+
* @param {*} actualTableData The actual page data returned from the getAgGridData() command.
|
|
69
|
+
* @param {*} expectedTableData The expected data to exist within the current grid page. Does not need to be in any specific order.
|
|
70
|
+
*/
|
|
71
|
+
agGridValidateRowsSubset<E extends Node = HTMLElement>(
|
|
72
|
+
actualTableData: {},
|
|
73
|
+
expectedTableData: {}
|
|
74
|
+
): Chainable<JQuery<E>>;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* * Validates the Ag Grid table data is empty.
|
|
78
|
+
* @param {*} actualTableData The actual page data returned from the getAgGridData() command.
|
|
79
|
+
*/
|
|
80
|
+
agGridValidateEmptyTable<E extends Node = HTMLElement>(actualTableData: {}): Chainable<JQuery<E>>;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* * Will add or remove a column from ag grid.
|
|
84
|
+
* @param columnName The column name to add/remove
|
|
85
|
+
* @param doRemove true will remove the column. false will add the column.
|
|
86
|
+
*/
|
|
87
|
+
agGridToggleColumnsSideBar<E extends Node = HTMLElement>(
|
|
88
|
+
columnName: string,
|
|
89
|
+
doRemove: boolean
|
|
90
|
+
): Chainable<JQuery<E>>;
|
|
91
|
+
}
|
|
98
92
|
}
|
|
93
|
+
|
|
94
|
+
interface agGridColumnFilterOptions<TSearchCriteria> {
|
|
95
|
+
searchCriteria: TSearchCriteria,
|
|
96
|
+
/** True if "Apply" button is used, false if filters by text input automatically. */
|
|
97
|
+
hasApplyButton?: boolean,
|
|
98
|
+
selectAllLocaleText?: string,
|
|
99
|
+
noMenuTabs?: boolean,
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
interface getAgGridElementsOptions {
|
|
104
|
+
/** Define columns to select from */
|
|
105
|
+
onlyColumns?: string[],
|
|
106
|
+
/** If true, return headers & rows values as arrays instead of mapping as objects */
|
|
107
|
+
valuesArray?: boolean
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
interface agGridColumnFilterSearchCriteriaOptions {
|
|
111
|
+
/** Name of the column to filter */
|
|
112
|
+
columnName: string,
|
|
113
|
+
/** Value to input into the filter textbox */
|
|
114
|
+
filterValue: string
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
interface agGridColumnFilterSearchCriteriaOptionsWithOperator extends agGridColumnFilterSearchCriteriaOptions {
|
|
118
|
+
/** Use if using a search operator (i.e. Less Than, Equals, etc...use filterOperator.enum values) */
|
|
119
|
+
operator?: string
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
interface agGridColumnFilterSearchCriteriaOptionsWithMultiFilter extends agGridColumnFilterSearchCriteriaOptionsWithOperator {
|
|
123
|
+
/** Use if floating filter is multiselect checkboxes vs free form input */
|
|
124
|
+
isMultiFilter?: boolean
|
|
125
|
+
}
|