@alfalab/core-components-slider-input 9.0.4 → 9.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/Component.d.ts CHANGED
@@ -4,7 +4,12 @@ import { ComponentType, ReactNode } from "react";
4
4
  import { InputProps } from "@alfalab/core-components-input";
5
5
  import { SliderProps } from "@alfalab/core-components-slider";
6
6
  import { OnChangeType, OnInputChangeType } from "./types/propTypes";
7
- type SliderInputProps = Omit<InputProps, 'min' | 'max' | 'step' | 'value' | 'type' | 'onChange' | 'bottomAddons'> & {
7
+ type SliderInputProps = Omit<InputProps, 'min' | 'max' | 'step' | 'value' | 'type' | 'onChange' | 'bottomAddons' | 'size'> & {
8
+ /**
9
+ * Размер компонента
10
+ * @description s, m, l, xl deprecated, используйте вместо них 48, 56, 64, 72 соответственно
11
+ */
12
+ size?: Exclude<InputProps['size'], 40>;
8
13
  /**
9
14
  * Мин. допустимое число
10
15
  */
@@ -17,6 +22,7 @@ type SliderInputProps = Omit<InputProps, 'min' | 'max' | 'step' | 'value' | 'typ
17
22
  * Предотвращает ввод числа если оно больше или меньше допустимого.
18
23
  * При событии blur установится число по верхней границе, если оно больше допустимого, и наоборот - по нижней границе, если число меньше допустимого.
19
24
  * @default false
25
+ * @deprecated Обработайте установку лимитов самостоятельно в событии onBlur. Пропс будет удален в версии core-components@49.0
20
26
  */
21
27
  lockLimit?: boolean;
22
28
  /**
@@ -96,7 +102,12 @@ type SliderInputProps = Omit<InputProps, 'min' | 'max' | 'step' | 'value' | 'typ
96
102
  */
97
103
  dataTestId?: string;
98
104
  };
99
- declare const SliderInput: React.ForwardRefExoticComponent<Omit<InputProps, "value" | "bottomAddons" | "onChange" | "step" | "type" | "max" | "min"> & {
105
+ declare const SliderInput: React.ForwardRefExoticComponent<Omit<InputProps, "value" | "size" | "bottomAddons" | "onChange" | "step" | "type" | "max" | "min"> & {
106
+ /**
107
+ * Размер компонента
108
+ * @description s, m, l, xl deprecated, используйте вместо них 48, 56, 64, 72 соответственно
109
+ */
110
+ size?: Exclude<InputProps['size'], 40>;
100
111
  /**
101
112
  * Мин. допустимое число
102
113
  */
@@ -109,6 +120,7 @@ declare const SliderInput: React.ForwardRefExoticComponent<Omit<InputProps, "val
109
120
  * Предотвращает ввод числа если оно больше или меньше допустимого.
110
121
  * При событии blur установится число по верхней границе, если оно больше допустимого, и наоборот - по нижней границе, если число меньше допустимого.
111
122
  * @default false
123
+ * @deprecated Обработайте установку лимитов самостоятельно в событии onBlur. Пропс будет удален в версии core-components@49.0
112
124
  */
113
125
  lockLimit?: boolean | undefined;
114
126
  /**
package/Component.js CHANGED
@@ -13,7 +13,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
13
13
  var React__default = /*#__PURE__*/_interopDefaultCompat(React);
14
14
  var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
15
15
 
16
- var styles = {"component":"slider-input__component_pusnq","block":"slider-input__block_pusnq","slider":"slider-input__slider_pusnq","size-72":"slider-input__size-72_pusnq","hidePips":"slider-input__hidePips_pusnq","field":"slider-input__field_pusnq","size-48":"slider-input__size-48_pusnq","size-56":"slider-input__size-56_pusnq","size-64":"slider-input__size-64_pusnq","input":"slider-input__input_pusnq","steps":"slider-input__steps_pusnq","info":"slider-input__info_pusnq","hasLabel":"slider-input__hasLabel_pusnq","focused":"slider-input__focused_pusnq","filled":"slider-input__filled_pusnq"};
16
+ var styles = {"component":"slider-input__component_q9aae","block":"slider-input__block_q9aae","slider":"slider-input__slider_q9aae","size-72":"slider-input__size-72_q9aae","hidePips":"slider-input__hidePips_q9aae","field":"slider-input__field_q9aae","size-48":"slider-input__size-48_q9aae","size-56":"slider-input__size-56_q9aae","size-64":"slider-input__size-64_q9aae","input":"slider-input__input_q9aae","steps":"slider-input__steps_q9aae","info":"slider-input__info_q9aae","hasLabel":"slider-input__hasLabel_q9aae","focused":"slider-input__focused_q9aae","filled":"slider-input__filled_q9aae"};
17
17
  require('./index.css')
18
18
 
19
19
  var SIZE_TO_CLASSNAME_MAP = {
@@ -69,7 +69,10 @@ var SliderInput = React.forwardRef(function (_a, ref) {
69
69
  });
70
70
  }
71
71
  }
72
- }, [getValidInputValue, lockLimit, max, min, onChange, onInputChange]);
72
+ if (restProps.onBlur) {
73
+ restProps.onBlur(event);
74
+ }
75
+ }, [getValidInputValue, lockLimit, max, min, onChange, onInputChange, restProps]);
73
76
  return (React__default.default.createElement("div", { className: cn__default.default(styles.component, (_b = {},
74
77
  _b[styles.block] = block,
75
78
  _b[styles.filled] = Boolean(value),
@@ -4,7 +4,12 @@ import { ComponentType, ReactNode } from "react";
4
4
  import { InputProps } from "@alfalab/core-components-input";
5
5
  import { SliderProps } from "@alfalab/core-components-slider";
6
6
  import { OnChangeType, OnInputChangeType } from "./types/propTypes";
7
- type SliderInputProps = Omit<InputProps, 'min' | 'max' | 'step' | 'value' | 'type' | 'onChange' | 'bottomAddons'> & {
7
+ type SliderInputProps = Omit<InputProps, 'min' | 'max' | 'step' | 'value' | 'type' | 'onChange' | 'bottomAddons' | 'size'> & {
8
+ /**
9
+ * Размер компонента
10
+ * @description s, m, l, xl deprecated, используйте вместо них 48, 56, 64, 72 соответственно
11
+ */
12
+ size?: Exclude<InputProps['size'], 40>;
8
13
  /**
9
14
  * Мин. допустимое число
10
15
  */
@@ -17,6 +22,7 @@ type SliderInputProps = Omit<InputProps, 'min' | 'max' | 'step' | 'value' | 'typ
17
22
  * Предотвращает ввод числа если оно больше или меньше допустимого.
18
23
  * При событии blur установится число по верхней границе, если оно больше допустимого, и наоборот - по нижней границе, если число меньше допустимого.
19
24
  * @default false
25
+ * @deprecated Обработайте установку лимитов самостоятельно в событии onBlur. Пропс будет удален в версии core-components@49.0
20
26
  */
21
27
  lockLimit?: boolean;
22
28
  /**
@@ -96,7 +102,12 @@ type SliderInputProps = Omit<InputProps, 'min' | 'max' | 'step' | 'value' | 'typ
96
102
  */
97
103
  dataTestId?: string;
98
104
  };
99
- declare const SliderInput: React.ForwardRefExoticComponent<Omit<InputProps, "value" | "bottomAddons" | "onChange" | "step" | "type" | "max" | "min"> & {
105
+ declare const SliderInput: React.ForwardRefExoticComponent<Omit<InputProps, "value" | "size" | "bottomAddons" | "onChange" | "step" | "type" | "max" | "min"> & {
106
+ /**
107
+ * Размер компонента
108
+ * @description s, m, l, xl deprecated, используйте вместо них 48, 56, 64, 72 соответственно
109
+ */
110
+ size?: Exclude<InputProps['size'], 40>;
100
111
  /**
101
112
  * Мин. допустимое число
102
113
  */
@@ -109,6 +120,7 @@ declare const SliderInput: React.ForwardRefExoticComponent<Omit<InputProps, "val
109
120
  * Предотвращает ввод числа если оно больше или меньше допустимого.
110
121
  * При событии blur установится число по верхней границе, если оно больше допустимого, и наоборот - по нижней границе, если число меньше допустимого.
111
122
  * @default false
123
+ * @deprecated Обработайте установку лимитов самостоятельно в событии onBlur. Пропс будет удален в версии core-components@49.0
112
124
  */
113
125
  lockLimit?: boolean | undefined;
114
126
  /**
package/cssm/Component.js CHANGED
@@ -68,7 +68,10 @@ var SliderInput = React.forwardRef(function (_a, ref) {
68
68
  });
69
69
  }
70
70
  }
71
- }, [getValidInputValue, lockLimit, max, min, onChange, onInputChange]);
71
+ if (restProps.onBlur) {
72
+ restProps.onBlur(event);
73
+ }
74
+ }, [getValidInputValue, lockLimit, max, min, onChange, onInputChange, restProps]);
72
75
  return (React__default.default.createElement("div", { className: cn__default.default(styles__default.default.component, (_b = {},
73
76
  _b[styles__default.default.block] = block,
74
77
  _b[styles__default.default.filled] = Boolean(value),
@@ -29,7 +29,10 @@
29
29
  --gap-2xl: 32px; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
30
30
 
31
31
  /* новые значения, используйте их */
32
- --gap-0: 0;
32
+
33
+ /* no-unit может приводить к проблемам в calc (#1559) */
34
+ /* stylelint-disable-next-line length-zero-no-unit */
35
+ --gap-0: 0px;
33
36
  --gap-4: var(--gap-2xs);
34
37
  --gap-8: var(--gap-xs);
35
38
  --gap-12: var(--gap-s);
@@ -4,7 +4,12 @@ import { ComponentType, ReactNode } from "react";
4
4
  import { InputProps } from "@alfalab/core-components-input";
5
5
  import { SliderProps } from "@alfalab/core-components-slider";
6
6
  import { OnChangeType, OnInputChangeType } from "./types/propTypes";
7
- type SliderInputProps = Omit<InputProps, 'min' | 'max' | 'step' | 'value' | 'type' | 'onChange' | 'bottomAddons'> & {
7
+ type SliderInputProps = Omit<InputProps, 'min' | 'max' | 'step' | 'value' | 'type' | 'onChange' | 'bottomAddons' | 'size'> & {
8
+ /**
9
+ * Размер компонента
10
+ * @description s, m, l, xl deprecated, используйте вместо них 48, 56, 64, 72 соответственно
11
+ */
12
+ size?: Exclude<InputProps['size'], 40>;
8
13
  /**
9
14
  * Мин. допустимое число
10
15
  */
@@ -17,6 +22,7 @@ type SliderInputProps = Omit<InputProps, 'min' | 'max' | 'step' | 'value' | 'typ
17
22
  * Предотвращает ввод числа если оно больше или меньше допустимого.
18
23
  * При событии blur установится число по верхней границе, если оно больше допустимого, и наоборот - по нижней границе, если число меньше допустимого.
19
24
  * @default false
25
+ * @deprecated Обработайте установку лимитов самостоятельно в событии onBlur. Пропс будет удален в версии core-components@49.0
20
26
  */
21
27
  lockLimit?: boolean;
22
28
  /**
@@ -96,7 +102,12 @@ type SliderInputProps = Omit<InputProps, 'min' | 'max' | 'step' | 'value' | 'typ
96
102
  */
97
103
  dataTestId?: string;
98
104
  };
99
- declare const SliderInput: React.ForwardRefExoticComponent<Omit<InputProps, "value" | "bottomAddons" | "onChange" | "step" | "type" | "max" | "min"> & {
105
+ declare const SliderInput: React.ForwardRefExoticComponent<Omit<InputProps, "value" | "size" | "bottomAddons" | "onChange" | "step" | "type" | "max" | "min"> & {
106
+ /**
107
+ * Размер компонента
108
+ * @description s, m, l, xl deprecated, используйте вместо них 48, 56, 64, 72 соответственно
109
+ */
110
+ size?: Exclude<InputProps['size'], 40>;
100
111
  /**
101
112
  * Мин. допустимое число
102
113
  */
@@ -109,6 +120,7 @@ declare const SliderInput: React.ForwardRefExoticComponent<Omit<InputProps, "val
109
120
  * Предотвращает ввод числа если оно больше или меньше допустимого.
110
121
  * При событии blur установится число по верхней границе, если оно больше допустимого, и наоборот - по нижней границе, если число меньше допустимого.
111
122
  * @default false
123
+ * @deprecated Обработайте установку лимитов самостоятельно в событии onBlur. Пропс будет удален в версии core-components@49.0
112
124
  */
113
125
  lockLimit?: boolean | undefined;
114
126
  /**
package/esm/Component.js CHANGED
@@ -4,7 +4,7 @@ import cn from 'classnames';
4
4
  import { Input } from '@alfalab/core-components-input/esm';
5
5
  import { Slider } from '@alfalab/core-components-slider/esm';
6
6
 
7
- var styles = {"component":"slider-input__component_pusnq","block":"slider-input__block_pusnq","slider":"slider-input__slider_pusnq","size-72":"slider-input__size-72_pusnq","hidePips":"slider-input__hidePips_pusnq","field":"slider-input__field_pusnq","size-48":"slider-input__size-48_pusnq","size-56":"slider-input__size-56_pusnq","size-64":"slider-input__size-64_pusnq","input":"slider-input__input_pusnq","steps":"slider-input__steps_pusnq","info":"slider-input__info_pusnq","hasLabel":"slider-input__hasLabel_pusnq","focused":"slider-input__focused_pusnq","filled":"slider-input__filled_pusnq"};
7
+ var styles = {"component":"slider-input__component_q9aae","block":"slider-input__block_q9aae","slider":"slider-input__slider_q9aae","size-72":"slider-input__size-72_q9aae","hidePips":"slider-input__hidePips_q9aae","field":"slider-input__field_q9aae","size-48":"slider-input__size-48_q9aae","size-56":"slider-input__size-56_q9aae","size-64":"slider-input__size-64_q9aae","input":"slider-input__input_q9aae","steps":"slider-input__steps_q9aae","info":"slider-input__info_q9aae","hasLabel":"slider-input__hasLabel_q9aae","focused":"slider-input__focused_q9aae","filled":"slider-input__filled_q9aae"};
8
8
  require('./index.css')
9
9
 
10
10
  var SIZE_TO_CLASSNAME_MAP = {
@@ -60,7 +60,10 @@ var SliderInput = forwardRef(function (_a, ref) {
60
60
  });
61
61
  }
62
62
  }
63
- }, [getValidInputValue, lockLimit, max, min, onChange, onInputChange]);
63
+ if (restProps.onBlur) {
64
+ restProps.onBlur(event);
65
+ }
66
+ }, [getValidInputValue, lockLimit, max, min, onChange, onInputChange, restProps]);
64
67
  return (React.createElement("div", { className: cn(styles.component, (_b = {},
65
68
  _b[styles.block] = block,
66
69
  _b[styles.filled] = Boolean(value),
package/esm/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: w3axl */
1
+ /* hash: 1okz1 */
2
2
  :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
3
3
  } /* deprecated */ :root {
4
4
  --color-light-neutral-700: #898991;
@@ -30,7 +30,10 @@
30
30
  --gap-2xl: 32px; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
31
31
 
32
32
  /* новые значения, используйте их */
33
- --gap-0: 0;
33
+
34
+ /* no-unit может приводить к проблемам в calc (#1559) */
35
+ /* stylelint-disable-next-line length-zero-no-unit */
36
+ --gap-0: 0px;
34
37
  --gap-4: var(--gap-2xs);
35
38
  --gap-8: var(--gap-xs);
36
39
  --gap-12: var(--gap-s);
@@ -89,57 +92,57 @@
89
92
  --slider-input-progress-hover-bg-color: var(--color-light-neutral-700);
90
93
  --slider-input-origin-width: calc(100% - 16px);
91
94
  --slider-input-origin-right: var(--gap-8);
92
- } .slider-input__component_pusnq {
95
+ } .slider-input__component_q9aae {
93
96
  position: relative;
94
97
  display: inline-block;
95
- } .slider-input__block_pusnq {
98
+ } .slider-input__block_q9aae {
96
99
  display: block;
97
- } .slider-input__slider_pusnq {
100
+ } .slider-input__slider_q9aae {
98
101
  width: calc(100% - var(--slider-input-progress-margin-horizontal) * 2);
99
102
  margin-left: var(--slider-input-progress-margin-horizontal);
100
103
  margin-right: var(--slider-input-progress-margin-horizontal);
101
104
  margin-top: calc(var(--slider-progress-s-height) / -2);
102
105
  transform: translateY(-1px)
103
- } .slider-input__slider_pusnq.slider-input__size-72_pusnq {
106
+ } .slider-input__slider_q9aae.slider-input__size-72_q9aae {
104
107
  width: calc(100% - var(--slider-input-xl-progress-margin-horizontal) * 2);
105
108
  margin-left: var(--slider-input-xl-progress-margin-horizontal);
106
109
  margin-right: var(--slider-input-xl-progress-margin-horizontal);
107
- } .slider-input__slider_pusnq .noUi-base {
110
+ } .slider-input__slider_q9aae .noUi-base {
108
111
  border-radius: var(--slider-input-progress-border-radius);
109
- } .slider-input__slider_pusnq .noUi-base:hover > .noUi-connects {
112
+ } .slider-input__slider_q9aae .noUi-base:hover > .noUi-connects {
110
113
  background-color: var(--slider-input-progress-hover-bg-color);
111
- } .slider-input__slider_pusnq .noUi-connects {
114
+ } .slider-input__slider_q9aae .noUi-connects {
112
115
  border-radius: var(--slider-input-progress-border-radius);
113
116
  background-color: var(--slider-input-progress-bg-color);
114
- } .slider-input__slider_pusnq .noUi-origin {
117
+ } .slider-input__slider_q9aae .noUi-origin {
115
118
  width: var(--slider-input-origin-width);
116
119
  right: var(--slider-input-origin-right);
117
- } .slider-input__slider_pusnq {
120
+ } .slider-input__slider_q9aae {
118
121
 
119
122
  /* TODO исправить на 6px когда слайдеру добавят position: absolute */
120
- } .slider-input__slider_pusnq + * {
123
+ } .slider-input__slider_q9aae + * {
121
124
  margin-top: 5px;
122
- } .slider-input__hidePips_pusnq .noUi-pips {
125
+ } .slider-input__hidePips_q9aae .noUi-pips {
123
126
  display: none;
124
- } .slider-input__component_pusnq .slider-input__field_pusnq.slider-input__size-48_pusnq {
127
+ } .slider-input__component_q9aae .slider-input__field_q9aae.slider-input__size-48_q9aae {
125
128
  border-bottom-left-radius: var(--slider-input-s-border-bottom-radius);
126
129
  border-bottom-right-radius: var(--slider-input-s-border-bottom-radius);
127
- } .slider-input__component_pusnq .slider-input__field_pusnq.slider-input__size-56_pusnq {
130
+ } .slider-input__component_q9aae .slider-input__field_q9aae.slider-input__size-56_q9aae {
128
131
  border-bottom-left-radius: var(--slider-input-m-border-bottom-radius);
129
132
  border-bottom-right-radius: var(--slider-input-m-border-bottom-radius);
130
- } .slider-input__component_pusnq .slider-input__field_pusnq.slider-input__size-64_pusnq {
133
+ } .slider-input__component_q9aae .slider-input__field_q9aae.slider-input__size-64_q9aae {
131
134
  border-bottom-left-radius: var(--slider-input-l-border-bottom-radius);
132
135
  border-bottom-right-radius: var(--slider-input-l-border-bottom-radius);
133
- } .slider-input__component_pusnq .slider-input__field_pusnq.slider-input__size-72_pusnq {
136
+ } .slider-input__component_q9aae .slider-input__field_q9aae.slider-input__size-72_q9aae {
134
137
  border-bottom-left-radius: var(--slider-input-xl-border-bottom-radius);
135
138
  border-bottom-right-radius: var(--slider-input-xl-border-bottom-radius);
136
- } .slider-input__input_pusnq input,
137
- .slider-input__input_pusnq input + div {
139
+ } .slider-input__input_q9aae input,
140
+ .slider-input__input_q9aae input + div {
138
141
  font-weight: var(--slider-input-font-weight);
139
142
  font-variant-numeric: tabular-nums;
140
- } .slider-input__input_pusnq input::placeholder {
143
+ } .slider-input__input_q9aae input::placeholder {
141
144
  font-weight: 400;
142
- } .slider-input__steps_pusnq {
145
+ } .slider-input__steps_q9aae {
143
146
  font-size: 14px;
144
147
  line-height: 18px;
145
148
  font-weight: 400;
@@ -148,7 +151,7 @@
148
151
  justify-content: space-between;
149
152
  margin-top: var(--gap-8);
150
153
  color: var(--slider-input-steps-color);
151
- } .slider-input__info_pusnq {
154
+ } .slider-input__info_q9aae {
152
155
  font-size: 16px;
153
156
  line-height: 20px;
154
157
  font-weight: 400;
@@ -158,24 +161,24 @@
158
161
  opacity: 0;
159
162
  transition: 0.2s ease;
160
163
  visibility: hidden;
161
- } .slider-input__size-48_pusnq.slider-input__hasLabel_pusnq .slider-input__info_pusnq:first-child {
164
+ } .slider-input__size-48_q9aae.slider-input__hasLabel_q9aae .slider-input__info_q9aae:first-child {
162
165
  padding: var(--form-control-labeled-s-paddings);
163
166
  padding-left: var(--gap-0);
164
167
  padding-right: var(--gap-0);
165
- } .slider-input__size-56_pusnq.slider-input__hasLabel_pusnq .slider-input__info_pusnq:first-child {
168
+ } .slider-input__size-56_q9aae.slider-input__hasLabel_q9aae .slider-input__info_q9aae:first-child {
166
169
  padding: var(--form-control-labeled-m-paddings);
167
170
  padding-left: var(--gap-0);
168
171
  padding-right: var(--gap-0);
169
- } .slider-input__size-64_pusnq.slider-input__hasLabel_pusnq .slider-input__info_pusnq:first-child {
172
+ } .slider-input__size-64_q9aae.slider-input__hasLabel_q9aae .slider-input__info_q9aae:first-child {
170
173
  padding: var(--form-control-labeled-l-paddings);
171
174
  padding-left: var(--gap-0);
172
175
  padding-right: var(--gap-0);
173
- } .slider-input__size-72_pusnq.slider-input__hasLabel_pusnq .slider-input__info_pusnq:first-child {
176
+ } .slider-input__size-72_q9aae.slider-input__hasLabel_q9aae .slider-input__info_q9aae:first-child {
174
177
  padding: var(--form-control-labeled-xl-paddings);
175
178
  padding-left: var(--gap-0);
176
179
  padding-right: var(--gap-0);
177
- } .slider-input__focused_pusnq .slider-input__info_pusnq,
178
- .slider-input__filled_pusnq .slider-input__info_pusnq {
180
+ } .slider-input__focused_q9aae .slider-input__info_q9aae,
181
+ .slider-input__filled_q9aae .slider-input__info_q9aae {
179
182
  visibility: visible;
180
183
  opacity: 1;
181
184
  }
package/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: w3axl */
1
+ /* hash: 1okz1 */
2
2
  :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
3
3
  } /* deprecated */ :root {
4
4
  --color-light-neutral-700: #898991;
@@ -30,7 +30,10 @@
30
30
  --gap-2xl: 32px; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
31
31
 
32
32
  /* новые значения, используйте их */
33
- --gap-0: 0;
33
+
34
+ /* no-unit может приводить к проблемам в calc (#1559) */
35
+ /* stylelint-disable-next-line length-zero-no-unit */
36
+ --gap-0: 0px;
34
37
  --gap-4: var(--gap-2xs);
35
38
  --gap-8: var(--gap-xs);
36
39
  --gap-12: var(--gap-s);
@@ -89,57 +92,57 @@
89
92
  --slider-input-progress-hover-bg-color: var(--color-light-neutral-700);
90
93
  --slider-input-origin-width: calc(100% - 16px);
91
94
  --slider-input-origin-right: var(--gap-8);
92
- } .slider-input__component_pusnq {
95
+ } .slider-input__component_q9aae {
93
96
  position: relative;
94
97
  display: inline-block;
95
- } .slider-input__block_pusnq {
98
+ } .slider-input__block_q9aae {
96
99
  display: block;
97
- } .slider-input__slider_pusnq {
100
+ } .slider-input__slider_q9aae {
98
101
  width: calc(100% - var(--slider-input-progress-margin-horizontal) * 2);
99
102
  margin-left: var(--slider-input-progress-margin-horizontal);
100
103
  margin-right: var(--slider-input-progress-margin-horizontal);
101
104
  margin-top: calc(var(--slider-progress-s-height) / -2);
102
105
  transform: translateY(-1px)
103
- } .slider-input__slider_pusnq.slider-input__size-72_pusnq {
106
+ } .slider-input__slider_q9aae.slider-input__size-72_q9aae {
104
107
  width: calc(100% - var(--slider-input-xl-progress-margin-horizontal) * 2);
105
108
  margin-left: var(--slider-input-xl-progress-margin-horizontal);
106
109
  margin-right: var(--slider-input-xl-progress-margin-horizontal);
107
- } .slider-input__slider_pusnq .noUi-base {
110
+ } .slider-input__slider_q9aae .noUi-base {
108
111
  border-radius: var(--slider-input-progress-border-radius);
109
- } .slider-input__slider_pusnq .noUi-base:hover > .noUi-connects {
112
+ } .slider-input__slider_q9aae .noUi-base:hover > .noUi-connects {
110
113
  background-color: var(--slider-input-progress-hover-bg-color);
111
- } .slider-input__slider_pusnq .noUi-connects {
114
+ } .slider-input__slider_q9aae .noUi-connects {
112
115
  border-radius: var(--slider-input-progress-border-radius);
113
116
  background-color: var(--slider-input-progress-bg-color);
114
- } .slider-input__slider_pusnq .noUi-origin {
117
+ } .slider-input__slider_q9aae .noUi-origin {
115
118
  width: var(--slider-input-origin-width);
116
119
  right: var(--slider-input-origin-right);
117
- } .slider-input__slider_pusnq {
120
+ } .slider-input__slider_q9aae {
118
121
 
119
122
  /* TODO исправить на 6px когда слайдеру добавят position: absolute */
120
- } .slider-input__slider_pusnq + * {
123
+ } .slider-input__slider_q9aae + * {
121
124
  margin-top: 5px;
122
- } .slider-input__hidePips_pusnq .noUi-pips {
125
+ } .slider-input__hidePips_q9aae .noUi-pips {
123
126
  display: none;
124
- } .slider-input__component_pusnq .slider-input__field_pusnq.slider-input__size-48_pusnq {
127
+ } .slider-input__component_q9aae .slider-input__field_q9aae.slider-input__size-48_q9aae {
125
128
  border-bottom-left-radius: var(--slider-input-s-border-bottom-radius);
126
129
  border-bottom-right-radius: var(--slider-input-s-border-bottom-radius);
127
- } .slider-input__component_pusnq .slider-input__field_pusnq.slider-input__size-56_pusnq {
130
+ } .slider-input__component_q9aae .slider-input__field_q9aae.slider-input__size-56_q9aae {
128
131
  border-bottom-left-radius: var(--slider-input-m-border-bottom-radius);
129
132
  border-bottom-right-radius: var(--slider-input-m-border-bottom-radius);
130
- } .slider-input__component_pusnq .slider-input__field_pusnq.slider-input__size-64_pusnq {
133
+ } .slider-input__component_q9aae .slider-input__field_q9aae.slider-input__size-64_q9aae {
131
134
  border-bottom-left-radius: var(--slider-input-l-border-bottom-radius);
132
135
  border-bottom-right-radius: var(--slider-input-l-border-bottom-radius);
133
- } .slider-input__component_pusnq .slider-input__field_pusnq.slider-input__size-72_pusnq {
136
+ } .slider-input__component_q9aae .slider-input__field_q9aae.slider-input__size-72_q9aae {
134
137
  border-bottom-left-radius: var(--slider-input-xl-border-bottom-radius);
135
138
  border-bottom-right-radius: var(--slider-input-xl-border-bottom-radius);
136
- } .slider-input__input_pusnq input,
137
- .slider-input__input_pusnq input + div {
139
+ } .slider-input__input_q9aae input,
140
+ .slider-input__input_q9aae input + div {
138
141
  font-weight: var(--slider-input-font-weight);
139
142
  font-variant-numeric: tabular-nums;
140
- } .slider-input__input_pusnq input::placeholder {
143
+ } .slider-input__input_q9aae input::placeholder {
141
144
  font-weight: 400;
142
- } .slider-input__steps_pusnq {
145
+ } .slider-input__steps_q9aae {
143
146
  font-size: 14px;
144
147
  line-height: 18px;
145
148
  font-weight: 400;
@@ -148,7 +151,7 @@
148
151
  justify-content: space-between;
149
152
  margin-top: var(--gap-8);
150
153
  color: var(--slider-input-steps-color);
151
- } .slider-input__info_pusnq {
154
+ } .slider-input__info_q9aae {
152
155
  font-size: 16px;
153
156
  line-height: 20px;
154
157
  font-weight: 400;
@@ -158,24 +161,24 @@
158
161
  opacity: 0;
159
162
  transition: 0.2s ease;
160
163
  visibility: hidden;
161
- } .slider-input__size-48_pusnq.slider-input__hasLabel_pusnq .slider-input__info_pusnq:first-child {
164
+ } .slider-input__size-48_q9aae.slider-input__hasLabel_q9aae .slider-input__info_q9aae:first-child {
162
165
  padding: var(--form-control-labeled-s-paddings);
163
166
  padding-left: var(--gap-0);
164
167
  padding-right: var(--gap-0);
165
- } .slider-input__size-56_pusnq.slider-input__hasLabel_pusnq .slider-input__info_pusnq:first-child {
168
+ } .slider-input__size-56_q9aae.slider-input__hasLabel_q9aae .slider-input__info_q9aae:first-child {
166
169
  padding: var(--form-control-labeled-m-paddings);
167
170
  padding-left: var(--gap-0);
168
171
  padding-right: var(--gap-0);
169
- } .slider-input__size-64_pusnq.slider-input__hasLabel_pusnq .slider-input__info_pusnq:first-child {
172
+ } .slider-input__size-64_q9aae.slider-input__hasLabel_q9aae .slider-input__info_q9aae:first-child {
170
173
  padding: var(--form-control-labeled-l-paddings);
171
174
  padding-left: var(--gap-0);
172
175
  padding-right: var(--gap-0);
173
- } .slider-input__size-72_pusnq.slider-input__hasLabel_pusnq .slider-input__info_pusnq:first-child {
176
+ } .slider-input__size-72_q9aae.slider-input__hasLabel_q9aae .slider-input__info_q9aae:first-child {
174
177
  padding: var(--form-control-labeled-xl-paddings);
175
178
  padding-left: var(--gap-0);
176
179
  padding-right: var(--gap-0);
177
- } .slider-input__focused_pusnq .slider-input__info_pusnq,
178
- .slider-input__filled_pusnq .slider-input__info_pusnq {
180
+ } .slider-input__focused_q9aae .slider-input__info_q9aae,
181
+ .slider-input__filled_q9aae .slider-input__info_q9aae {
179
182
  visibility: visible;
180
183
  opacity: 1;
181
184
  }
@@ -4,7 +4,12 @@ import { ComponentType, ReactNode } from "react";
4
4
  import { InputProps } from "@alfalab/core-components-input";
5
5
  import { SliderProps } from "@alfalab/core-components-slider";
6
6
  import { OnChangeType, OnInputChangeType } from "./types/propTypes";
7
- type SliderInputProps = Omit<InputProps, 'min' | 'max' | 'step' | 'value' | 'type' | 'onChange' | 'bottomAddons'> & {
7
+ type SliderInputProps = Omit<InputProps, 'min' | 'max' | 'step' | 'value' | 'type' | 'onChange' | 'bottomAddons' | 'size'> & {
8
+ /**
9
+ * Размер компонента
10
+ * @description s, m, l, xl deprecated, используйте вместо них 48, 56, 64, 72 соответственно
11
+ */
12
+ size?: Exclude<InputProps['size'], 40>;
8
13
  /**
9
14
  * Мин. допустимое число
10
15
  */
@@ -17,6 +22,7 @@ type SliderInputProps = Omit<InputProps, 'min' | 'max' | 'step' | 'value' | 'typ
17
22
  * Предотвращает ввод числа если оно больше или меньше допустимого.
18
23
  * При событии blur установится число по верхней границе, если оно больше допустимого, и наоборот - по нижней границе, если число меньше допустимого.
19
24
  * @default false
25
+ * @deprecated Обработайте установку лимитов самостоятельно в событии onBlur. Пропс будет удален в версии core-components@49.0
20
26
  */
21
27
  lockLimit?: boolean;
22
28
  /**
@@ -96,7 +102,12 @@ type SliderInputProps = Omit<InputProps, 'min' | 'max' | 'step' | 'value' | 'typ
96
102
  */
97
103
  dataTestId?: string;
98
104
  };
99
- declare const SliderInput: React.ForwardRefExoticComponent<Omit<InputProps, "value" | "bottomAddons" | "onChange" | "step" | "type" | "max" | "min"> & {
105
+ declare const SliderInput: React.ForwardRefExoticComponent<Omit<InputProps, "value" | "size" | "bottomAddons" | "onChange" | "step" | "type" | "max" | "min"> & {
106
+ /**
107
+ * Размер компонента
108
+ * @description s, m, l, xl deprecated, используйте вместо них 48, 56, 64, 72 соответственно
109
+ */
110
+ size?: Exclude<InputProps['size'], 40>;
100
111
  /**
101
112
  * Мин. допустимое число
102
113
  */
@@ -109,6 +120,7 @@ declare const SliderInput: React.ForwardRefExoticComponent<Omit<InputProps, "val
109
120
  * Предотвращает ввод числа если оно больше или меньше допустимого.
110
121
  * При событии blur установится число по верхней границе, если оно больше допустимого, и наоборот - по нижней границе, если число меньше допустимого.
111
122
  * @default false
123
+ * @deprecated Обработайте установку лимитов самостоятельно в событии onBlur. Пропс будет удален в версии core-components@49.0
112
124
  */
113
125
  lockLimit?: boolean | undefined;
114
126
  /**
@@ -3,7 +3,7 @@ import cn from 'classnames';
3
3
  import { Input } from '@alfalab/core-components-input/modern';
4
4
  import { Slider } from '@alfalab/core-components-slider/modern';
5
5
 
6
- const styles = {"component":"slider-input__component_pusnq","block":"slider-input__block_pusnq","slider":"slider-input__slider_pusnq","size-72":"slider-input__size-72_pusnq","hidePips":"slider-input__hidePips_pusnq","field":"slider-input__field_pusnq","size-48":"slider-input__size-48_pusnq","size-56":"slider-input__size-56_pusnq","size-64":"slider-input__size-64_pusnq","input":"slider-input__input_pusnq","steps":"slider-input__steps_pusnq","info":"slider-input__info_pusnq","hasLabel":"slider-input__hasLabel_pusnq","focused":"slider-input__focused_pusnq","filled":"slider-input__filled_pusnq"};
6
+ const styles = {"component":"slider-input__component_q9aae","block":"slider-input__block_q9aae","slider":"slider-input__slider_q9aae","size-72":"slider-input__size-72_q9aae","hidePips":"slider-input__hidePips_q9aae","field":"slider-input__field_q9aae","size-48":"slider-input__size-48_q9aae","size-56":"slider-input__size-56_q9aae","size-64":"slider-input__size-64_q9aae","input":"slider-input__input_q9aae","steps":"slider-input__steps_q9aae","info":"slider-input__info_q9aae","hasLabel":"slider-input__hasLabel_q9aae","focused":"slider-input__focused_q9aae","filled":"slider-input__filled_q9aae"};
7
7
  require('./index.css')
8
8
 
9
9
  const SIZE_TO_CLASSNAME_MAP = {
@@ -57,7 +57,10 @@ const SliderInput = forwardRef(({ className, inputClassName, sliderClassName, st
57
57
  });
58
58
  }
59
59
  }
60
- }, [getValidInputValue, lockLimit, max, min, onChange, onInputChange]);
60
+ if (restProps.onBlur) {
61
+ restProps.onBlur(event);
62
+ }
63
+ }, [getValidInputValue, lockLimit, max, min, onChange, onInputChange, restProps]);
61
64
  return (React.createElement("div", { className: cn(styles.component, {
62
65
  [styles.block]: block,
63
66
  [styles.filled]: Boolean(value),
package/modern/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: w3axl */
1
+ /* hash: 1okz1 */
2
2
  :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
3
3
  } /* deprecated */ :root {
4
4
  --color-light-neutral-700: #898991;
@@ -30,7 +30,10 @@
30
30
  --gap-2xl: 32px; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
31
31
 
32
32
  /* новые значения, используйте их */
33
- --gap-0: 0;
33
+
34
+ /* no-unit может приводить к проблемам в calc (#1559) */
35
+ /* stylelint-disable-next-line length-zero-no-unit */
36
+ --gap-0: 0px;
34
37
  --gap-4: var(--gap-2xs);
35
38
  --gap-8: var(--gap-xs);
36
39
  --gap-12: var(--gap-s);
@@ -89,57 +92,57 @@
89
92
  --slider-input-progress-hover-bg-color: var(--color-light-neutral-700);
90
93
  --slider-input-origin-width: calc(100% - 16px);
91
94
  --slider-input-origin-right: var(--gap-8);
92
- } .slider-input__component_pusnq {
95
+ } .slider-input__component_q9aae {
93
96
  position: relative;
94
97
  display: inline-block;
95
- } .slider-input__block_pusnq {
98
+ } .slider-input__block_q9aae {
96
99
  display: block;
97
- } .slider-input__slider_pusnq {
100
+ } .slider-input__slider_q9aae {
98
101
  width: calc(100% - var(--slider-input-progress-margin-horizontal) * 2);
99
102
  margin-left: var(--slider-input-progress-margin-horizontal);
100
103
  margin-right: var(--slider-input-progress-margin-horizontal);
101
104
  margin-top: calc(var(--slider-progress-s-height) / -2);
102
105
  transform: translateY(-1px)
103
- } .slider-input__slider_pusnq.slider-input__size-72_pusnq {
106
+ } .slider-input__slider_q9aae.slider-input__size-72_q9aae {
104
107
  width: calc(100% - var(--slider-input-xl-progress-margin-horizontal) * 2);
105
108
  margin-left: var(--slider-input-xl-progress-margin-horizontal);
106
109
  margin-right: var(--slider-input-xl-progress-margin-horizontal);
107
- } .slider-input__slider_pusnq .noUi-base {
110
+ } .slider-input__slider_q9aae .noUi-base {
108
111
  border-radius: var(--slider-input-progress-border-radius);
109
- } .slider-input__slider_pusnq .noUi-base:hover > .noUi-connects {
112
+ } .slider-input__slider_q9aae .noUi-base:hover > .noUi-connects {
110
113
  background-color: var(--slider-input-progress-hover-bg-color);
111
- } .slider-input__slider_pusnq .noUi-connects {
114
+ } .slider-input__slider_q9aae .noUi-connects {
112
115
  border-radius: var(--slider-input-progress-border-radius);
113
116
  background-color: var(--slider-input-progress-bg-color);
114
- } .slider-input__slider_pusnq .noUi-origin {
117
+ } .slider-input__slider_q9aae .noUi-origin {
115
118
  width: var(--slider-input-origin-width);
116
119
  right: var(--slider-input-origin-right);
117
- } .slider-input__slider_pusnq {
120
+ } .slider-input__slider_q9aae {
118
121
 
119
122
  /* TODO исправить на 6px когда слайдеру добавят position: absolute */
120
- } .slider-input__slider_pusnq + * {
123
+ } .slider-input__slider_q9aae + * {
121
124
  margin-top: 5px;
122
- } .slider-input__hidePips_pusnq .noUi-pips {
125
+ } .slider-input__hidePips_q9aae .noUi-pips {
123
126
  display: none;
124
- } .slider-input__component_pusnq .slider-input__field_pusnq.slider-input__size-48_pusnq {
127
+ } .slider-input__component_q9aae .slider-input__field_q9aae.slider-input__size-48_q9aae {
125
128
  border-bottom-left-radius: var(--slider-input-s-border-bottom-radius);
126
129
  border-bottom-right-radius: var(--slider-input-s-border-bottom-radius);
127
- } .slider-input__component_pusnq .slider-input__field_pusnq.slider-input__size-56_pusnq {
130
+ } .slider-input__component_q9aae .slider-input__field_q9aae.slider-input__size-56_q9aae {
128
131
  border-bottom-left-radius: var(--slider-input-m-border-bottom-radius);
129
132
  border-bottom-right-radius: var(--slider-input-m-border-bottom-radius);
130
- } .slider-input__component_pusnq .slider-input__field_pusnq.slider-input__size-64_pusnq {
133
+ } .slider-input__component_q9aae .slider-input__field_q9aae.slider-input__size-64_q9aae {
131
134
  border-bottom-left-radius: var(--slider-input-l-border-bottom-radius);
132
135
  border-bottom-right-radius: var(--slider-input-l-border-bottom-radius);
133
- } .slider-input__component_pusnq .slider-input__field_pusnq.slider-input__size-72_pusnq {
136
+ } .slider-input__component_q9aae .slider-input__field_q9aae.slider-input__size-72_q9aae {
134
137
  border-bottom-left-radius: var(--slider-input-xl-border-bottom-radius);
135
138
  border-bottom-right-radius: var(--slider-input-xl-border-bottom-radius);
136
- } .slider-input__input_pusnq input,
137
- .slider-input__input_pusnq input + div {
139
+ } .slider-input__input_q9aae input,
140
+ .slider-input__input_q9aae input + div {
138
141
  font-weight: var(--slider-input-font-weight);
139
142
  font-variant-numeric: tabular-nums;
140
- } .slider-input__input_pusnq input::placeholder {
143
+ } .slider-input__input_q9aae input::placeholder {
141
144
  font-weight: 400;
142
- } .slider-input__steps_pusnq {
145
+ } .slider-input__steps_q9aae {
143
146
  font-size: 14px;
144
147
  line-height: 18px;
145
148
  font-weight: 400;
@@ -148,7 +151,7 @@
148
151
  justify-content: space-between;
149
152
  margin-top: var(--gap-8);
150
153
  color: var(--slider-input-steps-color);
151
- } .slider-input__info_pusnq {
154
+ } .slider-input__info_q9aae {
152
155
  font-size: 16px;
153
156
  line-height: 20px;
154
157
  font-weight: 400;
@@ -158,24 +161,24 @@
158
161
  opacity: 0;
159
162
  transition: 0.2s ease;
160
163
  visibility: hidden;
161
- } .slider-input__size-48_pusnq.slider-input__hasLabel_pusnq .slider-input__info_pusnq:first-child {
164
+ } .slider-input__size-48_q9aae.slider-input__hasLabel_q9aae .slider-input__info_q9aae:first-child {
162
165
  padding: var(--form-control-labeled-s-paddings);
163
166
  padding-left: var(--gap-0);
164
167
  padding-right: var(--gap-0);
165
- } .slider-input__size-56_pusnq.slider-input__hasLabel_pusnq .slider-input__info_pusnq:first-child {
168
+ } .slider-input__size-56_q9aae.slider-input__hasLabel_q9aae .slider-input__info_q9aae:first-child {
166
169
  padding: var(--form-control-labeled-m-paddings);
167
170
  padding-left: var(--gap-0);
168
171
  padding-right: var(--gap-0);
169
- } .slider-input__size-64_pusnq.slider-input__hasLabel_pusnq .slider-input__info_pusnq:first-child {
172
+ } .slider-input__size-64_q9aae.slider-input__hasLabel_q9aae .slider-input__info_q9aae:first-child {
170
173
  padding: var(--form-control-labeled-l-paddings);
171
174
  padding-left: var(--gap-0);
172
175
  padding-right: var(--gap-0);
173
- } .slider-input__size-72_pusnq.slider-input__hasLabel_pusnq .slider-input__info_pusnq:first-child {
176
+ } .slider-input__size-72_q9aae.slider-input__hasLabel_q9aae .slider-input__info_q9aae:first-child {
174
177
  padding: var(--form-control-labeled-xl-paddings);
175
178
  padding-left: var(--gap-0);
176
179
  padding-right: var(--gap-0);
177
- } .slider-input__focused_pusnq .slider-input__info_pusnq,
178
- .slider-input__filled_pusnq .slider-input__info_pusnq {
180
+ } .slider-input__focused_q9aae .slider-input__info_q9aae,
181
+ .slider-input__filled_q9aae .slider-input__info_q9aae {
179
182
  visibility: visible;
180
183
  opacity: 1;
181
184
  }
@@ -4,7 +4,12 @@ import { ComponentType, ReactNode } from "react";
4
4
  import { InputProps } from "@alfalab/core-components-input";
5
5
  import { SliderProps } from "@alfalab/core-components-slider";
6
6
  import { OnChangeType, OnInputChangeType } from "./types/propTypes";
7
- type SliderInputProps = Omit<InputProps, 'min' | 'max' | 'step' | 'value' | 'type' | 'onChange' | 'bottomAddons'> & {
7
+ type SliderInputProps = Omit<InputProps, 'min' | 'max' | 'step' | 'value' | 'type' | 'onChange' | 'bottomAddons' | 'size'> & {
8
+ /**
9
+ * Размер компонента
10
+ * @description s, m, l, xl deprecated, используйте вместо них 48, 56, 64, 72 соответственно
11
+ */
12
+ size?: Exclude<InputProps['size'], 40>;
8
13
  /**
9
14
  * Мин. допустимое число
10
15
  */
@@ -17,6 +22,7 @@ type SliderInputProps = Omit<InputProps, 'min' | 'max' | 'step' | 'value' | 'typ
17
22
  * Предотвращает ввод числа если оно больше или меньше допустимого.
18
23
  * При событии blur установится число по верхней границе, если оно больше допустимого, и наоборот - по нижней границе, если число меньше допустимого.
19
24
  * @default false
25
+ * @deprecated Обработайте установку лимитов самостоятельно в событии onBlur. Пропс будет удален в версии core-components@49.0
20
26
  */
21
27
  lockLimit?: boolean;
22
28
  /**
@@ -96,7 +102,12 @@ type SliderInputProps = Omit<InputProps, 'min' | 'max' | 'step' | 'value' | 'typ
96
102
  */
97
103
  dataTestId?: string;
98
104
  };
99
- declare const SliderInput: React.ForwardRefExoticComponent<Omit<InputProps, "value" | "bottomAddons" | "onChange" | "step" | "type" | "max" | "min"> & {
105
+ declare const SliderInput: React.ForwardRefExoticComponent<Omit<InputProps, "value" | "size" | "bottomAddons" | "onChange" | "step" | "type" | "max" | "min"> & {
106
+ /**
107
+ * Размер компонента
108
+ * @description s, m, l, xl deprecated, используйте вместо них 48, 56, 64, 72 соответственно
109
+ */
110
+ size?: Exclude<InputProps['size'], 40>;
100
111
  /**
101
112
  * Мин. допустимое число
102
113
  */
@@ -109,6 +120,7 @@ declare const SliderInput: React.ForwardRefExoticComponent<Omit<InputProps, "val
109
120
  * Предотвращает ввод числа если оно больше или меньше допустимого.
110
121
  * При событии blur установится число по верхней границе, если оно больше допустимого, и наоборот - по нижней границе, если число меньше допустимого.
111
122
  * @default false
123
+ * @deprecated Обработайте установку лимитов самостоятельно в событии onBlur. Пропс будет удален в версии core-components@49.0
112
124
  */
113
125
  lockLimit?: boolean | undefined;
114
126
  /**
@@ -55,7 +55,10 @@ const SliderInput = forwardRef(({ className, inputClassName, sliderClassName, st
55
55
  });
56
56
  }
57
57
  }
58
- }, [getValidInputValue, lockLimit, max, min, onChange, onInputChange]);
58
+ if (restProps.onBlur) {
59
+ restProps.onBlur(event);
60
+ }
61
+ }, [getValidInputValue, lockLimit, max, min, onChange, onInputChange, restProps]);
59
62
  return (React.createElement("div", { className: cn(styles.component, {
60
63
  [styles.block]: block,
61
64
  [styles.filled]: Boolean(value),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfalab/core-components-slider-input",
3
- "version": "9.0.4",
3
+ "version": "9.2.0",
4
4
  "description": "Slider input component",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -16,11 +16,11 @@
16
16
  "react-dom": "^16.9.0 || ^17.0.1 || ^18.0.0"
17
17
  },
18
18
  "dependencies": {
19
- "@alfalab/core-components-input": "^15.4.0",
20
- "@alfalab/core-components-slider": "^4.7.2",
19
+ "@alfalab/core-components-input": "^15.5.1",
20
+ "@alfalab/core-components-slider": "^4.7.3",
21
21
  "classnames": "^2.5.1",
22
22
  "tslib": "^2.4.0"
23
23
  },
24
- "themesVersion": "13.6.0",
25
- "varsVersion": "9.16.0"
24
+ "themesVersion": "13.7.0",
25
+ "varsVersion": "9.18.0"
26
26
  }
package/src/Component.tsx CHANGED
@@ -20,8 +20,14 @@ import styles from './index.module.css';
20
20
 
21
21
  export type SliderInputProps = Omit<
22
22
  InputProps,
23
- 'min' | 'max' | 'step' | 'value' | 'type' | 'onChange' | 'bottomAddons'
23
+ 'min' | 'max' | 'step' | 'value' | 'type' | 'onChange' | 'bottomAddons' | 'size'
24
24
  > & {
25
+ /**
26
+ * Размер компонента
27
+ * @description s, m, l, xl deprecated, используйте вместо них 48, 56, 64, 72 соответственно
28
+ */
29
+ size?: Exclude<InputProps['size'], 40>;
30
+
25
31
  /**
26
32
  * Мин. допустимое число
27
33
  */
@@ -36,6 +42,7 @@ export type SliderInputProps = Omit<
36
42
  * Предотвращает ввод числа если оно больше или меньше допустимого.
37
43
  * При событии blur установится число по верхней границе, если оно больше допустимого, и наоборот - по нижней границе, если число меньше допустимого.
38
44
  * @default false
45
+ * @deprecated Обработайте установку лимитов самостоятельно в событии onBlur. Пропс будет удален в версии core-components@49.0
39
46
  */
40
47
  lockLimit?: boolean;
41
48
 
@@ -206,7 +213,7 @@ export const SliderInput = forwardRef<HTMLInputElement, SliderInputProps>(
206
213
  );
207
214
 
208
215
  const handleInputBlur = useCallback(
209
- (event: FocusEvent) => {
216
+ (event: FocusEvent<HTMLInputElement>) => {
210
217
  const { value: inputValue } = event.target as HTMLInputElement;
211
218
  const validValue = getValidInputValue(inputValue);
212
219
 
@@ -234,8 +241,12 @@ export const SliderInput = forwardRef<HTMLInputElement, SliderInputProps>(
234
241
  });
235
242
  }
236
243
  }
244
+
245
+ if (restProps.onBlur) {
246
+ restProps.onBlur(event);
247
+ }
237
248
  },
238
- [getValidInputValue, lockLimit, max, min, onChange, onInputChange],
249
+ [getValidInputValue, lockLimit, max, min, onChange, onInputChange, restProps],
239
250
  );
240
251
 
241
252
  return (