@linzjs/step-ag-grid 22.2.1 → 22.2.3

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@linzjs/step-ag-grid",
3
3
  "repository": "github:linz/step-ag-grid.git",
4
4
  "license": "MIT",
5
- "version": "22.2.1",
5
+ "version": "22.2.3",
6
6
  "keywords": [
7
7
  "aggrid",
8
8
  "ag-grid",
@@ -1,5 +1,4 @@
1
1
  import { CellClickedEvent } from "ag-grid-community";
2
- import { fnOrVar } from "../utils/util";
3
2
 
4
3
  /**
5
4
  * AgGrid checkbox select does not pass clicks within cell but not on the checkbox to checkbox.
@@ -9,13 +8,14 @@ export const clickInputWhenContainingCellClicked = (params: CellClickedEvent) =>
9
8
  const { data, event, colDef } = params;
10
9
  if (!data || !event) return;
11
10
 
12
- if (fnOrVar(colDef.editable, params) === false) {
13
- return;
14
- }
15
-
16
11
  const element = event.target as Element;
17
12
  // Already handled
18
- if (["BUTTON", "INPUT"].includes(element?.tagName) && element.closest(".ag-cell-inline-editing")) return;
13
+ if (
14
+ element.closest(".GridCell-readonly") ||
15
+ (["BUTTON", "INPUT"].includes(element?.tagName) && element.closest(".ag-cell-inline-editing"))
16
+ ) {
17
+ return;
18
+ }
19
19
 
20
20
  const row = element.closest("[row-id]");
21
21
  if (!row) return;
@@ -24,12 +24,19 @@ const BooleanCellRenderer = (props: CustomCellEditorProps) => {
24
24
  };
25
25
  }, [api, column, node.rowIndex]);
26
26
 
27
+ const isDisabled = !fnOrVar(colDef?.editable, props);
28
+
27
29
  return (
28
- <div className={clsx("ag-wrapper ag-input-wrapper ag-checkbox-input-wrapper", { "ag-checked": props.value })}>
30
+ <div
31
+ className={clsx("ag-wrapper ag-input-wrapper ag-checkbox-input-wrapper", {
32
+ "ag-checked": props.value,
33
+ "ag-disabled": isDisabled,
34
+ })}
35
+ >
29
36
  <input
30
37
  type="checkbox"
31
38
  className="ag-input-field-input ag-checkbox-input"
32
- disabled={!fnOrVar(colDef?.editable, props)}
39
+ disabled={isDisabled}
33
40
  ref={inputRef}
34
41
  checked={value}
35
42
  onChange={() => {}}