grep-components 1.20.0-grepf-1818.1 → 1.20.0-grepf-1794.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
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;
@@ -13,6 +13,7 @@ export interface GrepSelectProps extends SelectProps {
13
13
  selectItems: SelectItem[];
14
14
  unselectOption?: boolean;
15
15
  useCheckedSelect?: boolean;
16
+ inputProps?: InputBaseComponentProps | undefined;
16
17
  }
17
18
  declare const _default: React.ComponentType<GrepSelectProps>;
18
19
  export default _default;
@@ -9,6 +9,8 @@ export interface SearchBarProps {
9
9
  onClear: () => void;
10
10
  onSearchAll?: () => void;
11
11
  onInputChange: (value: string) => void;
12
+ id?: string;
13
+ title?: string;
12
14
  }
13
15
  declare const _default: React.ComponentType<SearchBarProps>;
14
16
  export default _default;
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, 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';
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';
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';
@@ -3328,10 +3328,9 @@ var ContainedLinkList = function (props) {
3328
3328
  var classes = useStyles$e().classes;
3329
3329
  return (React.createElement(Box, { className: classes.container, style: props.style },
3330
3330
  React.createElement(Typography, { className: classes.title }, props.title),
3331
- React.createElement(List, { style: { padding: 0 } }, props.pages.map(function (page) { return (React.createElement(ListItem, { divider: true, key: page.id, disablePadding: true },
3332
- React.createElement(ListItemButton, { onClick: function () { return props.onPageClick(page); } },
3333
- page.linkIcon && React.createElement(ListItemIcon$1, null, page.linkIcon),
3334
- React.createElement(ListItemText, { primary: page.label })))); }))));
3331
+ React.createElement(List, { style: { padding: 0 } }, props.pages.map(function (page) { return (React.createElement(ListItem, { button: true, divider: true, key: page.id, onClick: function () { return props.onPageClick(page); } },
3332
+ page.linkIcon && React.createElement(ListItemIcon$1, null, page.linkIcon),
3333
+ React.createElement(ListItemText, { primary: page.label }))); }))));
3335
3334
  };
3336
3335
 
3337
3336
  var OverflowTooltip = /** @class */ (function (_super) {
@@ -3501,6 +3500,9 @@ var PaginationActions = function (_a) {
3501
3500
  var GrepTablePagination = function (props) {
3502
3501
  var classes = usePaginationStyles().classes;
3503
3502
  return (React__default.createElement(TablePagination, __assign({ classes: classes, rowsPerPageOptions: props.rowsPerPageOptions || [5, 10, 25, 50], SelectProps: {
3503
+ inputProps: {
3504
+ title: 'Velg antall elementer',
3505
+ },
3504
3506
  style: {
3505
3507
  gridArea: 'left',
3506
3508
  justifySelf: 'start',
@@ -3833,7 +3835,13 @@ var SearchBar = function (props) {
3833
3835
  } },
3834
3836
  React.createElement(Box, { className: classes.icon },
3835
3837
  React.createElement(Search, null)),
3836
- React.createElement(TextField, { role: "search", className: classes.input, value: value, variant: "standard", inputRef: inputRef, onChange: _handleChange, autoFocus: props.autoFocus, placeholder: props.placeholder, InputProps: { disableUnderline: true, fullWidth: true } }),
3838
+ 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: {
3839
+ disableUnderline: true,
3840
+ fullWidth: true,
3841
+ inputProps: {
3842
+ title: props.title,
3843
+ },
3844
+ } }),
3837
3845
  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) })))),
3838
3846
  React.createElement("div", { style: { display: 'flex', alignItems: 'center' } },
3839
3847
  props.helpText && (React.createElement(Typography, { className: classes.helptext }, props.helpText)),
@@ -3956,7 +3964,7 @@ var GrepSelect = function (props) {
3956
3964
  React.useEffect(function () {
3957
3965
  setLabelWidth(inputLabel.current.offsetWidth);
3958
3966
  }, []);
3959
- 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"]);
3967
+ 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"]);
3960
3968
  var error = errorMessage ? errorMessage.length > 0 : false;
3961
3969
  var selected = value;
3962
3970
  return (React.createElement(FormControl, { variant: outlined ? 'outlined' : 'standard', className: props.className, fullWidth: fullWidth, required: required, style: props.style, error: error, size: size, disabled: disabled },
@@ -3964,7 +3972,7 @@ var GrepSelect = function (props) {
3964
3972
  minWidth: 'max-content',
3965
3973
  overflow: 'visible',
3966
3974
  } }, label),
3967
- React.createElement(Select, __assign({}, rest, { inputProps: { id: id }, disabled: !selectItems || disabled, value: value === null ? '' : value, style: { minWidth: labelWidth + (outlined ? 35 : 25) },
3975
+ React.createElement(Select, __assign({}, rest, { inputProps: __assign({ id: id }, inputProps), disabled: !selectItems || disabled, value: value === null ? '' : value, style: { minWidth: labelWidth + (outlined ? 35 : 25) },
3968
3976
  // @todo: make input respect label length
3969
3977
  input: outlined ? React.createElement(OutlinedInput, { label: label }) : React.createElement(Input, null), MenuProps: {
3970
3978
  anchorOrigin: {