grep-components 1.17.0-grepf-1778.1 → 1.17.0-grepf-1779.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,7 +7,6 @@ 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;
|
|
11
10
|
}
|
|
12
11
|
declare type Component<T> = React.FunctionComponent<Properties<T>>;
|
|
13
12
|
export declare const GrepTableRow: Component<any>;
|
|
@@ -41,7 +41,6 @@ export interface GrepTableProps<T> extends Pick<TableProps, 'size' | 'stickyHead
|
|
|
41
41
|
*/
|
|
42
42
|
rowHeight?: number;
|
|
43
43
|
disableSelectOnClick?: boolean;
|
|
44
|
-
underlineOnFocus?: boolean;
|
|
45
44
|
}
|
|
46
45
|
interface StyleProps {
|
|
47
46
|
outlined?: boolean;
|
|
@@ -65,6 +64,6 @@ export declare const useStyles: (params: StyleProps, styleOverrides?: {
|
|
|
65
64
|
* @todo enhance page handling
|
|
66
65
|
*
|
|
67
66
|
*/
|
|
68
|
-
export declare const GrepTable: <T>({ placeholderText, dropdownItems, isRowDisabled, pagination, outlined, columns, header, data, onSelectedRowChange, sortBy, sortDirection, onSortBy, onRowClick, size, caption, stickyHeader, padding, disableSelectOnClick,
|
|
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;
|
|
69
68
|
export { GrepTableRow };
|
|
70
69
|
export default GrepTable;
|
package/dist/index.js
CHANGED
|
@@ -39,6 +39,7 @@ 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';
|
|
42
43
|
import Menu$2 from '@mui/material/Menu';
|
|
43
44
|
import MenuItem$1 from '@mui/material/MenuItem';
|
|
44
45
|
import Button$1 from '@mui/material/Button';
|
|
@@ -4390,13 +4391,7 @@ var useFooterStyles = makeStyles()(function (theme) {
|
|
|
4390
4391
|
_a),
|
|
4391
4392
|
content: (_b = {
|
|
4392
4393
|
display: 'flex',
|
|
4393
|
-
width: '100%'
|
|
4394
|
-
a: {
|
|
4395
|
-
':focus': {
|
|
4396
|
-
outlineColor: 'white',
|
|
4397
|
-
outlineOffset: '8px',
|
|
4398
|
-
},
|
|
4399
|
-
}
|
|
4394
|
+
width: '100%'
|
|
4400
4395
|
},
|
|
4401
4396
|
_b[theme.breakpoints.down('md')] = {
|
|
4402
4397
|
flexDirection: 'column',
|
|
@@ -4449,11 +4444,6 @@ var useFooterStyles = makeStyles()(function (theme) {
|
|
|
4449
4444
|
_e['&:last-child'] = {
|
|
4450
4445
|
border: '0 !important',
|
|
4451
4446
|
},
|
|
4452
|
-
_e[':focus'] = {
|
|
4453
|
-
background: 'inherit',
|
|
4454
|
-
boxShadow: '0px 0px 0px 1px white',
|
|
4455
|
-
borderRadius: '2px',
|
|
4456
|
-
},
|
|
4457
4447
|
_e),
|
|
4458
4448
|
itemText: {
|
|
4459
4449
|
padding: 0,
|
|
@@ -4477,7 +4467,7 @@ var Footer = function (_a) {
|
|
|
4477
4467
|
var renderItem = function (text) { return (React__default.createElement(ListItemText, { className: classes.itemText, primary: text, primaryTypographyProps: {
|
|
4478
4468
|
style: { fontSize: 14, fontFamily: 'Montserrat', fontWeight: 400 },
|
|
4479
4469
|
} })); };
|
|
4480
|
-
return (React__default.createElement(Box, { className: classes.footer },
|
|
4470
|
+
return (React__default.createElement(Box, { className: classes.footer, role: "contentinfo" },
|
|
4481
4471
|
React__default.createElement(Box, { className: classes.content },
|
|
4482
4472
|
React__default.createElement("a", { href: udirLink },
|
|
4483
4473
|
React__default.createElement("img", { src: udirLogo, alt: "Utdanningsdirektoratet logo", style: { height: '43px', width: '150px' } })),
|
|
@@ -4577,11 +4567,9 @@ var GrepTableRow$1 = function (_a) {
|
|
|
4577
4567
|
};
|
|
4578
4568
|
|
|
4579
4569
|
var GrepTableRow = function (_a) {
|
|
4580
|
-
var row = _a.row, columns = _a.columns, selected = _a.selected, variant = _a.variant; _a.clickable; _a.height; var
|
|
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"]);
|
|
4581
4571
|
var render = function (column, index) { return (React__default.createElement(GrepTableRow$1, __assign({ key: index }, { column: column, row: row, variant: variant, selected: selected }))); };
|
|
4582
|
-
return
|
|
4583
|
-
':focus': { textDecoration: underlineOnFocus ? 'underline' : 'none' },
|
|
4584
|
-
} }, __assign({ selected: selected }, props)), columns.map(render)));
|
|
4572
|
+
return React__default.createElement(TableRow, __assign({}, __assign({ selected: selected }, props)), columns.map(render));
|
|
4585
4573
|
};
|
|
4586
4574
|
|
|
4587
4575
|
var usePaginationActionStyles = makeStyles()(function (_a) {
|
|
@@ -4746,7 +4734,7 @@ var getElementIndex = function (el) {
|
|
|
4746
4734
|
*
|
|
4747
4735
|
*/
|
|
4748
4736
|
var GrepTable = function (_a) {
|
|
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,
|
|
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"]);
|
|
4750
4738
|
var _c = __read(React__default.useState(props.rowsPerPage || 10), 2), rowsPerPage = _c[0], setRowsPerPage = _c[1];
|
|
4751
4739
|
var _d = __read(React__default.useState(null), 2), menuAnchor = _d[0], setMenuAnchor = _d[1];
|
|
4752
4740
|
var _e = __read(React__default.useState(0), 2), currentPage = _e[0], _setCurrentPage = _e[1];
|
|
@@ -4844,7 +4832,7 @@ var GrepTable = function (_a) {
|
|
|
4844
4832
|
}, columns: rowColumns, row: row, style: { cursor: clickableRows && !disabled ? 'pointer' : '' }, onFocus: function (_a) {
|
|
4845
4833
|
var currentTarget = _a.currentTarget;
|
|
4846
4834
|
return setSelectedElement(currentTarget);
|
|
4847
|
-
}
|
|
4835
|
+
} }));
|
|
4848
4836
|
};
|
|
4849
4837
|
var onKey = function (e) {
|
|
4850
4838
|
var maxIndex = data.length - 1;
|
|
@@ -4956,10 +4944,6 @@ var useStyles$b = makeStyles()({
|
|
|
4956
4944
|
'&:hover': {
|
|
4957
4945
|
textDecoration: 'underline',
|
|
4958
4946
|
},
|
|
4959
|
-
'&:focus': {
|
|
4960
|
-
textDecoration: 'underline',
|
|
4961
|
-
outlineOffset: '2px',
|
|
4962
|
-
},
|
|
4963
4947
|
},
|
|
4964
4948
|
});
|
|
4965
4949
|
|
|
@@ -5035,7 +5019,7 @@ var SearchBar = function (props) {
|
|
|
5035
5019
|
} },
|
|
5036
5020
|
React.createElement(Box, { className: classes.icon },
|
|
5037
5021
|
React.createElement(Search, null)),
|
|
5038
|
-
React.createElement(TextField, { className: classes.input, value: value, variant: "standard", inputRef: inputRef, onChange: _handleChange, autoFocus: props.autoFocus, placeholder: props.placeholder, InputProps: { disableUnderline: true, fullWidth: true } }),
|
|
5022
|
+
React.createElement(TextField, { role: "search", className: classes.input, value: value, variant: "standard", inputRef: inputRef, onChange: _handleChange, autoFocus: props.autoFocus, placeholder: props.placeholder, InputProps: { disableUnderline: true, fullWidth: true } }),
|
|
5039
5023
|
React.createElement(Box, { className: classes.icon, style: { cursor: 'pointer' } }, !!value.length && (React.createElement(Close, { "data-testid": "searchBarClearBtn", tabIndex: 0, onClick: _handleClear, onKeyPress: keyboard.onActivation(_handleClear) })))),
|
|
5040
5024
|
React.createElement("div", { style: { display: 'flex', alignItems: 'center' } },
|
|
5041
5025
|
props.helpText && (React.createElement(Typography, { className: classes.helptext }, props.helpText)),
|
|
@@ -21788,11 +21772,7 @@ var ToolbarTitle = styled(NavLink)(function () { return ({
|
|
|
21788
21772
|
fontWeight: 500,
|
|
21789
21773
|
textDecoration: 'none',
|
|
21790
21774
|
':hover': {
|
|
21791
|
-
textDecoration: '
|
|
21792
|
-
},
|
|
21793
|
-
':focus': {
|
|
21794
|
-
outline: 'none',
|
|
21795
|
-
textDecoration: 'underline',
|
|
21775
|
+
textDecoration: 'none',
|
|
21796
21776
|
},
|
|
21797
21777
|
}); });
|
|
21798
21778
|
var EnvironmentTitle = styled('div')(function () { return ({
|
|
@@ -22003,21 +21983,12 @@ var ToolbarMenuItem = styled(NavLink)(function (_a) {
|
|
|
22003
21983
|
},
|
|
22004
21984
|
':focus': {
|
|
22005
21985
|
outline: 'none',
|
|
22006
|
-
color: menuItemHoverGreen,
|
|
22007
|
-
':after': {
|
|
22008
|
-
bottom: '-4px',
|
|
22009
|
-
opacity: '1',
|
|
22010
|
-
},
|
|
22011
21986
|
},
|
|
22012
21987
|
':hover': {
|
|
22013
21988
|
textDecoration: 'none',
|
|
22014
21989
|
color: menuItemHoverGreen,
|
|
22015
|
-
':after': {
|
|
22016
|
-
bottom: '-4px',
|
|
22017
|
-
opacity: '1',
|
|
22018
|
-
},
|
|
22019
21990
|
},
|
|
22020
|
-
'.active:after': {
|
|
21991
|
+
'.active:after, :hover:after, focus:after': {
|
|
22021
21992
|
bottom: '-4px',
|
|
22022
21993
|
opacity: '1',
|
|
22023
21994
|
},
|
|
@@ -22054,7 +22025,7 @@ var MobileAppBar = function (_a) {
|
|
|
22054
22025
|
setAnchorElMenu(null);
|
|
22055
22026
|
};
|
|
22056
22027
|
return (React.createElement(MobileToolbarMenu, { style: { flexGrow: 1 } },
|
|
22057
|
-
React.createElement(AppBar$1, { position: "static" },
|
|
22028
|
+
React.createElement(AppBar$1, { position: "static", role: "nav" },
|
|
22058
22029
|
React.createElement(Toolbar$1, { style: { minHeight: '50px' } },
|
|
22059
22030
|
React.createElement(IconButton, { size: "medium", edge: "start", color: "inherit", "aria-label": "menu", style: { marginRight: 2 }, onClick: handleClickNav },
|
|
22060
22031
|
React.createElement(Menu$1, { sx: { color: 'white' } })),
|
|
@@ -22097,13 +22068,13 @@ var AppBar = function (_a) {
|
|
|
22097
22068
|
};
|
|
22098
22069
|
return (React.createElement(Toolbar, null,
|
|
22099
22070
|
React.createElement(ToolbarFixer, null,
|
|
22100
|
-
React.createElement(ToolbarInner, { colors: colors },
|
|
22071
|
+
React.createElement(ToolbarInner, { colors: colors, role: "header" },
|
|
22101
22072
|
React.createElement(ToolbarLeft, null,
|
|
22102
22073
|
React.createElement(ToolbarTitle, { to: '/' },
|
|
22103
22074
|
appTitle,
|
|
22104
22075
|
!isProd && (React.createElement(EnvironmentTitle, null, process.env.REACT_APP_HOST)))),
|
|
22105
22076
|
React.createElement(ToolbarRight, null,
|
|
22106
|
-
React.createElement(Button$1, {
|
|
22077
|
+
React.createElement(Button$1, { onClick: _handleIconButtonClick },
|
|
22107
22078
|
React.createElement(AccountCircle, { color: "primary", fontSize: "large" }),
|
|
22108
22079
|
React.createElement(UserContainer, null,
|
|
22109
22080
|
React.createElement(AccountName, null, username),
|
|
@@ -22116,19 +22087,17 @@ var AppBar = function (_a) {
|
|
|
22116
22087
|
vertical: 'top',
|
|
22117
22088
|
horizontal: 'center',
|
|
22118
22089
|
} }, userMenuItems.map(function (i, index) {
|
|
22119
|
-
return (React.createElement(
|
|
22120
|
-
|
|
22121
|
-
|
|
22122
|
-
|
|
22123
|
-
|
|
22124
|
-
textDecoration: '
|
|
22125
|
-
|
|
22126
|
-
|
|
22127
|
-
|
|
22128
|
-
color: 'inherit',
|
|
22129
|
-
}, rel: "noreferrer", href: i.href }, i.label)) : (i.label)));
|
|
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)));
|
|
22130
22099
|
})))),
|
|
22131
|
-
React.createElement(ToolbarMenu,
|
|
22100
|
+
React.createElement(ToolbarMenu, { role: "nav" },
|
|
22132
22101
|
React.createElement(ToolbarMenuInner, null, menuItems.map(function (page) { return _renderToolbarMenuItem(page); }))),
|
|
22133
22102
|
React.createElement(MobileAppBar, { menuItems: menuItems, userMenuItems: userMenuItems, colors: colors }))));
|
|
22134
22103
|
};
|