@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/README.md +1 -0
- package/dist/step-ag-grid.cjs.js +8 -5
- package/dist/step-ag-grid.cjs.js.map +1 -1
- package/dist/step-ag-grid.esm.js +8 -5
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/clickInputWhenContainingCellClicked.tsx +6 -6
- package/src/components/gridPopoverEdit/GridEditBoolean.tsx +9 -2
package/package.json
CHANGED
|
@@ -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 (
|
|
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
|
|
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={
|
|
39
|
+
disabled={isDisabled}
|
|
33
40
|
ref={inputRef}
|
|
34
41
|
checked={value}
|
|
35
42
|
onChange={() => {}}
|