grep-components 1.20.0-grepf-1778.1 → 1.20.0
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/index.d.ts +3 -1
- package/dist/components/SearchBar/index.d.ts +2 -0
- package/dist/index.js +46 -33
- 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>;
|
|
@@ -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,6 +37,7 @@ 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
|
*/
|
|
@@ -65,6 +67,6 @@ export declare const useStyles: (params: StyleProps, styleOverrides?: {
|
|
|
65
67
|
* @todo enhance page handling
|
|
66
68
|
*
|
|
67
69
|
*/
|
|
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;
|
|
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;
|
|
69
71
|
export { GrepTableRow };
|
|
70
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';
|
|
@@ -3138,7 +3138,7 @@ var CollapsableMenuItem = function (_a) {
|
|
|
3138
3138
|
return window.dispatchEvent(new Event('resize'));
|
|
3139
3139
|
});
|
|
3140
3140
|
} }, items)))); };
|
|
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, 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()));
|
|
3142
3142
|
};
|
|
3143
3143
|
|
|
3144
3144
|
var useStyles$f = makeStyles()(function (_a) {
|
|
@@ -3273,9 +3273,11 @@ var useFooterStyles = makeStyles()(function (theme) {
|
|
|
3273
3273
|
fontFamily: 'Montserrat',
|
|
3274
3274
|
fontWeight: 400,
|
|
3275
3275
|
fontSize: '14px',
|
|
3276
|
+
color: Colors.white,
|
|
3276
3277
|
},
|
|
3277
3278
|
itemBtn: {
|
|
3278
3279
|
textDecoration: 'underline',
|
|
3280
|
+
textTransform: 'none',
|
|
3279
3281
|
'&:hover': {
|
|
3280
3282
|
backgroundColor: 'unset',
|
|
3281
3283
|
},
|
|
@@ -3286,9 +3288,11 @@ var useFooterStyles = makeStyles()(function (theme) {
|
|
|
3286
3288
|
var Footer = function (_a) {
|
|
3287
3289
|
var items = _a.items, serviceNameText = _a.serviceNameText, udirLink = _a.udirLink, udirLogo = _a.udirLogo;
|
|
3288
3290
|
var classes = useFooterStyles().classes;
|
|
3289
|
-
var renderItem = function (
|
|
3290
|
-
|
|
3291
|
-
|
|
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
|
+
};
|
|
3292
3296
|
return (React__default.createElement(Box, { className: classes.footer, role: "contentinfo" },
|
|
3293
3297
|
React__default.createElement(Box, { className: classes.content },
|
|
3294
3298
|
React__default.createElement("a", { href: udirLink },
|
|
@@ -3299,13 +3303,12 @@ var Footer = function (_a) {
|
|
|
3299
3303
|
paddingRight: '16px !important',
|
|
3300
3304
|
} },
|
|
3301
3305
|
React__default.createElement("span", { className: classes.serviceNameText }, serviceNameText),
|
|
3302
|
-
React__default.createElement(List, { className: classes.list }, items.map(function (
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
}))))));
|
|
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))); }))))));
|
|
3309
3312
|
};
|
|
3310
3313
|
|
|
3311
3314
|
var LinkList = function (props) { return (React.createElement(Box, { width: "100%", flexDirection: "column" },
|
|
@@ -3338,9 +3341,10 @@ var ContainedLinkList = function (props) {
|
|
|
3338
3341
|
var classes = useStyles$e().classes;
|
|
3339
3342
|
return (React.createElement(Box, { className: classes.container, style: props.style },
|
|
3340
3343
|
React.createElement(Typography, { className: classes.title }, props.title),
|
|
3341
|
-
React.createElement(List, { style: { padding: 0 } }, props.pages.map(function (page) { return (React.createElement(ListItem, {
|
|
3342
|
-
|
|
3343
|
-
|
|
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 })))); }))));
|
|
3344
3348
|
};
|
|
3345
3349
|
|
|
3346
3350
|
var OverflowTooltip = /** @class */ (function (_super) {
|
|
@@ -3378,9 +3382,9 @@ var CellValue = styled('span')({
|
|
|
3378
3382
|
});
|
|
3379
3383
|
var GrepTableRow$1 = function (_a) {
|
|
3380
3384
|
var row = _a.row, column = _a.column, selected = _a.selected, props = __rest$1(_a, ["row", "column", "selected"]);
|
|
3381
|
-
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;
|
|
3382
3386
|
var padding = column.padding;
|
|
3383
|
-
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)));
|
|
3384
3388
|
if (forceTooltip || getTooltip) {
|
|
3385
3389
|
return (React__default.createElement(TableCell, __assign({ padding: padding }, props),
|
|
3386
3390
|
React__default.createElement(OverflowTooltip, { force: forceTooltip, title: getTooltip ? getTooltip(row) : value }, value)));
|
|
@@ -3450,14 +3454,14 @@ var useTableHeaderStyles = makeStyles()(function (_theme, _a) {
|
|
|
3450
3454
|
});
|
|
3451
3455
|
|
|
3452
3456
|
var TableHeaderCell = function (_a) {
|
|
3453
|
-
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"]);
|
|
3454
3458
|
var classes = useTableHeaderStyles({ column: column }).classes;
|
|
3455
3459
|
var sortable = !!(onSortBy && column.sortable);
|
|
3456
|
-
if (sortable) {
|
|
3457
|
-
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),
|
|
3458
3462
|
React__default.createElement(TableSortLabel, { active: active, direction: direction }, children)));
|
|
3459
3463
|
}
|
|
3460
|
-
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));
|
|
3461
3465
|
};
|
|
3462
3466
|
|
|
3463
3467
|
var TableHeader = function (_a) {
|
|
@@ -3469,7 +3473,7 @@ var TableHeader = function (_a) {
|
|
|
3469
3473
|
React__default.createElement(TableRow, null, headerColumns.map(function (column, index) {
|
|
3470
3474
|
var sortable = !!(onSortBy && column.sortable);
|
|
3471
3475
|
var label = column.label, colDef = column.colDef;
|
|
3472
|
-
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) {
|
|
3473
3477
|
if (sortable) {
|
|
3474
3478
|
e.preventDefault();
|
|
3475
3479
|
onSortBy(column);
|
|
@@ -3512,6 +3516,9 @@ var PaginationActions = function (_a) {
|
|
|
3512
3516
|
var GrepTablePagination = function (props) {
|
|
3513
3517
|
var classes = usePaginationStyles().classes;
|
|
3514
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
|
+
},
|
|
3515
3522
|
style: {
|
|
3516
3523
|
gridArea: 'left',
|
|
3517
3524
|
justifySelf: 'start',
|
|
@@ -3558,7 +3565,7 @@ var getElementIndex = function (el) {
|
|
|
3558
3565
|
*
|
|
3559
3566
|
*/
|
|
3560
3567
|
var GrepTable = function (_a) {
|
|
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"]);
|
|
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"]);
|
|
3562
3569
|
var _c = __read(React__default.useState(props.rowsPerPage || 10), 2), rowsPerPage = _c[0], setRowsPerPage = _c[1];
|
|
3563
3570
|
var _d = __read(React__default.useState(null), 2), menuAnchor = _d[0], setMenuAnchor = _d[1];
|
|
3564
3571
|
var _e = __read(React__default.useState(0), 2), currentPage = _e[0], _setCurrentPage = _e[1];
|
|
@@ -3637,7 +3644,7 @@ var GrepTable = function (_a) {
|
|
|
3637
3644
|
e.preventDefault();
|
|
3638
3645
|
break;
|
|
3639
3646
|
}
|
|
3640
|
-
}, tabIndex: 0, size: "large" },
|
|
3647
|
+
}, tabIndex: 0, size: "large", "aria-label": menuButtonLabel !== null && menuButtonLabel !== void 0 ? menuButtonLabel : 'Åpne meny' },
|
|
3641
3648
|
React__default.createElement(MoreVert, null)))));
|
|
3642
3649
|
};
|
|
3643
3650
|
var _renderRow = function (row, index) {
|
|
@@ -3745,7 +3752,7 @@ var LoadingOverlay = function (_a) {
|
|
|
3745
3752
|
opacity: show ? 1 : 0,
|
|
3746
3753
|
transition: "opacity ".concat(show ? 0 : minTime, "ms ease"),
|
|
3747
3754
|
}, sx: sx }, box),
|
|
3748
|
-
React__default.createElement(CircularProgress,
|
|
3755
|
+
React__default.createElement(CircularProgress, { "aria-label": "Laster inn" }))));
|
|
3749
3756
|
};
|
|
3750
3757
|
|
|
3751
3758
|
var useStyles$b = makeStyles()({
|
|
@@ -3848,7 +3855,13 @@ var SearchBar = function (props) {
|
|
|
3848
3855
|
} },
|
|
3849
3856
|
React.createElement(Box, { className: classes.icon },
|
|
3850
3857
|
React.createElement(Search, null)),
|
|
3851
|
-
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
|
+
} }),
|
|
3852
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) })))),
|
|
3853
3866
|
React.createElement("div", { style: { display: 'flex', alignItems: 'center' } },
|
|
3854
3867
|
props.helpText && (React.createElement(Typography, { className: classes.helptext }, props.helpText)),
|
|
@@ -3971,7 +3984,7 @@ var GrepSelect = function (props) {
|
|
|
3971
3984
|
React.useEffect(function () {
|
|
3972
3985
|
setLabelWidth(inputLabel.current.offsetWidth);
|
|
3973
3986
|
}, []);
|
|
3974
|
-
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"]);
|
|
3975
3988
|
var error = errorMessage ? errorMessage.length > 0 : false;
|
|
3976
3989
|
var selected = value;
|
|
3977
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 },
|
|
@@ -3979,7 +3992,7 @@ var GrepSelect = function (props) {
|
|
|
3979
3992
|
minWidth: 'max-content',
|
|
3980
3993
|
overflow: 'visible',
|
|
3981
3994
|
} }, label),
|
|
3982
|
-
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) },
|
|
3983
3996
|
// @todo: make input respect label length
|
|
3984
3997
|
input: outlined ? React.createElement(OutlinedInput, { label: label }) : React.createElement(Input, null), MenuProps: {
|
|
3985
3998
|
anchorOrigin: {
|
|
@@ -3994,8 +4007,8 @@ var GrepSelect = function (props) {
|
|
|
3994
4007
|
unselectOption && (React.createElement(MenuItem, { value: "" },
|
|
3995
4008
|
React.createElement("em", null, "Fjern valgt"))),
|
|
3996
4009
|
selectItems.map(function (_a, i) {
|
|
3997
|
-
var label = _a.label, value = _a.value, disabled = _a.disabled;
|
|
3998
|
-
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 },
|
|
3999
4012
|
useCheckedSelect && (React.createElement(Checkbox, { checked: (selected === null || selected === void 0 ? void 0 : selected.indexOf(value)) > -1 })),
|
|
4000
4013
|
React.createElement(ListItemText, { sx: { margin: '0px', span: { lineHeight: '1.4375em' } }, primary: label ? label : value })));
|
|
4001
4014
|
})),
|
|
@@ -20505,7 +20518,7 @@ var getCharCount = function (editorState) {
|
|
|
20505
20518
|
return editorState.getCurrentContent().getPlainText('').length;
|
|
20506
20519
|
};
|
|
20507
20520
|
var EditorComponent = function (_a) {
|
|
20508
|
-
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"]);
|
|
20509
20522
|
var _c = useContext(EditorContext), state = _c.state, setState = _c.setState, setSelection = _c.setSelection;
|
|
20510
20523
|
var ref = useRef();
|
|
20511
20524
|
var canStyle = allowedStyles === undefined || allowedStyles.length > 0;
|
|
@@ -20574,7 +20587,7 @@ var EditorComponent = function (_a) {
|
|
|
20574
20587
|
React__default.createElement("span", { dangerouslySetInnerHTML: { __html: '​' } })),
|
|
20575
20588
|
label && (React__default.createElement("label", { className: clsx(styles.label, classes === null || classes === void 0 ? void 0 : classes.label) }, label)),
|
|
20576
20589
|
canStyle && (React__default.createElement(Toolbar, { editor: ref, buttons: buttons })),
|
|
20577
|
-
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 },
|
|
20578
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)))),
|
|
20579
20592
|
(showCharCount || helperText) && (React__default.createElement(Box, { margin: ".5rem" },
|
|
20580
20593
|
showCharCount && (React__default.createElement(FormHelperText, { className: styles.charcount }, "Antall tegn: ".concat(charCount))),
|
|
@@ -20813,7 +20826,7 @@ var ToolbarMenuItem = styled(NavLink)(function (_a) {
|
|
|
20813
20826
|
left: '50%',
|
|
20814
20827
|
width: '32px',
|
|
20815
20828
|
marginLeft: '-16px',
|
|
20816
|
-
borderBottom: "2px solid ".concat(theme.palette.secondary.
|
|
20829
|
+
borderBottom: "2px solid ".concat(theme.palette.secondary.light),
|
|
20817
20830
|
opacity: 0,
|
|
20818
20831
|
content: '""',
|
|
20819
20832
|
transition: 'all 0.3s ease',
|