@redneckz/wildless-cms-uni-blocks 0.8.20 → 0.8.22

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 (253) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +96 -82
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/bundle/components/Calculator/CreditCalculatorForm.d.ts +0 -2
  5. package/bundle/components/Calculator/constants.d.ts +2 -2
  6. package/bundle/components/Calculator/renderInterestPayment.d.ts +9 -1
  7. package/bundle/components/Calculator/renderPaymentType.d.ts +12 -0
  8. package/bundle/components/Calculator/renderRegistrationType.d.ts +10 -0
  9. package/bundle/components/Calculator/useBusinessDepositCalculatorParams.d.ts +3 -2
  10. package/bundle/components/Calculator/useCreditCalculatorParams.d.ts +1 -4
  11. package/bundle/components/Calculator/useDepositCalculatorParams.d.ts +1 -0
  12. package/bundle/components/StepsBlock/StepsBlock.d.ts +1 -1
  13. package/bundle/components/StepsBlock/StepsBlockContent.d.ts +2 -1
  14. package/bundle/components/StepsBlock/StepsBlockStyleMaps.d.ts +1 -2
  15. package/bundle/ui-kit/RadioButtonGroup/RadioButtonGroup.d.ts +2 -0
  16. package/dist/components/Calculator/BusinessDepositCalculatorForm.js +7 -2
  17. package/dist/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
  18. package/dist/components/Calculator/CreditCalculatorForm.d.ts +0 -2
  19. package/dist/components/Calculator/CreditCalculatorForm.js +7 -15
  20. package/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
  21. package/dist/components/Calculator/DepositCalculatorForm.js +13 -1
  22. package/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
  23. package/dist/components/Calculator/constants.d.ts +2 -2
  24. package/dist/components/Calculator/constants.js +6 -7
  25. package/dist/components/Calculator/constants.js.map +1 -1
  26. package/dist/components/Calculator/rangeHelpers.js +1 -1
  27. package/dist/components/Calculator/rangeHelpers.js.map +1 -1
  28. package/dist/components/Calculator/renderInterestPayment.d.ts +9 -1
  29. package/dist/components/Calculator/renderInterestPayment.js +2 -2
  30. package/dist/components/Calculator/renderInterestPayment.js.map +1 -1
  31. package/dist/components/Calculator/renderPaymentType.d.ts +12 -0
  32. package/dist/components/Calculator/renderPaymentType.js +22 -0
  33. package/dist/components/Calculator/renderPaymentType.js.map +1 -0
  34. package/dist/components/Calculator/renderRegistrationType.d.ts +10 -0
  35. package/dist/components/Calculator/renderRegistrationType.js +22 -0
  36. package/dist/components/Calculator/renderRegistrationType.js.map +1 -0
  37. package/dist/components/Calculator/useBusinessDepositCalculatorParams.d.ts +3 -2
  38. package/dist/components/Calculator/useBusinessDepositCalculatorParams.js +1 -1
  39. package/dist/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
  40. package/dist/components/Calculator/useCreditCalculatorParams.d.ts +1 -4
  41. package/dist/components/Calculator/useCreditCalculatorParams.js +2 -4
  42. package/dist/components/Calculator/useCreditCalculatorParams.js.map +1 -1
  43. package/dist/components/Calculator/useDepositCalculatorParams.d.ts +1 -0
  44. package/dist/components/Calculator/useDepositCalculatorParams.js +2 -1
  45. package/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  46. package/dist/components/Footer/Contacts.js +1 -1
  47. package/dist/components/Footer/Contacts.js.map +1 -1
  48. package/dist/components/Footer/Sitemap.js +7 -5
  49. package/dist/components/Footer/Sitemap.js.map +1 -1
  50. package/dist/components/StepsBlock/StepsBlock.d.ts +1 -1
  51. package/dist/components/StepsBlock/StepsBlock.js +11 -8
  52. package/dist/components/StepsBlock/StepsBlock.js.map +1 -1
  53. package/dist/components/StepsBlock/StepsBlock.mobile.js +2 -6
  54. package/dist/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
  55. package/dist/components/StepsBlock/StepsBlockContent.d.ts +2 -1
  56. package/dist/components/StepsBlock/StepsBlockStyleMaps.d.ts +1 -2
  57. package/dist/components/StepsBlock/StepsBlockStyleMaps.js +7 -39
  58. package/dist/components/StepsBlock/StepsBlockStyleMaps.js.map +1 -1
  59. package/dist/ui-kit/RadioButtonGroup/RadioButtonGroup.d.ts +2 -0
  60. package/dist/ui-kit/RadioButtonGroup/RadioButtonGroup.js +5 -1
  61. package/dist/ui-kit/RadioButtonGroup/RadioButtonGroup.js.map +1 -1
  62. package/lib/common.css +1 -1
  63. package/lib/components/Calculator/BusinessDepositCalculatorForm.js +7 -2
  64. package/lib/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
  65. package/lib/components/Calculator/CreditCalculatorForm.d.ts +0 -2
  66. package/lib/components/Calculator/CreditCalculatorForm.js +6 -14
  67. package/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
  68. package/lib/components/Calculator/DepositCalculatorForm.js +13 -1
  69. package/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
  70. package/lib/components/Calculator/constants.d.ts +2 -2
  71. package/lib/components/Calculator/constants.js +6 -7
  72. package/lib/components/Calculator/constants.js.map +1 -1
  73. package/lib/components/Calculator/rangeHelpers.js +1 -1
  74. package/lib/components/Calculator/rangeHelpers.js.map +1 -1
  75. package/lib/components/Calculator/renderInterestPayment.d.ts +9 -1
  76. package/lib/components/Calculator/renderInterestPayment.js +2 -2
  77. package/lib/components/Calculator/renderInterestPayment.js.map +1 -1
  78. package/lib/components/Calculator/renderPaymentType.d.ts +12 -0
  79. package/lib/components/Calculator/renderPaymentType.js +19 -0
  80. package/lib/components/Calculator/renderPaymentType.js.map +1 -0
  81. package/lib/components/Calculator/renderRegistrationType.d.ts +10 -0
  82. package/lib/components/Calculator/renderRegistrationType.js +19 -0
  83. package/lib/components/Calculator/renderRegistrationType.js.map +1 -0
  84. package/lib/components/Calculator/useBusinessDepositCalculatorParams.d.ts +3 -2
  85. package/lib/components/Calculator/useBusinessDepositCalculatorParams.js +1 -1
  86. package/lib/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
  87. package/lib/components/Calculator/useCreditCalculatorParams.d.ts +1 -4
  88. package/lib/components/Calculator/useCreditCalculatorParams.js +2 -4
  89. package/lib/components/Calculator/useCreditCalculatorParams.js.map +1 -1
  90. package/lib/components/Calculator/useDepositCalculatorParams.d.ts +1 -0
  91. package/lib/components/Calculator/useDepositCalculatorParams.js +2 -1
  92. package/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  93. package/lib/components/Footer/Contacts.js +1 -1
  94. package/lib/components/Footer/Contacts.js.map +1 -1
  95. package/lib/components/Footer/Sitemap.js +7 -5
  96. package/lib/components/Footer/Sitemap.js.map +1 -1
  97. package/lib/components/StepsBlock/StepsBlock.d.ts +1 -1
  98. package/lib/components/StepsBlock/StepsBlock.js +12 -9
  99. package/lib/components/StepsBlock/StepsBlock.js.map +1 -1
  100. package/lib/components/StepsBlock/StepsBlock.mobile.js +3 -7
  101. package/lib/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
  102. package/lib/components/StepsBlock/StepsBlockContent.d.ts +2 -1
  103. package/lib/components/StepsBlock/StepsBlockStyleMaps.d.ts +1 -2
  104. package/lib/components/StepsBlock/StepsBlockStyleMaps.js +6 -38
  105. package/lib/components/StepsBlock/StepsBlockStyleMaps.js.map +1 -1
  106. package/lib/ui-kit/RadioButtonGroup/RadioButtonGroup.d.ts +2 -0
  107. package/lib/ui-kit/RadioButtonGroup/RadioButtonGroup.js +5 -1
  108. package/lib/ui-kit/RadioButtonGroup/RadioButtonGroup.js.map +1 -1
  109. package/mobile/bundle/bundle.umd.js +10 -46
  110. package/mobile/bundle/bundle.umd.min.js +1 -1
  111. package/mobile/bundle/components/Calculator/CreditCalculatorForm.d.ts +0 -2
  112. package/mobile/bundle/components/Calculator/constants.d.ts +2 -2
  113. package/mobile/bundle/components/Calculator/renderInterestPayment.d.ts +9 -1
  114. package/mobile/bundle/components/Calculator/renderPaymentType.d.ts +12 -0
  115. package/mobile/bundle/components/Calculator/renderRegistrationType.d.ts +10 -0
  116. package/mobile/bundle/components/Calculator/useBusinessDepositCalculatorParams.d.ts +3 -2
  117. package/mobile/bundle/components/Calculator/useCreditCalculatorParams.d.ts +1 -4
  118. package/mobile/bundle/components/Calculator/useDepositCalculatorParams.d.ts +1 -0
  119. package/mobile/bundle/components/StepsBlock/StepsBlockContent.d.ts +2 -1
  120. package/mobile/bundle/components/StepsBlock/StepsBlockStyleMaps.d.ts +1 -2
  121. package/mobile/bundle/ui-kit/RadioButtonGroup/RadioButtonGroup.d.ts +2 -0
  122. package/mobile/dist/components/Calculator/BusinessDepositCalculatorForm.js +7 -2
  123. package/mobile/dist/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
  124. package/mobile/dist/components/Calculator/CreditCalculatorForm.d.ts +0 -2
  125. package/mobile/dist/components/Calculator/CreditCalculatorForm.js +7 -15
  126. package/mobile/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
  127. package/mobile/dist/components/Calculator/DepositCalculatorForm.js +13 -1
  128. package/mobile/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
  129. package/mobile/dist/components/Calculator/constants.d.ts +2 -2
  130. package/mobile/dist/components/Calculator/constants.js +6 -7
  131. package/mobile/dist/components/Calculator/constants.js.map +1 -1
  132. package/mobile/dist/components/Calculator/rangeHelpers.js +1 -1
  133. package/mobile/dist/components/Calculator/rangeHelpers.js.map +1 -1
  134. package/mobile/dist/components/Calculator/renderInterestPayment.d.ts +9 -1
  135. package/mobile/dist/components/Calculator/renderInterestPayment.js +2 -2
  136. package/mobile/dist/components/Calculator/renderInterestPayment.js.map +1 -1
  137. package/mobile/dist/components/Calculator/renderPaymentType.d.ts +12 -0
  138. package/mobile/dist/components/Calculator/renderPaymentType.js +22 -0
  139. package/mobile/dist/components/Calculator/renderPaymentType.js.map +1 -0
  140. package/mobile/dist/components/Calculator/renderRegistrationType.d.ts +10 -0
  141. package/mobile/dist/components/Calculator/renderRegistrationType.js +22 -0
  142. package/mobile/dist/components/Calculator/renderRegistrationType.js.map +1 -0
  143. package/mobile/dist/components/Calculator/useBusinessDepositCalculatorParams.d.ts +3 -2
  144. package/mobile/dist/components/Calculator/useBusinessDepositCalculatorParams.js +1 -1
  145. package/mobile/dist/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
  146. package/mobile/dist/components/Calculator/useCreditCalculatorParams.d.ts +1 -4
  147. package/mobile/dist/components/Calculator/useCreditCalculatorParams.js +2 -4
  148. package/mobile/dist/components/Calculator/useCreditCalculatorParams.js.map +1 -1
  149. package/mobile/dist/components/Calculator/useDepositCalculatorParams.d.ts +1 -0
  150. package/mobile/dist/components/Calculator/useDepositCalculatorParams.js +2 -1
  151. package/mobile/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  152. package/mobile/dist/components/Footer/Contacts.js +1 -1
  153. package/mobile/dist/components/Footer/Contacts.js.map +1 -1
  154. package/mobile/dist/components/Footer/Sitemap.js +7 -5
  155. package/mobile/dist/components/Footer/Sitemap.js.map +1 -1
  156. package/mobile/dist/components/StepsBlock/StepsBlock.js +2 -6
  157. package/mobile/dist/components/StepsBlock/StepsBlock.js.map +1 -1
  158. package/mobile/dist/components/StepsBlock/StepsBlockContent.d.ts +2 -1
  159. package/mobile/dist/components/StepsBlock/StepsBlockStyleMaps.d.ts +1 -2
  160. package/mobile/dist/components/StepsBlock/StepsBlockStyleMaps.js +7 -39
  161. package/mobile/dist/components/StepsBlock/StepsBlockStyleMaps.js.map +1 -1
  162. package/mobile/dist/ui-kit/RadioButtonGroup/RadioButtonGroup.d.ts +2 -0
  163. package/mobile/dist/ui-kit/RadioButtonGroup/RadioButtonGroup.js +5 -1
  164. package/mobile/dist/ui-kit/RadioButtonGroup/RadioButtonGroup.js.map +1 -1
  165. package/mobile/lib/components/Calculator/BusinessDepositCalculatorForm.js +7 -2
  166. package/mobile/lib/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
  167. package/mobile/lib/components/Calculator/CreditCalculatorForm.d.ts +0 -2
  168. package/mobile/lib/components/Calculator/CreditCalculatorForm.js +6 -14
  169. package/mobile/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
  170. package/mobile/lib/components/Calculator/DepositCalculatorForm.js +13 -1
  171. package/mobile/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
  172. package/mobile/lib/components/Calculator/constants.d.ts +2 -2
  173. package/mobile/lib/components/Calculator/constants.js +6 -7
  174. package/mobile/lib/components/Calculator/constants.js.map +1 -1
  175. package/mobile/lib/components/Calculator/rangeHelpers.js +1 -1
  176. package/mobile/lib/components/Calculator/rangeHelpers.js.map +1 -1
  177. package/mobile/lib/components/Calculator/renderInterestPayment.d.ts +9 -1
  178. package/mobile/lib/components/Calculator/renderInterestPayment.js +2 -2
  179. package/mobile/lib/components/Calculator/renderInterestPayment.js.map +1 -1
  180. package/mobile/lib/components/Calculator/renderPaymentType.d.ts +12 -0
  181. package/mobile/lib/components/Calculator/renderPaymentType.js +19 -0
  182. package/mobile/lib/components/Calculator/renderPaymentType.js.map +1 -0
  183. package/mobile/lib/components/Calculator/renderRegistrationType.d.ts +10 -0
  184. package/mobile/lib/components/Calculator/renderRegistrationType.js +19 -0
  185. package/mobile/lib/components/Calculator/renderRegistrationType.js.map +1 -0
  186. package/mobile/lib/components/Calculator/useBusinessDepositCalculatorParams.d.ts +3 -2
  187. package/mobile/lib/components/Calculator/useBusinessDepositCalculatorParams.js +1 -1
  188. package/mobile/lib/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
  189. package/mobile/lib/components/Calculator/useCreditCalculatorParams.d.ts +1 -4
  190. package/mobile/lib/components/Calculator/useCreditCalculatorParams.js +2 -4
  191. package/mobile/lib/components/Calculator/useCreditCalculatorParams.js.map +1 -1
  192. package/mobile/lib/components/Calculator/useDepositCalculatorParams.d.ts +1 -0
  193. package/mobile/lib/components/Calculator/useDepositCalculatorParams.js +2 -1
  194. package/mobile/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  195. package/mobile/lib/components/Footer/Contacts.js +1 -1
  196. package/mobile/lib/components/Footer/Contacts.js.map +1 -1
  197. package/mobile/lib/components/Footer/Sitemap.js +7 -5
  198. package/mobile/lib/components/Footer/Sitemap.js.map +1 -1
  199. package/mobile/lib/components/StepsBlock/StepsBlock.js +3 -7
  200. package/mobile/lib/components/StepsBlock/StepsBlock.js.map +1 -1
  201. package/mobile/lib/components/StepsBlock/StepsBlockContent.d.ts +2 -1
  202. package/mobile/lib/components/StepsBlock/StepsBlockStyleMaps.d.ts +1 -2
  203. package/mobile/lib/components/StepsBlock/StepsBlockStyleMaps.js +6 -38
  204. package/mobile/lib/components/StepsBlock/StepsBlockStyleMaps.js.map +1 -1
  205. package/mobile/lib/ui-kit/RadioButtonGroup/RadioButtonGroup.d.ts +2 -0
  206. package/mobile/lib/ui-kit/RadioButtonGroup/RadioButtonGroup.js +5 -1
  207. package/mobile/lib/ui-kit/RadioButtonGroup/RadioButtonGroup.js.map +1 -1
  208. package/mobile/src/components/Calculator/BusinessDepositCalculatorForm.tsx +9 -8
  209. package/mobile/src/components/Calculator/CreditCalculatorForm.tsx +8 -22
  210. package/mobile/src/components/Calculator/DepositCalculatorForm.tsx +22 -8
  211. package/mobile/src/components/Calculator/constants.ts +6 -7
  212. package/mobile/src/components/Calculator/rangeHelpers.ts +1 -1
  213. package/mobile/src/components/Calculator/renderInterestPayment.tsx +21 -9
  214. package/mobile/src/components/Calculator/renderPaymentType.tsx +49 -0
  215. package/mobile/src/components/Calculator/renderRegistrationType.tsx +51 -0
  216. package/mobile/src/components/Calculator/useBusinessDepositCalculatorParams.ts +4 -3
  217. package/mobile/src/components/Calculator/useCreditCalculatorParams.ts +3 -8
  218. package/mobile/src/components/Calculator/useDepositCalculatorParams.ts +4 -2
  219. package/mobile/src/components/Catalog/Catalog.ui.json +1 -0
  220. package/mobile/src/components/Footer/Contacts.tsx +1 -1
  221. package/mobile/src/components/Footer/Sitemap.tsx +10 -5
  222. package/mobile/src/components/Gallery/Gallery.ui.json +1 -0
  223. package/mobile/src/components/MiniGallery/MiniGallery.ui.json +1 -0
  224. package/mobile/src/components/StepsBlock/StepsBlock.example.json +3 -1
  225. package/mobile/src/components/StepsBlock/StepsBlock.tsx +23 -27
  226. package/mobile/src/components/StepsBlock/StepsBlockContent.ts +2 -1
  227. package/mobile/src/components/StepsBlock/StepsBlockStyleMaps.ts +6 -40
  228. package/mobile/src/ui-kit/RadioButtonGroup/RadioButtonGroup.tsx +9 -2
  229. package/package.json +1 -1
  230. package/src/components/Calculator/BusinessDepositCalculatorForm.tsx +9 -8
  231. package/src/components/Calculator/CreditCalculatorForm.tsx +8 -22
  232. package/src/components/Calculator/DepositCalculatorForm.tsx +22 -8
  233. package/src/components/Calculator/constants.ts +6 -7
  234. package/src/components/Calculator/rangeHelpers.ts +1 -1
  235. package/src/components/Calculator/renderInterestPayment.tsx +21 -9
  236. package/src/components/Calculator/renderPaymentType.tsx +49 -0
  237. package/src/components/Calculator/renderRegistrationType.tsx +51 -0
  238. package/src/components/Calculator/useBusinessDepositCalculatorParams.ts +4 -3
  239. package/src/components/Calculator/useCreditCalculatorParams.ts +3 -8
  240. package/src/components/Calculator/useDepositCalculatorParams.ts +4 -2
  241. package/src/components/Catalog/Catalog.ui.json +1 -0
  242. package/src/components/Footer/Contacts.tsx +1 -1
  243. package/src/components/Footer/Sitemap.tsx +10 -5
  244. package/src/components/Gallery/Gallery.ui.json +1 -0
  245. package/src/components/MiniGallery/MiniGallery.ui.json +1 -0
  246. package/src/components/StepsBlock/StepsBlock.example.json +3 -1
  247. package/src/components/StepsBlock/StepsBlock.fixture.tsx +4 -0
  248. package/src/components/StepsBlock/StepsBlock.mobile.tsx +23 -27
  249. package/src/components/StepsBlock/StepsBlock.tsx +34 -27
  250. package/src/components/StepsBlock/StepsBlockContent.ts +2 -1
  251. package/src/components/StepsBlock/StepsBlockStyleMaps.ts +6 -40
  252. package/src/ui-kit/RadioButtonGroup/RadioButtonGroup.fixture.tsx +22 -5
  253. package/src/ui-kit/RadioButtonGroup/RadioButtonGroup.tsx +9 -2
@@ -1,3 +1,4 @@
1
+ import { ListOrientation } from '../../model/ListOrientation';
1
2
  import { RadioButtonGroup } from '../../ui-kit/RadioButtonGroup/RadioButtonGroup';
2
3
  import { Text } from '../../ui-kit/Text/Text';
3
4
 
@@ -15,21 +16,32 @@ const depositTypeItems = [
15
16
  },
16
17
  ];
17
18
 
18
- export function renderInterestPayment(
19
- isMonthlyInterestPayment: boolean,
20
- callback?: (value: boolean) => void,
21
- title?: string,
22
- ) {
19
+ interface InterestPaymentProps {
20
+ isMonthlyInterestPayment: boolean;
21
+ callback?: (value: boolean) => void;
22
+ title?: string;
23
+ orientation?: ListOrientation;
24
+ }
25
+
26
+ export function renderInterestPayment({
27
+ isMonthlyInterestPayment,
28
+ callback,
29
+ title,
30
+ orientation = 'horizontal',
31
+ }: InterestPaymentProps) {
23
32
  return (
24
33
  <div>
25
34
  {title ? (
26
- <Text color="text-secondary-text" font="font-light">
27
- {title}
28
- </Text>
35
+ <div className="mb-3">
36
+ <Text color="text-secondary-text" font="font-light">
37
+ {title}
38
+ </Text>
39
+ </div>
29
40
  ) : null}
30
41
 
31
- <div className="mt-3">
42
+ <div>
32
43
  <RadioButtonGroup
44
+ orientation={orientation}
33
45
  items={depositTypeItems}
34
46
  checkedItem={isMonthlyInterestPayment ? EVERY_MONTH : AT_END_TERM}
35
47
  onChange={(text: string) => callback && callback(text === EVERY_MONTH)}
@@ -0,0 +1,49 @@
1
+ import { ListOrientation } from '../../model/ListOrientation';
2
+ import { RadioButtonGroup } from '../../ui-kit/RadioButtonGroup/RadioButtonGroup';
3
+ import { Text } from '../../ui-kit/Text/Text';
4
+
5
+ export const ANNUITY = 'annuity';
6
+ export const DIFFERENTIAL = 'differential';
7
+
8
+ const paymentTypeItems = [
9
+ {
10
+ id: ANNUITY,
11
+ text: 'Аннуитетный',
12
+ },
13
+ {
14
+ id: DIFFERENTIAL,
15
+ text: 'Дифференцированный',
16
+ },
17
+ ];
18
+
19
+ interface PaymentTypeProps {
20
+ isAnnuity: boolean;
21
+ callback?: (value: boolean) => void;
22
+ title?: string;
23
+ orientation?: ListOrientation;
24
+ }
25
+
26
+ export function renderPaymentType({
27
+ isAnnuity,
28
+ callback,
29
+ title,
30
+ orientation = 'horizontal',
31
+ }: PaymentTypeProps) {
32
+ return (
33
+ <div>
34
+ {title ? (
35
+ <div className="mb-3">
36
+ <Text color="text-secondary-text" font="font-light">
37
+ {title}
38
+ </Text>
39
+ </div>
40
+ ) : null}
41
+ <RadioButtonGroup
42
+ orientation={orientation}
43
+ items={paymentTypeItems}
44
+ checkedItem={isAnnuity ? ANNUITY : DIFFERENTIAL}
45
+ onChange={(text: string) => callback && callback(text === ANNUITY)}
46
+ />
47
+ </div>
48
+ );
49
+ }
@@ -0,0 +1,51 @@
1
+ import { ListOrientation } from '../../model/ListOrientation';
2
+ import { RadioButtonGroup } from '../../ui-kit/RadioButtonGroup/RadioButtonGroup';
3
+ import { Text } from '../../ui-kit/Text/Text';
4
+
5
+ const REMOTE_REGISTRATION = 'remote';
6
+ const OFFICE_REGISTRATION = 'office';
7
+
8
+ const registrationTypeItems = [
9
+ {
10
+ id: OFFICE_REGISTRATION,
11
+ text: 'Офис Банка',
12
+ },
13
+ {
14
+ id: REMOTE_REGISTRATION,
15
+ text: 'Дистанционно',
16
+ },
17
+ ];
18
+
19
+ interface RegistrationTypeProps {
20
+ isRemoteRegistration: boolean;
21
+ callback?: (value: boolean) => void;
22
+ title?: string;
23
+ orientation?: ListOrientation;
24
+ }
25
+
26
+ export function renderRegistrationType({
27
+ isRemoteRegistration,
28
+ callback,
29
+ title,
30
+ orientation = 'horizontal',
31
+ }: RegistrationTypeProps) {
32
+ return (
33
+ <div>
34
+ {title ? (
35
+ <div className="mb-3">
36
+ <Text color="text-secondary-text" font="font-light">
37
+ {title}
38
+ </Text>
39
+ </div>
40
+ ) : null}
41
+ <div>
42
+ <RadioButtonGroup
43
+ orientation={orientation}
44
+ items={registrationTypeItems}
45
+ checkedItem={isRemoteRegistration ? REMOTE_REGISTRATION : OFFICE_REGISTRATION}
46
+ onChange={(text: string) => callback && callback(text === REMOTE_REGISTRATION)}
47
+ />
48
+ </div>
49
+ </div>
50
+ );
51
+ }
@@ -7,9 +7,9 @@ import {
7
7
  } from './constants';
8
8
  import { checkRangeByKeys, getRangeByKeys } from './rangeHelpers';
9
9
  import { useCalculatorParams } from './useCalculatorParams';
10
- import type { CommonDepositParams } from './useDepositCalculatorParams';
11
10
 
12
- export interface BusinessCommonDepositParams extends CommonDepositParams {
11
+ export interface BusinessCommonDepositParams {
12
+ isMonthlyInterestPayment: boolean;
13
13
  isReplenished: boolean;
14
14
  isPartialWithdrawal: boolean;
15
15
  isSmallBusiness: boolean;
@@ -34,6 +34,7 @@ export interface BusinessDepositCalculatorParams
34
34
  income?: number;
35
35
  finalSum?: number;
36
36
  isDisabledOperatingDeposit?: boolean;
37
+ isShowUnknownRate?: boolean;
37
38
  }
38
39
 
39
40
  export type BusinessDepositCalculatorData = {
@@ -65,7 +66,7 @@ export const useBusinessDepositCalculatorParams = (
65
66
  ...DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS,
66
67
  ...userInputParams,
67
68
  isDisabledOperatingDeposit,
68
- rate: 0,
69
+ isShowUnknownRate: true,
69
70
  };
70
71
  }
71
72
  const businessDepositCalculatorSourceBookParams =
@@ -13,9 +13,7 @@ export interface CreditCalculatorSourceBookParams extends CommonCreditParams {
13
13
  maxSum: number;
14
14
  minMonths: number;
15
15
  maxMonths: number;
16
- rateBottomRange: number;
17
- rateTopRange: number;
18
- sumBorder: number;
16
+ rate: number;
19
17
  }
20
18
 
21
19
  export interface CreditCalculatorUserInputParams extends CommonCreditParams {
@@ -28,7 +26,6 @@ export interface CreditCalculatorParams
28
26
  extends CreditCalculatorSourceBookParams,
29
27
  CreditCalculatorUserInputParams {
30
28
  monthlyPayment: number;
31
- finalRate: number;
32
29
  }
33
30
 
34
31
  export type CreditCalculatorData = {
@@ -53,9 +50,8 @@ export const useCreditCalculatorParams = (
53
50
  );
54
51
  }) || DEFAULT_CREDIT_CALCULATOR_PARAMS;
55
52
 
56
- const { rateBottomRange, rateTopRange, sumBorder } = creditCalculatorSourceBookParams;
57
- const finalRate = moneyValue <= sumBorder ? rateBottomRange : rateTopRange;
58
- const monthlyPayment = getMonthlyPayment(finalRate, userInputParams);
53
+ const { rate } = creditCalculatorSourceBookParams;
54
+ const monthlyPayment = getMonthlyPayment(rate, userInputParams);
59
55
  const sourceBookRows = data?.rows || [DEFAULT_CREDIT_CALCULATOR_PARAMS];
60
56
 
61
57
  return {
@@ -63,7 +59,6 @@ export const useCreditCalculatorParams = (
63
59
  ...getRangeByKeys(['minSum', 'maxSum'], sourceBookRows),
64
60
  ...getRangeByKeys(['minMonths', 'maxMonths'], sourceBookRows),
65
61
  ...userInputParams,
66
- finalRate,
67
62
  monthlyPayment,
68
63
  };
69
64
  };
@@ -4,6 +4,7 @@ import { useCalculatorParams } from './useCalculatorParams';
4
4
 
5
5
  export interface CommonDepositParams {
6
6
  isMonthlyInterestPayment: boolean;
7
+ isRemoteRegistration: boolean;
7
8
  }
8
9
 
9
10
  export interface DepositCalculatorSourceBookParams extends CommonDepositParams {
@@ -34,7 +35,8 @@ export const useDepositCalculatorParams = (
34
35
  userInputParams: DepositCalculatorUserInputParams,
35
36
  sourceBookDir?: string,
36
37
  ): DepositCalculatorParams => {
37
- const { isMonthlyInterestPayment, moneyValue, monthsValue } = userInputParams;
38
+ const { isMonthlyInterestPayment, isRemoteRegistration, moneyValue, monthsValue } =
39
+ userInputParams;
38
40
 
39
41
  const data = useCalculatorParams<DepositCalculatorData>(
40
42
  sourceBookDir || DEPOSIT_CALC_DEFAULT_DIR,
@@ -44,12 +46,12 @@ export const useDepositCalculatorParams = (
44
46
  data?.rows?.find(
45
47
  (_) =>
46
48
  isMonthlyInterestPayment === _.isMonthlyInterestPayment &&
49
+ isRemoteRegistration === _.isRemoteRegistration &&
47
50
  checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], _) &&
48
51
  checkRangeByKeys(monthsValue, ['minMonths', 'maxMonths'], _),
49
52
  ) || DEFAULT_DEPOSIT_CALCULATOR_PARAMS;
50
53
 
51
54
  const { rate } = depositCalculatorSourceBookParams;
52
-
53
55
  const income = getDepositIncome(rate, userInputParams);
54
56
  const finalSum = moneyValue + income;
55
57
  const sourceBookRows = data?.rows || [DEFAULT_DEPOSIT_CALCULATOR_PARAMS];
@@ -15,7 +15,7 @@ export const Contacts = JSX<ContactsProps>(({ className = '', items, hasButton }
15
15
  <Button
16
16
  version="primary"
17
17
  className="mb-6 w-full"
18
- href="/"
18
+ href="https://www.rshb.ru/feedback/question/"
19
19
  target="_blank"
20
20
  ariaLabel="Обратная связь"
21
21
  text="Обратная связь"
@@ -5,6 +5,7 @@ import type { LinkProps } from '../../model/LinkProps';
5
5
  import { projectSettings } from '../../ProjectSettings';
6
6
  import type { SitemapDataProps, TopMenuItem } from '../../services/sitemap/SitemapProps';
7
7
  import { useSWRResource } from '../../services/sitemap/useSWRResource';
8
+ import { joinPath } from '../../utils/url';
8
9
 
9
10
  export interface SitemapProps {
10
11
  className?: string;
@@ -12,7 +13,7 @@ export interface SitemapProps {
12
13
  }
13
14
 
14
15
  export const Sitemap = JSX<SitemapProps>(({ className = '', fallback }) => {
15
- const link = useLink();
16
+ const link = useLink(true);
16
17
  const sitemap = useSWRResource<SitemapDataProps>(projectSettings.SITEMAP || 'sitemap', fallback);
17
18
 
18
19
  return (
@@ -36,24 +37,28 @@ const renderColumn = (menuItem: TopMenuItem & { onClick: () => void }, index: nu
36
37
  {text || `Раздел ${index}`}
37
38
  </a>
38
39
  {items?.map((_, i) => (
39
- <ColumnItem key={String(i)} {..._} index={i} />
40
+ <ColumnItem key={String(i)} {..._} basePath={href} index={i} />
40
41
  ))}
41
42
  </div>
42
43
  );
43
44
  };
44
45
 
45
46
  interface ColumnItemProps extends LinkProps {
47
+ basePath?: string;
46
48
  index?: number;
47
49
  }
48
50
 
49
- const ColumnItem = JSX<ColumnItemProps>(({ text, index, ...rest }) => {
50
- const link = useLink();
51
+ const ColumnItem = JSX<ColumnItemProps>(({ text, index, basePath, ...rest }) => {
52
+ const isAnotherPortal =
53
+ projectSettings.BASE_PATH && basePath ? !projectSettings.BASE_PATH.startsWith(basePath) : false;
54
+
55
+ const link = useLink(isAnotherPortal);
51
56
  const { href, target, onClick } = link(rest);
52
57
 
53
58
  return (
54
59
  <a
55
60
  className="block text-l-light text-secondary-text hover:text-primary-main no-underline"
56
- href={href}
61
+ href={isAnotherPortal ? joinPath(basePath, href) : href}
57
62
  target={target || '_self'}
58
63
  onClick={onClick}
59
64
  >
@@ -4,6 +4,8 @@
4
4
  "title": "Шаги",
5
5
  "description": "Описание",
6
6
  "showLines": true,
7
+ "size": "normal",
8
+ "stepVersion": "gray",
7
9
  "steps": [
8
10
  {
9
11
  "label": "Шаг №1",
@@ -20,7 +22,7 @@
20
22
  "text": "Кнопка",
21
23
  "target": "_blank",
22
24
  "version": "primary"
23
- }
25
+ }
24
26
  },
25
27
  {
26
28
  "label": "Шаг №2",
@@ -10,7 +10,7 @@ import { assertUnreachable } from '../../utils/assertUnreachable';
10
10
  import { getIconWithVersion } from '../../utils/getIconWithVersion';
11
11
  import { checkCanRenderIcon } from './checkCanRenderIcon';
12
12
  import type { DefaultStep, Step, StepsBlockContent } from './StepsBlockContent';
13
- import { STEPS_BLOCK_STYLE_MAPS } from './StepsBlockStyleMaps';
13
+ import { STEPS_BLOCK_STYLE } from './StepsBlockStyleMaps';
14
14
 
15
15
  export interface StepsBlockProps extends StepsBlockContent, UniBlockProps {}
16
16
 
@@ -24,6 +24,8 @@ const STEPS_TILE_DESCRIPTION_HEIGHT_MAP: Record<SizeVersion, string> = {
24
24
  small: 'min-h-12',
25
25
  };
26
26
 
27
+ const styleMap = STEPS_BLOCK_STYLE;
28
+
27
29
  export const StepsBlock = JSX<StepsBlockProps>(
28
30
  ({
29
31
  className = '',
@@ -34,31 +36,27 @@ export const StepsBlock = JSX<StepsBlockProps>(
34
36
  size = 'normal',
35
37
  version = 'primary',
36
38
  ...rest
37
- }) => {
38
- const styleMap = STEPS_BLOCK_STYLE_MAPS[version];
39
-
40
- return (
41
- <BlockWrapper
42
- className={`box-border px-4 py-6 flex flex-col ${className}`}
43
- version={version}
44
- {...rest}
45
- >
46
- {title ? <Heading headingType="h3" className="text-center" title={title} /> : null}
47
- {description ? (
48
- <p className={`text-m-light text-center ${styleMap.description} ${title ? 'mt-2' : ''}`}>
49
- {description}
50
- </p>
51
- ) : null}
52
- {steps?.length ? (
53
- <div className={`box-border py-0.5 mb-0.5 mt-5`}>
54
- <div className="flex flex-col justify-between gap-x-[101px]">
55
- {steps.map(renderStep(size, version, showLines))}
56
- </div>
39
+ }) => (
40
+ <BlockWrapper
41
+ className={`box-border px-4 py-6 flex flex-col ${className}`}
42
+ version={version}
43
+ {...rest}
44
+ >
45
+ {title ? <Heading headingType="h3" className="text-center" title={title} /> : null}
46
+ {description ? (
47
+ <p className={`text-m-light text-center ${styleMap.description} ${title ? 'mt-2' : ''}`}>
48
+ {description}
49
+ </p>
50
+ ) : null}
51
+ {steps?.length ? (
52
+ <div className={`box-border py-0.5 mb-0.5 mt-5`}>
53
+ <div className="flex flex-col justify-between gap-x-[101px]">
54
+ {steps.map(renderStep(size, version, showLines))}
57
55
  </div>
58
- ) : null}
59
- </BlockWrapper>
60
- );
61
- },
56
+ </div>
57
+ ) : null}
58
+ </BlockWrapper>
59
+ ),
62
60
  );
63
61
 
64
62
  // TODO: Create universal function for this case
@@ -88,7 +86,6 @@ const renderDefaultStep =
88
86
  (step: DefaultStep, i: number, steps: Step[]) => {
89
87
  const isLastStep = steps.length - 1 === i;
90
88
  const margin = size === 'normal' ? 'ml-[34px]' : 'ml-6';
91
- const styleMap = STEPS_BLOCK_STYLE_MAPS[version];
92
89
 
93
90
  return (
94
91
  <div key={String(i)}>
@@ -119,7 +116,6 @@ const renderDefaultStep =
119
116
  };
120
117
 
121
118
  const renderIconArea = (size: SizeVersion, version: BlockVersion) => (step: Step, i: number) => {
122
- const styleMap = STEPS_BLOCK_STYLE_MAPS[version];
123
119
  const iconAreaSize = STEPS_SIZE_MAP[size];
124
120
 
125
121
  const iconSize = size === 'normal' ? '38' : '27';
@@ -48,10 +48,11 @@ export type StepsBlockContent = HeadlineCommonProps & {
48
48
  * @maxItems 5
49
49
  */
50
50
  steps?: Step[];
51
+ stepVersion?: BlockVersion;
51
52
  /** @title Кнопка */
52
53
  button?: ButtonWithIconProps;
53
54
  /**
54
- * @title Размер шагов (моб.)
55
+ * @title Размер шагов
55
56
  * @default normal
56
57
  */
57
58
  size?: SizeVersion; // TODO: mobile content
@@ -1,5 +1,3 @@
1
- import type { BlockVersion } from '../../model/BlockVersion';
2
-
3
1
  export type StyleType = {
4
2
  description: string;
5
3
  iconText: string;
@@ -8,42 +6,10 @@ export type StyleType = {
8
6
  dot: string;
9
7
  };
10
8
 
11
- export const STEPS_BLOCK_STYLE_MAPS: Record<BlockVersion, StyleType> = {
12
- primary: {
13
- description: '!text-secondary-text text-l-light',
14
- iconText: 'text-secondary-text',
15
- iconBackground: 'bg-main-divider',
16
- iconConnector: 'bg-secondary-light',
17
- dot: 'bg-secondary-text',
18
- },
19
- secondary: {
20
- description: '!text-white/80 text-l-light',
21
- iconText: 'text-white',
22
- iconBackground: 'bg-white/30',
23
- iconConnector: 'bg-white',
24
- dot: 'bg-white/80',
25
- },
26
- gray: {
27
- // TODO Replace this Map with group-data-*
28
- description: '!text-white/80 text-l-light',
29
- iconText: 'text-white',
30
- iconBackground: 'bg-white/30',
31
- iconConnector: 'bg-white',
32
- dot: 'bg-white/80',
33
- },
34
- transparent: {
35
- description: '!text-white/80 text-l-light',
36
- iconText: 'text-white',
37
- iconBackground: 'bg-white/30',
38
- iconConnector: 'bg-white',
39
- dot: 'bg-white/80',
40
- },
41
- '': {
42
- // TODO Replace this Map with group-data-*
43
- description: '!text-white/80 text-l-light',
44
- iconText: 'text-white',
45
- iconBackground: 'bg-white/30',
46
- iconConnector: 'bg-white',
47
- dot: 'bg-white/80',
48
- },
9
+ export const STEPS_BLOCK_STYLE: StyleType = {
10
+ description: 'text-white/80 text-l-light group-data-primary:text-secondary-text',
11
+ iconText: 'text-white group-data-primary:text-secondary-text',
12
+ iconBackground: 'bg-white/30 group-data-primary:bg-main-divider',
13
+ iconConnector: 'bg-white group-data-primary:bg-secondary-light',
14
+ dot: 'bg-white/80 group-data-primary:bg-secondary-text',
49
15
  };
@@ -1,4 +1,5 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
+ import { ListOrientation } from '../../model/ListOrientation';
2
3
  import { Checkbox } from '../Checkbox/Checkbox';
3
4
 
4
5
  export interface RadioButtonItem {
@@ -10,11 +11,17 @@ interface RadioButtonGroupProps {
10
11
  items?: RadioButtonItem[];
11
12
  checkedItem?: string;
12
13
  onChange?: (id: string) => void;
14
+ orientation?: ListOrientation;
13
15
  }
14
16
 
17
+ const orientationStyleMap: Record<ListOrientation, string> = {
18
+ horizontal: 'gap-10',
19
+ vertical: 'flex-col gap-3',
20
+ };
21
+
15
22
  export const RadioButtonGroup = JSX<RadioButtonGroupProps>(
16
- ({ items, checkedItem, onChange: onChangeCheckedItem }) => (
17
- <div className="flex flex-col gap-3">
23
+ ({ items, checkedItem, onChange: onChangeCheckedItem, orientation = 'horizontal' }) => (
24
+ <div className={`flex ${orientationStyleMap[orientation]}`}>
18
25
  {items?.map(({ id, text }) => (
19
26
  <Checkbox
20
27
  key={String(id)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.8.20",
3
+ "version": "0.8.22",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -47,7 +47,7 @@ export const BusinessDepositCalculatorForm = JSX<BusinessDepositCalculatorProp>(
47
47
  };
48
48
 
49
49
  const calculatorParams = useBusinessDepositCalculatorParams(userInputParams, sourceBookDir);
50
- const { income, finalSum, rate, depositeName } = calculatorParams;
50
+ const { income, finalSum, rate, depositeName, isShowUnknownRate } = calculatorParams;
51
51
 
52
52
  return (
53
53
  <section className={className}>
@@ -62,14 +62,17 @@ export const BusinessDepositCalculatorForm = JSX<BusinessDepositCalculatorProp>(
62
62
  handleIsPartialWithdrawal,
63
63
  handleIsSmallBusiness,
64
64
  })}
65
- {renderInterestPayment(
65
+ {renderInterestPayment({
66
66
  isMonthlyInterestPayment,
67
- handleIsMonthlyInterestPayment,
68
- 'Выплата процентов',
69
- )}
67
+ callback: handleIsMonthlyInterestPayment,
68
+ title: 'Выплата процентов',
69
+ orientation: 'vertical',
70
+ })}
70
71
  </div>
71
72
  </div>
72
- {rate ? (
73
+ {isShowUnknownRate ? (
74
+ <UnknownRate />
75
+ ) : (
73
76
  <Rate
74
77
  rate={rate}
75
78
  depositeName={depositeName}
@@ -77,8 +80,6 @@ export const BusinessDepositCalculatorForm = JSX<BusinessDepositCalculatorProp>(
77
80
  rateBlockClassName="tracking-[-25px]"
78
81
  unit="%"
79
82
  />
80
- ) : (
81
- <UnknownRate />
82
83
  )}
83
84
 
84
85
  <div className="w-full max-w-[350px]">
@@ -2,7 +2,6 @@ import { JSX } from '@redneckz/uni-jsx';
2
2
  import { useCallback, useState } from '@redneckz/uni-jsx/lib/hooks';
3
3
  import { renderButtonsSection } from '../../ui-kit/Button/renderButtonsSection';
4
4
  import { Checkbox } from '../../ui-kit/Checkbox/Checkbox';
5
- import { RadioButtonGroup } from '../../ui-kit/RadioButtonGroup/RadioButtonGroup';
6
5
  import { style } from '../../utils/style';
7
6
  import type { CommonCalculatorProps } from './CalculatorContent';
8
7
  import { CalculatorValueBlock } from './CalculatorValueBlock';
@@ -10,23 +9,10 @@ import { DEFAULT_MONTHS, DEFAULT_SUM } from './constants';
10
9
  import { Rate } from './Rate';
11
10
  import { renderFootnote } from './renderFootnote';
12
11
  import { renderMonthsInput } from './renderMonthsInput';
12
+ import { renderPaymentType } from './renderPaymentType';
13
13
  import { renderWantedSumInput } from './renderWantedSumInput';
14
14
  import { useCreditCalculatorParams } from './useCreditCalculatorParams';
15
15
 
16
- export const ANNUITY = 'annuity';
17
- export const DIFFERENTIAL = 'differential';
18
-
19
- const paymentTypeItems = [
20
- {
21
- id: ANNUITY,
22
- text: 'Аннуитетный',
23
- },
24
- {
25
- id: DIFFERENTIAL,
26
- text: 'Дифференцированный',
27
- },
28
- ];
29
-
30
16
  export interface CreditCalculatorProp extends CommonCalculatorProps {
31
17
  className?: string;
32
18
  }
@@ -82,21 +68,21 @@ export const CreditCalculatorForm = JSX<CreditCalculatorProp>(
82
68
  </div>
83
69
  <Rate
84
70
  title="Ставка"
85
- rate={calculatorParams.finalRate}
71
+ rate={calculatorParams.rate}
86
72
  rateBlockClassName="tracking-[-25px]"
87
73
  unit="%"
88
74
  />
89
75
  <div className="w-full max-w-[350px]">
90
76
  <CalculatorValueBlock
91
- title={isAnnuity ? 'Ежемесячный платеж' : 'Платёж в первый месяц'}
77
+ title={'Ежемесячный платеж'}
92
78
  value={calculatorParams.monthlyPayment}
93
79
  postfix="₽"
94
80
  />
95
- <RadioButtonGroup
96
- items={paymentTypeItems}
97
- checkedItem={isAnnuity ? ANNUITY : DIFFERENTIAL}
98
- onChange={(text: string) => toggleIsAnnuity(text === ANNUITY)}
99
- />
81
+ {renderPaymentType({
82
+ isAnnuity,
83
+ orientation: 'vertical',
84
+ callback: toggleIsAnnuity,
85
+ })}
100
86
  {renderButtonsSection(buttons, { className: 'mt-7', isVertical: true })}
101
87
  {renderFootnote(footnote)}
102
88
  </div>