@redneckz/wildless-cms-uni-blocks 0.14.600 → 0.14.601

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 (336) hide show
  1. package/bundle/EventBus/EventBus.d.ts +4 -17
  2. package/bundle/EventBus/defaultEventBus.d.ts +13 -2
  3. package/bundle/EventBus/useLatestEvent.d.ts +2 -0
  4. package/bundle/bundle.umd.js +89 -131
  5. package/bundle/bundle.umd.min.js +1 -1
  6. package/bundle/components/CarouselTariffsCard/CarouselTariffsCardAction.d.ts +6 -0
  7. package/bundle/hooks/useLocation.d.ts +1 -2
  8. package/bundle/ui-kit/Foldable/Foldable.d.ts +1 -11
  9. package/dist/EventBus/EventBus.d.ts +4 -17
  10. package/dist/EventBus/EventBus.js +10 -29
  11. package/dist/EventBus/EventBus.js.map +1 -1
  12. package/dist/EventBus/defaultEventBus.d.ts +13 -2
  13. package/dist/EventBus/defaultEventBus.js.map +1 -1
  14. package/dist/EventBus/useLatestEvent.d.ts +2 -0
  15. package/dist/EventBus/useLatestEvent.js +11 -0
  16. package/dist/EventBus/useLatestEvent.js.map +1 -0
  17. package/dist/components/CarouselTariffsCard/CarouselTariffsCard.js +25 -11
  18. package/dist/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
  19. package/dist/components/CarouselTariffsCard/CarouselTariffsCardAction.d.ts +6 -0
  20. package/dist/components/CarouselTariffsCard/CarouselTariffsCardAction.js +2 -0
  21. package/dist/components/CarouselTariffsCard/CarouselTariffsCardAction.js.map +1 -0
  22. package/dist/components/ExchangeRateTile/ExchangeRateTile.js +1 -1
  23. package/dist/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
  24. package/dist/components/Header/HeaderSecondaryMenu.js +1 -1
  25. package/dist/components/Header/HeaderSecondaryMenu.js.map +1 -1
  26. package/dist/components/OfficesAtmsMap/AtmsMap.js +1 -1
  27. package/dist/components/OfficesAtmsMap/AtmsMap.js.map +1 -1
  28. package/dist/components/OfficesAtmsMap/OfficesMap.js +1 -1
  29. package/dist/components/OfficesAtmsMap/OfficesMap.js.map +1 -1
  30. package/dist/components/StickyBottomMenu/BurgerMenuDialog.js +1 -1
  31. package/dist/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
  32. package/dist/hooks/useLocation.d.ts +1 -2
  33. package/dist/hooks/useLocation.js +33 -27
  34. package/dist/hooks/useLocation.js.map +1 -1
  35. package/dist/hooks/useRegions.js +1 -3
  36. package/dist/hooks/useRegions.js.map +1 -1
  37. package/dist/ui-kit/DialogManager/useDialogManager.js +3 -3
  38. package/dist/ui-kit/DialogManager/useDialogManager.js.map +1 -1
  39. package/dist/ui-kit/DialogManager/useDialogsList.js +1 -1
  40. package/dist/ui-kit/DialogManager/useDialogsList.js.map +1 -1
  41. package/dist/ui-kit/Foldable/Foldable.d.ts +1 -11
  42. package/dist/ui-kit/Foldable/Foldable.js +2 -10
  43. package/dist/ui-kit/Foldable/Foldable.js.map +1 -1
  44. package/dist/ui-kit/FormField/constants.js +0 -1
  45. package/dist/ui-kit/FormField/constants.js.map +1 -1
  46. package/dist/ui-kit/FormField/getValidation.js +0 -1
  47. package/dist/ui-kit/FormField/getValidation.js.map +1 -1
  48. package/dist/ui-kit/LocationDialog/LocationDialog.js +12 -9
  49. package/dist/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
  50. package/dist/ui-kit/PopupManager/PopupManager.js +1 -1
  51. package/dist/ui-kit/PopupManager/PopupManager.js.map +1 -1
  52. package/dist/ui-kit/PopupManager/usePopupManager.js +3 -3
  53. package/dist/ui-kit/PopupManager/usePopupManager.js.map +1 -1
  54. package/lib/EventBus/EventBus.d.ts +4 -17
  55. package/lib/EventBus/EventBus.js +10 -29
  56. package/lib/EventBus/EventBus.js.map +1 -1
  57. package/lib/EventBus/defaultEventBus.d.ts +13 -2
  58. package/lib/EventBus/defaultEventBus.js.map +1 -1
  59. package/lib/EventBus/useLatestEvent.d.ts +2 -0
  60. package/lib/EventBus/useLatestEvent.js +8 -0
  61. package/lib/EventBus/useLatestEvent.js.map +1 -0
  62. package/lib/common.css +1 -1
  63. package/lib/components/CarouselTariffsCard/CarouselTariffsCard.js +26 -12
  64. package/lib/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
  65. package/lib/components/CarouselTariffsCard/CarouselTariffsCardAction.d.ts +6 -0
  66. package/lib/components/CarouselTariffsCard/CarouselTariffsCardAction.js +2 -0
  67. package/lib/components/CarouselTariffsCard/CarouselTariffsCardAction.js.map +1 -0
  68. package/lib/components/ExchangeRateTile/ExchangeRateTile.js +2 -2
  69. package/lib/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
  70. package/lib/components/Header/HeaderSecondaryMenu.js +2 -2
  71. package/lib/components/Header/HeaderSecondaryMenu.js.map +1 -1
  72. package/lib/components/OfficesAtmsMap/AtmsMap.js +2 -2
  73. package/lib/components/OfficesAtmsMap/AtmsMap.js.map +1 -1
  74. package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +1 -1
  75. package/lib/components/OfficesAtmsMap/OfficesMap.js +2 -2
  76. package/lib/components/OfficesAtmsMap/OfficesMap.js.map +1 -1
  77. package/lib/components/StickyBottomMenu/BurgerMenuDialog.js +2 -2
  78. package/lib/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
  79. package/lib/hooks/useLocation.d.ts +1 -2
  80. package/lib/hooks/useLocation.js +33 -26
  81. package/lib/hooks/useLocation.js.map +1 -1
  82. package/lib/hooks/useRegions.js +1 -3
  83. package/lib/hooks/useRegions.js.map +1 -1
  84. package/lib/ui-kit/DialogManager/useDialogManager.js +3 -3
  85. package/lib/ui-kit/DialogManager/useDialogManager.js.map +1 -1
  86. package/lib/ui-kit/DialogManager/useDialogsList.js +1 -1
  87. package/lib/ui-kit/DialogManager/useDialogsList.js.map +1 -1
  88. package/lib/ui-kit/Foldable/Foldable.d.ts +1 -11
  89. package/lib/ui-kit/Foldable/Foldable.js +2 -10
  90. package/lib/ui-kit/Foldable/Foldable.js.map +1 -1
  91. package/lib/ui-kit/FormField/constants.js +0 -1
  92. package/lib/ui-kit/FormField/constants.js.map +1 -1
  93. package/lib/ui-kit/FormField/getValidation.js +0 -1
  94. package/lib/ui-kit/FormField/getValidation.js.map +1 -1
  95. package/lib/ui-kit/LocationDialog/LocationDialog.js +13 -10
  96. package/lib/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
  97. package/lib/ui-kit/PopupManager/PopupManager.js +1 -1
  98. package/lib/ui-kit/PopupManager/PopupManager.js.map +1 -1
  99. package/lib/ui-kit/PopupManager/usePopupManager.js +3 -3
  100. package/lib/ui-kit/PopupManager/usePopupManager.js.map +1 -1
  101. package/mobile/bundle/EventBus/EventBus.d.ts +4 -17
  102. package/mobile/bundle/EventBus/defaultEventBus.d.ts +13 -2
  103. package/mobile/bundle/EventBus/useLatestEvent.d.ts +2 -0
  104. package/mobile/bundle/bundle.umd.js +89 -131
  105. package/mobile/bundle/bundle.umd.min.js +1 -1
  106. package/mobile/bundle/components/CarouselTariffsCard/CarouselTariffsCardAction.d.ts +6 -0
  107. package/mobile/bundle/hooks/useLocation.d.ts +1 -2
  108. package/mobile/bundle/ui-kit/Foldable/Foldable.d.ts +1 -11
  109. package/mobile/dist/EventBus/EventBus.d.ts +4 -17
  110. package/mobile/dist/EventBus/EventBus.js +10 -29
  111. package/mobile/dist/EventBus/EventBus.js.map +1 -1
  112. package/mobile/dist/EventBus/defaultEventBus.d.ts +13 -2
  113. package/mobile/dist/EventBus/defaultEventBus.js.map +1 -1
  114. package/mobile/dist/EventBus/useLatestEvent.d.ts +2 -0
  115. package/mobile/dist/EventBus/useLatestEvent.js +11 -0
  116. package/mobile/dist/EventBus/useLatestEvent.js.map +1 -0
  117. package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCard.js +25 -11
  118. package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
  119. package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCardAction.d.ts +6 -0
  120. package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCardAction.js +2 -0
  121. package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCardAction.js.map +1 -0
  122. package/mobile/dist/components/ExchangeRateTile/ExchangeRateTile.js +1 -1
  123. package/mobile/dist/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
  124. package/mobile/dist/components/Header/HeaderSecondaryMenu.js +1 -1
  125. package/mobile/dist/components/Header/HeaderSecondaryMenu.js.map +1 -1
  126. package/mobile/dist/components/OfficesAtmsMap/AtmsMap.js +1 -1
  127. package/mobile/dist/components/OfficesAtmsMap/AtmsMap.js.map +1 -1
  128. package/mobile/dist/components/OfficesAtmsMap/OfficesMap.js +1 -1
  129. package/mobile/dist/components/OfficesAtmsMap/OfficesMap.js.map +1 -1
  130. package/mobile/dist/components/StickyBottomMenu/BurgerMenuDialog.js +1 -1
  131. package/mobile/dist/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
  132. package/mobile/dist/hooks/useLocation.d.ts +1 -2
  133. package/mobile/dist/hooks/useLocation.js +33 -27
  134. package/mobile/dist/hooks/useLocation.js.map +1 -1
  135. package/mobile/dist/hooks/useRegions.js +1 -3
  136. package/mobile/dist/hooks/useRegions.js.map +1 -1
  137. package/mobile/dist/ui-kit/DialogManager/useDialogManager.js +3 -3
  138. package/mobile/dist/ui-kit/DialogManager/useDialogManager.js.map +1 -1
  139. package/mobile/dist/ui-kit/DialogManager/useDialogsList.js +1 -1
  140. package/mobile/dist/ui-kit/DialogManager/useDialogsList.js.map +1 -1
  141. package/mobile/dist/ui-kit/Foldable/Foldable.d.ts +1 -11
  142. package/mobile/dist/ui-kit/Foldable/Foldable.js +2 -10
  143. package/mobile/dist/ui-kit/Foldable/Foldable.js.map +1 -1
  144. package/mobile/dist/ui-kit/FormField/constants.js +0 -1
  145. package/mobile/dist/ui-kit/FormField/constants.js.map +1 -1
  146. package/mobile/dist/ui-kit/FormField/getValidation.js +0 -1
  147. package/mobile/dist/ui-kit/FormField/getValidation.js.map +1 -1
  148. package/mobile/dist/ui-kit/LocationDialog/LocationDialog.js +12 -9
  149. package/mobile/dist/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
  150. package/mobile/dist/ui-kit/PopupManager/PopupManager.js +1 -1
  151. package/mobile/dist/ui-kit/PopupManager/PopupManager.js.map +1 -1
  152. package/mobile/dist/ui-kit/PopupManager/usePopupManager.js +3 -3
  153. package/mobile/dist/ui-kit/PopupManager/usePopupManager.js.map +1 -1
  154. package/mobile/lib/EventBus/EventBus.d.ts +4 -17
  155. package/mobile/lib/EventBus/EventBus.js +10 -29
  156. package/mobile/lib/EventBus/EventBus.js.map +1 -1
  157. package/mobile/lib/EventBus/defaultEventBus.d.ts +13 -2
  158. package/mobile/lib/EventBus/defaultEventBus.js.map +1 -1
  159. package/mobile/lib/EventBus/useLatestEvent.d.ts +2 -0
  160. package/mobile/lib/EventBus/useLatestEvent.js +8 -0
  161. package/mobile/lib/EventBus/useLatestEvent.js.map +1 -0
  162. package/mobile/lib/common.css +1 -1
  163. package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCard.js +26 -12
  164. package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
  165. package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCardAction.d.ts +6 -0
  166. package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCardAction.js +2 -0
  167. package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCardAction.js.map +1 -0
  168. package/mobile/lib/components/ExchangeRateTile/ExchangeRateTile.js +2 -2
  169. package/mobile/lib/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
  170. package/mobile/lib/components/Header/HeaderSecondaryMenu.js +2 -2
  171. package/mobile/lib/components/Header/HeaderSecondaryMenu.js.map +1 -1
  172. package/mobile/lib/components/OfficesAtmsMap/AtmsMap.js +2 -2
  173. package/mobile/lib/components/OfficesAtmsMap/AtmsMap.js.map +1 -1
  174. package/mobile/lib/components/OfficesAtmsMap/OfficesMap.js +2 -2
  175. package/mobile/lib/components/OfficesAtmsMap/OfficesMap.js.map +1 -1
  176. package/mobile/lib/components/StickyBottomMenu/BurgerMenuDialog.js +2 -2
  177. package/mobile/lib/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
  178. package/mobile/lib/hooks/useLocation.d.ts +1 -2
  179. package/mobile/lib/hooks/useLocation.js +33 -26
  180. package/mobile/lib/hooks/useLocation.js.map +1 -1
  181. package/mobile/lib/hooks/useRegions.js +1 -3
  182. package/mobile/lib/hooks/useRegions.js.map +1 -1
  183. package/mobile/lib/ui-kit/DialogManager/useDialogManager.js +3 -3
  184. package/mobile/lib/ui-kit/DialogManager/useDialogManager.js.map +1 -1
  185. package/mobile/lib/ui-kit/DialogManager/useDialogsList.js +1 -1
  186. package/mobile/lib/ui-kit/DialogManager/useDialogsList.js.map +1 -1
  187. package/mobile/lib/ui-kit/Foldable/Foldable.d.ts +1 -11
  188. package/mobile/lib/ui-kit/Foldable/Foldable.js +2 -10
  189. package/mobile/lib/ui-kit/Foldable/Foldable.js.map +1 -1
  190. package/mobile/lib/ui-kit/FormField/constants.js +0 -1
  191. package/mobile/lib/ui-kit/FormField/constants.js.map +1 -1
  192. package/mobile/lib/ui-kit/FormField/getValidation.js +0 -1
  193. package/mobile/lib/ui-kit/FormField/getValidation.js.map +1 -1
  194. package/mobile/lib/ui-kit/LocationDialog/LocationDialog.js +13 -10
  195. package/mobile/lib/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
  196. package/mobile/lib/ui-kit/PopupManager/PopupManager.js +1 -1
  197. package/mobile/lib/ui-kit/PopupManager/PopupManager.js.map +1 -1
  198. package/mobile/lib/ui-kit/PopupManager/usePopupManager.js +3 -3
  199. package/mobile/lib/ui-kit/PopupManager/usePopupManager.js.map +1 -1
  200. package/mobile/src/EventBus/EventBus.ts +15 -51
  201. package/mobile/src/EventBus/defaultEventBus.ts +14 -2
  202. package/mobile/src/EventBus/useLatestEvent.ts +16 -0
  203. package/mobile/src/components/CarouselTariffsCard/CarouselTariffsCard.tsx +66 -23
  204. package/mobile/src/components/CarouselTariffsCard/CarouselTariffsCardAction.ts +6 -0
  205. package/mobile/src/components/ExchangeRateTile/ExchangeRateTile.tsx +2 -2
  206. package/mobile/src/components/Header/HeaderSecondaryMenu.tsx +2 -2
  207. package/mobile/src/components/OfficesAtmsMap/AtmsMap.tsx +3 -2
  208. package/mobile/src/components/OfficesAtmsMap/OfficesMap.tsx +2 -2
  209. package/mobile/src/components/StickyBottomMenu/BurgerMenuDialog.tsx +2 -2
  210. package/mobile/src/hooks/useLocation.ts +44 -30
  211. package/mobile/src/hooks/useRegions.ts +1 -4
  212. package/mobile/src/ui-kit/DialogManager/useDialogManager.ts +3 -3
  213. package/mobile/src/ui-kit/DialogManager/useDialogsList.ts +1 -1
  214. package/mobile/src/ui-kit/Foldable/Foldable.tsx +5 -21
  215. package/mobile/src/ui-kit/FormField/constants.tsx +0 -1
  216. package/mobile/src/ui-kit/FormField/getValidation.tsx +0 -1
  217. package/mobile/src/ui-kit/LocationDialog/LocationDialog.tsx +25 -13
  218. package/mobile/src/ui-kit/PopupManager/PopupManager.tsx +1 -1
  219. package/mobile/src/ui-kit/PopupManager/usePopupManager.tsx +3 -3
  220. package/package.json +1 -1
  221. package/src/EventBus/EventBus.ts +15 -51
  222. package/src/EventBus/defaultEventBus.ts +14 -2
  223. package/src/EventBus/useLatestEvent.ts +16 -0
  224. package/src/components/CarouselTariffsCard/CarouselTariffsCard.tsx +66 -23
  225. package/src/components/CarouselTariffsCard/CarouselTariffsCardAction.ts +6 -0
  226. package/src/components/ExchangeRateTile/ExchangeRateTile.tsx +2 -2
  227. package/src/components/Header/HeaderSecondaryMenu.tsx +2 -2
  228. package/src/components/OfficesAtmsMap/AtmsMap.tsx +3 -2
  229. package/src/components/OfficesAtmsMap/OfficesMap.tsx +2 -2
  230. package/src/components/StickyBottomMenu/BurgerMenuDialog.tsx +2 -2
  231. package/src/hooks/useLocation.ts +44 -30
  232. package/src/hooks/useRegions.ts +1 -4
  233. package/src/ui-kit/DialogManager/useDialogManager.ts +3 -3
  234. package/src/ui-kit/DialogManager/useDialogsList.ts +1 -1
  235. package/src/ui-kit/Foldable/Foldable.tsx +5 -21
  236. package/src/ui-kit/FormField/constants.tsx +0 -1
  237. package/src/ui-kit/FormField/getValidation.tsx +0 -1
  238. package/src/ui-kit/LocationDialog/LocationDialog.tsx +25 -13
  239. package/src/ui-kit/PopupManager/PopupManager.tsx +1 -1
  240. package/src/ui-kit/PopupManager/usePopupManager.tsx +3 -3
  241. package/bundle/EventBus/useSubject.d.ts +0 -2
  242. package/bundle/EventBus/useSubjectState.d.ts +0 -2
  243. package/bundle/components/CarouselTariffsCard/CardCellsSection.d.ts +0 -9
  244. package/bundle/components/CarouselTariffsCard/carouselTariffsCardEventBus.d.ts +0 -9
  245. package/bundle/hooks/useReducer.d.ts +0 -4
  246. package/bundle/ui-kit/LocationDialog/SelectedLocation.d.ts +0 -5
  247. package/dist/EventBus/useSubject.d.ts +0 -2
  248. package/dist/EventBus/useSubject.js +0 -17
  249. package/dist/EventBus/useSubject.js.map +0 -1
  250. package/dist/EventBus/useSubjectState.d.ts +0 -2
  251. package/dist/EventBus/useSubjectState.js +0 -10
  252. package/dist/EventBus/useSubjectState.js.map +0 -1
  253. package/dist/components/CarouselTariffsCard/CardCellsSection.d.ts +0 -9
  254. package/dist/components/CarouselTariffsCard/CardCellsSection.js +0 -18
  255. package/dist/components/CarouselTariffsCard/CardCellsSection.js.map +0 -1
  256. package/dist/components/CarouselTariffsCard/carouselTariffsCardEventBus.d.ts +0 -9
  257. package/dist/components/CarouselTariffsCard/carouselTariffsCardEventBus.js +0 -5
  258. package/dist/components/CarouselTariffsCard/carouselTariffsCardEventBus.js.map +0 -1
  259. package/dist/hooks/useReducer.d.ts +0 -4
  260. package/dist/hooks/useReducer.js +0 -12
  261. package/dist/hooks/useReducer.js.map +0 -1
  262. package/dist/ui-kit/LocationDialog/SelectedLocation.d.ts +0 -5
  263. package/dist/ui-kit/LocationDialog/SelectedLocation.js +0 -15
  264. package/dist/ui-kit/LocationDialog/SelectedLocation.js.map +0 -1
  265. package/lib/EventBus/useSubject.d.ts +0 -2
  266. package/lib/EventBus/useSubject.js +0 -14
  267. package/lib/EventBus/useSubject.js.map +0 -1
  268. package/lib/EventBus/useSubjectState.d.ts +0 -2
  269. package/lib/EventBus/useSubjectState.js +0 -7
  270. package/lib/EventBus/useSubjectState.js.map +0 -1
  271. package/lib/components/CarouselTariffsCard/CardCellsSection.d.ts +0 -9
  272. package/lib/components/CarouselTariffsCard/CardCellsSection.js +0 -16
  273. package/lib/components/CarouselTariffsCard/CardCellsSection.js.map +0 -1
  274. package/lib/components/CarouselTariffsCard/carouselTariffsCardEventBus.d.ts +0 -9
  275. package/lib/components/CarouselTariffsCard/carouselTariffsCardEventBus.js +0 -3
  276. package/lib/components/CarouselTariffsCard/carouselTariffsCardEventBus.js.map +0 -1
  277. package/lib/hooks/useReducer.d.ts +0 -4
  278. package/lib/hooks/useReducer.js +0 -9
  279. package/lib/hooks/useReducer.js.map +0 -1
  280. package/lib/ui-kit/LocationDialog/SelectedLocation.d.ts +0 -5
  281. package/lib/ui-kit/LocationDialog/SelectedLocation.js +0 -13
  282. package/lib/ui-kit/LocationDialog/SelectedLocation.js.map +0 -1
  283. package/mobile/bundle/EventBus/useSubject.d.ts +0 -2
  284. package/mobile/bundle/EventBus/useSubjectState.d.ts +0 -2
  285. package/mobile/bundle/components/CarouselTariffsCard/CardCellsSection.d.ts +0 -9
  286. package/mobile/bundle/components/CarouselTariffsCard/carouselTariffsCardEventBus.d.ts +0 -9
  287. package/mobile/bundle/hooks/useReducer.d.ts +0 -4
  288. package/mobile/bundle/ui-kit/LocationDialog/SelectedLocation.d.ts +0 -5
  289. package/mobile/dist/EventBus/useSubject.d.ts +0 -2
  290. package/mobile/dist/EventBus/useSubject.js +0 -17
  291. package/mobile/dist/EventBus/useSubject.js.map +0 -1
  292. package/mobile/dist/EventBus/useSubjectState.d.ts +0 -2
  293. package/mobile/dist/EventBus/useSubjectState.js +0 -10
  294. package/mobile/dist/EventBus/useSubjectState.js.map +0 -1
  295. package/mobile/dist/components/CarouselTariffsCard/CardCellsSection.d.ts +0 -9
  296. package/mobile/dist/components/CarouselTariffsCard/CardCellsSection.js +0 -18
  297. package/mobile/dist/components/CarouselTariffsCard/CardCellsSection.js.map +0 -1
  298. package/mobile/dist/components/CarouselTariffsCard/carouselTariffsCardEventBus.d.ts +0 -9
  299. package/mobile/dist/components/CarouselTariffsCard/carouselTariffsCardEventBus.js +0 -5
  300. package/mobile/dist/components/CarouselTariffsCard/carouselTariffsCardEventBus.js.map +0 -1
  301. package/mobile/dist/hooks/useReducer.d.ts +0 -4
  302. package/mobile/dist/hooks/useReducer.js +0 -12
  303. package/mobile/dist/hooks/useReducer.js.map +0 -1
  304. package/mobile/dist/ui-kit/LocationDialog/SelectedLocation.d.ts +0 -5
  305. package/mobile/dist/ui-kit/LocationDialog/SelectedLocation.js +0 -15
  306. package/mobile/dist/ui-kit/LocationDialog/SelectedLocation.js.map +0 -1
  307. package/mobile/lib/EventBus/useSubject.d.ts +0 -2
  308. package/mobile/lib/EventBus/useSubject.js +0 -14
  309. package/mobile/lib/EventBus/useSubject.js.map +0 -1
  310. package/mobile/lib/EventBus/useSubjectState.d.ts +0 -2
  311. package/mobile/lib/EventBus/useSubjectState.js +0 -7
  312. package/mobile/lib/EventBus/useSubjectState.js.map +0 -1
  313. package/mobile/lib/components/CarouselTariffsCard/CardCellsSection.d.ts +0 -9
  314. package/mobile/lib/components/CarouselTariffsCard/CardCellsSection.js +0 -16
  315. package/mobile/lib/components/CarouselTariffsCard/CardCellsSection.js.map +0 -1
  316. package/mobile/lib/components/CarouselTariffsCard/carouselTariffsCardEventBus.d.ts +0 -9
  317. package/mobile/lib/components/CarouselTariffsCard/carouselTariffsCardEventBus.js +0 -3
  318. package/mobile/lib/components/CarouselTariffsCard/carouselTariffsCardEventBus.js.map +0 -1
  319. package/mobile/lib/hooks/useReducer.d.ts +0 -4
  320. package/mobile/lib/hooks/useReducer.js +0 -9
  321. package/mobile/lib/hooks/useReducer.js.map +0 -1
  322. package/mobile/lib/ui-kit/LocationDialog/SelectedLocation.d.ts +0 -5
  323. package/mobile/lib/ui-kit/LocationDialog/SelectedLocation.js +0 -13
  324. package/mobile/lib/ui-kit/LocationDialog/SelectedLocation.js.map +0 -1
  325. package/mobile/src/EventBus/useSubject.ts +0 -19
  326. package/mobile/src/EventBus/useSubjectState.ts +0 -13
  327. package/mobile/src/components/CarouselTariffsCard/CardCellsSection.tsx +0 -54
  328. package/mobile/src/components/CarouselTariffsCard/carouselTariffsCardEventBus.ts +0 -11
  329. package/mobile/src/hooks/useReducer.ts +0 -21
  330. package/mobile/src/ui-kit/LocationDialog/SelectedLocation.tsx +0 -27
  331. package/src/EventBus/useSubject.ts +0 -19
  332. package/src/EventBus/useSubjectState.ts +0 -13
  333. package/src/components/CarouselTariffsCard/CardCellsSection.tsx +0 -54
  334. package/src/components/CarouselTariffsCard/carouselTariffsCardEventBus.ts +0 -11
  335. package/src/hooks/useReducer.ts +0 -21
  336. package/src/ui-kit/LocationDialog/SelectedLocation.tsx +0 -27
@@ -1 +0,0 @@
1
- {"version":3,"file":"useSubject.js","sourceRoot":"","sources":["../../src/EventBus/useSubject.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAGrE,MAAM,UAAU,UAAU,CACxB,QAA6B,EAC7B,IAAO,EACP,YAAoD;IAEpD,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,KAAK,GAAG,YAAY,YAAY,QAAQ,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC;QAC/E,IAAI,KAAK,YAAY,OAAO,EAAE;YAC5B,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;SAC5D;aAAM;YACL,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;SAC/B;IACH,CAAC,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;IAErB,OAAO,WAAW,CAAC,CAAC,CAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;AAC7E,CAAC"}
@@ -1,2 +0,0 @@
1
- import { type EventBusObservable } from './EventBus';
2
- export declare const useSubjectState: <EM extends Record<string, any>, K extends keyof EM>(eventBus: EventBusObservable<EM>, type: K, initialState: EM[K]) => EM[K];
@@ -1,7 +0,0 @@
1
- import { useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
2
- export const useSubjectState = (eventBus, type, initialState) => {
3
- const [state, setState] = useState(initialState);
4
- useEffect(() => eventBus.subscribe(type, setState), [eventBus, type]);
5
- return state;
6
- };
7
- //# sourceMappingURL=useSubjectState.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useSubjectState.js","sourceRoot":"","sources":["../../src/EventBus/useSubjectState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAGlE,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,QAAgC,EAChC,IAAO,EACP,YAAmB,EACZ,EAAE;IACT,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC;IACjD,SAAS,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;IAEtE,OAAO,KAAK,CAAC;AACf,CAAC,CAAC"}
@@ -1,9 +0,0 @@
1
- import type { AspectsProps } from '../../model/AspectsProps';
2
- import type { TariffsCardCellProps } from './CarouselTariffsCardContent';
3
- export interface CardCellsSectionProps extends AspectsProps {
4
- cardCells?: TariffsCardCellProps[];
5
- visibleCellsCount?: number;
6
- isUnfolded?: boolean;
7
- onToggle?: () => void;
8
- }
9
- export declare const CardCellsSection: import("@redneckz/uni-jsx").UNIComponent<CardCellsSectionProps, any, any>;
@@ -1,16 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
2
- import { JSX } from '@redneckz/uni-jsx';
3
- import { FoldableWrapper } from '../../ui-kit/Foldable/Foldable.js';
4
- import { FoldableSection } from '../../ui-kit/Foldable/FoldableSection.js';
5
- import { Icon } from '../../ui-kit/Icon/Icon.js';
6
- import { getAspectsAttributes } from '../../utils/dataAttributes.js';
7
- import { renderCardInfo } from './renderCardInfo.js';
8
- export const CardCellsSection = JSX((props) => {
9
- const { cardCells = [], visibleCellsCount = 1, isUnfolded } = props;
10
- const [visibleCells, hiddenCells] = visibleCellsCount > 0 && cardCells.length >= visibleCellsCount
11
- ? [cardCells.slice(0, visibleCellsCount), cardCells.slice(visibleCellsCount)]
12
- : [cardCells, []];
13
- return hiddenCells.length ? (_jsxs(FoldableWrapper, { children: [_jsxs("div", { children: [visibleCells.map(renderCardInfo), _jsx(FoldableSection, { isUnfolded: isUnfolded, children: hiddenCells.map(renderCardInfo) })] }), _jsx(FoldButton, { ...props })] })) : (_jsx("div", { children: visibleCells.map(renderCardInfo) }));
14
- });
15
- const FoldButton = JSX(({ isUnfolded, data, onToggle }) => (_jsxs("button", { type: "button", className: "w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center", ...(isUnfolded ? getAspectsAttributes(data) : {}), onClick: onToggle, children: [_jsx("div", { children: isUnfolded ? 'Скрыть' : 'Подробнее о тарифе' }), _jsx(Icon, { className: "text-primary-text", name: isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', width: "16", height: "16" })] })));
16
- //# sourceMappingURL=CardCellsSection.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CardCellsSection.js","sourceRoot":"","sources":["../../../src/components/CarouselTariffsCard/CardCellsSection.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAExC,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AASlD,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAwB,CAAC,KAAK,EAAE,EAAE;IACnE,MAAM,EAAE,SAAS,GAAG,EAAE,EAAE,iBAAiB,GAAG,CAAC,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;IAEpE,MAAM,CAAC,YAAY,EAAE,WAAW,CAAC,GAC/B,iBAAiB,GAAG,CAAC,IAAI,SAAS,CAAC,MAAM,IAAI,iBAAiB;QAC5D,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,iBAAiB,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;QAC7E,CAAC,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;IAEtB,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAC1B,MAAC,eAAe,eACd,0BACG,YAAY,CAAC,GAAG,CAAC,cAAc,CAAC,EACjC,KAAC,eAAe,IAAC,UAAU,EAAE,UAAU,YAAG,WAAW,CAAC,GAAG,CAAC,cAAc,CAAC,GAAmB,IACxF,EACN,KAAC,UAAU,OAAK,KAAK,GAAI,IACT,CACnB,CAAC,CAAC,CAAC,CACF,wBAAM,YAAY,CAAC,GAAG,CAAC,cAAc,CAAC,GAAO,CAC9C,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,UAAU,GAAG,GAAG,CAAwB,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAChF,kBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,iFAAiF,KAEvF,CAAC,UAAU,CAAC,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAClD,OAAO,EAAE,QAAQ,aAEjB,wBAAM,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,oBAAoB,GAAO,EACzD,KAAC,IAAI,IACH,SAAS,EAAC,mBAAmB,EAC7B,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,eAAe,EAClD,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,GACX,IACK,CACV,CAAC,CAAC"}
@@ -1,9 +0,0 @@
1
- import { EventBus } from '../../EventBus/EventBus';
2
- import { type Slot } from '../../model/ContentPageDef';
3
- export declare type CarouselTariffsCardFoldAction = {
4
- isUnfolded?: boolean;
5
- parent?: Slot;
6
- };
7
- export declare const carouselTariffsCardEventBus: EventBus<{
8
- fold: CarouselTariffsCardFoldAction;
9
- }>;
@@ -1,3 +0,0 @@
1
- import { EventBus } from '../../EventBus/EventBus.js';
2
- export const carouselTariffsCardEventBus = new EventBus();
3
- //# sourceMappingURL=carouselTariffsCardEventBus.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"carouselTariffsCardEventBus.js","sourceRoot":"","sources":["../../../src/components/CarouselTariffsCard/carouselTariffsCardEventBus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAQnD,MAAM,CAAC,MAAM,2BAA2B,GAAG,IAAI,QAAQ,EAEnD,CAAC"}
@@ -1,4 +0,0 @@
1
- export declare type NotUndefined = object | null;
2
- export declare type Reducer<S, A extends NotUndefined> = (state: S, action: A) => S;
3
- export declare type Dispatch<A extends NotUndefined> = (action: A) => void;
4
- export declare function useReducer<S, A extends NotUndefined>(reducer: Reducer<S, A>, initialArg: S): [state: S, dispatch: Dispatch<A>];
@@ -1,9 +0,0 @@
1
- import { useCallback, useState } from '@redneckz/uni-jsx/lib/hooks';
2
- export function useReducer(reducer, initialArg) {
3
- const [state, setState] = useState(initialArg);
4
- const dispatch = useCallback((action) => {
5
- setState((_) => reducer(_, action));
6
- }, [reducer]);
7
- return [state, dispatch];
8
- }
9
- //# sourceMappingURL=useReducer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useReducer.js","sourceRoot":"","sources":["../../src/hooks/useReducer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAMpE,MAAM,UAAU,UAAU,CACxB,OAAsB,EACtB,UAAa;IAEb,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC;IAE/C,MAAM,QAAQ,GAAG,WAAW,CAC1B,CAAC,MAAS,EAAE,EAAE;QACZ,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACtC,CAAC,EACD,CAAC,OAAO,CAAC,CACV,CAAC;IAEF,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AAC3B,CAAC"}
@@ -1,5 +0,0 @@
1
- interface SelectedLocationProps {
2
- defaultLocation?: string;
3
- }
4
- export declare const SelectedLocation: import("@redneckz/uni-jsx").UNIComponent<SelectedLocationProps, any, any>;
5
- export {};
@@ -1,13 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
2
- import { JSX } from '@redneckz/uni-jsx';
3
- import { useLink } from '../../hooks/useLink.js';
4
- import { useLocationState } from '../../hooks/useLocation.js';
5
- import { LinkWrapper } from '../LinkWrapper/LinkWrapper.js';
6
- import { Paragraph } from '../Paragraph/Paragraph.js';
7
- export const SelectedLocation = JSX(({ defaultLocation }) => {
8
- const currentLocation = useLocationState(defaultLocation);
9
- const link = useLink();
10
- const { href } = link({ href: `/branches/${currentLocation.slug}` });
11
- return currentLocation ? (_jsx("div", { className: "mb-s", children: _jsxs(Paragraph, { size: "text-l", color: "text-primary-text", children: ["\u0421\u0435\u0439\u0447\u0430\u0441 \u0432\u044B\u0431\u0440\u0430\u043D:", _jsx(LinkWrapper, { href: href, className: "inline mx-2xs text-primary-main", children: currentLocation.name })] }) })) : null;
12
- });
13
- //# sourceMappingURL=SelectedLocation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SelectedLocation.js","sourceRoot":"","sources":["../../../src/ui-kit/LocationDialog/SelectedLocation.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAMnD,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAwB,CAAC,EAAE,eAAe,EAAE,EAAE,EAAE;IACjF,MAAM,eAAe,GAAG,gBAAgB,CAAC,eAAe,CAAC,CAAC;IAE1D,MAAM,IAAI,GAAG,OAAO,EAAE,CAAC;IACvB,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,EAAE,IAAI,EAAE,aAAa,eAAe,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAErE,OAAO,eAAe,CAAC,CAAC,CAAC,CACvB,cAAK,SAAS,EAAC,MAAM,YACnB,MAAC,SAAS,IAAC,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAC,mBAAmB,2FAEhD,KAAC,WAAW,IAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAC,iCAAiC,YACjE,eAAe,CAAC,IAAI,GACT,IACJ,GACR,CACP,CAAC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC,CAAC,CAAC"}
@@ -1,19 +0,0 @@
1
- import { useCallback, useEffect } from '@redneckz/uni-jsx/lib/hooks';
2
- import type { EventBusEmitter } from './EventBus';
3
-
4
- export function useSubject<EM extends Record<string, any>, K extends keyof EM>(
5
- eventBus: EventBusEmitter<EM>,
6
- type: K,
7
- initialState: EM[K] | (() => EM[K] | Promise<EM[K]>),
8
- ): (_: EM[K]) => void {
9
- useEffect(() => {
10
- const state = initialState instanceof Function ? initialState() : initialState;
11
- if (state instanceof Promise) {
12
- state.then((_) => eventBus.subject(type, _), console.warn);
13
- } else {
14
- eventBus.subject(type, state);
15
- }
16
- }, [eventBus, type]);
17
-
18
- return useCallback((_: EM[K]) => eventBus.fire(type, _), [eventBus, type]);
19
- }
@@ -1,13 +0,0 @@
1
- import { useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
2
- import { type EventBusObservable } from './EventBus';
3
-
4
- export const useSubjectState = <EM extends Record<string, any>, K extends keyof EM>(
5
- eventBus: EventBusObservable<EM>,
6
- type: K,
7
- initialState: EM[K],
8
- ): EM[K] => {
9
- const [state, setState] = useState(initialState);
10
- useEffect(() => eventBus.subscribe(type, setState), [eventBus, type]);
11
-
12
- return state;
13
- };
@@ -1,54 +0,0 @@
1
- import { JSX } from '@redneckz/uni-jsx';
2
- import type { AspectsProps } from '../../model/AspectsProps';
3
- import { FoldableWrapper } from '../../ui-kit/Foldable/Foldable';
4
- import { FoldableSection } from '../../ui-kit/Foldable/FoldableSection';
5
- import { Icon } from '../../ui-kit/Icon/Icon';
6
- import { getAspectsAttributes } from '../../utils/dataAttributes';
7
- import type { TariffsCardCellProps } from './CarouselTariffsCardContent';
8
- import { renderCardInfo } from './renderCardInfo';
9
-
10
- export interface CardCellsSectionProps extends AspectsProps {
11
- cardCells?: TariffsCardCellProps[];
12
- visibleCellsCount?: number;
13
- isUnfolded?: boolean;
14
- onToggle?: () => void;
15
- }
16
-
17
- export const CardCellsSection = JSX<CardCellsSectionProps>((props) => {
18
- const { cardCells = [], visibleCellsCount = 1, isUnfolded } = props;
19
-
20
- const [visibleCells, hiddenCells] =
21
- visibleCellsCount > 0 && cardCells.length >= visibleCellsCount
22
- ? [cardCells.slice(0, visibleCellsCount), cardCells.slice(visibleCellsCount)]
23
- : [cardCells, []];
24
-
25
- return hiddenCells.length ? (
26
- <FoldableWrapper>
27
- <div>
28
- {visibleCells.map(renderCardInfo)}
29
- <FoldableSection isUnfolded={isUnfolded}>{hiddenCells.map(renderCardInfo)}</FoldableSection>
30
- </div>
31
- <FoldButton {...props} />
32
- </FoldableWrapper>
33
- ) : (
34
- <div>{visibleCells.map(renderCardInfo)}</div>
35
- );
36
- });
37
-
38
- const FoldButton = JSX<CardCellsSectionProps>(({ isUnfolded, data, onToggle }) => (
39
- <button
40
- type="button"
41
- className="w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center"
42
- // eslint-disable-next-line react/jsx-props-no-spreading
43
- {...(isUnfolded ? getAspectsAttributes(data) : {})}
44
- onClick={onToggle}
45
- >
46
- <div>{isUnfolded ? 'Скрыть' : 'Подробнее о тарифе'}</div>
47
- <Icon
48
- className="text-primary-text"
49
- name={isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon'}
50
- width="16"
51
- height="16"
52
- />
53
- </button>
54
- ));
@@ -1,11 +0,0 @@
1
- import { EventBus } from '../../EventBus/EventBus';
2
- import { type Slot } from '../../model/ContentPageDef';
3
-
4
- export type CarouselTariffsCardFoldAction = {
5
- isUnfolded?: boolean;
6
- parent?: Slot;
7
- };
8
-
9
- export const carouselTariffsCardEventBus = new EventBus<{
10
- fold: CarouselTariffsCardFoldAction;
11
- }>();
@@ -1,21 +0,0 @@
1
- import { useCallback, useState } from '@redneckz/uni-jsx/lib/hooks';
2
-
3
- export type NotUndefined = object | null;
4
- export type Reducer<S, A extends NotUndefined> = (state: S, action: A) => S;
5
- export type Dispatch<A extends NotUndefined> = (action: A) => void;
6
-
7
- export function useReducer<S, A extends NotUndefined>(
8
- reducer: Reducer<S, A>,
9
- initialArg: S,
10
- ): [state: S, dispatch: Dispatch<A>] {
11
- const [state, setState] = useState(initialArg);
12
-
13
- const dispatch = useCallback(
14
- (action: A) => {
15
- setState((_) => reducer(_, action));
16
- },
17
- [reducer],
18
- );
19
-
20
- return [state, dispatch];
21
- }
@@ -1,27 +0,0 @@
1
- import { JSX } from '@redneckz/uni-jsx';
2
- import { useLink } from '../../hooks/useLink';
3
- import { useLocationState } from '../../hooks/useLocation';
4
- import { LinkWrapper } from '../LinkWrapper/LinkWrapper';
5
- import { Paragraph } from '../Paragraph/Paragraph';
6
-
7
- interface SelectedLocationProps {
8
- defaultLocation?: string;
9
- }
10
-
11
- export const SelectedLocation = JSX<SelectedLocationProps>(({ defaultLocation }) => {
12
- const currentLocation = useLocationState(defaultLocation);
13
-
14
- const link = useLink();
15
- const { href } = link({ href: `/branches/${currentLocation.slug}` });
16
-
17
- return currentLocation ? (
18
- <div className="mb-s">
19
- <Paragraph size="text-l" color="text-primary-text">
20
- Сейчас выбран:
21
- <LinkWrapper href={href} className="inline mx-2xs text-primary-main">
22
- {currentLocation.name}
23
- </LinkWrapper>
24
- </Paragraph>
25
- </div>
26
- ) : null;
27
- });
@@ -1,19 +0,0 @@
1
- import { useCallback, useEffect } from '@redneckz/uni-jsx/lib/hooks';
2
- import type { EventBusEmitter } from './EventBus';
3
-
4
- export function useSubject<EM extends Record<string, any>, K extends keyof EM>(
5
- eventBus: EventBusEmitter<EM>,
6
- type: K,
7
- initialState: EM[K] | (() => EM[K] | Promise<EM[K]>),
8
- ): (_: EM[K]) => void {
9
- useEffect(() => {
10
- const state = initialState instanceof Function ? initialState() : initialState;
11
- if (state instanceof Promise) {
12
- state.then((_) => eventBus.subject(type, _), console.warn);
13
- } else {
14
- eventBus.subject(type, state);
15
- }
16
- }, [eventBus, type]);
17
-
18
- return useCallback((_: EM[K]) => eventBus.fire(type, _), [eventBus, type]);
19
- }
@@ -1,13 +0,0 @@
1
- import { useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
2
- import { type EventBusObservable } from './EventBus';
3
-
4
- export const useSubjectState = <EM extends Record<string, any>, K extends keyof EM>(
5
- eventBus: EventBusObservable<EM>,
6
- type: K,
7
- initialState: EM[K],
8
- ): EM[K] => {
9
- const [state, setState] = useState(initialState);
10
- useEffect(() => eventBus.subscribe(type, setState), [eventBus, type]);
11
-
12
- return state;
13
- };
@@ -1,54 +0,0 @@
1
- import { JSX } from '@redneckz/uni-jsx';
2
- import type { AspectsProps } from '../../model/AspectsProps';
3
- import { FoldableWrapper } from '../../ui-kit/Foldable/Foldable';
4
- import { FoldableSection } from '../../ui-kit/Foldable/FoldableSection';
5
- import { Icon } from '../../ui-kit/Icon/Icon';
6
- import { getAspectsAttributes } from '../../utils/dataAttributes';
7
- import type { TariffsCardCellProps } from './CarouselTariffsCardContent';
8
- import { renderCardInfo } from './renderCardInfo';
9
-
10
- export interface CardCellsSectionProps extends AspectsProps {
11
- cardCells?: TariffsCardCellProps[];
12
- visibleCellsCount?: number;
13
- isUnfolded?: boolean;
14
- onToggle?: () => void;
15
- }
16
-
17
- export const CardCellsSection = JSX<CardCellsSectionProps>((props) => {
18
- const { cardCells = [], visibleCellsCount = 1, isUnfolded } = props;
19
-
20
- const [visibleCells, hiddenCells] =
21
- visibleCellsCount > 0 && cardCells.length >= visibleCellsCount
22
- ? [cardCells.slice(0, visibleCellsCount), cardCells.slice(visibleCellsCount)]
23
- : [cardCells, []];
24
-
25
- return hiddenCells.length ? (
26
- <FoldableWrapper>
27
- <div>
28
- {visibleCells.map(renderCardInfo)}
29
- <FoldableSection isUnfolded={isUnfolded}>{hiddenCells.map(renderCardInfo)}</FoldableSection>
30
- </div>
31
- <FoldButton {...props} />
32
- </FoldableWrapper>
33
- ) : (
34
- <div>{visibleCells.map(renderCardInfo)}</div>
35
- );
36
- });
37
-
38
- const FoldButton = JSX<CardCellsSectionProps>(({ isUnfolded, data, onToggle }) => (
39
- <button
40
- type="button"
41
- className="w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center"
42
- // eslint-disable-next-line react/jsx-props-no-spreading
43
- {...(isUnfolded ? getAspectsAttributes(data) : {})}
44
- onClick={onToggle}
45
- >
46
- <div>{isUnfolded ? 'Скрыть' : 'Подробнее о тарифе'}</div>
47
- <Icon
48
- className="text-primary-text"
49
- name={isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon'}
50
- width="16"
51
- height="16"
52
- />
53
- </button>
54
- ));
@@ -1,11 +0,0 @@
1
- import { EventBus } from '../../EventBus/EventBus';
2
- import { type Slot } from '../../model/ContentPageDef';
3
-
4
- export type CarouselTariffsCardFoldAction = {
5
- isUnfolded?: boolean;
6
- parent?: Slot;
7
- };
8
-
9
- export const carouselTariffsCardEventBus = new EventBus<{
10
- fold: CarouselTariffsCardFoldAction;
11
- }>();
@@ -1,21 +0,0 @@
1
- import { useCallback, useState } from '@redneckz/uni-jsx/lib/hooks';
2
-
3
- export type NotUndefined = object | null;
4
- export type Reducer<S, A extends NotUndefined> = (state: S, action: A) => S;
5
- export type Dispatch<A extends NotUndefined> = (action: A) => void;
6
-
7
- export function useReducer<S, A extends NotUndefined>(
8
- reducer: Reducer<S, A>,
9
- initialArg: S,
10
- ): [state: S, dispatch: Dispatch<A>] {
11
- const [state, setState] = useState(initialArg);
12
-
13
- const dispatch = useCallback(
14
- (action: A) => {
15
- setState((_) => reducer(_, action));
16
- },
17
- [reducer],
18
- );
19
-
20
- return [state, dispatch];
21
- }
@@ -1,27 +0,0 @@
1
- import { JSX } from '@redneckz/uni-jsx';
2
- import { useLink } from '../../hooks/useLink';
3
- import { useLocationState } from '../../hooks/useLocation';
4
- import { LinkWrapper } from '../LinkWrapper/LinkWrapper';
5
- import { Paragraph } from '../Paragraph/Paragraph';
6
-
7
- interface SelectedLocationProps {
8
- defaultLocation?: string;
9
- }
10
-
11
- export const SelectedLocation = JSX<SelectedLocationProps>(({ defaultLocation }) => {
12
- const currentLocation = useLocationState(defaultLocation);
13
-
14
- const link = useLink();
15
- const { href } = link({ href: `/branches/${currentLocation.slug}` });
16
-
17
- return currentLocation ? (
18
- <div className="mb-s">
19
- <Paragraph size="text-l" color="text-primary-text">
20
- Сейчас выбран:
21
- <LinkWrapper href={href} className="inline mx-2xs text-primary-main">
22
- {currentLocation.name}
23
- </LinkWrapper>
24
- </Paragraph>
25
- </div>
26
- ) : null;
27
- });