@redneckz/wildless-cms-uni-blocks 0.14.230 → 0.14.232
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/EventBus/defaultEventBus.d.ts +2 -2
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +51 -40
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/Calculator/BusinessDepositCalculatorForm.d.ts +0 -3
- package/bundle/components/Calculator/CalculatorContent.d.ts +27 -1
- package/bundle/components/Calculator/constants.d.ts +1 -1
- package/bundle/components/Calculator/{getBusinessDepositCalculatorParams.d.ts → useBusinessDepositCalculatorParams.d.ts} +2 -4
- package/bundle/components/Calculator/useBusinessDepositRates.d.ts +4 -0
- package/bundle/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +2 -2
- package/bundle/hooks/useLocation.d.ts +2 -7
- package/bundle/hooks/useRegions.d.ts +1 -0
- package/bundle/ui-kit/LinkWrapper/LinkWrapper.d.ts +1 -0
- package/bundle/ui-kit/LocationDialog/renderRegion.d.ts +1 -1
- package/dist/EventBus/defaultEventBus.d.ts +2 -2
- package/dist/components/Calculator/BusinessDepositCalculatorForm.d.ts +0 -3
- package/dist/components/Calculator/BusinessDepositCalculatorForm.js +3 -3
- package/dist/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/CalculatorContent.d.ts +27 -1
- package/dist/components/Calculator/constants.d.ts +1 -1
- package/dist/components/Calculator/{getBusinessDepositCalculatorParams.d.ts → useBusinessDepositCalculatorParams.d.ts} +2 -4
- package/dist/components/Calculator/{getBusinessDepositCalculatorParams.js → useBusinessDepositCalculatorParams.js} +8 -6
- package/dist/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -0
- package/dist/components/Calculator/useBusinessDepositRates.d.ts +4 -0
- package/dist/components/Calculator/useBusinessDepositRates.js +15 -0
- package/dist/components/Calculator/useBusinessDepositRates.js.map +1 -0
- package/dist/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +2 -2
- package/dist/components/ExchangeRateTile/useFetchExchangeRateData.js.map +1 -1
- package/dist/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
- package/dist/hooks/useLocation.d.ts +2 -7
- package/dist/hooks/useLocation.js.map +1 -1
- package/dist/hooks/useRegions.d.ts +1 -0
- package/dist/hooks/useRegions.js.map +1 -1
- package/dist/ui-kit/LinkWrapper/LinkWrapper.d.ts +1 -0
- package/dist/ui-kit/LinkWrapper/LinkWrapper.js +2 -2
- package/dist/ui-kit/LinkWrapper/LinkWrapper.js.map +1 -1
- package/dist/ui-kit/LocationDialog/LocationDialog.js +4 -3
- package/dist/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
- package/dist/ui-kit/LocationDialog/renderRegion.d.ts +1 -1
- package/dist/ui-kit/LocationDialog/renderRegion.js +4 -3
- package/dist/ui-kit/LocationDialog/renderRegion.js.map +1 -1
- package/lib/EventBus/defaultEventBus.d.ts +2 -2
- package/lib/components/Calculator/BusinessDepositCalculatorForm.d.ts +0 -3
- package/lib/components/Calculator/BusinessDepositCalculatorForm.js +3 -3
- package/lib/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/CalculatorContent.d.ts +27 -1
- package/lib/components/Calculator/constants.d.ts +1 -1
- package/lib/components/Calculator/{getBusinessDepositCalculatorParams.d.ts → useBusinessDepositCalculatorParams.d.ts} +2 -4
- package/lib/components/Calculator/{getBusinessDepositCalculatorParams.js → useBusinessDepositCalculatorParams.js} +6 -4
- package/lib/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -0
- package/lib/components/Calculator/useBusinessDepositRates.d.ts +4 -0
- package/lib/components/Calculator/useBusinessDepositRates.js +12 -0
- package/lib/components/Calculator/useBusinessDepositRates.js.map +1 -0
- package/lib/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +2 -2
- package/lib/components/ExchangeRateTile/useFetchExchangeRateData.js.map +1 -1
- package/lib/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
- package/lib/hooks/useLocation.d.ts +2 -7
- package/lib/hooks/useLocation.js.map +1 -1
- package/lib/hooks/useRegions.d.ts +1 -0
- package/lib/hooks/useRegions.js.map +1 -1
- package/lib/ui-kit/LinkWrapper/LinkWrapper.d.ts +1 -0
- package/lib/ui-kit/LinkWrapper/LinkWrapper.js +2 -2
- package/lib/ui-kit/LinkWrapper/LinkWrapper.js.map +1 -1
- package/lib/ui-kit/LocationDialog/LocationDialog.js +4 -3
- package/lib/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
- package/lib/ui-kit/LocationDialog/renderRegion.d.ts +1 -1
- package/lib/ui-kit/LocationDialog/renderRegion.js +4 -3
- package/lib/ui-kit/LocationDialog/renderRegion.js.map +1 -1
- package/mobile/bundle/EventBus/defaultEventBus.d.ts +2 -2
- package/mobile/bundle/bundle.umd.js +51 -40
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/Calculator/BusinessDepositCalculatorForm.d.ts +0 -3
- package/mobile/bundle/components/Calculator/CalculatorContent.d.ts +27 -1
- package/mobile/bundle/components/Calculator/constants.d.ts +1 -1
- package/mobile/bundle/components/Calculator/{getBusinessDepositCalculatorParams.d.ts → useBusinessDepositCalculatorParams.d.ts} +2 -4
- package/mobile/bundle/components/Calculator/useBusinessDepositRates.d.ts +4 -0
- package/mobile/bundle/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +2 -2
- package/mobile/bundle/hooks/useLocation.d.ts +2 -7
- package/mobile/bundle/hooks/useRegions.d.ts +1 -0
- package/mobile/bundle/ui-kit/LinkWrapper/LinkWrapper.d.ts +1 -0
- package/mobile/bundle/ui-kit/LocationDialog/renderRegion.d.ts +1 -1
- package/mobile/dist/EventBus/defaultEventBus.d.ts +2 -2
- package/mobile/dist/components/Calculator/BusinessDepositCalculatorForm.d.ts +0 -3
- package/mobile/dist/components/Calculator/BusinessDepositCalculatorForm.js +3 -3
- package/mobile/dist/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/CalculatorContent.d.ts +27 -1
- package/mobile/dist/components/Calculator/constants.d.ts +1 -1
- package/mobile/dist/components/Calculator/useBusinessDepositCalculatorParams.d.ts +25 -0
- package/mobile/dist/components/Calculator/{getBusinessDepositCalculatorParams.js → useBusinessDepositCalculatorParams.js} +8 -6
- package/mobile/dist/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -0
- package/mobile/dist/components/Calculator/useBusinessDepositRates.d.ts +4 -0
- package/mobile/dist/components/Calculator/useBusinessDepositRates.js +15 -0
- package/mobile/dist/components/Calculator/useBusinessDepositRates.js.map +1 -0
- package/mobile/dist/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +2 -2
- package/mobile/dist/components/ExchangeRateTile/useFetchExchangeRateData.js.map +1 -1
- package/mobile/dist/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
- package/mobile/dist/hooks/useLocation.d.ts +2 -7
- package/mobile/dist/hooks/useLocation.js.map +1 -1
- package/mobile/dist/hooks/useRegions.d.ts +1 -0
- package/mobile/dist/hooks/useRegions.js.map +1 -1
- package/mobile/dist/ui-kit/LinkWrapper/LinkWrapper.d.ts +1 -0
- package/mobile/dist/ui-kit/LinkWrapper/LinkWrapper.js +2 -2
- package/mobile/dist/ui-kit/LinkWrapper/LinkWrapper.js.map +1 -1
- package/mobile/dist/ui-kit/LocationDialog/LocationDialog.js +4 -3
- package/mobile/dist/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
- package/mobile/dist/ui-kit/LocationDialog/renderRegion.d.ts +1 -1
- package/mobile/dist/ui-kit/LocationDialog/renderRegion.js +4 -3
- package/mobile/dist/ui-kit/LocationDialog/renderRegion.js.map +1 -1
- package/mobile/lib/EventBus/defaultEventBus.d.ts +2 -2
- package/mobile/lib/components/Calculator/BusinessDepositCalculatorForm.d.ts +0 -3
- package/mobile/lib/components/Calculator/BusinessDepositCalculatorForm.js +3 -3
- package/mobile/lib/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/CalculatorContent.d.ts +27 -1
- package/mobile/lib/components/Calculator/constants.d.ts +1 -1
- package/mobile/lib/components/Calculator/useBusinessDepositCalculatorParams.d.ts +25 -0
- package/mobile/lib/components/Calculator/{getBusinessDepositCalculatorParams.js → useBusinessDepositCalculatorParams.js} +6 -4
- package/mobile/lib/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -0
- package/mobile/lib/components/Calculator/useBusinessDepositRates.d.ts +4 -0
- package/mobile/lib/components/Calculator/useBusinessDepositRates.js +12 -0
- package/mobile/lib/components/Calculator/useBusinessDepositRates.js.map +1 -0
- package/mobile/lib/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +2 -2
- package/mobile/lib/components/ExchangeRateTile/useFetchExchangeRateData.js.map +1 -1
- package/mobile/lib/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
- package/mobile/lib/hooks/useLocation.d.ts +2 -7
- package/mobile/lib/hooks/useLocation.js.map +1 -1
- package/mobile/lib/hooks/useRegions.d.ts +1 -0
- package/mobile/lib/hooks/useRegions.js.map +1 -1
- package/mobile/lib/ui-kit/LinkWrapper/LinkWrapper.d.ts +1 -0
- package/mobile/lib/ui-kit/LinkWrapper/LinkWrapper.js +2 -2
- package/mobile/lib/ui-kit/LinkWrapper/LinkWrapper.js.map +1 -1
- package/mobile/lib/ui-kit/LocationDialog/LocationDialog.js +4 -3
- package/mobile/lib/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
- package/mobile/lib/ui-kit/LocationDialog/renderRegion.d.ts +1 -1
- package/mobile/lib/ui-kit/LocationDialog/renderRegion.js +4 -3
- package/mobile/lib/ui-kit/LocationDialog/renderRegion.js.map +1 -1
- package/mobile/src/EventBus/defaultEventBus.ts +2 -2
- package/mobile/src/components/Calculator/BusinessDepositCalculatorForm.tsx +7 -10
- package/mobile/src/components/Calculator/CalculatorContent.ts +31 -1
- package/mobile/src/components/Calculator/constants.ts +1 -1
- package/mobile/src/components/Calculator/{getBusinessDepositCalculatorParams.ts → useBusinessDepositCalculatorParams.ts} +8 -9
- package/mobile/src/components/Calculator/useBusinessDepositRates.ts +22 -0
- package/mobile/src/components/ExchangeRateTile/useFetchExchangeRateData.ts +2 -2
- package/mobile/src/components/StickyBottomMenu/BurgerMenuDialog.tsx +3 -2
- package/mobile/src/hooks/useLocation.ts +6 -13
- package/mobile/src/hooks/useRegions.ts +1 -0
- package/mobile/src/ui-kit/LinkWrapper/LinkWrapper.tsx +3 -2
- package/mobile/src/ui-kit/LocationDialog/LocationDialog.tsx +9 -8
- package/mobile/src/ui-kit/LocationDialog/renderRegion.tsx +16 -15
- package/package.json +1 -1
- package/src/EventBus/defaultEventBus.ts +2 -2
- package/src/components/Calculator/BusinessDepositCalculatorForm.tsx +7 -10
- package/src/components/Calculator/Calculator.fixture.tsx +2 -2
- package/src/components/Calculator/CalculatorContent.ts +31 -1
- package/src/components/Calculator/constants.ts +1 -1
- package/src/components/Calculator/{getBusinessDepositCalculatorParams.ts → useBusinessDepositCalculatorParams.ts} +8 -9
- package/src/components/Calculator/useBusinessDepositRates.ts +22 -0
- package/src/components/ExchangeRateTile/useFetchExchangeRateData.ts +2 -2
- package/src/components/StickyBottomMenu/BurgerMenuDialog.tsx +3 -2
- package/src/hooks/useLocation.ts +6 -13
- package/src/hooks/useRegions.ts +1 -0
- package/src/ui-kit/LinkWrapper/LinkWrapper.tsx +3 -2
- package/src/ui-kit/LocationDialog/LocationDialog.tsx +9 -8
- package/src/ui-kit/LocationDialog/renderRegion.tsx +16 -15
- package/dist/components/Calculator/getBusinessDepositCalculatorParams.js.map +0 -1
- package/lib/components/Calculator/getBusinessDepositCalculatorParams.js.map +0 -1
- package/mobile/dist/components/Calculator/getBusinessDepositCalculatorParams.d.ts +0 -27
- package/mobile/dist/components/Calculator/getBusinessDepositCalculatorParams.js.map +0 -1
- package/mobile/lib/components/Calculator/getBusinessDepositCalculatorParams.d.ts +0 -27
- package/mobile/lib/components/Calculator/getBusinessDepositCalculatorParams.js.map +0 -1
package/bundle/bundle.umd.js
CHANGED
|
@@ -2095,6 +2095,33 @@
|
|
|
2095
2095
|
|
|
2096
2096
|
const CalculatorFormLayout = JSX(({ className, inputChildren, rateChildren, resultChildren }) => (jsxs("section", { className: style('flex flex-col justify-between @5xl:flex-row gap-m', className), children: [jsx("div", { className: "flex flex-col gap-y-m sm:max-w-md gap-2xl", children: inputChildren }), jsx("div", { className: "border-b border-main-divider md:hidden" }), rateChildren, jsx("div", { className: "flex flex-col gap-2xl sm:w-96 max-w-full", children: resultChildren })] })));
|
|
2097
2097
|
|
|
2098
|
+
const getMoneyDefaultValue = (defaultParams, defaultMoney = 0) => defaultParams?.sum ? defaultParams.sum : defaultMoney;
|
|
2099
|
+
const getMonthsDefaultValue = (defaultParams, defaultMonth = 0) => defaultParams?.period &&
|
|
2100
|
+
defaultParams.period >= DEFAULT_MIN_MONTHS &&
|
|
2101
|
+
defaultParams.period <= DEFAULT_MAX_MONTHS
|
|
2102
|
+
? defaultParams.period
|
|
2103
|
+
: defaultMonth;
|
|
2104
|
+
|
|
2105
|
+
const STEP_DAYS = 1;
|
|
2106
|
+
const renderDaysInput = (props) => (jsx(InputRange, { items: [`От ${daysText(props.min || 0)}`, `До ${daysText(props.max || 0)}`], step: STEP_DAYS, ...props }));
|
|
2107
|
+
const daysText = (days) => `${days} ${Number(days) % 10 === 1 ? 'дня' : 'дней'}`;
|
|
2108
|
+
|
|
2109
|
+
const orientationStyleMap = {
|
|
2110
|
+
horizontal: 'gap-5xl',
|
|
2111
|
+
vertical: 'flex-col gap-s',
|
|
2112
|
+
};
|
|
2113
|
+
const RadioButtonGroup = JSX(({ items, checkedItem, className, onChange: onChangeCheckedItem, orientation = 'horizontal', }) => (jsx("div", { className: style(`flex ${orientationStyleMap[orientation]}`, className), role: "radiogroup", children: items?.map(({ id, text }) => (jsx(Checkbox, { isRadio: true, text: text, value: checkedItem === id, onChange: () => onChangeCheckedItem && onChangeCheckedItem(id) }, String(id)))) })));
|
|
2114
|
+
|
|
2115
|
+
const renderBinaryRadioButtonGroup = ({ items, title, mobileTitle = title, orientation = 'horizontal', value, radioGroupClassName, onChange, }) => (jsxs("div", { className: "space-y-s", children: [title ? (jsx("div", { className: "hidden @5xl:block", children: jsx(Text, { color: "text-secondary-text", font: "font-light", children: title }) })) : null, mobileTitle ? (jsx("div", { className: "@5xl:hidden", children: jsx(Text, { color: "text-secondary-text", font: "font-light", children: mobileTitle }) })) : 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) })] }));
|
|
2116
|
+
|
|
2117
|
+
const renderInterestPayment = (props) => renderBinaryRadioButtonGroup({
|
|
2118
|
+
...props,
|
|
2119
|
+
items: [
|
|
2120
|
+
{ id: 'everyMonth', text: 'Ежемесячно' },
|
|
2121
|
+
{ id: 'atEndTerm', text: 'В конце срока' },
|
|
2122
|
+
],
|
|
2123
|
+
});
|
|
2124
|
+
|
|
2098
2125
|
const defaultDiscriminator = (_) => _;
|
|
2099
2126
|
const maxBy = (discriminator = defaultDiscriminator) => (list) => list.reduceRight((a, b) => (discriminator(a) > discriminator(b) ? a : b));
|
|
2100
2127
|
const max = maxBy();
|
|
@@ -2118,10 +2145,21 @@
|
|
|
2118
2145
|
});
|
|
2119
2146
|
const checkRangeByKeys = (value, [minKey, maxKey], sourceBookRow) => value >= sourceBookRow[minKey] && value <= sourceBookRow[maxKey];
|
|
2120
2147
|
|
|
2121
|
-
const
|
|
2148
|
+
const DEPOSIT_RATES_SERVICE_MAP = {
|
|
2149
|
+
UL: 'businessdepositrates',
|
|
2150
|
+
IP: 'selfemployeddepositrates',
|
|
2151
|
+
};
|
|
2152
|
+
function useBusinessDepositRates(rateParams) {
|
|
2153
|
+
const serviceName = rateParams?.rateType ? DEPOSIT_RATES_SERVICE_MAP[rateParams?.rateType] : '';
|
|
2154
|
+
const { data } = useAsyncData(serviceName ? `/api/v1/depositrates/${serviceName}` : null, fetchJSONUnsafe);
|
|
2155
|
+
return Array.isArray(data) ? data : [];
|
|
2156
|
+
}
|
|
2157
|
+
|
|
2158
|
+
const useBusinessDepositCalculatorParams = (userInputParams, rateParams) => {
|
|
2122
2159
|
const { daysValue, moneyValue, isPartialWithdrawal, isReplenished, isMonthlyInterestPayment } = userInputParams;
|
|
2123
2160
|
const isOperatingDeposit = isReplenished || isPartialWithdrawal;
|
|
2124
2161
|
const isDisabledOperatingDeposit = daysValue < BUSINESS_OPERATING_MIN_DAYS || daysValue > BUSINESS_OPERATING_MAX_DAYS;
|
|
2162
|
+
const rateRows = useBusinessDepositRates(rateParams);
|
|
2125
2163
|
if (daysValue <= BUSINESS_RATE_MIN_DAYS) {
|
|
2126
2164
|
return {
|
|
2127
2165
|
...DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS,
|
|
@@ -2130,7 +2168,7 @@
|
|
|
2130
2168
|
isUnavailableByTerm: true,
|
|
2131
2169
|
};
|
|
2132
2170
|
}
|
|
2133
|
-
const businessDepositCalculatorSourceBookParams =
|
|
2171
|
+
const businessDepositCalculatorSourceBookParams = rateRows?.find((_) => {
|
|
2134
2172
|
return (isMonthlyInterestPayment === _.isMonthlyInterestPayment &&
|
|
2135
2173
|
checkIsOperatingDeposit(isOperatingDeposit, _) &&
|
|
2136
2174
|
checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], _) &&
|
|
@@ -2139,7 +2177,7 @@
|
|
|
2139
2177
|
const { rate } = businessDepositCalculatorSourceBookParams;
|
|
2140
2178
|
const income = getDepositIncome$1(rate, userInputParams);
|
|
2141
2179
|
const finalSum = moneyValue + income;
|
|
2142
|
-
const sourceBookRows =
|
|
2180
|
+
const sourceBookRows = rateRows || [DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS];
|
|
2143
2181
|
return {
|
|
2144
2182
|
...businessDepositCalculatorSourceBookParams,
|
|
2145
2183
|
...getRangeByKeys(['minSum', 'maxSum'], sourceBookRows),
|
|
@@ -2166,34 +2204,7 @@
|
|
|
2166
2204
|
}
|
|
2167
2205
|
};
|
|
2168
2206
|
|
|
2169
|
-
const
|
|
2170
|
-
const getMonthsDefaultValue = (defaultParams, defaultMonth = 0) => defaultParams?.period &&
|
|
2171
|
-
defaultParams.period >= DEFAULT_MIN_MONTHS &&
|
|
2172
|
-
defaultParams.period <= DEFAULT_MAX_MONTHS
|
|
2173
|
-
? defaultParams.period
|
|
2174
|
-
: defaultMonth;
|
|
2175
|
-
|
|
2176
|
-
const STEP_DAYS = 1;
|
|
2177
|
-
const renderDaysInput = (props) => (jsx(InputRange, { items: [`От ${daysText(props.min || 0)}`, `До ${daysText(props.max || 0)}`], step: STEP_DAYS, ...props }));
|
|
2178
|
-
const daysText = (days) => `${days} ${Number(days) % 10 === 1 ? 'дня' : 'дней'}`;
|
|
2179
|
-
|
|
2180
|
-
const orientationStyleMap = {
|
|
2181
|
-
horizontal: 'gap-5xl',
|
|
2182
|
-
vertical: 'flex-col gap-s',
|
|
2183
|
-
};
|
|
2184
|
-
const RadioButtonGroup = JSX(({ items, checkedItem, className, onChange: onChangeCheckedItem, orientation = 'horizontal', }) => (jsx("div", { className: style(`flex ${orientationStyleMap[orientation]}`, className), role: "radiogroup", children: items?.map(({ id, text }) => (jsx(Checkbox, { isRadio: true, text: text, value: checkedItem === id, onChange: () => onChangeCheckedItem && onChangeCheckedItem(id) }, String(id)))) })));
|
|
2185
|
-
|
|
2186
|
-
const renderBinaryRadioButtonGroup = ({ items, title, mobileTitle = title, orientation = 'horizontal', value, radioGroupClassName, onChange, }) => (jsxs("div", { className: "space-y-s", children: [title ? (jsx("div", { className: "hidden @5xl:block", children: jsx(Text, { color: "text-secondary-text", font: "font-light", children: title }) })) : null, mobileTitle ? (jsx("div", { className: "@5xl:hidden", children: jsx(Text, { color: "text-secondary-text", font: "font-light", children: mobileTitle }) })) : 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) })] }));
|
|
2187
|
-
|
|
2188
|
-
const renderInterestPayment = (props) => renderBinaryRadioButtonGroup({
|
|
2189
|
-
...props,
|
|
2190
|
-
items: [
|
|
2191
|
-
{ id: 'everyMonth', text: 'Ежемесячно' },
|
|
2192
|
-
{ id: 'atEndTerm', text: 'В конце срока' },
|
|
2193
|
-
],
|
|
2194
|
-
});
|
|
2195
|
-
|
|
2196
|
-
const BusinessDepositCalculatorForm = JSX(({ className = '', buttons, footnote, bottomFootnote, isShowDepositeName, defaultParams, calcSource, }) => {
|
|
2207
|
+
const BusinessDepositCalculatorForm = JSX(({ className = '', buttons, footnote, bottomFootnote, isShowDepositeName, defaultParams, rateParams, }) => {
|
|
2197
2208
|
const [userInputParams, { field }] = useForm({
|
|
2198
2209
|
moneyValue: getMoneyDefaultValue(defaultParams, BUSINESS_DEFAULT_SUM),
|
|
2199
2210
|
daysValue: getMonthsDefaultValue(defaultParams, BUSINESS_DEFAULT_DAYS),
|
|
@@ -2201,7 +2212,7 @@
|
|
|
2201
2212
|
isPartialWithdrawal: Boolean(defaultParams?.isPartialWithdrawal),
|
|
2202
2213
|
isMonthlyInterestPayment: Boolean(defaultParams?.isMonthlyInterestPayment),
|
|
2203
2214
|
});
|
|
2204
|
-
const calculatorParams =
|
|
2215
|
+
const calculatorParams = useBusinessDepositCalculatorParams(userInputParams, rateParams);
|
|
2205
2216
|
const { income, finalSum, rate, isUnavailableByTerm, depositeName } = calculatorParams;
|
|
2206
2217
|
return (jsx(CalculatorFormLayout, { className: className, inputChildren: jsxs("div", { children: [renderWantedSumInput({
|
|
2207
2218
|
title: 'Сумма, ₽',
|
|
@@ -3058,9 +3069,9 @@
|
|
|
3058
3069
|
.map((link, index) => (jsx(CarouselLinkButton, { ...link }, String(index)))) }, String(groupIndex)))) }));
|
|
3059
3070
|
};
|
|
3060
3071
|
|
|
3061
|
-
const LinkWrapper = JSX(({ className = '', href, target, isRemote = false, children }) => {
|
|
3072
|
+
const LinkWrapper = JSX(({ className = '', href, target, isRemote = false, onClick, children }) => {
|
|
3062
3073
|
const link = useLink({ isRemote });
|
|
3063
|
-
const linkProps = link({ href, target });
|
|
3074
|
+
const linkProps = link({ href, target, onClick });
|
|
3064
3075
|
const Tag = href ? 'a' : 'div';
|
|
3065
3076
|
return (jsx(Tag, { className: style('block', className), ...(href ? linkProps : {}), role: href ? 'link' : 'none', children: children }));
|
|
3066
3077
|
});
|
|
@@ -4095,9 +4106,9 @@
|
|
|
4095
4106
|
return (jsxs("div", { className: "flex gap-s items-center", children: [icon ? jsx(Img, { pathPrefix: "/wcms-resources/", image: icon }) : null, text ? (jsx("a", { className: "hover:text-primary-hover", href: href, target: target, onClick: onClick, children: jsx(Text, { size: "text-l", font: "font-light", color: "text-primary-text", children: text }) })) : null] }));
|
|
4096
4107
|
});
|
|
4097
4108
|
|
|
4098
|
-
const renderRegion = (onChangeLocation) => (region) => (jsx(
|
|
4099
|
-
|
|
4100
|
-
|
|
4109
|
+
const renderRegion = (onChangeLocation) => (region) => region.name ? (jsx(LinkWrapper, { isRemote: true, href: `/branches/${region.slug}`, className: "mb-xs sm:mb-2xs hover:text-primary-hover", onClick: () => {
|
|
4110
|
+
onChangeLocation && onChangeLocation(region);
|
|
4111
|
+
}, children: jsx(Text, { size: "text-l", font: "font-light", children: region.name }) }, String(region.id))) : null;
|
|
4101
4112
|
|
|
4102
4113
|
const renderRegionGroup = (onChangeLocation) => ([letter, regions]) => (jsxs("div", { className: "break-inside-avoid mb-2xl w-56", children: [jsx("div", { className: "mb-s", children: jsx(Text, { size: "text-h6", children: letter }) }), regions.map(renderRegion(onChangeLocation))] }, letter));
|
|
4103
4114
|
|
|
@@ -4109,7 +4120,7 @@
|
|
|
4109
4120
|
const SEARCH_TERM_MIN_LENGTH = 3;
|
|
4110
4121
|
const LocationDialog = JSX(({ foreignOffices, defaultLocation }) => {
|
|
4111
4122
|
const [currentLocation, selectCurrentLocation] = useLocation(defaultLocation);
|
|
4112
|
-
const link = useLink({ isRemote: true
|
|
4123
|
+
const link = useLink({ isRemote: true });
|
|
4113
4124
|
const { href } = link({ href: `/branches/${currentLocation.slug}` });
|
|
4114
4125
|
const [query, setQuery] = useState('');
|
|
4115
4126
|
const regions = cleanUpRegions(useRegions()).sort((a, b) => a.name.localeCompare(b.name));
|
|
@@ -4119,7 +4130,7 @@
|
|
|
4119
4130
|
selectCurrentLocation(region);
|
|
4120
4131
|
close();
|
|
4121
4132
|
}, []);
|
|
4122
|
-
return (jsxs(Dialog, { className: "pb-20", head: jsxs("div", { children: [jsx(Text, { size: "text-h4", color: "text-primary-text", children: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0438\u043B\u0438\u0430\u043B" }), currentLocation ? (
|
|
4133
|
+
return (jsxs(Dialog, { className: "pb-20", head: jsxs("div", { children: [jsx(Text, { size: "text-h4", color: "text-primary-text", children: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0438\u043B\u0438\u0430\u043B" }), currentLocation ? (jsx("div", { className: "mb-s", children: jsxs(Paragraph, { size: "text-l", color: "text-primary-text", children: ["\u0421\u0435\u0439\u0447\u0430\u0441 \u0432\u044B\u0431\u0440\u0430\u043D:", jsx(LinkWrapper, { isRemote: true, href: href, className: "inline mx-2xs text-primary-main", children: currentLocation.name })] }) })) : null, jsx(SearchBar, { onSearch: setQuery, searchTerm: query })] }), children: [query && query.length >= SEARCH_TERM_MIN_LENGTH ? (jsx("div", { children: regions
|
|
4123
4134
|
.filter(({ name }) => name && jaroWinklerDistance(name.toLowerCase())(query.toLowerCase()) >= 0.8)
|
|
4124
4135
|
.map(renderRegion(handleChangeLocation)) })) : (jsx("div", { className: "columns-1 sm:columns-5", children: Array.from(regionsGroupByLetter.entries()).map(renderRegionGroup(handleChangeLocation)) })), renderForeignOffices(foreignOffices)] }));
|
|
4125
4136
|
});
|
|
@@ -5994,7 +6005,7 @@
|
|
|
5994
6005
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
5995
6006
|
});
|
|
5996
6007
|
|
|
5997
|
-
const packageVersion = "0.14.
|
|
6008
|
+
const packageVersion = "0.14.231";
|
|
5998
6009
|
|
|
5999
6010
|
exports.Blocks = Blocks;
|
|
6000
6011
|
exports.ContentPage = ContentPage;
|