@redneckz/wildless-cms-uni-blocks 0.6.50 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +71 -19
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/CarouselTariffsCard/CarouselTariffsCard.d.ts +1 -1
- package/bundle/components/CarouselTariffsCard/CarouselTariffsCardContent.d.ts +1 -1
- package/bundle/components/LinkDocs/LinkDocsContent.d.ts +4 -0
- package/bundle/components/SwipeListControlBlock/SwipeListControlBlock.d.ts +6 -0
- package/bundle/components/SwipeListControlBlock/SwipeListControlBlockContent.d.ts +5 -0
- package/bundle/ui-kit/SwipeListControl/SwipeListContainer.d.ts +2 -1
- package/bundle/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +2 -0
- package/bundle/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +7 -0
- package/bundle/utils/style.d.ts +1 -0
- package/dist/components/Blocks.js +2 -0
- package/dist/components/Blocks.js.map +1 -1
- package/dist/components/CarouselCard/CarouselCard.js +2 -2
- package/dist/components/CarouselCard/CarouselCard.js.map +1 -1
- package/dist/components/CarouselProgramsCard/CarouselProgramsCard.js +1 -1
- package/dist/components/CarouselProgramsCard/CarouselProgramsCard.js.map +1 -1
- package/dist/components/CarouselTariffsCard/CarouselTariffsCard.d.ts +1 -1
- package/dist/components/CarouselTariffsCard/CarouselTariffsCard.js +12 -9
- package/dist/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
- package/dist/components/CarouselTariffsCard/CarouselTariffsCardContent.d.ts +1 -1
- package/dist/components/LinkDocs/LinkDocsContent.d.ts +4 -0
- package/dist/components/SwipeListControlBlock/SwipeListControlBlock.d.ts +6 -0
- package/dist/components/SwipeListControlBlock/SwipeListControlBlock.js +14 -0
- package/dist/components/SwipeListControlBlock/SwipeListControlBlock.js.map +1 -0
- package/dist/components/SwipeListControlBlock/SwipeListControlBlockContent.d.ts +5 -0
- package/dist/components/SwipeListControlBlock/SwipeListControlBlockContent.js +2 -0
- package/dist/components/SwipeListControlBlock/SwipeListControlBlockContent.js.map +1 -0
- package/dist/ui-kit/BlockWrapper.js +1 -1
- package/dist/ui-kit/BlockWrapper.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/SwipeListContainer.d.ts +2 -1
- package/dist/ui-kit/SwipeListControl/SwipeListContainer.js +8 -5
- package/dist/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/SwipeListControl.js +3 -2
- package/dist/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +2 -0
- package/dist/ui-kit/SwipeListControl/SwipeListControlDots.js +12 -3
- package/dist/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +7 -0
- package/dist/utils/style.d.ts +1 -0
- package/dist/utils/style.js +5 -0
- package/dist/utils/style.js.map +1 -0
- package/lib/common.css +1 -1
- package/lib/components/Blocks.js +2 -0
- package/lib/components/Blocks.js.map +1 -1
- package/lib/components/CarouselCard/CarouselCard.js +2 -2
- package/lib/components/CarouselCard/CarouselCard.js.map +1 -1
- package/lib/components/CarouselProgramsCard/CarouselProgramsCard.js +1 -1
- package/lib/components/CarouselProgramsCard/CarouselProgramsCard.js.map +1 -1
- package/lib/components/CarouselTariffsCard/CarouselTariffsCard.d.ts +1 -1
- package/lib/components/CarouselTariffsCard/CarouselTariffsCard.js +12 -9
- package/lib/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
- package/lib/components/CarouselTariffsCard/CarouselTariffsCardContent.d.ts +1 -1
- package/lib/components/LinkDocs/LinkDocsContent.d.ts +4 -0
- package/lib/components/SwipeListControlBlock/SwipeListControlBlock.d.ts +6 -0
- package/lib/components/SwipeListControlBlock/SwipeListControlBlock.fixture.d.ts +5 -0
- package/lib/components/SwipeListControlBlock/SwipeListControlBlock.js +12 -0
- package/lib/components/SwipeListControlBlock/SwipeListControlBlock.js.map +1 -0
- package/lib/components/SwipeListControlBlock/SwipeListControlBlockContent.d.ts +5 -0
- package/lib/components/SwipeListControlBlock/SwipeListControlBlockContent.js +2 -0
- package/lib/components/SwipeListControlBlock/SwipeListControlBlockContent.js.map +1 -0
- package/lib/ui-kit/BlockWrapper.js +1 -1
- package/lib/ui-kit/BlockWrapper.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/SwipeListContainer.d.ts +2 -1
- package/lib/ui-kit/SwipeListControl/SwipeListContainer.js +8 -5
- package/lib/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/SwipeListControl.fixture.mobile.d.ts +1 -0
- package/lib/ui-kit/SwipeListControl/SwipeListControl.js +3 -2
- package/lib/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +2 -0
- package/lib/ui-kit/SwipeListControl/SwipeListControlDots.js +12 -3
- package/lib/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +7 -0
- package/lib/utils/style.d.ts +1 -0
- package/lib/utils/style.js +2 -0
- package/lib/utils/style.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +25 -12
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/CarouselTariffsCard/CarouselTariffsCard.d.ts +1 -1
- package/mobile/bundle/components/CarouselTariffsCard/CarouselTariffsCardContent.d.ts +1 -1
- package/mobile/bundle/components/LinkDocs/LinkDocsContent.d.ts +4 -0
- package/mobile/bundle/components/SwipeListControlBlock/SwipeListControlBlock.d.ts +6 -0
- package/mobile/bundle/components/SwipeListControlBlock/SwipeListControlBlockContent.d.ts +5 -0
- package/mobile/bundle/ui-kit/SwipeListControl/SwipeListContainer.d.ts +2 -1
- package/mobile/bundle/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +2 -0
- package/mobile/bundle/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +7 -0
- package/mobile/bundle/utils/style.d.ts +1 -0
- package/mobile/dist/components/CarouselCard/CarouselCard.js +2 -2
- package/mobile/dist/components/CarouselCard/CarouselCard.js.map +1 -1
- package/mobile/dist/components/CarouselProgramsCard/CarouselProgramsCard.js +1 -1
- package/mobile/dist/components/CarouselProgramsCard/CarouselProgramsCard.js.map +1 -1
- package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCard.d.ts +1 -1
- package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCard.js +12 -9
- package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
- package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCardContent.d.ts +1 -1
- package/mobile/dist/components/LinkDocs/LinkDocsContent.d.ts +4 -0
- package/mobile/dist/components/SwipeListControlBlock/SwipeListControlBlock.d.ts +6 -0
- package/mobile/dist/components/SwipeListControlBlock/SwipeListControlBlock.js +14 -0
- package/mobile/dist/components/SwipeListControlBlock/SwipeListControlBlock.js.map +1 -0
- package/mobile/dist/components/SwipeListControlBlock/SwipeListControlBlockContent.d.ts +5 -0
- package/mobile/dist/components/SwipeListControlBlock/SwipeListControlBlockContent.js +2 -0
- package/mobile/dist/components/SwipeListControlBlock/SwipeListControlBlockContent.js.map +1 -0
- package/mobile/dist/ui-kit/BlockWrapper.js +1 -1
- package/mobile/dist/ui-kit/BlockWrapper.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.d.ts +2 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.js +8 -5
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControl.js +3 -2
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +2 -0
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlDots.js +12 -3
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +7 -0
- package/mobile/dist/utils/style.d.ts +1 -0
- package/mobile/dist/utils/style.js +5 -0
- package/mobile/dist/utils/style.js.map +1 -0
- package/mobile/lib/components/CarouselCard/CarouselCard.js +2 -2
- package/mobile/lib/components/CarouselCard/CarouselCard.js.map +1 -1
- package/mobile/lib/components/CarouselProgramsCard/CarouselProgramsCard.js +1 -1
- package/mobile/lib/components/CarouselProgramsCard/CarouselProgramsCard.js.map +1 -1
- package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCard.d.ts +1 -1
- package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCard.js +12 -9
- package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
- package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCardContent.d.ts +1 -1
- package/mobile/lib/components/LinkDocs/LinkDocsContent.d.ts +4 -0
- package/mobile/lib/components/SwipeListControlBlock/SwipeListControlBlock.d.ts +6 -0
- package/mobile/lib/components/SwipeListControlBlock/SwipeListControlBlock.js +12 -0
- package/mobile/lib/components/SwipeListControlBlock/SwipeListControlBlock.js.map +1 -0
- package/mobile/lib/components/SwipeListControlBlock/SwipeListControlBlockContent.d.ts +5 -0
- package/mobile/lib/components/SwipeListControlBlock/SwipeListControlBlockContent.js +2 -0
- package/mobile/lib/components/SwipeListControlBlock/SwipeListControlBlockContent.js.map +1 -0
- package/mobile/lib/ui-kit/BlockWrapper.js +1 -1
- package/mobile/lib/ui-kit/BlockWrapper.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.d.ts +2 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.js +8 -5
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControl.js +3 -2
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +2 -0
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlDots.js +12 -3
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +7 -0
- package/mobile/lib/utils/style.d.ts +1 -0
- package/mobile/lib/utils/style.js +2 -0
- package/mobile/lib/utils/style.js.map +1 -0
- package/mobile/src/common.css +11 -0
- package/mobile/src/components/Carousel/Carousel.ui.json +8 -0
- package/mobile/src/components/CarouselCard/CarouselCard.tsx +11 -5
- package/mobile/src/components/CarouselProgramsCard/CarouselProgramsCard.tsx +1 -1
- package/mobile/src/components/CarouselTariffsCard/CarouselTariffsCard.example.json +11 -3
- package/mobile/src/components/CarouselTariffsCard/CarouselTariffsCard.tsx +29 -17
- package/mobile/src/components/CarouselTariffsCard/CarouselTariffsCardContent.ts +1 -1
- package/mobile/src/components/LinkDocs/LinkDocsContent.ts +4 -0
- package/mobile/src/components/SwipeListControlBlock/SwipeListControlBlock.example.json +18 -0
- package/mobile/src/components/SwipeListControlBlock/SwipeListControlBlock.tsx +23 -0
- package/mobile/src/components/SwipeListControlBlock/SwipeListControlBlock.ui.json +1 -0
- package/mobile/src/components/SwipeListControlBlock/SwipeListControlBlockContent.ts +6 -0
- package/mobile/src/ui-kit/BlockWrapper.tsx +1 -1
- package/mobile/src/ui-kit/SwipeListControl/SwipeListContainer.tsx +19 -10
- package/mobile/src/ui-kit/SwipeListControl/SwipeListControl.tsx +6 -2
- package/mobile/src/ui-kit/SwipeListControl/SwipeListControlDots.tsx +20 -4
- package/mobile/src/ui-kit/SwipeListControl/SwipeListControlProps.ts +8 -0
- package/mobile/src/utils/style.ts +2 -0
- package/package.json +2 -2
- package/src/common.css +11 -0
- package/src/components/Blocks.ts +2 -0
- package/src/components/Carousel/Carousel.ui.json +8 -0
- package/src/components/CarouselCard/CarouselCard.tsx +11 -5
- package/src/components/CarouselProgramsCard/CarouselProgramsCard.tsx +1 -1
- package/src/components/CarouselTariffsCard/CarouselTariffsCard.example.json +11 -3
- package/src/components/CarouselTariffsCard/CarouselTariffsCard.fixture.tsx +3 -3
- package/src/components/CarouselTariffsCard/CarouselTariffsCard.tsx +29 -17
- package/src/components/CarouselTariffsCard/CarouselTariffsCardContent.ts +1 -1
- package/src/components/LinkDocs/LinkDocsContent.ts +4 -0
- package/src/components/SwipeListControlBlock/SwipeListControlBlock.example.json +18 -0
- package/src/components/SwipeListControlBlock/SwipeListControlBlock.fixture.tsx +27 -0
- package/src/components/SwipeListControlBlock/SwipeListControlBlock.tsx +23 -0
- package/src/components/SwipeListControlBlock/SwipeListControlBlock.ui.json +1 -0
- package/src/components/SwipeListControlBlock/SwipeListControlBlockContent.ts +6 -0
- package/src/icons/IconName.ts +333 -6
- package/src/ui-kit/BlockWrapper.tsx +1 -1
- package/src/ui-kit/SwipeListControl/SwipeListContainer.tsx +19 -10
- package/src/ui-kit/SwipeListControl/SwipeListControl.fixture.mobile.tsx +6 -1
- package/src/ui-kit/SwipeListControl/SwipeListControl.tsx +6 -2
- package/src/ui-kit/SwipeListControl/SwipeListControlDots.tsx +20 -4
- package/src/ui-kit/SwipeListControl/SwipeListControlProps.ts +8 -0
- package/src/utils/style.ts +2 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwipeListContainer.js","sourceRoot":"","sources":["../../../src/ui-kit/SwipeListControl/SwipeListContainer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAElE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
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ACR,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,kFAAkF;AAClF,MAAM,iBAAiB,GAAG,CAAC,OAAe,EAAE,iBAAiB,GAAG,CAAC,EAA0B,EAAE,CAAC,CAAC;IAC7F,UAAU,EAAE,GAAG,CAAC,OAAO,IAAI;IAC3B,WAAW,EAAE,GAAG,CAAC,OAAO,IAAI;IAC5B,WAAW,EAAE,GAAG,OAAO,IAAI;IAC3B,YAAY,EAAE,GAAG,OAAO,GAAG,iBAAiB,IAAI;CACjD,CAAC,CAAC;AAEH,MAAM,iBAAiB,GAAG,CAAC,mBAAwC,EAAE,EAAE,CACrE,mBAAmB;KAChB,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAmD,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;KACtE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,iBAAiB,IAAI,GAAG,CAAC;KAChD,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
3
|
+
import { style } from '../../utils/style.js';
|
|
3
4
|
import { SwipeListContainer } from './SwipeListContainer.js';
|
|
4
5
|
import { SwipeListControlDots } from './SwipeListControlDots.js';
|
|
5
6
|
import { useSwipeListScroll } from './useSwipeListScroll.js';
|
|
@@ -10,13 +11,13 @@ const DEFAULT_GAP = 14;
|
|
|
10
11
|
and get rid of a clipping effect caused by overflow: hidden.
|
|
11
12
|
*/
|
|
12
13
|
const DEFAULT_PADDING = 16;
|
|
13
|
-
export const SwipeListControl = JSX(({ className, gap = DEFAULT_GAP, padding = DEFAULT_PADDING, showDots = true, children, onVisibleIndicesChange, }) => {
|
|
14
|
+
export const SwipeListControl = JSX(({ className = '', gap = DEFAULT_GAP, padding = DEFAULT_PADDING, showDots = true, children, onVisibleIndicesChange, listType = 'horizontal-list', }) => {
|
|
14
15
|
const itemCount = Array.isArray(children) ? children.length : 0;
|
|
15
16
|
const [containerRef, scroll] = useSwipeListScroll({
|
|
16
17
|
itemCount,
|
|
17
18
|
onVisibleIndicesChange,
|
|
18
19
|
});
|
|
19
20
|
const [activeIndex] = scroll.visibleIndicesRange;
|
|
20
|
-
return (_jsxs("div", { className: className, children: [_jsx(SwipeListContainer, { containerRef: containerRef, activeIndex: activeIndex, visibleItemCount: 1, gap: gap, padding: padding, onVisibleIndicesChange: scroll.handleVisibleIndicesChange, children: children }), showDots ? (_jsx(SwipeListControlDots, { containerRef: containerRef, activeIndex: activeIndex, dotCount: itemCount })) : null] }));
|
|
21
|
+
return (_jsxs("div", { className: style(className, listType === 'vertical-list' ? 'relative h-full' : ''), children: [_jsx(SwipeListContainer, { containerRef: containerRef, activeIndex: activeIndex, visibleItemCount: 1, gap: gap, padding: padding, onVisibleIndicesChange: scroll.handleVisibleIndicesChange, listType: listType, children: children }), showDots ? (_jsx(SwipeListControlDots, { containerRef: containerRef, activeIndex: activeIndex, dotCount: itemCount, listType: listType })) : null] }));
|
|
21
22
|
});
|
|
22
23
|
//# sourceMappingURL=SwipeListControl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwipeListControl.js","sourceRoot":"","sources":["../../../src/ui-kit/SwipeListControl/SwipeListControl.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,MAAM,WAAW,GAAG,EAAE,CAAC;AAEvB;;;;GAIG;AACH,MA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IACjB,YAAY,EAAE,YAAY,EAC1B,WAAW,EAAE,WAAW,EACxB,gBAAgB,EAAE,CAAC,EACnB,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,OAAO,EAChB,sBAAsB,EAAE,MAAM,CAAC,0BAA0B,EACzD,QAAQ,EAAE,QAAQ,YAEjB,QAAQ,GACU,EACpB,QAAQ,CAAC,CAAC,CAAC,CACV,KAAC,oBAAoB,IACnB,YAAY,EAAE,YAAY,EAC1B,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,SAAS,EACnB,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import type { SwipeListControlType } from './SwipeListControlProps';
|
|
1
2
|
interface SwipeListControlDotsProps {
|
|
2
3
|
containerRef?: {
|
|
3
4
|
current: HTMLDivElement | null;
|
|
4
5
|
};
|
|
5
6
|
activeIndex?: number;
|
|
6
7
|
dotCount?: number;
|
|
8
|
+
listType?: SwipeListControlType;
|
|
7
9
|
}
|
|
8
10
|
export declare const SwipeListControlDots: import("@redneckz/uni-jsx").UNIComponent<SwipeListControlDotsProps, any, any>;
|
|
9
11
|
export {};
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
3
|
-
const
|
|
4
|
-
|
|
3
|
+
const containerStyles = {
|
|
4
|
+
'horizontal-list': 'mx-auto mt-5 w-fit',
|
|
5
|
+
'vertical-list': 'absolute flex-col justify-center h-full top-0 left-4',
|
|
6
|
+
};
|
|
7
|
+
const activeDotStyles = {
|
|
8
|
+
'horizontal-list': 'w-6',
|
|
9
|
+
'vertical-list': 'h-6',
|
|
10
|
+
};
|
|
11
|
+
const dotStyle = 'cursor-pointer bg-primary-main rounded-full transition-width duration-300';
|
|
12
|
+
const inactiveDotStyle = 'w-2 h-2 opacity-30';
|
|
13
|
+
export const SwipeListControlDots = JSX(({ containerRef, activeIndex, dotCount = 0, listType = 'horizontal-list' }) => {
|
|
5
14
|
const handleClick = (idx) => {
|
|
6
15
|
if (idx !== activeIndex && containerRef?.current) {
|
|
7
16
|
containerRef.current.children[idx]?.scrollIntoView({
|
|
@@ -10,6 +19,6 @@ export const SwipeListControlDots = JSX(({ containerRef, activeIndex, dotCount =
|
|
|
10
19
|
});
|
|
11
20
|
}
|
|
12
21
|
};
|
|
13
|
-
return dotCount ? (_jsx("div", { className:
|
|
22
|
+
return dotCount ? (_jsx("div", { className: `flex gap-2 ${containerStyles[listType]}`, children: new Array(dotCount).fill(null).map((_, idx) => (_jsx("div", { className: `${dotStyle} ${idx === activeIndex ? activeDotStyles[listType] : inactiveDotStyle}`, role: "button", "aria-hidden": true, onClick: () => handleClick(idx) }, String(idx)))) })) : null;
|
|
14
23
|
});
|
|
15
24
|
//# sourceMappingURL=SwipeListControlDots.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwipeListControlDots.js","sourceRoot":"","sources":["../../../src/ui-kit/SwipeListControl/SwipeListControlDots.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"SwipeListControlDots.js","sourceRoot":"","sources":["../../../src/ui-kit/SwipeListControl/SwipeListControlDots.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGxC,MAAM,eAAe,GAAyC;IAC5D,iBAAiB,EAAE,oBAAoB;IACvC,eAAe,EAAE,sDAAsD;CACxE,CAAC;AAEF,MAAM,eAAe,GAAyC;IAC5D,iBAAiB,EAAE,KAAK;IACxB,eAAe,EAAE,KAAK;CACvB,CAAC;AAEF,MAAM,QAAQ,GAAG,2EAA2E,CAAC;AAE7F,MAAM,gBAAgB,GAAG,oBAAoB,CAAC;AAS9C,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,CACrC,CAAC,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,GAAG,CAAC,EAAE,QAAQ,GAAG,iBAAiB,EAAE,EAAE,EAAE;IAC5E,MAAM,WAAW,GAAG,CAAC,GAAW,EAAE,EAAE;QAClC,IAAI,GAAG,KAAK,WAAW,IAAI,YAAY,EAAE,OAAO,EAAE;YAChD,YAAY,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,cAAc,CAAC;gBACjD,QAAQ,EAAE,QAAQ;gBAClB,KAAK,EAAE,SAAS;aACjB,CAAC,CAAC;SACJ;IACH,CAAC,CAAC;IAEF,OAAO,QAAQ,CAAC,CAAC,CAAC,CAChB,cAAK,SAAS,EAAE,cAAc,eAAe,CAAC,QAAQ,CAAC,EAAE,YACtD,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAW,EAAE,EAAE,CAAC,CACtD,cAEE,SAAS,EAAE,GAAG,QAAQ,IACpB,GAAG,KAAK,WAAW,CAAC,CAAC,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,gBACpD,EAAE,EACF,IAAI,EAAC,QAAQ,uBAEb,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,IAN1B,MAAM,CAAC,GAAG,CAAC,CAOhB,CACH,CAAC,GACE,CACP,CAAC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC,CACF,CAAC"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @title Вид
|
|
3
|
+
* @enumNames ["Горизонтальный", "Вертикальный"]
|
|
4
|
+
*/
|
|
5
|
+
export declare type SwipeListControlType = 'horizontal-list' | 'vertical-list';
|
|
1
6
|
/**
|
|
2
7
|
* @title Контейнер
|
|
3
8
|
*/
|
|
@@ -14,5 +19,7 @@ export interface SwipeListControlProps extends SwipeContainerProps {
|
|
|
14
19
|
className?: string;
|
|
15
20
|
/** @title Точки-индикаторы */
|
|
16
21
|
showDots?: boolean;
|
|
22
|
+
/** @hidden */
|
|
17
23
|
onVisibleIndicesChange?: (indices: number[]) => void;
|
|
24
|
+
listType?: SwipeListControlType;
|
|
18
25
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const style: (...atoms: (string | null | undefined)[]) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.js","sourceRoot":"","sources":["../../src/utils/style.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,GAAG,KAAoC,EAAU,EAAE,CACvE,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC"}
|
package/mobile/src/common.css
CHANGED
|
@@ -71,9 +71,20 @@ html {
|
|
|
71
71
|
display: flex;
|
|
72
72
|
overflow-x: scroll;
|
|
73
73
|
-webkit-overflow-scrolling: touch;
|
|
74
|
+
-webkit-scroll-snap-type: x mandatory;
|
|
75
|
+
-ms-scroll-snap-type: x mandatory;
|
|
74
76
|
scroll-snap-type: x mandatory;
|
|
75
77
|
}
|
|
76
78
|
|
|
79
|
+
.vertical-list {
|
|
80
|
+
height: 100%;
|
|
81
|
+
overflow-y: scroll;
|
|
82
|
+
-webkit-overflow-scrolling: touch;
|
|
83
|
+
-webkit-scroll-snap-type: y mandatory;
|
|
84
|
+
-ms-scroll-snap-type: y mandatory;
|
|
85
|
+
scroll-snap-type: y mandatory;
|
|
86
|
+
}
|
|
87
|
+
|
|
77
88
|
.gradient-color-text {
|
|
78
89
|
background: linear-gradient(180deg, #42ab44 0%, #f6db7d 100%);
|
|
79
90
|
-webkit-background-clip: text;
|
|
@@ -10,20 +10,26 @@ export interface CarouselCardProps extends CarouselCardContent, UniBlockProps {}
|
|
|
10
10
|
const BLOCK_CLASSES = 'absolute border border-solid border-gray w-full h-full';
|
|
11
11
|
|
|
12
12
|
const CARD_WIDTH_MAP: Record<CarouselCardVersion, string> = {
|
|
13
|
-
normal: 'min-w-[
|
|
13
|
+
normal: 'min-w-[970px]',
|
|
14
14
|
mini: 'min-w-[355px]',
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
export const CarouselCard = JSX<CarouselCardProps>(
|
|
18
18
|
({ className = '', button, description, title, version = 'normal' }) => (
|
|
19
|
-
<section className={`flex pb-9 pl-12 ${CARD_WIDTH_MAP[version]} ${className}`}>
|
|
19
|
+
<section className={`flex pb-9 pl-12 border-box ${CARD_WIDTH_MAP[version]} ${className}`}>
|
|
20
20
|
<div className="relative w-full">
|
|
21
21
|
<div className={`${BLOCK_CLASSES} z-10 top-9 right-12 bg-green-dark`} />
|
|
22
22
|
<div className={`${BLOCK_CLASSES} z-10 top-6 right-8 bg-green`} />
|
|
23
23
|
<div className={`${BLOCK_CLASSES} z-10 top-3 right-4 bg-green-light`} />
|
|
24
|
-
<div className="relative bg-white z-10
|
|
25
|
-
<Headline
|
|
26
|
-
|
|
24
|
+
<div className="relative bg-white z-10 p-10 border border-solid border-green-light">
|
|
25
|
+
<Headline
|
|
26
|
+
className="!p-0"
|
|
27
|
+
title={title}
|
|
28
|
+
description={description}
|
|
29
|
+
headlineVersion="L"
|
|
30
|
+
align="text-left"
|
|
31
|
+
/>
|
|
32
|
+
{button ? <div className="mt-14">{renderButton({ button })}</div> : null}
|
|
27
33
|
</div>
|
|
28
34
|
</div>
|
|
29
35
|
</section>
|
|
@@ -16,7 +16,7 @@ export const CarouselProgramsCard = JSX<CarouselTariffsCardProps>(
|
|
|
16
16
|
className={`font-sans border border-gray flex min-w-[536px] ${VersionStyleMap[version]} ${className}`}
|
|
17
17
|
{...rest}
|
|
18
18
|
>
|
|
19
|
-
<div className="w-[200px] min-w-[200px] self-
|
|
19
|
+
<div className="w-[200px] min-w-[200px] self-center">
|
|
20
20
|
{icon?.icon ? <Img image={getIconWithVersion(icon)} asSVG /> : null}
|
|
21
21
|
{icon?.src ? <Img image={icon} /> : null}
|
|
22
22
|
</div>
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
{
|
|
2
|
-
"title": "Заголовок",
|
|
2
|
+
"title": "Заголовок карточки",
|
|
3
3
|
"button": {
|
|
4
4
|
"href": "",
|
|
5
5
|
"text": "Кнопка",
|
|
6
6
|
"target": "_self",
|
|
7
|
-
"version": "
|
|
7
|
+
"version": "secondary"
|
|
8
|
+
},
|
|
9
|
+
"icon": {
|
|
10
|
+
"icon": "",
|
|
11
|
+
"format": "webp",
|
|
12
|
+
"size": {
|
|
13
|
+
"width": 267,
|
|
14
|
+
"height": 73
|
|
15
|
+
}
|
|
8
16
|
},
|
|
9
17
|
"isHighlighting": false,
|
|
10
|
-
"
|
|
18
|
+
"cardCells": [
|
|
11
19
|
{
|
|
12
20
|
"title": "Ячейка 1-1",
|
|
13
21
|
"description": "Описание 1-1"
|
|
@@ -1,49 +1,52 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import type { HeadlineCommonProps } from '../../model/HeadlineType';
|
|
3
|
-
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
4
|
-
import { VNode } from '../../model/VNode';
|
|
5
2
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
6
3
|
import { Button } from '../../ui-kit/Button/Button';
|
|
7
4
|
import { Foldable } from '../../ui-kit/Foldable/Foldable';
|
|
8
5
|
import { FoldablePartProps } from '../../ui-kit/Foldable/FoldablePartProps';
|
|
9
6
|
import { FoldableSection } from '../../ui-kit/Foldable/FoldableSection';
|
|
7
|
+
import { getIconWithVersion } from '../../utils/getIconWithVersion';
|
|
10
8
|
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
11
9
|
import { Icon } from '../../ui-kit/Icon/Icon';
|
|
12
10
|
import { Img } from '../../ui-kit/Img/Img';
|
|
11
|
+
import { Paragraph } from '../../ui-kit/Paragraph/Paragraph';
|
|
13
12
|
import type { CarouselTariffsCardContent } from './CarouselTariffsCardContent';
|
|
13
|
+
import type { HeadlineCommonProps } from '../../model/HeadlineType';
|
|
14
|
+
import type { Picture } from '../../model/Picture';
|
|
15
|
+
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
16
|
+
import type { VNode } from '../../model/VNode';
|
|
14
17
|
|
|
15
18
|
export interface CarouselTariffsCardProps extends CarouselTariffsCardContent, UniBlockProps {}
|
|
16
19
|
|
|
17
|
-
const
|
|
20
|
+
const VISIBLE_CELLS_COUNT = 1;
|
|
18
21
|
|
|
19
22
|
export const CarouselTariffsCard = JSX<CarouselTariffsCardProps>(
|
|
20
|
-
({ className = '', title, icon, isHighlighting, button,
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const
|
|
23
|
+
({ className = '', title, icon, isHighlighting, button, cardCells = [], ...rest }) => {
|
|
24
|
+
const cellsNode = cardCells.map(renderCardInfo);
|
|
25
|
+
const visibleCells = cellsNode.slice(0, VISIBLE_CELLS_COUNT);
|
|
26
|
+
const hiddenCells = cellsNode.slice(VISIBLE_CELLS_COUNT);
|
|
24
27
|
|
|
25
28
|
return (
|
|
26
29
|
<BlockWrapper
|
|
27
|
-
className={`font-sans relative bg-white border border-gray min-w-[322px] p-8
|
|
30
|
+
className={`font-sans relative bg-white border border-gray min-w-[322px] p-8 flex flex-col
|
|
28
31
|
${getHitStyle(isHighlighting)}
|
|
29
32
|
${className}`}
|
|
30
33
|
{...rest}
|
|
31
34
|
>
|
|
32
35
|
{isHighlighting ? renderHitIcon() : null}
|
|
33
|
-
{icon
|
|
36
|
+
{renderIconBlock(icon)}
|
|
34
37
|
{title ? (
|
|
35
38
|
<Heading className="text-primary-text text-center pt-2" headingType="h5" title={title} />
|
|
36
39
|
) : null}
|
|
37
40
|
{button ? <Button className="w-full mt-4" {...button} /> : null}
|
|
38
|
-
{
|
|
41
|
+
{cardCells.length ? (
|
|
39
42
|
<Foldable
|
|
40
43
|
renderFoldableSection={({ isUnfolded }) => (
|
|
41
44
|
<div>
|
|
42
|
-
{
|
|
43
|
-
<FoldableSection isUnfolded={isUnfolded}>{
|
|
45
|
+
{visibleCells}
|
|
46
|
+
<FoldableSection isUnfolded={isUnfolded}>{hiddenCells}</FoldableSection>
|
|
44
47
|
</div>
|
|
45
48
|
)}
|
|
46
|
-
renderFoldButton={
|
|
49
|
+
renderFoldButton={cardCells.length > 1 ? renderFoldButton : null}
|
|
47
50
|
/>
|
|
48
51
|
) : null}
|
|
49
52
|
</BlockWrapper>
|
|
@@ -51,8 +54,15 @@ export const CarouselTariffsCard = JSX<CarouselTariffsCardProps>(
|
|
|
51
54
|
},
|
|
52
55
|
);
|
|
53
56
|
|
|
57
|
+
const renderIconBlock = (icon?: Picture) => (
|
|
58
|
+
<div className="w-[267px] min-w-[267px] self-center">
|
|
59
|
+
{icon?.src ? <Img image={icon} /> : null}
|
|
60
|
+
{icon?.icon ? <Img image={getIconWithVersion(icon)} asSVG /> : null}
|
|
61
|
+
</div>
|
|
62
|
+
);
|
|
63
|
+
|
|
54
64
|
const getHitStyle = (isHighlighting?: boolean): string =>
|
|
55
|
-
isHighlighting ? 'mt-9 pt-[70px]' : 'mt-[70px] pt-
|
|
65
|
+
isHighlighting ? 'mt-9 pt-[70px]' : 'mt-[70px] pt-7';
|
|
56
66
|
|
|
57
67
|
const renderFoldButton = ({ isUnfolded, onToggle }: FoldablePartProps): VNode => (
|
|
58
68
|
<button
|
|
@@ -82,8 +92,10 @@ const renderCardInfo = (cell: HeadlineCommonProps, i: number): VNode => (
|
|
|
82
92
|
);
|
|
83
93
|
|
|
84
94
|
const renderHitIcon = (): VNode => (
|
|
85
|
-
<div className="absolute -top-7 -right-4 h-[60px] w-[60px] bg-white flex flex-col items-center justify-center shadow-[0_4px_25px_rgba(0,0,0,0.07)]">
|
|
95
|
+
<div className="absolute -top-7 -right-4 h-[60px] w-[60px] bg-white flex flex-col items-center justify-center rounded-md shadow-[0_4px_25px_rgba(0,0,0,0.07)]">
|
|
86
96
|
<Icon iconVersion="black" name="HeartIcon" width="23" height="22" asSVG />
|
|
87
|
-
<
|
|
97
|
+
<Paragraph size="text-s" font="font-normal" align="text-center" color="text-primary-text">
|
|
98
|
+
ХИТ
|
|
99
|
+
</Paragraph>
|
|
88
100
|
</div>
|
|
89
101
|
);
|
|
@@ -43,5 +43,9 @@ export type LinkDocsContent = HeadlineCommonProps & {
|
|
|
43
43
|
orientation?: ListOrientation; // TODO: мобильный проп
|
|
44
44
|
/** @title Рамка элементов (моб.) */ // TODO: мобильный проп
|
|
45
45
|
hasBorder?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* @title Выравнивание
|
|
48
|
+
* @default text-center
|
|
49
|
+
*/
|
|
46
50
|
align?: TextAlign;
|
|
47
51
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"content": {
|
|
3
|
+
"listType": "vertical-list"
|
|
4
|
+
},
|
|
5
|
+
"style": ["col-span-12", "h-96"],
|
|
6
|
+
"type": "SwipeListControlBlock",
|
|
7
|
+
"blocks": [
|
|
8
|
+
{
|
|
9
|
+
"type": "Headline",
|
|
10
|
+
"content": {
|
|
11
|
+
"title": "Заголовок блока",
|
|
12
|
+
"description": "Описание блока",
|
|
13
|
+
"headlineVersion": "M"
|
|
14
|
+
},
|
|
15
|
+
"style": ["col-span-12"]
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { renderChildren } from '../../BlockRenderer/renderChildren';
|
|
3
|
+
import type { JSXBlock, UniBlockProps } from '../../model/JSXBlock';
|
|
4
|
+
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
5
|
+
import { SwipeListControl } from '../../ui-kit/SwipeListControl/SwipeListControl';
|
|
6
|
+
import type { SwipeListControlBlockContent } from './SwipeListControlBlockContent';
|
|
7
|
+
|
|
8
|
+
interface SwipeListControlBlockProps extends SwipeListControlBlockContent, UniBlockProps {}
|
|
9
|
+
|
|
10
|
+
export const SwipeListControlBlock: JSXBlock<SwipeListControlBlockProps> =
|
|
11
|
+
JSX<SwipeListControlBlockProps>(({ gap, listType, padding, showDots, options, ...rest }) => {
|
|
12
|
+
return (
|
|
13
|
+
<BlockWrapper {...rest}>
|
|
14
|
+
<SwipeListControl gap={gap} listType={listType} padding={padding} showDots={showDots}>
|
|
15
|
+
{renderChildren({ ...rest, options })}
|
|
16
|
+
</SwipeListControl>
|
|
17
|
+
</BlockWrapper>
|
|
18
|
+
);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
SwipeListControlBlock.childrenTypes = {
|
|
22
|
+
exclude: ['SwipeListControlBlock'],
|
|
23
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
@@ -10,7 +10,7 @@ interface BlockWrapperProps extends UniBlockProps {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export const BlockWrapper = JSX<BlockWrapperProps>(
|
|
13
|
-
({ className, block, tag = 'section', role, children }) => {
|
|
13
|
+
({ className = '', block, tag = 'section', role, children }) => {
|
|
14
14
|
const Tag: any = tag;
|
|
15
15
|
|
|
16
16
|
const ref = useBlockIntersectionObserver(block);
|
|
@@ -2,7 +2,8 @@ import { JSX } from '@redneckz/uni-jsx';
|
|
|
2
2
|
import { useCallback, useRef } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
3
|
import type { IntersectionObserverOptions } from '../../hooks/useIntersectionObserver';
|
|
4
4
|
import { mapChildren } from '../../utils/mapChildren';
|
|
5
|
-
import
|
|
5
|
+
import { style } from '../../utils/style';
|
|
6
|
+
import type { SwipeContainerProps, SwipeListControlType } from './SwipeListControlProps';
|
|
6
7
|
import { SwipeListItem } from './SwipeListItem';
|
|
7
8
|
|
|
8
9
|
type ItemsVisibilityList = Array<IntersectionObserverEntry | undefined>;
|
|
@@ -20,6 +21,7 @@ interface SwipeListContainerProps extends SwipeContainerProps {
|
|
|
20
21
|
snapAlign?: 'snap-start' | 'snap-center' | 'snap-end';
|
|
21
22
|
onVisibleItemsChange?: (itemsVisibilityList: ItemsVisibilityList) => void;
|
|
22
23
|
onVisibleIndicesChange?: (indices: number[]) => void;
|
|
24
|
+
listType?: SwipeListControlType;
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
const childStyleMap = ['min-w-[100%]', 'min-w-[50%]', 'min-w-[33.33%]', 'min-w-[25%]'];
|
|
@@ -32,6 +34,7 @@ export const SwipeListContainer = JSX<SwipeListContainerProps>(
|
|
|
32
34
|
visibleItemCount = 0,
|
|
33
35
|
gap = 0,
|
|
34
36
|
padding = 0,
|
|
37
|
+
listType = 'horizontal-list',
|
|
35
38
|
snapAlign = 'snap-center',
|
|
36
39
|
children,
|
|
37
40
|
onVisibleItemsChange,
|
|
@@ -54,25 +57,31 @@ export const SwipeListContainer = JSX<SwipeListContainerProps>(
|
|
|
54
57
|
},
|
|
55
58
|
[onVisibleItemsChange, onVisibleIndicesChange],
|
|
56
59
|
);
|
|
60
|
+
|
|
57
61
|
const additionPadding = visibleItemCount > 0 ? gap * Number(visibleItemCount) - 1 : 0;
|
|
58
62
|
|
|
63
|
+
const isHorizontalList = listType === 'horizontal-list';
|
|
64
|
+
const containerStyle = {
|
|
65
|
+
...(isHorizontalList ? getContainerStyle(padding, additionPadding) : {}),
|
|
66
|
+
gap: `${gap}px`,
|
|
67
|
+
};
|
|
68
|
+
|
|
59
69
|
return (
|
|
60
70
|
<div
|
|
61
|
-
className={
|
|
62
|
-
style={
|
|
63
|
-
...getContainerStyle(padding, additionPadding),
|
|
64
|
-
gap: `${gap}px`,
|
|
65
|
-
}}
|
|
71
|
+
className={style('box-border overflow-auto no-scrollbar', listType, className)}
|
|
72
|
+
style={containerStyle}
|
|
66
73
|
role="list"
|
|
67
74
|
ref={containerRef}
|
|
68
75
|
>
|
|
69
76
|
{mapChildren((child, idx) => (
|
|
70
77
|
<SwipeListItem
|
|
71
78
|
key={String(idx)}
|
|
72
|
-
className={
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
79
|
+
className={style(
|
|
80
|
+
snapAlign,
|
|
81
|
+
visibleItemCount ? childStyleMap[visibleItemCount - 1] : '',
|
|
82
|
+
listType === 'vertical-list' ? 'h-full' : '',
|
|
83
|
+
)}
|
|
84
|
+
style={isHorizontalList ? getContainerStyle(padding / 4) : {}}
|
|
76
85
|
activeIndex={activeIndex}
|
|
77
86
|
idx={idx}
|
|
78
87
|
observerOptions={observerOptions}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { style } from '../../utils/style';
|
|
2
3
|
import { SwipeListContainer } from './SwipeListContainer';
|
|
3
4
|
import { SwipeListControlDots } from './SwipeListControlDots';
|
|
4
5
|
import type { SwipeListControlProps } from './SwipeListControlProps';
|
|
@@ -15,12 +16,13 @@ const DEFAULT_PADDING = 16;
|
|
|
15
16
|
|
|
16
17
|
export const SwipeListControl = JSX<SwipeListControlProps>(
|
|
17
18
|
({
|
|
18
|
-
className,
|
|
19
|
+
className = '',
|
|
19
20
|
gap = DEFAULT_GAP,
|
|
20
21
|
padding = DEFAULT_PADDING,
|
|
21
22
|
showDots = true,
|
|
22
23
|
children,
|
|
23
24
|
onVisibleIndicesChange,
|
|
25
|
+
listType = 'horizontal-list',
|
|
24
26
|
}) => {
|
|
25
27
|
const itemCount = Array.isArray(children) ? children.length : 0;
|
|
26
28
|
|
|
@@ -31,7 +33,7 @@ export const SwipeListControl = JSX<SwipeListControlProps>(
|
|
|
31
33
|
const [activeIndex] = scroll.visibleIndicesRange;
|
|
32
34
|
|
|
33
35
|
return (
|
|
34
|
-
<div className={className}>
|
|
36
|
+
<div className={style(className, listType === 'vertical-list' ? 'relative h-full' : '')}>
|
|
35
37
|
<SwipeListContainer
|
|
36
38
|
containerRef={containerRef}
|
|
37
39
|
activeIndex={activeIndex}
|
|
@@ -39,6 +41,7 @@ export const SwipeListControl = JSX<SwipeListControlProps>(
|
|
|
39
41
|
gap={gap}
|
|
40
42
|
padding={padding}
|
|
41
43
|
onVisibleIndicesChange={scroll.handleVisibleIndicesChange}
|
|
44
|
+
listType={listType}
|
|
42
45
|
>
|
|
43
46
|
{children}
|
|
44
47
|
</SwipeListContainer>
|
|
@@ -47,6 +50,7 @@ export const SwipeListControl = JSX<SwipeListControlProps>(
|
|
|
47
50
|
containerRef={containerRef}
|
|
48
51
|
activeIndex={activeIndex}
|
|
49
52
|
dotCount={itemCount}
|
|
53
|
+
listType={listType}
|
|
50
54
|
/>
|
|
51
55
|
) : null}
|
|
52
56
|
</div>
|
|
@@ -1,15 +1,29 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import type { SwipeListControlType } from './SwipeListControlProps';
|
|
2
3
|
|
|
3
|
-
const
|
|
4
|
+
const containerStyles: Record<SwipeListControlType, string> = {
|
|
5
|
+
'horizontal-list': 'mx-auto mt-5 w-fit',
|
|
6
|
+
'vertical-list': 'absolute flex-col justify-center h-full top-0 left-4',
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const activeDotStyles: Record<SwipeListControlType, string> = {
|
|
10
|
+
'horizontal-list': 'w-6',
|
|
11
|
+
'vertical-list': 'h-6',
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const dotStyle = 'cursor-pointer bg-primary-main rounded-full transition-width duration-300';
|
|
15
|
+
|
|
16
|
+
const inactiveDotStyle = 'w-2 h-2 opacity-30';
|
|
4
17
|
|
|
5
18
|
interface SwipeListControlDotsProps {
|
|
6
19
|
containerRef?: { current: HTMLDivElement | null };
|
|
7
20
|
activeIndex?: number;
|
|
8
21
|
dotCount?: number;
|
|
22
|
+
listType?: SwipeListControlType;
|
|
9
23
|
}
|
|
10
24
|
|
|
11
25
|
export const SwipeListControlDots = JSX<SwipeListControlDotsProps>(
|
|
12
|
-
({ containerRef, activeIndex, dotCount = 0 }) => {
|
|
26
|
+
({ containerRef, activeIndex, dotCount = 0, listType = 'horizontal-list' }) => {
|
|
13
27
|
const handleClick = (idx: number) => {
|
|
14
28
|
if (idx !== activeIndex && containerRef?.current) {
|
|
15
29
|
containerRef.current.children[idx]?.scrollIntoView({
|
|
@@ -20,11 +34,13 @@ export const SwipeListControlDots = JSX<SwipeListControlDotsProps>(
|
|
|
20
34
|
};
|
|
21
35
|
|
|
22
36
|
return dotCount ? (
|
|
23
|
-
<div className=
|
|
37
|
+
<div className={`flex gap-2 ${containerStyles[listType]}`}>
|
|
24
38
|
{new Array(dotCount).fill(null).map((_, idx: number) => (
|
|
25
39
|
<div
|
|
26
40
|
key={String(idx)}
|
|
27
|
-
className={`${dotStyle} ${
|
|
41
|
+
className={`${dotStyle} ${
|
|
42
|
+
idx === activeIndex ? activeDotStyles[listType] : inactiveDotStyle
|
|
43
|
+
}`}
|
|
28
44
|
role="button"
|
|
29
45
|
aria-hidden
|
|
30
46
|
onClick={() => handleClick(idx)}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @title Вид
|
|
3
|
+
* @enumNames ["Горизонтальный", "Вертикальный"]
|
|
4
|
+
*/
|
|
5
|
+
export type SwipeListControlType = 'horizontal-list' | 'vertical-list';
|
|
6
|
+
|
|
1
7
|
/**
|
|
2
8
|
* @title Контейнер
|
|
3
9
|
*/
|
|
@@ -15,5 +21,7 @@ export interface SwipeListControlProps extends SwipeContainerProps {
|
|
|
15
21
|
className?: string;
|
|
16
22
|
/** @title Точки-индикаторы */
|
|
17
23
|
showDots?: boolean;
|
|
24
|
+
/** @hidden */
|
|
18
25
|
onVisibleIndicesChange?: (indices: number[]) => void;
|
|
26
|
+
listType?: SwipeListControlType;
|
|
19
27
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redneckz/wildless-cms-uni-blocks",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "ЦК",
|
|
@@ -188,7 +188,7 @@
|
|
|
188
188
|
"path": "lib/common.css"
|
|
189
189
|
},
|
|
190
190
|
{
|
|
191
|
-
"limit": "
|
|
191
|
+
"limit": "47 kB",
|
|
192
192
|
"path": "bundle/bundle.umd.min.js"
|
|
193
193
|
}
|
|
194
194
|
],
|
package/src/common.css
CHANGED
|
@@ -71,9 +71,20 @@ html {
|
|
|
71
71
|
display: flex;
|
|
72
72
|
overflow-x: scroll;
|
|
73
73
|
-webkit-overflow-scrolling: touch;
|
|
74
|
+
-webkit-scroll-snap-type: x mandatory;
|
|
75
|
+
-ms-scroll-snap-type: x mandatory;
|
|
74
76
|
scroll-snap-type: x mandatory;
|
|
75
77
|
}
|
|
76
78
|
|
|
79
|
+
.vertical-list {
|
|
80
|
+
height: 100%;
|
|
81
|
+
overflow-y: scroll;
|
|
82
|
+
-webkit-overflow-scrolling: touch;
|
|
83
|
+
-webkit-scroll-snap-type: y mandatory;
|
|
84
|
+
-ms-scroll-snap-type: y mandatory;
|
|
85
|
+
scroll-snap-type: y mandatory;
|
|
86
|
+
}
|
|
87
|
+
|
|
77
88
|
.gradient-color-text {
|
|
78
89
|
background: linear-gradient(180deg, #42ab44 0%, #f6db7d 100%);
|
|
79
90
|
-webkit-background-clip: text;
|