@bytebrand/fe-ui-core 4.1.160 → 4.1.162
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
|
@@ -22,6 +22,10 @@ export interface IExpansionPanelProps {
|
|
|
22
22
|
expandedClassName?: string;
|
|
23
23
|
arrowIconClassName?: string;
|
|
24
24
|
expanded?: string | boolean;
|
|
25
|
+
vehiclesComparedCount?: number;
|
|
26
|
+
widthCompareBlock?: number;
|
|
27
|
+
isCompare?: boolean;
|
|
28
|
+
accordionSummaryClassName?: string;
|
|
25
29
|
accordionClassName?: string;
|
|
26
30
|
}
|
|
27
31
|
|
|
@@ -45,15 +49,19 @@ class ExpansionPanel extends React.Component<IExpansionPanelProps> {
|
|
|
45
49
|
reactScrollName,
|
|
46
50
|
reactScrollClassName,
|
|
47
51
|
defaultExpanded,
|
|
52
|
+
accordionSummaryClassName,
|
|
48
53
|
subTitleClassName,
|
|
49
54
|
onChange,
|
|
50
55
|
expanded,
|
|
51
|
-
accordionClassName
|
|
56
|
+
accordionClassName,
|
|
57
|
+
vehiclesComparedCount,
|
|
58
|
+
widthCompareBlock,
|
|
59
|
+
isCompare = false
|
|
52
60
|
} = this.props;
|
|
53
61
|
|
|
54
62
|
const scrollElementClassName = classnames(reactScrollClassName);
|
|
55
63
|
const subtitleCombinedClassName = classnames(styles.subTitle, subTitleClassName);
|
|
56
|
-
|
|
64
|
+
const widthForTitle = `${vehiclesComparedCount * widthCompareBlock}px`;
|
|
57
65
|
return (
|
|
58
66
|
<ConditionalWrapper
|
|
59
67
|
condition={reactScrollName}
|
|
@@ -62,14 +70,16 @@ class ExpansionPanel extends React.Component<IExpansionPanelProps> {
|
|
|
62
70
|
<ThemeProvider theme={Theme}>
|
|
63
71
|
<Accordion
|
|
64
72
|
defaultExpanded={defaultExpanded}
|
|
65
|
-
onChange={onChange
|
|
66
|
-
expanded={expanded
|
|
73
|
+
onChange={isCompare ? onChange : onChange && onChange(reactScrollName)}
|
|
74
|
+
expanded={isCompare ? expanded : expanded && (expanded === reactScrollName)}
|
|
67
75
|
className={accordionClassName}
|
|
68
76
|
>
|
|
69
77
|
<AccordionSummary
|
|
70
78
|
expandIcon={<IconSVG name={'arrowSelect'} className={styles.icon} customDimensions />}
|
|
71
79
|
aria-controls={title}
|
|
80
|
+
className={accordionSummaryClassName}
|
|
72
81
|
id={title}
|
|
82
|
+
sx={isCompare && { width: widthForTitle }}
|
|
73
83
|
>
|
|
74
84
|
<span>
|
|
75
85
|
{title}
|