grep-components 1.22.0-GREPF-2004.1 → 1.22.0

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.
@@ -44,6 +44,7 @@ export interface GrepTableProps<T> extends Pick<TableProps, 'size' | 'stickyHead
44
44
  rowHeight?: number;
45
45
  disableSelectOnClick?: boolean;
46
46
  underlineOnFocus?: boolean;
47
+ rowTabIndex?: number;
47
48
  }
48
49
  interface StyleProps {
49
50
  outlined?: boolean;
@@ -67,6 +68,6 @@ export declare const useStyles: (params: StyleProps, styleOverrides?: {
67
68
  * @todo enhance page handling
68
69
  *
69
70
  */
70
- export declare const GrepTable: <T>({ placeholderText, dropdownItems, isRowDisabled, pagination, outlined, columns, header, data, onSelectedRowChange, sortBy, sortDirection, onSortBy, onRowClick, size, caption, stickyHeader, padding, disableSelectOnClick, menuButtonLabel, underlineOnFocus, ...props }: GrepTableProps<T>) => JSX.Element;
71
+ export declare const GrepTable: <T>({ placeholderText, dropdownItems, isRowDisabled, pagination, outlined, columns, header, data, onSelectedRowChange, sortBy, sortDirection, onSortBy, onRowClick, size, caption, stickyHeader, padding, disableSelectOnClick, menuButtonLabel, underlineOnFocus, rowTabIndex, ...props }: GrepTableProps<T>) => JSX.Element;
71
72
  export { GrepTableRow };
72
73
  export default GrepTable;
package/dist/index.js CHANGED
@@ -3126,8 +3126,7 @@ var CollapsableMenu = function (_a) {
3126
3126
  var TooltipMenuItem = function (_a) {
3127
3127
  var children = _a.children, tooltipText = _a.tooltipText, disabled = _a.disabled, props = __rest$1(_a, ["children", "tooltipText", "disabled"]);
3128
3128
  return (React__default.createElement(Tooltip, { title: tooltipText },
3129
- React__default.createElement("span", null,
3130
- React__default.createElement(MenuItem, __assign({ role: "menuitem", disabled: disabled }, props), children))));
3129
+ React__default.createElement(MenuItem, __assign({ role: "menuitem", disabled: disabled, sx: { pointerEvents: 'inherit !important' } }, props), children)));
3131
3130
  };
3132
3131
 
3133
3132
  var useStyles$g = makeStyles()(function (_a, _b) {
@@ -3495,7 +3494,7 @@ var GrepTableRow = function (_a) {
3495
3494
  var render = function (column, index) { return (React__default.createElement(GrepTableRow$1, __assign({ key: index }, { column: column, row: row, variant: variant, selected: selected }))); };
3496
3495
  return (React__default.createElement(TableRow, __assign({ sx: {
3497
3496
  ':focus': { textDecoration: underlineOnFocus ? 'underline' : 'none' },
3498
- } }, __assign({ selected: selected }, props)), columns.map(render)));
3497
+ }, tabIndex: props.tabIndex }, __assign({ selected: selected }, props)), columns.map(render)));
3499
3498
  };
3500
3499
 
3501
3500
  var usePaginationActionStyles = makeStyles()(function (_a) {
@@ -3663,7 +3662,7 @@ var getElementIndex = function (el) {
3663
3662
  *
3664
3663
  */
3665
3664
  var GrepTable = function (_a) {
3666
- var placeholderText = _a.placeholderText, dropdownItems = _a.dropdownItems, isRowDisabled = _a.isRowDisabled, pagination = _a.pagination, outlined = _a.outlined, columns = _a.columns, header = _a.header, data = _a.data, onSelectedRowChange = _a.onSelectedRowChange, sortBy = _a.sortBy, sortDirection = _a.sortDirection, onSortBy = _a.onSortBy, onRowClick = _a.onRowClick, size = _a.size, caption = _a.caption, stickyHeader = _a.stickyHeader, padding = _a.padding, _b = _a.disableSelectOnClick, disableSelectOnClick = _b === void 0 ? false : _b, menuButtonLabel = _a.menuButtonLabel, underlineOnFocus = _a.underlineOnFocus, props = __rest$1(_a, ["placeholderText", "dropdownItems", "isRowDisabled", "pagination", "outlined", "columns", "header", "data", "onSelectedRowChange", "sortBy", "sortDirection", "onSortBy", "onRowClick", "size", "caption", "stickyHeader", "padding", "disableSelectOnClick", "menuButtonLabel", "underlineOnFocus"]);
3665
+ var placeholderText = _a.placeholderText, dropdownItems = _a.dropdownItems, isRowDisabled = _a.isRowDisabled, pagination = _a.pagination, outlined = _a.outlined, columns = _a.columns, header = _a.header, data = _a.data, onSelectedRowChange = _a.onSelectedRowChange, sortBy = _a.sortBy, sortDirection = _a.sortDirection, onSortBy = _a.onSortBy, onRowClick = _a.onRowClick, size = _a.size, caption = _a.caption, stickyHeader = _a.stickyHeader, padding = _a.padding, _b = _a.disableSelectOnClick, disableSelectOnClick = _b === void 0 ? false : _b, menuButtonLabel = _a.menuButtonLabel, underlineOnFocus = _a.underlineOnFocus, rowTabIndex = _a.rowTabIndex, props = __rest$1(_a, ["placeholderText", "dropdownItems", "isRowDisabled", "pagination", "outlined", "columns", "header", "data", "onSelectedRowChange", "sortBy", "sortDirection", "onSortBy", "onRowClick", "size", "caption", "stickyHeader", "padding", "disableSelectOnClick", "menuButtonLabel", "underlineOnFocus", "rowTabIndex"]);
3667
3666
  var _c = __read(React__default.useState(props.rowsPerPage || 10), 2), rowsPerPage = _c[0], setRowsPerPage = _c[1];
3668
3667
  var _d = __read(React__default.useState(null), 2), menuAnchor = _d[0], setMenuAnchor = _d[1];
3669
3668
  var _e = __read(React__default.useState(0), 2), currentPage = _e[0], _setCurrentPage = _e[1];
@@ -3752,7 +3751,7 @@ var GrepTable = function (_a) {
3752
3751
  var clickableRows = !!onRowClick;
3753
3752
  var disabled = isRowDisabled && isRowDisabled(row);
3754
3753
  var rowIndex = index + currentPage * rowsPerPage;
3755
- return (React__default.createElement(GrepTableRow, { key: rowIndex, "data-index": rowIndex, tabIndex: 0, hover: clickableRows, selected: rowIndex === selectedRowIndex, clickable: clickableRows, onMouseDown: function (_a) {
3754
+ return (React__default.createElement(GrepTableRow, { key: rowIndex, "data-index": rowIndex, tabIndex: rowTabIndex !== null && rowTabIndex !== void 0 ? rowTabIndex : 0, hover: clickableRows, selected: rowIndex === selectedRowIndex, clickable: clickableRows, onMouseDown: function (_a) {
3756
3755
  var currentTarget = _a.currentTarget;
3757
3756
  setSelectedElement(currentTarget);
3758
3757
  if (!disableSelectOnClick) {
@@ -21909,7 +21908,7 @@ var GrepTableOfContentNav = function (props) {
21909
21908
  });
21910
21909
  }, [ref]);
21911
21910
  var onKeyDown = function (e) {
21912
- if (selected && e.which === Key_enum.Key.Tab) {
21911
+ if (selected && e.which === Key_enum.Key.Tab && e.shiftKey === false) {
21913
21912
  var tabindex_1 = selected.getAttribute('tabindex');
21914
21913
  selected.setAttribute('tabindex', '0');
21915
21914
  selected.focus();