@linzjs/step-ag-grid 27.2.3 → 27.3.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/dist/src/components/Grid.d.ts +2 -0
- package/dist/step-ag-grid.cjs +8 -4
- package/dist/step-ag-grid.cjs.map +1 -1
- package/dist/step-ag-grid.esm.js +8 -4
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Grid.tsx +8 -2
- package/src/components/clickInputWhenContainingCellClicked.tsx +4 -2
- package/src/stories/grid/GridReadOnly.stories.tsx +2 -0
|
@@ -13,6 +13,8 @@ export interface GridProps<TData extends GridBaseRow = GridBaseRow> {
|
|
|
13
13
|
readOnly?: boolean;
|
|
14
14
|
defaultPostSort?: boolean;
|
|
15
15
|
selectable?: boolean;
|
|
16
|
+
enableClickSelection?: boolean;
|
|
17
|
+
enableSelectionWithoutKeys?: boolean;
|
|
16
18
|
hideSelectColumn?: boolean;
|
|
17
19
|
theme?: string;
|
|
18
20
|
['data-testid']?: string;
|
package/dist/step-ag-grid.cjs
CHANGED
|
@@ -667,9 +667,10 @@ const clickInputWhenContainingCellClicked = (params) => {
|
|
|
667
667
|
if (!cell)
|
|
668
668
|
return;
|
|
669
669
|
const input = cell.querySelector('input, button');
|
|
670
|
-
if (!input)
|
|
670
|
+
if (!input) {
|
|
671
671
|
return;
|
|
672
|
-
|
|
672
|
+
}
|
|
673
|
+
input.dispatchEvent(event);
|
|
673
674
|
};
|
|
674
675
|
setTimeout(clickInput, 20);
|
|
675
676
|
};
|
|
@@ -3187,7 +3188,8 @@ const Grid = ({ 'data-testid': dataTestId, defaultPostSort = true, rowSelection
|
|
|
3187
3188
|
const headerRowCount = columnDefs.some((c) => c.children) ? 2 : 1;
|
|
3188
3189
|
return (jsxRuntime.jsxs("div", { "data-testid": dataTestId, className: clsx('Grid-container', theme, 'theme-specific', staleGrid && 'Grid-sortIsStale', gridReady && rowData && autoSized && 'Grid-ready'), children: [gridContextMenu.component, jsxRuntime.jsx("div", { style: { flex: 1 }, ref: gridDivRef, children: jsxRuntime.jsx(agGridReact.AgGridReact, { theme: 'legacy', rowSelection: selectable
|
|
3189
3190
|
? {
|
|
3190
|
-
|
|
3191
|
+
enableSelectionWithoutKeys: params.enableSelectionWithoutKeys ?? false,
|
|
3192
|
+
enableClickSelection: params.enableClickSelection ?? false,
|
|
3191
3193
|
mode: rowSelection == 'single' ? 'singleRow' : 'multiRow',
|
|
3192
3194
|
}
|
|
3193
3195
|
: undefined, rowHeight: rowHeight, animateRows: params.animateRows ?? false, rowClassRules: params.rowClassRules, getRowId: (params) => `${params.data.id}`, onGridSizeChanged: onGridSizeChanged, suppressColumnVirtualisation: suppressColumnVirtualization, suppressClickEdit: true, onColumnVisible: setInitialContentSize, onRowDataUpdated: onRowDataChanged, onCellKeyDown: onCellKeyPress, onCellClicked: onCellClicked, onCellDoubleClicked: onCellDoubleClick, onCellEditingStarted: refreshSelectedRows, domLayout: params.domLayout, onColumnResized: onColumnResized, defaultColDef: { minWidth: 48, ...lodashEs.omit(params.defaultColDef, ['editable']) }, columnDefs: columnDefsAdjusted, rowData: rowData, noRowsOverlayComponent: (event) => {
|
|
@@ -3219,7 +3221,9 @@ const Grid = ({ 'data-testid': dataTestId, defaultPostSort = true, rowSelection
|
|
|
3219
3221
|
}
|
|
3220
3222
|
return false;
|
|
3221
3223
|
},
|
|
3222
|
-
onCellClicked:
|
|
3224
|
+
onCellClicked: params.enableSelectionWithoutKeys || params.enableClickSelection
|
|
3225
|
+
? undefined
|
|
3226
|
+
: clickInputWhenContainingCellClicked,
|
|
3223
3227
|
} }) })] }));
|
|
3224
3228
|
};
|
|
3225
3229
|
|