grep-components 1.16.0 → 1.17.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';
@@ -4391,7 +4390,13 @@ var useFooterStyles = makeStyles()(function (theme) {
4391
4390
  _a),
4392
4391
  content: (_b = {
4393
4392
  display: 'flex',
4394
- width: '100%'
4393
+ width: '100%',
4394
+ a: {
4395
+ ':focus': {
4396
+ outlineColor: 'white',
4397
+ outlineOffset: '8px',
4398
+ },
4399
+ }
4395
4400
  },
4396
4401
  _b[theme.breakpoints.down('md')] = {
4397
4402
  flexDirection: 'column',
@@ -4435,7 +4440,7 @@ var useFooterStyles = makeStyles()(function (theme) {
4435
4440
  margin: '0',
4436
4441
  height: '10px',
4437
4442
  gap: '10px',
4438
- borderRight: "1px solid ".concat(theme.palette.divider)
4443
+ borderRight: "1px solid #7dbf9d"
4439
4444
  },
4440
4445
  _e[theme.breakpoints.down('md')] = {
4441
4446
  textAlign: 'center',
@@ -4444,6 +4449,11 @@ var useFooterStyles = makeStyles()(function (theme) {
4444
4449
  _e['&:last-child'] = {
4445
4450
  border: '0 !important',
4446
4451
  },
4452
+ _e[':focus'] = {
4453
+ background: 'inherit',
4454
+ boxShadow: '0px 0px 0px 1px white',
4455
+ borderRadius: '2px',
4456
+ },
4447
4457
  _e),
4448
4458
  itemText: {
4449
4459
  padding: 0,
@@ -4567,9 +4577,11 @@ var GrepTableRow$1 = function (_a) {
4567
4577
  };
4568
4578
 
4569
4579
  var GrepTableRow = function (_a) {
4570
- 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"]);
4580
+ 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"]);
4571
4581
  var render = function (column, index) { return (React__default.createElement(GrepTableRow$1, __assign({ key: index }, { column: column, row: row, variant: variant, selected: selected }))); };
4572
- return React__default.createElement(TableRow, __assign({}, __assign({ selected: selected }, props)), columns.map(render));
4582
+ return (React__default.createElement(TableRow, __assign({ sx: {
4583
+ ':focus': { textDecoration: underlineOnFocus ? 'underline' : 'none' },
4584
+ } }, __assign({ selected: selected }, props)), columns.map(render)));
4573
4585
  };
4574
4586
 
4575
4587
  var usePaginationActionStyles = makeStyles()(function (_a) {
@@ -4734,7 +4746,7 @@ var getElementIndex = function (el) {
4734
4746
  *
4735
4747
  */
4736
4748
  var GrepTable = function (_a) {
4737
- 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"]);
4749
+ 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"]);
4738
4750
  var _c = __read(React__default.useState(props.rowsPerPage || 10), 2), rowsPerPage = _c[0], setRowsPerPage = _c[1];
4739
4751
  var _d = __read(React__default.useState(null), 2), menuAnchor = _d[0], setMenuAnchor = _d[1];
4740
4752
  var _e = __read(React__default.useState(0), 2), currentPage = _e[0], _setCurrentPage = _e[1];
@@ -4832,7 +4844,7 @@ var GrepTable = function (_a) {
4832
4844
  }, columns: rowColumns, row: row, style: { cursor: clickableRows && !disabled ? 'pointer' : '' }, onFocus: function (_a) {
4833
4845
  var currentTarget = _a.currentTarget;
4834
4846
  return setSelectedElement(currentTarget);
4835
- } }));
4847
+ }, underlineOnFocus: underlineOnFocus }));
4836
4848
  };
4837
4849
  var onKey = function (e) {
4838
4850
  var maxIndex = data.length - 1;
@@ -4944,6 +4956,10 @@ var useStyles$b = makeStyles()({
4944
4956
  '&:hover': {
4945
4957
  textDecoration: 'underline',
4946
4958
  },
4959
+ '&:focus': {
4960
+ textDecoration: 'underline',
4961
+ outlineOffset: '2px',
4962
+ },
4947
4963
  },
4948
4964
  });
4949
4965
 
@@ -21772,7 +21788,11 @@ var ToolbarTitle = styled(NavLink)(function () { return ({
21772
21788
  fontWeight: 500,
21773
21789
  textDecoration: 'none',
21774
21790
  ':hover': {
21775
- textDecoration: 'none',
21791
+ textDecoration: 'underline',
21792
+ },
21793
+ ':focus': {
21794
+ outline: 'none',
21795
+ textDecoration: 'underline',
21776
21796
  },
21777
21797
  }); });
21778
21798
  var EnvironmentTitle = styled('div')(function () { return ({
@@ -21983,12 +22003,21 @@ var ToolbarMenuItem = styled(NavLink)(function (_a) {
21983
22003
  },
21984
22004
  ':focus': {
21985
22005
  outline: 'none',
22006
+ color: menuItemHoverGreen,
22007
+ ':after': {
22008
+ bottom: '-4px',
22009
+ opacity: '1',
22010
+ },
21986
22011
  },
21987
22012
  ':hover': {
21988
22013
  textDecoration: 'none',
21989
22014
  color: menuItemHoverGreen,
22015
+ ':after': {
22016
+ bottom: '-4px',
22017
+ opacity: '1',
22018
+ },
21990
22019
  },
21991
- '.active:after, :hover:after, focus:after': {
22020
+ '.active:after': {
21992
22021
  bottom: '-4px',
21993
22022
  opacity: '1',
21994
22023
  },
@@ -22074,7 +22103,7 @@ var AppBar = function (_a) {
22074
22103
  appTitle,
22075
22104
  !isProd && (React.createElement(EnvironmentTitle, null, process.env.REACT_APP_HOST)))),
22076
22105
  React.createElement(ToolbarRight, null,
22077
- React.createElement(Button$1, { onClick: _handleIconButtonClick },
22106
+ React.createElement(Button$1, { "aria-controls": userMenuAnchor ? 'basic-menu' : undefined, "aria-haspopup": "true", "aria-expanded": userMenuAnchor ? 'true' : undefined, onClick: _handleIconButtonClick },
22078
22107
  React.createElement(AccountCircle, { color: "primary", fontSize: "large" }),
22079
22108
  React.createElement(UserContainer, null,
22080
22109
  React.createElement(AccountName, null, username),
@@ -22087,15 +22116,17 @@ var AppBar = function (_a) {
22087
22116
  vertical: 'top',
22088
22117
  horizontal: 'center',
22089
22118
  } }, userMenuItems.map(function (i, index) {
22090
- return (React.createElement(Box, { key: i.id },
22091
- React.createElement(MenuItem$1, { key: i.id, onClick: function () {
22092
- setUserMenuAnchor(null);
22093
- i.action && i.action();
22094
- } }, i.isAnchor ? (React.createElement("a", { style: {
22095
- textDecoration: 'inherit',
22096
- color: 'inherit',
22097
- }, rel: "noreferrer", href: i.href }, i.label)) : (i.label)),
22098
- userMenuItems.length > index + 1 && React.createElement(Divider$1, null)));
22119
+ return (React.createElement(MenuItem$1, { key: i.id, onClick: function () {
22120
+ setUserMenuAnchor(null);
22121
+ i.action && i.action();
22122
+ }, divider: userMenuItems.length > index + 1, sx: {
22123
+ ':focus': {
22124
+ textDecoration: 'underline',
22125
+ },
22126
+ } }, i.isAnchor ? (React.createElement("a", { style: {
22127
+ textDecoration: 'inherit',
22128
+ color: 'inherit',
22129
+ }, rel: "noreferrer", href: i.href }, i.label)) : (i.label)));
22099
22130
  })))),
22100
22131
  React.createElement(ToolbarMenu, null,
22101
22132
  React.createElement(ToolbarMenuInner, null, menuItems.map(function (page) { return _renderToolbarMenuItem(page); }))),