@redneckz/wildless-cms-uni-blocks 0.8.9 → 0.8.10
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/bin/migration-scripts/0.8.10.js +31 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +82 -48
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/Calculator/rangeHelpers.d.ts +4 -0
- package/bundle/components/StepsBlock/StepsBlockContent.d.ts +11 -1
- package/bundle/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
- package/bundle/components/StepsBlock/{renderStepContent.d.ts → renderStep.d.ts} +5 -5
- package/bundle/components/Tile/TileContent.d.ts +2 -2
- package/dist/components/Calculator/Rate.js +1 -1
- package/dist/components/Calculator/Rate.js.map +1 -1
- package/dist/components/Calculator/constants.js +2 -2
- package/dist/components/Calculator/constants.js.map +1 -1
- package/dist/components/Calculator/rangeHelpers.d.ts +4 -0
- package/dist/components/Calculator/rangeHelpers.js +12 -0
- package/dist/components/Calculator/rangeHelpers.js.map +1 -0
- package/dist/components/Calculator/useBusinessDepositCalculatorParams.js +10 -3
- package/dist/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
- package/dist/components/Calculator/useCreditCalculatorParams.js +8 -2
- package/dist/components/Calculator/useCreditCalculatorParams.js.map +1 -1
- package/dist/components/Calculator/useDepositCalculatorParams.js +14 -4
- package/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/dist/components/Carousel/Carousel.js +6 -4
- package/dist/components/Carousel/Carousel.js.map +1 -1
- package/dist/components/PictureText/renderBenefit.js +1 -0
- package/dist/components/PictureText/renderBenefit.js.map +1 -1
- package/dist/components/ProductTile/renderBenefit.js +1 -0
- package/dist/components/ProductTile/renderBenefit.js.map +1 -1
- package/dist/components/StepsBlock/StepsBlock.js +7 -13
- package/dist/components/StepsBlock/StepsBlock.js.map +1 -1
- package/dist/components/StepsBlock/StepsBlock.mobile.js +24 -4
- package/dist/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
- package/dist/components/StepsBlock/StepsBlockContent.d.ts +11 -1
- package/dist/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
- package/dist/components/StepsBlock/checkCanRenderIcon.js +5 -0
- package/dist/components/StepsBlock/checkCanRenderIcon.js.map +1 -0
- package/{lib/components/StepsBlock/renderStepContent.d.ts → dist/components/StepsBlock/renderStep.d.ts} +5 -5
- package/dist/components/StepsBlock/renderStep.js +34 -0
- package/dist/components/StepsBlock/renderStep.js.map +1 -0
- package/dist/components/Tile/Tile.js +3 -3
- package/dist/components/Tile/Tile.js.map +1 -1
- package/dist/components/Tile/TileContent.d.ts +2 -2
- package/lib/components/Calculator/Rate.js +1 -1
- package/lib/components/Calculator/Rate.js.map +1 -1
- package/lib/components/Calculator/constants.js +2 -2
- package/lib/components/Calculator/constants.js.map +1 -1
- package/lib/components/Calculator/rangeHelpers.d.ts +4 -0
- package/lib/components/Calculator/rangeHelpers.js +8 -0
- package/lib/components/Calculator/rangeHelpers.js.map +1 -0
- package/lib/components/Calculator/useBusinessDepositCalculatorParams.js +10 -3
- package/lib/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
- package/lib/components/Calculator/useCreditCalculatorParams.js +8 -2
- package/lib/components/Calculator/useCreditCalculatorParams.js.map +1 -1
- package/lib/components/Calculator/useDepositCalculatorParams.js +14 -4
- package/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/lib/components/Carousel/Carousel.js +6 -4
- package/lib/components/Carousel/Carousel.js.map +1 -1
- package/lib/components/PictureText/renderBenefit.js +1 -0
- package/lib/components/PictureText/renderBenefit.js.map +1 -1
- package/lib/components/ProductTile/renderBenefit.js +1 -0
- package/lib/components/ProductTile/renderBenefit.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlock.js +7 -13
- package/lib/components/StepsBlock/StepsBlock.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlock.mobile.js +24 -4
- package/lib/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlockContent.d.ts +11 -1
- package/lib/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
- package/lib/components/StepsBlock/checkCanRenderIcon.js +2 -0
- package/lib/components/StepsBlock/checkCanRenderIcon.js.map +1 -0
- package/{dist/components/StepsBlock/renderStepContent.d.ts → lib/components/StepsBlock/renderStep.d.ts} +5 -5
- package/lib/components/StepsBlock/renderStep.js +31 -0
- package/lib/components/StepsBlock/renderStep.js.map +1 -0
- package/lib/components/Tile/Tile.js +3 -3
- package/lib/components/Tile/Tile.js.map +1 -1
- package/lib/components/Tile/TileContent.d.ts +2 -2
- package/mobile/bundle/bundle.umd.js +32 -5
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/Calculator/rangeHelpers.d.ts +4 -0
- package/mobile/bundle/components/StepsBlock/StepsBlockContent.d.ts +11 -1
- package/mobile/bundle/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
- package/mobile/bundle/components/StepsBlock/{renderStepContent.d.ts → renderStep.d.ts} +5 -5
- package/mobile/bundle/components/Tile/TileContent.d.ts +2 -2
- package/mobile/dist/components/Calculator/Rate.js +1 -1
- package/mobile/dist/components/Calculator/Rate.js.map +1 -1
- package/mobile/dist/components/Calculator/constants.js +2 -2
- package/mobile/dist/components/Calculator/constants.js.map +1 -1
- package/mobile/dist/components/Calculator/rangeHelpers.d.ts +4 -0
- package/mobile/dist/components/Calculator/rangeHelpers.js +12 -0
- package/mobile/dist/components/Calculator/rangeHelpers.js.map +1 -0
- package/mobile/dist/components/Calculator/useBusinessDepositCalculatorParams.js +10 -3
- package/mobile/dist/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
- package/mobile/dist/components/Calculator/useCreditCalculatorParams.js +8 -2
- package/mobile/dist/components/Calculator/useCreditCalculatorParams.js.map +1 -1
- package/mobile/dist/components/Calculator/useDepositCalculatorParams.js +14 -4
- package/mobile/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/mobile/dist/components/Carousel/Carousel.js +6 -4
- package/mobile/dist/components/Carousel/Carousel.js.map +1 -1
- package/mobile/dist/components/PictureText/renderBenefit.js +1 -0
- package/mobile/dist/components/PictureText/renderBenefit.js.map +1 -1
- package/mobile/dist/components/ProductTile/renderBenefit.js +1 -0
- package/mobile/dist/components/ProductTile/renderBenefit.js.map +1 -1
- package/mobile/dist/components/StepsBlock/StepsBlock.js +24 -4
- package/mobile/dist/components/StepsBlock/StepsBlock.js.map +1 -1
- package/mobile/dist/components/StepsBlock/StepsBlockContent.d.ts +11 -1
- package/mobile/dist/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
- package/mobile/dist/components/StepsBlock/checkCanRenderIcon.js +5 -0
- package/mobile/dist/components/StepsBlock/checkCanRenderIcon.js.map +1 -0
- package/mobile/dist/components/StepsBlock/renderStep.d.ts +11 -0
- package/mobile/dist/components/StepsBlock/renderStep.js +34 -0
- package/mobile/dist/components/StepsBlock/renderStep.js.map +1 -0
- package/mobile/dist/components/Tile/Tile.js +3 -3
- package/mobile/dist/components/Tile/Tile.js.map +1 -1
- package/mobile/dist/components/Tile/TileContent.d.ts +2 -2
- package/mobile/lib/components/Calculator/Rate.js +1 -1
- package/mobile/lib/components/Calculator/Rate.js.map +1 -1
- package/mobile/lib/components/Calculator/constants.js +2 -2
- package/mobile/lib/components/Calculator/constants.js.map +1 -1
- package/mobile/lib/components/Calculator/rangeHelpers.d.ts +4 -0
- package/mobile/lib/components/Calculator/rangeHelpers.js +8 -0
- package/mobile/lib/components/Calculator/rangeHelpers.js.map +1 -0
- package/mobile/lib/components/Calculator/useBusinessDepositCalculatorParams.js +10 -3
- package/mobile/lib/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
- package/mobile/lib/components/Calculator/useCreditCalculatorParams.js +8 -2
- package/mobile/lib/components/Calculator/useCreditCalculatorParams.js.map +1 -1
- package/mobile/lib/components/Calculator/useDepositCalculatorParams.js +14 -4
- package/mobile/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/mobile/lib/components/Carousel/Carousel.js +6 -4
- package/mobile/lib/components/Carousel/Carousel.js.map +1 -1
- package/mobile/lib/components/PictureText/renderBenefit.js +1 -0
- package/mobile/lib/components/PictureText/renderBenefit.js.map +1 -1
- package/mobile/lib/components/ProductTile/renderBenefit.js +1 -0
- package/mobile/lib/components/ProductTile/renderBenefit.js.map +1 -1
- package/mobile/lib/components/StepsBlock/StepsBlock.js +24 -4
- package/mobile/lib/components/StepsBlock/StepsBlock.js.map +1 -1
- package/mobile/lib/components/StepsBlock/StepsBlockContent.d.ts +11 -1
- package/mobile/lib/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
- package/mobile/lib/components/StepsBlock/checkCanRenderIcon.js +2 -0
- package/mobile/lib/components/StepsBlock/checkCanRenderIcon.js.map +1 -0
- package/mobile/lib/components/StepsBlock/renderStep.d.ts +11 -0
- package/mobile/lib/components/StepsBlock/renderStep.js +31 -0
- package/mobile/lib/components/StepsBlock/renderStep.js.map +1 -0
- package/mobile/lib/components/Tile/Tile.js +3 -3
- package/mobile/lib/components/Tile/Tile.js.map +1 -1
- package/mobile/lib/components/Tile/TileContent.d.ts +2 -2
- package/mobile/src/components/Calculator/Rate.tsx +1 -1
- package/mobile/src/components/Calculator/constants.ts +2 -2
- package/mobile/src/components/Calculator/rangeHelpers.ts +24 -0
- package/mobile/src/components/Calculator/useBusinessDepositCalculatorParams.ts +15 -3
- package/mobile/src/components/Calculator/useCreditCalculatorParams.ts +8 -2
- package/mobile/src/components/Calculator/useDepositCalculatorParams.ts +18 -4
- package/mobile/src/components/Carousel/Carousel.tsx +6 -4
- package/mobile/src/components/PictureText/renderBenefit.tsx +1 -0
- package/mobile/src/components/ProductTile/renderBenefit.tsx +1 -0
- package/mobile/src/components/StepsBlock/StepsBlock.tsx +29 -5
- package/mobile/src/components/StepsBlock/StepsBlock.ui.json +6 -0
- package/mobile/src/components/StepsBlock/StepsBlockContent.ts +13 -1
- package/mobile/src/components/StepsBlock/checkCanRenderIcon.ts +3 -0
- package/mobile/src/components/StepsBlock/renderStep.tsx +83 -0
- package/mobile/src/components/Tile/Tile.example.json +1 -1
- package/mobile/src/components/Tile/Tile.tsx +4 -4
- package/mobile/src/components/Tile/Tile.ui.json +7 -1
- package/mobile/src/components/Tile/TileContent.ts +2 -2
- package/package.json +1 -1
- package/src/components/Calculator/Rate.tsx +1 -1
- package/src/components/Calculator/constants.ts +2 -2
- package/src/components/Calculator/rangeHelpers.ts +24 -0
- package/src/components/Calculator/useBusinessDepositCalculatorParams.ts +15 -3
- package/src/components/Calculator/useCreditCalculatorParams.ts +8 -2
- package/src/components/Calculator/useDepositCalculatorParams.ts +18 -4
- package/src/components/Carousel/Carousel.tsx +6 -4
- package/src/components/PictureText/renderBenefit.tsx +1 -0
- package/src/components/ProductTile/renderBenefit.tsx +1 -0
- package/src/components/StepsBlock/StepsBlock.fixture.mobile.tsx +19 -1
- package/src/components/StepsBlock/StepsBlock.fixture.tsx +10 -3
- package/src/components/StepsBlock/StepsBlock.mobile.tsx +29 -5
- package/src/components/StepsBlock/StepsBlock.tsx +28 -16
- package/src/components/StepsBlock/StepsBlock.ui.json +6 -0
- package/src/components/StepsBlock/StepsBlockContent.ts +13 -1
- package/src/components/StepsBlock/checkCanRenderIcon.ts +3 -0
- package/src/components/StepsBlock/renderStep.tsx +83 -0
- package/src/components/Tile/Tile.example.json +1 -1
- package/src/components/Tile/Tile.fixture.tsx +2 -2
- package/src/components/Tile/Tile.tsx +4 -4
- package/src/components/Tile/Tile.ui.json +7 -1
- package/src/components/Tile/TileContent.ts +2 -2
- package/bundle/utils/checkIsIconRenderable.d.ts +0 -2
- package/dist/components/StepsBlock/renderStepContent.js +0 -19
- package/dist/components/StepsBlock/renderStepContent.js.map +0 -1
- package/dist/utils/checkIsIconRenderable.d.ts +0 -2
- package/dist/utils/checkIsIconRenderable.js +0 -5
- package/dist/utils/checkIsIconRenderable.js.map +0 -1
- package/lib/components/StepsBlock/renderStepContent.js +0 -16
- package/lib/components/StepsBlock/renderStepContent.js.map +0 -1
- package/lib/utils/checkIsIconRenderable.d.ts +0 -2
- package/lib/utils/checkIsIconRenderable.js +0 -2
- package/lib/utils/checkIsIconRenderable.js.map +0 -1
- package/mobile/bundle/utils/checkIsIconRenderable.d.ts +0 -2
- package/mobile/dist/components/StepsBlock/renderStepContent.d.ts +0 -11
- package/mobile/dist/components/StepsBlock/renderStepContent.js +0 -19
- package/mobile/dist/components/StepsBlock/renderStepContent.js.map +0 -1
- package/mobile/dist/utils/checkIsIconRenderable.d.ts +0 -2
- package/mobile/dist/utils/checkIsIconRenderable.js +0 -5
- package/mobile/dist/utils/checkIsIconRenderable.js.map +0 -1
- package/mobile/lib/components/StepsBlock/renderStepContent.d.ts +0 -11
- package/mobile/lib/components/StepsBlock/renderStepContent.js +0 -16
- package/mobile/lib/components/StepsBlock/renderStepContent.js.map +0 -1
- package/mobile/lib/utils/checkIsIconRenderable.d.ts +0 -2
- package/mobile/lib/utils/checkIsIconRenderable.js +0 -2
- package/mobile/lib/utils/checkIsIconRenderable.js.map +0 -1
- package/mobile/src/components/StepsBlock/renderStepContent.tsx +0 -83
- package/mobile/src/utils/checkIsIconRenderable.tsx +0 -3
- package/src/components/StepsBlock/renderStepContent.tsx +0 -83
- package/src/utils/checkIsIconRenderable.tsx +0 -3
|
@@ -2,20 +2,26 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
2
2
|
exports.useCreditCalculatorParams = void 0;
|
|
3
3
|
const constants_1 = require("./constants");
|
|
4
4
|
const getMonthlyPayment_1 = require("./getMonthlyPayment");
|
|
5
|
+
const rangeHelpers_1 = require("./rangeHelpers");
|
|
5
6
|
const useCalculatorParams_1 = require("./useCalculatorParams");
|
|
6
7
|
const useCreditCalculatorParams = (userInputParams, sourceBookDir) => {
|
|
7
|
-
const { isInsurance, isSalaryClient, isStateEmployee, moneyValue } = userInputParams;
|
|
8
|
+
const { isInsurance, isSalaryClient, isStateEmployee, moneyValue, monthsValue } = userInputParams;
|
|
8
9
|
const data = (0, useCalculatorParams_1.useCalculatorParams)(sourceBookDir || constants_1.CREDIT_CALC_DEFAULT_DIR);
|
|
9
10
|
const creditCalculatorSourceBookParams = data?.rows?.find((_) => {
|
|
10
11
|
return (isInsurance === _.isInsurance &&
|
|
11
12
|
isSalaryClient === _.isSalaryClient &&
|
|
12
|
-
isStateEmployee === _.isStateEmployee
|
|
13
|
+
isStateEmployee === _.isStateEmployee &&
|
|
14
|
+
(0, rangeHelpers_1.checkRangeByKeys)(moneyValue, ['minSum', 'maxSum'], _) &&
|
|
15
|
+
(0, rangeHelpers_1.checkRangeByKeys)(monthsValue, ['minMonths', 'maxMonths'], _));
|
|
13
16
|
}) || constants_1.DEFAULT_CREDIT_CALCULATOR_PARAMS;
|
|
14
17
|
const { rateBottomRange, rateTopRange, sumBorder } = creditCalculatorSourceBookParams;
|
|
15
18
|
const finalRate = moneyValue <= sumBorder ? rateBottomRange : rateTopRange;
|
|
16
19
|
const monthlyPayment = (0, getMonthlyPayment_1.getMonthlyPayment)(finalRate, userInputParams);
|
|
20
|
+
const sourceBookRows = data?.rows || [constants_1.DEFAULT_CREDIT_CALCULATOR_PARAMS];
|
|
17
21
|
return {
|
|
18
22
|
...creditCalculatorSourceBookParams,
|
|
23
|
+
...(0, rangeHelpers_1.getRangeByKeys)(['minSum', 'maxSum'], sourceBookRows),
|
|
24
|
+
...(0, rangeHelpers_1.getRangeByKeys)(['minMonths', 'maxMonths'], sourceBookRows),
|
|
19
25
|
...userInputParams,
|
|
20
26
|
finalRate,
|
|
21
27
|
monthlyPayment,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCreditCalculatorParams.js","sourceRoot":"","sources":["../../../src/components/Calculator/useCreditCalculatorParams.ts"],"names":[],"mappings":";;AAAA,2CAAwF;AACxF,2DAAwD;AACxD,+DAA4D;AAkCrD,MAAM,yBAAyB,GAAG,CACvC,eAAgD,EAChD,aAAsB,EACE,EAAE;IAC1B,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,UAAU,EAAE,GAAG,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"useCreditCalculatorParams.js","sourceRoot":"","sources":["../../../src/components/Calculator/useCreditCalculatorParams.ts"],"names":[],"mappings":";;AAAA,2CAAwF;AACxF,2DAAwD;AACxD,iDAAkE;AAClE,+DAA4D;AAkCrD,MAAM,yBAAyB,GAAG,CACvC,eAAgD,EAChD,aAAsB,EACE,EAAE;IAC1B,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,eAAe,CAAC;IAElG,MAAM,IAAI,GAAG,IAAA,yCAAmB,EAAuB,aAAa,IAAI,mCAAuB,CAAC,CAAC;IACjG,MAAM,gCAAgC,GACpC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;QACrB,OAAO,CACL,WAAW,KAAK,CAAC,CAAC,WAAW;YAC7B,cAAc,KAAK,CAAC,CAAC,cAAc;YACnC,eAAe,KAAK,CAAC,CAAC,eAAe;YACrC,IAAA,+BAAgB,EAAC,UAAU,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC;YACrD,IAAA,+BAAgB,EAAC,WAAW,EAAE,CAAC,WAAW,EAAE,WAAW,CAAC,EAAE,CAAC,CAAC,CAC7D,CAAC;IACJ,CAAC,CAAC,IAAI,4CAAgC,CAAC;IAEzC,MAAM,EAAE,eAAe,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,gCAAgC,CAAC;IACtF,MAAM,SAAS,GAAG,UAAU,IAAI,SAAS,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,YAAY,CAAC;IAC3E,MAAM,cAAc,GAAG,IAAA,qCAAiB,EAAC,SAAS,EAAE,eAAe,CAAC,CAAC;IACrE,MAAM,cAAc,GAAG,IAAI,EAAE,IAAI,IAAI,CAAC,4CAAgC,CAAC,CAAC;IAExE,OAAO;QACL,GAAG,gCAAgC;QACnC,GAAG,IAAA,6BAAc,EAAC,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE,cAAc,CAAC;QACvD,GAAG,IAAA,6BAAc,EAAC,CAAC,WAAW,EAAE,WAAW,CAAC,EAAE,cAAc,CAAC;QAC7D,GAAG,eAAe;QAClB,SAAS;QACT,cAAc;KACf,CAAC;AACJ,CAAC,CAAC;AA/BW,QAAA,yBAAyB,6BA+BpC"}
|
|
@@ -1,16 +1,26 @@
|
|
|
1
1
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
2
|
exports.useDepositCalculatorParams = void 0;
|
|
3
3
|
const constants_1 = require("./constants");
|
|
4
|
+
const rangeHelpers_1 = require("./rangeHelpers");
|
|
4
5
|
const useCalculatorParams_1 = require("./useCalculatorParams");
|
|
5
6
|
const useDepositCalculatorParams = (userInputParams, sourceBookDir) => {
|
|
6
|
-
const { isMonthlyInterestPayment, moneyValue } = userInputParams;
|
|
7
|
+
const { isMonthlyInterestPayment, moneyValue, monthsValue } = userInputParams;
|
|
7
8
|
const data = (0, useCalculatorParams_1.useCalculatorParams)(sourceBookDir || constants_1.DEPOSIT_CALC_DEFAULT_DIR);
|
|
8
|
-
const depositCalculatorSourceBookParams = data?.rows?.find((_) => isMonthlyInterestPayment === _.isMonthlyInterestPayment
|
|
9
|
-
|
|
9
|
+
const depositCalculatorSourceBookParams = data?.rows?.find((_) => isMonthlyInterestPayment === _.isMonthlyInterestPayment &&
|
|
10
|
+
(0, rangeHelpers_1.checkRangeByKeys)(moneyValue, ['minSum', 'maxSum'], _) &&
|
|
11
|
+
(0, rangeHelpers_1.checkRangeByKeys)(monthsValue, ['minMonths', 'maxMonths'], _)) || constants_1.DEFAULT_DEPOSIT_CALCULATOR_PARAMS;
|
|
10
12
|
const { rate } = depositCalculatorSourceBookParams;
|
|
11
13
|
const income = getDepositIncome(rate, userInputParams);
|
|
12
14
|
const finalSum = moneyValue + income;
|
|
13
|
-
|
|
15
|
+
const sourceBookRows = data?.rows || [constants_1.DEFAULT_DEPOSIT_CALCULATOR_PARAMS];
|
|
16
|
+
return {
|
|
17
|
+
...depositCalculatorSourceBookParams,
|
|
18
|
+
...(0, rangeHelpers_1.getRangeByKeys)(['minSum', 'maxSum'], sourceBookRows),
|
|
19
|
+
...(0, rangeHelpers_1.getRangeByKeys)(['minMonths', 'maxMonths'], sourceBookRows),
|
|
20
|
+
...userInputParams,
|
|
21
|
+
income,
|
|
22
|
+
finalSum,
|
|
23
|
+
};
|
|
14
24
|
};
|
|
15
25
|
exports.useDepositCalculatorParams = useDepositCalculatorParams;
|
|
16
26
|
const getDepositIncome = (rate, userInputParams) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDepositCalculatorParams.js","sourceRoot":"","sources":["../../../src/components/Calculator/useDepositCalculatorParams.ts"],"names":[],"mappings":";;AAAA,2CAA0F;AAC1F,+DAA4D;
|
|
1
|
+
{"version":3,"file":"useDepositCalculatorParams.js","sourceRoot":"","sources":["../../../src/components/Calculator/useDepositCalculatorParams.ts"],"names":[],"mappings":";;AAAA,2CAA0F;AAC1F,iDAAkE;AAClE,+DAA4D;AA8BrD,MAAM,0BAA0B,GAAG,CACxC,eAAiD,EACjD,aAAsB,EACG,EAAE;IAC3B,MAAM,EAAE,wBAAwB,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,eAAe,CAAC;IAE9E,MAAM,IAAI,GAAG,IAAA,yCAAmB,EAC9B,aAAa,IAAI,oCAAwB,CAC1C,CAAC;IAEF,MAAM,iCAAiC,GACrC,IAAI,EAAE,IAAI,EAAE,IAAI,CACd,CAAC,CAAC,EAAE,EAAE,CACJ,wBAAwB,KAAK,CAAC,CAAC,wBAAwB;QACvD,IAAA,+BAAgB,EAAC,UAAU,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC;QACrD,IAAA,+BAAgB,EAAC,WA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22
22
|
});
|
|
23
23
|
const isBankHistoryCarousel = childBlocks && childBlocks[0]?.type === 'CarouselBankHistoryCard';
|
|
24
|
-
return ((0, jsx_runtime_1.jsx)(BlockWrapper_1.BlockWrapper, { className: (0, style_1.style)(getPaddingStyle(isPadding), className), ...rest, children: (0, jsx_runtime_1.jsxs)("div", { className: "relative max-w-full", children: [(0, jsx_runtime_1.jsx)(SwipeListContainer_1.SwipeListContainer, { containerRef: containerRef, visibleItemCount: visibleItemCount, snapAlign: "snap-start", gap: ITEMS_GAP, onVisibleIndicesChange: scroll.handleVisibleIndicesChange, children:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
return ((0, jsx_runtime_1.jsx)(BlockWrapper_1.BlockWrapper, { className: (0, style_1.style)(getPaddingStyle(isPadding), className), ...rest, children: (0, jsx_runtime_1.jsxs)("div", { className: "relative max-w-full", children: [(0, jsx_runtime_1.jsx)(SwipeListContainer_1.SwipeListContainer, { containerRef: containerRef, visibleItemCount: visibleItemCount, snapAlign: "snap-start", gap: ITEMS_GAP, onVisibleIndicesChange: scroll.handleVisibleIndicesChange, children: isBankHistoryCarousel
|
|
25
|
+
? (0, renderChildren_1.renderChildren)({
|
|
26
|
+
...rest,
|
|
27
|
+
block: { ...rest.block, blocks: buildBlocks(childBlocks, activeIndex) },
|
|
28
|
+
})
|
|
29
|
+
: (0, renderChildren_1.renderChildren)(rest) }), (0, jsx_runtime_1.jsx)(CarouselScrollButtons_1.CarouselScrollButtons, { scroll: scroll, isBlur: isBlur, arrowsPadded: arrowsPadded, onScrollLeft: decreaseActiveIndex, onScrollRight: increaseActiveIndex, hasEdgeBlocks: isBankHistoryCarousel, activeIndex: activeIndex, itemCount: count })] }) }));
|
|
28
30
|
});
|
|
29
31
|
exports.Carousel.childrenTypes = [
|
|
30
32
|
'CarouselCard',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Carousel.js","sourceRoot":"","sources":["../../../src/components/Carousel/Carousel.tsx"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ChB,IACE,GACO,CAChB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAQ,CAAC,aAAa,GAAG;IACvB,cAAc;IACd,yBAAyB;IACzB,qBAAqB;IACrB,wBAAwB;IACxB,qBAAqB;IACrB,sBAAsB;IACtB,4BAA4B;IAC5B,qBAAqB;IACrB,wBAAwB;CACzB,CAAC;AAEF,MAAM,WAAW,GAAG,CAAC,MAAmB,EAAE,WAAoB,EAAE,EAAE;IAChE,OAAO,MAAM,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,KAAK,yBAAyB;QAC5D,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;YAClB,OAAO;gBACL,GAAG,CAAC;gBACJ,OAAO,EAAE;oBACP,GAAG,CAAC,CAAC,OAAO;oBACZ,WAAW,EAAE,CAAC;oBACd,QAAQ,EAAE,WAAW,KAAK,CAAC;oBAC3B,YAAY,EAAE,MAAM,CAAC,MAAM;iBAC5B;aACF,CAAC;QACJ,CAAC,CAAC;QACJ,CAAC,CAAC,MAAM,CAAC;AACb,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,SAAkB,EAAU,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC"}
|
|
@@ -4,6 +4,7 @@ const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
|
4
4
|
const BenefitItem_1 = require("../../ui-kit/BenefitItem/BenefitItem");
|
|
5
5
|
const RichText_1 = require("../../ui-kit/RichText/RichText");
|
|
6
6
|
const assertUnreachable_1 = require("../../utils/assertUnreachable");
|
|
7
|
+
// TODO: Create universal function for this case
|
|
7
8
|
const renderBenefit =
|
|
8
9
|
// Linter doesn't understand that switch processes all cases
|
|
9
10
|
// eslint-disable-next-line consistent-return
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderBenefit.js","sourceRoot":"","sources":["../../../src/components/PictureText/renderBenefit.tsx"],"names":[],"mappings":";;;AACA,sEAAmE;AAEnE,6DAA0D;AAC1D,qEAAkE;
|
|
1
|
+
{"version":3,"file":"renderBenefit.js","sourceRoot":"","sources":["../../../src/components/PictureText/renderBenefit.tsx"],"names":[],"mappings":";;;AACA,sEAAmE;AAEnE,6DAA0D;AAC1D,qEAAkE;AAElE,gDAAgD;AACzC,MAAM,aAAa;AACxB,4DAA4D;AAC5D,6CAA6C;AAC7C,CAAC,OAAqB,EAAE,EAAE,CAAC,CAAC,OAA4B,EAAE,CAAS,EAAE,EAAE;IACrE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IAEzB,IAAI,CAAC,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,KAAK,CAAC,EAAE;QAC3C,OAAO,IAAI,CAAC;KACb;IAED,QAAQ,IAAI,EAAE;QACZ,KAAK,SAAS;YACZ,OAAO,CACL,uBAAC,yBAAW,IAEV,IAAI,EAAE,OAAO,CAAC,IAAI,EAClB,KAAK,EAAE,OAAO,CAAC,KAAK,EACpB,WAAW,EAAE,OAAO,CAAC,WAAW,EAChC,OAAO,EAAE,OAAO,IAJX,MAAM,CAAC,CAAC,CAAC,CAKd,CACH,CAAC;QACJ,KAAK,KAAK;YACR,OAAO,uBAAC,mBAAQ,IAAC,MAAM,EAAE,OAAO,CAAC,MAAM,GAAI,CAAC;QAC9C;YACE,IAAA,qCAAiB,EAAC,OAAO,CAAC,CAAC;KAC9B;AACH,CAAC,CAAC;AA1BS,QAAA,aAAa,iBA0BtB"}
|
|
@@ -4,6 +4,7 @@ const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
|
4
4
|
const RichText_1 = require("../../ui-kit/RichText/RichText");
|
|
5
5
|
const Text_1 = require("../../ui-kit/Text/Text");
|
|
6
6
|
const assertUnreachable_1 = require("../../utils/assertUnreachable");
|
|
7
|
+
// TODO: Create universal function for this case
|
|
7
8
|
const renderBenefit =
|
|
8
9
|
// Linter doesn't understand that switch processes all cases
|
|
9
10
|
// eslint-disable-next-line consistent-return
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderBenefit.js","sourceRoot":"","sources":["../../../src/components/ProductTile/renderBenefit.tsx"],"names":[],"mappings":";;;AAAA,6DAA0D;AAC1D,iDAA8C;AAC9C,qEAAkE;
|
|
1
|
+
{"version":3,"file":"renderBenefit.js","sourceRoot":"","sources":["../../../src/components/ProductTile/renderBenefit.tsx"],"names":[],"mappings":";;;AAAA,6DAA0D;AAC1D,iDAA8C;AAC9C,qEAAkE;AAGlE,gDAAgD;AACzC,MAAM,aAAa;AACxB,4DAA4D;AAC5D,6CAA6C;AAC7C,CAAC,OAAgB,EAAE,CAAS,EAAE,EAAE;IAC9B,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IAEzB,IAAI,CAAC,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,KAAK,CAAC,EAAE;QAC3C,OAAO,IAAI,CAAC;KACb;IAED,QAAQ,IAAI,EAAE;QACZ,KAAK,SAAS;YACZ,OAAO;gBACL,uBAAC,WAAI,IAAoB,IAAI,EAAC,SAAS,YACpC,OAAO,CAAC,KAAK,IADL,SAAS,CAAC,EAAE,CAEhB;gBACP,uBAAC,WAAI,IAEH,IAAI,EAAC,QAAQ,EACb,IAAI,EAAC,YAAY,EACjB,KAAK,EAAC,wCAAwC,YAE7C,OAAO,CAAC,WAAW,IALf,QAAQ,CAAC,EAAE,CAMX;aACR,CAAC;QACJ,KAAK,KAAK;YACR,OAAO,CACL,gCAAK,SAAS,EAAC,YAAY,YACzB,uBAAC,mBAAQ,IAAC,MAAM,EAAE,OAAO,CAAC,MAAM,GAAI,GAChC,CACP,CAAC;QACJ;YACE,IAAA,qCAAiB,EAAC,OAAO,CAAC,CAAC;KAC9B;AACH,CAAC,CAAC;AAlCS,QAAA,aAAa,iBAkCtB"}
|
|
@@ -5,8 +5,10 @@ const uni_jsx_1 = require("@redneckz/uni-jsx");
|
|
|
5
5
|
const BlockWrapper_1 = require("../../ui-kit/BlockWrapper");
|
|
6
6
|
const Heading_1 = require("../../ui-kit/Heading/Heading");
|
|
7
7
|
const Img_1 = require("../../ui-kit/Img/Img");
|
|
8
|
-
const
|
|
8
|
+
const RichText_1 = require("../../ui-kit/RichText/RichText");
|
|
9
|
+
const assertUnreachable_1 = require("../../utils/assertUnreachable");
|
|
9
10
|
const getIconWithVersion_1 = require("../../utils/getIconWithVersion");
|
|
11
|
+
const checkCanRenderIcon_1 = require("./checkCanRenderIcon");
|
|
10
12
|
const StepsBlockStyleMaps_1 = require("./StepsBlockStyleMaps");
|
|
11
13
|
const STEPS_SIZE_MAP = {
|
|
12
14
|
normal: 'h-[70px] w-[70px] min-w-[70px] min-h-[70px]',
|
|
@@ -18,9 +20,27 @@ const STEPS_TILE_DESCRIPTION_HEIGHT_MAP = {
|
|
|
18
20
|
};
|
|
19
21
|
exports.StepsBlock = (0, uni_jsx_1.JSX)(({ className = '', title, description, showLines = true, steps, size = 'normal', version = 'primary', ...rest }) => {
|
|
20
22
|
const styleMap = StepsBlockStyleMaps_1.STEPS_BLOCK_STYLE_MAPS[version];
|
|
21
|
-
return ((0, jsx_runtime_1.jsxs)(BlockWrapper_1.BlockWrapper, { className: `box-border px-4 py-6 flex flex-col ${className}`, version: version, ...rest, children: [title ? (0, jsx_runtime_1.jsx)(Heading_1.Heading, { headingType: "h3", className: "text-center", title: title }) : null, description ? ((0, jsx_runtime_1.jsx)("p", { className: `text-m-light text-center ${styleMap.description} ${title ? 'mt-2' : ''}`, children: description })) : null, steps?.length ? ((0, jsx_runtime_1.jsx)("div", { className: `box-border py-0.5 mb-0.5 mt-5`, children: (0, jsx_runtime_1.jsx)("div", { className: "flex flex-col justify-between gap-x-[101px]", children: steps.map(
|
|
23
|
+
return ((0, jsx_runtime_1.jsxs)(BlockWrapper_1.BlockWrapper, { className: `box-border px-4 py-6 flex flex-col ${className}`, version: version, ...rest, children: [title ? (0, jsx_runtime_1.jsx)(Heading_1.Heading, { headingType: "h3", className: "text-center", title: title }) : null, description ? ((0, jsx_runtime_1.jsx)("p", { className: `text-m-light text-center ${styleMap.description} ${title ? 'mt-2' : ''}`, children: description })) : null, steps?.length ? ((0, jsx_runtime_1.jsx)("div", { className: `box-border py-0.5 mb-0.5 mt-5`, children: (0, jsx_runtime_1.jsx)("div", { className: "flex flex-col justify-between gap-x-[101px]", children: steps.map(renderStep(size, version, showLines)) }) })) : null] }));
|
|
22
24
|
});
|
|
23
|
-
|
|
25
|
+
// TODO: Create universal function for this case
|
|
26
|
+
const renderStep = (size, version, showLines) =>
|
|
27
|
+
// Linter doesn't understand that switch processes all cases
|
|
28
|
+
// eslint-disable-next-line consistent-return
|
|
29
|
+
(step, i, steps) => {
|
|
30
|
+
const { type } = step;
|
|
31
|
+
if (!(type === 'default' || type === 'rte')) {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
switch (type) {
|
|
35
|
+
case 'default':
|
|
36
|
+
return renderDefaultStep(size, version, showLines)(step, i, steps);
|
|
37
|
+
case 'rte':
|
|
38
|
+
return (0, jsx_runtime_1.jsx)(RichText_1.RichText, { __html: step.__html });
|
|
39
|
+
default:
|
|
40
|
+
(0, assertUnreachable_1.assertUnreachable)(step);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
const renderDefaultStep = (size, version, showLines) => (step, i, steps) => {
|
|
24
44
|
const isLastStep = steps.length - 1 === i;
|
|
25
45
|
const margin = size === 'normal' ? 'ml-[34px]' : 'ml-6';
|
|
26
46
|
const styleMap = StepsBlockStyleMaps_1.STEPS_BLOCK_STYLE_MAPS[version];
|
|
@@ -31,6 +51,6 @@ const renderIconArea = (size, version) => (step, i) => {
|
|
|
31
51
|
const iconAreaSize = STEPS_SIZE_MAP[size];
|
|
32
52
|
const iconSize = size === 'normal' ? '38' : '27';
|
|
33
53
|
const iconTextSize = size === 'normal' ? 'text-m-title' : 'text-m-title-xs';
|
|
34
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: `${iconAreaSize} ${styleMap.iconBackground} rounded-full z-10 mr-3 flex justify-center content-center`, children: (0, jsx_runtime_1.jsx)("span", { className: `font-medium flex self-center ${iconTextSize}`, children: (0,
|
|
54
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: `${iconAreaSize} ${styleMap.iconBackground} rounded-full z-10 mr-3 flex justify-center content-center`, children: (0, jsx_runtime_1.jsx)("span", { className: `font-medium flex self-center ${iconTextSize}`, children: (0, checkCanRenderIcon_1.checkCanRenderIcon)(step?.icon) ? ((0, jsx_runtime_1.jsx)(Img_1.Img, { image: (0, getIconWithVersion_1.getIconWithVersion)({ ...step.icon }, version), width: iconSize, height: iconSize, asSVG: true })) : ((0, jsx_runtime_1.jsx)("span", { children: i + 1 })) }) }));
|
|
35
55
|
};
|
|
36
56
|
//# sourceMappingURL=StepsBlock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepsBlock.js","sourceRoot":"","sources":["../../../src/components/StepsBlock/StepsBlock.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AAIxC,4DAAyD;AACzD,0DAAuD;AACvD,8CAA2C;AAC3C,
|
|
1
|
+
{"version":3,"file":"StepsBlock.js","sourceRoot":"","sources":["../../../src/components/StepsBlock/StepsBlock.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AAIxC,4DAAyD;AACzD,0DAAuD;AACvD,8CAA2C;AAC3C,6DAA0D;AAC1D,qEAAkE;AAClE,uEAAoE;AACpE,6DAA0D;AAE1D,+DAA+D;AAI/D,MAAM,cAAc,GAAgC;IAClD,MAAM,EAAE,6CAA6C;IACrD,KAAK,EAAE,6BAA6B;CACrC,CAAC;AAEF,MAAM,iCAAiC,GAAgC;IACrE,MAAM,EAAE,cAAc;IACtB,KAAK,EAAE,UAAU;CAClB,CAAC;AAEW,QAAA,UAAU,GAAG,IAAA,aAAG,EAC3B,CAAC,EACC,SAAS,GAAG,EA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
import type { DefaultListItemType } from '../../model/DefaultListItemType';
|
|
2
3
|
import type { DescriptionProps, HeadlineCommonProps, LabelProps } from '../../model/HeadlineType';
|
|
3
4
|
import type { IconProps } from '../../model/Picture';
|
|
5
|
+
import type { RichTextItem } from '../../model/RichTextItem';
|
|
4
6
|
import type { SizeVersion } from '../../model/SizeVersion';
|
|
5
7
|
import type { ButtonWithIconProps } from '../../ui-kit/Button/ButtonProps';
|
|
6
8
|
declare type StepCommonProps = IconProps & {
|
|
@@ -14,10 +16,18 @@ declare type StepCommonProps = IconProps & {
|
|
|
14
16
|
/** @title Список */
|
|
15
17
|
items?: string[];
|
|
16
18
|
};
|
|
19
|
+
/**
|
|
20
|
+
* @title Стандартный
|
|
21
|
+
*/
|
|
22
|
+
export declare type DefaultStep = DescriptionProps & LabelProps & StepCommonProps & DefaultListItemType;
|
|
23
|
+
/**
|
|
24
|
+
* @title Форматированный текст
|
|
25
|
+
*/
|
|
26
|
+
declare type RichTextStep = RichTextItem & IconProps;
|
|
17
27
|
/**
|
|
18
28
|
* @title Шаг
|
|
19
29
|
*/
|
|
20
|
-
export declare type Step =
|
|
30
|
+
export declare type Step = DefaultStep | RichTextStep;
|
|
21
31
|
/**
|
|
22
32
|
* @title Блок шаги
|
|
23
33
|
*/
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
exports.checkCanRenderIcon = void 0;
|
|
3
|
+
const checkCanRenderIcon = (icon) => Boolean(icon?.icon || icon?.src);
|
|
4
|
+
exports.checkCanRenderIcon = checkCanRenderIcon;
|
|
5
|
+
//# sourceMappingURL=checkCanRenderIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkCanRenderIcon.js","sourceRoot":"","sources":["../../../src/components/StepsBlock/checkCanRenderIcon.ts"],"names":[],"mappings":";;AAEO,MAAM,kBAAkB,GAAG,CAAC,IAAc,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,IAAI,IAAI,EAAE,GAAG,CAAC,CAAC;AAA1E,QAAA,kBAAkB,sBAAwD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { BlockVersion } from '../../model/BlockVersion';
|
|
2
|
+
import type { VNode } from '../../model/VNode';
|
|
3
|
+
import type { Step } from './StepsBlockContent';
|
|
4
|
+
import type { StyleType } from './StepsBlockStyleMaps';
|
|
5
|
+
interface RenderStepProps {
|
|
6
|
+
styleMap: StyleType;
|
|
7
|
+
isMainButton: boolean;
|
|
8
|
+
version?: BlockVersion;
|
|
9
|
+
}
|
|
10
|
+
export declare const renderStep: (props: RenderStepProps) => (step: Step, i: number, arr: Step[]) => VNode;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
exports.renderStep = void 0;
|
|
3
|
+
const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
4
|
+
const Button_1 = require("../../ui-kit/Button/Button");
|
|
5
|
+
const List_1 = require("../../ui-kit/List/List");
|
|
6
|
+
const RichText_1 = require("../../ui-kit/RichText/RichText");
|
|
7
|
+
const Text_1 = require("../../ui-kit/Text/Text");
|
|
8
|
+
const assertUnreachable_1 = require("../../utils/assertUnreachable");
|
|
9
|
+
const style_1 = require("../../utils/style");
|
|
10
|
+
// TODO: Create universal function for this case
|
|
11
|
+
const renderStep = (props) =>
|
|
12
|
+
// Linter doesn't understand that switch processes all cases
|
|
13
|
+
// eslint-disable-next-line consistent-return
|
|
14
|
+
(step, i, arr) => {
|
|
15
|
+
const { type } = step;
|
|
16
|
+
if (!(type === 'default' || type === 'rte')) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
switch (type) {
|
|
20
|
+
case 'default':
|
|
21
|
+
return renderDefaultStep(props)(step, i, arr);
|
|
22
|
+
case 'rte':
|
|
23
|
+
return (0, jsx_runtime_1.jsx)(RichText_1.RichText, { __html: step.__html });
|
|
24
|
+
default:
|
|
25
|
+
(0, assertUnreachable_1.assertUnreachable)(step);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
exports.renderStep = renderStep;
|
|
29
|
+
const renderDefaultStep = ({ styleMap, isMainButton, version }) => (step, i, arr) => {
|
|
30
|
+
const { label, description, button, items, isDotted } = step;
|
|
31
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, style_1.style)('relative flex flex-col items-center text-center whitespace-pre-line overflow-hidden', getContainerWidth(arr.length)), children: [(0, jsx_runtime_1.jsxs)("div", { className: (0, style_1.style)(button?.text ? 'mb-8' : '', 'text-center'), children: [label ? ((0, jsx_runtime_1.jsx)("div", { className: "mb-2", children: (0, jsx_runtime_1.jsx)(Text_1.Text, { size: "text-h6", children: label }) })) : null, (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center", children: [description ? (0, jsx_runtime_1.jsx)("div", { className: styleMap.description, children: description }) : null, (0, jsx_runtime_1.jsx)(List_1.List, { className: (0, style_1.style)(description ? `${styleMap.description} mt-0.5` : 'text-h6'), items: items, listItemSize: "M", isDotted: isDotted })] })] }), button?.text && !isMainButton ? ((0, jsx_runtime_1.jsx)(Button_1.Button, { className: "box-border py-3 h-12 w-full max-w-[240px] mt-auto", version: version, ...button, children: button?.text })) : null] }, String(i)));
|
|
32
|
+
};
|
|
33
|
+
const getContainerWidth = (length) => (length < 5 ? 'w-[276px]' : 'w-[210px]');
|
|
34
|
+
//# sourceMappingURL=renderStep.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderStep.js","sourceRoot":"","sources":["../../../src/components/StepsBlock/renderStep.tsx"],"names":[],"mappings":";;;AAGA,uDAAoD;AACpD,iDAA8C;AAC9C,6DAA0D;AAC1D,iDAA8C;AAC9C,qEAAkE;AAClE,6CAA0C;AAU1C,gDAAgD;AACzC,MAAM,UAAU,GACrB,CAAC,KAAsB,EAAE,EAAE;AAC3B,4DAA4D;AA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C,WAAW,CAAC,CAAC,CAAC,gCAAK,SAAS,EAAE,QAAQ,CAAC,WAAW,YAAG,WAAW,GAAO,CAAC,CAAC,CAAC,IAAI,EAC/E,uBAAC,WAAI,IACH,SAAS,EAAE,IAAA,aAAK,EAAC,WAAW,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,WAAW,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,EAC5E,KAAK,EAAE,KAAK,EACZ,YAAY,EAAC,GAAG,EAChB,QAAQ,EAAE,QAAQ,GAClB,IACE,IACF,EACL,MAAM,EAAE,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAC/B,uBAAC,eAAM,IACL,SAAS,EAAC,mDAAmD,EAC7D,OAAO,EAAE,OAAwB,KAC7B,MAAM,YAET,MAAM,EAAE,IAAI,GACN,CACV,CAAC,CAAC,CAAC,IAAI,KA9BH,MAAM,CAAC,CAAC,CAAC,CA+BV,CACP,CAAC;AACJ,CAAC,CAAC;AAEJ,MAAM,iBAAiB,GAAG,CAAC,MAAc,EAAU,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC"}
|
|
@@ -7,13 +7,13 @@ const renderButtonsSection_1 = require("../../ui-kit/Button/renderButtonsSection
|
|
|
7
7
|
const Heading_1 = require("../../ui-kit/Heading/Heading");
|
|
8
8
|
const Img_1 = require("../../ui-kit/Img/Img");
|
|
9
9
|
const List_1 = require("../../ui-kit/List/List");
|
|
10
|
-
const
|
|
10
|
+
const RichText_1 = require("../../ui-kit/RichText/RichText");
|
|
11
11
|
const Tags_1 = require("../../ui-kit/Tags/Tags");
|
|
12
12
|
const BaseTile_1 = require("../BaseTile/BaseTile");
|
|
13
13
|
const getTileMinHeight_1 = require("../BaseTile/getTileMinHeight");
|
|
14
14
|
const getTileRightPadding_1 = require("../BaseTile/getTileRightPadding");
|
|
15
|
-
exports.Tile = (0, uni_jsx_1.JSX)(({ title, headingType = 'h3',
|
|
15
|
+
exports.Tile = (0, uni_jsx_1.JSX)(({ title, headingType = 'h3', __html, items, buttons, image, isDotted = true, listItemSize = 'M', className = '', tags, children, ...rest }) => ((0, jsx_runtime_1.jsx)(BlockWrapper_1.BlockWrapper, { className: `overflow-hidden p-9 pr-3 box-border ${(0, getTileRightPadding_1.getTileRightPadding)(className)} ${(0, getTileMinHeight_1.getTileMinHeight)(className)} ${className}`, ...rest, children: (0, jsx_runtime_1.jsxs)(BaseTile_1.BaseTile, { title: title ? ((0, jsx_runtime_1.jsx)(Heading_1.Heading, { headingType: headingType, as: "h2", title: title, className: `whitespace-pre-wrap max-w-[600px]` })) : null, buttons: (0, renderButtonsSection_1.renderButtonsSection)(buttons, {
|
|
16
16
|
className: 'mt-8',
|
|
17
17
|
buttonClassName: 'min-w-[158px]',
|
|
18
|
-
}), image: image?.src ? (0, jsx_runtime_1.jsx)(Img_1.Img, { className: "mt-auto ml-7", image: image }) : null, children: [
|
|
18
|
+
}), image: image?.src ? (0, jsx_runtime_1.jsx)(Img_1.Img, { className: "mt-auto ml-7", image: image }) : null, children: [__html ? ((0, jsx_runtime_1.jsx)("div", { className: "max-w-[600px] mt-2.5", children: (0, jsx_runtime_1.jsx)(RichText_1.RichText, { __html: __html }) })) : null, children, (0, jsx_runtime_1.jsx)(List_1.List, { className: "mt-2.5", itemClassName: "mb-1.5", items: items, isDotted: isDotted, listItemSize: listItemSize }), tags?.length ? (0, jsx_runtime_1.jsx)(Tags_1.Tags, { tags: tags, className: "mt-5" }) : null] }) })));
|
|
19
19
|
//# sourceMappingURL=Tile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tile.js","sourceRoot":"","sources":["../../../src/components/Tile/Tile.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AAExC,4DAAyD;AACzD,mFAAgF;AAChF,0DAAuD;AACvD,8CAA2C;AAC3C,iDAA8C;AAC9C,
|
|
1
|
+
{"version":3,"file":"Tile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AC,CAAC,IAAI,EACP,QAAQ,EACT,uBAAC,WAAI,IACH,SAAS,EAAC,QAAQ,EAClB,aAAa,EAAC,QAAQ,EACtB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,GAC1B,EACD,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,uBAAC,WAAI,IAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,IACnD,GACE,CAChB,CACF,CAAC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import type { BlockVersion } from '../../model/BlockVersion';
|
|
2
|
-
import type { DescriptionProps } from '../../model/HeadlineType';
|
|
3
2
|
import type { Picture } from '../../model/Picture';
|
|
4
3
|
import type { ButtonContent } from '../../ui-kit/Button/ButtonProps';
|
|
5
4
|
import type { HeadingCommonProps } from '../../ui-kit/Heading/HeadingProps';
|
|
6
5
|
import type { ListContent } from '../../ui-kit/List/ListContent';
|
|
7
6
|
import type { ListItemSize } from '../../ui-kit/List/ListProps';
|
|
7
|
+
import type { RichTextProps } from '../../ui-kit/RichText/RichTextProps';
|
|
8
8
|
import type { TagsContent } from '../../ui-kit/Tags/TagsContent';
|
|
9
9
|
/**
|
|
10
10
|
* @title Плитка
|
|
11
11
|
*/
|
|
12
|
-
export declare type TileContent = HeadingCommonProps &
|
|
12
|
+
export declare type TileContent = HeadingCommonProps & RichTextProps & ListContent & ButtonContent & TagsContent & {
|
|
13
13
|
/**
|
|
14
14
|
* @default {
|
|
15
15
|
* "format": "webp",
|
|
@@ -2,5 +2,5 @@ import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
|
|
|
2
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
3
3
|
import { Text } from '../../ui-kit/Text/Text.js';
|
|
4
4
|
import { style } from '../../utils/style.js';
|
|
5
|
-
export const Rate = JSX(({ rate, title = 'Ставка', unit, depositeName, isShowDepositeName, rateBlockClassName }) => (_jsxs("div", { children: [_jsx(Text, { size: "text-l-light", color: "text-secondary-text", children: title }), _jsxs("div", { className: "relative", children: [_jsxs("div", { className: "flex justify-start", children: [_jsx("span", { className: style('block gradient-color-text font-mohave text-title-huge pr-6 -mt-4', rateBlockClassName), children: String(rate).replace('.', ',') }), unit ? (_jsx("span", { className: "gradient-color-text text-[65px] leading-[75px]", children: unit })) : ('')] }), depositeName && isShowDepositeName ? (_jsx("div", { className: "absolute bottom-7 w-full text-center whitespace-nowrap", children: depositeName })) : null] })] })));
|
|
5
|
+
export const Rate = JSX(({ rate, title = 'Ставка', unit, depositeName, isShowDepositeName, rateBlockClassName }) => (_jsxs("div", { children: [_jsx(Text, { size: "text-l-light", color: "text-secondary-text", children: title }), _jsxs("div", { className: "relative", children: [_jsxs("div", { className: "flex justify-start", children: [_jsx("span", { className: style('block gradient-color-text font-mohave text-title-huge pr-6 -mt-4', rateBlockClassName), children: String(rate.toFixed(2)).replace('.', ',') }), unit ? (_jsx("span", { className: "gradient-color-text text-[65px] leading-[75px]", children: unit })) : ('')] }), depositeName && isShowDepositeName ? (_jsx("div", { className: "absolute bottom-7 w-full text-center whitespace-nowrap", children: depositeName })) : null] })] })));
|
|
6
6
|
//# sourceMappingURL=Rate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Rate.js","sourceRoot":"","sources":["../../../src/components/Calculator/Rate.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAW1C,MAAM,CAAC,MAAM,IAAI,GAAG,GAAG,CACrB,CAAC,EAAE,IAAI,EAAE,KAAK,GAAG,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,EAAE,EAAE,CAAC,CAC1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ACT,CACP,CAAC,CAAC,CAAC,IAAI,IACJ,IACF,CACP,CACF,CAAC"}
|
|
@@ -44,7 +44,7 @@ export const DEFAULT_DEPOSIT_CALCULATOR_PARAMS = {
|
|
|
44
44
|
maxSum: 5000000,
|
|
45
45
|
minMonths: 2,
|
|
46
46
|
maxMonths: 120,
|
|
47
|
-
rate:
|
|
47
|
+
rate: 7,
|
|
48
48
|
isMonthlyInterestPayment: true,
|
|
49
49
|
};
|
|
50
50
|
export const DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS = {
|
|
@@ -52,7 +52,7 @@ export const DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS = {
|
|
|
52
52
|
maxSum: 500000,
|
|
53
53
|
minDays: BUSINESS_MIN_DAYS,
|
|
54
54
|
maxDays: BUSINESS_MAX_DAYS,
|
|
55
|
-
rate:
|
|
55
|
+
rate: 6.6,
|
|
56
56
|
isMonthlyInterestPayment: true,
|
|
57
57
|
isReplenished: false,
|
|
58
58
|
isPartialWithdrawal: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/components/Calculator/constants.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC;AACrC,MAAM,CAAC,MAAM,eAAe,GAAG,OAAO,CAAC;AACvC,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,eAAe,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC;AACnE,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAC;AACrC,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAC;AACrC,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,kBAAkB,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC;AACxF,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC;AAC3C,MAAM,CAAC,MAAM,iBAAiB,GAA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ends string, MaxKey extends string, T extends Record<MinKey | MaxKey, number>>([minKey, maxKey]: [MinKey, MaxKey], rows?: T[]) => {
|
|
2
|
+
[x: string]: unknown;
|
|
3
|
+
};
|
|
4
|
+
export declare const checkRangeByKeys: <MinKey extends string, MaxKey extends string, T extends Record<MinKey | MaxKey, number>>(value: number, [minKey, maxKey]: [MinKey, MaxKey], sourceBookRow: T) => boolean;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { maxBy } from '../../utils/maxBy.js';
|
|
2
|
+
import { minBy } from '../../utils/minBy.js';
|
|
3
|
+
export const getRangeByKeys = ([minKey, maxKey], rows = []) => ({
|
|
4
|
+
[minKey]: rows.length ? minBy()(rows.map((row) => row[minKey])) : 0,
|
|
5
|
+
[maxKey]: rows.length ? maxBy()(rows.map((row) => row[maxKey])) : 0,
|
|
6
|
+
});
|
|
7
|
+
export const checkRangeByKeys = (value, [minKey, maxKey], sourceBookRow) => value >= sourceBookRow[minKey] && value < sourceBookRow[maxKey];
|
|
8
|
+
//# sourceMappingURL=rangeHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rangeHelpers.js","sourceRoot":"","sources":["../../../src/components/Calculator/rangeHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1C,MAAM,CAAC,MAAM,cAAc,GAAG,CAK5B,CAAC,MAAM,EAAE,MAAM,CAAmB,EAClC,OAAY,EAAE,EACd,EAAE,CAAC,CAAC;IACJ,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACnE,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACpE,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAK9B,KAAa,EACb,CAAC,MAAM,EAAE,MAAM,CAAmB,EAClC,aAAgB,EACP,EAAE,CAAC,KAAK,IAAI,aAAa,CAAC,MAAM,CAAC,IAAI,KAAK,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BUSINESS_DEPOSIT_CALC_DEFAULT_DIR, BUSINESS_OPERATING_MAX_DAYS, BUSINESS_OPERATING_MIN_DAYS, BUSINESS_RATE_MIN_DAYS, DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS, } from './constants.js';
|
|
2
|
+
import { checkRangeByKeys, getRangeByKeys } from './rangeHelpers.js';
|
|
2
3
|
import { useCalculatorParams } from './useCalculatorParams.js';
|
|
3
4
|
export const useBusinessDepositCalculatorParams = (userInputParams, sourceBookDir) => {
|
|
4
5
|
const { daysValue, moneyValue, isPartialWithdrawal, isReplenished, isSmallBusiness, isMonthlyInterestPayment, } = userInputParams;
|
|
@@ -16,21 +17,27 @@ export const useBusinessDepositCalculatorParams = (userInputParams, sourceBookDi
|
|
|
16
17
|
const businessDepositCalculatorSourceBookParams = data?.rows?.find((_) => {
|
|
17
18
|
return (isMonthlyInterestPayment === _.isMonthlyInterestPayment &&
|
|
18
19
|
isSmallBusiness === _.isSmallBusiness &&
|
|
19
|
-
(isOperatingDeposit
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
checkIsOperatingDeposit(isOperatingDeposit, _) &&
|
|
21
|
+
checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], _) &&
|
|
22
|
+
checkRangeByKeys(daysValue, ['minDays', 'maxDays'], _));
|
|
22
23
|
}) || DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS;
|
|
23
24
|
const { rate } = businessDepositCalculatorSourceBookParams;
|
|
24
25
|
const income = getDepositIncome(rate, userInputParams);
|
|
25
26
|
const finalSum = moneyValue + income;
|
|
27
|
+
const sourceBookRows = data?.rows || [DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS];
|
|
26
28
|
return {
|
|
27
29
|
...businessDepositCalculatorSourceBookParams,
|
|
30
|
+
...getRangeByKeys(['minSum', 'maxSum'], sourceBookRows),
|
|
31
|
+
...getRangeByKeys(['minDays', 'maxDays'], sourceBookRows),
|
|
28
32
|
...userInputParams,
|
|
29
33
|
isDisabledOperatingDeposit,
|
|
30
34
|
income,
|
|
31
35
|
finalSum,
|
|
32
36
|
};
|
|
33
37
|
};
|
|
38
|
+
const checkIsOperatingDeposit = (isOperatingDeposit, sourceBookRow) => isOperatingDeposit
|
|
39
|
+
? sourceBookRow.isReplenished && sourceBookRow.isPartialWithdrawal
|
|
40
|
+
: !sourceBookRow.isReplenished && !sourceBookRow.isPartialWithdrawal;
|
|
34
41
|
const getDepositIncome = (rate, userInputParams) => {
|
|
35
42
|
const { isMonthlyInterestPayment, moneyValue, daysValue } = userInputParams;
|
|
36
43
|
/*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBusinessDepositCalculatorParams.js","sourceRoot":"","sources":["../../../src/components/Calculator/useBusinessDepositCalculatorParams.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iCAAiC,EACjC,2BAA2B,EAC3B,2BAA2B,EAC3B,sBAAsB,EACtB,0CAA0C,GAC3C,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAkC5D,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAChD,eAAyD,EACzD,aAAsB,EACW,EAAE;IACnC,MAAM,EACJ,SAAS,EACT,UAAU,EACV,mBAAmB,EACnB,aAAa,EACb,eAAe,EACf,wBAAwB,GACzB,GAAG,eAAe,CAAC;IACpB,MAAM,IAAI,GAAG,mBAAmB,CAC9B,aAAa,IAAI,iCAAiC,CACnD,CAAC;IAEF,MAAM,kBAAkB,GAAG,aAAa,IAAI,mBAAmB,CAAC;IAChE,MAAM,0BAA0B,GAC9B,SAAS,GAAG,2BAA2B,IAAI,SAAS,GAAG,2BAA2B,CAAC;IAErF,IAAI,SAAS,IAAI,sBAAsB,EAAE;QACvC,OAAO;YACL,GAAG,0CAA0C;YAC7C,GAAG,eAAe;YAClB,0BAA0B;YAC1B,IAAI,EAAE,CAAC;SACR,CAAC;KACH;IACD,MAAM,yCAAyC,GAC7C,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;QACrB,OAAO,CACL,wBAAwB,KAAK,CAAC,CAAC,wBAAwB;YACvD,eAAe,KAAK,CAAC,CAAC,eAAe;YACrC,CAAC,kBAAkB
|
|
1
|
+
{"version":3,"file":"useBusinessDepositCalculatorParams.js","sourceRoot":"","sources":["../../../src/components/Calculator/useBusinessDepositCalculatorParams.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iCAAiC,EACjC,2BAA2B,EAC3B,2BAA2B,EAC3B,sBAAsB,EACtB,0CAA0C,GAC3C,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAkC5D,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAChD,eAAyD,EACzD,aAAsB,EACW,EAAE;IACnC,MAAM,EACJ,SAAS,EACT,UAAU,EACV,mBAAmB,EACnB,aAAa,EACb,eAAe,EACf,wBAAwB,GACzB,GAAG,eAAe,CAAC;IACpB,MAAM,IAAI,GAAG,mBAAmB,CAC9B,aAAa,IAAI,iCAAiC,CACnD,CAAC;IAEF,MAAM,kBAAkB,GAAG,aAAa,IAA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EAC3B,aAAwD,EACxD,EAAE,CACF,kBAAkB;IAChB,CAAC,CAAC,aAAa,CAAC,aAAa,IAAI,aAAa,CAAC,mBAAmB;IAClE,CAAC,CAAC,CAAC,aAAa,CAAC,aAAa,IAAI,CAAC,aAAa,CAAC,mBAAmB,CAAC;AAEzE,MAAM,gBAAgB,GAAG,CACvB,IAAY,EACZ,eAAyD,EACzD,EAAE;IACF,MAAM,EAAE,wBAAwB,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,eAAe,CAAC;IAE5E;;MAEE;IACF,IAAI,wBAAwB,EAAE;QAC5B,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,IAAI,EAAE,SAAS,GAAG,EAAE,CAAC,GAAG,UAAU,CAAC,CAAC;KAC7F;SAAM;QACL,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,UAAU,GAAG,IAAI,GAAG,SAAS,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC;KAChE;AACH,CAAC,CAAC"}
|
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
import { CREDIT_CALC_DEFAULT_DIR, DEFAULT_CREDIT_CALCULATOR_PARAMS } from './constants.js';
|
|
2
2
|
import { getMonthlyPayment } from './getMonthlyPayment.js';
|
|
3
|
+
import { checkRangeByKeys, getRangeByKeys } from './rangeHelpers.js';
|
|
3
4
|
import { useCalculatorParams } from './useCalculatorParams.js';
|
|
4
5
|
export const useCreditCalculatorParams = (userInputParams, sourceBookDir) => {
|
|
5
|
-
const { isInsurance, isSalaryClient, isStateEmployee, moneyValue } = userInputParams;
|
|
6
|
+
const { isInsurance, isSalaryClient, isStateEmployee, moneyValue, monthsValue } = userInputParams;
|
|
6
7
|
const data = useCalculatorParams(sourceBookDir || CREDIT_CALC_DEFAULT_DIR);
|
|
7
8
|
const creditCalculatorSourceBookParams = data?.rows?.find((_) => {
|
|
8
9
|
return (isInsurance === _.isInsurance &&
|
|
9
10
|
isSalaryClient === _.isSalaryClient &&
|
|
10
|
-
isStateEmployee === _.isStateEmployee
|
|
11
|
+
isStateEmployee === _.isStateEmployee &&
|
|
12
|
+
checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], _) &&
|
|
13
|
+
checkRangeByKeys(monthsValue, ['minMonths', 'maxMonths'], _));
|
|
11
14
|
}) || DEFAULT_CREDIT_CALCULATOR_PARAMS;
|
|
12
15
|
const { rateBottomRange, rateTopRange, sumBorder } = creditCalculatorSourceBookParams;
|
|
13
16
|
const finalRate = moneyValue <= sumBorder ? rateBottomRange : rateTopRange;
|
|
14
17
|
const monthlyPayment = getMonthlyPayment(finalRate, userInputParams);
|
|
18
|
+
const sourceBookRows = data?.rows || [DEFAULT_CREDIT_CALCULATOR_PARAMS];
|
|
15
19
|
return {
|
|
16
20
|
...creditCalculatorSourceBookParams,
|
|
21
|
+
...getRangeByKeys(['minSum', 'maxSum'], sourceBookRows),
|
|
22
|
+
...getRangeByKeys(['minMonths', 'maxMonths'], sourceBookRows),
|
|
17
23
|
...userInputParams,
|
|
18
24
|
finalRate,
|
|
19
25
|
monthlyPayment,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCreditCalculatorParams.js","sourceRoot":"","sources":["../../../src/components/Calculator/useCreditCalculatorParams.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,gCAAgC,EAAE,MAAM,aAAa,CAAC;AACxF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAkC5D,MAAM,CAAC,MAAM,yBAAyB,GAAG,CACvC,eAAgD,EAChD,aAAsB,EACE,EAAE;IAC1B,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,UAAU,EAAE,GAAG,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"useCreditCalculatorParams.js","sourceRo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I,EAAE,IAAI,IAAI,CAAC,gCAAgC,CAAC,CAAC;IAExE,OAAO;QACL,GAAG,gCAAgC;QACnC,GAAG,cAAc,CAAC,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE,cAAc,CAAC;QACvD,GAAG,cAAc,CAAC,CAAC,WAAW,EAAE,WAAW,CAAC,EAAE,cAAc,CAAC;QAC7D,GAAG,eAAe;QAClB,SAAS;QACT,cAAc;KACf,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
import { DEFAULT_DEPOSIT_CALCULATOR_PARAMS, DEPOSIT_CALC_DEFAULT_DIR } from './constants.js';
|
|
2
|
+
import { checkRangeByKeys, getRangeByKeys } from './rangeHelpers.js';
|
|
2
3
|
import { useCalculatorParams } from './useCalculatorParams.js';
|
|
3
4
|
export const useDepositCalculatorParams = (userInputParams, sourceBookDir) => {
|
|
4
|
-
const { isMonthlyInterestPayment, moneyValue } = userInputParams;
|
|
5
|
+
const { isMonthlyInterestPayment, moneyValue, monthsValue } = userInputParams;
|
|
5
6
|
const data = useCalculatorParams(sourceBookDir || DEPOSIT_CALC_DEFAULT_DIR);
|
|
6
|
-
const depositCalculatorSourceBookParams = data?.rows?.find((_) => isMonthlyInterestPayment === _.isMonthlyInterestPayment
|
|
7
|
-
|
|
7
|
+
const depositCalculatorSourceBookParams = data?.rows?.find((_) => isMonthlyInterestPayment === _.isMonthlyInterestPayment &&
|
|
8
|
+
checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], _) &&
|
|
9
|
+
checkRangeByKeys(monthsValue, ['minMonths', 'maxMonths'], _)) || DEFAULT_DEPOSIT_CALCULATOR_PARAMS;
|
|
8
10
|
const { rate } = depositCalculatorSourceBookParams;
|
|
9
11
|
const income = getDepositIncome(rate, userInputParams);
|
|
10
12
|
const finalSum = moneyValue + income;
|
|
11
|
-
|
|
13
|
+
const sourceBookRows = data?.rows || [DEFAULT_DEPOSIT_CALCULATOR_PARAMS];
|
|
14
|
+
return {
|
|
15
|
+
...depositCalculatorSourceBookParams,
|
|
16
|
+
...getRangeByKeys(['minSum', 'maxSum'], sourceBookRows),
|
|
17
|
+
...getRangeByKeys(['minMonths', 'maxMonths'], sourceBookRows),
|
|
18
|
+
...userInputParams,
|
|
19
|
+
income,
|
|
20
|
+
finalSum,
|
|
21
|
+
};
|
|
12
22
|
};
|
|
13
23
|
const getDepositIncome = (rate, userInputParams) => {
|
|
14
24
|
const { isMonthlyInterestPayment, moneyValue, monthsValue } = userInputParams;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDepositCalculatorParams.js","sourceRoot":"","sources":["../../../src/components/Calculator/useDepositCalculatorParams.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iCAAiC,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAC1F,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"useDepositCalculatorParams.js","sourceRoot":"","sources":["../../../src/components/Calculator/useDepositCalculatorParams.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iCAAiC,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAC1F,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AA8B5D,MAAM,CAAC,MAAM,0BAA0B,GAAG,CACxC,eAAiD,EACjD,aAAsB,EACG,EAAE;IAC3B,MAAM,EAAE,wBAAwB,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,eAAe,CAAC;IAE9E,MAAM,IAAI,GAAG,mBAAmB,CAC9B,aAAa,IAAI,wBAAwB,CAC1C,CAAC;IAEF,MAAM,iCAAiC,GACrC,IAAI,EAAE,IAAI,EAAE,IAAI,CACd,CAAC,CAAC,EAAE,EAAE,CACJ,wBAAwB,KAAK,CAAC,CAAC,wBAAwB;QACvD,gBAAgB,CAAC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