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.
@@ -43,6 +43,10 @@ export type TProps = TCommonStepsProps & Omit<ComponentProps<'div'>, 'onClick'>
43
43
  * Адаптивный шаг
44
44
  */
45
45
  resizable?: boolean;
46
+ /**
47
+ * Нужен ли сброс до нулевого значения.
48
+ */
49
+ needZeroValue?: boolean;
46
50
  /**
47
51
  * Класс для иконки шага
48
52
  */
@@ -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
- setStep(clickedStep !== step2 ? clickedStep : ZERO_STEP);
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 && onClick(step);
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,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mimir-ui-kit",
3
3
  "private": false,
4
- "version": "1.29.3",
4
+ "version": "1.29.4",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {