@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.
Files changed (213) hide show
  1. package/bin/migration-scripts/0.8.10.js +31 -0
  2. package/bundle/blocks.schema.json +1 -1
  3. package/bundle/bundle.umd.js +82 -48
  4. package/bundle/bundle.umd.min.js +1 -1
  5. package/bundle/components/Calculator/rangeHelpers.d.ts +4 -0
  6. package/bundle/components/StepsBlock/StepsBlockContent.d.ts +11 -1
  7. package/bundle/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
  8. package/bundle/components/StepsBlock/{renderStepContent.d.ts → renderStep.d.ts} +5 -5
  9. package/bundle/components/Tile/TileContent.d.ts +2 -2
  10. package/dist/components/Calculator/Rate.js +1 -1
  11. package/dist/components/Calculator/Rate.js.map +1 -1
  12. package/dist/components/Calculator/constants.js +2 -2
  13. package/dist/components/Calculator/constants.js.map +1 -1
  14. package/dist/components/Calculator/rangeHelpers.d.ts +4 -0
  15. package/dist/components/Calculator/rangeHelpers.js +12 -0
  16. package/dist/components/Calculator/rangeHelpers.js.map +1 -0
  17. package/dist/components/Calculator/useBusinessDepositCalculatorParams.js +10 -3
  18. package/dist/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
  19. package/dist/components/Calculator/useCreditCalculatorParams.js +8 -2
  20. package/dist/components/Calculator/useCreditCalculatorParams.js.map +1 -1
  21. package/dist/components/Calculator/useDepositCalculatorParams.js +14 -4
  22. package/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  23. package/dist/components/Carousel/Carousel.js +6 -4
  24. package/dist/components/Carousel/Carousel.js.map +1 -1
  25. package/dist/components/PictureText/renderBenefit.js +1 -0
  26. package/dist/components/PictureText/renderBenefit.js.map +1 -1
  27. package/dist/components/ProductTile/renderBenefit.js +1 -0
  28. package/dist/components/ProductTile/renderBenefit.js.map +1 -1
  29. package/dist/components/StepsBlock/StepsBlock.js +7 -13
  30. package/dist/components/StepsBlock/StepsBlock.js.map +1 -1
  31. package/dist/components/StepsBlock/StepsBlock.mobile.js +24 -4
  32. package/dist/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
  33. package/dist/components/StepsBlock/StepsBlockContent.d.ts +11 -1
  34. package/dist/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
  35. package/dist/components/StepsBlock/checkCanRenderIcon.js +5 -0
  36. package/dist/components/StepsBlock/checkCanRenderIcon.js.map +1 -0
  37. package/{lib/components/StepsBlock/renderStepContent.d.ts → dist/components/StepsBlock/renderStep.d.ts} +5 -5
  38. package/dist/components/StepsBlock/renderStep.js +34 -0
  39. package/dist/components/StepsBlock/renderStep.js.map +1 -0
  40. package/dist/components/Tile/Tile.js +3 -3
  41. package/dist/components/Tile/Tile.js.map +1 -1
  42. package/dist/components/Tile/TileContent.d.ts +2 -2
  43. package/lib/components/Calculator/Rate.js +1 -1
  44. package/lib/components/Calculator/Rate.js.map +1 -1
  45. package/lib/components/Calculator/constants.js +2 -2
  46. package/lib/components/Calculator/constants.js.map +1 -1
  47. package/lib/components/Calculator/rangeHelpers.d.ts +4 -0
  48. package/lib/components/Calculator/rangeHelpers.js +8 -0
  49. package/lib/components/Calculator/rangeHelpers.js.map +1 -0
  50. package/lib/components/Calculator/useBusinessDepositCalculatorParams.js +10 -3
  51. package/lib/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
  52. package/lib/components/Calculator/useCreditCalculatorParams.js +8 -2
  53. package/lib/components/Calculator/useCreditCalculatorParams.js.map +1 -1
  54. package/lib/components/Calculator/useDepositCalculatorParams.js +14 -4
  55. package/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  56. package/lib/components/Carousel/Carousel.js +6 -4
  57. package/lib/components/Carousel/Carousel.js.map +1 -1
  58. package/lib/components/PictureText/renderBenefit.js +1 -0
  59. package/lib/components/PictureText/renderBenefit.js.map +1 -1
  60. package/lib/components/ProductTile/renderBenefit.js +1 -0
  61. package/lib/components/ProductTile/renderBenefit.js.map +1 -1
  62. package/lib/components/StepsBlock/StepsBlock.js +7 -13
  63. package/lib/components/StepsBlock/StepsBlock.js.map +1 -1
  64. package/lib/components/StepsBlock/StepsBlock.mobile.js +24 -4
  65. package/lib/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
  66. package/lib/components/StepsBlock/StepsBlockContent.d.ts +11 -1
  67. package/lib/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
  68. package/lib/components/StepsBlock/checkCanRenderIcon.js +2 -0
  69. package/lib/components/StepsBlock/checkCanRenderIcon.js.map +1 -0
  70. package/{dist/components/StepsBlock/renderStepContent.d.ts → lib/components/StepsBlock/renderStep.d.ts} +5 -5
  71. package/lib/components/StepsBlock/renderStep.js +31 -0
  72. package/lib/components/StepsBlock/renderStep.js.map +1 -0
  73. package/lib/components/Tile/Tile.js +3 -3
  74. package/lib/components/Tile/Tile.js.map +1 -1
  75. package/lib/components/Tile/TileContent.d.ts +2 -2
  76. package/mobile/bundle/bundle.umd.js +32 -5
  77. package/mobile/bundle/bundle.umd.min.js +1 -1
  78. package/mobile/bundle/components/Calculator/rangeHelpers.d.ts +4 -0
  79. package/mobile/bundle/components/StepsBlock/StepsBlockContent.d.ts +11 -1
  80. package/mobile/bundle/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
  81. package/mobile/bundle/components/StepsBlock/{renderStepContent.d.ts → renderStep.d.ts} +5 -5
  82. package/mobile/bundle/components/Tile/TileContent.d.ts +2 -2
  83. package/mobile/dist/components/Calculator/Rate.js +1 -1
  84. package/mobile/dist/components/Calculator/Rate.js.map +1 -1
  85. package/mobile/dist/components/Calculator/constants.js +2 -2
  86. package/mobile/dist/components/Calculator/constants.js.map +1 -1
  87. package/mobile/dist/components/Calculator/rangeHelpers.d.ts +4 -0
  88. package/mobile/dist/components/Calculator/rangeHelpers.js +12 -0
  89. package/mobile/dist/components/Calculator/rangeHelpers.js.map +1 -0
  90. package/mobile/dist/components/Calculator/useBusinessDepositCalculatorParams.js +10 -3
  91. package/mobile/dist/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
  92. package/mobile/dist/components/Calculator/useCreditCalculatorParams.js +8 -2
  93. package/mobile/dist/components/Calculator/useCreditCalculatorParams.js.map +1 -1
  94. package/mobile/dist/components/Calculator/useDepositCalculatorParams.js +14 -4
  95. package/mobile/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  96. package/mobile/dist/components/Carousel/Carousel.js +6 -4
  97. package/mobile/dist/components/Carousel/Carousel.js.map +1 -1
  98. package/mobile/dist/components/PictureText/renderBenefit.js +1 -0
  99. package/mobile/dist/components/PictureText/renderBenefit.js.map +1 -1
  100. package/mobile/dist/components/ProductTile/renderBenefit.js +1 -0
  101. package/mobile/dist/components/ProductTile/renderBenefit.js.map +1 -1
  102. package/mobile/dist/components/StepsBlock/StepsBlock.js +24 -4
  103. package/mobile/dist/components/StepsBlock/StepsBlock.js.map +1 -1
  104. package/mobile/dist/components/StepsBlock/StepsBlockContent.d.ts +11 -1
  105. package/mobile/dist/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
  106. package/mobile/dist/components/StepsBlock/checkCanRenderIcon.js +5 -0
  107. package/mobile/dist/components/StepsBlock/checkCanRenderIcon.js.map +1 -0
  108. package/mobile/dist/components/StepsBlock/renderStep.d.ts +11 -0
  109. package/mobile/dist/components/StepsBlock/renderStep.js +34 -0
  110. package/mobile/dist/components/StepsBlock/renderStep.js.map +1 -0
  111. package/mobile/dist/components/Tile/Tile.js +3 -3
  112. package/mobile/dist/components/Tile/Tile.js.map +1 -1
  113. package/mobile/dist/components/Tile/TileContent.d.ts +2 -2
  114. package/mobile/lib/components/Calculator/Rate.js +1 -1
  115. package/mobile/lib/components/Calculator/Rate.js.map +1 -1
  116. package/mobile/lib/components/Calculator/constants.js +2 -2
  117. package/mobile/lib/components/Calculator/constants.js.map +1 -1
  118. package/mobile/lib/components/Calculator/rangeHelpers.d.ts +4 -0
  119. package/mobile/lib/components/Calculator/rangeHelpers.js +8 -0
  120. package/mobile/lib/components/Calculator/rangeHelpers.js.map +1 -0
  121. package/mobile/lib/components/Calculator/useBusinessDepositCalculatorParams.js +10 -3
  122. package/mobile/lib/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
  123. package/mobile/lib/components/Calculator/useCreditCalculatorParams.js +8 -2
  124. package/mobile/lib/components/Calculator/useCreditCalculatorParams.js.map +1 -1
  125. package/mobile/lib/components/Calculator/useDepositCalculatorParams.js +14 -4
  126. package/mobile/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  127. package/mobile/lib/components/Carousel/Carousel.js +6 -4
  128. package/mobile/lib/components/Carousel/Carousel.js.map +1 -1
  129. package/mobile/lib/components/PictureText/renderBenefit.js +1 -0
  130. package/mobile/lib/components/PictureText/renderBenefit.js.map +1 -1
  131. package/mobile/lib/components/ProductTile/renderBenefit.js +1 -0
  132. package/mobile/lib/components/ProductTile/renderBenefit.js.map +1 -1
  133. package/mobile/lib/components/StepsBlock/StepsBlock.js +24 -4
  134. package/mobile/lib/components/StepsBlock/StepsBlock.js.map +1 -1
  135. package/mobile/lib/components/StepsBlock/StepsBlockContent.d.ts +11 -1
  136. package/mobile/lib/components/StepsBlock/checkCanRenderIcon.d.ts +2 -0
  137. package/mobile/lib/components/StepsBlock/checkCanRenderIcon.js +2 -0
  138. package/mobile/lib/components/StepsBlock/checkCanRenderIcon.js.map +1 -0
  139. package/mobile/lib/components/StepsBlock/renderStep.d.ts +11 -0
  140. package/mobile/lib/components/StepsBlock/renderStep.js +31 -0
  141. package/mobile/lib/components/StepsBlock/renderStep.js.map +1 -0
  142. package/mobile/lib/components/Tile/Tile.js +3 -3
  143. package/mobile/lib/components/Tile/Tile.js.map +1 -1
  144. package/mobile/lib/components/Tile/TileContent.d.ts +2 -2
  145. package/mobile/src/components/Calculator/Rate.tsx +1 -1
  146. package/mobile/src/components/Calculator/constants.ts +2 -2
  147. package/mobile/src/components/Calculator/rangeHelpers.ts +24 -0
  148. package/mobile/src/components/Calculator/useBusinessDepositCalculatorParams.ts +15 -3
  149. package/mobile/src/components/Calculator/useCreditCalculatorParams.ts +8 -2
  150. package/mobile/src/components/Calculator/useDepositCalculatorParams.ts +18 -4
  151. package/mobile/src/components/Carousel/Carousel.tsx +6 -4
  152. package/mobile/src/components/PictureText/renderBenefit.tsx +1 -0
  153. package/mobile/src/components/ProductTile/renderBenefit.tsx +1 -0
  154. package/mobile/src/components/StepsBlock/StepsBlock.tsx +29 -5
  155. package/mobile/src/components/StepsBlock/StepsBlock.ui.json +6 -0
  156. package/mobile/src/components/StepsBlock/StepsBlockContent.ts +13 -1
  157. package/mobile/src/components/StepsBlock/checkCanRenderIcon.ts +3 -0
  158. package/mobile/src/components/StepsBlock/renderStep.tsx +83 -0
  159. package/mobile/src/components/Tile/Tile.example.json +1 -1
  160. package/mobile/src/components/Tile/Tile.tsx +4 -4
  161. package/mobile/src/components/Tile/Tile.ui.json +7 -1
  162. package/mobile/src/components/Tile/TileContent.ts +2 -2
  163. package/package.json +1 -1
  164. package/src/components/Calculator/Rate.tsx +1 -1
  165. package/src/components/Calculator/constants.ts +2 -2
  166. package/src/components/Calculator/rangeHelpers.ts +24 -0
  167. package/src/components/Calculator/useBusinessDepositCalculatorParams.ts +15 -3
  168. package/src/components/Calculator/useCreditCalculatorParams.ts +8 -2
  169. package/src/components/Calculator/useDepositCalculatorParams.ts +18 -4
  170. package/src/components/Carousel/Carousel.tsx +6 -4
  171. package/src/components/PictureText/renderBenefit.tsx +1 -0
  172. package/src/components/ProductTile/renderBenefit.tsx +1 -0
  173. package/src/components/StepsBlock/StepsBlock.fixture.mobile.tsx +19 -1
  174. package/src/components/StepsBlock/StepsBlock.fixture.tsx +10 -3
  175. package/src/components/StepsBlock/StepsBlock.mobile.tsx +29 -5
  176. package/src/components/StepsBlock/StepsBlock.tsx +28 -16
  177. package/src/components/StepsBlock/StepsBlock.ui.json +6 -0
  178. package/src/components/StepsBlock/StepsBlockContent.ts +13 -1
  179. package/src/components/StepsBlock/checkCanRenderIcon.ts +3 -0
  180. package/src/components/StepsBlock/renderStep.tsx +83 -0
  181. package/src/components/Tile/Tile.example.json +1 -1
  182. package/src/components/Tile/Tile.fixture.tsx +2 -2
  183. package/src/components/Tile/Tile.tsx +4 -4
  184. package/src/components/Tile/Tile.ui.json +7 -1
  185. package/src/components/Tile/TileContent.ts +2 -2
  186. package/bundle/utils/checkIsIconRenderable.d.ts +0 -2
  187. package/dist/components/StepsBlock/renderStepContent.js +0 -19
  188. package/dist/components/StepsBlock/renderStepContent.js.map +0 -1
  189. package/dist/utils/checkIsIconRenderable.d.ts +0 -2
  190. package/dist/utils/checkIsIconRenderable.js +0 -5
  191. package/dist/utils/checkIsIconRenderable.js.map +0 -1
  192. package/lib/components/StepsBlock/renderStepContent.js +0 -16
  193. package/lib/components/StepsBlock/renderStepContent.js.map +0 -1
  194. package/lib/utils/checkIsIconRenderable.d.ts +0 -2
  195. package/lib/utils/checkIsIconRenderable.js +0 -2
  196. package/lib/utils/checkIsIconRenderable.js.map +0 -1
  197. package/mobile/bundle/utils/checkIsIconRenderable.d.ts +0 -2
  198. package/mobile/dist/components/StepsBlock/renderStepContent.d.ts +0 -11
  199. package/mobile/dist/components/StepsBlock/renderStepContent.js +0 -19
  200. package/mobile/dist/components/StepsBlock/renderStepContent.js.map +0 -1
  201. package/mobile/dist/utils/checkIsIconRenderable.d.ts +0 -2
  202. package/mobile/dist/utils/checkIsIconRenderable.js +0 -5
  203. package/mobile/dist/utils/checkIsIconRenderable.js.map +0 -1
  204. package/mobile/lib/components/StepsBlock/renderStepContent.d.ts +0 -11
  205. package/mobile/lib/components/StepsBlock/renderStepContent.js +0 -16
  206. package/mobile/lib/components/StepsBlock/renderStepContent.js.map +0 -1
  207. package/mobile/lib/utils/checkIsIconRenderable.d.ts +0 -2
  208. package/mobile/lib/utils/checkIsIconRenderable.js +0 -2
  209. package/mobile/lib/utils/checkIsIconRenderable.js.map +0 -1
  210. package/mobile/src/components/StepsBlock/renderStepContent.tsx +0 -83
  211. package/mobile/src/utils/checkIsIconRenderable.tsx +0 -3
  212. package/src/components/StepsBlock/renderStepContent.tsx +0 -83
  213. package/src/utils/checkIsIconRenderable.tsx +0 -3
@@ -1111,8 +1111,8 @@
1111
1111
  return (jsx(BlockWrapper, { className: `font-sans bg-white p-[50px] pb-9 ${className}`, ...rest, children: jsxs("div", { className: "container max-w-[978px]", children: [title ? jsx(Heading, { headingType: "h3", title: title, className: "text-center mb-8" }) : null, COMPONENTS_MAP[typeForm]({ button, link, handleSubmit }), responceType ? jsx(ResponseNotification, { responceType: responceType }) : null] }) }));
1112
1112
  });
1113
1113
 
1114
- const BenefitsBlock = JSX(({ className = '', title, benefitList, ...rest }) => (jsxs(BlockWrapper, { className: `p-12 flex flex-col items-center ${className}`, ...rest, children: [title ? (jsx(Heading, { headingType: "h3", as: "h2", className: "max-w-[47rem] text-center", title: title })) : null, benefitList?.length ? (jsx("div", { className: "flex flex-wrap w-full justify-center gap-x-20 mt-8", children: benefitList.map(renderStep) })) : null] })));
1115
- const renderStep = (benefit, i) => {
1114
+ const BenefitsBlock = JSX(({ className = '', title, benefitList, ...rest }) => (jsxs(BlockWrapper, { className: `p-12 flex flex-col items-center ${className}`, ...rest, children: [title ? (jsx(Heading, { headingType: "h3", as: "h2", className: "max-w-[47rem] text-center", title: title })) : null, benefitList?.length ? (jsx("div", { className: "flex flex-wrap w-full justify-center gap-x-20 mt-8", children: benefitList.map(renderStep$1) })) : null] })));
1115
+ const renderStep$1 = (benefit, i) => {
1116
1116
  const description = benefit.description;
1117
1117
  return (jsxs("div", { className: "flex items-center basis-1/2 max-w-[500px] mb-14", children: [benefit?.icon?.icon ? (jsx(ImgInner, { className: "w-12 h-12 min-w-12 p-3 rounded-full bg-main-divider text-primary-main group-data-secondary:bg-white/30 group-data-secondary:text-black", image: benefit.icon, asSVG: true })) : null, benefit?.icon?.src ? jsx(ImgInner, { image: benefit.icon }) : null, jsxs("div", { className: "ml-5", children: [benefit?.label ? jsx(Heading, { headingType: "h6", children: benefit.label }) : null, renderDescription$5(description)] })] }, String(i)));
1118
1118
  };
@@ -1320,7 +1320,7 @@
1320
1320
  maxSum: 5000000,
1321
1321
  minMonths: 2,
1322
1322
  maxMonths: 120,
1323
- rate: 5.9,
1323
+ rate: 7,
1324
1324
  isMonthlyInterestPayment: true,
1325
1325
  };
1326
1326
  const DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS = {
@@ -1328,7 +1328,7 @@
1328
1328
  maxSum: 500000,
1329
1329
  minDays: BUSINESS_MIN_DAYS,
1330
1330
  maxDays: BUSINESS_MAX_DAYS,
1331
- rate: 5.9,
1331
+ rate: 6.6,
1332
1332
  isMonthlyInterestPayment: true,
1333
1333
  isReplenished: false,
1334
1334
  isPartialWithdrawal: false,
@@ -1340,7 +1340,7 @@
1340
1340
  const DEPOSIT_CALC_DEFAULT_DIR = 'deposit-calculator-data';
1341
1341
  const BUSINESS_DEPOSIT_CALC_DEFAULT_DIR = 'business-calculator-data';
1342
1342
 
1343
- 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] })] })));
1343
+ 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] })] })));
1344
1344
 
1345
1345
  const renderFootnote = (text) => text ? (jsx(Paragraph, { size: "text-s-light", color: "text-secondary-text", children: text })) : null;
1346
1346
 
@@ -1440,6 +1440,17 @@
1440
1440
 
1441
1441
  const UnknownRate = JSX(({ title = 'Ставка' }) => (jsxs("div", { children: [jsx(Text, { size: "text-l-light", color: "text-secondary-text", children: title }), jsx("div", { className: "mt-1 pt-1 pl-5 pb-1.5", children: jsx(ImgInner, { image: { icon: 'PercentIcon' }, width: "90", height: "85", asSVG: true }) }), jsx("div", { className: "w-[250px] mt-3.5", children: jsxs(Paragraph, { size: "text-xl-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"] }) })] })));
1442
1442
 
1443
+ const defaultDiscriminator = (_) => _;
1444
+ const maxBy = (discriminator = defaultDiscriminator) => (list) => list.reduceRight((a, b) => (discriminator(a) > discriminator(b) ? a : b));
1445
+
1446
+ const minBy = (discriminator = defaultDiscriminator) => maxBy((_) => -discriminator(_));
1447
+
1448
+ const getRangeByKeys = ([minKey, maxKey], rows = []) => ({
1449
+ [minKey]: rows.length ? minBy()(rows.map((row) => row[minKey])) : 0,
1450
+ [maxKey]: rows.length ? maxBy()(rows.map((row) => row[maxKey])) : 0,
1451
+ });
1452
+ const checkRangeByKeys = (value, [minKey, maxKey], sourceBookRow) => value >= sourceBookRow[minKey] && value < sourceBookRow[maxKey];
1453
+
1443
1454
  const useBusinessDepositCalculatorParams = (userInputParams, sourceBookDir) => {
1444
1455
  const { daysValue, moneyValue, isPartialWithdrawal, isReplenished, isSmallBusiness, isMonthlyInterestPayment, } = userInputParams;
1445
1456
  const data = useCalculatorParams(sourceBookDir || BUSINESS_DEPOSIT_CALC_DEFAULT_DIR);
@@ -1456,21 +1467,27 @@
1456
1467
  const businessDepositCalculatorSourceBookParams = data?.rows?.find((_) => {
1457
1468
  return (isMonthlyInterestPayment === _.isMonthlyInterestPayment &&
1458
1469
  isSmallBusiness === _.isSmallBusiness &&
1459
- (isOperatingDeposit
1460
- ? _.isReplenished && _.isPartialWithdrawal
1461
- : !_.isReplenished && !_.isPartialWithdrawal));
1470
+ checkIsOperatingDeposit(isOperatingDeposit, _) &&
1471
+ checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], _) &&
1472
+ checkRangeByKeys(daysValue, ['minDays', 'maxDays'], _));
1462
1473
  }) || DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS;
1463
1474
  const { rate } = businessDepositCalculatorSourceBookParams;
1464
1475
  const income = getDepositIncome$1(rate, userInputParams);
1465
1476
  const finalSum = moneyValue + income;
1477
+ const sourceBookRows = data?.rows || [DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS];
1466
1478
  return {
1467
1479
  ...businessDepositCalculatorSourceBookParams,
1480
+ ...getRangeByKeys(['minSum', 'maxSum'], sourceBookRows),
1481
+ ...getRangeByKeys(['minDays', 'maxDays'], sourceBookRows),
1468
1482
  ...userInputParams,
1469
1483
  isDisabledOperatingDeposit,
1470
1484
  income,
1471
1485
  finalSum,
1472
1486
  };
1473
1487
  };
1488
+ const checkIsOperatingDeposit = (isOperatingDeposit, sourceBookRow) => isOperatingDeposit
1489
+ ? sourceBookRow.isReplenished && sourceBookRow.isPartialWithdrawal
1490
+ : !sourceBookRow.isReplenished && !sourceBookRow.isPartialWithdrawal;
1474
1491
  const getDepositIncome$1 = (rate, userInputParams) => {
1475
1492
  const { isMonthlyInterestPayment, moneyValue, daysValue } = userInputParams;
1476
1493
  /*
@@ -1542,18 +1559,23 @@
1542
1559
  };
1543
1560
 
1544
1561
  const useCreditCalculatorParams = (userInputParams, sourceBookDir) => {
1545
- const { isInsurance, isSalaryClient, isStateEmployee, moneyValue } = userInputParams;
1562
+ const { isInsurance, isSalaryClient, isStateEmployee, moneyValue, monthsValue } = userInputParams;
1546
1563
  const data = useCalculatorParams(sourceBookDir || CREDIT_CALC_DEFAULT_DIR);
1547
1564
  const creditCalculatorSourceBookParams = data?.rows?.find((_) => {
1548
1565
  return (isInsurance === _.isInsurance &&
1549
1566
  isSalaryClient === _.isSalaryClient &&
1550
- isStateEmployee === _.isStateEmployee);
1567
+ isStateEmployee === _.isStateEmployee &&
1568
+ checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], _) &&
1569
+ checkRangeByKeys(monthsValue, ['minMonths', 'maxMonths'], _));
1551
1570
  }) || DEFAULT_CREDIT_CALCULATOR_PARAMS;
1552
1571
  const { rateBottomRange, rateTopRange, sumBorder } = creditCalculatorSourceBookParams;
1553
1572
  const finalRate = moneyValue <= sumBorder ? rateBottomRange : rateTopRange;
1554
1573
  const monthlyPayment = getMonthlyPayment(finalRate, userInputParams);
1574
+ const sourceBookRows = data?.rows || [DEFAULT_CREDIT_CALCULATOR_PARAMS];
1555
1575
  return {
1556
1576
  ...creditCalculatorSourceBookParams,
1577
+ ...getRangeByKeys(['minSum', 'maxSum'], sourceBookRows),
1578
+ ...getRangeByKeys(['minMonths', 'maxMonths'], sourceBookRows),
1557
1579
  ...userInputParams,
1558
1580
  finalRate,
1559
1581
  monthlyPayment,
@@ -1594,14 +1616,23 @@
1594
1616
  });
1595
1617
 
1596
1618
  const useDepositCalculatorParams = (userInputParams, sourceBookDir) => {
1597
- const { isMonthlyInterestPayment, moneyValue } = userInputParams;
1619
+ const { isMonthlyInterestPayment, moneyValue, monthsValue } = userInputParams;
1598
1620
  const data = useCalculatorParams(sourceBookDir || DEPOSIT_CALC_DEFAULT_DIR);
1599
- const depositCalculatorSourceBookParams = data?.rows?.find((_) => isMonthlyInterestPayment === _.isMonthlyInterestPayment) ||
1600
- DEFAULT_DEPOSIT_CALCULATOR_PARAMS;
1621
+ const depositCalculatorSourceBookParams = data?.rows?.find((_) => isMonthlyInterestPayment === _.isMonthlyInterestPayment &&
1622
+ checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], _) &&
1623
+ checkRangeByKeys(monthsValue, ['minMonths', 'maxMonths'], _)) || DEFAULT_DEPOSIT_CALCULATOR_PARAMS;
1601
1624
  const { rate } = depositCalculatorSourceBookParams;
1602
1625
  const income = getDepositIncome(rate, userInputParams);
1603
1626
  const finalSum = moneyValue + income;
1604
- return { ...depositCalculatorSourceBookParams, ...userInputParams, income, finalSum };
1627
+ const sourceBookRows = data?.rows || [DEFAULT_DEPOSIT_CALCULATOR_PARAMS];
1628
+ return {
1629
+ ...depositCalculatorSourceBookParams,
1630
+ ...getRangeByKeys(['minSum', 'maxSum'], sourceBookRows),
1631
+ ...getRangeByKeys(['minMonths', 'maxMonths'], sourceBookRows),
1632
+ ...userInputParams,
1633
+ income,
1634
+ finalSum,
1635
+ };
1605
1636
  };
1606
1637
  const getDepositIncome = (rate, userInputParams) => {
1607
1638
  const { isMonthlyInterestPayment, moneyValue, monthsValue } = userInputParams;
@@ -1811,11 +1842,6 @@
1811
1842
 
1812
1843
  const areArraysEqual = (as, bs) => as === bs || Boolean(as && bs && as?.length === bs?.length && as.every((_, i) => _ === bs[i]));
1813
1844
 
1814
- const defaultDiscriminator = (_) => _;
1815
- const maxBy = (discriminator = defaultDiscriminator) => (list) => list.reduceRight((a, b) => (discriminator(a) > discriminator(b) ? a : b));
1816
-
1817
- const minBy = (discriminator = defaultDiscriminator) => maxBy((_) => -discriminator(_));
1818
-
1819
1845
  const getItemWidth = (container) => (itemCount) => container.scrollWidth / itemCount;
1820
1846
  const scrollBy = (container) => (itemCount, delta) => {
1821
1847
  container.scrollBy({ left: delta * getItemWidth(container)(itemCount), behavior: 'smooth' });
@@ -1916,10 +1942,12 @@
1916
1942
  isCyclic,
1917
1943
  });
1918
1944
  const isBankHistoryCarousel = childBlocks && childBlocks[0]?.type === 'CarouselBankHistoryCard';
1919
- return (jsx(BlockWrapper, { className: style(getPaddingStyle(isPadding), className), ...rest, children: jsxs("div", { className: "relative max-w-full", children: [jsx(SwipeListContainer, { containerRef: containerRef, visibleItemCount: visibleItemCount, snapAlign: "snap-start", gap: ITEMS_GAP, onVisibleIndicesChange: scroll.handleVisibleIndicesChange, children: renderChildren({
1920
- ...rest,
1921
- block: { ...rest.block, blocks: buildBlocks(childBlocks, activeIndex) },
1922
- }) }), jsx(CarouselScrollButtons, { scroll: scroll, isBlur: isBlur, arrowsPadded: arrowsPadded, onScrollLeft: decreaseActiveIndex, onScrollRight: increaseActiveIndex, hasEdgeBlocks: isBankHistoryCarousel, activeIndex: activeIndex, itemCount: count })] }) }));
1945
+ return (jsx(BlockWrapper, { className: style(getPaddingStyle(isPadding), className), ...rest, children: jsxs("div", { className: "relative max-w-full", children: [jsx(SwipeListContainer, { containerRef: containerRef, visibleItemCount: visibleItemCount, snapAlign: "snap-start", gap: ITEMS_GAP, onVisibleIndicesChange: scroll.handleVisibleIndicesChange, children: isBankHistoryCarousel
1946
+ ? renderChildren({
1947
+ ...rest,
1948
+ block: { ...rest.block, blocks: buildBlocks(childBlocks, activeIndex) },
1949
+ })
1950
+ : renderChildren(rest) }), jsx(CarouselScrollButtons, { scroll: scroll, isBlur: isBlur, arrowsPadded: arrowsPadded, onScrollLeft: decreaseActiveIndex, onScrollRight: increaseActiveIndex, hasEdgeBlocks: isBankHistoryCarousel, activeIndex: activeIndex, itemCount: count })] }) }));
1923
1951
  });
1924
1952
  Carousel.childrenTypes = [
1925
1953
  'CarouselCard',
@@ -3504,6 +3532,7 @@
3504
3532
  throw new Error(x);
3505
3533
  }
3506
3534
 
3535
+ // TODO: Create universal function for this case
3507
3536
  const renderBenefit$2 =
3508
3537
  // Linter doesn't understand that switch processes all cases
3509
3538
  // eslint-disable-next-line consistent-return
@@ -3640,6 +3669,7 @@
3640
3669
  return (jsx("div", { className: `mt-2.5 z-10 ${descriptionWidth}`, children: jsx(Paragraph, { size: "text-m", font: "font-light", color: "group-data-primary:text-secondary-text", children: additionalDescription }) }));
3641
3670
  }
3642
3671
 
3672
+ // TODO: Create universal function for this case
3643
3673
  const renderBenefit =
3644
3674
  // Linter doesn't understand that switch processes all cases
3645
3675
  // eslint-disable-next-line consistent-return
@@ -3842,19 +3872,30 @@
3842
3872
  });
3843
3873
  const normalizeSelectedRegion = (selectedRegion, regions) => !selectedRegion && regions?.length && regions[0]?.code ? regions[0].code : selectedRegion;
3844
3874
 
3845
- const checkIsIconRenderable = (icon) => Boolean(icon?.icon || icon?.src);
3875
+ const checkCanRenderIcon = (icon) => Boolean(icon?.icon || icon?.src);
3846
3876
 
3847
- const renderStepContent = ({ styleMap, isMainButton, version, }) => (step, i, { length }) => {
3877
+ // TODO: Create universal function for this case
3878
+ const renderStep = (props) =>
3879
+ // Linter doesn't understand that switch processes all cases
3880
+ // eslint-disable-next-line consistent-return
3881
+ (step, i, arr) => {
3882
+ const { type } = step;
3883
+ if (!(type === 'default' || type === 'rte')) {
3884
+ return null;
3885
+ }
3886
+ switch (type) {
3887
+ case 'default':
3888
+ return renderDefaultStep(props)(step, i, arr);
3889
+ case 'rte':
3890
+ return jsx(RichText, { __html: step.__html });
3891
+ default:
3892
+ assertUnreachable(step);
3893
+ }
3894
+ };
3895
+ const renderDefaultStep = ({ styleMap, isMainButton, version }) => (step, i, arr) => {
3848
3896
  const { label, description, button, items, isDotted } = step;
3849
- const contentMarginClass = label && (description || items) ? 'mt-2' : '';
3850
- return (jsxs("div", { className: `relative flex flex-col items-center text-center whitespace-pre-line overflow-hidden ${getContainerWidth(length)}`, children: [jsxs("div", { className: `${button?.text ? 'mb-8' : ''} text-center`, children: [renderStepLabel(label), jsxs("div", { className: `${contentMarginClass} flex flex-col items-center`, children: [renderStepDescription({
3851
- description,
3852
- className: styleMap.description,
3853
- }), jsx(List, { className: getItemsClasses({ className: 'text-left', description, styleMap }), items: items, listItemSize: "M", isDotted: isDotted })] })] }), button?.text && !isMainButton ? (jsx(Button, { className: "box-border py-3 h-12 w-full max-w-[240px] mt-auto", version: version, ...button, children: button?.text })) : null] }, String(i)));
3854
- };
3855
- const renderStepLabel = (label) => label ? jsx("div", { className: "text-h6", children: label }) : null;
3856
- const renderStepDescription = ({ description, className = '', }) => (description ? jsx("div", { className: className, children: description }) : null);
3857
- const getItemsClasses = ({ className, description, styleMap, }) => [description ? styleMap.description : 'text-h6', description ? 'mt-0.5' : '', className].join(' ');
3897
+ return (jsxs("div", { className: style('relative flex flex-col items-center text-center whitespace-pre-line overflow-hidden', getContainerWidth(arr.length)), children: [jsxs("div", { className: style(button?.text ? 'mb-8' : '', 'text-center'), children: [label ? (jsx("div", { className: "mb-2", children: jsx(Text, { size: "text-h6", children: label }) })) : null, jsxs("div", { className: "flex flex-col items-center", children: [description ? jsx("div", { className: styleMap.description, children: description }) : null, jsx(List, { className: style(description ? `${styleMap.description} mt-0.5` : 'text-h6'), items: items, listItemSize: "M", isDotted: isDotted })] })] }), button?.text && !isMainButton ? (jsx(Button, { className: "box-border py-3 h-12 w-full max-w-[240px] mt-auto", version: version, ...button, children: button?.text })) : null] }, String(i)));
3898
+ };
3858
3899
  const getContainerWidth = (length) => (length < 5 ? 'w-[276px]' : 'w-[210px]');
3859
3900
 
3860
3901
  const STEPS_BLOCK_STYLE_MAPS = {
@@ -3899,21 +3940,14 @@
3899
3940
 
3900
3941
  const getLineOpacity = (showLines) => (showLines ? '' : 'opacity-0');
3901
3942
  const getPaddingX = (steps) => (steps < 5 ? 'px-[88px]' : 'px-[55px]');
3902
- const StepsBlock = JSX(({ className = '', showLines = true, steps = [], button, version = 'primary', ...rest }) => {
3903
- const { title } = rest;
3904
- const styleMap = STEPS_BLOCK_STYLE_MAPS[version];
3943
+ const StepsBlock = JSX(({ className = '', showLines = true, steps = [], button, version = 'primary', title, ...rest }) => {
3905
3944
  const shortGaps = steps.length > 3;
3945
+ const styleMap = STEPS_BLOCK_STYLE_MAPS[version];
3906
3946
  const lineOpacity = getLineOpacity(showLines);
3907
- const titleMargin = title ? 'mt-9' : '';
3908
3947
  const paddingX = getPaddingX(steps.length);
3909
- return (jsxs(BlockWrapper, { className: [
3910
- 'box-border py-12',
3911
- shortGaps ? 'px-20' : 'px-[70px]',
3912
- 'flex flex-col items-center overflow-hidden',
3913
- className,
3914
- ].join(' '), version: version, ...rest, children: [title ? (jsx(Heading, { headingType: "h3", className: "max-w-[752px] text-center", title: title })) : null, steps?.length ? (jsxs("div", { className: `box-border ${titleMargin}`, children: [jsx("div", { className: `flex items-center ${paddingX}`, children: joinList(jsx("div", { className: `h-0.5 w-full bg-secondary-light ${lineOpacity}` }))(steps.map(renderStepIcon(styleMap, version))) }), jsx("div", { className: `flex justify-between mt-4 ${shortGaps ? 'gap-x-3' : 'gap-x-[101px]'}`, children: steps.map(renderStepContent({ styleMap, isMainButton: Boolean(button?.text), version })) })] })) : null, button?.text ? jsx(Button, { className: "mt-8 min-w-60", version: "primary", ...button }) : null] }));
3948
+ return (jsxs(BlockWrapper, { className: style('box-border py-12', shortGaps ? 'px-20' : 'px-[70px]', 'flex flex-col items-center overflow-hidden', className), version: version, ...rest, children: [title ? (jsx(Heading, { headingType: "h3", className: "max-w-[752px] text-center mb-9", title: title })) : null, steps?.length ? (jsxs("div", { className: "box-border", children: [jsx("div", { className: style('flex items-center', paddingX), children: joinList(jsx("div", { className: style('h-0.5 w-full bg-secondary-light', lineOpacity) }))(steps.map(renderStepIcon(styleMap, version))) }), jsx("div", { className: style('flex justify-between mt-4', shortGaps ? 'gap-x-3' : 'gap-x-[101px]'), children: steps.map(renderStep({ styleMap, isMainButton: Boolean(button?.text), version })) })] })) : null, button?.text ? jsx(Button, { className: "mt-8 min-w-60", version: "primary", ...button }) : null] }));
3915
3949
  });
3916
- const renderStepIcon = (styleMap, version) => ({ icon }, i) => (jsx("div", { className: "flex flex-col items-center text-center", children: jsx("div", { className: `h-[100px] w-[100px] min-w-[100px] min-h-[100px] rounded-full p-[26px] box-border z-10 flex justify-center items-center ${styleMap.iconBackground}`, children: checkIsIconRenderable(icon) ? (jsx(ImgInner, { image: getIconWithVersion(icon || {}, version), width: "48", height: "48", asSVG: true })) : (jsx("span", { className: `text-h4 ${styleMap.iconText}`, children: i + 1 })) }) }, String(i)));
3950
+ const renderStepIcon = (styleMap, version) => ({ icon }, i) => (jsx("div", { className: "flex flex-col items-center text-center", children: jsx("div", { className: `h-[100px] w-[100px] min-w-[100px] min-h-[100px] rounded-full p-[26px] box-border z-10 flex justify-center items-center ${styleMap.iconBackground}`, children: checkCanRenderIcon(icon) ? (jsx(ImgInner, { image: getIconWithVersion(icon || {}, version), width: "48", height: "48", asSVG: true })) : (jsx("span", { className: `text-h4 ${styleMap.iconText}`, children: i + 1 })) }) }, String(i)));
3917
3951
 
3918
3952
  const containerStyles = {
3919
3953
  'horizontal-list': 'mx-auto mt-5 w-fit',
@@ -4315,10 +4349,10 @@
4315
4349
  });
4316
4350
  const renderTag = (tag, key) => (jsx("span", { className: "text-m-light py-2 px-2.5 border-solid border rounded-md border-gray", children: tag }, String(key)));
4317
4351
 
4318
- const Tile = JSX(({ title, headingType = 'h3', description, items, buttons, image, isDotted = true, listItemSize = 'M', className = '', tags, children, ...rest }) => (jsx(BlockWrapper, { className: `overflow-hidden p-9 pr-3 box-border ${getTileRightPadding(className)} ${getTileMinHeight(className)} ${className}`, ...rest, children: jsxs(BaseTile, { title: title ? (jsx(Heading, { headingType: headingType, as: "h2", title: title, className: `whitespace-pre-wrap max-w-[600px]` })) : null, buttons: renderButtonsSection(buttons, {
4352
+ const Tile = JSX(({ title, headingType = 'h3', __html, items, buttons, image, isDotted = true, listItemSize = 'M', className = '', tags, children, ...rest }) => (jsx(BlockWrapper, { className: `overflow-hidden p-9 pr-3 box-border ${getTileRightPadding(className)} ${getTileMinHeight(className)} ${className}`, ...rest, children: jsxs(BaseTile, { title: title ? (jsx(Heading, { headingType: headingType, as: "h2", title: title, className: `whitespace-pre-wrap max-w-[600px]` })) : null, buttons: renderButtonsSection(buttons, {
4319
4353
  className: 'mt-8',
4320
4354
  buttonClassName: 'min-w-[158px]',
4321
- }), image: image?.src ? jsx(ImgInner, { className: "mt-auto ml-7", image: image }) : null, children: [description ? (jsx("div", { className: "max-w-[600px] mt-2.5", children: jsx(Paragraph, { size: "text-xl-light", children: description }) })) : null, children, jsx(List, { className: "mt-2.5", itemClassName: "mb-1.5", items: items, isDotted: isDotted, listItemSize: listItemSize }), tags?.length ? jsx(Tags, { tags: tags, className: "mt-5" }) : null] }) })));
4355
+ }), image: image?.src ? jsx(ImgInner, { className: "mt-auto ml-7", image: image }) : null, children: [__html ? (jsx("div", { className: "max-w-[600px] mt-2.5", children: jsx(RichText, { __html: __html }) })) : null, children, jsx(List, { className: "mt-2.5", itemClassName: "mb-1.5", items: items, isDotted: isDotted, listItemSize: listItemSize }), tags?.length ? jsx(Tags, { tags: tags, className: "mt-5" }) : null] }) })));
4322
4356
 
4323
4357
  const alignStyle = {
4324
4358
  left: 'items-start',
@@ -4521,7 +4555,7 @@
4521
4555
  return (jsx("div", { className: "flex items-end absolute bottom-0 right-0 h-full pointer-events-none", children: jsx(LikeControl, { className: "rounded-tl-lg sticky bottom-0 pointer-events-auto" }) }));
4522
4556
  }
4523
4557
 
4524
- const packageVersion = "0.8.9";
4558
+ const packageVersion = "0.8.10";
4525
4559
 
4526
4560
  exports.Blocks = Blocks;
4527
4561
  exports.ContentPage = ContentPage;