grep-components 1.20.0-grepf-1813.1 → 1.20.0-grepf-1778.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.
@@ -7,6 +7,7 @@ interface Properties<T> extends TableRowProps, Pick<TableCellProperties<T>, 'var
7
7
  columns: Array<TableColumn<T>>;
8
8
  clickable?: boolean;
9
9
  height?: number;
10
+ underlineOnFocus?: boolean;
10
11
  }
11
12
  declare type Component<T> = React.FunctionComponent<Properties<T>>;
12
13
  export declare const GrepTableRow: Component<any>;
@@ -41,6 +41,7 @@ export interface GrepTableProps<T> extends Pick<TableProps, 'size' | 'stickyHead
41
41
  */
42
42
  rowHeight?: number;
43
43
  disableSelectOnClick?: boolean;
44
+ underlineOnFocus?: boolean;
44
45
  }
45
46
  interface StyleProps {
46
47
  outlined?: boolean;
@@ -64,6 +65,6 @@ export declare const useStyles: (params: StyleProps, styleOverrides?: {
64
65
  * @todo enhance page handling
65
66
  *
66
67
  */
67
- export declare const GrepTable: <T>({ placeholderText, dropdownItems, isRowDisabled, pagination, outlined, columns, header, data, onSelectedRowChange, sortBy, sortDirection, onSortBy, onRowClick, size, caption, stickyHeader, padding, disableSelectOnClick, ...props }: GrepTableProps<T>) => JSX.Element;
68
+ export declare const GrepTable: <T>({ placeholderText, dropdownItems, isRowDisabled, pagination, outlined, columns, header, data, onSelectedRowChange, sortBy, sortDirection, onSortBy, onRowClick, size, caption, stickyHeader, padding, disableSelectOnClick, underlineOnFocus, ...props }: GrepTableProps<T>) => JSX.Element;
68
69
  export { GrepTableRow };
69
70
  export default GrepTable;
package/dist/index.js CHANGED
@@ -39,7 +39,6 @@ export { ContentState } from 'draft-js';
39
39
  import ToggleButton from '@mui/material/ToggleButton';
40
40
  import FormatBold from '@mui/icons-material/FormatBold';
41
41
  import FormatItalic from '@mui/icons-material/FormatItalic';
42
- import Divider$1 from '@mui/material/Divider';
43
42
  import Menu$2 from '@mui/material/Menu';
44
43
  import MenuItem$1 from '@mui/material/MenuItem';
45
44
  import Button$1 from '@mui/material/Button';
@@ -3203,7 +3202,13 @@ var useFooterStyles = makeStyles()(function (theme) {
3203
3202
  _a),
3204
3203
  content: (_b = {
3205
3204
  display: 'flex',
3206
- width: '100%'
3205
+ width: '100%',
3206
+ a: {
3207
+ ':focus': {
3208
+ outlineColor: 'white',
3209
+ outlineOffset: '8px',
3210
+ },
3211
+ }
3207
3212
  },
3208
3213
  _b[theme.breakpoints.down('md')] = {
3209
3214
  flexDirection: 'column',
@@ -3256,6 +3261,11 @@ var useFooterStyles = makeStyles()(function (theme) {
3256
3261
  _e['&:last-child'] = {
3257
3262
  border: '0 !important',
3258
3263
  },
3264
+ _e[':focus'] = {
3265
+ background: 'inherit',
3266
+ boxShadow: '0px 0px 0px 1px white',
3267
+ borderRadius: '2px',
3268
+ },
3259
3269
  _e),
3260
3270
  itemText: {
3261
3271
  padding: 0,
@@ -3379,9 +3389,11 @@ var GrepTableRow$1 = function (_a) {
3379
3389
  };
3380
3390
 
3381
3391
  var GrepTableRow = function (_a) {
3382
- var row = _a.row, columns = _a.columns, selected = _a.selected, variant = _a.variant; _a.clickable; _a.height; var props = __rest$1(_a, ["row", "columns", "selected", "variant", "clickable", "height"]);
3392
+ var row = _a.row, columns = _a.columns, selected = _a.selected, variant = _a.variant; _a.clickable; _a.height; var underlineOnFocus = _a.underlineOnFocus, props = __rest$1(_a, ["row", "columns", "selected", "variant", "clickable", "height", "underlineOnFocus"]);
3383
3393
  var render = function (column, index) { return (React__default.createElement(GrepTableRow$1, __assign({ key: index }, { column: column, row: row, variant: variant, selected: selected }))); };
3384
- return React__default.createElement(TableRow, __assign({}, __assign({ selected: selected }, props)), columns.map(render));
3394
+ return (React__default.createElement(TableRow, __assign({ sx: {
3395
+ ':focus': { textDecoration: underlineOnFocus ? 'underline' : 'none' },
3396
+ } }, __assign({ selected: selected }, props)), columns.map(render)));
3385
3397
  };
3386
3398
 
3387
3399
  var usePaginationActionStyles = makeStyles()(function (_a) {
@@ -3546,7 +3558,7 @@ var getElementIndex = function (el) {
3546
3558
  *
3547
3559
  */
3548
3560
  var GrepTable = function (_a) {
3549
- 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, props = __rest$1(_a, ["placeholderText", "dropdownItems", "isRowDisabled", "pagination", "outlined", "columns", "header", "data", "onSelectedRowChange", "sortBy", "sortDirection", "onSortBy", "onRowClick", "size", "caption", "stickyHeader", "padding", "disableSelectOnClick"]);
3561
+ 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, 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", "underlineOnFocus"]);
3550
3562
  var _c = __read(React__default.useState(props.rowsPerPage || 10), 2), rowsPerPage = _c[0], setRowsPerPage = _c[1];
3551
3563
  var _d = __read(React__default.useState(null), 2), menuAnchor = _d[0], setMenuAnchor = _d[1];
3552
3564
  var _e = __read(React__default.useState(0), 2), currentPage = _e[0], _setCurrentPage = _e[1];
@@ -3644,7 +3656,7 @@ var GrepTable = function (_a) {
3644
3656
  }, columns: rowColumns, row: row, style: { cursor: clickableRows && !disabled ? 'pointer' : '' }, onFocus: function (_a) {
3645
3657
  var currentTarget = _a.currentTarget;
3646
3658
  return setSelectedElement(currentTarget);
3647
- } }));
3659
+ }, underlineOnFocus: underlineOnFocus }));
3648
3660
  };
3649
3661
  var onKey = function (e) {
3650
3662
  var maxIndex = data.length - 1;
@@ -3757,6 +3769,10 @@ var useStyles$b = makeStyles()({
3757
3769
  '&:hover': {
3758
3770
  textDecoration: 'underline',
3759
3771
  },
3772
+ '&:focus': {
3773
+ textDecoration: 'underline',
3774
+ outlineOffset: '2px',
3775
+ },
3760
3776
  },
3761
3777
  });
3762
3778
 
@@ -20590,7 +20606,11 @@ var ToolbarTitle = styled(NavLink)(function () { return ({
20590
20606
  fontWeight: 500,
20591
20607
  textDecoration: 'none',
20592
20608
  ':hover': {
20593
- textDecoration: 'none',
20609
+ textDecoration: 'underline',
20610
+ },
20611
+ ':focus': {
20612
+ outline: 'none',
20613
+ textDecoration: 'underline',
20594
20614
  },
20595
20615
  }); });
20596
20616
  var EnvironmentTitle = styled('div')(function () { return ({
@@ -20793,7 +20813,7 @@ var ToolbarMenuItem = styled(NavLink)(function (_a) {
20793
20813
  left: '50%',
20794
20814
  width: '32px',
20795
20815
  marginLeft: '-16px',
20796
- borderBottom: "2px solid ".concat(theme.palette.secondary.light),
20816
+ borderBottom: "2px solid ".concat(theme.palette.secondary.main),
20797
20817
  opacity: 0,
20798
20818
  content: '""',
20799
20819
  transition: 'all 0.3s ease',
@@ -20801,12 +20821,21 @@ var ToolbarMenuItem = styled(NavLink)(function (_a) {
20801
20821
  },
20802
20822
  ':focus': {
20803
20823
  outline: 'none',
20824
+ color: menuItemHoverGreen,
20825
+ ':after': {
20826
+ bottom: '-4px',
20827
+ opacity: '1',
20828
+ },
20804
20829
  },
20805
20830
  ':hover': {
20806
20831
  textDecoration: 'none',
20807
20832
  color: menuItemHoverGreen,
20833
+ ':after': {
20834
+ bottom: '-4px',
20835
+ opacity: '1',
20836
+ },
20808
20837
  },
20809
- '.active:after, :hover:after, focus:after': {
20838
+ '.active:after': {
20810
20839
  bottom: '-4px',
20811
20840
  opacity: '1',
20812
20841
  },
@@ -20892,7 +20921,7 @@ var AppBar = function (_a) {
20892
20921
  appTitle,
20893
20922
  !isProd && (React.createElement(EnvironmentTitle, null, process.env.REACT_APP_HOST)))),
20894
20923
  React.createElement(ToolbarRight, null,
20895
- React.createElement(Button$1, { onClick: _handleIconButtonClick },
20924
+ React.createElement(Button$1, { "aria-controls": userMenuAnchor ? 'basic-menu' : undefined, "aria-haspopup": "true", "aria-expanded": userMenuAnchor ? 'true' : undefined, onClick: _handleIconButtonClick },
20896
20925
  React.createElement(AccountCircle, { color: "primary", fontSize: "large" }),
20897
20926
  React.createElement(UserContainer, null,
20898
20927
  React.createElement(AccountName, null, username),
@@ -20905,15 +20934,17 @@ var AppBar = function (_a) {
20905
20934
  vertical: 'top',
20906
20935
  horizontal: 'center',
20907
20936
  } }, userMenuItems.map(function (i, index) {
20908
- return (React.createElement(Box, { key: i.id },
20909
- React.createElement(MenuItem$1, { key: i.id, onClick: function () {
20910
- setUserMenuAnchor(null);
20911
- i.action && i.action();
20912
- } }, i.isAnchor ? (React.createElement("a", { style: {
20913
- textDecoration: 'inherit',
20914
- color: 'inherit',
20915
- }, rel: "noreferrer", href: i.href, onClick: i.onClick }, i.label)) : (i.label)),
20916
- userMenuItems.length > index + 1 && React.createElement(Divider$1, null)));
20937
+ return (React.createElement(MenuItem$1, { key: i.id, onClick: function () {
20938
+ setUserMenuAnchor(null);
20939
+ i.action && i.action();
20940
+ }, divider: userMenuItems.length > index + 1, sx: {
20941
+ ':focus': {
20942
+ textDecoration: 'underline',
20943
+ },
20944
+ } }, i.isAnchor ? (React.createElement("a", { style: {
20945
+ textDecoration: 'inherit',
20946
+ color: 'inherit',
20947
+ }, rel: "noreferrer", href: i.href, onClick: i.onClick }, i.label)) : (i.label)));
20917
20948
  })))),
20918
20949
  React.createElement(ToolbarMenu, { role: "navigation" },
20919
20950
  React.createElement(ToolbarMenuInner, null, menuItems.map(function (page) { return _renderToolbarMenuItem(page); }))),