@linzjs/step-ag-grid 7.11.0 → 7.11.1
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/README.md +48 -1
- package/dist/index.js +54 -37
- package/dist/index.js.map +1 -1
- package/dist/step-ag-grid.esm.js +54 -37
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Grid.tsx +6 -1
- package/src/utils/testUtil.ts +13 -8
package/dist/step-ag-grid.esm.js
CHANGED
|
@@ -2885,7 +2885,7 @@ var Grid = function (params) {
|
|
|
2885
2885
|
sizeColumnsToFit();
|
|
2886
2886
|
}
|
|
2887
2887
|
}, [columnDefs === null || columnDefs === void 0 ? void 0 : columnDefs.length, sizeColumnsToFit]);
|
|
2888
|
-
return (jsxs("div", __assign({ "data-testid": params["data-testid"], className: clsx("Grid-container", "ag-theme-alpine", staleGrid && "Grid-sortIsStale") }, { children: [params.quickFilter && (jsx("div", __assign({ className: "Grid-quickFilter" }, { children: jsx("input", { "aria-label": "Search", className: "lui-margin-top-xxs lui-margin-bottom-xxs Grid-quickFilterBox", type: "text", placeholder: (_a = params.quickFilterPlaceholder) !== null && _a !== void 0 ? _a : "Search...", value: internalQuickFilter, onChange: function (event) {
|
|
2888
|
+
return (jsxs("div", __assign({ "data-testid": params["data-testid"], className: clsx("Grid-container", "ag-theme-alpine", staleGrid && "Grid-sortIsStale", gridReady && params.rowData && "Grid-ready") }, { children: [params.quickFilter && (jsx("div", __assign({ className: "Grid-quickFilter" }, { children: jsx("input", { "aria-label": "Search", className: "lui-margin-top-xxs lui-margin-bottom-xxs Grid-quickFilterBox", type: "text", placeholder: (_a = params.quickFilterPlaceholder) !== null && _a !== void 0 ? _a : "Search...", value: internalQuickFilter, onChange: function (event) {
|
|
2889
2889
|
setInternalQuickFilter(event.target.value);
|
|
2890
2890
|
} }) }))), jsx(AgGridReact, { animateRows: params.animateRows, rowClassRules: params.rowClassRules, defaultColDef: params.defaultColDef, getRowId: function (params) { return "".concat(params.data.id); }, suppressRowClickSelection: true, rowSelection: (_b = params.rowSelection) !== null && _b !== void 0 ? _b : "multiple", suppressBrowserResizeObserver: true, colResizeDefault: "shift", onFirstDataRendered: sizeColumnsToFit, onGridSizeChanged: sizeColumnsToFit, suppressClickEdit: true, onCellKeyPress: onCellKeyPress, onCellClicked: onCellClicked, onCellDoubleClicked: onCellDoubleClick, onCellEditingStarted: refreshSelectedRows, onCellEditingStopped: onCellEditingStopped, domLayout: params.domLayout, columnDefs: columnDefs, rowData: params.rowData, noRowsOverlayComponent: noRowsOverlayComponent, onGridReady: onGridReady, onSortChanged: ensureSelectedRowIsVisible, postSortRows: (_c = params.postSortRows) !== null && _c !== void 0 ? _c : postSortRows, onSelectionChanged: synchroniseExternalStateToGridSelection })] })));
|
|
2891
2891
|
};
|
|
@@ -24480,17 +24480,36 @@ var _selectRow = function (select, rowId, within) { return __awaiter(void 0, voi
|
|
|
24480
24480
|
return __generator(this, function (_a) {
|
|
24481
24481
|
switch (_a.label) {
|
|
24482
24482
|
case 0: return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
24483
|
-
var row, isSelected;
|
|
24483
|
+
var row, isSelected, cell;
|
|
24484
24484
|
return __generator(this, function (_a) {
|
|
24485
24485
|
switch (_a.label) {
|
|
24486
24486
|
case 0: return [4 /*yield*/, findRow(rowId, within)];
|
|
24487
24487
|
case 1:
|
|
24488
24488
|
row = _a.sent();
|
|
24489
|
-
isSelected =
|
|
24490
|
-
if (select === "toggle" || (select === "select" && !isSelected) || (select === "deselect" && isSelected))
|
|
24491
|
-
|
|
24492
|
-
|
|
24493
|
-
|
|
24489
|
+
isSelected = row.className.includes("ag-row-selected");
|
|
24490
|
+
if (!(select === "toggle" || (select === "select" && !isSelected) || (select === "deselect" && isSelected))) return [3 /*break*/, 4];
|
|
24491
|
+
return [4 /*yield*/, findCell(rowId, "selection", within)];
|
|
24492
|
+
case 2:
|
|
24493
|
+
cell = _a.sent();
|
|
24494
|
+
userEvent.click(cell);
|
|
24495
|
+
return [4 /*yield*/, waitForWrapper(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
24496
|
+
var row, nowSelected;
|
|
24497
|
+
return __generator(this, function (_a) {
|
|
24498
|
+
switch (_a.label) {
|
|
24499
|
+
case 0: return [4 /*yield*/, findRow(rowId, within)];
|
|
24500
|
+
case 1:
|
|
24501
|
+
row = _a.sent();
|
|
24502
|
+
nowSelected = row.className.includes("ag-row-selected");
|
|
24503
|
+
if (nowSelected == isSelected)
|
|
24504
|
+
throw "Row ".concat(rowId, " won't select");
|
|
24505
|
+
return [2 /*return*/];
|
|
24506
|
+
}
|
|
24507
|
+
});
|
|
24508
|
+
}); })];
|
|
24509
|
+
case 3:
|
|
24510
|
+
_a.sent();
|
|
24511
|
+
_a.label = 4;
|
|
24512
|
+
case 4: return [2 /*return*/];
|
|
24494
24513
|
}
|
|
24495
24514
|
});
|
|
24496
24515
|
}); })];
|
|
@@ -24561,22 +24580,25 @@ var selectCell = function (rowId, colId, within) { return __awaiter(void 0, void
|
|
|
24561
24580
|
var editCell = function (rowId, colId, within) { return __awaiter(void 0, void 0, void 0, function () {
|
|
24562
24581
|
return __generator(this, function (_a) {
|
|
24563
24582
|
switch (_a.label) {
|
|
24564
|
-
case 0: return [4 /*yield*/,
|
|
24565
|
-
var cell;
|
|
24566
|
-
return __generator(this, function (_a) {
|
|
24567
|
-
switch (_a.label) {
|
|
24568
|
-
case 0: return [4 /*yield*/, findCell(rowId, colId, within)];
|
|
24569
|
-
case 1:
|
|
24570
|
-
cell = _a.sent();
|
|
24571
|
-
userEvent.dblClick(cell);
|
|
24572
|
-
return [2 /*return*/];
|
|
24573
|
-
}
|
|
24574
|
-
});
|
|
24575
|
-
}); })];
|
|
24583
|
+
case 0: return [4 /*yield*/, selectRow(rowId, within)];
|
|
24576
24584
|
case 1:
|
|
24577
24585
|
_a.sent();
|
|
24578
|
-
return [4 /*yield*/,
|
|
24586
|
+
return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
24587
|
+
var cell;
|
|
24588
|
+
return __generator(this, function (_a) {
|
|
24589
|
+
switch (_a.label) {
|
|
24590
|
+
case 0: return [4 /*yield*/, findCell(rowId, colId, within)];
|
|
24591
|
+
case 1:
|
|
24592
|
+
cell = _a.sent();
|
|
24593
|
+
userEvent.dblClick(cell);
|
|
24594
|
+
return [2 /*return*/];
|
|
24595
|
+
}
|
|
24596
|
+
});
|
|
24597
|
+
}); })];
|
|
24579
24598
|
case 2:
|
|
24599
|
+
_a.sent();
|
|
24600
|
+
return [4 /*yield*/, waitForWrapper(findOpenMenu)];
|
|
24601
|
+
case 3:
|
|
24580
24602
|
_a.sent();
|
|
24581
24603
|
return [2 /*return*/];
|
|
24582
24604
|
}
|
|
@@ -24617,27 +24639,25 @@ var findMenuOption = function (menuOptionText) { return __awaiter(void 0, void 0
|
|
|
24617
24639
|
return [2 /*return*/, menuOption];
|
|
24618
24640
|
}
|
|
24619
24641
|
});
|
|
24620
|
-
}); }, { timeout:
|
|
24642
|
+
}); }, { timeout: 5000 })];
|
|
24621
24643
|
case 1: return [2 /*return*/, _a.sent()];
|
|
24622
24644
|
}
|
|
24623
24645
|
});
|
|
24624
24646
|
}); };
|
|
24625
24647
|
var clickMenuOption = function (menuOptionText) { return __awaiter(void 0, void 0, void 0, function () {
|
|
24648
|
+
var menuOption;
|
|
24626
24649
|
return __generator(this, function (_a) {
|
|
24627
24650
|
switch (_a.label) {
|
|
24628
|
-
case 0: return [4 /*yield*/,
|
|
24629
|
-
var menuOption;
|
|
24630
|
-
return __generator(this, function (_a) {
|
|
24631
|
-
switch (_a.label) {
|
|
24632
|
-
case 0: return [4 /*yield*/, findMenuOption(menuOptionText)];
|
|
24633
|
-
case 1:
|
|
24634
|
-
menuOption = _a.sent();
|
|
24635
|
-
menuOption && userEvent.click(menuOption);
|
|
24636
|
-
return [2 /*return*/];
|
|
24637
|
-
}
|
|
24638
|
-
});
|
|
24639
|
-
}); })];
|
|
24651
|
+
case 0: return [4 /*yield*/, findMenuOption(menuOptionText)];
|
|
24640
24652
|
case 1:
|
|
24653
|
+
menuOption = _a.sent();
|
|
24654
|
+
return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
24655
|
+
return __generator(this, function (_a) {
|
|
24656
|
+
userEvent.click(menuOption);
|
|
24657
|
+
return [2 /*return*/];
|
|
24658
|
+
});
|
|
24659
|
+
}); })];
|
|
24660
|
+
case 2:
|
|
24641
24661
|
_a.sent();
|
|
24642
24662
|
return [2 /*return*/];
|
|
24643
24663
|
}
|
|
@@ -24648,12 +24668,9 @@ var openAndClickMenuOption = function (rowId, colId, menuOptionText, within) { r
|
|
|
24648
24668
|
switch (_a.label) {
|
|
24649
24669
|
case 0: return [4 /*yield*/, editCell(rowId, colId, within)];
|
|
24650
24670
|
case 1:
|
|
24651
|
-
_a.sent();
|
|
24652
|
-
return [4 /*yield*/, wait$2(100)];
|
|
24653
|
-
case 2:
|
|
24654
24671
|
_a.sent();
|
|
24655
24672
|
return [4 /*yield*/, clickMenuOption(menuOptionText)];
|
|
24656
|
-
case
|
|
24673
|
+
case 2:
|
|
24657
24674
|
_a.sent();
|
|
24658
24675
|
return [2 /*return*/];
|
|
24659
24676
|
}
|