mimir-ui-kit 1.29.3 → 1.29.4
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.
@@ -31,6 +31,7 @@ const Steps = forwardRef(
|
|
31
31
|
rootClassName,
|
32
32
|
stepClassName,
|
33
33
|
quantity,
|
34
|
+
needZeroValue = true,
|
34
35
|
current = ZERO_STEP,
|
35
36
|
editable: editable2 = false,
|
36
37
|
size = EStepsSize.M,
|
@@ -64,7 +65,10 @@ const Steps = forwardRef(
|
|
64
65
|
const handleClick = (idx) => {
|
65
66
|
const clickedStep = idx + DIFF_BETWEEN_STEP_AND_INDEX;
|
66
67
|
stepWasChangedRef.current = true;
|
67
|
-
|
68
|
+
if (needZeroValue) {
|
69
|
+
return setStep(clickedStep !== step2 ? clickedStep : ZERO_STEP);
|
70
|
+
}
|
71
|
+
setStep(clickedStep);
|
68
72
|
};
|
69
73
|
useEffect(() => {
|
70
74
|
if (stepWasChangedRef.current === true) {
|
@@ -65,6 +65,10 @@ export type TProps = TCommonVoteProps & {
|
|
65
65
|
* Адаптивный шаг
|
66
66
|
*/
|
67
67
|
resizable?: boolean;
|
68
|
+
/**
|
69
|
+
* Нужен ли сброс до нулевого значения.
|
70
|
+
*/
|
71
|
+
needZeroValue?: boolean;
|
68
72
|
/**
|
69
73
|
* Класс для иконки шага
|
70
74
|
*/
|
@@ -145,6 +149,10 @@ export declare const Vote: import('react').ForwardRefExoticComponent<TCommonVote
|
|
145
149
|
* Адаптивный шаг
|
146
150
|
*/
|
147
151
|
resizable?: boolean;
|
152
|
+
/**
|
153
|
+
* Нужен ли сброс до нулевого значения.
|
154
|
+
*/
|
155
|
+
needZeroValue?: boolean;
|
148
156
|
/**
|
149
157
|
* Класс для иконки шага
|
150
158
|
*/
|
@@ -21,6 +21,7 @@ const Vote = forwardRef((props, ref) => {
|
|
21
21
|
stepsStepClassName,
|
22
22
|
title: title2 = DEFAULT_TITLE,
|
23
23
|
withoutTitle = false,
|
24
|
+
needZeroValue = true,
|
24
25
|
quantity,
|
25
26
|
current = ZERO_STEP,
|
26
27
|
size = EVoteSize.M,
|
@@ -51,7 +52,7 @@ const Vote = forwardRef((props, ref) => {
|
|
51
52
|
}, [score2, zones, unselectedColor, isZeroStep]);
|
52
53
|
const handleStepsClick = (step) => {
|
53
54
|
setScore(step);
|
54
|
-
onClick
|
55
|
+
onClick == null ? void 0 : onClick(step);
|
55
56
|
};
|
56
57
|
const handleHoverStepEnter = (step) => {
|
57
58
|
setHoveredScore(step + 1);
|
@@ -98,6 +99,7 @@ const Vote = forwardRef((props, ref) => {
|
|
98
99
|
size: EVoteSize.L,
|
99
100
|
current: score2,
|
100
101
|
editable: true,
|
102
|
+
needZeroValue,
|
101
103
|
resizable,
|
102
104
|
disabled,
|
103
105
|
onClick: handleStepsClick,
|