@salutejs/plasma-new-hope 0.76.2-canary.1184.8705168480.0 → 0.76.3-canary.1178.8720542914.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (411) hide show
  1. package/cjs/_virtual/_rollupPluginBabelHelpers.js +1 -1
  2. package/cjs/components/Calendar/CalendarBase/CalendarBase.js +1 -1
  3. package/cjs/components/Calendar/CalendarBase/CalendarBase.js.map +1 -1
  4. package/cjs/components/Calendar/CalendarDouble/CalendarDouble.js +1 -1
  5. package/cjs/components/Calendar/CalendarDouble/CalendarDouble.js.map +1 -1
  6. package/cjs/components/Calendar/hoc/withRange.js +1 -1
  7. package/cjs/components/Calendar/hoc/withRange.js.map +1 -1
  8. package/cjs/components/Calendar/hooks/useKeyNavigation.js +19 -19
  9. package/cjs/components/Calendar/hooks/useKeyNavigation.js.map +1 -1
  10. package/cjs/components/Calendar/ui/CalendarDays/CalendarDays.js +3 -3
  11. package/cjs/components/Calendar/ui/CalendarDays/CalendarDays.js.map +1 -1
  12. package/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.js +2 -2
  13. package/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.js.map +1 -1
  14. package/cjs/components/Calendar/ui/CalendarMonths/CalendarMonths.js +1 -1
  15. package/cjs/components/Calendar/ui/CalendarMonths/CalendarMonths.js.map +1 -1
  16. package/cjs/components/Calendar/ui/CalendarYears/CalendarYears.js +1 -1
  17. package/cjs/components/Calendar/ui/CalendarYears/CalendarYears.js.map +1 -1
  18. package/cjs/components/Chip/Chip.css +2 -0
  19. package/cjs/components/Chip/Chip.js +16 -4
  20. package/cjs/components/Chip/Chip.js.map +1 -1
  21. package/cjs/components/Chip/Chip.tokens.js +5 -0
  22. package/cjs/components/Chip/Chip.tokens.js.map +1 -1
  23. package/cjs/components/Chip/variations/_pilled/base.js +9 -0
  24. package/cjs/components/Chip/variations/_pilled/base.js.map +1 -0
  25. package/cjs/components/Chip/variations/_pilled/base_3kce4h.css +1 -0
  26. package/cjs/components/Combobox/Combobox.css +2 -0
  27. package/cjs/components/Combobox/Combobox.js +5 -5
  28. package/cjs/components/Combobox/Combobox.js.map +1 -1
  29. package/cjs/components/Combobox/hooks/useFocusController.js +9 -9
  30. package/cjs/components/Combobox/hooks/useFocusController.js.map +1 -1
  31. package/cjs/components/Combobox/ui/ComboboxChip/ComboboxChip.css +2 -0
  32. package/cjs/components/Combobox/ui/ComboboxChip/ComboboxChip.js +1 -1
  33. package/cjs/components/Combobox/ui/ComboboxChip/ComboboxChip.js.map +1 -1
  34. package/cjs/components/Combobox/ui/ComboboxTarget/ComboboxTarget.css +2 -0
  35. package/cjs/components/Combobox/ui/ComboboxTarget/ComboboxTarget.js +6 -6
  36. package/cjs/components/Combobox/ui/ComboboxTarget/ComboboxTarget.js.map +1 -1
  37. package/cjs/components/Drawer/DrawerContext.js +1 -1
  38. package/cjs/components/Drawer/DrawerContext.js.map +1 -1
  39. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +2 -2
  40. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
  41. package/cjs/components/Modal/ModalContext.js +1 -1
  42. package/cjs/components/Modal/ModalContext.js.map +1 -1
  43. package/cjs/components/Overlay/Overlay.js +1 -1
  44. package/cjs/components/Overlay/Overlay.js.map +1 -1
  45. package/cjs/components/Pagination/Pagination.css +2 -0
  46. package/cjs/components/Pagination/Pagination.js +2 -2
  47. package/cjs/components/Pagination/Pagination.js.map +1 -1
  48. package/cjs/components/Pagination/ui/PaginationQuickJumpToPage/PaginationQuickJumpToPage.js +1 -1
  49. package/cjs/components/Pagination/ui/PaginationQuickJumpToPage/PaginationQuickJumpToPage.js.map +1 -1
  50. package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +2 -0
  51. package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js +1 -1
  52. package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js.map +1 -1
  53. package/cjs/components/Popover/Popover.js +7 -7
  54. package/cjs/components/Popover/Popover.js.map +1 -1
  55. package/cjs/components/Popup/Popup.js +1 -1
  56. package/cjs/components/Popup/Popup.js.map +1 -1
  57. package/cjs/components/Segment/ui/SegmentItem/SegmentItem.js +2 -2
  58. package/cjs/components/Segment/ui/SegmentItem/SegmentItem.js.map +1 -1
  59. package/cjs/components/Select/Select.css +2 -0
  60. package/cjs/components/Select/Select.js +5 -5
  61. package/cjs/components/Select/Select.js.map +1 -1
  62. package/cjs/components/Select/hooks/useKeyNavigation.js +12 -12
  63. package/cjs/components/Select/hooks/useKeyNavigation.js.map +1 -1
  64. package/cjs/components/Select/ui/SelectChip/SelectChip.css +2 -0
  65. package/cjs/components/Select/ui/SelectChip/SelectChip.js +1 -1
  66. package/cjs/components/Select/ui/SelectChip/SelectChip.js.map +1 -1
  67. package/cjs/components/Select/ui/SelectTarget/SelectTarget.css +2 -0
  68. package/cjs/components/Select/ui/SelectTarget/SelectTarget.js +2 -2
  69. package/cjs/components/Select/ui/SelectTarget/SelectTarget.js.map +1 -1
  70. package/cjs/components/Select/utils/index.js +2 -2
  71. package/cjs/components/Select/utils/index.js.map +1 -1
  72. package/cjs/components/Tabs/TabsContext.js +2 -1
  73. package/cjs/components/Tabs/TabsContext.js.map +1 -1
  74. package/cjs/components/Tabs/ui/TabItem/TabItem.js +1 -1
  75. package/cjs/components/Tabs/ui/TabItem/TabItem.js.map +1 -1
  76. package/cjs/components/Tabs/ui/Tabs/Tabs.js +2 -2
  77. package/cjs/components/Tabs/ui/Tabs/Tabs.js.map +1 -1
  78. package/cjs/components/TextArea/TextArea.js +1 -1
  79. package/cjs/components/TextArea/TextArea.js.map +1 -1
  80. package/cjs/components/TextField/TextField.js +2 -2
  81. package/cjs/components/TextField/TextField.js.map +1 -1
  82. package/cjs/components/TextField/hooks/useKeyNavigation.js +9 -9
  83. package/cjs/components/TextField/hooks/useKeyNavigation.js.map +1 -1
  84. package/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.css +2 -0
  85. package/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.js +1 -1
  86. package/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.js.map +1 -1
  87. package/cjs/components/Toast/ToastProvider/ToastProvider.js +2 -2
  88. package/cjs/components/Toast/ToastProvider/ToastProvider.js.map +1 -1
  89. package/cjs/components/Tooltip/Tooltip.js +1 -1
  90. package/cjs/components/Tooltip/Tooltip.js.map +1 -1
  91. package/cjs/index.css +2 -0
  92. package/es/_virtual/_rollupPluginBabelHelpers.js +1 -1
  93. package/es/components/Calendar/CalendarBase/CalendarBase.js +1 -1
  94. package/es/components/Calendar/CalendarBase/CalendarBase.js.map +1 -1
  95. package/es/components/Calendar/CalendarDouble/CalendarDouble.js +1 -1
  96. package/es/components/Calendar/CalendarDouble/CalendarDouble.js.map +1 -1
  97. package/es/components/Calendar/hoc/withRange.js +1 -1
  98. package/es/components/Calendar/hoc/withRange.js.map +1 -1
  99. package/es/components/Calendar/hooks/useKeyNavigation.js +19 -19
  100. package/es/components/Calendar/hooks/useKeyNavigation.js.map +1 -1
  101. package/es/components/Calendar/ui/CalendarDays/CalendarDays.js +3 -3
  102. package/es/components/Calendar/ui/CalendarDays/CalendarDays.js.map +1 -1
  103. package/es/components/Calendar/ui/CalendarHeader/CalendarHeader.js +2 -2
  104. package/es/components/Calendar/ui/CalendarHeader/CalendarHeader.js.map +1 -1
  105. package/es/components/Calendar/ui/CalendarMonths/CalendarMonths.js +1 -1
  106. package/es/components/Calendar/ui/CalendarMonths/CalendarMonths.js.map +1 -1
  107. package/es/components/Calendar/ui/CalendarYears/CalendarYears.js +1 -1
  108. package/es/components/Calendar/ui/CalendarYears/CalendarYears.js.map +1 -1
  109. package/es/components/Chip/Chip.css +2 -0
  110. package/es/components/Chip/Chip.js +17 -5
  111. package/es/components/Chip/Chip.js.map +1 -1
  112. package/es/components/Chip/Chip.tokens.js +5 -1
  113. package/es/components/Chip/Chip.tokens.js.map +1 -1
  114. package/es/components/Chip/variations/_pilled/base.js +5 -0
  115. package/es/components/Chip/variations/_pilled/base.js.map +1 -0
  116. package/es/components/Chip/variations/_pilled/base_3kce4h.css +1 -0
  117. package/es/components/Combobox/Combobox.css +2 -0
  118. package/es/components/Combobox/Combobox.js +5 -5
  119. package/es/components/Combobox/Combobox.js.map +1 -1
  120. package/es/components/Combobox/hooks/useFocusController.js +9 -9
  121. package/es/components/Combobox/hooks/useFocusController.js.map +1 -1
  122. package/es/components/Combobox/ui/ComboboxChip/ComboboxChip.css +2 -0
  123. package/es/components/Combobox/ui/ComboboxChip/ComboboxChip.js +1 -1
  124. package/es/components/Combobox/ui/ComboboxChip/ComboboxChip.js.map +1 -1
  125. package/es/components/Combobox/ui/ComboboxTarget/ComboboxTarget.css +2 -0
  126. package/es/components/Combobox/ui/ComboboxTarget/ComboboxTarget.js +6 -6
  127. package/es/components/Combobox/ui/ComboboxTarget/ComboboxTarget.js.map +1 -1
  128. package/es/components/Drawer/DrawerContext.js +1 -1
  129. package/es/components/Drawer/DrawerContext.js.map +1 -1
  130. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +2 -2
  131. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
  132. package/es/components/Modal/ModalContext.js +1 -1
  133. package/es/components/Modal/ModalContext.js.map +1 -1
  134. package/es/components/Overlay/Overlay.js +1 -1
  135. package/es/components/Overlay/Overlay.js.map +1 -1
  136. package/es/components/Pagination/Pagination.css +2 -0
  137. package/es/components/Pagination/Pagination.js +2 -2
  138. package/es/components/Pagination/Pagination.js.map +1 -1
  139. package/es/components/Pagination/ui/PaginationQuickJumpToPage/PaginationQuickJumpToPage.js +1 -1
  140. package/es/components/Pagination/ui/PaginationQuickJumpToPage/PaginationQuickJumpToPage.js.map +1 -1
  141. package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +2 -0
  142. package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js +1 -1
  143. package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js.map +1 -1
  144. package/es/components/Popover/Popover.js +7 -7
  145. package/es/components/Popover/Popover.js.map +1 -1
  146. package/es/components/Popup/Popup.js +1 -1
  147. package/es/components/Popup/Popup.js.map +1 -1
  148. package/es/components/Segment/ui/SegmentItem/SegmentItem.js +2 -2
  149. package/es/components/Segment/ui/SegmentItem/SegmentItem.js.map +1 -1
  150. package/es/components/Select/Select.css +2 -0
  151. package/es/components/Select/Select.js +5 -5
  152. package/es/components/Select/Select.js.map +1 -1
  153. package/es/components/Select/hooks/useKeyNavigation.js +12 -12
  154. package/es/components/Select/hooks/useKeyNavigation.js.map +1 -1
  155. package/es/components/Select/ui/SelectChip/SelectChip.css +2 -0
  156. package/es/components/Select/ui/SelectChip/SelectChip.js +1 -1
  157. package/es/components/Select/ui/SelectChip/SelectChip.js.map +1 -1
  158. package/es/components/Select/ui/SelectTarget/SelectTarget.css +2 -0
  159. package/es/components/Select/ui/SelectTarget/SelectTarget.js +2 -2
  160. package/es/components/Select/ui/SelectTarget/SelectTarget.js.map +1 -1
  161. package/es/components/Select/utils/index.js +2 -2
  162. package/es/components/Select/utils/index.js.map +1 -1
  163. package/es/components/Tabs/TabsContext.js +2 -1
  164. package/es/components/Tabs/TabsContext.js.map +1 -1
  165. package/es/components/Tabs/ui/TabItem/TabItem.js +1 -1
  166. package/es/components/Tabs/ui/TabItem/TabItem.js.map +1 -1
  167. package/es/components/Tabs/ui/Tabs/Tabs.js +2 -2
  168. package/es/components/Tabs/ui/Tabs/Tabs.js.map +1 -1
  169. package/es/components/TextArea/TextArea.js +1 -1
  170. package/es/components/TextArea/TextArea.js.map +1 -1
  171. package/es/components/TextField/TextField.js +2 -2
  172. package/es/components/TextField/TextField.js.map +1 -1
  173. package/es/components/TextField/hooks/useKeyNavigation.js +9 -9
  174. package/es/components/TextField/hooks/useKeyNavigation.js.map +1 -1
  175. package/es/components/TextField/ui/TextFieldChip/TextFieldChip.css +2 -0
  176. package/es/components/TextField/ui/TextFieldChip/TextFieldChip.js +1 -1
  177. package/es/components/TextField/ui/TextFieldChip/TextFieldChip.js.map +1 -1
  178. package/es/components/Toast/ToastProvider/ToastProvider.js +2 -2
  179. package/es/components/Toast/ToastProvider/ToastProvider.js.map +1 -1
  180. package/es/components/Tooltip/Tooltip.js +1 -1
  181. package/es/components/Tooltip/Tooltip.js.map +1 -1
  182. package/es/index.css +2 -0
  183. package/package.json +11 -11
  184. package/styled-components/cjs/components/Avatar/Avatar.js +1 -1
  185. package/styled-components/cjs/components/Avatar/Avatar.styles.js +1 -1
  186. package/styled-components/cjs/components/AvatarGroup/AvatarGroup.js +1 -1
  187. package/styled-components/cjs/components/Badge/Badge.js +1 -1
  188. package/styled-components/cjs/components/Badge/Badge.styles.js +1 -1
  189. package/styled-components/cjs/components/Button/Button.js +2 -2
  190. package/styled-components/cjs/components/Button/Button.styles.js +1 -1
  191. package/styled-components/cjs/components/ButtonGroup/ButtonGroup.js +1 -1
  192. package/styled-components/cjs/components/Calendar/CalendarBase/CalendarBase.js +2 -2
  193. package/styled-components/cjs/components/Calendar/CalendarBase/CalendarBase.styles.js +1 -1
  194. package/styled-components/cjs/components/Calendar/CalendarDouble/CalendarDouble.js +2 -2
  195. package/styled-components/cjs/components/Calendar/CalendarDouble/CalendarDouble.styles.js +1 -1
  196. package/styled-components/cjs/components/Calendar/hoc/withRange.js +2 -2
  197. package/styled-components/cjs/components/Calendar/hooks/useKeyNavigation.js +20 -20
  198. package/styled-components/cjs/components/Calendar/store/reducer.js +1 -1
  199. package/styled-components/cjs/components/Calendar/ui/CalendarDayItem/CalendarDayItem.js +1 -1
  200. package/styled-components/cjs/components/Calendar/ui/CalendarDays/CalendarDays.js +4 -4
  201. package/styled-components/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.js +3 -3
  202. package/styled-components/cjs/components/Calendar/ui/CalendarMonths/CalendarMonths.js +2 -2
  203. package/styled-components/cjs/components/Calendar/ui/CalendarYears/CalendarYears.js +2 -2
  204. package/styled-components/cjs/components/Cell/Cell.js +1 -1
  205. package/styled-components/cjs/components/Cell/Cell.styles.js +1 -1
  206. package/styled-components/cjs/components/Checkbox/Checkbox.js +1 -1
  207. package/styled-components/cjs/components/Chip/Chip.js +17 -5
  208. package/styled-components/cjs/components/Chip/Chip.styles.js +1 -1
  209. package/styled-components/cjs/components/Chip/Chip.template-doc.mdx +2 -2
  210. package/styled-components/cjs/components/Chip/Chip.tokens.js +5 -1
  211. package/styled-components/cjs/components/Chip/variations/_pilled/base.js +9 -0
  212. package/styled-components/cjs/components/Chip/variations/_pilled/tokens.json +4 -0
  213. package/styled-components/cjs/components/Combobox/Combobox.js +6 -6
  214. package/styled-components/cjs/components/Combobox/hooks/useFocusController.js +9 -9
  215. package/styled-components/cjs/components/Combobox/ui/ComboboxChip/ComboboxChip.js +2 -2
  216. package/styled-components/cjs/components/Combobox/ui/ComboboxTarget/ComboboxTarget.js +7 -7
  217. package/styled-components/cjs/components/Counter/Counter.js +1 -1
  218. package/styled-components/cjs/components/Divider/Divider.js +2 -2
  219. package/styled-components/cjs/components/Drawer/Drawer.js +1 -1
  220. package/styled-components/cjs/components/Drawer/DrawerContext.js +1 -1
  221. package/styled-components/cjs/components/Drawer/hooks/useDrawer.js +1 -1
  222. package/styled-components/cjs/components/Drawer/ui/DrawerContent/DrawerContent.js +1 -1
  223. package/styled-components/cjs/components/Drawer/ui/DrawerFooter/DrawerFooter.js +1 -1
  224. package/styled-components/cjs/components/Drawer/ui/DrawerHeader/DrawerHeader.js +1 -1
  225. package/styled-components/cjs/components/Dropdown/Dropdown.js +1 -1
  226. package/styled-components/cjs/components/Dropdown/ui/DropdownDivider/DropdownDivider.js +1 -1
  227. package/styled-components/cjs/components/Dropdown/ui/DropdownFooter/DropdownFooter.js +1 -1
  228. package/styled-components/cjs/components/Dropdown/ui/DropdownGroup/DropdownGroup.js +1 -1
  229. package/styled-components/cjs/components/Dropdown/ui/DropdownHeader/DropdownHeader.js +1 -1
  230. package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +4 -4
  231. package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +1 -1
  232. package/styled-components/cjs/components/Dropdown/utils/index.js +1 -1
  233. package/styled-components/cjs/components/Grid/Grid.js +2 -2
  234. package/styled-components/cjs/components/Grid/ui/Col/Col.js +2 -2
  235. package/styled-components/cjs/components/Grid/ui/Row/Row.js +1 -1
  236. package/styled-components/cjs/components/Grid/utils/index.js +1 -1
  237. package/styled-components/cjs/components/Header/HeaderRoot/HeaderRoot.js +1 -1
  238. package/styled-components/cjs/components/Header/ui/HeaderArrow/HeaderArrow.js +1 -1
  239. package/styled-components/cjs/components/Header/ui/HeaderLogo/HeaderLogo.js +1 -1
  240. package/styled-components/cjs/components/Header/ui/HeaderTitleWrapper/HeaderTitleWrapper.js +1 -1
  241. package/styled-components/cjs/components/Image/Image.js +2 -2
  242. package/styled-components/cjs/components/Image/Image.styles.js +1 -1
  243. package/styled-components/cjs/components/Indicator/Indicator.js +1 -1
  244. package/styled-components/cjs/components/Link/Link.js +1 -1
  245. package/styled-components/cjs/components/Modal/Modal.js +1 -1
  246. package/styled-components/cjs/components/Modal/ModalContext.js +1 -1
  247. package/styled-components/cjs/components/Modal/hooks/useModal.js +1 -1
  248. package/styled-components/cjs/components/Notification/Notification.js +1 -1
  249. package/styled-components/cjs/components/Notification/Notification.styles.js +1 -1
  250. package/styled-components/cjs/components/Notification/NotificationsPortal.js +1 -1
  251. package/styled-components/cjs/components/Notification/NotificationsStore.js +1 -1
  252. package/styled-components/cjs/components/Overlay/Overlay.js +2 -2
  253. package/styled-components/cjs/components/Pagination/Pagination.js +3 -3
  254. package/styled-components/cjs/components/Pagination/ui/PaginationQuickJumpToPage/PaginationQuickJumpToPage.js +2 -2
  255. package/styled-components/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js +2 -2
  256. package/styled-components/cjs/components/Panel/Panel.js +2 -2
  257. package/styled-components/cjs/components/Panel/ui/PanelContent/PanelContent.js +1 -1
  258. package/styled-components/cjs/components/Panel/ui/PanelFooter/PanelFooter.js +1 -1
  259. package/styled-components/cjs/components/Panel/ui/PanelHeader/PanelHeader.js +1 -1
  260. package/styled-components/cjs/components/Popover/Popover.js +9 -9
  261. package/styled-components/cjs/components/Popup/Popup.js +2 -2
  262. package/styled-components/cjs/components/Popup/PopupContext.js +1 -1
  263. package/styled-components/cjs/components/Popup/PopupRoot.js +1 -1
  264. package/styled-components/cjs/components/Popup/hooks/usePopup.js +1 -1
  265. package/styled-components/cjs/components/Progress/Progress.js +1 -1
  266. package/styled-components/cjs/components/Progress/Progress.styles.js +1 -1
  267. package/styled-components/cjs/components/Radiobox/Radiobox.js +1 -1
  268. package/styled-components/cjs/components/SSRProvider/SSRProvider.js +1 -1
  269. package/styled-components/cjs/components/Segment/SegmentProvider/SegmentProvider.js +1 -1
  270. package/styled-components/cjs/components/Segment/ui/SegmentGroup/SegmentGroup.js +1 -1
  271. package/styled-components/cjs/components/Segment/ui/SegmentGroup/SegmentGroup.styles.js +1 -1
  272. package/styled-components/cjs/components/Segment/ui/SegmentItem/SegmentItem.js +3 -3
  273. package/styled-components/cjs/components/Segment/ui/SegmentItem/SegmentItem.styles.js +1 -1
  274. package/styled-components/cjs/components/Select/Select.js +6 -6
  275. package/styled-components/cjs/components/Select/hooks/useKeyNavigation.js +12 -12
  276. package/styled-components/cjs/components/Select/ui/SelectChip/SelectChip.js +2 -2
  277. package/styled-components/cjs/components/Select/ui/SelectTarget/SelectTarget.js +3 -3
  278. package/styled-components/cjs/components/Select/utils/index.js +3 -3
  279. package/styled-components/cjs/components/Skeleton/LineSkeleton/LineSkeleton.js +1 -1
  280. package/styled-components/cjs/components/Skeleton/LineSkeleton/LineSkeleton.styles.js +1 -1
  281. package/styled-components/cjs/components/Skeleton/RectSkeleton/RectSkeleton.js +1 -1
  282. package/styled-components/cjs/components/Skeleton/TextSkeleton/TextSkeleton.js +2 -2
  283. package/styled-components/cjs/components/Skeleton/hoc/withSkeleton.js +1 -1
  284. package/styled-components/cjs/components/Spinner/Spinner.js +1 -1
  285. package/styled-components/cjs/components/Spinner/Spinner.styles.js +1 -1
  286. package/styled-components/cjs/components/Spinner/utils/index.js +1 -1
  287. package/styled-components/cjs/components/Switch/Switch.js +1 -1
  288. package/styled-components/cjs/components/Tabs/TabsContext.js +3 -2
  289. package/styled-components/cjs/components/Tabs/createTabsController.js +1 -1
  290. package/styled-components/cjs/components/Tabs/ui/TabItem/TabItem.js +2 -2
  291. package/styled-components/cjs/components/Tabs/ui/TabItem/TabItem.styles.js +1 -1
  292. package/styled-components/cjs/components/Tabs/ui/Tabs/Tabs.js +3 -3
  293. package/styled-components/cjs/components/Tabs/ui/Tabs/Tabs.styles.js +1 -1
  294. package/styled-components/cjs/components/TextArea/TextArea.js +2 -2
  295. package/styled-components/cjs/components/TextField/TextField.js +3 -3
  296. package/styled-components/cjs/components/TextField/hooks/useKeyNavigation.js +9 -9
  297. package/styled-components/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.js +2 -2
  298. package/styled-components/cjs/components/Toast/Toast.js +2 -2
  299. package/styled-components/cjs/components/Toast/Toast.styles.js +1 -1
  300. package/styled-components/cjs/components/Toast/ToastController.js +2 -2
  301. package/styled-components/cjs/components/Toast/ToastProvider/ToastProvider.js +3 -3
  302. package/styled-components/cjs/components/Toolbar/Toolbar.js +1 -1
  303. package/styled-components/cjs/components/Toolbar/ui/ToolbarDivider/ToolbarDivider.js +1 -1
  304. package/styled-components/cjs/components/Tooltip/Tooltip.js +2 -2
  305. package/styled-components/cjs/components/Typography/Old/Subtitle/Subtitle.js +2 -2
  306. package/styled-components/cjs/components/Typography/Old/TypographyOld.js +2 -2
  307. package/styled-components/cjs/components/Typography/Typography.js +2 -2
  308. package/styled-components/cjs/engines/common.js +1 -1
  309. package/styled-components/cjs/engines/styled-components.js +1 -1
  310. package/styled-components/cjs/examples/_helpers.js +1 -1
  311. package/styled-components/cjs/examples/plasma_b2c/components/Chip/Chip.config.js +10 -7
  312. package/styled-components/cjs/examples/plasma_b2c/components/Chip/Chip.stories.tsx +18 -2
  313. package/styled-components/cjs/examples/plasma_b2c/components/Grid/Grid.config.js +1 -1
  314. package/styled-components/cjs/examples/plasma_web/components/Chip/Chip.config.js +10 -7
  315. package/styled-components/cjs/examples/plasma_web/components/Chip/Chip.stories.tsx +18 -2
  316. package/styled-components/cjs/examples/plasma_web/components/Grid/Grid.config.js +1 -1
  317. package/styled-components/cjs/examples/sds_engineer/components/Grid/Grid.config.js +1 -1
  318. package/styled-components/cjs/mixins/applySpacing.js +1 -1
  319. package/styled-components/cjs/mixins/typography.js +1 -1
  320. package/styled-components/es/components/Button/Button.js +1 -1
  321. package/styled-components/es/components/Calendar/CalendarBase/CalendarBase.js +1 -1
  322. package/styled-components/es/components/Calendar/CalendarDouble/CalendarDouble.js +1 -1
  323. package/styled-components/es/components/Calendar/hoc/withRange.js +1 -1
  324. package/styled-components/es/components/Calendar/hooks/useKeyNavigation.js +20 -20
  325. package/styled-components/es/components/Calendar/store/reducer.js +1 -1
  326. package/styled-components/es/components/Calendar/ui/CalendarDays/CalendarDays.js +3 -3
  327. package/styled-components/es/components/Calendar/ui/CalendarHeader/CalendarHeader.js +2 -2
  328. package/styled-components/es/components/Calendar/ui/CalendarMonths/CalendarMonths.js +1 -1
  329. package/styled-components/es/components/Calendar/ui/CalendarYears/CalendarYears.js +1 -1
  330. package/styled-components/es/components/Chip/Chip.js +17 -5
  331. package/styled-components/es/components/Chip/Chip.template-doc.mdx +2 -2
  332. package/styled-components/es/components/Chip/Chip.tokens.js +4 -0
  333. package/styled-components/es/components/Chip/variations/_pilled/base.js +3 -0
  334. package/styled-components/es/components/Chip/variations/_pilled/tokens.json +4 -0
  335. package/styled-components/es/components/Combobox/Combobox.js +5 -5
  336. package/styled-components/es/components/Combobox/hooks/useFocusController.js +9 -9
  337. package/styled-components/es/components/Combobox/ui/ComboboxChip/ComboboxChip.js +1 -1
  338. package/styled-components/es/components/Combobox/ui/ComboboxTarget/ComboboxTarget.js +6 -6
  339. package/styled-components/es/components/Divider/Divider.js +1 -1
  340. package/styled-components/es/components/Drawer/DrawerContext.js +1 -1
  341. package/styled-components/es/components/Drawer/hooks/useDrawer.js +1 -1
  342. package/styled-components/es/components/Drawer/ui/DrawerContent/DrawerContent.js +1 -1
  343. package/styled-components/es/components/Drawer/ui/DrawerFooter/DrawerFooter.js +1 -1
  344. package/styled-components/es/components/Drawer/ui/DrawerHeader/DrawerHeader.js +1 -1
  345. package/styled-components/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +3 -3
  346. package/styled-components/es/components/Grid/Grid.js +1 -1
  347. package/styled-components/es/components/Grid/ui/Col/Col.js +1 -1
  348. package/styled-components/es/components/Grid/utils/index.js +1 -1
  349. package/styled-components/es/components/Image/Image.js +1 -1
  350. package/styled-components/es/components/Modal/ModalContext.js +1 -1
  351. package/styled-components/es/components/Modal/hooks/useModal.js +1 -1
  352. package/styled-components/es/components/Notification/NotificationsStore.js +1 -1
  353. package/styled-components/es/components/Overlay/Overlay.js +1 -1
  354. package/styled-components/es/components/Pagination/Pagination.js +2 -2
  355. package/styled-components/es/components/Pagination/ui/PaginationQuickJumpToPage/PaginationQuickJumpToPage.js +1 -1
  356. package/styled-components/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js +1 -1
  357. package/styled-components/es/components/Panel/Panel.js +1 -1
  358. package/styled-components/es/components/Popover/Popover.js +8 -8
  359. package/styled-components/es/components/Popup/Popup.js +1 -1
  360. package/styled-components/es/components/Popup/hooks/usePopup.js +1 -1
  361. package/styled-components/es/components/Segment/ui/SegmentItem/SegmentItem.js +2 -2
  362. package/styled-components/es/components/Select/Select.js +5 -5
  363. package/styled-components/es/components/Select/hooks/useKeyNavigation.js +12 -12
  364. package/styled-components/es/components/Select/ui/SelectChip/SelectChip.js +1 -1
  365. package/styled-components/es/components/Select/ui/SelectTarget/SelectTarget.js +2 -2
  366. package/styled-components/es/components/Select/utils/index.js +3 -3
  367. package/styled-components/es/components/Skeleton/TextSkeleton/TextSkeleton.js +1 -1
  368. package/styled-components/es/components/Skeleton/hoc/withSkeleton.js +1 -1
  369. package/styled-components/es/components/Spinner/utils/index.js +1 -1
  370. package/styled-components/es/components/Tabs/TabsContext.js +3 -2
  371. package/styled-components/es/components/Tabs/ui/TabItem/TabItem.js +1 -1
  372. package/styled-components/es/components/Tabs/ui/Tabs/Tabs.js +2 -2
  373. package/styled-components/es/components/TextArea/TextArea.js +1 -1
  374. package/styled-components/es/components/TextField/TextField.js +2 -2
  375. package/styled-components/es/components/TextField/hooks/useKeyNavigation.js +9 -9
  376. package/styled-components/es/components/TextField/ui/TextFieldChip/TextFieldChip.js +1 -1
  377. package/styled-components/es/components/Toast/Toast.js +1 -1
  378. package/styled-components/es/components/Toast/ToastController.js +1 -1
  379. package/styled-components/es/components/Toast/ToastProvider/ToastProvider.js +2 -2
  380. package/styled-components/es/components/Toolbar/ui/ToolbarDivider/ToolbarDivider.js +1 -1
  381. package/styled-components/es/components/Tooltip/Tooltip.js +1 -1
  382. package/styled-components/es/components/Typography/Old/Subtitle/Subtitle.js +1 -1
  383. package/styled-components/es/components/Typography/Old/TypographyOld.js +1 -1
  384. package/styled-components/es/components/Typography/Typography.js +1 -1
  385. package/styled-components/es/engines/common.js +1 -1
  386. package/styled-components/es/examples/_helpers.js +1 -1
  387. package/styled-components/es/examples/plasma_b2c/components/Chip/Chip.config.js +10 -7
  388. package/styled-components/es/examples/plasma_b2c/components/Chip/Chip.stories.tsx +18 -2
  389. package/styled-components/es/examples/plasma_b2c/components/Grid/Grid.config.js +1 -1
  390. package/styled-components/es/examples/plasma_web/components/Chip/Chip.config.js +10 -7
  391. package/styled-components/es/examples/plasma_web/components/Chip/Chip.stories.tsx +18 -2
  392. package/styled-components/es/examples/plasma_web/components/Grid/Grid.config.js +1 -1
  393. package/styled-components/es/examples/sds_engineer/components/Grid/Grid.config.js +1 -1
  394. package/styled-components/es/mixins/applySpacing.js +1 -1
  395. package/styled-components/es/mixins/typography.js +1 -1
  396. package/types/components/Chip/Chip.d.ts +4 -0
  397. package/types/components/Chip/Chip.d.ts.map +1 -1
  398. package/types/components/Chip/Chip.tokens.d.ts +4 -0
  399. package/types/components/Chip/Chip.tokens.d.ts.map +1 -1
  400. package/types/components/Chip/Chip.types.d.ts +6 -0
  401. package/types/components/Chip/Chip.types.d.ts.map +1 -1
  402. package/types/components/Chip/variations/_pilled/base.d.ts +2 -0
  403. package/types/components/Chip/variations/_pilled/base.d.ts.map +1 -0
  404. package/types/examples/plasma_b2c/components/Chip/Chip.config.d.ts +4 -1
  405. package/types/examples/plasma_b2c/components/Chip/Chip.config.d.ts.map +1 -1
  406. package/types/examples/plasma_b2c/components/Chip/Chip.d.ts +4 -1
  407. package/types/examples/plasma_b2c/components/Chip/Chip.d.ts.map +1 -1
  408. package/types/examples/plasma_web/components/Chip/Chip.config.d.ts +4 -1
  409. package/types/examples/plasma_web/components/Chip/Chip.config.d.ts.map +1 -1
  410. package/types/examples/plasma_web/components/Chip/Chip.d.ts +4 -1
  411. package/types/examples/plasma_web/components/Chip/Chip.d.ts.map +1 -1
@@ -22,31 +22,31 @@ var isOutOfBound = function isOutOfBound(_ref, rowSize, columnSize) {
22
22
  return columnIndex === -1 || columnIndex === columnSize + 1 || rowIndex === -1 || rowIndex === rowSize + 1;
23
23
  };
24
24
  var isVisible = function isVisible(refs, row, column) {
25
- var _refs$current;
26
- return (_refs$current = refs.current) === null || _refs$current === void 0 || (_refs$current = _refs$current[row]) === null || _refs$current === void 0 ? void 0 : _refs$current[column];
25
+ var _refs$current, _refs$current$row;
26
+ return (_refs$current = refs.current) === null || _refs$current === void 0 ? void 0 : (_refs$current$row = _refs$current[row]) === null || _refs$current$row === void 0 ? void 0 : _refs$current$row[column];
27
27
  };
28
28
  var isAriaDisableItem = function isAriaDisableItem(item) {
29
29
  return (item === null || item === void 0 ? void 0 : item.getAttribute('aria-disabled')) === 'true';
30
30
  };
31
31
  var hasDisabledArrowKey = function hasDisabledArrowKey(_ref3) {
32
- var _refs$current2;
32
+ var _refs$current2, _refs$current2$previo, _refs$current2$previo2;
33
33
  var refs = _ref3.refs,
34
34
  payload = _ref3.payload,
35
35
  key = _ref3.key;
36
36
  var _payload = _slicedToArray(payload, 2),
37
37
  previousRowIndex = _payload[0],
38
38
  previousColumnIndex = _payload[1];
39
- var disabledArrowKey = (_refs$current2 = refs.current) === null || _refs$current2 === void 0 || (_refs$current2 = _refs$current2[previousRowIndex]) === null || _refs$current2 === void 0 || (_refs$current2 = _refs$current2[previousColumnIndex]) === null || _refs$current2 === void 0 ? void 0 : _refs$current2.dataset.disabledArrowKey;
39
+ var disabledArrowKey = (_refs$current2 = refs.current) === null || _refs$current2 === void 0 ? void 0 : (_refs$current2$previo = _refs$current2[previousRowIndex]) === null || _refs$current2$previo === void 0 ? void 0 : (_refs$current2$previo2 = _refs$current2$previo[previousColumnIndex]) === null || _refs$current2$previo2 === void 0 ? void 0 : _refs$current2$previo2.dataset.disabledArrowKey;
40
40
  return Boolean(disabledArrowKey === null || disabledArrowKey === void 0 ? void 0 : disabledArrowKey.includes(key));
41
41
  };
42
42
  var hasDisabledMonths = function hasDisabledMonths(_ref4) {
43
43
  var _item$dataset, _item$dataset2;
44
44
  var item = _ref4.item,
45
45
  key = _ref4.key;
46
- return item !== null && item !== void 0 && (_item$dataset = item.dataset) !== null && _item$dataset !== void 0 && _item$dataset.disabledMonths ? item === null || item === void 0 || (_item$dataset2 = item.dataset) === null || _item$dataset2 === void 0 ? void 0 : _item$dataset2.disabledMonths.includes(key) : false;
46
+ return item !== null && item !== void 0 && (_item$dataset = item.dataset) !== null && _item$dataset !== void 0 && _item$dataset.disabledMonths ? item === null || item === void 0 ? void 0 : (_item$dataset2 = item.dataset) === null || _item$dataset2 === void 0 ? void 0 : _item$dataset2.disabledMonths.includes(key) : false;
47
47
  };
48
48
  var getNextCorrectPosition = function getNextCorrectPosition(_ref5) {
49
- var _refs$current3;
49
+ var _refs$current3, _refs$current3$newRow;
50
50
  var refs = _ref5.refs,
51
51
  rowSize = _ref5.rowSize,
52
52
  newRowIndex = _ref5.newRowIndex,
@@ -55,15 +55,15 @@ var getNextCorrectPosition = function getNextCorrectPosition(_ref5) {
55
55
  minColumnIndex = _ref5.minColumnIndex,
56
56
  _ref5$defaultState = _ref5.defaultState,
57
57
  defaultState = _ref5$defaultState === void 0 ? [] : _ref5$defaultState;
58
- var item = (_refs$current3 = refs.current) === null || _refs$current3 === void 0 || (_refs$current3 = _refs$current3[newRowIndex]) === null || _refs$current3 === void 0 ? void 0 : _refs$current3[newColumnIndex];
58
+ var item = (_refs$current3 = refs.current) === null || _refs$current3 === void 0 ? void 0 : (_refs$current3$newRow = _refs$current3[newRowIndex]) === null || _refs$current3$newRow === void 0 ? void 0 : _refs$current3$newRow[newColumnIndex];
59
59
  while (isAriaDisableItem(item) && newColumnIndex <= columnSize) {
60
- var _refs$current4;
60
+ var _refs$current4, _refs$current4$newRow;
61
61
  newColumnIndex++;
62
62
  if (newColumnIndex > columnSize && newRowIndex < rowSize) {
63
63
  newRowIndex++;
64
64
  newColumnIndex = minColumnIndex;
65
65
  }
66
- item = (_refs$current4 = refs.current) === null || _refs$current4 === void 0 || (_refs$current4 = _refs$current4[newRowIndex]) === null || _refs$current4 === void 0 ? void 0 : _refs$current4[newColumnIndex];
66
+ item = (_refs$current4 = refs.current) === null || _refs$current4 === void 0 ? void 0 : (_refs$current4$newRow = _refs$current4[newRowIndex]) === null || _refs$current4$newRow === void 0 ? void 0 : _refs$current4$newRow[newColumnIndex];
67
67
  if (item) {
68
68
  var isDisabledArrowDown = hasDisabledArrowKey({
69
69
  refs: refs,
@@ -83,7 +83,7 @@ var getNextCorrectPosition = function getNextCorrectPosition(_ref5) {
83
83
  return [newRowIndex, newColumnIndex];
84
84
  };
85
85
  var getPreviousCorrectPosition = function getPreviousCorrectPosition(_ref6) {
86
- var _refs$current5;
86
+ var _refs$current5, _refs$current5$newRow;
87
87
  var refs = _ref6.refs,
88
88
  rowSize = _ref6.rowSize,
89
89
  newRowIndex = _ref6.newRowIndex,
@@ -92,15 +92,15 @@ var getPreviousCorrectPosition = function getPreviousCorrectPosition(_ref6) {
92
92
  minColumnIndex = _ref6.minColumnIndex,
93
93
  _ref6$defaultState = _ref6.defaultState,
94
94
  defaultState = _ref6$defaultState === void 0 ? [] : _ref6$defaultState;
95
- var item = (_refs$current5 = refs.current) === null || _refs$current5 === void 0 || (_refs$current5 = _refs$current5[newRowIndex]) === null || _refs$current5 === void 0 ? void 0 : _refs$current5[newColumnIndex];
95
+ var item = (_refs$current5 = refs.current) === null || _refs$current5 === void 0 ? void 0 : (_refs$current5$newRow = _refs$current5[newRowIndex]) === null || _refs$current5$newRow === void 0 ? void 0 : _refs$current5$newRow[newColumnIndex];
96
96
  while (isAriaDisableItem(item) && newColumnIndex >= minColumnIndex) {
97
- var _refs$current6;
97
+ var _refs$current6, _refs$current6$newRow;
98
98
  newColumnIndex--;
99
99
  if (newColumnIndex < minColumnIndex && newRowIndex <= rowSize) {
100
100
  newRowIndex--;
101
101
  newColumnIndex = columnSize;
102
102
  }
103
- item = (_refs$current6 = refs.current) === null || _refs$current6 === void 0 || (_refs$current6 = _refs$current6[newRowIndex]) === null || _refs$current6 === void 0 ? void 0 : _refs$current6[newColumnIndex];
103
+ item = (_refs$current6 = refs.current) === null || _refs$current6 === void 0 ? void 0 : (_refs$current6$newRow = _refs$current6[newRowIndex]) === null || _refs$current6$newRow === void 0 ? void 0 : _refs$current6$newRow[newColumnIndex];
104
104
  if (item && item.dataset.day === '1') {
105
105
  var isDisabledArrowUp = hasDisabledArrowKey({
106
106
  refs: refs,
@@ -141,7 +141,7 @@ function getCorrectColumnIndex(_ref7) {
141
141
  }) - 1;
142
142
  }
143
143
  var getCorrectIndexes = function getCorrectIndexes(refs, _ref8, rowSize, columnSize, withShift, defaultState) {
144
- var _refs$current7;
144
+ var _refs$current7, _refs$current7$newRow;
145
145
  var _ref9 = _slicedToArray(_ref8, 2),
146
146
  rowIndex = _ref9[0],
147
147
  columnIndex = _ref9[1];
@@ -178,7 +178,7 @@ var getCorrectIndexes = function getCorrectIndexes(refs, _ref8, rowSize, columnS
178
178
 
179
179
  // INFO: Логика для получения правильной позиции дня, когда переключились на другой месяц
180
180
  // INFO: и ставим указатель на первый доступный день. Только при зажатой клавиши Shift.
181
- if (isAriaDisableItem((_refs$current7 = refs.current) === null || _refs$current7 === void 0 || (_refs$current7 = _refs$current7[newRowIndex]) === null || _refs$current7 === void 0 ? void 0 : _refs$current7[newColumnIndex]) && withShift) {
181
+ if (isAriaDisableItem((_refs$current7 = refs.current) === null || _refs$current7 === void 0 ? void 0 : (_refs$current7$newRow = _refs$current7[newRowIndex]) === null || _refs$current7$newRow === void 0 ? void 0 : _refs$current7$newRow[newColumnIndex]) && withShift) {
182
182
  var isNext = rowIndex === rowSize + 1;
183
183
  var isPrevious = rowIndex === minColumnIndex - 1;
184
184
  var state = {
@@ -295,11 +295,11 @@ var useKeyNavigation = function useKeyNavigation(_ref10) {
295
295
  setSelectIndexes([newRowIndex, newColumnIndex]);
296
296
  }, [onPrev, onNext, selectIndexes, rowSize, columnSize, withShiftState, currentIndexes, isDouble]);
297
297
  useLayoutEffect(function () {
298
- var _outerRefs$current;
298
+ var _outerRefs$current, _outerRefs$current$ro;
299
299
  var _selectIndexes = _slicedToArray(selectIndexes, 2),
300
300
  rowIndex = _selectIndexes[0],
301
301
  columnIndex = _selectIndexes[1];
302
- var item = outerRefs === null || outerRefs === void 0 || (_outerRefs$current = outerRefs.current) === null || _outerRefs$current === void 0 || (_outerRefs$current = _outerRefs$current[rowIndex]) === null || _outerRefs$current === void 0 ? void 0 : _outerRefs$current[columnIndex];
302
+ var item = outerRefs === null || outerRefs === void 0 ? void 0 : (_outerRefs$current = outerRefs.current) === null || _outerRefs$current === void 0 ? void 0 : (_outerRefs$current$ro = _outerRefs$current[rowIndex]) === null || _outerRefs$current$ro === void 0 ? void 0 : _outerRefs$current$ro[columnIndex];
303
303
  if (item) {
304
304
  item.focus();
305
305
  }
@@ -569,8 +569,8 @@ var useKeyNavigation = function useKeyNavigation(_ref10) {
569
569
  case Keys.enter:
570
570
  case Keys.space:
571
571
  {
572
- var _outerRefs$current2;
573
- (_outerRefs$current2 = outerRefs.current) === null || _outerRefs$current2 === void 0 || (_outerRefs$current2 = _outerRefs$current2[newRowIndex]) === null || _outerRefs$current2 === void 0 || _outerRefs$current2[newColumnIndex].click();
572
+ var _outerRefs$current2, _outerRefs$current2$n;
573
+ (_outerRefs$current2 = outerRefs.current) === null || _outerRefs$current2 === void 0 ? void 0 : (_outerRefs$current2$n = _outerRefs$current2[newRowIndex]) === null || _outerRefs$current2$n === void 0 ? void 0 : _outerRefs$current2$n[newColumnIndex].click();
574
574
  break;
575
575
  }
576
576
  default:
@@ -1 +1 @@
1
- {"version":3,"file":"useKeyNavigation.js","sources":["../../../../src/components/Calendar/hooks/useKeyNavigation.ts"],"sourcesContent":["import React, { KeyboardEvent, useCallback, useLayoutEffect, useRef, useState } from 'react';\n\nimport type { DaysMetaDescription, KeyboardArrowKey, UseKeyNavigationProps } from '../Calendar.types';\nimport { Keys } from '../Calendar.types';\nimport { ROW_STEP } from '../utils';\n\n/**\n * Метод для получения стороны двойного календаря.\n */\nconst getDoubleCalendarSide = (currentIndexWeek: number) => {\n if (currentIndexWeek >= 0 && currentIndexWeek < ROW_STEP) {\n return 'first';\n }\n\n if (currentIndexWeek >= ROW_STEP && currentIndexWeek < ROW_STEP * 2) {\n return 'second';\n }\n\n return '';\n};\n\nconst isOutOfBound = ([rowIndex, columnIndex]: number[], rowSize: number, columnSize: number) =>\n columnIndex === -1 || columnIndex === columnSize + 1 || rowIndex === -1 || rowIndex === rowSize + 1;\n\nconst isVisible = (refs: React.MutableRefObject<HTMLDivElement[][]>, row: number, column: number) =>\n refs.current?.[row]?.[column];\n\nconst isAriaDisableItem = (item: HTMLDivElement) => item?.getAttribute('aria-disabled') === 'true';\n\nconst hasDisabledArrowKey = ({\n refs,\n payload,\n key,\n}: {\n refs: React.MutableRefObject<HTMLDivElement[][]>;\n payload: number[];\n key: KeyboardArrowKey;\n}) => {\n const [previousRowIndex, previousColumnIndex] = payload;\n\n const disabledArrowKey = refs.current?.[previousRowIndex]?.[previousColumnIndex]?.dataset.disabledArrowKey;\n\n return Boolean(disabledArrowKey?.includes(key));\n};\n\nconst hasDisabledMonths = ({ item, key }: { item: HTMLDivElement; key: 'previous' | 'next' }) => {\n return item?.dataset?.disabledMonths ? item?.dataset?.disabledMonths.includes(key) : false;\n};\n\nconst getNextCorrectPosition = ({\n refs,\n rowSize,\n newRowIndex,\n newColumnIndex,\n columnSize,\n minColumnIndex,\n defaultState = [],\n}: DaysMetaDescription): number[] => {\n let item = refs.current?.[newRowIndex]?.[newColumnIndex];\n\n while (isAriaDisableItem(item) && newColumnIndex <= columnSize) {\n newColumnIndex++;\n\n if (newColumnIndex > columnSize && newRowIndex < rowSize) {\n newRowIndex++;\n newColumnIndex = minColumnIndex;\n }\n\n item = refs.current?.[newRowIndex]?.[newColumnIndex];\n\n if (item) {\n const isDisabledArrowDown = hasDisabledArrowKey({\n refs,\n payload: [newRowIndex, newColumnIndex],\n key: 'down',\n });\n\n const isDisabledArrowRight = hasDisabledArrowKey({\n refs,\n payload: [newRowIndex, newColumnIndex],\n key: 'right',\n });\n\n if (isDisabledArrowDown || isDisabledArrowRight) {\n return defaultState;\n }\n }\n }\n\n return [newRowIndex, newColumnIndex];\n};\n\nconst getPreviousCorrectPosition = ({\n refs,\n rowSize,\n newRowIndex,\n newColumnIndex,\n columnSize,\n minColumnIndex,\n defaultState = [],\n}: DaysMetaDescription): number[] => {\n let item = refs.current?.[newRowIndex]?.[newColumnIndex];\n\n while (isAriaDisableItem(item) && newColumnIndex >= minColumnIndex) {\n newColumnIndex--;\n\n if (newColumnIndex < minColumnIndex && newRowIndex <= rowSize) {\n newRowIndex--;\n newColumnIndex = columnSize;\n }\n\n item = refs.current?.[newRowIndex]?.[newColumnIndex];\n\n if (item && item.dataset.day === '1') {\n const isDisabledArrowUp = hasDisabledArrowKey({\n refs,\n payload: [newRowIndex, newColumnIndex],\n key: 'up',\n });\n\n const isDisabledArrowLeft = hasDisabledArrowKey({\n refs,\n payload: [newRowIndex, newColumnIndex],\n key: 'left',\n });\n\n if (isDisabledArrowUp || isDisabledArrowLeft) {\n return defaultState;\n }\n }\n }\n\n return [newRowIndex, newColumnIndex];\n};\n\n/**\n * Метод для нахождения стартового индекса дня в следующем/предыдущем месяце\n */\nfunction getCorrectColumnIndex({\n refs,\n rowSize,\n isNext,\n}: {\n refs: HTMLDivElement[][];\n rowSize: number;\n isNext: boolean;\n}): number {\n if (isNext) {\n let index = refs[rowSize].filter(Boolean).length;\n\n if (!index) {\n index = refs[rowSize - 1].filter(Boolean).length;\n }\n\n return index;\n }\n\n // Смещение влево - начинаем поиск первого не-nullable элемента в первой строке\n return refs[0].findIndex((item) => item) - 1;\n}\n\nconst getCorrectIndexes = (\n refs: React.MutableRefObject<HTMLDivElement[][]>,\n [rowIndex, columnIndex]: number[],\n rowSize: number,\n columnSize: number,\n withShift: boolean,\n defaultState: number[],\n) => {\n let newRowIndex = rowIndex;\n let newColumnIndex = columnIndex;\n\n const minRowIndex = newRowIndex + 1;\n const maxRowIndex = newRowIndex - 1;\n\n const minColumnIndex = 0;\n const maxColumnIndex = columnSize;\n\n if (newColumnIndex === minColumnIndex - 1) {\n newColumnIndex += 1;\n\n while (newColumnIndex < maxColumnIndex && !isVisible(refs, newRowIndex, newColumnIndex)) {\n newColumnIndex++;\n }\n }\n\n if (newColumnIndex === columnSize + 1) {\n newColumnIndex -= 1;\n\n while (newColumnIndex > minColumnIndex && !isVisible(refs, newRowIndex, newColumnIndex)) {\n newColumnIndex--;\n }\n }\n\n if (newRowIndex === minColumnIndex - 1) {\n newRowIndex = ROW_STEP - 1;\n\n while (newRowIndex > minRowIndex && !isVisible(refs, newRowIndex, newColumnIndex)) {\n newRowIndex--;\n }\n }\n\n if (newRowIndex === rowSize + 1) {\n newRowIndex = rowSize + 1 - ROW_STEP;\n\n while (newRowIndex <= maxRowIndex && !isVisible(refs, newRowIndex, newColumnIndex)) {\n newRowIndex++;\n }\n }\n\n // INFO: Логика для получения правильной позиции дня, когда переключились на другой месяц\n // INFO: и ставим указатель на первый доступный день. Только при зажатой клавиши Shift.\n if (isAriaDisableItem(refs.current?.[newRowIndex]?.[newColumnIndex]) && withShift) {\n const isNext = rowIndex === rowSize + 1;\n const isPrevious = rowIndex === minColumnIndex - 1;\n\n const state = { refs, rowSize, newColumnIndex, minColumnIndex, columnSize, newRowIndex, defaultState };\n\n if (isNext) {\n return getNextCorrectPosition(state);\n }\n\n if (isPrevious) {\n return getPreviousCorrectPosition(state);\n }\n }\n\n return [newRowIndex, newColumnIndex];\n};\n\n/**\n * Хук для осуществления возможности клавиатурной навигации по матрице.\n */\nexport const useKeyNavigation = ({ isDouble = false, size, onPrev, onNext }: UseKeyNavigationProps) => {\n const [rowSize, columnSize] = size;\n const [selectIndexes, setSelectIndexes] = useState<number[]>([0, 0]);\n const [isOutOfMinMaxRange, setIsOutOfMinMaxRange] = useState<boolean>(false);\n\n const withShiftState = useRef<boolean>(false);\n const currentIndexes = useRef<number[]>([0, 0]);\n\n const outerRefs = useRef(\n Array(rowSize + 1)\n .fill(0)\n .map(() => Array<HTMLDivElement>(columnSize + 1)),\n );\n\n useLayoutEffect(() => {\n if (!isOutOfBound(selectIndexes, rowSize, columnSize)) {\n return;\n }\n\n if (withShiftState.current) {\n const isNext = selectIndexes[0] === rowSize + 1;\n\n let refs = outerRefs.current;\n\n const isSecond = isDouble && isNext;\n const isFirst = isDouble && !isNext;\n\n // Определяем какую часть сдвоенного календаря взять\n if (isFirst) {\n refs = outerRefs.current.slice(0, 5);\n } else if (isSecond) {\n refs = outerRefs.current.slice(5, 12);\n }\n\n const refsList = refs?.flatMap((items) => items.filter(Boolean));\n\n // Если в месяце нет хотя бы одной none-disabled даты значит весь месяц выключен.\n const hasSomeEnabledDay = refsList.some((item) => !isAriaDisableItem(item));\n\n const isDisabledNextMonth = hasDisabledMonths({ item: refsList[refsList.length - 1], key: 'next' });\n const isDisabledPreviousMonth = hasDisabledMonths({ item: refsList[0], key: 'previous' });\n\n // Если следующий/предыдущий месяц находится за границами мин/макс, то переходить на него\n // с текущего выключенного, нет смысла.\n if (!hasSomeEnabledDay && (isDisabledNextMonth || isDisabledPreviousMonth)) {\n const inverseHandle = isNext ? onPrev : onNext;\n\n inverseHandle();\n\n setSelectIndexes(currentIndexes.current);\n\n // Если индексы равны, значит мы остались на текущей дате по причине, того\n // что в следующем(-их)/предыдущем(-их) месяце нет доступных дат\n setIsOutOfMinMaxRange(true);\n\n return;\n }\n\n if (!hasSomeEnabledDay) {\n const handle = isNext ? onNext : onPrev;\n\n const startColumnIndex = getCorrectColumnIndex({\n refs,\n rowSize: isDouble ? refs.length - 1 : rowSize,\n isNext,\n });\n\n handle();\n\n setSelectIndexes([selectIndexes[0], startColumnIndex]);\n\n return;\n }\n }\n\n const [newRowIndex, newColumnIndex] = getCorrectIndexes(\n outerRefs,\n selectIndexes,\n rowSize,\n columnSize,\n withShiftState.current,\n currentIndexes.current,\n );\n\n /**\n * Изменение состояния необходимо сделать здесь, т.к.\n * требуется дождаться обновление DOM и outerRefs\n */\n setSelectIndexes([newRowIndex, newColumnIndex]);\n }, [onPrev, onNext, selectIndexes, rowSize, columnSize, withShiftState, currentIndexes, isDouble]);\n\n useLayoutEffect(() => {\n const [rowIndex, columnIndex] = selectIndexes;\n\n const item = outerRefs?.current?.[rowIndex]?.[columnIndex];\n\n if (item) {\n item.focus();\n }\n }, [selectIndexes]);\n\n const onKeyDown = useCallback(\n (event: KeyboardEvent<HTMLDivElement>) => {\n setIsOutOfMinMaxRange(false);\n\n const { keyCode, shiftKey: withShift } = event;\n\n const [currentRowIndex, currentColumnIndex] = selectIndexes;\n\n let newRowIndex = currentRowIndex;\n let newColumnIndex = currentColumnIndex;\n\n const minColumnIndex = 0;\n const minRowIndex = 0;\n\n const prevRowIndex = currentRowIndex - 1;\n const nextRowIndex = currentRowIndex + 1;\n\n const prevColumnIndex = currentColumnIndex - 1;\n const nextColumnIndex = currentColumnIndex + 1;\n\n currentIndexes.current = [currentRowIndex, currentColumnIndex];\n\n const positionState = {\n refs: outerRefs,\n rowSize,\n columnSize,\n minColumnIndex,\n defaultState: [currentRowIndex, currentColumnIndex],\n };\n\n switch (keyCode) {\n case Keys.pageUp: {\n const isDisabledPreviousMonth = hasDisabledMonths({\n item: outerRefs.current[currentRowIndex][currentColumnIndex],\n key: 'previous',\n });\n\n if (isDisabledPreviousMonth) {\n setIsOutOfMinMaxRange(true);\n\n break;\n }\n\n onPrev(withShift);\n\n break;\n }\n case Keys.pageDown: {\n const isDisabledNextMonth = hasDisabledMonths({\n item: outerRefs.current[currentRowIndex][currentColumnIndex],\n key: 'next',\n });\n\n if (isDisabledNextMonth) {\n setIsOutOfMinMaxRange(true);\n\n break;\n }\n\n onNext(withShift);\n\n break;\n }\n case Keys.home: {\n newColumnIndex = minColumnIndex;\n\n if (isVisible(outerRefs, newRowIndex, newColumnIndex)) {\n break;\n }\n\n newColumnIndex = minColumnIndex - 1;\n\n break;\n }\n case Keys.end: {\n newColumnIndex = columnSize;\n\n if (isVisible(outerRefs, newRowIndex, newColumnIndex)) {\n break;\n }\n\n newColumnIndex = columnSize + 1;\n\n break;\n }\n\n case Keys.left: {\n newRowIndex = prevColumnIndex < minColumnIndex ? prevRowIndex : currentRowIndex;\n newColumnIndex = prevColumnIndex < minColumnIndex ? columnSize : prevColumnIndex;\n\n withShiftState.current = withShift;\n\n const isCurrentDateDisabledArrowLeft = hasDisabledArrowKey({\n refs: outerRefs,\n payload: [currentRowIndex, currentColumnIndex],\n key: 'left',\n });\n\n setIsOutOfMinMaxRange(isCurrentDateDisabledArrowLeft);\n\n if (isCurrentDateDisabledArrowLeft) {\n newRowIndex = currentRowIndex;\n newColumnIndex = currentColumnIndex;\n\n break;\n }\n\n // INFO: Для навигации только по доступным дням\n if (withShift) {\n const [rowIndex, columnIndex] = getPreviousCorrectPosition({\n ...positionState,\n newRowIndex,\n newColumnIndex,\n });\n\n // Если индексы равны, значит мы остались на текущей дате по причине, того\n // что в следующем(-их)/предыдущем(-их) месяце нет доступных дат\n setIsOutOfMinMaxRange(rowIndex === currentRowIndex && currentColumnIndex === columnIndex);\n\n newRowIndex = rowIndex;\n newColumnIndex = columnIndex;\n }\n\n if (isVisible(outerRefs, newRowIndex, newColumnIndex)) {\n break;\n }\n\n if (!isDouble || getDoubleCalendarSide(currentRowIndex) === 'first') {\n if (isCurrentDateDisabledArrowLeft) {\n newRowIndex = currentRowIndex;\n newColumnIndex = currentColumnIndex;\n\n break;\n }\n\n onPrev();\n }\n\n newRowIndex = minRowIndex - 1;\n\n break;\n }\n case Keys.up: {\n newRowIndex = prevRowIndex < minRowIndex ? rowSize : prevRowIndex;\n\n withShiftState.current = withShift;\n\n const isCurrentDateDisabledArrowUp = hasDisabledArrowKey({\n refs: outerRefs,\n payload: [currentRowIndex, currentColumnIndex],\n key: 'up',\n });\n\n setIsOutOfMinMaxRange(isCurrentDateDisabledArrowUp);\n\n if (isCurrentDateDisabledArrowUp) {\n newRowIndex = currentRowIndex;\n newColumnIndex = currentColumnIndex;\n\n break;\n }\n\n if (withShift) {\n const item = outerRefs.current[newRowIndex][newColumnIndex];\n\n const isNextDateDisabledArrowUp =\n !!item &&\n hasDisabledArrowKey({\n refs: outerRefs,\n payload: [newRowIndex, newColumnIndex],\n key: 'up',\n });\n\n const [rowIndex, columnIndex] = getPreviousCorrectPosition({\n ...positionState,\n newRowIndex,\n newColumnIndex,\n });\n\n // Если индексы равны, значит мы остались на текущей дате по причине, того\n // что в следующем(-их)/предыдущем(-их) месяце нет доступных дат\n const haseCurrentPosition = rowIndex === currentRowIndex && currentColumnIndex === columnIndex;\n\n setIsOutOfMinMaxRange(isNextDateDisabledArrowUp || haseCurrentPosition);\n\n newRowIndex = rowIndex;\n newColumnIndex = columnIndex;\n }\n\n if (isVisible(outerRefs, newRowIndex, newColumnIndex)) {\n break;\n }\n\n if (!isDouble || getDoubleCalendarSide(currentRowIndex) === 'first') {\n if (isCurrentDateDisabledArrowUp) {\n newRowIndex = currentRowIndex;\n newColumnIndex = currentColumnIndex;\n\n break;\n }\n\n onPrev();\n }\n\n newRowIndex = minRowIndex - 1;\n\n break;\n }\n\n case Keys.right: {\n newRowIndex = nextColumnIndex > columnSize ? nextRowIndex : currentRowIndex;\n newColumnIndex = nextColumnIndex > columnSize ? minColumnIndex : nextColumnIndex;\n\n withShiftState.current = withShift;\n\n const isCurrentDateDisabledArrowRight = hasDisabledArrowKey({\n refs: outerRefs,\n payload: [currentRowIndex, currentColumnIndex],\n key: 'right',\n });\n\n setIsOutOfMinMaxRange(isCurrentDateDisabledArrowRight);\n\n if (isCurrentDateDisabledArrowRight) {\n newRowIndex = currentRowIndex;\n newColumnIndex = currentColumnIndex;\n\n break;\n }\n\n if (withShift) {\n const [rowIndex, columnIndex] = getNextCorrectPosition({\n ...positionState,\n newRowIndex,\n newColumnIndex,\n });\n\n // Если индексы равны, значит мы остались на текущей дате по причине, того\n // что в следующем(-их)/предыдущем(-их) месяце нет доступных дат\n setIsOutOfMinMaxRange(rowIndex === currentRowIndex && currentColumnIndex === columnIndex);\n\n newRowIndex = rowIndex;\n newColumnIndex = columnIndex;\n }\n\n if (isVisible(outerRefs, newRowIndex, newColumnIndex)) {\n break;\n }\n\n if (!isDouble || getDoubleCalendarSide(currentRowIndex) === 'second') {\n if (isCurrentDateDisabledArrowRight) {\n newRowIndex = currentRowIndex;\n newColumnIndex = currentColumnIndex;\n\n break;\n }\n\n onNext();\n }\n\n newRowIndex = rowSize + 1;\n\n break;\n }\n case Keys.down: {\n newRowIndex = nextRowIndex > rowSize ? minRowIndex : nextRowIndex;\n\n withShiftState.current = withShift;\n\n const isCurrentDateDisabledArrowDown = hasDisabledArrowKey({\n refs: outerRefs,\n payload: [currentRowIndex, currentColumnIndex],\n key: 'down',\n });\n\n setIsOutOfMinMaxRange(isCurrentDateDisabledArrowDown);\n\n if (isCurrentDateDisabledArrowDown) {\n newRowIndex = currentRowIndex;\n newColumnIndex = currentColumnIndex;\n\n break;\n }\n\n if (withShift) {\n const item = outerRefs.current[newRowIndex][newColumnIndex];\n\n const isNextDateDisabledArrowUp =\n !!item &&\n hasDisabledArrowKey({\n refs: outerRefs,\n payload: [newRowIndex, newColumnIndex],\n key: 'down',\n });\n\n const [rowIndex, columnIndex] = getNextCorrectPosition({\n ...positionState,\n newRowIndex,\n newColumnIndex,\n });\n\n // Если индексы равны, значит мы остались на текущей дате по причине, того\n // что в следующем(-их)/предыдущем(-их) месяце нет доступных дат\n const haseCurrentPosition = rowIndex === currentRowIndex && currentColumnIndex === columnIndex;\n\n setIsOutOfMinMaxRange(isNextDateDisabledArrowUp || haseCurrentPosition);\n\n newRowIndex = rowIndex;\n newColumnIndex = columnIndex;\n }\n\n if (isVisible(outerRefs, newRowIndex, newColumnIndex)) {\n break;\n }\n\n if (!isDouble || getDoubleCalendarSide(currentRowIndex) === 'second') {\n if (isCurrentDateDisabledArrowDown) {\n newRowIndex = currentRowIndex;\n newColumnIndex = currentColumnIndex;\n\n break;\n }\n\n onNext();\n }\n\n newRowIndex = rowSize + 1;\n\n break;\n }\n case Keys.enter:\n case Keys.space: {\n outerRefs.current?.[newRowIndex]?.[newColumnIndex].click();\n break;\n }\n\n default:\n return;\n }\n\n setSelectIndexes([newRowIndex, newColumnIndex]);\n },\n [selectIndexes, outerRefs, rowSize, columnSize, onNext, onPrev, isDouble],\n );\n\n return [selectIndexes, onKeyDown, setSelectIndexes, outerRefs, isOutOfMinMaxRange] as const;\n};\n"],"names":["getDoubleCalendarSide","currentIndexWeek","ROW_STEP","isOutOfBound","_ref","rowSize","columnSize","_ref2","_slicedToArray","rowIndex","columnIndex","isVisible","refs","row","column","_refs$current","current","isAriaDisableItem","item","getAttribute","hasDisabledArrowKey","_ref3","_refs$current2","payload","key","_payload","previousRowIndex","previousColumnIndex","disabledArrowKey","dataset","Boolean","includes","hasDisabledMonths","_ref4","_item$dataset","_item$dataset2","disabledMonths","getNextCorrectPosition","_ref5","_refs$current3","newRowIndex","newColumnIndex","minColumnIndex","_ref5$defaultState","defaultState","_refs$current4","isDisabledArrowDown","isDisabledArrowRight","getPreviousCorrectPosition","_ref6","_refs$current5","_ref6$defaultState","_refs$current6","day","isDisabledArrowUp","isDisabledArrowLeft","getCorrectColumnIndex","_ref7","isNext","index","filter","length","findIndex","getCorrectIndexes","_ref8","withShift","_refs$current7","_ref9","minRowIndex","maxRowIndex","maxColumnIndex","isPrevious","state","useKeyNavigation","_ref10","_ref10$isDouble","isDouble","size","onPrev","onNext","_size","_useState","useState","_useState2","selectIndexes","setSelectIndexes","_useState3","_useState4","isOutOfMinMaxRange","setIsOutOfMinMaxRange","withShiftState","useRef","currentIndexes","outerRefs","Array","fill","map","useLayoutEffect","_refs","isSecond","isFirst","slice","refsList","flatMap","items","hasSomeEnabledDay","some","isDisabledNextMonth","isDisabledPreviousMonth","inverseHandle","handle","startColumnIndex","_getCorrectIndexes","_getCorrectIndexes2","_outerRefs$current","_selectIndexes","focus","onKeyDown","useCallback","event","keyCode","shiftKey","_selectIndexes2","currentRowIndex","currentColumnIndex","prevRowIndex","nextRowIndex","prevColumnIndex","nextColumnIndex","positionState","Keys","pageUp","pageDown","home","end","left","isCurrentDateDisabledArrowLeft","_getPreviousCorrectPo","_objectSpread","_getPreviousCorrectPo2","up","isCurrentDateDisabledArrowUp","isNextDateDisabledArrowUp","_getPreviousCorrectPo3","_getPreviousCorrectPo4","haseCurrentPosition","right","isCurrentDateDisabledArrowRight","_getNextCorrectPositi","_getNextCorrectPositi2","down","isCurrentDateDisabledArrowDown","_getNextCorrectPositi3","_getNextCorrectPositi4","enter","space","_outerRefs$current2","click"],"mappings":";;;;;AAMA;AACA;AACA;AACA,IAAMA,qBAAqB,GAAG,SAAxBA,qBAAqBA,CAAIC,gBAAwB,EAAK;AACxD,EAAA,IAAIA,gBAAgB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AACR,KAAA;AAEAxE,IAAAA,gBAAgB,CAAC,CAAC7C,WAAW,EAAEC,cAAc,CAAC,CAAC,CAAA;AACnD,GAAC,EACD,CAAC2C,aAAa,EAAES,SAAS,EAAExF,OAAO,EAAEC,UAAU,EAAEyE,MAAM,EAAED,MAAM,EAAEF,QAAQ,CAC5E,CAAC,CAAA;EAED,OAAO,CAACQ,aAAa,EAAEiC,SAAS,EAAEhC,gBAAgB,EAAEQ,SAAS,EAAEL,kBAAkB,CAAC,CAAA;AACtF;;;;"}
1
+ {"version":3,"file":"useKeyNavigation.js","sources":["../../../../src/components/Calendar/hooks/useKeyNavigation.ts"],"sourcesContent":["import React, { KeyboardEvent, useCallback, useLayoutEffect, useRef, useState } from 'react';\n\nimport type { DaysMetaDescription, KeyboardArrowKey, UseKeyNavigationProps } from '../Calendar.types';\nimport { Keys } from '../Calendar.types';\nimport { ROW_STEP } from '../utils';\n\n/**\n * Метод для получения стороны двойного календаря.\n */\nconst getDoubleCalendarSide = (currentIndexWeek: number) => {\n if (currentIndexWeek >= 0 && currentIndexWeek < ROW_STEP) {\n return 'first';\n }\n\n if (currentIndexWeek >= ROW_STEP && currentIndexWeek < ROW_STEP * 2) {\n return 'second';\n }\n\n return '';\n};\n\nconst isOutOfBound = ([rowIndex, columnIndex]: number[], rowSize: number, columnSize: number) =>\n columnIndex === -1 || columnIndex === columnSize + 1 || rowIndex === -1 || rowIndex === rowSize + 1;\n\nconst isVisible = (refs: React.MutableRefObject<HTMLDivElement[][]>, row: number, column: number) =>\n refs.current?.[row]?.[column];\n\nconst isAriaDisableItem = (item: HTMLDivElement) => item?.getAttribute('aria-disabled') === 'true';\n\nconst hasDisabledArrowKey = ({\n refs,\n payload,\n key,\n}: {\n refs: React.MutableRefObject<HTMLDivElement[][]>;\n payload: number[];\n key: KeyboardArrowKey;\n}) => {\n const [previousRowIndex, previousColumnIndex] = payload;\n\n const disabledArrowKey = refs.current?.[previousRowIndex]?.[previousColumnIndex]?.dataset.disabledArrowKey;\n\n return Boolean(disabledArrowKey?.includes(key));\n};\n\nconst hasDisabledMonths = ({ item, key }: { item: HTMLDivElement; key: 'previous' | 'next' }) => {\n return item?.dataset?.disabledMonths ? item?.dataset?.disabledMonths.includes(key) : false;\n};\n\nconst getNextCorrectPosition = ({\n refs,\n rowSize,\n newRowIndex,\n newColumnIndex,\n columnSize,\n minColumnIndex,\n defaultState = [],\n}: DaysMetaDescription): number[] => {\n let item = refs.current?.[newRowIndex]?.[newColumnIndex];\n\n while (isAriaDisableItem(item) && newColumnIndex <= columnSize) {\n newColumnIndex++;\n\n if (newColumnIndex > columnSize && newRowIndex < rowSize) {\n newRowIndex++;\n newColumnIndex = minColumnIndex;\n }\n\n item = refs.current?.[newRowIndex]?.[newColumnIndex];\n\n if (item) {\n const isDisabledArrowDown = hasDisabledArrowKey({\n refs,\n payload: [newRowIndex, newColumnIndex],\n key: 'down',\n });\n\n const isDisabledArrowRight = hasDisabledArrowKey({\n refs,\n payload: [newRowIndex, newColumnIndex],\n key: 'right',\n });\n\n if (isDisabledArrowDown || isDisabledArrowRight) {\n return defaultState;\n }\n }\n }\n\n return [newRowIndex, newColumnIndex];\n};\n\nconst getPreviousCorrectPosition = ({\n refs,\n rowSize,\n newRowIndex,\n newColumnIndex,\n columnSize,\n minColumnIndex,\n defaultState = [],\n}: DaysMetaDescription): number[] => {\n let item = refs.current?.[newRowIndex]?.[newColumnIndex];\n\n while (isAriaDisableItem(item) && newColumnIndex >= minColumnIndex) {\n newColumnIndex--;\n\n if (newColumnIndex < minColumnIndex && newRowIndex <= rowSize) {\n newRowIndex--;\n newColumnIndex = columnSize;\n }\n\n item = refs.current?.[newRowIndex]?.[newColumnIndex];\n\n if (item && item.dataset.day === '1') {\n const isDisabledArrowUp = hasDisabledArrowKey({\n refs,\n payload: [newRowIndex, newColumnIndex],\n key: 'up',\n });\n\n const isDisabledArrowLeft = hasDisabledArrowKey({\n refs,\n payload: [newRowIndex, newColumnIndex],\n key: 'left',\n });\n\n if (isDisabledArrowUp || isDisabledArrowLeft) {\n return defaultState;\n }\n }\n }\n\n return [newRowIndex, newColumnIndex];\n};\n\n/**\n * Метод для нахождения стартового индекса дня в следующем/предыдущем месяце\n */\nfunction getCorrectColumnIndex({\n refs,\n rowSize,\n isNext,\n}: {\n refs: HTMLDivElement[][];\n rowSize: number;\n isNext: boolean;\n}): number {\n if (isNext) {\n let index = refs[rowSize].filter(Boolean).length;\n\n if (!index) {\n index = refs[rowSize - 1].filter(Boolean).length;\n }\n\n return index;\n }\n\n // Смещение влево - начинаем поиск первого не-nullable элемента в первой строке\n return refs[0].findIndex((item) => item) - 1;\n}\n\nconst getCorrectIndexes = (\n refs: React.MutableRefObject<HTMLDivElement[][]>,\n [rowIndex, columnIndex]: number[],\n rowSize: number,\n columnSize: number,\n withShift: boolean,\n defaultState: number[],\n) => {\n let newRowIndex = rowIndex;\n let newColumnIndex = columnIndex;\n\n const minRowIndex = newRowIndex + 1;\n const maxRowIndex = newRowIndex - 1;\n\n const minColumnIndex = 0;\n const maxColumnIndex = columnSize;\n\n if (newColumnIndex === minColumnIndex - 1) {\n newColumnIndex += 1;\n\n while (newColumnIndex < maxColumnIndex && !isVisible(refs, newRowIndex, newColumnIndex)) {\n newColumnIndex++;\n }\n }\n\n if (newColumnIndex === columnSize + 1) {\n newColumnIndex -= 1;\n\n while (newColumnIndex > minColumnIndex && !isVisible(refs, newRowIndex, newColumnIndex)) {\n newColumnIndex--;\n }\n }\n\n if (newRowIndex === minColumnIndex - 1) {\n newRowIndex = ROW_STEP - 1;\n\n while (newRowIndex > minRowIndex && !isVisible(refs, newRowIndex, newColumnIndex)) {\n newRowIndex--;\n }\n }\n\n if (newRowIndex === rowSize + 1) {\n newRowIndex = rowSize + 1 - ROW_STEP;\n\n while (newRowIndex <= maxRowIndex && !isVisible(refs, newRowIndex, newColumnIndex)) {\n newRowIndex++;\n }\n }\n\n // INFO: Логика для получения правильной позиции дня, когда переключились на другой месяц\n // INFO: и ставим указатель на первый доступный день. Только при зажатой клавиши Shift.\n if (isAriaDisableItem(refs.current?.[newRowIndex]?.[newColumnIndex]) && withShift) {\n const isNext = rowIndex === rowSize + 1;\n const isPrevious = rowIndex === minColumnIndex - 1;\n\n const state = { refs, rowSize, newColumnIndex, minColumnIndex, columnSize, newRowIndex, defaultState };\n\n if (isNext) {\n return getNextCorrectPosition(state);\n }\n\n if (isPrevious) {\n return getPreviousCorrectPosition(state);\n }\n }\n\n return [newRowIndex, newColumnIndex];\n};\n\n/**\n * Хук для осуществления возможности клавиатурной навигации по матрице.\n */\nexport const useKeyNavigation = ({ isDouble = false, size, onPrev, onNext }: UseKeyNavigationProps) => {\n const [rowSize, columnSize] = size;\n const [selectIndexes, setSelectIndexes] = useState<number[]>([0, 0]);\n const [isOutOfMinMaxRange, setIsOutOfMinMaxRange] = useState<boolean>(false);\n\n const withShiftState = useRef<boolean>(false);\n const currentIndexes = useRef<number[]>([0, 0]);\n\n const outerRefs = useRef(\n Array(rowSize + 1)\n .fill(0)\n .map(() => Array<HTMLDivElement>(columnSize + 1)),\n );\n\n useLayoutEffect(() => {\n if (!isOutOfBound(selectIndexes, rowSize, columnSize)) {\n return;\n }\n\n if (withShiftState.current) {\n const isNext = selectIndexes[0] === rowSize + 1;\n\n let refs = outerRefs.current;\n\n const isSecond = isDouble && isNext;\n const isFirst = isDouble && !isNext;\n\n // Определяем какую часть сдвоенного календаря взять\n if (isFirst) {\n refs = outerRefs.current.slice(0, 5);\n } else if (isSecond) {\n refs = outerRefs.current.slice(5, 12);\n }\n\n const refsList = refs?.flatMap((items) => items.filter(Boolean));\n\n // Если в месяце нет хотя бы одной none-disabled даты значит весь месяц выключен.\n const hasSomeEnabledDay = refsList.some((item) => !isAriaDisableItem(item));\n\n const isDisabledNextMonth = hasDisabledMonths({ item: refsList[refsList.length - 1], key: 'next' });\n const isDisabledPreviousMonth = hasDisabledMonths({ item: refsList[0], key: 'previous' });\n\n // Если следующий/предыдущий месяц находится за границами мин/макс, то переходить на него\n // с текущего выключенного, нет смысла.\n if (!hasSomeEnabledDay && (isDisabledNextMonth || isDisabledPreviousMonth)) {\n const inverseHandle = isNext ? onPrev : onNext;\n\n inverseHandle();\n\n setSelectIndexes(currentIndexes.current);\n\n // Если индексы равны, значит мы остались на текущей дате по причине, того\n // что в следующем(-их)/предыдущем(-их) месяце нет доступных дат\n setIsOutOfMinMaxRange(true);\n\n return;\n }\n\n if (!hasSomeEnabledDay) {\n const handle = isNext ? onNext : onPrev;\n\n const startColumnIndex = getCorrectColumnIndex({\n refs,\n rowSize: isDouble ? refs.length - 1 : rowSize,\n isNext,\n });\n\n handle();\n\n setSelectIndexes([selectIndexes[0], startColumnIndex]);\n\n return;\n }\n }\n\n const [newRowIndex, newColumnIndex] = getCorrectIndexes(\n outerRefs,\n selectIndexes,\n rowSize,\n columnSize,\n withShiftState.current,\n currentIndexes.current,\n );\n\n /**\n * Изменение состояния необходимо сделать здесь, т.к.\n * требуется дождаться обновление DOM и outerRefs\n */\n setSelectIndexes([newRowIndex, newColumnIndex]);\n }, [onPrev, onNext, selectIndexes, rowSize, columnSize, withShiftState, currentIndexes, isDouble]);\n\n useLayoutEffect(() => {\n const [rowIndex, columnIndex] = selectIndexes;\n\n const item = outerRefs?.current?.[rowIndex]?.[columnIndex];\n\n if (item) {\n item.focus();\n }\n }, [selectIndexes]);\n\n const onKeyDown = useCallback(\n (event: KeyboardEvent<HTMLDivElement>) => {\n setIsOutOfMinMaxRange(false);\n\n const { keyCode, shiftKey: withShift } = event;\n\n const [currentRowIndex, currentColumnIndex] = selectIndexes;\n\n let newRowIndex = currentRowIndex;\n let newColumnIndex = currentColumnIndex;\n\n const minColumnIndex = 0;\n const minRowIndex = 0;\n\n const prevRowIndex = currentRowIndex - 1;\n const nextRowIndex = currentRowIndex + 1;\n\n const prevColumnIndex = currentColumnIndex - 1;\n const nextColumnIndex = currentColumnIndex + 1;\n\n currentIndexes.current = [currentRowIndex, currentColumnIndex];\n\n const positionState = {\n refs: outerRefs,\n rowSize,\n columnSize,\n minColumnIndex,\n defaultState: [currentRowIndex, currentColumnIndex],\n };\n\n switch (keyCode) {\n case Keys.pageUp: {\n const isDisabledPreviousMonth = hasDisabledMonths({\n item: outerRefs.current[currentRowIndex][currentColumnIndex],\n key: 'previous',\n });\n\n if (isDisabledPreviousMonth) {\n setIsOutOfMinMaxRange(true);\n\n break;\n }\n\n onPrev(withShift);\n\n break;\n }\n case Keys.pageDown: {\n const isDisabledNextMonth = hasDisabledMonths({\n item: outerRefs.current[currentRowIndex][currentColumnIndex],\n key: 'next',\n });\n\n if (isDisabledNextMonth) {\n setIsOutOfMinMaxRange(true);\n\n break;\n }\n\n onNext(withShift);\n\n break;\n }\n case Keys.home: {\n newColumnIndex = minColumnIndex;\n\n if (isVisible(outerRefs, newRowIndex, newColumnIndex)) {\n break;\n }\n\n newColumnIndex = minColumnIndex - 1;\n\n break;\n }\n case Keys.end: {\n newColumnIndex = columnSize;\n\n if (isVisible(outerRefs, newRowIndex, newColumnIndex)) {\n break;\n }\n\n newColumnIndex = columnSize + 1;\n\n break;\n }\n\n case Keys.left: {\n newRowIndex = prevColumnIndex < minColumnIndex ? prevRowIndex : currentRowIndex;\n newColumnIndex = prevColumnIndex < minColumnIndex ? columnSize : prevColumnIndex;\n\n withShiftState.current = withShift;\n\n const isCurrentDateDisabledArrowLeft = hasDisabledArrowKey({\n refs: outerRefs,\n payload: [currentRowIndex, currentColumnIndex],\n key: 'left',\n });\n\n setIsOutOfMinMaxRange(isCurrentDateDisabledArrowLeft);\n\n if (isCurrentDateDisabledArrowLeft) {\n newRowIndex = currentRowIndex;\n newColumnIndex = currentColumnIndex;\n\n break;\n }\n\n // INFO: Для навигации только по доступным дням\n if (withShift) {\n const [rowIndex, columnIndex] = getPreviousCorrectPosition({\n ...positionState,\n newRowIndex,\n newColumnIndex,\n });\n\n // Если индексы равны, значит мы остались на текущей дате по причине, того\n // что в следующем(-их)/предыдущем(-их) месяце нет доступных дат\n setIsOutOfMinMaxRange(rowIndex === currentRowIndex && currentColumnIndex === columnIndex);\n\n newRowIndex = rowIndex;\n newColumnIndex = columnIndex;\n }\n\n if (isVisible(outerRefs, newRowIndex, newColumnIndex)) {\n break;\n }\n\n if (!isDouble || getDoubleCalendarSide(currentRowIndex) === 'first') {\n if (isCurrentDateDisabledArrowLeft) {\n newRowIndex = currentRowIndex;\n newColumnIndex = currentColumnIndex;\n\n break;\n }\n\n onPrev();\n }\n\n newRowIndex = minRowIndex - 1;\n\n break;\n }\n case Keys.up: {\n newRowIndex = prevRowIndex < minRowIndex ? rowSize : prevRowIndex;\n\n withShiftState.current = withShift;\n\n const isCurrentDateDisabledArrowUp = hasDisabledArrowKey({\n refs: outerRefs,\n payload: [currentRowIndex, currentColumnIndex],\n key: 'up',\n });\n\n setIsOutOfMinMaxRange(isCurrentDateDisabledArrowUp);\n\n if (isCurrentDateDisabledArrowUp) {\n newRowIndex = currentRowIndex;\n newColumnIndex = currentColumnIndex;\n\n break;\n }\n\n if (withShift) {\n const item = outerRefs.current[newRowIndex][newColumnIndex];\n\n const isNextDateDisabledArrowUp =\n !!item &&\n hasDisabledArrowKey({\n refs: outerRefs,\n payload: [newRowIndex, newColumnIndex],\n key: 'up',\n });\n\n const [rowIndex, columnIndex] = getPreviousCorrectPosition({\n ...positionState,\n newRowIndex,\n newColumnIndex,\n });\n\n // Если индексы равны, значит мы остались на текущей дате по причине, того\n // что в следующем(-их)/предыдущем(-их) месяце нет доступных дат\n const haseCurrentPosition = rowIndex === currentRowIndex && currentColumnIndex === columnIndex;\n\n setIsOutOfMinMaxRange(isNextDateDisabledArrowUp || haseCurrentPosition);\n\n newRowIndex = rowIndex;\n newColumnIndex = columnIndex;\n }\n\n if (isVisible(outerRefs, newRowIndex, newColumnIndex)) {\n break;\n }\n\n if (!isDouble || getDoubleCalendarSide(currentRowIndex) === 'first') {\n if (isCurrentDateDisabledArrowUp) {\n newRowIndex = currentRowIndex;\n newColumnIndex = currentColumnIndex;\n\n break;\n }\n\n onPrev();\n }\n\n newRowIndex = minRowIndex - 1;\n\n break;\n }\n\n case Keys.right: {\n newRowIndex = nextColumnIndex > columnSize ? nextRowIndex : currentRowIndex;\n newColumnIndex = nextColumnIndex > columnSize ? minColumnIndex : nextColumnIndex;\n\n withShiftState.current = withShift;\n\n const isCurrentDateDisabledArrowRight = hasDisabledArrowKey({\n refs: outerRefs,\n payload: [currentRowIndex, currentColumnIndex],\n key: 'right',\n });\n\n setIsOutOfMinMaxRange(isCurrentDateDisabledArrowRight);\n\n if (isCurrentDateDisabledArrowRight) {\n newRowIndex = currentRowIndex;\n newColumnIndex = currentColumnIndex;\n\n break;\n }\n\n if (withShift) {\n const [rowIndex, columnIndex] = getNextCorrectPosition({\n ...positionState,\n newRowIndex,\n newColumnIndex,\n });\n\n // Если индексы равны, значит мы остались на текущей дате по причине, того\n // что в следующем(-их)/предыдущем(-их) месяце нет доступных дат\n setIsOutOfMinMaxRange(rowIndex === currentRowIndex && currentColumnIndex === columnIndex);\n\n newRowIndex = rowIndex;\n newColumnIndex = columnIndex;\n }\n\n if (isVisible(outerRefs, newRowIndex, newColumnIndex)) {\n break;\n }\n\n if (!isDouble || getDoubleCalendarSide(currentRowIndex) === 'second') {\n if (isCurrentDateDisabledArrowRight) {\n newRowIndex = currentRowIndex;\n newColumnIndex = currentColumnIndex;\n\n break;\n }\n\n onNext();\n }\n\n newRowIndex = rowSize + 1;\n\n break;\n }\n case Keys.down: {\n newRowIndex = nextRowIndex > rowSize ? minRowIndex : nextRowIndex;\n\n withShiftState.current = withShift;\n\n const isCurrentDateDisabledArrowDown = hasDisabledArrowKey({\n refs: outerRefs,\n payload: [currentRowIndex, currentColumnIndex],\n key: 'down',\n });\n\n setIsOutOfMinMaxRange(isCurrentDateDisabledArrowDown);\n\n if (isCurrentDateDisabledArrowDown) {\n newRowIndex = currentRowIndex;\n newColumnIndex = currentColumnIndex;\n\n break;\n }\n\n if (withShift) {\n const item = outerRefs.current[newRowIndex][newColumnIndex];\n\n const isNextDateDisabledArrowUp =\n !!item &&\n hasDisabledArrowKey({\n refs: outerRefs,\n payload: [newRowIndex, newColumnIndex],\n key: 'down',\n });\n\n const [rowIndex, columnIndex] = getNextCorrectPosition({\n ...positionState,\n newRowIndex,\n newColumnIndex,\n });\n\n // Если индексы равны, значит мы остались на текущей дате по причине, того\n // что в следующем(-их)/предыдущем(-их) месяце нет доступных дат\n const haseCurrentPosition = rowIndex === currentRowIndex && currentColumnIndex === columnIndex;\n\n setIsOutOfMinMaxRange(isNextDateDisabledArrowUp || haseCurrentPosition);\n\n newRowIndex = rowIndex;\n newColumnIndex = columnIndex;\n }\n\n if (isVisible(outerRefs, newRowIndex, newColumnIndex)) {\n break;\n }\n\n if (!isDouble || getDoubleCalendarSide(currentRowIndex) === 'second') {\n if (isCurrentDateDisabledArrowDown) {\n newRowIndex = currentRowIndex;\n newColumnIndex = currentColumnIndex;\n\n break;\n }\n\n onNext();\n }\n\n newRowIndex = rowSize + 1;\n\n break;\n }\n case Keys.enter:\n case Keys.space: {\n outerRefs.current?.[newRowIndex]?.[newColumnIndex].click();\n break;\n }\n\n default:\n return;\n }\n\n setSelectIndexes([newRowIndex, newColumnIndex]);\n },\n [selectIndexes, outerRefs, rowSize, columnSize, onNext, onPrev, isDouble],\n );\n\n return [selectIndexes, onKeyDown, setSelectIndexes, outerRefs, isOutOfMinMaxRange] as const;\n};\n"],"names":["getDoubleCalendarSide","currentIndexWeek","ROW_STEP","isOutOfBound","_ref","rowSize","columnSize","_ref2","_slicedToArray","rowIndex","columnIndex","isVisible","refs","row","column","_refs$current","_refs$current$row","current","isAriaDisableItem","item","getAttribute","hasDisabledArrowKey","_ref3","_refs$current2","_refs$current2$previo","_refs$current2$previo2","payload","key","_payload","previousRowIndex","previousColumnIndex","disabledArrowKey","dataset","Boolean","includes","hasDisabledMonths","_ref4","_item$dataset","_item$dataset2","disabledMonths","getNextCorrectPosition","_ref5","_refs$current3","_refs$current3$newRow","newRowIndex","newColumnIndex","minColumnIndex","_ref5$defaultState","defaultState","_refs$current4","_refs$current4$newRow","isDisabledArrowDown","isDisabledArrowRight","getPreviousCorrectPosition","_ref6","_refs$current5","_refs$current5$newRow","_ref6$defaultState","_refs$current6","_refs$current6$newRow","day","isDisabledArrowUp","isDisabledArrowLeft","getCorrectColumnIndex","_ref7","isNext","index","filter","length","findIndex","getCorrectIndexes","_ref8","withShift","_refs$current7","_refs$current7$newRow","_ref9","minRowIndex","maxRowIndex","maxColumnIndex","isPrevious","state","useKeyNavigation","_ref10","_ref10$isDouble","isDouble","size","onPrev","onNext","_size","_useState","useState","_useState2","selectIndexes","setSelectIndexes","_useState3","_useState4","isOutOfMinMaxRange","setIsOutOfMinMaxRange","withShiftState","useRef","currentIndexes","outerRefs","Array","fill","map","useLayoutEffect","_refs","isSecond","isFirst","slice","refsList","flatMap","items","hasSomeEnabledDay","some","isDisabledNextMonth","isDisabledPreviousMonth","inverseHandle","handle","startColumnIndex","_getCorrectIndexes","_getCorrectIndexes2","_outerRefs$current","_outerRefs$current$ro","_selectIndexes","focus","onKeyDown","useCallback","event","keyCode","shiftKey","_selectIndexes2","currentRowIndex","currentColumnIndex","prevRowIndex","nextRowIndex","prevColumnIndex","nextColumnIndex","positionState","Keys","pageUp","pageDown","home","end","left","isCurrentDateDisabledArrowLeft","_getPreviousCorrectPo","_objectSpread","_getPreviousCorrectPo2","up","isCurrentDateDisabledArrowUp","isNextDateDisabledArrowUp","_getPreviousCorrectPo3","_getPreviousCorrectPo4","haseCurrentPosition","right","isCurrentDateDisabledArrowRight","_getNextCorrectPositi","_getNextCorrectPositi2","down","isCurrentDateDisabledArrowDown","_getNextCorrectPositi3","_getNextCorrectPositi4","enter","space","_outerRefs$current2","_outerRefs$current2$n","click"],"mappings":";;;;;AAMA;AACA;AACA;AACA,IAAMA,qBAAqB,GAAG,SAAxBA,qBAAqBA,CAAIC,gBAAwB,EAAK;AACxD,EAAA,IAAIA,gBAAgB,IAAI,CAAC,IAAIA,gBAAgB,GAAGC,QAAQ,EAAE;A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,OAAO,cAAAoJ,mBAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,CAAAC,qBAAA,GAAjBD,mBAAA,CAAoBzH,WAAW,CAAC,MAAA,IAAA,IAAA0H,qBAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAhCA,qBAAA,CAAmCzH,cAAc,CAAC,CAAC0H,KAAK,EAAE,CAAA;AAC1D,UAAA,MAAA;AACJ,SAAA;AAEA,MAAA;AACI,QAAA,OAAA;AACR,KAAA;AAEA1E,IAAAA,gBAAgB,CAAC,CAACjD,WAAW,EAAEC,cAAc,CAAC,CAAC,CAAA;AACnD,GAAC,EACD,CAAC+C,aAAa,EAAES,SAAS,EAAEhG,OAAO,EAAEC,UAAU,EAAEiF,MAAM,EAAED,MAAM,EAAEF,QAAQ,CAC5E,CAAC,CAAA;EAED,OAAO,CAACQ,aAAa,EAAEkC,SAAS,EAAEjC,gBAAgB,EAAEQ,SAAS,EAAEL,kBAAkB,CAAC,CAAA;AACtF;;;;"}
@@ -55,7 +55,7 @@ var CalendarDays = function CalendarDays(_ref) {
55
55
  }
56
56
  onChangeDay(selectedDate, [i + offset, j]);
57
57
  if (isSelectProcess(value)) {
58
- onHoverDay === null || onHoverDay === void 0 || onHoverDay(undefined);
58
+ onHoverDay === null || onHoverDay === void 0 ? void 0 : onHoverDay(undefined);
59
59
  }
60
60
  };
61
61
  }, [getSelectedDate, onChangeDay, offset, value, onHoverDay]);
@@ -65,7 +65,7 @@ var CalendarDays = function CalendarDays(_ref) {
65
65
  if (!selectedDate || !Array.isArray(value) || isSelectedDone) {
66
66
  return;
67
67
  }
68
- onHoverDay === null || onHoverDay === void 0 || onHoverDay(selectedDate);
68
+ onHoverDay === null || onHoverDay === void 0 ? void 0 : onHoverDay(selectedDate);
69
69
  }, [getSelectedDate, onHoverDay, value]);
70
70
  var handleOnFocusDay = useCallback(function () {
71
71
  // заглушка будет убрана при реализации доступности
@@ -78,7 +78,7 @@ var CalendarDays = function CalendarDays(_ref) {
78
78
  useEffect(function () {
79
79
  if (selectedRef.current) {
80
80
  var _onSetSelectedRef$cur;
81
- (_onSetSelectedRef$cur = onSetSelectedRef.current) === null || _onSetSelectedRef$cur === void 0 || _onSetSelectedRef$cur.call(onSetSelectedRef, selectedRef.current);
81
+ (_onSetSelectedRef$cur = onSetSelectedRef.current) === null || _onSetSelectedRef$cur === void 0 ? void 0 : _onSetSelectedRef$cur.call(onSetSelectedRef, selectedRef.current);
82
82
  }
83
83
  }, []);
84
84
  return /*#__PURE__*/React.createElement(StyledCalendarDays, {
@@ -1 +1 @@
1
- {"version":3,"file":"CalendarDays.js","sources":["../../../../../src/components/Calendar/ui/CalendarDays/CalendarDays.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef } from 'react';\n\nimport { useDays } from '../../hooks';\nimport {\n canSelectDate,\n FULL_DAY_NAMES,\n getInRange,\n getSideInRange,\n isSameDay,\n isSelectProcess,\n ROW_STEP,\n SHORT_DAY_NAMES,\n} from '../../utils';\nimport { CalendarDayItem } from '../CalendarDayItem/CalendarDayItem';\nimport { DateItem } from '../../Calendar.types';\n\nimport { StyledCalendarDays, StyledCalendarDaysHint, StyledFlex } from './CalendarDays.styles';\nimport type { CalendarDaysProps } from './CalendarDays.types';\n\n/**\n * Компонент дней в календаре.\n */\nexport const CalendarDays: React.FC<CalendarDaysProps> = ({\n date: currentDate,\n value,\n eventList,\n disabledList,\n min,\n max,\n hoveredDay,\n selectIndexes,\n isDouble,\n isSecond,\n outerRefs,\n onChangeDay,\n onHoverDay,\n onSetSelected,\n onKeyDown,\n}) => {\n const [days, selected] = useDays(currentDate, value, eventList, disabledList, min, max);\n const selectedRef = useRef(selected);\n const onSetSelectedRef = useRef(onSetSelected);\n\n const offset = isSecond ? ROW_STEP : 0;\n\n const getSelectedDate = useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n const { day, monthIndex, year } = event.currentTarget.dataset;\n\n const selectedDate = {\n day: Number(day),\n monthIndex: Number(monthIndex),\n year: Number(year),\n };\n\n if (!canSelectDate(selectedDate, value, disabledList)) {\n return;\n }\n\n return selectedDate;\n },\n [disabledList, value],\n );\n\n const handleOnChangeDay = useCallback(\n (i: number, j: number) => (event: React.MouseEvent<HTMLDivElement>) => {\n const selectedDate = getSelectedDate(event);\n\n if (!selectedDate) {\n return;\n }\n\n onChangeDay(selectedDate, [i + offset, j]);\n\n if (isSelectProcess(value)) {\n onHoverDay?.(undefined);\n }\n },\n [getSelectedDate, onChangeDay, offset, value, onHoverDay],\n );\n\n const handleOnHoverDay = useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n const selectedDate = getSelectedDate(event);\n const isSelectedDone = Array.isArray(value) && value[0] && value[1];\n\n if (!selectedDate || !Array.isArray(value) || isSelectedDone) {\n return;\n }\n\n onHoverDay?.(selectedDate);\n },\n [getSelectedDate, onHoverDay, value],\n );\n\n const handleOnFocusDay = useCallback(() => {\n // заглушка будет убрана при реализации доступности\n }, []);\n\n const getRefs = useCallback(\n (element: HTMLDivElement, isDayInCurrentMonth: boolean, i: number, j: number) => {\n if (isDayInCurrentMonth) {\n outerRefs.current[i + offset][j] = element;\n }\n },\n [offset, outerRefs],\n );\n\n useEffect(() => {\n if (selectedRef.current) {\n onSetSelectedRef.current?.(selectedRef.current);\n }\n }, []);\n\n return (\n <StyledCalendarDays role=\"grid\" aria-labelledby=\"id-grid-label\" onKeyDown={onKeyDown}>\n <StyledCalendarDaysHint id=\"withShift\">\n Для навигации только по доступным датам удерживайте клавишу Shift.\n </StyledCalendarDaysHint>\n <StyledFlex role=\"row\">\n {SHORT_DAY_NAMES.map((name) => (\n <CalendarDayItem\n role=\"columnheader\"\n aria-label={FULL_DAY_NAMES[name]}\n key={name}\n dayOfWeek\n day={name}\n />\n ))}\n </StyledFlex>\n {days.map((day: DateItem[], i) => (\n <StyledFlex role=\"row\" key={i}>\n {day.map(\n (\n {\n date,\n events,\n disabled,\n isSelected,\n isCurrent,\n isDayInCurrentMonth,\n inRange,\n isOutOfMinMaxRange = false,\n disabledArrowKey,\n disabledMonths,\n },\n j,\n ) => (\n <CalendarDayItem\n ref={(element: HTMLDivElement) => getRefs(element, isDayInCurrentMonth, i, j)}\n eventList={events}\n disabled={disabled}\n day={date.day}\n year={date.year}\n monthIndex={date.monthIndex}\n isFocused={\n i + offset === selectIndexes?.[0] && j === selectIndexes?.[1] && !isOutOfMinMaxRange\n }\n isSelected={isSelected}\n isCurrent={isCurrent}\n isDayInCurrentMonth={isDayInCurrentMonth}\n isDouble={isDouble}\n isHovered={isSameDay(date, hoveredDay)}\n inRange={getInRange(value, date, hoveredDay, inRange)}\n sideInRange={getSideInRange(value, date, hoveredDay, isSelected)}\n onClick={disabled ? undefined : handleOnChangeDay(i, j)}\n onMouseOver={disabled ? undefined : handleOnHoverDay}\n onFocus={handleOnFocusDay}\n key={`StyledDay-${j}`}\n role=\"gridcell\"\n disabledArrowKey={disabledArrowKey}\n disabledMonths={disabledMonths}\n />\n ),\n )}\n </StyledFlex>\n ))}\n </StyledCalendarDays>\n );\n};\n"],"names":["CalendarDays","_ref","currentDate","date","value","eventList","disabledList","min","max","hoveredDay","selectIndexes","isDouble","isSecond","outerRefs","onChangeDay","onHoverDay","onSetSelected","onKeyDown","_useDays","useDays","_useDays2","_slicedToArray","days","selected","selectedRef","useRef","onSetSelectedRef","offset","ROW_STEP","getSelectedDate","useCallback","event","_event$currentTarget$","currentTarget","dataset","day","monthIndex","year","selectedDate","Number","canSelectDate","handleOnChangeDay","i","j","isSelectProcess","undefined","handleOnHoverDay","isSelectedDone","Array","isArray","handleOnFocusDay","getRefs","element","isDayInCurrentMonth","current","useEffect","_onSetSelectedRef$cur","call","React","createElement","StyledCalendarDays","role","_StyledCalendarDaysHi","StyledCalendarDaysHint","id","StyledFlex","SHORT_DAY_NAMES","map","name","CalendarDayItem","FULL_DAY_NAMES","key","dayOfWeek","_ref2","events","disabled","isSelected","isCurrent","inRange","_ref2$isOutOfMinMaxRa","isOutOfMinMaxRange","disabledArrowKey","disabledMonths","ref","isFocused","isHovered","isSameDay","getInRange","sideInRange","getSideInRange","onClick","onMouseOver","onFocus","concat"],"mappings":";;;;;;;;AAmBA;AACA;AACA;IACaA,YAAyC,GAAG,SAA5CA,YAAyCA,CAAAC,IAAA,EAgBhD;AAAA,EAAA,IAfIC,WAAW,GAAAD,IAAA,CAAjBE,IAAI;IACJC,KAAK,GAAAH,IAAA,CAALG,KAAK;IACLC,SAAS,GAAAJ,IAAA,CAATI,SAAS;IACTC,YAAY,GAAAL,IAAA,CAAZK,YAAY;IACZC,GAAG,GAAAN,IAAA,CAAHM,GAAG;IACHC,GAAG,GAAAP,IAAA,CAAHO,GAAG;IACHC,UAAU,GAAAR,IAAA,CAAVQ,UAAU;IACVC,aAAa,GAAAT,IAAA,CAAbS,aAAa;IACbC,QAAQ,GAAAV,IAAA,CAARU,QAAQ;IACRC,QAAQ,GAAAX,IAAA,CAARW,QAAQ;IACRC,SAAS,GAAAZ,IAAA,CAATY,SAAS;IACTC,WAAW,GAAAb,IAAA,CAAXa,WAAW;IACXC,UAAU,GAAAd,IAAA,CAAVc,UAAU;IACVC,aAAa,GAAAf,IAAA,CAAbe,aAAa;IACbC,SAAS,GAAAhB,IAAA,CAATgB,SAAS,CAAA;AAET,EAAA,IAAAC,QAAA,GAAyBC,OAAO,CAACjB,WAAW,EAAEE,KAAK,EAAEC,SAAS,EAAEC,YAAY,EAAEC,GAAG,EAAEC,GAAG,CAAC;IAAAY,SAAA,GAAAC,cAAA,CAAAH,QAAA,EAAA,CAAA,CAAA;AAAhFI,IAAAA,IAAI,GAAAF,SAAA,CAAA,CAAA,CAAA;AAAEG,IAAAA,QAAQ,GAAAH,SAAA,CAAA,CAAA,CAAA,CAAA;AACrB,EAAA,IAAMI,WAAW,GAAGC,MAAM,CAACF,QAAQ,CAAC,CAAA;AACpC,EAAA,IAAMG,gBAAgB,GAAGD,MAAM,CAACT,aAAa,CAAC,CAAA;AAE9C,EAAA,IAAMW,MAAM,GAAGf,Q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nB0E,QAAAA,SAAS,EAAEC,SAAS,CAACnF,IAAI,EAAEM,UAAU,CAAE;QACvCqE,OAAO,EAAES,UAAU,CAACnF,KAAK,EAAED,IAAI,EAAEM,UAAU,EAAEqE,OAAO,CAAE;QACtDU,WAAW,EAAEC,cAAc,CAACrF,KAAK,EAAED,IAAI,EAAEM,UAAU,EAAEmE,UAAU,CAAE;QACjEc,OAAO,EAAEf,QAAQ,GAAG9B,SAAS,GAAGJ,iBAAiB,CAACC,CAAC,EAAEC,CAAC,CAAE;AACxDgD,QAAAA,WAAW,EAAEhB,QAAQ,GAAG9B,SAAS,GAAGC,gBAAiB;AACrD8C,QAAAA,OAAO,EAAE1C,gBAAiB;AAC1BqB,QAAAA,GAAG,EAAAsB,YAAAA,CAAAA,MAAA,CAAelD,CAAC,CAAG;AACtBkB,QAAAA,IAAI,EAAC,UAAU;AACfoB,QAAAA,gBAAgB,EAAEA,gBAAiB;AACnCC,QAAAA,cAAc,EAAEA,cAAAA;AAAe,OAClC,CAAC,CAAA;AAAA,KAEV,CACQ,CAAC,CAAA;AAAA,GAChB,CACe,CAAC,CAAA;AAE7B;;;;"}
1
+ {"version":3,"file":"CalendarDays.js","sources":["../../../../../src/components/Calendar/ui/CalendarDays/CalendarDays.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef } from 'react';\n\nimport { useDays } from '../../hooks';\nimport {\n canSelectDate,\n FULL_DAY_NAMES,\n getInRange,\n getSideInRange,\n isSameDay,\n isSelectProcess,\n ROW_STEP,\n SHORT_DAY_NAMES,\n} from '../../utils';\nimport { CalendarDayItem } from '../CalendarDayItem/CalendarDayItem';\nimport { DateItem } from '../../Calendar.types';\n\nimport { StyledCalendarDays, StyledCalendarDaysHint, StyledFlex } from './CalendarDays.styles';\nimport type { CalendarDaysProps } from './CalendarDays.types';\n\n/**\n * Компонент дней в календаре.\n */\nexport const CalendarDays: React.FC<CalendarDaysProps> = ({\n date: currentDate,\n value,\n eventList,\n disabledList,\n min,\n max,\n hoveredDay,\n selectIndexes,\n isDouble,\n isSecond,\n outerRefs,\n onChangeDay,\n onHoverDay,\n onSetSelected,\n onKeyDown,\n}) => {\n const [days, selected] = useDays(currentDate, value, eventList, disabledList, min, max);\n const selectedRef = useRef(selected);\n const onSetSelectedRef = useRef(onSetSelected);\n\n const offset = isSecond ? ROW_STEP : 0;\n\n const getSelectedDate = useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n const { day, monthIndex, year } = event.currentTarget.dataset;\n\n const selectedDate = {\n day: Number(day),\n monthIndex: Number(monthIndex),\n year: Number(year),\n };\n\n if (!canSelectDate(selectedDate, value, disabledList)) {\n return;\n }\n\n return selectedDate;\n },\n [disabledList, value],\n );\n\n const handleOnChangeDay = useCallback(\n (i: number, j: number) => (event: React.MouseEvent<HTMLDivElement>) => {\n const selectedDate = getSelectedDate(event);\n\n if (!selectedDate) {\n return;\n }\n\n onChangeDay(selectedDate, [i + offset, j]);\n\n if (isSelectProcess(value)) {\n onHoverDay?.(undefined);\n }\n },\n [getSelectedDate, onChangeDay, offset, value, onHoverDay],\n );\n\n const handleOnHoverDay = useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n const selectedDate = getSelectedDate(event);\n const isSelectedDone = Array.isArray(value) && value[0] && value[1];\n\n if (!selectedDate || !Array.isArray(value) || isSelectedDone) {\n return;\n }\n\n onHoverDay?.(selectedDate);\n },\n [getSelectedDate, onHoverDay, value],\n );\n\n const handleOnFocusDay = useCallback(() => {\n // заглушка будет убрана при реализации доступности\n }, []);\n\n const getRefs = useCallback(\n (element: HTMLDivElement, isDayInCurrentMonth: boolean, i: number, j: number) => {\n if (isDayInCurrentMonth) {\n outerRefs.current[i + offset][j] = element;\n }\n },\n [offset, outerRefs],\n );\n\n useEffect(() => {\n if (selectedRef.current) {\n onSetSelectedRef.current?.(selectedRef.current);\n }\n }, []);\n\n return (\n <StyledCalendarDays role=\"grid\" aria-labelledby=\"id-grid-label\" onKeyDown={onKeyDown}>\n <StyledCalendarDaysHint id=\"withShift\">\n Для навигации только по доступным датам удерживайте клавишу Shift.\n </StyledCalendarDaysHint>\n <StyledFlex role=\"row\">\n {SHORT_DAY_NAMES.map((name) => (\n <CalendarDayItem\n role=\"columnheader\"\n aria-label={FULL_DAY_NAMES[name]}\n key={name}\n dayOfWeek\n day={name}\n />\n ))}\n </StyledFlex>\n {days.map((day: DateItem[], i) => (\n <StyledFlex role=\"row\" key={i}>\n {day.map(\n (\n {\n date,\n events,\n disabled,\n isSelected,\n isCurrent,\n isDayInCurrentMonth,\n inRange,\n isOutOfMinMaxRange = false,\n disabledArrowKey,\n disabledMonths,\n },\n j,\n ) => (\n <CalendarDayItem\n ref={(element: HTMLDivElement) => getRefs(element, isDayInCurrentMonth, i, j)}\n eventList={events}\n disabled={disabled}\n day={date.day}\n year={date.year}\n monthIndex={date.monthIndex}\n isFocused={\n i + offset === selectIndexes?.[0] && j === selectIndexes?.[1] && !isOutOfMinMaxRange\n }\n isSelected={isSelected}\n isCurrent={isCurrent}\n isDayInCurrentMonth={isDayInCurrentMonth}\n isDouble={isDouble}\n isHovered={isSameDay(date, hoveredDay)}\n inRange={getInRange(value, date, hoveredDay, inRange)}\n sideInRange={getSideInRange(value, date, hoveredDay, isSelected)}\n onClick={disabled ? undefined : handleOnChangeDay(i, j)}\n onMouseOver={disabled ? undefined : handleOnHoverDay}\n onFocus={handleOnFocusDay}\n key={`StyledDay-${j}`}\n role=\"gridcell\"\n disabledArrowKey={disabledArrowKey}\n disabledMonths={disabledMonths}\n />\n ),\n )}\n </StyledFlex>\n ))}\n </StyledCalendarDays>\n );\n};\n"],"names":["CalendarDays","_ref","currentDate","date","value","eventList","disabledList","min","max","hoveredDay","selectIndexes","isDouble","isSecond","outerRefs","onChangeDay","onHoverDay","onSetSelected","onKeyDown","_useDays","useDays","_useDays2","_slicedToArray","days","selected","selectedRef","useRef","onSetSelectedRef","offset","ROW_STEP","getSelectedDate","useCallback","event","_event$currentTarget$","currentTarget","dataset","day","monthIndex","year","selectedDate","Number","canSelectDate","handleOnChangeDay","i","j","isSelectProcess","undefined","handleOnHoverDay","isSelectedDone","Array","isArray","handleOnFocusDay","getRefs","element","isDayInCurrentMonth","current","useEffect","_onSetSelectedRef$cur","call","React","createElement","StyledCalendarDays","role","_StyledCalendarDaysHi","StyledCalendarDaysHint","id","StyledFlex","SHORT_DAY_NAMES","map","name","CalendarDayItem","FULL_DAY_NAMES","key","dayOfWeek","_ref2","events","disabled","isSelected","isCurrent","inRange","_ref2$isOutOfMinMaxRa","isOutOfMinMaxRange","disabledArrowKey","disabledMonths","ref","isFocused","isHovered","isSameDay","getInRange","sideInRange","getSideInRange","onClick","onMouseOver","onFocus","concat"],"mappings":";;;;;;;;AAmBA;AACA;AACA;IACaA,YAAyC,GAAG,SAA5CA,YAAyCA,CAAAC,IAAA,EAgBhD;AAAA,EAAA,IAfIC,WAAW,GAAAD,IAAA,CAAjBE,IAAI;IACJC,KAAK,GAAAH,IAAA,CAALG,KAAK;IACLC,SAAS,GAAAJ,IAAA,CAATI,SAAS;IACTC,YAAY,GAAAL,IAAA,CAAZK,YAAY;IACZC,GAAG,GAAAN,IAAA,CAAHM,GAAG;IACHC,GAAG,GAAAP,IAAA,CAAHO,GAAG;IACHC,UAAU,GAAAR,IAAA,CAAVQ,UAAU;IACVC,aAAa,GAAAT,IAAA,CAAbS,aAAa;IACbC,QAAQ,GAAAV,IAAA,CAARU,QAAQ;IACRC,QAAQ,GAAAX,IAAA,CAARW,QAAQ;IACRC,SAAS,GAAAZ,IAAA,CAATY,SAAS;IACTC,WAAW,GAAAb,IAAA,CAAXa,WAAW;IACXC,UAAU,GAAAd,IAAA,CAAVc,UAAU;IACVC,aAAa,GAAAf,IAAA,CAAbe,aAAa;IACbC,SAAS,GAAAhB,IAAA,CAATgB,SAAS,CAAA;AAET,EAAA,IAAAC,QAAA,GAAyBC,OAAO,CAACjB,WAAW,EAAEE,KAAK,EAAEC,SAAS,EAAEC,YAAY,EAAEC,GAAG,EAAEC,GAA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jB,aAAa,KAAA,IAAA,IAAbA,aAAa,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAbA,aAAa,CAAG,CAAC,CAAC,KAAIiC,CAAC,MAAKjC,aAAa,KAAA,IAAA,IAAbA,aAAa,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAbA,aAAa,CAAG,CAAC,CAAC,CAAI,IAAA,CAACsE,kBACrE;AACDJ,QAAAA,UAAU,EAAEA,UAAW;AACvBC,QAAAA,SAAS,EAAEA,SAAU;AACrBxB,QAAAA,mBAAmB,EAAEA,mBAAoB;AACzC1C,QAAAA,QAAQ,EAAEA,QAAS;AACnB0E,QAAAA,SAAS,EAAEC,SAAS,CAACnF,IAAI,EAAEM,UAAU,CAAE;QACvCqE,OAAO,EAAES,UAAU,CAACnF,KAAK,EAAED,IAAI,EAAEM,UAAU,EAAEqE,OAAO,CAAE;QACtDU,WAAW,EAAEC,cAAc,CAACrF,KAAK,EAAED,IAAI,EAAEM,UAAU,EAAEmE,UAAU,CAAE;QACjEc,OAAO,EAAEf,QAAQ,GAAG9B,SAAS,GAAGJ,iBAAiB,CAACC,CAAC,EAAEC,CAAC,CAAE;AACxDgD,QAAAA,WAAW,EAAEhB,QAAQ,GAAG9B,SAAS,GAAGC,gBAAiB;AACrD8C,QAAAA,OAAO,EAAE1C,gBAAiB;AAC1BqB,QAAAA,GAAG,EAAAsB,YAAAA,CAAAA,MAAA,CAAelD,CAAC,CAAG;AACtBkB,QAAAA,IAAI,EAAC,UAAU;AACfoB,QAAAA,gBAAgB,EAAEA,gBAAiB;AACnCC,QAAAA,cAAc,EAAEA,cAAAA;AAAe,OAClC,CAAC,CAAA;AAAA,KAEV,CACQ,CAAC,CAAA;AAAA,GAChB,CACe,CAAC,CAAA;AAE7B;;;;"}
@@ -24,10 +24,10 @@ var CalendarHeader = function CalendarHeader(_ref) {
24
24
  onUpdateCalendarState = _ref.onUpdateCalendarState;
25
25
  var handleCalendarState = useCallback(function () {
26
26
  if (type === CalendarState.Days) {
27
- onUpdateCalendarState === null || onUpdateCalendarState === void 0 || onUpdateCalendarState(CalendarState.Months, [3, 2]);
27
+ onUpdateCalendarState === null || onUpdateCalendarState === void 0 ? void 0 : onUpdateCalendarState(CalendarState.Months, [3, 2]);
28
28
  }
29
29
  if (type === CalendarState.Months) {
30
- onUpdateCalendarState === null || onUpdateCalendarState === void 0 || onUpdateCalendarState(CalendarState.Years, [3, 2]);
30
+ onUpdateCalendarState === null || onUpdateCalendarState === void 0 ? void 0 : onUpdateCalendarState(CalendarState.Years, [3, 2]);
31
31
  }
32
32
  }, [type, onUpdateCalendarState]);
33
33
  var getHeaderContent = useCallback(function (date) {
@@ -1 +1 @@
1
- {"version":3,"file":"CalendarHeader.js","sources":["../../../../../src/components/Calendar/ui/CalendarHeader/CalendarHeader.tsx"],"sourcesContent":["import React, { useCallback, useMemo } from 'react';\n\nimport { IconDisclosureLeft, IconDisclosureRight } from '../../../_Icon';\nimport { CalendarState } from '../../store/types';\nimport { getCalendarType, MONTH_NAMES, YEAR_RENDER_COUNT } from '../../utils';\nimport type { DateObject } from '../../Calendar.types';\n\nimport type { CalendarHeaderProps } from './CalendarHeader.types';\nimport {\n StyledArrow,\n StyledArrows,\n StyledCalendarHeader,\n StyledHeader,\n StyledHeaderDouble,\n StyledNavigation,\n} from './CalendarHeader.styles';\n\n/**\n * Компонент шапки календаря.\n */\nexport const CalendarHeader: React.FC<CalendarHeaderProps> = ({\n type = 'Days',\n startYear = 0,\n firstDate,\n secondDate,\n isDouble,\n onPrev,\n onNext,\n onUpdateCalendarState,\n}) => {\n const handleCalendarState = useCallback(() => {\n if (type === CalendarState.Days) {\n onUpdateCalendarState?.(CalendarState.Months, [3, 2]);\n }\n\n if (type === CalendarState.Months) {\n onUpdateCalendarState?.(CalendarState.Years, [3, 2]);\n }\n }, [type, onUpdateCalendarState]);\n\n const getHeaderContent = useCallback(\n (date?: DateObject) => {\n if (!date) {\n return '';\n }\n\n if (type === CalendarState.Days) {\n return `${MONTH_NAMES[date.monthIndex]} ${date.year}`;\n }\n\n if (type === CalendarState.Months) {\n return `${date.year}`;\n }\n\n if (type === CalendarState.Years) {\n return `${startYear}—${startYear + YEAR_RENDER_COUNT - 1}`;\n }\n\n return '';\n },\n [type, startYear],\n );\n\n const currentCalendarType = getCalendarType(isDouble ? CalendarState.Days : type);\n\n const PreviousButton = useMemo(\n () => (\n <StyledArrow\n type=\"button\"\n aria-label={`Предыдущий ${currentCalendarType}`}\n tabIndex={0}\n onClick={() => onPrev()}\n >\n <IconDisclosureLeft />\n </StyledArrow>\n ),\n [currentCalendarType, onPrev],\n );\n\n const NextButton = useMemo(\n () => (\n <StyledArrow\n type=\"button\"\n aria-label={`Следующий ${currentCalendarType}`}\n tabIndex={0}\n onClick={() => onNext()}\n >\n <IconDisclosureRight />\n </StyledArrow>\n ),\n [currentCalendarType, onNext],\n );\n\n return (\n <StyledCalendarHeader>\n {isDouble ? (\n <StyledNavigation>\n {PreviousButton}\n <StyledHeaderDouble aria-live=\"polite\">{getHeaderContent(firstDate)}</StyledHeaderDouble>\n <StyledHeaderDouble aria-live=\"polite\">{getHeaderContent(secondDate)}</StyledHeaderDouble>\n {NextButton}\n </StyledNavigation>\n ) : (\n <>\n <StyledHeader\n type=\"button\"\n aria-live=\"polite\"\n id=\"id-grid-label\"\n onClick={handleCalendarState}\n tabIndex={0}\n >\n {getHeaderContent(firstDate)}\n </StyledHeader>\n <StyledArrows>\n {PreviousButton}\n {NextButton}\n </StyledArrows>\n </>\n )}\n </StyledCalendarHeader>\n );\n};\n"],"names":["CalendarHeader","_ref","_ref$type","type","_ref$startYear","startYear","firstDate","secondDate","isDouble","onPrev","onNext","onUpdateCalendarState","handleCalendarState","useCallback","CalendarState","Days","Months","Years","getHeaderContent","date","concat","MONTH_NAMES","monthIndex","year","YEAR_RENDER_COUNT","currentCalendarType","getCalendarType","PreviousButton","useMemo","React","createElement","StyledArrow","tabIndex","onClick","_IconDisclosureLeft","IconDisclosureLeft","NextButton","_IconDisclosureRight","IconDisclosureRight","StyledCalendarHeader","StyledNavigation","StyledHeaderDouble","Fragment","StyledHeader","id","StyledArrows"],"mappings":";;;;;;;;;;AAiBA;AACA;AACA;IACaA,cAA6C,GAAG,SAAhDA,cAA6CA,CAAAC,IAAA,EASpD;AAAA,EAAA,IAAAC,SAAA,GAAAD,IAAA,CARFE,IAAI;AAAJA,IAAAA,IAAI,GAAAD,SAAA,KAAG,KAAA,CAAA,GAAA,MAAM,GAAAA,SAAA;IAAAE,cAAA,GAAAH,IAAA,CACbI,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAG,KAAA,CAAA,GAAA,CAAC,GAAAA,cAAA;IACbE,SAAS,GAAAL,IAAA,CAATK,SAAS;IACTC,UAAU,GAAAN,IAAA,CAAVM,UAAU;IACVC,QAAQ,GAAAP,IAAA,CAARO,QAAQ;IACRC,MAAM,GAAAR,IAAA,CAANQ,MAAM;IACNC,MAAM,GAAAT,IAAA,CAANS,MAAM;IACNC,qBAAqB,GAAAV,IAAA,CAArBU,qBAAqB,CAAA;AAErB,EAAA,IAAMC,mBAAmB,GAAGC,WAAW,CAAC,YAAM;AAC1C,IAAA,IAAIV,IAAI,KAAKW,aAAa,CAACC,IAAI,EAAE;AAC7BJ,MAAAA,qBAAqB,KAArBA,IAAAA,IAAAA,qBAAqB,KAArBA,KAAAA,CAAAA,IAAAA,qBAAqB,CAAGG,aAAa,CAACE,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;AACzD,KAAA;AAEA,IAAA,IAAIb,IAAI,KAAKW,aAAa,CAACE,MAAM,EAAE;AAC/BL,MAAAA,qBAAqB,KAArBA,IAAAA,IAAAA,qBAAqB,KAArBA,KAAAA,CAAAA,IAAAA,qBAAqB,CAAGG,aAAa,CAACG,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;AACxD,KAAA;AACJ,GAAC,EAAE,CAACd,IAAI,EAAEQ,qBAAqB,CAA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AU,QAAQ;AAClByC,IAAAA,EAAE,EAAC,eAAe;AAClBX,IAAAA,OAAO,EAAErB,mBAAoB;AAC7BoB,IAAAA,QAAQ,EAAE,CAAA;AAAE,GAAA,EAEXd,gBAAgB,CAACZ,SAAS,CACjB,CAAC,eACfuB,KAAA,CAAAC,aAAA,CAACe,YAAY,EACRlB,IAAAA,EAAAA,cAAc,EACdS,UACS,CAChB,CAEY,CAAC,CAAA;AAE/B;;;;"}
1
+ {"version":3,"file":"CalendarHeader.js","sources":["../../../../../src/components/Calendar/ui/CalendarHeader/CalendarHeader.tsx"],"sourcesContent":["import React, { useCallback, useMemo } from 'react';\n\nimport { IconDisclosureLeft, IconDisclosureRight } from '../../../_Icon';\nimport { CalendarState } from '../../store/types';\nimport { getCalendarType, MONTH_NAMES, YEAR_RENDER_COUNT } from '../../utils';\nimport type { DateObject } from '../../Calendar.types';\n\nimport type { CalendarHeaderProps } from './CalendarHeader.types';\nimport {\n StyledArrow,\n StyledArrows,\n StyledCalendarHeader,\n StyledHeader,\n StyledHeaderDouble,\n StyledNavigation,\n} from './CalendarHeader.styles';\n\n/**\n * Компонент шапки календаря.\n */\nexport const CalendarHeader: React.FC<CalendarHeaderProps> = ({\n type = 'Days',\n startYear = 0,\n firstDate,\n secondDate,\n isDouble,\n onPrev,\n onNext,\n onUpdateCalendarState,\n}) => {\n const handleCalendarState = useCallback(() => {\n if (type === CalendarState.Days) {\n onUpdateCalendarState?.(CalendarState.Months, [3, 2]);\n }\n\n if (type === CalendarState.Months) {\n onUpdateCalendarState?.(CalendarState.Years, [3, 2]);\n }\n }, [type, onUpdateCalendarState]);\n\n const getHeaderContent = useCallback(\n (date?: DateObject) => {\n if (!date) {\n return '';\n }\n\n if (type === CalendarState.Days) {\n return `${MONTH_NAMES[date.monthIndex]} ${date.year}`;\n }\n\n if (type === CalendarState.Months) {\n return `${date.year}`;\n }\n\n if (type === CalendarState.Years) {\n return `${startYear}—${startYear + YEAR_RENDER_COUNT - 1}`;\n }\n\n return '';\n },\n [type, startYear],\n );\n\n const currentCalendarType = getCalendarType(isDouble ? CalendarState.Days : type);\n\n const PreviousButton = useMemo(\n () => (\n <StyledArrow\n type=\"button\"\n aria-label={`Предыдущий ${currentCalendarType}`}\n tabIndex={0}\n onClick={() => onPrev()}\n >\n <IconDisclosureLeft />\n </StyledArrow>\n ),\n [currentCalendarType, onPrev],\n );\n\n const NextButton = useMemo(\n () => (\n <StyledArrow\n type=\"button\"\n aria-label={`Следующий ${currentCalendarType}`}\n tabIndex={0}\n onClick={() => onNext()}\n >\n <IconDisclosureRight />\n </StyledArrow>\n ),\n [currentCalendarType, onNext],\n );\n\n return (\n <StyledCalendarHeader>\n {isDouble ? (\n <StyledNavigation>\n {PreviousButton}\n <StyledHeaderDouble aria-live=\"polite\">{getHeaderContent(firstDate)}</StyledHeaderDouble>\n <StyledHeaderDouble aria-live=\"polite\">{getHeaderContent(secondDate)}</StyledHeaderDouble>\n {NextButton}\n </StyledNavigation>\n ) : (\n <>\n <StyledHeader\n type=\"button\"\n aria-live=\"polite\"\n id=\"id-grid-label\"\n onClick={handleCalendarState}\n tabIndex={0}\n >\n {getHeaderContent(firstDate)}\n </StyledHeader>\n <StyledArrows>\n {PreviousButton}\n {NextButton}\n </StyledArrows>\n </>\n )}\n </StyledCalendarHeader>\n );\n};\n"],"names":["CalendarHeader","_ref","_ref$type","type","_ref$startYear","startYear","firstDate","secondDate","isDouble","onPrev","onNext","onUpdateCalendarState","handleCalendarState","useCallback","CalendarState","Days","Months","Years","getHeaderContent","date","concat","MONTH_NAMES","monthIndex","year","YEAR_RENDER_COUNT","currentCalendarType","getCalendarType","PreviousButton","useMemo","React","createElement","StyledArrow","tabIndex","onClick","_IconDisclosureLeft","IconDisclosureLeft","NextButton","_IconDisclosureRight","IconDisclosureRight","StyledCalendarHeader","StyledNavigation","StyledHeaderDouble","Fragment","StyledHeader","id","StyledArrows"],"mappings":";;;;;;;;;;AAiBA;AACA;AACA;IACaA,cAA6C,GAAG,SA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Q,EAAE,CAAA;AAAE,GAAA,EAEXd,gBAAgB,CAACZ,SAAS,CACjB,CAAC,eACfuB,KAAA,CAAAC,aAAA,CAACe,YAAY,EACRlB,IAAAA,EAAAA,cAAc,EACdS,UACS,CAChB,CAEY,CAAC,CAAA;AAE/B;;;;"}
@@ -37,7 +37,7 @@ var CalendarMonths = function CalendarMonths(_ref) {
37
37
  useEffect(function () {
38
38
  if (selectedRef.current) {
39
39
  var _onSetSelectedRef$cur;
40
- (_onSetSelectedRef$cur = onSetSelectedRef.current) === null || _onSetSelectedRef$cur === void 0 || _onSetSelectedRef$cur.call(onSetSelectedRef, selectedRef.current);
40
+ (_onSetSelectedRef$cur = onSetSelectedRef.current) === null || _onSetSelectedRef$cur === void 0 ? void 0 : _onSetSelectedRef$cur.call(onSetSelectedRef, selectedRef.current);
41
41
  }
42
42
  }, []);
43
43
  return /*#__PURE__*/React.createElement(StyledCalendarMonths, {
@@ -1 +1 @@
1
- {"version":3,"file":"CalendarMonths.js","sources":["../../../../../src/components/Calendar/ui/CalendarMonths/CalendarMonths.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef } from 'react';\n\nimport { cx } from '../../../../utils';\nimport { useMonths } from '../../hooks';\nimport { classes } from '../../Calendar.tokens';\n\nimport type { CalendarMonthsProps } from './CalendarMonths.types';\nimport { StyledCalendarMonths, StyledFlex, StyledMonth, StyledMonthRoot } from './CalendarMonths.styles';\n\n/**\n * Компонент месяцев в календаре.\n */\nexport const CalendarMonths: React.FC<CalendarMonthsProps> = ({\n date: currentDate,\n selectIndexes,\n outerRefs,\n onChangeMonth,\n onSetSelected,\n onKeyDown,\n}) => {\n const [months, selected] = useMonths(currentDate);\n const selectedRef = useRef(selected);\n const onSetSelectedRef = useRef(onSetSelected);\n\n const handleOnChangeMonth = useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n /**\n * нужно вызвать stopImmediatePropagation для случаев, когда\n * обработчик события onClick навешивается снаружи.\n * Как, например, в компоненте Popup\n */\n event.nativeEvent.stopImmediatePropagation();\n\n const { monthIndex } = event.currentTarget.dataset;\n onChangeMonth(Number(monthIndex));\n },\n [onChangeMonth],\n );\n\n const getRefs = useCallback(\n (element: HTMLDivElement, i: number, j: number) => {\n outerRefs.current[i][j] = element;\n },\n [outerRefs],\n );\n\n useEffect(() => {\n if (selectedRef.current) {\n onSetSelectedRef.current?.(selectedRef.current);\n }\n }, []);\n\n return (\n <StyledCalendarMonths role=\"grid\" aria-labelledby=\"id-grid-label\" onKeyDown={onKeyDown}>\n {months.map((month, i) => (\n <StyledFlex role=\"row\" key={i}>\n {month.map(({ monthName, monthIndex, isSelected, isCurrent, monthFullName }, j) => {\n const selectedClass = isSelected ? classes.selectedItem : undefined;\n const currentClass = !isSelected && isCurrent ? classes.currentItem : undefined;\n\n return (\n <StyledMonthRoot\n id={`month-test-${i}-${j}`}\n className={cx(selectedClass, currentClass, classes.selectableItem)}\n ref={(element: HTMLDivElement) => getRefs(element, i, j)}\n tabIndex={i === selectIndexes?.[0] && j === selectIndexes?.[1] ? 0 : -1}\n onClick={handleOnChangeMonth}\n data-month-index={monthIndex}\n aria-selected={isSelected}\n role=\"gridcell\"\n key={`StyledMonth-${i}-${j}`}\n aria-label={monthFullName}\n >\n <StyledMonth>{monthName}</StyledMonth>\n </StyledMonthRoot>\n );\n })}\n </StyledFlex>\n ))}\n </StyledCalendarMonths>\n );\n};\n"],"names":["CalendarMonths","_ref","currentDate","date","selectIndexes","outerRefs","onChangeMonth","onSetSelected","onKeyDown","_useMonths","useMonths","_useMonths2","_slicedToArray","months","selected","selectedRef","useRef","onSetSelectedRef","handleOnChangeMonth","useCallback","event","nativeEvent","stopImmediatePropagation","monthIndex","currentTarget","dataset","Number","getRefs","element","i","j","current","useEffect","_onSetSelectedRef$cur","call","React","createElement","StyledCalendarMonths","role","map","month","StyledFlex","key","_ref2","monthName","isSelected","isCurrent","monthFullName","selectedClass","classes","selectedItem","undefined","currentClass","currentItem","StyledMonthRoot","id","concat","className","cx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ACkB,eAAe,EAAA;QACZC,EAAE,EAAA,aAAA,CAAAC,MAAA,CAAgB3B,CAAC,OAAA2B,MAAA,CAAI1B,CAAC,CAAG;QAC3B2B,SAAS,EAAEC,EAAE,CAACV,aAAa,EAAEI,YAAY,EAAEH,OAAO,CAACU,cAAc,CAAE;QACnEC,GAAG,EAAE,SAAAA,GAAAA,CAAChC,OAAuB,EAAA;AAAA,UAAA,OAAKD,OAAO,CAACC,OAAO,EAAEC,CAAC,EAAEC,CAAC,CAAC,CAAA;SAAC;QACzD+B,QAAQ,EAAEhC,CAAC,MAAKzB,aAAa,KAAA,IAAA,IAAbA,aAAa,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAbA,aAAa,CAAG,CAAC,CAAC,CAAI0B,IAAAA,CAAC,MAAK1B,aAAa,KAAA,IAAA,IAAbA,aAAa,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAbA,aAAa,CAAG,CAAC,CAAC,CAAG,GAAA,CAAC,GAAG,CAAC,CAAE;AACxE0D,QAAAA,OAAO,EAAE5C,mBAAoB;AAC7B,QAAA,kBAAA,EAAkBK,UAAW;AAC7B,QAAA,eAAA,EAAesB,UAAW;AAC1BP,QAAAA,IAAI,EAAC,UAAU;QACfI,GAAG,EAAA,cAAA,CAAAc,MAAA,CAAiB3B,CAAC,OAAA2B,MAAA,CAAI1B,CAAC,CAAG;QAC7B,YAAYiB,EAAAA,aAAAA;OAEZZ,eAAAA,KAAA,CAAAC,aAAA,CAAC2B,WAAW,EAAEnB,IAAAA,EAAAA,SAAuB,CACxB,CAAC,CAAA;AAE1B,KAAC,CACO,CAAC,CAAA;AAAA,GAChB,CACiB,CAAC,CAAA;AAE/B;;;;"}
1
+ {"version":3,"file":"CalendarMonths.js","sources":["../../../../../src/components/Calendar/ui/CalendarMonths/CalendarMonths.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef } from 'react';\n\nimport { cx } from '../../../../utils';\nimport { useMonths } from '../../hooks';\nimport { classes } from '../../Calendar.tokens';\n\nimport type { CalendarMonthsProps } from './CalendarMonths.types';\nimport { StyledCalendarMonths, StyledFlex, StyledMonth, StyledMonthRoot } from './CalendarMonths.styles';\n\n/**\n * Компонент месяцев в календаре.\n */\nexport const CalendarMonths: React.FC<CalendarMonthsProps> = ({\n date: currentDate,\n selectIndexes,\n outerRefs,\n onChangeMonth,\n onSetSelected,\n onKeyDown,\n}) => {\n const [months, selected] = useMonths(currentDate);\n const selectedRef = useRef(selected);\n const onSetSelectedRef = useRef(onSetSelected);\n\n const handleOnChangeMonth = useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n /**\n * нужно вызвать stopImmediatePropagation для случаев, когда\n * обработчик события onClick навешивается снаружи.\n * Как, например, в компоненте Popup\n */\n event.nativeEvent.stopImmediatePropagation();\n\n const { monthIndex } = event.currentTarget.dataset;\n onChangeMonth(Number(monthIndex));\n },\n [onChangeMonth],\n );\n\n const getRefs = useCallback(\n (element: HTMLDivElement, i: number, j: number) => {\n outerRefs.current[i][j] = element;\n },\n [outerRefs],\n );\n\n useEffect(() => {\n if (selectedRef.current) {\n onSetSelectedRef.current?.(selectedRef.current);\n }\n }, []);\n\n return (\n <StyledCalendarMonths role=\"grid\" aria-labelledby=\"id-grid-label\" onKeyDown={onKeyDown}>\n {months.map((month, i) => (\n <StyledFlex role=\"row\" key={i}>\n {month.map(({ monthName, monthIndex, isSelected, isCurrent, monthFullName }, j) => {\n const selectedClass = isSelected ? classes.selectedItem : undefined;\n const currentClass = !isSelected && isCurrent ? classes.currentItem : undefined;\n\n return (\n <StyledMonthRoot\n id={`month-test-${i}-${j}`}\n className={cx(selectedClass, currentClass, classes.selectableItem)}\n ref={(element: HTMLDivElement) => getRefs(element, i, j)}\n tabIndex={i === selectIndexes?.[0] && j === selectIndexes?.[1] ? 0 : -1}\n onClick={handleOnChangeMonth}\n data-month-index={monthIndex}\n aria-selected={isSelected}\n role=\"gridcell\"\n key={`StyledMonth-${i}-${j}`}\n aria-label={monthFullName}\n >\n <StyledMonth>{monthName}</StyledMonth>\n </StyledMonthRoot>\n );\n })}\n </StyledFlex>\n ))}\n </StyledCalendarMonths>\n );\n};\n"],"names":["CalendarMonths","_ref","currentDate","date","selectIndexes","outerRefs","onChangeMonth","onSetSelected","onKeyDown","_useMonths","useMonths","_useMonths2","_slicedToArray","months","selected","selectedRef","useRef","onSetSelectedRef","handleOnChangeMonth","useCallback","event","nativeEvent","stopImmediatePropagation","monthIndex","currentTarget","dataset","Number","getRefs","element","i","j","current","useEffect","_onSetSelectedRef$cur","call","React","createElement","StyledCalendarMonths","role","map","month","StyledFlex","key","_ref2","monthName","isSelected","isCurrent","monthFullName","selectedClass","classes","selectedItem","undefined","currentClass","currentItem","StyledMonthRoot","id","concat","className","cx","selectableItem","ref","tabIndex","onClick","StyledMonth"],"mappings":";;;;;;;AASA;AACA;AACA;IACaA,cAA6C,GAAG,SAAhDA,cAA6CA,CAAAC,IAAA,EAOpD;AAAA,EAAA,IANIC,WAAW,GAAAD,IAAA,CAAjBE,IAAI;IACJC,aAAa,GAAAH,IAAA,CAAbG,aAAa;IACbC,SAAS,GAAAJ,IAAA,CAATI,SAAS;IACTC,aAAa,GAAAL,IAAA,CAAbK,aAAa;IACbC,aAAa,GAAAN,IAAA,CAAbM,aAAa;IACbC,SAAS,GAAAP,IAAA,CAATO,SAAS,CAAA;AAET,EAAA,IAAAC,UAAA,GAA2BC,SAAS,CAACR,WAAW,CAAC;IAAAS,WAAA,GAAAC,cAAA,CAAAH,UAAA,EAAA,CAAA,CAAA;AAA1CI,IAAAA,MAAM,GAAAF,WAAA,CAAA,CAAA,CAAA;AAAEG,IAAAA,QAAQ,GAAAH,WAAA,CAAA,CAAA,CAAA,CAAA;AACvB,EAAA,IAAMI,WAAW,GAAGC,MAAM,CAACF,QAAQ,CAAC,CAAA;AACpC,EAAA,IAAMG,gBAAgB,GAAGD,MAAM,CAACT,aAAa,CAAC,CAAA;AAE9C,EAAA,IAAMW,mBAAmB,GAAGC,WAA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AAA,IAAI,EAAC,UAAU;QACfI,GAAG,EAAA,cAAA,CAAAc,MAAA,CAAiB3B,CAAC,OAAA2B,MAAA,CAAI1B,CAAC,CAAG;QAC7B,YAAYiB,EAAAA,aAAAA;OAEZZ,eAAAA,KAAA,CAAAC,aAAA,CAAC2B,WAAW,EAAEnB,IAAAA,EAAAA,SAAuB,CACxB,CAAC,CAAA;AAE1B,KAAC,CACO,CAAC,CAAA;AAAA,GAChB,CACiB,CAAC,CAAA;AAE/B;;;;"}
@@ -38,7 +38,7 @@ var CalendarYears = function CalendarYears(_ref) {
38
38
  useEffect(function () {
39
39
  if (selectedRef.current) {
40
40
  var _onSetSelectedRef$cur;
41
- (_onSetSelectedRef$cur = onSetSelectedRef.current) === null || _onSetSelectedRef$cur === void 0 || _onSetSelectedRef$cur.call(onSetSelectedRef, selectedRef.current);
41
+ (_onSetSelectedRef$cur = onSetSelectedRef.current) === null || _onSetSelectedRef$cur === void 0 ? void 0 : _onSetSelectedRef$cur.call(onSetSelectedRef, selectedRef.current);
42
42
  }
43
43
  }, []);
44
44
  return /*#__PURE__*/React.createElement(StyledCalendarYears, {