@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,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
+ };
@@ -1,6 +1,8 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
+ import { useState } from '@redneckz/uni-jsx/lib/hooks';
2
3
  import type { UniBlockProps } from '../../model/JSXBlock';
3
4
  import { Img } from '../../ui-kit/Img/Img';
5
+ import type { TariffsTableInnerContent } from '../../ui-kit/InnerTable/InnerTableProps';
4
6
  import { TableCarouselContainer } from '../ComparisonTable/TableCarouselContainer';
5
7
  import { COLUMN_WIDTH, DIVIDER_CLASSES, FIRST_CELL_CLASSES } from './constants';
6
8
  import { TariffsTableCell } from './TariffsTableCell';
@@ -10,19 +12,23 @@ import { TariffsTableRowContainer } from './TariffsTableRowContainer';
10
12
  export interface TariffsTableRowProps extends UniBlockProps {
11
13
  row: Data;
12
14
  activeCardIndex: number;
13
- isLastRow: boolean;
14
15
  rowIdx: number;
15
16
  }
16
17
 
17
18
  export const TariffsTableRow = JSX<TariffsTableRowProps>(
18
- ({ row: { header, data }, activeCardIndex, isLastRow, context, rowIdx }) => {
19
+ ({ row: { header, data }, activeCardIndex, context, rowIdx }) => {
20
+ const [tableInner, setTableInner] = useState<TariffsTableInnerContent | undefined>(undefined);
21
+ const [openTableInnerIdx, setOpenTableInnerIdx] = useState<number | undefined>(undefined);
22
+
23
+ const onHideContentClick = () => setTableInner(undefined);
24
+
19
25
  return (
20
- <TariffsTableRowContainer context={context} rowIdx={rowIdx}>
21
- <div
22
- className={`text-s py-5 ${FIRST_CELL_CLASSES} ${DIVIDER_CLASSES} ${
23
- !isLastRow ? 'border-solid' : ''
24
- }`}
25
- >
26
+ <TariffsTableRowContainer
27
+ context={context}
28
+ onHideContentClick={onHideContentClick}
29
+ tableInner={tableInner}
30
+ >
31
+ <div className={`text-s py-5 ${FIRST_CELL_CLASSES} ${DIVIDER_CLASSES}`}>
26
32
  <div className="flex items-center text-primary-text" role="cell">
27
33
  {header?.icon ? (
28
34
  <Img
@@ -46,10 +52,13 @@ export const TariffsTableRow = JSX<TariffsTableRowProps>(
46
52
  <TariffsTableCell
47
53
  key={String(i)}
48
54
  cells={cells}
49
- isLastRow={isLastRow}
50
55
  rowIdx={rowIdx}
51
56
  cellIdx={i}
52
57
  context={context}
58
+ setTableInner={setTableInner}
59
+ tableInner={tableInner}
60
+ openTableInnerIdx={openTableInnerIdx}
61
+ setOpenTableInnerIdx={setOpenTableInnerIdx}
53
62
  />
54
63
  ))}
55
64
  </TableCarouselContainer>
@@ -1,6 +1,4 @@
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 { UniBlockProps } from '../../model/JSXBlock';
5
3
  import type { VNode } from '../../model/VNode';
6
4
  import { InnerTable } from '../../ui-kit/InnerTable/InnerTable';
@@ -8,31 +6,18 @@ import type { TariffsTableInnerContent } from '../../ui-kit/InnerTable/InnerTabl
8
6
 
9
7
  export interface TariffsTableRowContainerProps extends UniBlockProps {
10
8
  children?: VNode;
11
- rowIdx: number;
9
+ onHideContentClick: () => void;
10
+ tableInner?: TariffsTableInnerContent;
12
11
  }
13
12
 
14
13
  export const TariffsTableRowContainer = JSX<TariffsTableRowContainerProps>(
15
- ({ context, children, rowIdx }) => {
16
- const [tableInnerData, setTableInnerData] = useState<TariffsTableInnerContent | undefined>(
17
- undefined,
18
- );
19
-
20
- useEffect(
21
- () =>
22
- EventBus.inst.subscribe('tariffInnerTable', (event) => {
23
- setTableInnerData(
24
- rowIdx === event.rowIdx ? { dataUrl: event.dataUrl, pdfUrl: event.pdfUrl } : undefined,
25
- );
26
- }),
27
- [rowIdx],
28
- );
29
-
14
+ ({ context, children, tableInner, onHideContentClick }) => {
30
15
  return (
31
16
  <div className="self-start flex flex-col" role="row">
32
17
  <div className="flex">{children}</div>
33
- {tableInnerData ? (
18
+ {tableInner ? (
34
19
  <div className="origin-top animate-expansion">
35
- <InnerTable context={context} {...tableInnerData} />
20
+ <InnerTable context={context} {...tableInner} onClick={onHideContentClick} />
36
21
  </div>
37
22
  ) : null}
38
23
  </div>
@@ -39,5 +39,7 @@ const renderCell = (cell: CellDef, context: ContentPageContext) => {
39
39
 
40
40
  const EmbeddableCellInner = EmbeddableCellData[type];
41
41
 
42
- return <EmbeddableCellInner context={context} {...rest} />;
42
+ return (
43
+ <EmbeddableCellInner context={context} displayTable={() => null} {...rest} isVisible={true} />
44
+ );
43
45
  };
@@ -7,9 +7,13 @@ import { TableInnerButton } from './InnerTableButton';
7
7
  import { InnerTableHeader } from './InnerTableHeader';
8
8
  import type { TableFetchData, TariffsTableInnerContent } from './InnerTableProps';
9
9
 
10
- export interface InnerTableProps extends TariffsTableInnerContent, UniBlockProps {}
10
+ export interface InnerTableProps extends TariffsTableInnerContent, UniBlockProps {
11
+ onClick: () => void;
12
+ }
11
13
 
12
- export const InnerTable = JSX<InnerTableProps>(({ context, dataUrl, pdfUrl }) => {
14
+ const EMPTY_DATA = 'Данных нет';
15
+
16
+ export const InnerTable = JSX<InnerTableProps>(({ context, dataUrl, pdfUrl, onClick }) => {
13
17
  const { tableData }: TableFetchData = useTariffsInnerTableData(dataUrl);
14
18
 
15
19
  const [activeTabIndex, setActiveTabIndex] = useState(0);
@@ -26,7 +30,12 @@ export const InnerTable = JSX<InnerTableProps>(({ context, dataUrl, pdfUrl }) =>
26
30
  linkToPDF={pdfUrl} //TODO: need link to service
27
31
  />
28
32
  <InnerTableBody context={context} activeTabIndex={activeTabIndex} items={items} />
29
- <TableInnerButton context={context} isOpen />
33
+ <TableInnerButton context={context} onClick={onClick} isOpen />
34
+ </div>
35
+ ) : (
36
+ <div className="my-5 text-h6 text-center">
37
+ <p>{EMPTY_DATA}</p>
38
+ <TableInnerButton context={context} onClick={onClick} isOpen />
30
39
  </div>
31
- ) : null;
40
+ );
32
41
  });
@@ -1,36 +1,30 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { EventBus } from '../../EventBus/EventBus';
3
2
  import type { UniBlockProps } from '../../model/JSXBlock';
4
3
  import { Button } from '../Button/Button';
5
4
  import { Icon } from '../Icon/Icon';
6
5
  import type { TariffsTableInnerEvent } from './InnerTableProps';
7
6
 
8
7
  export interface TableInnerButtonProps extends TariffsTableInnerEvent, UniBlockProps {
8
+ onClick?: () => void;
9
9
  isOpen?: boolean;
10
10
  }
11
11
 
12
- export const TableInnerButton = JSX<TableInnerButtonProps>(
13
- ({ isOpen, dataUrl, pdfUrl, rowIdx, cellIdx, fieldIdx }) => {
14
- const handleClick = () => {
15
- EventBus.inst.fire('tariffInnerTable', { dataUrl, pdfUrl, rowIdx, cellIdx, fieldIdx });
16
- };
17
-
18
- return (
19
- <Button
20
- version="primary"
21
- onClick={handleClick}
22
- className="w-full flex items-center justify-center rounded-none py-5"
23
- >
24
- <div className="text-h4">{isOpen ? 'Скрыть' : 'Показать ставки по вкладу'}</div>
25
- <Icon
26
- name={isOpen ? 'ArrowUpIcon' : 'ArrowDownIcon'}
27
- className="ml-3"
28
- iconVersion="white"
29
- width="20"
30
- height="20"
31
- asSVG
32
- />
33
- </Button>
34
- );
35
- },
36
- );
12
+ export const TableInnerButton = JSX<TableInnerButtonProps>(({ isOpen, onClick }) => {
13
+ return (
14
+ <Button
15
+ version="primary"
16
+ onClick={onClick}
17
+ className="w-full flex items-center justify-center rounded-none py-5"
18
+ >
19
+ <div className="text-h4">{isOpen ? 'Скрыть' : 'Показать ставки по вкладу'}</div>
20
+ <Icon
21
+ name={isOpen ? 'ArrowUpIcon' : 'ArrowDownIcon'}
22
+ className="ml-3"
23
+ iconVersion="white"
24
+ width="20"
25
+ height="20"
26
+ asSVG
27
+ />
28
+ </Button>
29
+ );
30
+ });
@@ -33,7 +33,7 @@ export const InputRange = JSX<InputRangeProps>(
33
33
  return (
34
34
  <div className={className}>
35
35
  <label className="block relative">
36
- {title ? <span className="text-m-light">{title}</span> : null}
36
+ {title ? <span className="text-m-light text-primary-text">{title}</span> : null}
37
37
  <input
38
38
  className={`m-0 mt-2 font-sans text-h3 w-full h-14 border border-solid border-main-stroke rounded-md
39
39
  outline-none p-0 pl-4 box-border text-primary-text hover:border-primary-hover focus:border-primary-focus ${DISABLED_INPUT_CLASSES}`}
@@ -3,7 +3,7 @@ import { RadioProps } from './RadioProps';
3
3
 
4
4
  export const Radio = JSX<RadioProps>(({ name, text, value, checked, onChange, className }) => (
5
5
  <div className={className}>
6
- <label className="flex items-center relative cursor-pointer">
6
+ <label className="font-sans flex items-center relative cursor-pointer">
7
7
  <input
8
8
  className="appearance-none flex justify-center items-center shrink-0 w-5 h-5 border border-gray hover:border-checkbox-hover
9
9
  checked:border-2 checked:!border-primary-main focus:checked:border-primary-main focus:border-primary-text active:border-primary-text
@@ -14,7 +14,7 @@ export const Radio = JSX<RadioProps>(({ name, text, value, checked, onChange, cl
14
14
  checked={checked}
15
15
  onChange={onChange}
16
16
  />
17
- {text ? <span className="font-sans ml-3 cursor-pointer">{text}</span> : null}
17
+ {text ? <span className="text-primary-text ml-3 cursor-pointer">{text}</span> : null}
18
18
  </label>
19
19
  </div>
20
20
  ));
@@ -41,7 +41,7 @@ export const Select = JSX<SelectProps>(
41
41
 
42
42
  return (
43
43
  <div className={`${className}`} ref={wrapperRef}>
44
- {label ? <span className="mb-2 flex">{label}</span> : null}
44
+ {label ? <span className="mb-2 flex text-primary-text">{label}</span> : null}
45
45
  <div className={`relative ${isOpen ? 'z-20' : 'z-10'}`}>
46
46
  <div
47
47
  className={`text-l flex justify-between items-center mb-0.5 text-primary-text cursor-pointer
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.6.18",
3
+ "version": "0.6.19",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -32,7 +32,7 @@ export const Bonus = JSX<BonusProps>((props) => {
32
32
  return (
33
33
  <div
34
34
  key={String(i)}
35
- className="flex-grow w-[49%] border border-gray pl-9 pt-9 pr-6 pb-6 mb-3 mx-2 even:mr-0 odd:ml-0 last:odd:mx-0"
35
+ className="flex-grow w-[49%] border border-gray p-9 mb-3 mx-2 even:mr-0 odd:ml-0 last:odd:mx-0"
36
36
  >
37
37
  <div className="flex justify-between w-full">
38
38
  <div className="flex flex-col justify-between mr-4">
@@ -22,7 +22,11 @@ export function renderBackwardButton(
22
22
  href={href}
23
23
  target={target}
24
24
  >
25
- <Img className="w-4 h-4" image={{ ...backwardIcon, iconVersion }} asSVG />
25
+ <Img
26
+ className="w-4 h-4"
27
+ image={{ ...backwardIcon, iconVersion: backwardIcon.iconVersion || iconVersion }}
28
+ asSVG
29
+ />
26
30
  </Button>
27
31
  {text ? <span className="text-m">{text}</span> : null}
28
32
  </div>
@@ -47,7 +47,12 @@ export const SafeDepositRental = JSX<SafeDepositRentalProps>(
47
47
  <BlockWrapper context={context} className={className} {...rest}>
48
48
  <div className="font-sans bg-white px-8 py-12">
49
49
  {title ? (
50
- <Heading title={title} headingType="h3" as="h2" className="mb-2.5 text-center" />
50
+ <Heading
51
+ title={title}
52
+ headingType="h3"
53
+ as="h2"
54
+ className="text-primary-text mb-2.5 text-center"
55
+ />
51
56
  ) : null}
52
57
  <SafeDepositRentalForm
53
58
  regions={regions}