@redneckz/wildless-cms-uni-blocks 0.14.742 → 0.14.744

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 (268) hide show
  1. package/bundle/bundle.umd.js +112 -156
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/components/OfficesAtmsMap/{renderFiltrationForm.d.ts → FiltrationForm.d.ts} +2 -2
  4. package/bundle/components/OfficesAtmsMap/FoldableCardContent.d.ts +1 -0
  5. package/bundle/components/OfficesAtmsMap/renderOfficeCard.d.ts +1 -1
  6. package/bundle/ui-kit/BaseFiltration/GridBlocks.d.ts +8 -0
  7. package/bundle/ui-kit/Button/IconButton.d.ts +10 -0
  8. package/bundle/ui-kit/Foldable/Foldable.d.ts +0 -6
  9. package/bundle/utils/capitalize.d.ts +1 -0
  10. package/bundle/utils/dataAttributes.d.ts +2 -2
  11. package/dist/components/ApplicationLeadForm/GroupedConsents.js +6 -7
  12. package/dist/components/ApplicationLeadForm/GroupedConsents.js.map +1 -1
  13. package/dist/components/CarouselTariffsCard/CarouselTariffsCard.js +6 -5
  14. package/dist/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
  15. package/{lib/components/OfficesAtmsMap/renderFiltrationForm.d.ts → dist/components/OfficesAtmsMap/FiltrationForm.d.ts} +2 -2
  16. package/dist/components/OfficesAtmsMap/FiltrationForm.js +24 -0
  17. package/dist/components/OfficesAtmsMap/FiltrationForm.js.map +1 -0
  18. package/dist/components/OfficesAtmsMap/FoldableCardContent.d.ts +1 -0
  19. package/dist/components/OfficesAtmsMap/FoldableCardContent.js +13 -0
  20. package/dist/components/OfficesAtmsMap/FoldableCardContent.js.map +1 -0
  21. package/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +2 -8
  22. package/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
  23. package/dist/components/OfficesAtmsMap/renderAtmCard.js +6 -12
  24. package/dist/components/OfficesAtmsMap/renderAtmCard.js.map +1 -1
  25. package/dist/components/OfficesAtmsMap/renderFoldButton.js +2 -4
  26. package/dist/components/OfficesAtmsMap/renderFoldButton.js.map +1 -1
  27. package/dist/components/OfficesAtmsMap/renderOfficeCard.d.ts +1 -1
  28. package/dist/components/OfficesAtmsMap/renderOfficeCard.js +5 -29
  29. package/dist/components/OfficesAtmsMap/renderOfficeCard.js.map +1 -1
  30. package/dist/components/OfficesAtmsMap/renderRemoteWorkplaceCard.js +3 -11
  31. package/dist/components/OfficesAtmsMap/renderRemoteWorkplaceCard.js.map +1 -1
  32. package/dist/components/RollupItem/RollupItem.js +17 -13
  33. package/dist/components/RollupItem/RollupItem.js.map +1 -1
  34. package/dist/components/TariffsTable/TariffsTable.js +3 -1
  35. package/dist/components/TariffsTable/TariffsTable.js.map +1 -1
  36. package/dist/ui-kit/BaseFiltration/FilteredBlocks.js +2 -2
  37. package/dist/ui-kit/BaseFiltration/FilteredBlocks.js.map +1 -1
  38. package/dist/ui-kit/BaseFiltration/GridBlocks.d.ts +8 -0
  39. package/dist/ui-kit/BaseFiltration/{renderGridBlocks.js → GridBlocks.js} +8 -7
  40. package/dist/ui-kit/BaseFiltration/GridBlocks.js.map +1 -0
  41. package/dist/ui-kit/Button/IconButton.d.ts +10 -0
  42. package/dist/ui-kit/Button/IconButton.js +13 -0
  43. package/dist/ui-kit/Button/IconButton.js.map +1 -0
  44. package/dist/ui-kit/Foldable/DefaultFoldButton.js +1 -5
  45. package/dist/ui-kit/Foldable/DefaultFoldButton.js.map +1 -1
  46. package/dist/ui-kit/Foldable/Foldable.d.ts +0 -6
  47. package/dist/ui-kit/Foldable/Foldable.js +3 -10
  48. package/dist/ui-kit/Foldable/Foldable.js.map +1 -1
  49. package/dist/ui-kit/FormField/getObjectValidator.js +3 -3
  50. package/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
  51. package/dist/utils/capitalize.d.ts +1 -0
  52. package/dist/utils/capitalize.js +5 -0
  53. package/dist/utils/capitalize.js.map +1 -0
  54. package/dist/utils/dataAttributes.d.ts +2 -2
  55. package/dist/utils/dataAttributes.js +1 -6
  56. package/dist/utils/dataAttributes.js.map +1 -1
  57. package/lib/common.css +1 -1
  58. package/lib/components/ApplicationLeadForm/GroupedConsents.js +7 -8
  59. package/lib/components/ApplicationLeadForm/GroupedConsents.js.map +1 -1
  60. package/lib/components/CarouselTariffsCard/CarouselTariffsCard.js +6 -5
  61. package/lib/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
  62. package/{dist/components/OfficesAtmsMap/renderFiltrationForm.d.ts → lib/components/OfficesAtmsMap/FiltrationForm.d.ts} +2 -2
  63. package/lib/components/OfficesAtmsMap/FiltrationForm.js +21 -0
  64. package/lib/components/OfficesAtmsMap/FiltrationForm.js.map +1 -0
  65. package/lib/components/OfficesAtmsMap/FoldableCardContent.d.ts +1 -0
  66. package/lib/components/OfficesAtmsMap/FoldableCardContent.js +11 -0
  67. package/lib/components/OfficesAtmsMap/FoldableCardContent.js.map +1 -0
  68. package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +2 -8
  69. package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
  70. package/lib/components/OfficesAtmsMap/renderAtmCard.js +6 -12
  71. package/lib/components/OfficesAtmsMap/renderAtmCard.js.map +1 -1
  72. package/lib/components/OfficesAtmsMap/renderFoldButton.js +3 -5
  73. package/lib/components/OfficesAtmsMap/renderFoldButton.js.map +1 -1
  74. package/lib/components/OfficesAtmsMap/renderOfficeCard.d.ts +1 -1
  75. package/lib/components/OfficesAtmsMap/renderOfficeCard.js +5 -29
  76. package/lib/components/OfficesAtmsMap/renderOfficeCard.js.map +1 -1
  77. package/lib/components/OfficesAtmsMap/renderRemoteWorkplaceCard.js +3 -11
  78. package/lib/components/OfficesAtmsMap/renderRemoteWorkplaceCard.js.map +1 -1
  79. package/lib/components/RollupItem/RollupItem.js +18 -14
  80. package/lib/components/RollupItem/RollupItem.js.map +1 -1
  81. package/lib/components/TariffsTable/TariffsTable.js +3 -1
  82. package/lib/components/TariffsTable/TariffsTable.js.map +1 -1
  83. package/lib/ui-kit/BaseFiltration/FilteredBlocks.js +3 -3
  84. package/lib/ui-kit/BaseFiltration/FilteredBlocks.js.map +1 -1
  85. package/lib/ui-kit/BaseFiltration/GridBlocks.d.ts +8 -0
  86. package/{mobile/lib/ui-kit/BaseFiltration/renderGridBlocks.js → lib/ui-kit/BaseFiltration/GridBlocks.js} +7 -5
  87. package/lib/ui-kit/BaseFiltration/GridBlocks.js.map +1 -0
  88. package/lib/ui-kit/Button/IconButton.d.ts +10 -0
  89. package/lib/ui-kit/Button/IconButton.js +11 -0
  90. package/lib/ui-kit/Button/IconButton.js.map +1 -0
  91. package/lib/ui-kit/Foldable/DefaultFoldButton.js +1 -5
  92. package/lib/ui-kit/Foldable/DefaultFoldButton.js.map +1 -1
  93. package/lib/ui-kit/Foldable/Foldable.d.ts +0 -6
  94. package/lib/ui-kit/Foldable/Foldable.js +4 -11
  95. package/lib/ui-kit/Foldable/Foldable.js.map +1 -1
  96. package/lib/ui-kit/FormField/getObjectValidator.js +3 -3
  97. package/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
  98. package/lib/utils/capitalize.d.ts +1 -0
  99. package/lib/utils/capitalize.js +2 -0
  100. package/lib/utils/capitalize.js.map +1 -0
  101. package/lib/utils/dataAttributes.d.ts +2 -2
  102. package/lib/utils/dataAttributes.js +1 -6
  103. package/lib/utils/dataAttributes.js.map +1 -1
  104. package/mobile/bundle/bundle.umd.js +112 -156
  105. package/mobile/bundle/bundle.umd.min.js +1 -1
  106. package/mobile/bundle/components/OfficesAtmsMap/{renderFiltrationForm.d.ts → FiltrationForm.d.ts} +2 -2
  107. package/mobile/bundle/components/OfficesAtmsMap/FoldableCardContent.d.ts +1 -0
  108. package/mobile/bundle/components/OfficesAtmsMap/renderOfficeCard.d.ts +1 -1
  109. package/mobile/bundle/ui-kit/BaseFiltration/GridBlocks.d.ts +8 -0
  110. package/mobile/bundle/ui-kit/Button/IconButton.d.ts +10 -0
  111. package/mobile/bundle/ui-kit/Foldable/Foldable.d.ts +0 -6
  112. package/mobile/bundle/utils/capitalize.d.ts +1 -0
  113. package/mobile/bundle/utils/dataAttributes.d.ts +2 -2
  114. package/mobile/dist/components/ApplicationLeadForm/GroupedConsents.js +6 -7
  115. package/mobile/dist/components/ApplicationLeadForm/GroupedConsents.js.map +1 -1
  116. package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCard.js +6 -5
  117. package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
  118. package/mobile/dist/components/OfficesAtmsMap/FiltrationForm.d.ts +13 -0
  119. package/mobile/dist/components/OfficesAtmsMap/FiltrationForm.js +24 -0
  120. package/mobile/dist/components/OfficesAtmsMap/FiltrationForm.js.map +1 -0
  121. package/mobile/dist/components/OfficesAtmsMap/FoldableCardContent.d.ts +1 -0
  122. package/mobile/dist/components/OfficesAtmsMap/FoldableCardContent.js +13 -0
  123. package/mobile/dist/components/OfficesAtmsMap/FoldableCardContent.js.map +1 -0
  124. package/mobile/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +2 -8
  125. package/mobile/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
  126. package/mobile/dist/components/OfficesAtmsMap/renderAtmCard.js +6 -12
  127. package/mobile/dist/components/OfficesAtmsMap/renderAtmCard.js.map +1 -1
  128. package/mobile/dist/components/OfficesAtmsMap/renderFoldButton.js +2 -4
  129. package/mobile/dist/components/OfficesAtmsMap/renderFoldButton.js.map +1 -1
  130. package/mobile/dist/components/OfficesAtmsMap/renderOfficeCard.d.ts +1 -1
  131. package/mobile/dist/components/OfficesAtmsMap/renderOfficeCard.js +5 -29
  132. package/mobile/dist/components/OfficesAtmsMap/renderOfficeCard.js.map +1 -1
  133. package/mobile/dist/components/OfficesAtmsMap/renderRemoteWorkplaceCard.js +3 -11
  134. package/mobile/dist/components/OfficesAtmsMap/renderRemoteWorkplaceCard.js.map +1 -1
  135. package/mobile/dist/components/RollupItem/RollupItem.js +17 -13
  136. package/mobile/dist/components/RollupItem/RollupItem.js.map +1 -1
  137. package/mobile/dist/components/TariffsTable/TariffsTable.js +3 -1
  138. package/mobile/dist/components/TariffsTable/TariffsTable.js.map +1 -1
  139. package/mobile/dist/ui-kit/BaseFiltration/FilteredBlocks.js +2 -2
  140. package/mobile/dist/ui-kit/BaseFiltration/FilteredBlocks.js.map +1 -1
  141. package/mobile/dist/ui-kit/BaseFiltration/GridBlocks.d.ts +8 -0
  142. package/mobile/dist/ui-kit/BaseFiltration/{renderGridBlocks.js → GridBlocks.js} +8 -7
  143. package/mobile/dist/ui-kit/BaseFiltration/GridBlocks.js.map +1 -0
  144. package/mobile/dist/ui-kit/Button/IconButton.d.ts +10 -0
  145. package/mobile/dist/ui-kit/Button/IconButton.js +13 -0
  146. package/mobile/dist/ui-kit/Button/IconButton.js.map +1 -0
  147. package/mobile/dist/ui-kit/Foldable/DefaultFoldButton.js +1 -5
  148. package/mobile/dist/ui-kit/Foldable/DefaultFoldButton.js.map +1 -1
  149. package/mobile/dist/ui-kit/Foldable/Foldable.d.ts +0 -6
  150. package/mobile/dist/ui-kit/Foldable/Foldable.js +3 -10
  151. package/mobile/dist/ui-kit/Foldable/Foldable.js.map +1 -1
  152. package/mobile/dist/ui-kit/FormField/getObjectValidator.js +3 -3
  153. package/mobile/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
  154. package/mobile/dist/utils/capitalize.d.ts +1 -0
  155. package/mobile/dist/utils/capitalize.js +5 -0
  156. package/mobile/dist/utils/capitalize.js.map +1 -0
  157. package/mobile/dist/utils/dataAttributes.d.ts +2 -2
  158. package/mobile/dist/utils/dataAttributes.js +1 -6
  159. package/mobile/dist/utils/dataAttributes.js.map +1 -1
  160. package/mobile/lib/common.css +1 -1
  161. package/mobile/lib/components/ApplicationLeadForm/GroupedConsents.js +7 -8
  162. package/mobile/lib/components/ApplicationLeadForm/GroupedConsents.js.map +1 -1
  163. package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCard.js +6 -5
  164. package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
  165. package/mobile/lib/components/OfficesAtmsMap/FiltrationForm.d.ts +13 -0
  166. package/mobile/lib/components/OfficesAtmsMap/FiltrationForm.js +21 -0
  167. package/mobile/lib/components/OfficesAtmsMap/FiltrationForm.js.map +1 -0
  168. package/mobile/lib/components/OfficesAtmsMap/FoldableCardContent.d.ts +1 -0
  169. package/mobile/lib/components/OfficesAtmsMap/FoldableCardContent.js +11 -0
  170. package/mobile/lib/components/OfficesAtmsMap/FoldableCardContent.js.map +1 -0
  171. package/mobile/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +2 -8
  172. package/mobile/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
  173. package/mobile/lib/components/OfficesAtmsMap/renderAtmCard.js +6 -12
  174. package/mobile/lib/components/OfficesAtmsMap/renderAtmCard.js.map +1 -1
  175. package/mobile/lib/components/OfficesAtmsMap/renderFoldButton.js +3 -5
  176. package/mobile/lib/components/OfficesAtmsMap/renderFoldButton.js.map +1 -1
  177. package/mobile/lib/components/OfficesAtmsMap/renderOfficeCard.d.ts +1 -1
  178. package/mobile/lib/components/OfficesAtmsMap/renderOfficeCard.js +5 -29
  179. package/mobile/lib/components/OfficesAtmsMap/renderOfficeCard.js.map +1 -1
  180. package/mobile/lib/components/OfficesAtmsMap/renderRemoteWorkplaceCard.js +3 -11
  181. package/mobile/lib/components/OfficesAtmsMap/renderRemoteWorkplaceCard.js.map +1 -1
  182. package/mobile/lib/components/RollupItem/RollupItem.js +18 -14
  183. package/mobile/lib/components/RollupItem/RollupItem.js.map +1 -1
  184. package/mobile/lib/components/TariffsTable/TariffsTable.js +3 -1
  185. package/mobile/lib/components/TariffsTable/TariffsTable.js.map +1 -1
  186. package/mobile/lib/ui-kit/BaseFiltration/FilteredBlocks.js +3 -3
  187. package/mobile/lib/ui-kit/BaseFiltration/FilteredBlocks.js.map +1 -1
  188. package/mobile/lib/ui-kit/BaseFiltration/GridBlocks.d.ts +8 -0
  189. package/{lib/ui-kit/BaseFiltration/renderGridBlocks.js → mobile/lib/ui-kit/BaseFiltration/GridBlocks.js} +7 -5
  190. package/mobile/lib/ui-kit/BaseFiltration/GridBlocks.js.map +1 -0
  191. package/mobile/lib/ui-kit/Button/IconButton.d.ts +10 -0
  192. package/mobile/lib/ui-kit/Button/IconButton.js +11 -0
  193. package/mobile/lib/ui-kit/Button/IconButton.js.map +1 -0
  194. package/mobile/lib/ui-kit/Foldable/DefaultFoldButton.js +1 -5
  195. package/mobile/lib/ui-kit/Foldable/DefaultFoldButton.js.map +1 -1
  196. package/mobile/lib/ui-kit/Foldable/Foldable.d.ts +0 -6
  197. package/mobile/lib/ui-kit/Foldable/Foldable.js +4 -11
  198. package/mobile/lib/ui-kit/Foldable/Foldable.js.map +1 -1
  199. package/mobile/lib/ui-kit/FormField/getObjectValidator.js +3 -3
  200. package/mobile/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
  201. package/mobile/lib/utils/capitalize.d.ts +1 -0
  202. package/mobile/lib/utils/capitalize.js +2 -0
  203. package/mobile/lib/utils/capitalize.js.map +1 -0
  204. package/mobile/lib/utils/dataAttributes.d.ts +2 -2
  205. package/mobile/lib/utils/dataAttributes.js +1 -6
  206. package/mobile/lib/utils/dataAttributes.js.map +1 -1
  207. package/mobile/src/components/ApplicationLeadForm/GroupedConsents.tsx +26 -44
  208. package/mobile/src/components/CarouselTariffsCard/CarouselTariffsCard.tsx +21 -36
  209. package/mobile/src/components/OfficesAtmsMap/FiltrationForm.tsx +79 -0
  210. package/mobile/src/components/OfficesAtmsMap/FoldableCardContent.tsx +16 -0
  211. package/mobile/src/components/OfficesAtmsMap/OfficesAtmsMapLayout.tsx +7 -9
  212. package/mobile/src/components/OfficesAtmsMap/renderAtmCard.tsx +12 -27
  213. package/mobile/src/components/OfficesAtmsMap/renderFoldButton.tsx +6 -12
  214. package/mobile/src/components/OfficesAtmsMap/renderOfficeCard.tsx +9 -56
  215. package/mobile/src/components/OfficesAtmsMap/renderRemoteWorkplaceCard.tsx +4 -21
  216. package/mobile/src/components/RollupItem/RollupItem.tsx +29 -27
  217. package/mobile/src/components/TariffsTable/TariffsTable.tsx +10 -9
  218. package/mobile/src/ui-kit/BaseFiltration/FilteredBlocks.tsx +2 -2
  219. package/mobile/src/ui-kit/BaseFiltration/{renderGridBlocks.tsx → GridBlocks.tsx} +29 -32
  220. package/mobile/src/ui-kit/Button/IconButton.tsx +36 -0
  221. package/mobile/src/ui-kit/Foldable/DefaultFoldButton.tsx +7 -12
  222. package/mobile/src/ui-kit/Foldable/Foldable.tsx +7 -37
  223. package/mobile/src/ui-kit/FormField/getObjectValidator.tsx +3 -3
  224. package/mobile/src/utils/capitalize.ts +2 -0
  225. package/mobile/src/utils/dataAttributes.ts +1 -7
  226. package/package.json +1 -1
  227. package/src/components/ApplicationLeadForm/GroupedConsents.tsx +26 -44
  228. package/src/components/CarouselTariffsCard/CarouselTariffsCard.tsx +21 -36
  229. package/src/components/OfficesAtmsMap/FiltrationForm.tsx +79 -0
  230. package/src/components/OfficesAtmsMap/FoldableCardContent.tsx +16 -0
  231. package/src/components/OfficesAtmsMap/OfficesAtmsMapLayout.tsx +7 -9
  232. package/src/components/OfficesAtmsMap/renderAtmCard.tsx +12 -27
  233. package/src/components/OfficesAtmsMap/renderFoldButton.tsx +6 -12
  234. package/src/components/OfficesAtmsMap/renderOfficeCard.tsx +9 -56
  235. package/src/components/OfficesAtmsMap/renderRemoteWorkplaceCard.tsx +4 -21
  236. package/src/components/RollupItem/RollupItem.tsx +29 -27
  237. package/src/components/TariffsTable/TariffsTable.tsx +10 -9
  238. package/src/icons/IconName.ts +4 -4
  239. package/src/ui-kit/BaseFiltration/FilteredBlocks.tsx +2 -2
  240. package/src/ui-kit/BaseFiltration/{renderGridBlocks.tsx → GridBlocks.tsx} +29 -32
  241. package/src/ui-kit/Button/IconButton.tsx +36 -0
  242. package/src/ui-kit/Foldable/DefaultFoldButton.tsx +7 -12
  243. package/src/ui-kit/Foldable/Foldable.tsx +7 -37
  244. package/src/ui-kit/FormField/getObjectValidator.tsx +3 -3
  245. package/src/utils/capitalize.ts +2 -0
  246. package/src/utils/dataAttributes.ts +1 -7
  247. package/bundle/ui-kit/BaseFiltration/renderGridBlocks.d.ts +0 -9
  248. package/dist/components/OfficesAtmsMap/renderFiltrationForm.js +0 -26
  249. package/dist/components/OfficesAtmsMap/renderFiltrationForm.js.map +0 -1
  250. package/dist/ui-kit/BaseFiltration/renderGridBlocks.d.ts +0 -9
  251. package/dist/ui-kit/BaseFiltration/renderGridBlocks.js.map +0 -1
  252. package/lib/components/OfficesAtmsMap/renderFiltrationForm.js +0 -22
  253. package/lib/components/OfficesAtmsMap/renderFiltrationForm.js.map +0 -1
  254. package/lib/ui-kit/BaseFiltration/renderGridBlocks.d.ts +0 -9
  255. package/lib/ui-kit/BaseFiltration/renderGridBlocks.js.map +0 -1
  256. package/mobile/bundle/ui-kit/BaseFiltration/renderGridBlocks.d.ts +0 -9
  257. package/mobile/dist/components/OfficesAtmsMap/renderFiltrationForm.d.ts +0 -13
  258. package/mobile/dist/components/OfficesAtmsMap/renderFiltrationForm.js +0 -26
  259. package/mobile/dist/components/OfficesAtmsMap/renderFiltrationForm.js.map +0 -1
  260. package/mobile/dist/ui-kit/BaseFiltration/renderGridBlocks.d.ts +0 -9
  261. package/mobile/dist/ui-kit/BaseFiltration/renderGridBlocks.js.map +0 -1
  262. package/mobile/lib/components/OfficesAtmsMap/renderFiltrationForm.d.ts +0 -13
  263. package/mobile/lib/components/OfficesAtmsMap/renderFiltrationForm.js +0 -22
  264. package/mobile/lib/components/OfficesAtmsMap/renderFiltrationForm.js.map +0 -1
  265. package/mobile/lib/ui-kit/BaseFiltration/renderGridBlocks.d.ts +0 -9
  266. package/mobile/lib/ui-kit/BaseFiltration/renderGridBlocks.js.map +0 -1
  267. package/mobile/src/components/OfficesAtmsMap/renderFiltrationForm.tsx +0 -87
  268. package/src/components/OfficesAtmsMap/renderFiltrationForm.tsx +0 -87
@@ -1,9 +1,8 @@
1
- import { Foldable } from '../../ui-kit/Foldable/Foldable';
2
- import { FoldableSection } from '../../ui-kit/Foldable/FoldableSection';
3
1
  import { Icon } from '../../ui-kit/Icon/Icon';
4
2
  import { Text } from '../../ui-kit/Text/Text';
5
3
  import { CardCell } from './CardCell';
6
4
  import { CardRow } from './CardRow';
5
+ import { FoldableCardContent } from './FoldableCardContent';
7
6
  import { getScheduleDescription } from './getScheduleDescription';
8
7
  import { getWorkScheduleWeek } from './getWorkScheduleWeek';
9
8
  import { type Branch } from './OfficesAtmsMapProps';
@@ -11,77 +10,31 @@ import { renderAlternativeDay, renderBusinessSchedule } from './renderBusinessSc
11
10
  import { renderCurrency } from './renderCurrency';
12
11
  import { renderCurrentDaySchedule } from './renderCurrentDaySchedule';
13
12
  import { renderDay } from './renderDay';
14
- import { renderFoldButton } from './renderFoldButton';
15
13
  import { renderWorkSchedule } from './renderWorkSchedule';
16
14
 
17
- export const renderOfficeCard = (
18
- {
19
- name,
20
- address,
21
- phone,
22
- fax,
23
- phoneBusiness,
24
- phoneNatural,
25
- phoneCallCentre,
26
- phoneCurrencyControl,
27
- workSchedule,
28
- exchangeRate,
29
- }: Branch,
30
- i: number,
31
- ) => {
32
- if (!workSchedule) {
15
+ export const renderOfficeCard = (branch: Branch, i: number) => {
16
+ if (!branch.workSchedule) {
33
17
  return null;
34
18
  }
35
19
 
36
- const workScheduleWeek = getWorkScheduleWeek(workSchedule);
20
+ const workScheduleWeek = getWorkScheduleWeek(branch.workSchedule);
37
21
 
38
22
  return (
39
23
  <div key={String(i)} className="bg-white col-span-12 p-3xl sm:border-green sm:border">
40
24
  <div className="sm:flex sm:justify-between">
41
25
  <div>
42
- <Text size="text-h4">{name}</Text>
43
- {address ? (
26
+ <Text size="text-h4">{branch.name}</Text>
27
+ {branch.address ? (
44
28
  <div className="flex pb-xl pt-xs gap-2xs">
45
29
  <Icon name="GeolocationIcon" width="24" height="24" />
46
- <Text size="text-l">{address}</Text>
30
+ <Text size="text-l">{branch.address}</Text>
47
31
  </div>
48
32
  ) : null}
49
33
  </div>
50
34
  {renderCurrentDaySchedule(workScheduleWeek)}
51
35
  </div>
52
- <div className="hidden sm:block">
53
- {renderCardContent({
54
- phone,
55
- fax,
56
- phoneBusiness,
57
- phoneNatural,
58
- phoneCallCentre,
59
- phoneCurrencyControl,
60
- workSchedule,
61
- exchangeRate,
62
- })}
63
- </div>
64
- <Foldable
65
- className="block sm:hidden"
66
- renderFoldableSection={({ isUnfolded }) => {
67
- return (
68
- <FoldableSection isUnfolded={isUnfolded}>
69
- {renderCardContent({
70
- phone,
71
- fax,
72
- phoneBusiness,
73
- phoneNatural,
74
- phoneCallCentre,
75
- phoneCurrencyControl,
76
- workSchedule,
77
- exchangeRate,
78
- })}
79
- </FoldableSection>
80
- );
81
- }}
82
- //** TODO: remove styles with refactoring DefaultFoldButton*/
83
- renderFoldButton={({ isUnfolded, onToggle }) => renderFoldButton({ isUnfolded, onToggle })}
84
- />
36
+ <div className="hidden sm:block">{renderCardContent(branch)}</div>
37
+ <FoldableCardContent>{renderCardContent(branch)}</FoldableCardContent>
85
38
  </div>
86
39
  );
87
40
  };
@@ -1,11 +1,9 @@
1
- import { Foldable } from '../../ui-kit/Foldable/Foldable';
2
- import { FoldableSection } from '../../ui-kit/Foldable/FoldableSection';
3
1
  import { Icon } from '../../ui-kit/Icon/Icon';
4
2
  import { Text } from '../../ui-kit/Text/Text';
5
3
  import { CardCell } from './CardCell';
6
4
  import { CardRow } from './CardRow';
5
+ import { FoldableCardContent } from './FoldableCardContent';
7
6
  import { type RemoteWorkplace } from './OfficesAtmsMapProps';
8
- import { renderFoldButton } from './renderFoldButton';
9
7
 
10
8
  export const renderRemoteWorkplaceCard = (
11
9
  { address, workScheduleDescription }: RemoteWorkplace,
@@ -28,28 +26,13 @@ export const renderRemoteWorkplaceCard = (
28
26
  ) : null}
29
27
  </div>
30
28
  </div>
31
- <div className="hidden sm:block">
32
- {renderCardContent({
33
- workScheduleDescription,
34
- })}
35
- </div>
36
- <Foldable
37
- className="block sm:hidden"
38
- renderFoldableSection={({ isUnfolded }) => (
39
- <FoldableSection isUnfolded={isUnfolded}>
40
- {renderCardContent({
41
- workScheduleDescription,
42
- })}
43
- </FoldableSection>
44
- )}
45
- //** TODO: remove styles with refactoring DefaultFoldButton*/
46
- renderFoldButton={({ isUnfolded, onToggle }) => renderFoldButton({ isUnfolded, onToggle })}
47
- />
29
+ <div className="hidden sm:block">{renderCardContent(workScheduleDescription)}</div>
30
+ <FoldableCardContent>{renderCardContent(workScheduleDescription)}</FoldableCardContent>
48
31
  </div>
49
32
  );
50
33
  };
51
34
 
52
- const renderCardContent = ({ workScheduleDescription }: RemoteWorkplace) => {
35
+ const renderCardContent = (workScheduleDescription?: string) => {
53
36
  return (
54
37
  <div>
55
38
  <CardRow className="flex">
@@ -1,3 +1,4 @@
1
+ import { useBool } from '@redneckz/uni-jsx/lib/hooks/useBool';
1
2
  import { renderChildren } from '../../BlockRenderer/renderChildren';
2
3
  import { useMobileMode } from '../../hooks/useMobileMode';
3
4
  import { type Picture } from '../../model/Picture';
@@ -37,6 +38,29 @@ export const RollupItem = UniBlock<RollupItemProps>(
37
38
  }) => {
38
39
  const isMobile = useMobileMode();
39
40
 
41
+ const [isUnfolded, { toggle }] = useBool(isExpanded);
42
+
43
+ const foldableSection = (
44
+ <FoldableSection
45
+ className={style('gap-lg', getFoldableStyles(isMobile))}
46
+ isUnfolded={isUnfolded}
47
+ >
48
+ {renderChildren({
49
+ ...rest,
50
+ extraProps: { className: 'w-full', padding: 'p-0' },
51
+ })}
52
+ </FoldableSection>
53
+ );
54
+ const foldButton = renderFoldButton({
55
+ foldButtonVersion,
56
+ label,
57
+ labelIcon,
58
+ labelIconBgVersion,
59
+ isMobile,
60
+ isUnfolded,
61
+ onToggle: toggle,
62
+ });
63
+
40
64
  return (
41
65
  <BlockWrapper
42
66
  className={style(
@@ -49,32 +73,10 @@ export const RollupItem = UniBlock<RollupItemProps>(
49
73
  role={role}
50
74
  {...rest}
51
75
  >
52
- <Foldable
53
- isFoldButtonOnTop={isFoldButtonOnTop}
54
- unfoldedByDefault={isExpanded}
55
- renderFoldableSection={({ isUnfolded }) => (
56
- <FoldableSection
57
- className={style('gap-lg', getFoldableStyles(isMobile))}
58
- isUnfolded={isUnfolded}
59
- >
60
- {renderChildren({
61
- ...rest,
62
- extraProps: { className: 'w-full', padding: 'p-0' },
63
- })}
64
- </FoldableSection>
65
- )}
66
- renderFoldButton={({ isUnfolded, onToggle }) =>
67
- renderFoldButton({
68
- foldButtonVersion,
69
- label,
70
- labelIcon,
71
- labelIconBgVersion,
72
- isUnfolded,
73
- onToggle,
74
- isMobile,
75
- })
76
- }
77
- />
76
+ <Foldable>
77
+ {isFoldButtonOnTop ? foldButton : foldableSection}
78
+ {isFoldButtonOnTop ? foldableSection : foldButton}
79
+ </Foldable>
78
80
  </BlockWrapper>
79
81
  );
80
82
  },
@@ -98,8 +100,8 @@ const renderFoldButton = ({
98
100
  labelIcon,
99
101
  labelIconBgVersion,
100
102
  isUnfolded,
101
- onToggle,
102
103
  isMobile = false,
104
+ onToggle,
103
105
  }: FoldButtonProps) => {
104
106
  const label = defaultLabel || (isUnfolded ? 'Скрыть' : 'Развернуть');
105
107
  const icon = getIconName(isUnfolded, isMobile);
@@ -1,4 +1,5 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
+ import { useBool } from '@redneckz/uni-jsx/lib/hooks/useBool';
2
3
  import { useCarouselControls } from '../../hooks/useCarouselControls';
3
4
  import { BlockWrapper } from '../../ui-kit/BlockWrapper';
4
5
  import { renderDefaultFoldButton } from '../../ui-kit/Foldable/DefaultFoldButton';
@@ -40,6 +41,8 @@ export const TariffsTable = JSX<TariffsTableProps>(
40
41
  const [visibleRows, hiddenRows] =
41
42
  hiddenRowsNum > 0 ? [rows.slice(0, -hiddenRowsNum), rows.slice(-hiddenRowsNum)] : [rows, []];
42
43
 
44
+ const [isUnfolded, { toggle }] = useBool(false);
45
+
43
46
  return (
44
47
  <BlockWrapper
45
48
  className={style('relative space-y-6xl @4xl:space-y-xl', className)}
@@ -55,15 +58,13 @@ export const TariffsTable = JSX<TariffsTableProps>(
55
58
  />
56
59
  <div className="space-y-m overflow-hidden">
57
60
  {hiddenRowsNum > 0 ? (
58
- <Foldable
59
- renderFoldableSection={({ isUnfolded }) => (
60
- <TariffsTableWrapper controls={controls}>
61
- {visibleRows}
62
- <FoldableSection isUnfolded={isUnfolded}>{hiddenRows}</FoldableSection>
63
- </TariffsTableWrapper>
64
- )}
65
- renderFoldButton={renderDefaultFoldButton}
66
- />
61
+ <Foldable>
62
+ <TariffsTableWrapper controls={controls}>
63
+ {visibleRows}
64
+ <FoldableSection isUnfolded={isUnfolded}>{hiddenRows}</FoldableSection>
65
+ </TariffsTableWrapper>
66
+ {renderDefaultFoldButton({ isUnfolded, onToggle: toggle })}
67
+ </Foldable>
67
68
  ) : (
68
69
  <TariffsTableWrapper controls={controls}>{rows}</TariffsTableWrapper>
69
70
  )}
@@ -3,8 +3,8 @@ import { type BlockDef } from '../../model/ContentPageDef';
3
3
  import { type UniBlockProps } from '../../UniBlock/UniBlockProps';
4
4
  import { NotFound } from '../NotFound/NotFound';
5
5
  import { type BaseFiltrationContent } from './BaseFiltrationContent';
6
+ import { GridBlocks } from './GridBlocks';
6
7
  import { renderCarouselBlocks } from './renderCarouselBlocks';
7
- import { renderGridBlocks } from './renderGridBlocks';
8
8
 
9
9
  interface FilteredBlocksProps extends BaseFiltrationContent, UniBlockProps {
10
10
  blocksToRender?: BlockDef[];
@@ -17,7 +17,7 @@ export const FilteredBlocks = JSX<FilteredBlocksProps>(
17
17
  return (
18
18
  <div>
19
19
  {renderNotFound(notFound, blocksToRender)}
20
- {renderGridBlocks({ ...blocksSection, ...rest, blocksToRender })}
20
+ <GridBlocks {...blocksSection} {...rest} blocksToRender={blocksToRender} />
21
21
  </div>
22
22
  );
23
23
  case 'carousel':
@@ -1,3 +1,5 @@
1
+ import { JSX } from '@redneckz/uni-jsx';
2
+ import { useBool } from '@redneckz/uni-jsx/lib/hooks/useBool';
1
3
  import { renderBlocksList } from '../../BlockRenderer/renderBlockList';
2
4
  import { AdTile } from '../../components/AdTile/AdTile';
3
5
  import { type BlockDef } from '../../model/ContentPageDef';
@@ -7,49 +9,44 @@ import { style } from '../../utils/style';
7
9
  import { DefaultFoldButton } from '../Foldable/DefaultFoldButton';
8
10
  import { Foldable } from '../Foldable/Foldable';
9
11
  import { FoldableSection } from '../Foldable/FoldableSection';
10
- import { type IconName } from '../Icon/IconProps';
11
12
  import { type GridSection } from './BaseFiltrationContent';
12
13
 
13
- const ICONS: IconName[] = ['ArrowDownIcon', 'ArrowUpIcon'];
14
-
15
14
  const resultsGridStyle = 'space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs';
16
15
 
17
- export const renderGridBlocks = ({
18
- topItemsCount = 0,
19
- label = '',
20
- block,
21
- blocksToRender = [],
22
- ...rest
23
- }: GridSection & UniBlockProps & { blocksToRender?: BlockDef[] }) => {
24
- const [visibleBlocks, hiddenBlocks] =
25
- topItemsCount > 0
26
- ? [blocksToRender.slice(0, topItemsCount), blocksToRender.slice(topItemsCount)]
27
- : [blocksToRender, []];
16
+ interface GridBlocksProps extends GridSection, UniBlockProps {
17
+ blocksToRender?: BlockDef[];
18
+ }
28
19
 
29
- return (
30
- <div className={style('space-y-2xs', { hidden: !blocksToRender.length })}>
31
- <div className={style(resultsGridStyle)}>
32
- {renderBlocksList(visibleBlocks, { ...rest.options, parent: block })}
33
- {isOdd(visibleBlocks.length) ? <AdTile className="col-span-6" {...rest} /> : null}
34
- </div>
35
- <Foldable
36
- renderFoldableSection={({ isUnfolded }) => (
20
+ export const GridBlocks = JSX<GridBlocksProps>(
21
+ ({ topItemsCount = 0, label = '', block, blocksToRender = [], ...rest }) => {
22
+ const [visibleBlocks, hiddenBlocks] =
23
+ topItemsCount > 0
24
+ ? [blocksToRender.slice(0, topItemsCount), blocksToRender.slice(topItemsCount)]
25
+ : [blocksToRender, []];
26
+
27
+ const [isUnfolded, { toggle }] = useBool(false);
28
+
29
+ return (
30
+ <div className={style('space-y-2xs', { hidden: !blocksToRender.length })}>
31
+ <div className={style(resultsGridStyle)}>
32
+ {renderBlocksList(visibleBlocks, { ...rest.options, parent: block })}
33
+ {isOdd(visibleBlocks.length) ? <AdTile className="col-span-6" {...rest} /> : null}
34
+ </div>
35
+ <Foldable>
37
36
  <FoldableSection className={style(resultsGridStyle)} isUnfolded={isUnfolded}>
38
37
  {renderBlocksList(hiddenBlocks, { ...rest.options, parent: block })}
39
38
  {isOdd(hiddenBlocks.length) ? <AdTile className="col-span-6" {...rest} /> : null}
40
39
  </FoldableSection>
41
- )}
42
- renderFoldButton={({ isUnfolded, onToggle }) => (
43
40
  <DefaultFoldButton
44
41
  className={style({ hidden: topItemsCount < 1 })}
42
+ dataTheme={rest.options?.page?.colorPalette}
45
43
  disabled={!hiddenBlocks?.length}
46
44
  label={label}
47
- icon={ICONS[Number(isUnfolded)]}
48
- dataTheme={rest.options?.page?.colorPalette}
49
- onClick={onToggle}
45
+ icon={isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon'}
46
+ onClick={toggle}
50
47
  />
51
- )}
52
- />
53
- </div>
54
- );
55
- };
48
+ </Foldable>
49
+ </div>
50
+ );
51
+ },
52
+ );
@@ -0,0 +1,36 @@
1
+ import { JSX } from '@redneckz/uni-jsx';
2
+ import { useMemo } from '@redneckz/uni-jsx/lib/hooks';
3
+ import type { IconName } from '../../icons/IconName';
4
+ import { type AspectsDef } from '../../model/AspectsProps';
5
+ import { Icon } from '../../ui-kit/Icon/Icon';
6
+ import { getAspectsAttributes } from '../../utils/dataAttributes';
7
+ import { style } from '../../utils/style';
8
+
9
+ export interface IconButtonProps {
10
+ className?: string;
11
+ name: IconName;
12
+ text?: string;
13
+ data?: AspectsDef[];
14
+ onClick?: () => void;
15
+ }
16
+
17
+ export const IconButton = JSX<IconButtonProps>(({ className, name, text, data, onClick }) => {
18
+ const aspectsAttrs = useMemo(() => getAspectsAttributes(data), [data]);
19
+
20
+ return (
21
+ <button
22
+ className={style(
23
+ 'text-primary-main flex justify-between items-center border-none px-m',
24
+ text ? 'pt-lg' : 'py-2xs',
25
+ className,
26
+ )}
27
+ type="button"
28
+ // eslint-disable-next-line react/jsx-props-no-spreading
29
+ {...aspectsAttrs}
30
+ onClick={onClick}
31
+ >
32
+ {text ? <div className="pr-m">{text}</div> : null}
33
+ <Icon className="text-primary-text" name={name} width="16" height="16" />
34
+ </button>
35
+ );
36
+ });
@@ -50,15 +50,10 @@ export const DefaultFoldButton = JSX<DefaultFoldButtonProps>(
50
50
  ),
51
51
  );
52
52
 
53
- export const renderDefaultFoldButton = ({ isUnfolded, onToggle }: FoldablePartProps) => {
54
- const labels = ['Развернуть', 'Скрыть'];
55
- const icons: IconName[] = ['ArrowDownIcon', 'ArrowUpIcon'];
56
-
57
- return (
58
- <DefaultFoldButton
59
- icon={icons[Number(isUnfolded)]}
60
- label={labels[Number(isUnfolded)]}
61
- onClick={onToggle}
62
- />
63
- );
64
- };
53
+ export const renderDefaultFoldButton = ({ isUnfolded, onToggle }: FoldablePartProps) => (
54
+ <DefaultFoldButton
55
+ icon={isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon'}
56
+ label={isUnfolded ? 'Скрыть' : 'Развернуть'}
57
+ onClick={onToggle}
58
+ />
59
+ );
@@ -1,43 +1,13 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { useCallback, useState } from '@redneckz/uni-jsx/lib/hooks';
3
- import { type VNode } from '../../model/VNode';
4
- import { type FoldablePartProps } from './FoldablePartProps';
2
+ import { style } from '../../utils/style';
5
3
 
6
4
  export interface FoldableProps {
7
5
  className?: string;
8
- unfoldedByDefault?: boolean;
9
- isFoldButtonOnTop?: boolean;
10
- renderFoldableSection: (props: FoldablePartProps) => VNode;
11
- renderFoldButton?: ((props: FoldablePartProps) => VNode) | null;
12
6
  }
13
7
 
14
- export const Foldable = JSX<FoldableProps>(
15
- ({
16
- className = '',
17
- isFoldButtonOnTop = false,
18
- unfoldedByDefault = false,
19
- renderFoldableSection,
20
- renderFoldButton,
21
- }) => {
22
- const [isUnfolded, setIsUnfolded] = useState(unfoldedByDefault);
23
-
24
- const onToggle = useCallback(() => {
25
- setIsUnfolded((_) => !_);
26
- }, []);
27
-
28
- const sectionNode = renderFoldableSection({ isUnfolded, onToggle });
29
- const buttonNode = renderFoldButton ? renderFoldButton({ isUnfolded, onToggle }) : null;
30
-
31
- return isFoldButtonOnTop ? (
32
- <div className={className} role="group">
33
- {buttonNode}
34
- {sectionNode}
35
- </div>
36
- ) : (
37
- <div className={className} role="group">
38
- {sectionNode}
39
- {buttonNode}
40
- </div>
41
- );
42
- },
43
- );
8
+ // TODO Не особо полезно, в итоге
9
+ export const Foldable = JSX<FoldableProps>(({ className, children }) => (
10
+ <div className={style(className)} role="group">
11
+ {children}
12
+ </div>
13
+ ));
@@ -108,9 +108,9 @@ export const validatorObj: Record<string, Validator> = {
108
108
  secondaryPhone: phoneValidator('Укажите номер телефона'),
109
109
  region: defaultSelectValidator(),
110
110
 
111
- surname: nameValidator('Укажите свою фамилию'),
112
- name: nameValidator('Укажите своё имя'),
113
- middleName: nameValidator('Укажите своё отчество'),
111
+ surname: nameValidator('Укажите свою фамилию на кириллице'),
112
+ name: nameValidator('Укажите своё имя на кириллице'),
113
+ middleName: nameValidator('Укажите своё отчество на кириллице'),
114
114
  birthday: defaultValidator('Укажите дату рождения'),
115
115
  phone: phoneValidator('Укажите номер телефона'),
116
116
  email: emailValidator('Укажите электронную почту'),
@@ -0,0 +1,2 @@
1
+ export const capitalize = (text?: string): string =>
2
+ text ? `${text.charAt(0).toUpperCase()}${text.slice(1)}` : '';
@@ -1,14 +1,8 @@
1
1
  import { type AspectsDef } from '../model/AspectsProps';
2
2
 
3
3
  export const getAspectsAttributes = (data?: AspectsDef[]) => {
4
- if (!Array.isArray(data) || !data.length) {
5
- return {};
6
- }
7
-
8
4
  try {
9
- return {
10
- 'data-aspects': JSON.stringify(data),
11
- };
5
+ return Array.isArray(data) && data.length ? { 'data-aspects': JSON.stringify(data) } : {};
12
6
  } catch (_) {
13
7
  return {};
14
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.14.742",
3
+ "version": "0.14.744",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -1,16 +1,16 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { useMemo } from '@redneckz/uni-jsx/lib/hooks';
3
- import { type FormFieldRegisterer, type VNode } from '../../services/retail/external/types';
2
+ import { useCallback, useMemo } from '@redneckz/uni-jsx/lib/hooks';
3
+ import { useBool } from '@redneckz/uni-jsx/lib/hooks/useBool';
4
+ import { type FormFieldRegisterer } from '../../services/retail/external/types';
4
5
  import { InputsConsentsMap } from '../../services/retail/inputs';
5
6
  import { type LeadFormState } from '../../services/retail/model/LeadFormState';
6
7
  import { type FieldRetailDef } from '../../services/retail/model/RetailFormContent';
8
+ import { IconButton } from '../../ui-kit/Button/IconButton';
7
9
  import { Checkbox } from '../../ui-kit/Checkbox/Checkbox';
8
10
  import { Foldable } from '../../ui-kit/Foldable/Foldable';
9
- import { type FoldablePartProps } from '../../ui-kit/Foldable/FoldablePartProps';
10
11
  import { FoldableSection } from '../../ui-kit/Foldable/FoldableSection';
11
12
  import { getField } from '../../ui-kit/FormField/getField';
12
13
  import { validatorObj } from '../../ui-kit/FormField/getObjectValidator';
13
- import { Icon } from '../../ui-kit/Icon/Icon';
14
14
  import { renderErrorText } from '../../ui-kit/Input/renderErrorText';
15
15
  import { withValidator } from '../../validation/withValidator';
16
16
 
@@ -25,12 +25,15 @@ const CONSENT_REQUIRED = 'Отметьте все обязательные со
25
25
  export const GroupedConsents = JSX<GroupedConsentsProps>(({ inputs = [], field, key }) => {
26
26
  const isChecked = inputs.every((_) => Boolean(field(_.name as keyof LeadFormState).value));
27
27
 
28
- const handleGeneralToggle = (value: boolean) => {
29
- for (const item of inputs) {
30
- const itemField = field(item.name as keyof LeadFormState);
31
- itemField.onChange?.(value);
32
- }
33
- };
28
+ const handleGeneralToggle = useCallback(
29
+ (value: boolean) => {
30
+ for (const item of inputs) {
31
+ const itemField = field(item.name as keyof LeadFormState);
32
+ itemField.onChange?.(value);
33
+ }
34
+ },
35
+ [inputs],
36
+ );
34
37
 
35
38
  const hasValidationErrors = useMemo(
36
39
  () =>
@@ -47,48 +50,27 @@ export const GroupedConsents = JSX<GroupedConsentsProps>(({ inputs = [], field,
47
50
  [inputs],
48
51
  );
49
52
 
53
+ const [isUnfolded, { toggle }] = useBool(true);
54
+
50
55
  return (
51
56
  <div className="w-fit">
52
- <Foldable
53
- isFoldButtonOnTop
54
- unfoldedByDefault
55
- renderFoldableSection={({ isUnfolded }) => (
56
- <FoldableSection isUnfolded={isUnfolded} className="flex flex-col pl-2xl">
57
- {
58
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
59
- inputs.map(getField<FieldRetailDef>(field, {}, { ...InputsConsentsMap }))
60
- }
61
- </FoldableSection>
62
- )}
63
- renderFoldButton={renderGeneralCheckbox(
57
+ <Foldable>
58
+ <div className="flex items-start">
64
59
  <div>
65
60
  <Checkbox
61
+ key={key}
62
+ text={CONSENT_ALL_DOCS_TEXT}
66
63
  value={isChecked}
67
64
  onChange={handleGeneralToggle}
68
- text={CONSENT_ALL_DOCS_TEXT}
69
- key={key}
70
65
  />
71
66
  {renderErrorText(hasValidationErrors ? CONSENT_REQUIRED : '')}
72
- </div>,
73
- )}
74
- />
67
+ </div>
68
+ <IconButton name={isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon'} onClick={toggle} />
69
+ </div>
70
+ <FoldableSection className="flex flex-col pl-2xl" isUnfolded={isUnfolded}>
71
+ {inputs.map(getField<FieldRetailDef>(field, {}, InputsConsentsMap))}
72
+ </FoldableSection>
73
+ </Foldable>
75
74
  </div>
76
75
  );
77
76
  });
78
-
79
- const renderGeneralCheckbox =
80
- (generalCheckBox: VNode) =>
81
- (foldableData: FoldablePartProps): VNode =>
82
- (
83
- <div className="flex items-start">
84
- {generalCheckBox}
85
- <button onClick={foldableData.onToggle} className="px-m py-2xs" type="button">
86
- <Icon
87
- className="text-primary-text"
88
- name={foldableData.isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon'}
89
- width="16"
90
- height="16"
91
- />
92
- </button>
93
- </div>
94
- );