@equinor/eds-data-grid-react 0.7.1 → 0.7.2
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.
|
@@ -468,7 +468,8 @@ function TableBodyCell({
|
|
|
468
468
|
function TableRow({
|
|
469
469
|
row,
|
|
470
470
|
onCellClick,
|
|
471
|
-
onClick
|
|
471
|
+
onClick,
|
|
472
|
+
onContextMenu
|
|
472
473
|
}) {
|
|
473
474
|
const {
|
|
474
475
|
rowClass,
|
|
@@ -480,6 +481,7 @@ function TableRow({
|
|
|
480
481
|
},
|
|
481
482
|
className: `${row.getIsSelected() ? 'selected' : ''} ${rowClass?.(row)}`,
|
|
482
483
|
onClick: onClick,
|
|
484
|
+
onContextMenu: onContextMenu,
|
|
483
485
|
children: row.getVisibleCells().map(cell => /*#__PURE__*/jsxRuntime.jsx(TableBodyCell, {
|
|
484
486
|
cell: cell,
|
|
485
487
|
onClick: onCellClick ? event => onCellClick(cell, event) : undefined
|
|
@@ -584,6 +586,7 @@ function EdsDataGrid({
|
|
|
584
586
|
setExpansionState,
|
|
585
587
|
getSubRows,
|
|
586
588
|
defaultColumn,
|
|
589
|
+
onRowContextMenu,
|
|
587
590
|
onRowClick,
|
|
588
591
|
onCellClick,
|
|
589
592
|
enableFooter,
|
|
@@ -911,6 +914,7 @@ function EdsDataGrid({
|
|
|
911
914
|
const row = table.getRowModel().rows[virtualItem.index];
|
|
912
915
|
return /*#__PURE__*/jsxRuntime.jsx(TableRow, {
|
|
913
916
|
row: row,
|
|
917
|
+
onContextMenu: onRowContextMenu ? event => onRowContextMenu(row, event) : undefined,
|
|
914
918
|
onClick: onRowClick ? event => onRowClick(row, event) : undefined,
|
|
915
919
|
onCellClick: onCellClick
|
|
916
920
|
}, virtualItem.index);
|
|
@@ -928,6 +932,7 @@ function EdsDataGrid({
|
|
|
928
932
|
})]
|
|
929
933
|
}), !enableVirtual && table.getRowModel().rows.map(row => /*#__PURE__*/jsxRuntime.jsx(TableRow, {
|
|
930
934
|
row: row,
|
|
935
|
+
onContextMenu: onRowContextMenu ? event => onRowContextMenu(row, event) : undefined,
|
|
931
936
|
onClick: onRowClick ? event => onRowClick(row, event) : undefined,
|
|
932
937
|
onCellClick: onCellClick
|
|
933
938
|
}, row.id))]
|
package/dist/esm/EdsDataGrid.js
CHANGED
|
@@ -62,6 +62,7 @@ function EdsDataGrid({
|
|
|
62
62
|
setExpansionState,
|
|
63
63
|
getSubRows,
|
|
64
64
|
defaultColumn,
|
|
65
|
+
onRowContextMenu,
|
|
65
66
|
onRowClick,
|
|
66
67
|
onCellClick,
|
|
67
68
|
enableFooter,
|
|
@@ -389,6 +390,7 @@ function EdsDataGrid({
|
|
|
389
390
|
const row = table.getRowModel().rows[virtualItem.index];
|
|
390
391
|
return /*#__PURE__*/jsx(TableRow, {
|
|
391
392
|
row: row,
|
|
393
|
+
onContextMenu: onRowContextMenu ? event => onRowContextMenu(row, event) : undefined,
|
|
392
394
|
onClick: onRowClick ? event => onRowClick(row, event) : undefined,
|
|
393
395
|
onCellClick: onCellClick
|
|
394
396
|
}, virtualItem.index);
|
|
@@ -406,6 +408,7 @@ function EdsDataGrid({
|
|
|
406
408
|
})]
|
|
407
409
|
}), !enableVirtual && table.getRowModel().rows.map(row => /*#__PURE__*/jsx(TableRow, {
|
|
408
410
|
row: row,
|
|
411
|
+
onContextMenu: onRowContextMenu ? event => onRowContextMenu(row, event) : undefined,
|
|
409
412
|
onClick: onRowClick ? event => onRowClick(row, event) : undefined,
|
|
410
413
|
onCellClick: onCellClick
|
|
411
414
|
}, row.id))]
|
|
@@ -7,7 +7,8 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
7
7
|
function TableRow({
|
|
8
8
|
row,
|
|
9
9
|
onCellClick,
|
|
10
|
-
onClick
|
|
10
|
+
onClick,
|
|
11
|
+
onContextMenu
|
|
11
12
|
}) {
|
|
12
13
|
const {
|
|
13
14
|
rowClass,
|
|
@@ -19,6 +20,7 @@ function TableRow({
|
|
|
19
20
|
},
|
|
20
21
|
className: `${row.getIsSelected() ? 'selected' : ''} ${rowClass?.(row)}`,
|
|
21
22
|
onClick: onClick,
|
|
23
|
+
onContextMenu: onContextMenu,
|
|
22
24
|
children: row.getVisibleCells().map(cell => /*#__PURE__*/jsx(TableBodyCell, {
|
|
23
25
|
cell: cell,
|
|
24
26
|
onClick: onCellClick ? event => onCellClick(cell, event) : undefined
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
2
|
import { EdsDataGridProps } from './EdsDataGridProps';
|
|
3
|
-
export declare function EdsDataGrid<T>({ rows, columns, columnResizeMode, pageSize, rowSelection, enableRowSelection, enableMultiRowSelection, enableSubRowSelection, selectedRows, rowSelectionState, enableColumnFiltering, debug, enablePagination, enableSorting, stickyHeader, stickyFooter, onSelectRow, onRowSelectionChange, caption, enableVirtual, virtualHeight, columnVisibility, columnVisibilityChange, emptyMessage, columnOrder, cellClass, cellStyle, rowClass, rowStyle, headerClass, headerStyle, footerClass, footerStyle, externalPaginator, onSortingChange, manualSorting, sortingState, columnPinState, scrollbarHorizontal, width, minWidth, height, getRowId, rowVirtualizerInstanceRef, columnSizing, onColumnResize, expansionState, setExpansionState, getSubRows, defaultColumn, onRowClick, onCellClick, enableFooter, enableSortingRemoval, ...rest }: EdsDataGridProps<T> & HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare function EdsDataGrid<T>({ rows, columns, columnResizeMode, pageSize, rowSelection, enableRowSelection, enableMultiRowSelection, enableSubRowSelection, selectedRows, rowSelectionState, enableColumnFiltering, debug, enablePagination, enableSorting, stickyHeader, stickyFooter, onSelectRow, onRowSelectionChange, caption, enableVirtual, virtualHeight, columnVisibility, columnVisibilityChange, emptyMessage, columnOrder, cellClass, cellStyle, rowClass, rowStyle, headerClass, headerStyle, footerClass, footerStyle, externalPaginator, onSortingChange, manualSorting, sortingState, columnPinState, scrollbarHorizontal, width, minWidth, height, getRowId, rowVirtualizerInstanceRef, columnSizing, onColumnResize, expansionState, setExpansionState, getSubRows, defaultColumn, onRowContextMenu, onRowClick, onCellClick, enableFooter, enableSortingRemoval, ...rest }: EdsDataGridProps<T> & HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -186,6 +186,13 @@ type FilterProps = {
|
|
|
186
186
|
enableColumnFiltering?: boolean;
|
|
187
187
|
};
|
|
188
188
|
type HandlersProps<T> = {
|
|
189
|
+
/**
|
|
190
|
+
*
|
|
191
|
+
* @param row the current row
|
|
192
|
+
* @param event The right-click event
|
|
193
|
+
* @returns
|
|
194
|
+
*/
|
|
195
|
+
onRowContextMenu?: (row: Row<T>, event: MouseEvent<HTMLTableRowElement>) => unknown;
|
|
189
196
|
/**
|
|
190
197
|
* Row click handler.
|
|
191
198
|
*
|
|
@@ -5,5 +5,5 @@ type Props<T> = {
|
|
|
5
5
|
row: Row<T>;
|
|
6
6
|
onCellClick?: EdsDataGridProps<T>['onCellClick'];
|
|
7
7
|
} & HTMLAttributes<HTMLTableRowElement>;
|
|
8
|
-
export declare function TableRow<T>({ row, onCellClick, onClick }: Props<T>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function TableRow<T>({ row, onCellClick, onClick, onContextMenu, }: Props<T>): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export {};
|
package/package.json
CHANGED