@megafon/ui-shared 4.0.0-beta.4 → 4.0.0-beta.7
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 +63 -16
- package/dist/es/components/Instructions/Instructions.css +3 -0
- package/dist/es/components/Instructions/Instructions.js +19 -11
- package/dist/es/components/PictureWithDescription/PictureWithDescription.css +2 -2
- package/dist/es/components/Table/Table.css +0 -5
- package/dist/es/components/TextWithIcon/TextWithIcon.css +0 -5
- package/dist/es/components/TextWithIcon/TextWithIcon.d.ts +4 -0
- package/dist/es/components/TextWithIcon/TextWithIcon.js +27 -10
- package/dist/es/components/TextWithIcon/TextWithIconItem.css +1 -19
- package/dist/es/components/TextWithIcon/TextWithIconItem.d.ts +2 -0
- package/dist/es/components/TextWithIcon/TextWithIconItem.js +6 -1
- package/dist/es/components/VideoBanner/VideoBanner.css +2 -3
- package/dist/es/components/VideoBanner/VideoBanner.d.ts +2 -0
- package/dist/es/components/VideoBanner/VideoBanner.js +20 -33
- package/dist/lib/components/Instructions/Instructions.css +3 -0
- package/dist/lib/components/Instructions/Instructions.js +20 -11
- package/dist/lib/components/PictureWithDescription/PictureWithDescription.css +2 -2
- package/dist/lib/components/Table/Table.css +0 -5
- package/dist/lib/components/TextWithIcon/TextWithIcon.css +0 -5
- package/dist/lib/components/TextWithIcon/TextWithIcon.d.ts +4 -0
- package/dist/lib/components/TextWithIcon/TextWithIcon.js +27 -10
- package/dist/lib/components/TextWithIcon/TextWithIconItem.css +1 -19
- package/dist/lib/components/TextWithIcon/TextWithIconItem.d.ts +2 -0
- package/dist/lib/components/TextWithIcon/TextWithIconItem.js +6 -1
- package/dist/lib/components/VideoBanner/VideoBanner.css +2 -3
- package/dist/lib/components/VideoBanner/VideoBanner.d.ts +2 -0
- package/dist/lib/components/VideoBanner/VideoBanner.js +20 -33
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
@@ -3,7 +3,7 @@
|
|
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
|
-
# [4.0.0-beta.
|
6
|
+
# [4.0.0-beta.7](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-shared@4.0.0-beta.6...@megafon/ui-shared@4.0.0-beta.7) (2022-07-05)
|
7
7
|
|
8
8
|
**Note:** Version bump only for package @megafon/ui-shared
|
9
9
|
|
@@ -11,25 +11,37 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
11
11
|
|
12
12
|
|
13
13
|
|
14
|
-
# [4.0.0-beta.
|
14
|
+
# [4.0.0-beta.6](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-shared@3.4.3...@megafon/ui-shared@4.0.0-beta.6) (2022-06-29)
|
15
|
+
|
16
|
+
|
17
|
+
### Bug Fixes
|
18
|
+
|
19
|
+
* **breadcrumbs:** change default color prop value from black to default ([5c30998](https://github.com/MegafonWebLab/megafon-ui/commit/5c30998fe192be143add5af873c08cf51deb299e))
|
15
20
|
|
16
21
|
|
17
22
|
### Features
|
18
23
|
|
19
|
-
* **
|
24
|
+
* **paragraph:** remove prop size; add new prop; add 'pale' option to colors ([ffb6bc7](https://github.com/MegafonWebLab/megafon-ui/commit/ffb6bc709a4ef91536e359d5f9edc5501caf0c2c))
|
25
|
+
* **tabs:** update by new design ([20ae2cc](https://github.com/MegafonWebLab/megafon-ui/commit/20ae2cc695e1245b9cd06fe37a9e4e3bb0c7eaae))
|
26
|
+
* **text-with-icon:** delete centering in mobile resolution ([c68f98f](https://github.com/MegafonWebLab/megafon-ui/commit/c68f98f0b69cbe0e416de4d526c70c009213647e))
|
20
27
|
|
21
28
|
|
22
29
|
### BREAKING CHANGES
|
23
30
|
|
31
|
+
* **text-with-icon:** centering in mobile resolution was removed according guides
|
24
32
|
* **tabs:** new prop autoWidth added
|
25
33
|
size prop small vallue removed
|
26
34
|
new sizes
|
35
|
+
* **breadcrumbs:** color is now depends on current theme. by default it matches content text color.
|
36
|
+
for keep black color on light background use 'black' value for prop 'color'.
|
37
|
+
* **paragraph:** prop 'size' is no longer exists.
|
38
|
+
use component Caption instead of Paragraph size="small"
|
27
39
|
|
28
40
|
|
29
41
|
|
30
42
|
|
31
43
|
|
32
|
-
|
44
|
+
## [3.4.3](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-shared@3.4.2...@megafon/ui-shared@3.4.3) (2022-06-28)
|
33
45
|
|
34
46
|
**Note:** Version bump only for package @megafon/ui-shared
|
35
47
|
|
@@ -37,7 +49,7 @@ new sizes
|
|
37
49
|
|
38
50
|
|
39
51
|
|
40
|
-
|
52
|
+
## [3.4.2](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-shared@3.4.1...@megafon/ui-shared@3.4.2) (2022-06-21)
|
41
53
|
|
42
54
|
**Note:** Version bump only for package @megafon/ui-shared
|
43
55
|
|
@@ -45,31 +57,47 @@ new sizes
|
|
45
57
|
|
46
58
|
|
47
59
|
|
48
|
-
|
60
|
+
## [3.4.1](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-shared@3.4.0...@megafon/ui-shared@3.4.1) (2022-06-07)
|
61
|
+
|
62
|
+
**Note:** Version bump only for package @megafon/ui-shared
|
63
|
+
|
49
64
|
|
50
65
|
|
51
|
-
### Bug Fixes
|
52
66
|
|
53
|
-
|
67
|
+
|
68
|
+
# [3.4.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-shared@3.3.5...@megafon/ui-shared@3.4.0) (2022-05-30)
|
54
69
|
|
55
70
|
|
56
71
|
### Features
|
57
72
|
|
58
|
-
* **
|
73
|
+
* **instructions:** add swipe to picture ([eb9eb09](https://github.com/MegafonWebLab/megafon-ui/commit/eb9eb0991444e113baf95d2d014d1c690cd1e99a))
|
74
|
+
* **textwithicon:** add isFullWidth and centeringOnMobile props ([b86ad8b](https://github.com/MegafonWebLab/megafon-ui/commit/b86ad8b1ad5e41c87e83ebadeb3a0a157bc41a2c))
|
59
75
|
|
60
76
|
|
61
|
-
### BREAKING CHANGES
|
62
77
|
|
63
|
-
* **paragraph:** prop 'size' is no longer exists.
|
64
|
-
use component Caption instead of Paragraph size="small"
|
65
|
-
* **breadcrumbs:** color is now depends on current theme. by default it matches content text color.
|
66
|
-
for keep black color on light background use 'black' value for prop 'color'.
|
67
78
|
|
68
79
|
|
80
|
+
## [3.3.5](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-shared@3.3.4...@megafon/ui-shared@3.3.5) (2022-05-27)
|
81
|
+
|
82
|
+
**Note:** Version bump only for package @megafon/ui-shared
|
83
|
+
|
69
84
|
|
70
85
|
|
71
86
|
|
72
|
-
|
87
|
+
|
88
|
+
## [3.3.4](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-shared@3.3.3...@megafon/ui-shared@3.3.4) (2022-05-24)
|
89
|
+
|
90
|
+
|
91
|
+
### Bug Fixes
|
92
|
+
|
93
|
+
* **instructions:** remove css prorerty filter for image ([d4ee221](https://github.com/MegafonWebLab/megafon-ui/commit/d4ee22123565b82ec777c1526093a94251e59809))
|
94
|
+
* **picturewithdescription:** fix clearing indents for first and last element ([d9263e3](https://github.com/MegafonWebLab/megafon-ui/commit/d9263e3670b2d493ec4bf194a2cdd6440d1ea86f))
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
## [3.3.3](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-shared@3.3.2...@megafon/ui-shared@3.3.3) (2022-05-17)
|
73
101
|
|
74
102
|
**Note:** Version bump only for package @megafon/ui-shared
|
75
103
|
|
@@ -77,7 +105,7 @@ for keep black color on light background use 'black' value for prop 'color'.
|
|
77
105
|
|
78
106
|
|
79
107
|
|
80
|
-
## [3.
|
108
|
+
## [3.3.2](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-shared@3.3.1...@megafon/ui-shared@3.3.2) (2022-05-05)
|
81
109
|
|
82
110
|
**Note:** Version bump only for package @megafon/ui-shared
|
83
111
|
|
@@ -85,6 +113,25 @@ for keep black color on light background use 'black' value for prop 'color'.
|
|
85
113
|
|
86
114
|
|
87
115
|
|
116
|
+
## [3.3.1](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-shared@3.3.0...@megafon/ui-shared@3.3.1) (2022-04-25)
|
117
|
+
|
118
|
+
**Note:** Version bump only for package @megafon/ui-shared
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
# [3.3.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-shared@3.2.2...@megafon/ui-shared@3.3.0) (2022-04-18)
|
125
|
+
|
126
|
+
|
127
|
+
### Features
|
128
|
+
|
129
|
+
* **videobanner:** add proprety for mobile video, use picture for background image ([c21c927](https://github.com/MegafonWebLab/megafon-ui/commit/c21c9278d2ff1e192195a5113d43d50753fd02c5))
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
88
135
|
## [3.2.2](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-shared@3.2.1...@megafon/ui-shared@3.2.2) (2022-04-13)
|
89
136
|
|
90
137
|
**Note:** Version bump only for package @megafon/ui-shared
|
@@ -78,13 +78,19 @@ var Instructions = function Instructions(_ref) {
|
|
78
78
|
swiperInstance && swiperInstance.slideTo(ind);
|
79
79
|
};
|
80
80
|
}, [swiperInstance]);
|
81
|
+
var handleSlideChange = React.useCallback(function (_ref2) {
|
82
|
+
var activeIndex = _ref2.activeIndex;
|
83
|
+
setSlideIndex(activeIndex);
|
84
|
+
}, []);
|
81
85
|
var renderVideo = React.useCallback(function (mediaUrl, index) {
|
82
86
|
return /*#__PURE__*/React.createElement("video", _extends({
|
83
87
|
loop: true,
|
84
88
|
muted: true,
|
85
89
|
autoPlay: true,
|
86
90
|
playsInline: true,
|
87
|
-
className: cn('swiper-img'
|
91
|
+
className: cn('swiper-img', {
|
92
|
+
video: true
|
93
|
+
})
|
88
94
|
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.image, index + 1)), /*#__PURE__*/React.createElement("source", {
|
89
95
|
src: mediaUrl,
|
90
96
|
type: "video/mp4"
|
@@ -92,12 +98,14 @@ var Instructions = function Instructions(_ref) {
|
|
92
98
|
}, [dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.image]);
|
93
99
|
var renderSlider = React.useCallback(function () {
|
94
100
|
return /*#__PURE__*/React.createElement(Swiper, {
|
95
|
-
|
101
|
+
noSwiping: false,
|
96
102
|
onSwiper: getSwiperInstance,
|
97
|
-
noSwipingClass: swiperSlideCn
|
98
|
-
|
99
|
-
|
100
|
-
|
103
|
+
noSwipingClass: swiperSlideCn,
|
104
|
+
onSlideChange: handleSlideChange,
|
105
|
+
className: cn('swiper')
|
106
|
+
}, instructionItems.map(function (_ref3, i) {
|
107
|
+
var mediaUrl = _ref3.mediaUrl,
|
108
|
+
isVideo = _ref3.isVideo;
|
101
109
|
return /*#__PURE__*/React.createElement(SwiperSlide, {
|
102
110
|
className: swiperSlideCn,
|
103
111
|
key: i + mediaUrl
|
@@ -108,7 +116,7 @@ var Instructions = function Instructions(_ref) {
|
|
108
116
|
className: cn('swiper-img', [instructionItemImg])
|
109
117
|
})));
|
110
118
|
}));
|
111
|
-
}, [getSwiperInstance, instructionItemImg, instructionItems, renderVideo, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.image]);
|
119
|
+
}, [getSwiperInstance, instructionItemImg, instructionItems, renderVideo, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.image, handleSlideChange]);
|
112
120
|
var renderTitle = React.useCallback(function (resolution) {
|
113
121
|
return /*#__PURE__*/React.createElement(Header, {
|
114
122
|
className: cn('title', {
|
@@ -140,8 +148,8 @@ var Instructions = function Instructions(_ref) {
|
|
140
148
|
'text-after': !!text,
|
141
149
|
desktop: true
|
142
150
|
})
|
143
|
-
}, instructionItems.map(function (
|
144
|
-
var itemTitle =
|
151
|
+
}, instructionItems.map(function (_ref4, i) {
|
152
|
+
var itemTitle = _ref4.title;
|
145
153
|
return (
|
146
154
|
/*#__PURE__*/
|
147
155
|
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
|
@@ -169,8 +177,8 @@ var Instructions = function Instructions(_ref) {
|
|
169
177
|
})
|
170
178
|
}, /*#__PURE__*/React.createElement("div", {
|
171
179
|
className: cn('articles-title-block')
|
172
|
-
}, instructionItems.map(function (
|
173
|
-
var itemTitle =
|
180
|
+
}, instructionItems.map(function (_ref5, i) {
|
181
|
+
var itemTitle = _ref5.title;
|
174
182
|
return slideIndex === i && /*#__PURE__*/React.createElement("div", _extends({
|
175
183
|
key: i,
|
176
184
|
"data-index": i
|
@@ -53,10 +53,10 @@ h5 {
|
|
53
53
|
max-width: 550px;
|
54
54
|
height: 100%;
|
55
55
|
}
|
56
|
-
.mfui-picture-with-description__content :first-child {
|
56
|
+
.mfui-picture-with-description__content > :first-child {
|
57
57
|
margin-top: 0 !important;
|
58
58
|
}
|
59
|
-
.mfui-picture-with-description__content :last-child {
|
59
|
+
.mfui-picture-with-description__content > :last-child {
|
60
60
|
margin-bottom: 0 !important;
|
61
61
|
}
|
62
62
|
@media screen and (min-width: 1024px) {
|
@@ -45,7 +45,6 @@ h5 {
|
|
45
45
|
}
|
46
46
|
}
|
47
47
|
.mfui-table__top-shadow {
|
48
|
-
position: -webkit-sticky;
|
49
48
|
position: sticky;
|
50
49
|
top: 0;
|
51
50
|
z-index: 2;
|
@@ -58,7 +57,6 @@ h5 {
|
|
58
57
|
background: linear-gradient(359.94deg, rgba(0, 0, 0, 0.0001) 0.06%, rgba(0, 0, 0, 0.03) 38.08%, rgba(0, 0, 0, 0.08) 74.98%);
|
59
58
|
}
|
60
59
|
.mfui-table__left-shadow {
|
61
|
-
position: -webkit-sticky;
|
62
60
|
position: sticky;
|
63
61
|
top: 0;
|
64
62
|
bottom: 0;
|
@@ -70,7 +68,6 @@ h5 {
|
|
70
68
|
background: linear-gradient(270deg, rgba(0, 0, 0, 0.0001) 16.3%, rgba(0, 0, 0, 0.03) 51.81%, rgba(0, 0, 0, 0.08) 86.27%);
|
71
69
|
}
|
72
70
|
.mfui-table__bottom-gradient {
|
73
|
-
position: -webkit-sticky;
|
74
71
|
position: sticky;
|
75
72
|
bottom: 0;
|
76
73
|
z-index: 1;
|
@@ -84,7 +81,6 @@ h5 {
|
|
84
81
|
background: linear-gradient(to top, var(--base) 25%, rgba(255, 255, 255, 0));
|
85
82
|
}
|
86
83
|
.mfui-table__right-gradient {
|
87
|
-
position: -webkit-sticky;
|
88
84
|
position: sticky;
|
89
85
|
right: 0;
|
90
86
|
z-index: 1;
|
@@ -142,7 +138,6 @@ h5 {
|
|
142
138
|
min-width: 144px;
|
143
139
|
}
|
144
140
|
.mfui-table_fix-column .mfui-table__cell:first-child {
|
145
|
-
position: -webkit-sticky;
|
146
141
|
position: sticky;
|
147
142
|
}
|
148
143
|
.mfui-table_fix-column .mfui-table__left-shadow {
|
@@ -12,6 +12,10 @@ export interface ITextWithIconProps {
|
|
12
12
|
};
|
13
13
|
/** Дополнительный класс для корневого элемента */
|
14
14
|
className?: string;
|
15
|
+
/** Включить растягивание на всю ширину контейнера */
|
16
|
+
isFullWidth?: boolean;
|
17
|
+
/** Выравнивание по центру на мобильных */
|
18
|
+
centeringOnMobile?: boolean;
|
15
19
|
/** Допустимый дочерний компонент */
|
16
20
|
children: React.ReactElement<ITextWithIconItem>[] | React.ReactElement<ITextWithIconItem>;
|
17
21
|
}
|
@@ -11,19 +11,34 @@ var TextWithIcon = function TextWithIcon(_ref) {
|
|
11
11
|
rootRef = _ref.rootRef,
|
12
12
|
dataAttrs = _ref.dataAttrs,
|
13
13
|
className = _ref.className,
|
14
|
+
_ref$isFullWidth = _ref.isFullWidth,
|
15
|
+
isFullWidth = _ref$isFullWidth === void 0 ? false : _ref$isFullWidth,
|
16
|
+
_ref$centeringOnMobil = _ref.centeringOnMobile,
|
17
|
+
centeringOnMobile = _ref$centeringOnMobil === void 0 ? true : _ref$centeringOnMobil,
|
14
18
|
children = _ref.children;
|
19
|
+
|
20
|
+
var renderContent = function renderContent() {
|
21
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, title && /*#__PURE__*/React.createElement(Header, {
|
22
|
+
className: cn('header'),
|
23
|
+
as: "h5"
|
24
|
+
}, title), children);
|
25
|
+
};
|
26
|
+
|
27
|
+
var renderContentWithGrid = function renderContentWithGrid() {
|
28
|
+
return /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(GridColumn, {
|
29
|
+
mobile: '12',
|
30
|
+
tablet: '7',
|
31
|
+
desktop: '6',
|
32
|
+
wide: '6'
|
33
|
+
}, renderContent()));
|
34
|
+
};
|
35
|
+
|
15
36
|
return /*#__PURE__*/React.createElement("div", _extends({
|
16
|
-
className: cn(
|
37
|
+
className: cn({
|
38
|
+
'centering-on-mobile': centeringOnMobile
|
39
|
+
}, [className]),
|
17
40
|
ref: rootRef
|
18
|
-
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root)),
|
19
|
-
mobile: '12',
|
20
|
-
tablet: '7',
|
21
|
-
desktop: '6',
|
22
|
-
wide: '6'
|
23
|
-
}, title && /*#__PURE__*/React.createElement(Header, {
|
24
|
-
className: cn('header'),
|
25
|
-
as: "h5"
|
26
|
-
}, title), children)));
|
41
|
+
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root)), isFullWidth ? renderContent() : renderContentWithGrid());
|
27
42
|
};
|
28
43
|
|
29
44
|
TextWithIcon.propTypes = {
|
@@ -35,6 +50,8 @@ TextWithIcon.propTypes = {
|
|
35
50
|
root: PropTypes.objectOf(PropTypes.string.isRequired)
|
36
51
|
}),
|
37
52
|
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.element.isRequired), PropTypes.element.isRequired]).isRequired,
|
53
|
+
isFullWidth: PropTypes.bool,
|
54
|
+
centeringOnMobile: PropTypes.bool,
|
38
55
|
className: PropTypes.string
|
39
56
|
};
|
40
57
|
export default TextWithIcon;
|
@@ -13,14 +13,6 @@ h5 {
|
|
13
13
|
-ms-flex-align: center;
|
14
14
|
align-items: center;
|
15
15
|
}
|
16
|
-
@media screen and (max-width: 767px) {
|
17
|
-
.mfui-text-with-icon-item {
|
18
|
-
-webkit-box-orient: vertical;
|
19
|
-
-webkit-box-direction: normal;
|
20
|
-
-ms-flex-direction: column;
|
21
|
-
flex-direction: column;
|
22
|
-
}
|
23
|
-
}
|
24
16
|
.mfui-text-with-icon-item:not(:first-of-type) {
|
25
17
|
margin-top: 16px;
|
26
18
|
}
|
@@ -34,16 +26,6 @@ h5 {
|
|
34
26
|
min-width: 40px;
|
35
27
|
height: 40px;
|
36
28
|
min-height: 40px;
|
29
|
+
margin-right: 16px;
|
37
30
|
overflow: hidden;
|
38
31
|
}
|
39
|
-
@media screen and (min-width: 768px) {
|
40
|
-
.mfui-text-with-icon-item__svg-icon {
|
41
|
-
margin-right: 16px;
|
42
|
-
}
|
43
|
-
}
|
44
|
-
@media screen and (max-width: 767px) {
|
45
|
-
.mfui-text-with-icon-item__text {
|
46
|
-
margin-top: 12px;
|
47
|
-
text-align: center;
|
48
|
-
}
|
49
|
-
}
|
@@ -10,9 +10,13 @@ var TextWithIconItem = function TextWithIconItem(_ref) {
|
|
10
10
|
icon = _ref.icon,
|
11
11
|
rootRef = _ref.rootRef,
|
12
12
|
dataAttrs = _ref.dataAttrs,
|
13
|
+
_ref$centeringOnMobil = _ref.centeringOnMobile,
|
14
|
+
centeringOnMobile = _ref$centeringOnMobil === void 0 ? true : _ref$centeringOnMobil,
|
13
15
|
className = _ref.className;
|
14
16
|
return /*#__PURE__*/React.createElement("div", _extends({
|
15
|
-
className: cn(
|
17
|
+
className: cn({
|
18
|
+
'centering-on-mobile': centeringOnMobile
|
19
|
+
}, [className]),
|
16
20
|
ref: rootRef
|
17
21
|
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root)), /*#__PURE__*/React.createElement("div", {
|
18
22
|
className: cn('svg-icon')
|
@@ -30,6 +34,7 @@ TextWithIconItem.propTypes = {
|
|
30
34
|
dataAttrs: PropTypes.shape({
|
31
35
|
root: PropTypes.objectOf(PropTypes.string.isRequired)
|
32
36
|
}),
|
37
|
+
centeringOnMobile: PropTypes.bool,
|
33
38
|
className: PropTypes.string
|
34
39
|
};
|
35
40
|
export default TextWithIconItem;
|
@@ -84,9 +84,8 @@ h5 {
|
|
84
84
|
.mfui-video-banner__background-image {
|
85
85
|
width: 100%;
|
86
86
|
height: 100%;
|
87
|
-
|
88
|
-
|
89
|
-
background-size: cover;
|
87
|
+
-o-object-fit: cover;
|
88
|
+
object-fit: cover;
|
90
89
|
}
|
91
90
|
.mfui-video-banner__content {
|
92
91
|
position: relative;
|
@@ -78,6 +78,8 @@ interface IVideoBannerProps {
|
|
78
78
|
videoSrc?: string;
|
79
79
|
/** Тип видео */
|
80
80
|
videoType?: VideoType;
|
81
|
+
/** Разрешить проигрывать видео на мобильном разрешении */
|
82
|
+
videoMobile?: boolean;
|
81
83
|
/** Наличие звука в видео */
|
82
84
|
isMuted?: boolean;
|
83
85
|
/** Изображение для мобильного разрешения */
|
@@ -63,20 +63,17 @@ var VideoBanner = function VideoBanner(_ref2) {
|
|
63
63
|
content = _ref2.content,
|
64
64
|
_ref2$isMuted = _ref2.isMuted,
|
65
65
|
isMuted = _ref2$isMuted === void 0 ? true : _ref2$isMuted,
|
66
|
-
breadcrumbs = _ref2.breadcrumbs
|
66
|
+
breadcrumbs = _ref2.breadcrumbs,
|
67
|
+
_ref2$videoMobile = _ref2.videoMobile,
|
68
|
+
videoMobile = _ref2$videoMobile === void 0 ? false : _ref2$videoMobile;
|
67
69
|
|
68
70
|
var _React$useState = React.useState(true),
|
69
71
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
70
72
|
isMobile = _React$useState2[0],
|
71
73
|
setIsMobile = _React$useState2[1];
|
72
74
|
|
73
|
-
var _React$useState3 = React.useState(imageMobile),
|
74
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
75
|
-
imageSrc = _React$useState4[0],
|
76
|
-
setImageSrc = _React$useState4[1];
|
77
|
-
|
78
75
|
var isVideoData = !!videoSrc && !!videoType;
|
79
|
-
var isRenderVideo = !isMobile && isVideoData;
|
76
|
+
var isRenderVideo = (!isMobile || videoMobile) && isVideoData;
|
80
77
|
var renderContent = React.useCallback(function (_ref3) {
|
81
78
|
var title = _ref3.title,
|
82
79
|
description = _ref3.description,
|
@@ -189,27 +186,8 @@ var VideoBanner = function VideoBanner(_ref2) {
|
|
189
186
|
}
|
190
187
|
}, [videoType, videoSrc, isMuted, classes.video]);
|
191
188
|
React.useEffect(function () {
|
192
|
-
var getImageSrc = function getImageSrc() {
|
193
|
-
var windowWidth = window.innerWidth;
|
194
|
-
|
195
|
-
switch (true) {
|
196
|
-
case windowWidth >= breakpoints.DESKTOP_MIDDLE_START:
|
197
|
-
return imageDesktopWide;
|
198
|
-
|
199
|
-
case windowWidth >= breakpoints.DESKTOP_SMALL_START && windowWidth <= breakpoints.DESKTOP_SMALL_END:
|
200
|
-
return imageDesktop;
|
201
|
-
|
202
|
-
case windowWidth >= breakpoints.MOBILE_BIG_START && windowWidth <= breakpoints.MOBILE_BIG_END:
|
203
|
-
return imageTablet;
|
204
|
-
|
205
|
-
default:
|
206
|
-
return imageMobile;
|
207
|
-
}
|
208
|
-
};
|
209
|
-
|
210
189
|
var resizeHandler = function resizeHandler() {
|
211
190
|
setIsMobile(window.innerWidth < breakpoints.DESKTOP_SMALL_START);
|
212
|
-
setImageSrc(getImageSrc());
|
213
191
|
};
|
214
192
|
|
215
193
|
var resizeHandlerThrottled = throttle(resizeHandler, throttleTime.resize);
|
@@ -218,7 +196,7 @@ var VideoBanner = function VideoBanner(_ref2) {
|
|
218
196
|
return function () {
|
219
197
|
window.removeEventListener('resize', resizeHandlerThrottled);
|
220
198
|
};
|
221
|
-
}, [
|
199
|
+
}, [setIsMobile]);
|
222
200
|
return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
223
201
|
className: cn([className, classes.root]),
|
224
202
|
ref: rootRef
|
@@ -235,12 +213,20 @@ var VideoBanner = function VideoBanner(_ref2) {
|
|
235
213
|
classes: {
|
236
214
|
item: classes.breadcrumbs
|
237
215
|
}
|
238
|
-
}), content && renderContent(content), isRenderVideo && renderVideo(), !isRenderVideo && /*#__PURE__*/React.createElement("
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
216
|
+
}), content && renderContent(content), isRenderVideo && renderVideo(), !isRenderVideo && /*#__PURE__*/React.createElement("picture", null, /*#__PURE__*/React.createElement("source", {
|
217
|
+
media: "(min-width: ".concat(breakpoints.DESKTOP_MIDDLE_START, "px)"),
|
218
|
+
srcSet: imageDesktopWide
|
219
|
+
}), /*#__PURE__*/React.createElement("source", {
|
220
|
+
media: "(min-width: ".concat(breakpoints.DESKTOP_SMALL_START, "px)"),
|
221
|
+
srcSet: imageDesktop
|
222
|
+
}), /*#__PURE__*/React.createElement("source", {
|
223
|
+
media: "(min-width: ".concat(breakpoints.MOBILE_BIG_START, "px)"),
|
224
|
+
srcSet: imageTablet
|
225
|
+
}), /*#__PURE__*/React.createElement("img", {
|
226
|
+
className: cn('background-image'),
|
227
|
+
src: imageMobile,
|
228
|
+
alt: ""
|
229
|
+
})))));
|
244
230
|
};
|
245
231
|
|
246
232
|
VideoBanner.propTypes = {
|
@@ -263,6 +249,7 @@ VideoBanner.propTypes = {
|
|
263
249
|
}), PropTypes.any])]),
|
264
250
|
videoSrc: PropTypes.string,
|
265
251
|
videoType: PropTypes.oneOf(Object.values(VideoType)),
|
252
|
+
videoMobile: PropTypes.bool,
|
266
253
|
content: PropTypes.shape({
|
267
254
|
title: PropTypes.string.isRequired,
|
268
255
|
description: PropTypes.string.isRequired,
|
@@ -99,13 +99,20 @@ var Instructions = function Instructions(_ref) {
|
|
99
99
|
};
|
100
100
|
}, [swiperInstance]);
|
101
101
|
|
102
|
+
var handleSlideChange = _react["default"].useCallback(function (_ref2) {
|
103
|
+
var activeIndex = _ref2.activeIndex;
|
104
|
+
setSlideIndex(activeIndex);
|
105
|
+
}, []);
|
106
|
+
|
102
107
|
var renderVideo = _react["default"].useCallback(function (mediaUrl, index) {
|
103
108
|
return /*#__PURE__*/_react["default"].createElement("video", (0, _extends2["default"])({
|
104
109
|
loop: true,
|
105
110
|
muted: true,
|
106
111
|
autoPlay: true,
|
107
112
|
playsInline: true,
|
108
|
-
className: cn('swiper-img'
|
113
|
+
className: cn('swiper-img', {
|
114
|
+
video: true
|
115
|
+
})
|
109
116
|
}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.image, index + 1)), /*#__PURE__*/_react["default"].createElement("source", {
|
110
117
|
src: mediaUrl,
|
111
118
|
type: "video/mp4"
|
@@ -114,12 +121,14 @@ var Instructions = function Instructions(_ref) {
|
|
114
121
|
|
115
122
|
var renderSlider = _react["default"].useCallback(function () {
|
116
123
|
return /*#__PURE__*/_react["default"].createElement(_react2.Swiper, {
|
117
|
-
|
124
|
+
noSwiping: false,
|
118
125
|
onSwiper: getSwiperInstance,
|
119
|
-
noSwipingClass: swiperSlideCn
|
120
|
-
|
121
|
-
|
122
|
-
|
126
|
+
noSwipingClass: swiperSlideCn,
|
127
|
+
onSlideChange: handleSlideChange,
|
128
|
+
className: cn('swiper')
|
129
|
+
}, instructionItems.map(function (_ref3, i) {
|
130
|
+
var mediaUrl = _ref3.mediaUrl,
|
131
|
+
isVideo = _ref3.isVideo;
|
123
132
|
return /*#__PURE__*/_react["default"].createElement(_react2.SwiperSlide, {
|
124
133
|
className: swiperSlideCn,
|
125
134
|
key: i + mediaUrl
|
@@ -130,7 +139,7 @@ var Instructions = function Instructions(_ref) {
|
|
130
139
|
className: cn('swiper-img', [instructionItemImg])
|
131
140
|
})));
|
132
141
|
}));
|
133
|
-
}, [getSwiperInstance, instructionItemImg, instructionItems, renderVideo, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.image]);
|
142
|
+
}, [getSwiperInstance, instructionItemImg, instructionItems, renderVideo, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.image, handleSlideChange]);
|
134
143
|
|
135
144
|
var renderTitle = _react["default"].useCallback(function (resolution) {
|
136
145
|
return /*#__PURE__*/_react["default"].createElement(_uiCore.Header, {
|
@@ -166,8 +175,8 @@ var Instructions = function Instructions(_ref) {
|
|
166
175
|
'text-after': !!text,
|
167
176
|
desktop: true
|
168
177
|
})
|
169
|
-
}, instructionItems.map(function (
|
170
|
-
var itemTitle =
|
178
|
+
}, instructionItems.map(function (_ref4, i) {
|
179
|
+
var itemTitle = _ref4.title;
|
171
180
|
return (
|
172
181
|
/*#__PURE__*/
|
173
182
|
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
|
@@ -196,8 +205,8 @@ var Instructions = function Instructions(_ref) {
|
|
196
205
|
})
|
197
206
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
198
207
|
className: cn('articles-title-block')
|
199
|
-
}, instructionItems.map(function (
|
200
|
-
var itemTitle =
|
208
|
+
}, instructionItems.map(function (_ref5, i) {
|
209
|
+
var itemTitle = _ref5.title;
|
201
210
|
return slideIndex === i && /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({
|
202
211
|
key: i,
|
203
212
|
"data-index": i
|
@@ -53,10 +53,10 @@ h5 {
|
|
53
53
|
max-width: 550px;
|
54
54
|
height: 100%;
|
55
55
|
}
|
56
|
-
.mfui-picture-with-description__content :first-child {
|
56
|
+
.mfui-picture-with-description__content > :first-child {
|
57
57
|
margin-top: 0 !important;
|
58
58
|
}
|
59
|
-
.mfui-picture-with-description__content :last-child {
|
59
|
+
.mfui-picture-with-description__content > :last-child {
|
60
60
|
margin-bottom: 0 !important;
|
61
61
|
}
|
62
62
|
@media screen and (min-width: 1024px) {
|
@@ -45,7 +45,6 @@ h5 {
|
|
45
45
|
}
|
46
46
|
}
|
47
47
|
.mfui-table__top-shadow {
|
48
|
-
position: -webkit-sticky;
|
49
48
|
position: sticky;
|
50
49
|
top: 0;
|
51
50
|
z-index: 2;
|
@@ -58,7 +57,6 @@ h5 {
|
|
58
57
|
background: linear-gradient(359.94deg, rgba(0, 0, 0, 0.0001) 0.06%, rgba(0, 0, 0, 0.03) 38.08%, rgba(0, 0, 0, 0.08) 74.98%);
|
59
58
|
}
|
60
59
|
.mfui-table__left-shadow {
|
61
|
-
position: -webkit-sticky;
|
62
60
|
position: sticky;
|
63
61
|
top: 0;
|
64
62
|
bottom: 0;
|
@@ -70,7 +68,6 @@ h5 {
|
|
70
68
|
background: linear-gradient(270deg, rgba(0, 0, 0, 0.0001) 16.3%, rgba(0, 0, 0, 0.03) 51.81%, rgba(0, 0, 0, 0.08) 86.27%);
|
71
69
|
}
|
72
70
|
.mfui-table__bottom-gradient {
|
73
|
-
position: -webkit-sticky;
|
74
71
|
position: sticky;
|
75
72
|
bottom: 0;
|
76
73
|
z-index: 1;
|
@@ -84,7 +81,6 @@ h5 {
|
|
84
81
|
background: linear-gradient(to top, var(--base) 25%, rgba(255, 255, 255, 0));
|
85
82
|
}
|
86
83
|
.mfui-table__right-gradient {
|
87
|
-
position: -webkit-sticky;
|
88
84
|
position: sticky;
|
89
85
|
right: 0;
|
90
86
|
z-index: 1;
|
@@ -142,7 +138,6 @@ h5 {
|
|
142
138
|
min-width: 144px;
|
143
139
|
}
|
144
140
|
.mfui-table_fix-column .mfui-table__cell:first-child {
|
145
|
-
position: -webkit-sticky;
|
146
141
|
position: sticky;
|
147
142
|
}
|
148
143
|
.mfui-table_fix-column .mfui-table__left-shadow {
|
@@ -12,6 +12,10 @@ export interface ITextWithIconProps {
|
|
12
12
|
};
|
13
13
|
/** Дополнительный класс для корневого элемента */
|
14
14
|
className?: string;
|
15
|
+
/** Включить растягивание на всю ширину контейнера */
|
16
|
+
isFullWidth?: boolean;
|
17
|
+
/** Выравнивание по центру на мобильных */
|
18
|
+
centeringOnMobile?: boolean;
|
15
19
|
/** Допустимый дочерний компонент */
|
16
20
|
children: React.ReactElement<ITextWithIconItem>[] | React.ReactElement<ITextWithIconItem>;
|
17
21
|
}
|
@@ -30,19 +30,34 @@ var TextWithIcon = function TextWithIcon(_ref) {
|
|
30
30
|
rootRef = _ref.rootRef,
|
31
31
|
dataAttrs = _ref.dataAttrs,
|
32
32
|
className = _ref.className,
|
33
|
+
_ref$isFullWidth = _ref.isFullWidth,
|
34
|
+
isFullWidth = _ref$isFullWidth === void 0 ? false : _ref$isFullWidth,
|
35
|
+
_ref$centeringOnMobil = _ref.centeringOnMobile,
|
36
|
+
centeringOnMobile = _ref$centeringOnMobil === void 0 ? true : _ref$centeringOnMobil,
|
33
37
|
children = _ref.children;
|
38
|
+
|
39
|
+
var renderContent = function renderContent() {
|
40
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, title && /*#__PURE__*/React.createElement(_uiCore.Header, {
|
41
|
+
className: cn('header'),
|
42
|
+
as: "h5"
|
43
|
+
}, title), children);
|
44
|
+
};
|
45
|
+
|
46
|
+
var renderContentWithGrid = function renderContentWithGrid() {
|
47
|
+
return /*#__PURE__*/React.createElement(_uiCore.Grid, null, /*#__PURE__*/React.createElement(_uiCore.GridColumn, {
|
48
|
+
mobile: '12',
|
49
|
+
tablet: '7',
|
50
|
+
desktop: '6',
|
51
|
+
wide: '6'
|
52
|
+
}, renderContent()));
|
53
|
+
};
|
54
|
+
|
34
55
|
return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({
|
35
|
-
className: cn(
|
56
|
+
className: cn({
|
57
|
+
'centering-on-mobile': centeringOnMobile
|
58
|
+
}, [className]),
|
36
59
|
ref: rootRef
|
37
|
-
}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root)),
|
38
|
-
mobile: '12',
|
39
|
-
tablet: '7',
|
40
|
-
desktop: '6',
|
41
|
-
wide: '6'
|
42
|
-
}, title && /*#__PURE__*/React.createElement(_uiCore.Header, {
|
43
|
-
className: cn('header'),
|
44
|
-
as: "h5"
|
45
|
-
}, title), children)));
|
60
|
+
}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root)), isFullWidth ? renderContent() : renderContentWithGrid());
|
46
61
|
};
|
47
62
|
|
48
63
|
TextWithIcon.propTypes = {
|
@@ -54,6 +69,8 @@ TextWithIcon.propTypes = {
|
|
54
69
|
root: PropTypes.objectOf(PropTypes.string.isRequired)
|
55
70
|
}),
|
56
71
|
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.element.isRequired), PropTypes.element.isRequired]).isRequired,
|
72
|
+
isFullWidth: PropTypes.bool,
|
73
|
+
centeringOnMobile: PropTypes.bool,
|
57
74
|
className: PropTypes.string
|
58
75
|
};
|
59
76
|
var _default = TextWithIcon;
|
@@ -13,14 +13,6 @@ h5 {
|
|
13
13
|
-ms-flex-align: center;
|
14
14
|
align-items: center;
|
15
15
|
}
|
16
|
-
@media screen and (max-width: 767px) {
|
17
|
-
.mfui-text-with-icon-item {
|
18
|
-
-webkit-box-orient: vertical;
|
19
|
-
-webkit-box-direction: normal;
|
20
|
-
-ms-flex-direction: column;
|
21
|
-
flex-direction: column;
|
22
|
-
}
|
23
|
-
}
|
24
16
|
.mfui-text-with-icon-item:not(:first-of-type) {
|
25
17
|
margin-top: 16px;
|
26
18
|
}
|
@@ -34,16 +26,6 @@ h5 {
|
|
34
26
|
min-width: 40px;
|
35
27
|
height: 40px;
|
36
28
|
min-height: 40px;
|
29
|
+
margin-right: 16px;
|
37
30
|
overflow: hidden;
|
38
31
|
}
|
39
|
-
@media screen and (min-width: 768px) {
|
40
|
-
.mfui-text-with-icon-item__svg-icon {
|
41
|
-
margin-right: 16px;
|
42
|
-
}
|
43
|
-
}
|
44
|
-
@media screen and (max-width: 767px) {
|
45
|
-
.mfui-text-with-icon-item__text {
|
46
|
-
margin-top: 12px;
|
47
|
-
text-align: center;
|
48
|
-
}
|
49
|
-
}
|
@@ -28,9 +28,13 @@ var TextWithIconItem = function TextWithIconItem(_ref) {
|
|
28
28
|
icon = _ref.icon,
|
29
29
|
rootRef = _ref.rootRef,
|
30
30
|
dataAttrs = _ref.dataAttrs,
|
31
|
+
_ref$centeringOnMobil = _ref.centeringOnMobile,
|
32
|
+
centeringOnMobile = _ref$centeringOnMobil === void 0 ? true : _ref$centeringOnMobil,
|
31
33
|
className = _ref.className;
|
32
34
|
return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({
|
33
|
-
className: cn(
|
35
|
+
className: cn({
|
36
|
+
'centering-on-mobile': centeringOnMobile
|
37
|
+
}, [className]),
|
34
38
|
ref: rootRef
|
35
39
|
}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root)), /*#__PURE__*/React.createElement("div", {
|
36
40
|
className: cn('svg-icon')
|
@@ -48,6 +52,7 @@ TextWithIconItem.propTypes = {
|
|
48
52
|
dataAttrs: PropTypes.shape({
|
49
53
|
root: PropTypes.objectOf(PropTypes.string.isRequired)
|
50
54
|
}),
|
55
|
+
centeringOnMobile: PropTypes.bool,
|
51
56
|
className: PropTypes.string
|
52
57
|
};
|
53
58
|
var _default = TextWithIconItem;
|
@@ -84,9 +84,8 @@ h5 {
|
|
84
84
|
.mfui-video-banner__background-image {
|
85
85
|
width: 100%;
|
86
86
|
height: 100%;
|
87
|
-
|
88
|
-
|
89
|
-
background-size: cover;
|
87
|
+
-o-object-fit: cover;
|
88
|
+
object-fit: cover;
|
90
89
|
}
|
91
90
|
.mfui-video-banner__content {
|
92
91
|
position: relative;
|
@@ -78,6 +78,8 @@ interface IVideoBannerProps {
|
|
78
78
|
videoSrc?: string;
|
79
79
|
/** Тип видео */
|
80
80
|
videoType?: VideoType;
|
81
|
+
/** Разрешить проигрывать видео на мобильном разрешении */
|
82
|
+
videoMobile?: boolean;
|
81
83
|
/** Наличие звука в видео */
|
82
84
|
isMuted?: boolean;
|
83
85
|
/** Изображение для мобильного разрешения */
|
@@ -95,20 +95,17 @@ var VideoBanner = function VideoBanner(_ref2) {
|
|
95
95
|
content = _ref2.content,
|
96
96
|
_ref2$isMuted = _ref2.isMuted,
|
97
97
|
isMuted = _ref2$isMuted === void 0 ? true : _ref2$isMuted,
|
98
|
-
breadcrumbs = _ref2.breadcrumbs
|
98
|
+
breadcrumbs = _ref2.breadcrumbs,
|
99
|
+
_ref2$videoMobile = _ref2.videoMobile,
|
100
|
+
videoMobile = _ref2$videoMobile === void 0 ? false : _ref2$videoMobile;
|
99
101
|
|
100
102
|
var _React$useState = _react["default"].useState(true),
|
101
103
|
_React$useState2 = (0, _slicedToArray2["default"])(_React$useState, 2),
|
102
104
|
isMobile = _React$useState2[0],
|
103
105
|
setIsMobile = _React$useState2[1];
|
104
106
|
|
105
|
-
var _React$useState3 = _react["default"].useState(imageMobile),
|
106
|
-
_React$useState4 = (0, _slicedToArray2["default"])(_React$useState3, 2),
|
107
|
-
imageSrc = _React$useState4[0],
|
108
|
-
setImageSrc = _React$useState4[1];
|
109
|
-
|
110
107
|
var isVideoData = !!videoSrc && !!videoType;
|
111
|
-
var isRenderVideo = !isMobile && isVideoData;
|
108
|
+
var isRenderVideo = (!isMobile || videoMobile) && isVideoData;
|
112
109
|
|
113
110
|
var renderContent = _react["default"].useCallback(function (_ref3) {
|
114
111
|
var title = _ref3.title,
|
@@ -224,27 +221,8 @@ var VideoBanner = function VideoBanner(_ref2) {
|
|
224
221
|
}, [videoType, videoSrc, isMuted, classes.video]);
|
225
222
|
|
226
223
|
_react["default"].useEffect(function () {
|
227
|
-
var getImageSrc = function getImageSrc() {
|
228
|
-
var windowWidth = window.innerWidth;
|
229
|
-
|
230
|
-
switch (true) {
|
231
|
-
case windowWidth >= _uiHelpers.breakpoints.DESKTOP_MIDDLE_START:
|
232
|
-
return imageDesktopWide;
|
233
|
-
|
234
|
-
case windowWidth >= _uiHelpers.breakpoints.DESKTOP_SMALL_START && windowWidth <= _uiHelpers.breakpoints.DESKTOP_SMALL_END:
|
235
|
-
return imageDesktop;
|
236
|
-
|
237
|
-
case windowWidth >= _uiHelpers.breakpoints.MOBILE_BIG_START && windowWidth <= _uiHelpers.breakpoints.MOBILE_BIG_END:
|
238
|
-
return imageTablet;
|
239
|
-
|
240
|
-
default:
|
241
|
-
return imageMobile;
|
242
|
-
}
|
243
|
-
};
|
244
|
-
|
245
224
|
var resizeHandler = function resizeHandler() {
|
246
225
|
setIsMobile(window.innerWidth < _uiHelpers.breakpoints.DESKTOP_SMALL_START);
|
247
|
-
setImageSrc(getImageSrc());
|
248
226
|
};
|
249
227
|
|
250
228
|
var resizeHandlerThrottled = (0, _lodash["default"])(resizeHandler, _throttleTime["default"].resize);
|
@@ -253,7 +231,7 @@ var VideoBanner = function VideoBanner(_ref2) {
|
|
253
231
|
return function () {
|
254
232
|
window.removeEventListener('resize', resizeHandlerThrottled);
|
255
233
|
};
|
256
|
-
}, [
|
234
|
+
}, [setIsMobile]);
|
257
235
|
|
258
236
|
return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
259
237
|
className: cn([className, classes.root]),
|
@@ -271,12 +249,20 @@ var VideoBanner = function VideoBanner(_ref2) {
|
|
271
249
|
classes: {
|
272
250
|
item: classes.breadcrumbs
|
273
251
|
}
|
274
|
-
}), content && renderContent(content), isRenderVideo && renderVideo(), !isRenderVideo && /*#__PURE__*/_react["default"].createElement("
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
252
|
+
}), content && renderContent(content), isRenderVideo && renderVideo(), !isRenderVideo && /*#__PURE__*/_react["default"].createElement("picture", null, /*#__PURE__*/_react["default"].createElement("source", {
|
253
|
+
media: "(min-width: ".concat(_uiHelpers.breakpoints.DESKTOP_MIDDLE_START, "px)"),
|
254
|
+
srcSet: imageDesktopWide
|
255
|
+
}), /*#__PURE__*/_react["default"].createElement("source", {
|
256
|
+
media: "(min-width: ".concat(_uiHelpers.breakpoints.DESKTOP_SMALL_START, "px)"),
|
257
|
+
srcSet: imageDesktop
|
258
|
+
}), /*#__PURE__*/_react["default"].createElement("source", {
|
259
|
+
media: "(min-width: ".concat(_uiHelpers.breakpoints.MOBILE_BIG_START, "px)"),
|
260
|
+
srcSet: imageTablet
|
261
|
+
}), /*#__PURE__*/_react["default"].createElement("img", {
|
262
|
+
className: cn('background-image'),
|
263
|
+
src: imageMobile,
|
264
|
+
alt: ""
|
265
|
+
})))));
|
280
266
|
};
|
281
267
|
|
282
268
|
VideoBanner.propTypes = {
|
@@ -299,6 +285,7 @@ VideoBanner.propTypes = {
|
|
299
285
|
}), PropTypes.any])]),
|
300
286
|
videoSrc: PropTypes.string,
|
301
287
|
videoType: PropTypes.oneOf(Object.values(VideoType)),
|
288
|
+
videoMobile: PropTypes.bool,
|
302
289
|
content: PropTypes.shape({
|
303
290
|
title: PropTypes.string.isRequired,
|
304
291
|
description: PropTypes.string.isRequired,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@megafon/ui-shared",
|
3
|
-
"version": "4.0.0-beta.
|
3
|
+
"version": "4.0.0-beta.7",
|
4
4
|
"files": [
|
5
5
|
"dist"
|
6
6
|
],
|
@@ -52,7 +52,7 @@
|
|
52
52
|
"@babel/preset-env": "^7.8.6",
|
53
53
|
"@babel/preset-react": "^7.8.3",
|
54
54
|
"@babel/preset-typescript": "^7.8.3",
|
55
|
-
"@megafon/ui-icons": "^2.0.0-beta.
|
55
|
+
"@megafon/ui-icons": "^2.0.0-beta.2",
|
56
56
|
"@svgr/core": "^2.4.1",
|
57
57
|
"@types/enzyme": "^3.10.5",
|
58
58
|
"@types/enzyme-adapter-react-16": "^1.0.6",
|
@@ -82,7 +82,7 @@
|
|
82
82
|
},
|
83
83
|
"dependencies": {
|
84
84
|
"@babel/runtime": "^7.8.4",
|
85
|
-
"@megafon/ui-core": "^4.0.0-beta.
|
85
|
+
"@megafon/ui-core": "^4.0.0-beta.6",
|
86
86
|
"@megafon/ui-helpers": "^2.1.2",
|
87
87
|
"core-js": "^3.6.4",
|
88
88
|
"htmr": "^0.9.2",
|
@@ -90,5 +90,5 @@
|
|
90
90
|
"prop-types": "^15.7.2",
|
91
91
|
"swiper": "^6.5.6"
|
92
92
|
},
|
93
|
-
"gitHead": "
|
93
|
+
"gitHead": "7c2d8ac800a977892811ac71bc542e7e193404da"
|
94
94
|
}
|