@redneckz/wildless-cms-uni-blocks 0.11.0 → 0.11.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/bundle.umd.js +71 -46
- 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/dist/components/BaseTile/BaseTile.js +1 -1
- package/dist/components/BaseTile/BaseTile.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/ProductBlock/ProductBlockInner.js +1 -1
- 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 +1 -1
- package/lib/components/BaseTile/BaseTile.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/ProductBlock/ProductBlockInner.js +1 -1
- 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 +5 -5
- 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/dist/components/BaseTile/BaseTile.js +1 -1
- package/mobile/dist/components/BaseTile/BaseTile.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/ProductBlock/ProductBlockInner.js +1 -1
- 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 +1 -1
- package/mobile/lib/components/BaseTile/BaseTile.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/ProductBlock/ProductBlockInner.js +1 -1
- 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 +2 -2
- 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/ProductBlock/ProductBlockInner.tsx +1 -1
- 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 +2 -2
- 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/ProductBlock/ProductBlockInner.tsx +1 -1
- package/src/ui-kit/Img/ImgAsPicture.tsx +1 -1
- package/src/ui-kit/InnerTable/InnerTableButton.tsx +1 -1
- package/tailwind.config.cjs +0 -15
|
@@ -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
|
))}
|
|
@@ -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}
|
|
@@ -45,7 +45,7 @@ export const ImgAsPicture = JSX<ImageProps>(
|
|
|
45
45
|
const renderImg = (image: Picture, imageClassName = '', isMobile = false) => {
|
|
46
46
|
const style = {
|
|
47
47
|
width: image.size?.width ? `${image.size?.width}px` : '100%',
|
|
48
|
-
height: image.size?.height ? `${image.size?.height}px` : '
|
|
48
|
+
height: image.size?.height ? `${image.size?.height}px` : 'auto',
|
|
49
49
|
};
|
|
50
50
|
|
|
51
51
|
const title = image.title || '';
|
|
@@ -18,7 +18,7 @@ export const TableInnerButton = JSX<TableInnerButtonProps>(({ isOpen, onClick })
|
|
|
18
18
|
onClick={onClick}
|
|
19
19
|
className="w-full flex items-center justify-center rounded-none py-5"
|
|
20
20
|
>
|
|
21
|
-
<div className="text-h4">{isOpen ? 'Скрыть' : 'Показать
|
|
21
|
+
<div className="text-h4">{isOpen ? 'Скрыть' : 'Показать'}</div>
|
|
22
22
|
<Icon
|
|
23
23
|
name={isOpen ? 'ArrowUpIcon' : 'ArrowDownIcon'}
|
|
24
24
|
className="ml-3"
|
package/tailwind.config.cjs
CHANGED
|
@@ -9,21 +9,6 @@ module.exports = {
|
|
|
9
9
|
filter: true,
|
|
10
10
|
},
|
|
11
11
|
theme: {
|
|
12
|
-
screens: {
|
|
13
|
-
sm: { max: '767px' },
|
|
14
|
-
// => @media (max-width: 767px) { ... }
|
|
15
|
-
|
|
16
|
-
md: { min: '768px', max: '1023px' },
|
|
17
|
-
// => @media (min-width: 768px and max-width: 1023px) { ... }
|
|
18
|
-
|
|
19
|
-
lg: { min: '1024px', max: '1279px' },
|
|
20
|
-
// => @media (min-width: 1024px and max-width: 1279px) { ... }
|
|
21
|
-
|
|
22
|
-
xl: { min: '1280px' },
|
|
23
|
-
// => @media (min-width: 1280px) { ... }
|
|
24
|
-
xl: { min: '1280px' },
|
|
25
|
-
// => @media (min-width: 1280px) { ... }
|
|
26
|
-
},
|
|
27
12
|
container: {
|
|
28
13
|
center: true,
|
|
29
14
|
},
|