@linzjs/step-ag-grid 29.0.1 → 29.1.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 +3 -1
- package/dist/src/utils/__tests__/testUtil.ts +1 -1
- package/dist/src/utils/__tests__/vitestUtil.ts +1 -1
- package/dist/step-ag-grid.cjs +1 -1
- package/dist/step-ag-grid.cjs.map +1 -1
- package/dist/step-ag-grid.esm.js +1 -1
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Grid.tsx +6 -0
- package/src/utils/__tests__/testUtil.ts +1 -1
- package/src/utils/__tests__/vitestUtil.ts +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ColDef, GridOptions } from 'ag-grid-community';
|
|
1
|
+
import { ColDef, GridOptions, RowClickedEvent, RowDoubleClickedEvent } from 'ag-grid-community';
|
|
2
2
|
import { ReactElement } from 'react';
|
|
3
3
|
import { GridContextMenuComponent } from './gridHook';
|
|
4
4
|
export interface GridBaseRow {
|
|
@@ -82,6 +82,8 @@ export interface GridProps<TData extends GridBaseRow = GridBaseRow> {
|
|
|
82
82
|
suppressCellFocus?: boolean;
|
|
83
83
|
pinnedTopRowData?: GridOptions['pinnedTopRowData'];
|
|
84
84
|
pinnedBottomRowData?: GridOptions['pinnedBottomRowData'];
|
|
85
|
+
onRowClicked?: (event: RowClickedEvent) => void;
|
|
86
|
+
onRowDoubleClicked?: (event: RowDoubleClickedEvent) => void;
|
|
85
87
|
}
|
|
86
88
|
/**
|
|
87
89
|
* Wrapper for AgGrid to add commonly used functionality.
|
|
@@ -15,7 +15,7 @@ export const setUpUserEvent = (customisedUserEvent: any) => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
export const countRows = (within?: HTMLElement): number => {
|
|
18
|
-
return getAllQuick({ tagName:
|
|
18
|
+
return getAllQuick({ tagName: `.ag-center-cols-container div[row-id]:not(:empty)` }, within).length;
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
export const findRowByIndex = async (rowIndex: number | string, within?: HTMLElement): Promise<HTMLDivElement> => {
|
|
@@ -16,7 +16,7 @@ export const setUpUserEvent = (customisedUserEvent: any) => {
|
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
export const countRows = (within?: HTMLElement): number => {
|
|
19
|
-
return getAllQuick({ tagName:
|
|
19
|
+
return getAllQuick({ tagName: `.ag-center-cols-container div[row-id]:not(:empty)` }, within).length;
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
export const findRowByIndex = async (rowIndex: number | string, within?: HTMLElement): Promise<HTMLDivElement> => {
|
package/dist/step-ag-grid.cjs
CHANGED
|
@@ -3256,7 +3256,7 @@ const Grid = ({ 'data-testid': dataTestId, defaultPostSort = true, rowSelection
|
|
|
3256
3256
|
enableClickSelection: params.enableClickSelection ?? false,
|
|
3257
3257
|
mode: rowSelection == 'single' ? 'singleRow' : 'multiRow',
|
|
3258
3258
|
}
|
|
3259
|
-
: undefined, rowHeight: rowHeight, animateRows: params.animateRows ?? false, rowClassRules: params.rowClassRules, getRowId: getRowId, onGridSizeChanged: onGridSizeChanged, suppressColumnVirtualisation: suppressColumnVirtualization, suppressClickEdit: true, onColumnVisible: setInitialContentSize, onRowDataUpdated: onRowDataChanged, onCellFocused: onCellFocused, onCellKeyDown: onCellKeyPress, onCellClicked: onCellClicked, onCellDoubleClicked: onCellDoubleClick, domLayout: params.domLayout, onColumnResized: onColumnResized, defaultColDef: defaultColDef, columnDefs: columnDefsAdjusted, selectionColumnDef: selectionColumnDef, rowData: rowData, postSortRows: params.onRowDragEnd || !defaultPostSort ? undefined : postSortRows, onModelUpdated: onModelUpdated, onGridReady: onGridReady, onSortChanged: ensureSelectedRowIsVisible, quickFilterParser: quickFilterParser, onSelectionChanged: synchroniseExternalStateToGridSelection, onColumnMoved: params.onColumnMoved, noRowsOverlayComponent: noRowsOverlayComponent, alwaysShowVerticalScroll: params.alwaysShowVerticalScroll, isExternalFilterPresent: isExternalFilterPresent, doesExternalFilterPass: doesExternalFilterPass, maintainColumnOrder: true, preventDefaultOnContextMenu: true, onCellContextMenu: gridContextMenu.cellContextMenu, rowDragText: params.rowDragText, onRowDragCancel: clearHighlightRowClasses, onRowDragMove: onRowDragMove, onRowDragEnd: onRowDragEnd, suppressCellFocus: params.suppressCellFocus, pinnedTopRowData: params.pinnedTopRowData, pinnedBottomRowData: params.pinnedBottomRowData }) })] }));
|
|
3259
|
+
: undefined, rowHeight: rowHeight, animateRows: params.animateRows ?? false, rowClassRules: params.rowClassRules, getRowId: getRowId, onGridSizeChanged: onGridSizeChanged, suppressColumnVirtualisation: suppressColumnVirtualization, suppressClickEdit: true, onColumnVisible: setInitialContentSize, onRowDataUpdated: onRowDataChanged, onCellFocused: onCellFocused, onCellKeyDown: onCellKeyPress, onCellClicked: onCellClicked, onCellDoubleClicked: onCellDoubleClick, domLayout: params.domLayout, onColumnResized: onColumnResized, defaultColDef: defaultColDef, columnDefs: columnDefsAdjusted, selectionColumnDef: selectionColumnDef, rowData: rowData, postSortRows: params.onRowDragEnd || !defaultPostSort ? undefined : postSortRows, onModelUpdated: onModelUpdated, onGridReady: onGridReady, onSortChanged: ensureSelectedRowIsVisible, quickFilterParser: quickFilterParser, onSelectionChanged: synchroniseExternalStateToGridSelection, onColumnMoved: params.onColumnMoved, noRowsOverlayComponent: noRowsOverlayComponent, alwaysShowVerticalScroll: params.alwaysShowVerticalScroll, isExternalFilterPresent: isExternalFilterPresent, doesExternalFilterPass: doesExternalFilterPass, maintainColumnOrder: true, preventDefaultOnContextMenu: true, onCellContextMenu: gridContextMenu.cellContextMenu, rowDragText: params.rowDragText, onRowDragCancel: clearHighlightRowClasses, onRowDragMove: onRowDragMove, onRowDragEnd: onRowDragEnd, suppressCellFocus: params.suppressCellFocus, pinnedTopRowData: params.pinnedTopRowData, pinnedBottomRowData: params.pinnedBottomRowData, onRowClicked: params.onRowClicked, onRowDoubleClicked: params.onRowDoubleClicked }) })] }));
|
|
3260
3260
|
};
|
|
3261
3261
|
const quickFilterParser = (filterStr) => {
|
|
3262
3262
|
// filter is exact matches exactly groups separated by commas
|