@linzjs/step-ag-grid 22.2.2 → 22.2.4

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 CHANGED
@@ -221,6 +221,7 @@ To exclude a column from CSV download add ```export: false``` to the GridCell de
221
221
 
222
222
  ## Writing tests
223
223
 
224
+
224
225
  The following testing calls can be imported from step-ag-grid:
225
226
 
226
227
  - findRow
@@ -4478,7 +4478,11 @@ const BooleanCellRenderer = (props) => {
4478
4478
  api.removeEventListener("cellFocused", checkFocus);
4479
4479
  };
4480
4480
  }, [api, column, node.rowIndex]);
4481
- return (jsxRuntime.jsx("div", { className: clsx("ag-wrapper ag-input-wrapper ag-checkbox-input-wrapper", { "ag-checked": props.value }), children: jsxRuntime.jsx("input", { type: "checkbox", className: "ag-input-field-input ag-checkbox-input", disabled: !fnOrVar(colDef?.editable, props), ref: inputRef, checked: value, onChange: () => { }, onClick: (e) => {
4481
+ const isDisabled = !fnOrVar(colDef?.editable, props);
4482
+ return (jsxRuntime.jsx("div", { className: clsx("ag-wrapper ag-input-wrapper ag-checkbox-input-wrapper", {
4483
+ "ag-checked": props.value,
4484
+ "ag-disabled": isDisabled,
4485
+ }), children: jsxRuntime.jsx("input", { type: "checkbox", className: "ag-input-field-input ag-checkbox-input", disabled: isDisabled, ref: inputRef, checked: value, onChange: () => { }, onClick: (e) => {
4482
4486
  e.stopPropagation();
4483
4487
  // cell has to be in edit mode
4484
4488
  // if in non-edit mode clickInputWhenContainingCellClicked will click to put it in edit mode
@@ -4487,7 +4491,14 @@ const BooleanCellRenderer = (props) => {
4487
4491
  const params = props?.colDef?.cellEditorParams;
4488
4492
  if (!params)
4489
4493
  return;
4490
- const selectedRows = [data];
4494
+ // The data cannot be relied upon if grid changed whilst editing, data will be stale
4495
+ // So I get the data from the node itself which will be up to date.
4496
+ const selectedRows = [];
4497
+ api.forEachNode((n) => {
4498
+ if (n.data.id === data.id) {
4499
+ selectedRows.push(n.data);
4500
+ }
4501
+ });
4491
4502
  const checked = !value;
4492
4503
  onValueChange(checked);
4493
4504
  params.onClick({ selectedRows, selectedRowIds: selectedRows.map((r) => r.id), checked }).then();