grep-components 1.22.0-GREPF-822.1 → 1.22.0-GREPF-822.3

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
@@ -3394,7 +3394,7 @@ var GrepTableRow = function (_a) {
3394
3394
  var render = function (column, index) { return (React__default.createElement(GrepTableRow$1, __assign({ key: index }, { column: column, row: row, variant: variant, selected: selected }))); };
3395
3395
  return (React__default.createElement(TableRow, __assign({ sx: {
3396
3396
  ':focus': { textDecoration: underlineOnFocus ? 'underline' : 'none' },
3397
- } }, __assign({ selected: selected }, props)), columns.map(render)));
3397
+ }, tabIndex: props.tabIndex }, __assign({ selected: selected }, props)), columns.map(render)));
3398
3398
  };
3399
3399
 
3400
3400
  var usePaginationActionStyles = makeStyles()(function (_a) {
@@ -3562,7 +3562,7 @@ var getElementIndex = function (el) {
3562
3562
  *
3563
3563
  */
3564
3564
  var GrepTable = function (_a) {
3565
- 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"]);
3565
+ 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"]);
3566
3566
  var _c = __read(React__default.useState(props.rowsPerPage || 10), 2), rowsPerPage = _c[0], setRowsPerPage = _c[1];
3567
3567
  var _d = __read(React__default.useState(null), 2), menuAnchor = _d[0], setMenuAnchor = _d[1];
3568
3568
  var _e = __read(React__default.useState(0), 2), currentPage = _e[0], _setCurrentPage = _e[1];
@@ -3651,7 +3651,7 @@ var GrepTable = function (_a) {
3651
3651
  var clickableRows = !!onRowClick;
3652
3652
  var disabled = isRowDisabled && isRowDisabled(row);
3653
3653
  var rowIndex = index + currentPage * rowsPerPage;
3654
- return (React__default.createElement(GrepTableRow, { key: rowIndex, "data-index": rowIndex, tabIndex: 0, hover: clickableRows, selected: rowIndex === selectedRowIndex, clickable: clickableRows, onMouseDown: function (_a) {
3654
+ 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) {
3655
3655
  var currentTarget = _a.currentTarget;
3656
3656
  setSelectedElement(currentTarget);
3657
3657
  if (!disableSelectOnClick) {
@@ -21808,7 +21808,7 @@ var GrepTableOfContentNav = function (props) {
21808
21808
  });
21809
21809
  }, [ref]);
21810
21810
  var onKeyDown = function (e) {
21811
- if (selected && e.which === Key_enum.Key.Tab) {
21811
+ if (selected && e.which === Key_enum.Key.Tab && e.shiftKey === false) {
21812
21812
  var tabindex_1 = selected.getAttribute('tabindex');
21813
21813
  selected.setAttribute('tabindex', '0');
21814
21814
  selected.focus();