@salutejs/plasma-new-hope 0.326.1-canary.2018.15775755664.0 → 0.326.1-canary.2019.15674501487.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/cjs/components/Calendar/CalendarBase/CalendarBase.js +0 -12
- package/cjs/components/Calendar/CalendarBase/CalendarBase.js.map +1 -1
- package/cjs/components/Calendar/CalendarDouble/CalendarDouble.js +0 -12
- package/cjs/components/Calendar/CalendarDouble/CalendarDouble.js.map +1 -1
- package/cjs/components/Calendar/ui/CalendarDays/CalendarDays.js +0 -3
- package/cjs/components/Calendar/ui/CalendarDays/CalendarDays.js.map +1 -1
- package/cjs/components/Calendar/ui/CalendarMonths/CalendarMonths.js +0 -3
- package/cjs/components/Calendar/ui/CalendarMonths/CalendarMonths.js.map +1 -1
- package/cjs/components/Calendar/ui/CalendarQuarters/CalendarQuarters.js +0 -3
- package/cjs/components/Calendar/ui/CalendarQuarters/CalendarQuarters.js.map +1 -1
- package/cjs/components/Calendar/ui/CalendarYears/CalendarYears.js +0 -3
- package/cjs/components/Calendar/ui/CalendarYears/CalendarYears.js.map +1 -1
- package/cjs/components/Carousel/CarouselNew/Carousel.css +5 -5
- package/cjs/components/Carousel/CarouselNew/Carousel.js +6 -9
- package/cjs/components/Carousel/CarouselNew/Carousel.js.map +1 -1
- package/cjs/components/Carousel/CarouselNew/Carousel.styles.js +4 -13
- package/cjs/components/Carousel/CarouselNew/Carousel.styles.js.map +1 -1
- package/cjs/components/Carousel/CarouselNew/Carousel.styles_151pk3s.css +5 -0
- package/cjs/components/Carousel/CarouselNew/Carousel.tokens.js +1 -9
- package/cjs/components/Carousel/CarouselNew/Carousel.tokens.js.map +1 -1
- package/cjs/components/Carousel/CarouselNew/hooks/useCarousel.js +357 -49
- package/cjs/components/Carousel/CarouselNew/hooks/useCarousel.js.map +1 -1
- package/cjs/components/Carousel/CarouselNew/ui/Dots/Dots.js +38 -52
- package/cjs/components/Carousel/CarouselNew/ui/Dots/Dots.js.map +1 -1
- package/cjs/components/Carousel/CarouselOld/CarouselItem.js +1 -1
- package/cjs/components/Carousel/CarouselOld/CarouselItem.js.map +1 -1
- package/{es/components/Carousel/CarouselOld/CarouselItem_uvoxfy.css → cjs/components/Carousel/CarouselOld/CarouselItem_cghzk7.css} +1 -1
- package/cjs/components/CodeField/CodeField.css +6 -6
- package/cjs/components/CodeField/CodeField.styles.js +1 -1
- package/cjs/components/CodeField/CodeField.styles.js.map +1 -1
- package/{es/components/CodeField/CodeField.styles_7zxgpc.css → cjs/components/CodeField/CodeField.styles_ebdpd0.css} +1 -1
- package/cjs/components/Drawer/Drawer.js +3 -4
- package/cjs/components/Drawer/Drawer.js.map +1 -1
- package/cjs/components/Drawer/hooks/useDrawer.js +2 -2
- package/cjs/components/Drawer/hooks/useDrawer.js.map +1 -1
- package/cjs/components/Mask/Mask.js +3 -3
- package/cjs/components/Mask/Mask.js.map +1 -1
- package/cjs/components/Modal/Modal.js +2 -3
- package/cjs/components/Modal/Modal.js.map +1 -1
- package/cjs/components/Modal/hooks/useModal.js +1 -1
- package/cjs/components/Modal/hooks/useModal.js.map +1 -1
- package/cjs/components/Popup/Popup.js +1 -2
- package/cjs/components/Popup/Popup.js.map +1 -1
- package/cjs/components/Popup/PopupContext.js +15 -13
- package/cjs/components/Popup/PopupContext.js.map +1 -1
- package/cjs/components/Rating/Rating.css +6 -6
- package/cjs/components/Rating/Rating.styles.js +1 -1
- package/cjs/components/Rating/Rating.styles.js.map +1 -1
- package/{es/components/Rating/Rating.styles_hi5qwl.css → cjs/components/Rating/Rating.styles_dg76kk.css} +1 -1
- package/cjs/components/Rating/utils/getIcons.css +6 -6
- package/cjs/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.css +4 -4
- package/cjs/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.styles.js +1 -1
- package/cjs/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.styles.js.map +1 -1
- package/cjs/components/Tabs/ui/vertical/VerticalTabs/{VerticalTabs.styles_1egpt45.css → VerticalTabs.styles_1khdtzl.css} +1 -1
- package/cjs/index.css +22 -22
- package/cjs/index.js +0 -2
- package/cjs/index.js.map +1 -1
- package/emotion/cjs/components/Calendar/CalendarBase/CalendarBase.js +0 -12
- package/emotion/cjs/components/Calendar/CalendarDouble/CalendarDouble.js +0 -12
- package/emotion/cjs/components/Calendar/ui/CalendarDays/CalendarDays.js +0 -3
- package/emotion/cjs/components/Calendar/ui/CalendarMonths/CalendarMonths.js +0 -3
- package/emotion/cjs/components/Calendar/ui/CalendarQuarters/CalendarQuarters.js +0 -3
- package/emotion/cjs/components/Calendar/ui/CalendarYears/CalendarYears.js +0 -3
- package/emotion/cjs/components/Carousel/CarouselNew/Carousel.js +6 -9
- package/emotion/cjs/components/Carousel/CarouselNew/Carousel.styles.js +17 -12
- package/emotion/cjs/components/Carousel/CarouselNew/Carousel.tokens.js +1 -9
- package/emotion/cjs/components/Carousel/CarouselNew/hooks/useCarousel.js +353 -50
- package/emotion/cjs/components/Carousel/CarouselNew/ui/Dots/Dots.js +38 -52
- package/emotion/cjs/components/Carousel/CarouselOld/CarouselItem.js +1 -1
- package/emotion/cjs/components/CodeField/CodeField.styles.js +6 -6
- package/emotion/cjs/components/Drawer/Drawer.js +8 -8
- package/emotion/cjs/components/Drawer/hooks/useDrawer.js +2 -2
- package/emotion/cjs/components/Mask/Mask.js +3 -3
- package/emotion/cjs/components/Modal/Modal.js +5 -6
- package/emotion/cjs/components/Modal/hooks/useModal.js +1 -1
- package/emotion/cjs/components/Popup/Popup.js +1 -1
- package/emotion/cjs/components/Popup/PopupContext.js +20 -14
- package/emotion/cjs/components/Rating/Rating.styles.js +11 -11
- package/emotion/cjs/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.styles.js +8 -8
- package/emotion/cjs/examples/plasma_b2c/components/Carousel/Carousel.config.js +2 -2
- package/emotion/cjs/examples/plasma_b2c/components/Carousel/Carousel.stories.tsx +14 -10
- package/emotion/cjs/examples/plasma_web/components/Carousel/Carousel.config.js +2 -2
- package/emotion/cjs/examples/plasma_web/components/Carousel/Carousel.stories.tsx +15 -10
- package/emotion/cjs/hooks/index.js +1 -8
- package/emotion/es/components/Calendar/CalendarBase/CalendarBase.js +0 -12
- package/emotion/es/components/Calendar/CalendarDouble/CalendarDouble.js +0 -12
- package/emotion/es/components/Calendar/ui/CalendarDays/CalendarDays.js +0 -3
- package/emotion/es/components/Calendar/ui/CalendarMonths/CalendarMonths.js +0 -3
- package/emotion/es/components/Calendar/ui/CalendarQuarters/CalendarQuarters.js +0 -3
- package/emotion/es/components/Calendar/ui/CalendarYears/CalendarYears.js +0 -3
- package/emotion/es/components/Carousel/CarouselNew/Carousel.js +6 -9
- package/emotion/es/components/Carousel/CarouselNew/Carousel.styles.js +18 -13
- package/emotion/es/components/Carousel/CarouselNew/Carousel.tokens.js +1 -9
- package/emotion/es/components/Carousel/CarouselNew/hooks/useCarousel.js +349 -50
- package/emotion/es/components/Carousel/CarouselNew/ui/Dots/Dots.js +38 -52
- package/emotion/es/components/Carousel/CarouselOld/CarouselItem.js +1 -1
- package/emotion/es/components/CodeField/CodeField.styles.js +6 -6
- package/emotion/es/components/Drawer/Drawer.js +3 -3
- package/emotion/es/components/Drawer/hooks/useDrawer.js +2 -2
- package/emotion/es/components/Mask/Mask.js +3 -3
- package/emotion/es/components/Modal/Modal.js +3 -4
- package/emotion/es/components/Modal/hooks/useModal.js +1 -1
- package/emotion/es/components/Popup/Popup.js +2 -2
- package/emotion/es/components/Popup/PopupContext.js +20 -14
- package/emotion/es/components/Rating/Rating.styles.js +11 -11
- package/emotion/es/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.styles.js +8 -8
- package/emotion/es/examples/plasma_b2c/components/Carousel/Carousel.config.js +2 -2
- package/emotion/es/examples/plasma_b2c/components/Carousel/Carousel.stories.tsx +14 -10
- package/emotion/es/examples/plasma_web/components/Carousel/Carousel.config.js +2 -2
- package/emotion/es/examples/plasma_web/components/Carousel/Carousel.stories.tsx +15 -10
- package/emotion/es/hooks/index.js +1 -2
- package/es/components/Calendar/CalendarBase/CalendarBase.js +0 -12
- package/es/components/Calendar/CalendarBase/CalendarBase.js.map +1 -1
- package/es/components/Calendar/CalendarDouble/CalendarDouble.js +0 -12
- package/es/components/Calendar/CalendarDouble/CalendarDouble.js.map +1 -1
- package/es/components/Calendar/ui/CalendarDays/CalendarDays.js +0 -3
- package/es/components/Calendar/ui/CalendarDays/CalendarDays.js.map +1 -1
- package/es/components/Calendar/ui/CalendarMonths/CalendarMonths.js +0 -3
- package/es/components/Calendar/ui/CalendarMonths/CalendarMonths.js.map +1 -1
- package/es/components/Calendar/ui/CalendarQuarters/CalendarQuarters.js +0 -3
- package/es/components/Calendar/ui/CalendarQuarters/CalendarQuarters.js.map +1 -1
- package/es/components/Calendar/ui/CalendarYears/CalendarYears.js +0 -3
- package/es/components/Calendar/ui/CalendarYears/CalendarYears.js.map +1 -1
- package/es/components/Carousel/CarouselNew/Carousel.css +5 -5
- package/es/components/Carousel/CarouselNew/Carousel.js +6 -9
- package/es/components/Carousel/CarouselNew/Carousel.js.map +1 -1
- package/es/components/Carousel/CarouselNew/Carousel.styles.js +4 -13
- package/es/components/Carousel/CarouselNew/Carousel.styles.js.map +1 -1
- package/es/components/Carousel/CarouselNew/Carousel.styles_151pk3s.css +5 -0
- package/es/components/Carousel/CarouselNew/Carousel.tokens.js +1 -9
- package/es/components/Carousel/CarouselNew/Carousel.tokens.js.map +1 -1
- package/es/components/Carousel/CarouselNew/hooks/useCarousel.js +349 -51
- package/es/components/Carousel/CarouselNew/hooks/useCarousel.js.map +1 -1
- package/es/components/Carousel/CarouselNew/ui/Dots/Dots.js +38 -52
- package/es/components/Carousel/CarouselNew/ui/Dots/Dots.js.map +1 -1
- package/es/components/Carousel/CarouselOld/CarouselItem.js +1 -1
- package/es/components/Carousel/CarouselOld/CarouselItem.js.map +1 -1
- package/{cjs/components/Carousel/CarouselOld/CarouselItem_uvoxfy.css → es/components/Carousel/CarouselOld/CarouselItem_cghzk7.css} +1 -1
- package/es/components/CodeField/CodeField.css +6 -6
- package/es/components/CodeField/CodeField.styles.js +1 -1
- package/es/components/CodeField/CodeField.styles.js.map +1 -1
- package/{cjs/components/CodeField/CodeField.styles_7zxgpc.css → es/components/CodeField/CodeField.styles_ebdpd0.css} +1 -1
- package/es/components/Drawer/Drawer.js +3 -4
- package/es/components/Drawer/Drawer.js.map +1 -1
- package/es/components/Drawer/hooks/useDrawer.js +2 -2
- package/es/components/Drawer/hooks/useDrawer.js.map +1 -1
- package/es/components/Mask/Mask.js +3 -3
- package/es/components/Mask/Mask.js.map +1 -1
- package/es/components/Modal/Modal.js +2 -3
- package/es/components/Modal/Modal.js.map +1 -1
- package/es/components/Modal/hooks/useModal.js +1 -1
- package/es/components/Modal/hooks/useModal.js.map +1 -1
- package/es/components/Popup/Popup.js +1 -2
- package/es/components/Popup/Popup.js.map +1 -1
- package/es/components/Popup/PopupContext.js +16 -14
- package/es/components/Popup/PopupContext.js.map +1 -1
- package/es/components/Rating/Rating.css +6 -6
- package/es/components/Rating/Rating.styles.js +1 -1
- package/es/components/Rating/Rating.styles.js.map +1 -1
- package/{cjs/components/Rating/Rating.styles_hi5qwl.css → es/components/Rating/Rating.styles_dg76kk.css} +1 -1
- package/es/components/Rating/utils/getIcons.css +6 -6
- package/es/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.css +4 -4
- package/es/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.styles.js +1 -1
- package/es/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.styles.js.map +1 -1
- package/es/components/Tabs/ui/vertical/VerticalTabs/{VerticalTabs.styles_1egpt45.css → VerticalTabs.styles_1khdtzl.css} +1 -1
- package/es/index.css +22 -22
- package/es/index.js +0 -1
- package/es/index.js.map +1 -1
- package/package.json +2 -2
- package/styled-components/cjs/components/Calendar/CalendarBase/CalendarBase.js +0 -12
- package/styled-components/cjs/components/Calendar/CalendarDouble/CalendarDouble.js +0 -12
- package/styled-components/cjs/components/Calendar/ui/CalendarDays/CalendarDays.js +0 -3
- package/styled-components/cjs/components/Calendar/ui/CalendarMonths/CalendarMonths.js +0 -3
- package/styled-components/cjs/components/Calendar/ui/CalendarQuarters/CalendarQuarters.js +0 -3
- package/styled-components/cjs/components/Calendar/ui/CalendarYears/CalendarYears.js +0 -3
- package/styled-components/cjs/components/Carousel/CarouselNew/Carousel.js +6 -9
- package/styled-components/cjs/components/Carousel/CarouselNew/Carousel.styles.js +3 -6
- package/styled-components/cjs/components/Carousel/CarouselNew/Carousel.tokens.js +1 -9
- package/styled-components/cjs/components/Carousel/CarouselNew/hooks/useCarousel.js +353 -50
- package/styled-components/cjs/components/Carousel/CarouselNew/ui/Dots/Dots.js +38 -52
- package/styled-components/cjs/components/Carousel/CarouselOld/CarouselItem.js +1 -1
- package/styled-components/cjs/components/CodeField/CodeField.styles.js +1 -1
- package/styled-components/cjs/components/Drawer/Drawer.js +8 -8
- package/styled-components/cjs/components/Drawer/hooks/useDrawer.js +2 -2
- package/styled-components/cjs/components/Mask/Mask.js +3 -3
- package/styled-components/cjs/components/Modal/Modal.js +5 -6
- package/styled-components/cjs/components/Modal/hooks/useModal.js +1 -1
- package/styled-components/cjs/components/Popup/Popup.js +1 -1
- package/styled-components/cjs/components/Popup/PopupContext.js +20 -14
- package/styled-components/cjs/components/Rating/Rating.styles.js +1 -1
- package/styled-components/cjs/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.styles.js +1 -1
- package/styled-components/cjs/examples/plasma_b2c/components/Carousel/Carousel.config.js +2 -2
- package/styled-components/cjs/examples/plasma_b2c/components/Carousel/Carousel.stories.tsx +14 -10
- package/styled-components/cjs/examples/plasma_web/components/Carousel/Carousel.config.js +2 -2
- package/styled-components/cjs/examples/plasma_web/components/Carousel/Carousel.stories.tsx +15 -10
- package/styled-components/cjs/hooks/index.js +1 -8
- package/styled-components/es/components/Calendar/CalendarBase/CalendarBase.js +0 -12
- package/styled-components/es/components/Calendar/CalendarDouble/CalendarDouble.js +0 -12
- package/styled-components/es/components/Calendar/ui/CalendarDays/CalendarDays.js +0 -3
- package/styled-components/es/components/Calendar/ui/CalendarMonths/CalendarMonths.js +0 -3
- package/styled-components/es/components/Calendar/ui/CalendarQuarters/CalendarQuarters.js +0 -3
- package/styled-components/es/components/Calendar/ui/CalendarYears/CalendarYears.js +0 -3
- package/styled-components/es/components/Carousel/CarouselNew/Carousel.js +6 -9
- package/styled-components/es/components/Carousel/CarouselNew/Carousel.styles.js +4 -7
- package/styled-components/es/components/Carousel/CarouselNew/Carousel.tokens.js +1 -9
- package/styled-components/es/components/Carousel/CarouselNew/hooks/useCarousel.js +349 -50
- package/styled-components/es/components/Carousel/CarouselNew/ui/Dots/Dots.js +38 -52
- package/styled-components/es/components/Carousel/CarouselOld/CarouselItem.js +1 -1
- package/styled-components/es/components/CodeField/CodeField.styles.js +1 -1
- package/styled-components/es/components/Drawer/Drawer.js +3 -3
- package/styled-components/es/components/Drawer/hooks/useDrawer.js +2 -2
- package/styled-components/es/components/Mask/Mask.js +3 -3
- package/styled-components/es/components/Modal/Modal.js +3 -4
- package/styled-components/es/components/Modal/hooks/useModal.js +1 -1
- package/styled-components/es/components/Popup/Popup.js +2 -2
- package/styled-components/es/components/Popup/PopupContext.js +20 -14
- package/styled-components/es/components/Rating/Rating.styles.js +1 -1
- package/styled-components/es/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.styles.js +1 -1
- package/styled-components/es/examples/plasma_b2c/components/Carousel/Carousel.config.js +2 -2
- package/styled-components/es/examples/plasma_b2c/components/Carousel/Carousel.stories.tsx +14 -10
- package/styled-components/es/examples/plasma_web/components/Carousel/Carousel.config.js +2 -2
- package/styled-components/es/examples/plasma_web/components/Carousel/Carousel.stories.tsx +15 -10
- package/styled-components/es/hooks/index.js +1 -2
- package/types/components/Calendar/CalendarBase/CalendarBase.d.ts.map +1 -1
- package/types/components/Calendar/CalendarDouble/CalendarDouble.d.ts.map +1 -1
- package/types/components/Calendar/ui/CalendarDays/CalendarDays.d.ts.map +1 -1
- package/types/components/Calendar/ui/CalendarMonths/CalendarMonths.d.ts.map +1 -1
- package/types/components/Calendar/ui/CalendarQuarters/CalendarQuarters.d.ts.map +1 -1
- package/types/components/Calendar/ui/CalendarYears/CalendarYears.d.ts.map +1 -1
- package/types/components/Carousel/CarouselNew/Carousel.d.ts.map +1 -1
- package/types/components/Carousel/CarouselNew/Carousel.styles.d.ts +1 -4
- package/types/components/Carousel/CarouselNew/Carousel.styles.d.ts.map +1 -1
- package/types/components/Carousel/CarouselNew/Carousel.tokens.d.ts +0 -8
- package/types/components/Carousel/CarouselNew/Carousel.tokens.d.ts.map +1 -1
- package/types/components/Carousel/CarouselNew/Carousel.types.d.ts +3 -8
- package/types/components/Carousel/CarouselNew/Carousel.types.d.ts.map +1 -1
- package/types/components/Carousel/CarouselNew/hooks/useCarousel.d.ts +52 -11
- package/types/components/Carousel/CarouselNew/hooks/useCarousel.d.ts.map +1 -1
- package/types/components/Carousel/CarouselNew/ui/Dots/Dots.d.ts.map +1 -1
- package/types/components/Carousel/CarouselOld/CarouselItem.d.ts.map +1 -1
- package/types/components/Drawer/Drawer.d.ts +1 -1
- package/types/components/Drawer/Drawer.d.ts.map +1 -1
- package/types/components/Drawer/hooks/useDrawer.d.ts.map +1 -1
- package/types/components/Modal/Modal.d.ts +1 -1
- package/types/components/Modal/Modal.d.ts.map +1 -1
- package/types/components/Popup/Popup.d.ts +1 -1
- package/types/components/Popup/Popup.d.ts.map +1 -1
- package/types/components/Popup/Popup.types.d.ts +1 -1
- package/types/components/Popup/Popup.types.d.ts.map +1 -1
- package/types/components/Popup/PopupContext.d.ts.map +1 -1
- package/types/hooks/index.d.ts +0 -1
- package/types/hooks/index.d.ts.map +1 -1
- package/cjs/components/Carousel/CarouselNew/Carousel.styles_1benby5.css +0 -5
- package/cjs/hooks/useDisableScroll.js +0 -30
- package/cjs/hooks/useDisableScroll.js.map +0 -1
- package/emotion/cjs/hooks/useDisableScroll.js +0 -28
- package/emotion/es/hooks/useDisableScroll.js +0 -22
- package/es/components/Carousel/CarouselNew/Carousel.styles_1benby5.css +0 -5
- package/es/hooks/useDisableScroll.js +0 -26
- package/es/hooks/useDisableScroll.js.map +0 -1
- package/styled-components/cjs/hooks/useDisableScroll.js +0 -28
- package/styled-components/es/hooks/useDisableScroll.js +0 -22
- package/types/hooks/useDisableScroll.d.ts +0 -3
- package/types/hooks/useDisableScroll.d.ts.map +0 -1
@@ -8,17 +8,9 @@ export var classes = {
|
|
8
8
|
shrinking: 'dot-shrinking',
|
9
9
|
availableDotsLeft: 'dot-available-dots-left',
|
10
10
|
availableDotsRight: 'dot-available-dots-right',
|
11
|
-
leftControlButton: 'carousel-left-control-button',
|
12
11
|
rightControlButton: 'carousel-right-control-button'
|
13
12
|
};
|
14
13
|
export var tokens = {
|
15
14
|
paginationDotBackground: '--plasma-carousel-pagination-dot-background',
|
16
|
-
paginationDotActiveBackground: '--plasma-carousel-pagination-dot-active-background'
|
17
|
-
controlIconButtonRadius: '--plasma-carousel-control-icon-button-radius',
|
18
|
-
controlIconButtonColor: '--plasma-carousel-control-icon-button-color',
|
19
|
-
controlIconButtonBackgroundColor: '--plasma-carousel-control-icon-button-background-color',
|
20
|
-
controlIconButtonColorHover: '--plasma-carousel-control-icon-button-color-hover',
|
21
|
-
controlIconButtonBackgroundColorHover: '--plasma-carousel-control-icon-button-background-color-hover',
|
22
|
-
controlIconButtonColorActive: '--plasma-carousel-control-icon-button-color-active',
|
23
|
-
controlIconButtonBackgroundColorActive: '--plasma-carousel-control-icon-button-background-color-active'
|
15
|
+
paginationDotActiveBackground: '--plasma-carousel-pagination-dot-active-background'
|
24
16
|
};
|
@@ -1,65 +1,364 @@
|
|
1
|
-
import { useEffect, useRef } from 'react';
|
1
|
+
import { useEffect, useCallback, useRef, useMemo } from 'react';
|
2
|
+
import throttle from 'lodash.throttle';
|
2
3
|
/**
|
3
|
-
* Подсчет
|
4
|
+
* Подсчет смещения из-за паддингов.
|
4
5
|
*/
|
5
|
-
export var
|
6
|
-
var
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
6
|
+
export var getCalculatedOffset = function getCalculatedOffset(scrollEl, trackEl) {
|
7
|
+
var paddingProp = 'paddingLeft';
|
8
|
+
return parseInt(getComputedStyle(scrollEl)[paddingProp], 10) + parseInt(getComputedStyle(trackEl)[paddingProp], 10);
|
9
|
+
};
|
10
|
+
var positionModByScrollAlign = function positionModByScrollAlign(_ref) {
|
11
|
+
var scrollAlign = _ref.scrollAlign,
|
12
|
+
position = _ref.position,
|
13
|
+
carouselSize = _ref.carouselSize,
|
14
|
+
itemSize = _ref.itemSize,
|
15
|
+
offset = _ref.offset,
|
16
|
+
scrollStart = _ref.scrollStart;
|
17
|
+
if (scrollAlign === 'start') {
|
18
|
+
var paddingOffset = 0;
|
19
|
+
return position + paddingOffset;
|
14
20
|
}
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
case 'end':
|
29
|
-
{
|
30
|
-
return left - scrollRect.width + itemRect.width;
|
31
|
-
}
|
32
|
-
default:
|
33
|
-
{
|
34
|
-
return 0;
|
35
|
-
}
|
21
|
+
if (scrollAlign === 'center') {
|
22
|
+
return position - carouselSize / 2 + itemSize / 2;
|
23
|
+
}
|
24
|
+
if (scrollAlign === 'end') {
|
25
|
+
return position - carouselSize + itemSize + offset;
|
26
|
+
}
|
27
|
+
if (scrollAlign === 'activeDirection') {
|
28
|
+
if (position >= scrollStart + carouselSize - itemSize) {
|
29
|
+
return position - carouselSize + itemSize + offset;
|
30
|
+
}
|
31
|
+
if (position > scrollStart) {
|
32
|
+
return scrollStart;
|
33
|
+
}
|
36
34
|
}
|
35
|
+
return position;
|
37
36
|
};
|
38
|
-
|
39
|
-
|
37
|
+
|
38
|
+
/**
|
39
|
+
* Подсчет скролла до переданного индекса.
|
40
|
+
*/
|
41
|
+
export var getCalculatedPos = function getCalculatedPos(_ref2) {
|
42
|
+
var _items$item$offsetWid2, _items$item2;
|
43
|
+
var scrollEl = _ref2.scrollEl,
|
44
|
+
items = _ref2.items,
|
45
|
+
index = _ref2.index,
|
46
|
+
offset = _ref2.offset,
|
40
47
|
scrollAlign = _ref2.scrollAlign;
|
48
|
+
var position = scrollAlign === 'center' ? offset : 0;
|
49
|
+
if (items.item(index) === null) {
|
50
|
+
return position;
|
51
|
+
}
|
52
|
+
for (var i = 0; i < index; i++) {
|
53
|
+
var _items$item$offsetWid, _items$item;
|
54
|
+
position += (_items$item$offsetWid = (_items$item = items.item(i)) === null || _items$item === void 0 ? void 0 : _items$item.offsetWidth) !== null && _items$item$offsetWid !== void 0 ? _items$item$offsetWid : 0;
|
55
|
+
}
|
56
|
+
var carouselSize = scrollEl.offsetWidth;
|
57
|
+
var itemSize = (_items$item$offsetWid2 = (_items$item2 = items.item(index)) === null || _items$item2 === void 0 ? void 0 : _items$item2.offsetWidth) !== null && _items$item$offsetWid2 !== void 0 ? _items$item$offsetWid2 : 0;
|
58
|
+
var scrollStart = scrollEl.scrollLeft;
|
59
|
+
return positionModByScrollAlign({
|
60
|
+
scrollAlign: scrollAlign,
|
61
|
+
position: position,
|
62
|
+
carouselSize: carouselSize,
|
63
|
+
itemSize: itemSize,
|
64
|
+
offset: offset,
|
65
|
+
scrollStart: scrollStart
|
66
|
+
});
|
67
|
+
};
|
68
|
+
var DEFAULT_DURATION = 300;
|
69
|
+
|
70
|
+
// https://css-tricks.com/emulating-css-timing-functions-javascript/
|
71
|
+
var tfs = {
|
72
|
+
linear: function linear(t) {
|
73
|
+
return t;
|
74
|
+
},
|
75
|
+
// eslint-disable-next-line
|
76
|
+
easeIn: function easeIn(t) {
|
77
|
+
return Math.pow(t, 1.675);
|
78
|
+
},
|
79
|
+
// eslint-disable-next-line
|
80
|
+
easeOut: function easeOut(t) {
|
81
|
+
return 1 - Math.pow(1 - t, 1.675);
|
82
|
+
},
|
83
|
+
easeInOut: function easeInOut(t) {
|
84
|
+
return 0.5 * (Math.sin((t - 0.5) * Math.PI) + 1);
|
85
|
+
}
|
86
|
+
};
|
87
|
+
/**
|
88
|
+
* Плавная прокрутка по горизонтали
|
89
|
+
* @param {Element} elem
|
90
|
+
* @param {number} pos
|
91
|
+
* @param {number} duration
|
92
|
+
* @param {string} timingFunction
|
93
|
+
*/
|
94
|
+
export var animatedScrollToX = function animatedScrollToX(elem, pos) {
|
95
|
+
var duration = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DEFAULT_DURATION;
|
96
|
+
var timingFunction = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'easeInOut';
|
97
|
+
var startTime;
|
98
|
+
var startX = elem.scrollLeft;
|
99
|
+
var endX = Math.max(0, Math.min(elem.scrollWidth - elem.clientWidth, pos));
|
100
|
+
var handleNewAnimationFrame = function handleNewAnimationFrame() {
|
101
|
+
startTime = startTime || Date.now();
|
102
|
+
var timePos = Math.min(1, Math.max(1, Date.now() - startTime) / duration);
|
103
|
+
var scrollPos = tfs[timingFunction](timePos);
|
104
|
+
var left = startX + (endX - startX) * scrollPos;
|
105
|
+
elem.scrollTo({
|
106
|
+
left: left
|
107
|
+
});
|
108
|
+
if (timePos !== 1) window.requestAnimationFrame(handleNewAnimationFrame);
|
109
|
+
};
|
110
|
+
window.requestAnimationFrame(handleNewAnimationFrame);
|
111
|
+
};
|
112
|
+
|
113
|
+
/**
|
114
|
+
* Прокрутка к указанной позиции с анимацией или без.
|
115
|
+
*/
|
116
|
+
export var scrollToPos = function scrollToPos(_ref3) {
|
117
|
+
var scrollEl = _ref3.scrollEl,
|
118
|
+
pos = _ref3.pos,
|
119
|
+
animated = _ref3.animated,
|
120
|
+
duration = _ref3.duration,
|
121
|
+
timingFunction = _ref3.timingFunction;
|
122
|
+
if (Math.abs(pos - scrollEl.scrollLeft) > 1) {
|
123
|
+
if (animated) {
|
124
|
+
animatedScrollToX(scrollEl, pos, duration, timingFunction);
|
125
|
+
} else {
|
126
|
+
scrollEl.scrollTo({
|
127
|
+
left: pos
|
128
|
+
});
|
129
|
+
}
|
130
|
+
}
|
131
|
+
};
|
132
|
+
var round = function round(n) {
|
133
|
+
return Math.round(n * 100) / 100;
|
134
|
+
};
|
135
|
+
|
136
|
+
/**
|
137
|
+
* Получить позицию (слот) айтема в каруселе.
|
138
|
+
* Каждый айтем имеет свой слот относительно вьюпорта карусели.
|
139
|
+
*/
|
140
|
+
export var getItemSlot = function getItemSlot(itemIndex, itemEnd, itemSize, scrollStart, scrollSize, scrollAlign) {
|
141
|
+
var prevIndex = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 0;
|
142
|
+
var offset = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;
|
143
|
+
/**
|
144
|
+
* Граница и центр скролла (видимой части).
|
145
|
+
* Смещение + размер.
|
146
|
+
*/
|
147
|
+
var scrollEnd = scrollStart + scrollSize;
|
148
|
+
var scrollCenter = scrollStart + scrollSize / 2;
|
149
|
+
var itemCenter = itemEnd - itemSize / 2;
|
150
|
+
if (scrollAlign === 'center') {
|
151
|
+
return round((itemCenter - scrollCenter) / itemSize);
|
152
|
+
}
|
153
|
+
if (scrollAlign === 'start') {
|
154
|
+
return round((itemEnd - itemSize - scrollStart) / itemSize);
|
155
|
+
}
|
156
|
+
if (scrollAlign === 'end') {
|
157
|
+
return round((itemEnd - (scrollSize + scrollStart)) / itemSize);
|
158
|
+
}
|
159
|
+
if (scrollAlign === 'activeDirection') {
|
160
|
+
var prevStart = offset + itemSize * prevIndex;
|
161
|
+
var prevEnd = prevStart + itemSize;
|
162
|
+
var prevVisible = prevEnd > scrollStart && prevStart < scrollEnd;
|
163
|
+
if (!prevVisible) {
|
164
|
+
if (prevIndex < itemIndex) {
|
165
|
+
return round((itemEnd - (scrollSize + scrollStart)) / itemSize);
|
166
|
+
}
|
167
|
+
return round((itemEnd - itemSize - scrollStart) / itemSize);
|
168
|
+
}
|
169
|
+
}
|
170
|
+
return null;
|
171
|
+
};
|
172
|
+
export function getCarouselItems(track) {
|
173
|
+
return track.children;
|
174
|
+
}
|
175
|
+
export function useDebouncedFunction(func, delay, cleanUp) {
|
176
|
+
var timeoutRef = useRef();
|
177
|
+
|
178
|
+
/**
|
179
|
+
* Очистка таймера
|
180
|
+
*/
|
181
|
+
function clearTimer() {
|
182
|
+
if (timeoutRef.current) {
|
183
|
+
clearTimeout(timeoutRef.current);
|
184
|
+
timeoutRef.current = undefined;
|
185
|
+
}
|
186
|
+
}
|
187
|
+
|
188
|
+
/**
|
189
|
+
* Очищаем таймер при анмаунте компонента, если cleanUp выставлен в true
|
190
|
+
* и тем самым отменяем последний запланированный вызов
|
191
|
+
*/
|
192
|
+
useEffect(function () {
|
193
|
+
return cleanUp ? clearTimer : undefined;
|
194
|
+
}, [cleanUp]);
|
195
|
+
return function () {
|
196
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
197
|
+
args[_key] = arguments[_key];
|
198
|
+
}
|
199
|
+
clearTimer();
|
200
|
+
timeoutRef.current = setTimeout(function () {
|
201
|
+
return func.apply(void 0, args);
|
202
|
+
}, delay);
|
203
|
+
};
|
204
|
+
}
|
205
|
+
var THROTTLE_DEFAULT_MS = 100;
|
206
|
+
var DEBOUNCE_DEFAULT_MS = 150;
|
207
|
+
export var useCarousel = function useCarousel(_ref4) {
|
208
|
+
var index = _ref4.index,
|
209
|
+
onIndexChange = _ref4.onIndexChange,
|
210
|
+
_ref4$detectActive = _ref4.detectActive,
|
211
|
+
detectActive = _ref4$detectActive === void 0 ? false : _ref4$detectActive,
|
212
|
+
_ref4$detectThreshold = _ref4.detectThreshold,
|
213
|
+
detectThreshold = _ref4$detectThreshold === void 0 ? 0.5 : _ref4$detectThreshold,
|
214
|
+
_ref4$scrollAlign = _ref4.scrollAlign,
|
215
|
+
scrollAlign = _ref4$scrollAlign === void 0 ? 'center' : _ref4$scrollAlign,
|
216
|
+
_ref4$throttleMs = _ref4.throttleMs,
|
217
|
+
throttleMs = _ref4$throttleMs === void 0 ? THROTTLE_DEFAULT_MS : _ref4$throttleMs,
|
218
|
+
_ref4$debounceMs = _ref4.debounceMs,
|
219
|
+
debounceMs = _ref4$debounceMs === void 0 ? DEBOUNCE_DEFAULT_MS : _ref4$debounceMs;
|
220
|
+
var prevIndex = useRef(null);
|
221
|
+
var offset = useRef(0);
|
41
222
|
var scrollRef = useRef(null);
|
42
223
|
var trackRef = useRef(null);
|
224
|
+
var axis = 'x';
|
225
|
+
|
226
|
+
/**
|
227
|
+
* Для того, чтобы не спамить изменениями индекса.
|
228
|
+
* Задержка дебаунса слегка больше, чем у тротлинга.
|
229
|
+
* Таким образом, событие срабатывает при завершении скролла.
|
230
|
+
*/
|
231
|
+
var debouncedOnIndexChange = useDebouncedFunction(function (i) {
|
232
|
+
return onIndexChange === null || onIndexChange === void 0 ? void 0 : onIndexChange(i);
|
233
|
+
}, debounceMs);
|
234
|
+
|
235
|
+
/**
|
236
|
+
* Вычисление центрального элемента.
|
237
|
+
* Подсчет: от 0 до 1, какое количество ширины/высоты
|
238
|
+
* каждого элемента находится по центру скролла.
|
239
|
+
*/
|
240
|
+
var throttledDetectActiveItem = useMemo(function () {
|
241
|
+
return throttle(function () {
|
242
|
+
if (!detectActive || scrollRef.current === null || trackRef.current === null) {
|
243
|
+
return;
|
244
|
+
}
|
245
|
+
|
246
|
+
/**
|
247
|
+
* Правая (или нижняя для Оу) граница элемента.
|
248
|
+
*/
|
249
|
+
var itemEdge = offset.current;
|
250
|
+
|
251
|
+
/**
|
252
|
+
* Смещение (отрицательный или положительный отступ)
|
253
|
+
* и размер карусели (для Ox - ширина, для Oy - высота).
|
254
|
+
*/
|
255
|
+
var scrollPos = scrollRef.current[axis === 'x' ? 'scrollLeft' : 'scrollTop'];
|
256
|
+
var scrollSize = scrollRef.current[axis === 'x' ? 'offsetWidth' : 'offsetHeight'];
|
43
257
|
|
44
|
-
|
258
|
+
/**
|
259
|
+
* Граница скролла (видимой части).
|
260
|
+
* Смещение + размер.
|
261
|
+
*/
|
262
|
+
var scrollEdge = scrollPos + scrollSize;
|
263
|
+
var items = getCarouselItems(trackRef.current);
|
264
|
+
|
265
|
+
/**
|
266
|
+
* Проходим по всему списку, суммируя ширины элементов,
|
267
|
+
* пока не найдем один элемент, чей центр будет в центре карусели.
|
268
|
+
*/
|
269
|
+
for (var itemIndex = 0; itemIndex < items.length; itemIndex++) {
|
270
|
+
var _prevIndex$current;
|
271
|
+
var item = items.item(itemIndex);
|
272
|
+
if (item === null) {
|
273
|
+
// eslint-disable-next-line no-continue
|
274
|
+
continue;
|
275
|
+
}
|
276
|
+
|
277
|
+
/**
|
278
|
+
* Для Ox - ширина, для Oy - высота.
|
279
|
+
*/
|
280
|
+
var itemSize = item[axis === 'x' ? 'offsetWidth' : 'offsetHeight'];
|
281
|
+
|
282
|
+
/**
|
283
|
+
* Все элементы правее вьюпорта выпадают из процедуры.
|
284
|
+
* Сравниваем по предыдущему элементу.
|
285
|
+
* [ ... ] ...|n| <- Левый край элемента за пределами начала видимой части
|
286
|
+
*/
|
287
|
+
if (itemEdge > scrollEdge) {
|
288
|
+
// eslint-disable-next-line no-continue
|
289
|
+
continue;
|
290
|
+
}
|
291
|
+
itemEdge += itemSize;
|
292
|
+
|
293
|
+
/**
|
294
|
+
* Все элементы левее вьюпорта выпадают из процедуры.
|
295
|
+
* Сравниваем по текущему элементу.
|
296
|
+
* Правый край элемента за пределами начала видимой части -> |p|... [ ... ]
|
297
|
+
*/
|
298
|
+
if (scrollPos > itemEdge) {
|
299
|
+
// eslint-disable-next-line no-continue
|
300
|
+
continue;
|
301
|
+
}
|
302
|
+
var itemSlot = getItemSlot(itemIndex, itemEdge, itemSize, scrollPos, scrollSize, scrollAlign, (_prevIndex$current = prevIndex.current) !== null && _prevIndex$current !== void 0 ? _prevIndex$current : 0, offset.current);
|
303
|
+
if (itemSlot !== null) {
|
304
|
+
if (detectThreshold && Math.abs(itemSlot) <= detectThreshold) {
|
305
|
+
debouncedOnIndexChange === null || debouncedOnIndexChange === void 0 || debouncedOnIndexChange(itemIndex);
|
306
|
+
}
|
307
|
+
}
|
308
|
+
}
|
309
|
+
}, throttleMs);
|
310
|
+
}, [debouncedOnIndexChange, detectActive, detectThreshold, scrollAlign, throttleMs]);
|
311
|
+
|
312
|
+
/**
|
313
|
+
* Прокрутка до нужной позиции индекса.
|
314
|
+
*/
|
315
|
+
var toIndex = useCallback(function (i) {
|
316
|
+
var scrollEl = scrollRef.current;
|
317
|
+
var items = trackRef.current ? getCarouselItems(trackRef.current) : null;
|
318
|
+
if (scrollEl && items && items.length > 0 && i >= 0) {
|
319
|
+
scrollToPos({
|
320
|
+
scrollEl: scrollEl,
|
321
|
+
pos: getCalculatedPos({
|
322
|
+
scrollEl: scrollEl,
|
323
|
+
items: items,
|
324
|
+
index: i,
|
325
|
+
offset: offset.current,
|
326
|
+
scrollAlign: scrollAlign
|
327
|
+
})
|
328
|
+
});
|
329
|
+
prevIndex.current = i;
|
330
|
+
}
|
331
|
+
}, [scrollAlign]);
|
45
332
|
useEffect(function () {
|
46
|
-
if (
|
47
|
-
|
333
|
+
if (scrollRef.current && trackRef.current) {
|
334
|
+
offset.current = getCalculatedOffset(scrollRef.current, trackRef.current);
|
48
335
|
}
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
336
|
+
}, []);
|
337
|
+
|
338
|
+
/**
|
339
|
+
* Операции на маунте/анмаунте компонента.
|
340
|
+
* Создать слушатели событи и т.п.
|
341
|
+
*/
|
342
|
+
useEffect(function () {
|
343
|
+
var carouselElement = scrollRef.current;
|
344
|
+
if (carouselElement) {
|
345
|
+
carouselElement.addEventListener('scroll', throttledDetectActiveItem);
|
346
|
+
}
|
347
|
+
return function () {
|
348
|
+
if (carouselElement) {
|
349
|
+
carouselElement.removeEventListener('scroll', throttledDetectActiveItem);
|
350
|
+
}
|
351
|
+
};
|
352
|
+
}, [throttledDetectActiveItem]);
|
353
|
+
|
354
|
+
/**
|
355
|
+
* Прокрутка до нужной позиции индекса, если индекс изменился.
|
356
|
+
*/
|
357
|
+
useEffect(function () {
|
358
|
+
if (index !== prevIndex.current) {
|
359
|
+
toIndex(index);
|
61
360
|
}
|
62
|
-
}, [index]);
|
361
|
+
}, [index, toIndex]);
|
63
362
|
return {
|
64
363
|
scrollRef: scrollRef,
|
65
364
|
trackRef: trackRef
|
@@ -132,33 +132,26 @@ export var Dots = /*#__PURE__*/memo(function (_ref) {
|
|
132
132
|
}
|
133
133
|
if (dotsToAdd > 0) {
|
134
134
|
var _loop = function _loop() {
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
}
|
154
|
-
currentDomNode.classList.add(classes.animateOut);
|
155
|
-
currentDomNode.style.animationDelay = "".concat(delay, "s");
|
156
|
-
currentDomNode.style.animationDuration = "".concat(duration, "s");
|
157
|
-
},
|
158
|
-
_ret;
|
135
|
+
var _dotWrapperRef$curren4;
|
136
|
+
var node = document.createElement('div');
|
137
|
+
node.textContent = '';
|
138
|
+
node.classList.add(classes.dot);
|
139
|
+
node.style.opacity = '0';
|
140
|
+
var delay = i * (ANIMATION_DURATION / dotsToAdd);
|
141
|
+
node.style.animationDelay = "".concat(delay, "s");
|
142
|
+
rightAnimationWrapperRef.current.appendChild(node);
|
143
|
+
var duration = ANIMATION_DURATION / dotsToAdd;
|
144
|
+
requestAnimationFrame(function () {
|
145
|
+
node.classList.add(classes.animateIn);
|
146
|
+
node.style.animationDuration = "".concat(duration, "s");
|
147
|
+
});
|
148
|
+
var currentDomNode = (_dotWrapperRef$curren4 = dotWrapperRef.current.children) === null || _dotWrapperRef$curren4 === void 0 ? void 0 : _dotWrapperRef$curren4[i];
|
149
|
+
currentDomNode === null || currentDomNode === void 0 || currentDomNode.classList.add(classes.animateOut);
|
150
|
+
currentDomNode.style.animationDelay = "".concat(delay, "s");
|
151
|
+
currentDomNode.style.animationDuration = "".concat(duration, "s");
|
152
|
+
};
|
159
153
|
for (var i = 0; i < dotsToAdd; i++) {
|
160
|
-
|
161
|
-
if (_ret) return _ret.v;
|
154
|
+
_loop();
|
162
155
|
}
|
163
156
|
}
|
164
157
|
} else {
|
@@ -180,33 +173,26 @@ export var Dots = /*#__PURE__*/memo(function (_ref) {
|
|
180
173
|
}
|
181
174
|
if (dotsToAdd > 0) {
|
182
175
|
var _loop2 = function _loop2() {
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
}
|
202
|
-
currentDomNode.classList.add(classes.animateOut);
|
203
|
-
currentDomNode.style.animationDelay = "".concat(_i * (ANIMATION_DURATION / dotsToAdd), "s");
|
204
|
-
currentDomNode.style.animationDuration = "".concat(duration, "s");
|
205
|
-
},
|
206
|
-
_ret2;
|
176
|
+
var _dotWrapperRef$curren7;
|
177
|
+
var node = document.createElement('div');
|
178
|
+
node.textContent = '';
|
179
|
+
node.classList.add(classes.dot);
|
180
|
+
node.style.opacity = '0';
|
181
|
+
var delay = (dotsToAdd - 1 - _i) * (ANIMATION_DURATION / dotsToAdd);
|
182
|
+
node.style.animationDelay = "".concat(delay, "s");
|
183
|
+
leftAnimationWrapperRef.current.prepend(node);
|
184
|
+
var duration = ANIMATION_DURATION / dotsToAdd;
|
185
|
+
requestAnimationFrame(function () {
|
186
|
+
node.classList.add(classes.animateIn);
|
187
|
+
node.style.animationDuration = "".concat(duration, "s");
|
188
|
+
});
|
189
|
+
var currentDomNode = (_dotWrapperRef$curren7 = dotWrapperRef.current.children) === null || _dotWrapperRef$curren7 === void 0 ? void 0 : _dotWrapperRef$curren7[dotWrapperRef.current.children.length - 1 - _i];
|
190
|
+
currentDomNode === null || currentDomNode === void 0 || currentDomNode.classList.add(classes.animateOut);
|
191
|
+
currentDomNode.style.animationDelay = "".concat(_i * (ANIMATION_DURATION / dotsToAdd), "s");
|
192
|
+
currentDomNode.style.animationDuration = "".concat(duration, "s");
|
193
|
+
};
|
207
194
|
for (var _i = dotsToAdd - 1; _i >= 0; _i--) {
|
208
|
-
|
209
|
-
if (_ret2) return _ret2.v;
|
195
|
+
_loop2();
|
210
196
|
}
|
211
197
|
}
|
212
198
|
}
|
@@ -6,7 +6,7 @@ import React from 'react';
|
|
6
6
|
import styled from 'styled-components';
|
7
7
|
var StyledItem = /*#__PURE__*/styled.div.withConfig({
|
8
8
|
componentId: "plasma-new-hope__sc-1b1k2uh-0"
|
9
|
-
})(["scroll-snap-align:", ";scroll-snap-stop:", ";"], function (_ref) {
|
9
|
+
})(["scroll-snap-align:", ";scroll-snap-stop:", ";padding:0 var(--plasma_private-carousel-padding);"], function (_ref) {
|
10
10
|
var scrollSnapAlign = _ref.scrollSnapAlign;
|
11
11
|
return scrollSnapAlign || 'none';
|
12
12
|
}, function (_ref2) {
|
@@ -3,7 +3,7 @@ function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.fre
|
|
3
3
|
import { css } from 'styled-components';
|
4
4
|
import styled from 'styled-components';
|
5
5
|
import { classes, tokens } from "./CodeField.tokens";
|
6
|
-
export var base = /*#__PURE__*/css(_templateObject || (_templateObject = /*#__PURE__*/_taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n justify-content: center;\n width: min-content;\n align-items: center;\n\n &.", " {\n align-items: start;\n }\n"])), classes.captionAlignLeft);
|
6
|
+
export var base = /*#__PURE__*/css(_templateObject || (_templateObject = /*#__PURE__*/_taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n justify-content: center;\n width: min-content;\n align-items: center;\n\n &.", " {\n align-items: flex-start;\n }\n"])), classes.captionAlignLeft);
|
7
7
|
export var CodeWrapper = /*#__PURE__*/styled.div.withConfig({
|
8
8
|
componentId: "plasma-new-hope__sc-1269wxl-0"
|
9
9
|
})(["display:flex;align-items:center;"]);
|
@@ -3,11 +3,11 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
|
|
3
3
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
4
4
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
5
5
|
import React, { forwardRef, useMemo } from 'react';
|
6
|
-
import { useForkRef } from '@salutejs/plasma-core';
|
7
|
-
import { cx, getSizeValueFromProp, safeUseId } from "../../utils";
|
6
|
+
import { useForkRef, safeUseId } from '@salutejs/plasma-core';
|
8
7
|
import { usePopupContext } from "../Popup";
|
9
8
|
import { Overlay } from "../Overlay";
|
10
9
|
import { DEFAULT_Z_INDEX } from "../Popup/utils";
|
10
|
+
import { cx, getSizeValueFromProp } from "../../utils";
|
11
11
|
import { useFocusTrap } from "../../hooks";
|
12
12
|
import { classes, tokens } from "./Drawer.tokens";
|
13
13
|
import { base as viewCSS } from "./variations/_view/base";
|
@@ -74,7 +74,7 @@ export var drawerRoot = function drawerRoot(Root) {
|
|
74
74
|
}),
|
75
75
|
drawerInfo = _useDrawer.drawerInfo;
|
76
76
|
var transparent = useMemo(function () {
|
77
|
-
return getIdLastDrawer(
|
77
|
+
return getIdLastDrawer(popupController.items) !== innerId;
|
78
78
|
}, [innerId, popupController.items]);
|
79
79
|
var onDrawerOverlayKeyDown = function onDrawerOverlayKeyDown(event) {
|
80
80
|
if (onOverlayClick) {
|
@@ -27,7 +27,7 @@ export var useDrawer = function useDrawer(_ref) {
|
|
27
27
|
if (!closeOnEsc) {
|
28
28
|
return;
|
29
29
|
}
|
30
|
-
if (event.keyCode === ESCAPE_KEYCODE && getIdLastDrawer(
|
30
|
+
if (event.keyCode === ESCAPE_KEYCODE && getIdLastDrawer(popupController.items) === id) {
|
31
31
|
if (onEscKeyDown) {
|
32
32
|
onEscKeyDown(event);
|
33
33
|
return;
|
@@ -58,7 +58,7 @@ export var useDrawer = function useDrawer(_ref) {
|
|
58
58
|
if (!canUseDOM) {
|
59
59
|
return;
|
60
60
|
}
|
61
|
-
if (!isOpen && !hasDrawers(
|
61
|
+
if (!isOpen && !hasDrawers(popupController.items)) {
|
62
62
|
document.body.style.overflow = overflow.current;
|
63
63
|
}
|
64
64
|
}, [isOpen, popupController.items]);
|
@@ -11,11 +11,11 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
|
|
11
11
|
import React, { forwardRef, useImperativeHandle, useState } from 'react';
|
12
12
|
import maskInputCompose from '@salutejs/react-maskinput';
|
13
13
|
var defaultFormatChars = [{
|
14
|
-
str: '*',
|
15
|
-
regexp: /./
|
16
|
-
}, {
|
17
14
|
str: '0',
|
18
15
|
regexp: /[0-9]/
|
16
|
+
}, {
|
17
|
+
str: '*',
|
18
|
+
regexp: /./
|
19
19
|
}, {
|
20
20
|
str: 'a',
|
21
21
|
regexp: /[a-zA-Z]/
|
@@ -4,13 +4,12 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
|
|
4
4
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
5
5
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
6
6
|
import React, { forwardRef, useCallback, useMemo } from 'react';
|
7
|
-
import { useForkRef } from '@salutejs/plasma-core';
|
8
|
-
import { safeUseId } from "../../utils";
|
7
|
+
import { useForkRef, safeUseId } from '@salutejs/plasma-core';
|
9
8
|
import { component } from "../../engines";
|
10
|
-
import { useFocusTrap } from "../../hooks";
|
11
9
|
import { popupConfig, usePopupContext } from "../Popup";
|
12
10
|
import { Overlay } from "../Overlay";
|
13
11
|
import { DEFAULT_Z_INDEX } from "../Popup/utils";
|
12
|
+
import { useFocusTrap } from "../../hooks";
|
14
13
|
import { IconClose } from "../_Icon/Icons/IconClose";
|
15
14
|
import { classes, tokens } from "./Modal.tokens";
|
16
15
|
import { useModal } from "./hooks";
|
@@ -66,7 +65,7 @@ export var modalRoot = function modalRoot(Root) {
|
|
66
65
|
}),
|
67
66
|
modalInfo = _useModal.modalInfo;
|
68
67
|
var transparent = useMemo(function () {
|
69
|
-
return getIdLastModal(
|
68
|
+
return getIdLastModal(popupController.items) !== innerId;
|
70
69
|
}, [innerId, popupController.items]);
|
71
70
|
var onModalOverlayKeyDown = useCallback(function (event) {
|
72
71
|
if (onOverlayClick) {
|
@@ -22,7 +22,7 @@ export var useModal = function useModal(_ref) {
|
|
22
22
|
if (!closeOnEsc) {
|
23
23
|
return;
|
24
24
|
}
|
25
|
-
if (event.keyCode === ESCAPE_KEYCODE && getIdLastModal(
|
25
|
+
if (event.keyCode === ESCAPE_KEYCODE && getIdLastModal(popupController.items) === id) {
|
26
26
|
if (onEscKeyDown) {
|
27
27
|
onEscKeyDown(event);
|
28
28
|
return;
|