@megafon/ui-shared 5.1.0 → 5.2.1
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 +20 -0
- package/dist/es/components/BenefitsIcons/BenefitsIcons.js +19 -116
- package/dist/es/components/BenefitsIcons/BenefitsIconsTile.js +3 -1
- package/dist/es/components/BenefitsIcons/helpers.d.ts +8 -0
- package/dist/es/components/BenefitsIcons/helpers.js +116 -0
- package/dist/es/components/ButtonBanner/ButtonBanner.js +5 -2
- package/dist/es/components/DownloadLinks/DownloadLink.js +1 -1
- package/dist/es/components/DownloadLinks/DownloadLinks.d.ts +10 -0
- package/dist/es/components/DownloadLinks/DownloadLinks.js +4 -4
- package/dist/es/components/Instructions/Instructions.js +11 -5
- package/dist/es/components/PageTitle/PageTitle.d.ts +2 -2
- package/dist/es/components/PageTitle/PageTitle.js +8 -1
- package/dist/es/components/Partners/Partners.js +12 -2
- package/dist/es/components/PictureWithDescription/PictureWithDescription.js +5 -2
- package/dist/es/components/Property/Property.js +2 -2
- package/dist/es/components/Property/types.d.ts +1 -1
- package/dist/es/components/StoreBanner/StoreBanner.js +5 -2
- package/dist/es/components/Table/Table.css +10 -1
- package/dist/es/components/Table/Table.d.ts +2 -0
- package/dist/es/components/Table/Table.js +17 -6
- package/dist/es/components/Table/TableRow.d.ts +2 -0
- package/dist/es/components/Table/TableRow.js +2 -0
- package/dist/es/components/TabsBox/TabsBox.d.ts +1 -1
- package/dist/es/components/TabsBox/TabsBox.js +3 -2
- package/dist/es/components/TextBox/TextBox.js +6 -1
- package/dist/es/components/TextWithIcon/TextWithIcon.js +8 -1
- package/dist/es/components/TextWithIcon/TextWithIconItem.js +5 -2
- package/dist/lib/components/BenefitsIcons/BenefitsIcons.js +21 -116
- package/dist/lib/components/BenefitsIcons/BenefitsIconsTile.js +3 -1
- package/dist/lib/components/BenefitsIcons/helpers.d.ts +8 -0
- package/dist/lib/components/BenefitsIcons/helpers.js +135 -0
- package/dist/lib/components/ButtonBanner/ButtonBanner.js +5 -2
- package/dist/lib/components/DownloadLinks/DownloadLink.js +1 -1
- package/dist/lib/components/DownloadLinks/DownloadLinks.d.ts +10 -0
- package/dist/lib/components/DownloadLinks/DownloadLinks.js +5 -2
- package/dist/lib/components/Instructions/Instructions.js +11 -5
- package/dist/lib/components/PageTitle/PageTitle.d.ts +2 -2
- package/dist/lib/components/PageTitle/PageTitle.js +8 -1
- package/dist/lib/components/Partners/Partners.js +12 -2
- package/dist/lib/components/PictureWithDescription/PictureWithDescription.js +5 -2
- package/dist/lib/components/Property/Property.js +2 -2
- package/dist/lib/components/Property/types.d.ts +1 -1
- package/dist/lib/components/StoreBanner/StoreBanner.js +5 -2
- package/dist/lib/components/Table/Table.css +10 -1
- package/dist/lib/components/Table/Table.d.ts +2 -0
- package/dist/lib/components/Table/Table.js +17 -6
- package/dist/lib/components/Table/TableRow.d.ts +2 -0
- package/dist/lib/components/Table/TableRow.js +2 -0
- package/dist/lib/components/TabsBox/TabsBox.d.ts +1 -1
- package/dist/lib/components/TabsBox/TabsBox.js +3 -2
- package/dist/lib/components/TextBox/TextBox.js +6 -1
- package/dist/lib/components/TextWithIcon/TextWithIcon.js +8 -1
- package/dist/lib/components/TextWithIcon/TextWithIconItem.js +5 -2
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,26 @@
|
|
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.2.1](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/compare/@megafon/ui-shared@5.2.0...@megafon/ui-shared@5.2.1) (2023-10-17)
|
7
|
+
|
8
|
+
**Note:** Version bump only for package @megafon/ui-shared
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
# [5.2.0](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/compare/@megafon/ui-shared@5.1.0...@megafon/ui-shared@5.2.0) (2023-09-21)
|
15
|
+
|
16
|
+
|
17
|
+
### Features
|
18
|
+
|
19
|
+
* **property:** add type ReactNode to props item.value ([5f59136](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/5f59136ffdc6fc863a6910bd45f17c6783be19c8))
|
20
|
+
* **table:** add vAlign and disableHeightLimit props ([813b1ce](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/813b1ceef71576104d8c397cf372c52192daa258))
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
|
6
26
|
# [5.1.0](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/compare/@megafon/ui-shared@5.0.1...@megafon/ui-shared@5.1.0) (2023-09-14)
|
7
27
|
|
8
28
|
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
2
1
|
import _extends from "@babel/runtime/helpers/extends";
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
3
3
|
import "core-js/modules/es.array.map.js";
|
4
4
|
import "core-js/modules/es.object.values.js";
|
5
5
|
import * as React from 'react';
|
@@ -9,120 +9,10 @@ import throttle from 'lodash.throttle';
|
|
9
9
|
import PropTypes from 'prop-types';
|
10
10
|
import throttleTime from "../../constants/throttleTime";
|
11
11
|
import BenefitsIconsTile from "./BenefitsIconsTile";
|
12
|
+
import getMultiColumnConfig, { getOneColumnConfig } from "./helpers";
|
12
13
|
import { IconPositionEnum, ItemsAlignEnum } from "./types";
|
13
|
-
import "./style/BenefitsIcons.css";
|
14
|
-
|
15
|
-
var getLeftSideConfig = function getLeftSideConfig(count, index) {
|
16
|
-
var everySecondWithoutOffset = index % 2 ? '1' : undefined;
|
17
|
-
var columnSize = {
|
18
|
-
wide: '4',
|
19
|
-
desktop: '5',
|
20
|
-
tablet: '10'
|
21
|
-
};
|
22
|
-
|
23
|
-
switch (count) {
|
24
|
-
case 2:
|
25
|
-
case 4:
|
26
|
-
return _extends(_extends({}, columnSize), {
|
27
|
-
leftOffsetWide: everySecondWithoutOffset,
|
28
|
-
leftOffsetDesktop: everySecondWithoutOffset
|
29
|
-
});
|
30
|
-
|
31
|
-
default:
|
32
|
-
return _extends(_extends({}, columnSize), {
|
33
|
-
leftOffsetDesktop: everySecondWithoutOffset
|
34
|
-
});
|
35
|
-
}
|
36
|
-
}; // left-aligned column with left-aligned icon on top
|
37
|
-
|
38
|
-
|
39
|
-
var getLeftTopConfig = function getLeftTopConfig(count, index) {
|
40
|
-
var everySecondWithoutOffset = index % 2 ? '1' : undefined;
|
41
|
-
var everyThirdWithoutOffset = index % 3 ? '1' : undefined;
|
42
|
-
|
43
|
-
switch (count) {
|
44
|
-
case 2:
|
45
|
-
return {
|
46
|
-
wide: '4',
|
47
|
-
desktop: '4',
|
48
|
-
tablet: '5',
|
49
|
-
leftOffsetWide: everySecondWithoutOffset,
|
50
|
-
leftOffsetDesktop: everySecondWithoutOffset,
|
51
|
-
leftOffsetTablet: everySecondWithoutOffset
|
52
|
-
};
|
53
|
-
|
54
|
-
case 4:
|
55
|
-
return {
|
56
|
-
wide: '3',
|
57
|
-
desktop: '4',
|
58
|
-
tablet: '5',
|
59
|
-
leftOffsetDesktop: everySecondWithoutOffset,
|
60
|
-
leftOffsetTablet: everySecondWithoutOffset
|
61
|
-
};
|
62
|
-
|
63
|
-
default:
|
64
|
-
return {
|
65
|
-
wide: '3',
|
66
|
-
desktop: '4',
|
67
|
-
tablet: '5',
|
68
|
-
leftOffsetWide: everyThirdWithoutOffset,
|
69
|
-
leftOffsetTablet: everySecondWithoutOffset
|
70
|
-
};
|
71
|
-
}
|
72
|
-
}; // center-aligned column with center-aligned icon on top
|
73
|
-
|
74
|
-
|
75
|
-
var getCenterTopConfig = function getCenterTopConfig(count, index) {
|
76
|
-
var isEvenIndex = !(index % 2);
|
77
|
-
var everyEvenWithLeftOffset = isEvenIndex ? '1' : undefined;
|
78
|
-
var everyOddWithRightOffset = isEvenIndex ? undefined : '1';
|
79
|
-
|
80
|
-
switch (count) {
|
81
|
-
case 4:
|
82
|
-
return {
|
83
|
-
wide: '3',
|
84
|
-
desktop: '5',
|
85
|
-
tablet: '5',
|
86
|
-
leftOffsetDesktop: everyEvenWithLeftOffset,
|
87
|
-
leftOffsetTablet: everyEvenWithLeftOffset,
|
88
|
-
rightOffsetTablet: everyOddWithRightOffset,
|
89
|
-
rightOffsetDesktop: everyOddWithRightOffset
|
90
|
-
};
|
91
|
-
|
92
|
-
default:
|
93
|
-
return {
|
94
|
-
wide: '4',
|
95
|
-
desktop: '4',
|
96
|
-
tablet: '4'
|
97
|
-
};
|
98
|
-
}
|
99
|
-
};
|
100
|
-
|
101
|
-
var getOneColumnConfig = function getOneColumnConfig(iconPosition) {
|
102
|
-
return iconPosition !== IconPositionEnum.CENTER_TOP ? {
|
103
|
-
wide: '10',
|
104
|
-
desktop: '10',
|
105
|
-
tablet: '10'
|
106
|
-
} : {
|
107
|
-
wide: '12',
|
108
|
-
desktop: '12',
|
109
|
-
tablet: '12'
|
110
|
-
};
|
111
|
-
};
|
112
|
-
|
113
|
-
var getMultiColumnConfig = function getMultiColumnConfig(iconPosition, count, index) {
|
114
|
-
switch (iconPosition) {
|
115
|
-
case IconPositionEnum.LEFT_TOP:
|
116
|
-
return getLeftTopConfig(count, index);
|
117
|
-
|
118
|
-
case IconPositionEnum.CENTER_TOP:
|
119
|
-
return getCenterTopConfig(count, index);
|
120
|
-
|
121
|
-
default:
|
122
|
-
return getLeftSideConfig(count, index);
|
123
|
-
}
|
124
|
-
};
|
125
|
-
|
14
|
+
import "./style/BenefitsIcons.css";
|
15
|
+
var testIdPrefix = 'BenefitsIcons';
|
126
16
|
var cn = cnCreate('mfui-benefits-icons');
|
127
17
|
|
128
18
|
var BenefitsIcons = function BenefitsIcons(_ref) {
|
@@ -177,7 +67,15 @@ var BenefitsIcons = function BenefitsIcons(_ref) {
|
|
177
67
|
}, /*#__PURE__*/React.createElement(Grid, {
|
178
68
|
className: classes.grid,
|
179
69
|
guttersLeft: "medium",
|
180
|
-
hAlign: itemsAlign
|
70
|
+
hAlign: itemsAlign,
|
71
|
+
dataAttrs: {
|
72
|
+
root: {
|
73
|
+
'data-testid': "".concat(testIdPrefix, "-grid-root")
|
74
|
+
},
|
75
|
+
container: {
|
76
|
+
'data-testid': "".concat(testIdPrefix, "-grid-container")
|
77
|
+
}
|
78
|
+
}
|
181
79
|
}, items.map(function (_ref2, i) {
|
182
80
|
var title = _ref2.title,
|
183
81
|
text = _ref2.text,
|
@@ -185,7 +83,12 @@ var BenefitsIcons = function BenefitsIcons(_ref) {
|
|
185
83
|
var columnConfig = inOneColumn ? getOneColumnConfig(iconPosition) : getMultiColumnConfig(iconPosition, items.length, i);
|
186
84
|
return /*#__PURE__*/React.createElement(GridColumn, _extends({
|
187
85
|
className: classes.gridColumn,
|
188
|
-
key: i
|
86
|
+
key: i,
|
87
|
+
dataAttrs: {
|
88
|
+
root: {
|
89
|
+
'data-testid': "".concat(testIdPrefix, "-grid-column")
|
90
|
+
}
|
91
|
+
}
|
189
92
|
}, columnConfig), /*#__PURE__*/React.createElement(BenefitsIconsTile, {
|
190
93
|
className: cn('tile', [classes.item]),
|
191
94
|
title: title,
|
@@ -5,6 +5,7 @@ import { cnCreate } from '@megafon/ui-helpers';
|
|
5
5
|
import PropTypes from 'prop-types';
|
6
6
|
import { IconPositionEnum } from "./types";
|
7
7
|
import "./style/BenefitsIconsTile.css";
|
8
|
+
var testIdPrefix = 'BenefitsIconsTile';
|
8
9
|
var cn = cnCreate('mfui-benefits-icons-tile');
|
9
10
|
|
10
11
|
var BenefitsIconsTile = function BenefitsIconsTile(_ref) {
|
@@ -17,7 +18,8 @@ var BenefitsIconsTile = function BenefitsIconsTile(_ref) {
|
|
17
18
|
return /*#__PURE__*/React.createElement("div", {
|
18
19
|
className: cn({
|
19
20
|
'icon-position': iconPosition
|
20
|
-
}, [className])
|
21
|
+
}, [className]),
|
22
|
+
"data-testid": "".concat(testIdPrefix, "-root")
|
21
23
|
}, /*#__PURE__*/React.createElement("div", {
|
22
24
|
className: cn('svg-icon')
|
23
25
|
}, icon), /*#__PURE__*/React.createElement("div", {
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { GridConfig } from './types';
|
2
|
+
declare const getLeftSideConfig: (count: number, index: number) => GridConfig;
|
3
|
+
declare const getLeftTopConfig: (count: number, index: number) => GridConfig;
|
4
|
+
declare const getCenterTopConfig: (count: number, index: number) => GridConfig;
|
5
|
+
declare const getOneColumnConfig: (iconPosition: "left-top" | "center-top" | "left-side") => GridConfig;
|
6
|
+
declare const getMultiColumnConfig: (iconPosition: "left-top" | "center-top" | "left-side", count: number, index: number) => GridConfig;
|
7
|
+
export default getMultiColumnConfig;
|
8
|
+
export { getLeftSideConfig, getLeftTopConfig, getCenterTopConfig, getOneColumnConfig };
|
@@ -0,0 +1,116 @@
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
2
|
+
import { IconPositionEnum } from "./types"; // left-aligned column with left side icon
|
3
|
+
|
4
|
+
var getLeftSideConfig = function getLeftSideConfig(count, index) {
|
5
|
+
var everySecondWithoutOffset = index % 2 ? '1' : undefined;
|
6
|
+
var columnSize = {
|
7
|
+
wide: '4',
|
8
|
+
desktop: '5',
|
9
|
+
tablet: '10'
|
10
|
+
};
|
11
|
+
|
12
|
+
switch (count) {
|
13
|
+
case 2:
|
14
|
+
case 4:
|
15
|
+
return _extends(_extends({}, columnSize), {
|
16
|
+
leftOffsetWide: everySecondWithoutOffset,
|
17
|
+
leftOffsetDesktop: everySecondWithoutOffset
|
18
|
+
});
|
19
|
+
|
20
|
+
default:
|
21
|
+
return _extends(_extends({}, columnSize), {
|
22
|
+
leftOffsetDesktop: everySecondWithoutOffset
|
23
|
+
});
|
24
|
+
}
|
25
|
+
}; // left-aligned column with left-aligned icon on top
|
26
|
+
|
27
|
+
|
28
|
+
var getLeftTopConfig = function getLeftTopConfig(count, index) {
|
29
|
+
var everySecondWithoutOffset = index % 2 ? '1' : undefined;
|
30
|
+
var everyThirdWithoutOffset = index % 3 ? '1' : undefined;
|
31
|
+
|
32
|
+
switch (count) {
|
33
|
+
case 2:
|
34
|
+
return {
|
35
|
+
wide: '4',
|
36
|
+
desktop: '4',
|
37
|
+
tablet: '5',
|
38
|
+
leftOffsetWide: everySecondWithoutOffset,
|
39
|
+
leftOffsetDesktop: everySecondWithoutOffset,
|
40
|
+
leftOffsetTablet: everySecondWithoutOffset
|
41
|
+
};
|
42
|
+
|
43
|
+
case 4:
|
44
|
+
return {
|
45
|
+
wide: '3',
|
46
|
+
desktop: '4',
|
47
|
+
tablet: '5',
|
48
|
+
leftOffsetDesktop: everySecondWithoutOffset,
|
49
|
+
leftOffsetTablet: everySecondWithoutOffset
|
50
|
+
};
|
51
|
+
|
52
|
+
default:
|
53
|
+
return {
|
54
|
+
wide: '3',
|
55
|
+
desktop: '4',
|
56
|
+
tablet: '5',
|
57
|
+
leftOffsetWide: everyThirdWithoutOffset,
|
58
|
+
leftOffsetTablet: everySecondWithoutOffset
|
59
|
+
};
|
60
|
+
}
|
61
|
+
}; // center-aligned column with center-aligned icon on top
|
62
|
+
|
63
|
+
|
64
|
+
var getCenterTopConfig = function getCenterTopConfig(count, index) {
|
65
|
+
var isEvenIndex = !(index % 2);
|
66
|
+
var everyEvenWithLeftOffset = isEvenIndex ? '1' : undefined;
|
67
|
+
var everyOddWithRightOffset = isEvenIndex ? undefined : '1';
|
68
|
+
|
69
|
+
switch (count) {
|
70
|
+
case 4:
|
71
|
+
return {
|
72
|
+
wide: '3',
|
73
|
+
desktop: '5',
|
74
|
+
tablet: '5',
|
75
|
+
leftOffsetDesktop: everyEvenWithLeftOffset,
|
76
|
+
leftOffsetTablet: everyEvenWithLeftOffset,
|
77
|
+
rightOffsetTablet: everyOddWithRightOffset,
|
78
|
+
rightOffsetDesktop: everyOddWithRightOffset
|
79
|
+
};
|
80
|
+
|
81
|
+
default:
|
82
|
+
return {
|
83
|
+
wide: '4',
|
84
|
+
desktop: '4',
|
85
|
+
tablet: '4'
|
86
|
+
};
|
87
|
+
}
|
88
|
+
};
|
89
|
+
|
90
|
+
var getOneColumnConfig = function getOneColumnConfig(iconPosition) {
|
91
|
+
return iconPosition !== IconPositionEnum.CENTER_TOP ? {
|
92
|
+
wide: '10',
|
93
|
+
desktop: '10',
|
94
|
+
tablet: '10'
|
95
|
+
} : {
|
96
|
+
wide: '12',
|
97
|
+
desktop: '12',
|
98
|
+
tablet: '12'
|
99
|
+
};
|
100
|
+
};
|
101
|
+
|
102
|
+
var getMultiColumnConfig = function getMultiColumnConfig(iconPosition, count, index) {
|
103
|
+
switch (iconPosition) {
|
104
|
+
case IconPositionEnum.LEFT_TOP:
|
105
|
+
return getLeftTopConfig(count, index);
|
106
|
+
|
107
|
+
case IconPositionEnum.CENTER_TOP:
|
108
|
+
return getCenterTopConfig(count, index);
|
109
|
+
|
110
|
+
default:
|
111
|
+
return getLeftSideConfig(count, index);
|
112
|
+
}
|
113
|
+
};
|
114
|
+
|
115
|
+
export default getMultiColumnConfig;
|
116
|
+
export { getLeftSideConfig, getLeftTopConfig, getCenterTopConfig, getOneColumnConfig };
|
@@ -25,6 +25,7 @@ var getMediaStyle = function getMediaStyle(imageUrl) {
|
|
25
25
|
};
|
26
26
|
|
27
27
|
var cn = cnCreate('mfui-button-banner');
|
28
|
+
var testIdPrefix = 'ButtonBanner';
|
28
29
|
|
29
30
|
var ButtonBanner = function ButtonBanner(_ref) {
|
30
31
|
var dataAttrs = _ref.dataAttrs,
|
@@ -74,7 +75,8 @@ var ButtonBanner = function ButtonBanner(_ref) {
|
|
74
75
|
leftOffsetDesktop: "1",
|
75
76
|
leftOffsetWide: "1"
|
76
77
|
}, /*#__PURE__*/React.createElement("div", {
|
77
|
-
className: cn('content')
|
78
|
+
className: cn('content'),
|
79
|
+
"data-testid": "".concat(testIdPrefix, "-content")
|
78
80
|
}, /*#__PURE__*/React.createElement(Header, {
|
79
81
|
className: cn('header'),
|
80
82
|
as: "h2"
|
@@ -85,7 +87,8 @@ var ButtonBanner = function ButtonBanner(_ref) {
|
|
85
87
|
mobile: "12"
|
86
88
|
}, /*#__PURE__*/React.createElement("div", {
|
87
89
|
className: cn('media'),
|
88
|
-
style: getMediaStyle(imageUrl)
|
90
|
+
style: getMediaStyle(imageUrl),
|
91
|
+
"data-testid": "".concat(testIdPrefix, "-media")
|
89
92
|
}, !imageUrl && buttonElem))));
|
90
93
|
};
|
91
94
|
|
@@ -45,7 +45,7 @@ var DownloadLink = function DownloadLink(_ref) {
|
|
45
45
|
className: cn('link', [classes.link])
|
46
46
|
}, text), /*#__PURE__*/React.createElement("p", {
|
47
47
|
className: cn('info')
|
48
|
-
}, "".concat(extension).concat(extension && fileSize ? ',' : ''
|
48
|
+
}, "".concat(extension).concat(extension && fileSize ? ', ' : '').concat(fileSize))));
|
49
49
|
};
|
50
50
|
|
51
51
|
DownloadLink.propTypes = {
|
@@ -1,6 +1,16 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
+
import { GridColumn } from '@megafon/ui-core';
|
2
3
|
import './DownloadLinks.less';
|
3
4
|
import { IDownloadLink } from './DownloadLink';
|
5
|
+
declare type GridColumnType = React.ComponentProps<typeof GridColumn>;
|
6
|
+
declare type ColumnConfig = {
|
7
|
+
wide?: GridColumnType['wide'];
|
8
|
+
desktop?: GridColumnType['desktop'];
|
9
|
+
tablet?: GridColumnType['tablet'];
|
10
|
+
mobile?: GridColumnType['mobile'];
|
11
|
+
all?: GridColumnType['all'];
|
12
|
+
};
|
13
|
+
export declare const getColumnConfig: (itemsCount: number) => ColumnConfig;
|
4
14
|
interface IDownloadLinks {
|
5
15
|
/** Выстраивать ссылки в одну колонку вне зависимости от количества */
|
6
16
|
inOneColumn?: boolean;
|
@@ -5,8 +5,7 @@ import { Grid, GridColumn } from '@megafon/ui-core';
|
|
5
5
|
import { cnCreate } from '@megafon/ui-helpers';
|
6
6
|
import * as PropTypes from 'prop-types';
|
7
7
|
import "./DownloadLinks.css";
|
8
|
-
|
9
|
-
var getColumnConfig = function getColumnConfig(itemsCount) {
|
8
|
+
export var getColumnConfig = function getColumnConfig(itemsCount) {
|
10
9
|
switch (true) {
|
11
10
|
case itemsCount <= 2:
|
12
11
|
{
|
@@ -35,7 +34,7 @@ var getColumnConfig = function getColumnConfig(itemsCount) {
|
|
35
34
|
}
|
36
35
|
}
|
37
36
|
};
|
38
|
-
|
37
|
+
var testIdPrefix = 'DownloadLinks';
|
39
38
|
var cn = cnCreate('mfui-download-links');
|
40
39
|
|
41
40
|
var DownloadLinks = function DownloadLinks(_ref) {
|
@@ -45,7 +44,8 @@ var DownloadLinks = function DownloadLinks(_ref) {
|
|
45
44
|
|
46
45
|
if (inOneColumn) {
|
47
46
|
return /*#__PURE__*/React.createElement("div", {
|
48
|
-
className: cn()
|
47
|
+
className: cn(),
|
48
|
+
"data-testid": "".concat(testIdPrefix, "-oneColumn")
|
49
49
|
}, React.Children.map(children, function (child) {
|
50
50
|
return /*#__PURE__*/React.createElement("div", {
|
51
51
|
className: cn('item')
|
@@ -28,6 +28,7 @@ export var pictureMaskTypes = {
|
|
28
28
|
IPHONE_12: 'iphone-12',
|
29
29
|
NONE: 'none'
|
30
30
|
};
|
31
|
+
var testIdPrefix = 'Instructions';
|
31
32
|
var cn = cnCreate('mfui-instructions');
|
32
33
|
var swiperSlideCn = cn('slide');
|
33
34
|
|
@@ -143,7 +144,8 @@ var Instructions = function Instructions(_ref) {
|
|
143
144
|
}
|
144
145
|
|
145
146
|
return /*#__PURE__*/React.createElement("div", {
|
146
|
-
className: cn('img-wrapper')
|
147
|
+
className: cn('img-wrapper'),
|
148
|
+
"data-testid": "".concat(testIdPrefix, "-img-wrapper")
|
147
149
|
}, /*#__PURE__*/React.createElement("div", {
|
148
150
|
className: cn('device-screen')
|
149
151
|
}), renderSlider());
|
@@ -153,7 +155,8 @@ var Instructions = function Instructions(_ref) {
|
|
153
155
|
className: cn('articles-list', {
|
154
156
|
'text-after': !!text,
|
155
157
|
desktop: true
|
156
|
-
})
|
158
|
+
}),
|
159
|
+
"data-testid": "".concat(testIdPrefix, "-articles-list-desktop")
|
157
160
|
}, instructionItems.map(function (_ref4, i) {
|
158
161
|
var itemTitle = _ref4.title;
|
159
162
|
return (
|
@@ -180,7 +183,8 @@ var Instructions = function Instructions(_ref) {
|
|
180
183
|
return /*#__PURE__*/React.createElement("div", {
|
181
184
|
className: cn('articles-list', {
|
182
185
|
mobile: true
|
183
|
-
})
|
186
|
+
}),
|
187
|
+
"data-testid": "".concat(testIdPrefix, "-articles-list-mobile")
|
184
188
|
}, /*#__PURE__*/React.createElement("div", {
|
185
189
|
className: cn('articles-title-block')
|
186
190
|
}, instructionItems.map(function (_ref5, i) {
|
@@ -194,7 +198,8 @@ var Instructions = function Instructions(_ref) {
|
|
194
198
|
})), /*#__PURE__*/React.createElement("ul", {
|
195
199
|
className: cn('articles-dots', {
|
196
200
|
'text-after': !!text
|
197
|
-
})
|
201
|
+
}),
|
202
|
+
"data-testid": "".concat(testIdPrefix, "-articles-dots-mobile")
|
198
203
|
}, instructionItems.map(function (_item, i) {
|
199
204
|
return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.item, i + 1), {
|
200
205
|
key: i,
|
@@ -222,7 +227,8 @@ var Instructions = function Instructions(_ref) {
|
|
222
227
|
className: cn('picture', {
|
223
228
|
align: pictureAlign,
|
224
229
|
'vertical-align': pictureVerticalAlign
|
225
|
-
})
|
230
|
+
}),
|
231
|
+
"data-testid": "".concat(testIdPrefix, "-picture")
|
226
232
|
}, renderPicture()), /*#__PURE__*/React.createElement("div", {
|
227
233
|
className: cn('articles', {
|
228
234
|
align: pictureAlign
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import './PageTitle.less';
|
3
3
|
import { Props as BreadcrumbsType } from '../Breadcrumbs/Breadcrumbs';
|
4
|
-
declare type
|
4
|
+
export declare type PageTitleProps = {
|
5
5
|
/** Дополнительные data атрибуты к внутренним элементам */
|
6
6
|
dataAttrs?: {
|
7
7
|
root?: Record<string, string>;
|
@@ -27,5 +27,5 @@ declare type Props = {
|
|
27
27
|
/** Ссылка на корневой элемент */
|
28
28
|
rootRef?: React.RefObject<HTMLDivElement>;
|
29
29
|
};
|
30
|
-
declare const PageTitle: React.FC<
|
30
|
+
declare const PageTitle: React.FC<PageTitleProps>;
|
31
31
|
export default PageTitle;
|
@@ -5,6 +5,7 @@ import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
|
5
5
|
import PropTypes from 'prop-types';
|
6
6
|
import "./PageTitle.css";
|
7
7
|
import Breadcrumbs from "../Breadcrumbs/Breadcrumbs";
|
8
|
+
var testIdPrefix = 'PageTitle';
|
8
9
|
var cn = cnCreate('mfui-page-title');
|
9
10
|
|
10
11
|
var PageTitle = function PageTitle(_ref) {
|
@@ -34,7 +35,13 @@ var PageTitle = function PageTitle(_ref) {
|
|
34
35
|
}, title));
|
35
36
|
}, [badge, title, isBreadcrumbs]);
|
36
37
|
var renderPageTitleWithGrid = React.useCallback(function () {
|
37
|
-
return /*#__PURE__*/React.createElement(Grid,
|
38
|
+
return /*#__PURE__*/React.createElement(Grid, {
|
39
|
+
dataAttrs: {
|
40
|
+
root: {
|
41
|
+
'data-testid': "".concat(testIdPrefix, "-grid")
|
42
|
+
}
|
43
|
+
}
|
44
|
+
}, /*#__PURE__*/React.createElement(GridColumn, {
|
38
45
|
wide: "8",
|
39
46
|
desktop: "10",
|
40
47
|
tablet: "12",
|
@@ -21,6 +21,7 @@ var slidesSettings = (_slidesSettings = {}, _defineProperty(_slidesSettings, bre
|
|
21
21
|
slidesPerView: 4,
|
22
22
|
spaceBetween: 20
|
23
23
|
}), _slidesSettings);
|
24
|
+
var testIdPrefix = 'Partners';
|
24
25
|
var cn = cnCreate('mfui-partners');
|
25
26
|
|
26
27
|
var Partners = function Partners(_ref) {
|
@@ -56,7 +57,8 @@ var Partners = function Partners(_ref) {
|
|
56
57
|
root: _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.item, index + 1))
|
57
58
|
}
|
58
59
|
}, /*#__PURE__*/React.createElement("div", {
|
59
|
-
className: cn('tile-inner', [itemClass])
|
60
|
+
className: cn('tile-inner', [itemClass]),
|
61
|
+
"data-testid": "".concat(testIdPrefix, "-tile-inner")
|
60
62
|
}, /*#__PURE__*/React.createElement("div", {
|
61
63
|
className: cn('img-wrapper')
|
62
64
|
}, /*#__PURE__*/React.createElement("img", {
|
@@ -85,7 +87,15 @@ var Partners = function Partners(_ref) {
|
|
85
87
|
slidesSettings: slidesSettings,
|
86
88
|
onChange: onChange,
|
87
89
|
onNextClick: onNextClick,
|
88
|
-
onPrevClick: onPrevClick
|
90
|
+
onPrevClick: onPrevClick,
|
91
|
+
dataAttrs: {
|
92
|
+
prev: {
|
93
|
+
'data-testid': "".concat(testIdPrefix, "-prev")
|
94
|
+
},
|
95
|
+
next: {
|
96
|
+
'data-testid': "".concat(testIdPrefix, "-next")
|
97
|
+
}
|
98
|
+
}
|
89
99
|
}, topRow.map(function (item, i) {
|
90
100
|
return /*#__PURE__*/React.createElement("div", {
|
91
101
|
key: i + item.src,
|
@@ -7,6 +7,7 @@ export var pictureAlignTypes = {
|
|
7
7
|
LEFT: 'left',
|
8
8
|
RIGHT: 'right'
|
9
9
|
};
|
10
|
+
var testIdPrefix = 'PictureWithDescription';
|
10
11
|
var cn = cnCreate('mfui-picture-with-description');
|
11
12
|
|
12
13
|
var PictureWithDescription = function PictureWithDescription(_ref) {
|
@@ -27,7 +28,8 @@ var PictureWithDescription = function PictureWithDescription(_ref) {
|
|
27
28
|
}, /*#__PURE__*/React.createElement("div", {
|
28
29
|
className: cn('picture', {
|
29
30
|
align: pictureAlign
|
30
|
-
})
|
31
|
+
}),
|
32
|
+
"data-testid": "".concat(testIdPrefix, "-picture")
|
31
33
|
}, /*#__PURE__*/React.createElement("img", {
|
32
34
|
className: cn('img'),
|
33
35
|
src: pictureUrl,
|
@@ -36,7 +38,8 @@ var PictureWithDescription = function PictureWithDescription(_ref) {
|
|
36
38
|
className: cn('articles', {
|
37
39
|
align: pictureAlign,
|
38
40
|
'text-top-align': isTextTopAlign
|
39
|
-
})
|
41
|
+
}),
|
42
|
+
"data-testid": "".concat(testIdPrefix, "-articles")
|
40
43
|
}, !!title && /*#__PURE__*/React.createElement(Header, {
|
41
44
|
className: cn('title', [classes.title]),
|
42
45
|
as: "h2"
|
@@ -98,7 +98,7 @@ var Property = function Property(_ref) {
|
|
98
98
|
"data-testid": "".concat(testIdPrefix, "-value")
|
99
99
|
}, /*#__PURE__*/React.createElement("div", {
|
100
100
|
className: cn('value')
|
101
|
-
}, convert(value, {})), valueUnit && /*#__PURE__*/React.createElement(Caption, {
|
101
|
+
}, typeof value === 'string' ? convert(value, {}) : value), valueUnit && /*#__PURE__*/React.createElement(Caption, {
|
102
102
|
className: cn('value-unit'),
|
103
103
|
hasMargin: false
|
104
104
|
}, convert(valueUnit, {})));
|
@@ -157,7 +157,7 @@ Property.propTypes = {
|
|
157
157
|
value: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.node)]).isRequired,
|
158
158
|
isCollapsible: PropTypes.bool
|
159
159
|
})),
|
160
|
-
value: PropTypes.string,
|
160
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
161
161
|
titleSize: PropTypes.oneOf(['default', 'big']),
|
162
162
|
valueUnit: PropTypes.string,
|
163
163
|
valueFrameColor: PropTypes.oneOf(['none', 'default', 'gray'])
|
@@ -14,7 +14,7 @@ export declare type Item = {
|
|
14
14
|
title?: string[] | React.ReactNode[];
|
15
15
|
titleSize?: 'default' | 'big';
|
16
16
|
description?: Desc[];
|
17
|
-
value?: string;
|
17
|
+
value?: string | React.ReactNode;
|
18
18
|
valueUnit?: string;
|
19
19
|
valueFrameColor?: 'none' | 'default' | 'gray';
|
20
20
|
};
|
@@ -19,6 +19,7 @@ export var DeviceMask = {
|
|
19
19
|
NEW_IPHONE: 'new-iphone',
|
20
20
|
WHITE_IPHONE: 'white-iphone'
|
21
21
|
};
|
22
|
+
var testIdPrefix = 'StoreBanner';
|
22
23
|
var cn = cnCreate('mfui-store-banner');
|
23
24
|
|
24
25
|
var StoreBanner = function StoreBanner(_ref) {
|
@@ -90,9 +91,11 @@ var StoreBanner = function StoreBanner(_ref) {
|
|
90
91
|
}, !linkButton && qrCode && /*#__PURE__*/React.createElement("img", {
|
91
92
|
src: qrCode,
|
92
93
|
className: cn('qr-code'),
|
93
|
-
alt: "QR-\u043A\u043E\u0434"
|
94
|
+
alt: "QR-\u043A\u043E\u0434",
|
95
|
+
"data-testid": "".concat(testIdPrefix, "-qrCode")
|
94
96
|
}), !linkButton && /*#__PURE__*/React.createElement("div", {
|
95
|
-
className: cn('stores')
|
97
|
+
className: cn('stores'),
|
98
|
+
"data-testid": "".concat(testIdPrefix, "-stores")
|
96
99
|
}, linkApple && /*#__PURE__*/React.createElement(StoreButton, {
|
97
100
|
dataAttrs: {
|
98
101
|
root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.linkApple
|
@@ -40,7 +40,7 @@ h5 {
|
|
40
40
|
overflow: auto;
|
41
41
|
}
|
42
42
|
@media screen and (min-width: 1024px) {
|
43
|
-
.mfui-
|
43
|
+
.mfui-table__scroll_limit {
|
44
44
|
max-height: 500px;
|
45
45
|
}
|
46
46
|
}
|
@@ -131,6 +131,15 @@ h5 {
|
|
131
131
|
.mfui-table__row:not(:last-child) .mfui-table__cell {
|
132
132
|
border-bottom: 1px solid var(--spbSky2);
|
133
133
|
}
|
134
|
+
.mfui-table__row_align_bottom .mfui-table__cell {
|
135
|
+
vertical-align: bottom;
|
136
|
+
}
|
137
|
+
.mfui-table__row_align_top .mfui-table__cell {
|
138
|
+
vertical-align: top;
|
139
|
+
}
|
140
|
+
.mfui-table__row_align_top.mfui-table__row_head .mfui-table__cell {
|
141
|
+
padding-top: 12px;
|
142
|
+
}
|
134
143
|
.mfui-table_min-cell-size_small .mfui-table__cell:not(:first-child) {
|
135
144
|
min-width: 72px;
|
136
145
|
}
|
@@ -8,6 +8,8 @@ export interface ITable {
|
|
8
8
|
fixColumn?: boolean;
|
9
9
|
/** Минимальный размер ячеек */
|
10
10
|
minCellSize?: 'small' | 'large';
|
11
|
+
/** Отключить ограничение по высоте при разрешении больше 1024px */
|
12
|
+
disableHeightLimit?: boolean;
|
11
13
|
children: Array<React.ReactElement<ITableRow>>;
|
12
14
|
}
|
13
15
|
declare const Table: React.FC<ITable>;
|