@redneckz/wildless-cms-uni-blocks 0.14.147 → 0.14.149
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 +67 -14
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/OfficesAtmsMap/OfficesAtmsMapContent.d.ts +2 -3
- package/bundle/components/TabsLayout/TabsLayout.d.ts +5 -0
- package/bundle/components/TabsLayout/TabsLayoutButton.d.ts +10 -0
- package/bundle/components/TabsLayout/TabsLayoutContent.d.ts +21 -0
- package/bundle/components/TabsLayout/TabsLayoutRedirectTab.d.ts +6 -0
- package/bundle/components/TabsLayout/alignTabStyle.d.ts +2 -0
- package/bundle/ui-kit/Shimmer/Shimmer.d.ts +5 -0
- package/bundle/ui-kit/SwipeListControl/SwipeListContainer.d.ts +2 -2
- package/bundle/ui-kit/SwipeListControl/useSwipeListScroll.d.ts +1 -1
- package/dist/components/Blocks.js +3 -1
- package/dist/components/Blocks.js.map +1 -1
- package/dist/components/Blocks.mobile.js +3 -1
- package/dist/components/Blocks.mobile.js.map +1 -1
- package/dist/components/ContentPage/ContentPage.page.json +0 -37
- package/dist/components/OfficesAtmsMap/OfficesAtmsMapContent.d.ts +2 -3
- package/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +2 -2
- package/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
- package/dist/components/Placeholder/Placeholder.js +2 -7
- package/dist/components/Placeholder/Placeholder.js.map +1 -1
- package/dist/components/TabsLayout/TabsLayout.d.ts +5 -0
- package/dist/components/TabsLayout/TabsLayout.js +32 -0
- package/dist/components/TabsLayout/TabsLayout.js.map +1 -0
- package/dist/components/TabsLayout/TabsLayoutButton.d.ts +10 -0
- package/dist/components/TabsLayout/TabsLayoutButton.js +23 -0
- package/dist/components/TabsLayout/TabsLayoutButton.js.map +1 -0
- package/dist/components/TabsLayout/TabsLayoutContent.d.ts +21 -0
- package/dist/components/TabsLayout/TabsLayoutContent.js +2 -0
- package/dist/components/TabsLayout/TabsLayoutContent.js.map +1 -0
- package/dist/components/TabsLayout/TabsLayoutRedirectTab.d.ts +6 -0
- package/dist/components/TabsLayout/TabsLayoutRedirectTab.js +17 -0
- package/dist/components/TabsLayout/TabsLayoutRedirectTab.js.map +1 -0
- package/dist/components/TabsLayout/alignTabStyle.d.ts +2 -0
- package/dist/components/TabsLayout/alignTabStyle.js +8 -0
- package/dist/components/TabsLayout/alignTabStyle.js.map +1 -0
- package/dist/setup-fixture.js +1 -1
- package/dist/setup-fixture.js.map +1 -1
- package/dist/ui-kit/Shimmer/Shimmer.d.ts +5 -0
- package/dist/ui-kit/Shimmer/Shimmer.js +13 -0
- package/dist/ui-kit/Shimmer/Shimmer.js.map +1 -0
- package/dist/ui-kit/SwipeListControl/SwipeListContainer.d.ts +2 -2
- package/dist/ui-kit/SwipeListControl/SwipeListContainer.js +2 -2
- package/dist/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/SwipeListItem.js +3 -2
- package/dist/ui-kit/SwipeListControl/SwipeListItem.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/useSwipeListScroll.d.ts +1 -1
- package/dist/ui-kit/SwipeListControl/useSwipeListScroll.js +6 -6
- package/dist/ui-kit/SwipeListControl/useSwipeListScroll.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/Blocks.js +3 -1
- package/lib/components/Blocks.js.map +1 -1
- package/lib/components/Blocks.mobile.js +3 -1
- package/lib/components/Blocks.mobile.js.map +1 -1
- package/lib/components/ContentPage/ContentPage.page.json +0 -37
- package/lib/components/OfficesAtmsMap/OfficesAtmsMapContent.d.ts +2 -3
- package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +2 -2
- package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
- package/lib/components/Placeholder/Placeholder.js +2 -7
- package/lib/components/Placeholder/Placeholder.js.map +1 -1
- package/lib/components/TabsLayout/TabsLayout.d.ts +5 -0
- package/lib/components/TabsLayout/TabsLayout.fixture.d.ts +6 -0
- package/lib/components/TabsLayout/TabsLayout.fixture.mobile.d.ts +6 -0
- package/lib/components/TabsLayout/TabsLayout.js +30 -0
- package/lib/components/TabsLayout/TabsLayout.js.map +1 -0
- package/lib/components/TabsLayout/TabsLayoutButton.d.ts +10 -0
- package/lib/components/TabsLayout/TabsLayoutButton.js +21 -0
- package/lib/components/TabsLayout/TabsLayoutButton.js.map +1 -0
- package/lib/components/TabsLayout/TabsLayoutContent.d.ts +21 -0
- package/lib/components/TabsLayout/TabsLayoutContent.js +2 -0
- package/lib/components/TabsLayout/TabsLayoutContent.js.map +1 -0
- package/lib/components/TabsLayout/TabsLayoutRedirectTab.d.ts +6 -0
- package/lib/components/TabsLayout/TabsLayoutRedirectTab.js +15 -0
- package/lib/components/TabsLayout/TabsLayoutRedirectTab.js.map +1 -0
- package/lib/components/TabsLayout/alignTabStyle.d.ts +2 -0
- package/lib/components/TabsLayout/alignTabStyle.js +6 -0
- package/lib/components/TabsLayout/alignTabStyle.js.map +1 -0
- package/lib/setup-fixture.js +1 -1
- package/lib/setup-fixture.js.map +1 -1
- package/lib/ui-kit/Shimmer/Shimmer.d.ts +5 -0
- package/lib/ui-kit/Shimmer/Shimmer.js +11 -0
- package/lib/ui-kit/Shimmer/Shimmer.js.map +1 -0
- package/lib/ui-kit/SwipeListControl/SwipeListContainer.d.ts +2 -2
- package/lib/ui-kit/SwipeListControl/SwipeListContainer.js +2 -2
- package/lib/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/SwipeListItem.js +3 -2
- package/lib/ui-kit/SwipeListControl/SwipeListItem.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/useSwipeListScroll.d.ts +1 -1
- package/lib/ui-kit/SwipeListControl/useSwipeListScroll.js +6 -6
- package/lib/ui-kit/SwipeListControl/useSwipeListScroll.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +76 -23
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/OfficesAtmsMap/OfficesAtmsMapContent.d.ts +2 -3
- package/mobile/bundle/components/TabsLayout/TabsLayout.d.ts +5 -0
- package/mobile/bundle/components/TabsLayout/TabsLayoutButton.d.ts +10 -0
- package/mobile/bundle/components/TabsLayout/TabsLayoutContent.d.ts +21 -0
- package/mobile/bundle/components/TabsLayout/TabsLayoutRedirectTab.d.ts +6 -0
- package/mobile/bundle/components/TabsLayout/alignTabStyle.d.ts +2 -0
- package/mobile/bundle/ui-kit/Shimmer/Shimmer.d.ts +5 -0
- package/mobile/bundle/ui-kit/SwipeListControl/SwipeListContainer.d.ts +2 -2
- package/mobile/bundle/ui-kit/SwipeListControl/useSwipeListScroll.d.ts +1 -1
- package/mobile/dist/components/Blocks.js +3 -1
- package/mobile/dist/components/Blocks.js.map +1 -1
- package/mobile/dist/components/ContentPage/ContentPage.page.json +0 -37
- package/mobile/dist/components/OfficesAtmsMap/OfficesAtmsMapContent.d.ts +2 -3
- package/mobile/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +2 -2
- package/mobile/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
- package/mobile/dist/components/Placeholder/Placeholder.js +2 -7
- package/mobile/dist/components/Placeholder/Placeholder.js.map +1 -1
- package/mobile/dist/components/TabsLayout/TabsLayout.d.ts +5 -0
- package/mobile/dist/components/TabsLayout/TabsLayout.js +32 -0
- package/mobile/dist/components/TabsLayout/TabsLayout.js.map +1 -0
- package/mobile/dist/components/TabsLayout/TabsLayoutButton.d.ts +10 -0
- package/mobile/dist/components/TabsLayout/TabsLayoutButton.js +23 -0
- package/mobile/dist/components/TabsLayout/TabsLayoutButton.js.map +1 -0
- package/mobile/dist/components/TabsLayout/TabsLayoutContent.d.ts +21 -0
- package/mobile/dist/components/TabsLayout/TabsLayoutContent.js +2 -0
- package/mobile/dist/components/TabsLayout/TabsLayoutContent.js.map +1 -0
- package/mobile/dist/components/TabsLayout/TabsLayoutRedirectTab.d.ts +6 -0
- package/mobile/dist/components/TabsLayout/TabsLayoutRedirectTab.js +17 -0
- package/mobile/dist/components/TabsLayout/TabsLayoutRedirectTab.js.map +1 -0
- package/mobile/dist/components/TabsLayout/alignTabStyle.d.ts +2 -0
- package/mobile/dist/components/TabsLayout/alignTabStyle.js +8 -0
- package/mobile/dist/components/TabsLayout/alignTabStyle.js.map +1 -0
- package/mobile/dist/setup-fixture.js +1 -1
- package/mobile/dist/setup-fixture.js.map +1 -1
- package/mobile/dist/ui-kit/Shimmer/Shimmer.d.ts +5 -0
- package/mobile/dist/ui-kit/Shimmer/Shimmer.js +13 -0
- package/mobile/dist/ui-kit/Shimmer/Shimmer.js.map +1 -0
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.d.ts +2 -2
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.js +2 -2
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListItem.js +3 -2
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListItem.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/useSwipeListScroll.d.ts +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/useSwipeListScroll.js +6 -6
- package/mobile/dist/ui-kit/SwipeListControl/useSwipeListScroll.js.map +1 -1
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/Blocks.js +3 -1
- package/mobile/lib/components/Blocks.js.map +1 -1
- package/mobile/lib/components/ContentPage/ContentPage.page.json +0 -37
- package/mobile/lib/components/OfficesAtmsMap/OfficesAtmsMapContent.d.ts +2 -3
- package/mobile/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +2 -2
- package/mobile/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
- package/mobile/lib/components/Placeholder/Placeholder.js +2 -7
- package/mobile/lib/components/Placeholder/Placeholder.js.map +1 -1
- package/mobile/lib/components/TabsLayout/TabsLayout.d.ts +5 -0
- package/mobile/lib/components/TabsLayout/TabsLayout.js +30 -0
- package/mobile/lib/components/TabsLayout/TabsLayout.js.map +1 -0
- package/mobile/lib/components/TabsLayout/TabsLayoutButton.d.ts +10 -0
- package/mobile/lib/components/TabsLayout/TabsLayoutButton.js +21 -0
- package/mobile/lib/components/TabsLayout/TabsLayoutButton.js.map +1 -0
- package/mobile/lib/components/TabsLayout/TabsLayoutContent.d.ts +21 -0
- package/mobile/lib/components/TabsLayout/TabsLayoutContent.js +2 -0
- package/mobile/lib/components/TabsLayout/TabsLayoutContent.js.map +1 -0
- package/mobile/lib/components/TabsLayout/TabsLayoutRedirectTab.d.ts +6 -0
- package/mobile/lib/components/TabsLayout/TabsLayoutRedirectTab.js +15 -0
- package/mobile/lib/components/TabsLayout/TabsLayoutRedirectTab.js.map +1 -0
- package/mobile/lib/components/TabsLayout/alignTabStyle.d.ts +2 -0
- package/mobile/lib/components/TabsLayout/alignTabStyle.js +6 -0
- package/mobile/lib/components/TabsLayout/alignTabStyle.js.map +1 -0
- package/mobile/lib/setup-fixture.js +1 -1
- package/mobile/lib/setup-fixture.js.map +1 -1
- package/mobile/lib/ui-kit/Shimmer/Shimmer.d.ts +5 -0
- package/mobile/lib/ui-kit/Shimmer/Shimmer.js +11 -0
- package/mobile/lib/ui-kit/Shimmer/Shimmer.js.map +1 -0
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.d.ts +2 -2
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.js +2 -2
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListItem.js +3 -2
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListItem.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/useSwipeListScroll.d.ts +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/useSwipeListScroll.js +6 -6
- package/mobile/lib/ui-kit/SwipeListControl/useSwipeListScroll.js.map +1 -1
- package/mobile/src/components/Blocks.ts +3 -1
- package/mobile/src/components/ContentPage/ContentPage.page.json +0 -37
- package/mobile/src/components/OfficesAtmsMap/OfficesAtmsMap.ui.json +3 -0
- package/mobile/src/components/OfficesAtmsMap/OfficesAtmsMapContent.ts +2 -3
- package/mobile/src/components/OfficesAtmsMap/OfficesAtmsMapLayout.tsx +4 -8
- package/mobile/src/components/Placeholder/Placeholder.tsx +2 -19
- package/mobile/src/components/TabsLayout/TabsLayout.example.json +8 -0
- package/mobile/src/components/TabsLayout/TabsLayout.tsx +88 -0
- package/mobile/src/components/TabsLayout/TabsLayout.ui.json +11 -0
- package/mobile/src/components/TabsLayout/TabsLayoutButton.tsx +60 -0
- package/mobile/src/components/TabsLayout/TabsLayoutContent.ts +26 -0
- package/mobile/src/components/TabsLayout/TabsLayoutRedirectTab.tsx +26 -0
- package/mobile/src/components/TabsLayout/alignTabStyle.ts +7 -0
- package/mobile/src/setup-fixture.ts +1 -1
- package/mobile/src/ui-kit/Shimmer/Shimmer.tsx +29 -0
- package/mobile/src/ui-kit/SwipeListControl/SwipeListContainer.tsx +5 -4
- package/mobile/src/ui-kit/SwipeListControl/SwipeListItem.tsx +12 -3
- package/mobile/src/ui-kit/SwipeListControl/useSwipeListScroll.ts +10 -7
- package/package.json +2 -2
- package/src/components/Blocks.mobile.ts +3 -1
- package/src/components/Blocks.ts +3 -1
- package/src/components/ContentPage/ContentPage.page.json +0 -37
- package/src/components/OfficesAtmsMap/OfficesAtmsMap.fixture.mobile.tsx +4 -2
- package/src/components/OfficesAtmsMap/OfficesAtmsMap.fixture.tsx +4 -2
- package/src/components/OfficesAtmsMap/OfficesAtmsMap.ui.json +3 -0
- package/src/components/OfficesAtmsMap/OfficesAtmsMapContent.ts +2 -3
- package/src/components/OfficesAtmsMap/OfficesAtmsMapLayout.tsx +4 -8
- package/src/components/Placeholder/Placeholder.tsx +2 -19
- package/src/components/TabsLayout/TabsLayout.example.json +8 -0
- package/src/components/TabsLayout/TabsLayout.fixture.mobile.tsx +53 -0
- package/src/components/TabsLayout/TabsLayout.fixture.tsx +53 -0
- package/src/components/TabsLayout/TabsLayout.tsx +88 -0
- package/src/components/TabsLayout/TabsLayout.ui.json +11 -0
- package/src/components/TabsLayout/TabsLayoutButton.tsx +60 -0
- package/src/components/TabsLayout/TabsLayoutContent.ts +26 -0
- package/src/components/TabsLayout/TabsLayoutRedirectTab.tsx +26 -0
- package/src/components/TabsLayout/alignTabStyle.ts +7 -0
- package/src/setup-fixture.ts +1 -1
- package/src/ui-kit/Shimmer/Shimmer.tsx +29 -0
- package/src/ui-kit/SwipeListControl/SwipeListContainer.tsx +5 -4
- package/src/ui-kit/SwipeListControl/SwipeListItem.tsx +12 -3
- package/src/ui-kit/SwipeListControl/useSwipeListScroll.ts +10 -7
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
3
|
+
import { style } from '../../utils/style.js';
|
|
4
|
+
const GOLDEN_RATIO = 1.618;
|
|
5
|
+
export const Shimmer = JSX(({ className, size }) => (_jsx("figure", { className: style('m-0 mt-xl min-w-[80%]', className), children: renderShimmer(size) })));
|
|
6
|
+
const renderShimmer = (size = 3) => goldenSequence(100, size)
|
|
7
|
+
.map((_) => Math.floor(_))
|
|
8
|
+
.map(renderShimmerItem);
|
|
9
|
+
const renderShimmerItem = (width, index) => (_jsx("div", { style: { width: `${width || 100}%` }, className: "h-4 mt-xs bg-secondary-light" }, String(index)));
|
|
10
|
+
const goldenSequence = (first, size) => [first].concat(size > 0 ? goldenSequence(first / GOLDEN_RATIO, size - 1) : []);
|
|
11
|
+
//# sourceMappingURL=Shimmer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Shimmer.js","sourceRoot":"","sources":["../../../src/ui-kit/Shimmer/Shimmer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1C,MAAM,YAAY,GAAG,KAAK,CAAC;AAO3B,MAAM,CAAC,MAAM,OAAO,GAAG,GAAG,CAAe,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAChE,iBAAQ,SAAS,EAAE,KAAK,CAAC,uBAAuB,EAAE,SAAS,CAAC,YAAG,aAAa,CAAC,IAAI,CAAC,GAAU,CAC7F,CAAC,CAAC;AAEH,MAAM,aAAa,GAAG,CAAC,IAAI,GAAG,CAAC,EAAE,EAAE,CACjC,cAAc,CAAC,GAAG,EAAE,IAAI,CAAC;KACtB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;KACzB,GAAG,CAAC,iBAAiB,CAAC,CAAC;AAE5B,MAAM,iBAAiB,GAAG,CAAC,KAAa,EAAE,KAAa,EAAE,EAAE,CAAC,CAC1D,cAEE,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,GAAG,GAAG,EAAE,EACpC,SAAS,EAAC,8BAA8B,IAFnC,MAAM,CAAC,KAAK,CAAC,CAGlB,CACH,CAAC;AAEF,MAAM,cAAc,GAAG,CAAC,KAAa,EAAE,IAAY,EAAY,EAAE,CAC/D,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,KAAK,GAAG,YAAY,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { type SwipeListContainerContent } from './SwipeListControlContent';
|
|
2
2
|
declare type ItemsVisibilityList = Array<IntersectionObserverEntry | undefined>;
|
|
3
|
-
declare type SwipeListItemWidthAuto = 0;
|
|
4
3
|
/**
|
|
5
4
|
* @title Список
|
|
6
5
|
*/
|
|
7
6
|
interface SwipeListContainerProps extends SwipeListContainerContent {
|
|
8
7
|
className?: string;
|
|
8
|
+
itemClassName?: string;
|
|
9
9
|
containerRef?: {
|
|
10
10
|
current: HTMLDivElement | null;
|
|
11
11
|
};
|
|
12
12
|
activeIndex?: number;
|
|
13
|
-
visibleItemCount?:
|
|
13
|
+
visibleItemCount?: 0 | 1 | 2 | 3 | 4;
|
|
14
14
|
snapAlign?: 'snap-start' | 'snap-center' | 'snap-end';
|
|
15
15
|
gap?: number;
|
|
16
16
|
padding?: number;
|
|
@@ -6,7 +6,7 @@ import { style } from '../../utils/style.js';
|
|
|
6
6
|
import { getContainerHeight } from './getContainerHeight.js';
|
|
7
7
|
import { SwipeListItem } from './SwipeListItem.js';
|
|
8
8
|
const childStyleMap = ['min-w-full', '@lg:min-w-[50%]', '@lg:min-w-[33.3%]', '@lg:min-w-[25%]'];
|
|
9
|
-
export const SwipeListContainer = JSX(({ className
|
|
9
|
+
export const SwipeListContainer = JSX(({ className, itemClassName, containerRef, activeIndex, visibleItemCount = 0, gap = 0, padding = 0, listType = 'horizontal-list', snapAlign = 'snap-center', minHeight, children, onVisibleItemsChange, onVisibleIndicesChange, }) => {
|
|
10
10
|
const observerOptions = {
|
|
11
11
|
sensitivity: 1,
|
|
12
12
|
rootRef: containerRef,
|
|
@@ -27,7 +27,7 @@ export const SwipeListContainer = JSX(({ className = '', containerRef, activeInd
|
|
|
27
27
|
...(isVerticalList ? getContainerHeight(minHeight) : {}),
|
|
28
28
|
gap: `${gap}px`,
|
|
29
29
|
};
|
|
30
|
-
return (_jsx("div", { className: style('box-border overflow-auto no-scrollbar', listType, className), style: containerStyle, ref: containerRef, children: mapChildren((child, idx) => (_jsx(SwipeListItem, { className: style(snapAlign, visibleItemCount ? childStyleMap[visibleItemCount - 1] : '', isVerticalList ? 'h-full' : ''), style: isHorizontalList ? getContainerOffset(padding / 4) : {}, activeIndex: activeIndex, idx: idx, observerOptions: observerOptions, onIntersection: handleIntersection, children: child }, String(idx))))(children) }));
|
|
30
|
+
return (_jsx("div", { className: style('box-border overflow-auto no-scrollbar', listType, className), style: containerStyle, ref: containerRef, children: mapChildren((child, idx) => (_jsx(SwipeListItem, { className: style(snapAlign, visibleItemCount ? childStyleMap[visibleItemCount - 1] : '', isVerticalList ? 'h-full' : '', itemClassName), style: isHorizontalList ? getContainerOffset(padding / 4) : {}, activeIndex: activeIndex, idx: idx, observerOptions: observerOptions, onIntersection: handleIntersection, children: child }, String(idx))))(children) }));
|
|
31
31
|
});
|
|
32
32
|
// Styles used to compensate outer container padding to get rid of clipping effect
|
|
33
33
|
const getContainerOffset = (padding, additionalPadding = 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;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;
|
|
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;AACtD,OAAO,EAAE,KAAK,E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AAE,iBAAiB,GAAG,CAAC,EAA0B,EAAE,CAAC,CAAC;IAC9F,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"}
|
|
@@ -2,13 +2,14 @@ import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
|
|
|
2
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
3
3
|
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
4
4
|
import { useIntersectionObserver, } from '../../hooks/useIntersectionObserver.js';
|
|
5
|
-
|
|
5
|
+
import { style } from '../../utils/style.js';
|
|
6
|
+
export const SwipeListItem = JSX(({ className, style: inlineStyle, idx, activeIndex, observerOptions, children, onIntersection, }) => {
|
|
6
7
|
const observerCallback = useCallback((entries) => {
|
|
7
8
|
if (entries.length && onIntersection) {
|
|
8
9
|
onIntersection(idx || 0, entries[entries.length - 1]);
|
|
9
10
|
}
|
|
10
11
|
}, [onIntersection, idx]);
|
|
11
12
|
const ref = useIntersectionObserver(observerCallback, observerOptions);
|
|
12
|
-
return (_jsx("div", { className:
|
|
13
|
+
return (_jsx("div", { className: style('inline-block snap-always box-border', className), style: inlineStyle, "aria-current": Boolean(idx === activeIndex), ref: ref, children: children }));
|
|
13
14
|
});
|
|
14
15
|
//# sourceMappingURL=SwipeListItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwipeListItem.js","sourceRoot":"","sources":["../../../src/ui-kit/SwipeListControl/SwipeListItem.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EACL,uBAAuB,GAExB,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"SwipeListItem.js","sourceRoot":"","sources":["../../../src/ui-kit/SwipeListControl/SwipeListItem.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EACL,uBAAuB,GAExB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAc1C,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAC9B,CAAC,EACC,SAAS,EACT,KAAK,EAAE,WAAW,EAClB,GAAG,EACH,WAAW,EACX,eAAe,EACf,QAAQ,EACR,cAAc,GACf,EAAE,EAAE;IACH,MAAM,gBAAgB,GAAG,WAAW,CAClC,CAAC,OAAoC,EAAE,EAAE;QACvC,IAAI,OAAO,CAAC,MAAM,IAAI,cAAc,EAAE;YACpC,cAAc,CAAC,GAAG,IAAI,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;SACvD;IACH,CAAC,EACD,CAAC,cAAc,EAAE,GAAG,CAAC,CACtB,CAAC;IACF,MAAM,GAAG,GAAG,uBAAuB,CAAiB,gBAAgB,EAAE,eAAe,CAAC,CAAC;IAEvF,OAAO,CACL,cACE,SAAS,EAAE,KAAK,CAAC,qCAAqC,EAAE,SAAS,CAAC,EAClE,KAAK,EAAE,WAAW,kBACJ,OAAO,CAAC,GAAG,KAAK,WAAW,CAAC,EAC1C,GAAG,EAAE,GAAG,YAEP,QAAQ,GACL,CACP,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export interface SwipeListScroll {
|
|
2
2
|
scrollLeft: () => void;
|
|
3
3
|
scrollRight: () => void;
|
|
4
|
-
scrollTo: (idx: number) => void;
|
|
4
|
+
scrollTo: (idx: number, options?: ScrollIntoViewOptions) => void;
|
|
5
5
|
canScrollLeft: boolean;
|
|
6
6
|
canScrollRight: boolean;
|
|
7
7
|
visibleIndicesRange: [number, number];
|
|
@@ -39,13 +39,13 @@ export const useSwipeListScroll = ({ itemCount, onVisibleIndicesChange, }) => {
|
|
|
39
39
|
scrollToStart(containerRef.current);
|
|
40
40
|
}
|
|
41
41
|
}, [itemCount, canScrollRight]);
|
|
42
|
-
const scrollTo = useCallback((idx
|
|
42
|
+
const scrollTo = useCallback((idx, options = {
|
|
43
|
+
behavior: 'smooth',
|
|
44
|
+
block: 'nearest',
|
|
45
|
+
inline: 'center',
|
|
46
|
+
}) => {
|
|
43
47
|
if (containerRef?.current) {
|
|
44
|
-
containerRef.current.children[idx]?.scrollIntoView(
|
|
45
|
-
behavior: 'smooth',
|
|
46
|
-
block: 'nearest',
|
|
47
|
-
inline: 'center',
|
|
48
|
-
});
|
|
48
|
+
containerRef.current.children[idx]?.scrollIntoView(options);
|
|
49
49
|
}
|
|
50
50
|
}, [containerRef]);
|
|
51
51
|
return [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSwipeListScroll.js","sourceRoot":"","sources":["../../../src/ui-kit/SwipeListControl/useSwipeListScroll.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4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cAAc,EAAE;YAClB,QAAQ,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;SAC9C;aAAM;YACL,aAAa,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;SACrC;IACH,CAAC,EAAE,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC;IAEhC,MAAM,QAAQ,GAAG,WAAW,CAC1B,CACE,GAAW,EACX,UAAU;QACR,QAAQ,EAAE,QAAQ;QAClB,KAAK,EAAE,SAAS;QAChB,MAAM,EAAE,QAAQ;KACQ,EAC1B,EAAE;QACF,IAAI,YAAY,EAAE,OAAO,EAAE;YACzB,YAAY,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;SAC7D;IACH,CAAC,EACD,CAAC,YAAY,CAAC,CACf,CAAC;IAEF,OAAO;QACL,YAAY;QACZ;YACE,UAAU;YACV,WAAW;YACX,QAAQ;YACR,aAAa;YACb,cAAc;YACd,mBAAmB,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;YACzC,0BAA0B;SAC3B;KACF,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -36,6 +36,7 @@ import { RollupItem } from './RollupItem/RollupItem';
|
|
|
36
36
|
import { SafeDepositRental } from './SafeDepositRental/SafeDepositRental';
|
|
37
37
|
import { StepsBlock } from './StepsBlock/StepsBlock';
|
|
38
38
|
import { Tabs } from './Tabs/Tabs';
|
|
39
|
+
import { TabsLayout } from './TabsLayout/TabsLayout';
|
|
39
40
|
import { TariffsTable } from './TariffsTable/TariffsTable';
|
|
40
41
|
import { TextBlock } from './TextBlock/TextBlock';
|
|
41
42
|
import { UnitBlock } from './UnitBlock/UnitBlock';
|
|
@@ -72,14 +73,15 @@ export const Blocks: BlocksRegistry = {
|
|
|
72
73
|
Placeholder,
|
|
73
74
|
ProductBlock,
|
|
74
75
|
ProductGallery,
|
|
75
|
-
UnitBlock,
|
|
76
76
|
RepresentativeOfficeInfo,
|
|
77
77
|
RichTextBlock,
|
|
78
78
|
RollupItem,
|
|
79
79
|
SafeDepositRental,
|
|
80
80
|
StepsBlock,
|
|
81
81
|
Tabs,
|
|
82
|
+
TabsLayout,
|
|
82
83
|
TariffsTable,
|
|
83
84
|
TextBlock,
|
|
85
|
+
UnitBlock,
|
|
84
86
|
VerticalLayout,
|
|
85
87
|
};
|
|
@@ -28,43 +28,6 @@
|
|
|
28
28
|
"type": "Footer",
|
|
29
29
|
"style": ["col-span-12"]
|
|
30
30
|
}
|
|
31
|
-
],
|
|
32
|
-
"stickyBottomMenu": [
|
|
33
|
-
{
|
|
34
|
-
"type": "StickyBottomMenu",
|
|
35
|
-
"content": {
|
|
36
|
-
"menuItems": [
|
|
37
|
-
{
|
|
38
|
-
"title": "Кредиты",
|
|
39
|
-
"url": "#EmptyWalletIcon",
|
|
40
|
-
"icon": {
|
|
41
|
-
"icon": "EmptyWalletIcon"
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
"title": "Карты",
|
|
46
|
-
"url": "#CardIcon",
|
|
47
|
-
"icon": {
|
|
48
|
-
"icon": "CardIcon"
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
"title": "Вклады",
|
|
53
|
-
"url": "#SafeIcon",
|
|
54
|
-
"icon": {
|
|
55
|
-
"icon": "SafeIcon"
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
"title": "Инвестиции",
|
|
60
|
-
"url": "#ChartIcon",
|
|
61
|
-
"icon": {
|
|
62
|
-
"icon": "ChartIcon"
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
]
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
31
|
]
|
|
69
32
|
},
|
|
70
33
|
"blocks": []
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type UniBlockContent } from '../../model/JSXBlock';
|
|
2
2
|
import { type Picture } from '../../model/Picture';
|
|
3
|
+
import { type RichTextProps } from '../../ui-kit/RichText/RichTextProps';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* @title Пункт
|
|
@@ -22,10 +23,8 @@ export type OfficesDef = {
|
|
|
22
23
|
* @title Банкоматам
|
|
23
24
|
* @default {"dataType": "atms"}
|
|
24
25
|
*/
|
|
25
|
-
export type AtmsDef = {
|
|
26
|
+
export type AtmsDef = RichTextProps & {
|
|
26
27
|
dataType: 'atms';
|
|
27
|
-
/** @title Описание */
|
|
28
|
-
description: string;
|
|
29
28
|
/** @title Список */
|
|
30
29
|
list?: ItemList[];
|
|
31
30
|
};
|
|
@@ -5,7 +5,7 @@ import { type VNode } from '../../model/VNode';
|
|
|
5
5
|
import { ClientOnly } from '../../ui-kit/ClientOnly';
|
|
6
6
|
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
7
7
|
import { Img } from '../../ui-kit/Img/Img';
|
|
8
|
-
import {
|
|
8
|
+
import { RichText } from '../../ui-kit/RichText/RichText';
|
|
9
9
|
import { Text } from '../../ui-kit/Text/Text';
|
|
10
10
|
import { YandexMap } from '../../ui-kit/YandexMap/YandexMap';
|
|
11
11
|
import { style } from '../../utils/style';
|
|
@@ -75,14 +75,10 @@ export const OfficesAtmsMapLayout = JSX<OfficesAtmsMapLayoutProps<Branch | Atm>>
|
|
|
75
75
|
},
|
|
76
76
|
);
|
|
77
77
|
|
|
78
|
-
const renderDescriptionBlock = ({
|
|
79
|
-
|
|
78
|
+
const renderDescriptionBlock = ({ __html, list }: AtmsDef) =>
|
|
79
|
+
__html || list?.length ? (
|
|
80
80
|
<div className="p-xl mb-2xl border-b sm:border border-main-divider sm:rounded-md">
|
|
81
|
-
{
|
|
82
|
-
<Paragraph size="text-l" font="font-light">
|
|
83
|
-
{description}
|
|
84
|
-
</Paragraph>
|
|
85
|
-
) : null}
|
|
81
|
+
{__html ? <RichText __html={__html} /> : null}
|
|
86
82
|
{list?.length ? (
|
|
87
83
|
<div className="flex flex-col sm:flex-row gap-2xl sm:flex-wrap pt-xs">
|
|
88
84
|
{list.map((item, i) => (
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { type UniBlockProps } from '../../model/JSXBlock';
|
|
3
3
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
4
|
+
import { Shimmer } from '../../ui-kit/Shimmer/Shimmer';
|
|
4
5
|
import { style } from '../../utils/style';
|
|
5
6
|
import { Headline } from '../Headline/Headline';
|
|
6
7
|
import { type PlaceholderContent } from './PlaceholderContent';
|
|
7
8
|
|
|
8
9
|
export interface PlaceholderProps extends PlaceholderContent, UniBlockProps {}
|
|
9
10
|
|
|
10
|
-
const GOLDEN_RATIO = 1.618;
|
|
11
|
-
|
|
12
11
|
export const Placeholder = JSX<PlaceholderProps>(
|
|
13
12
|
({ className, title, description = 'Блок в разработке...', ...rest }) => (
|
|
14
13
|
<BlockWrapper className={style('box-border', className)} {...rest}>
|
|
@@ -20,23 +19,7 @@ export const Placeholder = JSX<PlaceholderProps>(
|
|
|
20
19
|
align="text-left"
|
|
21
20
|
isEmbedded={true}
|
|
22
21
|
/>
|
|
23
|
-
<
|
|
22
|
+
<Shimmer />
|
|
24
23
|
</BlockWrapper>
|
|
25
24
|
),
|
|
26
25
|
);
|
|
27
|
-
|
|
28
|
-
const renderShimmer = (size = 3) =>
|
|
29
|
-
goldenSequence(100, size)
|
|
30
|
-
.map((_) => Math.floor(_))
|
|
31
|
-
.map(renderShimmerItem);
|
|
32
|
-
|
|
33
|
-
const renderShimmerItem = (width: number, index: number) => (
|
|
34
|
-
<div
|
|
35
|
-
key={String(index)}
|
|
36
|
-
style={{ width: `${width || 100}%` }}
|
|
37
|
-
className="h-4 mt-xs bg-secondary-light"
|
|
38
|
-
/>
|
|
39
|
-
);
|
|
40
|
-
|
|
41
|
-
const goldenSequence = (first: number, size: number): number[] =>
|
|
42
|
-
[first].concat(size > 0 ? goldenSequence(first / GOLDEN_RATIO, size - 1) : []);
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
|
+
import { renderBlocksList } from '../../BlockRenderer/renderBlockList';
|
|
4
|
+
import { useCarouselControls } from '../../hooks/useCarouselControls';
|
|
5
|
+
import { type Align } from '../../model/Align';
|
|
6
|
+
import type { JSXBlock, UniBlockProps } from '../../model/JSXBlock';
|
|
7
|
+
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
8
|
+
import { SwipeListContainer } from '../../ui-kit/SwipeListControl/SwipeListContainer';
|
|
9
|
+
import { useSwipeListScroll } from '../../ui-kit/SwipeListControl/useSwipeListScroll';
|
|
10
|
+
import { style } from '../../utils/style';
|
|
11
|
+
import { CarouselScrollButtons } from '../Carousel/CarouselScrollButtons';
|
|
12
|
+
import { alignTabStyle } from './alignTabStyle';
|
|
13
|
+
import { TabsLayoutButton } from './TabsLayoutButton';
|
|
14
|
+
import { type Tab, type TabsLayoutContent } from './TabsLayoutContent';
|
|
15
|
+
import { TabsLayoutRedirectTab } from './TabsLayoutRedirectTab';
|
|
16
|
+
|
|
17
|
+
export interface TabsLayoutProps extends TabsLayoutContent, UniBlockProps {}
|
|
18
|
+
|
|
19
|
+
export const TabsLayout: JSXBlock<TabsLayoutProps> = JSX<TabsLayoutProps>(
|
|
20
|
+
({ className = '', tabs = [], block, tabAlign, ...rest }) => {
|
|
21
|
+
const [activeTabIndex, setActiveTabIndex] = useState(getInitSelectedIndex(tabs));
|
|
22
|
+
|
|
23
|
+
const slotName = getSlotName(tabs[activeTabIndex], activeTabIndex);
|
|
24
|
+
|
|
25
|
+
const itemCount = tabs.length;
|
|
26
|
+
|
|
27
|
+
const [activeSlideIndex, { inc: incActiveSlideIndex, dec: decActiveSlideIndex }] =
|
|
28
|
+
useCarouselControls({ itemCount }, activeTabIndex);
|
|
29
|
+
|
|
30
|
+
const [containerRef, scroll] = useSwipeListScroll<HTMLDivElement>({ itemCount });
|
|
31
|
+
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
scroll.scrollTo(activeTabIndex, { behavior: 'auto' });
|
|
34
|
+
}, []);
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<BlockWrapper className={style(className)} defaultPadding="p-0" {...rest}>
|
|
38
|
+
<div className="relative border-b-8 border-primary-main">
|
|
39
|
+
<SwipeListContainer
|
|
40
|
+
itemClassName="flex"
|
|
41
|
+
containerRef={containerRef}
|
|
42
|
+
snapAlign="snap-end"
|
|
43
|
+
gap={8}
|
|
44
|
+
onVisibleIndicesChange={scroll.handleVisibleIndicesChange}
|
|
45
|
+
>
|
|
46
|
+
{tabs.map(renderTabButton(activeTabIndex, setActiveTabIndex, tabAlign))}
|
|
47
|
+
</SwipeListContainer>
|
|
48
|
+
<CarouselScrollButtons
|
|
49
|
+
scroll={scroll}
|
|
50
|
+
arrowsPadded={true}
|
|
51
|
+
onScrollLeft={decActiveSlideIndex}
|
|
52
|
+
onScrollRight={incActiveSlideIndex}
|
|
53
|
+
activeIndex={activeSlideIndex}
|
|
54
|
+
itemCount={itemCount}
|
|
55
|
+
/>
|
|
56
|
+
</div>
|
|
57
|
+
<div className="space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs">
|
|
58
|
+
{tabs[activeTabIndex]?.href ? (
|
|
59
|
+
<TabsLayoutRedirectTab tab={tabs[activeTabIndex]} />
|
|
60
|
+
) : (
|
|
61
|
+
renderBlocksList(block?.slots?.[slotName], { ...rest?.options, slotName })
|
|
62
|
+
)}
|
|
63
|
+
</div>
|
|
64
|
+
</BlockWrapper>
|
|
65
|
+
);
|
|
66
|
+
},
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
TabsLayout.slots = ({ tabs }) => tabs?.filter((_) => !_.href).map(getSlotName) || [];
|
|
70
|
+
TabsLayout.childrenTypes = { exclude: ['TabsLayout'] };
|
|
71
|
+
|
|
72
|
+
const getSlotName = (tab: Tab, index: number): string => tab?.title || `Слот №${index}`;
|
|
73
|
+
|
|
74
|
+
const getInitSelectedIndex = (tabs: Tab[]) =>
|
|
75
|
+
tabs.reduce((selectedIndex, tab, i) => (tab.selected ? i : selectedIndex), 0);
|
|
76
|
+
|
|
77
|
+
const renderTabButton =
|
|
78
|
+
(activeTabIndex: number, onClick: (i: number) => void, tabAlign: Align = 'start') =>
|
|
79
|
+
(tab: Tab, i: number) =>
|
|
80
|
+
(
|
|
81
|
+
<TabsLayoutButton
|
|
82
|
+
key={String(i)}
|
|
83
|
+
className={alignTabStyle[tabAlign]}
|
|
84
|
+
tab={tab}
|
|
85
|
+
isActive={activeTabIndex === i}
|
|
86
|
+
onClick={() => onClick(i)}
|
|
87
|
+
/>
|
|
88
|
+
);
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { type IconVersion } from '../../model/IconVersion';
|
|
3
|
+
import { Img } from '../../ui-kit/Img/Img';
|
|
4
|
+
import { type PreventableEvent } from '../../ui-kit/PreventableEvent';
|
|
5
|
+
import { style } from '../../utils/style';
|
|
6
|
+
import { type Tab } from './TabsLayoutContent';
|
|
7
|
+
|
|
8
|
+
const getButtonClassNames = (isActive: boolean) => ({
|
|
9
|
+
btn: `w-96 ${
|
|
10
|
+
isActive
|
|
11
|
+
? 'p-m border-none bg-primary-main text-white'
|
|
12
|
+
: 'p-s ease-in duration-300 bg-white text-primary-text'
|
|
13
|
+
}`,
|
|
14
|
+
title: isActive ? 'mb-xs text-xl' : 'mb-2xs text-l',
|
|
15
|
+
desc: `font-light ${isActive ? 'text-l text-white' : 'text-m text-secondary-text'}`,
|
|
16
|
+
icon: isActive ? '' : 'text-primary-main',
|
|
17
|
+
iconVersion: (isActive ? 'white' : 'normal') as IconVersion,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
interface TabsLayoutButtonProps {
|
|
21
|
+
tab: Tab;
|
|
22
|
+
className?: string;
|
|
23
|
+
onClick: (ev?: PreventableEvent) => void;
|
|
24
|
+
isActive: boolean;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const TabsLayoutButton = JSX<TabsLayoutButtonProps>(
|
|
28
|
+
({ tab, className, onClick, isActive }) => {
|
|
29
|
+
const buttonClassNames = getButtonClassNames(isActive);
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<button
|
|
33
|
+
type="button"
|
|
34
|
+
onClick={onClick}
|
|
35
|
+
aria-label={tab?.title}
|
|
36
|
+
className={style(
|
|
37
|
+
'border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs',
|
|
38
|
+
buttonClassNames.btn,
|
|
39
|
+
className,
|
|
40
|
+
)}
|
|
41
|
+
>
|
|
42
|
+
{tab?.icon ? (
|
|
43
|
+
<Img
|
|
44
|
+
className={style('h-6 w-6 min-w-6 min-h-6', buttonClassNames.icon)}
|
|
45
|
+
image={{
|
|
46
|
+
...tab?.icon,
|
|
47
|
+
iconVersion: tab?.icon?.iconVersion ?? buttonClassNames.iconVersion,
|
|
48
|
+
}}
|
|
49
|
+
width="24"
|
|
50
|
+
height="24"
|
|
51
|
+
/>
|
|
52
|
+
) : null}
|
|
53
|
+
<div className="border-0">
|
|
54
|
+
{tab?.title ? <div className={buttonClassNames.title}>{tab.title}</div> : null}
|
|
55
|
+
{tab?.description ? <div className={buttonClassNames.desc}>{tab.description}</div> : null}
|
|
56
|
+
</div>
|
|
57
|
+
</button>
|
|
58
|
+
);
|
|
59
|
+
},
|
|
60
|
+
);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type Align } from '../../model/Align';
|
|
2
|
+
import { type DescriptionProps, type TitleProps } from '../../model/HeadlineType';
|
|
3
|
+
import { type UniBlockContent } from '../../model/JSXBlock';
|
|
4
|
+
import { type LinkCommonProps } from '../../model/LinkProps';
|
|
5
|
+
import { type IconProps } from '../../model/Picture';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @title Таб
|
|
9
|
+
*/
|
|
10
|
+
export type Tab = TitleProps &
|
|
11
|
+
DescriptionProps &
|
|
12
|
+
IconProps &
|
|
13
|
+
LinkCommonProps & {
|
|
14
|
+
/** @title Вкладка выбрана по-умолчанию */
|
|
15
|
+
selected?: boolean;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @title Табы
|
|
20
|
+
*/
|
|
21
|
+
export type TabsLayoutContent = UniBlockContent & {
|
|
22
|
+
/** @title Выравнивание табов */
|
|
23
|
+
tabAlign?: Align;
|
|
24
|
+
/** @title Список табов */
|
|
25
|
+
tabs?: Tab[];
|
|
26
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useDebouncedEffect } from '@redneckz/uni-jsx/lib/hooks/useDebouncedEffect';
|
|
3
|
+
import { useLink } from '../../hooks/useLink';
|
|
4
|
+
import { Shimmer } from '../../ui-kit/Shimmer/Shimmer';
|
|
5
|
+
import { type Tab } from './TabsLayoutContent';
|
|
6
|
+
|
|
7
|
+
const REDIRECT_DELAY = 0.5 * 1000;
|
|
8
|
+
|
|
9
|
+
interface TabsLayoutRedirectTabProps {
|
|
10
|
+
tab: Tab;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const TabsLayoutRedirectTab = JSX<TabsLayoutRedirectTabProps>(({ tab }) => {
|
|
14
|
+
const link = useLink();
|
|
15
|
+
|
|
16
|
+
useDebouncedEffect(
|
|
17
|
+
() => {
|
|
18
|
+
const { onClick } = link(tab);
|
|
19
|
+
onClick();
|
|
20
|
+
},
|
|
21
|
+
[tab],
|
|
22
|
+
REDIRECT_DELAY,
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
return <Shimmer className="col-span-12 p-xl" size={5} />;
|
|
26
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { style } from '../../utils/style';
|
|
3
|
+
|
|
4
|
+
const GOLDEN_RATIO = 1.618;
|
|
5
|
+
|
|
6
|
+
export interface ShimmerProps {
|
|
7
|
+
className?: string;
|
|
8
|
+
size?: number;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const Shimmer = JSX<ShimmerProps>(({ className, size }) => (
|
|
12
|
+
<figure className={style('m-0 mt-xl min-w-[80%]', className)}>{renderShimmer(size)}</figure>
|
|
13
|
+
));
|
|
14
|
+
|
|
15
|
+
const renderShimmer = (size = 3) =>
|
|
16
|
+
goldenSequence(100, size)
|
|
17
|
+
.map((_) => Math.floor(_))
|
|
18
|
+
.map(renderShimmerItem);
|
|
19
|
+
|
|
20
|
+
const renderShimmerItem = (width: number, index: number) => (
|
|
21
|
+
<div
|
|
22
|
+
key={String(index)}
|
|
23
|
+
style={{ width: `${width || 100}%` }}
|
|
24
|
+
className="h-4 mt-xs bg-secondary-light"
|
|
25
|
+
/>
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
const goldenSequence = (first: number, size: number): number[] =>
|
|
29
|
+
[first].concat(size > 0 ? goldenSequence(first / GOLDEN_RATIO, size - 1) : []);
|
|
@@ -9,16 +9,15 @@ import { SwipeListItem } from './SwipeListItem';
|
|
|
9
9
|
|
|
10
10
|
type ItemsVisibilityList = Array<IntersectionObserverEntry | undefined>;
|
|
11
11
|
|
|
12
|
-
type SwipeListItemWidthAuto = 0;
|
|
13
|
-
|
|
14
12
|
/**
|
|
15
13
|
* @title Список
|
|
16
14
|
*/
|
|
17
15
|
interface SwipeListContainerProps extends SwipeListContainerContent {
|
|
18
16
|
className?: string;
|
|
17
|
+
itemClassName?: string;
|
|
19
18
|
containerRef?: { current: HTMLDivElement | null };
|
|
20
19
|
activeIndex?: number;
|
|
21
|
-
visibleItemCount?:
|
|
20
|
+
visibleItemCount?: 0 | 1 | 2 | 3 | 4;
|
|
22
21
|
snapAlign?: 'snap-start' | 'snap-center' | 'snap-end';
|
|
23
22
|
gap?: number;
|
|
24
23
|
padding?: number;
|
|
@@ -30,7 +29,8 @@ const childStyleMap = ['min-w-full', '@lg:min-w-[50%]', '@lg:min-w-[33.3%]', '@l
|
|
|
30
29
|
|
|
31
30
|
export const SwipeListContainer = JSX<SwipeListContainerProps>(
|
|
32
31
|
({
|
|
33
|
-
className
|
|
32
|
+
className,
|
|
33
|
+
itemClassName,
|
|
34
34
|
containerRef,
|
|
35
35
|
activeIndex,
|
|
36
36
|
visibleItemCount = 0,
|
|
@@ -84,6 +84,7 @@ export const SwipeListContainer = JSX<SwipeListContainerProps>(
|
|
|
84
84
|
snapAlign,
|
|
85
85
|
visibleItemCount ? childStyleMap[visibleItemCount - 1] : '',
|
|
86
86
|
isVerticalList ? 'h-full' : '',
|
|
87
|
+
itemClassName,
|
|
87
88
|
)}
|
|
88
89
|
style={isHorizontalList ? getContainerOffset(padding / 4) : {}}
|
|
89
90
|
activeIndex={activeIndex}
|