grep-components 1.20.0-grepf-1813.1 → 1.20.0-grepf-1803.2
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.
- package/dist/components/GrepEditor/components/editor.d.ts +1 -0
- package/dist/components/GrepSelect/index.d.ts +3 -1
- package/dist/components/GrepTable/components/grep-table-header-cell.d.ts +1 -0
- package/dist/components/GrepTable/components/grep-table-row.d.ts +1 -0
- package/dist/components/GrepTable/index.d.ts +4 -1
- package/dist/components/SearchBar/index.d.ts +2 -0
- package/dist/index.js +93 -49
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { SelectProps } from '@mui/material';
|
|
2
|
+
import { SelectProps, InputBaseComponentProps } from '@mui/material';
|
|
3
3
|
export interface SelectItem {
|
|
4
4
|
value: string | number;
|
|
5
5
|
label?: string;
|
|
6
6
|
disabled?: boolean;
|
|
7
|
+
lang?: string;
|
|
7
8
|
}
|
|
8
9
|
export interface GrepSelectProps extends SelectProps {
|
|
9
10
|
label: string;
|
|
@@ -13,6 +14,7 @@ export interface GrepSelectProps extends SelectProps {
|
|
|
13
14
|
selectItems: SelectItem[];
|
|
14
15
|
unselectOption?: boolean;
|
|
15
16
|
useCheckedSelect?: boolean;
|
|
17
|
+
inputProps?: InputBaseComponentProps | undefined;
|
|
16
18
|
}
|
|
17
19
|
declare const _default: React.ComponentType<GrepSelectProps>;
|
|
18
20
|
export default _default;
|
|
@@ -4,6 +4,7 @@ import { TableColumn } from '..';
|
|
|
4
4
|
interface Properties<T> extends TableSortLabelProps {
|
|
5
5
|
column: TableColumn<T>;
|
|
6
6
|
onSortBy?: (row: T) => void;
|
|
7
|
+
empty?: boolean;
|
|
7
8
|
}
|
|
8
9
|
declare type Component<T> = React.FunctionComponent<Properties<T>>;
|
|
9
10
|
export declare const TableHeaderCell: Component<any>;
|
|
@@ -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>;
|
|
@@ -11,6 +11,7 @@ export interface TableColumn<T> extends Pick<TableCellProps, 'padding' | 'sx'> {
|
|
|
11
11
|
getTooltip?: (row: T) => string;
|
|
12
12
|
getCell: (row: T) => string | number | boolean | JSX.Element;
|
|
13
13
|
lines?: (row: T) => number;
|
|
14
|
+
lang?: string | ((row: T) => string);
|
|
14
15
|
}
|
|
15
16
|
export interface GrepTableProps<T> extends Pick<TableProps, 'size' | 'stickyHeader' | 'padding'> {
|
|
16
17
|
data: T[];
|
|
@@ -36,11 +37,13 @@ export interface GrepTableProps<T> extends Pick<TableProps, 'size' | 'stickyHead
|
|
|
36
37
|
onContextIdChanged?: (row: T) => void;
|
|
37
38
|
onSortBy?: (col: TableColumn<T>) => any;
|
|
38
39
|
caption?: React.ReactNode;
|
|
40
|
+
menuButtonLabel?: string;
|
|
39
41
|
/**
|
|
40
42
|
* @deprecated No longer in use.
|
|
41
43
|
*/
|
|
42
44
|
rowHeight?: number;
|
|
43
45
|
disableSelectOnClick?: boolean;
|
|
46
|
+
underlineOnFocus?: boolean;
|
|
44
47
|
}
|
|
45
48
|
interface StyleProps {
|
|
46
49
|
outlined?: boolean;
|
|
@@ -64,6 +67,6 @@ export declare const useStyles: (params: StyleProps, styleOverrides?: {
|
|
|
64
67
|
* @todo enhance page handling
|
|
65
68
|
*
|
|
66
69
|
*/
|
|
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;
|
|
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;
|
|
68
71
|
export { GrepTableRow };
|
|
69
72
|
export default GrepTable;
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import * as React from 'react';
|
|
|
7
7
|
import React__default, { useRef, useContext, createContext, createElement, Fragment, forwardRef, useMemo as useMemo$1, 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, ListItemIcon, Divider, styled, TableCell, TableRow, TableSortLabel, TableHead, TablePagination, TableContainer, Table, TableBody, TableFooter, CircularProgress, Link, TextField, FormControl, InputLabel, Select, OutlinedInput, Input, Checkbox, FormHelperText, Grid, ToggleButtonGroup, AppBar as AppBar$1, Toolbar as Toolbar$1, Dialog, DialogTitle, DialogContent, DialogContentText, DialogActions } from '@mui/material';
|
|
10
|
+
import { Button, Box, Typography, IconButton, Menu, MenuItem, Tabs, Tab, Collapse, MenuList, Tooltip, Container, List, ListItem, ListItemText, ListItemIcon, Divider, ListItemButton, styled, TableCell, TableRow, TableSortLabel, TableHead, TablePagination, TableContainer, Table, TableBody, TableFooter, CircularProgress, Link, TextField, FormControl, InputLabel, Select, OutlinedInput, Input, Checkbox, FormHelperText, Grid, ToggleButtonGroup, AppBar as AppBar$1, Toolbar as Toolbar$1, Dialog, DialogTitle, DialogContent, DialogContentText, DialogActions } from '@mui/material';
|
|
11
11
|
import { useTheme } from '@mui/material/styles';
|
|
12
12
|
import { useHistory, NavLink, Prompt } from 'react-router-dom';
|
|
13
13
|
import MenuIcon from '@mui/icons-material/Menu';
|
|
@@ -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';
|
|
@@ -3139,7 +3138,7 @@ var CollapsableMenuItem = function (_a) {
|
|
|
3139
3138
|
return window.dispatchEvent(new Event('resize'));
|
|
3140
3139
|
});
|
|
3141
3140
|
} }, items)))); };
|
|
3142
|
-
return tooltipText ? (React__default.createElement(TooltipMenuItem, { className: classes.root, tooltipText: tooltipText, onMouseOver: function (e) { return e.currentTarget.focus(); }, disabled: disabled, selected: open, onClick: handleClick, onKeyDown: handleKey }, renderInner())) : (React__default.createElement(MenuItem, __assign({ className: classes.root, ref: listItemRef, selected: open, onClick: handleClick, onKeyDown: handleKey }, props), renderInner()));
|
|
3141
|
+
return tooltipText ? (React__default.createElement(TooltipMenuItem, { className: classes.root, tooltipText: tooltipText, onMouseOver: function (e) { return e.currentTarget.focus(); }, disabled: disabled, selected: open, onClick: handleClick, onKeyDown: handleKey }, renderInner())) : (React__default.createElement(MenuItem, __assign({ className: classes.root, ref: listItemRef, selected: open, disabled: disabled, onClick: handleClick, onKeyDown: handleKey }, props), renderInner()));
|
|
3143
3142
|
};
|
|
3144
3143
|
|
|
3145
3144
|
var useStyles$f = makeStyles()(function (_a) {
|
|
@@ -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,
|
|
@@ -3263,9 +3273,11 @@ var useFooterStyles = makeStyles()(function (theme) {
|
|
|
3263
3273
|
fontFamily: 'Montserrat',
|
|
3264
3274
|
fontWeight: 400,
|
|
3265
3275
|
fontSize: '14px',
|
|
3276
|
+
color: Colors.white,
|
|
3266
3277
|
},
|
|
3267
3278
|
itemBtn: {
|
|
3268
3279
|
textDecoration: 'underline',
|
|
3280
|
+
textTransform: 'none',
|
|
3269
3281
|
'&:hover': {
|
|
3270
3282
|
backgroundColor: 'unset',
|
|
3271
3283
|
},
|
|
@@ -3276,9 +3288,11 @@ var useFooterStyles = makeStyles()(function (theme) {
|
|
|
3276
3288
|
var Footer = function (_a) {
|
|
3277
3289
|
var items = _a.items, serviceNameText = _a.serviceNameText, udirLink = _a.udirLink, udirLogo = _a.udirLogo;
|
|
3278
3290
|
var classes = useFooterStyles().classes;
|
|
3279
|
-
var renderItem = function (
|
|
3280
|
-
|
|
3281
|
-
|
|
3291
|
+
var renderItem = function (item) {
|
|
3292
|
+
return item.onClickItem ? (React__default.createElement(Button, { className: classes.itemBtn.concat(' ' + classes.itemText), onClick: item.onClickItem }, item.label)) : (React__default.createElement(ListItemText, { className: classes.itemText, primary: item.label, primaryTypographyProps: {
|
|
3293
|
+
style: { fontSize: 14, fontFamily: 'Montserrat', fontWeight: 400 },
|
|
3294
|
+
} }));
|
|
3295
|
+
};
|
|
3282
3296
|
return (React__default.createElement(Box, { className: classes.footer, role: "contentinfo" },
|
|
3283
3297
|
React__default.createElement(Box, { className: classes.content },
|
|
3284
3298
|
React__default.createElement("a", { href: udirLink },
|
|
@@ -3289,13 +3303,12 @@ var Footer = function (_a) {
|
|
|
3289
3303
|
paddingRight: '16px !important',
|
|
3290
3304
|
} },
|
|
3291
3305
|
React__default.createElement("span", { className: classes.serviceNameText }, serviceNameText),
|
|
3292
|
-
React__default.createElement(List, { className: classes.list }, items.map(function (
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
}))))));
|
|
3306
|
+
React__default.createElement(List, { className: classes.list }, items.map(function (item, i) { return (React__default.createElement(ListItem, { key: i, classes: {
|
|
3307
|
+
root: classes.item,
|
|
3308
|
+
//button: onClickItem ? classes.itemBtn : undefined,
|
|
3309
|
+
} }, item.render
|
|
3310
|
+
? item.render(function () { return renderItem(item); })
|
|
3311
|
+
: renderItem(item))); }))))));
|
|
3299
3312
|
};
|
|
3300
3313
|
|
|
3301
3314
|
var LinkList = function (props) { return (React.createElement(Box, { width: "100%", flexDirection: "column" },
|
|
@@ -3328,9 +3341,10 @@ var ContainedLinkList = function (props) {
|
|
|
3328
3341
|
var classes = useStyles$e().classes;
|
|
3329
3342
|
return (React.createElement(Box, { className: classes.container, style: props.style },
|
|
3330
3343
|
React.createElement(Typography, { className: classes.title }, props.title),
|
|
3331
|
-
React.createElement(List, { style: { padding: 0 } }, props.pages.map(function (page) { return (React.createElement(ListItem, {
|
|
3332
|
-
|
|
3333
|
-
|
|
3344
|
+
React.createElement(List, { style: { padding: 0 } }, props.pages.map(function (page) { return (React.createElement(ListItem, { divider: true, key: page.id, disablePadding: true },
|
|
3345
|
+
React.createElement(ListItemButton, { onClick: function () { return props.onPageClick(page); } },
|
|
3346
|
+
page.linkIcon && React.createElement(ListItemIcon$1, null, page.linkIcon),
|
|
3347
|
+
React.createElement(ListItemText, { primary: page.label })))); }))));
|
|
3334
3348
|
};
|
|
3335
3349
|
|
|
3336
3350
|
var OverflowTooltip = /** @class */ (function (_super) {
|
|
@@ -3368,9 +3382,9 @@ var CellValue = styled('span')({
|
|
|
3368
3382
|
});
|
|
3369
3383
|
var GrepTableRow$1 = function (_a) {
|
|
3370
3384
|
var row = _a.row, column = _a.column, selected = _a.selected, props = __rest$1(_a, ["row", "column", "selected"]);
|
|
3371
|
-
var forceTooltip = column.forceTooltip, getTooltip = column.getTooltip, getCell = column.getCell, _b = column.lines, lines = _b === void 0 ? function () { return (selected ? undefined : 1); } : _b;
|
|
3385
|
+
var forceTooltip = column.forceTooltip, getTooltip = column.getTooltip, getCell = column.getCell, lang = column.lang, _b = column.lines, lines = _b === void 0 ? function () { return (selected ? undefined : 1); } : _b;
|
|
3372
3386
|
var padding = column.padding;
|
|
3373
|
-
var value = (React__default.createElement(CellValue, { style: { WebkitLineClamp: lines(row) } }, getCell(row)));
|
|
3387
|
+
var value = (React__default.createElement(CellValue, { style: { WebkitLineClamp: lines(row) }, lang: typeof lang === 'string' ? lang : lang ? lang(row) : '' }, getCell(row)));
|
|
3374
3388
|
if (forceTooltip || getTooltip) {
|
|
3375
3389
|
return (React__default.createElement(TableCell, __assign({ padding: padding }, props),
|
|
3376
3390
|
React__default.createElement(OverflowTooltip, { force: forceTooltip, title: getTooltip ? getTooltip(row) : value }, value)));
|
|
@@ -3379,9 +3393,11 @@ var GrepTableRow$1 = function (_a) {
|
|
|
3379
3393
|
};
|
|
3380
3394
|
|
|
3381
3395
|
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"]);
|
|
3396
|
+
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
3397
|
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({
|
|
3398
|
+
return (React__default.createElement(TableRow, __assign({ sx: {
|
|
3399
|
+
':focus': { textDecoration: underlineOnFocus ? 'underline' : 'none' },
|
|
3400
|
+
} }, __assign({ selected: selected }, props)), columns.map(render)));
|
|
3385
3401
|
};
|
|
3386
3402
|
|
|
3387
3403
|
var usePaginationActionStyles = makeStyles()(function (_a) {
|
|
@@ -3438,14 +3454,14 @@ var useTableHeaderStyles = makeStyles()(function (_theme, _a) {
|
|
|
3438
3454
|
});
|
|
3439
3455
|
|
|
3440
3456
|
var TableHeaderCell = function (_a) {
|
|
3441
|
-
var column = _a.column, onSortBy = _a.onSortBy, direction = _a.direction, active = _a.active, children = _a.children, props = __rest$1(_a, ["column", "onSortBy", "direction", "active", "children"]);
|
|
3457
|
+
var column = _a.column, onSortBy = _a.onSortBy, direction = _a.direction, active = _a.active, children = _a.children, _b = _a.empty, empty = _b === void 0 ? false : _b, props = __rest$1(_a, ["column", "onSortBy", "direction", "active", "children", "empty"]);
|
|
3442
3458
|
var classes = useTableHeaderStyles({ column: column }).classes;
|
|
3443
3459
|
var sortable = !!(onSortBy && column.sortable);
|
|
3444
|
-
if (sortable) {
|
|
3445
|
-
return (React__default.createElement(TableCell, __assign({ variant:
|
|
3460
|
+
if (sortable && !empty) {
|
|
3461
|
+
return (React__default.createElement(TableCell, __assign({ variant: empty ? 'body' : 'head', className: classes.th }, props),
|
|
3446
3462
|
React__default.createElement(TableSortLabel, { active: active, direction: direction }, children)));
|
|
3447
3463
|
}
|
|
3448
|
-
return (React__default.createElement(TableCell, __assign({ variant:
|
|
3464
|
+
return empty ? (React__default.createElement("td", { className: classes.th }, children)) : (React__default.createElement(TableCell, __assign({ variant: empty ? 'body' : 'head', className: classes.th }, props), children));
|
|
3449
3465
|
};
|
|
3450
3466
|
|
|
3451
3467
|
var TableHeader = function (_a) {
|
|
@@ -3457,7 +3473,7 @@ var TableHeader = function (_a) {
|
|
|
3457
3473
|
React__default.createElement(TableRow, null, headerColumns.map(function (column, index) {
|
|
3458
3474
|
var sortable = !!(onSortBy && column.sortable);
|
|
3459
3475
|
var label = column.label, colDef = column.colDef;
|
|
3460
|
-
return (React__default.createElement(TableHeaderCell, { key: index, column: column, direction: sortDirection, active: sortable ? sortBy === colDef : undefined, onClick: function () { return sortable && onSortBy(column); }, onKeyDown: onActivation(function (e) {
|
|
3476
|
+
return (React__default.createElement(TableHeaderCell, { key: index, empty: !label, column: column, direction: sortDirection, active: sortable ? sortBy === colDef : undefined, onClick: function () { return sortable && onSortBy(column); }, onKeyDown: onActivation(function (e) {
|
|
3461
3477
|
if (sortable) {
|
|
3462
3478
|
e.preventDefault();
|
|
3463
3479
|
onSortBy(column);
|
|
@@ -3500,6 +3516,9 @@ var PaginationActions = function (_a) {
|
|
|
3500
3516
|
var GrepTablePagination = function (props) {
|
|
3501
3517
|
var classes = usePaginationStyles().classes;
|
|
3502
3518
|
return (React__default.createElement(TablePagination, __assign({ classes: classes, rowsPerPageOptions: props.rowsPerPageOptions || [5, 10, 25, 50], SelectProps: {
|
|
3519
|
+
inputProps: {
|
|
3520
|
+
title: 'Velg antall elementer',
|
|
3521
|
+
},
|
|
3503
3522
|
style: {
|
|
3504
3523
|
gridArea: 'left',
|
|
3505
3524
|
justifySelf: 'start',
|
|
@@ -3546,7 +3565,7 @@ var getElementIndex = function (el) {
|
|
|
3546
3565
|
*
|
|
3547
3566
|
*/
|
|
3548
3567
|
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"]);
|
|
3568
|
+
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"]);
|
|
3550
3569
|
var _c = __read(React__default.useState(props.rowsPerPage || 10), 2), rowsPerPage = _c[0], setRowsPerPage = _c[1];
|
|
3551
3570
|
var _d = __read(React__default.useState(null), 2), menuAnchor = _d[0], setMenuAnchor = _d[1];
|
|
3552
3571
|
var _e = __read(React__default.useState(0), 2), currentPage = _e[0], _setCurrentPage = _e[1];
|
|
@@ -3625,7 +3644,7 @@ var GrepTable = function (_a) {
|
|
|
3625
3644
|
e.preventDefault();
|
|
3626
3645
|
break;
|
|
3627
3646
|
}
|
|
3628
|
-
}, tabIndex: 0, size: "large" },
|
|
3647
|
+
}, tabIndex: 0, size: "large", "aria-label": menuButtonLabel !== null && menuButtonLabel !== void 0 ? menuButtonLabel : 'Åpne meny' },
|
|
3629
3648
|
React__default.createElement(MoreVert, null)))));
|
|
3630
3649
|
};
|
|
3631
3650
|
var _renderRow = function (row, index) {
|
|
@@ -3644,7 +3663,7 @@ var GrepTable = function (_a) {
|
|
|
3644
3663
|
}, columns: rowColumns, row: row, style: { cursor: clickableRows && !disabled ? 'pointer' : '' }, onFocus: function (_a) {
|
|
3645
3664
|
var currentTarget = _a.currentTarget;
|
|
3646
3665
|
return setSelectedElement(currentTarget);
|
|
3647
|
-
} }));
|
|
3666
|
+
}, underlineOnFocus: underlineOnFocus }));
|
|
3648
3667
|
};
|
|
3649
3668
|
var onKey = function (e) {
|
|
3650
3669
|
var maxIndex = data.length - 1;
|
|
@@ -3733,7 +3752,7 @@ var LoadingOverlay = function (_a) {
|
|
|
3733
3752
|
opacity: show ? 1 : 0,
|
|
3734
3753
|
transition: "opacity ".concat(show ? 0 : minTime, "ms ease"),
|
|
3735
3754
|
}, sx: sx }, box),
|
|
3736
|
-
React__default.createElement(CircularProgress,
|
|
3755
|
+
React__default.createElement(CircularProgress, { "aria-label": "Laster inn" }))));
|
|
3737
3756
|
};
|
|
3738
3757
|
|
|
3739
3758
|
var useStyles$b = makeStyles()({
|
|
@@ -3757,6 +3776,10 @@ var useStyles$b = makeStyles()({
|
|
|
3757
3776
|
'&:hover': {
|
|
3758
3777
|
textDecoration: 'underline',
|
|
3759
3778
|
},
|
|
3779
|
+
'&:focus': {
|
|
3780
|
+
textDecoration: 'underline',
|
|
3781
|
+
outlineOffset: '2px',
|
|
3782
|
+
},
|
|
3760
3783
|
},
|
|
3761
3784
|
});
|
|
3762
3785
|
|
|
@@ -3832,7 +3855,13 @@ var SearchBar = function (props) {
|
|
|
3832
3855
|
} },
|
|
3833
3856
|
React.createElement(Box, { className: classes.icon },
|
|
3834
3857
|
React.createElement(Search, null)),
|
|
3835
|
-
React.createElement(TextField, { role: "search", className: classes.input, value: value, variant: "standard", inputRef: inputRef, onChange: _handleChange, autoFocus: props.autoFocus, placeholder: props.placeholder, InputProps: {
|
|
3858
|
+
React.createElement(TextField, { id: props.id, role: "search", className: classes.input, value: value, variant: "standard", inputRef: inputRef, onChange: _handleChange, autoFocus: props.autoFocus, placeholder: props.placeholder, InputProps: {
|
|
3859
|
+
disableUnderline: true,
|
|
3860
|
+
fullWidth: true,
|
|
3861
|
+
inputProps: {
|
|
3862
|
+
title: props.title,
|
|
3863
|
+
},
|
|
3864
|
+
} }),
|
|
3836
3865
|
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) })))),
|
|
3837
3866
|
React.createElement("div", { style: { display: 'flex', alignItems: 'center' } },
|
|
3838
3867
|
props.helpText && (React.createElement(Typography, { className: classes.helptext }, props.helpText)),
|
|
@@ -3955,7 +3984,7 @@ var GrepSelect = function (props) {
|
|
|
3955
3984
|
React.useEffect(function () {
|
|
3956
3985
|
setLabelWidth(inputLabel.current.offsetWidth);
|
|
3957
3986
|
}, []);
|
|
3958
|
-
var _b = props.unselectOption, unselectOption = _b === void 0 ? true : _b, errorMessage = props.errorMessage, selectItems = props.selectItems, helperText = props.helperText, fullWidth = props.fullWidth, outlined = props.outlined, disabled = props.disabled, required = props.required, label = props.label, value = props.value, size = props.size, id = props.id, useCheckedSelect = props.useCheckedSelect, rest = __rest$1(props, ["unselectOption", "errorMessage", "selectItems", "helperText", "fullWidth", "outlined", "disabled", "required", "label", "value", "size", "id", "useCheckedSelect"]);
|
|
3987
|
+
var _b = props.unselectOption, unselectOption = _b === void 0 ? true : _b, errorMessage = props.errorMessage, selectItems = props.selectItems, helperText = props.helperText, fullWidth = props.fullWidth, outlined = props.outlined, disabled = props.disabled, required = props.required, label = props.label, inputProps = props.inputProps, value = props.value, size = props.size, id = props.id, useCheckedSelect = props.useCheckedSelect, rest = __rest$1(props, ["unselectOption", "errorMessage", "selectItems", "helperText", "fullWidth", "outlined", "disabled", "required", "label", "inputProps", "value", "size", "id", "useCheckedSelect"]);
|
|
3959
3988
|
var error = errorMessage ? errorMessage.length > 0 : false;
|
|
3960
3989
|
var selected = value;
|
|
3961
3990
|
return (React.createElement(FormControl, { variant: outlined ? 'outlined' : 'standard', className: props.className, fullWidth: fullWidth, required: required, style: props.style, error: error, size: size, disabled: disabled },
|
|
@@ -3963,7 +3992,7 @@ var GrepSelect = function (props) {
|
|
|
3963
3992
|
minWidth: 'max-content',
|
|
3964
3993
|
overflow: 'visible',
|
|
3965
3994
|
} }, label),
|
|
3966
|
-
React.createElement(Select, __assign({}, rest, { inputProps: { id: id }, disabled: !selectItems || disabled, value: value === null ? '' : value, style: { minWidth: labelWidth + (outlined ? 35 : 25) },
|
|
3995
|
+
React.createElement(Select, __assign({}, rest, { inputProps: __assign({ id: id }, inputProps), disabled: !selectItems || disabled, value: value === null ? '' : value, style: { minWidth: labelWidth + (outlined ? 35 : 25) },
|
|
3967
3996
|
// @todo: make input respect label length
|
|
3968
3997
|
input: outlined ? React.createElement(OutlinedInput, { label: label }) : React.createElement(Input, null), MenuProps: {
|
|
3969
3998
|
anchorOrigin: {
|
|
@@ -3978,8 +4007,8 @@ var GrepSelect = function (props) {
|
|
|
3978
4007
|
unselectOption && (React.createElement(MenuItem, { value: "" },
|
|
3979
4008
|
React.createElement("em", null, "Fjern valgt"))),
|
|
3980
4009
|
selectItems.map(function (_a, i) {
|
|
3981
|
-
var label = _a.label, value = _a.value, disabled = _a.disabled;
|
|
3982
|
-
return (React.createElement(MenuItem, { key: i, value: value, disabled: disabled },
|
|
4010
|
+
var label = _a.label, value = _a.value, disabled = _a.disabled, lang = _a.lang;
|
|
4011
|
+
return (React.createElement(MenuItem, { key: i, value: value, disabled: disabled, lang: lang },
|
|
3983
4012
|
useCheckedSelect && (React.createElement(Checkbox, { checked: (selected === null || selected === void 0 ? void 0 : selected.indexOf(value)) > -1 })),
|
|
3984
4013
|
React.createElement(ListItemText, { sx: { margin: '0px', span: { lineHeight: '1.4375em' } }, primary: label ? label : value })));
|
|
3985
4014
|
})),
|
|
@@ -20489,7 +20518,7 @@ var getCharCount = function (editorState) {
|
|
|
20489
20518
|
return editorState.getCurrentContent().getPlainText('').length;
|
|
20490
20519
|
};
|
|
20491
20520
|
var EditorComponent = function (_a) {
|
|
20492
|
-
var label = _a.label, classes = _a.classes, autoFocus = _a.autoFocus, helperText = _a.helperText, showCharCount = _a.showCharCount, allowedStyles = _a.allowedStyles, disableNewlines = _a.disableNewlines, onContentChange = _a.onContentChange, _b = _a.Toolbar, Toolbar = _b === void 0 ? FloatingToolbar : _b, blockPasting = _a.blockPasting, props = __rest$1(_a, ["label", "classes", "autoFocus", "helperText", "showCharCount", "allowedStyles", "disableNewlines", "onContentChange", "Toolbar", "blockPasting"]);
|
|
20521
|
+
var label = _a.label, classes = _a.classes, autoFocus = _a.autoFocus, helperText = _a.helperText, showCharCount = _a.showCharCount, allowedStyles = _a.allowedStyles, disableNewlines = _a.disableNewlines, onContentChange = _a.onContentChange, _b = _a.Toolbar, Toolbar = _b === void 0 ? FloatingToolbar : _b, blockPasting = _a.blockPasting, lang = _a.lang, props = __rest$1(_a, ["label", "classes", "autoFocus", "helperText", "showCharCount", "allowedStyles", "disableNewlines", "onContentChange", "Toolbar", "blockPasting", "lang"]);
|
|
20493
20522
|
var _c = useContext(EditorContext), state = _c.state, setState = _c.setState, setSelection = _c.setSelection;
|
|
20494
20523
|
var ref = useRef();
|
|
20495
20524
|
var canStyle = allowedStyles === undefined || allowedStyles.length > 0;
|
|
@@ -20558,7 +20587,7 @@ var EditorComponent = function (_a) {
|
|
|
20558
20587
|
React__default.createElement("span", { dangerouslySetInnerHTML: { __html: '​' } })),
|
|
20559
20588
|
label && (React__default.createElement("label", { className: clsx(styles.label, classes === null || classes === void 0 ? void 0 : classes.label) }, label)),
|
|
20560
20589
|
canStyle && (React__default.createElement(Toolbar, { editor: ref, buttons: buttons })),
|
|
20561
|
-
React__default.createElement(Box, { className: clsx(styles.editor, classes === null || classes === void 0 ? void 0 : classes.editor) },
|
|
20590
|
+
React__default.createElement(Box, { className: clsx(styles.editor, classes === null || classes === void 0 ? void 0 : classes.editor), lang: lang },
|
|
20562
20591
|
React__default.createElement(Editor, __assign({ ref: ref }, __assign({ editorState: state, onChange: onChange, onFocus: onFocus, onBlur: onBlur, blockStyleFn: blockStyleFn, handleKeyCommand: handleKeyCommand, keyBindingFn: keyBindingFn, handlePastedText: handlePastedText }, props)))),
|
|
20563
20592
|
(showCharCount || helperText) && (React__default.createElement(Box, { margin: ".5rem" },
|
|
20564
20593
|
showCharCount && (React__default.createElement(FormHelperText, { className: styles.charcount }, "Antall tegn: ".concat(charCount))),
|
|
@@ -20590,7 +20619,11 @@ var ToolbarTitle = styled(NavLink)(function () { return ({
|
|
|
20590
20619
|
fontWeight: 500,
|
|
20591
20620
|
textDecoration: 'none',
|
|
20592
20621
|
':hover': {
|
|
20593
|
-
textDecoration: '
|
|
20622
|
+
textDecoration: 'underline',
|
|
20623
|
+
},
|
|
20624
|
+
':focus': {
|
|
20625
|
+
outline: 'none',
|
|
20626
|
+
textDecoration: 'underline',
|
|
20594
20627
|
},
|
|
20595
20628
|
}); });
|
|
20596
20629
|
var EnvironmentTitle = styled('div')(function () { return ({
|
|
@@ -20801,12 +20834,21 @@ var ToolbarMenuItem = styled(NavLink)(function (_a) {
|
|
|
20801
20834
|
},
|
|
20802
20835
|
':focus': {
|
|
20803
20836
|
outline: 'none',
|
|
20837
|
+
color: menuItemHoverGreen,
|
|
20838
|
+
':after': {
|
|
20839
|
+
bottom: '-4px',
|
|
20840
|
+
opacity: '1',
|
|
20841
|
+
},
|
|
20804
20842
|
},
|
|
20805
20843
|
':hover': {
|
|
20806
20844
|
textDecoration: 'none',
|
|
20807
20845
|
color: menuItemHoverGreen,
|
|
20846
|
+
':after': {
|
|
20847
|
+
bottom: '-4px',
|
|
20848
|
+
opacity: '1',
|
|
20849
|
+
},
|
|
20808
20850
|
},
|
|
20809
|
-
'.active:after
|
|
20851
|
+
'.active:after': {
|
|
20810
20852
|
bottom: '-4px',
|
|
20811
20853
|
opacity: '1',
|
|
20812
20854
|
},
|
|
@@ -20892,7 +20934,7 @@ var AppBar = function (_a) {
|
|
|
20892
20934
|
appTitle,
|
|
20893
20935
|
!isProd && (React.createElement(EnvironmentTitle, null, process.env.REACT_APP_HOST)))),
|
|
20894
20936
|
React.createElement(ToolbarRight, null,
|
|
20895
|
-
React.createElement(Button$1, { onClick: _handleIconButtonClick },
|
|
20937
|
+
React.createElement(Button$1, { "aria-controls": userMenuAnchor ? 'basic-menu' : undefined, "aria-haspopup": "true", "aria-expanded": userMenuAnchor ? 'true' : undefined, onClick: _handleIconButtonClick },
|
|
20896
20938
|
React.createElement(AccountCircle, { color: "primary", fontSize: "large" }),
|
|
20897
20939
|
React.createElement(UserContainer, null,
|
|
20898
20940
|
React.createElement(AccountName, null, username),
|
|
@@ -20905,15 +20947,17 @@ var AppBar = function (_a) {
|
|
|
20905
20947
|
vertical: 'top',
|
|
20906
20948
|
horizontal: 'center',
|
|
20907
20949
|
} }, userMenuItems.map(function (i, index) {
|
|
20908
|
-
return (React.createElement(
|
|
20909
|
-
|
|
20910
|
-
|
|
20911
|
-
|
|
20912
|
-
|
|
20913
|
-
textDecoration: '
|
|
20914
|
-
|
|
20915
|
-
|
|
20916
|
-
|
|
20950
|
+
return (React.createElement(MenuItem$1, { key: i.id, onClick: function () {
|
|
20951
|
+
setUserMenuAnchor(null);
|
|
20952
|
+
i.action && i.action();
|
|
20953
|
+
}, divider: userMenuItems.length > index + 1, sx: {
|
|
20954
|
+
':focus': {
|
|
20955
|
+
textDecoration: 'underline',
|
|
20956
|
+
},
|
|
20957
|
+
} }, i.isAnchor ? (React.createElement("a", { style: {
|
|
20958
|
+
textDecoration: 'inherit',
|
|
20959
|
+
color: 'inherit',
|
|
20960
|
+
}, rel: "noreferrer", href: i.href, onClick: i.onClick }, i.label)) : (i.label)));
|
|
20917
20961
|
})))),
|
|
20918
20962
|
React.createElement(ToolbarMenu, { role: "navigation" },
|
|
20919
20963
|
React.createElement(ToolbarMenuInner, null, menuItems.map(function (page) { return _renderToolbarMenuItem(page); }))),
|