@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.
Files changed (169) hide show
  1. package/bundle/EventBus/defaultEventBus.d.ts +2 -2
  2. package/bundle/blocks.schema.json +1 -1
  3. package/bundle/bundle.umd.js +51 -40
  4. package/bundle/bundle.umd.min.js +1 -1
  5. package/bundle/components/Calculator/BusinessDepositCalculatorForm.d.ts +0 -3
  6. package/bundle/components/Calculator/CalculatorContent.d.ts +27 -1
  7. package/bundle/components/Calculator/constants.d.ts +1 -1
  8. package/bundle/components/Calculator/{getBusinessDepositCalculatorParams.d.ts → useBusinessDepositCalculatorParams.d.ts} +2 -4
  9. package/bundle/components/Calculator/useBusinessDepositRates.d.ts +4 -0
  10. package/bundle/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +2 -2
  11. package/bundle/hooks/useLocation.d.ts +2 -7
  12. package/bundle/hooks/useRegions.d.ts +1 -0
  13. package/bundle/ui-kit/LinkWrapper/LinkWrapper.d.ts +1 -0
  14. package/bundle/ui-kit/LocationDialog/renderRegion.d.ts +1 -1
  15. package/dist/EventBus/defaultEventBus.d.ts +2 -2
  16. package/dist/components/Calculator/BusinessDepositCalculatorForm.d.ts +0 -3
  17. package/dist/components/Calculator/BusinessDepositCalculatorForm.js +3 -3
  18. package/dist/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
  19. package/dist/components/Calculator/CalculatorContent.d.ts +27 -1
  20. package/dist/components/Calculator/constants.d.ts +1 -1
  21. package/dist/components/Calculator/{getBusinessDepositCalculatorParams.d.ts → useBusinessDepositCalculatorParams.d.ts} +2 -4
  22. package/dist/components/Calculator/{getBusinessDepositCalculatorParams.js → useBusinessDepositCalculatorParams.js} +8 -6
  23. package/dist/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -0
  24. package/dist/components/Calculator/useBusinessDepositRates.d.ts +4 -0
  25. package/dist/components/Calculator/useBusinessDepositRates.js +15 -0
  26. package/dist/components/Calculator/useBusinessDepositRates.js.map +1 -0
  27. package/dist/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +2 -2
  28. package/dist/components/ExchangeRateTile/useFetchExchangeRateData.js.map +1 -1
  29. package/dist/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
  30. package/dist/hooks/useLocation.d.ts +2 -7
  31. package/dist/hooks/useLocation.js.map +1 -1
  32. package/dist/hooks/useRegions.d.ts +1 -0
  33. package/dist/hooks/useRegions.js.map +1 -1
  34. package/dist/ui-kit/LinkWrapper/LinkWrapper.d.ts +1 -0
  35. package/dist/ui-kit/LinkWrapper/LinkWrapper.js +2 -2
  36. package/dist/ui-kit/LinkWrapper/LinkWrapper.js.map +1 -1
  37. package/dist/ui-kit/LocationDialog/LocationDialog.js +4 -3
  38. package/dist/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
  39. package/dist/ui-kit/LocationDialog/renderRegion.d.ts +1 -1
  40. package/dist/ui-kit/LocationDialog/renderRegion.js +4 -3
  41. package/dist/ui-kit/LocationDialog/renderRegion.js.map +1 -1
  42. package/lib/EventBus/defaultEventBus.d.ts +2 -2
  43. package/lib/components/Calculator/BusinessDepositCalculatorForm.d.ts +0 -3
  44. package/lib/components/Calculator/BusinessDepositCalculatorForm.js +3 -3
  45. package/lib/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
  46. package/lib/components/Calculator/CalculatorContent.d.ts +27 -1
  47. package/lib/components/Calculator/constants.d.ts +1 -1
  48. package/lib/components/Calculator/{getBusinessDepositCalculatorParams.d.ts → useBusinessDepositCalculatorParams.d.ts} +2 -4
  49. package/lib/components/Calculator/{getBusinessDepositCalculatorParams.js → useBusinessDepositCalculatorParams.js} +6 -4
  50. package/lib/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -0
  51. package/lib/components/Calculator/useBusinessDepositRates.d.ts +4 -0
  52. package/lib/components/Calculator/useBusinessDepositRates.js +12 -0
  53. package/lib/components/Calculator/useBusinessDepositRates.js.map +1 -0
  54. package/lib/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +2 -2
  55. package/lib/components/ExchangeRateTile/useFetchExchangeRateData.js.map +1 -1
  56. package/lib/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
  57. package/lib/hooks/useLocation.d.ts +2 -7
  58. package/lib/hooks/useLocation.js.map +1 -1
  59. package/lib/hooks/useRegions.d.ts +1 -0
  60. package/lib/hooks/useRegions.js.map +1 -1
  61. package/lib/ui-kit/LinkWrapper/LinkWrapper.d.ts +1 -0
  62. package/lib/ui-kit/LinkWrapper/LinkWrapper.js +2 -2
  63. package/lib/ui-kit/LinkWrapper/LinkWrapper.js.map +1 -1
  64. package/lib/ui-kit/LocationDialog/LocationDialog.js +4 -3
  65. package/lib/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
  66. package/lib/ui-kit/LocationDialog/renderRegion.d.ts +1 -1
  67. package/lib/ui-kit/LocationDialog/renderRegion.js +4 -3
  68. package/lib/ui-kit/LocationDialog/renderRegion.js.map +1 -1
  69. package/mobile/bundle/EventBus/defaultEventBus.d.ts +2 -2
  70. package/mobile/bundle/bundle.umd.js +51 -40
  71. package/mobile/bundle/bundle.umd.min.js +1 -1
  72. package/mobile/bundle/components/Calculator/BusinessDepositCalculatorForm.d.ts +0 -3
  73. package/mobile/bundle/components/Calculator/CalculatorContent.d.ts +27 -1
  74. package/mobile/bundle/components/Calculator/constants.d.ts +1 -1
  75. package/mobile/bundle/components/Calculator/{getBusinessDepositCalculatorParams.d.ts → useBusinessDepositCalculatorParams.d.ts} +2 -4
  76. package/mobile/bundle/components/Calculator/useBusinessDepositRates.d.ts +4 -0
  77. package/mobile/bundle/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +2 -2
  78. package/mobile/bundle/hooks/useLocation.d.ts +2 -7
  79. package/mobile/bundle/hooks/useRegions.d.ts +1 -0
  80. package/mobile/bundle/ui-kit/LinkWrapper/LinkWrapper.d.ts +1 -0
  81. package/mobile/bundle/ui-kit/LocationDialog/renderRegion.d.ts +1 -1
  82. package/mobile/dist/EventBus/defaultEventBus.d.ts +2 -2
  83. package/mobile/dist/components/Calculator/BusinessDepositCalculatorForm.d.ts +0 -3
  84. package/mobile/dist/components/Calculator/BusinessDepositCalculatorForm.js +3 -3
  85. package/mobile/dist/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
  86. package/mobile/dist/components/Calculator/CalculatorContent.d.ts +27 -1
  87. package/mobile/dist/components/Calculator/constants.d.ts +1 -1
  88. package/mobile/dist/components/Calculator/useBusinessDepositCalculatorParams.d.ts +25 -0
  89. package/mobile/dist/components/Calculator/{getBusinessDepositCalculatorParams.js → useBusinessDepositCalculatorParams.js} +8 -6
  90. package/mobile/dist/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -0
  91. package/mobile/dist/components/Calculator/useBusinessDepositRates.d.ts +4 -0
  92. package/mobile/dist/components/Calculator/useBusinessDepositRates.js +15 -0
  93. package/mobile/dist/components/Calculator/useBusinessDepositRates.js.map +1 -0
  94. package/mobile/dist/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +2 -2
  95. package/mobile/dist/components/ExchangeRateTile/useFetchExchangeRateData.js.map +1 -1
  96. package/mobile/dist/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
  97. package/mobile/dist/hooks/useLocation.d.ts +2 -7
  98. package/mobile/dist/hooks/useLocation.js.map +1 -1
  99. package/mobile/dist/hooks/useRegions.d.ts +1 -0
  100. package/mobile/dist/hooks/useRegions.js.map +1 -1
  101. package/mobile/dist/ui-kit/LinkWrapper/LinkWrapper.d.ts +1 -0
  102. package/mobile/dist/ui-kit/LinkWrapper/LinkWrapper.js +2 -2
  103. package/mobile/dist/ui-kit/LinkWrapper/LinkWrapper.js.map +1 -1
  104. package/mobile/dist/ui-kit/LocationDialog/LocationDialog.js +4 -3
  105. package/mobile/dist/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
  106. package/mobile/dist/ui-kit/LocationDialog/renderRegion.d.ts +1 -1
  107. package/mobile/dist/ui-kit/LocationDialog/renderRegion.js +4 -3
  108. package/mobile/dist/ui-kit/LocationDialog/renderRegion.js.map +1 -1
  109. package/mobile/lib/EventBus/defaultEventBus.d.ts +2 -2
  110. package/mobile/lib/components/Calculator/BusinessDepositCalculatorForm.d.ts +0 -3
  111. package/mobile/lib/components/Calculator/BusinessDepositCalculatorForm.js +3 -3
  112. package/mobile/lib/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
  113. package/mobile/lib/components/Calculator/CalculatorContent.d.ts +27 -1
  114. package/mobile/lib/components/Calculator/constants.d.ts +1 -1
  115. package/mobile/lib/components/Calculator/useBusinessDepositCalculatorParams.d.ts +25 -0
  116. package/mobile/lib/components/Calculator/{getBusinessDepositCalculatorParams.js → useBusinessDepositCalculatorParams.js} +6 -4
  117. package/mobile/lib/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -0
  118. package/mobile/lib/components/Calculator/useBusinessDepositRates.d.ts +4 -0
  119. package/mobile/lib/components/Calculator/useBusinessDepositRates.js +12 -0
  120. package/mobile/lib/components/Calculator/useBusinessDepositRates.js.map +1 -0
  121. package/mobile/lib/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +2 -2
  122. package/mobile/lib/components/ExchangeRateTile/useFetchExchangeRateData.js.map +1 -1
  123. package/mobile/lib/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
  124. package/mobile/lib/hooks/useLocation.d.ts +2 -7
  125. package/mobile/lib/hooks/useLocation.js.map +1 -1
  126. package/mobile/lib/hooks/useRegions.d.ts +1 -0
  127. package/mobile/lib/hooks/useRegions.js.map +1 -1
  128. package/mobile/lib/ui-kit/LinkWrapper/LinkWrapper.d.ts +1 -0
  129. package/mobile/lib/ui-kit/LinkWrapper/LinkWrapper.js +2 -2
  130. package/mobile/lib/ui-kit/LinkWrapper/LinkWrapper.js.map +1 -1
  131. package/mobile/lib/ui-kit/LocationDialog/LocationDialog.js +4 -3
  132. package/mobile/lib/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
  133. package/mobile/lib/ui-kit/LocationDialog/renderRegion.d.ts +1 -1
  134. package/mobile/lib/ui-kit/LocationDialog/renderRegion.js +4 -3
  135. package/mobile/lib/ui-kit/LocationDialog/renderRegion.js.map +1 -1
  136. package/mobile/src/EventBus/defaultEventBus.ts +2 -2
  137. package/mobile/src/components/Calculator/BusinessDepositCalculatorForm.tsx +7 -10
  138. package/mobile/src/components/Calculator/CalculatorContent.ts +31 -1
  139. package/mobile/src/components/Calculator/constants.ts +1 -1
  140. package/mobile/src/components/Calculator/{getBusinessDepositCalculatorParams.ts → useBusinessDepositCalculatorParams.ts} +8 -9
  141. package/mobile/src/components/Calculator/useBusinessDepositRates.ts +22 -0
  142. package/mobile/src/components/ExchangeRateTile/useFetchExchangeRateData.ts +2 -2
  143. package/mobile/src/components/StickyBottomMenu/BurgerMenuDialog.tsx +3 -2
  144. package/mobile/src/hooks/useLocation.ts +6 -13
  145. package/mobile/src/hooks/useRegions.ts +1 -0
  146. package/mobile/src/ui-kit/LinkWrapper/LinkWrapper.tsx +3 -2
  147. package/mobile/src/ui-kit/LocationDialog/LocationDialog.tsx +9 -8
  148. package/mobile/src/ui-kit/LocationDialog/renderRegion.tsx +16 -15
  149. package/package.json +1 -1
  150. package/src/EventBus/defaultEventBus.ts +2 -2
  151. package/src/components/Calculator/BusinessDepositCalculatorForm.tsx +7 -10
  152. package/src/components/Calculator/Calculator.fixture.tsx +2 -2
  153. package/src/components/Calculator/CalculatorContent.ts +31 -1
  154. package/src/components/Calculator/constants.ts +1 -1
  155. package/src/components/Calculator/{getBusinessDepositCalculatorParams.ts → useBusinessDepositCalculatorParams.ts} +8 -9
  156. package/src/components/Calculator/useBusinessDepositRates.ts +22 -0
  157. package/src/components/ExchangeRateTile/useFetchExchangeRateData.ts +2 -2
  158. package/src/components/StickyBottomMenu/BurgerMenuDialog.tsx +3 -2
  159. package/src/hooks/useLocation.ts +6 -13
  160. package/src/hooks/useRegions.ts +1 -0
  161. package/src/ui-kit/LinkWrapper/LinkWrapper.tsx +3 -2
  162. package/src/ui-kit/LocationDialog/LocationDialog.tsx +9 -8
  163. package/src/ui-kit/LocationDialog/renderRegion.tsx +16 -15
  164. package/dist/components/Calculator/getBusinessDepositCalculatorParams.js.map +0 -1
  165. package/lib/components/Calculator/getBusinessDepositCalculatorParams.js.map +0 -1
  166. package/mobile/dist/components/Calculator/getBusinessDepositCalculatorParams.d.ts +0 -27
  167. package/mobile/dist/components/Calculator/getBusinessDepositCalculatorParams.js.map +0 -1
  168. package/mobile/lib/components/Calculator/getBusinessDepositCalculatorParams.d.ts +0 -27
  169. package/mobile/lib/components/Calculator/getBusinessDepositCalculatorParams.js.map +0 -1
@@ -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 getBusinessDepositCalculatorParams = (userInputParams, calcSource) => {
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 = calcSource?.rateRows?.find((_) => {
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 = calcSource?.rateRows || [DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS];
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 getMoneyDefaultValue = (defaultParams, defaultMoney = 0) => defaultParams?.sum ? defaultParams.sum : defaultMoney;
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 = getBusinessDepositCalculatorParams(userInputParams, calcSource);
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("div", { className: "mb-xs sm:mb-2xs", children: jsx("button", { className: "cursor-pointer hover:text-primary-hover", onClick: () => {
4099
- onChangeLocation && onChangeLocation(region);
4100
- }, type: "button", children: jsx(Text, { size: "text-l", font: "font-light", children: region.name || '' }) }) }, region.id));
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, basePath: '/' });
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 ? (jsxs("div", { className: "mb-s", children: [jsx(Text, { size: "text-l", font: "font-light", children: "\u0421\u0435\u0439\u0447\u0430\u0441 \u0432\u044B\u0431\u0440\u0430\u043D:\u00A0" }), jsx(LinkButton, { href: href, onClick: () => selectCurrentLocation(currentLocation), children: jsx(Text, { color: "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
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.229";
6008
+ const packageVersion = "0.14.231";
5998
6009
 
5999
6010
  exports.Blocks = Blocks;
6000
6011
  exports.ContentPage = ContentPage;