@redneckz/wildless-cms-uni-blocks 0.6.18 → 0.6.19

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 (227) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +81 -56
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/bundle/components/StepsBlock/renderStepContent.d.ts +2 -2
  5. package/bundle/components/TariffsTable/EmbeddableCellData.d.ts +7 -1
  6. package/bundle/components/TariffsTable/TariffsTableCell.d.ts +8 -2
  7. package/bundle/components/TariffsTable/TariffsTableContent.d.ts +3 -4
  8. package/bundle/components/TariffsTable/TariffsTableRenderCell.d.ts +11 -0
  9. package/bundle/components/TariffsTable/TariffsTableRow.d.ts +0 -1
  10. package/bundle/components/TariffsTable/TariffsTableRowContainer.d.ts +3 -1
  11. package/bundle/ui-kit/InnerTable/InnerTable.d.ts +1 -0
  12. package/bundle/ui-kit/InnerTable/InnerTableButton.d.ts +1 -0
  13. package/dist/components/Bonus/Bonus.js +1 -1
  14. package/dist/components/Bonus/Bonus.js.map +1 -1
  15. package/dist/components/ProductBlock/renderBackwardButton.js +1 -1
  16. package/dist/components/ProductBlock/renderBackwardButton.js.map +1 -1
  17. package/dist/components/SafeDepositRental/SafeDepositRental.js +1 -1
  18. package/dist/components/SafeDepositRental/SafeDepositRental.js.map +1 -1
  19. package/dist/components/StepsBlock/StepsBlock.js +3 -3
  20. package/dist/components/StepsBlock/StepsBlock.js.map +1 -1
  21. package/dist/components/StepsBlock/renderItems.js +1 -4
  22. package/dist/components/StepsBlock/renderItems.js.map +1 -1
  23. package/dist/components/StepsBlock/renderStepContent.d.ts +2 -2
  24. package/dist/components/StepsBlock/renderStepContent.js +13 -8
  25. package/dist/components/StepsBlock/renderStepContent.js.map +1 -1
  26. package/dist/components/TariffsTable/EmbeddableCellData.d.ts +7 -1
  27. package/dist/components/TariffsTable/EmbeddableCellData.js +4 -11
  28. package/dist/components/TariffsTable/EmbeddableCellData.js.map +1 -1
  29. package/dist/components/TariffsTable/TariffsTable.js +1 -1
  30. package/dist/components/TariffsTable/TariffsTable.js.map +1 -1
  31. package/dist/components/TariffsTable/TariffsTableCell.d.ts +8 -2
  32. package/dist/components/TariffsTable/TariffsTableCell.js +13 -18
  33. package/dist/components/TariffsTable/TariffsTableCell.js.map +1 -1
  34. package/dist/components/TariffsTable/TariffsTableContent.d.ts +3 -4
  35. package/dist/components/TariffsTable/TariffsTableRenderCell.d.ts +11 -0
  36. package/dist/components/TariffsTable/TariffsTableRenderCell.js +42 -0
  37. package/dist/components/TariffsTable/TariffsTableRenderCell.js.map +1 -0
  38. package/dist/components/TariffsTable/TariffsTableRow.d.ts +0 -1
  39. package/dist/components/TariffsTable/TariffsTableRow.js +6 -2
  40. package/dist/components/TariffsTable/TariffsTableRow.js.map +1 -1
  41. package/dist/components/TariffsTable/TariffsTableRowContainer.d.ts +3 -1
  42. package/dist/components/TariffsTable/TariffsTableRowContainer.js +2 -8
  43. package/dist/components/TariffsTable/TariffsTableRowContainer.js.map +1 -1
  44. package/dist/components/TariffsTable/TariffsTableTileCell.js +1 -1
  45. package/dist/components/TariffsTable/TariffsTableTileCell.js.map +1 -1
  46. package/dist/ui-kit/InnerTable/InnerTable.d.ts +1 -0
  47. package/dist/ui-kit/InnerTable/InnerTable.js +3 -2
  48. package/dist/ui-kit/InnerTable/InnerTable.js.map +1 -1
  49. package/dist/ui-kit/InnerTable/InnerTableButton.d.ts +1 -0
  50. package/dist/ui-kit/InnerTable/InnerTableButton.js +2 -6
  51. package/dist/ui-kit/InnerTable/InnerTableButton.js.map +1 -1
  52. package/dist/ui-kit/InputRange/InputRange.js +1 -1
  53. package/dist/ui-kit/InputRange/InputRange.js.map +1 -1
  54. package/dist/ui-kit/Radio/Radio.js +1 -1
  55. package/dist/ui-kit/Radio/Radio.js.map +1 -1
  56. package/dist/ui-kit/Select/Select.js +1 -1
  57. package/dist/ui-kit/Select/Select.js.map +1 -1
  58. package/lib/common.css +1 -1
  59. package/lib/components/Bonus/Bonus.js +1 -1
  60. package/lib/components/Bonus/Bonus.js.map +1 -1
  61. package/lib/components/ProductBlock/renderBackwardButton.js +1 -1
  62. package/lib/components/ProductBlock/renderBackwardButton.js.map +1 -1
  63. package/lib/components/SafeDepositRental/SafeDepositRental.js +1 -1
  64. package/lib/components/SafeDepositRental/SafeDepositRental.js.map +1 -1
  65. package/lib/components/StepsBlock/StepsBlock.fixture.d.ts +6 -2
  66. package/lib/components/StepsBlock/StepsBlock.js +3 -3
  67. package/lib/components/StepsBlock/StepsBlock.js.map +1 -1
  68. package/lib/components/StepsBlock/renderItems.js +1 -4
  69. package/lib/components/StepsBlock/renderItems.js.map +1 -1
  70. package/lib/components/StepsBlock/renderStepContent.d.ts +2 -2
  71. package/lib/components/StepsBlock/renderStepContent.js +14 -9
  72. package/lib/components/StepsBlock/renderStepContent.js.map +1 -1
  73. package/lib/components/TariffsTable/EmbeddableCellData.d.ts +7 -1
  74. package/lib/components/TariffsTable/EmbeddableCellData.js +4 -11
  75. package/lib/components/TariffsTable/EmbeddableCellData.js.map +1 -1
  76. package/lib/components/TariffsTable/TariffsTable.js +1 -1
  77. package/lib/components/TariffsTable/TariffsTable.js.map +1 -1
  78. package/lib/components/TariffsTable/TariffsTableCell.d.ts +8 -2
  79. package/lib/components/TariffsTable/TariffsTableCell.js +14 -19
  80. package/lib/components/TariffsTable/TariffsTableCell.js.map +1 -1
  81. package/lib/components/TariffsTable/TariffsTableContent.d.ts +3 -4
  82. package/lib/components/TariffsTable/TariffsTableRenderCell.d.ts +11 -0
  83. package/lib/components/TariffsTable/TariffsTableRenderCell.js +39 -0
  84. package/lib/components/TariffsTable/TariffsTableRenderCell.js.map +1 -0
  85. package/lib/components/TariffsTable/TariffsTableRow.d.ts +0 -1
  86. package/lib/components/TariffsTable/TariffsTableRow.js +6 -2
  87. package/lib/components/TariffsTable/TariffsTableRow.js.map +1 -1
  88. package/lib/components/TariffsTable/TariffsTableRowContainer.d.ts +3 -1
  89. package/lib/components/TariffsTable/TariffsTableRowContainer.js +2 -8
  90. package/lib/components/TariffsTable/TariffsTableRowContainer.js.map +1 -1
  91. package/lib/components/TariffsTable/TariffsTableTileCell.js +1 -1
  92. package/lib/components/TariffsTable/TariffsTableTileCell.js.map +1 -1
  93. package/lib/ui-kit/InnerTable/InnerTable.d.ts +1 -0
  94. package/lib/ui-kit/InnerTable/InnerTable.js +3 -2
  95. package/lib/ui-kit/InnerTable/InnerTable.js.map +1 -1
  96. package/lib/ui-kit/InnerTable/InnerTableButton.d.ts +1 -0
  97. package/lib/ui-kit/InnerTable/InnerTableButton.js +2 -6
  98. package/lib/ui-kit/InnerTable/InnerTableButton.js.map +1 -1
  99. package/lib/ui-kit/InputRange/InputRange.js +1 -1
  100. package/lib/ui-kit/InputRange/InputRange.js.map +1 -1
  101. package/lib/ui-kit/Radio/Radio.js +1 -1
  102. package/lib/ui-kit/Radio/Radio.js.map +1 -1
  103. package/lib/ui-kit/Select/Select.js +1 -1
  104. package/lib/ui-kit/Select/Select.js.map +1 -1
  105. package/mobile/bundle/bundle.umd.js +2 -2
  106. package/mobile/bundle/bundle.umd.min.js +1 -1
  107. package/mobile/bundle/components/StepsBlock/renderStepContent.d.ts +2 -2
  108. package/mobile/bundle/components/TariffsTable/TariffsTableCell.d.ts +8 -2
  109. package/mobile/bundle/components/TariffsTable/TariffsTableContent.d.ts +3 -4
  110. package/mobile/bundle/components/TariffsTable/TariffsTableRenderCell.d.ts +11 -0
  111. package/mobile/bundle/components/TariffsTable/TariffsTableRow.d.ts +0 -1
  112. package/mobile/bundle/components/TariffsTable/TariffsTableRowContainer.d.ts +3 -1
  113. package/mobile/bundle/ui-kit/InnerTable/InnerTable.d.ts +1 -0
  114. package/mobile/bundle/ui-kit/InnerTable/InnerTableButton.d.ts +1 -0
  115. package/mobile/dist/components/Bonus/Bonus.js +1 -1
  116. package/mobile/dist/components/Bonus/Bonus.js.map +1 -1
  117. package/mobile/dist/components/ProductBlock/renderBackwardButton.js +1 -1
  118. package/mobile/dist/components/ProductBlock/renderBackwardButton.js.map +1 -1
  119. package/mobile/dist/components/SafeDepositRental/SafeDepositRental.js +1 -1
  120. package/mobile/dist/components/SafeDepositRental/SafeDepositRental.js.map +1 -1
  121. package/mobile/dist/components/StepsBlock/renderItems.js +1 -4
  122. package/mobile/dist/components/StepsBlock/renderItems.js.map +1 -1
  123. package/mobile/dist/components/StepsBlock/renderStepContent.d.ts +2 -2
  124. package/mobile/dist/components/StepsBlock/renderStepContent.js +13 -8
  125. package/mobile/dist/components/StepsBlock/renderStepContent.js.map +1 -1
  126. package/mobile/dist/components/TariffsTable/TariffsTableCell.d.ts +8 -2
  127. package/mobile/dist/components/TariffsTable/TariffsTableCell.js +13 -18
  128. package/mobile/dist/components/TariffsTable/TariffsTableCell.js.map +1 -1
  129. package/mobile/dist/components/TariffsTable/TariffsTableContent.d.ts +3 -4
  130. package/mobile/dist/components/TariffsTable/TariffsTableRenderCell.d.ts +11 -0
  131. package/mobile/dist/components/TariffsTable/TariffsTableRenderCell.js +42 -0
  132. package/mobile/dist/components/TariffsTable/TariffsTableRenderCell.js.map +1 -0
  133. package/mobile/dist/components/TariffsTable/TariffsTableRow.d.ts +0 -1
  134. package/mobile/dist/components/TariffsTable/TariffsTableRow.js +6 -2
  135. package/mobile/dist/components/TariffsTable/TariffsTableRow.js.map +1 -1
  136. package/mobile/dist/components/TariffsTable/TariffsTableRowContainer.d.ts +3 -1
  137. package/mobile/dist/components/TariffsTable/TariffsTableRowContainer.js +2 -8
  138. package/mobile/dist/components/TariffsTable/TariffsTableRowContainer.js.map +1 -1
  139. package/mobile/dist/components/TariffsTable/TariffsTableTileCell.js +1 -1
  140. package/mobile/dist/components/TariffsTable/TariffsTableTileCell.js.map +1 -1
  141. package/mobile/dist/ui-kit/InnerTable/InnerTable.d.ts +1 -0
  142. package/mobile/dist/ui-kit/InnerTable/InnerTable.js +3 -2
  143. package/mobile/dist/ui-kit/InnerTable/InnerTable.js.map +1 -1
  144. package/mobile/dist/ui-kit/InnerTable/InnerTableButton.d.ts +1 -0
  145. package/mobile/dist/ui-kit/InnerTable/InnerTableButton.js +2 -6
  146. package/mobile/dist/ui-kit/InnerTable/InnerTableButton.js.map +1 -1
  147. package/mobile/dist/ui-kit/InputRange/InputRange.js +1 -1
  148. package/mobile/dist/ui-kit/InputRange/InputRange.js.map +1 -1
  149. package/mobile/dist/ui-kit/Radio/Radio.js +1 -1
  150. package/mobile/dist/ui-kit/Radio/Radio.js.map +1 -1
  151. package/mobile/dist/ui-kit/Select/Select.js +1 -1
  152. package/mobile/dist/ui-kit/Select/Select.js.map +1 -1
  153. package/mobile/lib/components/Bonus/Bonus.js +1 -1
  154. package/mobile/lib/components/Bonus/Bonus.js.map +1 -1
  155. package/mobile/lib/components/ProductBlock/renderBackwardButton.js +1 -1
  156. package/mobile/lib/components/ProductBlock/renderBackwardButton.js.map +1 -1
  157. package/mobile/lib/components/SafeDepositRental/SafeDepositRental.js +1 -1
  158. package/mobile/lib/components/SafeDepositRental/SafeDepositRental.js.map +1 -1
  159. package/mobile/lib/components/StepsBlock/renderItems.js +1 -4
  160. package/mobile/lib/components/StepsBlock/renderItems.js.map +1 -1
  161. package/mobile/lib/components/StepsBlock/renderStepContent.d.ts +2 -2
  162. package/mobile/lib/components/StepsBlock/renderStepContent.js +14 -9
  163. package/mobile/lib/components/StepsBlock/renderStepContent.js.map +1 -1
  164. package/mobile/lib/components/TariffsTable/TariffsTableCell.d.ts +8 -2
  165. package/mobile/lib/components/TariffsTable/TariffsTableCell.js +14 -19
  166. package/mobile/lib/components/TariffsTable/TariffsTableCell.js.map +1 -1
  167. package/mobile/lib/components/TariffsTable/TariffsTableContent.d.ts +3 -4
  168. package/mobile/lib/components/TariffsTable/TariffsTableRenderCell.d.ts +11 -0
  169. package/mobile/lib/components/TariffsTable/TariffsTableRenderCell.js +39 -0
  170. package/mobile/lib/components/TariffsTable/TariffsTableRenderCell.js.map +1 -0
  171. package/mobile/lib/components/TariffsTable/TariffsTableRow.d.ts +0 -1
  172. package/mobile/lib/components/TariffsTable/TariffsTableRow.js +6 -2
  173. package/mobile/lib/components/TariffsTable/TariffsTableRow.js.map +1 -1
  174. package/mobile/lib/components/TariffsTable/TariffsTableRowContainer.d.ts +3 -1
  175. package/mobile/lib/components/TariffsTable/TariffsTableRowContainer.js +2 -8
  176. package/mobile/lib/components/TariffsTable/TariffsTableRowContainer.js.map +1 -1
  177. package/mobile/lib/components/TariffsTable/TariffsTableTileCell.js +1 -1
  178. package/mobile/lib/components/TariffsTable/TariffsTableTileCell.js.map +1 -1
  179. package/mobile/lib/ui-kit/InnerTable/InnerTable.d.ts +1 -0
  180. package/mobile/lib/ui-kit/InnerTable/InnerTable.js +3 -2
  181. package/mobile/lib/ui-kit/InnerTable/InnerTable.js.map +1 -1
  182. package/mobile/lib/ui-kit/InnerTable/InnerTableButton.d.ts +1 -0
  183. package/mobile/lib/ui-kit/InnerTable/InnerTableButton.js +2 -6
  184. package/mobile/lib/ui-kit/InnerTable/InnerTableButton.js.map +1 -1
  185. package/mobile/lib/ui-kit/InputRange/InputRange.js +1 -1
  186. package/mobile/lib/ui-kit/InputRange/InputRange.js.map +1 -1
  187. package/mobile/lib/ui-kit/Radio/Radio.js +1 -1
  188. package/mobile/lib/ui-kit/Radio/Radio.js.map +1 -1
  189. package/mobile/lib/ui-kit/Select/Select.js +1 -1
  190. package/mobile/lib/ui-kit/Select/Select.js.map +1 -1
  191. package/mobile/src/components/Bonus/Bonus.tsx +1 -1
  192. package/mobile/src/components/ProductBlock/renderBackwardButton.tsx +5 -1
  193. package/mobile/src/components/SafeDepositRental/SafeDepositRental.tsx +6 -1
  194. package/mobile/src/components/StepsBlock/renderItems.tsx +5 -8
  195. package/mobile/src/components/StepsBlock/renderStepContent.tsx +40 -15
  196. package/mobile/src/components/TariffsTable/TariffsTableCell.tsx +39 -45
  197. package/mobile/src/components/TariffsTable/TariffsTableContent.ts +3 -4
  198. package/mobile/src/components/TariffsTable/TariffsTableRenderCell.tsx +88 -0
  199. package/mobile/src/components/TariffsTable/TariffsTableRow.tsx +18 -9
  200. package/mobile/src/components/TariffsTable/TariffsTableRowContainer.tsx +5 -20
  201. package/mobile/src/components/TariffsTable/TariffsTableTileCell.tsx +3 -1
  202. package/mobile/src/ui-kit/InnerTable/InnerTable.tsx +13 -4
  203. package/mobile/src/ui-kit/InnerTable/InnerTableButton.tsx +20 -26
  204. package/mobile/src/ui-kit/InputRange/InputRange.tsx +1 -1
  205. package/mobile/src/ui-kit/Radio/Radio.tsx +2 -2
  206. package/mobile/src/ui-kit/Select/Select.tsx +1 -1
  207. package/package.json +1 -1
  208. package/src/components/Bonus/Bonus.tsx +1 -1
  209. package/src/components/ProductBlock/renderBackwardButton.tsx +5 -1
  210. package/src/components/SafeDepositRental/SafeDepositRental.tsx +6 -1
  211. package/src/components/StepsBlock/StepsBlock.fixture.tsx +72 -81
  212. package/src/components/StepsBlock/StepsBlock.tsx +3 -3
  213. package/src/components/StepsBlock/renderItems.tsx +5 -8
  214. package/src/components/StepsBlock/renderStepContent.tsx +40 -15
  215. package/src/components/TariffsTable/EmbeddableCellData.tsx +20 -18
  216. package/src/components/TariffsTable/TariffsTable.tsx +1 -2
  217. package/src/components/TariffsTable/TariffsTableCell.tsx +39 -45
  218. package/src/components/TariffsTable/TariffsTableContent.ts +3 -4
  219. package/src/components/TariffsTable/TariffsTableRenderCell.tsx +88 -0
  220. package/src/components/TariffsTable/TariffsTableRow.tsx +18 -9
  221. package/src/components/TariffsTable/TariffsTableRowContainer.tsx +5 -20
  222. package/src/components/TariffsTable/TariffsTableTileCell.tsx +3 -1
  223. package/src/ui-kit/InnerTable/InnerTable.tsx +13 -4
  224. package/src/ui-kit/InnerTable/InnerTableButton.tsx +20 -26
  225. package/src/ui-kit/InputRange/InputRange.tsx +1 -1
  226. package/src/ui-kit/Radio/Radio.tsx +2 -2
  227. package/src/ui-kit/Select/Select.tsx +1 -1
@@ -1,9 +1,19 @@
1
1
  import { context } from '../../react/setup-fixture';
2
2
  import { StepsBlock } from './StepsBlock';
3
+ import type { StepsBlockProps } from './StepsBlock';
3
4
  import type { Step } from './StepsBlockContent';
4
5
 
5
- const ITEMS = ['item1', 'item2', 'item3', 'item4', 'item5'];
6
- const STEPS = [
6
+ const TITLE =
7
+ 'Рассчитайте условия на онлайн-калькуляторе и оставьте заявку на потребительский кредит';
8
+
9
+ const ITEMS: Step['items'] = ['item1', 'item2', 'item3', 'item4', 'item5'];
10
+ const COMMON_PROPS: StepsBlockProps = {
11
+ className: 'col-span-12',
12
+ context,
13
+ title: TITLE,
14
+ };
15
+
16
+ const STEPS: Step[] = [
7
17
  {
8
18
  label: 'Заявка на кредит',
9
19
  description: 'Оставьте онлайн-заявку на потребительский кредит',
@@ -22,93 +32,71 @@ const STEPS = [
22
32
  },
23
33
  ];
24
34
 
25
- const STEPS_WITH_LIST: Step[] = [
35
+ const STEPS_WITH_ICONS: Step[] = [
26
36
  {
27
37
  label: 'В мобильном приложении или интернет-банке',
28
38
  description: 'Для всех клиентов Россельхозбанка',
29
39
  icon: { icon: 'SignDocsIcon' },
30
- items: ITEMS,
31
40
  },
32
41
  {
33
42
  label: 'Через Госуслуги',
34
43
  description: 'При наличии данных в Единой биометрической системе',
35
44
  icon: { icon: 'ClockIcon' },
36
- items: ITEMS,
37
45
  },
38
46
  {
39
47
  label: 'В офисах Россельхозбанка',
40
48
  description: 'Откройте вклад',
41
49
  icon: { icon: 'ComfortableCompIcon' },
42
- items: ITEMS,
43
50
  },
44
51
  ];
45
52
 
53
+ const BUTTONS: Step['button'][] = [
54
+ { text: 'Войти в интернет-банк' },
55
+ { text: 'Оформить' },
56
+ { text: 'Офисы на карте' },
57
+ ];
58
+
59
+ const STEPS_WITH_BUTTONS_AND_ICONS: Step[] = STEPS_WITH_ICONS.map((step, i) => ({
60
+ ...step,
61
+ button: BUTTONS[i],
62
+ }));
63
+
64
+ const STEPS_WITH_LIST_PROPS: StepsBlockProps = {
65
+ ...COMMON_PROPS,
66
+ steps: STEPS_WITH_ICONS.map((step) => ({ ...step, description: '', items: ITEMS })),
67
+ };
68
+
69
+ const STEPS_WITH_LIST_AND_DESC_PROPS: StepsBlockProps = {
70
+ ...COMMON_PROPS,
71
+ steps: STEPS_WITH_ICONS.map((step) => ({ ...step, items: ITEMS })),
72
+ };
73
+
74
+ const STEPS_WITH_BUTTON_PROPS: StepsBlockProps = {
75
+ ...COMMON_PROPS,
76
+ steps: STEPS.map((step) => ({
77
+ ...step,
78
+ button: { text: 'Оформить' },
79
+ })),
80
+ title: TITLE,
81
+ };
82
+
46
83
  export default {
47
84
  default: (
48
85
  <div className="container grid grid-cols-12">
49
- <StepsBlock
50
- className="col-span-12"
51
- context={context}
52
- title="Рассчитайте условия на онлайн-калькуляторе и оставьте заявку на потребительский кредит"
53
- steps={STEPS.slice(0, 3)}
54
- version="secondary"
55
- />
86
+ <StepsBlock {...COMMON_PROPS} steps={STEPS.slice(0, 3)} version="secondary" />
56
87
  </div>
57
88
  ),
58
89
  'steps-img': (
59
90
  <div className="container grid grid-cols-12">
60
- <StepsBlock
61
- className="col-span-12"
62
- context={context}
63
- title="Рассчитайте условия на онлайн-калькуляторе и оставьте заявку на потребительский кредит"
64
- showLines={false}
65
- steps={[
66
- {
67
- label: 'В мобильном приложении или интернет-банке',
68
- description: 'Для всех клиентов Россельхозбанка',
69
- icon: { icon: 'SignDocsIcon' },
70
- button: { text: 'Войти в интернет-банк' },
71
- },
72
- {
73
- label: 'Через Госуслуги',
74
- description: 'При наличии данных в Единой биометрической системе',
75
- icon: { icon: 'ClockIcon' },
76
- button: { text: 'Оформить' },
77
- },
78
- {
79
- label: 'В офисах Россельхозбанка',
80
- description: 'Откройте вклад',
81
- icon: { icon: 'ComfortableCompIcon' },
82
- button: { text: 'Офисы на карте' },
83
- },
84
- ]}
85
- />
91
+ <StepsBlock {...COMMON_PROPS} showLines={false} steps={STEPS_WITH_BUTTONS_AND_ICONS} />
86
92
  </div>
87
93
  ),
88
94
  'steps-with-btn': (
89
95
  <div className="container grid grid-cols-12">
90
96
  <StepsBlock
91
- className="col-span-12"
92
- context={context}
93
- title="Рассчитайте условия на онлайн-калькуляторе и оставьте заявку на потребительский кредит"
97
+ {...COMMON_PROPS}
94
98
  showLines={false}
95
- steps={[
96
- {
97
- label: 'В мобильном приложении или интернет-банке',
98
- description: 'Для всех клиентов Россельхозбанка',
99
- icon: { icon: 'SignDocsIcon' },
100
- },
101
- {
102
- label: 'Через Госуслуги',
103
- description: 'При наличии данных в Единой биометрической системе',
104
- icon: { icon: 'ClockIcon' },
105
- },
106
- {
107
- label: 'В офисах Россельхозбанка',
108
- description: 'Откройте вклад',
109
- icon: { icon: 'ComfortableCompIcon' },
110
- },
111
- ]}
99
+ steps={STEPS_WITH_ICONS}
112
100
  button={{
113
101
  text: 'Отправить заявку',
114
102
  href: 'https://www.rshb.ru/',
@@ -121,34 +109,37 @@ export default {
121
109
  ),
122
110
  '4 steps': (
123
111
  <div className="container grid grid-cols-12">
124
- <StepsBlock
125
- className="col-span-12"
126
- context={context}
127
- title="Рассчитайте условия на онлайн-калькуляторе и оставьте заявку на потребительский кредит"
128
- steps={STEPS}
129
- />
112
+ <StepsBlock {...COMMON_PROPS} steps={STEPS} />
130
113
  </div>
131
114
  ),
132
-
133
- 'with list': (
115
+ 'with list and description': (
134
116
  <div className="container grid grid-cols-12">
135
- <StepsBlock
136
- className="col-span-12"
137
- context={context}
138
- title="Рассчитайте условия на онлайн-калькуляторе и оставьте заявку на потребительский кредит"
139
- steps={STEPS_WITH_LIST}
140
- />
117
+ <StepsBlock {...STEPS_WITH_LIST_PROPS} version="primary" />
141
118
  </div>
142
119
  ),
143
- 'with list secondary': (
120
+ 'with list and description secondary': (
144
121
  <div className="container grid grid-cols-12">
145
- <StepsBlock
146
- className="col-span-12"
147
- context={context}
148
- version="secondary"
149
- title="Рассчитайте условия на онлайн-калькуляторе и оставьте заявку на потребительский кредит"
150
- steps={STEPS_WITH_LIST}
151
- />
122
+ <StepsBlock {...STEPS_WITH_LIST_AND_DESC_PROPS} version="secondary" />
123
+ </div>
124
+ ),
125
+ 'with list, no description': (
126
+ <div className="container grid grid-cols-12">
127
+ <StepsBlock {...STEPS_WITH_LIST_AND_DESC_PROPS} version="primary" />
128
+ </div>
129
+ ),
130
+ 'with list, no description secondary': (
131
+ <div className="container grid grid-cols-12">
132
+ <StepsBlock {...STEPS_WITH_LIST_PROPS} version="secondary" />
133
+ </div>
134
+ ),
135
+ 'with button primary': (
136
+ <div className="container grid grid-cols-12">
137
+ <StepsBlock {...STEPS_WITH_BUTTON_PROPS} version="primary" />
138
+ </div>
139
+ ),
140
+ 'with button secondary': (
141
+ <div className="container grid grid-cols-12">
142
+ <StepsBlock {...STEPS_WITH_BUTTON_PROPS} version="secondary" />
152
143
  </div>
153
144
  ),
154
145
  };
@@ -41,9 +41,9 @@ export const StepsBlock = JSX<StepsBlockProps>(
41
41
  return (
42
42
  <BlockWrapper
43
43
  className={[
44
- 'box-border font-sans text-primary-text bg-white',
44
+ 'box-border py-[50px] font-sans',
45
45
  shortGaps ? 'px-20' : 'px-[70px]',
46
- 'py-[50px] flex flex-col items-center',
46
+ 'flex flex-col items-center',
47
47
  styleMap.background,
48
48
  styleMap.title,
49
49
  className,
@@ -61,7 +61,7 @@ export const StepsBlock = JSX<StepsBlockProps>(
61
61
  steps.map(renderStepIcon(styleMap)),
62
62
  )}
63
63
  </div>
64
- <div className={`flex justify-between ${shortGaps ? 'gap-x-3' : 'gap-x-[101px]'}`}>
64
+ <div className={`flex justify-between mt-4 ${shortGaps ? 'gap-x-3' : 'gap-x-[101px]'}`}>
65
65
  {steps.map(
66
66
  renderStepContent({
67
67
  styleMap,
@@ -11,16 +11,13 @@ export const renderItems = ({
11
11
  isDotted?: boolean;
12
12
  version?: BlockVersion;
13
13
  className?: string;
14
- }) => {
15
- const listVersion = version === 'primary' ? 'gray' : version;
16
-
17
- return items ? (
14
+ }) =>
15
+ items ? (
18
16
  <List
19
- className={`mt-4 ${className}`}
20
- version={listVersion}
17
+ className={className}
18
+ version={version}
21
19
  items={items}
22
- listItemSize="S"
20
+ listItemSize="M"
23
21
  isDotted={isDotted}
24
22
  />
25
23
  ) : null;
26
- };
@@ -3,6 +3,7 @@ import type { BlockVersion } from '../../model/BlockVersion';
3
3
  import type { HandlerDecorator, Router } from '../ContentPage/ContentPageContext';
4
4
  import type { Step } from './StepsBlockContent';
5
5
  import type { StyleType } from './StepsBlockStyleMaps';
6
+ import type { VNode } from '../../model/VNode';
6
7
  import { renderItems } from './renderItems';
7
8
  import { useLink } from '../../hooks/useLink';
8
9
 
@@ -20,39 +21,48 @@ export const renderStepContent =
20
21
  router: Router;
21
22
  handlerDecorator?: HandlerDecorator;
22
23
  }) =>
23
- (step: Step, i: number, { length }: { length: number }) => {
24
+ (step: Step, i: number, { length }: { length: number }): VNode => {
24
25
  const { label, description, button, items, isDotted } = step;
25
26
 
26
- const additionalMarginClass = `${button?.text ? 'mb-8' : ''} ${step?.label ? 'mt-2' : 'mt-4'}`;
27
- const widthContainer = length < 5 ? 'w-[276px]' : 'w-[210px]';
27
+ const contentMarginClass = label && (description || items) ? 'mt-2' : '';
28
28
 
29
29
  return (
30
30
  <div
31
31
  key={String(i)}
32
- className={`flex flex-col items-center text-center relative
33
- whitespace-pre-line overflow-hidden ${widthContainer}`}
32
+ className={`relative flex flex-col items-center text-center whitespace-pre-line overflow-hidden ${getContainerWidth(
33
+ length,
34
+ )}`}
34
35
  >
35
- {renderStepLabel(label)}
36
- {renderStepDescription({
37
- description,
38
- className: `${styleMap.description} ${additionalMarginClass}`,
39
- })}
40
- {renderItems({ items, isDotted, version, className: styleMap.description })}
36
+ <div className={`${button?.text ? 'mb-8' : ''} text-center`}>
37
+ {renderStepLabel(label)}
38
+ <div className={`${contentMarginClass} flex flex-col items-center`}>
39
+ {renderStepDescription({
40
+ description,
41
+ className: styleMap.description,
42
+ })}
43
+ {renderItems({
44
+ items,
45
+ isDotted,
46
+ version,
47
+ className: getItemsClasses({ className: 'text-left', description, styleMap }),
48
+ })}
49
+ </div>
50
+ </div>
41
51
  {button?.text && !isMainButton ? (
42
52
  <Button
43
53
  className="box-border py-3 h-12 w-full max-w-[240px] mt-auto"
44
54
  {...useLink({ router, handlerDecorator }, button)}
45
55
  version={version}
46
56
  >
47
- {button.text}
57
+ {button?.text}
48
58
  </Button>
49
59
  ) : null}
50
60
  </div>
51
61
  );
52
62
  };
53
63
 
54
- const renderStepLabel = (label?: string) =>
55
- label ? <div className="text-x6 m-0 mt-4">{label}</div> : null;
64
+ const renderStepLabel = (label?: string): VNode =>
65
+ label ? <div className="text-h6">{label}</div> : null;
56
66
 
57
67
  const renderStepDescription = ({
58
68
  description,
@@ -60,4 +70,19 @@ const renderStepDescription = ({
60
70
  }: {
61
71
  description?: string;
62
72
  className?: string;
63
- }) => (description ? <div className={className}>{description}</div> : null);
73
+ }): VNode => (description ? <div className={className}>{description}</div> : null);
74
+
75
+ const getItemsClasses = ({
76
+ className,
77
+ description,
78
+ styleMap,
79
+ }: {
80
+ className?: string;
81
+ description?: string;
82
+ styleMap: StyleType;
83
+ }): string =>
84
+ [description ? styleMap.description : 'text-h6', description ? 'mt-0.5' : '', className].join(
85
+ ' ',
86
+ );
87
+
88
+ const getContainerWidth = (length: number): string => (length < 5 ? 'w-[276px]' : 'w-[210px]');
@@ -1,15 +1,13 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
3
- import { EventBus } from '../../EventBus/EventBus';
4
2
  import type { ButtonContent } from '../../ui-kit/Button/ButtonProps';
5
3
  import { renderButton } from '../../ui-kit/Button/ButtonSection';
6
4
  import { Img } from '../../ui-kit/Img/Img';
7
5
  import type { ImageContent } from '../../ui-kit/Img/ImgProps';
8
6
  import { TableInnerButton, TableInnerButtonProps } from '../../ui-kit/InnerTable/InnerTableButton';
9
- import { TariffsTableInnerEvent } from '../../ui-kit/InnerTable/InnerTableProps';
7
+ import type { TariffsTableInnerContent } from '../../ui-kit/InnerTable/InnerTableProps';
10
8
  import { List } from '../../ui-kit/List/List';
11
9
  import type { ListProps } from '../../ui-kit/List/ListProps';
12
- import type { LabelDescriptionCell, TariffsTableCellIndexProps } from './TariffsTableContent';
10
+ import type { LabelDescriptionCell } from './TariffsTableContent';
13
11
 
14
12
  export type EmbeddableCellDataType =
15
13
  | LabelDescriptionCell
@@ -18,6 +16,11 @@ export type EmbeddableCellDataType =
18
16
  | ListProps
19
17
  | TableInnerButtonProps;
20
18
 
19
+ interface TableCellDataProps extends TableInnerButtonProps {
20
+ isVisible?: boolean;
21
+ displayTable: (props: TariffsTableInnerContent) => void;
22
+ }
23
+
21
24
  const renderButtonsCellData = ({ buttons }: ButtonContent) =>
22
25
  buttons && buttons?.length ? (
23
26
  <div>
@@ -52,20 +55,19 @@ const renderListCellData = ({ isDotted, ...rest }: ListProps) => (
52
55
  />
53
56
  );
54
57
 
55
- const renderTableCellData = JSX((props: TableInnerButtonProps) => {
56
- const [showBtn, setShowBtn] = useState(true);
57
- console.log(props);
58
- const tariffInnerTableSubscriber = (event: TariffsTableInnerEvent) => {
59
- const _showBtn = (
60
- ['rowIdx', 'cellIdx', 'fieldIdx'] as Array<keyof TariffsTableCellIndexProps>
61
- ).every((key) => props[key] === event[key]);
62
- setShowBtn(!_showBtn);
63
- };
64
-
65
- useEffect(() => EventBus.inst.subscribe('tariffInnerTable', tariffInnerTableSubscriber), []);
66
-
67
- return showBtn ? <TableInnerButton {...props} /> : null;
68
- });
58
+ const renderTableCellData = JSX<TableCellDataProps>(
59
+ ({ isVisible, displayTable, dataUrl, pdfUrl, isOpen, context }) => {
60
+ return isVisible ? (
61
+ <TableInnerButton
62
+ isOpen={isOpen}
63
+ context={context}
64
+ onClick={() => {
65
+ displayTable({ dataUrl, pdfUrl });
66
+ }}
67
+ />
68
+ ) : null;
69
+ },
70
+ );
69
71
 
70
72
  export const EmbeddableCellData = {
71
73
  Buttons: renderButtonsCellData,
@@ -43,12 +43,11 @@ export const TariffsTable = JSX<TariffsTableProps>(
43
43
  setActiveCardIndex,
44
44
  });
45
45
 
46
- const rows = (rowData || []).map((row, i, { length }) => (
46
+ const rows = (rowData || []).map((row, i) => (
47
47
  <TariffsTableRow
48
48
  context={context}
49
49
  key={String(i)}
50
50
  row={row}
51
- isLastRow={i + 1 === length}
52
51
  activeCardIndex={activeCardIndex}
53
52
  rowIdx={i}
54
53
  />
@@ -1,59 +1,53 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import type { UniBlockProps } from '../../model/JSXBlock';
3
- import type { ContentPageContext } from '../ContentPage/ContentPageContext';
4
- import { EmbeddableCellData } from './EmbeddableCellData';
5
- import type { CellDef, TariffsTableCellIndexProps } from './TariffsTableContent';
3
+ import type { TariffsTableInnerContent } from '../../ui-kit/InnerTable/InnerTableProps';
6
4
 
7
- export interface TariffsTableCellProps extends UniBlockProps {
5
+ import type { CellDef } from './TariffsTableContent';
6
+ import { renderCellInner } from './TariffsTableRenderCell';
7
+
8
+ export interface TariffTableContentProps {
9
+ openTableInnerIdx?: number;
10
+ setOpenTableInnerIdx: (props?: number) => void;
11
+ setTableInner: (props?: TariffsTableInnerContent) => void;
12
+ tableInner?: TariffsTableInnerContent;
13
+ }
14
+
15
+ export interface TariffsTableCellProps extends TariffTableContentProps, UniBlockProps {
8
16
  rowIdx: number;
9
17
  cellIdx: number;
10
18
  cells: CellDef[];
11
- isLastRow: boolean;
12
19
  }
13
20
 
14
21
  export const TariffsTableCell = JSX<TariffsTableCellProps>(
15
- ({ context, cells, isLastRow, rowIdx, cellIdx }) => {
16
- const cellWrapperClasses = `first:pl-0 w-80 flex-grow flex flex-col border-solid border-main-divider border border-t-0 border-x-0 ${
17
- isLastRow ? 'border-t-0 rounded-b-md' : ''
18
- }`;
19
-
20
- return (
21
- <div className={cellWrapperClasses} role="cell">
22
- {cells.map(renderCellInner(rowIdx, context, cellIdx))}
23
- </div>
24
- );
25
- },
26
- );
27
-
28
- const renderCellInner =
29
- (rowIdx: number, context: ContentPageContext, cellIdx: number) => (cell: CellDef, i: number) => {
22
+ ({
23
+ context,
24
+ cells,
25
+ rowIdx,
26
+ cellIdx,
27
+ setTableInner,
28
+ tableInner,
29
+ openTableInnerIdx,
30
+ setOpenTableInnerIdx,
31
+ }) => {
30
32
  return (
31
33
  <div
32
- key={String(i)}
33
- className={cell?.tableCellType === 'Table' ? 'ml-10' : `first:pt-5 last:pb-5 pl-10`}
34
+ className="first:pl-0 w-80 flex-grow flex flex-col border-solid border-main-divider border border-t-0 border-x-0"
35
+ role="cell"
34
36
  >
35
- {i > 0 ? <div className="h-5" /> : null}
36
- {renderCell(cell, context, { rowIdx, cellIdx, fieldIdx: i })}
37
+ {cells?.length
38
+ ? cells.map(
39
+ renderCellInner({
40
+ rowIdx,
41
+ context,
42
+ cellIdx,
43
+ setTableInner,
44
+ tableInner,
45
+ openTableInnerIdx,
46
+ setOpenTableInnerIdx,
47
+ }),
48
+ )
49
+ : null}
37
50
  </div>
38
51
  );
39
- };
40
-
41
- const renderCell = (
42
- cell: CellDef,
43
- context: ContentPageContext,
44
- indexes: TariffsTableCellIndexProps,
45
- ) => {
46
- if (!cell) {
47
- return null;
48
- }
49
-
50
- const { tableCellType: type, ...rest } = cell;
51
-
52
- if (!type || !(type in EmbeddableCellData)) {
53
- return null;
54
- }
55
-
56
- const EmbeddableCellInner = EmbeddableCellData[type];
57
-
58
- return <EmbeddableCellInner context={context} {...rest} {...indexes} />;
59
- };
52
+ },
53
+ );
@@ -1,10 +1,9 @@
1
1
  import type { EmptyOption } from '../../model/EmptyOptionType';
2
- import type { DescriptionProps, LabelProps } from '../../model/HeadlineType';
2
+ import type { DescriptionProps, LabelProps, TitleProps } from '../../model/HeadlineType';
3
3
  import type { UniBlockProps } from '../../model/JSXBlock';
4
4
  import type { ListOrientation } from '../../model/ListOrientation';
5
5
  import type { Picture } from '../../model/Picture';
6
6
  import type { ButtonContent } from '../../ui-kit/Button/ButtonProps';
7
- import type { HeadingProps } from '../../ui-kit/Heading/HeadingProps';
8
7
  import type { TariffsTableInnerContent } from '../../ui-kit/InnerTable/InnerTableProps';
9
8
  import type { ListProps } from '../../ui-kit/List/ListProps';
10
9
 
@@ -43,7 +42,7 @@ export type Data = {
43
42
  /**
44
43
  * @title Параметр
45
44
  */
46
- export type TariffsTableRowHeader = HeadingProps & {
45
+ export type TariffsTableRowHeader = TitleProps & {
47
46
  /** @default { "format": "webp", "size": { "width": 24, "height": 24 } } */
48
47
  icon?: Picture;
49
48
  };
@@ -117,7 +116,7 @@ export interface TariffsTableColumn {
117
116
  /**
118
117
  * @title Таблица тарифов
119
118
  */
120
- export type TariffsTableContent = HeadingProps &
119
+ export type TariffsTableContent = TitleProps &
121
120
  DescriptionProps & {
122
121
  /** @title Колонки */
123
122
  tariffsColumns?: TariffsTableColumn[];
@@ -0,0 +1,88 @@
1
+ import { useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
2
+ import type { TariffsTableInnerContent } from '../../ui-kit/InnerTable/InnerTableProps';
3
+ import type { ContentPageContext } from '../ContentPage/ContentPageContext';
4
+ import { EmbeddableCellData } from './EmbeddableCellData';
5
+ import type { TariffTableContentProps } from './TariffsTableCell';
6
+ import type { CellDef } from './TariffsTableContent';
7
+
8
+ interface TariffTableCellInnerProps extends TariffTableContentProps {
9
+ cellIdx: number;
10
+ context: ContentPageContext;
11
+ rowIdx: number;
12
+ }
13
+
14
+ interface RenderCellProps {
15
+ cell: CellDef;
16
+ cellProps: CellProps;
17
+ }
18
+
19
+ interface CellProps {
20
+ isVisible?: boolean;
21
+ cellIdx: number;
22
+ context: ContentPageContext;
23
+ rowIdx: number;
24
+ fieldIdx: number;
25
+ displayTable: (props: TariffsTableInnerContent) => void;
26
+ }
27
+
28
+ export const renderCellInner =
29
+ ({
30
+ rowIdx,
31
+ context,
32
+ cellIdx,
33
+ setTableInner,
34
+ tableInner,
35
+ openTableInnerIdx,
36
+ setOpenTableInnerIdx,
37
+ }: TariffTableCellInnerProps) =>
38
+ (cell: CellDef, i: number) => {
39
+ const [isVisible, setVisibility] = useState(true);
40
+
41
+ useEffect(() => {
42
+ if (cellIdx !== openTableInnerIdx || !tableInner) {
43
+ setVisibility(true);
44
+ }
45
+ }, [tableInner, openTableInnerIdx]);
46
+
47
+ const displayTable = (props: TariffsTableInnerContent) => {
48
+ setVisibility(false);
49
+ setOpenTableInnerIdx(cellIdx);
50
+ setTableInner(props);
51
+ };
52
+
53
+ return (
54
+ <div
55
+ key={String(i)}
56
+ className={cell?.tableCellType === 'Table' ? 'ml-10' : `first:pt-5 last:pb-5 pl-10`}
57
+ >
58
+ {i > 0 ? <div className="h-5" /> : null}
59
+ {renderCell({
60
+ cell,
61
+ cellProps: {
62
+ rowIdx,
63
+ cellIdx,
64
+ fieldIdx: i,
65
+ displayTable,
66
+ isVisible,
67
+ context,
68
+ },
69
+ })}
70
+ </div>
71
+ );
72
+ };
73
+
74
+ const renderCell = ({ cell, cellProps }: RenderCellProps) => {
75
+ if (!cell) {
76
+ return null;
77
+ }
78
+
79
+ const { tableCellType: type, ...rest } = cell;
80
+
81
+ if (!type || !(type in EmbeddableCellData)) {
82
+ return null;
83
+ }
84
+
85
+ const EmbeddableCellInner = EmbeddableCellData[type];
86
+
87
+ return <EmbeddableCellInner {...cellProps} {...rest} />;
88
+ };