@megafon/ui-shared 3.0.0-beta.9 → 3.1.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 +48 -67
- package/README.md +2 -2
- package/dist/es/components/AccordionBox/AccordionBox.d.ts +5 -0
- package/dist/es/components/AccordionBox/AccordionBox.js +6 -1
- package/dist/es/components/BenefitsIcons/BenefitsIcons.js +1 -1
- package/dist/es/components/Breadcrumbs/Breadcrumbs.css +2 -2
- package/dist/es/components/Breadcrumbs/Breadcrumbs.d.ts +7 -2
- package/dist/es/components/Breadcrumbs/Breadcrumbs.js +48 -18
- package/dist/es/components/ButtonBanner/ButtonBanner.d.ts +1 -0
- package/dist/es/components/ButtonBanner/ButtonBanner.js +5 -1
- package/dist/es/components/ButtonLinkBox/ButtonLinkBox.d.ts +2 -0
- package/dist/es/components/ButtonLinkBox/ButtonLinkBox.js +9 -1
- package/dist/es/components/Card/Card.d.ts +4 -2
- package/dist/es/components/Card/Card.js +16 -6
- package/dist/es/components/Container/Container.css +163 -0
- package/dist/es/components/DownloadLinks/DownloadLink.css +1 -1
- package/dist/es/components/DownloadLinks/DownloadLink.d.ts +5 -0
- package/dist/es/components/DownloadLinks/DownloadLink.js +14 -6
- package/dist/es/components/Instructions/Instructions.d.ts +7 -0
- package/dist/es/components/Instructions/Instructions.js +55 -45
- package/dist/es/components/PageTitle/PageTitle.d.ts +6 -0
- package/dist/es/components/PageTitle/PageTitle.js +15 -4
- package/dist/es/components/Partners/Partners.d.ts +5 -4
- package/dist/es/components/Partners/Partners.js +15 -7
- package/dist/es/components/Property/Property.d.ts +3 -2
- package/dist/es/components/Property/Property.js +9 -3
- package/dist/es/components/Property/PropertyDescription.js +11 -5
- package/dist/es/components/Property/types.d.ts +3 -0
- package/dist/es/components/StoreBanner/StoreBanner.css +21 -22
- package/dist/es/components/StoreBanner/StoreBanner.d.ts +4 -0
- package/dist/es/components/StoreBanner/StoreBanner.js +19 -4
- package/dist/es/components/StoreBanner/doc/img/qr-code.png +0 -0
- package/dist/es/components/StoreButton/StoreButton.d.ts +1 -1
- package/dist/es/components/StoreButton/StoreButton.js +26 -7
- package/dist/es/components/Table/Table.css +1 -1
- package/dist/es/components/TextBox/TextBox.css +9 -0
- package/dist/es/components/TextWithIcon/TextWithIcon.css +15 -0
- package/dist/es/components/TextWithIcon/TextWithIcon.d.ts +19 -0
- package/dist/es/components/TextWithIcon/TextWithIcon.js +40 -0
- package/dist/es/components/TextWithIcon/TextWithIconItem.css +49 -0
- package/dist/es/components/TextWithIcon/TextWithIconItem.d.ts +18 -0
- package/dist/es/components/TextWithIcon/TextWithIconItem.js +35 -0
- package/dist/es/components/VideoBanner/VideoBanner.d.ts +7 -2
- package/dist/es/components/VideoBanner/VideoBanner.js +21 -5
- package/dist/es/components/VideoBlock/VideoBlock.d.ts +4 -3
- package/dist/es/components/VideoBlock/VideoBlock.js +12 -6
- package/dist/es/index.d.ts +2 -0
- package/dist/es/index.js +2 -0
- package/dist/lib/components/AccordionBox/AccordionBox.d.ts +5 -0
- package/dist/lib/components/AccordionBox/AccordionBox.js +6 -1
- package/dist/lib/components/BenefitsIcons/BenefitsIcons.js +1 -1
- package/dist/lib/components/Breadcrumbs/Breadcrumbs.css +2 -2
- package/dist/lib/components/Breadcrumbs/Breadcrumbs.d.ts +7 -2
- package/dist/lib/components/Breadcrumbs/Breadcrumbs.js +49 -17
- package/dist/lib/components/ButtonBanner/ButtonBanner.d.ts +1 -0
- package/dist/lib/components/ButtonBanner/ButtonBanner.js +5 -1
- package/dist/lib/components/ButtonLinkBox/ButtonLinkBox.d.ts +2 -0
- package/dist/lib/components/ButtonLinkBox/ButtonLinkBox.js +9 -1
- package/dist/lib/components/Card/Card.d.ts +4 -2
- package/dist/lib/components/Card/Card.js +16 -6
- package/dist/lib/components/Container/Container.css +163 -0
- package/dist/lib/components/DownloadLinks/DownloadLink.css +1 -1
- package/dist/lib/components/DownloadLinks/DownloadLink.d.ts +5 -0
- package/dist/lib/components/DownloadLinks/DownloadLink.js +13 -5
- package/dist/lib/components/Instructions/Instructions.d.ts +7 -0
- package/dist/lib/components/Instructions/Instructions.js +55 -44
- package/dist/lib/components/PageTitle/PageTitle.d.ts +6 -0
- package/dist/lib/components/PageTitle/PageTitle.js +17 -5
- package/dist/lib/components/Partners/Partners.d.ts +5 -4
- package/dist/lib/components/Partners/Partners.js +15 -7
- package/dist/lib/components/Property/Property.d.ts +3 -2
- package/dist/lib/components/Property/Property.js +9 -3
- package/dist/lib/components/Property/PropertyDescription.js +11 -4
- package/dist/lib/components/Property/types.d.ts +3 -0
- package/dist/lib/components/StoreBanner/StoreBanner.css +21 -22
- package/dist/lib/components/StoreBanner/StoreBanner.d.ts +4 -0
- package/dist/lib/components/StoreBanner/StoreBanner.js +19 -4
- package/dist/lib/components/StoreBanner/doc/img/qr-code.png +0 -0
- package/dist/lib/components/StoreButton/StoreButton.d.ts +1 -1
- package/dist/lib/components/StoreButton/StoreButton.js +30 -9
- package/dist/lib/components/Table/Table.css +1 -1
- package/dist/lib/components/TextBox/TextBox.css +9 -0
- package/dist/lib/components/TextWithIcon/TextWithIcon.css +15 -0
- package/dist/lib/components/TextWithIcon/TextWithIcon.d.ts +19 -0
- package/dist/lib/components/TextWithIcon/TextWithIcon.js +60 -0
- package/dist/lib/components/TextWithIcon/TextWithIconItem.css +49 -0
- package/dist/lib/components/TextWithIcon/TextWithIconItem.d.ts +18 -0
- package/dist/lib/components/TextWithIcon/TextWithIconItem.js +54 -0
- package/dist/lib/components/VideoBanner/VideoBanner.d.ts +7 -2
- package/dist/lib/components/VideoBanner/VideoBanner.js +21 -5
- package/dist/lib/components/VideoBlock/VideoBlock.d.ts +4 -3
- package/dist/lib/components/VideoBlock/VideoBlock.js +12 -6
- package/dist/lib/index.d.ts +2 -0
- package/dist/lib/index.js +16 -0
- package/package.json +5 -5
@@ -344,6 +344,9 @@ h5 {
|
|
344
344
|
.mfui-container .mfui-title-description-box + .mfui-download-links {
|
345
345
|
margin-top: 32px;
|
346
346
|
}
|
347
|
+
.mfui-container .mfui-title-description-box + .mfui-text-with-icon {
|
348
|
+
margin-top: 24px;
|
349
|
+
}
|
347
350
|
@media screen and (min-width: 768px) and (max-width: 1023px) {
|
348
351
|
.mfui-container .mfui-title-description-box + .mfui-benefits-icons {
|
349
352
|
margin-top: 48px;
|
@@ -2230,6 +2233,9 @@ h5 {
|
|
2230
2233
|
.mfui-container .mfui-text-box + .mfui-download-links {
|
2231
2234
|
margin-top: 32px;
|
2232
2235
|
}
|
2236
|
+
.mfui-container .mfui-text-box + .mfui-text-with-icon {
|
2237
|
+
margin-top: 32px;
|
2238
|
+
}
|
2233
2239
|
@media screen and (min-width: 768px) and (max-width: 1023px) {
|
2234
2240
|
.mfui-container .mfui-text-box + .mfui-benefits-icons {
|
2235
2241
|
margin-top: 48px;
|
@@ -2869,6 +2875,163 @@ h5 {
|
|
2869
2875
|
.mfui-container .mfui-page-title + .mfui-button-link-box {
|
2870
2876
|
margin-top: 0 !important;
|
2871
2877
|
}
|
2878
|
+
.mfui-container .mfui-text-with-icon + .mfui-benefits-pictures {
|
2879
|
+
margin-top: 40px;
|
2880
|
+
}
|
2881
|
+
.mfui-container .mfui-text-with-icon + .mfui-cards-box {
|
2882
|
+
margin-top: 40px;
|
2883
|
+
}
|
2884
|
+
.mfui-container .mfui-text-with-icon + .mfui-carousel-box {
|
2885
|
+
margin-top: 40px;
|
2886
|
+
}
|
2887
|
+
.mfui-container .mfui-text-with-icon + .mfui-video-block {
|
2888
|
+
margin-top: 40px;
|
2889
|
+
}
|
2890
|
+
.mfui-container .mfui-text-with-icon + .mfui-tabs-box {
|
2891
|
+
margin-top: 40px;
|
2892
|
+
}
|
2893
|
+
.mfui-container .mfui-text-with-icon + .mfui-partners {
|
2894
|
+
margin-top: 40px;
|
2895
|
+
}
|
2896
|
+
.mfui-container .mfui-text-with-icon + .mfui-instructions {
|
2897
|
+
margin-top: 40px;
|
2898
|
+
}
|
2899
|
+
.mfui-container .mfui-text-with-icon + .mfui-property {
|
2900
|
+
margin-top: 40px;
|
2901
|
+
}
|
2902
|
+
.mfui-container .mfui-text-with-icon + .mfui-table {
|
2903
|
+
margin-top: 40px;
|
2904
|
+
}
|
2905
|
+
.mfui-container .mfui-text-with-icon + .mfui-accordion-box {
|
2906
|
+
margin-top: 40px;
|
2907
|
+
}
|
2908
|
+
.mfui-container .mfui-text-with-icon + .mfui-button-link-box {
|
2909
|
+
margin-top: 40px;
|
2910
|
+
}
|
2911
|
+
.mfui-container .mfui-text-with-icon + .mfui-download-links {
|
2912
|
+
margin-top: 40px;
|
2913
|
+
}
|
2914
|
+
.mfui-container .mfui-text-with-icon + .mfui-text-box {
|
2915
|
+
margin-top: 32px;
|
2916
|
+
}
|
2917
|
+
.mfui-container .mfui-text-with-icon + .mfui-picture-with-description {
|
2918
|
+
margin-top: 40px;
|
2919
|
+
}
|
2920
|
+
.mfui-container .mfui-text-with-icon + .mfui-store-banner {
|
2921
|
+
margin-top: 40px;
|
2922
|
+
}
|
2923
|
+
.mfui-container .mfui-text-with-icon + .mfui-button-banner {
|
2924
|
+
margin-top: 40px;
|
2925
|
+
}
|
2926
|
+
.mfui-container .mfui-text-with-icon + .mfui-steps {
|
2927
|
+
margin-top: 40px;
|
2928
|
+
}
|
2929
|
+
@media screen and (min-width: 768px) and (max-width: 1023px) {
|
2930
|
+
.mfui-container .mfui-text-with-icon + .mfui-benefits-pictures {
|
2931
|
+
margin-top: 48px;
|
2932
|
+
}
|
2933
|
+
.mfui-container .mfui-text-with-icon + .mfui-cards-box {
|
2934
|
+
margin-top: 48px;
|
2935
|
+
}
|
2936
|
+
.mfui-container .mfui-text-with-icon + .mfui-carousel-box {
|
2937
|
+
margin-top: 48px;
|
2938
|
+
}
|
2939
|
+
.mfui-container .mfui-text-with-icon + .mfui-video-block {
|
2940
|
+
margin-top: 48px;
|
2941
|
+
}
|
2942
|
+
.mfui-container .mfui-text-with-icon + .mfui-tabs-box {
|
2943
|
+
margin-top: 48px;
|
2944
|
+
}
|
2945
|
+
.mfui-container .mfui-text-with-icon + .mfui-partners {
|
2946
|
+
margin-top: 48px;
|
2947
|
+
}
|
2948
|
+
.mfui-container .mfui-text-with-icon + .mfui-instructions {
|
2949
|
+
margin-top: 48px;
|
2950
|
+
}
|
2951
|
+
.mfui-container .mfui-text-with-icon + .mfui-property {
|
2952
|
+
margin-top: 48px;
|
2953
|
+
}
|
2954
|
+
.mfui-container .mfui-text-with-icon + .mfui-table {
|
2955
|
+
margin-top: 48px;
|
2956
|
+
}
|
2957
|
+
.mfui-container .mfui-text-with-icon + .mfui-accordion-box {
|
2958
|
+
margin-top: 48px;
|
2959
|
+
}
|
2960
|
+
.mfui-container .mfui-text-with-icon + .mfui-button-link-box {
|
2961
|
+
margin-top: 48px;
|
2962
|
+
}
|
2963
|
+
.mfui-container .mfui-text-with-icon + .mfui-download-links {
|
2964
|
+
margin-top: 48px;
|
2965
|
+
}
|
2966
|
+
.mfui-container .mfui-text-with-icon + .mfui-text-box {
|
2967
|
+
margin-top: 32px;
|
2968
|
+
}
|
2969
|
+
.mfui-container .mfui-text-with-icon + .mfui-picture-with-description {
|
2970
|
+
margin-top: 48px;
|
2971
|
+
}
|
2972
|
+
.mfui-container .mfui-text-with-icon + .mfui-store-banner {
|
2973
|
+
margin-top: 48px;
|
2974
|
+
}
|
2975
|
+
.mfui-container .mfui-text-with-icon + .mfui-button-banner {
|
2976
|
+
margin-top: 48px;
|
2977
|
+
}
|
2978
|
+
.mfui-container .mfui-text-with-icon + .mfui-steps {
|
2979
|
+
margin-top: 48px;
|
2980
|
+
}
|
2981
|
+
}
|
2982
|
+
@media screen and (min-width: 1024px) {
|
2983
|
+
.mfui-container .mfui-text-with-icon + .mfui-benefits-pictures {
|
2984
|
+
margin-top: 56px;
|
2985
|
+
}
|
2986
|
+
.mfui-container .mfui-text-with-icon + .mfui-cards-box {
|
2987
|
+
margin-top: 56px;
|
2988
|
+
}
|
2989
|
+
.mfui-container .mfui-text-with-icon + .mfui-carousel-box {
|
2990
|
+
margin-top: 56px;
|
2991
|
+
}
|
2992
|
+
.mfui-container .mfui-text-with-icon + .mfui-video-block {
|
2993
|
+
margin-top: 56px;
|
2994
|
+
}
|
2995
|
+
.mfui-container .mfui-text-with-icon + .mfui-tabs-box {
|
2996
|
+
margin-top: 56px;
|
2997
|
+
}
|
2998
|
+
.mfui-container .mfui-text-with-icon + .mfui-partners {
|
2999
|
+
margin-top: 56px;
|
3000
|
+
}
|
3001
|
+
.mfui-container .mfui-text-with-icon + .mfui-instructions {
|
3002
|
+
margin-top: 56px;
|
3003
|
+
}
|
3004
|
+
.mfui-container .mfui-text-with-icon + .mfui-property {
|
3005
|
+
margin-top: 56px;
|
3006
|
+
}
|
3007
|
+
.mfui-container .mfui-text-with-icon + .mfui-table {
|
3008
|
+
margin-top: 56px;
|
3009
|
+
}
|
3010
|
+
.mfui-container .mfui-text-with-icon + .mfui-accordion-box {
|
3011
|
+
margin-top: 56px;
|
3012
|
+
}
|
3013
|
+
.mfui-container .mfui-text-with-icon + .mfui-button-link-box {
|
3014
|
+
margin-top: 48px;
|
3015
|
+
}
|
3016
|
+
.mfui-container .mfui-text-with-icon + .mfui-download-links {
|
3017
|
+
margin-top: 48px;
|
3018
|
+
}
|
3019
|
+
.mfui-container .mfui-text-with-icon + .mfui-text-box {
|
3020
|
+
margin-top: 32px;
|
3021
|
+
}
|
3022
|
+
.mfui-container .mfui-text-with-icon + .mfui-picture-with-description {
|
3023
|
+
margin-top: 56px;
|
3024
|
+
}
|
3025
|
+
.mfui-container .mfui-text-with-icon + .mfui-store-banner {
|
3026
|
+
margin-top: 56px;
|
3027
|
+
}
|
3028
|
+
.mfui-container .mfui-text-with-icon + .mfui-button-banner {
|
3029
|
+
margin-top: 56px;
|
3030
|
+
}
|
3031
|
+
.mfui-container .mfui-text-with-icon + .mfui-steps {
|
3032
|
+
margin-top: 56px;
|
3033
|
+
}
|
3034
|
+
}
|
2872
3035
|
.mfui-container_disable-padding-top {
|
2873
3036
|
padding-top: 0 !important;
|
2874
3037
|
}
|
@@ -1,6 +1,11 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import './DownloadLink.less';
|
3
3
|
export interface IDownloadLink {
|
4
|
+
/** Дополнительные data атрибуты к внутренним элементам */
|
5
|
+
dataAttrs?: {
|
6
|
+
root?: Record<string, string>;
|
7
|
+
link?: Record<string, string>;
|
8
|
+
};
|
4
9
|
/** Ссылка на корневой элемент */
|
5
10
|
rootRef?: React.Ref<HTMLDivElement>;
|
6
11
|
/** Адресы ссылки */
|
@@ -3,7 +3,7 @@ import "core-js/modules/es.string.link";
|
|
3
3
|
import _extends from "@babel/runtime/helpers/extends";
|
4
4
|
import * as React from 'react';
|
5
5
|
import { TextLink } from '@megafon/ui-core';
|
6
|
-
import { cnCreate } from '@megafon/ui-helpers';
|
6
|
+
import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
7
7
|
import * as PropTypes from 'prop-types';
|
8
8
|
import "./DownloadLink.css";
|
9
9
|
|
@@ -26,25 +26,33 @@ var DownloadLink = function DownloadLink(_ref) {
|
|
26
26
|
className = _ref.className,
|
27
27
|
_ref$classes = _ref.classes,
|
28
28
|
classes = _ref$classes === void 0 ? {} : _ref$classes,
|
29
|
-
rootRef = _ref.rootRef
|
30
|
-
|
29
|
+
rootRef = _ref.rootRef,
|
30
|
+
dataAttrs = _ref.dataAttrs;
|
31
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
31
32
|
className: cn([className, classes.root]),
|
32
33
|
ref: rootRef
|
33
|
-
}, /*#__PURE__*/React.createElement("div", {
|
34
|
+
}), /*#__PURE__*/React.createElement("div", {
|
34
35
|
className: cn('icon')
|
35
36
|
}, /*#__PURE__*/React.createElement(DownloadIcon, {
|
36
37
|
className: cn('icon-svg')
|
37
38
|
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(TextLink, {
|
38
|
-
|
39
|
+
download: true,
|
39
40
|
href: href,
|
40
41
|
onClick: onClick,
|
41
|
-
|
42
|
+
dataAttrs: {
|
43
|
+
root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.link
|
44
|
+
},
|
45
|
+
className: cn('link', [classes.link])
|
42
46
|
}, text), /*#__PURE__*/React.createElement("p", {
|
43
47
|
className: cn('info')
|
44
48
|
}, "".concat(extension).concat(extension && fileSize ? ',' : '', " ").concat(fileSize))));
|
45
49
|
};
|
46
50
|
|
47
51
|
DownloadLink.propTypes = {
|
52
|
+
dataAttrs: PropTypes.shape({
|
53
|
+
root: PropTypes.objectOf(PropTypes.string.isRequired),
|
54
|
+
link: PropTypes.objectOf(PropTypes.string.isRequired)
|
55
|
+
}),
|
48
56
|
rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
|
49
57
|
current: PropTypes.elementType
|
50
58
|
}), PropTypes.any])]),
|
@@ -22,6 +22,13 @@ export declare type InstructionItemType = {
|
|
22
22
|
isVideo: boolean;
|
23
23
|
};
|
24
24
|
export interface IInstructionsProps {
|
25
|
+
/** Дополнительные data атрибуты к внутренним элементам */
|
26
|
+
dataAttrs?: {
|
27
|
+
root?: Record<string, string>;
|
28
|
+
item?: Record<string, string>;
|
29
|
+
image?: Record<string, string>;
|
30
|
+
mobileItemText?: Record<string, string>;
|
31
|
+
};
|
25
32
|
/** Ссылка на корневой элемент */
|
26
33
|
rootRef?: Ref<HTMLDivElement>;
|
27
34
|
/** Дополнительные классы для внутренних элементов */
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import "core-js/modules/es.array.map";
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
2
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
3
4
|
|
4
5
|
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
@@ -6,7 +7,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
6
7
|
/* eslint-disable jsx-a11y/click-events-have-key-events */
|
7
8
|
import React from 'react';
|
8
9
|
import { Grid, GridColumn, Header, Paragraph } from '@megafon/ui-core';
|
9
|
-
import { cnCreate } from '@megafon/ui-helpers';
|
10
|
+
import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
10
11
|
import convert from 'htmr';
|
11
12
|
import PropTypes from 'prop-types';
|
12
13
|
import { Swiper, SwiperSlide } from 'swiper/react';
|
@@ -28,7 +29,8 @@ var cn = cnCreate('mfui-instructions');
|
|
28
29
|
var swiperSlideCn = cn('slide');
|
29
30
|
|
30
31
|
var Instructions = function Instructions(_ref) {
|
31
|
-
var
|
32
|
+
var dataAttrs = _ref.dataAttrs,
|
33
|
+
rootRef = _ref.rootRef,
|
32
34
|
_ref$classes = _ref.classes;
|
33
35
|
_ref$classes = _ref$classes === void 0 ? {} : _ref$classes;
|
34
36
|
var instructionItem = _ref$classes.instructionItem,
|
@@ -75,36 +77,37 @@ var Instructions = function Instructions(_ref) {
|
|
75
77
|
swiperInstance && swiperInstance.slideTo(ind);
|
76
78
|
};
|
77
79
|
}, [swiperInstance]);
|
78
|
-
var renderVideo = React.useCallback(function (mediaUrl) {
|
79
|
-
return /*#__PURE__*/React.createElement("video", {
|
80
|
-
className: cn('swiper-img'),
|
81
|
-
autoPlay: true,
|
82
|
-
muted: true,
|
80
|
+
var renderVideo = React.useCallback(function (mediaUrl, index) {
|
81
|
+
return /*#__PURE__*/React.createElement("video", _extends({
|
83
82
|
loop: true,
|
84
|
-
|
85
|
-
|
83
|
+
muted: true,
|
84
|
+
autoPlay: true,
|
85
|
+
playsInline: true,
|
86
|
+
className: cn('swiper-img')
|
87
|
+
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.image, index + 1)), /*#__PURE__*/React.createElement("source", {
|
86
88
|
src: mediaUrl,
|
87
89
|
type: "video/mp4"
|
88
90
|
}));
|
89
|
-
}, []);
|
91
|
+
}, [dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.image]);
|
90
92
|
var renderSlider = React.useCallback(function () {
|
91
93
|
return /*#__PURE__*/React.createElement(Swiper, {
|
92
94
|
className: cn('swiper'),
|
93
95
|
onSwiper: getSwiperInstance,
|
94
96
|
noSwipingClass: swiperSlideCn
|
95
|
-
}, instructionItems.map(function (_ref2,
|
97
|
+
}, instructionItems.map(function (_ref2, i) {
|
96
98
|
var mediaUrl = _ref2.mediaUrl,
|
97
99
|
isVideo = _ref2.isVideo;
|
98
100
|
return /*#__PURE__*/React.createElement(SwiperSlide, {
|
99
101
|
className: swiperSlideCn,
|
100
|
-
key:
|
101
|
-
}, isVideo ? renderVideo(mediaUrl) : /*#__PURE__*/React.createElement("img", {
|
102
|
-
|
103
|
-
src: mediaUrl
|
104
|
-
|
105
|
-
|
102
|
+
key: i + mediaUrl
|
103
|
+
}, isVideo ? renderVideo(mediaUrl, i) : /*#__PURE__*/React.createElement("img", _extends({
|
104
|
+
alt: "",
|
105
|
+
src: mediaUrl
|
106
|
+
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.image, i + 1), {
|
107
|
+
className: cn('swiper-img', [instructionItemImg])
|
108
|
+
})));
|
106
109
|
}));
|
107
|
-
}, [getSwiperInstance, instructionItemImg, instructionItems, renderVideo]);
|
110
|
+
}, [getSwiperInstance, instructionItemImg, instructionItems, renderVideo, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.image]);
|
108
111
|
var renderTitle = React.useCallback(function (resolution) {
|
109
112
|
return /*#__PURE__*/React.createElement(Header, {
|
110
113
|
className: cn('title', {
|
@@ -136,28 +139,28 @@ var Instructions = function Instructions(_ref) {
|
|
136
139
|
'text-after': !!text,
|
137
140
|
desktop: true
|
138
141
|
})
|
139
|
-
}, instructionItems.map(function (_ref3,
|
142
|
+
}, instructionItems.map(function (_ref3, i) {
|
140
143
|
var itemTitle = _ref3.title;
|
141
144
|
return (
|
142
145
|
/*#__PURE__*/
|
143
146
|
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
|
144
|
-
React.createElement("li", {
|
147
|
+
React.createElement("li", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.item, i + 1), {
|
145
148
|
className: cn('articles-item', {
|
146
|
-
active: slideIndex ===
|
147
|
-
}, [getActiveCustomClass(
|
148
|
-
"data-index":
|
149
|
-
onClick: handleArticleClick(
|
150
|
-
key:
|
151
|
-
}, /*#__PURE__*/React.createElement("div", {
|
149
|
+
active: slideIndex === i
|
150
|
+
}, [getActiveCustomClass(i, slideIndex), instructionItem, desktopInstructionItem]),
|
151
|
+
"data-index": i,
|
152
|
+
onClick: handleArticleClick(i),
|
153
|
+
key: i
|
154
|
+
}), /*#__PURE__*/React.createElement("div", {
|
152
155
|
className: cn('articles-item-dot')
|
153
156
|
}, /*#__PURE__*/React.createElement("span", {
|
154
157
|
className: cn('articles-item-dot-number')
|
155
|
-
},
|
158
|
+
}, i + 1)), /*#__PURE__*/React.createElement("div", {
|
156
159
|
className: cn('articles-item-title', [desktopItemTitle])
|
157
160
|
}, itemTitle))
|
158
161
|
);
|
159
162
|
}));
|
160
|
-
}, [desktopInstructionItem, desktopItemTitle, getActiveCustomClass, handleArticleClick, instructionItem, instructionItems, slideIndex, text]);
|
163
|
+
}, [desktopInstructionItem, desktopItemTitle, getActiveCustomClass, handleArticleClick, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.item, instructionItem, instructionItems, slideIndex, text]);
|
161
164
|
var renderMobileArticles = React.useCallback(function () {
|
162
165
|
return /*#__PURE__*/React.createElement("div", {
|
163
166
|
className: cn('articles-list', {
|
@@ -165,35 +168,36 @@ var Instructions = function Instructions(_ref) {
|
|
165
168
|
})
|
166
169
|
}, /*#__PURE__*/React.createElement("div", {
|
167
170
|
className: cn('articles-title-block')
|
168
|
-
}, instructionItems.map(function (_ref4,
|
171
|
+
}, instructionItems.map(function (_ref4, i) {
|
169
172
|
var itemTitle = _ref4.title;
|
170
|
-
return slideIndex ===
|
171
|
-
|
172
|
-
"data-index":
|
173
|
-
|
174
|
-
|
173
|
+
return slideIndex === i && /*#__PURE__*/React.createElement("div", _extends({
|
174
|
+
key: i,
|
175
|
+
"data-index": i
|
176
|
+
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.mobileItemText, i + 1), {
|
177
|
+
className: cn('articles-title', [mobileItemTitle])
|
178
|
+
}), itemTitle);
|
175
179
|
})), /*#__PURE__*/React.createElement("ul", {
|
176
180
|
className: cn('articles-dots', {
|
177
181
|
'text-after': !!text
|
178
182
|
})
|
179
|
-
}, instructionItems.map(function (_item,
|
180
|
-
return /*#__PURE__*/React.createElement("div", {
|
181
|
-
key:
|
183
|
+
}, instructionItems.map(function (_item, i) {
|
184
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.item, i + 1), {
|
185
|
+
key: i,
|
182
186
|
className: cn('articles-dot', {
|
183
|
-
active: slideIndex ===
|
184
|
-
}, [getActiveCustomClass(
|
185
|
-
onClick: handleArticleClick(
|
186
|
-
}, /*#__PURE__*/React.createElement("span", {
|
187
|
+
active: slideIndex === i
|
188
|
+
}, [getActiveCustomClass(i, slideIndex), instructionItem, mobileInstructionItem]),
|
189
|
+
onClick: handleArticleClick(i)
|
190
|
+
}), /*#__PURE__*/React.createElement("span", {
|
187
191
|
className: cn('articles-dot-number')
|
188
|
-
},
|
192
|
+
}, i + 1));
|
189
193
|
})));
|
190
|
-
}, [getActiveCustomClass, handleArticleClick, instructionItem, instructionItems, mobileInstructionItem, mobileItemTitle, slideIndex, text]);
|
191
|
-
return /*#__PURE__*/React.createElement("div", {
|
194
|
+
}, [dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.mobileItemText, getActiveCustomClass, handleArticleClick, instructionItem, instructionItems, mobileInstructionItem, mobileItemTitle, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.item, slideIndex, text]);
|
195
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
192
196
|
className: cn({
|
193
197
|
mask: pictureMask
|
194
198
|
}),
|
195
199
|
ref: rootRef
|
196
|
-
}, /*#__PURE__*/React.createElement(Grid, {
|
200
|
+
}), /*#__PURE__*/React.createElement(Grid, {
|
197
201
|
hAlign: "center"
|
198
202
|
}, /*#__PURE__*/React.createElement(GridColumn, {
|
199
203
|
all: "12"
|
@@ -211,6 +215,12 @@ var Instructions = function Instructions(_ref) {
|
|
211
215
|
};
|
212
216
|
|
213
217
|
Instructions.propTypes = {
|
218
|
+
dataAttrs: PropTypes.shape({
|
219
|
+
root: PropTypes.objectOf(PropTypes.string.isRequired),
|
220
|
+
item: PropTypes.objectOf(PropTypes.string.isRequired),
|
221
|
+
image: PropTypes.objectOf(PropTypes.string.isRequired),
|
222
|
+
mobileItemText: PropTypes.objectOf(PropTypes.string.isRequired)
|
223
|
+
}),
|
214
224
|
rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
|
215
225
|
current: PropTypes.elementType
|
216
226
|
}), PropTypes.any])]),
|
@@ -2,6 +2,12 @@ import * as React from 'react';
|
|
2
2
|
import './PageTitle.less';
|
3
3
|
import { Props as BreadcrumbsType } from '../Breadcrumbs/Breadcrumbs';
|
4
4
|
declare type Props = {
|
5
|
+
/** Дополнительные data атрибуты к внутренним элементам */
|
6
|
+
dataAttrs?: {
|
7
|
+
root?: Record<string, string>;
|
8
|
+
breadcrumbs?: Record<string, string>;
|
9
|
+
breadcrumbsLink?: Record<string, string>;
|
10
|
+
};
|
5
11
|
/** Текст заголовка */
|
6
12
|
title: string | React.ReactNode | React.ReactNode[];
|
7
13
|
/** Хлебные крошки */
|
@@ -1,13 +1,15 @@
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
1
2
|
import * as React from 'react';
|
2
3
|
import { Header, Grid, GridColumn } from '@megafon/ui-core';
|
3
|
-
import { cnCreate } from '@megafon/ui-helpers';
|
4
|
+
import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
4
5
|
import PropTypes from 'prop-types';
|
5
6
|
import "./PageTitle.css";
|
6
7
|
import Breadcrumbs from "../Breadcrumbs/Breadcrumbs";
|
7
8
|
var cn = cnCreate('mfui-page-title');
|
8
9
|
|
9
10
|
var PageTitle = function PageTitle(_ref) {
|
10
|
-
var
|
11
|
+
var dataAttrs = _ref.dataAttrs,
|
12
|
+
title = _ref.title,
|
11
13
|
breadcrumbs = _ref.breadcrumbs,
|
12
14
|
badge = _ref.badge,
|
13
15
|
_ref$isFullWidth = _ref.isFullWidth,
|
@@ -37,16 +39,25 @@ var PageTitle = function PageTitle(_ref) {
|
|
37
39
|
mobile: "12"
|
38
40
|
}, renderPageTitle()));
|
39
41
|
}, [renderPageTitle]);
|
40
|
-
return /*#__PURE__*/React.createElement("div", {
|
42
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
41
43
|
className: cn([className]),
|
42
44
|
ref: rootRef
|
43
|
-
}, (breadcrumbs === null || breadcrumbs === void 0 ? void 0 : breadcrumbs.length) && /*#__PURE__*/React.createElement(Breadcrumbs, {
|
45
|
+
}), (breadcrumbs === null || breadcrumbs === void 0 ? void 0 : breadcrumbs.length) && /*#__PURE__*/React.createElement(Breadcrumbs, {
|
44
46
|
items: breadcrumbs,
|
47
|
+
dataAttrs: {
|
48
|
+
root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.breadcrumbs,
|
49
|
+
link: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.breadcrumbsLink
|
50
|
+
},
|
45
51
|
className: cn('breadcrumbs', [classes.breadcrumbs])
|
46
52
|
}), isFullWidth ? renderPageTitle() : renderPageTitleWithGrid());
|
47
53
|
};
|
48
54
|
|
49
55
|
PageTitle.propTypes = {
|
56
|
+
dataAttrs: PropTypes.shape({
|
57
|
+
root: PropTypes.objectOf(PropTypes.string.isRequired),
|
58
|
+
breadcrumbs: PropTypes.objectOf(PropTypes.string.isRequired),
|
59
|
+
breadcrumbsLink: PropTypes.objectOf(PropTypes.string.isRequired)
|
60
|
+
}),
|
50
61
|
title: PropTypes.oneOfType([PropTypes.string, PropTypes.node, PropTypes.arrayOf(PropTypes.node)]).isRequired,
|
51
62
|
breadcrumbs: PropTypes.arrayOf(PropTypes.shape({
|
52
63
|
title: PropTypes.string.isRequired,
|
@@ -6,6 +6,11 @@ export declare type ItemType = {
|
|
6
6
|
alt: string;
|
7
7
|
};
|
8
8
|
export interface IPartnersProps {
|
9
|
+
/** Дополнительные data атрибуты к внутренним элементам */
|
10
|
+
dataAttrs?: {
|
11
|
+
root?: Record<string, string>;
|
12
|
+
item?: Record<string, string>;
|
13
|
+
};
|
9
14
|
/** Ссылка на корневой элемент */
|
10
15
|
rootRef?: React.Ref<HTMLDivElement>;
|
11
16
|
/** Дополнительные классы для корневого и внутренних элементов */
|
@@ -13,10 +18,6 @@ export interface IPartnersProps {
|
|
13
18
|
root?: string;
|
14
19
|
itemClass?: string;
|
15
20
|
};
|
16
|
-
/** Дата атрибуты для корневого элемента */
|
17
|
-
dataAttrs?: {
|
18
|
-
[key: string]: string;
|
19
|
-
};
|
20
21
|
/** Дополнительный класс корневого элемента */
|
21
22
|
className?: string;
|
22
23
|
/** Список логотипов */
|
@@ -36,6 +36,8 @@ var Partners = function Partners(_ref) {
|
|
36
36
|
onNextClick = _ref.onNextClick,
|
37
37
|
onPrevClick = _ref.onPrevClick;
|
38
38
|
var renderItem = React.useCallback(function (item) {
|
39
|
+
var index = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
40
|
+
|
39
41
|
if (!item) {
|
40
42
|
return null;
|
41
43
|
}
|
@@ -44,10 +46,13 @@ var Partners = function Partners(_ref) {
|
|
44
46
|
href = item.href,
|
45
47
|
alt = item.alt;
|
46
48
|
return /*#__PURE__*/React.createElement(Tile, {
|
47
|
-
className: cn('tile'),
|
48
49
|
href: href,
|
49
50
|
shadowLevel: "low",
|
50
|
-
isInteractive: !!href
|
51
|
+
isInteractive: !!href,
|
52
|
+
className: cn('tile'),
|
53
|
+
dataAttrs: {
|
54
|
+
root: _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.item, index + 1))
|
55
|
+
}
|
51
56
|
}, /*#__PURE__*/React.createElement("div", {
|
52
57
|
className: cn('tile-inner', [itemClass])
|
53
58
|
}, /*#__PURE__*/React.createElement("div", {
|
@@ -57,7 +62,7 @@ var Partners = function Partners(_ref) {
|
|
57
62
|
alt: alt,
|
58
63
|
className: cn('tile-img')
|
59
64
|
}))));
|
60
|
-
}, [itemClass]);
|
65
|
+
}, [itemClass, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.item]);
|
61
66
|
var renderGrid = React.useCallback(function () {
|
62
67
|
return /*#__PURE__*/React.createElement(Grid, {
|
63
68
|
guttersLeft: "medium",
|
@@ -67,7 +72,7 @@ var Partners = function Partners(_ref) {
|
|
67
72
|
key: i + item.src,
|
68
73
|
all: "3",
|
69
74
|
mobile: "6"
|
70
|
-
}, renderItem(item));
|
75
|
+
}, renderItem(item, i));
|
71
76
|
}));
|
72
77
|
}, [items, renderItem]);
|
73
78
|
var renderCarousel = React.useCallback(function () {
|
@@ -83,13 +88,13 @@ var Partners = function Partners(_ref) {
|
|
83
88
|
return /*#__PURE__*/React.createElement("div", {
|
84
89
|
key: i + item.src,
|
85
90
|
className: cn('slide')
|
86
|
-
}, renderItem(item), renderItem(bottomRow[i]));
|
91
|
+
}, renderItem(item, i), renderItem(bottomRow[i], i));
|
87
92
|
}));
|
88
93
|
}, [items, onChange, onNextClick, onPrevClick, renderItem]);
|
89
94
|
return /*#__PURE__*/React.createElement("div", _extends({
|
90
95
|
ref: rootRef,
|
91
96
|
className: cn([root, className])
|
92
|
-
}, filterDataAttrs(dataAttrs)), items.length > MAX_GRID_ITEMS_LENGTH ? renderCarousel() : renderGrid());
|
97
|
+
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root)), items.length > MAX_GRID_ITEMS_LENGTH ? renderCarousel() : renderGrid());
|
93
98
|
};
|
94
99
|
|
95
100
|
Partners.propTypes = {
|
@@ -100,7 +105,10 @@ Partners.propTypes = {
|
|
100
105
|
root: PropTypes.string,
|
101
106
|
itemClass: PropTypes.string
|
102
107
|
}),
|
103
|
-
dataAttrs: PropTypes.
|
108
|
+
dataAttrs: PropTypes.shape({
|
109
|
+
root: PropTypes.objectOf(PropTypes.string.isRequired),
|
110
|
+
item: PropTypes.objectOf(PropTypes.string.isRequired)
|
111
|
+
}),
|
104
112
|
className: PropTypes.string,
|
105
113
|
items: PropTypes.arrayOf(PropTypes.shape({
|
106
114
|
href: PropTypes.string,
|
@@ -18,9 +18,10 @@ export interface IProperty {
|
|
18
18
|
icon?: React.ReactNode;
|
19
19
|
/** Растягивание компонента на всю доступную ширину */
|
20
20
|
fullWidth?: boolean;
|
21
|
-
/**
|
21
|
+
/** Дополнительные data атрибуты к внутренним элементам */
|
22
22
|
dataAttrs?: {
|
23
|
-
|
23
|
+
root?: Record<string, string>;
|
24
|
+
moreLink?: Record<string, string>;
|
24
25
|
};
|
25
26
|
/** Дополнительные классы для внутренних элементов */
|
26
27
|
classes?: {
|
@@ -47,13 +47,16 @@ var Property = function Property(_ref) {
|
|
47
47
|
}, /*#__PURE__*/React.createElement(PropertyDescription, {
|
48
48
|
value: value,
|
49
49
|
isCollapsible: isCollapsible,
|
50
|
+
dataAttrs: {
|
51
|
+
moreLink: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.moreLink
|
52
|
+
},
|
50
53
|
classes: {
|
51
54
|
open: classes.openedDescription,
|
52
55
|
toggle: classes.toggleDescription
|
53
56
|
}
|
54
57
|
}));
|
55
58
|
});
|
56
|
-
}, [classes.openedDescription, classes.toggleDescription]);
|
59
|
+
}, [classes.openedDescription, classes.toggleDescription, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.moreLink]);
|
57
60
|
var getColumnConfig = React.useCallback(function () {
|
58
61
|
return fullWidth ? {
|
59
62
|
all: '12'
|
@@ -69,7 +72,7 @@ var Property = function Property(_ref) {
|
|
69
72
|
'border-bottom': borderBottom
|
70
73
|
}, [className]),
|
71
74
|
ref: rootRef
|
72
|
-
}, filterDataAttrs(dataAttrs)), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(GridColumn, getColumnConfig(), /*#__PURE__*/React.createElement("div", {
|
75
|
+
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root)), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(GridColumn, getColumnConfig(), /*#__PURE__*/React.createElement("div", {
|
73
76
|
className: cn('wrapper')
|
74
77
|
}, badge && /*#__PURE__*/React.createElement("div", {
|
75
78
|
className: cn('badge-wrapper')
|
@@ -120,7 +123,10 @@ Property.propTypes = {
|
|
120
123
|
mergedValue: PropTypes.string,
|
121
124
|
icon: PropTypes.node,
|
122
125
|
fullWidth: PropTypes.bool,
|
123
|
-
dataAttrs: PropTypes.
|
126
|
+
dataAttrs: PropTypes.shape({
|
127
|
+
root: PropTypes.objectOf(PropTypes.string.isRequired),
|
128
|
+
moreLink: PropTypes.objectOf(PropTypes.string.isRequired)
|
129
|
+
}),
|
124
130
|
classes: PropTypes.shape({
|
125
131
|
title: PropTypes.string,
|
126
132
|
openedDescription: PropTypes.string,
|