@redneckz/wildless-cms-uni-blocks 0.3.9 → 0.3.12

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 (480) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +154 -76
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/cosmos-static/icons/GpsIcon.svg +1 -0
  5. package/dist/components/BaseTile/BaseTile.js +1 -1
  6. package/dist/components/BaseTile/BaseTile.js.map +1 -1
  7. package/dist/components/Blocks.d.ts +1 -0
  8. package/dist/components/Blocks.js +2 -0
  9. package/dist/components/Blocks.js.map +1 -1
  10. package/dist/components/ComparisonTable/ComparisonTable.mobile.d.ts +5 -0
  11. package/dist/components/ComparisonTable/ComparisonTable.mobile.js +46 -0
  12. package/dist/components/ComparisonTable/ComparisonTable.mobile.js.map +1 -0
  13. package/dist/components/ComparisonTable/ComparisonTableContent.d.ts +4 -0
  14. package/dist/components/ComparisonTable/HeaderCell.mobile.d.ts +12 -0
  15. package/dist/components/ComparisonTable/HeaderCell.mobile.js +9 -0
  16. package/dist/components/ComparisonTable/HeaderCell.mobile.js.map +1 -0
  17. package/dist/components/ComparisonTable/TableCell.d.ts +3 -2
  18. package/dist/components/ComparisonTable/TableCell.js.map +1 -1
  19. package/dist/components/ComparisonTable/TableCell.mobile.d.ts +9 -0
  20. package/dist/components/ComparisonTable/TableCell.mobile.js +12 -0
  21. package/dist/components/ComparisonTable/TableCell.mobile.js.map +1 -0
  22. package/dist/components/ComparisonTable/TableColumn.d.ts +10 -0
  23. package/dist/components/ComparisonTable/TableColumn.js +19 -0
  24. package/dist/components/ComparisonTable/TableColumn.js.map +1 -0
  25. package/dist/components/ContentPage/ContentPageContext.d.ts +1 -1
  26. package/dist/components/CreditCalculator/CreditCalculator.d.ts +2 -2
  27. package/dist/components/CreditCalculator/CreditCalculator.js +18 -22
  28. package/dist/components/CreditCalculator/CreditCalculator.js.map +1 -1
  29. package/dist/components/CreditCalculator/getCalculatorParams.d.ts +1 -1
  30. package/dist/components/CreditCalculator/getCreditRate.d.ts +1 -1
  31. package/dist/components/CreditCalculator/getDefaultMonths.d.ts +2 -0
  32. package/dist/components/CreditCalculator/getDefaultMonths.js +8 -0
  33. package/dist/components/CreditCalculator/getDefaultMonths.js.map +1 -0
  34. package/dist/components/CreditCalculator/getDefaultSum.d.ts +2 -0
  35. package/dist/components/CreditCalculator/getDefaultSum.js +8 -0
  36. package/dist/components/CreditCalculator/getDefaultSum.js.map +1 -0
  37. package/dist/components/CreditCalculator/getMonthlyPayment.d.ts +1 -1
  38. package/dist/components/CreditCalculator/renderButton.d.ts +1 -0
  39. package/dist/components/CreditCalculator/renderButton.js +8 -0
  40. package/dist/components/CreditCalculator/renderButton.js.map +1 -0
  41. package/dist/components/CreditCalculator/renderMonthsInput.d.ts +10 -0
  42. package/dist/components/CreditCalculator/renderMonthsInput.js +11 -0
  43. package/dist/components/CreditCalculator/renderMonthsInput.js.map +1 -0
  44. package/dist/components/CreditCalculator/renderProposal.d.ts +1 -0
  45. package/dist/components/CreditCalculator/renderProposal.js +9 -0
  46. package/dist/components/CreditCalculator/renderProposal.js.map +1 -0
  47. package/dist/components/CreditCalculator/renderTermsButton.d.ts +1 -0
  48. package/dist/components/CreditCalculator/renderTermsButton.js +9 -0
  49. package/dist/components/CreditCalculator/renderTermsButton.js.map +1 -0
  50. package/dist/components/CreditCalculator/renderWantedSumInput.d.ts +10 -0
  51. package/dist/components/CreditCalculator/renderWantedSumInput.js +18 -0
  52. package/dist/components/CreditCalculator/renderWantedSumInput.js.map +1 -0
  53. package/dist/components/ExchangeRateTile/CurrencyTable.d.ts +7 -0
  54. package/dist/components/ExchangeRateTile/CurrencyTable.js +19 -0
  55. package/dist/components/ExchangeRateTile/CurrencyTable.js.map +1 -0
  56. package/dist/components/ExchangeRateTile/CurrentLocation.d.ts +7 -0
  57. package/dist/components/ExchangeRateTile/CurrentLocation.js +7 -0
  58. package/dist/components/ExchangeRateTile/CurrentLocation.js.map +1 -0
  59. package/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +7 -0
  60. package/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +15 -0
  61. package/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -0
  62. package/dist/components/ExchangeRateTile/ExchangeRateTile.js +23 -27
  63. package/dist/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
  64. package/dist/components/ExchangeRateTile/ExchangeRateTileContent.d.ts +10 -0
  65. package/dist/components/ExchangeRateTile/formatCurrency.d.ts +1 -0
  66. package/dist/components/ExchangeRateTile/formatCurrency.js +6 -0
  67. package/dist/components/ExchangeRateTile/formatCurrency.js.map +1 -0
  68. package/dist/components/Gallery/Gallery.mobile.js +2 -2
  69. package/dist/components/Gallery/Gallery.mobile.js.map +1 -1
  70. package/dist/components/Header/Header.mobile.js +1 -1
  71. package/dist/components/Header/Header.mobile.js.map +1 -1
  72. package/dist/components/ProductBlock/ProductBlockInner.js +1 -1
  73. package/dist/components/ProductBlock/ProductBlockInner.js.map +1 -1
  74. package/dist/components/ProductBlock/ProductBlockInner.mobile.js +1 -1
  75. package/dist/components/ProductBlock/ProductBlockInner.mobile.js.map +1 -1
  76. package/dist/hooks/useCreditCalculatorData.js +3 -3
  77. package/dist/hooks/useCreditCalculatorData.js.map +1 -1
  78. package/dist/hooks/useExchangeRates.d.ts +9 -0
  79. package/dist/hooks/useExchangeRates.js +18 -0
  80. package/dist/hooks/useExchangeRates.js.map +1 -0
  81. package/dist/icons/IconName.d.ts +3 -2
  82. package/dist/icons/IconName.js +1 -0
  83. package/dist/icons/IconName.js.map +1 -1
  84. package/dist/model/InputTypes.d.ts +1 -0
  85. package/dist/model/InputTypes.js +2 -0
  86. package/dist/model/InputTypes.js.map +1 -0
  87. package/dist/setup-fixture.js +1 -1
  88. package/dist/setup-fixture.js.map +1 -1
  89. package/dist/ui-kit/Input/Input.d.ts +2 -0
  90. package/dist/ui-kit/Input/Input.js +8 -0
  91. package/dist/ui-kit/Input/Input.js.map +1 -0
  92. package/dist/ui-kit/Input/InputProps.d.ts +8 -0
  93. package/dist/ui-kit/Input/InputProps.js +2 -0
  94. package/dist/ui-kit/Input/InputProps.js.map +1 -0
  95. package/dist/ui-kit/Select/Select.d.ts +6 -0
  96. package/dist/ui-kit/Select/Select.js +8 -0
  97. package/dist/ui-kit/Select/Select.js.map +1 -0
  98. package/dist/ui-kit/Select/SelectOption.d.ts +5 -0
  99. package/dist/ui-kit/Select/SelectOption.js +8 -0
  100. package/dist/ui-kit/Select/SelectOption.js.map +1 -0
  101. package/dist/ui-kit/SwipeListControl/SwipeListControl.js +11 -6
  102. package/dist/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
  103. package/dist/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +1 -0
  104. package/lib/common.css +1 -1
  105. package/lib/components/BaseTile/BaseTile.js +1 -1
  106. package/lib/components/BaseTile/BaseTile.js.map +1 -1
  107. package/lib/components/Blocks.d.ts +1 -0
  108. package/lib/components/Blocks.js +2 -0
  109. package/lib/components/Blocks.js.map +1 -1
  110. package/lib/components/ComparisonTable/ComparisonTable.fixture.mobile.d.ts +5 -0
  111. package/lib/components/ComparisonTable/ComparisonTable.mobile.d.ts +5 -0
  112. package/lib/components/ComparisonTable/ComparisonTable.mobile.js +44 -0
  113. package/lib/components/ComparisonTable/ComparisonTable.mobile.js.map +1 -0
  114. package/lib/components/ComparisonTable/ComparisonTableContent.d.ts +4 -0
  115. package/lib/components/ComparisonTable/HeaderCell.mobile.d.ts +12 -0
  116. package/lib/components/ComparisonTable/HeaderCell.mobile.js +7 -0
  117. package/lib/components/ComparisonTable/HeaderCell.mobile.js.map +1 -0
  118. package/lib/components/ComparisonTable/TableCell.d.ts +3 -2
  119. package/lib/components/ComparisonTable/TableCell.js.map +1 -1
  120. package/lib/components/ComparisonTable/TableCell.mobile.d.ts +9 -0
  121. package/lib/components/ComparisonTable/TableCell.mobile.js +10 -0
  122. package/lib/components/ComparisonTable/TableCell.mobile.js.map +1 -0
  123. package/lib/components/ComparisonTable/TableColumn.d.ts +10 -0
  124. package/lib/components/ComparisonTable/TableColumn.js +17 -0
  125. package/lib/components/ComparisonTable/TableColumn.js.map +1 -0
  126. package/lib/components/ContentPage/ContentPageContext.d.ts +1 -1
  127. package/lib/components/CreditCalculator/CreditCalculator.d.ts +2 -2
  128. package/lib/components/CreditCalculator/CreditCalculator.js +19 -23
  129. package/lib/components/CreditCalculator/CreditCalculator.js.map +1 -1
  130. package/lib/components/CreditCalculator/getCalculatorParams.d.ts +1 -1
  131. package/lib/components/CreditCalculator/getCreditRate.d.ts +1 -1
  132. package/lib/components/CreditCalculator/getDefaultMonths.d.ts +2 -0
  133. package/lib/components/CreditCalculator/getDefaultMonths.js +5 -0
  134. package/lib/components/CreditCalculator/getDefaultMonths.js.map +1 -0
  135. package/lib/components/CreditCalculator/getDefaultSum.d.ts +2 -0
  136. package/lib/components/CreditCalculator/getDefaultSum.js +5 -0
  137. package/lib/components/CreditCalculator/getDefaultSum.js.map +1 -0
  138. package/lib/components/CreditCalculator/getMonthlyPayment.d.ts +1 -1
  139. package/lib/components/CreditCalculator/renderButton.d.ts +1 -0
  140. package/lib/components/CreditCalculator/renderButton.js +5 -0
  141. package/lib/components/CreditCalculator/renderButton.js.map +1 -0
  142. package/lib/components/CreditCalculator/renderMonthsInput.d.ts +10 -0
  143. package/lib/components/CreditCalculator/renderMonthsInput.js +8 -0
  144. package/lib/components/CreditCalculator/renderMonthsInput.js.map +1 -0
  145. package/lib/components/CreditCalculator/renderProposal.d.ts +1 -0
  146. package/lib/components/CreditCalculator/renderProposal.js +6 -0
  147. package/lib/components/CreditCalculator/renderProposal.js.map +1 -0
  148. package/lib/components/CreditCalculator/renderTermsButton.d.ts +1 -0
  149. package/lib/components/CreditCalculator/renderTermsButton.js +6 -0
  150. package/lib/components/CreditCalculator/renderTermsButton.js.map +1 -0
  151. package/lib/components/CreditCalculator/renderWantedSumInput.d.ts +10 -0
  152. package/lib/components/CreditCalculator/renderWantedSumInput.js +15 -0
  153. package/lib/components/CreditCalculator/renderWantedSumInput.js.map +1 -0
  154. package/lib/components/ExchangeRateTile/CurrencyTable.d.ts +7 -0
  155. package/lib/components/ExchangeRateTile/CurrencyTable.js +17 -0
  156. package/lib/components/ExchangeRateTile/CurrencyTable.js.map +1 -0
  157. package/lib/components/ExchangeRateTile/CurrentLocation.d.ts +7 -0
  158. package/lib/components/ExchangeRateTile/CurrentLocation.js +5 -0
  159. package/lib/components/ExchangeRateTile/CurrentLocation.js.map +1 -0
  160. package/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +7 -0
  161. package/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +13 -0
  162. package/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -0
  163. package/lib/components/ExchangeRateTile/ExchangeRateTile.js +23 -27
  164. package/lib/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
  165. package/lib/components/ExchangeRateTile/ExchangeRateTileContent.d.ts +10 -0
  166. package/lib/components/ExchangeRateTile/formatCurrency.d.ts +1 -0
  167. package/lib/components/ExchangeRateTile/formatCurrency.js +3 -0
  168. package/lib/components/ExchangeRateTile/formatCurrency.js.map +1 -0
  169. package/lib/components/Gallery/Gallery.mobile.js +2 -2
  170. package/lib/components/Gallery/Gallery.mobile.js.map +1 -1
  171. package/lib/components/Header/Header.mobile.js +1 -1
  172. package/lib/components/Header/Header.mobile.js.map +1 -1
  173. package/lib/components/ProductBlock/ProductBlock.fixture.mobile.d.ts +2 -1
  174. package/lib/components/ProductBlock/ProductBlockInner.js +1 -1
  175. package/lib/components/ProductBlock/ProductBlockInner.js.map +1 -1
  176. package/lib/components/ProductBlock/ProductBlockInner.mobile.js +1 -1
  177. package/lib/components/ProductBlock/ProductBlockInner.mobile.js.map +1 -1
  178. package/lib/hooks/useCreditCalculatorData.js +3 -3
  179. package/lib/hooks/useCreditCalculatorData.js.map +1 -1
  180. package/lib/hooks/useExchangeRates.d.ts +9 -0
  181. package/lib/hooks/useExchangeRates.js +15 -0
  182. package/lib/hooks/useExchangeRates.js.map +1 -0
  183. package/lib/icons/IconName.d.ts +3 -2
  184. package/lib/icons/IconName.js +1 -0
  185. package/lib/icons/IconName.js.map +1 -1
  186. package/lib/model/InputTypes.d.ts +1 -0
  187. package/lib/model/InputTypes.js +2 -0
  188. package/lib/model/InputTypes.js.map +1 -0
  189. package/lib/setup-fixture.js +1 -1
  190. package/lib/setup-fixture.js.map +1 -1
  191. package/lib/ui-kit/Input/Input.d.ts +2 -0
  192. package/lib/ui-kit/Input/Input.js +6 -0
  193. package/lib/ui-kit/Input/Input.js.map +1 -0
  194. package/lib/ui-kit/Input/InputProps.d.ts +8 -0
  195. package/lib/ui-kit/Input/InputProps.js +2 -0
  196. package/lib/ui-kit/Input/InputProps.js.map +1 -0
  197. package/lib/ui-kit/Select/Select.d.ts +6 -0
  198. package/lib/ui-kit/Select/Select.js +6 -0
  199. package/lib/ui-kit/Select/Select.js.map +1 -0
  200. package/lib/ui-kit/Select/SelectOption.d.ts +5 -0
  201. package/lib/ui-kit/Select/SelectOption.js +6 -0
  202. package/lib/ui-kit/Select/SelectOption.js.map +1 -0
  203. package/lib/ui-kit/SwipeListControl/SwipeListControl.js +12 -7
  204. package/lib/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
  205. package/lib/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +1 -0
  206. package/mobile/bundle/bundle.umd.js +136 -83
  207. package/mobile/bundle/bundle.umd.min.js +1 -1
  208. package/mobile/dist/components/BaseTile/BaseTile.js +1 -1
  209. package/mobile/dist/components/BaseTile/BaseTile.js.map +1 -1
  210. package/mobile/dist/components/ComparisonTable/ComparisonTable.js +38 -28
  211. package/mobile/dist/components/ComparisonTable/ComparisonTable.js.map +1 -1
  212. package/mobile/dist/components/ComparisonTable/ComparisonTableContent.d.ts +4 -0
  213. package/mobile/dist/components/ComparisonTable/HeaderCell.d.ts +2 -0
  214. package/mobile/dist/components/ComparisonTable/HeaderCell.js +1 -3
  215. package/mobile/dist/components/ComparisonTable/HeaderCell.js.map +1 -1
  216. package/mobile/dist/components/ComparisonTable/TableCell.d.ts +4 -3
  217. package/mobile/dist/components/ComparisonTable/TableCell.js +5 -5
  218. package/mobile/dist/components/ComparisonTable/TableCell.js.map +1 -1
  219. package/mobile/dist/components/ComparisonTable/TableColumn.d.ts +10 -0
  220. package/mobile/dist/components/ComparisonTable/TableColumn.js +19 -0
  221. package/mobile/dist/components/ComparisonTable/TableColumn.js.map +1 -0
  222. package/mobile/dist/components/ContentPage/ContentPageContext.d.ts +1 -1
  223. package/mobile/dist/components/CreditCalculator/CreditCalculator.d.ts +2 -2
  224. package/mobile/dist/components/CreditCalculator/CreditCalculator.js +18 -22
  225. package/mobile/dist/components/CreditCalculator/CreditCalculator.js.map +1 -1
  226. package/mobile/dist/components/CreditCalculator/getCalculatorParams.d.ts +1 -1
  227. package/mobile/dist/components/CreditCalculator/getCreditRate.d.ts +1 -1
  228. package/mobile/dist/components/CreditCalculator/getDefaultMonths.d.ts +2 -0
  229. package/mobile/dist/components/CreditCalculator/getDefaultMonths.js +8 -0
  230. package/mobile/dist/components/CreditCalculator/getDefaultMonths.js.map +1 -0
  231. package/mobile/dist/components/CreditCalculator/getDefaultSum.d.ts +2 -0
  232. package/mobile/dist/components/CreditCalculator/getDefaultSum.js +8 -0
  233. package/mobile/dist/components/CreditCalculator/getDefaultSum.js.map +1 -0
  234. package/mobile/dist/components/CreditCalculator/getMonthlyPayment.d.ts +1 -1
  235. package/mobile/dist/components/CreditCalculator/renderButton.d.ts +1 -0
  236. package/mobile/dist/components/CreditCalculator/renderButton.js +8 -0
  237. package/mobile/dist/components/CreditCalculator/renderButton.js.map +1 -0
  238. package/mobile/dist/components/CreditCalculator/renderMonthsInput.d.ts +10 -0
  239. package/mobile/dist/components/CreditCalculator/renderMonthsInput.js +11 -0
  240. package/mobile/dist/components/CreditCalculator/renderMonthsInput.js.map +1 -0
  241. package/mobile/dist/components/CreditCalculator/renderProposal.d.ts +1 -0
  242. package/mobile/dist/components/CreditCalculator/renderProposal.js +9 -0
  243. package/mobile/dist/components/CreditCalculator/renderProposal.js.map +1 -0
  244. package/mobile/dist/components/CreditCalculator/renderTermsButton.d.ts +1 -0
  245. package/mobile/dist/components/CreditCalculator/renderTermsButton.js +9 -0
  246. package/mobile/dist/components/CreditCalculator/renderTermsButton.js.map +1 -0
  247. package/mobile/dist/components/CreditCalculator/renderWantedSumInput.d.ts +10 -0
  248. package/mobile/dist/components/CreditCalculator/renderWantedSumInput.js +18 -0
  249. package/mobile/dist/components/CreditCalculator/renderWantedSumInput.js.map +1 -0
  250. package/mobile/dist/components/ExchangeRateTile/CurrencyTable.d.ts +7 -0
  251. package/mobile/dist/components/ExchangeRateTile/CurrencyTable.js +19 -0
  252. package/mobile/dist/components/ExchangeRateTile/CurrencyTable.js.map +1 -0
  253. package/mobile/dist/components/ExchangeRateTile/CurrentLocation.d.ts +7 -0
  254. package/mobile/dist/components/ExchangeRateTile/CurrentLocation.js +7 -0
  255. package/mobile/dist/components/ExchangeRateTile/CurrentLocation.js.map +1 -0
  256. package/mobile/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +7 -0
  257. package/mobile/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +15 -0
  258. package/mobile/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -0
  259. package/mobile/dist/components/ExchangeRateTile/ExchangeRateTile.js +23 -27
  260. package/mobile/dist/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
  261. package/mobile/dist/components/ExchangeRateTile/ExchangeRateTileContent.d.ts +10 -0
  262. package/mobile/dist/components/ExchangeRateTile/formatCurrency.d.ts +1 -0
  263. package/mobile/dist/components/ExchangeRateTile/formatCurrency.js +6 -0
  264. package/mobile/dist/components/ExchangeRateTile/formatCurrency.js.map +1 -0
  265. package/mobile/dist/components/Gallery/Gallery.js +2 -2
  266. package/mobile/dist/components/Gallery/Gallery.js.map +1 -1
  267. package/mobile/dist/components/Header/Header.js +1 -1
  268. package/mobile/dist/components/Header/Header.js.map +1 -1
  269. package/mobile/dist/components/ProductBlock/ProductBlockInner.js +1 -1
  270. package/mobile/dist/components/ProductBlock/ProductBlockInner.js.map +1 -1
  271. package/mobile/dist/hooks/useCreditCalculatorData.js +3 -3
  272. package/mobile/dist/hooks/useCreditCalculatorData.js.map +1 -1
  273. package/mobile/dist/hooks/useExchangeRates.d.ts +9 -0
  274. package/mobile/dist/hooks/useExchangeRates.js +18 -0
  275. package/mobile/dist/hooks/useExchangeRates.js.map +1 -0
  276. package/mobile/dist/icons/IconName.d.ts +3 -2
  277. package/mobile/dist/icons/IconName.js +1 -0
  278. package/mobile/dist/icons/IconName.js.map +1 -1
  279. package/mobile/dist/model/InputTypes.d.ts +1 -0
  280. package/mobile/dist/model/InputTypes.js +2 -0
  281. package/mobile/dist/model/InputTypes.js.map +1 -0
  282. package/mobile/dist/setup-fixture.js +1 -1
  283. package/mobile/dist/setup-fixture.js.map +1 -1
  284. package/mobile/dist/ui-kit/Input/Input.d.ts +2 -0
  285. package/mobile/dist/ui-kit/Input/Input.js +8 -0
  286. package/mobile/dist/ui-kit/Input/Input.js.map +1 -0
  287. package/mobile/dist/ui-kit/Input/InputProps.d.ts +8 -0
  288. package/mobile/dist/ui-kit/Input/InputProps.js +2 -0
  289. package/mobile/dist/ui-kit/Input/InputProps.js.map +1 -0
  290. package/mobile/dist/ui-kit/Select/Select.d.ts +6 -0
  291. package/mobile/dist/ui-kit/Select/Select.js +8 -0
  292. package/mobile/dist/ui-kit/Select/Select.js.map +1 -0
  293. package/mobile/dist/ui-kit/Select/SelectOption.d.ts +5 -0
  294. package/mobile/dist/ui-kit/Select/SelectOption.js +8 -0
  295. package/mobile/dist/ui-kit/Select/SelectOption.js.map +1 -0
  296. package/mobile/dist/ui-kit/SwipeListControl/SwipeListControl.js +11 -6
  297. package/mobile/dist/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
  298. package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +1 -0
  299. package/mobile/lib/components/BaseTile/BaseTile.js +1 -1
  300. package/mobile/lib/components/BaseTile/BaseTile.js.map +1 -1
  301. package/mobile/lib/components/ComparisonTable/ComparisonTable.js +38 -28
  302. package/mobile/lib/components/ComparisonTable/ComparisonTable.js.map +1 -1
  303. package/mobile/lib/components/ComparisonTable/ComparisonTableContent.d.ts +4 -0
  304. package/mobile/lib/components/ComparisonTable/HeaderCell.d.ts +2 -0
  305. package/mobile/lib/components/ComparisonTable/HeaderCell.js +1 -3
  306. package/mobile/lib/components/ComparisonTable/HeaderCell.js.map +1 -1
  307. package/mobile/lib/components/ComparisonTable/TableCell.d.ts +4 -3
  308. package/mobile/lib/components/ComparisonTable/TableCell.js +6 -6
  309. package/mobile/lib/components/ComparisonTable/TableCell.js.map +1 -1
  310. package/mobile/lib/components/ComparisonTable/TableColumn.d.ts +10 -0
  311. package/mobile/lib/components/ComparisonTable/TableColumn.js +17 -0
  312. package/mobile/lib/components/ComparisonTable/TableColumn.js.map +1 -0
  313. package/mobile/lib/components/ContentPage/ContentPageContext.d.ts +1 -1
  314. package/mobile/lib/components/CreditCalculator/CreditCalculator.d.ts +2 -2
  315. package/mobile/lib/components/CreditCalculator/CreditCalculator.js +19 -23
  316. package/mobile/lib/components/CreditCalculator/CreditCalculator.js.map +1 -1
  317. package/mobile/lib/components/CreditCalculator/getCalculatorParams.d.ts +1 -1
  318. package/mobile/lib/components/CreditCalculator/getCreditRate.d.ts +1 -1
  319. package/mobile/lib/components/CreditCalculator/getDefaultMonths.d.ts +2 -0
  320. package/mobile/lib/components/CreditCalculator/getDefaultMonths.js +5 -0
  321. package/mobile/lib/components/CreditCalculator/getDefaultMonths.js.map +1 -0
  322. package/mobile/lib/components/CreditCalculator/getDefaultSum.d.ts +2 -0
  323. package/mobile/lib/components/CreditCalculator/getDefaultSum.js +5 -0
  324. package/mobile/lib/components/CreditCalculator/getDefaultSum.js.map +1 -0
  325. package/mobile/lib/components/CreditCalculator/getMonthlyPayment.d.ts +1 -1
  326. package/mobile/lib/components/CreditCalculator/renderButton.d.ts +1 -0
  327. package/mobile/lib/components/CreditCalculator/renderButton.js +5 -0
  328. package/mobile/lib/components/CreditCalculator/renderButton.js.map +1 -0
  329. package/mobile/lib/components/CreditCalculator/renderMonthsInput.d.ts +10 -0
  330. package/mobile/lib/components/CreditCalculator/renderMonthsInput.js +8 -0
  331. package/mobile/lib/components/CreditCalculator/renderMonthsInput.js.map +1 -0
  332. package/mobile/lib/components/CreditCalculator/renderProposal.d.ts +1 -0
  333. package/mobile/lib/components/CreditCalculator/renderProposal.js +6 -0
  334. package/mobile/lib/components/CreditCalculator/renderProposal.js.map +1 -0
  335. package/mobile/lib/components/CreditCalculator/renderTermsButton.d.ts +1 -0
  336. package/mobile/lib/components/CreditCalculator/renderTermsButton.js +6 -0
  337. package/mobile/lib/components/CreditCalculator/renderTermsButton.js.map +1 -0
  338. package/mobile/lib/components/CreditCalculator/renderWantedSumInput.d.ts +10 -0
  339. package/mobile/lib/components/CreditCalculator/renderWantedSumInput.js +15 -0
  340. package/mobile/lib/components/CreditCalculator/renderWantedSumInput.js.map +1 -0
  341. package/mobile/lib/components/ExchangeRateTile/CurrencyTable.d.ts +7 -0
  342. package/mobile/lib/components/ExchangeRateTile/CurrencyTable.js +17 -0
  343. package/mobile/lib/components/ExchangeRateTile/CurrencyTable.js.map +1 -0
  344. package/mobile/lib/components/ExchangeRateTile/CurrentLocation.d.ts +7 -0
  345. package/mobile/lib/components/ExchangeRateTile/CurrentLocation.js +5 -0
  346. package/mobile/lib/components/ExchangeRateTile/CurrentLocation.js.map +1 -0
  347. package/mobile/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +7 -0
  348. package/mobile/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +13 -0
  349. package/mobile/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -0
  350. package/mobile/lib/components/ExchangeRateTile/ExchangeRateTile.js +23 -27
  351. package/mobile/lib/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
  352. package/mobile/lib/components/ExchangeRateTile/ExchangeRateTileContent.d.ts +10 -0
  353. package/mobile/lib/components/ExchangeRateTile/formatCurrency.d.ts +1 -0
  354. package/mobile/lib/components/ExchangeRateTile/formatCurrency.js +3 -0
  355. package/mobile/lib/components/ExchangeRateTile/formatCurrency.js.map +1 -0
  356. package/mobile/lib/components/Gallery/Gallery.js +2 -2
  357. package/mobile/lib/components/Gallery/Gallery.js.map +1 -1
  358. package/mobile/lib/components/Header/Header.js +1 -1
  359. package/mobile/lib/components/Header/Header.js.map +1 -1
  360. package/mobile/lib/components/ProductBlock/ProductBlockInner.js +1 -1
  361. package/mobile/lib/components/ProductBlock/ProductBlockInner.js.map +1 -1
  362. package/mobile/lib/hooks/useCreditCalculatorData.js +3 -3
  363. package/mobile/lib/hooks/useCreditCalculatorData.js.map +1 -1
  364. package/mobile/lib/hooks/useExchangeRates.d.ts +9 -0
  365. package/mobile/lib/hooks/useExchangeRates.js +15 -0
  366. package/mobile/lib/hooks/useExchangeRates.js.map +1 -0
  367. package/mobile/lib/icons/IconName.d.ts +3 -2
  368. package/mobile/lib/icons/IconName.js +1 -0
  369. package/mobile/lib/icons/IconName.js.map +1 -1
  370. package/mobile/lib/model/InputTypes.d.ts +1 -0
  371. package/mobile/lib/model/InputTypes.js +2 -0
  372. package/mobile/lib/model/InputTypes.js.map +1 -0
  373. package/mobile/lib/setup-fixture.js +1 -1
  374. package/mobile/lib/setup-fixture.js.map +1 -1
  375. package/mobile/lib/ui-kit/Input/Input.d.ts +2 -0
  376. package/mobile/lib/ui-kit/Input/Input.js +6 -0
  377. package/mobile/lib/ui-kit/Input/Input.js.map +1 -0
  378. package/mobile/lib/ui-kit/Input/InputProps.d.ts +8 -0
  379. package/mobile/lib/ui-kit/Input/InputProps.js +2 -0
  380. package/mobile/lib/ui-kit/Input/InputProps.js.map +1 -0
  381. package/mobile/lib/ui-kit/Select/Select.d.ts +6 -0
  382. package/mobile/lib/ui-kit/Select/Select.js +6 -0
  383. package/mobile/lib/ui-kit/Select/Select.js.map +1 -0
  384. package/mobile/lib/ui-kit/Select/SelectOption.d.ts +5 -0
  385. package/mobile/lib/ui-kit/Select/SelectOption.js +6 -0
  386. package/mobile/lib/ui-kit/Select/SelectOption.js.map +1 -0
  387. package/mobile/lib/ui-kit/SwipeListControl/SwipeListControl.js +12 -7
  388. package/mobile/lib/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
  389. package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +1 -0
  390. package/mobile/src/common.css +12 -2
  391. package/mobile/src/components/BaseTile/BaseTile.tsx +1 -1
  392. package/mobile/src/components/ComparisonTable/ComparisonTable.tsx +90 -102
  393. package/mobile/src/components/ComparisonTable/ComparisonTableContent.ts +4 -0
  394. package/mobile/src/components/ComparisonTable/HeaderCell.tsx +34 -30
  395. package/mobile/src/components/ComparisonTable/TableCell.tsx +30 -27
  396. package/mobile/src/components/ComparisonTable/TableColumn.tsx +66 -0
  397. package/mobile/src/components/ContentPage/ContentPageContext.tsx +1 -1
  398. package/mobile/src/components/CreditCalculator/CreditCalculator.tsx +26 -87
  399. package/mobile/src/components/CreditCalculator/getCalculatorParams.ts +1 -1
  400. package/mobile/src/components/CreditCalculator/getCreditRate.ts +1 -1
  401. package/mobile/src/components/CreditCalculator/getDefaultMonths.ts +7 -0
  402. package/mobile/src/components/CreditCalculator/getDefaultSum.ts +7 -0
  403. package/mobile/src/components/CreditCalculator/getMonthlyPayment.ts +1 -1
  404. package/mobile/src/components/CreditCalculator/renderButton.tsx +13 -0
  405. package/mobile/src/components/CreditCalculator/renderMonthsInput.tsx +29 -0
  406. package/mobile/src/components/CreditCalculator/renderProposal.tsx +13 -0
  407. package/mobile/src/components/CreditCalculator/renderTermsButton.tsx +16 -0
  408. package/mobile/src/components/CreditCalculator/renderWantedSumInput.tsx +36 -0
  409. package/mobile/src/components/ExchangeRateTile/CurrencyTable.tsx +47 -0
  410. package/mobile/src/components/ExchangeRateTile/CurrentLocation.tsx +22 -0
  411. package/mobile/src/components/ExchangeRateTile/ExchangeCurrencyCalculator.tsx +47 -0
  412. package/mobile/src/components/ExchangeRateTile/ExchangeRateTile.tsx +48 -79
  413. package/mobile/src/components/ExchangeRateTile/ExchangeRateTileContent.ts +11 -0
  414. package/mobile/src/components/ExchangeRateTile/formatCurrency.ts +3 -0
  415. package/mobile/src/components/Gallery/Gallery.tsx +2 -2
  416. package/mobile/src/components/Header/Header.tsx +1 -1
  417. package/mobile/src/components/ProductBlock/ProductBlock.example.json +11 -1
  418. package/mobile/src/components/ProductBlock/ProductBlockInner.tsx +5 -5
  419. package/mobile/src/hooks/useCreditCalculatorData.ts +3 -7
  420. package/mobile/src/hooks/useExchangeRates.ts +25 -0
  421. package/mobile/src/icons/GpsIcon.svg +8 -0
  422. package/mobile/src/icons/IconName.ts +3 -3
  423. package/mobile/src/model/InputTypes.ts +1 -0
  424. package/mobile/src/setup-fixture.ts +1 -1
  425. package/mobile/src/ui-kit/Input/Input.tsx +8 -0
  426. package/mobile/src/ui-kit/Input/InputProps.ts +9 -0
  427. package/mobile/src/ui-kit/Select/Select.tsx +15 -0
  428. package/mobile/src/ui-kit/Select/SelectOption.tsx +14 -0
  429. package/mobile/src/ui-kit/SwipeListControl/SwipeListControl.tsx +27 -19
  430. package/mobile/src/ui-kit/SwipeListControl/SwipeListControlProps.ts +1 -0
  431. package/package.json +1 -1
  432. package/src/common.css +12 -2
  433. package/src/components/BaseTile/BaseTile.tsx +1 -1
  434. package/src/components/Blocks.ts +2 -0
  435. package/src/components/ComparisonTable/ComparisonTable.fixture.mobile.tsx +152 -0
  436. package/src/components/ComparisonTable/ComparisonTable.mobile.tsx +121 -0
  437. package/src/components/ComparisonTable/ComparisonTableContent.ts +4 -0
  438. package/src/components/ComparisonTable/HeaderCell.mobile.tsx +50 -0
  439. package/src/components/ComparisonTable/TableCell.mobile.tsx +46 -0
  440. package/src/components/ComparisonTable/TableCell.tsx +3 -2
  441. package/src/components/ComparisonTable/TableColumn.tsx +66 -0
  442. package/src/components/ContentPage/ContentPageContext.tsx +1 -1
  443. package/src/components/CreditCalculator/CreditCalculator.tsx +26 -87
  444. package/src/components/CreditCalculator/getCalculatorParams.ts +1 -1
  445. package/src/components/CreditCalculator/getCreditRate.ts +1 -1
  446. package/src/components/CreditCalculator/getDefaultMonths.ts +7 -0
  447. package/src/components/CreditCalculator/getDefaultSum.ts +7 -0
  448. package/src/components/CreditCalculator/getMonthlyPayment.ts +1 -1
  449. package/src/components/CreditCalculator/renderButton.tsx +13 -0
  450. package/src/components/CreditCalculator/renderMonthsInput.tsx +29 -0
  451. package/src/components/CreditCalculator/renderProposal.tsx +13 -0
  452. package/src/components/CreditCalculator/renderTermsButton.tsx +16 -0
  453. package/src/components/CreditCalculator/renderWantedSumInput.tsx +36 -0
  454. package/src/components/ExchangeRateTile/CurrencyTable.tsx +47 -0
  455. package/src/components/ExchangeRateTile/CurrentLocation.tsx +22 -0
  456. package/src/components/ExchangeRateTile/ExchangeCurrencyCalculator.tsx +47 -0
  457. package/src/components/ExchangeRateTile/ExchangeRateTile.fixture.tsx +1 -1
  458. package/src/components/ExchangeRateTile/ExchangeRateTile.tsx +48 -79
  459. package/src/components/ExchangeRateTile/ExchangeRateTileContent.ts +11 -0
  460. package/src/components/ExchangeRateTile/formatCurrency.ts +3 -0
  461. package/src/components/Gallery/Gallery.mobile.tsx +2 -2
  462. package/src/components/Header/Header.mobile.tsx +1 -1
  463. package/src/components/ProductBlock/ProductBlock.example.json +11 -1
  464. package/src/components/ProductBlock/ProductBlock.fixture.mobile.tsx +57 -32
  465. package/src/components/ProductBlock/ProductBlock.fixture.tsx +57 -104
  466. package/src/components/ProductBlock/ProductBlockInner.mobile.tsx +5 -5
  467. package/src/components/ProductBlock/ProductBlockInner.tsx +4 -4
  468. package/src/hooks/useCreditCalculatorData.ts +3 -7
  469. package/src/hooks/useExchangeRates.ts +25 -0
  470. package/src/icons/GpsIcon.svg +8 -0
  471. package/src/icons/IconName.ts +3 -3
  472. package/src/model/InputTypes.ts +1 -0
  473. package/src/setup-fixture.ts +1 -1
  474. package/src/ui-kit/Button/Button.fixture.tsx +2 -6
  475. package/src/ui-kit/Input/Input.tsx +8 -0
  476. package/src/ui-kit/Input/InputProps.ts +9 -0
  477. package/src/ui-kit/Select/Select.tsx +15 -0
  478. package/src/ui-kit/Select/SelectOption.tsx +14 -0
  479. package/src/ui-kit/SwipeListControl/SwipeListControl.tsx +27 -19
  480. package/src/ui-kit/SwipeListControl/SwipeListControlProps.ts +1 -0
@@ -0,0 +1,15 @@
1
+ import { JSX } from '@redneckz/uni-jsx';
2
+
3
+ export interface SelectProps {
4
+ className?: string;
5
+ id?: string;
6
+ name?: string;
7
+ }
8
+
9
+ export const Select = JSX<SelectProps>(({ className = '', id, name, children }) => {
10
+ return (
11
+ <select className={className} id={id} name={name || id}>
12
+ {children}
13
+ </select>
14
+ );
15
+ });
@@ -0,0 +1,14 @@
1
+ import { JSX } from '@redneckz/uni-jsx';
2
+
3
+ export interface SelectOptionProps {
4
+ className?: string;
5
+ value?: string;
6
+ }
7
+
8
+ export const SelectOption = JSX<SelectOptionProps>(({ className = '', value, children }) => {
9
+ return (
10
+ <option className={className} value={`${value}`}>
11
+ {children}
12
+ </option>
13
+ );
14
+ });
@@ -1,10 +1,10 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
+ import { DEFAULT_GAP, DEFAULT_PADDING } from './constants';
3
+ import { SwipeListControlDots } from './SwipeListControlDots';
4
+ import { SwipeListControlList } from './SwipeListControlList';
2
5
  import type { SwipeListControlProps } from './SwipeListControlProps';
3
- import { getScrollPoints } from './utils/getScrollPoints';
4
6
  import { getIndexParts } from './utils/getIndexParts';
5
- import { SwipeListControlList } from './SwipeListControlList';
6
- import { SwipeListControlDots } from './SwipeListControlDots';
7
- import { DEFAULT_GAP, DEFAULT_PADDING } from './constants';
7
+ import { getScrollPoints } from './utils/getScrollPoints';
8
8
 
9
9
  export const SwipeListControl = JSX<SwipeListControlProps>(
10
10
  ({
@@ -14,6 +14,7 @@ export const SwipeListControl = JSX<SwipeListControlProps>(
14
14
  gap = DEFAULT_GAP,
15
15
  padding = DEFAULT_PADDING,
16
16
  showDots = true,
17
+ onSlideChange,
17
18
  }) => {
18
19
  const [activeIndex, setActiveIndex] = context.useState<number>(0);
19
20
  const [indexFraction, setIndexFraction] = context.useState<number>(0);
@@ -35,28 +36,35 @@ export const SwipeListControl = JSX<SwipeListControlProps>(
35
36
  });
36
37
 
37
38
  const { index, fraction } = getIndexParts(scrollLeft, scrollPoints);
39
+ if (index !== activeIndex && onSlideChange) {
40
+ onSlideChange();
41
+ }
38
42
  setActiveIndex(index);
39
43
  setIndexFraction(fraction);
40
44
  };
41
45
 
42
46
  return (
43
47
  <div className={className}>
44
- <SwipeListControlList
45
- gap={gap}
46
- padding={padding}
47
- activeIndex={activeIndex}
48
- onScroll={handleScroll}
49
- >
50
- {children}
51
- </SwipeListControlList>
52
- <SwipeListControlDots
53
- activeIndex={activeIndex}
54
- indexFraction={indexFraction}
55
- showDots={showDots}
56
- >
57
- {children}
58
- </SwipeListControlDots>
48
+ {renderSwipeList({ gap, padding, activeIndex, handleScroll, children })}
49
+ {renderSwipelistDots({ activeIndex, indexFraction, showDots, children })}
59
50
  </div>
60
51
  );
61
52
  },
62
53
  );
54
+
55
+ const renderSwipeList = ({ gap, padding, activeIndex, handleScroll, children }) => (
56
+ <SwipeListControlList
57
+ gap={gap}
58
+ padding={padding}
59
+ activeIndex={activeIndex}
60
+ onScroll={handleScroll}
61
+ >
62
+ {children}
63
+ </SwipeListControlList>
64
+ );
65
+
66
+ const renderSwipelistDots = ({ activeIndex, indexFraction, showDots, children }) => (
67
+ <SwipeListControlDots activeIndex={activeIndex} indexFraction={indexFraction} showDots={showDots}>
68
+ {children}
69
+ </SwipeListControlDots>
70
+ );
@@ -16,4 +16,5 @@ export interface SwipeContainer {
16
16
  export interface SwipeListControlProps extends SwipeContainer, UniBlockProps {
17
17
  /** @title Точки-индикаторы */
18
18
  showDots?: boolean;
19
+ onSlideChange?: () => void;
19
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.3.9",
3
+ "version": "0.3.12",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
package/src/common.css CHANGED
@@ -86,9 +86,7 @@
86
86
  .horizontal-list {
87
87
  display: flex;
88
88
  overflow-x: scroll;
89
- overscroll-behavior: contain;
90
89
  -webkit-overflow-scrolling: touch;
91
- touch-action: pan-x;
92
90
  scroll-snap-type: x mandatory;
93
91
  }
94
92
 
@@ -138,4 +136,16 @@
138
136
  box-shadow: none;
139
137
  border: 3px solid #42ab44;
140
138
  }
139
+
140
+ /* Hide arrows */
141
+ input[type='number']::-webkit-outer-spin-button,
142
+ input[type='number']::-webkit-inner-spin-button {
143
+ -webkit-appearance: none;
144
+ margin: 0;
145
+ }
146
+
147
+ /* Hide arrows */
148
+ input[type='number'] {
149
+ -moz-appearance: textfield;
150
+ }
141
151
  }
@@ -12,7 +12,7 @@ export const BaseTile = JSX<BaseTileProps>(
12
12
  <div className="flex grow w-full justify-between">
13
13
  <div className="flex flex-col justify-between w-full">
14
14
  <div>{children}</div>
15
- <div>{buttons}</div>
15
+ {buttons?.length ? <div>{buttons}</div> : null}
16
16
  </div>
17
17
  {image}
18
18
  </div>
@@ -12,6 +12,7 @@ import { MiniGallery } from './MiniGallery/MiniGallery';
12
12
  import { MobileAppTile } from './MobileAppTile/MobileAppTile';
13
13
  import { Navigation } from './Navigation/Navigation';
14
14
  import { PictureText } from './PictureText/PictureText';
15
+ import { Placeholder } from './Placeholder/Placeholder';
15
16
  import { ProductBlock } from './ProductBlock/ProductBlock';
16
17
  import { ProductGallery } from './ProductGallery/ProductGallery';
17
18
  import { ProductTile } from './ProductTile/ProductTile';
@@ -44,4 +45,5 @@ export const Blocks = {
44
45
  TextBlock,
45
46
  Tile,
46
47
  Navigation,
48
+ Placeholder,
47
49
  };
@@ -0,0 +1,152 @@
1
+ import type { Picture } from '../../model/Picture';
2
+ import { context } from '../../setup-fixture';
3
+ import { ComparisonTable } from './ComparisonTable';
4
+ import type { Column } from './ComparisonTableContent';
5
+
6
+ const image1: Picture = {
7
+ src: 'card-1.png',
8
+ format: 'webp',
9
+ size: {
10
+ width: 100,
11
+ height: 63,
12
+ },
13
+ };
14
+
15
+ const image2: Picture = {
16
+ src: 'card-2.png',
17
+ format: 'webp',
18
+ size: {
19
+ width: 100,
20
+ height: 63,
21
+ },
22
+ };
23
+
24
+ const image3: Picture = {
25
+ src: 'card-3.png',
26
+ format: 'webp',
27
+ size: {
28
+ width: 100,
29
+ height: 63,
30
+ },
31
+ };
32
+
33
+ const rowHeaders = [
34
+ { title: 'Начисление процентов на остаток по счету' },
35
+ { title: 'Начисление процентов на остаток по счету' },
36
+ { title: 'Начисление процентов на остаток по счету' },
37
+ ];
38
+ const columns: Column[] = [
39
+ {
40
+ header: {
41
+ title: 'Россельхоз-Росснефть',
42
+ subtitle: 'Менеджер свяжется с вами и согласует встречу',
43
+ image: image1,
44
+ link: {
45
+ text: 'Подробнее',
46
+ href: '#',
47
+ },
48
+ },
49
+ data: [
50
+ [
51
+ {
52
+ label: 'Бесплатно',
53
+ description: 'Мир',
54
+ },
55
+ ],
56
+ [
57
+ {
58
+ label: 'Бесплатно',
59
+ description: 'Мир',
60
+ },
61
+ ],
62
+ [
63
+ {
64
+ label: 'Бесплатно',
65
+ description: 'Мир',
66
+ },
67
+ ],
68
+ ],
69
+ },
70
+ {
71
+ header: {
72
+ title: 'Россельхоз-Росснефть',
73
+ image: image2,
74
+ link: {
75
+ text: 'Подробнее',
76
+ href: '#',
77
+ },
78
+ },
79
+ data: [
80
+ [
81
+ {
82
+ label: 'Бесплатно',
83
+ description: 'Начисление процентов на остаток по счету',
84
+ },
85
+ ],
86
+ [
87
+ {
88
+ label: 'Бесплатно',
89
+ description: 'Начисление',
90
+ },
91
+ ],
92
+ [
93
+ {
94
+ description: 'Начисление процентов на остаток по счету',
95
+ },
96
+ ],
97
+ ],
98
+ },
99
+ {
100
+ header: {
101
+ title: 'Профсоюзная',
102
+ image: image3,
103
+ link: {
104
+ text: 'Подробнее',
105
+ href: '/credits',
106
+ },
107
+ },
108
+ data: [
109
+ [{ label: 'Нет' }],
110
+ [{ label: 'Бесплатно' }],
111
+ [{ label: 'Есть' }],
112
+ [{ label: 'До 20%' }],
113
+ [
114
+ {
115
+ label: 'Бесплатно',
116
+ description: 'При обороте по карте от 10000 ₽ в месяц',
117
+ },
118
+ ],
119
+ [{ label: '69 рублей в месяц' }],
120
+ [{ description: 'Для членов профсоюзных организаций' }],
121
+ ],
122
+ },
123
+ ];
124
+ export default {
125
+ default: (
126
+ <div className="container grid grid-cols-12">
127
+ <ComparisonTable
128
+ className="col-span-12"
129
+ title="Другие дебетовые карты Россельхозбанка"
130
+ isColoredFirstColumn={true}
131
+ context={context}
132
+ rowHeaders={rowHeaders}
133
+ columns={Array(2).fill(columns).flat()}
134
+ visibleRowLength={2}
135
+ />
136
+ </div>
137
+ ),
138
+ 'with swiper': (
139
+ <div className="container grid grid-cols-12">
140
+ <ComparisonTable
141
+ className="col-span-12"
142
+ title="Другие дебетовые карты Россельхозбанка"
143
+ isColoredFirstColumn={true}
144
+ context={context}
145
+ rowHeaders={rowHeaders}
146
+ useSwiper={true}
147
+ columns={Array(2).fill(columns).flat()}
148
+ visibleRowLength={2}
149
+ />
150
+ </div>
151
+ ),
152
+ };
@@ -0,0 +1,121 @@
1
+ import { JSX } from '@redneckz/uni-jsx';
2
+ import type { UniBlockProps } from '../../types';
3
+ import { Heading } from '../../ui-kit/Heading/Heading';
4
+ import { SwipeListControl } from '../../ui-kit/SwipeListControl/SwipeListControl';
5
+ import type { ComparisonTableContent } from './ComparisonTableContent';
6
+ import { TableColumn } from './TableColumn';
7
+
8
+ export interface ComparisonTableProps extends ComparisonTableContent, UniBlockProps {}
9
+
10
+ export const ComparisonTable = JSX<ComparisonTableProps>(
11
+ ({
12
+ className,
13
+ context,
14
+ title,
15
+ rowHeaders,
16
+ columns,
17
+ visibleRowLength = 0,
18
+ isColoredFirstColumn = false,
19
+ useSwiper = false,
20
+ }) => {
21
+ const tableData =
22
+ columns?.map(({ data, header }) => ({
23
+ header,
24
+ column: data?.map((cell, i) => ({ cell, rowHeader: rowHeaders?.[i]?.title })),
25
+ })) || [];
26
+
27
+ const [columnsViewState, setColumnsViewState] = context.useState<boolean[]>(
28
+ new Array(columns?.length).fill(!visibleRowLength),
29
+ );
30
+
31
+ const handleToggleColumn = (i: number) => {
32
+ columnsViewState[i] = !columnsViewState[i];
33
+ setColumnsViewState([...columnsViewState]);
34
+ };
35
+
36
+ return (
37
+ <section
38
+ className={`bg-white font-sans px-4 py-6 overflow-hidden text-primary-text relative ${
39
+ className || ''
40
+ }`}
41
+ >
42
+ {title && (
43
+ <Heading headingType="h3" className="font-medium text-center m-0 mb-5" title={title} />
44
+ )}
45
+
46
+ {renderColumns({
47
+ tableData,
48
+ context,
49
+ visibleRowLength,
50
+ isColoredFirstColumn,
51
+ columnsViewState,
52
+ handleToggleColumn,
53
+ useSwiper,
54
+ setColumnsViewState,
55
+ })}
56
+ </section>
57
+ );
58
+ },
59
+ );
60
+
61
+ const renderColumns = ({
62
+ context,
63
+ tableData,
64
+ visibleRowLength,
65
+ isColoredFirstColumn,
66
+ columnsViewState,
67
+ handleToggleColumn,
68
+ useSwiper,
69
+ setColumnsViewState,
70
+ }) => (
71
+ <div role="table">
72
+ {tableData?.length ? (
73
+ useSwiper ? (
74
+ <SwipeListControl
75
+ context={context}
76
+ onSlideChange={onSlideChange(columnsViewState, setColumnsViewState)}
77
+ >
78
+ {tableData.map(
79
+ renderColumn({
80
+ context,
81
+ visibleRowLength,
82
+ isColoredFirstColumn,
83
+ columnsViewState,
84
+ handleToggleColumn,
85
+ }),
86
+ )}
87
+ </SwipeListControl>
88
+ ) : (
89
+ tableData.map(
90
+ renderColumn({
91
+ context,
92
+ visibleRowLength,
93
+ isColoredFirstColumn,
94
+ columnsViewState,
95
+ handleToggleColumn,
96
+ }),
97
+ )
98
+ )
99
+ ) : null}
100
+ </div>
101
+ );
102
+
103
+ const renderColumn =
104
+ ({ context, visibleRowLength, isColoredFirstColumn, columnsViewState, handleToggleColumn }) =>
105
+ (columnData, i) =>
106
+ (
107
+ <TableColumn
108
+ key={String(i)}
109
+ context={context}
110
+ visibleRowLength={visibleRowLength}
111
+ showRow={columnsViewState[i]}
112
+ header={columnData.header}
113
+ columnData={columnData.column}
114
+ isFillGradient={i === 0 && isColoredFirstColumn}
115
+ onToggleColumn={() => handleToggleColumn(i)}
116
+ />
117
+ );
118
+
119
+ const onSlideChange = (columnsViewState, setColumnsViewState) => () => {
120
+ setColumnsViewState(new Array(columnsViewState.length).fill(false));
121
+ };
@@ -26,6 +26,8 @@ export interface CellData {
26
26
  export interface ColumnHeader {
27
27
  /** @title Заголовок */
28
28
  title?: string;
29
+ /** @title Подзаголовок */
30
+ subtitle?: string;
29
31
  icon?: IconName;
30
32
  image?: Picture;
31
33
  link?: LinkProps;
@@ -61,4 +63,6 @@ export interface ComparisonTableContent {
61
63
  isColoredFirstColumn?: boolean;
62
64
  /** @title Отображать заданное количество строк */
63
65
  visibleRowLength?: number;
66
+ /** @title Использовать свайпер- */
67
+ useSwiper?: boolean;
64
68
  }
@@ -0,0 +1,50 @@
1
+ import { JSX } from '@redneckz/uni-jsx';
2
+ import type { LinkProps } from '../../model/LinkProps';
3
+ import type { Picture } from '../../model/Picture';
4
+ import { Heading } from '../../ui-kit/Heading/Heading';
5
+ import { Icon } from '../../ui-kit/Icon/Icon';
6
+ import type { IconName } from '../../ui-kit/Icon/IconProps';
7
+ import { Img } from '../../ui-kit/Img/Img';
8
+
9
+ export interface HeaderCellProps {
10
+ icon?: IconName;
11
+ image?: Picture;
12
+ title?: string;
13
+ subtitle?: string;
14
+ isFillGradient?: boolean;
15
+ link?: LinkProps;
16
+ }
17
+
18
+ export const HeaderCell = JSX<HeaderCellProps>(
19
+ ({ icon, image, title, subtitle, isFillGradient }) => (
20
+ <div role="columnheader" scope="col">
21
+ {icon && (
22
+ <Icon
23
+ className="h-[63px] w-[63px] min-w-[63px] min-h-[63px] mb-4"
24
+ name={icon}
25
+ width="63"
26
+ height="63"
27
+ />
28
+ )}
29
+ {image?.src && (
30
+ <div className="mb-3.5">
31
+ <Img image={image} />
32
+ </div>
33
+ )}
34
+ {title && (
35
+ <Heading
36
+ headingType="h4"
37
+ className={`${isFillGradient ? 'text-white' : ''}`}
38
+ title={title}
39
+ />
40
+ )}
41
+ {subtitle && (
42
+ <div
43
+ className={`text-m-sm mb-3.5 ${isFillGradient ? 'text-white' : 'text-secondary-text/80'}`}
44
+ >
45
+ {subtitle}
46
+ </div>
47
+ )}
48
+ </div>
49
+ ),
50
+ );
@@ -0,0 +1,46 @@
1
+ import { JSX } from '@redneckz/uni-jsx';
2
+ import type { CellData } from './ComparisonTableContent';
3
+ import { DIVIDER_CLASSES } from './constants';
4
+
5
+ export interface TableCellProps {
6
+ cell: CellData[];
7
+ rowHeader?: string;
8
+ isLastRow?: boolean;
9
+ isFirstRow?: boolean;
10
+ isFillGradient?: boolean;
11
+ }
12
+
13
+ export const TableCell = JSX<TableCellProps>(({ cell, rowHeader, isFillGradient = false }) => {
14
+ const cellWrapperClasses = `box-border flex flex-col`;
15
+
16
+ const cellClasses = `h-full ${DIVIDER_CLASSES}`;
17
+
18
+ return (
19
+ <div className={cellWrapperClasses} role="cell">
20
+ <div className={cellClasses}>{cell.map(renderCellInner(isFillGradient, rowHeader))}</div>
21
+ </div>
22
+ );
23
+ });
24
+
25
+ const renderCellInner =
26
+ (isFillGradient: boolean, rowHeader?: string) =>
27
+ ({ label, description }: CellData, i: number) =>
28
+ (
29
+ <div key={String(i)} className="flex justify-between text-m-sm py-3.5">
30
+ <div className={`${isFillGradient ? 'text-white/80' : 'text-secondary-text'}`}>
31
+ {rowHeader}
32
+ </div>
33
+ <div className="basis-1/2">
34
+ {label && (
35
+ <div className={`text-right ${isFillGradient ? 'text-white' : ''}`}>{label}</div>
36
+ )}
37
+ {description && (
38
+ <div
39
+ className={`text-right ${isFillGradient ? 'text-white/80' : 'text-secondary-text'}`}
40
+ >
41
+ {description}
42
+ </div>
43
+ )}
44
+ </div>
45
+ </div>
46
+ );
@@ -4,8 +4,9 @@ import { BORDER_CLASSES, DIVIDER_CLASSES, GRADIENT } from './constants';
4
4
 
5
5
  export interface TableCellProps {
6
6
  cell: CellData[];
7
- isLastRow: boolean;
8
- isFirstRow: boolean;
7
+ isLastRow?: boolean;
8
+ isFirstRow?: boolean;
9
+ rowHeader?: string;
9
10
  isFillGradient: boolean;
10
11
  }
11
12
 
@@ -0,0 +1,66 @@
1
+ import { JSX } from '@redneckz/uni-jsx';
2
+ import type { ButtonVersion } from '../../model/ButtonVersion';
3
+ import type { UniBlockProps } from '../../types';
4
+ import { Button } from '../../ui-kit/Button/Button';
5
+ import { GRADIENT } from './constants';
6
+ import { HeaderCell } from './HeaderCell';
7
+ import { TableCell } from './TableCell';
8
+
9
+ export interface TableColumnProps extends UniBlockProps {
10
+ header: any;
11
+ columnData: any;
12
+ visibleRowLength: number;
13
+ isFillGradient: boolean;
14
+ showRow: boolean;
15
+ onToggleColumn: () => void;
16
+ }
17
+
18
+ export const TableColumn = JSX<TableColumnProps>(
19
+ ({ header, columnData, visibleRowLength = 0, isFillGradient, showRow, onToggleColumn }) => {
20
+ const columnDataView = columnData.slice(0, showRow ? columnData.length : visibleRowLength);
21
+ const gradientClassName = isFillGradient ? GRADIENT : '';
22
+ const buttonVersion: ButtonVersion = isFillGradient ? 'secondary' : 'primary';
23
+ return (
24
+ <div className={`border border-main-stroke rounded-md p-4 mb-3.5 ${gradientClassName}`}>
25
+ <HeaderCell {...header} isFillGradient={isFillGradient} />
26
+ {columnDataView?.length
27
+ ? columnDataView.map(({ rowHeader, cell }, i) => (
28
+ <TableCell
29
+ key={String(i)}
30
+ cell={cell}
31
+ rowHeader={rowHeader}
32
+ isFillGradient={isFillGradient}
33
+ />
34
+ ))
35
+ : null}
36
+
37
+ {showRow && renderButton({ header, buttonVersion })}
38
+ {renderToggleButton({ onToggleColumn, isFillGradient, showRow })}
39
+ </div>
40
+ );
41
+ },
42
+ );
43
+
44
+ const renderButton = ({ header, buttonVersion }) => (
45
+ <Button
46
+ href={header.link.href}
47
+ target={header.link.target}
48
+ version={buttonVersion}
49
+ className="font-medium text-m-sm mt-4 py-[11px]"
50
+ >
51
+ {header.link.text}
52
+ </Button>
53
+ );
54
+
55
+ const renderToggleButton = ({ onToggleColumn, isFillGradient, showRow }) => (
56
+ <div className="mt-5">
57
+ <a
58
+ onClick={onToggleColumn}
59
+ className={`font-medium text-m-sm cursor-pointer ${
60
+ isFillGradient ? 'text-white/80' : 'text-primary-main'
61
+ }`}
62
+ >
63
+ {!showRow ? 'Показать описание' : 'Скрыть'}
64
+ </a>
65
+ </div>
66
+ );
@@ -21,7 +21,7 @@ export interface Search {
21
21
 
22
22
  export type AsyncDataHook = <Data, Error = any>(
23
23
  key: string,
24
- fetcher: () => Promise<Data>,
24
+ fetcher: (key: string) => Promise<Data>,
25
25
  ) => { data?: Data; error?: Error };
26
26
 
27
27
  export type GeolocationHook = (defaultLocation: string) => [string, () => void];