grep-components 1.29.1-GREPF-2262.5 → 1.29.1-GREPF-2262.6

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.
@@ -12,19 +12,19 @@ export declare const dimensions: {
12
12
  toolbarMenuWidth: number;
13
13
  toolbarMenuHeight: number;
14
14
  };
15
- export declare const ToolbarTitle: import("@emotion/styled").StyledComponent<import("react-router-dom").NavLinkProps & import("react").RefAttributes<HTMLAnchorElement> & MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
16
- export declare const EnvironmentTitle: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
17
- export declare const Toolbar: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
18
- export declare const ToolbarFixer: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
19
- export declare const ToolbarInner: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material").Theme> & {
15
+ export declare const ToolbarTitle: import("@emotion/styled").StyledComponent<import("react-router-dom").NavLinkProps<unknown> & import("react").RefAttributes<HTMLAnchorElement> & MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
16
+ export declare const EnvironmentTitle: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
17
+ export declare const Toolbar: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
18
+ export declare const ToolbarFixer: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
19
+ export declare const ToolbarInner: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
20
20
  colors: v0colors;
21
21
  } & MUIStyledCommonProps<Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
22
- export declare const ToolbarLeft: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
23
- export declare const ToolbarRight: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
24
- export declare const UserContainer: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
25
- export declare const AccountName: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
26
- export declare const ToolbarMenu: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
27
- export declare const MobileToolbarMenu: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
28
- export declare const ToolbarMenuInner: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
29
- export declare const ToolbarMenuItem: import("@emotion/styled").StyledComponent<import("react-router-dom").NavLinkProps & import("react").RefAttributes<HTMLAnchorElement> & MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
30
- export declare const MobileToolbarMenuItem: import("@emotion/styled").StyledComponent<import("react-router-dom").NavLinkProps & import("react").RefAttributes<HTMLAnchorElement> & MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
22
+ export declare const ToolbarLeft: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
23
+ export declare const ToolbarRight: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
24
+ export declare const UserContainer: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
25
+ export declare const AccountName: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
26
+ export declare const ToolbarMenu: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
27
+ export declare const MobileToolbarMenu: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
28
+ export declare const ToolbarMenuInner: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
29
+ export declare const ToolbarMenuItem: import("@emotion/styled").StyledComponent<import("react-router-dom").NavLinkProps<unknown> & import("react").RefAttributes<HTMLAnchorElement> & MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
30
+ export declare const MobileToolbarMenuItem: import("@emotion/styled").StyledComponent<import("react-router-dom").NavLinkProps<unknown> & import("react").RefAttributes<HTMLAnchorElement> & MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
@@ -17,8 +17,6 @@ export declare const v0colors: {
17
17
  declare const _default: {
18
18
  title: string;
19
19
  excludeStories: string[];
20
- render: () => React.JSX.Element;
21
- decorators: import("@storybook/preview-api/dist/addons").MakeDecoratorResult[];
22
20
  };
23
21
  export default _default;
24
22
  export declare const WithContent: {
@@ -10,8 +10,6 @@ export declare const navbarPages: {
10
10
  declare const _default: {
11
11
  title: string;
12
12
  excludeStories: string[];
13
- render: () => React.JSX.Element;
14
- decorators: import("@storybook/preview-api/dist/addons").MakeDecoratorResult[];
15
13
  };
16
14
  export default _default;
17
15
  export declare const WithThemeAndAppbar: {
@@ -4,8 +4,6 @@ export declare const breadcrumbs: Breadcrumb[];
4
4
  declare const _default: {
5
5
  title: string;
6
6
  excludeStories: string[];
7
- render: () => React.JSX.Element;
8
- decorators: import("@storybook/preview-api/dist/addons").MakeDecoratorResult[];
9
7
  };
10
8
  export default _default;
11
9
  export declare const Standard: {
@@ -2,7 +2,6 @@ import React from 'react';
2
2
  declare const _default: {
3
3
  title: string;
4
4
  render: () => React.JSX.Element;
5
- decorators: import("@storybook/preview-api/dist/addons").MakeDecoratorResult[];
6
5
  };
7
6
  export default _default;
8
7
  export declare const Default: {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- declare const Scaffold: ({ children }: {
2
+ declare const _default: ({ children }: {
3
3
  children: React.ReactNode;
4
4
  }) => React.JSX.Element;
5
- export default Scaffold;
5
+ export default _default;
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  declare const _default: {
3
3
  title: string;
4
- decorators: import("@storybook/preview-api/dist/addons").MakeDecoratorResult[];
4
+ decorators: ((storyFn: any) => React.JSX.Element)[];
5
5
  };
6
6
  export default _default;
7
7
  export declare const Dashboard: {
package/dist/index.js CHANGED
@@ -7,18 +7,21 @@ import * as React from 'react';
7
7
  import React__default, { useRef, useMemo as useMemo$1, createContext, useContext, forwardRef, createElement, useState, useCallback as useCallback$1, useEffect, useLayoutEffect } from 'react';
8
8
  import AccountCircle from '@mui/icons-material/AccountCircle';
9
9
  import ArrowDropdown from '@mui/icons-material/ArrowDropDown';
10
- import { Button, Box, Typography, IconButton, Menu, MenuItem, Tabs, Tab, Collapse, MenuList, Tooltip, Container, List, ListItem, ListItemText, ListItemButton, styled, CircularProgress, Link, TextField, FormControl, InputLabel, Select, OutlinedInput, Input, Checkbox, FormHelperText, TableHead as TableHead$1, TableRow as TableRow$1, ToggleButtonGroup, AppBar as AppBar$1, Toolbar as Toolbar$1, Divider as Divider$1, Dialog, DialogTitle, DialogContent, DialogContentText, DialogActions } from '@mui/material';
11
- import { useTheme } from '@mui/material/styles';
10
+ import { Button, Box, Typography, Tabs, Tab, Collapse, MenuList, Tooltip, MenuItem as MenuItem$1, Menu as Menu$1, Container, List, ListItem, ListItemText, ListItemButton, CircularProgress, TextField, FormControl, InputLabel, Select, OutlinedInput, Input, Checkbox, FormHelperText, IconButton as IconButton$1, TableHead as TableHead$1, TableRow as TableRow$1, ToggleButtonGroup, AppBar as AppBar$1, Toolbar as Toolbar$1, Divider as Divider$1, Dialog as Dialog$1, DialogTitle as DialogTitle$1, DialogContent as DialogContent$1, DialogContentText as DialogContentText$1, DialogActions as DialogActions$1 } from '@mui/material';
11
+ import { useTheme, styled } from '@mui/material/styles';
12
12
  import { __unsafe_useEmotionCache } from '@emotion/react';
13
- import { useNavigate, NavLink } from 'react-router-dom';
13
+ import { useHistory, NavLink, Prompt } from 'react-router-dom';
14
14
  import MenuIcon from '@mui/icons-material/Menu';
15
+ import Box$1 from '@mui/material/Box';
16
+ import IconButton from '@mui/material/IconButton';
17
+ import Menu from '@mui/material/Menu';
18
+ import MenuItem from '@mui/material/MenuItem';
15
19
  import ExpandMore from '@mui/icons-material/ExpandMore';
16
20
  import List$1 from '@mui/material/List';
17
21
  import ListItem$1 from '@mui/material/ListItem';
18
22
  import ListItemText$1 from '@mui/material/ListItemText';
19
23
  import ListItemIcon from '@mui/material/ListItemIcon';
20
24
  import Divider from '@mui/material/Divider';
21
- import Box$1 from '@mui/material/Box';
22
25
  import Typography$1 from '@mui/material/Typography';
23
26
  import ArrowForward from '@mui/icons-material/ArrowForward';
24
27
  import MoreVert from '@mui/icons-material/MoreVert';
@@ -28,12 +31,12 @@ import TableBody from '@mui/material/TableBody';
28
31
  import TableFooter from '@mui/material/TableFooter';
29
32
  import TableContainer from '@mui/material/TableContainer';
30
33
  import Tooltip$1 from '@mui/material/Tooltip';
31
- import IconButton$1 from '@mui/material/IconButton';
32
34
  import TableCell from '@mui/material/TableCell';
33
35
  import TableHead from '@mui/material/TableHead';
34
36
  import TableSortLabel from '@mui/material/TableSortLabel';
35
37
  import TablePagination from '@mui/material/TablePagination';
36
38
  import Button$1 from '@mui/material/Button';
39
+ import Link from '@mui/material/Link';
37
40
  import Close from '@mui/icons-material/Close';
38
41
  import Search from '@mui/icons-material/Search';
39
42
  import CircularProgress$1 from '@mui/material/CircularProgress';
@@ -53,12 +56,13 @@ export { ContentState } from 'draft-js';
53
56
  import ToggleButton from '@mui/material/ToggleButton';
54
57
  import FormatBold from '@mui/icons-material/FormatBold';
55
58
  import FormatItalic from '@mui/icons-material/FormatItalic';
56
- import Menu$2 from '@mui/material/Menu';
57
- import MenuItem$1 from '@mui/material/MenuItem';
58
- import { Menu as Menu$1 } from '@mui/icons-material';
59
- import { useBlocker } from 'react-router';
59
+ import { Menu as Menu$2 } from '@mui/icons-material';
60
+ import Dialog from '@mui/material/Dialog';
61
+ import DialogActions from '@mui/material/DialogActions';
62
+ import DialogContent from '@mui/material/DialogContent';
63
+ import DialogContentText from '@mui/material/DialogContentText';
64
+ import DialogTitle from '@mui/material/DialogTitle';
60
65
  import { getHash, getLocation } from 'connected-react-router';
61
- import Link$1 from '@mui/material/Link';
62
66
 
63
67
  dayjs.extend(isBetweenPlugin);
64
68
  dayjs.extend(LocalizedFormatPlugin);
@@ -1625,7 +1629,7 @@ const useMobileStyles = makeStyles()(({ palette, breakpoints }) => ({
1625
1629
 
1626
1630
  const MobileAppBarNavList = ({ pages, }) => {
1627
1631
  const { classes } = useMobileStyles();
1628
- const navigate = useNavigate();
1632
+ const history = useHistory();
1629
1633
  const [anchorElNav, setAnchorElNav] = React.useState(null);
1630
1634
  const openNav = Boolean(anchorElNav);
1631
1635
  const handleClickNav = (event) => {
@@ -1634,15 +1638,15 @@ const MobileAppBarNavList = ({ pages, }) => {
1634
1638
  const handleCloseNav = () => {
1635
1639
  setAnchorElNav(null);
1636
1640
  };
1637
- return (React.createElement(Box, { style: { flexGrow: 1 }, className: classes.mobileNavList },
1641
+ return (React.createElement(Box$1, { style: { flexGrow: 1 }, className: classes.mobileNavList },
1638
1642
  React.createElement(IconButton, { size: "medium", edge: "start", color: "inherit", "aria-label": "menu", style: { marginRight: 2 }, onClick: handleClickNav },
1639
1643
  React.createElement(MenuIcon, { fontSize: "large" })),
1640
1644
  React.createElement(Menu, { id: "basic-menu", anchorEl: anchorElNav, open: openNav, onClose: handleCloseNav, MenuListProps: {
1641
1645
  'aria-labelledby': 'basic-button',
1642
1646
  } }, pages.map((page) => (React.createElement(MenuItem, { key: page.id, onClick: () => {
1643
1647
  handleCloseNav();
1644
- navigate(page?.toUrl || '');
1645
- }, onKeyDown: keyboard.onActivation(() => navigate(page?.toUrl || '')) }, page.label))))));
1648
+ history.push(page?.toUrl || '');
1649
+ }, onKeyDown: keyboard.onActivation(() => history.push(page?.toUrl || '')) }, page.label))))));
1646
1650
  };
1647
1651
 
1648
1652
  const AppBarNavList = ({ selectedPage, pages, onChange, }) => {
@@ -1771,9 +1775,9 @@ const CollapsableMenuItem = ({ items, onClick, children, onClose: _onclose, tool
1771
1775
  items && React__default.createElement(ExpandMore, { className: classes.expander })),
1772
1776
  items && (React__default.createElement(CollapsableMenu, { className: classes.subMenu, in: open, onMenuClose: collapse, onEntered: () => requestAnimationFrame(() => window.dispatchEvent(new Event('resize'))) }, items))));
1773
1777
  return tooltipText ? (React__default.createElement(Tooltip, { title: tooltipText },
1774
- React__default.createElement(MenuItem, { role: "menuitem", sx: disabled && !items
1778
+ React__default.createElement(MenuItem$1, { role: "menuitem", sx: disabled && !items
1775
1779
  ? { cursor: 'not-allowed', pointerEvents: 'inherit !important' }
1776
- : { pointerEvents: 'inherit !important' }, className: classes.root, onMouseOver: (e) => e.currentTarget.focus(), selected: open, ref: listItemRef, onClick: handleClick, onKeyDown: handleKey }, renderInner()))) : (React__default.createElement(MenuItem, { sx: disabled && !items ? { cursor: 'not-allowed' } : {}, className: classes.root, onMouseOver: (e) => e.currentTarget.focus(), ref: listItemRef, selected: open, onClick: handleClick, onKeyDown: handleKey, ...props }, renderInner()));
1780
+ : { pointerEvents: 'inherit !important' }, className: classes.root, onMouseOver: (e) => e.currentTarget.focus(), selected: open, ref: listItemRef, onClick: handleClick, onKeyDown: handleKey }, renderInner()))) : (React__default.createElement(MenuItem$1, { sx: disabled && !items ? { cursor: 'not-allowed' } : {}, className: classes.root, onMouseOver: (e) => e.currentTarget.focus(), ref: listItemRef, selected: open, onClick: handleClick, onKeyDown: handleKey, ...props }, renderInner()));
1777
1781
  };
1778
1782
 
1779
1783
  const useStyles$f = makeStyles()(({ palette }) => ({
@@ -1813,7 +1817,7 @@ const DropdownMenu = ({ context, menuItems, ...menuProps }) => {
1813
1817
  return (React__default.createElement(CollapsableMenuItem, { sx: isDisabled && !children ? { cursor: 'not-allowed' } : {}, level: level, id: label, disabled: isDisabled, items: children?.map(renderChild(level + 1, isDisabled)), ...props },
1814
1818
  React__default.createElement("span", { style: style }, label)));
1815
1819
  };
1816
- return (React__default.createElement(Menu, { ...menuProps, anchorOrigin: menuProps?.anchorOrigin || {
1820
+ return (React__default.createElement(Menu$1, { ...menuProps, anchorOrigin: menuProps?.anchorOrigin || {
1817
1821
  vertical: 'bottom',
1818
1822
  horizontal: 'center',
1819
1823
  }, transformOrigin: menuProps.transformOrigin || {
@@ -2250,7 +2254,7 @@ const GrepTable = ({ placeholderText, dropdownItems, isRowDisabled, pagination,
2250
2254
  const tooltip = menuTooltip ? menuTooltip(row) : '';
2251
2255
  return (React__default.createElement(Tooltip$1, { title: tooltip, placement: "bottom" },
2252
2256
  React__default.createElement("div", { style: { display: 'flex', justifyContent: 'end' } },
2253
- React__default.createElement(IconButton$1, { disableTouchRipple: true, disabled: disabled, style: { float: 'right' }, onMouseDown: (e) => {
2257
+ React__default.createElement(IconButton, { disableTouchRipple: true, disabled: disabled, style: { float: 'right' }, onMouseDown: (e) => {
2254
2258
  e.preventDefault();
2255
2259
  e.stopPropagation();
2256
2260
  }, onClick: (e) => {
@@ -2423,7 +2427,7 @@ const useStyles$b = makeStyles()({
2423
2427
  const isOverflowing = (e) => e.offsetWidth < e.scrollWidth;
2424
2428
  const GrepCrumbs = ({ style, onClick, breadcrumbs, }) => {
2425
2429
  const { classes } = useStyles$b();
2426
- const navigate = useNavigate();
2430
+ const history = useHistory();
2427
2431
  const ref = React__default.useRef(null);
2428
2432
  const [showTooltip, setShowTooltip] = React__default.useState(false);
2429
2433
  React__default.useEffect(() => {
@@ -2435,12 +2439,12 @@ const GrepCrumbs = ({ style, onClick, breadcrumbs, }) => {
2435
2439
  onClick(crumb);
2436
2440
  }
2437
2441
  else {
2438
- crumb.path && navigate(crumb.path);
2442
+ crumb.path && history.push(crumb.path);
2439
2443
  }
2440
2444
  };
2441
- return (React__default.createElement("div", { className: classes.container, style: style }, breadcrumbs.map((crumb, index) => crumb.path ? (React__default.createElement(Box, { key: index, display: "flex" },
2445
+ return (React__default.createElement("div", { className: classes.container, style: style }, breadcrumbs.map((crumb, index) => crumb.path ? (React__default.createElement(Box$1, { key: index, display: "flex" },
2442
2446
  React__default.createElement(Link, { className: classes.link, tabIndex: 0, component: "button", onClick: () => handleClick(crumb) }, crumb.label),
2443
- index !== breadcrumbs.length - 1 && (React__default.createElement(Box, { margin: "auto 8px", height: "fit-content" /*lineHeight="20px"*/ }, ">")))) : (React__default.createElement(Tooltip, { key: index, title: showTooltip ? crumb.label : '' },
2447
+ index !== breadcrumbs.length - 1 && (React__default.createElement(Box$1, { margin: "auto 8px", height: "fit-content" /*lineHeight="20px"*/ }, ">")))) : (React__default.createElement(Tooltip$1, { key: index, title: showTooltip ? crumb.label : '' },
2444
2448
  React__default.createElement("div", { className: classes.current, ref: ref }, crumb.label))))));
2445
2449
  };
2446
2450
 
@@ -2623,9 +2627,9 @@ const GrepSelect = (props) => {
2623
2627
  horizontal: 'center',
2624
2628
  },
2625
2629
  } },
2626
- unselectOption && (React.createElement(MenuItem, { value: "" },
2630
+ unselectOption && (React.createElement(MenuItem$1, { value: "" },
2627
2631
  React.createElement("em", null, "Fjern valgt"))),
2628
- selectItems.map(({ label, value, disabled, lang }, i) => (React.createElement(MenuItem, { key: i, value: value, disabled: disabled, lang: lang },
2632
+ selectItems.map(({ label, value, disabled, lang }, i) => (React.createElement(MenuItem$1, { key: i, value: value, disabled: disabled, lang: lang },
2629
2633
  useCheckedSelect && (React.createElement(Checkbox, { checked: selected?.indexOf(value) > -1 })),
2630
2634
  React.createElement(ListItemText, { sx: { margin: '0px', span: { lineHeight: '1.4375em' } }, primary: label ? label : value }))))),
2631
2635
  React.createElement(FormHelperText, null, errorMessage || helperText)));
@@ -3326,7 +3330,7 @@ const ServiceMessage = ({ id, message, isPublic, onDismiss }) => {
3326
3330
  React.createElement(Warning, { className: classes.warning }),
3327
3331
  "Driftsmelding"),
3328
3332
  React.createElement(Typography, { className: classes.messageText }, message),
3329
- !isPublic && onDismiss && (React.createElement(IconButton, { className: classes.button, onClick: () => onDismiss(id), size: "large" },
3333
+ !isPublic && onDismiss && (React.createElement(IconButton$1, { className: classes.button, onClick: () => onDismiss(id), size: "large" },
3330
3334
  React.createElement(Close, { className: classes.close })))));
3331
3335
  };
3332
3336
 
@@ -19520,20 +19524,20 @@ const MobileAppBar = ({ userMenuItems, menuItems, }) => {
19520
19524
  return (React.createElement(MobileToolbarMenu, { style: { flexGrow: 1 } },
19521
19525
  React.createElement(AppBar$1, { position: "static", role: "navigation" },
19522
19526
  React.createElement(Toolbar$1, { style: { minHeight: '50px' } },
19523
- React.createElement(IconButton, { size: "medium", edge: "start", color: "inherit", "aria-label": "menu", style: { marginRight: 2 }, onClick: handleClickNav },
19524
- React.createElement(Menu$1, { sx: { color: 'white' } })),
19525
- React.createElement(Menu, { id: "basic-menu", anchorEl: anchorElNav, open: openNav, onClose: handleCloseNav, MenuListProps: {
19527
+ React.createElement(IconButton$1, { size: "medium", edge: "start", color: "inherit", "aria-label": "menu", style: { marginRight: 2 }, onClick: handleClickNav },
19528
+ React.createElement(Menu$2, { sx: { color: 'white' } })),
19529
+ React.createElement(Menu$1, { id: "basic-menu", anchorEl: anchorElNav, open: openNav, onClose: handleCloseNav, MenuListProps: {
19526
19530
  'aria-labelledby': 'basic-button',
19527
19531
  } }, menuItems.map((page) => (React.createElement(MobileToolbarMenuItem, { key: page.name, to: page.redirectUrl || '' },
19528
- React.createElement(MenuItem, { sx: {
19532
+ React.createElement(MenuItem$1, { sx: {
19529
19533
  width: '100%',
19530
19534
  }, key: page.name }, page.translatedTextRef))))),
19531
- React.createElement(IconButton, { size: "medium", edge: "end", color: "inherit", "aria-label": "menu", style: { marginLeft: 'auto' }, onClick: handleClickMenu },
19535
+ React.createElement(IconButton$1, { size: "medium", edge: "end", color: "inherit", "aria-label": "menu", style: { marginLeft: 'auto' }, onClick: handleClickMenu },
19532
19536
  React.createElement(MoreVert, { sx: { color: 'white' } })),
19533
- React.createElement(Menu, { id: "basic-menu", anchorEl: anchorElMenu, open: openMenu, onClose: handleCloseMenu, MenuListProps: {
19537
+ React.createElement(Menu$1, { id: "basic-menu", anchorEl: anchorElMenu, open: openMenu, onClose: handleCloseMenu, MenuListProps: {
19534
19538
  'aria-labelledby': 'basic-button',
19535
19539
  } }, userMenuItems.map((i, index) => (React.createElement(Box, { key: i.id },
19536
- React.createElement(MenuItem, { key: i.id, onClick: () => {
19540
+ React.createElement(MenuItem$1, { key: i.id, onClick: () => {
19537
19541
  handleCloseMenu();
19538
19542
  i.action && i.action();
19539
19543
  } }, i.isAnchor ? (React.createElement("a", { style: {
@@ -19572,14 +19576,14 @@ const AppBar = ({ username, currentPath, isProd, appTitle, userMenuItems, menuIt
19572
19576
  React.createElement(AccountName, null, username),
19573
19577
  userRole && (React.createElement(Box, { sx: { fontSize: '14px', lineHeight: '20px' } }, userRole))),
19574
19578
  React.createElement(ArrowDropdown, { color: "primary" })),
19575
- React.createElement(Menu$2, { open: Boolean(userMenuAnchor), anchorEl: userMenuAnchor, onClose: _handleCloseUserMenu, anchorOrigin: {
19579
+ React.createElement(Menu, { open: Boolean(userMenuAnchor), anchorEl: userMenuAnchor, onClose: _handleCloseUserMenu, anchorOrigin: {
19576
19580
  vertical: 'bottom',
19577
19581
  horizontal: 'center',
19578
19582
  }, transformOrigin: {
19579
19583
  vertical: 'top',
19580
19584
  horizontal: 'center',
19581
19585
  } }, userMenuItems.map((i, index) => {
19582
- return (React.createElement(MenuItem$1, { key: i.id, onClick: () => {
19586
+ return (React.createElement(MenuItem, { key: i.id, onClick: () => {
19583
19587
  setUserMenuAnchor(null);
19584
19588
  i.action && i.action();
19585
19589
  }, divider: userMenuItems.length > index + 1, sx: {
@@ -19598,35 +19602,43 @@ const AppBar = ({ username, currentPath, isProd, appTitle, userMenuItems, menuIt
19598
19602
 
19599
19603
  const NavGuard = ({ when, title, txt, txtSave, txtCancel, txtDiscard, onSave, onCancel, onDiscard, }) => {
19600
19604
  const [open, setOpen] = React.useState(false);
19601
- const blocker = useBlocker(({ currentLocation, nextLocation }) => when && currentLocation.pathname !== nextLocation.pathname);
19605
+ const [leave, setLeave] = React.useState(false);
19606
+ const [lastLocation, setLastLocation] = React.useState();
19607
+ const history = useHistory();
19602
19608
  const handleCancel = () => {
19609
+ setLeave(false);
19603
19610
  setOpen(false);
19604
19611
  onCancel && onCancel();
19605
- blocker.reset ? blocker.reset() : null;
19606
19612
  };
19607
19613
  const handleDiscard = () => {
19614
+ setLeave(true);
19608
19615
  setOpen(false);
19609
19616
  onDiscard && onDiscard();
19610
- blocker.proceed ? blocker.proceed() : null;
19617
+ lastLocation &&
19618
+ window.requestAnimationFrame(() => history.push(lastLocation));
19611
19619
  };
19612
19620
  const handleSave = () => {
19613
19621
  onSave && onSave();
19622
+ setLeave(true);
19614
19623
  setOpen(false);
19615
- blocker.proceed ? blocker.proceed() : null;
19624
+ lastLocation &&
19625
+ window.requestAnimationFrame(() => history.push(lastLocation));
19616
19626
  };
19617
- useEffect(() => {
19618
- if (blocker.state === 'blocked') {
19619
- setOpen(true);
19620
- }
19621
- }, [blocker]);
19622
- return (React.createElement(React.Fragment, null, blocker.state === 'blocked' ? (React.createElement(Dialog, { open: open, "aria-labelledby": "alert-dialog-title", "aria-describedby": "alert-dialog-description" },
19623
- React.createElement(DialogTitle, { id: "alert-dialog-title" }, title),
19624
- React.createElement(DialogContent, null,
19625
- React.createElement(DialogContentText, { id: "alert-dialog-description" }, txt)),
19626
- React.createElement(DialogActions, null,
19627
- React.createElement(Button, { onClick: handleCancel, autoFocus: true, color: "inherit" }, txtCancel),
19628
- React.createElement(Button, { onClick: handleDiscard, color: "error" }, txtDiscard),
19629
- onSave && (React.createElement(Button, { onClick: handleSave, color: "primary" }, txtSave))))) : null));
19627
+ const handleLeave = (location) => {
19628
+ setLastLocation(location);
19629
+ setOpen(!leave);
19630
+ return !!leave;
19631
+ };
19632
+ return (React.createElement(React.Fragment, null,
19633
+ React.createElement(Prompt, { when: when, message: handleLeave }),
19634
+ React.createElement(Dialog, { open: open, "aria-labelledby": "alert-dialog-title", "aria-describedby": "alert-dialog-description" },
19635
+ React.createElement(DialogTitle, { id: "alert-dialog-title" }, title),
19636
+ React.createElement(DialogContent, null,
19637
+ React.createElement(DialogContentText, { id: "alert-dialog-description" }, txt)),
19638
+ React.createElement(DialogActions, null,
19639
+ React.createElement(Button$1, { onClick: handleCancel, autoFocus: true, color: "inherit" }, txtCancel),
19640
+ React.createElement(Button$1, { onClick: handleDiscard, color: "error" }, txtDiscard),
19641
+ onSave && (React.createElement(Button$1, { onClick: handleSave, color: "primary" }, txtSave))))));
19630
19642
  };
19631
19643
 
19632
19644
  const useStyles$3 = makeStyles()(({ palette }) => ({
@@ -19640,11 +19652,11 @@ const useStyles$3 = makeStyles()(({ palette }) => ({
19640
19652
 
19641
19653
  const ConfirmationDialog = ({ open, title, description, warning, onSubmit, onCancel, confirmText = 'OK', cancelText = 'Avbryt', }) => {
19642
19654
  const { classes } = useStyles$3();
19643
- return (React__default.createElement(Dialog, { open: open },
19644
- React__default.createElement(DialogTitle, null, title),
19645
- React__default.createElement(DialogContent, null,
19646
- React__default.createElement(DialogContentText, null, description)),
19647
- React__default.createElement(DialogActions, null,
19655
+ return (React__default.createElement(Dialog$1, { open: open },
19656
+ React__default.createElement(DialogTitle$1, null, title),
19657
+ React__default.createElement(DialogContent$1, null,
19658
+ React__default.createElement(DialogContentText$1, null, description)),
19659
+ React__default.createElement(DialogActions$1, null,
19648
19660
  React__default.createElement(Button, { color: "primary", onClick: onCancel }, cancelText),
19649
19661
  React__default.createElement(Button, { className: warning ? classes.discard : '', onClick: onSubmit }, confirmText))));
19650
19662
  };
@@ -19680,10 +19692,10 @@ const GrepDialog = ({ open, title, content, onClose, closeBtnText = 'Lukk', ...p
19680
19692
  ];
19681
19693
  if (props.actions)
19682
19694
  actions.push(...props.actions);
19683
- return (React__default.createElement(Dialog, { open: open, onClose: onClose },
19684
- React__default.createElement(DialogTitle, null, title),
19685
- React__default.createElement(DialogContent, null, content),
19686
- React__default.createElement(DialogActions, null, actions.map((action) => action))));
19695
+ return (React__default.createElement(Dialog$1, { open: open, onClose: onClose },
19696
+ React__default.createElement(DialogTitle$1, null, title),
19697
+ React__default.createElement(DialogContent$1, null, content),
19698
+ React__default.createElement(DialogActions$1, null, actions.map((action) => action))));
19687
19699
  };
19688
19700
 
19689
19701
  const GrepDialogServiceContext = React__default.createContext(() => null);
@@ -20310,7 +20322,7 @@ const GrepTableOfContentNavTreeNode = (props) => {
20310
20322
  }
20311
20323
  };
20312
20324
  return (React__default.createElement("li", { key: index, "data-lvl": lvl, className: className, style: style },
20313
- React__default.createElement(Link$1, { ref: linkRef, className: clsx(styles.link, isSelected && `${styles.link}--selected`), href: url, tabIndex: tabIndex, onClick: (event) => {
20325
+ React__default.createElement(Link, { ref: linkRef, className: clsx(styles.link, isSelected && `${styles.link}--selected`), href: url, tabIndex: tabIndex, onClick: (event) => {
20314
20326
  console.debug('node click', node);
20315
20327
  event.preventDefault();
20316
20328
  event.stopPropagation();