@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCreditCalculatorParams.js","sourceRoot":"","sources":["../../../src/components/Calculator/useCreditCalculatorParams.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"useCreditCalculatorParams.js","sourceRoot":"","sources":["../../../src/components/Calculator/useCreditCalculatorParams.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1C,OAAO,EAAE,uBAAuB,EAAE,gCAAgC,EAAE,MAAM,aAAa,CAAC;AACxF,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAwC5D,MAAM,CAAC,MAAM,yBAAyB,GAAG,CACvC,eAAgD,EAChD,aAAsB,EACtB,kBAAuD,EAC/B,EAAE;IAC1B,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,eAAe,CAAC;IAClD,MAAM,IAAI,GAAG,mBAAmB,CAAuB,aAAa,IAAI,uBAAuB,CAAC,CAAC;IACjG,MAAM,QAAQ,GAAG,IAAI,EAAE,QAAQ,IAAI,CAAC,gCAAgC,CAAC,CAAC;IACtE,MAAM,SAAS,GAAG,IAAI,EAAE,SAAS,IAAI,EAAE,CAAC;IACxC,MAAM,qCAAqC,GAAG,8BAA8B,CAAC;QAC3E,SAAS;QACT,eAAe;QACf,kBAAkB;KACnB,CAAC,CAAC;IAEH,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,mBAAmB,CAC5C,CAAC,QAAQ,EAAE,QAAQ,CAAC,EACpB,qCAAqC,EACrC,QAAQ,CACT,CAAC;IACF,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,mBAAmB,CAClD,CAAC,WAAW,EAAE,WAAW,CAAC,EAC1B,qCAAqC,EACrC,QAAQ,CACT,CAAC;IAEF,UAAU,GAAG,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/C,WAAW,GAAG,KAAK,CAAC,WAAW,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;IAEvD,MAAM,0BAA0B,GAAG,6BAA6B,CAAC;QAC/D,QAAQ;QACR,eAAe;QACf,kBAAkB;QAClB,UAAU;QACV,WAAW;KACZ,CAAC,CAAC;IACH,MAAM,EAAE,IAAI,EAAE,GAAG,0BAA0B,CAAC;IAC5C,MAAM,cAAc,GAAG,iBAAiB,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;IAEhE,OAAO,OAAO,CACZ,GAAG,EAAE,CAAC,CAAC;QACL,GAAG,0BAA0B;QAC7B,GAAG,eAAe;QAClB,MAAM;QACN,MAAM;QACN,SAAS;QACT,SAAS;QACT,UAAU;QACV,WAAW;QACX,cAAc;KACf,CAAC,EACF,CAAC,eAAe,EAAE,IAAI,CAAC,CACxB,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -3,5 +3,5 @@ import { JSX } from '@redneckz/uni-jsx';
|
|
|
3
3
|
import { Text } from '../../ui-kit/Text/Text.js';
|
|
4
4
|
import { TextInformationLink } from './TextInformationLink.js';
|
|
5
5
|
import { textInformationTextSize } from './textInformationTextSize.js';
|
|
6
|
-
export const TextInformation = JSX(({ className = '', links }) => (_jsxs("div", { className: className, children: [_jsx("div", { className: "pt-
|
|
6
|
+
export const TextInformation = JSX(({ className = '', links }) => (_jsxs("div", { className: className, children: [_jsx("div", { className: "pt-4 xl:pt-5", children: _jsx(Text, { size: textInformationTextSize, color: "text-secondary-text", children: `\u00a9\u00A02000-${new Date().getFullYear()}\u00A0АО \u00ABРоссельхозбанк\u00BB Генеральная лицензия Банка России \u2116\u00A03349 от\u00A012.08.2015\u00A0г.` }) }), links?.length ? (_jsx("div", { className: "flex justify-start items-start gap-5 pt-4", children: links.map((_, i) => (_jsx(TextInformationLink, { index: i, ..._ }, String(i)))) })) : null] })));
|
|
7
7
|
//# sourceMappingURL=TextInformation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInformation.js","sourceRoot":"","sources":["../../../src/components/Footer/TextInformation.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAE9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAa,CAAC,EAAE,SAAS,GAAG,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAC5E,eAAK,SAAS,EAAE,SAAS,aACvB,cAAK,SAAS,EAAC,cAAc,YAC3B,KAAC,IAAI,IAAC,IAAI,EAAE,uBAAuB,EAAE,KAAK,EAAC,qBAAqB,YAC7D,oBAAoB,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,mHAAmH,GAC3J,GACH,EACL,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,CACf,cAAK,SAAS,EAAC,
|
|
1
|
+
{"version":3,"file":"TextInformation.js","sourceRoot":"","sources":["../../../src/components/Footer/TextInformation.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAE9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAa,CAAC,EAAE,SAAS,GAAG,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAC5E,eAAK,SAAS,EAAE,SAAS,aACvB,cAAK,SAAS,EAAC,cAAc,YAC3B,KAAC,IAAI,IAAC,IAAI,EAAE,uBAAuB,EAAE,KAAK,EAAC,qBAAqB,YAC7D,oBAAoB,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,mHAAmH,GAC3J,GACH,EACL,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,CACf,cAAK,SAAS,EAAC,2CAA2C,YACvD,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CACnB,KAAC,mBAAmB,IAAiB,KAAK,EAAE,CAAC,KAAM,CAAC,IAA1B,MAAM,CAAC,CAAC,CAAC,CAAqB,CACzD,CAAC,GACE,CACP,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC,CAAC"}
|
|
@@ -10,6 +10,6 @@ import { renderBenefit } from './renderBenefit.js';
|
|
|
10
10
|
export const ProductBlockInner = JSX(({ className, version = 'primary', headlineVersion = 'L', title, description, benefits, benefitsVersion, items, isDotted = true, __html, buttons, image, directionRight = true, }) => {
|
|
11
11
|
const benefitsWithLabel = benefits?.filter((_) => _.label);
|
|
12
12
|
const img = image?.src ? _jsx(Img, { className: "mt-[-50px]", image: image }) : null;
|
|
13
|
-
return (_jsxs(BaseTile, { className: className, insetTitle: _jsx(Headline, { className: "max-w-[600px] xl:max-w-[
|
|
13
|
+
return (_jsxs(BaseTile, { className: className, insetTitle: _jsx(Headline, { className: "max-w-[600px] xl:max-w-[728px]", title: title, description: description, headlineVersion: headlineVersion, align: "text-left", isPadding: false }), ...(directionRight ? { rightImage: img } : { leftImage: img }), buttons: renderButtonsSection(buttons), children: [benefitsWithLabel?.length ? (_jsx("div", { className: "flex flex-wrap gap-6", children: benefitsWithLabel.map(renderBenefit(version, benefitsVersion)) })) : null, __html ? (_jsx("div", { className: "mt-5", children: _jsx(RichText, { __html: __html }) })) : null, items?.length ? _jsx(List, { className: "mt-5", items: items, isDotted: isDotted }) : null] }));
|
|
14
14
|
});
|
|
15
15
|
//# sourceMappingURL=ProductBlockInner.js.map
|
|
@@ -19,7 +19,7 @@ export const ImgAsPicture = JSX(({ className = '', image, imageClassName = '', i
|
|
|
19
19
|
const renderImg = (image, imageClassName = '', isMobile = false) => {
|
|
20
20
|
const style = {
|
|
21
21
|
width: image.size?.width ? `${image.size?.width}px` : '100%',
|
|
22
|
-
height: image.size?.height ? `${image.size?.height}px` : '
|
|
22
|
+
height: image.size?.height ? `${image.size?.height}px` : 'auto',
|
|
23
23
|
};
|
|
24
24
|
const title = image.title || '';
|
|
25
25
|
const alt = image.alt || image.title;
|
|
@@ -3,6 +3,6 @@ import { JSX } from '@redneckz/uni-jsx';
|
|
|
3
3
|
import { Button } from '../Button/Button.js';
|
|
4
4
|
import { Icon } from '../Icon/Icon.js';
|
|
5
5
|
export const TableInnerButton = JSX(({ isOpen, onClick }) => {
|
|
6
|
-
return (_jsxs(Button, { version: "primary", onClick: onClick, className: "w-full flex items-center justify-center rounded-none py-5", children: [_jsx("div", { className: "text-h4", children: isOpen ? 'Скрыть' : 'Показать
|
|
6
|
+
return (_jsxs(Button, { version: "primary", onClick: onClick, className: "w-full flex items-center justify-center rounded-none py-5", children: [_jsx("div", { className: "text-h4", children: isOpen ? 'Скрыть' : 'Показать' }), _jsx(Icon, { name: isOpen ? 'ArrowUpIcon' : 'ArrowDownIcon', className: "ml-3", iconVersion: "white", width: "20", height: "20" })] }));
|
|
7
7
|
});
|
|
8
8
|
//# sourceMappingURL=InnerTableButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InnerTableButton.js","sourceRoot":"","sources":["../../../src/ui-kit/InnerTable/InnerTableButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAExC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAUpC,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAwB,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE;IACjF,OAAO,CACL,MAAC,MAAM,IACL,OAAO,EAAC,SAAS,EACjB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAC,2DAA2D,aAErE,cAAK,SAAS,EAAC,SAAS,YAAE,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"InnerTableButton.js","sourceRoot":"","sources":["../../../src/ui-kit/InnerTable/InnerTableButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAExC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAUpC,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAwB,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE;IACjF,OAAO,CACL,MAAC,MAAM,IACL,OAAO,EAAC,SAAS,EACjB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAC,2DAA2D,aAErE,cAAK,SAAS,EAAC,SAAS,YAAE,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,GAAO,EAC/D,KAAC,IAAI,IACH,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,eAAe,EAC9C,SAAS,EAAC,MAAM,EAChB,WAAW,EAAC,OAAO,EACnB,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,GACX,IACK,CACV,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -26,14 +26,14 @@ export const BaseTile = JSX<BaseTileProps>(
|
|
|
26
26
|
<div className={style('relative flex flex-col font-sans', className)}>
|
|
27
27
|
{backImage ? <div className="absolute bottom-0 right-0 z-0">{backImage}</div> : null}
|
|
28
28
|
{title}
|
|
29
|
-
<div className="grow relative flex flex-wrap justify-between items-stretch gap-8">
|
|
29
|
+
<div className="grow relative flex flex-wrap md:flex-nowrap justify-between items-stretch gap-8">
|
|
30
30
|
{leftImage}
|
|
31
31
|
<div className={style('flex flex-col gap-8', leftImage ? '' : 'grow')}>
|
|
32
32
|
{insetTitle}
|
|
33
33
|
<div className="grow">{children}</div>
|
|
34
34
|
{buttons}
|
|
35
35
|
</div>
|
|
36
|
-
{rightImage ? <div className="
|
|
36
|
+
{rightImage ? <div className="-order-1 lg:order-1">{rightImage}</div> : null}
|
|
37
37
|
</div>
|
|
38
38
|
</div>
|
|
39
39
|
),
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { CreditCalculatorParamsViewSettings } from './CalculatorContent';
|
|
2
|
+
import { CommonCreditParams, CreditCalculatorUserInputParams } from './useCreditCalculatorParams';
|
|
3
|
+
|
|
4
|
+
interface CheckSourceBookRowProps {
|
|
5
|
+
row: CommonCreditParams;
|
|
6
|
+
userInputParams: CreditCalculatorUserInputParams;
|
|
7
|
+
paramsViewSettings?: CreditCalculatorParamsViewSettings;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
interface CheckSourceBookRowFieldProps extends CheckSourceBookRowProps {
|
|
11
|
+
fieldKey: string;
|
|
12
|
+
viewSettingFieldKey: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const checkCreditSourceBookRowCommonParams = (props: CheckSourceBookRowProps) =>
|
|
16
|
+
checkRowParam({
|
|
17
|
+
...props,
|
|
18
|
+
fieldKey: 'isSalaryClient',
|
|
19
|
+
viewSettingFieldKey: 'isShowSalaryClient',
|
|
20
|
+
}) &&
|
|
21
|
+
checkRowParam({
|
|
22
|
+
...props,
|
|
23
|
+
fieldKey: 'isStateEmployee',
|
|
24
|
+
viewSettingFieldKey: 'isShowStateEmployee',
|
|
25
|
+
}) &&
|
|
26
|
+
checkRowParam({
|
|
27
|
+
...props,
|
|
28
|
+
fieldKey: 'isPensionClient',
|
|
29
|
+
viewSettingFieldKey: 'isShowPensionClient',
|
|
30
|
+
}) &&
|
|
31
|
+
checkRowParam({
|
|
32
|
+
...props,
|
|
33
|
+
fieldKey: 'isInsurance',
|
|
34
|
+
viewSettingFieldKey: 'isShowInsurance',
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const checkRowParam = ({
|
|
38
|
+
row,
|
|
39
|
+
userInputParams,
|
|
40
|
+
paramsViewSettings,
|
|
41
|
+
fieldKey,
|
|
42
|
+
viewSettingFieldKey,
|
|
43
|
+
}: CheckSourceBookRowFieldProps) => {
|
|
44
|
+
const isExclude = paramsViewSettings ? !paramsViewSettings[viewSettingFieldKey] : false;
|
|
45
|
+
|
|
46
|
+
return isExclude || userInputParams[fieldKey] === row[fieldKey];
|
|
47
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { CreditCalculatorParamsViewSettings } from './CalculatorContent';
|
|
2
|
+
import { checkCreditSourceBookRowCommonParams } from './checkCreditSourceBookRowCommonParams';
|
|
3
|
+
import {
|
|
4
|
+
CreditCalculatorSourceBookLimitParams,
|
|
5
|
+
CreditCalculatorUserInputParams,
|
|
6
|
+
} from './useCreditCalculatorParams';
|
|
7
|
+
|
|
8
|
+
interface GetCreditCalculatorLimitParamsProps {
|
|
9
|
+
limitRows: CreditCalculatorSourceBookLimitParams[];
|
|
10
|
+
userInputParams: CreditCalculatorUserInputParams;
|
|
11
|
+
paramsViewSettings?: CreditCalculatorParamsViewSettings;
|
|
12
|
+
}
|
|
13
|
+
export const getCreditCalculatorLimitParams = ({
|
|
14
|
+
limitRows,
|
|
15
|
+
userInputParams,
|
|
16
|
+
paramsViewSettings,
|
|
17
|
+
}: GetCreditCalculatorLimitParamsProps) =>
|
|
18
|
+
limitRows?.find((row) =>
|
|
19
|
+
checkCreditSourceBookRowCommonParams({
|
|
20
|
+
row,
|
|
21
|
+
userInputParams,
|
|
22
|
+
paramsViewSettings,
|
|
23
|
+
}),
|
|
24
|
+
);
|
|
@@ -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
|
))}
|
|
@@ -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/package.json
CHANGED
|
@@ -26,14 +26,14 @@ export const BaseTile = JSX<BaseTileProps>(
|
|
|
26
26
|
<div className={style('relative flex flex-col font-sans', className)}>
|
|
27
27
|
{backImage ? <div className="absolute bottom-0 right-0 z-0">{backImage}</div> : null}
|
|
28
28
|
{title}
|
|
29
|
-
<div className="grow relative flex flex-wrap justify-between items-stretch gap-8">
|
|
29
|
+
<div className="grow relative flex flex-wrap md:flex-nowrap justify-between items-stretch gap-8">
|
|
30
30
|
{leftImage}
|
|
31
31
|
<div className={style('flex flex-col gap-8', leftImage ? '' : 'grow')}>
|
|
32
32
|
{insetTitle}
|
|
33
33
|
<div className="grow">{children}</div>
|
|
34
34
|
{buttons}
|
|
35
35
|
</div>
|
|
36
|
-
{rightImage ? <div className="
|
|
36
|
+
{rightImage ? <div className="-order-1 lg:order-1">{rightImage}</div> : null}
|
|
37
37
|
</div>
|
|
38
38
|
</div>
|
|
39
39
|
),
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { CreditCalculatorParamsViewSettings } from './CalculatorContent';
|
|
2
|
+
import { CommonCreditParams, CreditCalculatorUserInputParams } from './useCreditCalculatorParams';
|
|
3
|
+
|
|
4
|
+
interface CheckSourceBookRowProps {
|
|
5
|
+
row: CommonCreditParams;
|
|
6
|
+
userInputParams: CreditCalculatorUserInputParams;
|
|
7
|
+
paramsViewSettings?: CreditCalculatorParamsViewSettings;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
interface CheckSourceBookRowFieldProps extends CheckSourceBookRowProps {
|
|
11
|
+
fieldKey: string;
|
|
12
|
+
viewSettingFieldKey: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const checkCreditSourceBookRowCommonParams = (props: CheckSourceBookRowProps) =>
|
|
16
|
+
checkRowParam({
|
|
17
|
+
...props,
|
|
18
|
+
fieldKey: 'isSalaryClient',
|
|
19
|
+
viewSettingFieldKey: 'isShowSalaryClient',
|
|
20
|
+
}) &&
|
|
21
|
+
checkRowParam({
|
|
22
|
+
...props,
|
|
23
|
+
fieldKey: 'isStateEmployee',
|
|
24
|
+
viewSettingFieldKey: 'isShowStateEmployee',
|
|
25
|
+
}) &&
|
|
26
|
+
checkRowParam({
|
|
27
|
+
...props,
|
|
28
|
+
fieldKey: 'isPensionClient',
|
|
29
|
+
viewSettingFieldKey: 'isShowPensionClient',
|
|
30
|
+
}) &&
|
|
31
|
+
checkRowParam({
|
|
32
|
+
...props,
|
|
33
|
+
fieldKey: 'isInsurance',
|
|
34
|
+
viewSettingFieldKey: 'isShowInsurance',
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const checkRowParam = ({
|
|
38
|
+
row,
|
|
39
|
+
userInputParams,
|
|
40
|
+
paramsViewSettings,
|
|
41
|
+
fieldKey,
|
|
42
|
+
viewSettingFieldKey,
|
|
43
|
+
}: CheckSourceBookRowFieldProps) => {
|
|
44
|
+
const isExclude = paramsViewSettings ? !paramsViewSettings[viewSettingFieldKey] : false;
|
|
45
|
+
|
|
46
|
+
return isExclude || userInputParams[fieldKey] === row[fieldKey];
|
|
47
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { CreditCalculatorParamsViewSettings } from './CalculatorContent';
|
|
2
|
+
import { checkCreditSourceBookRowCommonParams } from './checkCreditSourceBookRowCommonParams';
|
|
3
|
+
import {
|
|
4
|
+
CreditCalculatorSourceBookLimitParams,
|
|
5
|
+
CreditCalculatorUserInputParams,
|
|
6
|
+
} from './useCreditCalculatorParams';
|
|
7
|
+
|
|
8
|
+
interface GetCreditCalculatorLimitParamsProps {
|
|
9
|
+
limitRows: CreditCalculatorSourceBookLimitParams[];
|
|
10
|
+
userInputParams: CreditCalculatorUserInputParams;
|
|
11
|
+
paramsViewSettings?: CreditCalculatorParamsViewSettings;
|
|
12
|
+
}
|
|
13
|
+
export const getCreditCalculatorLimitParams = ({
|
|
14
|
+
limitRows,
|
|
15
|
+
userInputParams,
|
|
16
|
+
paramsViewSettings,
|
|
17
|
+
}: GetCreditCalculatorLimitParamsProps) =>
|
|
18
|
+
limitRows?.find((row) =>
|
|
19
|
+
checkCreditSourceBookRowCommonParams({
|
|
20
|
+
row,
|
|
21
|
+
userInputParams,
|
|
22
|
+
paramsViewSettings,
|
|
23
|
+
}),
|
|
24
|
+
);
|
|
@@ -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 = <
|