@lunit/oui 2.4.6 → 2.4.8
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.
|
@@ -18,7 +18,7 @@ const Segments = ({ segments, isCutoff }) => {
|
|
|
18
18
|
if (segment.color === 'jet') {
|
|
19
19
|
return _jsx(HeatmapGraphSVG, { width: `${segment.width}%` });
|
|
20
20
|
}
|
|
21
|
-
return (_jsx(GraphSegment, { color: segment.color, width: segment.width, isFirstSegment: i === 0, isLastSegment: i === segments.length - 1, isCutoff: isCutoff, combinedWidth: combinedWidth, isNextSegment: onePercentSegmentIndex
|
|
21
|
+
return (_jsx(GraphSegment, { color: segment.color, width: segment.width, isFirstSegment: i === 0, isLastSegment: i === segments.length - 1, isCutoff: isCutoff, combinedWidth: combinedWidth, isNextSegment: onePercentSegmentIndex >= 0 && i === onePercentSegmentIndex + 1, isOnePercentSegment: segment.width <= 1 }, i));
|
|
22
22
|
}) }));
|
|
23
23
|
};
|
|
24
24
|
const AnalysisBar = ({ componentType = 'analysisBar', isCutoff = false, expressionValue, caption, expressionLevels = [], expressionLabels = [], segments, isDimmed = false, }) => {
|
|
@@ -9,7 +9,7 @@ import { PresentationTypography } from '../presentations.styled';
|
|
|
9
9
|
import { Button, Dropdown, DropdownItem } from '../../components';
|
|
10
10
|
import { HorizonDivider } from '../HorizonDivider';
|
|
11
11
|
import { FreeText } from '../FreeText';
|
|
12
|
-
import {
|
|
12
|
+
import { baseSliderMarks, getPresetValue } from './Threshold.utils';
|
|
13
13
|
const Threshold = ({ componentType = 'threshold', title, totalScore, totalCells, statisticItems, options, description, controlStep = 1, isLoading = false, thresholdState, onChangeDropdown, onChangeSlider, onSliderChangeCommitted, onClickUpdateConfiguration, }) => {
|
|
14
14
|
if (!componentType)
|
|
15
15
|
throw new Error("The 'componentType' prop is required.");
|
|
@@ -22,7 +22,6 @@ const Threshold = ({ componentType = 'threshold', title, totalScore, totalCells,
|
|
|
22
22
|
const [isThresholdChanged, setIsThresholdChanged] = useState(false);
|
|
23
23
|
const [selectedOptionValue, setSelectedOptionValue] = useState(options[0].value);
|
|
24
24
|
const presetValue = getPresetValue(options, thresholdState?.selectedItem);
|
|
25
|
-
const marks = getSliderMarks(presetValue);
|
|
26
25
|
const handleDropdownChange = (event) => {
|
|
27
26
|
onChangeDropdown(event);
|
|
28
27
|
const newOption = options.find((option) => option.title === event.target.value)?.value;
|
|
@@ -41,7 +40,7 @@ const Threshold = ({ componentType = 'threshold', title, totalScore, totalCells,
|
|
|
41
40
|
return (_jsx(Statistic, { ...item }, uuidV4()));
|
|
42
41
|
}), _jsx(HorizonDivider, { componentType: "divider" }), _jsx(PresentationTypography, { size: "medium", children: title }), _jsx(Dropdown, { value: thresholdState?.selectedItem, onChange: handleDropdownChange, sx: { width: '258px' }, children: options.map((option) => {
|
|
43
42
|
return (_jsx(DropdownItem, { value: option.title, children: option.title }, option.title));
|
|
44
|
-
}) }), _jsxs(Box, { sx: { display: 'flex', flexDirection: 'column', paddingTop: '36px', gap: '6px' }, children: [_jsx(BaseSlider, { disabled: thresholdState?.isPresetSelected, step: controlStep, value: thresholdState?.sliderValue, valueLabelDisplay: "on", defaultThreshold: presetValue, marks:
|
|
43
|
+
}) }), _jsxs(Box, { sx: { display: 'flex', flexDirection: 'column', paddingTop: '36px', gap: '6px' }, children: [_jsx(BaseSlider, { disabled: thresholdState?.isPresetSelected, step: controlStep, value: thresholdState?.sliderValue, valueLabelDisplay: "on", defaultThreshold: presetValue, marks: baseSliderMarks, onChange: handleSliderChange, onChangeCommitted: onSliderChangeCommitted }), !thresholdState?.isPresetSelected && (_jsx(Button, { id: "update-threshold-config-btn", label: "Update Configuration", sx: {
|
|
45
44
|
width: '100%',
|
|
46
45
|
}, disabled: !isThresholdChanged || isLoading, onClick: handleUpdateConfiguration, loading: isLoading })), thresholdState?.isPresetSelected && description?.preset && (_jsx(FreeText, { componentType: "freeText", size: "small-dimmed", content: description.preset })), !thresholdState?.isPresetSelected && description?.user && (_jsx(FreeText, { componentType: "freeText", size: "small-dimmed", content: description.user }))] })] }));
|
|
47
46
|
};
|
|
@@ -7,7 +7,7 @@ export const Container = styled(Box)({
|
|
|
7
7
|
});
|
|
8
8
|
export const BaseSlider = styled(Slider, {
|
|
9
9
|
shouldForwardProp: (prop) => prop !== 'defaultThreshold',
|
|
10
|
-
})(({ defaultThreshold, marks }) => {
|
|
10
|
+
})(({ defaultThreshold, marks, disabled }) => {
|
|
11
11
|
let markIndex = 0;
|
|
12
12
|
if (Array.isArray(marks) && marks.length > 0) {
|
|
13
13
|
markIndex = marks.findIndex((mark) => mark.value === defaultThreshold);
|
|
@@ -30,18 +30,12 @@ export const BaseSlider = styled(Slider, {
|
|
|
30
30
|
'&.Mui-focusVisible': {
|
|
31
31
|
boxShadow: `0px 0px 0px 8px rgba(255, 0, 0, 0.2)`,
|
|
32
32
|
},
|
|
33
|
-
'&.Mui-disabled': {
|
|
34
|
-
visibility: 'hidden',
|
|
35
|
-
},
|
|
36
33
|
},
|
|
37
34
|
'& .MuiSlider-mark': {
|
|
38
35
|
background: theme.palette.neutralGrey[40],
|
|
39
36
|
height: '6px',
|
|
40
37
|
width: '6px',
|
|
41
38
|
borderRadius: '50%',
|
|
42
|
-
[defaultThresClass]: {
|
|
43
|
-
background: theme.palette.lunitTeal[40],
|
|
44
|
-
},
|
|
45
39
|
},
|
|
46
40
|
'& .MuiSlider-markLabel': {
|
|
47
41
|
fontFamily: 'Pretendard,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"',
|
|
@@ -49,9 +43,6 @@ export const BaseSlider = styled(Slider, {
|
|
|
49
43
|
fontStyle: 'normal',
|
|
50
44
|
fontWeight: '500',
|
|
51
45
|
lineHeight: '12px',
|
|
52
|
-
[defaultLabelClass]: {
|
|
53
|
-
color: theme.palette.lunitTeal[40],
|
|
54
|
-
},
|
|
55
46
|
},
|
|
56
47
|
'& .MuiSlider-valueLabel': {
|
|
57
48
|
fontFamily: 'Pretendard,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"',
|
|
@@ -63,7 +54,7 @@ export const BaseSlider = styled(Slider, {
|
|
|
63
54
|
width: 32,
|
|
64
55
|
height: 32,
|
|
65
56
|
borderRadius: '50% 50% 50% 0',
|
|
66
|
-
backgroundColor: theme.palette.lunitTeal[40],
|
|
57
|
+
backgroundColor: disabled ? theme.palette.neutralGrey[60] : theme.palette.lunitTeal[40],
|
|
67
58
|
transformOrigin: 'bottom left',
|
|
68
59
|
transform: 'translate(50%, -100%) rotate(-45deg) scale(0)',
|
|
69
60
|
'&:before': { display: 'none' },
|
package/package.json
CHANGED