@redneckz/wildless-cms-uni-blocks 0.14.534 → 0.14.536
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/bin/migration-scripts/0.14.530.js +38 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +94 -51
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/Carousel/CarouselContent.d.ts +2 -0
- package/bundle/components/Carousel/renderCarouselCards.d.ts +2 -1
- package/bundle/components/ProductBlock/ProductBlockContent.d.ts +2 -1
- package/bundle/ui-kit/ResponseTypeDialog/ResponseTypeDialog.d.ts +1 -0
- package/bundle/ui-kit/ResponseTypeDialog/useResponseTypeDialog.d.ts +1 -0
- package/bundle/ui-kit/SwipeListControl/NavButtonProp.d.ts +9 -0
- package/bundle/ui-kit/SwipeListControl/SwipeListControl.d.ts +2 -0
- package/bundle/ui-kit/SwipeListControl/SwipeListDots.d.ts +8 -3
- package/bundle/ui-kit/SwipeListControl/SwipeListScrollButtons.d.ts +1 -0
- package/bundle/ui-kit/SwipeListControl/renderDotButton.d.ts +3 -0
- package/bundle/ui-kit/SwipeListControl/renderNavButton.d.ts +3 -0
- package/dist/components/ApplicationForm/ApplicationForm.js +1 -1
- package/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/dist/components/ApplicationForm/getField.js +1 -1
- package/dist/components/ApplicationForm/getField.js.map +1 -1
- package/dist/components/Carousel/Carousel.js +8 -3
- package/dist/components/Carousel/Carousel.js.map +1 -1
- package/dist/components/Carousel/CarouselContent.d.ts +2 -0
- package/dist/components/Carousel/renderCarouselCards.d.ts +2 -1
- package/dist/components/Carousel/renderCarouselCards.js +3 -1
- package/dist/components/Carousel/renderCarouselCards.js.map +1 -1
- package/dist/components/ProductBlock/ProductBlock.js +1 -1
- package/dist/components/ProductBlock/ProductBlock.js.map +1 -1
- package/dist/components/ProductBlock/ProductBlockContent.d.ts +2 -1
- package/dist/ui-kit/LinkButton/ButtonInner.js +2 -2
- package/dist/ui-kit/LinkButton/ButtonInner.js.map +1 -1
- package/dist/ui-kit/ResponseTypeDialog/ResponseTypeDialog.d.ts +1 -0
- package/dist/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js +7 -2
- package/dist/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js.map +1 -1
- package/dist/ui-kit/ResponseTypeDialog/useResponseTypeDialog.d.ts +1 -0
- package/dist/ui-kit/ResponseTypeDialog/useResponseTypeDialog.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/NavButtonProp.d.ts +9 -0
- package/dist/ui-kit/SwipeListControl/NavButtonProp.js +2 -0
- package/dist/ui-kit/SwipeListControl/NavButtonProp.js.map +1 -0
- package/dist/ui-kit/SwipeListControl/SwipeListControl.d.ts +2 -0
- package/dist/ui-kit/SwipeListControl/SwipeListControl.js +2 -2
- package/dist/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/SwipeListDots.d.ts +8 -3
- package/dist/ui-kit/SwipeListControl/SwipeListDots.js +32 -16
- package/dist/ui-kit/SwipeListControl/SwipeListDots.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/SwipeListScrollButtons.d.ts +1 -0
- package/dist/ui-kit/SwipeListControl/SwipeListScrollButtons.js +4 -3
- package/dist/ui-kit/SwipeListControl/SwipeListScrollButtons.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/renderDotButton.d.ts +3 -0
- package/dist/ui-kit/SwipeListControl/renderDotButton.js +13 -0
- package/dist/ui-kit/SwipeListControl/renderDotButton.js.map +1 -0
- package/dist/ui-kit/SwipeListControl/renderNavButton.d.ts +3 -0
- package/dist/ui-kit/SwipeListControl/renderNavButton.js +17 -0
- package/dist/ui-kit/SwipeListControl/renderNavButton.js.map +1 -0
- package/dist/ui-kit/SwipeListControl/useSwipeListScroll.js +1 -1
- package/dist/ui-kit/SwipeListControl/useSwipeListScroll.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/ApplicationForm/ApplicationForm.js +1 -1
- package/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/lib/components/ApplicationForm/getField.js +1 -1
- package/lib/components/ApplicationForm/getField.js.map +1 -1
- package/lib/components/Carousel/Carousel.fixture.d.ts +1 -0
- package/lib/components/Carousel/Carousel.fixture.mobile.d.ts +1 -0
- package/lib/components/Carousel/Carousel.js +8 -3
- package/lib/components/Carousel/Carousel.js.map +1 -1
- package/lib/components/Carousel/CarouselContent.d.ts +2 -0
- package/lib/components/Carousel/renderCarouselCards.d.ts +2 -1
- package/lib/components/Carousel/renderCarouselCards.js +3 -1
- package/lib/components/Carousel/renderCarouselCards.js.map +1 -1
- package/lib/components/ProductBlock/ProductBlock.js +1 -1
- package/lib/components/ProductBlock/ProductBlock.js.map +1 -1
- package/lib/components/ProductBlock/ProductBlockContent.d.ts +2 -1
- package/lib/ui-kit/LinkButton/ButtonInner.js +2 -2
- package/lib/ui-kit/LinkButton/ButtonInner.js.map +1 -1
- package/lib/ui-kit/ResponseTypeDialog/ResponseTypeDialog.d.ts +1 -0
- package/lib/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js +7 -2
- package/lib/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js.map +1 -1
- package/lib/ui-kit/ResponseTypeDialog/useResponseTypeDialog.d.ts +1 -0
- package/lib/ui-kit/ResponseTypeDialog/useResponseTypeDialog.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/NavButtonProp.d.ts +9 -0
- package/lib/ui-kit/SwipeListControl/NavButtonProp.js +2 -0
- package/lib/ui-kit/SwipeListControl/NavButtonProp.js.map +1 -0
- package/lib/ui-kit/SwipeListControl/SwipeListControl.d.ts +2 -0
- package/lib/ui-kit/SwipeListControl/SwipeListControl.js +2 -2
- package/lib/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/SwipeListDots.d.ts +8 -3
- package/lib/ui-kit/SwipeListControl/SwipeListDots.js +32 -16
- package/lib/ui-kit/SwipeListControl/SwipeListDots.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/SwipeListScrollButtons.d.ts +1 -0
- package/lib/ui-kit/SwipeListControl/SwipeListScrollButtons.js +4 -3
- package/lib/ui-kit/SwipeListControl/SwipeListScrollButtons.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/renderDotButton.d.ts +2 -0
- package/lib/ui-kit/SwipeListControl/renderDotButton.js +10 -0
- package/lib/ui-kit/SwipeListControl/renderDotButton.js.map +1 -0
- package/lib/ui-kit/SwipeListControl/renderNavButton.d.ts +2 -0
- package/lib/ui-kit/SwipeListControl/renderNavButton.js +14 -0
- package/lib/ui-kit/SwipeListControl/renderNavButton.js.map +1 -0
- package/lib/ui-kit/SwipeListControl/useSwipeListScroll.js +1 -1
- package/lib/ui-kit/SwipeListControl/useSwipeListScroll.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +94 -51
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/Carousel/CarouselContent.d.ts +2 -0
- package/mobile/bundle/components/Carousel/renderCarouselCards.d.ts +2 -1
- package/mobile/bundle/components/ProductBlock/ProductBlockContent.d.ts +2 -1
- package/mobile/bundle/ui-kit/ResponseTypeDialog/ResponseTypeDialog.d.ts +1 -0
- package/mobile/bundle/ui-kit/ResponseTypeDialog/useResponseTypeDialog.d.ts +1 -0
- package/mobile/bundle/ui-kit/SwipeListControl/NavButtonProp.d.ts +9 -0
- package/mobile/bundle/ui-kit/SwipeListControl/SwipeListControl.d.ts +2 -0
- package/mobile/bundle/ui-kit/SwipeListControl/SwipeListDots.d.ts +8 -3
- package/mobile/bundle/ui-kit/SwipeListControl/SwipeListScrollButtons.d.ts +1 -0
- package/mobile/bundle/ui-kit/SwipeListControl/renderDotButton.d.ts +3 -0
- package/mobile/bundle/ui-kit/SwipeListControl/renderNavButton.d.ts +3 -0
- package/mobile/dist/components/ApplicationForm/ApplicationForm.js +1 -1
- package/mobile/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/getField.js +1 -1
- package/mobile/dist/components/ApplicationForm/getField.js.map +1 -1
- package/mobile/dist/components/Carousel/Carousel.js +8 -3
- package/mobile/dist/components/Carousel/Carousel.js.map +1 -1
- package/mobile/dist/components/Carousel/CarouselContent.d.ts +2 -0
- package/mobile/dist/components/Carousel/renderCarouselCards.d.ts +2 -1
- package/mobile/dist/components/Carousel/renderCarouselCards.js +3 -1
- package/mobile/dist/components/Carousel/renderCarouselCards.js.map +1 -1
- package/mobile/dist/components/ProductBlock/ProductBlock.js +1 -1
- package/mobile/dist/components/ProductBlock/ProductBlock.js.map +1 -1
- package/mobile/dist/components/ProductBlock/ProductBlockContent.d.ts +2 -1
- package/mobile/dist/ui-kit/LinkButton/ButtonInner.js +2 -2
- package/mobile/dist/ui-kit/LinkButton/ButtonInner.js.map +1 -1
- package/mobile/dist/ui-kit/ResponseTypeDialog/ResponseTypeDialog.d.ts +1 -0
- package/mobile/dist/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js +7 -2
- package/mobile/dist/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js.map +1 -1
- package/mobile/dist/ui-kit/ResponseTypeDialog/useResponseTypeDialog.d.ts +1 -0
- package/mobile/dist/ui-kit/ResponseTypeDialog/useResponseTypeDialog.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/NavButtonProp.d.ts +9 -0
- package/mobile/dist/ui-kit/SwipeListControl/NavButtonProp.js +2 -0
- package/mobile/dist/ui-kit/SwipeListControl/NavButtonProp.js.map +1 -0
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControl.d.ts +2 -0
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControl.js +2 -2
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListDots.d.ts +8 -3
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListDots.js +32 -16
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListDots.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListScrollButtons.d.ts +1 -0
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListScrollButtons.js +4 -3
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListScrollButtons.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/renderDotButton.d.ts +3 -0
- package/mobile/dist/ui-kit/SwipeListControl/renderDotButton.js +13 -0
- package/mobile/dist/ui-kit/SwipeListControl/renderDotButton.js.map +1 -0
- package/mobile/dist/ui-kit/SwipeListControl/renderNavButton.d.ts +3 -0
- package/mobile/dist/ui-kit/SwipeListControl/renderNavButton.js +17 -0
- package/mobile/dist/ui-kit/SwipeListControl/renderNavButton.js.map +1 -0
- package/mobile/dist/ui-kit/SwipeListControl/useSwipeListScroll.js +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/useSwipeListScroll.js.map +1 -1
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationForm.js +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/getField.js +1 -1
- package/mobile/lib/components/ApplicationForm/getField.js.map +1 -1
- package/mobile/lib/components/Carousel/Carousel.js +8 -3
- package/mobile/lib/components/Carousel/Carousel.js.map +1 -1
- package/mobile/lib/components/Carousel/CarouselContent.d.ts +2 -0
- package/mobile/lib/components/Carousel/renderCarouselCards.d.ts +2 -1
- package/mobile/lib/components/Carousel/renderCarouselCards.js +3 -1
- package/mobile/lib/components/Carousel/renderCarouselCards.js.map +1 -1
- package/mobile/lib/components/ProductBlock/ProductBlock.js +1 -1
- package/mobile/lib/components/ProductBlock/ProductBlock.js.map +1 -1
- package/mobile/lib/components/ProductBlock/ProductBlockContent.d.ts +2 -1
- package/mobile/lib/ui-kit/LinkButton/ButtonInner.js +2 -2
- package/mobile/lib/ui-kit/LinkButton/ButtonInner.js.map +1 -1
- package/mobile/lib/ui-kit/ResponseTypeDialog/ResponseTypeDialog.d.ts +1 -0
- package/mobile/lib/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js +7 -2
- package/mobile/lib/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js.map +1 -1
- package/mobile/lib/ui-kit/ResponseTypeDialog/useResponseTypeDialog.d.ts +1 -0
- package/mobile/lib/ui-kit/ResponseTypeDialog/useResponseTypeDialog.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/NavButtonProp.d.ts +9 -0
- package/mobile/lib/ui-kit/SwipeListControl/NavButtonProp.js +2 -0
- package/mobile/lib/ui-kit/SwipeListControl/NavButtonProp.js.map +1 -0
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControl.d.ts +2 -0
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControl.js +2 -2
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListDots.d.ts +8 -3
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListDots.js +32 -16
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListDots.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListScrollButtons.d.ts +1 -0
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListScrollButtons.js +4 -3
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListScrollButtons.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/renderDotButton.d.ts +3 -0
- package/mobile/lib/ui-kit/SwipeListControl/renderDotButton.js +10 -0
- package/mobile/lib/ui-kit/SwipeListControl/renderDotButton.js.map +1 -0
- package/mobile/lib/ui-kit/SwipeListControl/renderNavButton.d.ts +3 -0
- package/mobile/lib/ui-kit/SwipeListControl/renderNavButton.js +14 -0
- package/mobile/lib/ui-kit/SwipeListControl/renderNavButton.js.map +1 -0
- package/mobile/lib/ui-kit/SwipeListControl/useSwipeListScroll.js +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/useSwipeListScroll.js.map +1 -1
- package/mobile/src/components/ApplicationForm/ApplicationForm.example.json +5 -0
- package/mobile/src/components/ApplicationForm/ApplicationForm.tsx +1 -1
- package/mobile/src/components/ApplicationForm/getField.tsx +1 -0
- package/mobile/src/components/Carousel/Carousel.tsx +28 -17
- package/mobile/src/components/Carousel/CarouselContent.ts +2 -0
- package/mobile/src/components/Carousel/renderCarouselCards.tsx +8 -1
- package/mobile/src/components/ProductBlock/ProductBlock.tsx +7 -2
- package/mobile/src/components/ProductBlock/ProductBlockContent.ts +3 -1
- package/mobile/src/ui-kit/LinkButton/ButtonInner.tsx +2 -2
- package/mobile/src/ui-kit/ResponseTypeDialog/ResponseTypeDialog.tsx +12 -4
- package/mobile/src/ui-kit/ResponseTypeDialog/useResponseTypeDialog.tsx +1 -0
- package/mobile/src/ui-kit/SwipeListControl/NavButtonProp.ts +11 -0
- package/mobile/src/ui-kit/SwipeListControl/SwipeListControl.tsx +7 -1
- package/mobile/src/ui-kit/SwipeListControl/SwipeListDots.tsx +69 -46
- package/mobile/src/ui-kit/SwipeListControl/SwipeListScrollButtons.tsx +9 -5
- package/mobile/src/ui-kit/SwipeListControl/renderDotButton.tsx +29 -0
- package/mobile/src/ui-kit/SwipeListControl/renderNavButton.tsx +33 -0
- package/mobile/src/ui-kit/SwipeListControl/useSwipeListScroll.ts +1 -1
- package/package.json +2 -2
- package/src/components/ApplicationForm/ApplicationForm.example.json +5 -0
- package/src/components/ApplicationForm/ApplicationForm.fixture.mobile.tsx +5 -0
- package/src/components/ApplicationForm/ApplicationForm.fixture.tsx +5 -0
- package/src/components/ApplicationForm/ApplicationForm.tsx +1 -1
- package/src/components/ApplicationForm/getField.tsx +1 -0
- package/src/components/Carousel/Carousel.fixture.mobile.tsx +57 -0
- package/src/components/Carousel/Carousel.fixture.tsx +56 -0
- package/src/components/Carousel/Carousel.tsx +28 -17
- package/src/components/Carousel/CarouselContent.ts +2 -0
- package/src/components/Carousel/renderCarouselCards.tsx +8 -1
- package/src/components/ProductBlock/ProductBlock.tsx +7 -2
- package/src/components/ProductBlock/ProductBlockContent.ts +3 -1
- package/src/components/ProductGallery/ProductGallery.fixture.tsx +17 -84
- package/src/ui-kit/LinkButton/ButtonInner.tsx +2 -2
- package/src/ui-kit/ResponseTypeDialog/ResponseTypeDialog.tsx +12 -4
- package/src/ui-kit/ResponseTypeDialog/useResponseTypeDialog.tsx +1 -0
- package/src/ui-kit/SwipeListControl/NavButtonProp.ts +11 -0
- package/src/ui-kit/SwipeListControl/SwipeListControl.tsx +7 -1
- package/src/ui-kit/SwipeListControl/SwipeListDots.tsx +69 -46
- package/src/ui-kit/SwipeListControl/SwipeListScrollButtons.tsx +9 -5
- package/src/ui-kit/SwipeListControl/renderDotButton.tsx +29 -0
- package/src/ui-kit/SwipeListControl/renderNavButton.tsx +33 -0
- package/src/ui-kit/SwipeListControl/useSwipeListScroll.ts +1 -1
|
@@ -1,74 +1,97 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useCallback, useEffect } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
|
+
import { useMobileMode } from '../../hooks/useMobileMode';
|
|
2
4
|
import { type BlockVersion } from '../../model/BlockVersion';
|
|
3
5
|
import { style } from '../../utils/style';
|
|
6
|
+
import { type NavButtonProp } from './NavButtonProp';
|
|
7
|
+
import { renderDotButton } from './renderDotButton';
|
|
8
|
+
import { renderNavButton } from './renderNavButton';
|
|
9
|
+
import { SwipeListContainer } from './SwipeListContainer';
|
|
4
10
|
import { type SwipeListControlType } from './SwipeListControlContent';
|
|
11
|
+
import { useSwipeListScroll, type SwipeListScroll } from './useSwipeListScroll';
|
|
5
12
|
|
|
6
13
|
const containerStyles: Record<SwipeListControlType, string> = {
|
|
7
14
|
'horizontal-list': 'mx-auto mt-lg w-fit',
|
|
8
15
|
'vertical-list': 'absolute flex-col justify-center h-full top-0 left-4',
|
|
9
16
|
};
|
|
10
17
|
|
|
11
|
-
const activeDotStyles: Record<SwipeListControlType, string> = {
|
|
12
|
-
'horizontal-list': 'w-6',
|
|
13
|
-
'vertical-list': 'h-6',
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
const dotStyle =
|
|
17
|
-
'cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white';
|
|
18
|
-
|
|
19
|
-
const inactiveDotStyle = 'w-2 h-2 opacity-30';
|
|
20
|
-
|
|
21
18
|
interface SwipeListDotsProps {
|
|
22
19
|
className?: string;
|
|
23
|
-
containerRef?: { current: HTMLDivElement | null };
|
|
24
20
|
activeIndex?: number;
|
|
25
21
|
dotCount?: number;
|
|
26
22
|
listType?: SwipeListControlType;
|
|
27
23
|
version?: BlockVersion;
|
|
24
|
+
navButtons?: NavButtonProp[];
|
|
25
|
+
onVisibleIndicesChange?: (indices: number[]) => void;
|
|
26
|
+
containerRef?: { current: HTMLDivElement | null };
|
|
27
|
+
containerScroll?: SwipeListScroll;
|
|
28
28
|
}
|
|
29
|
-
|
|
30
29
|
export const SwipeListDots = JSX<SwipeListDotsProps>(
|
|
31
30
|
({
|
|
32
31
|
className = '',
|
|
33
|
-
|
|
34
|
-
activeIndex,
|
|
32
|
+
activeIndex = 0,
|
|
35
33
|
dotCount = 0,
|
|
36
34
|
listType = 'horizontal-list',
|
|
37
35
|
version,
|
|
36
|
+
navButtons = [],
|
|
37
|
+
containerRef,
|
|
38
|
+
containerScroll,
|
|
38
39
|
}) => {
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
const isMobileMode = useMobileMode();
|
|
41
|
+
const [navRef, navScroll] = useSwipeListScroll<HTMLDivElement>({
|
|
42
|
+
itemCount: navButtons.length,
|
|
43
|
+
});
|
|
44
|
+
const scrollOption = getOptions(Boolean(navButtons?.length));
|
|
45
|
+
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
if (navButtons?.length && activeIndex >= 0 && navRef?.current) {
|
|
48
|
+
navScroll.scrollTo(activeIndex, scrollOption);
|
|
45
49
|
}
|
|
46
|
-
};
|
|
50
|
+
}, [activeIndex]);
|
|
47
51
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
52
|
+
const onChangeActiveIndex = useCallback(
|
|
53
|
+
(idx: number) => {
|
|
54
|
+
if (idx !== activeIndex && containerRef?.current) {
|
|
55
|
+
containerScroll?.scrollTo(idx, scrollOption);
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
[containerRef?.current],
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
if (navButtons?.length && !isMobileMode) {
|
|
62
|
+
return (
|
|
63
|
+
<SwipeListContainer
|
|
64
|
+
containerRef={navRef}
|
|
65
|
+
snapAlign="snap-start"
|
|
66
|
+
itemClassName="h-36 flex items-stretch w-screen"
|
|
67
|
+
gap={8}
|
|
68
|
+
>
|
|
69
|
+
{navButtons.map(renderNavButton({ activeIndex, onClick: onChangeActiveIndex }))}
|
|
70
|
+
</SwipeListContainer>
|
|
71
|
+
);
|
|
72
|
+
} else if (dotCount) {
|
|
73
|
+
return (
|
|
74
|
+
<div
|
|
75
|
+
className={style(
|
|
76
|
+
'flex gap-xs',
|
|
77
|
+
containerStyles[listType],
|
|
78
|
+
version ? 'group' : '',
|
|
79
|
+
className,
|
|
80
|
+
{ 'pb-xl': navButtons?.length && isMobileMode },
|
|
81
|
+
)}
|
|
82
|
+
data-ver={version}
|
|
83
|
+
>
|
|
84
|
+
{Array.from({ length: dotCount })
|
|
85
|
+
.fill(null)
|
|
86
|
+
.map(renderDotButton({ activeIndex, onClick: onChangeActiveIndex, listType }))}
|
|
87
|
+
</div>
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return null;
|
|
73
92
|
},
|
|
74
93
|
);
|
|
94
|
+
|
|
95
|
+
const getOptions = (isAuto = false): ScrollIntoViewOptions => ({
|
|
96
|
+
behavior: isAuto ? 'auto' : 'smooth',
|
|
97
|
+
});
|
|
@@ -4,31 +4,32 @@ import { ScrollLeftButton, ScrollRightButton } from '../LinkButton/ArrowButton';
|
|
|
4
4
|
import { type SwipeListScrollButtonsContent } from './SwipeListControlContent';
|
|
5
5
|
import { type SwipeListScroll } from './useSwipeListScroll';
|
|
6
6
|
|
|
7
|
-
const scrollButtonStyle = 'absolute top-[calc(50%-24px)] z-40';
|
|
8
7
|
const blurBaseStyle = 'absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none';
|
|
9
8
|
|
|
10
9
|
export interface SwipeListScrollButtonsProps extends SwipeListScrollButtonsContent {
|
|
11
10
|
className?: string;
|
|
12
11
|
scroll: SwipeListScroll;
|
|
13
12
|
hasBlur?: boolean;
|
|
13
|
+
isBottom?: boolean;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export const SwipeListScrollButtons = JSX<SwipeListScrollButtonsProps>(
|
|
17
|
-
({ className, scroll, hasBlur, arrowsPadded }) => {
|
|
17
|
+
({ className, scroll, hasBlur, arrowsPadded, isBottom }) => {
|
|
18
18
|
const { canScrollLeft, canScrollRight, scrollLeft, scrollRight } = scroll;
|
|
19
|
+
const isArrowPadded = arrowsPadded && !isBottom;
|
|
19
20
|
|
|
20
21
|
return (
|
|
21
|
-
<div className={
|
|
22
|
+
<div className={className}>
|
|
22
23
|
{hasBlur ? renderBlur(scroll) : null}
|
|
23
24
|
{canScrollLeft ? (
|
|
24
25
|
<ScrollLeftButton
|
|
25
|
-
className={style(
|
|
26
|
+
className={style(buttonStyle(isBottom), isArrowPadded ? 'left-1' : 'left-0')}
|
|
26
27
|
onClick={scrollLeft}
|
|
27
28
|
/>
|
|
28
29
|
) : null}
|
|
29
30
|
{canScrollRight ? (
|
|
30
31
|
<ScrollRightButton
|
|
31
|
-
className={style(
|
|
32
|
+
className={style(buttonStyle(isBottom), isArrowPadded ? 'right-1' : 'right-0')}
|
|
32
33
|
onClick={scrollRight}
|
|
33
34
|
/>
|
|
34
35
|
) : null}
|
|
@@ -54,3 +55,6 @@ const renderBlur = (scroll: SwipeListScroll) => (
|
|
|
54
55
|
) : null}
|
|
55
56
|
</div>
|
|
56
57
|
);
|
|
58
|
+
|
|
59
|
+
const buttonStyle = (isBottom = false) =>
|
|
60
|
+
style('absolute z-40', isBottom ? 'bottom-[56px]' : 'top-[calc(50%-24px)]');
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { style } from '../../utils/style';
|
|
2
|
+
import type { DotProp } from './NavButtonProp';
|
|
3
|
+
import type { SwipeListControlType } from './SwipeListControlContent';
|
|
4
|
+
|
|
5
|
+
const activeDotStyles: Record<SwipeListControlType, string> = {
|
|
6
|
+
'horizontal-list': 'w-6',
|
|
7
|
+
'vertical-list': 'h-6',
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const dotStyle =
|
|
11
|
+
'cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white';
|
|
12
|
+
|
|
13
|
+
const inactiveDotStyle = 'w-2 h-2 opacity-30';
|
|
14
|
+
|
|
15
|
+
export const renderDotButton =
|
|
16
|
+
({ activeIndex, onClick, listType = 'horizontal-list' }: DotProp) =>
|
|
17
|
+
(_: any, idx: number) =>
|
|
18
|
+
(
|
|
19
|
+
<div
|
|
20
|
+
key={String(idx)}
|
|
21
|
+
className={style(
|
|
22
|
+
dotStyle,
|
|
23
|
+
idx === activeIndex ? activeDotStyles[listType] : inactiveDotStyle,
|
|
24
|
+
)}
|
|
25
|
+
role="button"
|
|
26
|
+
aria-hidden
|
|
27
|
+
onClick={() => onClick(idx)}
|
|
28
|
+
/>
|
|
29
|
+
);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { style } from '../../utils/style';
|
|
2
|
+
import { type DotProp, type NavButtonProp } from './NavButtonProp';
|
|
3
|
+
|
|
4
|
+
export const renderNavButton =
|
|
5
|
+
({ activeIndex, onClick }: DotProp) =>
|
|
6
|
+
(nav: NavButtonProp, i: number) => {
|
|
7
|
+
const isActive = i === activeIndex;
|
|
8
|
+
const btnClassName = isActive
|
|
9
|
+
? 'min-w-[350px] bg-white shadow-dark-blue border-none p-6'
|
|
10
|
+
: 'min-w-72 ease-in duration-300 bg-white/10 px-xl py-lg hover:backdrop-blur';
|
|
11
|
+
const btnTitleClassName = isActive
|
|
12
|
+
? 'text-primary-text text-h6 py-xs'
|
|
13
|
+
: 'text-l pb-2xs text-secondary-text group-data-secondary:text-white';
|
|
14
|
+
const btnDescClassName = isActive ? 'text-l' : 'text-m group-data-secondary:text-white/80';
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<button
|
|
18
|
+
type="button"
|
|
19
|
+
key={String(i)}
|
|
20
|
+
onClick={() => onClick(i)}
|
|
21
|
+
aria-label={nav?.title}
|
|
22
|
+
className={style(
|
|
23
|
+
'max-h-28 mt-xs ml-xs relative px-xl box-border overflow-hidden text-left grow basis-0 border border-gray group-data-secondary:border-white/50 whitespace-nowrap',
|
|
24
|
+
btnClassName,
|
|
25
|
+
)}
|
|
26
|
+
>
|
|
27
|
+
<div className={btnTitleClassName}>{nav?.title}</div>
|
|
28
|
+
<div className={style('text-secondary-text font-light', btnDescClassName)}>
|
|
29
|
+
{nav?.description}
|
|
30
|
+
</div>
|
|
31
|
+
</button>
|
|
32
|
+
);
|
|
33
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redneckz/wildless-cms-uni-blocks",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.536",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "ЦК",
|
|
@@ -210,7 +210,7 @@
|
|
|
210
210
|
"path": "lib/common.css"
|
|
211
211
|
},
|
|
212
212
|
{
|
|
213
|
-
"limit": "
|
|
213
|
+
"limit": "67 kB",
|
|
214
214
|
"path": "bundle/bundle.umd.min.js"
|
|
215
215
|
}
|
|
216
216
|
],
|
|
@@ -118,6 +118,11 @@
|
|
|
118
118
|
"name": "phone",
|
|
119
119
|
"required": true
|
|
120
120
|
},
|
|
121
|
+
{
|
|
122
|
+
"fieldType": "common",
|
|
123
|
+
"name": "email",
|
|
124
|
+
"label": "Электронная почта (для уведомлений от Банка по Вашему сообщению)"
|
|
125
|
+
},
|
|
121
126
|
{
|
|
122
127
|
"fieldType": "common",
|
|
123
128
|
"name": "birthday",
|
|
@@ -127,6 +127,11 @@ export default {
|
|
|
127
127
|
{ fieldType: 'common', name: 'name', required: true },
|
|
128
128
|
{ fieldType: 'common', name: 'middleName' },
|
|
129
129
|
{ fieldType: 'common', name: 'phone', required: true },
|
|
130
|
+
{
|
|
131
|
+
fieldType: 'common',
|
|
132
|
+
name: 'email',
|
|
133
|
+
label: 'Электронная почта (для уведомлений от Банка по Вашему сообщению)',
|
|
134
|
+
},
|
|
130
135
|
{ fieldType: 'common', name: 'birthday', required: true },
|
|
131
136
|
{ fieldType: 'common', name: 'isClient' },
|
|
132
137
|
{ fieldType: 'common', name: 'comment', required: true },
|
|
@@ -131,6 +131,11 @@ export default {
|
|
|
131
131
|
{ fieldType: 'common', name: 'name', required: true },
|
|
132
132
|
{ fieldType: 'common', name: 'middleName' },
|
|
133
133
|
{ fieldType: 'common', name: 'phone', required: true },
|
|
134
|
+
{
|
|
135
|
+
fieldType: 'common',
|
|
136
|
+
name: 'email',
|
|
137
|
+
label: 'Электронная почта (для уведомлений от Банка по Вашему сообщению)',
|
|
138
|
+
},
|
|
134
139
|
{ fieldType: 'common', name: 'birthday', required: true },
|
|
135
140
|
{ fieldType: 'common', name: 'isClient' },
|
|
136
141
|
{ fieldType: 'common', name: 'comment', required: true },
|
|
@@ -57,7 +57,7 @@ export const ApplicationForm = JSX<ApplicationFormProps>(
|
|
|
57
57
|
setResponseType(status);
|
|
58
58
|
|
|
59
59
|
if (status) {
|
|
60
|
-
const responseTypeDialog = useResponseTypeDialog({ responseType: status });
|
|
60
|
+
const responseTypeDialog = useResponseTypeDialog({ responseType: status, typeForm });
|
|
61
61
|
responseTypeDialog.open();
|
|
62
62
|
}
|
|
63
63
|
if (status === 'OK' && data) {
|
|
@@ -8,6 +8,7 @@ import { CATALOG_CARD, CATALOG_CARD_NEW } from '../CarouselCatalogCard/CarouselC
|
|
|
8
8
|
import { CAROUSEL_RECOMMENDATION_CARD_BENEFITS } from '../CarouselRecommendationCard/CarouselRecommendationCard.fixture';
|
|
9
9
|
import { CAROUSEL_RECOMMENDATION_CARD } from '../CarouselRecommendationCard/CarouselRecommendationCard.fixture.mobile';
|
|
10
10
|
import { TARIFFS_CARD, TARIFFS_CARD_HIT } from '../CarouselTariffsCard/CarouselTariffsCard.fixture';
|
|
11
|
+
import type { ProductBlockContent } from '../ProductBlock/ProductBlockContent';
|
|
11
12
|
import { Carousel } from './Carousel';
|
|
12
13
|
|
|
13
14
|
const catalogImage: Picture = {
|
|
@@ -20,6 +21,25 @@ const catalogImage: Picture = {
|
|
|
20
21
|
title: 'pay-ring',
|
|
21
22
|
};
|
|
22
23
|
|
|
24
|
+
const productBlock: ProductBlockContent = {
|
|
25
|
+
isFullWidthTitle: true,
|
|
26
|
+
version: 'secondary',
|
|
27
|
+
image: {
|
|
28
|
+
iconVersion: 'normal',
|
|
29
|
+
src: 'cow-card.png',
|
|
30
|
+
},
|
|
31
|
+
headlineVersion: 'XXL',
|
|
32
|
+
title: 'Кредит до 5 млн₽ на любые цели',
|
|
33
|
+
description: 'Оформление по паспорту',
|
|
34
|
+
buttons: [
|
|
35
|
+
{
|
|
36
|
+
text: 'Кнопка',
|
|
37
|
+
href: 'href',
|
|
38
|
+
version: 'secondary',
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
};
|
|
42
|
+
|
|
23
43
|
const options = {
|
|
24
44
|
blocksRegistry: Blocks,
|
|
25
45
|
} as BlockRendererOptions;
|
|
@@ -137,4 +157,41 @@ export default {
|
|
|
137
157
|
/>
|
|
138
158
|
</div>
|
|
139
159
|
),
|
|
160
|
+
productGallery: (
|
|
161
|
+
<div className="container grid grid-cols-12">
|
|
162
|
+
<Carousel
|
|
163
|
+
className="col-span-12"
|
|
164
|
+
visibleItemCount={1}
|
|
165
|
+
padding="p-0"
|
|
166
|
+
noCardBorder={true}
|
|
167
|
+
isNavButtons={true}
|
|
168
|
+
version="secondary"
|
|
169
|
+
block={{
|
|
170
|
+
type: 'Carousel',
|
|
171
|
+
blocks: [
|
|
172
|
+
{ type: 'ProductBlock', content: { ...productBlock } },
|
|
173
|
+
{
|
|
174
|
+
type: 'ProductBlock',
|
|
175
|
+
content: {
|
|
176
|
+
...productBlock,
|
|
177
|
+
title: 'Вклад «Доходный»',
|
|
178
|
+
description: 'Получайте максимальный доход даже при небольшой сумме вклада',
|
|
179
|
+
additionalDescription: 'Ставка до 16% годовых',
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
|
+
{ type: 'ProductBlock', content: { ...productBlock, title: 'Карта Своя' } },
|
|
183
|
+
{
|
|
184
|
+
type: 'ProductBlock',
|
|
185
|
+
content: {
|
|
186
|
+
...productBlock,
|
|
187
|
+
title: 'Сельская ипотека',
|
|
188
|
+
additionalDescription: 'до 6 млн. ₽',
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
],
|
|
192
|
+
}}
|
|
193
|
+
options={options}
|
|
194
|
+
/>
|
|
195
|
+
</div>
|
|
196
|
+
),
|
|
140
197
|
};
|
|
@@ -44,6 +44,25 @@ const catalogImage: Picture = {
|
|
|
44
44
|
title: 'pay-ring',
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
+
const productBlock: ProductBlockContent = {
|
|
48
|
+
isFullWidthTitle: true,
|
|
49
|
+
version: 'secondary',
|
|
50
|
+
image: {
|
|
51
|
+
iconVersion: 'normal',
|
|
52
|
+
src: 'cow-card.png',
|
|
53
|
+
},
|
|
54
|
+
headlineVersion: 'XXL',
|
|
55
|
+
title: 'Кредит до 5 млн₽ на любые цели',
|
|
56
|
+
description: 'Оформление по паспорту',
|
|
57
|
+
buttons: [
|
|
58
|
+
{
|
|
59
|
+
text: 'Кнопка',
|
|
60
|
+
href: 'href',
|
|
61
|
+
version: 'secondary',
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
};
|
|
65
|
+
|
|
47
66
|
const options = {
|
|
48
67
|
blocksRegistry: Blocks,
|
|
49
68
|
} as BlockRendererOptions;
|
|
@@ -211,4 +230,41 @@ export default {
|
|
|
211
230
|
/>
|
|
212
231
|
</div>
|
|
213
232
|
),
|
|
233
|
+
productGallery: (
|
|
234
|
+
<div className="container grid grid-cols-12">
|
|
235
|
+
<Carousel
|
|
236
|
+
className="col-span-12"
|
|
237
|
+
visibleItemCount={1}
|
|
238
|
+
padding="p-0"
|
|
239
|
+
noCardBorder={true}
|
|
240
|
+
isNavButtons={true}
|
|
241
|
+
version="secondary"
|
|
242
|
+
block={{
|
|
243
|
+
type: 'Carousel',
|
|
244
|
+
blocks: [
|
|
245
|
+
{ type: 'ProductBlock', content: { ...productBlock } },
|
|
246
|
+
{
|
|
247
|
+
type: 'ProductBlock',
|
|
248
|
+
content: {
|
|
249
|
+
...productBlock,
|
|
250
|
+
title: 'Вклад «Доходный»',
|
|
251
|
+
description: 'Получайте максимальный доход даже при небольшой сумме вклада',
|
|
252
|
+
additionalDescription: 'Ставка до 16% годовых',
|
|
253
|
+
},
|
|
254
|
+
},
|
|
255
|
+
{ type: 'ProductBlock', content: { ...productBlock, title: 'Карта Своя' } },
|
|
256
|
+
{
|
|
257
|
+
type: 'ProductBlock',
|
|
258
|
+
content: {
|
|
259
|
+
...productBlock,
|
|
260
|
+
title: 'Сельская ипотека',
|
|
261
|
+
additionalDescription: 'до 6 млн. ₽',
|
|
262
|
+
},
|
|
263
|
+
},
|
|
264
|
+
],
|
|
265
|
+
}}
|
|
266
|
+
options={options}
|
|
267
|
+
/>
|
|
268
|
+
</div>
|
|
269
|
+
),
|
|
214
270
|
};
|
|
@@ -3,6 +3,7 @@ import { SwipeListControl } from '../../ui-kit/SwipeListControl/SwipeListControl
|
|
|
3
3
|
import { UniBlock } from '../../UniBlock/UniBlock';
|
|
4
4
|
import { type UniBlockProps } from '../../UniBlock/UniBlockProps';
|
|
5
5
|
import { style } from '../../utils/style';
|
|
6
|
+
import { type ProductBlockContent } from '../ProductBlock/ProductBlockContent';
|
|
6
7
|
import { type CarouselContent } from './CarouselContent';
|
|
7
8
|
import { ITEMS_GAP } from './itemsGap';
|
|
8
9
|
import { renderCarouselCards } from './renderCarouselCards';
|
|
@@ -18,24 +19,24 @@ export const Carousel = UniBlock<CarouselProps>(
|
|
|
18
19
|
arrowsPadded = true,
|
|
19
20
|
isGap = true,
|
|
20
21
|
cardSize = 'normal',
|
|
22
|
+
isNavButtons = false,
|
|
21
23
|
...rest
|
|
22
|
-
}) =>
|
|
23
|
-
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
},
|
|
24
|
+
}) => (
|
|
25
|
+
<BlockWrapper className={style(className)} defaultPadding="p-6xl" {...rest}>
|
|
26
|
+
<SwipeListControl
|
|
27
|
+
className={style('relative max-w-full')}
|
|
28
|
+
visibleItemCount={visibleItemCount}
|
|
29
|
+
snapAlign="snap-start"
|
|
30
|
+
gap={isGap ? ITEMS_GAP : 0}
|
|
31
|
+
padding={0}
|
|
32
|
+
arrowsPadded={arrowsPadded}
|
|
33
|
+
navButtons={isNavButtons ? getNavButton(rest?.block?.blocks) : []}
|
|
34
|
+
hasBlur
|
|
35
|
+
>
|
|
36
|
+
{renderCarouselCards({ noCardBorder, cardSize, isNavButtons, ...rest })}
|
|
37
|
+
</SwipeListControl>
|
|
38
|
+
</BlockWrapper>
|
|
39
|
+
),
|
|
39
40
|
{
|
|
40
41
|
childrenTypes: [
|
|
41
42
|
'CarouselCard',
|
|
@@ -53,3 +54,13 @@ export const Carousel = UniBlock<CarouselProps>(
|
|
|
53
54
|
}),
|
|
54
55
|
},
|
|
55
56
|
);
|
|
57
|
+
|
|
58
|
+
const getNavButton = (blocks?: { content?: ProductBlockContent }[]) =>
|
|
59
|
+
blocks?.map((_) => {
|
|
60
|
+
const content = _?.content;
|
|
61
|
+
|
|
62
|
+
return {
|
|
63
|
+
title: content?.title,
|
|
64
|
+
description: content?.additionalDescription || content?.description,
|
|
65
|
+
};
|
|
66
|
+
}) ?? [];
|
|
@@ -16,6 +16,8 @@ export type CarouselContent = UniBlockContent & {
|
|
|
16
16
|
arrowsPadded?: boolean;
|
|
17
17
|
/** @title Отступы между карточками */
|
|
18
18
|
isGap?: boolean;
|
|
19
|
+
/** @title Показывать кнопки навигации */
|
|
20
|
+
isNavButtons?: boolean;
|
|
19
21
|
/** @title Не показывать контур на карточках */
|
|
20
22
|
noCardBorder?: boolean;
|
|
21
23
|
cardSize?: CardSizeMode;
|
|
@@ -19,10 +19,16 @@ const CARD_SIZE_MAP: Record<CardSizeMode, string> = {
|
|
|
19
19
|
export const renderCarouselCards = ({
|
|
20
20
|
noCardBorder,
|
|
21
21
|
cardSize = 'normal',
|
|
22
|
+
isNavButtons = false,
|
|
22
23
|
...rest
|
|
23
|
-
}: UniBlockProps & {
|
|
24
|
+
}: UniBlockProps & {
|
|
25
|
+
noCardBorder?: boolean;
|
|
26
|
+
cardSize?: CardSizeMode;
|
|
27
|
+
isNavButtons?: boolean;
|
|
28
|
+
}) => {
|
|
24
29
|
const { blocks: childBlocks } = rest.block || {};
|
|
25
30
|
const someCardsHighlighted = childBlocks?.some(isCardHighlighted);
|
|
31
|
+
const defaultPadding = isNavButtons ? { defaultPadding: 'p-6xl pb-m' } : {};
|
|
26
32
|
|
|
27
33
|
return renderChildren({
|
|
28
34
|
...rest,
|
|
@@ -34,6 +40,7 @@ export const renderCarouselCards = ({
|
|
|
34
40
|
showBorder: !noCardBorder,
|
|
35
41
|
cardSize,
|
|
36
42
|
}),
|
|
43
|
+
...defaultPadding,
|
|
37
44
|
blockIndex,
|
|
38
45
|
})}
|
|
39
46
|
{isCardHighlighted(block)
|
|
@@ -8,13 +8,18 @@ import { type ProductBlockContent } from './ProductBlockContent';
|
|
|
8
8
|
export interface ProductBlockProps extends UniBlockProps, ProductBlockContent {}
|
|
9
9
|
|
|
10
10
|
export const ProductBlock = UniBlock<ProductBlockProps>(
|
|
11
|
-
({ className, padding, ...rest }) => (
|
|
11
|
+
({ className, padding, defaultPadding, ...rest }) => (
|
|
12
12
|
<BlockWrapper
|
|
13
13
|
className={style('overflow-hidden flex flex-col gap-3xl box-border', className)}
|
|
14
14
|
padding="p-0"
|
|
15
15
|
{...rest}
|
|
16
16
|
>
|
|
17
|
-
<BaseProductTile
|
|
17
|
+
<BaseProductTile
|
|
18
|
+
defaultPadding={defaultPadding || 'p-6xl'}
|
|
19
|
+
padding={padding}
|
|
20
|
+
className="grow h-full"
|
|
21
|
+
{...rest}
|
|
22
|
+
/>
|
|
18
23
|
</BlockWrapper>
|
|
19
24
|
),
|
|
20
25
|
{ childrenTypes: ['UnitBlock'] },
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type AdditionalDescriptionProps } from '../../model/HeadlineType';
|
|
1
2
|
import { type BaseProductTileContent } from '../../ui-kit/BaseProductTile/BaseProductTileContent';
|
|
2
3
|
import { type UniBlockContent } from '../../UniBlock/UniBlockProps';
|
|
3
4
|
|
|
@@ -5,7 +6,8 @@ import { type UniBlockContent } from '../../UniBlock/UniBlockProps';
|
|
|
5
6
|
* @title Продуктовый блок
|
|
6
7
|
*/
|
|
7
8
|
export type ProductBlockContent = UniBlockContent &
|
|
8
|
-
BaseProductTileContent &
|
|
9
|
+
BaseProductTileContent &
|
|
10
|
+
AdditionalDescriptionProps & {
|
|
9
11
|
/** @title Отображать кнопку возврата */
|
|
10
12
|
backwardButton?: boolean;
|
|
11
13
|
};
|