@redneckz/wildless-cms-uni-blocks 0.13.7 → 0.13.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +46 -49
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/Calculator/UnknownRate.d.ts +1 -0
- package/bundle/components/Calculator/renderRate.d.ts +2 -1
- package/bundle/components/Calculator/useBusinessDepositCalculatorParams.d.ts +1 -1
- package/bundle/components/Carousel/CarouselContent.d.ts +2 -2
- package/dist/components/Calculator/BusinessDepositCalculatorForm.js +9 -9
- package/dist/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/RefinancingCalculatorForm.js +6 -3
- package/dist/components/Calculator/RefinancingCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/UnknownRate.d.ts +1 -0
- package/dist/components/Calculator/UnknownRate.js +1 -1
- package/dist/components/Calculator/UnknownRate.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/renderRate.d.ts +2 -1
- package/dist/components/Calculator/renderRate.js +5 -5
- package/dist/components/Calculator/renderRate.js.map +1 -1
- package/dist/components/Calculator/useBusinessDepositCalculatorParams.d.ts +1 -1
- package/dist/components/Calculator/useBusinessDepositCalculatorParams.js +1 -1
- package/dist/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
- package/dist/components/Calculator/useCreditCalculatorParams.js +1 -4
- package/dist/components/Calculator/useCreditCalculatorParams.js.map +1 -1
- package/dist/components/Calculator/useRefinancingCalculatorParams.js +4 -11
- package/dist/components/Calculator/useRefinancingCalculatorParams.js.map +1 -1
- package/dist/components/Carousel/CarouselContent.d.ts +2 -2
- package/dist/components/Carousel/renderCarouselCards.js +1 -0
- package/dist/components/Carousel/renderCarouselCards.js.map +1 -1
- package/dist/ui-kit/InputRange/renderRangeWithTicks.js +2 -1
- package/dist/ui-kit/InputRange/renderRangeWithTicks.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/Calculator/BusinessDepositCalculatorForm.js +9 -9
- package/lib/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/RefinancingCalculatorForm.js +6 -3
- package/lib/components/Calculator/RefinancingCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/UnknownRate.d.ts +1 -0
- package/lib/components/Calculator/UnknownRate.js +1 -1
- package/lib/components/Calculator/UnknownRate.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/renderRate.d.ts +2 -1
- package/lib/components/Calculator/renderRate.js +5 -5
- package/lib/components/Calculator/renderRate.js.map +1 -1
- package/lib/components/Calculator/useBusinessDepositCalculatorParams.d.ts +1 -1
- package/lib/components/Calculator/useBusinessDepositCalculatorParams.js +1 -1
- package/lib/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
- package/lib/components/Calculator/useCreditCalculatorParams.js +1 -4
- package/lib/components/Calculator/useCreditCalculatorParams.js.map +1 -1
- package/lib/components/Calculator/useRefinancingCalculatorParams.js +4 -11
- package/lib/components/Calculator/useRefinancingCalculatorParams.js.map +1 -1
- package/lib/components/Carousel/CarouselContent.d.ts +2 -2
- package/lib/components/Carousel/renderCarouselCards.js +1 -0
- package/lib/components/Carousel/renderCarouselCards.js.map +1 -1
- package/lib/ui-kit/InputRange/renderRangeWithTicks.js +2 -1
- package/lib/ui-kit/InputRange/renderRangeWithTicks.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +46 -49
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/Calculator/UnknownRate.d.ts +1 -0
- package/mobile/bundle/components/Calculator/renderRate.d.ts +2 -1
- package/mobile/bundle/components/Calculator/useBusinessDepositCalculatorParams.d.ts +1 -1
- package/mobile/bundle/components/Carousel/CarouselContent.d.ts +2 -2
- package/mobile/dist/components/Calculator/BusinessDepositCalculatorForm.js +9 -9
- package/mobile/dist/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/RefinancingCalculatorForm.js +6 -3
- package/mobile/dist/components/Calculator/RefinancingCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/UnknownRate.d.ts +1 -0
- package/mobile/dist/components/Calculator/UnknownRate.js +1 -1
- package/mobile/dist/components/Calculator/UnknownRate.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/renderRate.d.ts +2 -1
- package/mobile/dist/components/Calculator/renderRate.js +5 -5
- package/mobile/dist/components/Calculator/renderRate.js.map +1 -1
- package/mobile/dist/components/Calculator/useBusinessDepositCalculatorParams.d.ts +1 -1
- package/mobile/dist/components/Calculator/useBusinessDepositCalculatorParams.js +1 -1
- package/mobile/dist/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
- package/mobile/dist/components/Calculator/useCreditCalculatorParams.js +1 -4
- package/mobile/dist/components/Calculator/useCreditCalculatorParams.js.map +1 -1
- package/mobile/dist/components/Calculator/useRefinancingCalculatorParams.js +4 -11
- package/mobile/dist/components/Calculator/useRefinancingCalculatorParams.js.map +1 -1
- package/mobile/dist/components/Carousel/CarouselContent.d.ts +2 -2
- package/mobile/dist/components/Carousel/renderCarouselCards.js +1 -0
- package/mobile/dist/components/Carousel/renderCarouselCards.js.map +1 -1
- package/mobile/dist/ui-kit/InputRange/renderRangeWithTicks.js +2 -1
- package/mobile/dist/ui-kit/InputRange/renderRangeWithTicks.js.map +1 -1
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/Calculator/BusinessDepositCalculatorForm.js +9 -9
- package/mobile/lib/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/RefinancingCalculatorForm.js +6 -3
- package/mobile/lib/components/Calculator/RefinancingCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/UnknownRate.d.ts +1 -0
- package/mobile/lib/components/Calculator/UnknownRate.js +1 -1
- package/mobile/lib/components/Calculator/UnknownRate.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/renderRate.d.ts +2 -1
- package/mobile/lib/components/Calculator/renderRate.js +5 -5
- package/mobile/lib/components/Calculator/renderRate.js.map +1 -1
- package/mobile/lib/components/Calculator/useBusinessDepositCalculatorParams.d.ts +1 -1
- package/mobile/lib/components/Calculator/useBusinessDepositCalculatorParams.js +1 -1
- package/mobile/lib/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
- package/mobile/lib/components/Calculator/useCreditCalculatorParams.js +1 -4
- package/mobile/lib/components/Calculator/useCreditCalculatorParams.js.map +1 -1
- package/mobile/lib/components/Calculator/useRefinancingCalculatorParams.js +4 -11
- package/mobile/lib/components/Calculator/useRefinancingCalculatorParams.js.map +1 -1
- package/mobile/lib/components/Carousel/CarouselContent.d.ts +2 -2
- package/mobile/lib/components/Carousel/renderCarouselCards.js +1 -0
- package/mobile/lib/components/Carousel/renderCarouselCards.js.map +1 -1
- package/mobile/lib/ui-kit/InputRange/renderRangeWithTicks.js +2 -1
- package/mobile/lib/ui-kit/InputRange/renderRangeWithTicks.js.map +1 -1
- package/mobile/src/components/Calculator/BusinessDepositCalculatorForm.tsx +11 -11
- package/mobile/src/components/Calculator/RefinancingCalculatorForm.tsx +6 -9
- package/mobile/src/components/Calculator/UnknownRate.tsx +24 -14
- package/mobile/src/components/Calculator/constants.ts +2 -2
- package/mobile/src/components/Calculator/renderRate.tsx +13 -6
- package/mobile/src/components/Calculator/useBusinessDepositCalculatorParams.ts +2 -2
- package/mobile/src/components/Calculator/useCreditCalculatorParams.ts +1 -5
- package/mobile/src/components/Calculator/useRefinancingCalculatorParams.ts +5 -23
- package/mobile/src/components/Carousel/CarouselContent.ts +2 -2
- package/mobile/src/components/Carousel/renderCarouselCards.tsx +1 -0
- package/mobile/src/ui-kit/InputRange/renderRangeWithTicks.tsx +2 -1
- package/package.json +1 -1
- package/src/components/Calculator/BusinessDepositCalculatorForm.tsx +11 -11
- package/src/components/Calculator/RefinancingCalculatorForm.tsx +6 -9
- package/src/components/Calculator/UnknownRate.tsx +24 -14
- package/src/components/Calculator/constants.ts +2 -2
- package/src/components/Calculator/renderRate.tsx +13 -6
- package/src/components/Calculator/useBusinessDepositCalculatorParams.ts +2 -2
- package/src/components/Calculator/useCreditCalculatorParams.ts +1 -5
- package/src/components/Calculator/useRefinancingCalculatorParams.ts +5 -23
- package/src/components/Carousel/CarouselContent.ts +2 -2
- package/src/components/Carousel/renderCarouselCards.tsx +1 -0
- package/src/ui-kit/InputRange/renderRangeWithTicks.tsx +2 -1
package/bundle/bundle.umd.js
CHANGED
|
@@ -1031,8 +1031,9 @@
|
|
|
1031
1031
|
|
|
1032
1032
|
function renderRangeWithTicks({ list = [], min, max, step, value = list[0] || min, disabled, onChange, }) {
|
|
1033
1033
|
const rangeValue = list.length ? list.indexOf(value) : value;
|
|
1034
|
+
const rangeValueShift = rangeValue > min ? rangeValue - min : 0;
|
|
1034
1035
|
const inputStyle = {
|
|
1035
|
-
backgroundSize: `${((
|
|
1036
|
+
backgroundSize: `${((rangeValueShift * 100) / (max - min)).toFixed(2)}% 100%`,
|
|
1036
1037
|
};
|
|
1037
1038
|
return (jsxs("div", { children: [list.length ? (jsx("div", { className: "absolute w-full flex justify-between -bottom-[3px] px-m", children: list.map((_, i) => (jsx("div", { className: `w-2 h-2 rounded-full ${rangeValue <= i || disabled ? 'bg-gray' : 'bg-primary-main'}` }, String(i)))) })) : null, jsx("div", { className: "absolute inset-x-0 -bottom-1 px-m leading-[18px]", children: jsx("input", { className: "box-border w-full m-0 cursor-pointer slider relative z-10", style: inputStyle, type: "range", min: min, max: max, step: step, value: rangeValue, disabled: disabled, onInput: ((e) => {
|
|
1038
1039
|
const rawValue = parseDecimal(e.target?.value);
|
|
@@ -1510,7 +1511,7 @@
|
|
|
1510
1511
|
maxSum: DEFAULT_MAX_SUM$1,
|
|
1511
1512
|
minMonths: DEFAULT_MIN_MONTHS$1,
|
|
1512
1513
|
maxMonths: DEFAULT_MAX_MONTHS$1,
|
|
1513
|
-
rate:
|
|
1514
|
+
rate: 0,
|
|
1514
1515
|
isSalaryClient: false,
|
|
1515
1516
|
isPensionClient: false,
|
|
1516
1517
|
isStateEmployee: false,
|
|
@@ -1525,7 +1526,7 @@
|
|
|
1525
1526
|
maxSumExtra: REFINANCING_EXTRA_MAX_SUM,
|
|
1526
1527
|
minMonths: DEFAULT_REFINANCING_MIN_MONTHS,
|
|
1527
1528
|
maxMonths: DEFAULT_MAX_MONTHS$1,
|
|
1528
|
-
rate:
|
|
1529
|
+
rate: 0,
|
|
1529
1530
|
isExtraMoney: false,
|
|
1530
1531
|
isSalaryClient: false,
|
|
1531
1532
|
isInsurance: true,
|
|
@@ -1637,6 +1638,37 @@
|
|
|
1637
1638
|
})] }), monthBonus >= 0 ? (jsx(Rate, { title: "\u0411\u0430\u043B\u043B\u043E\u0432 \u0437\u0430 \u043C\u0435\u0441\u044F\u0446", rate: monthBonus, rateBlockClassName: "tracking-[-14px]", fractionDigits: 0 })) : null, jsxs("div", { className: "flex flex-col gap-2xl sm:w-96", children: [yearBonus >= 0 ? jsx(CalculatorValueBlock, { title: "\u0411\u0430\u043B\u043B\u043E\u0432 \u0437\u0430 \u0433\u043E\u0434", value: yearBonus }) : null, renderButtonsSection(buttons, { isVertical: true }), renderFootnote(footnote)] })] }));
|
|
1638
1639
|
});
|
|
1639
1640
|
|
|
1641
|
+
const STEP_DAYS = 1;
|
|
1642
|
+
const renderDaysInput = (props) => (jsx(InputRange, { items: [`От ${daysText(props.min || 0)}`, `До ${daysText(props.max || 0)}`], step: STEP_DAYS, ...props }));
|
|
1643
|
+
const daysText = (days) => `${days} ${Number(days) % 10 === 1 ? 'дня' : 'дней'}`;
|
|
1644
|
+
|
|
1645
|
+
const orientationStyleMap = {
|
|
1646
|
+
horizontal: 'gap-5xl',
|
|
1647
|
+
vertical: 'flex-col gap-s',
|
|
1648
|
+
};
|
|
1649
|
+
const RadioButtonGroup = JSX(({ items, checkedItem, className, onChange: onChangeCheckedItem, orientation = 'horizontal', }) => (jsx("div", { className: style(`flex ${orientationStyleMap[orientation]}`, className), children: items?.map(({ id, text }) => (jsx(Checkbox, { isRadio: true, text: text, value: checkedItem === id, onChange: () => onChangeCheckedItem && onChangeCheckedItem(id) }, String(id)))) })));
|
|
1650
|
+
|
|
1651
|
+
const renderBinaryRadioButtonGroup = ({ items, title, orientation = 'horizontal', value, radioGroupClassName, onChange, }) => (jsxs("div", { className: "space-y-s", children: [title ? (jsx("div", { children: jsx(Text, { color: "text-secondary-text", font: "font-light", children: title }) })) : null, jsx(RadioButtonGroup, { orientation: orientation, items: items, checkedItem: items[value ? 0 : 1].id, className: style('flex-col sm:flex-row', radioGroupClassName), onChange: (_) => onChange && onChange(_ === items[0].id) })] }));
|
|
1652
|
+
|
|
1653
|
+
const renderInterestPayment = (props) => renderBinaryRadioButtonGroup({
|
|
1654
|
+
...props,
|
|
1655
|
+
items: [
|
|
1656
|
+
{ id: 'everyMonth', text: 'Ежемесячно' },
|
|
1657
|
+
{ id: 'atEndTerm', text: 'В конце срока' },
|
|
1658
|
+
],
|
|
1659
|
+
});
|
|
1660
|
+
|
|
1661
|
+
const UnknownRate = JSX(({ title = 'Ставка', isUnavailableByTerm = false }) => (jsxs("div", { children: [jsx(Text, { size: "text-l", font: "font-light", color: "text-secondary-text", children: title }), jsx("div", { className: "mt-2xs pt-2xs pl-lg pb-xs", children: jsx(Icon, { name: "PercentIcon", width: "90", height: "85" }) }), jsx("div", { className: "w-64 mt-m", children: isUnavailableByTerm ? (jsxs(Paragraph, { size: "text-xl", font: "font-light", color: "text-primary-text", children: ["\u041F\u0440\u043E\u0446\u0435\u043D\u0442\u043D\u0430\u044F \u0441\u0442\u0430\u0432\u043A\u0430 \u0434\u043B\u044F \u0441\u0440\u043E\u043A\u0430 ", jsx("strong", { children: "1-30 \u0434\u043D\u0435\u0439" }), " \u0443\u0441\u0442\u0430\u043D\u0430\u0432\u043B\u0438\u0432\u0430\u0435\u0442\u0441\u044F \u043F\u0440\u0438 \u043E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u0438 \u0432 \u0411\u0430\u043D\u043A"] })) : (jsx(Paragraph, { size: "text-xl", font: "font-light", color: "text-primary-text", children: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0434\u0440\u0443\u0433\u0443\u044E \u0441\u0443\u043C\u043C\u0443 \u0438\u043B\u0438 \u0441\u0440\u043E\u043A" })) })] })));
|
|
1662
|
+
|
|
1663
|
+
const renderDesktopRate = ({ rate, depositeName, fractionDigits, isShowDepositeName, }) => (jsx(Rate, { rate: rate, depositeName: depositeName, fractionDigits: fractionDigits, isShowDepositeName: isShowDepositeName, rateBlockClassName: "tracking-[-25px]", unit: "%" }));
|
|
1664
|
+
const renderMobileRate = ({ rate }) => (jsx(CalculatorValueBlock, { title: "\u0421\u0442\u0430\u0432\u043A\u0430", value: rate, postfix: "%" }));
|
|
1665
|
+
const renderRate = (props) => {
|
|
1666
|
+
if (props.rate === 0) {
|
|
1667
|
+
return jsx(UnknownRate, { isUnavailableByTerm: props.isUnavailableByTerm });
|
|
1668
|
+
}
|
|
1669
|
+
return (jsxs("div", { children: [jsx("div", { className: "hidden md:block", children: renderDesktopRate(props) }), jsx("div", { className: "md:hidden", children: renderMobileRate(props) })] }));
|
|
1670
|
+
};
|
|
1671
|
+
|
|
1640
1672
|
const defaultDiscriminator = (_) => _;
|
|
1641
1673
|
const maxBy = (discriminator = defaultDiscriminator) => (list) => list.reduceRight((a, b) => (discriminator(a) > discriminator(b) ? a : b));
|
|
1642
1674
|
const max = maxBy();
|
|
@@ -1687,7 +1719,7 @@
|
|
|
1687
1719
|
...DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS,
|
|
1688
1720
|
...userInputParams,
|
|
1689
1721
|
isDisabledOperatingDeposit,
|
|
1690
|
-
|
|
1722
|
+
isUnavailableByTerm: true,
|
|
1691
1723
|
};
|
|
1692
1724
|
}
|
|
1693
1725
|
const businessDepositCalculatorSourceBookParams = data?.rateRows?.find((_) => {
|
|
@@ -1727,37 +1759,6 @@
|
|
|
1727
1759
|
}
|
|
1728
1760
|
};
|
|
1729
1761
|
|
|
1730
|
-
const STEP_DAYS = 1;
|
|
1731
|
-
const renderDaysInput = (props) => (jsx(InputRange, { items: [`От ${daysText(props.min || 0)}`, `До ${daysText(props.max || 0)}`], step: STEP_DAYS, ...props }));
|
|
1732
|
-
const daysText = (days) => `${days} ${Number(days) % 10 === 1 ? 'дня' : 'дней'}`;
|
|
1733
|
-
|
|
1734
|
-
const orientationStyleMap = {
|
|
1735
|
-
horizontal: 'gap-5xl',
|
|
1736
|
-
vertical: 'flex-col gap-s',
|
|
1737
|
-
};
|
|
1738
|
-
const RadioButtonGroup = JSX(({ items, checkedItem, className, onChange: onChangeCheckedItem, orientation = 'horizontal', }) => (jsx("div", { className: style(`flex ${orientationStyleMap[orientation]}`, className), children: items?.map(({ id, text }) => (jsx(Checkbox, { isRadio: true, text: text, value: checkedItem === id, onChange: () => onChangeCheckedItem && onChangeCheckedItem(id) }, String(id)))) })));
|
|
1739
|
-
|
|
1740
|
-
const renderBinaryRadioButtonGroup = ({ items, title, orientation = 'horizontal', value, radioGroupClassName, onChange, }) => (jsxs("div", { className: "space-y-s", children: [title ? (jsx("div", { children: jsx(Text, { color: "text-secondary-text", font: "font-light", children: title }) })) : null, jsx(RadioButtonGroup, { orientation: orientation, items: items, checkedItem: items[value ? 0 : 1].id, className: style('flex-col sm:flex-row', radioGroupClassName), onChange: (_) => onChange && onChange(_ === items[0].id) })] }));
|
|
1741
|
-
|
|
1742
|
-
const renderInterestPayment = (props) => renderBinaryRadioButtonGroup({
|
|
1743
|
-
...props,
|
|
1744
|
-
items: [
|
|
1745
|
-
{ id: 'everyMonth', text: 'Ежемесячно' },
|
|
1746
|
-
{ id: 'atEndTerm', text: 'В конце срока' },
|
|
1747
|
-
],
|
|
1748
|
-
});
|
|
1749
|
-
|
|
1750
|
-
const UnknownRate = JSX(({ title = 'Ставка' }) => (jsxs("div", { children: [jsx(Text, { size: "text-l", font: "font-light", color: "text-secondary-text", children: title }), jsx("div", { className: "mt-2xs pt-2xs pl-lg pb-xs", children: jsx(Icon, { name: "PercentIcon", width: "90", height: "85" }) }), jsx("div", { className: "w-64 mt-m", children: jsxs(Paragraph, { size: "text-xl", font: "font-light", color: "text-primary-text", children: ["\u041F\u0440\u043E\u0446\u0435\u043D\u0442\u043D\u0430\u044F \u0441\u0442\u0430\u0432\u043A\u0430 \u0434\u043B\u044F \u0441\u0440\u043E\u043A\u0430 ", jsx("strong", { children: "1-30 \u0434\u043D\u0435\u0439" }), " \u0443\u0441\u0442\u0430\u043D\u0430\u0432\u043B\u0438\u0432\u0430\u0435\u0442\u0441\u044F \u043F\u0440\u0438 \u043E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u0438 \u0432 \u0411\u0430\u043D\u043A"] }) })] })));
|
|
1751
|
-
|
|
1752
|
-
const renderDesktopRate = ({ rate, depositeName, isShowDepositeName }) => (jsx(Rate, { rate: rate, depositeName: depositeName, isShowDepositeName: isShowDepositeName, rateBlockClassName: "tracking-[-25px]", unit: "%" }));
|
|
1753
|
-
const renderMobileRate = ({ rate }) => (jsx(CalculatorValueBlock, { title: "\u0421\u0442\u0430\u0432\u043A\u0430", value: rate, postfix: "%" }));
|
|
1754
|
-
const renderRate = (props) => {
|
|
1755
|
-
if (props.isShowUnknownRate) {
|
|
1756
|
-
return jsx(UnknownRate, {});
|
|
1757
|
-
}
|
|
1758
|
-
return (jsxs("div", { children: [jsx("div", { className: "hidden md:block", children: renderDesktopRate(props) }), jsx("div", { className: "md:hidden", children: renderMobileRate(props) })] }));
|
|
1759
|
-
};
|
|
1760
|
-
|
|
1761
1762
|
const BusinessDepositCalculatorForm = JSX(({ className = '', sourceBookDir, buttons, footnote, bottomFootnote, isShowDepositeName }) => {
|
|
1762
1763
|
const [userInputParams, { field }] = useForm({
|
|
1763
1764
|
moneyValue: BUSINESS_DEFAULT_SUM,
|
|
@@ -1768,7 +1769,7 @@
|
|
|
1768
1769
|
isMonthlyInterestPayment: false,
|
|
1769
1770
|
});
|
|
1770
1771
|
const calculatorParams = useBusinessDepositCalculatorParams(userInputParams, sourceBookDir);
|
|
1771
|
-
const { income, finalSum, rate,
|
|
1772
|
+
const { income, finalSum, rate, isUnavailableByTerm, depositeName } = calculatorParams;
|
|
1772
1773
|
return (jsxs("section", { className: style('flex flex-col justify-between sm:flex-row gap-m', className), children: [jsxs("div", { className: "flex flex-col gap-y-m sm:w-2/5 gap-2xl", children: [renderWantedSumInput({
|
|
1773
1774
|
title: 'Сумма, ₽',
|
|
1774
1775
|
min: calculatorParams.minSum,
|
|
@@ -1790,7 +1791,7 @@
|
|
|
1790
1791
|
rate,
|
|
1791
1792
|
depositeName,
|
|
1792
1793
|
isShowDepositeName,
|
|
1793
|
-
|
|
1794
|
+
isUnavailableByTerm,
|
|
1794
1795
|
}), jsxs("div", { className: "flex flex-col gap-2xl sm:w-96", children: [renderDepositResults(finalSum, income), renderButtonsSection(buttons, { isVertical: true }), renderFootnote(footnote), renderFootnote(bottomFootnote)] })] }));
|
|
1795
1796
|
});
|
|
1796
1797
|
const renderBusinessDepositParamsForm = (calculatorParams, field) => (jsxs("div", { className: "flex flex-col gap-y-xl sm:gap-y-s", children: [jsx(Checkbox, { text: "\u041F\u043E\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u0435", disabled: calculatorParams.isDisabledOperatingDeposit, ...field('isReplenished'), value: calculatorParams.isReplenished }), jsx(Checkbox, { disabled: calculatorParams.isDisabledOperatingDeposit, text: "\u0427\u0430\u0441\u0442\u0438\u0447\u043D\u043E\u0435 \u0441\u043D\u044F\u0442\u0438\u0435", ...field('isPartialWithdrawal'), value: calculatorParams.isPartialWithdrawal }), jsx(Checkbox, { text: "\u0418\u041F / \u043C\u0430\u043B\u043E\u0435 \u043F\u0440\u0435\u0434\u043F\u0440\u0438\u044F\u0442\u0438\u0435", ...field('isSmallBusiness'), value: calculatorParams.isSmallBusiness })] }));
|
|
@@ -1863,7 +1864,7 @@
|
|
|
1863
1864
|
};
|
|
1864
1865
|
|
|
1865
1866
|
const useCreditCalculatorParams = (userInputParams, sourceBookDir, paramsViewSettings) => {
|
|
1866
|
-
|
|
1867
|
+
const { moneyValue, monthsValue } = userInputParams;
|
|
1867
1868
|
const data = useCalculatorParams(sourceBookDir || CREDIT_CALC_DEFAULT_DIR);
|
|
1868
1869
|
const rateRows = data?.rateRows || [DEFAULT_CREDIT_CALCULATOR_PARAMS];
|
|
1869
1870
|
const limitRows = data?.limitRows || [];
|
|
@@ -1874,8 +1875,6 @@
|
|
|
1874
1875
|
});
|
|
1875
1876
|
const { minSum, maxSum } = getLimitRangeByKeys(['minSum', 'maxSum'], creditCalculatorSourceBookLimitParams, rateRows);
|
|
1876
1877
|
const { minMonths, maxMonths } = getLimitRangeByKeys(['minMonths', 'maxMonths'], creditCalculatorSourceBookLimitParams, rateRows);
|
|
1877
|
-
moneyValue = clamp(moneyValue, minSum, maxSum);
|
|
1878
|
-
monthsValue = clamp(monthsValue, minMonths, maxMonths);
|
|
1879
1878
|
const creditCalculatorRateParams = getCreditCalculatorRateParams({
|
|
1880
1879
|
rateRows,
|
|
1881
1880
|
userInputParams,
|
|
@@ -2085,7 +2084,7 @@
|
|
|
2085
2084
|
checkRangeByKeys(monthsValue, ['minMonths', 'maxMonths'], row)) || DEFAULT_REFINANCING_CALCULATOR_PARAMS;
|
|
2086
2085
|
|
|
2087
2086
|
const useRefinancingCalculatorParams = (userInputParams, sourceBookDir, paramsViewSettings) => {
|
|
2088
|
-
|
|
2087
|
+
const { moneyValue, monthsValue, oldMonthlyPayment, moneyExtra } = userInputParams;
|
|
2089
2088
|
const data = useCalculatorParams(sourceBookDir || REFINANCING_CALC_DEFAULT_DIR);
|
|
2090
2089
|
const rateRows = data?.rateRows || [DEFAULT_REFINANCING_CALCULATOR_PARAMS];
|
|
2091
2090
|
const limitRows = data?.limitRows || [];
|
|
@@ -2095,13 +2094,7 @@
|
|
|
2095
2094
|
paramsViewSettings,
|
|
2096
2095
|
});
|
|
2097
2096
|
const { minSum, maxSum } = getLimitRangeByKeys(['minSum', 'maxSum'], sourceBookLimitParams, rateRows);
|
|
2098
|
-
const { minSumOld, maxSumOld } = getLimitRangeByKeys(['minSumOld', 'maxSumOld'], sourceBookLimitParams, rateRows);
|
|
2099
|
-
const { minSumExtra, maxSumExtra } = getLimitRangeByKeys(['minSumExtra', 'maxSumExtra'], sourceBookLimitParams, rateRows);
|
|
2100
2097
|
const { minMonths, maxMonths } = getLimitRangeByKeys(['minMonths', 'maxMonths'], sourceBookLimitParams, rateRows);
|
|
2101
|
-
moneyValue = clamp(moneyValue, minSum, maxSum);
|
|
2102
|
-
oldMonthlyPayment = clamp(oldMonthlyPayment, minSumOld, maxSumOld);
|
|
2103
|
-
moneyExtra = clamp(moneyExtra, minSumExtra, maxSumExtra);
|
|
2104
|
-
monthsValue = clamp(monthsValue, minMonths, maxMonths);
|
|
2105
2098
|
const refinancingCalculatorSourceBookRateParams = getRefinancingCalculatorRateParams({
|
|
2106
2099
|
rateRows,
|
|
2107
2100
|
userInputParams,
|
|
@@ -2172,7 +2165,10 @@
|
|
|
2172
2165
|
...field('moneyExtra'),
|
|
2173
2166
|
value: calculatorParams.moneyExtra,
|
|
2174
2167
|
})
|
|
2175
|
-
: null] }),
|
|
2168
|
+
: null] }), renderRate({
|
|
2169
|
+
rate: calculatorParams.rate,
|
|
2170
|
+
fractionDigits: 1,
|
|
2171
|
+
}), jsxs("div", { className: "flex flex-col gap-2xl sm:w-96", children: [jsx(CalculatorValueBlock, { title: 'Ежемесячный платеж', value: calculatorParams.monthlyPayment, postfix: "\u20BD" }), calculatorParams.benefit > 0 ? (jsx(CalculatorValueBlock, { title: 'Выгода в месяц', value: calculatorParams.benefit, postfix: "\u20BD" })) : null, renderPaymentType({ orientation: 'vertical', ...field('isAnnuity') }), renderButtonsSection(buttons, { isVertical: true }), renderFootnote(footnote)] })] }));
|
|
2176
2172
|
});
|
|
2177
2173
|
const renderCreditParamsForm = (params, field) => (jsxs("div", { className: "space-y-s", children: [params.isShowSalaryClient ? (jsx(Checkbox, { text: "\u041F\u043E\u043B\u0443\u0447\u0430\u044E \u0437\u0430\u0440\u043F\u043B\u0430\u0442\u0443 \u043D\u0430 \u0441\u0447\u0451\u0442 \u0432 \u0420\u043E\u0441\u0441\u0435\u043B\u044C\u0445\u043E\u0437\u0431\u0430\u043D\u043A\u0435", ...field('isSalaryClient'), value: params.isSalaryClient })) : null, params.isShowInsurance ? (jsx(Checkbox, { text: "\u041A\u043E\u043C\u043F\u043B\u0435\u043A\u0441\u043D\u0430\u044F \u0441\u0442\u0440\u0430\u0445\u043E\u0432\u0430\u044F \u0437\u0430\u0449\u0438\u0442\u0430", ...field('isInsurance'), value: params.isInsurance })) : null, params.isShowExtraMoney ? (jsx(Checkbox, { text: "\u041F\u043E\u043B\u0443\u0447\u0438\u0442\u044C \u0434\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u0443\u044E \u0441\u0443\u043C\u043C\u0443", ...field('isExtraMoney'), value: params.isExtraMoney })) : null] }));
|
|
2178
2174
|
|
|
@@ -2502,6 +2498,7 @@
|
|
|
2502
2498
|
|
|
2503
2499
|
const cardBaseStyle = 'relative h-full';
|
|
2504
2500
|
const CARD_SIZE_MAP = {
|
|
2501
|
+
small: 'sm:min-w-64',
|
|
2505
2502
|
normal: 'sm:min-w-96',
|
|
2506
2503
|
big: 'sm:min-w-[515px]',
|
|
2507
2504
|
};
|
|
@@ -5264,7 +5261,7 @@
|
|
|
5264
5261
|
return (jsx("div", { className: "flex items-end absolute bottom-0 right-0 h-full pointer-events-none", children: jsx(LikeControl, { className: "rounded-tl-3xl sticky bottom-0 pointer-events-auto" }) }));
|
|
5265
5262
|
}
|
|
5266
5263
|
|
|
5267
|
-
const packageVersion = "0.13.
|
|
5264
|
+
const packageVersion = "0.13.8";
|
|
5268
5265
|
|
|
5269
5266
|
exports.Blocks = Blocks;
|
|
5270
5267
|
exports.ContentPage = ContentPage;
|