@redneckz/wildless-cms-uni-blocks 0.14.430 → 0.14.432

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 (133) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +117 -35
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/bundle/components/CalculatorDeposit/CalculatorDepositContent.d.ts +10 -0
  5. package/bundle/components/CalculatorDeposit/getDepositCalculatorParams.d.ts +5 -0
  6. package/bundle/components/CalculatorDeposit/renderDepositParamsForm.d.ts +5 -0
  7. package/bundle/ui-kit/Calculator/renderRate.d.ts +3 -1
  8. package/dist/components/CalculatorDeposit/CalculatorDeposit.js +31 -26
  9. package/dist/components/CalculatorDeposit/CalculatorDeposit.js.map +1 -1
  10. package/dist/components/CalculatorDeposit/CalculatorDepositContent.d.ts +10 -0
  11. package/dist/components/CalculatorDeposit/getDepositCalculatorParams.d.ts +5 -0
  12. package/dist/components/CalculatorDeposit/getDepositCalculatorParams.js +19 -2
  13. package/dist/components/CalculatorDeposit/getDepositCalculatorParams.js.map +1 -1
  14. package/dist/components/CalculatorDeposit/renderDepositParamsForm.d.ts +5 -0
  15. package/dist/components/CalculatorDeposit/renderDepositParamsForm.js +45 -0
  16. package/dist/components/CalculatorDeposit/renderDepositParamsForm.js.map +1 -0
  17. package/dist/components/CalculatorDeposit/renderDepositResult.js +1 -1
  18. package/dist/components/CalculatorDeposit/renderDepositResult.js.map +1 -1
  19. package/dist/components/Header/DropdownMenu.js +26 -2
  20. package/dist/components/Header/DropdownMenu.js.map +1 -1
  21. package/dist/ui-kit/Calculator/CalculatorStyle.js +3 -3
  22. package/dist/ui-kit/Calculator/CalculatorStyle.js.map +1 -1
  23. package/dist/ui-kit/Calculator/renderBinaryRadioButtonGroup.js +1 -2
  24. package/dist/ui-kit/Calculator/renderBinaryRadioButtonGroup.js.map +1 -1
  25. package/dist/ui-kit/Calculator/renderRate.d.ts +3 -1
  26. package/dist/ui-kit/Calculator/renderRate.js +1 -1
  27. package/dist/ui-kit/Calculator/renderRate.js.map +1 -1
  28. package/lib/common.css +1 -1
  29. package/lib/components/CalculatorDeposit/CalculatorDeposit.fixture.d.ts +1 -0
  30. package/lib/components/CalculatorDeposit/CalculatorDeposit.js +30 -25
  31. package/lib/components/CalculatorDeposit/CalculatorDeposit.js.map +1 -1
  32. package/lib/components/CalculatorDeposit/CalculatorDepositContent.d.ts +10 -0
  33. package/lib/components/CalculatorDeposit/getDepositCalculatorParams.d.ts +5 -0
  34. package/lib/components/CalculatorDeposit/getDepositCalculatorParams.js +19 -2
  35. package/lib/components/CalculatorDeposit/getDepositCalculatorParams.js.map +1 -1
  36. package/lib/components/CalculatorDeposit/renderDepositParamsForm.d.ts +4 -0
  37. package/lib/components/CalculatorDeposit/renderDepositParamsForm.js +42 -0
  38. package/lib/components/CalculatorDeposit/renderDepositParamsForm.js.map +1 -0
  39. package/lib/components/CalculatorDeposit/renderDepositResult.js +1 -1
  40. package/lib/components/CalculatorDeposit/renderDepositResult.js.map +1 -1
  41. package/lib/components/Header/DropdownMenu.js +26 -2
  42. package/lib/components/Header/DropdownMenu.js.map +1 -1
  43. package/lib/ui-kit/Calculator/CalculatorStyle.js +3 -3
  44. package/lib/ui-kit/Calculator/CalculatorStyle.js.map +1 -1
  45. package/lib/ui-kit/Calculator/renderBinaryRadioButtonGroup.js +1 -2
  46. package/lib/ui-kit/Calculator/renderBinaryRadioButtonGroup.js.map +1 -1
  47. package/lib/ui-kit/Calculator/renderRate.d.ts +3 -1
  48. package/lib/ui-kit/Calculator/renderRate.js +1 -1
  49. package/lib/ui-kit/Calculator/renderRate.js.map +1 -1
  50. package/mobile/bundle/bundle.umd.js +93 -33
  51. package/mobile/bundle/bundle.umd.min.js +1 -1
  52. package/mobile/bundle/components/CalculatorDeposit/CalculatorDepositContent.d.ts +10 -0
  53. package/mobile/bundle/components/CalculatorDeposit/getDepositCalculatorParams.d.ts +5 -0
  54. package/mobile/bundle/components/CalculatorDeposit/renderDepositParamsForm.d.ts +5 -0
  55. package/mobile/bundle/ui-kit/Calculator/renderRate.d.ts +3 -1
  56. package/mobile/dist/components/CalculatorDeposit/CalculatorDeposit.js +31 -26
  57. package/mobile/dist/components/CalculatorDeposit/CalculatorDeposit.js.map +1 -1
  58. package/mobile/dist/components/CalculatorDeposit/CalculatorDepositContent.d.ts +10 -0
  59. package/mobile/dist/components/CalculatorDeposit/getDepositCalculatorParams.d.ts +5 -0
  60. package/mobile/dist/components/CalculatorDeposit/getDepositCalculatorParams.js +19 -2
  61. package/mobile/dist/components/CalculatorDeposit/getDepositCalculatorParams.js.map +1 -1
  62. package/mobile/dist/components/CalculatorDeposit/renderDepositParamsForm.d.ts +5 -0
  63. package/mobile/dist/components/CalculatorDeposit/renderDepositParamsForm.js +45 -0
  64. package/mobile/dist/components/CalculatorDeposit/renderDepositParamsForm.js.map +1 -0
  65. package/mobile/dist/components/CalculatorDeposit/renderDepositResult.js +1 -1
  66. package/mobile/dist/components/CalculatorDeposit/renderDepositResult.js.map +1 -1
  67. package/mobile/dist/components/Header/DropdownMenu.js +26 -2
  68. package/mobile/dist/components/Header/DropdownMenu.js.map +1 -1
  69. package/mobile/dist/ui-kit/Calculator/CalculatorStyle.js +3 -3
  70. package/mobile/dist/ui-kit/Calculator/CalculatorStyle.js.map +1 -1
  71. package/mobile/dist/ui-kit/Calculator/renderBinaryRadioButtonGroup.js +1 -2
  72. package/mobile/dist/ui-kit/Calculator/renderBinaryRadioButtonGroup.js.map +1 -1
  73. package/mobile/dist/ui-kit/Calculator/renderRate.d.ts +3 -1
  74. package/mobile/dist/ui-kit/Calculator/renderRate.js +1 -1
  75. package/mobile/dist/ui-kit/Calculator/renderRate.js.map +1 -1
  76. package/mobile/lib/common.css +1 -1
  77. package/mobile/lib/components/CalculatorDeposit/CalculatorDeposit.js +30 -25
  78. package/mobile/lib/components/CalculatorDeposit/CalculatorDeposit.js.map +1 -1
  79. package/mobile/lib/components/CalculatorDeposit/CalculatorDepositContent.d.ts +10 -0
  80. package/mobile/lib/components/CalculatorDeposit/getDepositCalculatorParams.d.ts +5 -0
  81. package/mobile/lib/components/CalculatorDeposit/getDepositCalculatorParams.js +19 -2
  82. package/mobile/lib/components/CalculatorDeposit/getDepositCalculatorParams.js.map +1 -1
  83. package/mobile/lib/components/CalculatorDeposit/renderDepositParamsForm.d.ts +5 -0
  84. package/mobile/lib/components/CalculatorDeposit/renderDepositParamsForm.js +42 -0
  85. package/mobile/lib/components/CalculatorDeposit/renderDepositParamsForm.js.map +1 -0
  86. package/mobile/lib/components/CalculatorDeposit/renderDepositResult.js +1 -1
  87. package/mobile/lib/components/CalculatorDeposit/renderDepositResult.js.map +1 -1
  88. package/mobile/lib/components/Header/DropdownMenu.js +26 -2
  89. package/mobile/lib/components/Header/DropdownMenu.js.map +1 -1
  90. package/mobile/lib/ui-kit/Calculator/CalculatorStyle.js +3 -3
  91. package/mobile/lib/ui-kit/Calculator/CalculatorStyle.js.map +1 -1
  92. package/mobile/lib/ui-kit/Calculator/renderBinaryRadioButtonGroup.js +1 -2
  93. package/mobile/lib/ui-kit/Calculator/renderBinaryRadioButtonGroup.js.map +1 -1
  94. package/mobile/lib/ui-kit/Calculator/renderRate.d.ts +3 -1
  95. package/mobile/lib/ui-kit/Calculator/renderRate.js +1 -1
  96. package/mobile/lib/ui-kit/Calculator/renderRate.js.map +1 -1
  97. package/mobile/src/components/CalculatorDeposit/CalculatorDeposit.tsx +45 -41
  98. package/mobile/src/components/CalculatorDeposit/CalculatorDepositContent.ts +10 -0
  99. package/mobile/src/components/CalculatorDeposit/getDepositCalculatorParams.ts +23 -0
  100. package/mobile/src/components/CalculatorDeposit/renderDepositParamsForm.tsx +59 -0
  101. package/mobile/src/components/CalculatorDeposit/renderDepositResult.tsx +1 -1
  102. package/mobile/src/components/Header/DropdownMenu.tsx +34 -2
  103. package/mobile/src/ui-kit/Calculator/CalculatorStyle.tsx +3 -3
  104. package/mobile/src/ui-kit/Calculator/renderBinaryRadioButtonGroup.tsx +2 -3
  105. package/mobile/src/ui-kit/Calculator/renderRate.tsx +5 -1
  106. package/package.json +1 -1
  107. package/src/components/CalculatorDeposit/CalculatorDeposit.fixture.tsx +20 -0
  108. package/src/components/CalculatorDeposit/CalculatorDeposit.tsx +45 -41
  109. package/src/components/CalculatorDeposit/CalculatorDepositContent.ts +10 -0
  110. package/src/components/CalculatorDeposit/getDepositCalculatorParams.ts +23 -0
  111. package/src/components/CalculatorDeposit/renderDepositParamsForm.tsx +59 -0
  112. package/src/components/CalculatorDeposit/renderDepositResult.tsx +1 -1
  113. package/src/components/Header/DropdownMenu.tsx +34 -2
  114. package/src/ui-kit/Calculator/CalculatorStyle.tsx +3 -3
  115. package/src/ui-kit/Calculator/renderBinaryRadioButtonGroup.tsx +2 -3
  116. package/src/ui-kit/Calculator/renderRate.tsx +5 -1
  117. package/tailwind.config.cjs +1 -1
  118. package/bundle/ui-kit/Breadcrumb.d.ts +0 -6
  119. package/dist/ui-kit/Breadcrumb.d.ts +0 -6
  120. package/dist/ui-kit/Breadcrumb.js +0 -11
  121. package/dist/ui-kit/Breadcrumb.js.map +0 -1
  122. package/lib/ui-kit/Breadcrumb.d.ts +0 -6
  123. package/lib/ui-kit/Breadcrumb.js +0 -9
  124. package/lib/ui-kit/Breadcrumb.js.map +0 -1
  125. package/mobile/bundle/ui-kit/Breadcrumb.d.ts +0 -6
  126. package/mobile/dist/ui-kit/Breadcrumb.d.ts +0 -6
  127. package/mobile/dist/ui-kit/Breadcrumb.js +0 -11
  128. package/mobile/dist/ui-kit/Breadcrumb.js.map +0 -1
  129. package/mobile/lib/ui-kit/Breadcrumb.d.ts +0 -6
  130. package/mobile/lib/ui-kit/Breadcrumb.js +0 -9
  131. package/mobile/lib/ui-kit/Breadcrumb.js.map +0 -1
  132. package/mobile/src/ui-kit/Breadcrumb.tsx +0 -21
  133. package/src/ui-kit/Breadcrumb.tsx +0 -21
@@ -2492,9 +2492,9 @@
2492
2492
  const CalculatorLayout = JSX(({ className, title, children, ...rest }) => (jsxs(BlockWrapper, { className: style('space-y-xl', className), defaultPadding: "p-4xl", ...rest, children: [title ? jsx(Heading, { className: "text-center", title: title }) : null, children] })));
2493
2493
 
2494
2494
  const CalculatorStyle = {
2495
- wrapper: 'flex flex-col justify-between @4xl:flex-row gap-x-m gap-y-7 @xl:gap-y-4xl',
2496
- input: 'flex flex-col @xl:max-w-md gap-2xl border-b border-b-main-divider @xl:border-none pb-3xl @xl:pb-0',
2497
- result: 'flex flex-col gap-y-xl @xl:w-96',
2495
+ wrapper: 'flex flex-col justify-between @4xl:flex-row gap-x-s gap-y-7 @xl:gap-y-4xl',
2496
+ input: 'flex flex-col lg:max-w-80 gap-2xl border-b border-b-main-divider @xl:border-none pb-3xl @xl:pb-0',
2497
+ result: 'flex flex-col gap-y-xl',
2498
2498
  };
2499
2499
 
2500
2500
  const calculatorValueBlockStyle = 'flex justify-between @xl:flex-col';
@@ -2508,7 +2508,7 @@
2508
2508
 
2509
2509
  const UnknownRate = JSX(({ title = 'Ставка', isUnavailableByTerm = false }) => (jsxs("div", { className: "space-y-s", children: [jsx(Text, { size: "text-l", font: "font-light", color: "text-secondary-text", children: title }), jsx(Icon, { className: "w-10 h-10 @5xl:h-auto @5xl:w-40", name: "PercentIcon" }), jsx("div", { className: "w-64", children: isUnavailableByTerm ? (jsxs(Paragraph, { size: "text-xl", font: "font-light", color: "text-primary-text", children: ["\u041F\u0440\u043E\u0446\u0435\u043D\u0442\u043D\u0430\u044F \u0441\u0442\u0430\u0432\u043A\u0430 \u0434\u043B\u044F \u0441\u0440\u043E\u043A\u0430 ", jsx("strong", { children: "1-30 \u0434\u043D\u0435\u0439" }), " \u0443\u0441\u0442\u0430\u043D\u0430\u0432\u043B\u0438\u0432\u0430\u0435\u0442\u0441\u044F \u043F\u0440\u0438 \u043E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u0438 \u0432 \u0411\u0430\u043D\u043A"] })) : (jsx(Paragraph, { size: "text-xl", font: "font-light", color: "text-primary-text", children: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0434\u0440\u0443\u0433\u0443\u044E \u0441\u0443\u043C\u043C\u0443 \u0438\u043B\u0438 \u0441\u0440\u043E\u043A" })) })] })));
2510
2510
 
2511
- const renderRate = ({ title = 'Ставка', rate = 0, unit = '%', fractionDigits = 2, isUnknownRateShown = true, color = 'text-secondary-text', ...rest }) => isUnknownRateShown && rate === 0 ? (jsx(UnknownRate, { title: title, ...rest })) : (jsxs("div", { children: [jsx("div", { className: "hidden @xl:block", children: jsx(Rate, { title: title, rate: rate, unit: unit, fractionDigits: fractionDigits, color: color, ...rest }) }), jsx("div", { className: "@xl:hidden", children: jsx(CalculatorValueBlock, { title: title, value: rate, postfix: unit, fractionDigits: fractionDigits, fixed: true, color: color, ...rest }) })] }));
2511
+ const renderRate = ({ title = 'Ставка', rate = 0, unit = '%', fractionDigits = 2, isUnknownRateShown = true, color = 'text-secondary-text', children, ...rest }) => isUnknownRateShown && rate === 0 ? (jsx(UnknownRate, { title: title, ...rest })) : (jsxs("div", { children: [jsx("div", { className: "hidden @xl:block min-w-96", children: jsx(Rate, { title: title, rate: rate, unit: unit, fractionDigits: fractionDigits, color: color, ...rest }) }), jsx("div", { className: "@xl:hidden", children: jsx(CalculatorValueBlock, { title: title, value: rate, postfix: unit, fractionDigits: fractionDigits, fixed: true, color: color, ...rest }) }), children] }));
2512
2512
 
2513
2513
  const DEFAULT_MONEY_STEP = 1000;
2514
2514
  function renderWantedSumInput({ isShowItems = true, step = DEFAULT_MONEY_STEP, ...rest }) {
@@ -2621,7 +2621,7 @@
2621
2621
  };
2622
2622
  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)))) })));
2623
2623
 
2624
- 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) })] }));
2624
+ const renderBinaryRadioButtonGroup = ({ items, title, mobileTitle = title, orientation = 'horizontal', value, radioGroupClassName, onChange, }) => (jsxs("div", { className: "grid gap-s whitespace-nowrap", 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: radioGroupClassName, onChange: (_) => onChange && onChange(_ === items[0].id) })] }));
2625
2625
 
2626
2626
  const renderPayout = (props) => renderBinaryRadioButtonGroup({
2627
2627
  ...props,
@@ -2631,7 +2631,7 @@
2631
2631
  ],
2632
2632
  });
2633
2633
 
2634
- const renderDepositResult = ({ income, finalSum, buttons, footnotes = [], }) => (jsxs("div", { className: CalculatorStyle.result, children: [jsx(CalculatorValueBlock, { title: "\u0414\u043E\u0445\u043E\u0434 \u0432 \u043A\u043E\u043D\u0446\u0435 \u0441\u0440\u043E\u043A\u0430", value: income, postfix: "\u20BD", prefix: "+" }), jsx(CalculatorValueBlock, { title: "\u0421\u0443\u043C\u043C\u0430 \u0432 \u043A\u043E\u043D\u0446\u0435 \u0441\u0440\u043E\u043A\u0430", value: finalSum, postfix: "\u20BD" }), renderButtonsSection(buttons, { isVertical: true }), footnotes?.map(renderFootnote)] }));
2634
+ const renderDepositResult = ({ income, finalSum, buttons = [], footnotes = [], }) => (jsxs("div", { className: CalculatorStyle.result, children: [jsx(CalculatorValueBlock, { title: "\u0414\u043E\u0445\u043E\u0434 \u0432 \u043A\u043E\u043D\u0446\u0435 \u0441\u0440\u043E\u043A\u0430", value: income, postfix: "\u20BD", prefix: "+" }), jsx(CalculatorValueBlock, { title: "\u0421\u0443\u043C\u043C\u0430 \u0432 \u043A\u043E\u043D\u0446\u0435 \u0441\u0440\u043E\u043A\u0430", value: finalSum, postfix: "\u20BD" }), renderButtonsSection(buttons, { isVertical: true }), footnotes?.map(renderFootnote)] }));
2635
2635
 
2636
2636
  const getLimitRangeByKeys = ([minKey, maxKey], limitParams, rateRows = []) => limitParams && limitParams[minKey] && limitParams[maxKey]
2637
2637
  ? {
@@ -3012,6 +3012,9 @@
3012
3012
  rate: 0,
3013
3013
  isMonthlyInterestPayment: true,
3014
3014
  isRemoteRegistration: true,
3015
+ isReplenish: false,
3016
+ isWithdrawn: false,
3017
+ type: '',
3015
3018
  };
3016
3019
  const getDepositCalculatorParams = (userInputParams, calcSource, paramsViewSettings) => {
3017
3020
  const { moneyValue, monthsValue } = userInputParams;
@@ -3020,12 +3023,26 @@
3020
3023
  : 0;
3021
3024
  const isExcludeMonthlyInterestPayment = !paramsViewSettings?.isShowMonthlyInterestPayment;
3022
3025
  const isExcludeRemoteRegistration = !paramsViewSettings?.isShowRemoteRegistration;
3026
+ const isExcludeReplenish = !paramsViewSettings?.isShowReplenish;
3027
+ const isExcludeWithdrawn = !paramsViewSettings?.isShowWithdrawn;
3023
3028
  const depositCalculatorSourceBookParams = calcSource?.rateRows?.find((row) => checkRowByParam({
3024
3029
  row,
3025
3030
  userInputParams,
3026
- paramKey: 'isMonthlyInterestPayment',
3027
- isExclude: isExcludeMonthlyInterestPayment,
3031
+ paramKey: 'isReplenish',
3032
+ isExclude: isExcludeReplenish,
3028
3033
  }) &&
3034
+ checkRowByParam({
3035
+ row,
3036
+ userInputParams,
3037
+ paramKey: 'isWithdrawn',
3038
+ isExclude: isExcludeWithdrawn,
3039
+ }) &&
3040
+ checkRowByParam({
3041
+ row,
3042
+ userInputParams,
3043
+ paramKey: 'isMonthlyInterestPayment',
3044
+ isExclude: isExcludeMonthlyInterestPayment,
3045
+ }) &&
3029
3046
  checkRowByParam({
3030
3047
  row,
3031
3048
  userInputParams,
@@ -3072,22 +3089,64 @@
3072
3089
  ],
3073
3090
  });
3074
3091
 
3092
+ const renderDepositParamsForm = (params, field) => (jsxs("div", { className: "grid gap-lg", children: [jsxs("div", { className: "flex gap-lg", children: [params.isShowReplenish
3093
+ ? renderBinaryRadioButtonGroup({
3094
+ title: 'Пополнение',
3095
+ ...field('isReplenish'),
3096
+ value: params.isReplenish,
3097
+ orientation: 'vertical',
3098
+ items: [
3099
+ { id: 'withReplenish', text: 'С пополнением' },
3100
+ { id: 'withoutReplenish', text: 'Без пополнения' },
3101
+ ],
3102
+ })
3103
+ : null, params.isShowWithdrawn
3104
+ ? renderBinaryRadioButtonGroup({
3105
+ title: 'Снятие',
3106
+ ...field('isWithdrawn'),
3107
+ value: params.isWithdrawn,
3108
+ orientation: 'vertical',
3109
+ items: [
3110
+ { id: 'wthDrawn', text: 'Со снятием' },
3111
+ { id: 'noWithdrawn', text: 'Без снятия' },
3112
+ ],
3113
+ })
3114
+ : null] }), jsx("div", { className: "border-b border-main-divider w-full" }), jsxs("div", { className: "flex gap-lg", children: [params.isShowMonthlyInterestPayment
3115
+ ? renderPayout({
3116
+ title: 'Выплата процентов',
3117
+ ...field('isMonthlyInterestPayment'),
3118
+ value: params.isMonthlyInterestPayment,
3119
+ orientation: 'vertical',
3120
+ })
3121
+ : null, params.isShowRemoteRegistration
3122
+ ? renderRegistrationType({
3123
+ title: 'Оформление',
3124
+ ...field('isRemoteRegistration'),
3125
+ value: params.isRemoteRegistration,
3126
+ orientation: 'vertical',
3127
+ })
3128
+ : null] })] }));
3129
+
3075
3130
  const MAP = {
3076
3131
  isMonthlyInterestPayment: 'isMonthlyInterestPayment',
3077
3132
  isRemoteRegistration: 'isRemoteRegistration',
3133
+ isReplenish: 'isReplenish',
3134
+ isWithdrawn: 'isWithdrawn',
3078
3135
  moneyValue: 'minSum',
3079
3136
  };
3080
3137
  const DEPOSIT_DEFAULT_SUM = 20000;
3081
- const CalculatorDeposit = UniBlock(({ className, title, calcSource, buttons, footnote, paramsViewSettings, defaultParams, ...rest }) => {
3138
+ const CalculatorDeposit = UniBlock(({ className, title, calcSource, buttons = [], footnote = '', paramsViewSettings, defaultParams, ...rest }) => {
3082
3139
  const defParams = getDefaultParamsMax(calcSource?.rateRows);
3083
3140
  const [userInputParams, { field }] = useForm({
3084
3141
  moneyValue: getMoneyDefaultValue(defaultParams, DEPOSIT_DEFAULT_SUM),
3085
3142
  monthsValue: getMonthsDefaultValue(defaultParams),
3086
3143
  isMonthlyInterestPayment: Boolean(defaultParams?.isMonthlyInterestPayment),
3087
3144
  isRemoteRegistration: Boolean(defaultParams?.isRemoteRegistration),
3145
+ isReplenish: false,
3146
+ isWithdrawn: Boolean(defaultParams?.isWithdrawn ?? false),
3088
3147
  });
3089
3148
  const calcParams = getDepositCalculatorParams(userInputParams, calcSource, paramsViewSettings);
3090
- const { defaultMonth, rate, income, finalSum } = calcParams;
3149
+ const { defaultMonth, rate, income, finalSum, type = '' } = calcParams;
3091
3150
  const { onChange: setMonthsValue } = field('monthsValue');
3092
3151
  const { onChange: setMoneyValue } = field('moneyValue');
3093
3152
  useEffect(() => {
@@ -3097,17 +3156,19 @@
3097
3156
  setMoneyValue &&
3098
3157
  setMoneyValue(clamp(userInputParams.moneyValue, calcParams.minSum, calcParams.maxSum));
3099
3158
  }, [calcParams.minSum, calcParams.maxSum]);
3159
+ const handleDefaultParamsCals = () => setDefaultParamsCalc({
3160
+ field,
3161
+ defParams: defParams,
3162
+ calcParams,
3163
+ monthsValue: 'minMonths',
3164
+ map: MAP,
3165
+ });
3100
3166
  useEffect(() => {
3101
3167
  if (!isDefaultParams(defaultParams) && defParams) {
3102
- setDefaultParamsCalc({
3103
- field,
3104
- defParams: defParams,
3105
- calcParams,
3106
- monthsValue: 'minMonths',
3107
- map: MAP,
3108
- });
3168
+ handleDefaultParamsCals();
3109
3169
  }
3110
3170
  }, [calcSource, defaultParams]);
3171
+ const isMaxRate = rate === defParams?.rate;
3111
3172
  return (jsx(CalculatorLayout, { className: className, title: title, ...rest, children: jsxs("section", { className: style(CalculatorStyle.wrapper, className), children: [jsxs("div", { className: CalculatorStyle.input, children: [renderWantedSumInput({
3112
3173
  title: 'Сумма, ₽',
3113
3174
  min: calcParams.minSum,
@@ -3123,21 +3184,20 @@
3123
3184
  value: calcParams.monthsValue,
3124
3185
  }), renderDepositParamsForm({ ...calcParams, ...paramsViewSettings }, field)] }), renderRate({
3125
3186
  rate,
3126
- }), renderDepositResult({ income, finalSum, buttons, footnotes: [footnote] })] }) }));
3127
- });
3128
- const renderDepositParamsForm = (params, field) => (jsxs("div", { className: "flex flex-col gap-y-2xl", children: [params.isShowMonthlyInterestPayment
3129
- ? renderPayout({
3130
- title: 'Выплата процентов',
3131
- ...field('isMonthlyInterestPayment'),
3132
- value: params.isMonthlyInterestPayment,
3133
- })
3134
- : null, params.isShowRemoteRegistration
3135
- ? renderRegistrationType({
3136
- title: 'Оформление',
3137
- ...field('isRemoteRegistration'),
3138
- value: params.isRemoteRegistration,
3139
- })
3140
- : null] }));
3187
+ children: renderMaxRateButton(handleDefaultParamsCals, isMaxRate),
3188
+ }), renderDepositResult({
3189
+ income,
3190
+ finalSum,
3191
+ buttons: [...buttons, getTariffButton(calcSource?.buttons, type)],
3192
+ footnotes: [footnote],
3193
+ })] }) }));
3194
+ });
3195
+ const getTariffButton = (buttons = [], btnType = '') => {
3196
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
3197
+ const { type, ...button } = buttons.find((_) => _.type === btnType) ?? {};
3198
+ return button;
3199
+ };
3200
+ const renderMaxRateButton = (handleDefaultParamsCals, isMaxRate = false) => isMaxRate ? null : (jsx(Button, { type: "button", version: "secondary", onClick: handleDefaultParamsCals, children: "\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u043C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0443\u044E \u0441\u0442\u0430\u0432\u043A\u0443" }));
3141
3201
 
3142
3202
  const checkRefinancingSourceBookRowCommonParams = (props) => checkRowParam({
3143
3203
  ...props,
@@ -4320,9 +4380,31 @@
4320
4380
  const DropdownMenu = JSX(({ className = '', items, activeItem, ariaLabel }) => {
4321
4381
  const [isVisible, { setFalse, toggle }] = useBool(false);
4322
4382
  const ref = useOutsideClick(setFalse);
4323
- return (jsxs("div", { className: style(isVisible ? 'bg-white rounded-md shadow-blue-gray' : '', className), ref: ref, role: "navigation", children: [jsx("button", { type: "button", className: "group/btn flex justify-between items-center h-6", "aria-label": ariaLabel, onClick: toggle, children: Array(3)
4383
+ const dropdownRef = useRef(null);
4384
+ const changeDropdownPosition = useCallback((isOpened, buttonRef, menuRef) => {
4385
+ if (isOpened) {
4386
+ const dropdownRect = menuRef?.current?.getBoundingClientRect();
4387
+ const dropdownButtonRect = buttonRef?.current?.getBoundingClientRect();
4388
+ if (menuRef.current && dropdownRect && dropdownButtonRect) {
4389
+ if (dropdownRect?.right >= globalThis.innerWidth) {
4390
+ menuRef.current.style.left = `${globalThis.innerWidth - dropdownRect.width}px`;
4391
+ }
4392
+ else if (dropdownButtonRect?.left > dropdownRect.left) {
4393
+ menuRef.current.style.left = `${globalThis.innerWidth - dropdownRect.width}px`;
4394
+ }
4395
+ else {
4396
+ menuRef.current.style.left = '';
4397
+ }
4398
+ }
4399
+ }
4400
+ }, [isVisible]);
4401
+ useEventListener(globalThis, 'resize', () => changeDropdownPosition(isVisible, ref, dropdownRef));
4402
+ useEffect(() => {
4403
+ changeDropdownPosition(isVisible, ref, dropdownRef);
4404
+ }, [isVisible]);
4405
+ return (jsxs("div", { className: style(isVisible ? 'rounded-md shadow-blue-gray' : '', className), ref: ref, role: "navigation", children: [jsx("button", { type: "button", className: "group/btn flex justify-between items-center h-6", "aria-label": ariaLabel, onClick: toggle, children: Array(3)
4324
4406
  .fill(null)
4325
- .map((_, i) => (jsx("div", { className: "w-[3px] h-[3px] rounded mr-2xs bg-primary-text group-hover/btn:bg-primary-hover group-data-transparent:bg-white" }, String(i)))) }), jsx("div", { className: style('absolute flex flex-col rounded-md bg-white p-xl pb-xs w-56 z-40 translate-x-[-100%]', isVisible ? '' : 'hidden'), "aria-hidden": !isVisible, children: items?.map((item, i) => (jsx(DropdownMenuItem, { isActive: item === activeItem, ...item }, item?.text ?? String(i)))) })] }));
4407
+ .map((_, i) => (jsx("div", { className: "w-[3px] h-[3px] rounded mr-2xs bg-primary-text group-hover/btn:bg-primary-hover group-data-transparent:bg-white" }, String(i)))) }), jsx("div", { ref: dropdownRef, className: style('absolute flex flex-col rounded-md bg-white p-xl pb-xs w-56 z-40', isVisible ? '' : 'hidden'), "aria-hidden": !isVisible, children: items?.map((item, i) => (jsx(DropdownMenuItem, { isActive: item === activeItem, ...item }, item?.text ?? String(i)))) })] }));
4326
4408
  });
4327
4409
  const DropdownMenuItem = JSX(({ isActive, ...rest }) => {
4328
4410
  const link = useLink();
@@ -6430,7 +6512,7 @@
6430
6512
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
6431
6513
  });
6432
6514
 
6433
- const packageVersion = "0.14.429";
6515
+ const packageVersion = "0.14.431";
6434
6516
 
6435
6517
  exports.Blocks = Blocks;
6436
6518
  exports.ContentPage = ContentPage;