@lunit/oui 2.1.1 → 2.2.0
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/dist/components/Tooltip/Tooltip.utils.js +1 -1
- package/dist/presentations/Accordion/index.d.ts +2 -0
- package/dist/presentations/AnalysisBar/AnalysisBar.js +2 -2
- package/dist/presentations/AnalysisBar/AnalysisBar.styled.d.ts +2 -1
- package/dist/presentations/AnalysisBar/AnalysisBar.styled.js +6 -4
- package/dist/presentations/Histogram/Histogram.d.ts +1 -1
- package/dist/presentations/Histogram/Histogram.js +6 -3
- package/dist/presentations/Histogram/Histogram.styled.d.ts +3 -0
- package/dist/presentations/Histogram/Histogram.styled.js +5 -0
- package/dist/presentations/Histogram/Histogram.types.d.ts +2 -0
- package/dist/presentations/Preview/Preview.d.ts +3 -0
- package/dist/presentations/Preview/Preview.js +18 -0
- package/dist/presentations/Preview/Preview.styled.d.ts +4 -0
- package/dist/presentations/Preview/Preview.styled.js +9 -0
- package/dist/presentations/Preview/Preview.types.d.ts +14 -0
- package/dist/presentations/Preview/Preview.types.js +1 -0
- package/dist/presentations/Preview/index.d.ts +4 -0
- package/dist/presentations/Preview/index.js +2 -0
- package/dist/presentations/Threshold/Threshold.d.ts +1 -1
- package/dist/presentations/Threshold/Threshold.js +2 -2
- package/dist/presentations/Threshold/Threshold.types.d.ts +1 -0
- package/dist/presentations/ToggleControl/ToggleControl.js +4 -1
- package/dist/presentations/ToggleControl/ToggleControl.styled.js +2 -3
- package/dist/presentations/ToggleControlGroup/ToggleControlGroup.js +7 -1
- package/dist/presentations/ToggleControlGroup/index.d.ts +2 -0
- package/dist/presentations/index.d.ts +1 -0
- package/dist/presentations/index.js +1 -0
- package/package.json +1 -1
|
@@ -8,7 +8,7 @@ const Segments = ({ segments, adjustForOnePercent }) => {
|
|
|
8
8
|
return null;
|
|
9
9
|
}
|
|
10
10
|
if (segments?.length === 1 && segments[0].color === 'jet') {
|
|
11
|
-
return (_jsx(Box, { sx: { width: '100%', height: '
|
|
11
|
+
return (_jsx(Box, { sx: { width: '100%', height: '14px', transform: 'scaleY(0.8)' }, children: _jsx(HeatmapGraphSVG, { width: 'auto', height: 'auto' }) }));
|
|
12
12
|
}
|
|
13
13
|
return (_jsx(_Fragment, { children: segments?.map((segment, i) => {
|
|
14
14
|
if (segment.color === 'jet') {
|
|
@@ -19,7 +19,7 @@ const Segments = ({ segments, adjustForOnePercent }) => {
|
|
|
19
19
|
};
|
|
20
20
|
const AnalysisBar = ({ componentType = 'analysisBar', expressionValue, caption, expressionLevels, segments, isDimmed = false, }) => {
|
|
21
21
|
const hasAdjustedOnePercentSegment = segments?.[0].width === 1;
|
|
22
|
-
return (_jsxs(AnalysisBarOuter, { className: "analysis-bar", isDimmed: isDimmed, children: [_jsxs(AnalysisBarSegmentContainer, { children: [expressionValue && (_jsx(GraphScoreIndicator, { adjustForOnePercent: hasAdjustedOnePercentSegment, value: expressionValue })), _jsx(Segments, { segments: segments, adjustForOnePercent: hasAdjustedOnePercentSegment })] }), _jsxs(AxisLabels, { children: [expressionLevels.map((val, i) => {
|
|
22
|
+
return (_jsxs(AnalysisBarOuter, { className: "analysis-bar", isDimmed: isDimmed, children: [_jsxs(AnalysisBarSegmentContainer, { children: [expressionValue && (_jsx(GraphScoreIndicator, { adjustForOnePercent: hasAdjustedOnePercentSegment, value: expressionValue, isJet: segments?.[0].color === 'jet' })), _jsx(Segments, { segments: segments, adjustForOnePercent: hasAdjustedOnePercentSegment })] }), _jsxs(AxisLabels, { children: [expressionLevels.map((val, i) => {
|
|
23
23
|
return (_jsx(GraphAxisLabel, { label: val, adjustForOnePercent: hasAdjustedOnePercentSegment, leftPos: parseStringValToNumber(val) }, i));
|
|
24
24
|
}), caption && (_jsx(GraphAxisLabel, { label: caption, adjustForOnePercent: hasAdjustedOnePercentSegment, leftPos: 50 }))] })] }));
|
|
25
25
|
};
|
|
@@ -7,9 +7,10 @@ export declare const AnalysisBarOuter: import("@emotion/styled").StyledComponent
|
|
|
7
7
|
export declare const AnalysisBarSegmentContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
8
8
|
ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
|
|
9
9
|
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
10
|
-
export declare const GraphScoreIndicator: ({ value, adjustForOnePercent, }: {
|
|
10
|
+
export declare const GraphScoreIndicator: ({ value, adjustForOnePercent, isJet, }: {
|
|
11
11
|
value: string;
|
|
12
12
|
adjustForOnePercent: boolean;
|
|
13
|
+
isJet?: boolean | undefined;
|
|
13
14
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
14
15
|
export declare const GraphAxisLabel: ({ label, leftPos, adjustForOnePercent, }: {
|
|
15
16
|
label: string;
|
|
@@ -17,14 +17,16 @@ export const AnalysisBarSegmentContainer = styled(Box)(() => ({
|
|
|
17
17
|
position: 'relative',
|
|
18
18
|
width: '100%',
|
|
19
19
|
}));
|
|
20
|
-
const GraphScoreIndicatorContainer = styled('span'
|
|
20
|
+
const GraphScoreIndicatorContainer = styled('span', {
|
|
21
|
+
shouldForwardProp: (prop) => prop !== 'isJet',
|
|
22
|
+
})(({ isJet }) => {
|
|
21
23
|
return {
|
|
22
24
|
width: '20px',
|
|
23
25
|
position: 'absolute',
|
|
24
26
|
display: 'flex',
|
|
25
27
|
flexDirection: 'column',
|
|
26
28
|
alignItems: 'center',
|
|
27
|
-
top: '-20px',
|
|
29
|
+
top: isJet ? '-20px' : '-19px',
|
|
28
30
|
zIndex: 999,
|
|
29
31
|
};
|
|
30
32
|
});
|
|
@@ -38,14 +40,14 @@ const GraphScoreIndicatorPip = styled('span')(() => {
|
|
|
38
40
|
boxSizing: 'content-box',
|
|
39
41
|
};
|
|
40
42
|
});
|
|
41
|
-
export const GraphScoreIndicator = ({ value, adjustForOnePercent, }) => {
|
|
43
|
+
export const GraphScoreIndicator = ({ value, adjustForOnePercent, isJet, }) => {
|
|
42
44
|
let leftPos = parseStringValToNumber(value);
|
|
43
45
|
if (adjustForOnePercent) {
|
|
44
46
|
leftPos = adjustBarLabelPosition(leftPos);
|
|
45
47
|
}
|
|
46
48
|
return (_jsxs(GraphScoreIndicatorContainer, { className: "analysis-bar-score-indicator", sx: {
|
|
47
49
|
left: `${leftPos}%`,
|
|
48
|
-
transform: 'translateX(-50%)',
|
|
50
|
+
transform: isJet ? 'translateX(-50%) translateY(8px)' : 'translateX(-50%)',
|
|
49
51
|
}, children: [_jsx(Typography, { variant: "small_body_sb1", sx: { textAlign: 'center' }, children: value }), _jsx(GraphScoreIndicatorPip, {})] }));
|
|
50
52
|
};
|
|
51
53
|
const GraphAxisLabelContainer = styled('span')(() => {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { HistogramProps } from './Histogram.types';
|
|
2
|
-
declare const Histogram: ({ componentType, title, xAxisLabels, yAxisLabels, tabs, }: HistogramProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const Histogram: ({ componentType, title, xAxisLabels, yAxisLabels, tabs, description, }: HistogramProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default Histogram;
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from 'react';
|
|
3
|
+
import { v4 as uuidV4 } from 'uuid';
|
|
3
4
|
import { Box } from '@mui/material';
|
|
4
|
-
import { HistogramContainer, HistogramChartContainer, HistogramTitle, HistogramNoData, } from './Histogram.styled';
|
|
5
|
+
import { HistogramContainer, HistogramChartContainer, HistogramTitle, HistogramNoData, HistogramDescription, } from './Histogram.styled';
|
|
5
6
|
import HistogramTabs from './HistogramTabs';
|
|
6
7
|
import HistogramChart from './HistogramCharts';
|
|
7
|
-
|
|
8
|
+
import { FreeText } from '../FreeText';
|
|
9
|
+
const Histogram = ({ componentType = 'histogram', title, xAxisLabels, yAxisLabels, tabs, description = [], }) => {
|
|
8
10
|
const [activeIndex, setActiveIndex] = useState(0);
|
|
9
11
|
const noData = tabs[activeIndex].data.length === 0;
|
|
10
12
|
return (_jsxs(HistogramContainer, { children: [noData && _jsx(HistogramNoData, { children: "No Data" }), title && _jsx(HistogramTitle, { children: title }), _jsx(HistogramTabs, { options: tabs.map((tab) => tab.label), active: activeIndex, onChange: setActiveIndex }), _jsx(HistogramChartContainer, { children: _jsx(Box, { sx: {
|
|
11
13
|
position: 'absolute',
|
|
12
14
|
left: '-25px',
|
|
13
|
-
}, children: _jsx(HistogramChart, { dataset: tabs[activeIndex], xAxisLabels: xAxisLabels, yAxisLabels: yAxisLabels }) }) })
|
|
15
|
+
}, children: _jsx(HistogramChart, { dataset: tabs[activeIndex], xAxisLabels: xAxisLabels, yAxisLabels: yAxisLabels }) }) }), _jsx(HistogramDescription, { children: description.length > 0 &&
|
|
16
|
+
description.map((item) => (_jsx(FreeText, { ...item }, uuidV4()))) })] }));
|
|
14
17
|
};
|
|
15
18
|
export default Histogram;
|
|
@@ -14,6 +14,9 @@ export declare const HistogramTabsContainer: import("@emotion/styled").StyledCom
|
|
|
14
14
|
export declare const HistogramChartContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
15
15
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
16
16
|
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
17
|
+
export declare const HistogramDescription: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
18
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
19
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
17
20
|
export declare const TabButton: import("@emotion/styled").StyledComponent<import("@mui/material").ButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
18
21
|
ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
19
22
|
}, "color" | "disabled" | "size" | "style" | "fullWidth" | "classes" | "className" | "children" | "sx" | "variant" | "tabIndex" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableElevation" | "disableFocusRipple" | "endIcon" | "href" | "startIcon"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
@@ -29,6 +29,11 @@ export const HistogramChartContainer = styled(Box)({
|
|
|
29
29
|
width: '244px',
|
|
30
30
|
marginBottom: '32px',
|
|
31
31
|
});
|
|
32
|
+
export const HistogramDescription = styled(Box)({
|
|
33
|
+
display: 'flex',
|
|
34
|
+
flexDirection: 'column',
|
|
35
|
+
gap: '4px',
|
|
36
|
+
});
|
|
32
37
|
export const TabButton = styled(Button, {
|
|
33
38
|
shouldForwardProp: (prop) => prop !== 'active',
|
|
34
39
|
})(({ theme, active = false }) => ({
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FreeTextProps } from '../FreeText';
|
|
1
2
|
export interface HistogramTab {
|
|
2
3
|
label: string;
|
|
3
4
|
data: number[];
|
|
@@ -5,6 +6,7 @@ export interface HistogramTab {
|
|
|
5
6
|
export interface HistogramProps {
|
|
6
7
|
componentType: 'histogram';
|
|
7
8
|
title?: string;
|
|
9
|
+
description?: FreeTextProps[];
|
|
8
10
|
xAxisLabels: number[];
|
|
9
11
|
yAxisLabels: number[];
|
|
10
12
|
tabs: HistogramTab[];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { v4 as uuidV4 } from 'uuid';
|
|
3
|
+
import { Container } from './Preview.styled';
|
|
4
|
+
import { Box } from '@mui/material';
|
|
5
|
+
import { ToggleControl } from '../ToggleControl';
|
|
6
|
+
import { ToggleControlGroup } from '../ToggleControlGroup';
|
|
7
|
+
import { AnalysisBar } from '../AnalysisBar';
|
|
8
|
+
import { HorizonDivider } from '../HorizonDivider';
|
|
9
|
+
import { Accordion } from '../Accordion';
|
|
10
|
+
import { Statistic } from '../Statistic';
|
|
11
|
+
import { Score } from '../Score';
|
|
12
|
+
import { FreeText } from '../FreeText';
|
|
13
|
+
import { Threshold } from '../Threshold';
|
|
14
|
+
import { Histogram } from '../Histogram';
|
|
15
|
+
const Preview = ({ visualizationControls = [], analysisSummary = [] }) => {
|
|
16
|
+
return (_jsxs(Container, { children: [_jsx(Box, { sx: { display: 'flex', flexDirection: 'column', gap: '16px', padding: '16px' }, children: visualizationControls.map((item) => (_jsxs(Box, { children: [item.componentType === 'toggle' && (_jsx(ToggleControl, { ...item, onChange: () => { } }, uuidV4())), item.componentType === 'toggleGroup' && (_jsx(ToggleControlGroup, { ...item, onChange: () => { } }, uuidV4())), item.componentType === 'analysisBar' && (_jsx(AnalysisBar, { ...item }, uuidV4()))] }, uuidV4()))) }), _jsx(HorizonDivider, { componentType: "divider" }), _jsxs(Box, { sx: { display: 'flex', flexDirection: 'column', gap: '16px', padding: '16px' }, children: [_jsx(FreeText, { componentType: "freeText", size: "large-bold", content: "Analysis Summary" }), analysisSummary.map((item) => (_jsxs(Box, { children: [item.componentType === 'accordion' && (_jsx(Accordion, { ...item }, uuidV4())), item.componentType === 'statistic' && (_jsx(Statistic, { ...item }, uuidV4())), item.componentType === 'score' && (_jsx(Score, { ...item }, uuidV4())), item.componentType === 'freeText' && (_jsx(FreeText, { ...item }, uuidV4())), item.componentType === 'threshold' && (_jsx(Threshold, { ...item }, uuidV4())), item.componentType === 'histogram' && (_jsx(Histogram, { ...item }, uuidV4()))] }, uuidV4())))] })] }));
|
|
17
|
+
};
|
|
18
|
+
export default Preview;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const Container: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
3
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
4
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AccordionProps } from '../Accordion';
|
|
2
|
+
import { StatisticProps } from '../Statistic';
|
|
3
|
+
import { ScoreProps } from '../Score';
|
|
4
|
+
import { ToggleControlProps } from '../ToggleControl';
|
|
5
|
+
import { ToggleControlGroupProps } from '../ToggleControlGroup';
|
|
6
|
+
import { AnalysisBarProps } from '../AnalysisBar';
|
|
7
|
+
import { FreeTextProps } from '../FreeText';
|
|
8
|
+
import { ThresholdProps } from '../Threshold';
|
|
9
|
+
import { HistogramProps } from '../Histogram';
|
|
10
|
+
interface PreviewProps {
|
|
11
|
+
visualizationControls: (ToggleControlProps | ToggleControlGroupProps | AnalysisBarProps)[];
|
|
12
|
+
analysisSummary: (AccordionProps | StatisticProps | ScoreProps | FreeTextProps | ThresholdProps | HistogramProps)[];
|
|
13
|
+
}
|
|
14
|
+
export type { PreviewProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ThresholdProps } from './Threshold.types';
|
|
2
|
-
declare const Threshold: ({ componentType, title, totalScore, statisticItems, options, description, controlStep, onChangeDropdown, onSliderChangeCommitted, }: ThresholdProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const Threshold: ({ componentType, title, totalScore, totalCells, statisticItems, options, description, controlStep, onChangeDropdown, onSliderChangeCommitted, }: ThresholdProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default Threshold;
|
|
@@ -10,7 +10,7 @@ import { Button, Dropdown, DropdownItem } from '../../components';
|
|
|
10
10
|
import { HorizonDivider } from '../HorizonDivider';
|
|
11
11
|
import { FreeText } from '../FreeText';
|
|
12
12
|
import { getPresetValue, getSliderMarks } from './Threshold.utils';
|
|
13
|
-
const Threshold = ({ componentType = 'threshold', title, totalScore, statisticItems, options, description, controlStep = 1, onChangeDropdown, onSliderChangeCommitted, }) => {
|
|
13
|
+
const Threshold = ({ componentType = 'threshold', title, totalScore, totalCells, statisticItems, options, description, controlStep = 1, onChangeDropdown, onSliderChangeCommitted, }) => {
|
|
14
14
|
const [selectedItem, setSelectedItem] = useState(options[0].title.toString());
|
|
15
15
|
const [selectedValue, setSelectedValue] = useState(options[0].value);
|
|
16
16
|
const [isPresetSelected, setIsPresetSelected] = useState(options[0].isPreset);
|
|
@@ -25,7 +25,7 @@ const Threshold = ({ componentType = 'threshold', title, totalScore, statisticIt
|
|
|
25
25
|
const handleSliderChange = (event, value) => {
|
|
26
26
|
setSelectedValue(value);
|
|
27
27
|
};
|
|
28
|
-
return (_jsxs(Container, { children: [_jsx(Score, { ...totalScore }), statisticItems.map((item) => {
|
|
28
|
+
return (_jsxs(Container, { children: [_jsx(Score, { ...totalScore }), _jsx(Statistic, { ...totalCells }), statisticItems.map((item) => {
|
|
29
29
|
return (_jsx(Statistic, { ...item }, uuidV4()));
|
|
30
30
|
}), _jsx(HorizonDivider, { componentType: "divider" }), _jsx(PresentationTypography, { size: "medium", children: title }), _jsx(Dropdown, { value: selectedItem, onChange: handleChange, sx: { width: '258px' }, children: options.map((option) => {
|
|
31
31
|
return (_jsx(DropdownItem, { value: option.title, children: option.title }, option.title));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
2
3
|
import { v4 as uuidV4 } from 'uuid';
|
|
3
4
|
import { Box } from '@mui/material';
|
|
4
5
|
import { ToggleControlContainer, ToggleControlOuter } from './ToggleControl.styled';
|
|
@@ -10,12 +11,14 @@ import { Statistic } from '../Statistic';
|
|
|
10
11
|
import { Tooltip } from '../../components';
|
|
11
12
|
import { Information } from '../../icons';
|
|
12
13
|
const ToggleControl = ({ componentType = 'toggle', title, size = 'medium', symbol, tooltip = [], content = [], color, isParent = false, disabled = false, bar, checked, isDimmed = false, onChange, }) => {
|
|
14
|
+
const [isChecked, setIsChecked] = useState(checked);
|
|
13
15
|
const handleChange = (event) => {
|
|
16
|
+
setIsChecked(event.target.checked);
|
|
14
17
|
onChange && onChange(event);
|
|
15
18
|
};
|
|
16
19
|
return (_jsxs(ToggleControlOuter, { "data-toggle-name": `toggle-control-${title?.replace(/\s/g, '-')}`, hasBar: !!bar, style: { marginBottom: isParent ? '4px' : '0' }, children: [_jsxs(ToggleControlContainer, { className: "toggle-inner-container", size: size, children: [_jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: '6px' }, className: "toggle-label", children: [!!tooltip.length && (_jsx(Tooltip, { arrow: true, size: "large", title: _jsx(Box, { sx: { display: 'flex', flexDirection: 'column', gap: '8px' }, children: tooltip.map((item) => (_jsxs(Box, { children: [item.componentType === 'freeText' && (_jsx(FreeText, { componentType: item.componentType, size: item.size, content: item.content })), item.componentType === 'statistic' && (_jsx(Statistic, { componentType: item.componentType, title: item.title, size: item.size, layout: item.layout, symbol: item.symbol, color: item.color }))] }, uuidV4()))) }), children: _jsx(Box, { sx: {
|
|
17
20
|
display: 'flex',
|
|
18
21
|
alignItems: 'center',
|
|
19
|
-
}, children: _jsx(Information, {}) }) })), symbol && (_jsx(PresentationSymbolIcon, { symbol: symbol, color: color, isDimmed: isDimmed || !checked })), _jsx(PresentationTypography, { size: size, isDimmed: isDimmed || !checked, children: title })] }), _jsx(StyledToggle, { disabled: disabled, checked:
|
|
22
|
+
}, children: _jsx(Information, {}) }) })), symbol && (_jsx(PresentationSymbolIcon, { symbol: symbol, color: color, isDimmed: isDimmed || !checked })), _jsx(PresentationTypography, { size: size, isDimmed: isDimmed || !checked, children: title })] }), _jsx(StyledToggle, { disabled: disabled, checked: isChecked, onChange: handleChange })] }), content.length > 0 && (_jsx(Box, { sx: { display: 'flex', flexDirection: 'column', gap: '8px' }, children: content.map((item) => (_jsx(Statistic, { ...item, isDimmed: isDimmed || !checked }))) }, uuidV4())), bar && (_jsx(Box, { sx: { padding: '0 8px', fontSize: '14px', lineHeight: '8px' }, children: _jsx(AnalysisBar, { isDimmed: isDimmed || !checked, componentType: bar.componentType, expressionValue: bar.expressionValue, expressionLevels: bar.expressionLevels, caption: bar.caption, segments: bar.segments }) }))] }));
|
|
20
23
|
};
|
|
21
24
|
export default ToggleControl;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Box, styled } from '@mui/material';
|
|
2
2
|
const getPadding = (size) => {
|
|
3
3
|
if (size === 'large-bold') {
|
|
4
|
-
return '14px
|
|
4
|
+
return '14px 0';
|
|
5
5
|
}
|
|
6
|
-
return '
|
|
6
|
+
return '2px';
|
|
7
7
|
};
|
|
8
8
|
export const ToggleControlOuter = styled(Box, { shouldForwardProp: (prop) => prop !== 'hasBar' })(({ hasBar }) => ({
|
|
9
9
|
display: 'flex',
|
|
@@ -20,7 +20,6 @@ export const ToggleControlContainer = styled(Box, {
|
|
|
20
20
|
width: '100%',
|
|
21
21
|
display: 'flex',
|
|
22
22
|
justifyContent: 'space-between',
|
|
23
|
-
gap: '34px',
|
|
24
23
|
padding: getPadding(size),
|
|
25
24
|
alignItems: 'center',
|
|
26
25
|
};
|
|
@@ -39,7 +39,13 @@ const ToggleControlGroup = ({ componentType = 'toggleGroup', size = 'medium', ti
|
|
|
39
39
|
setChildrenChecked(newState);
|
|
40
40
|
}
|
|
41
41
|
else {
|
|
42
|
-
|
|
42
|
+
const childChecked = Array(childToggles.length).fill(true);
|
|
43
|
+
childToggles.forEach((child, index) => {
|
|
44
|
+
if (child.checked === false) {
|
|
45
|
+
childChecked[index] = false;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
setChildrenChecked(childChecked);
|
|
43
49
|
}
|
|
44
50
|
}, [behavior, childToggles, childrenChecked.length]);
|
|
45
51
|
return (_jsxs(ToggleControlGroupContainer, { children: [_jsx(ToggleControl, { isParent: true, componentType: "toggle", bar: bar, disabled: disabled, size: size, title: title, tooltip: tooltip, checked: toggleChecked, onChange: handleToggleChange }), childToggles?.map((child, index) => {
|
package/package.json
CHANGED