@megafon/ui-core 5.12.1 → 5.14.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/CHANGELOG.md +33 -0
- package/dist/es/components/Carousel/Carousel.js +1 -0
- package/dist/es/components/Row/Row.css +238 -0
- package/dist/es/components/Row/Row.d.ts +46 -0
- package/dist/es/components/Row/Row.js +107 -0
- package/dist/es/components/Search/Search.css +10 -4
- package/dist/es/components/Sliders/Slider/Slider.css +2 -6
- package/dist/es/components/Sliders/Slider/Slider.js +2 -2
- package/dist/es/components/Sliders/SliderRange/SliderRange.css +12 -3
- package/dist/es/components/Sliders/SliderRange/SliderRange.js +41 -8
- package/dist/es/components/Sliders/SliderRatio/SliderRatio.css +8 -3
- package/dist/es/components/Sliders/SliderRatio/SliderRatio.js +38 -5
- package/dist/es/components/Sliders/components/SliderDisplayValue/SliderDisplayValue.css +1 -1
- package/dist/es/components/Sliders/components/SliderDisplayValue/SliderDisplayValue.js +21 -1
- package/dist/es/components/Sliders/helpers.d.ts +1 -0
- package/dist/es/components/Sliders/helpers.js +5 -0
- package/dist/es/components/Snackbar/Snackbar.css +5 -3
- package/dist/es/components/Snackbar/Snackbar.js +5 -2
- package/dist/es/index.d.ts +1 -0
- package/dist/es/index.js +1 -0
- package/dist/lib/components/Carousel/Carousel.js +1 -0
- package/dist/lib/components/Row/Row.css +238 -0
- package/dist/lib/components/Row/Row.d.ts +46 -0
- package/dist/lib/components/Row/Row.js +127 -0
- package/dist/lib/components/Search/Search.css +10 -4
- package/dist/lib/components/Sliders/Slider/Slider.css +2 -6
- package/dist/lib/components/Sliders/Slider/Slider.js +1 -1
- package/dist/lib/components/Sliders/SliderRange/SliderRange.css +12 -3
- package/dist/lib/components/Sliders/SliderRange/SliderRange.js +40 -7
- package/dist/lib/components/Sliders/SliderRatio/SliderRatio.css +8 -3
- package/dist/lib/components/Sliders/SliderRatio/SliderRatio.js +37 -4
- package/dist/lib/components/Sliders/components/SliderDisplayValue/SliderDisplayValue.css +1 -1
- package/dist/lib/components/Sliders/components/SliderDisplayValue/SliderDisplayValue.js +22 -1
- package/dist/lib/components/Sliders/helpers.d.ts +1 -0
- package/dist/lib/components/Sliders/helpers.js +12 -2
- package/dist/lib/components/Snackbar/Snackbar.css +5 -3
- package/dist/lib/components/Snackbar/Snackbar.js +5 -2
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.js +8 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,39 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [5.14.0](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/compare/@megafon/ui-core@5.13.0...@megafon/ui-core@5.14.0) (2024-06-03)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **carousel:** fix page scroll ([99c80bc](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/99c80bccd1f09b3ad3feaa965d9c0205b038d660))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* **search:** modern gradient ([7c2becc](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/7c2beccd79d83e9cd099ea49de4138e4ab9822af))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# [5.13.0](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/compare/@megafon/ui-core@5.12.1...@megafon/ui-core@5.13.0) (2024-05-27)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* **sliders:** fix bugs ([f09615a](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/f09615a4a417836ceaa71b3c604a9288f81ba69a))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Features
|
|
31
|
+
|
|
32
|
+
* **row:** create component Row ([08da88f](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/08da88fcbbdaea5c5fb1a88cffbfb820025e6d84))
|
|
33
|
+
* **snackbar:** update snackbar component ([71713f1](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/71713f11e81bb4da0e4b531fd27e2882287b6122))
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
6
39
|
## [5.12.1](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/compare/@megafon/ui-core@5.12.0...@megafon/ui-core@5.12.1) (2024-05-14)
|
|
7
40
|
|
|
8
41
|
|
|
@@ -302,6 +302,7 @@ var Carousel = function Carousel(_ref) {
|
|
|
302
302
|
fadeEffect: effectTheme === EffectTheme.FADE ? {
|
|
303
303
|
crossFade: effectTheme === EffectTheme.FADE
|
|
304
304
|
} : undefined,
|
|
305
|
+
touchMoveStopPropagation: true,
|
|
305
306
|
noSwipingSelector: noSwipingSelector ? ".swiper-pagination, ".concat(noSwipingSelector) : '.swiper-pagination',
|
|
306
307
|
onSwiper: handleSwiper,
|
|
307
308
|
onReachBeginning: handleReachBeginnig,
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
.mfui-row {
|
|
2
|
+
position: relative;
|
|
3
|
+
display: inline-block;
|
|
4
|
+
-webkit-box-sizing: border-box;
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
width: 100%;
|
|
7
|
+
height: -webkit-fit-content;
|
|
8
|
+
height: -moz-fit-content;
|
|
9
|
+
height: fit-content;
|
|
10
|
+
padding: 12px 16px;
|
|
11
|
+
border: none;
|
|
12
|
+
border-radius: 12px;
|
|
13
|
+
color: var(--content);
|
|
14
|
+
text-decoration: none;
|
|
15
|
+
background-color: var(--base);
|
|
16
|
+
-webkit-transition: background-color, color, -webkit-box-shadow;
|
|
17
|
+
transition: background-color, color, -webkit-box-shadow;
|
|
18
|
+
transition: background-color, color, box-shadow;
|
|
19
|
+
transition: background-color, color, box-shadow, -webkit-box-shadow;
|
|
20
|
+
-webkit-transition-duration: 0.3s;
|
|
21
|
+
transition-duration: 0.3s;
|
|
22
|
+
}
|
|
23
|
+
@media screen and (min-width: 768px) {
|
|
24
|
+
.mfui-row {
|
|
25
|
+
padding: 20px 24px;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
@media screen and (min-width: 1024px) {
|
|
29
|
+
.mfui-row {
|
|
30
|
+
padding: 24px 32px;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
.mfui-row__wrapper {
|
|
34
|
+
display: -webkit-box;
|
|
35
|
+
display: -ms-flexbox;
|
|
36
|
+
display: flex;
|
|
37
|
+
-webkit-box-align: center;
|
|
38
|
+
-ms-flex-align: center;
|
|
39
|
+
align-items: center;
|
|
40
|
+
}
|
|
41
|
+
.mfui-row__icon-container {
|
|
42
|
+
display: -webkit-box;
|
|
43
|
+
display: -ms-flexbox;
|
|
44
|
+
display: flex;
|
|
45
|
+
-ms-flex-negative: 0;
|
|
46
|
+
flex-shrink: 0;
|
|
47
|
+
-webkit-box-align: center;
|
|
48
|
+
-ms-flex-align: center;
|
|
49
|
+
align-items: center;
|
|
50
|
+
-webkit-box-pack: center;
|
|
51
|
+
-ms-flex-pack: center;
|
|
52
|
+
justify-content: center;
|
|
53
|
+
width: 40px;
|
|
54
|
+
height: 40px;
|
|
55
|
+
margin-right: 8px;
|
|
56
|
+
}
|
|
57
|
+
@media screen and (max-width: 767px) {
|
|
58
|
+
.mfui-row__icon-container {
|
|
59
|
+
margin-left: -4px;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
@media screen and (min-width: 768px) {
|
|
63
|
+
.mfui-row__icon-container {
|
|
64
|
+
width: 48px;
|
|
65
|
+
height: 48px;
|
|
66
|
+
margin-right: 12px;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
@media screen and (min-width: 1024px) {
|
|
70
|
+
.mfui-row__icon-container {
|
|
71
|
+
width: 56px;
|
|
72
|
+
height: 56px;
|
|
73
|
+
margin-right: 16px;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
.mfui-row__icon-container svg {
|
|
77
|
+
fill: var(--content);
|
|
78
|
+
}
|
|
79
|
+
.mfui-row__icon-container_colored {
|
|
80
|
+
border-radius: 50%;
|
|
81
|
+
background-color: var(--brandGreen20);
|
|
82
|
+
}
|
|
83
|
+
.mfui-row__icon-container_colored svg {
|
|
84
|
+
fill: var(--brandGreen);
|
|
85
|
+
}
|
|
86
|
+
.mfui-row__icon,
|
|
87
|
+
.mfui-row__icon svg {
|
|
88
|
+
width: 32px;
|
|
89
|
+
min-width: 32px;
|
|
90
|
+
height: 32px;
|
|
91
|
+
}
|
|
92
|
+
@media screen and (min-width: 1024px) {
|
|
93
|
+
.mfui-row__icon,
|
|
94
|
+
.mfui-row__icon svg {
|
|
95
|
+
width: 40px;
|
|
96
|
+
min-width: 40px;
|
|
97
|
+
height: 40px;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
.mfui-row__header {
|
|
101
|
+
margin-right: auto;
|
|
102
|
+
padding-right: 12px;
|
|
103
|
+
}
|
|
104
|
+
@media screen and (max-width: 767px) {
|
|
105
|
+
.mfui-row__title {
|
|
106
|
+
font-size: 15px;
|
|
107
|
+
line-height: 24px;
|
|
108
|
+
font-weight: 500;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
.mfui-row__sub-title {
|
|
112
|
+
font-size: 12px;
|
|
113
|
+
line-height: 18px;
|
|
114
|
+
margin-top: 2px;
|
|
115
|
+
color: var(--spbSky3);
|
|
116
|
+
}
|
|
117
|
+
@media screen and (min-width: 768px) {
|
|
118
|
+
.mfui-row__sub-title:not(.mfui-row_size_small) {
|
|
119
|
+
font-size: 15px;
|
|
120
|
+
line-height: 24px;
|
|
121
|
+
margin-top: 4px;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
.mfui-row__arrow {
|
|
125
|
+
width: 32px;
|
|
126
|
+
min-width: 32px;
|
|
127
|
+
height: 32px;
|
|
128
|
+
fill: var(--spbSky3);
|
|
129
|
+
}
|
|
130
|
+
@media screen and (min-width: 768px) {
|
|
131
|
+
.mfui-row__arrow {
|
|
132
|
+
margin-left: 4px;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
@media screen and (min-width: 1024px) {
|
|
136
|
+
.mfui-row__arrow {
|
|
137
|
+
margin-left: 12px;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
.mfui-row__children {
|
|
141
|
+
font-size: 15px;
|
|
142
|
+
line-height: 24px;
|
|
143
|
+
font-weight: 500;
|
|
144
|
+
}
|
|
145
|
+
@media screen and (min-width: 768px) {
|
|
146
|
+
.mfui-row__children {
|
|
147
|
+
font-weight: 500;
|
|
148
|
+
font-size: 18px;
|
|
149
|
+
line-height: 24px;
|
|
150
|
+
letter-spacing: 0.5px;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
@media screen and (min-width: 768px) and screen and (min-width: 1280px) {
|
|
154
|
+
.mfui-row__children {
|
|
155
|
+
font-size: 20px;
|
|
156
|
+
line-height: 28px;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
.mfui-row_view_shadow {
|
|
160
|
+
-webkit-box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
|
|
161
|
+
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
|
|
162
|
+
}
|
|
163
|
+
.mfui-row_view_stroke {
|
|
164
|
+
border: 1px solid var(--spbSky2);
|
|
165
|
+
background-color: inherit;
|
|
166
|
+
}
|
|
167
|
+
.mfui-row_pointer {
|
|
168
|
+
cursor: pointer;
|
|
169
|
+
}
|
|
170
|
+
.mfui-row_pointer.mfui-row_view_shadow:hover {
|
|
171
|
+
-webkit-box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
|
|
172
|
+
box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
|
|
173
|
+
}
|
|
174
|
+
.mfui-row_pointer.mfui-row_view_shadow:hover:after {
|
|
175
|
+
content: '';
|
|
176
|
+
position: absolute;
|
|
177
|
+
top: 0;
|
|
178
|
+
right: 0;
|
|
179
|
+
bottom: 0;
|
|
180
|
+
left: 0;
|
|
181
|
+
border-radius: 12px;
|
|
182
|
+
background-color: var(--stcWhite10);
|
|
183
|
+
pointer-events: none;
|
|
184
|
+
}
|
|
185
|
+
.mfui-row_pointer.mfui-row_view_stroke:hover {
|
|
186
|
+
background-color: var(--spbSky0);
|
|
187
|
+
}
|
|
188
|
+
.mfui-row_has-arrow {
|
|
189
|
+
padding-right: 8px;
|
|
190
|
+
}
|
|
191
|
+
@media screen and (min-width: 768px) {
|
|
192
|
+
.mfui-row_has-arrow {
|
|
193
|
+
padding-right: 16px;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
@media screen and (min-width: 1024px) {
|
|
197
|
+
.mfui-row_has-arrow {
|
|
198
|
+
padding-right: 20px;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
@media screen and (min-width: 1024px) {
|
|
202
|
+
.mfui-row_has-arrow.mfui-row_size_small {
|
|
203
|
+
padding-right: 16px;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
@media screen and (min-width: 768px) {
|
|
207
|
+
.mfui-row_size_small {
|
|
208
|
+
padding: 16px 24px 16px 20px;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
@media screen and (min-width: 1024px) {
|
|
212
|
+
.mfui-row_size_small {
|
|
213
|
+
padding: 20px 24px;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
@media screen and (min-width: 1024px) {
|
|
217
|
+
.mfui-row_size_small .mfui-row__sub-title {
|
|
218
|
+
font-size: 15px;
|
|
219
|
+
line-height: 24px;
|
|
220
|
+
margin-top: 4px;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
@media screen and (min-width: 768px) and (max-width: 1023px) {
|
|
224
|
+
.mfui-row_size_small .mfui-row__icon-container {
|
|
225
|
+
width: 40px;
|
|
226
|
+
height: 40px;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
@media screen and (min-width: 768px) and (max-width: 1023px) {
|
|
230
|
+
.mfui-row_size_small .mfui-row__arrow {
|
|
231
|
+
margin-right: -4px;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
.mfui-row_size_small .mfui-row__children {
|
|
235
|
+
font-size: 15px;
|
|
236
|
+
line-height: 24px;
|
|
237
|
+
font-weight: 500;
|
|
238
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './Row.less';
|
|
3
|
+
export interface IRowProps {
|
|
4
|
+
/** Заголовок */
|
|
5
|
+
title: string;
|
|
6
|
+
/** Дополнительный текст */
|
|
7
|
+
subTitle?: string;
|
|
8
|
+
/** Размер компонента */
|
|
9
|
+
size?: 'big' | 'small';
|
|
10
|
+
/** Визуальный эффект фона */
|
|
11
|
+
backgroundView?: 'shadow' | 'stroke';
|
|
12
|
+
/** Иконка */
|
|
13
|
+
icon?: JSX.Element;
|
|
14
|
+
/** Фоновая заливка у иконки */
|
|
15
|
+
isIconColored?: boolean;
|
|
16
|
+
/** Показать стелку */
|
|
17
|
+
showArrow?: boolean;
|
|
18
|
+
/** Показать загрузку */
|
|
19
|
+
showLoader?: boolean;
|
|
20
|
+
/** Ссылка */
|
|
21
|
+
href?: string;
|
|
22
|
+
/** Атрибут для открытия ссылки */
|
|
23
|
+
target?: '_self' | '_blank';
|
|
24
|
+
/** rel - аргумент тега <a> */
|
|
25
|
+
rel?: string;
|
|
26
|
+
/** Обработчик клика */
|
|
27
|
+
onClick?: (e: React.SyntheticEvent<EventTarget>) => void;
|
|
28
|
+
/** Дочерние элементы: Badges, Switcher, Selector */
|
|
29
|
+
children?: React.ReactNode | string;
|
|
30
|
+
/** Дополнительный класс корневого элемента */
|
|
31
|
+
className?: string;
|
|
32
|
+
/** Дополнительные классы для внутренних элементов */
|
|
33
|
+
classes?: {
|
|
34
|
+
root?: string;
|
|
35
|
+
title?: string;
|
|
36
|
+
subtitle?: string;
|
|
37
|
+
};
|
|
38
|
+
/** Дополнительные data атрибуты к внутренним элементам */
|
|
39
|
+
dataAttrs?: {
|
|
40
|
+
root?: Record<string, string>;
|
|
41
|
+
arrow?: Record<string, string>;
|
|
42
|
+
preloader?: Record<string, string>;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
declare const Row: React.FC<IRowProps>;
|
|
46
|
+
export default Row;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
|
4
|
+
import * as PropTypes from 'prop-types';
|
|
5
|
+
import Header from "../Header/Header";
|
|
6
|
+
import Preloader from "../Preloader/Preloader";
|
|
7
|
+
import "./Row.css";
|
|
8
|
+
|
|
9
|
+
var ArrowRight = function ArrowRight(props) {
|
|
10
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
11
|
+
viewBox: "0 0 32 32"
|
|
12
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
13
|
+
d: "M12.5 20.8l4.8-4.8-4.8-4.8 1.6-1.7 6.4 6.5-6.4 6.5z"
|
|
14
|
+
}));
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
var cn = cnCreate('mfui-row');
|
|
18
|
+
|
|
19
|
+
var Row = function Row(_ref) {
|
|
20
|
+
var title = _ref.title,
|
|
21
|
+
subTitle = _ref.subTitle,
|
|
22
|
+
_ref$size = _ref.size,
|
|
23
|
+
size = _ref$size === void 0 ? 'big' : _ref$size,
|
|
24
|
+
_ref$backgroundView = _ref.backgroundView,
|
|
25
|
+
backgroundView = _ref$backgroundView === void 0 ? 'shadow' : _ref$backgroundView,
|
|
26
|
+
icon = _ref.icon,
|
|
27
|
+
_ref$isIconColored = _ref.isIconColored,
|
|
28
|
+
isIconColored = _ref$isIconColored === void 0 ? false : _ref$isIconColored,
|
|
29
|
+
_ref$showArrow = _ref.showArrow,
|
|
30
|
+
showArrow = _ref$showArrow === void 0 ? false : _ref$showArrow,
|
|
31
|
+
_ref$showLoader = _ref.showLoader,
|
|
32
|
+
showLoader = _ref$showLoader === void 0 ? false : _ref$showLoader,
|
|
33
|
+
href = _ref.href,
|
|
34
|
+
_ref$target = _ref.target,
|
|
35
|
+
target = _ref$target === void 0 ? '_self' : _ref$target,
|
|
36
|
+
rel = _ref.rel,
|
|
37
|
+
onClick = _ref.onClick,
|
|
38
|
+
children = _ref.children,
|
|
39
|
+
className = _ref.className,
|
|
40
|
+
_ref$classes = _ref.classes,
|
|
41
|
+
classes = _ref$classes === void 0 ? {} : _ref$classes,
|
|
42
|
+
dataAttrs = _ref.dataAttrs;
|
|
43
|
+
var ElementType = href ? 'a' : 'div';
|
|
44
|
+
var isActive = !showLoader && (!!href || !!onClick);
|
|
45
|
+
var isSmallSize = size === 'small';
|
|
46
|
+
|
|
47
|
+
var handleClick = function handleClick(e) {
|
|
48
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
return /*#__PURE__*/React.createElement(ElementType, _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
|
52
|
+
className: cn({
|
|
53
|
+
size: size,
|
|
54
|
+
view: backgroundView,
|
|
55
|
+
pointer: isActive,
|
|
56
|
+
'has-arrow': showArrow && !showLoader
|
|
57
|
+
}, [className, classes.root]),
|
|
58
|
+
href: href,
|
|
59
|
+
target: href ? target : undefined,
|
|
60
|
+
rel: rel,
|
|
61
|
+
onClick: handleClick
|
|
62
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
63
|
+
className: cn('wrapper')
|
|
64
|
+
}, !!icon && /*#__PURE__*/React.createElement("div", {
|
|
65
|
+
className: cn('icon-container', {
|
|
66
|
+
colored: isIconColored
|
|
67
|
+
})
|
|
68
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
69
|
+
className: cn('icon')
|
|
70
|
+
}, icon)), /*#__PURE__*/React.createElement("div", {
|
|
71
|
+
className: cn('header')
|
|
72
|
+
}, /*#__PURE__*/React.createElement(Header, {
|
|
73
|
+
className: cn('title', [classes.title]),
|
|
74
|
+
as: isSmallSize ? 'h5' : 'h3'
|
|
75
|
+
}, title), !!subTitle && /*#__PURE__*/React.createElement("div", {
|
|
76
|
+
className: cn('sub-title', [classes.subtitle])
|
|
77
|
+
}, subTitle)), !showLoader ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
78
|
+
className: cn('children')
|
|
79
|
+
}, children), showArrow && /*#__PURE__*/React.createElement(ArrowRight, _extends({
|
|
80
|
+
className: cn('arrow')
|
|
81
|
+
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.arrow)))) : /*#__PURE__*/React.createElement(Preloader, {
|
|
82
|
+
delay: false,
|
|
83
|
+
dataAttrs: {
|
|
84
|
+
root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.preloader
|
|
85
|
+
}
|
|
86
|
+
})));
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
Row.propTypes = {
|
|
90
|
+
title: PropTypes.string.isRequired,
|
|
91
|
+
subTitle: PropTypes.string,
|
|
92
|
+
size: PropTypes.oneOf(['big', 'small']),
|
|
93
|
+
backgroundView: PropTypes.oneOf(['shadow', 'stroke']),
|
|
94
|
+
icon: PropTypes.element,
|
|
95
|
+
isIconColored: PropTypes.bool,
|
|
96
|
+
showArrow: PropTypes.bool,
|
|
97
|
+
showLoader: PropTypes.bool,
|
|
98
|
+
href: PropTypes.string,
|
|
99
|
+
target: PropTypes.oneOf(['_self', '_blank']),
|
|
100
|
+
rel: PropTypes.string,
|
|
101
|
+
onClick: PropTypes.func,
|
|
102
|
+
children: PropTypes.node,
|
|
103
|
+
className: PropTypes.string,
|
|
104
|
+
classes: PropTypes.objectOf(PropTypes.string),
|
|
105
|
+
dataAttrs: PropTypes.objectOf(PropTypes.object)
|
|
106
|
+
};
|
|
107
|
+
export default Row;
|
|
@@ -265,13 +265,19 @@
|
|
|
265
265
|
right: 0;
|
|
266
266
|
bottom: 0;
|
|
267
267
|
width: 40px;
|
|
268
|
-
background:
|
|
269
|
-
|
|
268
|
+
background: var(--base);
|
|
269
|
+
-webkit-mask-image: -webkit-gradient(linear, left top, right top, from(rgba(255, 255, 255, 0)), to(var(--base)));
|
|
270
|
+
-webkit-mask-image: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, var(--base) 100%);
|
|
271
|
+
mask-image: -webkit-gradient(linear, left top, right top, from(rgba(255, 255, 255, 0)), to(var(--spbSky0)));
|
|
272
|
+
mask-image: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, var(--spbSky0) 100%);
|
|
270
273
|
}
|
|
271
274
|
.mfui-search__list-item_active .mfui-search__item-title:after,
|
|
272
275
|
.mfui-search__popular-item_active .mfui-search__popular-item-title:after {
|
|
273
|
-
background:
|
|
274
|
-
|
|
276
|
+
background: var(--spbSky0);
|
|
277
|
+
-webkit-mask-image: -webkit-gradient(linear, left top, right top, from(rgba(255, 255, 255, 0)), to(var(--spbSky0)));
|
|
278
|
+
-webkit-mask-image: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, var(--spbSky0) 100%);
|
|
279
|
+
mask-image: -webkit-gradient(linear, left top, right top, from(rgba(255, 255, 255, 0)), to(var(--spbSky0)));
|
|
280
|
+
mask-image: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, var(--spbSky0) 100%);
|
|
275
281
|
}
|
|
276
282
|
.mfui-search__highlighted-fragment {
|
|
277
283
|
font-weight: bold;
|
|
@@ -11,12 +11,8 @@
|
|
|
11
11
|
font-size: 15px;
|
|
12
12
|
line-height: 24px;
|
|
13
13
|
font-weight: 500;
|
|
14
|
-
display:
|
|
15
|
-
|
|
16
|
-
display: flex;
|
|
17
|
-
-webkit-box-align: end;
|
|
18
|
-
-ms-flex-align: end;
|
|
19
|
-
align-items: flex-end;
|
|
14
|
+
display: grid;
|
|
15
|
+
grid-template-columns: auto 55%;
|
|
20
16
|
margin-bottom: 8px;
|
|
21
17
|
}
|
|
22
18
|
.mfui-slider__display-value {
|
|
@@ -6,7 +6,7 @@ import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
|
|
6
6
|
import * as PropTypes from 'prop-types';
|
|
7
7
|
import SliderDisplayValue, { DisplayValue } from "../components/SliderDisplayValue/SliderDisplayValue";
|
|
8
8
|
import SliderScale, { Scale } from "../components/SliderScale/SliderScale";
|
|
9
|
-
import { getRangeValue, getTrackSize } from "../helpers";
|
|
9
|
+
import { getRangeValue, getTrackSize, removeFirstZeros } from "../helpers";
|
|
10
10
|
import "./Slider.css";
|
|
11
11
|
var cn = cnCreate('mfui-slider');
|
|
12
12
|
|
|
@@ -47,7 +47,7 @@ var Slider = function Slider(_ref) {
|
|
|
47
47
|
|
|
48
48
|
var handleInputChange = function handleInputChange(isRange) {
|
|
49
49
|
return function (e) {
|
|
50
|
-
var targetValue = e.target.value;
|
|
50
|
+
var targetValue = removeFirstZeros(e.target.value);
|
|
51
51
|
var newRangeValue = getRangeValue(targetValue, minValue, maxValue, step);
|
|
52
52
|
!isControlled && setInnerRangeValue(newRangeValue);
|
|
53
53
|
!isRange && setRawInputValue(targetValue);
|
|
@@ -14,15 +14,20 @@
|
|
|
14
14
|
margin-bottom: 8px;
|
|
15
15
|
}
|
|
16
16
|
.mfui-slider-range__display-values {
|
|
17
|
-
display:
|
|
18
|
-
|
|
19
|
-
display: flex;
|
|
17
|
+
display: grid;
|
|
18
|
+
grid-template-columns: 45% 45%;
|
|
20
19
|
-webkit-box-pack: justify;
|
|
21
20
|
-ms-flex-pack: justify;
|
|
22
21
|
justify-content: space-between;
|
|
23
22
|
width: 100%;
|
|
24
23
|
margin-top: 8px;
|
|
25
24
|
}
|
|
25
|
+
.mfui-slider-range__display-value_left {
|
|
26
|
+
margin-right: auto;
|
|
27
|
+
}
|
|
28
|
+
.mfui-slider-range__display-value_right {
|
|
29
|
+
margin-left: auto;
|
|
30
|
+
}
|
|
26
31
|
.mfui-slider-range__range-container {
|
|
27
32
|
position: relative;
|
|
28
33
|
height: 12px;
|
|
@@ -97,6 +102,7 @@
|
|
|
97
102
|
padding: 0 12px;
|
|
98
103
|
border-radius: 100px;
|
|
99
104
|
background-color: var(--spbSky0);
|
|
105
|
+
cursor: pointer;
|
|
100
106
|
}
|
|
101
107
|
.mfui-slider-range__range-track-inner {
|
|
102
108
|
position: relative;
|
|
@@ -112,6 +118,9 @@
|
|
|
112
118
|
.mfui-slider-range_disabled .mfui-slider-range__head {
|
|
113
119
|
color: var(--spbSky3);
|
|
114
120
|
}
|
|
121
|
+
.mfui-slider-range_disabled .mfui-slider-range__range-track {
|
|
122
|
+
cursor: default;
|
|
123
|
+
}
|
|
115
124
|
.mfui-slider-range_disabled .mfui-slider-range__range-input {
|
|
116
125
|
background-image: -webkit-gradient(linear, left top, left bottom, from(var(--spbSky1)), to(var(--spbSky1)));
|
|
117
126
|
background-image: linear-gradient(var(--spbSky1), var(--spbSky1));
|
|
@@ -6,7 +6,7 @@ import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
|
|
6
6
|
import * as PropTypes from 'prop-types';
|
|
7
7
|
import SliderDisplayValue, { DisplayValue } from "../components/SliderDisplayValue/SliderDisplayValue";
|
|
8
8
|
import SliderScale, { Scale } from "../components/SliderScale/SliderScale";
|
|
9
|
-
import { getRangeValue } from "../helpers";
|
|
9
|
+
import { getRangeValue, removeFirstZeros } from "../helpers";
|
|
10
10
|
import { getTrackSize, getRangeValueByPageX, checkForThumbAtEndOfTrack } from "./helpers";
|
|
11
11
|
import "./SliderRange.css";
|
|
12
12
|
var THUMB_SIZE = 24;
|
|
@@ -35,6 +35,9 @@ var SliderRange = function SliderRange(_ref) {
|
|
|
35
35
|
onChange = _ref.onChange;
|
|
36
36
|
var outerLeftRangeValue = getRangeValue(outerLeftValue !== null && outerLeftValue !== void 0 ? outerLeftValue : minValue, minValue, maxValue, step);
|
|
37
37
|
var outerRightRangeValue = getRangeValue(outerRightValue !== null && outerRightValue !== void 0 ? outerRightValue : maxValue, minValue, maxValue, step);
|
|
38
|
+
var leftRangeInputRef = React.useRef(null);
|
|
39
|
+
var rightRangeInputRef = React.useRef(null);
|
|
40
|
+
var rangeTrackRef = React.useRef(null);
|
|
38
41
|
var rangeTrackInnerRef = React.useRef(null);
|
|
39
42
|
|
|
40
43
|
var _React$useState = React.useState(null),
|
|
@@ -63,8 +66,8 @@ var SliderRange = function SliderRange(_ref) {
|
|
|
63
66
|
var isThumbAtEndOfTrack = checkForThumbAtEndOfTrack(leftRangeValue, minValue, maxValue, THUMB_SIZE);
|
|
64
67
|
var showHead = !!label || !!displayValueType;
|
|
65
68
|
|
|
66
|
-
var
|
|
67
|
-
if (!rangeTrackInnerRef.current) {
|
|
69
|
+
var handleRangeTrackPointerUp = function handleRangeTrackPointerUp(e) {
|
|
70
|
+
if (!rangeTrackInnerRef.current || disabled) {
|
|
68
71
|
return;
|
|
69
72
|
}
|
|
70
73
|
|
|
@@ -81,9 +84,27 @@ var SliderRange = function SliderRange(_ref) {
|
|
|
81
84
|
}
|
|
82
85
|
};
|
|
83
86
|
|
|
87
|
+
var handleRangeTrackPointerLeave = React.useCallback(function () {
|
|
88
|
+
var _a, _b, _c;
|
|
89
|
+
|
|
90
|
+
(_a = leftRangeInputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
91
|
+
(_b = rightRangeInputRef.current) === null || _b === void 0 ? void 0 : _b.focus();
|
|
92
|
+
(_c = rangeTrackRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('pointerleave', handleRangeTrackPointerLeave);
|
|
93
|
+
}, []);
|
|
94
|
+
|
|
95
|
+
var handleRangeTrackPointerDown = function handleRangeTrackPointerDown() {
|
|
96
|
+
var _a;
|
|
97
|
+
|
|
98
|
+
if (disabled) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
(_a = rangeTrackRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('pointerleave', handleRangeTrackPointerLeave);
|
|
103
|
+
};
|
|
104
|
+
|
|
84
105
|
var handleLeftInputChange = function handleLeftInputChange(isRange) {
|
|
85
106
|
return function (e) {
|
|
86
|
-
var targetValue = e.target.value;
|
|
107
|
+
var targetValue = removeFirstZeros(e.target.value);
|
|
87
108
|
var newRangeValue = getRangeValue(targetValue, minValue, rightRangeValue, step);
|
|
88
109
|
!isControlled && setInnerLeftRangeValue(newRangeValue);
|
|
89
110
|
!isRange && setRawLeftInputValue(targetValue);
|
|
@@ -93,7 +114,7 @@ var SliderRange = function SliderRange(_ref) {
|
|
|
93
114
|
|
|
94
115
|
var handleRightInputChange = function handleRightInputChange(isRange) {
|
|
95
116
|
return function (e) {
|
|
96
|
-
var targetValue = e.target.value;
|
|
117
|
+
var targetValue = removeFirstZeros(e.target.value);
|
|
97
118
|
var newRangeValue = getRangeValue(targetValue, leftRangeValue, maxValue, step);
|
|
98
119
|
!isControlled && setInnerRightRangeValue(newRangeValue);
|
|
99
120
|
!isRange && setRawRightInputValue(targetValue);
|
|
@@ -126,6 +147,9 @@ var SliderRange = function SliderRange(_ref) {
|
|
|
126
147
|
}, label), !!displayValueType && /*#__PURE__*/React.createElement("div", {
|
|
127
148
|
className: cn('display-values')
|
|
128
149
|
}, /*#__PURE__*/React.createElement(SliderDisplayValue, {
|
|
150
|
+
className: cn('display-value', {
|
|
151
|
+
left: true
|
|
152
|
+
}),
|
|
129
153
|
value: rawLeftInputValue !== null && rawLeftInputValue !== void 0 ? rawLeftInputValue : leftRangeValue,
|
|
130
154
|
displayValueType: displayValueType,
|
|
131
155
|
displayValuePrefix: displayLeftValuePrefix,
|
|
@@ -137,6 +161,9 @@ var SliderRange = function SliderRange(_ref) {
|
|
|
137
161
|
input: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.leftInput
|
|
138
162
|
}
|
|
139
163
|
}), /*#__PURE__*/React.createElement(SliderDisplayValue, {
|
|
164
|
+
className: cn('display-value', {
|
|
165
|
+
right: true
|
|
166
|
+
}),
|
|
140
167
|
value: rawRightInputValue !== null && rawRightInputValue !== void 0 ? rawRightInputValue : rightRangeValue,
|
|
141
168
|
displayValueType: displayValueType,
|
|
142
169
|
displayValuePrefix: displayRightValuePrefix,
|
|
@@ -160,7 +187,9 @@ var SliderRange = function SliderRange(_ref) {
|
|
|
160
187
|
max: maxValue,
|
|
161
188
|
onChange: handleLeftInputChange(true),
|
|
162
189
|
disabled: disabled
|
|
163
|
-
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.leftRangeInput)
|
|
190
|
+
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.leftRangeInput), {
|
|
191
|
+
ref: leftRangeInputRef
|
|
192
|
+
})), /*#__PURE__*/React.createElement("input", _extends({
|
|
164
193
|
className: cn('range-input', {
|
|
165
194
|
right: true
|
|
166
195
|
}),
|
|
@@ -170,9 +199,13 @@ var SliderRange = function SliderRange(_ref) {
|
|
|
170
199
|
max: maxValue,
|
|
171
200
|
onChange: handleRightInputChange(true),
|
|
172
201
|
disabled: disabled
|
|
173
|
-
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.rightRangeInput)
|
|
202
|
+
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.rightRangeInput), {
|
|
203
|
+
ref: rightRangeInputRef
|
|
204
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
174
205
|
className: cn('range-track'),
|
|
175
|
-
|
|
206
|
+
onPointerUp: handleRangeTrackPointerUp,
|
|
207
|
+
onPointerDown: handleRangeTrackPointerDown,
|
|
208
|
+
ref: rangeTrackRef
|
|
176
209
|
}, /*#__PURE__*/React.createElement("div", {
|
|
177
210
|
className: cn('range-track-inner'),
|
|
178
211
|
ref: rangeTrackInnerRef
|
|
@@ -14,15 +14,20 @@
|
|
|
14
14
|
margin-bottom: 8px;
|
|
15
15
|
}
|
|
16
16
|
.mfui-slider-ratio__display-values {
|
|
17
|
-
display:
|
|
18
|
-
|
|
19
|
-
display: flex;
|
|
17
|
+
display: grid;
|
|
18
|
+
grid-template-columns: 45% 45%;
|
|
20
19
|
-webkit-box-pack: justify;
|
|
21
20
|
-ms-flex-pack: justify;
|
|
22
21
|
justify-content: space-between;
|
|
23
22
|
width: 100%;
|
|
24
23
|
margin-top: 8px;
|
|
25
24
|
}
|
|
25
|
+
.mfui-slider-ratio__display-value_left {
|
|
26
|
+
margin-right: auto;
|
|
27
|
+
}
|
|
28
|
+
.mfui-slider-ratio__display-value_right {
|
|
29
|
+
margin-left: auto;
|
|
30
|
+
}
|
|
26
31
|
.mfui-slider-ratio__range-container {
|
|
27
32
|
position: relative;
|
|
28
33
|
width: 100%;
|