aefis-core-ui 2.3.0-rc20 → 2.3.0-rc22

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.
@@ -1917,7 +1917,7 @@ MenuButton.propTypes = {
1917
1917
  const useTag = color => {
1918
1918
  const useStyles = makeStyles(theme => ({
1919
1919
  tag: {
1920
- borderLeft: `4px solid ${color ? color : theme.palette.primary.main}`
1920
+ borderLeft: `16px solid ${color ? color : theme.palette.primary.main}`
1921
1921
  }
1922
1922
  }));
1923
1923
  return useStyles();
@@ -2101,6 +2101,10 @@ const ContentBox = props => {
2101
2101
  height: props.imageHeight,
2102
2102
  backgroundColor: props.imageBackgroundColor ? props.imageBackgroundColor : "transparent"
2103
2103
  } : {};
2104
+ const otherSx = !props.children && !props.description ? {
2105
+ display: "none",
2106
+ visibility: "hidden"
2107
+ } : undefined;
2104
2108
  return /*#__PURE__*/jsxs(Box$1, {
2105
2109
  sx: props.sx,
2106
2110
  style: props.containerStyle,
@@ -2124,12 +2128,15 @@ const ContentBox = props => {
2124
2128
  component: "img",
2125
2129
  alt: "",
2126
2130
  image: props.image
2127
- }), props.title && /*#__PURE__*/jsx(CardHeader, _extends({}, headerProps)), props.formatContent && /*#__PURE__*/jsx(CardContent, {
2131
+ }), props.title && /*#__PURE__*/jsx(CardHeader, _extends({}, headerProps, {
2132
+ sx: {
2133
+ padding: props.dense ? 1 : 2
2134
+ }
2135
+ })), props.formatContent && /*#__PURE__*/jsx(CardContent, {
2128
2136
  className: !props.title ? classes.cardContentWithoutTitle : classes.cardContent,
2129
- sx: !props.children && !props.description ? {
2130
- display: "none",
2131
- visibility: "hidden"
2132
- } : undefined,
2137
+ sx: _extends({
2138
+ padding: props.dense ? 1 : 2
2139
+ }, otherSx),
2133
2140
  children: /*#__PURE__*/jsxs(React.Fragment, {
2134
2141
  children: [props.description && /*#__PURE__*/jsx(Typography, {
2135
2142
  variant: "body2",
@@ -2153,6 +2160,9 @@ const ContentBox = props => {
2153
2160
  }), renderChildren()]
2154
2161
  }), props.actions && /*#__PURE__*/jsx(CardActions, {
2155
2162
  disableSpacing: true,
2163
+ sx: {
2164
+ paddingTop: props.dense ? 0 : 1
2165
+ },
2156
2166
  children: props.actions
2157
2167
  }), props.afterActionContent]
2158
2168
  })]
@@ -2166,7 +2176,8 @@ ContentBox.defaultProps = {
2166
2176
  imageBackgroundColor: "transparent",
2167
2177
  titleComponent: "div",
2168
2178
  wrapTitle: false,
2169
- wrapSubtitle: false
2179
+ wrapSubtitle: false,
2180
+ dense: false
2170
2181
  };
2171
2182
  ContentBox.propTypes = {
2172
2183
  /** Content of the content box */
@@ -2218,7 +2229,9 @@ ContentBox.propTypes = {
2218
2229
  /** Additional styles for the content box container */
2219
2230
  containerStyle: PropTypes.any,
2220
2231
  /** Additional styles to apply */
2221
- sx: PropTypes.object
2232
+ sx: PropTypes.object,
2233
+ /** Compact display? */
2234
+ dense: PropTypes.bool
2222
2235
  };
2223
2236
 
2224
2237
  const defaultColorPalette = {
@@ -4760,19 +4773,26 @@ SwipeableTabPanel.propTypes = {
4760
4773
  appBarComponent: PropTypes.string
4761
4774
  };
4762
4775
 
4763
- const List = props => {
4776
+ const List = ({
4777
+ children,
4778
+ containerStyle,
4779
+ transparentBackground: _transparentBackground = false,
4780
+ display: _display = "vertical",
4781
+ animate: _animate = true,
4782
+ sx
4783
+ }) => {
4764
4784
  const theme = useTheme$1();
4765
4785
  const rootStyle = _extends({
4766
- backgroundColor: props.transparentBackground ? "transparent" : theme.palette.background.paper,
4786
+ backgroundColor: _transparentBackground ? "transparent" : theme.palette.background.paper,
4767
4787
  width: "100%"
4768
- }, props.containerStyle);
4769
- const listStyle = {
4788
+ }, containerStyle);
4789
+ const listStyle = _extends({
4770
4790
  margin: 0,
4771
4791
  padding: 0,
4772
4792
  flexWrap: "wrap"
4773
- };
4793
+ }, sx);
4774
4794
  const listProps = {};
4775
- if (props.display === "horizontal") {
4795
+ if (_display === "horizontal") {
4776
4796
  listStyle["display"] = "flex";
4777
4797
  listStyle["flexDirection"] = "row";
4778
4798
  listProps["dense"] = true;
@@ -4780,25 +4800,20 @@ const List = props => {
4780
4800
  }
4781
4801
  return /*#__PURE__*/jsx(Box$1, {
4782
4802
  sx: rootStyle,
4783
- children: props.animate ? /*#__PURE__*/jsx(FadeIn, {
4803
+ children: _animate ? /*#__PURE__*/jsx(FadeIn, {
4784
4804
  in: true,
4785
4805
  children: /*#__PURE__*/jsx(List$2, _extends({
4786
4806
  sx: listStyle
4787
4807
  }, listProps, {
4788
- children: props.children
4808
+ children: children
4789
4809
  }))
4790
4810
  }) : /*#__PURE__*/jsx(List$2, _extends({
4791
4811
  sx: listStyle
4792
4812
  }, listProps, {
4793
- children: props.children
4813
+ children: children
4794
4814
  }))
4795
4815
  });
4796
4816
  };
4797
- List.defaultProps = {
4798
- transparentBackground: false,
4799
- display: "vertical",
4800
- animate: true
4801
- };
4802
4817
  List.propTypes = {
4803
4818
  /** Children of the list. Children should be the ListItem component. */
4804
4819
  children: PropTypes.any.isRequired,
@@ -4809,7 +4824,9 @@ List.propTypes = {
4809
4824
  /** List display type */
4810
4825
  display: PropTypes.oneOf(["horizontal", "vertical"]),
4811
4826
  /** Show the animation? */
4812
- animate: PropTypes.bool
4827
+ animate: PropTypes.bool,
4828
+ /** Style to apply */
4829
+ sx: PropTypes.any
4813
4830
  };
4814
4831
 
4815
4832
  const StyledMuiListItemButton = withStyles$1({
@@ -4817,38 +4834,53 @@ const StyledMuiListItemButton = withStyles$1({
4817
4834
  "&:hover": {
4818
4835
  backgroundColor: "rgba(0, 0, 0, 0.02) !important"
4819
4836
  }
4820
- },
4821
- selected: {
4822
- backgroundColor: "#f5fbfe !important"
4823
- }
4824
- })(ListItem$2);
4825
- const StyledMuiListItem = withStyles$1({
4826
- selected: {
4827
- backgroundColor: "#f5fbfe !important"
4828
4837
  }
4829
4838
  })(ListItem$2);
4839
+ const StyledMuiListItem = withStyles$1({})(ListItem$2);
4830
4840
 
4831
4841
  /** List Item component to be used with List component. Displays items in a list. */
4832
4842
 
4833
- const ListItem = props => {
4834
- const listItemStyle = {};
4843
+ const ListItem = ({
4844
+ displayType: _displayType = "default",
4845
+ avatar,
4846
+ icon,
4847
+ title,
4848
+ subtitle,
4849
+ hasBorder: _hasBorder = false,
4850
+ borderStyle: _borderStyle = "2px solid",
4851
+ canClick: _canClick = false,
4852
+ onClick,
4853
+ children,
4854
+ id,
4855
+ disabled: _disabled = false,
4856
+ dense: _dense = false,
4857
+ hasGutter: _hasGutter = true,
4858
+ selected: _selected = false,
4859
+ selectedType: _selectedType = "background",
4860
+ display: _display = "vertical",
4861
+ sx
4862
+ }) => {
4835
4863
  const keyValue = useUID();
4836
- if (!props.hasGutter) {
4864
+ const listItemStyle = {
4865
+ backgroundColor: _selected && _selectedType === "background" ? "#f5fbfe" : "transparent",
4866
+ border: _selected && _selectedType === "outlined" ? "2px solid #2295f2" : "none"
4867
+ };
4868
+ if (!_hasGutter) {
4837
4869
  listItemStyle.padding = 0;
4838
4870
  }
4839
- if (props.hasBorder) {
4840
- listItemStyle.borderBottom = props.borderStyle;
4871
+ if (_hasBorder) {
4872
+ listItemStyle.borderBottom = _borderStyle;
4841
4873
  listItemStyle.borderColor = grey[200];
4842
4874
  }
4843
4875
  const listItemArgs = {
4844
- key: props.id ? props.id : keyValue,
4876
+ key: id ? id : keyValue,
4845
4877
  style: listItemStyle,
4846
- disabled: props.disabled,
4847
- dense: props.dense,
4848
- selected: props.selected,
4878
+ disabled: _disabled,
4879
+ dense: _dense,
4880
+ selected: _selected,
4849
4881
  component: "li"
4850
4882
  };
4851
- if (props.display === "horizontal") {
4883
+ if (_display === "horizontal") {
4852
4884
  listItemArgs["sx"] = {
4853
4885
  marginRight: "2px",
4854
4886
  marginBottom: "2px",
@@ -4858,51 +4890,42 @@ const ListItem = props => {
4858
4890
  listItemArgs["disablePadding"] = true;
4859
4891
  listItemArgs["disableGutters"] = true;
4860
4892
  }
4861
- if (props.canClick) {
4893
+ if (_canClick) {
4862
4894
  listItemArgs.button = true;
4863
- listItemArgs.onClick = props.onClick;
4895
+ listItemArgs.onClick = onClick;
4864
4896
  }
4865
- return props.displayType === "default" && props.canClick && /*#__PURE__*/jsxs(StyledMuiListItemButton, _extends({}, listItemArgs, {
4866
- children: [props.title && props.title !== "" && props.avatar && /*#__PURE__*/jsx(ListItemAvatar, {
4867
- children: props.avatar
4868
- }), props.title && props.title !== "" && props.icon && /*#__PURE__*/jsx(ListItemIcon, {
4869
- children: props.icon
4870
- }), props.title && props.title !== "" && /*#__PURE__*/jsx(ListItemText, {
4871
- primary: props.title,
4872
- secondary: props.subtitle
4873
- }), !props.title && props.children && /*#__PURE__*/jsx(React.Fragment, {
4874
- children: props.children
4897
+ return _displayType === "default" && _canClick && /*#__PURE__*/jsxs(StyledMuiListItemButton, _extends({}, listItemArgs, {
4898
+ children: [title && title !== "" && avatar && /*#__PURE__*/jsx(ListItemAvatar, {
4899
+ children: avatar
4900
+ }), title && title !== "" && icon && /*#__PURE__*/jsx(ListItemIcon, {
4901
+ children: icon
4902
+ }), title && title !== "" && /*#__PURE__*/jsx(ListItemText, {
4903
+ primary: title,
4904
+ secondary: subtitle
4905
+ }), !title && children && /*#__PURE__*/jsx(React.Fragment, {
4906
+ children: children
4875
4907
  })]
4876
- })) || props.displayType === "default" && !props.canClick && /*#__PURE__*/jsxs(StyledMuiListItem, _extends({}, listItemArgs, {
4877
- children: [props.title && props.title !== "" && props.avatar && /*#__PURE__*/jsx(ListItemAvatar, {
4878
- children: props.avatar
4879
- }), props.title && props.title !== "" && props.icon && /*#__PURE__*/jsx(ListItemIcon, {
4880
- children: props.icon
4881
- }), props.title && props.title !== "" && /*#__PURE__*/jsx(ListItemText, {
4882
- primary: props.title,
4883
- secondary: props.subtitle
4884
- }), !props.title && props.children && /*#__PURE__*/jsx(React.Fragment, {
4885
- children: props.children
4908
+ })) || _displayType === "default" && !_canClick && /*#__PURE__*/jsxs(StyledMuiListItem, _extends({}, listItemArgs, {
4909
+ sx: sx,
4910
+ children: [title && title !== "" && avatar && /*#__PURE__*/jsx(ListItemAvatar, {
4911
+ children: avatar
4912
+ }), title && title !== "" && icon && /*#__PURE__*/jsx(ListItemIcon, {
4913
+ children: icon
4914
+ }), title && title !== "" && /*#__PURE__*/jsx(ListItemText, {
4915
+ primary: title,
4916
+ secondary: subtitle
4917
+ }), !title && children && /*#__PURE__*/jsx(React.Fragment, {
4918
+ children: children
4886
4919
  })]
4887
- })) || props.displayType === "skeleton" && /*#__PURE__*/jsx(StyledMuiListItem, {
4920
+ })) || _displayType === "skeleton" && /*#__PURE__*/jsx(StyledMuiListItem, {
4888
4921
  style: listItemStyle,
4922
+ sx: sx,
4889
4923
  children: /*#__PURE__*/jsx(SkeletonContent, {
4890
4924
  displayType: "listItem",
4891
4925
  withAvatar: true
4892
4926
  })
4893
4927
  }, keyValue);
4894
4928
  };
4895
- ListItem.defaultProps = {
4896
- displayType: "default",
4897
- hasBorder: false,
4898
- disabled: false,
4899
- dense: false,
4900
- canClick: false,
4901
- borderStyle: "2px solid",
4902
- hasGutter: true,
4903
- selected: false,
4904
- display: "vertical"
4905
- };
4906
4929
  ListItem.propTypes = {
4907
4930
  /** The display type of the list item. */
4908
4931
  displayType: PropTypes.oneOf(["default", "skeleton"]),
@@ -4934,8 +4957,12 @@ ListItem.propTypes = {
4934
4957
  hasGutter: PropTypes.bool,
4935
4958
  /** Is the item selected? If selected, the list item will display a background color */
4936
4959
  selected: PropTypes.bool,
4960
+ /** When the list item is selected, use background color or outline. */
4961
+ selectedType: PropTypes.oneOf(["background", "outlined"]),
4937
4962
  /** List display type */
4938
- display: PropTypes.oneOf(["horizontal", "vertical"])
4963
+ display: PropTypes.oneOf(["horizontal", "vertical"]),
4964
+ /** Styles to apply */
4965
+ sx: PropTypes.any
4939
4966
  };
4940
4967
 
4941
4968
  const useStyles$z = makeStyles(theme => ({