@redneckz/wildless-cms-uni-blocks 0.13.7 → 0.13.9

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 (156) hide show
  1. package/bin/migration-scripts/0.13.9.js +59 -0
  2. package/bundle/blocks.schema.json +1 -1
  3. package/bundle/bundle.umd.js +60 -57
  4. package/bundle/bundle.umd.min.js +1 -1
  5. package/bundle/components/Calculator/UnknownRate.d.ts +1 -0
  6. package/bundle/components/Calculator/renderRate.d.ts +2 -1
  7. package/bundle/components/Calculator/useBusinessDepositCalculatorParams.d.ts +1 -1
  8. package/bundle/components/Carousel/CarouselContent.d.ts +2 -2
  9. package/bundle/components/DepositFiltration/DepositFiltrationContent.d.ts +2 -2
  10. package/dist/components/Calculator/BusinessDepositCalculatorForm.js +9 -9
  11. package/dist/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
  12. package/dist/components/Calculator/RefinancingCalculatorForm.js +6 -3
  13. package/dist/components/Calculator/RefinancingCalculatorForm.js.map +1 -1
  14. package/dist/components/Calculator/UnknownRate.d.ts +1 -0
  15. package/dist/components/Calculator/UnknownRate.js +1 -1
  16. package/dist/components/Calculator/UnknownRate.js.map +1 -1
  17. package/dist/components/Calculator/constants.js +2 -2
  18. package/dist/components/Calculator/constants.js.map +1 -1
  19. package/dist/components/Calculator/renderRate.d.ts +2 -1
  20. package/dist/components/Calculator/renderRate.js +5 -5
  21. package/dist/components/Calculator/renderRate.js.map +1 -1
  22. package/dist/components/Calculator/useBusinessDepositCalculatorParams.d.ts +1 -1
  23. package/dist/components/Calculator/useBusinessDepositCalculatorParams.js +1 -1
  24. package/dist/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
  25. package/dist/components/Calculator/useCreditCalculatorParams.js +1 -4
  26. package/dist/components/Calculator/useCreditCalculatorParams.js.map +1 -1
  27. package/dist/components/Calculator/useRefinancingCalculatorParams.js +4 -11
  28. package/dist/components/Calculator/useRefinancingCalculatorParams.js.map +1 -1
  29. package/dist/components/Carousel/CarouselContent.d.ts +2 -2
  30. package/dist/components/Carousel/renderCarouselCards.js +1 -0
  31. package/dist/components/Carousel/renderCarouselCards.js.map +1 -1
  32. package/dist/components/DepositFiltration/DepositFiltration.js +14 -8
  33. package/dist/components/DepositFiltration/DepositFiltration.js.map +1 -1
  34. package/dist/components/DepositFiltration/DepositFiltrationContent.d.ts +2 -2
  35. package/dist/ui-kit/InputRange/renderRangeWithTicks.js +2 -1
  36. package/dist/ui-kit/InputRange/renderRangeWithTicks.js.map +1 -1
  37. package/lib/common.css +1 -1
  38. package/lib/components/Calculator/BusinessDepositCalculatorForm.js +9 -9
  39. package/lib/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
  40. package/lib/components/Calculator/RefinancingCalculatorForm.js +6 -3
  41. package/lib/components/Calculator/RefinancingCalculatorForm.js.map +1 -1
  42. package/lib/components/Calculator/UnknownRate.d.ts +1 -0
  43. package/lib/components/Calculator/UnknownRate.js +1 -1
  44. package/lib/components/Calculator/UnknownRate.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/renderRate.d.ts +2 -1
  48. package/lib/components/Calculator/renderRate.js +5 -5
  49. package/lib/components/Calculator/renderRate.js.map +1 -1
  50. package/lib/components/Calculator/useBusinessDepositCalculatorParams.d.ts +1 -1
  51. package/lib/components/Calculator/useBusinessDepositCalculatorParams.js +1 -1
  52. package/lib/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
  53. package/lib/components/Calculator/useCreditCalculatorParams.js +1 -4
  54. package/lib/components/Calculator/useCreditCalculatorParams.js.map +1 -1
  55. package/lib/components/Calculator/useRefinancingCalculatorParams.js +4 -11
  56. package/lib/components/Calculator/useRefinancingCalculatorParams.js.map +1 -1
  57. package/lib/components/Carousel/CarouselContent.d.ts +2 -2
  58. package/lib/components/Carousel/renderCarouselCards.js +1 -0
  59. package/lib/components/Carousel/renderCarouselCards.js.map +1 -1
  60. package/lib/components/DepositFiltration/DepositFiltration.js +14 -8
  61. package/lib/components/DepositFiltration/DepositFiltration.js.map +1 -1
  62. package/lib/components/DepositFiltration/DepositFiltrationContent.d.ts +2 -2
  63. package/lib/ui-kit/InputRange/renderRangeWithTicks.js +2 -1
  64. package/lib/ui-kit/InputRange/renderRangeWithTicks.js.map +1 -1
  65. package/mobile/bundle/bundle.umd.js +46 -49
  66. package/mobile/bundle/bundle.umd.min.js +1 -1
  67. package/mobile/bundle/components/Calculator/UnknownRate.d.ts +1 -0
  68. package/mobile/bundle/components/Calculator/renderRate.d.ts +2 -1
  69. package/mobile/bundle/components/Calculator/useBusinessDepositCalculatorParams.d.ts +1 -1
  70. package/mobile/bundle/components/Carousel/CarouselContent.d.ts +2 -2
  71. package/mobile/bundle/components/DepositFiltration/DepositFiltrationContent.d.ts +2 -2
  72. package/mobile/dist/components/Calculator/BusinessDepositCalculatorForm.js +9 -9
  73. package/mobile/dist/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
  74. package/mobile/dist/components/Calculator/RefinancingCalculatorForm.js +6 -3
  75. package/mobile/dist/components/Calculator/RefinancingCalculatorForm.js.map +1 -1
  76. package/mobile/dist/components/Calculator/UnknownRate.d.ts +1 -0
  77. package/mobile/dist/components/Calculator/UnknownRate.js +1 -1
  78. package/mobile/dist/components/Calculator/UnknownRate.js.map +1 -1
  79. package/mobile/dist/components/Calculator/constants.js +2 -2
  80. package/mobile/dist/components/Calculator/constants.js.map +1 -1
  81. package/mobile/dist/components/Calculator/renderRate.d.ts +2 -1
  82. package/mobile/dist/components/Calculator/renderRate.js +5 -5
  83. package/mobile/dist/components/Calculator/renderRate.js.map +1 -1
  84. package/mobile/dist/components/Calculator/useBusinessDepositCalculatorParams.d.ts +1 -1
  85. package/mobile/dist/components/Calculator/useBusinessDepositCalculatorParams.js +1 -1
  86. package/mobile/dist/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
  87. package/mobile/dist/components/Calculator/useCreditCalculatorParams.js +1 -4
  88. package/mobile/dist/components/Calculator/useCreditCalculatorParams.js.map +1 -1
  89. package/mobile/dist/components/Calculator/useRefinancingCalculatorParams.js +4 -11
  90. package/mobile/dist/components/Calculator/useRefinancingCalculatorParams.js.map +1 -1
  91. package/mobile/dist/components/Carousel/CarouselContent.d.ts +2 -2
  92. package/mobile/dist/components/Carousel/renderCarouselCards.js +1 -0
  93. package/mobile/dist/components/Carousel/renderCarouselCards.js.map +1 -1
  94. package/mobile/dist/components/DepositFiltration/DepositFiltration.js +14 -8
  95. package/mobile/dist/components/DepositFiltration/DepositFiltration.js.map +1 -1
  96. package/mobile/dist/components/DepositFiltration/DepositFiltrationContent.d.ts +2 -2
  97. package/mobile/dist/ui-kit/InputRange/renderRangeWithTicks.js +2 -1
  98. package/mobile/dist/ui-kit/InputRange/renderRangeWithTicks.js.map +1 -1
  99. package/mobile/lib/common.css +1 -1
  100. package/mobile/lib/components/Calculator/BusinessDepositCalculatorForm.js +9 -9
  101. package/mobile/lib/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
  102. package/mobile/lib/components/Calculator/RefinancingCalculatorForm.js +6 -3
  103. package/mobile/lib/components/Calculator/RefinancingCalculatorForm.js.map +1 -1
  104. package/mobile/lib/components/Calculator/UnknownRate.d.ts +1 -0
  105. package/mobile/lib/components/Calculator/UnknownRate.js +1 -1
  106. package/mobile/lib/components/Calculator/UnknownRate.js.map +1 -1
  107. package/mobile/lib/components/Calculator/constants.js +2 -2
  108. package/mobile/lib/components/Calculator/constants.js.map +1 -1
  109. package/mobile/lib/components/Calculator/renderRate.d.ts +2 -1
  110. package/mobile/lib/components/Calculator/renderRate.js +5 -5
  111. package/mobile/lib/components/Calculator/renderRate.js.map +1 -1
  112. package/mobile/lib/components/Calculator/useBusinessDepositCalculatorParams.d.ts +1 -1
  113. package/mobile/lib/components/Calculator/useBusinessDepositCalculatorParams.js +1 -1
  114. package/mobile/lib/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
  115. package/mobile/lib/components/Calculator/useCreditCalculatorParams.js +1 -4
  116. package/mobile/lib/components/Calculator/useCreditCalculatorParams.js.map +1 -1
  117. package/mobile/lib/components/Calculator/useRefinancingCalculatorParams.js +4 -11
  118. package/mobile/lib/components/Calculator/useRefinancingCalculatorParams.js.map +1 -1
  119. package/mobile/lib/components/Carousel/CarouselContent.d.ts +2 -2
  120. package/mobile/lib/components/Carousel/renderCarouselCards.js +1 -0
  121. package/mobile/lib/components/Carousel/renderCarouselCards.js.map +1 -1
  122. package/mobile/lib/components/DepositFiltration/DepositFiltration.js +14 -8
  123. package/mobile/lib/components/DepositFiltration/DepositFiltration.js.map +1 -1
  124. package/mobile/lib/components/DepositFiltration/DepositFiltrationContent.d.ts +2 -2
  125. package/mobile/lib/ui-kit/InputRange/renderRangeWithTicks.js +2 -1
  126. package/mobile/lib/ui-kit/InputRange/renderRangeWithTicks.js.map +1 -1
  127. package/mobile/src/components/Calculator/BusinessDepositCalculatorForm.tsx +11 -11
  128. package/mobile/src/components/Calculator/RefinancingCalculatorForm.tsx +6 -9
  129. package/mobile/src/components/Calculator/UnknownRate.tsx +24 -14
  130. package/mobile/src/components/Calculator/constants.ts +2 -2
  131. package/mobile/src/components/Calculator/renderRate.tsx +13 -6
  132. package/mobile/src/components/Calculator/useBusinessDepositCalculatorParams.ts +2 -2
  133. package/mobile/src/components/Calculator/useCreditCalculatorParams.ts +1 -5
  134. package/mobile/src/components/Calculator/useRefinancingCalculatorParams.ts +5 -23
  135. package/mobile/src/components/Carousel/CarouselContent.ts +2 -2
  136. package/mobile/src/components/Carousel/renderCarouselCards.tsx +1 -0
  137. package/mobile/src/components/DepositFiltration/DepositFiltration.example.json +11 -1
  138. package/mobile/src/components/DepositFiltration/DepositFiltration.tsx +18 -12
  139. package/mobile/src/components/DepositFiltration/DepositFiltrationContent.ts +1 -2
  140. package/mobile/src/ui-kit/InputRange/renderRangeWithTicks.tsx +2 -1
  141. package/package.json +1 -1
  142. package/src/components/Calculator/BusinessDepositCalculatorForm.tsx +11 -11
  143. package/src/components/Calculator/RefinancingCalculatorForm.tsx +6 -9
  144. package/src/components/Calculator/UnknownRate.tsx +24 -14
  145. package/src/components/Calculator/constants.ts +2 -2
  146. package/src/components/Calculator/renderRate.tsx +13 -6
  147. package/src/components/Calculator/useBusinessDepositCalculatorParams.ts +2 -2
  148. package/src/components/Calculator/useCreditCalculatorParams.ts +1 -5
  149. package/src/components/Calculator/useRefinancingCalculatorParams.ts +5 -23
  150. package/src/components/Carousel/CarouselContent.ts +2 -2
  151. package/src/components/Carousel/renderCarouselCards.tsx +1 -0
  152. package/src/components/DepositFiltration/DepositFiltration.example.json +11 -1
  153. package/src/components/DepositFiltration/DepositFiltration.fixture.tsx +21 -8
  154. package/src/components/DepositFiltration/DepositFiltration.tsx +18 -12
  155. package/src/components/DepositFiltration/DepositFiltrationContent.ts +1 -2
  156. package/src/ui-kit/InputRange/renderRangeWithTicks.tsx +2 -1
@@ -1,18 +1,25 @@
1
- import { UnknownRate } from './UnknownRate';
2
- import { Rate } from './Rate';
3
1
  import { CalculatorValueBlock } from './CalculatorValueBlock';
2
+ import { Rate } from './Rate';
3
+ import { UnknownRate } from './UnknownRate';
4
4
 
5
5
  interface RenderRateProps {
6
6
  rate: number;
7
7
  depositeName?: string;
8
- isShowUnknownRate?: boolean;
8
+ isUnavailableByTerm?: boolean;
9
9
  isShowDepositeName?: boolean;
10
+ fractionDigits?: number;
10
11
  }
11
12
 
12
- const renderDesktopRate = ({ rate, depositeName, isShowDepositeName }: RenderRateProps) => (
13
+ const renderDesktopRate = ({
14
+ rate,
15
+ depositeName,
16
+ fractionDigits,
17
+ isShowDepositeName,
18
+ }: RenderRateProps) => (
13
19
  <Rate
14
20
  rate={rate}
15
21
  depositeName={depositeName}
22
+ fractionDigits={fractionDigits}
16
23
  isShowDepositeName={isShowDepositeName}
17
24
  rateBlockClassName="tracking-[-25px]"
18
25
  unit="%"
@@ -24,8 +31,8 @@ const renderMobileRate = ({ rate }: RenderRateProps) => (
24
31
  );
25
32
 
26
33
  export const renderRate = (props: RenderRateProps) => {
27
- if (props.isShowUnknownRate) {
28
- return <UnknownRate />;
34
+ if (props.rate === 0) {
35
+ return <UnknownRate isUnavailableByTerm={props.isUnavailableByTerm} />;
29
36
  }
30
37
 
31
38
  return (
@@ -34,7 +34,7 @@ export interface BusinessDepositCalculatorParams
34
34
  income?: number;
35
35
  finalSum?: number;
36
36
  isDisabledOperatingDeposit?: boolean;
37
- isShowUnknownRate?: boolean;
37
+ isUnavailableByTerm?: boolean;
38
38
  }
39
39
 
40
40
  export type BusinessDepositCalculatorData = {
@@ -66,7 +66,7 @@ export const useBusinessDepositCalculatorParams = (
66
66
  ...DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS,
67
67
  ...userInputParams,
68
68
  isDisabledOperatingDeposit,
69
- isShowUnknownRate: true,
69
+ isUnavailableByTerm: true,
70
70
  };
71
71
  }
72
72
  const businessDepositCalculatorSourceBookParams =
@@ -1,5 +1,4 @@
1
1
  import { useMemo } from '@redneckz/uni-jsx/lib/hooks';
2
- import { clamp } from '../../utils/clamp';
3
2
  import type { CreditCalculatorParamsViewSettings } from './CalculatorContent';
4
3
  import { CREDIT_CALC_DEFAULT_DIR, DEFAULT_CREDIT_CALCULATOR_PARAMS } from './constants';
5
4
  import { getCreditCalculatorLimitParams } from './getCreditCalculatorLimitParams';
@@ -51,7 +50,7 @@ export const useCreditCalculatorParams = (
51
50
  sourceBookDir?: string,
52
51
  paramsViewSettings?: CreditCalculatorParamsViewSettings,
53
52
  ): CreditCalculatorParams => {
54
- let { moneyValue, monthsValue } = userInputParams;
53
+ const { moneyValue, monthsValue } = userInputParams;
55
54
  const data = useCalculatorParams<CreditCalculatorData>(sourceBookDir || CREDIT_CALC_DEFAULT_DIR);
56
55
  const rateRows = data?.rateRows || [DEFAULT_CREDIT_CALCULATOR_PARAMS];
57
56
  const limitRows = data?.limitRows || [];
@@ -72,9 +71,6 @@ export const useCreditCalculatorParams = (
72
71
  rateRows,
73
72
  );
74
73
 
75
- moneyValue = clamp(moneyValue, minSum, maxSum);
76
- monthsValue = clamp(monthsValue, minMonths, maxMonths);
77
-
78
74
  const creditCalculatorRateParams = getCreditCalculatorRateParams({
79
75
  rateRows,
80
76
  userInputParams,
@@ -1,12 +1,11 @@
1
1
  import { useMemo } from '@redneckz/uni-jsx/lib/hooks';
2
- import { clamp } from '../../utils/clamp';
3
- import { DEFAULT_REFINANCING_CALCULATOR_PARAMS, REFINANCING_CALC_DEFAULT_DIR } from './constants';
4
- import { getLimitRangeByKeys } from './rangeHelpers';
5
- import { useCalculatorParams } from './useCalculatorParams';
6
2
  import { RefinancingCalculatorParamsViewSettings } from './CalculatorContent';
3
+ import { DEFAULT_REFINANCING_CALCULATOR_PARAMS, REFINANCING_CALC_DEFAULT_DIR } from './constants';
4
+ import { getMonthlyPayment } from './getMonthlyPayment';
7
5
  import { getRefinancingCalculatorLimitParams } from './getRefinancingCalculatorLimitParams';
8
6
  import { getRefinancingCalculatorRateParams } from './getRefinancingCalculatorRateParams';
9
- import { getMonthlyPayment } from './getMonthlyPayment';
7
+ import { getLimitRangeByKeys } from './rangeHelpers';
8
+ import { useCalculatorParams } from './useCalculatorParams';
10
9
 
11
10
  export interface CommonRefinancingParams {
12
11
  isSalaryClient: boolean;
@@ -61,7 +60,7 @@ export const useRefinancingCalculatorParams = (
61
60
  sourceBookDir?: string,
62
61
  paramsViewSettings?: RefinancingCalculatorParamsViewSettings,
63
62
  ): RefinancingCalculatorParams => {
64
- let { moneyValue, monthsValue, oldMonthlyPayment, moneyExtra } = userInputParams;
63
+ const { moneyValue, monthsValue, oldMonthlyPayment, moneyExtra } = userInputParams;
65
64
  const data = useCalculatorParams<RefinancingCalculatorData>(
66
65
  sourceBookDir || REFINANCING_CALC_DEFAULT_DIR,
67
66
  );
@@ -79,29 +78,12 @@ export const useRefinancingCalculatorParams = (
79
78
  rateRows,
80
79
  );
81
80
 
82
- const { minSumOld, maxSumOld } = getLimitRangeByKeys(
83
- ['minSumOld', 'maxSumOld'],
84
- sourceBookLimitParams,
85
- rateRows,
86
- );
87
-
88
- const { minSumExtra, maxSumExtra } = getLimitRangeByKeys(
89
- ['minSumExtra', 'maxSumExtra'],
90
- sourceBookLimitParams,
91
- rateRows,
92
- );
93
-
94
81
  const { minMonths, maxMonths } = getLimitRangeByKeys(
95
82
  ['minMonths', 'maxMonths'],
96
83
  sourceBookLimitParams,
97
84
  rateRows,
98
85
  );
99
86
 
100
- moneyValue = clamp(moneyValue, minSum, maxSum);
101
- oldMonthlyPayment = clamp(oldMonthlyPayment, minSumOld, maxSumOld);
102
- moneyExtra = clamp(moneyExtra, minSumExtra, maxSumExtra);
103
- monthsValue = clamp(monthsValue, minMonths, maxMonths);
104
-
105
87
  const refinancingCalculatorSourceBookRateParams = getRefinancingCalculatorRateParams({
106
88
  rateRows,
107
89
  userInputParams,
@@ -2,9 +2,9 @@ import type { UniBlockContent } from '../../model/JSXBlock';
2
2
 
3
3
  /**
4
4
  * @title Размер карточек
5
- * @enumNames ["Нормальный", "Большой"]
5
+ * @enumNames ["Маленький", "Нормальный", "Большой"]
6
6
  */
7
- export type CardSizeMode = 'normal' | 'big';
7
+ export type CardSizeMode = 'small' | 'normal' | 'big';
8
8
 
9
9
  /**
10
10
  * @title Карусель
@@ -10,6 +10,7 @@ import type { CardSizeMode } from './CarouselContent';
10
10
  const cardBaseStyle = 'relative h-full';
11
11
 
12
12
  const CARD_SIZE_MAP: Record<CardSizeMode, string> = {
13
+ small: 'sm:min-w-64',
13
14
  normal: 'sm:min-w-96',
14
15
  big: 'sm:min-w-[515px]',
15
16
  };
@@ -30,7 +30,17 @@
30
30
  },
31
31
  "sum": {
32
32
  "title": "Сумма",
33
- "type": "number"
33
+ "type": "object",
34
+ "properties": {
35
+ "min": {
36
+ "title": "Минимум",
37
+ "type": "number"
38
+ },
39
+ "max": {
40
+ "title": "Максимум",
41
+ "type": "number"
42
+ }
43
+ }
34
44
  },
35
45
  "period": {
36
46
  "title": "Срок",
@@ -78,7 +78,17 @@ const SCHEMA: DepositFiltrationContent['filtrationSchema'] = {
78
78
  },
79
79
  sum: {
80
80
  title: 'Сумма',
81
- type: 'number',
81
+ type: 'object',
82
+ properties: {
83
+ min: {
84
+ title: 'Минимум',
85
+ type: 'number',
86
+ },
87
+ max: {
88
+ title: 'Максимум',
89
+ type: 'number',
90
+ },
91
+ },
82
92
  },
83
93
  period: {
84
94
  title: 'Срок',
@@ -109,7 +119,7 @@ export default {
109
119
  filtrationSchema={SCHEMA}
110
120
  topItemsCount={2}
111
121
  sumInput={{ title: 'Сумма' }}
112
- periodInput={{ title: 'Срок, месяцев', min: 3, max: 36 }}
122
+ periodInput={{ title: 'Срок, месяцев', min: 3, max: 60 }}
113
123
  resetButton={{ text: 'Очистить фильтры', version: 'secondary' }}
114
124
  notFound={{
115
125
  title: 'Нет подходящей программы',
@@ -125,7 +135,7 @@ export default {
125
135
  OPTIONS_PENSIONER,
126
136
  PERCENTS_IN_THE_END,
127
137
  {
128
- sum: 5000,
138
+ sum: { min: 500, max: 5000 },
129
139
  period: { min: 9, max: 38 },
130
140
  },
131
141
  ),
@@ -135,7 +145,10 @@ export default {
135
145
  OPTIONS_ADD,
136
146
  OPTIONS_ONLINE,
137
147
  PERCENTS_EACH_MONTH,
138
- { sum: 1000, period: { min: 9, max: 38 } },
148
+ {
149
+ sum: { min: 500, max: 1000 },
150
+ period: { min: 9, max: 38 },
151
+ },
139
152
  ),
140
153
  generateBlock(
141
154
  PRODUCT_TILE,
@@ -144,7 +157,7 @@ export default {
144
157
  OPTIONS_PENSIONER,
145
158
  PERCENTS_EACH_MONTH,
146
159
  {
147
- sum: 500,
160
+ sum: { min: 500, max: 1500 },
148
161
  period: { min: 9, max: 38 },
149
162
  },
150
163
  ),
@@ -155,7 +168,7 @@ export default {
155
168
  OPTIONS_PENSIONER,
156
169
  PERCENTS_EACH_MONTH,
157
170
  {
158
- sum: 1000,
171
+ sum: { min: 500, max: 1000 },
159
172
  period: { min: 9, max: 38 },
160
173
  },
161
174
  ),
@@ -166,7 +179,7 @@ export default {
166
179
  OPTIONS_ONLINE,
167
180
  PERCENTS_IN_THE_END,
168
181
  {
169
- sum: 1000,
182
+ sum: { min: 500, max: 1000 },
170
183
  period: { min: 9, max: 38 },
171
184
  },
172
185
  ),
@@ -177,7 +190,7 @@ export default {
177
190
  OPTIONS_PENSIONER,
178
191
  PERCENTS_EACH_MONTH,
179
192
  {
180
- sum: 1000,
193
+ sum: { min: 500, max: 1000 },
181
194
  period: { min: 9, max: 38 },
182
195
  },
183
196
  ),
@@ -11,25 +11,28 @@ import type { DepositFiltrationContent } from './DepositFiltrationContent';
11
11
 
12
12
  interface DepositFiltrationProps extends DepositFiltrationContent, UniBlockProps {}
13
13
 
14
+ const DEFAULT_MIN_MONTHS = 3;
15
+ const DEFAULT_MAX_MONTHS = 60;
16
+
17
+ const DEFAULT_MIN_SUM = 500;
18
+ const DEFAULT_MAX_SUM = 1000000000;
19
+
14
20
  const initialFiltrationState = {
15
- sum: 500,
21
+ sum: {
22
+ min: 10000,
23
+ max: DEFAULT_MAX_SUM,
24
+ },
16
25
  period: {
17
26
  min: 3,
18
27
  max: 36,
19
28
  },
20
29
  };
21
30
 
22
- const DEFAULT_MIN_MONTHS = 3;
23
- const DEFAULT_MAX_MONTHS = 36;
24
-
25
- const DEFAULT_MIN_SUM = 500;
26
- const DEFAULT_MAX_SUM = 1000000000;
27
-
28
31
  export const DepositFiltration: JSXBlock<DepositFiltrationProps> = JSX<DepositFiltrationProps>(
29
32
  ({ className, filtrationSchema = {}, resetButton, sumInput, periodInput, ...rest }) => {
30
33
  const [filtrationState, { field, reset }] = useForm(initialFiltrationState);
31
34
 
32
- const maxValue = periodInput?.max || DEFAULT_MAX_MONTHS;
35
+ const maxPeriodValue = periodInput?.max || DEFAULT_MAX_MONTHS;
33
36
 
34
37
  const Inputs = (
35
38
  <div>
@@ -37,15 +40,18 @@ export const DepositFiltration: JSXBlock<DepositFiltrationProps> = JSX<DepositFi
37
40
  label={sumInput?.title}
38
41
  min={DEFAULT_MIN_SUM}
39
42
  max={DEFAULT_MAX_SUM}
40
- {...field('sum', { parse: Number, format: String })}
43
+ {...field('sum', {
44
+ parse: (min) => ({ min: Number(min), max: DEFAULT_MAX_SUM }),
45
+ format: ({ min }) => String(min),
46
+ })}
41
47
  />
42
48
  <InputRange
43
49
  title={periodInput?.title}
44
- items={['От 3 мес', 'До 3 лет']}
50
+ items={['От 3 мес', 'До 5 лет']}
45
51
  min={periodInput?.min || DEFAULT_MIN_MONTHS}
46
- max={maxValue}
52
+ max={maxPeriodValue}
47
53
  {...field('period', {
48
- parse: (min) => ({ min, max: maxValue }),
54
+ parse: (min) => ({ min, max: maxPeriodValue }),
49
55
  format: ({ min }) => min,
50
56
  })}
51
57
  />
@@ -1,7 +1,6 @@
1
1
  import type {
2
2
  BaseFiltrationInnerContent,
3
3
  NumberRange,
4
- NumberValue,
5
4
  StringArray,
6
5
  } from '../../ui-kit/BaseFiltration/BaseFiltrationContent';
7
6
 
@@ -13,7 +12,7 @@ export type DepositFiltrationSchema = {
13
12
  /** @title Выплата процентов */
14
13
  percents?: StringArray;
15
14
  /** @hidden */
16
- sum?: NumberValue;
15
+ sum?: NumberRange;
17
16
  /** @hidden */
18
17
  period?: NumberRange;
19
18
  };
@@ -20,8 +20,9 @@ export function renderRangeWithTicks({
20
20
  onChange,
21
21
  }: RangeWithTicksProps) {
22
22
  const rangeValue = list.length ? list.indexOf(value) : value;
23
+ const rangeValueShift = rangeValue > min ? rangeValue - min : 0;
23
24
  const inputStyle = {
24
- backgroundSize: `${(((rangeValue - min) * 100) / (max - min)).toFixed(2)}% 100%`,
25
+ backgroundSize: `${((rangeValueShift * 100) / (max - min)).toFixed(2)}% 100%`,
25
26
  };
26
27
 
27
28
  return (