@redneckz/wildless-cms-uni-blocks 0.11.0 → 0.11.2
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 +84 -53
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/Calculator/checkCreditSourceBookRowCommonParams.d.ts +9 -0
- package/bundle/components/Calculator/getCreditCalculatorLimitParams.d.ts +9 -0
- package/bundle/components/Calculator/getCreditCalculatorRateParams.d.ts +11 -0
- package/bundle/components/Calculator/rangeHelpers.d.ts +2 -2
- package/bundle/components/Header/Header.mobile.d.ts +2 -2
- package/bundle/components/Header/HeaderContent.d.ts +13 -1
- package/bundle/components/Header/HeaderTop.d.ts +6 -2
- package/bundle/components/ProductGallery/ProductGallery.mobile.d.ts +5 -0
- package/bundle/icons/IconName.d.ts +4 -2
- package/bundle/ui-kit/Heading/headingTag.d.ts +2 -0
- package/bundle/ui-kit/Heading/headingTag.mobile.d.ts +2 -0
- package/cosmos-static/icons/ChevronLeft.svg +1 -0
- package/dist/components/BaseTile/BaseTile.js +2 -1
- package/dist/components/BaseTile/BaseTile.js.map +1 -1
- package/dist/components/Blocks.mobile.js +4 -0
- package/dist/components/Blocks.mobile.js.map +1 -1
- package/dist/components/Calculator/checkCreditSourceBookRowCommonParams.d.ts +9 -0
- package/dist/components/Calculator/checkCreditSourceBookRowCommonParams.js +28 -0
- package/dist/components/Calculator/checkCreditSourceBookRowCommonParams.js.map +1 -0
- package/dist/components/Calculator/getCreditCalculatorLimitParams.d.ts +9 -0
- package/dist/components/Calculator/getCreditCalculatorLimitParams.js +10 -0
- package/dist/components/Calculator/getCreditCalculatorLimitParams.js.map +1 -0
- package/dist/components/Calculator/getCreditCalculatorRateParams.d.ts +11 -0
- package/dist/components/Calculator/getCreditCalculatorRateParams.js +14 -0
- package/dist/components/Calculator/getCreditCalculatorRateParams.js.map +1 -0
- package/dist/components/Calculator/rangeHelpers.d.ts +2 -2
- package/dist/components/Calculator/rangeHelpers.js +2 -2
- package/dist/components/Calculator/rangeHelpers.js.map +1 -1
- package/dist/components/Calculator/useCreditCalculatorParams.js +26 -38
- package/dist/components/Calculator/useCreditCalculatorParams.js.map +1 -1
- package/dist/components/Footer/TextInformation.js +1 -1
- package/dist/components/Footer/TextInformation.js.map +1 -1
- package/dist/components/Header/Header.mobile.d.ts +2 -2
- package/dist/components/Header/Header.mobile.js +3 -17
- package/dist/components/Header/Header.mobile.js.map +1 -1
- package/dist/components/Header/HeaderContent.d.ts +13 -1
- package/dist/components/Header/HeaderTop.d.ts +6 -2
- package/dist/components/Header/HeaderTop.js +15 -2
- package/dist/components/Header/HeaderTop.js.map +1 -1
- package/dist/components/Headline/headlineVersionStyles.js +6 -6
- package/dist/components/Headline/headlineVersionStyles.js.map +1 -1
- package/dist/components/ProductBlock/ProductBlockInner.js +1 -1
- package/dist/components/ProductGallery/ProductGallery.mobile.d.ts +5 -0
- package/dist/components/ProductGallery/ProductGallery.mobile.js +13 -0
- package/dist/components/ProductGallery/ProductGallery.mobile.js.map +1 -0
- package/dist/content-page-repository/transformImg.js +1 -1
- package/dist/content-page-repository/transformImg.js.map +1 -1
- package/dist/icons/IconName.d.ts +4 -2
- package/dist/icons/IconName.js +3 -1
- package/dist/icons/IconName.js.map +1 -1
- package/dist/ui-kit/Heading/Heading.js +5 -1
- package/dist/ui-kit/Heading/Heading.js.map +1 -1
- package/dist/ui-kit/Heading/headingTag.d.ts +2 -0
- package/dist/ui-kit/Heading/headingTag.js +5 -0
- package/dist/ui-kit/Heading/headingTag.js.map +1 -0
- package/dist/ui-kit/Heading/headingTag.mobile.d.ts +2 -0
- package/dist/ui-kit/Heading/headingTag.mobile.js +13 -0
- package/dist/ui-kit/Heading/headingTag.mobile.js.map +1 -0
- package/dist/ui-kit/Img/ImgAsPicture.js +1 -1
- package/dist/ui-kit/InnerTable/InnerTableButton.js +1 -1
- package/dist/ui-kit/InnerTable/InnerTableButton.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/BaseTile/BaseTile.js +2 -1
- package/lib/components/BaseTile/BaseTile.js.map +1 -1
- package/lib/components/Blocks.mobile.js +4 -0
- package/lib/components/Blocks.mobile.js.map +1 -1
- package/lib/components/Calculator/checkCreditSourceBookRowCommonParams.d.ts +9 -0
- package/lib/components/Calculator/checkCreditSourceBookRowCommonParams.js +25 -0
- package/lib/components/Calculator/checkCreditSourceBookRowCommonParams.js.map +1 -0
- package/lib/components/Calculator/getCreditCalculatorLimitParams.d.ts +9 -0
- package/lib/components/Calculator/getCreditCalculatorLimitParams.js +7 -0
- package/lib/components/Calculator/getCreditCalculatorLimitParams.js.map +1 -0
- package/lib/components/Calculator/getCreditCalculatorRateParams.d.ts +11 -0
- package/lib/components/Calculator/getCreditCalculatorRateParams.js +11 -0
- package/lib/components/Calculator/getCreditCalculatorRateParams.js.map +1 -0
- package/lib/components/Calculator/rangeHelpers.d.ts +2 -2
- package/lib/components/Calculator/rangeHelpers.js +4 -4
- package/lib/components/Calculator/rangeHelpers.js.map +1 -1
- package/lib/components/Calculator/useCreditCalculatorParams.js +27 -39
- package/lib/components/Calculator/useCreditCalculatorParams.js.map +1 -1
- package/lib/components/Footer/TextInformation.js +1 -1
- package/lib/components/Footer/TextInformation.js.map +1 -1
- package/lib/components/Header/Header.fixture.mobile.d.ts +2 -0
- package/lib/components/Header/Header.mobile.d.ts +2 -2
- package/lib/components/Header/Header.mobile.js +4 -18
- package/lib/components/Header/Header.mobile.js.map +1 -1
- package/lib/components/Header/HeaderContent.d.ts +13 -1
- package/lib/components/Header/HeaderTop.d.ts +6 -2
- package/lib/components/Header/HeaderTop.js +15 -2
- package/lib/components/Header/HeaderTop.js.map +1 -1
- package/lib/components/Headline/headlineVersionStyles.js +6 -6
- package/lib/components/Headline/headlineVersionStyles.js.map +1 -1
- package/lib/components/ProductBlock/ProductBlockInner.js +1 -1
- package/lib/components/ProductGallery/ProductGallery.fixture.mobile.d.ts +7 -0
- package/lib/components/ProductGallery/ProductGallery.mobile.d.ts +5 -0
- package/lib/components/ProductGallery/ProductGallery.mobile.js +11 -0
- package/lib/components/ProductGallery/ProductGallery.mobile.js.map +1 -0
- package/lib/content-page-repository/transformImg.js +1 -1
- package/lib/content-page-repository/transformImg.js.map +1 -1
- package/lib/icons/IconName.d.ts +4 -2
- package/lib/icons/IconName.js +3 -1
- package/lib/icons/IconName.js.map +1 -1
- package/lib/ui-kit/Heading/Heading.js +5 -1
- package/lib/ui-kit/Heading/Heading.js.map +1 -1
- package/lib/ui-kit/Heading/headingTag.d.ts +2 -0
- package/lib/ui-kit/Heading/headingTag.js +2 -0
- package/lib/ui-kit/Heading/headingTag.js.map +1 -0
- package/lib/ui-kit/Heading/headingTag.mobile.d.ts +2 -0
- package/lib/ui-kit/Heading/headingTag.mobile.js +10 -0
- package/lib/ui-kit/Heading/headingTag.mobile.js.map +1 -0
- package/lib/ui-kit/Img/ImgAsPicture.js +1 -1
- package/lib/ui-kit/InnerTable/InnerTableButton.js +1 -1
- package/lib/ui-kit/InnerTable/InnerTableButton.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +123 -410
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/Calculator/checkCreditSourceBookRowCommonParams.d.ts +9 -0
- package/mobile/bundle/components/Calculator/getCreditCalculatorLimitParams.d.ts +9 -0
- package/mobile/bundle/components/Calculator/getCreditCalculatorRateParams.d.ts +11 -0
- package/mobile/bundle/components/Calculator/rangeHelpers.d.ts +2 -2
- package/mobile/bundle/components/Header/Header.d.ts +2 -2
- package/mobile/bundle/components/Header/HeaderContent.d.ts +13 -1
- package/mobile/bundle/components/Header/HeaderTop.d.ts +6 -2
- package/mobile/bundle/icons/IconName.d.ts +4 -2
- package/mobile/bundle/ui-kit/Heading/headingTag.d.ts +2 -0
- package/mobile/dist/components/BaseTile/BaseTile.js +2 -1
- package/mobile/dist/components/BaseTile/BaseTile.js.map +1 -1
- package/mobile/dist/components/Blocks.js +4 -0
- package/mobile/dist/components/Blocks.js.map +1 -1
- package/mobile/dist/components/Calculator/checkCreditSourceBookRowCommonParams.d.ts +9 -0
- package/mobile/dist/components/Calculator/checkCreditSourceBookRowCommonParams.js +28 -0
- package/mobile/dist/components/Calculator/checkCreditSourceBookRowCommonParams.js.map +1 -0
- package/mobile/dist/components/Calculator/getCreditCalculatorLimitParams.d.ts +9 -0
- package/mobile/dist/components/Calculator/getCreditCalculatorLimitParams.js +10 -0
- package/mobile/dist/components/Calculator/getCreditCalculatorLimitParams.js.map +1 -0
- package/mobile/dist/components/Calculator/getCreditCalculatorRateParams.d.ts +11 -0
- package/mobile/dist/components/Calculator/getCreditCalculatorRateParams.js +14 -0
- package/mobile/dist/components/Calculator/getCreditCalculatorRateParams.js.map +1 -0
- package/mobile/dist/components/Calculator/rangeHelpers.d.ts +2 -2
- package/mobile/dist/components/Calculator/rangeHelpers.js +2 -2
- package/mobile/dist/components/Calculator/rangeHelpers.js.map +1 -1
- package/mobile/dist/components/Calculator/useCreditCalculatorParams.js +26 -38
- package/mobile/dist/components/Calculator/useCreditCalculatorParams.js.map +1 -1
- package/mobile/dist/components/Footer/TextInformation.js +1 -1
- package/mobile/dist/components/Footer/TextInformation.js.map +1 -1
- package/mobile/dist/components/Header/Header.d.ts +2 -2
- package/mobile/dist/components/Header/Header.js +3 -17
- package/mobile/dist/components/Header/Header.js.map +1 -1
- package/mobile/dist/components/Header/HeaderContent.d.ts +13 -1
- package/mobile/dist/components/Header/HeaderTop.d.ts +6 -2
- package/mobile/dist/components/Header/HeaderTop.js +15 -2
- package/mobile/dist/components/Header/HeaderTop.js.map +1 -1
- package/mobile/dist/components/Headline/headlineVersionStyles.js +6 -6
- package/mobile/dist/components/Headline/headlineVersionStyles.js.map +1 -1
- package/mobile/dist/components/ProductBlock/ProductBlockInner.js +1 -1
- package/mobile/dist/components/ProductGallery/ProductGallery.js +4 -17
- package/mobile/dist/components/ProductGallery/ProductGallery.js.map +1 -1
- package/mobile/dist/content-page-repository/transformImg.js +1 -1
- package/mobile/dist/content-page-repository/transformImg.js.map +1 -1
- package/mobile/dist/icons/IconName.d.ts +4 -2
- package/mobile/dist/icons/IconName.js +3 -1
- package/mobile/dist/icons/IconName.js.map +1 -1
- package/mobile/dist/ui-kit/Heading/Heading.js +12 -11
- package/mobile/dist/ui-kit/Heading/Heading.js.map +1 -1
- package/mobile/dist/ui-kit/Heading/headingTag.d.ts +2 -0
- package/mobile/dist/ui-kit/Heading/headingTag.js +13 -0
- package/mobile/dist/ui-kit/Heading/headingTag.js.map +1 -0
- package/mobile/dist/ui-kit/Img/ImgAsPicture.js +1 -1
- package/mobile/dist/ui-kit/InnerTable/InnerTableButton.js +1 -1
- package/mobile/dist/ui-kit/InnerTable/InnerTableButton.js.map +1 -1
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/BaseTile/BaseTile.js +2 -1
- package/mobile/lib/components/BaseTile/BaseTile.js.map +1 -1
- package/mobile/lib/components/Blocks.js +4 -0
- package/mobile/lib/components/Blocks.js.map +1 -1
- package/mobile/lib/components/Calculator/checkCreditSourceBookRowCommonParams.d.ts +9 -0
- package/mobile/lib/components/Calculator/checkCreditSourceBookRowCommonParams.js +25 -0
- package/mobile/lib/components/Calculator/checkCreditSourceBookRowCommonParams.js.map +1 -0
- package/mobile/lib/components/Calculator/getCreditCalculatorLimitParams.d.ts +9 -0
- package/mobile/lib/components/Calculator/getCreditCalculatorLimitParams.js +7 -0
- package/mobile/lib/components/Calculator/getCreditCalculatorLimitParams.js.map +1 -0
- package/mobile/lib/components/Calculator/getCreditCalculatorRateParams.d.ts +11 -0
- package/mobile/lib/components/Calculator/getCreditCalculatorRateParams.js +11 -0
- package/mobile/lib/components/Calculator/getCreditCalculatorRateParams.js.map +1 -0
- package/mobile/lib/components/Calculator/rangeHelpers.d.ts +2 -2
- package/mobile/lib/components/Calculator/rangeHelpers.js +4 -4
- package/mobile/lib/components/Calculator/rangeHelpers.js.map +1 -1
- package/mobile/lib/components/Calculator/useCreditCalculatorParams.js +27 -39
- package/mobile/lib/components/Calculator/useCreditCalculatorParams.js.map +1 -1
- package/mobile/lib/components/Footer/TextInformation.js +1 -1
- package/mobile/lib/components/Footer/TextInformation.js.map +1 -1
- package/mobile/lib/components/Header/Header.d.ts +2 -2
- package/mobile/lib/components/Header/Header.js +4 -18
- package/mobile/lib/components/Header/Header.js.map +1 -1
- package/mobile/lib/components/Header/HeaderContent.d.ts +13 -1
- package/mobile/lib/components/Header/HeaderTop.d.ts +6 -2
- package/mobile/lib/components/Header/HeaderTop.js +15 -2
- package/mobile/lib/components/Header/HeaderTop.js.map +1 -1
- package/mobile/lib/components/Headline/headlineVersionStyles.js +6 -6
- package/mobile/lib/components/Headline/headlineVersionStyles.js.map +1 -1
- package/mobile/lib/components/ProductBlock/ProductBlockInner.js +1 -1
- package/mobile/lib/components/ProductGallery/ProductGallery.js +5 -18
- package/mobile/lib/components/ProductGallery/ProductGallery.js.map +1 -1
- package/mobile/lib/content-page-repository/transformImg.js +1 -1
- package/mobile/lib/content-page-repository/transformImg.js.map +1 -1
- package/mobile/lib/icons/IconName.d.ts +4 -2
- package/mobile/lib/icons/IconName.js +3 -1
- package/mobile/lib/icons/IconName.js.map +1 -1
- package/mobile/lib/ui-kit/Heading/Heading.js +12 -11
- package/mobile/lib/ui-kit/Heading/Heading.js.map +1 -1
- package/mobile/lib/ui-kit/Heading/headingTag.d.ts +2 -0
- package/mobile/lib/ui-kit/Heading/headingTag.js +10 -0
- package/mobile/lib/ui-kit/Heading/headingTag.js.map +1 -0
- package/mobile/lib/ui-kit/Img/ImgAsPicture.js +1 -1
- package/mobile/lib/ui-kit/InnerTable/InnerTableButton.js +1 -1
- package/mobile/lib/ui-kit/InnerTable/InnerTableButton.js.map +1 -1
- package/mobile/src/components/BaseTile/BaseTile.tsx +6 -3
- package/mobile/src/components/Blocks.ts +4 -0
- package/mobile/src/components/Calculator/checkCreditSourceBookRowCommonParams.ts +47 -0
- package/mobile/src/components/Calculator/getCreditCalculatorLimitParams.ts +24 -0
- package/mobile/src/components/Calculator/getCreditCalculatorRateParams.ts +33 -0
- package/mobile/src/components/Calculator/rangeHelpers.ts +4 -4
- package/mobile/src/components/Calculator/useCreditCalculatorParams.ts +38 -73
- package/mobile/src/components/Footer/TextInformation.tsx +2 -2
- package/mobile/src/components/Header/Header.tsx +19 -50
- package/mobile/src/components/Header/HeaderContent.ts +15 -1
- package/mobile/src/components/Header/HeaderTop.tsx +62 -25
- package/mobile/src/components/Headline/headlineVersionStyles.ts +6 -6
- package/mobile/src/components/ProductBlock/ProductBlockInner.tsx +1 -1
- package/mobile/src/components/ProductGallery/ProductGallery.tsx +18 -59
- package/mobile/src/content-page-repository/transformImg.ts +1 -1
- package/mobile/src/icons/ChevronLeft.svg +3 -0
- package/mobile/src/icons/IconName.ts +5 -5
- package/mobile/src/ui-kit/Heading/Heading.tsx +17 -16
- package/mobile/src/ui-kit/Heading/headingTag.ts +12 -0
- package/mobile/src/ui-kit/Img/ImgAsPicture.tsx +1 -1
- package/mobile/src/ui-kit/InnerTable/InnerTableButton.tsx +1 -1
- package/package.json +1 -1
- package/src/components/BaseTile/BaseTile.tsx +6 -3
- package/src/components/Blocks.mobile.ts +4 -0
- package/src/components/Calculator/checkCreditSourceBookRowCommonParams.ts +47 -0
- package/src/components/Calculator/getCreditCalculatorLimitParams.ts +24 -0
- package/src/components/Calculator/getCreditCalculatorRateParams.ts +33 -0
- package/src/components/Calculator/rangeHelpers.ts +4 -4
- package/src/components/Calculator/useCreditCalculatorParams.ts +38 -73
- package/src/components/Footer/TextInformation.tsx +2 -2
- package/src/components/Header/Header.fixture.mobile.tsx +4 -0
- package/src/components/Header/Header.mobile.tsx +19 -50
- package/src/components/Header/HeaderContent.ts +15 -1
- package/src/components/Header/HeaderTop.tsx +62 -25
- package/src/components/Headline/headlineVersionStyles.ts +6 -6
- package/src/components/ProductBlock/ProductBlockInner.tsx +1 -1
- package/src/components/ProductGallery/ProductGallery.fixture.mobile.tsx +142 -0
- package/src/components/ProductGallery/ProductGallery.mobile.tsx +34 -0
- package/src/content-page-repository/transformImg.ts +1 -1
- package/src/icons/ChevronLeft.svg +3 -0
- package/src/icons/IconName.ts +5 -1
- package/src/ui-kit/Heading/Heading.fixture.mobile.tsx +6 -6
- package/src/ui-kit/Heading/Heading.fixture.tsx +6 -6
- package/src/ui-kit/Heading/Heading.tsx +8 -3
- package/src/ui-kit/Heading/headingTag.mobile.ts +12 -0
- package/src/ui-kit/Heading/headingTag.ts +3 -0
- package/src/ui-kit/Img/ImgAsPicture.tsx +1 -1
- package/src/ui-kit/InnerTable/InnerTableButton.tsx +1 -1
- package/tailwind.config.cjs +10 -19
- package/bundle/ui-kit/Heading/Heading.mobile.d.ts +0 -2
- package/dist/ui-kit/Heading/Heading.mobile.d.ts +0 -2
- package/dist/ui-kit/Heading/Heading.mobile.js +0 -18
- package/dist/ui-kit/Heading/Heading.mobile.js.map +0 -1
- package/lib/ui-kit/Heading/Heading.mobile.d.ts +0 -2
- package/lib/ui-kit/Heading/Heading.mobile.js +0 -16
- package/lib/ui-kit/Heading/Heading.mobile.js.map +0 -1
- package/src/ui-kit/Heading/Heading.mobile.tsx +0 -22
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { CreditCalculatorParamsViewSettings } from './CalculatorContent';
|
|
2
|
+
import { checkCreditSourceBookRowCommonParams } from './checkCreditSourceBookRowCommonParams';
|
|
3
|
+
import { DEFAULT_CREDIT_CALCULATOR_PARAMS } from './constants';
|
|
4
|
+
import { checkRangeByKeys } from './rangeHelpers';
|
|
5
|
+
import {
|
|
6
|
+
CreditCalculatorSourceBookRateParams,
|
|
7
|
+
CreditCalculatorUserInputParams,
|
|
8
|
+
} from './useCreditCalculatorParams';
|
|
9
|
+
|
|
10
|
+
interface GetCreditCalculatorRateParamsProps {
|
|
11
|
+
rateRows: CreditCalculatorSourceBookRateParams[];
|
|
12
|
+
userInputParams: CreditCalculatorUserInputParams;
|
|
13
|
+
paramsViewSettings?: CreditCalculatorParamsViewSettings;
|
|
14
|
+
moneyValue: number;
|
|
15
|
+
monthsValue: number;
|
|
16
|
+
}
|
|
17
|
+
export const getCreditCalculatorRateParams = ({
|
|
18
|
+
rateRows = [],
|
|
19
|
+
userInputParams,
|
|
20
|
+
paramsViewSettings,
|
|
21
|
+
moneyValue,
|
|
22
|
+
monthsValue,
|
|
23
|
+
}: GetCreditCalculatorRateParamsProps) =>
|
|
24
|
+
rateRows?.find(
|
|
25
|
+
(row) =>
|
|
26
|
+
checkCreditSourceBookRowCommonParams({
|
|
27
|
+
row,
|
|
28
|
+
userInputParams,
|
|
29
|
+
paramsViewSettings,
|
|
30
|
+
}) &&
|
|
31
|
+
checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], row) &&
|
|
32
|
+
checkRangeByKeys(monthsValue, ['minMonths', 'maxMonths'], row),
|
|
33
|
+
) || DEFAULT_CREDIT_CALCULATOR_PARAMS;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { max } from '../../utils/maxBy';
|
|
2
2
|
import { mergeIntervals } from '../../utils/mergeIntervals';
|
|
3
|
-
import {
|
|
3
|
+
import { min } from '../../utils/minBy';
|
|
4
4
|
|
|
5
5
|
export const getLimitRangeByKeys = <
|
|
6
6
|
MinKey extends string,
|
|
@@ -26,8 +26,8 @@ export const getRangeByKeys = <
|
|
|
26
26
|
[minKey, maxKey]: [MinKey, MaxKey],
|
|
27
27
|
rows: T[] = [],
|
|
28
28
|
) => ({
|
|
29
|
-
[minKey]: rows.length ?
|
|
30
|
-
[maxKey]: rows.length ?
|
|
29
|
+
[minKey]: rows.length ? min(rows.filter((row) => row[minKey]).map((row) => row[minKey])) : 0,
|
|
30
|
+
[maxKey]: rows.length ? max(rows.filter((row) => row[maxKey]).map((row) => row[maxKey])) : 0,
|
|
31
31
|
});
|
|
32
32
|
|
|
33
33
|
export const getMergeRangesByKeys = <
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { useMemo } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
|
+
import { clamp } from '../../utils/clamp';
|
|
2
3
|
import type { CreditCalculatorParamsViewSettings } from './CalculatorContent';
|
|
3
4
|
import { CREDIT_CALC_DEFAULT_DIR, DEFAULT_CREDIT_CALCULATOR_PARAMS } from './constants';
|
|
5
|
+
import { getCreditCalculatorLimitParams } from './getCreditCalculatorLimitParams';
|
|
6
|
+
import { getCreditCalculatorRateParams } from './getCreditCalculatorRateParams';
|
|
4
7
|
import { getMonthlyPayment } from './getMonthlyPayment';
|
|
5
|
-
import {
|
|
8
|
+
import { getLimitRangeByKeys } from './rangeHelpers';
|
|
6
9
|
import { useCalculatorParams } from './useCalculatorParams';
|
|
7
10
|
|
|
8
11
|
export interface CommonCreditParams {
|
|
@@ -48,90 +51,52 @@ export const useCreditCalculatorParams = (
|
|
|
48
51
|
sourceBookDir?: string,
|
|
49
52
|
paramsViewSettings?: CreditCalculatorParamsViewSettings,
|
|
50
53
|
): CreditCalculatorParams => {
|
|
51
|
-
|
|
54
|
+
let { moneyValue, monthsValue } = userInputParams;
|
|
52
55
|
const data = useCalculatorParams<CreditCalculatorData>(sourceBookDir || CREDIT_CALC_DEFAULT_DIR);
|
|
56
|
+
const rateRows = data?.rateRows || [DEFAULT_CREDIT_CALCULATOR_PARAMS];
|
|
57
|
+
const limitRows = data?.limitRows || [];
|
|
58
|
+
const creditCalculatorSourceBookLimitParams = getCreditCalculatorLimitParams({
|
|
59
|
+
limitRows,
|
|
60
|
+
userInputParams,
|
|
61
|
+
paramsViewSettings,
|
|
62
|
+
});
|
|
53
63
|
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
64
|
+
const { minSum, maxSum } = getLimitRangeByKeys(
|
|
65
|
+
['minSum', 'maxSum'],
|
|
66
|
+
creditCalculatorSourceBookLimitParams,
|
|
67
|
+
rateRows,
|
|
68
|
+
);
|
|
69
|
+
const { minMonths, maxMonths } = getLimitRangeByKeys(
|
|
70
|
+
['minMonths', 'maxMonths'],
|
|
71
|
+
creditCalculatorSourceBookLimitParams,
|
|
72
|
+
rateRows,
|
|
60
73
|
);
|
|
61
74
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
(row) =>
|
|
65
|
-
checkRowCommonParams({
|
|
66
|
-
row,
|
|
67
|
-
userInputParams,
|
|
68
|
-
paramsViewSettings,
|
|
69
|
-
}) &&
|
|
70
|
-
checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], row) &&
|
|
71
|
-
checkRangeByKeys(monthsValue, ['minMonths', 'maxMonths'], row),
|
|
72
|
-
) || DEFAULT_CREDIT_CALCULATOR_PARAMS;
|
|
75
|
+
moneyValue = clamp(moneyValue, minSum, maxSum);
|
|
76
|
+
monthsValue = clamp(monthsValue, minMonths, maxMonths);
|
|
73
77
|
|
|
74
|
-
const
|
|
78
|
+
const creditCalculatorRateParams = getCreditCalculatorRateParams({
|
|
79
|
+
rateRows,
|
|
80
|
+
userInputParams,
|
|
81
|
+
paramsViewSettings,
|
|
82
|
+
moneyValue,
|
|
83
|
+
monthsValue,
|
|
84
|
+
});
|
|
85
|
+
const { rate } = creditCalculatorRateParams;
|
|
75
86
|
const monthlyPayment = getMonthlyPayment(rate, userInputParams);
|
|
76
|
-
const rateRows = data?.rateRows || [DEFAULT_CREDIT_CALCULATOR_PARAMS];
|
|
77
87
|
|
|
78
88
|
return useMemo(
|
|
79
89
|
() => ({
|
|
80
|
-
...
|
|
81
|
-
...getLimitRangeByKeys(['minSum', 'maxSum'], creditCalculatorSourceBookLimitParams, rateRows),
|
|
82
|
-
...getLimitRangeByKeys(
|
|
83
|
-
['minMonths', 'maxMonths'],
|
|
84
|
-
creditCalculatorSourceBookLimitParams,
|
|
85
|
-
rateRows,
|
|
86
|
-
),
|
|
90
|
+
...creditCalculatorRateParams,
|
|
87
91
|
...userInputParams,
|
|
92
|
+
minSum,
|
|
93
|
+
maxSum,
|
|
94
|
+
minMonths,
|
|
95
|
+
maxMonths,
|
|
96
|
+
moneyValue,
|
|
97
|
+
monthsValue,
|
|
88
98
|
monthlyPayment,
|
|
89
99
|
}),
|
|
90
100
|
[userInputParams, data],
|
|
91
101
|
);
|
|
92
102
|
};
|
|
93
|
-
|
|
94
|
-
interface CheckSourceBookRowProps {
|
|
95
|
-
row: CommonCreditParams;
|
|
96
|
-
userInputParams: CreditCalculatorUserInputParams;
|
|
97
|
-
paramsViewSettings?: CreditCalculatorParamsViewSettings;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
interface CheckSourceBookRowFieldProps extends CheckSourceBookRowProps {
|
|
101
|
-
fieldKey: string;
|
|
102
|
-
viewSettingFieldKey: string;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
const checkRowCommonParams = (props: CheckSourceBookRowProps) =>
|
|
106
|
-
checkRowParam({
|
|
107
|
-
...props,
|
|
108
|
-
fieldKey: 'isSalaryClient',
|
|
109
|
-
viewSettingFieldKey: 'isShowSalaryClient',
|
|
110
|
-
}) &&
|
|
111
|
-
checkRowParam({
|
|
112
|
-
...props,
|
|
113
|
-
fieldKey: 'isStateEmployee',
|
|
114
|
-
viewSettingFieldKey: 'isShowStateEmployee',
|
|
115
|
-
}) &&
|
|
116
|
-
checkRowParam({
|
|
117
|
-
...props,
|
|
118
|
-
fieldKey: 'isPensionClient',
|
|
119
|
-
viewSettingFieldKey: 'isShowPensionClient',
|
|
120
|
-
}) &&
|
|
121
|
-
checkRowParam({
|
|
122
|
-
...props,
|
|
123
|
-
fieldKey: 'isInsurance',
|
|
124
|
-
viewSettingFieldKey: 'isShowInsurance',
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
const checkRowParam = ({
|
|
128
|
-
row,
|
|
129
|
-
userInputParams,
|
|
130
|
-
paramsViewSettings,
|
|
131
|
-
fieldKey,
|
|
132
|
-
viewSettingFieldKey,
|
|
133
|
-
}: CheckSourceBookRowFieldProps) => {
|
|
134
|
-
const isExclude = paramsViewSettings ? !paramsViewSettings[viewSettingFieldKey] : false;
|
|
135
|
-
|
|
136
|
-
return isExclude || userInputParams[fieldKey] === row[fieldKey];
|
|
137
|
-
};
|
|
@@ -6,13 +6,13 @@ import { textInformationTextSize } from './textInformationTextSize';
|
|
|
6
6
|
|
|
7
7
|
export const TextInformation = JSX<FooterLink>(({ className = '', links }) => (
|
|
8
8
|
<div className={className}>
|
|
9
|
-
<div className="pt-
|
|
9
|
+
<div className="pt-4 xl:pt-5">
|
|
10
10
|
<Text size={textInformationTextSize} color="text-secondary-text">
|
|
11
11
|
{`\u00a9\u00A02000-${new Date().getFullYear()}\u00A0АО \u00ABРоссельхозбанк\u00BB Генеральная лицензия Банка России \u2116\u00A03349 от\u00A012.08.2015\u00A0г.`}
|
|
12
12
|
</Text>
|
|
13
13
|
</div>
|
|
14
14
|
{links?.length ? (
|
|
15
|
-
<div className="flex justify-start items-start gap-5 pt-
|
|
15
|
+
<div className="flex justify-start items-start gap-5 pt-4">
|
|
16
16
|
{links.map((_, i) => (
|
|
17
17
|
<TextInformationLink key={String(i)} index={i} {..._} />
|
|
18
18
|
))}
|
|
@@ -1,78 +1,47 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import { useCallback, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
|
-
import { useRouter } from '../../hooks/useRouter';
|
|
4
2
|
import { useSWRResource } from '../../hooks/useSWRResource';
|
|
5
3
|
import type { BgColorVersion } from '../../model/BgColorVersion';
|
|
6
4
|
import type { BlockVersion } from '../../model/BlockVersion';
|
|
7
5
|
import type { Fallback } from '../../model/Fallback';
|
|
8
6
|
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
9
7
|
import { projectSettings } from '../../ProjectSettings';
|
|
10
|
-
import { findActiveSubItem } from '../../services/sitemap/findActiveSubItem';
|
|
11
|
-
import { isTopItemActive } from '../../services/sitemap/isTopItemActive';
|
|
12
8
|
import type { SitemapData } from '../../services/sitemap/SitemapData';
|
|
13
9
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
14
|
-
import { HeaderItem } from '../../ui-kit/HeaderItem/HeaderItem';
|
|
15
|
-
import { LinkList } from '../../ui-kit/LinkList/LinkList';
|
|
16
|
-
import { RollupItem } from '../RollupItem/RollupItem';
|
|
17
|
-
import { HeaderBurger } from './HeaderBurger';
|
|
18
|
-
import type { HeaderContent } from './HeaderContent';
|
|
19
10
|
import { HeaderTop } from './HeaderTop';
|
|
11
|
+
import type { HeaderContent } from './HeaderContent';
|
|
20
12
|
|
|
21
|
-
export interface
|
|
13
|
+
export interface HeaderMobileProps extends HeaderContent, UniBlockProps {}
|
|
22
14
|
|
|
23
15
|
const BG_COLOR_TO_BLOCK_VERSION: Record<BgColorVersion, BlockVersion> = {
|
|
24
16
|
'bg-white': 'primary',
|
|
25
17
|
transparent: 'transparent',
|
|
26
18
|
};
|
|
27
19
|
|
|
28
|
-
export const Header = JSX<
|
|
29
|
-
({
|
|
30
|
-
|
|
31
|
-
|
|
20
|
+
export const Header = JSX<HeaderMobileProps>(
|
|
21
|
+
({
|
|
22
|
+
bgColor = 'bg-white',
|
|
23
|
+
version = BG_COLOR_TO_BLOCK_VERSION[bgColor],
|
|
24
|
+
mobileHeaderType = 'none',
|
|
25
|
+
...rest
|
|
26
|
+
}) => {
|
|
32
27
|
const fallback: Fallback | undefined = rest.options?.page?.fallback;
|
|
33
|
-
const {
|
|
28
|
+
const { logo, internetBankUrl } = useSWRResource<SitemapData>(
|
|
34
29
|
projectSettings.SITEMAP || 'sitemap',
|
|
35
30
|
fallback,
|
|
36
31
|
);
|
|
37
32
|
|
|
38
|
-
const activeTopItem = topItems?.find(isTopItemActive(router));
|
|
39
|
-
const subItems = activeTopItem?.items;
|
|
40
|
-
const activeSubItem = findActiveSubItem(router)(subItems);
|
|
41
|
-
const [burgerMenuShow, setBurgerMenuShow] = useState(false);
|
|
42
|
-
const handleBurgerMenuShow = useCallback(() => setBurgerMenuShow((_) => !_), []);
|
|
43
|
-
|
|
44
33
|
return (
|
|
45
34
|
<BlockWrapper tag="header" version={version} {...rest}>
|
|
46
|
-
<div className="container px-4 py-
|
|
47
|
-
<HeaderTop
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
{..._}
|
|
56
|
-
/>
|
|
57
|
-
))}
|
|
58
|
-
</div>
|
|
59
|
-
</nav>
|
|
35
|
+
<div className="container px-4 py-1 box-border">
|
|
36
|
+
<HeaderTop
|
|
37
|
+
bgColor={bgColor}
|
|
38
|
+
logo={logo}
|
|
39
|
+
internetBankUrl={internetBankUrl}
|
|
40
|
+
version={version}
|
|
41
|
+
mobileHeaderType={mobileHeaderType}
|
|
42
|
+
{...rest}
|
|
43
|
+
/>
|
|
60
44
|
</div>
|
|
61
|
-
{burgerMenuShow ? (
|
|
62
|
-
<HeaderBurger
|
|
63
|
-
onClick={handleBurgerMenuShow}
|
|
64
|
-
burgerSubMenu={dispositions}
|
|
65
|
-
defaultLocation={defaultLocation}
|
|
66
|
-
>
|
|
67
|
-
<div className="list-none m-0 p-0">
|
|
68
|
-
{topItems?.map((item, i) => (
|
|
69
|
-
<RollupItem key={String(i)} label={item.text}>
|
|
70
|
-
<LinkList className="mt-2.5" items={item.items} />
|
|
71
|
-
</RollupItem>
|
|
72
|
-
))}
|
|
73
|
-
</div>
|
|
74
|
-
</HeaderBurger>
|
|
75
|
-
) : null}
|
|
76
45
|
</BlockWrapper>
|
|
77
46
|
);
|
|
78
47
|
},
|
|
@@ -25,10 +25,24 @@ export type Logo = ImageContent & {
|
|
|
25
25
|
title?: string;
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
+
/**
|
|
29
|
+
* @title Мобильный тип шапки
|
|
30
|
+
* @enumNames ["Не выбрано", "Название", "Кнопка возврата"]
|
|
31
|
+
*/
|
|
32
|
+
export type MobileHeaderType = 'none' | 'withTitle' | 'backwardButton';
|
|
33
|
+
|
|
34
|
+
export interface MobileHeaderProps {
|
|
35
|
+
mobileHeaderType?: MobileHeaderType;
|
|
36
|
+
/** @title Название (мобильная версия) */
|
|
37
|
+
mobileTitle?: string;
|
|
38
|
+
/** @title Кнопка возврата (мобильная версия) */
|
|
39
|
+
mobileBackwardButtonTitle?: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
28
42
|
/**
|
|
29
43
|
* @title Шапка (для мобильных горизонтальная прокрутка shift+mouseScroll)
|
|
30
44
|
*/
|
|
31
|
-
export interface HeaderContent {
|
|
45
|
+
export interface HeaderContent extends MobileHeaderProps {
|
|
32
46
|
/** @hidden */
|
|
33
47
|
showSubMenu?: boolean;
|
|
34
48
|
/** @hidden */
|
|
@@ -1,34 +1,71 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import type { BgColorVersion } from '../../model/BgColorVersion';
|
|
3
3
|
import type { LogoType } from '../../model/LogoType';
|
|
4
|
-
import { Img } from '../../ui-kit/Img/Img';
|
|
5
4
|
import { Logo } from '../../ui-kit/Logo/Logo';
|
|
5
|
+
import { Button } from '../../ui-kit/Button/Button';
|
|
6
|
+
import { style } from '../../utils/style';
|
|
7
|
+
import type { BlockVersion } from '../../model/BlockVersion';
|
|
8
|
+
import type { MobileHeaderProps, MobileHeaderType } from './HeaderContent';
|
|
9
|
+
import { Img } from '../../ui-kit/Img/Img';
|
|
6
10
|
|
|
7
|
-
export interface HeaderTopProps {
|
|
8
|
-
onClick: () => void;
|
|
11
|
+
export interface HeaderTopProps extends MobileHeaderProps {
|
|
9
12
|
bgColor?: BgColorVersion;
|
|
10
13
|
logo?: LogoType;
|
|
14
|
+
internetBankUrl?: string;
|
|
15
|
+
version?: BlockVersion;
|
|
16
|
+
mobileHeaderType?: MobileHeaderType;
|
|
11
17
|
}
|
|
12
18
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
19
|
+
const BUTTON_STYLE = {
|
|
20
|
+
default: 'px-5 bg-main-divider rounded hover:text-primary-main',
|
|
21
|
+
transparent: 'text-white hover:text-primary-hover',
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const HeaderTop = JSX<HeaderTopProps>(
|
|
25
|
+
({
|
|
26
|
+
bgColor,
|
|
27
|
+
logo,
|
|
28
|
+
internetBankUrl,
|
|
29
|
+
version,
|
|
30
|
+
mobileHeaderType,
|
|
31
|
+
mobileTitle,
|
|
32
|
+
mobileBackwardButtonTitle,
|
|
33
|
+
}) => {
|
|
34
|
+
const isTypeNone = mobileHeaderType === 'none';
|
|
35
|
+
const isTypeWithTitle = mobileHeaderType === 'withTitle';
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<div className="flex items-center justify-between w-full">
|
|
39
|
+
{isTypeNone || isTypeWithTitle ? (
|
|
40
|
+
<Logo bgColor={bgColor} logo={logo} showTitle={isTypeNone} />
|
|
41
|
+
) : null}
|
|
42
|
+
{isTypeWithTitle ? mobileTitle : null}
|
|
43
|
+
{mobileHeaderType === 'backwardButton' ? (
|
|
44
|
+
<Button className="flex items-center text-l">
|
|
45
|
+
<Img
|
|
46
|
+
className="w-6 h-6"
|
|
47
|
+
image={{
|
|
48
|
+
icon: 'ChevronLeft',
|
|
49
|
+
iconVersion: 'black',
|
|
50
|
+
}}
|
|
51
|
+
/>
|
|
52
|
+
{mobileBackwardButtonTitle}
|
|
53
|
+
</Button>
|
|
54
|
+
) : null}
|
|
55
|
+
{internetBankUrl ? (
|
|
56
|
+
<Button
|
|
57
|
+
href={internetBankUrl}
|
|
58
|
+
ariaLabel="Войти"
|
|
59
|
+
target="_blank"
|
|
60
|
+
className={style(
|
|
61
|
+
'p-3 my-1 text-s whitespace-nowrap text-primary-main hover:text-primary-hover',
|
|
62
|
+
BUTTON_STYLE[version === 'transparent' ? 'transparent' : 'default'],
|
|
63
|
+
)}
|
|
64
|
+
>
|
|
65
|
+
Войти
|
|
66
|
+
</Button>
|
|
67
|
+
) : null}
|
|
68
|
+
</div>
|
|
69
|
+
);
|
|
70
|
+
},
|
|
71
|
+
);
|
|
@@ -13,32 +13,32 @@ export const headlineVersionStyles: Record<
|
|
|
13
13
|
XXL: {
|
|
14
14
|
title: { headingType: 'h0', as: 'h1' },
|
|
15
15
|
descriptionSize: 'text-h5',
|
|
16
|
-
descriptionStyle: 'mt-
|
|
16
|
+
descriptionStyle: 'mt-headline-xxl',
|
|
17
17
|
},
|
|
18
18
|
XL: {
|
|
19
19
|
title: { headingType: 'h1', as: 'h1' },
|
|
20
20
|
descriptionSize: 'text-xl-light',
|
|
21
|
-
descriptionStyle: 'mt-
|
|
21
|
+
descriptionStyle: 'mt-headline-l',
|
|
22
22
|
},
|
|
23
23
|
L: {
|
|
24
24
|
title: { headingType: 'h2', as: 'h2' },
|
|
25
25
|
descriptionSize: 'text-xl-light',
|
|
26
|
-
descriptionStyle: 'mt-
|
|
26
|
+
descriptionStyle: 'mt-headline-l',
|
|
27
27
|
},
|
|
28
28
|
M: {
|
|
29
29
|
title: { headingType: 'h3', as: 'h3' },
|
|
30
30
|
descriptionSize: 'text-xl-light',
|
|
31
|
-
descriptionStyle: 'mt-
|
|
31
|
+
descriptionStyle: 'mt-headline-m',
|
|
32
32
|
},
|
|
33
33
|
S: {
|
|
34
34
|
title: { headingType: 'h4', as: 'h4' },
|
|
35
35
|
descriptionSize: 'text-xl-light',
|
|
36
|
-
descriptionStyle: 'mt-
|
|
36
|
+
descriptionStyle: 'mt-headline-s',
|
|
37
37
|
},
|
|
38
38
|
XS: {
|
|
39
39
|
title: { headingType: 'h5', as: 'h5' },
|
|
40
40
|
descriptionSize: 'text-l-light',
|
|
41
|
-
descriptionStyle: 'mt-
|
|
41
|
+
descriptionStyle: 'mt-headline-s',
|
|
42
42
|
},
|
|
43
43
|
};
|
|
44
44
|
|
|
@@ -35,7 +35,7 @@ export const ProductBlockInner = JSX<ProductBlockInnerProps>(
|
|
|
35
35
|
className={className}
|
|
36
36
|
insetTitle={
|
|
37
37
|
<Headline
|
|
38
|
-
className="max-w-[600px] xl:max-w-[
|
|
38
|
+
className="max-w-[600px] xl:max-w-[728px]"
|
|
39
39
|
title={title}
|
|
40
40
|
description={description}
|
|
41
41
|
headlineVersion={headlineVersion}
|
|
@@ -1,75 +1,34 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import { useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
2
|
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
4
3
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
5
|
-
import {
|
|
4
|
+
import { SwipeListControl } from '../../ui-kit/SwipeListControl/SwipeListControl';
|
|
5
|
+
import type { ProductBlockInnerContent } from '../ProductBlock/ProductBlockContent';
|
|
6
6
|
import { ProductBlockInner } from '../ProductBlock/ProductBlockInner';
|
|
7
|
-
import type { ProductGalleryContent
|
|
7
|
+
import type { ProductGalleryContent } from './ProductGalleryContent';
|
|
8
8
|
|
|
9
9
|
export interface ProductGalleryProps extends ProductGalleryContent, UniBlockProps {}
|
|
10
10
|
|
|
11
11
|
export const ProductGallery = JSX<ProductGalleryProps>(
|
|
12
12
|
({ className = '', slides = [], ...rest }) => {
|
|
13
|
-
const
|
|
13
|
+
const galleryBlocks = slides.map((s) => s.productBlock);
|
|
14
14
|
|
|
15
15
|
return (
|
|
16
|
-
<BlockWrapper
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
<div key={String(i)} className="box-border grow-0 shrink-0 basis-full" role="listitem">
|
|
24
|
-
<ProductBlockInner
|
|
25
|
-
className="pl-default h-full"
|
|
26
|
-
headlineVersion="XXL"
|
|
27
|
-
{...productBlock}
|
|
28
|
-
{...rest}
|
|
29
|
-
/>
|
|
30
|
-
</div>
|
|
31
|
-
))}
|
|
32
|
-
</div>
|
|
33
|
-
<div className="h-28 px-6 mt-6 -mb-6 flex items-center gap-2 box-border">
|
|
34
|
-
{slides.map(renderNavButton({ activeSlideIndex, onClick: setActiveSlideIndex }))}
|
|
35
|
-
</div>
|
|
16
|
+
<BlockWrapper
|
|
17
|
+
className={`box-border py-6 overflow-hidden relative w-100 mb-6 ${className}`}
|
|
18
|
+
{...rest}
|
|
19
|
+
>
|
|
20
|
+
<SwipeListControl gap={0} padding={0}>
|
|
21
|
+
{galleryBlocks.map((_, i) => renderProductBlock({ ..._, ...rest }, i))}
|
|
22
|
+
</SwipeListControl>
|
|
36
23
|
</BlockWrapper>
|
|
37
24
|
);
|
|
38
25
|
},
|
|
39
26
|
);
|
|
40
27
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
({ nav }: ProductSlide, i: number) => {
|
|
49
|
-
const isActive = i === activeSlideIndex;
|
|
50
|
-
const btnClassName = isActive
|
|
51
|
-
? 'min-w-[350px] bg-white shadow-dark-blue border-none p-6'
|
|
52
|
-
: 'min-w-[290px] ease-in duration-300 bg-white/10 px-6 py-5 hover:py-6 backdrop-blur';
|
|
53
|
-
const btnTitleClassName = isActive
|
|
54
|
-
? 'text-primary-text text-h6 py-2'
|
|
55
|
-
: 'text-l pb-1 text-secondary-text group-data-secondary:text-white';
|
|
56
|
-
const btnDescClassName = isActive
|
|
57
|
-
? 'text-secondary-text text-l-light'
|
|
58
|
-
: 'text-m-light text-secondary-text group-data-secondary:text-white/80';
|
|
59
|
-
|
|
60
|
-
return (
|
|
61
|
-
<button
|
|
62
|
-
type="button"
|
|
63
|
-
key={String(i)}
|
|
64
|
-
onClick={() => onClick(i)}
|
|
65
|
-
aria-label={nav?.title}
|
|
66
|
-
className={style(
|
|
67
|
-
'relative px-6 box-border overflow-hidden text-left grow basis-0 border border-gray group-data-secondary:border-white/50',
|
|
68
|
-
btnClassName,
|
|
69
|
-
)}
|
|
70
|
-
>
|
|
71
|
-
<div className={btnTitleClassName}>{nav?.title}</div>
|
|
72
|
-
<div className={btnDescClassName}>{nav?.description}</div>
|
|
73
|
-
</button>
|
|
74
|
-
);
|
|
75
|
-
};
|
|
28
|
+
const renderProductBlock = (block: ProductBlockInnerContent, i: number) => (
|
|
29
|
+
<ProductBlockInner
|
|
30
|
+
key={String(i)}
|
|
31
|
+
className="z-10 px-5 group-data-secondary:text-white"
|
|
32
|
+
{...block}
|
|
33
|
+
/>
|
|
34
|
+
);
|
|
@@ -77,7 +77,7 @@ const computeTransformationChain = ({
|
|
|
77
77
|
pipe(
|
|
78
78
|
resizeImg(isPictureSizeEmpty(size) ? containerSize : size),
|
|
79
79
|
alignImg({ containerSize, alignment }),
|
|
80
|
-
(_) => (format ? _.toFormat(format, options) : _),
|
|
80
|
+
(_) => (format ? _.toFormat(format, { ...options, nearLossless: true }) : _),
|
|
81
81
|
);
|
|
82
82
|
|
|
83
83
|
const pipe = (...operations: Array<(chain: Sharp) => Promise<Sharp> | Sharp>) =>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg title="Стрелка 'Вправо'" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M14.7071 6.29289C15.0976 6.68342 15.0976 7.31658 14.7071 7.70711L10.4142 12L14.7071 16.2929C15.0976 16.6834 15.0976 17.3166 14.7071 17.7071C14.3166 18.0976 13.6834 18.0976 13.2929 17.7071L8.29289 12.7071C7.90237 12.3166 7.90237 11.6834 8.29289 11.2929L13.2929 6.29289C13.6834 5.90237 14.3166 5.90237 14.7071 6.29289Z" fill="currentColor"/>
|
|
3
|
+
</svg>
|