@linzjs/step-ag-grid 7.10.0 → 7.10.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/package.json
CHANGED
package/src/components/Grid.tsx
CHANGED
|
@@ -219,7 +219,12 @@ export const Grid = (params: GridProps): JSX.Element => {
|
|
|
219
219
|
const editAction = e.colDef?.cellRendererParams?.editAction;
|
|
220
220
|
if (!editAction) return false;
|
|
221
221
|
const editable = fnOrVar(e.colDef?.editable, e);
|
|
222
|
-
|
|
222
|
+
if (editable) {
|
|
223
|
+
if (!e.node.isSelected()) {
|
|
224
|
+
e.node.setSelected(true, true);
|
|
225
|
+
}
|
|
226
|
+
editAction([e.data, ...e.api.getSelectedRows().filter((row) => row.id !== e.data.id)]);
|
|
227
|
+
}
|
|
223
228
|
return true;
|
|
224
229
|
};
|
|
225
230
|
|
|
@@ -25,6 +25,7 @@ export default {
|
|
|
25
25
|
quickFilterValue: "",
|
|
26
26
|
quickFilterPlaceholder: "Quick filter...",
|
|
27
27
|
selectable: false,
|
|
28
|
+
rowSelection: "single",
|
|
28
29
|
},
|
|
29
30
|
decorators: [
|
|
30
31
|
(Story) => (
|
|
@@ -105,7 +106,7 @@ const GridReadOnlyTemplate: ComponentStory<typeof Grid> = (props: GridProps) =>
|
|
|
105
106
|
<GridIcon icon={"ic_launch_modal"} title={"Title text"} className={"GridCell-editableIcon"} />
|
|
106
107
|
),
|
|
107
108
|
editAction: (selectedRows) => {
|
|
108
|
-
alert(`Custom edit ${selectedRows.
|
|
109
|
+
alert(`Custom edit ${selectedRows.map((r) => r.id)} rowId(s) selected`);
|
|
109
110
|
},
|
|
110
111
|
shortcutKeys: {
|
|
111
112
|
e: () => {
|
|
@@ -126,7 +127,7 @@ const GridReadOnlyTemplate: ComponentStory<typeof Grid> = (props: GridProps) =>
|
|
|
126
127
|
{
|
|
127
128
|
label: "Single edit only",
|
|
128
129
|
action: async (selectedRows) => {
|
|
129
|
-
alert(`Single-edit: ${selectedRows.
|
|
130
|
+
alert(`Single-edit: ${selectedRows.map((r) => r.id)} rowId(s) selected`);
|
|
130
131
|
await wait(1500);
|
|
131
132
|
},
|
|
132
133
|
disabled: selectedItems.length > 1,
|
|
@@ -134,7 +135,7 @@ const GridReadOnlyTemplate: ComponentStory<typeof Grid> = (props: GridProps) =>
|
|
|
134
135
|
{
|
|
135
136
|
label: "Multi-edit",
|
|
136
137
|
action: async (selectedRows) => {
|
|
137
|
-
alert(`Multi-edit: ${selectedRows.
|
|
138
|
+
alert(`Multi-edit: ${selectedRows.map((r) => r.id)} rowId(s) selected`);
|
|
138
139
|
await wait(1500);
|
|
139
140
|
},
|
|
140
141
|
},
|
|
@@ -204,7 +205,6 @@ const GridReadOnlyTemplate: ComponentStory<typeof Grid> = (props: GridProps) =>
|
|
|
204
205
|
columnDefs={columnDefs}
|
|
205
206
|
rowData={rowData}
|
|
206
207
|
domLayout={"autoHeight"}
|
|
207
|
-
rowSelection={"single"}
|
|
208
208
|
/>
|
|
209
209
|
);
|
|
210
210
|
};
|