@megafon/ui-shared 6.0.0-beta.5 → 6.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 +4043 -0
- package/dist/es/components/AccordionBox/AccordionBox.css +15 -1
- package/dist/es/components/AccordionBox/AccordionBox.d.ts +2 -2
- package/dist/es/components/AccordionBox/AccordionBox.js +49 -6
- package/dist/es/components/AudioPlayer/AudioPlayer.d.ts +2 -2
- package/dist/es/components/AudioPlayer/AudioPlayer.js +27 -11
- package/dist/es/components/AudioPlayer/AudioProgress.d.ts +1 -1
- package/dist/es/components/AudioPlayer/AudioProgress.js +22 -10
- package/dist/es/components/AudioPlayer/AudioRange.d.ts +1 -1
- package/dist/es/components/AudioPlayer/AudioRange.js +10 -8
- package/dist/es/components/AudioPlayer/AudioVolume.d.ts +1 -1
- package/dist/es/components/AudioPlayer/AudioVolume.js +12 -3
- package/dist/es/components/AudioPlayer/hooks/useTrackDuration.js +10 -4
- package/dist/es/components/AudioPlayer/style/AudioPlayer.css +58 -1
- package/dist/es/components/AudioPlayer/style/AudioProgress.css +35 -1
- package/dist/es/components/AudioPlayer/style/AudioRange.css +68 -1
- package/dist/es/components/AudioPlayer/style/AudioVolume.css +34 -1
- package/dist/es/components/AudioPlayer/timerFormatUtil.js +9 -1
- package/dist/es/components/BannerBox/BannerBox.d.ts +1 -1
- package/dist/es/components/BannerBox/BannerBox.js +12 -3
- package/dist/es/components/BenefitsIcons/BenefitsIcons.d.ts +1 -1
- package/dist/es/components/BenefitsIcons/BenefitsIcons.js +64 -23
- package/dist/es/components/BenefitsIcons/BenefitsIconsTile.d.ts +1 -1
- package/dist/es/components/BenefitsIcons/BenefitsIconsTile.js +36 -9
- package/dist/es/components/BenefitsIcons/helpers.d.ts +3 -3
- package/dist/es/components/BenefitsIcons/helpers.js +20 -6
- package/dist/es/components/BenefitsIcons/style/BenefitsIcons.css +38 -1
- package/dist/es/components/BenefitsIcons/style/BenefitsIconsTile.css +90 -1
- package/dist/es/components/BenefitsIcons/types.d.ts +5 -5
- package/dist/es/components/BenefitsPictures/BenefitsPictures.d.ts +1 -1
- package/dist/es/components/BenefitsPictures/BenefitsPictures.js +49 -19
- package/dist/es/components/BenefitsPictures/BenfitsPictures.css +43 -1
- package/dist/es/components/BenefitsPictures/helpers.d.ts +2 -2
- package/dist/es/components/BenefitsPictures/helpers.js +14 -0
- package/dist/es/components/BenefitsPictures/types.d.ts +3 -3
- package/dist/es/components/BenefitsPictures/types.js +0 -1
- package/dist/es/components/BlogBox/BlogBox.css +92 -0
- package/dist/es/components/BlogBox/BlogBox.d.ts +28 -0
- package/dist/es/components/BlogBox/BlogBox.js +101 -0
- package/dist/es/components/BlogBox/components/BlogBoxTile.css +197 -0
- package/dist/es/components/BlogBox/components/BlogBoxTile.d.ts +9 -0
- package/dist/es/components/BlogBox/components/BlogBoxTile.js +67 -0
- package/dist/es/components/BlogBox/types.d.ts +37 -0
- package/dist/es/components/BlogBox/types.js +0 -0
- package/dist/es/components/Breadcrumbs/Breadcrumbs.css +43 -1
- package/dist/es/components/Breadcrumbs/Breadcrumbs.d.ts +6 -6
- package/dist/es/components/Breadcrumbs/Breadcrumbs.js +39 -10
- package/dist/es/components/Breadcrumbs/components/BreadcrumbsItem.css +16 -1
- package/dist/es/components/Breadcrumbs/components/BreadcrumbsItem.d.ts +4 -4
- package/dist/es/components/Breadcrumbs/components/BreadcrumbsItem.js +36 -11
- package/dist/es/components/ButtonBanner/ButtonBanner.css +122 -1
- package/dist/es/components/ButtonBanner/ButtonBanner.d.ts +7 -7
- package/dist/es/components/ButtonBanner/ButtonBanner.js +53 -22
- package/dist/es/components/ButtonLinkBox/ButtonLinkBox.css +19 -1
- package/dist/es/components/ButtonLinkBox/ButtonLinkBox.d.ts +3 -3
- package/dist/es/components/ButtonLinkBox/ButtonLinkBox.js +51 -20
- package/dist/es/components/Card/Card.css +354 -1
- package/dist/es/components/Card/Card.d.ts +4 -4
- package/dist/es/components/Card/Card.js +115 -25
- package/dist/es/components/Card/types.d.ts +10 -10
- package/dist/es/components/Card/types.js +0 -1
- package/dist/es/components/CardsBox/CardsBox.js +14 -3
- package/dist/es/components/CardsBox/helpers.d.ts +2 -2
- package/dist/es/components/CardsBox/helpers.js +4 -0
- package/dist/es/components/CarouselBox/CarouselBox.d.ts +2 -2
- package/dist/es/components/CarouselBox/CarouselBox.js +24 -11
- package/dist/es/components/Container/Container.css +3287 -1
- package/dist/es/components/Container/Container.d.ts +5 -7
- package/dist/es/components/Container/Container.js +25 -10
- package/dist/es/components/DownloadLinks/DownloadLink.css +37 -1
- package/dist/es/components/DownloadLinks/DownloadLink.d.ts +1 -1
- package/dist/es/components/DownloadLinks/DownloadLink.js +44 -13
- package/dist/es/components/DownloadLinks/DownloadLinks.css +36 -1
- package/dist/es/components/DownloadLinks/DownloadLinks.d.ts +3 -3
- package/dist/es/components/DownloadLinks/DownloadLinks.js +13 -2
- package/dist/es/components/FaqWrapper/FaqWrapper.d.ts +2 -5
- package/dist/es/components/FaqWrapper/FaqWrapper.js +3 -1
- package/dist/es/components/ImageBanner/ImageBanner.css +252 -1
- package/dist/es/components/ImageBanner/ImageBanner.d.ts +7 -8
- package/dist/es/components/ImageBanner/ImageBanner.js +88 -37
- package/dist/es/components/Instructions/Instructions.css +827 -1
- package/dist/es/components/Instructions/Instructions.d.ts +13 -11
- package/dist/es/components/Instructions/Instructions.js +101 -44
- package/dist/es/components/NotificationBox/NotificationBox.d.ts +4 -4
- package/dist/es/components/NotificationBox/NotificationBox.js +19 -5
- package/dist/es/components/NotificationBox/style/NotificationBox.css +28 -0
- package/dist/es/components/PageTitle/PageTitle.css +80 -1
- package/dist/es/components/PageTitle/PageTitle.d.ts +2 -2
- package/dist/es/components/PageTitle/PageTitle.js +37 -12
- package/dist/es/components/Partners/Partners.css +53 -1
- package/dist/es/components/Partners/Partners.d.ts +2 -2
- package/dist/es/components/Partners/Partners.js +48 -17
- package/dist/es/components/PictureWithDescription/PictureWithDescription.css +80 -1
- package/dist/es/components/PictureWithDescription/PictureWithDescription.d.ts +2 -4
- package/dist/es/components/PictureWithDescription/PictureWithDescription.js +28 -10
- package/dist/es/components/Property/Property.css +156 -1
- package/dist/es/components/Property/Property.d.ts +4 -4
- package/dist/es/components/Property/Property.js +81 -37
- package/dist/es/components/Property/PropertyDescription.css +17 -1
- package/dist/es/components/Property/PropertyDescription.d.ts +3 -3
- package/dist/es/components/Property/PropertyDescription.js +28 -8
- package/dist/es/components/Property/types.d.ts +5 -7
- package/dist/es/components/Property/types.js +0 -1
- package/dist/es/components/Steps/Steps.css +41 -1
- package/dist/es/components/Steps/Steps.d.ts +1 -2
- package/dist/es/components/Steps/Steps.js +19 -4
- package/dist/es/components/Steps/StepsItem.css +42 -1
- package/dist/es/components/Steps/StepsItem.d.ts +2 -2
- package/dist/es/components/Steps/StepsItem.js +9 -2
- package/dist/es/components/StoreBanner/StoreBanner.css +346 -1
- package/dist/es/components/StoreBanner/StoreBanner.d.ts +5 -5
- package/dist/es/components/StoreBanner/StoreBanner.js +97 -41
- package/dist/es/components/StoreBanner/doc/img/android-screen.png +0 -0
- package/dist/es/components/StoreBanner/doc/img/qr-code.png +0 -0
- package/dist/es/components/StoreBanner/doc/img/screen.png +0 -0
- package/dist/es/components/StoreButton/StoreButton.css +327 -1
- package/dist/es/components/StoreButton/StoreButton.d.ts +3 -3
- package/dist/es/components/StoreButton/StoreButton.js +44 -13
- package/dist/es/components/Table/Table.css +157 -1
- package/dist/es/components/Table/Table.d.ts +1 -1
- package/dist/es/components/Table/Table.js +51 -31
- package/dist/es/components/Table/TableCell.js +6 -0
- package/dist/es/components/Table/TableRow.js +10 -1
- package/dist/es/components/TabsBox/TabsBox.d.ts +1 -1
- package/dist/es/components/TabsBox/TabsBox.js +13 -4
- package/dist/es/components/TextBox/TextBox.css +25 -1
- package/dist/es/components/TextBox/TextBox.d.ts +1 -2
- package/dist/es/components/TextBox/TextBox.js +23 -8
- package/dist/es/components/TextBox/TextBoxPicture.css +27 -1
- package/dist/es/components/TextBox/TextBoxPicture.d.ts +2 -2
- package/dist/es/components/TextBox/TextBoxPicture.js +14 -5
- package/dist/es/components/TextWithIcon/TextWithIcon.css +10 -1
- package/dist/es/components/TextWithIcon/TextWithIcon.d.ts +1 -1
- package/dist/es/components/TextWithIcon/TextWithIcon.js +24 -6
- package/dist/es/components/TextWithIcon/TextWithIconItem.css +29 -1
- package/dist/es/components/TextWithIcon/TextWithIconItem.d.ts +1 -1
- package/dist/es/components/TextWithIcon/TextWithIconItem.js +21 -6
- package/dist/es/components/TitleDescriptionBox/TitleDescriptionBox.css +31 -1
- package/dist/es/components/TitleDescriptionBox/TitleDescriptionBox.d.ts +1 -1
- package/dist/es/components/TitleDescriptionBox/TitleDescriptionBox.js +23 -6
- package/dist/es/components/VideoBanner/VideoBanner.css +225 -1
- package/dist/es/components/VideoBanner/VideoBanner.d.ts +7 -7
- package/dist/es/components/VideoBanner/VideoBanner.js +110 -47
- package/dist/es/components/VideoBlock/VideoBlock.css +106 -1
- package/dist/es/components/VideoBlock/VideoBlock.d.ts +4 -4
- package/dist/es/components/VideoBlock/VideoBlock.js +75 -35
- package/dist/es/helpers/getColumnConfig.d.ts +1 -5
- package/dist/es/helpers/setRelAttribute.d.ts +1 -0
- package/dist/es/helpers/setRelAttribute.js +11 -0
- package/dist/es/hooks/useResolutions.d.ts +7 -0
- package/dist/es/hooks/useResolutions.js +60 -0
- package/dist/es/index.d.ts +2 -0
- package/dist/es/index.js +2 -0
- package/dist/lib/components/AccordionBox/AccordionBox.css +15 -1
- package/dist/lib/components/AccordionBox/AccordionBox.d.ts +2 -2
- package/dist/lib/components/AccordionBox/AccordionBox.js +66 -10
- package/dist/lib/components/AudioPlayer/AudioPlayer.d.ts +2 -2
- package/dist/lib/components/AudioPlayer/AudioPlayer.js +56 -32
- package/dist/lib/components/AudioPlayer/AudioProgress.d.ts +1 -1
- package/dist/lib/components/AudioPlayer/AudioProgress.js +43 -12
- package/dist/lib/components/AudioPlayer/AudioRange.d.ts +1 -1
- package/dist/lib/components/AudioPlayer/AudioRange.js +17 -9
- package/dist/lib/components/AudioPlayer/AudioVolume.d.ts +1 -1
- package/dist/lib/components/AudioPlayer/AudioVolume.js +23 -4
- package/dist/lib/components/AudioPlayer/hooks/useTrackDuration.js +16 -5
- package/dist/lib/components/AudioPlayer/style/AudioPlayer.css +58 -1
- package/dist/lib/components/AudioPlayer/style/AudioProgress.css +35 -1
- package/dist/lib/components/AudioPlayer/style/AudioRange.css +68 -1
- package/dist/lib/components/AudioPlayer/style/AudioVolume.css +34 -1
- package/dist/lib/components/AudioPlayer/timerFormatUtil.js +13 -2
- package/dist/lib/components/BannerBox/BannerBox.d.ts +1 -1
- package/dist/lib/components/BannerBox/BannerBox.js +25 -7
- package/dist/lib/components/BenefitsIcons/BenefitsIcons.d.ts +1 -1
- package/dist/lib/components/BenefitsIcons/BenefitsIcons.js +86 -26
- package/dist/lib/components/BenefitsIcons/BenefitsIconsTile.d.ts +1 -1
- package/dist/lib/components/BenefitsIcons/BenefitsIconsTile.js +53 -13
- package/dist/lib/components/BenefitsIcons/helpers.d.ts +3 -3
- package/dist/lib/components/BenefitsIcons/helpers.js +37 -10
- package/dist/lib/components/BenefitsIcons/style/BenefitsIcons.css +38 -1
- package/dist/lib/components/BenefitsIcons/style/BenefitsIconsTile.css +90 -1
- package/dist/lib/components/BenefitsIcons/types.d.ts +5 -5
- package/dist/lib/components/BenefitsIcons/types.js +8 -5
- package/dist/lib/components/BenefitsPictures/BenefitsPictures.d.ts +1 -1
- package/dist/lib/components/BenefitsPictures/BenefitsPictures.js +71 -24
- package/dist/lib/components/BenefitsPictures/BenfitsPictures.css +43 -1
- package/dist/lib/components/BenefitsPictures/helpers.d.ts +2 -2
- package/dist/lib/components/BenefitsPictures/helpers.js +40 -9
- package/dist/lib/components/BenefitsPictures/types.d.ts +3 -3
- package/dist/lib/components/BenefitsPictures/types.js +1 -5
- package/dist/lib/components/BlogBox/BlogBox.css +92 -0
- package/dist/lib/components/BlogBox/BlogBox.d.ts +28 -0
- package/dist/lib/components/BlogBox/BlogBox.js +120 -0
- package/dist/lib/components/BlogBox/components/BlogBoxTile.css +197 -0
- package/dist/lib/components/BlogBox/components/BlogBoxTile.d.ts +9 -0
- package/dist/lib/components/BlogBox/components/BlogBoxTile.js +80 -0
- package/dist/lib/components/BlogBox/types.d.ts +37 -0
- package/dist/lib/components/BlogBox/types.js +1 -0
- package/dist/lib/components/Breadcrumbs/Breadcrumbs.css +43 -1
- package/dist/lib/components/Breadcrumbs/Breadcrumbs.d.ts +6 -6
- package/dist/lib/components/Breadcrumbs/Breadcrumbs.js +60 -18
- package/dist/lib/components/Breadcrumbs/components/BreadcrumbsItem.css +16 -1
- package/dist/lib/components/Breadcrumbs/components/BreadcrumbsItem.d.ts +4 -4
- package/dist/lib/components/Breadcrumbs/components/BreadcrumbsItem.js +55 -22
- package/dist/lib/components/ButtonBanner/ButtonBanner.css +122 -1
- package/dist/lib/components/ButtonBanner/ButtonBanner.d.ts +7 -7
- package/dist/lib/components/ButtonBanner/ButtonBanner.js +89 -40
- package/dist/lib/components/ButtonLinkBox/ButtonLinkBox.css +19 -1
- package/dist/lib/components/ButtonLinkBox/ButtonLinkBox.d.ts +3 -3
- package/dist/lib/components/ButtonLinkBox/ButtonLinkBox.js +72 -29
- package/dist/lib/components/Card/Card.css +354 -1
- package/dist/lib/components/Card/Card.d.ts +4 -4
- package/dist/lib/components/Card/Card.js +164 -67
- package/dist/lib/components/Card/types.d.ts +10 -10
- package/dist/lib/components/Card/types.js +1 -5
- package/dist/lib/components/CardsBox/CardsBox.js +31 -7
- package/dist/lib/components/CardsBox/helpers.d.ts +2 -2
- package/dist/lib/components/CardsBox/helpers.js +8 -1
- package/dist/lib/components/CarouselBox/CarouselBox.d.ts +2 -2
- package/dist/lib/components/CarouselBox/CarouselBox.js +39 -15
- package/dist/lib/components/Container/Container.css +3287 -1
- package/dist/lib/components/Container/Container.d.ts +5 -7
- package/dist/lib/components/Container/Container.js +40 -18
- package/dist/lib/components/DownloadLinks/DownloadLink.css +37 -1
- package/dist/lib/components/DownloadLinks/DownloadLink.d.ts +1 -1
- package/dist/lib/components/DownloadLinks/DownloadLink.js +60 -17
- package/dist/lib/components/DownloadLinks/DownloadLinks.css +36 -1
- package/dist/lib/components/DownloadLinks/DownloadLinks.d.ts +3 -3
- package/dist/lib/components/DownloadLinks/DownloadLinks.js +33 -8
- package/dist/lib/components/FaqWrapper/FaqWrapper.d.ts +2 -5
- package/dist/lib/components/FaqWrapper/FaqWrapper.js +9 -6
- package/dist/lib/components/ImageBanner/ImageBanner.css +252 -1
- package/dist/lib/components/ImageBanner/ImageBanner.d.ts +7 -8
- package/dist/lib/components/ImageBanner/ImageBanner.js +138 -61
- package/dist/lib/components/Instructions/Instructions.css +827 -1
- package/dist/lib/components/Instructions/Instructions.d.ts +13 -11
- package/dist/lib/components/Instructions/Instructions.js +193 -106
- package/dist/lib/components/NotificationBox/NotificationBox.d.ts +4 -4
- package/dist/lib/components/NotificationBox/NotificationBox.js +37 -9
- package/dist/lib/components/NotificationBox/style/NotificationBox.css +28 -0
- package/dist/lib/components/PageTitle/PageTitle.css +80 -1
- package/dist/lib/components/PageTitle/PageTitle.d.ts +2 -2
- package/dist/lib/components/PageTitle/PageTitle.js +52 -15
- package/dist/lib/components/Partners/Partners.css +53 -1
- package/dist/lib/components/Partners/Partners.d.ts +2 -2
- package/dist/lib/components/Partners/Partners.js +65 -21
- package/dist/lib/components/PictureWithDescription/PictureWithDescription.css +80 -1
- package/dist/lib/components/PictureWithDescription/PictureWithDescription.d.ts +2 -4
- package/dist/lib/components/PictureWithDescription/PictureWithDescription.js +46 -16
- package/dist/lib/components/Property/Property.css +156 -1
- package/dist/lib/components/Property/Property.d.ts +4 -4
- package/dist/lib/components/Property/Property.js +120 -60
- package/dist/lib/components/Property/PropertyDescription.css +17 -1
- package/dist/lib/components/Property/PropertyDescription.d.ts +3 -3
- package/dist/lib/components/Property/PropertyDescription.js +46 -15
- package/dist/lib/components/Property/types.d.ts +5 -7
- package/dist/lib/components/Property/types.js +1 -5
- package/dist/lib/components/Steps/Steps.css +41 -1
- package/dist/lib/components/Steps/Steps.d.ts +1 -2
- package/dist/lib/components/Steps/Steps.js +35 -8
- package/dist/lib/components/Steps/StepsItem.css +42 -1
- package/dist/lib/components/Steps/StepsItem.d.ts +2 -2
- package/dist/lib/components/Steps/StepsItem.js +23 -11
- package/dist/lib/components/StoreBanner/StoreBanner.css +346 -1
- package/dist/lib/components/StoreBanner/StoreBanner.d.ts +5 -5
- package/dist/lib/components/StoreBanner/StoreBanner.js +118 -47
- package/dist/lib/components/StoreBanner/doc/img/android-screen.png +0 -0
- package/dist/lib/components/StoreBanner/doc/img/qr-code.png +0 -0
- package/dist/lib/components/StoreBanner/doc/img/screen.png +0 -0
- package/dist/lib/components/StoreButton/StoreButton.css +327 -1
- package/dist/lib/components/StoreButton/StoreButton.d.ts +3 -3
- package/dist/lib/components/StoreButton/StoreButton.js +63 -17
- package/dist/lib/components/Table/Table.css +157 -1
- package/dist/lib/components/Table/Table.d.ts +1 -1
- package/dist/lib/components/Table/Table.js +68 -35
- package/dist/lib/components/Table/TableCell.js +16 -4
- package/dist/lib/components/Table/TableRow.js +19 -5
- package/dist/lib/components/TabsBox/TabBox.js +4 -1
- package/dist/lib/components/TabsBox/TabsBox.d.ts +1 -1
- package/dist/lib/components/TabsBox/TabsBox.js +26 -8
- package/dist/lib/components/TextBox/TextBox.css +25 -1
- package/dist/lib/components/TextBox/TextBox.d.ts +1 -2
- package/dist/lib/components/TextBox/TextBox.js +36 -12
- package/dist/lib/components/TextBox/TextBoxPicture.css +27 -1
- package/dist/lib/components/TextBox/TextBoxPicture.d.ts +2 -2
- package/dist/lib/components/TextBox/TextBoxPicture.js +29 -11
- package/dist/lib/components/TextWithIcon/TextWithIcon.css +10 -1
- package/dist/lib/components/TextWithIcon/TextWithIcon.d.ts +1 -1
- package/dist/lib/components/TextWithIcon/TextWithIcon.js +39 -10
- package/dist/lib/components/TextWithIcon/TextWithIconItem.css +29 -1
- package/dist/lib/components/TextWithIcon/TextWithIconItem.d.ts +1 -1
- package/dist/lib/components/TextWithIcon/TextWithIconItem.js +37 -10
- package/dist/lib/components/TitleDescriptionBox/TitleDescriptionBox.css +31 -1
- package/dist/lib/components/TitleDescriptionBox/TitleDescriptionBox.d.ts +1 -1
- package/dist/lib/components/TitleDescriptionBox/TitleDescriptionBox.js +40 -10
- package/dist/lib/components/VideoBanner/VideoBanner.css +225 -1
- package/dist/lib/components/VideoBanner/VideoBanner.d.ts +7 -7
- package/dist/lib/components/VideoBanner/VideoBanner.js +176 -83
- package/dist/lib/components/VideoBlock/VideoBlock.css +106 -1
- package/dist/lib/components/VideoBlock/VideoBlock.d.ts +4 -4
- package/dist/lib/components/VideoBlock/VideoBlock.js +114 -58
- package/dist/lib/constants/throttleTime.js +3 -2
- package/dist/lib/helpers/getColumnConfig.d.ts +1 -5
- package/dist/lib/helpers/getColumnConfig.js +5 -2
- package/dist/lib/helpers/setRelAttribute.d.ts +1 -0
- package/dist/lib/helpers/setRelAttribute.js +20 -0
- package/dist/lib/hooks/useResolutions.d.ts +7 -0
- package/dist/lib/hooks/useResolutions.js +75 -0
- package/dist/lib/index.d.ts +2 -0
- package/dist/lib/index.js +73 -10
- package/package.json +92 -87
- package/dist/es/components/NotificationBox/NotificationBox.css +0 -1
- package/dist/lib/components/NotificationBox/NotificationBox.css +0 -1
@@ -1,6 +1,6 @@
|
|
1
|
-
import
|
1
|
+
import React, { Ref } from 'react';
|
2
2
|
import SwiperCore from 'swiper';
|
3
|
-
import './Instructions.
|
3
|
+
import './Instructions.less';
|
4
4
|
export declare const pictureAlignTypes: {
|
5
5
|
readonly LEFT: "left";
|
6
6
|
readonly RIGHT: "right";
|
@@ -34,13 +34,13 @@ export declare const elementOrderTypes: {
|
|
34
34
|
readonly DEFAULT: "default";
|
35
35
|
readonly REVERSED: "reversed";
|
36
36
|
};
|
37
|
-
type PictureAlignTypesType =
|
38
|
-
type PictureVerticalAlignTypesType =
|
39
|
-
type PictureMaskTypesType =
|
40
|
-
type PictureBackgroundColorsType =
|
41
|
-
type ArrowThemeType =
|
42
|
-
type ElementOrderType =
|
43
|
-
export type InstructionItemType = {
|
37
|
+
declare type PictureAlignTypesType = typeof pictureAlignTypes[keyof typeof pictureAlignTypes];
|
38
|
+
declare type PictureVerticalAlignTypesType = typeof pictureVerticalAlignTypes[keyof typeof pictureVerticalAlignTypes];
|
39
|
+
declare type PictureMaskTypesType = typeof pictureMaskTypes[keyof typeof pictureMaskTypes];
|
40
|
+
declare type PictureBackgroundColorsType = typeof pictureBackgroundColorTypes[keyof typeof pictureBackgroundColorTypes];
|
41
|
+
declare type ArrowThemeType = typeof arrowTheme[keyof typeof arrowTheme];
|
42
|
+
declare type ElementOrderType = typeof elementOrderTypes[keyof typeof elementOrderTypes];
|
43
|
+
export declare type InstructionItemType = {
|
44
44
|
title: string | React.ReactNode | React.ReactNode[];
|
45
45
|
mediaUrl: string;
|
46
46
|
isVideo: boolean;
|
@@ -62,7 +62,7 @@ export interface IInstructionsProps {
|
|
62
62
|
arrowNext?: Record<string, string>;
|
63
63
|
};
|
64
64
|
/** Ссылка на корневой элемент */
|
65
|
-
rootRef?:
|
65
|
+
rootRef?: Ref<HTMLDivElement>;
|
66
66
|
/** Дополнительные классы для внутренних элементов */
|
67
67
|
classes?: {
|
68
68
|
instructionItem?: string;
|
@@ -96,8 +96,10 @@ export interface IInstructionsProps {
|
|
96
96
|
arrowsTheme?: ArrowThemeType;
|
97
97
|
/** Вертикальный порядок элементов на мобильных устройствах и планшетах */
|
98
98
|
elementOrder?: ElementOrderType;
|
99
|
+
/** Показать нумерацию пунктов инструкции на мобильных устройствах */
|
100
|
+
showMobileNumeration?: boolean;
|
99
101
|
/** Ref на swiper */
|
100
102
|
getSwiper?: (instance: SwiperCore) => void;
|
101
103
|
}
|
102
|
-
declare const Instructions: React.FC<
|
104
|
+
declare const Instructions: React.FC<IInstructionsProps>;
|
103
105
|
export default Instructions;
|
@@ -1,33 +1,43 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
5
4
|
value: true
|
6
5
|
});
|
7
|
-
exports
|
6
|
+
exports["default"] = exports.elementOrderTypes = exports.arrowTheme = exports.pictureBackgroundColorTypes = exports.pictureMaskTypes = exports.pictureVerticalAlignTypes = exports.pictureAlignTypes = void 0;
|
7
|
+
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
9
|
+
|
9
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
11
|
+
|
10
12
|
require("core-js/modules/es.array.map.js");
|
11
|
-
|
13
|
+
|
14
|
+
var _react = _interopRequireDefault(require("react"));
|
15
|
+
|
12
16
|
var _uiCore = require("@megafon/ui-core");
|
17
|
+
|
13
18
|
var _uiHelpers = require("@megafon/ui-helpers");
|
19
|
+
|
20
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
21
|
+
|
14
22
|
var _react2 = require("swiper/react");
|
15
|
-
|
16
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
23
|
+
|
17
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
25
|
+
|
18
26
|
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
19
|
-
/* eslint-disable jsx-a11y/click-events-have-key-events */
|
20
27
|
|
21
|
-
|
28
|
+
/* eslint-disable jsx-a11y/click-events-have-key-events */
|
29
|
+
var pictureAlignTypes = {
|
22
30
|
LEFT: 'left',
|
23
31
|
RIGHT: 'right'
|
24
32
|
};
|
25
|
-
|
33
|
+
exports.pictureAlignTypes = pictureAlignTypes;
|
34
|
+
var pictureVerticalAlignTypes = {
|
26
35
|
CENTER: 'center',
|
27
36
|
TOP: 'top',
|
28
37
|
UNSET: 'unset'
|
29
38
|
};
|
30
|
-
|
39
|
+
exports.pictureVerticalAlignTypes = pictureVerticalAlignTypes;
|
40
|
+
var pictureMaskTypes = {
|
31
41
|
ANDROID: 'android',
|
32
42
|
ANDROID_CROPPED: 'android-cropped',
|
33
43
|
NEW_IPHONE: 'new-iphone',
|
@@ -40,96 +50,115 @@ var pictureMaskTypes = exports.pictureMaskTypes = {
|
|
40
50
|
IPHONE_CROPPED: 'iphone-cropped',
|
41
51
|
NONE: 'none'
|
42
52
|
};
|
43
|
-
|
53
|
+
exports.pictureMaskTypes = pictureMaskTypes;
|
54
|
+
var pictureBackgroundColorTypes = {
|
44
55
|
SPB_SKY_0: 'spbSky0'
|
45
56
|
};
|
46
|
-
|
57
|
+
exports.pictureBackgroundColorTypes = pictureBackgroundColorTypes;
|
58
|
+
var arrowTheme = {
|
47
59
|
PURPLE: 'purple',
|
48
60
|
DARK: 'dark'
|
49
61
|
};
|
50
|
-
|
62
|
+
exports.arrowTheme = arrowTheme;
|
63
|
+
var elementOrderTypes = {
|
51
64
|
DEFAULT: 'default',
|
52
65
|
REVERSED: 'reversed'
|
53
66
|
};
|
67
|
+
exports.elementOrderTypes = elementOrderTypes;
|
54
68
|
var testIdPrefix = 'Instructions';
|
55
69
|
var cn = (0, _uiHelpers.cnCreate)('mfui-instructions');
|
56
70
|
var swiperSlideCn = cn('slide');
|
71
|
+
|
57
72
|
var Instructions = function Instructions(_ref) {
|
58
73
|
var dataAttrs = _ref.dataAttrs,
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
74
|
+
rootRef = _ref.rootRef,
|
75
|
+
_ref$classes = _ref.classes;
|
76
|
+
_ref$classes = _ref$classes === void 0 ? {} : _ref$classes;
|
77
|
+
var instructionItem = _ref$classes.instructionItem,
|
78
|
+
desktopInstructionItem = _ref$classes.desktopInstructionItem,
|
79
|
+
mobileInstructionItem = _ref$classes.mobileInstructionItem,
|
80
|
+
activeInstructionItem = _ref$classes.activeInstructionItem,
|
81
|
+
desktopItemTitle = _ref$classes.desktopItemTitle,
|
82
|
+
mobileItemTitle = _ref$classes.mobileItemTitle,
|
83
|
+
instructionItemImg = _ref$classes.instructionItemImg,
|
84
|
+
additionalText = _ref$classes.additionalText,
|
85
|
+
arrowPrev = _ref$classes.arrowPrev,
|
86
|
+
arrowNext = _ref$classes.arrowNext,
|
87
|
+
_ref$title = _ref.title,
|
88
|
+
title = _ref$title === void 0 ? '' : _ref$title,
|
89
|
+
instructionItems = _ref.instructionItems,
|
90
|
+
_ref$pictureAlign = _ref.pictureAlign,
|
91
|
+
pictureAlign = _ref$pictureAlign === void 0 ? 'left' : _ref$pictureAlign,
|
92
|
+
_ref$pictureVerticalA = _ref.pictureVerticalAlign,
|
93
|
+
pictureVerticalAlign = _ref$pictureVerticalA === void 0 ? 'center' : _ref$pictureVerticalA,
|
94
|
+
_ref$pictureMask = _ref.pictureMask,
|
95
|
+
pictureMask = _ref$pictureMask === void 0 ? 'none' : _ref$pictureMask,
|
96
|
+
pictureBackgroundColor = _ref.pictureBackgroundColor,
|
97
|
+
getSwiper = _ref.getSwiper,
|
98
|
+
text = _ref.additionalText,
|
99
|
+
showArrows = _ref.showArrows,
|
100
|
+
_ref$arrowsTheme = _ref.arrowsTheme,
|
101
|
+
arrowsTheme = _ref$arrowsTheme === void 0 ? arrowTheme.DARK : _ref$arrowsTheme,
|
102
|
+
_ref$elementOrder = _ref.elementOrder,
|
103
|
+
elementOrder = _ref$elementOrder === void 0 ? 'default' : _ref$elementOrder,
|
104
|
+
showMobileNumeration = _ref.showMobileNumeration,
|
105
|
+
children = _ref.children;
|
106
|
+
|
107
|
+
var _React$useState = _react["default"].useState(),
|
108
|
+
_React$useState2 = (0, _slicedToArray2["default"])(_React$useState, 2),
|
109
|
+
swiperInstance = _React$useState2[0],
|
110
|
+
setSwiperInstance = _React$useState2[1];
|
111
|
+
|
112
|
+
var _React$useState3 = _react["default"].useState(0),
|
113
|
+
_React$useState4 = (0, _slicedToArray2["default"])(_React$useState3, 2),
|
114
|
+
slideIndex = _React$useState4[0],
|
115
|
+
setSlideIndex = _React$useState4[1];
|
116
|
+
|
98
117
|
var isMobileReversed = elementOrder === 'reversed';
|
99
|
-
|
118
|
+
|
119
|
+
var getSwiperInstance = _react["default"].useCallback(function (swiper) {
|
100
120
|
setSwiperInstance(swiper);
|
101
121
|
getSwiper && getSwiper(swiper);
|
102
122
|
}, [getSwiper]);
|
103
|
-
|
123
|
+
|
124
|
+
var getActiveCustomClass = _react["default"].useCallback(function (articleIndex, activeIndex) {
|
104
125
|
if (articleIndex !== activeIndex) {
|
105
126
|
return undefined;
|
106
127
|
}
|
128
|
+
|
107
129
|
return activeInstructionItem;
|
108
130
|
}, [activeInstructionItem]);
|
109
|
-
|
131
|
+
|
132
|
+
var handleArticleClick = _react["default"].useCallback(function (ind) {
|
110
133
|
return function () {
|
111
134
|
setSlideIndex(ind);
|
112
135
|
swiperInstance && swiperInstance.slideTo(ind);
|
113
136
|
};
|
114
137
|
}, [swiperInstance]);
|
115
|
-
|
138
|
+
|
139
|
+
var handleSlideChange = _react["default"].useCallback(function (_ref2) {
|
116
140
|
var activeIndex = _ref2.activeIndex;
|
117
141
|
setSlideIndex(activeIndex);
|
118
142
|
}, []);
|
119
|
-
|
143
|
+
|
144
|
+
var handlePrevClick = _react["default"].useCallback(function () {
|
120
145
|
if (!swiperInstance) {
|
121
146
|
return;
|
122
147
|
}
|
148
|
+
|
123
149
|
swiperInstance.slidePrev();
|
124
150
|
}, [swiperInstance]);
|
125
|
-
|
151
|
+
|
152
|
+
var handleNextClick = _react["default"].useCallback(function () {
|
126
153
|
if (!swiperInstance) {
|
127
154
|
return;
|
128
155
|
}
|
156
|
+
|
129
157
|
swiperInstance.slideNext();
|
130
158
|
}, [swiperInstance]);
|
131
|
-
|
132
|
-
|
159
|
+
|
160
|
+
var renderVideo = _react["default"].useCallback(function (mediaUrl, index) {
|
161
|
+
return /*#__PURE__*/_react["default"].createElement("video", (0, _extends2["default"])({
|
133
162
|
loop: true,
|
134
163
|
muted: true,
|
135
164
|
autoPlay: true,
|
@@ -137,19 +166,20 @@ var Instructions = function Instructions(_ref) {
|
|
137
166
|
className: cn('swiper-img', {
|
138
167
|
video: true
|
139
168
|
})
|
140
|
-
}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.image, index + 1)), /*#__PURE__*/
|
169
|
+
}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.image, index + 1)), /*#__PURE__*/_react["default"].createElement("source", {
|
141
170
|
src: mediaUrl,
|
142
171
|
type: "video/mp4"
|
143
172
|
}));
|
144
173
|
}, [dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.image]);
|
145
|
-
|
146
|
-
|
174
|
+
|
175
|
+
var renderMobileDots = _react["default"].useCallback(function () {
|
176
|
+
return /*#__PURE__*/_react["default"].createElement("ul", {
|
147
177
|
className: cn('articles-dots', {
|
148
178
|
reversed: isMobileReversed
|
149
179
|
}),
|
150
180
|
"data-testid": "".concat(testIdPrefix, "-articles-dots-mobile")
|
151
181
|
}, instructionItems.map(function (_item, i) {
|
152
|
-
return /*#__PURE__*/
|
182
|
+
return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.item, i + 1), {
|
153
183
|
key: i,
|
154
184
|
className: cn('articles-dot', {
|
155
185
|
active: slideIndex === i
|
@@ -158,8 +188,9 @@ var Instructions = function Instructions(_ref) {
|
|
158
188
|
}));
|
159
189
|
}));
|
160
190
|
}, [instructionItems, dataAttrs, slideIndex, instructionItem, mobileInstructionItem, getActiveCustomClass, handleArticleClick, isMobileReversed]);
|
161
|
-
|
162
|
-
|
191
|
+
|
192
|
+
var renderSlider = _react["default"].useCallback(function () {
|
193
|
+
return /*#__PURE__*/_react["default"].createElement(_react2.Swiper, {
|
163
194
|
noSwiping: false,
|
164
195
|
onSwiper: getSwiperInstance,
|
165
196
|
noSwipingClass: swiperSlideCn,
|
@@ -167,12 +198,12 @@ var Instructions = function Instructions(_ref) {
|
|
167
198
|
className: cn('swiper')
|
168
199
|
}, instructionItems.map(function (_ref3, i) {
|
169
200
|
var mediaUrl = _ref3.mediaUrl,
|
170
|
-
|
171
|
-
|
172
|
-
return /*#__PURE__*/
|
201
|
+
isVideo = _ref3.isVideo,
|
202
|
+
imageAlt = _ref3.imageAlt;
|
203
|
+
return /*#__PURE__*/_react["default"].createElement(_react2.SwiperSlide, {
|
173
204
|
className: swiperSlideCn,
|
174
205
|
key: i + mediaUrl
|
175
|
-
}, isVideo ? renderVideo(mediaUrl, i) : /*#__PURE__*/
|
206
|
+
}, isVideo ? renderVideo(mediaUrl, i) : /*#__PURE__*/_react["default"].createElement("img", (0, _extends2["default"])({
|
176
207
|
alt: imageAlt,
|
177
208
|
src: mediaUrl
|
178
209
|
}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.image, i + 1), {
|
@@ -180,51 +211,57 @@ var Instructions = function Instructions(_ref) {
|
|
180
211
|
})));
|
181
212
|
}));
|
182
213
|
}, [getSwiperInstance, instructionItemImg, instructionItems, renderVideo, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.image, handleSlideChange]);
|
183
|
-
|
184
|
-
|
214
|
+
|
215
|
+
var renderTitle = _react["default"].useCallback(function (resolution) {
|
216
|
+
return /*#__PURE__*/_react["default"].createElement(_uiCore.Header, {
|
185
217
|
className: cn('title', {
|
186
218
|
resolution: resolution
|
187
219
|
}),
|
188
220
|
as: "h2"
|
189
221
|
}, (0, _uiHelpers.convert)(title, _uiHelpers.titleConvertConfig));
|
190
222
|
}, [title]);
|
191
|
-
|
192
|
-
|
223
|
+
|
224
|
+
var renderQrCode = _react["default"].useCallback(function () {
|
225
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, instructionItems.map(function (_ref4, i) {
|
193
226
|
var qrCode = _ref4.qrCode,
|
194
|
-
|
195
|
-
return slideIndex === i && !!qrCode && /*#__PURE__*/
|
227
|
+
qrCodeText = _ref4.qrCodeText;
|
228
|
+
return slideIndex === i && !!qrCode && /*#__PURE__*/_react["default"].createElement(_uiCore.Tile, {
|
196
229
|
className: cn('qr-code'),
|
197
230
|
radius: "rounded",
|
198
231
|
shadowLevel: "default",
|
199
232
|
key: qrCode
|
200
|
-
}, !!qrCodeText && /*#__PURE__*/
|
233
|
+
}, !!qrCodeText && /*#__PURE__*/_react["default"].createElement("div", {
|
201
234
|
className: cn('qr-code-text')
|
202
|
-
}, qrCodeText), /*#__PURE__*/
|
235
|
+
}, qrCodeText), /*#__PURE__*/_react["default"].createElement("img", {
|
203
236
|
src: qrCode,
|
204
237
|
className: cn('qr-code-image'),
|
205
238
|
alt: "QR-\u043A\u043E\u0434"
|
206
239
|
}));
|
207
240
|
}));
|
208
241
|
}, [instructionItems, slideIndex]);
|
209
|
-
|
210
|
-
|
242
|
+
|
243
|
+
var renderText = _react["default"].useCallback(function () {
|
244
|
+
return /*#__PURE__*/_react["default"].createElement(_uiCore.Paragraph, {
|
211
245
|
className: cn('text', [additionalText]),
|
212
246
|
hasMargin: false
|
213
247
|
}, (0, _uiHelpers.convert)(text, _uiHelpers.textConvertConfig));
|
214
248
|
}, [text, additionalText]);
|
215
|
-
|
249
|
+
|
250
|
+
var renderPicture = _react["default"].useCallback(function () {
|
216
251
|
if (pictureMask === pictureMaskTypes.NONE) {
|
217
252
|
return renderSlider();
|
218
253
|
}
|
219
|
-
|
254
|
+
|
255
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
220
256
|
className: cn('img-wrapper'),
|
221
257
|
"data-testid": "".concat(testIdPrefix, "-img-wrapper")
|
222
|
-
}, /*#__PURE__*/
|
258
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
223
259
|
className: cn('device-screen')
|
224
260
|
}), renderSlider());
|
225
261
|
}, [pictureMask, renderSlider]);
|
226
|
-
|
227
|
-
|
262
|
+
|
263
|
+
var renderDesktopArticles = _react["default"].useCallback(function () {
|
264
|
+
return /*#__PURE__*/_react["default"].createElement("ul", {
|
228
265
|
className: cn('articles-list', {
|
229
266
|
'text-after': !!text,
|
230
267
|
desktop: true
|
@@ -232,47 +269,53 @@ var Instructions = function Instructions(_ref) {
|
|
232
269
|
"data-testid": "".concat(testIdPrefix, "-articles-list-desktop")
|
233
270
|
}, instructionItems.map(function (_ref5, i) {
|
234
271
|
var itemTitle = _ref5.title;
|
235
|
-
return
|
272
|
+
return (
|
273
|
+
/*#__PURE__*/
|
236
274
|
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
|
237
|
-
|
275
|
+
_react["default"].createElement("li", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.item, i + 1), {
|
238
276
|
className: cn('articles-item', {
|
239
277
|
active: slideIndex === i
|
240
278
|
}, [getActiveCustomClass(i, slideIndex), instructionItem, desktopInstructionItem]),
|
241
279
|
"data-index": i,
|
242
280
|
onClick: handleArticleClick(i),
|
243
281
|
key: i
|
244
|
-
}), /*#__PURE__*/
|
282
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
245
283
|
className: cn('articles-item-dot')
|
246
|
-
}, /*#__PURE__*/
|
284
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
247
285
|
className: cn('articles-item-dot-number')
|
248
|
-
}, i + 1)), /*#__PURE__*/
|
286
|
+
}, i + 1)), /*#__PURE__*/_react["default"].createElement("div", {
|
249
287
|
className: cn('articles-item-title', [desktopItemTitle])
|
250
288
|
}, itemTitle))
|
251
289
|
);
|
252
290
|
}));
|
253
291
|
}, [desktopInstructionItem, desktopItemTitle, getActiveCustomClass, handleArticleClick, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.item, instructionItem, instructionItems, slideIndex, text]);
|
254
|
-
|
255
|
-
|
292
|
+
|
293
|
+
var renderMobileArticles = _react["default"].useCallback(function () {
|
294
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
256
295
|
className: cn('articles-list', {
|
257
296
|
mobile: true
|
258
297
|
}),
|
259
298
|
"data-testid": "".concat(testIdPrefix, "-articles-list-mobile")
|
260
|
-
}, /*#__PURE__*/
|
299
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
261
300
|
className: cn('articles-title-block', {
|
262
|
-
reversed: isMobileReversed
|
301
|
+
reversed: isMobileReversed,
|
302
|
+
'with-numeration': showMobileNumeration
|
263
303
|
})
|
264
304
|
}, instructionItems.map(function (_ref6, i) {
|
265
305
|
var itemTitle = _ref6.title;
|
266
|
-
return slideIndex === i && /*#__PURE__*/
|
306
|
+
return slideIndex === i && /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({
|
267
307
|
key: i,
|
268
308
|
"data-index": i
|
269
309
|
}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.mobileItemText, i + 1), {
|
270
310
|
className: cn('articles-title', [mobileItemTitle])
|
271
|
-
}),
|
311
|
+
}), showMobileNumeration && /*#__PURE__*/_react["default"].createElement("span", {
|
312
|
+
className: cn('articles-num')
|
313
|
+
}, i + 1), itemTitle);
|
272
314
|
})));
|
273
|
-
}, [dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.mobileItemText, instructionItems, mobileItemTitle, slideIndex, isMobileReversed]);
|
274
|
-
|
275
|
-
|
315
|
+
}, [dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.mobileItemText, instructionItems, mobileItemTitle, slideIndex, isMobileReversed, showMobileNumeration]);
|
316
|
+
|
317
|
+
var renderArrows = _react["default"].useCallback(function () {
|
318
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_uiCore.NavArrow, {
|
276
319
|
dataAttrs: {
|
277
320
|
root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.arrowPrev
|
278
321
|
},
|
@@ -282,7 +325,7 @@ var Instructions = function Instructions(_ref) {
|
|
282
325
|
theme: arrowsTheme,
|
283
326
|
disabled: slideIndex === 0,
|
284
327
|
onClick: handlePrevClick
|
285
|
-
}), /*#__PURE__*/
|
328
|
+
}), /*#__PURE__*/_react["default"].createElement(_uiCore.NavArrow, {
|
286
329
|
dataAttrs: {
|
287
330
|
root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.arrowNext
|
288
331
|
},
|
@@ -295,30 +338,74 @@ var Instructions = function Instructions(_ref) {
|
|
295
338
|
onClick: handleNextClick
|
296
339
|
}));
|
297
340
|
}, [handlePrevClick, handleNextClick, arrowsTheme, arrowPrev, arrowNext, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.arrowPrev, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.arrowNext, slideIndex, instructionItems.length]);
|
298
|
-
|
341
|
+
|
342
|
+
return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
299
343
|
className: cn({
|
300
344
|
mask: pictureMask,
|
301
345
|
reversed: isMobileReversed
|
302
346
|
}),
|
303
347
|
ref: rootRef
|
304
|
-
}), /*#__PURE__*/
|
348
|
+
}), /*#__PURE__*/_react["default"].createElement(_uiCore.Grid, {
|
305
349
|
hAlign: "center"
|
306
|
-
}, /*#__PURE__*/
|
350
|
+
}, /*#__PURE__*/_react["default"].createElement(_uiCore.GridColumn, {
|
307
351
|
all: "12"
|
308
|
-
}, !!title && renderTitle('mobile'), /*#__PURE__*/
|
352
|
+
}, !!title && renderTitle('mobile'), /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({
|
309
353
|
className: cn('wrapper', {
|
310
354
|
'vertical-align': pictureVerticalAlign
|
311
355
|
})
|
312
|
-
}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.wrapper)), /*#__PURE__*/
|
356
|
+
}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.wrapper)), /*#__PURE__*/_react["default"].createElement("div", {
|
313
357
|
className: cn('picture', {
|
314
358
|
align: pictureAlign,
|
315
359
|
background: pictureBackgroundColor
|
316
360
|
}),
|
317
361
|
"data-testid": "".concat(testIdPrefix, "-picture")
|
318
|
-
}, isMobileReversed && renderMobileArticles(), renderPicture(), !!showArrows && renderArrows(), renderQrCode()), renderMobileDots(), /*#__PURE__*/
|
362
|
+
}, isMobileReversed && renderMobileArticles(), renderPicture(), !!showArrows && renderArrows(), renderQrCode()), renderMobileDots(), /*#__PURE__*/_react["default"].createElement("div", {
|
319
363
|
className: cn('articles', {
|
320
364
|
align: pictureAlign
|
321
365
|
})
|
322
366
|
}, !!title && renderTitle('desktop'), !isMobileReversed && renderMobileArticles(), renderDesktopArticles(), text && renderText(), children)))));
|
323
367
|
};
|
324
|
-
|
368
|
+
|
369
|
+
Instructions.propTypes = {
|
370
|
+
dataAttrs: _propTypes["default"].shape({
|
371
|
+
root: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired),
|
372
|
+
item: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired),
|
373
|
+
image: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired),
|
374
|
+
mobileItemText: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired),
|
375
|
+
wrapper: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired),
|
376
|
+
arrowPrev: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired),
|
377
|
+
arrowNext: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired)
|
378
|
+
}),
|
379
|
+
rootRef: _propTypes["default"].oneOfType([_propTypes["default"].func, _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
380
|
+
current: _propTypes["default"].elementType
|
381
|
+
}), _propTypes["default"].any])]),
|
382
|
+
classes: _propTypes["default"].shape({
|
383
|
+
instructionItem: _propTypes["default"].string,
|
384
|
+
desktopInstructionItem: _propTypes["default"].string,
|
385
|
+
mobileInstructionItem: _propTypes["default"].string,
|
386
|
+
activeInstructionItem: _propTypes["default"].string,
|
387
|
+
desktopItemTitle: _propTypes["default"].string,
|
388
|
+
mobileItemTitle: _propTypes["default"].string,
|
389
|
+
instructionItemImg: _propTypes["default"].string,
|
390
|
+
arrowPrev: _propTypes["default"].string,
|
391
|
+
arrowNext: _propTypes["default"].string
|
392
|
+
}),
|
393
|
+
title: _propTypes["default"].string,
|
394
|
+
additionalText: _propTypes["default"].string,
|
395
|
+
instructionItems: _propTypes["default"].arrayOf(_propTypes["default"].shape({
|
396
|
+
title: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].node, _propTypes["default"].arrayOf(_propTypes["default"].node)]).isRequired,
|
397
|
+
mediaUrl: _propTypes["default"].string.isRequired,
|
398
|
+
isVideo: _propTypes["default"].bool.isRequired,
|
399
|
+
imageAlt: _propTypes["default"].string
|
400
|
+
}).isRequired).isRequired,
|
401
|
+
pictureAlign: _propTypes["default"].oneOf([pictureAlignTypes.LEFT, pictureAlignTypes.RIGHT]),
|
402
|
+
pictureVerticalAlign: _propTypes["default"].oneOf([pictureVerticalAlignTypes.CENTER, pictureVerticalAlignTypes.TOP, pictureVerticalAlignTypes.UNSET]),
|
403
|
+
pictureMask: _propTypes["default"].oneOf([pictureMaskTypes.ANDROID, pictureMaskTypes.ANDROID_CROPPED, pictureMaskTypes.NEW_IPHONE, pictureMaskTypes.WHITE_IPHONE, pictureMaskTypes.BLACK_IPHONE, pictureMaskTypes.LAPTOP, pictureMaskTypes.LAPTOP_NEW, pictureMaskTypes.IPHONE_12, pictureMaskTypes.IPHONE_15, pictureMaskTypes.IPHONE_CROPPED, pictureMaskTypes.NONE]),
|
404
|
+
pictureBackgroundColor: _propTypes["default"].oneOf([pictureBackgroundColorTypes.SPB_SKY_0]),
|
405
|
+
showArrows: _propTypes["default"].bool,
|
406
|
+
arrowsTheme: _propTypes["default"].oneOf([arrowTheme.DARK, arrowTheme.PURPLE]),
|
407
|
+
elementOrder: _propTypes["default"].oneOf([elementOrderTypes.DEFAULT, elementOrderTypes.REVERSED]),
|
408
|
+
getSwiper: _propTypes["default"].func
|
409
|
+
};
|
410
|
+
var _default = Instructions;
|
411
|
+
exports["default"] = _default;
|
@@ -1,13 +1,13 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import { Notification } from '@megafon/ui-core';
|
3
|
-
import './NotificationBox.
|
3
|
+
import './style/NotificationBox.less';
|
4
4
|
export declare const Align: {
|
5
5
|
readonly LEFT: "left";
|
6
6
|
readonly CENTER: "center";
|
7
7
|
};
|
8
|
-
type AlignType =
|
9
|
-
type NotificationProps = React.ComponentProps<typeof Notification>;
|
10
|
-
type NotificationBoxProps = Omit<NotificationProps, 'isColored'> & {
|
8
|
+
declare type AlignType = typeof Align[keyof typeof Align];
|
9
|
+
declare type NotificationProps = React.ComponentProps<typeof Notification>;
|
10
|
+
declare type NotificationBoxProps = Omit<NotificationProps, 'isColored'> & {
|
11
11
|
/** Горизонтальное выравнивание */
|
12
12
|
align?: AlignType;
|
13
13
|
};
|