@linzjs/step-ag-grid 7.11.0 → 7.11.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/README.md +48 -1
- package/dist/index.js +39 -25
- package/dist/index.js.map +1 -1
- package/dist/step-ag-grid.esm.js +39 -25
- 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 +12 -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
|
}); })];
|
|
@@ -24575,7 +24594,7 @@ var editCell = function (rowId, colId, within) { return __awaiter(void 0, void 0
|
|
|
24575
24594
|
}); })];
|
|
24576
24595
|
case 1:
|
|
24577
24596
|
_a.sent();
|
|
24578
|
-
return [4 /*yield*/, findOpenMenu
|
|
24597
|
+
return [4 /*yield*/, waitForWrapper(findOpenMenu)];
|
|
24579
24598
|
case 2:
|
|
24580
24599
|
_a.sent();
|
|
24581
24600
|
return [2 /*return*/];
|
|
@@ -24617,27 +24636,25 @@ var findMenuOption = function (menuOptionText) { return __awaiter(void 0, void 0
|
|
|
24617
24636
|
return [2 /*return*/, menuOption];
|
|
24618
24637
|
}
|
|
24619
24638
|
});
|
|
24620
|
-
}); }, { timeout:
|
|
24639
|
+
}); }, { timeout: 5000 })];
|
|
24621
24640
|
case 1: return [2 /*return*/, _a.sent()];
|
|
24622
24641
|
}
|
|
24623
24642
|
});
|
|
24624
24643
|
}); };
|
|
24625
24644
|
var clickMenuOption = function (menuOptionText) { return __awaiter(void 0, void 0, void 0, function () {
|
|
24645
|
+
var menuOption;
|
|
24626
24646
|
return __generator(this, function (_a) {
|
|
24627
24647
|
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
|
-
}); })];
|
|
24648
|
+
case 0: return [4 /*yield*/, findMenuOption(menuOptionText)];
|
|
24640
24649
|
case 1:
|
|
24650
|
+
menuOption = _a.sent();
|
|
24651
|
+
return [4 /*yield*/, act(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
24652
|
+
return __generator(this, function (_a) {
|
|
24653
|
+
userEvent.click(menuOption);
|
|
24654
|
+
return [2 /*return*/];
|
|
24655
|
+
});
|
|
24656
|
+
}); })];
|
|
24657
|
+
case 2:
|
|
24641
24658
|
_a.sent();
|
|
24642
24659
|
return [2 /*return*/];
|
|
24643
24660
|
}
|
|
@@ -24648,12 +24665,9 @@ var openAndClickMenuOption = function (rowId, colId, menuOptionText, within) { r
|
|
|
24648
24665
|
switch (_a.label) {
|
|
24649
24666
|
case 0: return [4 /*yield*/, editCell(rowId, colId, within)];
|
|
24650
24667
|
case 1:
|
|
24651
|
-
_a.sent();
|
|
24652
|
-
return [4 /*yield*/, wait$2(100)];
|
|
24653
|
-
case 2:
|
|
24654
24668
|
_a.sent();
|
|
24655
24669
|
return [4 /*yield*/, clickMenuOption(menuOptionText)];
|
|
24656
|
-
case
|
|
24670
|
+
case 2:
|
|
24657
24671
|
_a.sent();
|
|
24658
24672
|
return [2 /*return*/];
|
|
24659
24673
|
}
|