@bytebrand/fe-ui-core 4.1.200 → 4.1.202

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytebrand/fe-ui-core",
3
- "version": "4.1.200",
3
+ "version": "4.1.202",
4
4
  "description": "UI components for the auto.de project",
5
5
  "main": "index.ts",
6
6
  "module": "dist/common.js",
@@ -135,7 +135,7 @@ export const FilterBlockFactory: IFilterBlockFactory = {
135
135
  };
136
136
 
137
137
  export const FilterBlockFactoryDetailed: IFilterBlockFactory = {
138
- BASIC_DATA: (props: any): JSX.Element => (<BasicDataWidgetMobile {...props} />),
138
+ BASIC_DATA: (props: any): JSX.Element => (<BasicDataWidgetMobile {...props} isNotDetailed={false}/>),
139
139
  HIGHLIGHTS: (props: any): JSX.Element => (<HighlightsWidgetMobile {...props} />),
140
140
  ENGINE_TRANS_DRIVE: (props: any): JSX.Element => (<EngineTransDriveWidgetMobile {...props} />),
141
141
  BODY_COLOR: (props: any): JSX.Element => (<BodyColorWidget {...props} />),
@@ -16,6 +16,7 @@ export interface IFuelProps {
16
16
  onDropDownFocus?: (id: string) => void;
17
17
  t?: (phrase: string) => string;
18
18
  optionClassName?: string;
19
+ isNotDetailed:boolean;
19
20
  }
20
21
 
21
22
  class Fuel extends React.Component<IFuelProps, {}> {
@@ -33,7 +34,7 @@ class Fuel extends React.Component<IFuelProps, {}> {
33
34
  };
34
35
 
35
36
  getOptions = (options: string[]) => options.map((option: string) => {
36
- const { t } = this.props;
37
+ const { t, isNotDetailed} = this.props;
37
38
 
38
39
  const agg = this.getAggregation(option);
39
40
 
@@ -41,6 +42,7 @@ class Fuel extends React.Component<IFuelProps, {}> {
41
42
  value: option,
42
43
  label: (
43
44
  <span className={styles.wrapOptions}>
45
+ {isNotDetailed ? null : <IconSVG name={option} customDimensions />}
44
46
  <FilterLabel text={t(`cbd:${option}`)} agg={agg} />
45
47
  </span>
46
48
  )
@@ -19,6 +19,7 @@ import { OBJECT_FILTERS, RATE_DEFAULT_CONTROLS } from '../../../framework/consta
19
19
  interface IBasicDataWidgetDetailedProps {
20
20
  [key: string]: any;
21
21
  t?: (phrase: string) => string;
22
+ isNotDetailed:boolean;
22
23
  }
23
24
 
24
25
  interface IBasicDataWidgetDetailedState {
@@ -31,7 +32,7 @@ class BasicDataWidgetMobile extends React.Component<IMakeModelProps & IMakeModel
31
32
  };
32
33
 
33
34
  shouldComponentUpdate(nextProps: any, nextState: any) {
34
- const { MMS_GROUPS, BODY_TYPE, FIRST_REGISTRATION, MILEAGE, POWER, RATE, PRICE, CONSUMPTION, SEATS, DOORS, FUEL, t } = this.props;
35
+ const { MMS_GROUPS, BODY_TYPE, FIRST_REGISTRATION, MILEAGE, POWER, RATE, PRICE, CONSUMPTION, SEATS, DOORS, FUEL, t,isNotDetailed } = this.props;
35
36
 
36
37
  const dataBlocks = {
37
38
  MMS_GROUPS, BODY_TYPE, FIRST_REGISTRATION, MILEAGE, POWER, RATE, PRICE, CONSUMPTION, SEATS, DOORS, FUEL
@@ -66,7 +67,7 @@ class BasicDataWidgetMobile extends React.Component<IMakeModelProps & IMakeModel
66
67
  const {
67
68
  MMS_GROUPS, BODY_TYPE, FIRST_REGISTRATION, MILEAGE, POWER, RATE, PRICE, CONSUMPTION, SEATS, DOORS, FUEL,
68
69
  onFilterChange, onChangeFilterControls, onAddMmsGroup, onRemoveMmsGroup, onDropDownFocus,
69
- MM_GROUPS_EXCLUDE, onAddMmExcludeGroup, onRemoveMmExcludeGroup, t, showModal, hideModal, onAddMmsGroupClick
70
+ MM_GROUPS_EXCLUDE, onAddMmExcludeGroup, onRemoveMmExcludeGroup, t, showModal, hideModal, onAddMmsGroupClick,isNotDetailed
70
71
  } = this.props;
71
72
  const commonProps = { t, onChange: onFilterChange };
72
73
 
@@ -98,6 +99,8 @@ class BasicDataWidgetMobile extends React.Component<IMakeModelProps & IMakeModel
98
99
  onDropDownFocus,
99
100
  options: FUEL.options,
100
101
  values: FUEL.values,
102
+ // tslint:disable-next-line:object-literal-shorthand
103
+ isNotDetailed:isNotDetailed,
101
104
  aggregation: FUEL.aggregation || {}
102
105
  };
103
106
 
@@ -0,0 +1,8 @@
1
+ import { styled } from '@mui/system';
2
+ import IconSVG from '../IconSVG/IconSVG';
3
+
4
+ export const IconSvgWrapper = styled(IconSVG)({
5
+ fill: '#005ccb',
6
+ width: '12px',
7
+ height: '12px'
8
+ });
@@ -1,21 +1,34 @@
1
1
  import React from 'react';
2
2
  import IconButton from '@mui/material/IconButton';
3
- import Tooltip from '@mui/material/Tooltip';
4
- import IconSVG from '../IconSVG/IconSVG';
3
+ import Tooltip, { TooltipProps, tooltipClasses } from '@mui/material/Tooltip';
4
+ import { styled } from '@mui/material/styles';
5
+ import { IconSvgWrapper } from './MaterialTooltip.styled';
5
6
 
6
7
  interface IMaterialTooltip {
7
8
  text: string;
8
- icon: string;
9
+ icon?: string;
10
+ placement?: 'bottom-end' | 'bottom-start' | 'bottom' | 'left-end' | 'left-start' | 'left' | 'right-end' | 'right-start' | 'right' | 'top-end' | 'top-start' | 'top';
9
11
  }
10
12
 
11
- const MaterialTooltip = ({ text, icon }: IMaterialTooltip) => {
13
+ const LightTooltip = styled(({ className, ...props }: TooltipProps) => (
14
+ <Tooltip {...props} classes={{ popper: className }} />
15
+ ))(({ theme }) => ({
16
+ [`& .${tooltipClasses.tooltip}`]: {
17
+ backgroundColor: theme.palette.common.white,
18
+ color: 'rgba(0, 0, 0, 0.87)',
19
+ boxShadow: theme.shadows[1],
20
+ fontSize: 11,
21
+ },
22
+ }));
23
+
24
+ const MaterialTooltip = ({ text, icon = 'infoIcon', placement }: IMaterialTooltip) => {
12
25
  return (
13
- <Tooltip title={text}>
26
+ <LightTooltip placement={placement} title={text}>
14
27
  <IconButton>
15
- <IconSVG name={icon} customDimensions />
28
+ <IconSvgWrapper name={icon} customDimensions />
16
29
  </IconButton>
17
- </Tooltip>
30
+ </LightTooltip>
18
31
  );
19
32
  };
20
33
 
21
- export default MaterialTooltip;
34
+ export default MaterialTooltip;