@bytebrand/fe-ui-core 4.8.50 → 4.8.52
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 +1 -2
- package/source/components/OfferPanel/OfferCheckboxGroup/CheckboxContainer.tsx +2 -2
- package/source/components/OfferPanel/OfferCheckboxGroup/OfferCheckboxGroup.styl +24 -0
- package/source/components/OfferPanel/OfferCheckboxGroup/OfferCheckboxGroup.tsx +1 -1
- package/source/components/OfferPanel/OfferPanel.tsx +1 -1
- package/source/components/VehicleDetailedSlider/partials/PriceData.tsx +48 -48
- package/source/components/_common/MaterialTooltip/MaterialTooltip.tsx +4 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bytebrand/fe-ui-core",
|
|
3
|
-
"version": "4.8.
|
|
3
|
+
"version": "4.8.52",
|
|
4
4
|
"description": "UI components for the auto.de project",
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"module": "dist/common.js",
|
|
@@ -104,7 +104,6 @@
|
|
|
104
104
|
"@types/react": "^16.8.3"
|
|
105
105
|
},
|
|
106
106
|
"scripts": {
|
|
107
|
-
"prepare": "husky",
|
|
108
107
|
"storybook": "start-storybook -p 6006",
|
|
109
108
|
"clean": "rm -rf ./dist/*.*",
|
|
110
109
|
"build:lib": "yarn clean && webpack --config ./webpack.config.js --progress",
|
|
@@ -21,7 +21,7 @@ export interface ICheckboxProps {
|
|
|
21
21
|
checkboxClassName?: string;
|
|
22
22
|
labelClassName?: string;
|
|
23
23
|
labelPlacement?: 'end' | 'start' | 'top' | 'bottom';
|
|
24
|
-
tooltipDescription?:
|
|
24
|
+
tooltipDescription?: React.ReactNode;
|
|
25
25
|
checkboxPriceValue: any;
|
|
26
26
|
tooltipPosX?: string;
|
|
27
27
|
error?: boolean;
|
|
@@ -128,7 +128,7 @@ class CheckboxContainer extends React.Component<ICheckboxProps, {}> {
|
|
|
128
128
|
{description ? (
|
|
129
129
|
<span className={styles.labelContent}>
|
|
130
130
|
{description}
|
|
131
|
-
{tooltipDescription && <MaterialTooltip zindex={10000} text={tooltipDescription} className={styles.tooltipCheckbox} icon='InfoTransparent' />}
|
|
131
|
+
{tooltipDescription && <MaterialTooltip zindex={10000} disablePortal={false} text={tooltipDescription} className={styles.tooltipCheckbox} icon='InfoTransparent' />}
|
|
132
132
|
</span>
|
|
133
133
|
) : false}
|
|
134
134
|
</label>
|
|
@@ -111,6 +111,30 @@
|
|
|
111
111
|
max-height: inherit;
|
|
112
112
|
width: inherit !important
|
|
113
113
|
|
|
114
|
+
:global
|
|
115
|
+
.MuiTooltip-tooltip
|
|
116
|
+
max-width: 360px !important
|
|
117
|
+
font-size: 11px
|
|
118
|
+
line-height: 1.45
|
|
119
|
+
color: #4C4E64AD
|
|
120
|
+
text-align: left
|
|
121
|
+
|
|
122
|
+
b
|
|
123
|
+
display: block
|
|
124
|
+
margin-bottom: 6px
|
|
125
|
+
font-size: 12px
|
|
126
|
+
color: #1a1a1a
|
|
127
|
+
|
|
128
|
+
p
|
|
129
|
+
margin: 0 0 6px
|
|
130
|
+
|
|
131
|
+
ul
|
|
132
|
+
margin: 4px 0 0
|
|
133
|
+
padding-left: 16px
|
|
134
|
+
|
|
135
|
+
li
|
|
136
|
+
margin-bottom: 3px
|
|
137
|
+
|
|
114
138
|
.checkboxPrice
|
|
115
139
|
align-self: center;
|
|
116
140
|
color: rgba(#000000, .63);
|
|
@@ -16,7 +16,7 @@ const OfferCheckboxGroup: FC<IOfferPeriod> = ({ additionalService, transferInsta
|
|
|
16
16
|
return (
|
|
17
17
|
<div className={offerGroupClass}>
|
|
18
18
|
{isAboAccordionExpanded0 && <CheckboxContainer {...additionalService } />}
|
|
19
|
-
<CheckboxContainer {...{ ...transferInstallments, isAboAccordionExpanded0 }} />
|
|
19
|
+
{priceTabIndex === 2 && <CheckboxContainer {...{ ...transferInstallments, isAboAccordionExpanded0 }} />}
|
|
20
20
|
</div>
|
|
21
21
|
);
|
|
22
22
|
};
|
|
@@ -71,7 +71,7 @@ const OfferPanel: FC<IFinancingPanel> = ({
|
|
|
71
71
|
|
|
72
72
|
{priceTabIndex === THREE
|
|
73
73
|
? <div className={styles.aboAccordionWrapper}><AboAccordion /></div>
|
|
74
|
-
: <div className={styles.offerCheckboxGroup}><OfferCheckboxGroup {...{ transferInstallments, additionalService }} /></div>}
|
|
74
|
+
: <div className={styles.offerCheckboxGroup}><OfferCheckboxGroup {...{ transferInstallments, additionalService, priceTabIndex }} /></div>}
|
|
75
75
|
</>
|
|
76
76
|
}
|
|
77
77
|
</form>
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import FormattedNumber from '../../FormattedNumber/FormattedNumber';
|
|
3
|
-
import Badge from '../../_common/Badge/Badge';
|
|
4
|
-
|
|
5
|
-
import styles from './PriceData.styl';
|
|
6
|
-
|
|
7
|
-
interface IProps {
|
|
8
|
-
t: (phrase: string, config?: any) => string;
|
|
9
|
-
showNewLabel: boolean;
|
|
10
|
-
historyPriceDifference: number;
|
|
11
|
-
historyPriceDifferencePerCent: number;
|
|
12
|
-
financingConfig?: any;
|
|
13
|
-
activeTab?: number;
|
|
14
|
-
showDownPayment: boolean;
|
|
15
|
-
financingFirstInstallment?: number | null;
|
|
16
|
-
leasingFirstInstallment?: number | null;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const MIN_PERCENT = 5;
|
|
20
|
-
const MIN_PRICE_DIFFERENCE = 500;
|
|
21
|
-
const EUR = `€`;
|
|
22
|
-
|
|
23
|
-
const PriceData: React.FunctionComponent<IProps> = ({ t, showDownPayment, showNewLabel, historyPriceDifference, historyPriceDifferencePerCent, activeTab, financingFirstInstallment, leasingFirstInstallment }) => {
|
|
24
|
-
const showDownPaymentBadge = showDownPayment && (
|
|
25
|
-
(activeTab === 0 && financingFirstInstallment === 0) ||
|
|
26
|
-
(activeTab === 1 && leasingFirstInstallment === 0)
|
|
27
|
-
);
|
|
28
|
-
return (
|
|
29
|
-
<div className={styles.topWrapper}>
|
|
30
|
-
{showNewLabel && <Badge type='blue' className={styles.new}>{t('slider.new')}</Badge>}
|
|
31
|
-
{!!historyPriceDifference && historyPriceDifference >= MIN_PRICE_DIFFERENCE && (
|
|
32
|
-
<Badge type='green' className={styles.priceDifference}>
|
|
33
|
-
<FormattedNumber value={historyPriceDifference} numbersAfterDot={0}/>
|
|
34
|
-
{` ${EUR} ${t('slider.save')}`}
|
|
35
|
-
</Badge>
|
|
36
|
-
)}
|
|
37
|
-
{showDownPaymentBadge &&
|
|
38
|
-
<Badge type='lightBlue' className={styles.percentageOfFirstInstallment}>{`0${EUR} ${t('slider.firstInstallment')}`}</Badge>}
|
|
39
|
-
{historyPriceDifferencePerCent >= MIN_PERCENT && (
|
|
40
|
-
<Badge type='red' className={styles.priceDifferencePerCent}>
|
|
41
|
-
-{historyPriceDifferencePerCent}%
|
|
42
|
-
</Badge>
|
|
43
|
-
)}
|
|
44
|
-
</div>
|
|
45
|
-
);
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export default PriceData;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import FormattedNumber from '../../FormattedNumber/FormattedNumber';
|
|
3
|
+
import Badge from '../../_common/Badge/Badge';
|
|
4
|
+
|
|
5
|
+
import styles from './PriceData.styl';
|
|
6
|
+
|
|
7
|
+
interface IProps {
|
|
8
|
+
t: (phrase: string, config?: any) => string;
|
|
9
|
+
showNewLabel: boolean;
|
|
10
|
+
historyPriceDifference: number;
|
|
11
|
+
historyPriceDifferencePerCent: number;
|
|
12
|
+
financingConfig?: any;
|
|
13
|
+
activeTab?: number;
|
|
14
|
+
showDownPayment: boolean;
|
|
15
|
+
financingFirstInstallment?: number | null;
|
|
16
|
+
leasingFirstInstallment?: number | null;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const MIN_PERCENT = 5;
|
|
20
|
+
const MIN_PRICE_DIFFERENCE = 500;
|
|
21
|
+
const EUR = `€`;
|
|
22
|
+
|
|
23
|
+
const PriceData: React.FunctionComponent<IProps> = ({ t, showDownPayment, showNewLabel, historyPriceDifference, historyPriceDifferencePerCent, activeTab, financingFirstInstallment, leasingFirstInstallment }) => {
|
|
24
|
+
const showDownPaymentBadge = showDownPayment && (
|
|
25
|
+
(activeTab === 0 && financingFirstInstallment === 0) ||
|
|
26
|
+
(activeTab === 1 && leasingFirstInstallment === 0)
|
|
27
|
+
);
|
|
28
|
+
return (
|
|
29
|
+
<div className={styles.topWrapper}>
|
|
30
|
+
{showNewLabel && <Badge type='blue' className={styles.new}>{t('slider.new')}</Badge>}
|
|
31
|
+
{!!historyPriceDifference && historyPriceDifference >= MIN_PRICE_DIFFERENCE && (
|
|
32
|
+
<Badge type='green' className={styles.priceDifference}>
|
|
33
|
+
<FormattedNumber value={historyPriceDifference} numbersAfterDot={0}/>
|
|
34
|
+
{` ${EUR} ${t('slider.save')}`}
|
|
35
|
+
</Badge>
|
|
36
|
+
)}
|
|
37
|
+
{showDownPaymentBadge &&
|
|
38
|
+
<Badge type='lightBlue' className={styles.percentageOfFirstInstallment}>{`0${EUR} ${t('slider.firstInstallment')}`}</Badge>}
|
|
39
|
+
{historyPriceDifferencePerCent >= MIN_PERCENT && (
|
|
40
|
+
<Badge type='red' className={styles.priceDifferencePerCent}>
|
|
41
|
+
-{historyPriceDifferencePerCent}%
|
|
42
|
+
</Badge>
|
|
43
|
+
)}
|
|
44
|
+
</div>
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export default PriceData;
|
|
@@ -7,12 +7,13 @@ import ClickAwayListener from '@mui/material/ClickAwayListener';
|
|
|
7
7
|
import { debounce } from 'lodash';
|
|
8
8
|
|
|
9
9
|
interface IMaterialTooltip {
|
|
10
|
-
text:
|
|
10
|
+
text: React.ReactNode;
|
|
11
11
|
icon?: string;
|
|
12
12
|
className?: string;
|
|
13
13
|
placement?: 'bottom-end' | 'bottom-start' | 'bottom' | 'left-end' | 'left-start' | 'left' | 'right-end' | 'right-start' | 'right' | 'top-end' | 'top-start' | 'top';
|
|
14
14
|
disabled?: Boolean;
|
|
15
15
|
zindex?: number;
|
|
16
|
+
disablePortal?: boolean;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
const LightTooltip = styled(({ className, ...props }: TooltipProps) => (
|
|
@@ -32,7 +33,7 @@ const LightTooltip = styled(({ className, ...props }: TooltipProps) => (
|
|
|
32
33
|
}
|
|
33
34
|
}));
|
|
34
35
|
|
|
35
|
-
const MaterialTooltip = ({ text, placement, className, disabled, zindex }: IMaterialTooltip) => {
|
|
36
|
+
const MaterialTooltip = ({ text, placement, className, disabled, zindex, disablePortal = true }: IMaterialTooltip) => {
|
|
36
37
|
const [isOpen, setIsOpen] = useState(false);
|
|
37
38
|
|
|
38
39
|
const onHandleMenuOpen = (event: any) => {
|
|
@@ -71,7 +72,7 @@ const MaterialTooltip = ({ text, placement, className, disabled, zindex }: IMate
|
|
|
71
72
|
className={className}
|
|
72
73
|
zindex={zindex}
|
|
73
74
|
PopperProps={{
|
|
74
|
-
disablePortal
|
|
75
|
+
disablePortal
|
|
75
76
|
}}
|
|
76
77
|
>
|
|
77
78
|
<IconButton>
|