@salutejs/plasma-new-hope 0.76.3-dev.0 → 0.76.4-canary.1085.8735373257.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (347) 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.js +2 -2
  19. package/cjs/components/Chip/Chip.js.map +1 -1
  20. package/cjs/components/Combobox/Combobox.js +5 -5
  21. package/cjs/components/Combobox/Combobox.js.map +1 -1
  22. package/cjs/components/Combobox/hooks/useFocusController.js +9 -9
  23. package/cjs/components/Combobox/hooks/useFocusController.js.map +1 -1
  24. package/cjs/components/Combobox/ui/ComboboxChip/ComboboxChip.js +1 -1
  25. package/cjs/components/Combobox/ui/ComboboxChip/ComboboxChip.js.map +1 -1
  26. package/cjs/components/Combobox/ui/ComboboxTarget/ComboboxTarget.js +6 -6
  27. package/cjs/components/Combobox/ui/ComboboxTarget/ComboboxTarget.js.map +1 -1
  28. package/cjs/components/Drawer/DrawerContext.js +1 -1
  29. package/cjs/components/Drawer/DrawerContext.js.map +1 -1
  30. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +2 -2
  31. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
  32. package/cjs/components/Modal/ModalContext.js +1 -1
  33. package/cjs/components/Modal/ModalContext.js.map +1 -1
  34. package/cjs/components/Overlay/Overlay.js +1 -1
  35. package/cjs/components/Overlay/Overlay.js.map +1 -1
  36. package/cjs/components/Pagination/Pagination.js +2 -2
  37. package/cjs/components/Pagination/Pagination.js.map +1 -1
  38. package/cjs/components/Pagination/ui/PaginationQuickJumpToPage/PaginationQuickJumpToPage.js +1 -1
  39. package/cjs/components/Pagination/ui/PaginationQuickJumpToPage/PaginationQuickJumpToPage.js.map +1 -1
  40. package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js +1 -1
  41. package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js.map +1 -1
  42. package/cjs/components/Popover/Popover.js +7 -7
  43. package/cjs/components/Popover/Popover.js.map +1 -1
  44. package/cjs/components/Popup/Popup.js +1 -1
  45. package/cjs/components/Popup/Popup.js.map +1 -1
  46. package/cjs/components/Segment/ui/SegmentItem/SegmentItem.js +2 -2
  47. package/cjs/components/Segment/ui/SegmentItem/SegmentItem.js.map +1 -1
  48. package/cjs/components/Select/Select.js +5 -5
  49. package/cjs/components/Select/Select.js.map +1 -1
  50. package/cjs/components/Select/hooks/useKeyNavigation.js +12 -12
  51. package/cjs/components/Select/hooks/useKeyNavigation.js.map +1 -1
  52. package/cjs/components/Select/ui/SelectChip/SelectChip.js +1 -1
  53. package/cjs/components/Select/ui/SelectChip/SelectChip.js.map +1 -1
  54. package/cjs/components/Select/ui/SelectTarget/SelectTarget.js +2 -2
  55. package/cjs/components/Select/ui/SelectTarget/SelectTarget.js.map +1 -1
  56. package/cjs/components/Select/utils/index.js +2 -2
  57. package/cjs/components/Select/utils/index.js.map +1 -1
  58. package/cjs/components/Tabs/TabsContext.js +1 -2
  59. package/cjs/components/Tabs/TabsContext.js.map +1 -1
  60. package/cjs/components/Tabs/ui/TabItem/TabItem.js +1 -1
  61. package/cjs/components/Tabs/ui/TabItem/TabItem.js.map +1 -1
  62. package/cjs/components/Tabs/ui/Tabs/Tabs.js +2 -2
  63. package/cjs/components/Tabs/ui/Tabs/Tabs.js.map +1 -1
  64. package/cjs/components/TextArea/TextArea.js +1 -1
  65. package/cjs/components/TextArea/TextArea.js.map +1 -1
  66. package/cjs/components/TextField/TextField.js +2 -2
  67. package/cjs/components/TextField/TextField.js.map +1 -1
  68. package/cjs/components/TextField/hooks/useKeyNavigation.js +9 -9
  69. package/cjs/components/TextField/hooks/useKeyNavigation.js.map +1 -1
  70. package/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.js +1 -1
  71. package/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.js.map +1 -1
  72. package/cjs/components/Toast/ToastProvider/ToastProvider.js +2 -2
  73. package/cjs/components/Toast/ToastProvider/ToastProvider.js.map +1 -1
  74. package/cjs/components/Tooltip/Tooltip.js +1 -1
  75. package/cjs/components/Tooltip/Tooltip.js.map +1 -1
  76. package/es/_virtual/_rollupPluginBabelHelpers.js +1 -1
  77. package/es/components/Calendar/CalendarBase/CalendarBase.js +1 -1
  78. package/es/components/Calendar/CalendarBase/CalendarBase.js.map +1 -1
  79. package/es/components/Calendar/CalendarDouble/CalendarDouble.js +1 -1
  80. package/es/components/Calendar/CalendarDouble/CalendarDouble.js.map +1 -1
  81. package/es/components/Calendar/hoc/withRange.js +1 -1
  82. package/es/components/Calendar/hoc/withRange.js.map +1 -1
  83. package/es/components/Calendar/hooks/useKeyNavigation.js +19 -19
  84. package/es/components/Calendar/hooks/useKeyNavigation.js.map +1 -1
  85. package/es/components/Calendar/ui/CalendarDays/CalendarDays.js +3 -3
  86. package/es/components/Calendar/ui/CalendarDays/CalendarDays.js.map +1 -1
  87. package/es/components/Calendar/ui/CalendarHeader/CalendarHeader.js +2 -2
  88. package/es/components/Calendar/ui/CalendarHeader/CalendarHeader.js.map +1 -1
  89. package/es/components/Calendar/ui/CalendarMonths/CalendarMonths.js +1 -1
  90. package/es/components/Calendar/ui/CalendarMonths/CalendarMonths.js.map +1 -1
  91. package/es/components/Calendar/ui/CalendarYears/CalendarYears.js +1 -1
  92. package/es/components/Calendar/ui/CalendarYears/CalendarYears.js.map +1 -1
  93. package/es/components/Chip/Chip.js +2 -2
  94. package/es/components/Chip/Chip.js.map +1 -1
  95. package/es/components/Combobox/Combobox.js +5 -5
  96. package/es/components/Combobox/Combobox.js.map +1 -1
  97. package/es/components/Combobox/hooks/useFocusController.js +9 -9
  98. package/es/components/Combobox/hooks/useFocusController.js.map +1 -1
  99. package/es/components/Combobox/ui/ComboboxChip/ComboboxChip.js +1 -1
  100. package/es/components/Combobox/ui/ComboboxChip/ComboboxChip.js.map +1 -1
  101. package/es/components/Combobox/ui/ComboboxTarget/ComboboxTarget.js +6 -6
  102. package/es/components/Combobox/ui/ComboboxTarget/ComboboxTarget.js.map +1 -1
  103. package/es/components/Drawer/DrawerContext.js +1 -1
  104. package/es/components/Drawer/DrawerContext.js.map +1 -1
  105. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +2 -2
  106. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
  107. package/es/components/Modal/ModalContext.js +1 -1
  108. package/es/components/Modal/ModalContext.js.map +1 -1
  109. package/es/components/Overlay/Overlay.js +1 -1
  110. package/es/components/Overlay/Overlay.js.map +1 -1
  111. package/es/components/Pagination/Pagination.js +2 -2
  112. package/es/components/Pagination/Pagination.js.map +1 -1
  113. package/es/components/Pagination/ui/PaginationQuickJumpToPage/PaginationQuickJumpToPage.js +1 -1
  114. package/es/components/Pagination/ui/PaginationQuickJumpToPage/PaginationQuickJumpToPage.js.map +1 -1
  115. package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js +1 -1
  116. package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js.map +1 -1
  117. package/es/components/Popover/Popover.js +7 -7
  118. package/es/components/Popover/Popover.js.map +1 -1
  119. package/es/components/Popup/Popup.js +1 -1
  120. package/es/components/Popup/Popup.js.map +1 -1
  121. package/es/components/Segment/ui/SegmentItem/SegmentItem.js +2 -2
  122. package/es/components/Segment/ui/SegmentItem/SegmentItem.js.map +1 -1
  123. package/es/components/Select/Select.js +5 -5
  124. package/es/components/Select/Select.js.map +1 -1
  125. package/es/components/Select/hooks/useKeyNavigation.js +12 -12
  126. package/es/components/Select/hooks/useKeyNavigation.js.map +1 -1
  127. package/es/components/Select/ui/SelectChip/SelectChip.js +1 -1
  128. package/es/components/Select/ui/SelectChip/SelectChip.js.map +1 -1
  129. package/es/components/Select/ui/SelectTarget/SelectTarget.js +2 -2
  130. package/es/components/Select/ui/SelectTarget/SelectTarget.js.map +1 -1
  131. package/es/components/Select/utils/index.js +2 -2
  132. package/es/components/Select/utils/index.js.map +1 -1
  133. package/es/components/Tabs/TabsContext.js +1 -2
  134. package/es/components/Tabs/TabsContext.js.map +1 -1
  135. package/es/components/Tabs/ui/TabItem/TabItem.js +1 -1
  136. package/es/components/Tabs/ui/TabItem/TabItem.js.map +1 -1
  137. package/es/components/Tabs/ui/Tabs/Tabs.js +2 -2
  138. package/es/components/Tabs/ui/Tabs/Tabs.js.map +1 -1
  139. package/es/components/TextArea/TextArea.js +1 -1
  140. package/es/components/TextArea/TextArea.js.map +1 -1
  141. package/es/components/TextField/TextField.js +2 -2
  142. package/es/components/TextField/TextField.js.map +1 -1
  143. package/es/components/TextField/hooks/useKeyNavigation.js +9 -9
  144. package/es/components/TextField/hooks/useKeyNavigation.js.map +1 -1
  145. package/es/components/TextField/ui/TextFieldChip/TextFieldChip.js +1 -1
  146. package/es/components/TextField/ui/TextFieldChip/TextFieldChip.js.map +1 -1
  147. package/es/components/Toast/ToastProvider/ToastProvider.js +2 -2
  148. package/es/components/Toast/ToastProvider/ToastProvider.js.map +1 -1
  149. package/es/components/Tooltip/Tooltip.js +1 -1
  150. package/es/components/Tooltip/Tooltip.js.map +1 -1
  151. package/package.json +13 -13
  152. package/styled-components/cjs/components/Avatar/Avatar.js +1 -1
  153. package/styled-components/cjs/components/Avatar/Avatar.styles.js +1 -1
  154. package/styled-components/cjs/components/AvatarGroup/AvatarGroup.js +1 -1
  155. package/styled-components/cjs/components/Badge/Badge.js +1 -1
  156. package/styled-components/cjs/components/Badge/Badge.styles.js +1 -1
  157. package/styled-components/cjs/components/Button/Button.js +2 -2
  158. package/styled-components/cjs/components/Button/Button.styles.js +1 -1
  159. package/styled-components/cjs/components/ButtonGroup/ButtonGroup.js +1 -1
  160. package/styled-components/cjs/components/Calendar/CalendarBase/CalendarBase.js +2 -2
  161. package/styled-components/cjs/components/Calendar/CalendarBase/CalendarBase.styles.js +1 -1
  162. package/styled-components/cjs/components/Calendar/CalendarDouble/CalendarDouble.js +2 -2
  163. package/styled-components/cjs/components/Calendar/CalendarDouble/CalendarDouble.styles.js +1 -1
  164. package/styled-components/cjs/components/Calendar/hoc/withRange.js +2 -2
  165. package/styled-components/cjs/components/Calendar/hooks/useKeyNavigation.js +20 -20
  166. package/styled-components/cjs/components/Calendar/store/reducer.js +1 -1
  167. package/styled-components/cjs/components/Calendar/ui/CalendarDayItem/CalendarDayItem.js +1 -1
  168. package/styled-components/cjs/components/Calendar/ui/CalendarDays/CalendarDays.js +4 -4
  169. package/styled-components/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.js +3 -3
  170. package/styled-components/cjs/components/Calendar/ui/CalendarMonths/CalendarMonths.js +2 -2
  171. package/styled-components/cjs/components/Calendar/ui/CalendarYears/CalendarYears.js +2 -2
  172. package/styled-components/cjs/components/Cell/Cell.js +1 -1
  173. package/styled-components/cjs/components/Cell/Cell.styles.js +1 -1
  174. package/styled-components/cjs/components/Checkbox/Checkbox.js +1 -1
  175. package/styled-components/cjs/components/Chip/Chip.js +3 -3
  176. package/styled-components/cjs/components/Chip/Chip.styles.js +1 -1
  177. package/styled-components/cjs/components/Combobox/Combobox.js +6 -6
  178. package/styled-components/cjs/components/Combobox/hooks/useFocusController.js +9 -9
  179. package/styled-components/cjs/components/Combobox/ui/ComboboxChip/ComboboxChip.js +2 -2
  180. package/styled-components/cjs/components/Combobox/ui/ComboboxTarget/ComboboxTarget.js +7 -7
  181. package/styled-components/cjs/components/Counter/Counter.js +1 -1
  182. package/styled-components/cjs/components/Divider/Divider.js +2 -2
  183. package/styled-components/cjs/components/Drawer/Drawer.js +1 -1
  184. package/styled-components/cjs/components/Drawer/DrawerContext.js +1 -1
  185. package/styled-components/cjs/components/Drawer/hooks/useDrawer.js +1 -1
  186. package/styled-components/cjs/components/Drawer/ui/DrawerContent/DrawerContent.js +1 -1
  187. package/styled-components/cjs/components/Drawer/ui/DrawerFooter/DrawerFooter.js +1 -1
  188. package/styled-components/cjs/components/Drawer/ui/DrawerHeader/DrawerHeader.js +1 -1
  189. package/styled-components/cjs/components/Dropdown/Dropdown.js +1 -1
  190. package/styled-components/cjs/components/Dropdown/ui/DropdownDivider/DropdownDivider.js +1 -1
  191. package/styled-components/cjs/components/Dropdown/ui/DropdownFooter/DropdownFooter.js +1 -1
  192. package/styled-components/cjs/components/Dropdown/ui/DropdownGroup/DropdownGroup.js +1 -1
  193. package/styled-components/cjs/components/Dropdown/ui/DropdownHeader/DropdownHeader.js +1 -1
  194. package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +4 -4
  195. package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +1 -1
  196. package/styled-components/cjs/components/Dropdown/utils/index.js +1 -1
  197. package/styled-components/cjs/components/Grid/Grid.js +2 -2
  198. package/styled-components/cjs/components/Grid/ui/Col/Col.js +2 -2
  199. package/styled-components/cjs/components/Grid/ui/Row/Row.js +1 -1
  200. package/styled-components/cjs/components/Grid/utils/index.js +1 -1
  201. package/styled-components/cjs/components/Header/HeaderRoot/HeaderRoot.js +1 -1
  202. package/styled-components/cjs/components/Header/ui/HeaderArrow/HeaderArrow.js +1 -1
  203. package/styled-components/cjs/components/Header/ui/HeaderLogo/HeaderLogo.js +1 -1
  204. package/styled-components/cjs/components/Header/ui/HeaderTitleWrapper/HeaderTitleWrapper.js +1 -1
  205. package/styled-components/cjs/components/Image/Image.js +2 -2
  206. package/styled-components/cjs/components/Image/Image.styles.js +1 -1
  207. package/styled-components/cjs/components/Indicator/Indicator.js +1 -1
  208. package/styled-components/cjs/components/Link/Link.js +1 -1
  209. package/styled-components/cjs/components/Modal/Modal.js +1 -1
  210. package/styled-components/cjs/components/Modal/ModalContext.js +1 -1
  211. package/styled-components/cjs/components/Modal/hooks/useModal.js +1 -1
  212. package/styled-components/cjs/components/Notification/Notification.js +1 -1
  213. package/styled-components/cjs/components/Notification/Notification.styles.js +1 -1
  214. package/styled-components/cjs/components/Notification/NotificationsPortal.js +1 -1
  215. package/styled-components/cjs/components/Notification/NotificationsStore.js +1 -1
  216. package/styled-components/cjs/components/Overlay/Overlay.js +2 -2
  217. package/styled-components/cjs/components/Pagination/Pagination.js +3 -3
  218. package/styled-components/cjs/components/Pagination/ui/PaginationQuickJumpToPage/PaginationQuickJumpToPage.js +2 -2
  219. package/styled-components/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js +2 -2
  220. package/styled-components/cjs/components/Panel/Panel.js +2 -2
  221. package/styled-components/cjs/components/Panel/ui/PanelContent/PanelContent.js +1 -1
  222. package/styled-components/cjs/components/Panel/ui/PanelFooter/PanelFooter.js +1 -1
  223. package/styled-components/cjs/components/Panel/ui/PanelHeader/PanelHeader.js +1 -1
  224. package/styled-components/cjs/components/Popover/Popover.js +9 -9
  225. package/styled-components/cjs/components/Popup/Popup.js +2 -2
  226. package/styled-components/cjs/components/Popup/PopupContext.js +1 -1
  227. package/styled-components/cjs/components/Popup/PopupRoot.js +1 -1
  228. package/styled-components/cjs/components/Popup/hooks/usePopup.js +1 -1
  229. package/styled-components/cjs/components/Progress/Progress.js +1 -1
  230. package/styled-components/cjs/components/Progress/Progress.styles.js +1 -1
  231. package/styled-components/cjs/components/Radiobox/Radiobox.js +1 -1
  232. package/styled-components/cjs/components/SSRProvider/SSRProvider.js +1 -1
  233. package/styled-components/cjs/components/Segment/SegmentProvider/SegmentProvider.js +1 -1
  234. package/styled-components/cjs/components/Segment/ui/SegmentGroup/SegmentGroup.js +1 -1
  235. package/styled-components/cjs/components/Segment/ui/SegmentGroup/SegmentGroup.styles.js +1 -1
  236. package/styled-components/cjs/components/Segment/ui/SegmentItem/SegmentItem.js +3 -3
  237. package/styled-components/cjs/components/Segment/ui/SegmentItem/SegmentItem.styles.js +1 -1
  238. package/styled-components/cjs/components/Select/Select.js +6 -6
  239. package/styled-components/cjs/components/Select/hooks/useKeyNavigation.js +12 -12
  240. package/styled-components/cjs/components/Select/ui/SelectChip/SelectChip.js +2 -2
  241. package/styled-components/cjs/components/Select/ui/SelectTarget/SelectTarget.js +3 -3
  242. package/styled-components/cjs/components/Select/utils/index.js +3 -3
  243. package/styled-components/cjs/components/Skeleton/LineSkeleton/LineSkeleton.js +1 -1
  244. package/styled-components/cjs/components/Skeleton/LineSkeleton/LineSkeleton.styles.js +1 -1
  245. package/styled-components/cjs/components/Skeleton/RectSkeleton/RectSkeleton.js +1 -1
  246. package/styled-components/cjs/components/Skeleton/TextSkeleton/TextSkeleton.js +2 -2
  247. package/styled-components/cjs/components/Skeleton/hoc/withSkeleton.js +1 -1
  248. package/styled-components/cjs/components/Spinner/Spinner.js +1 -1
  249. package/styled-components/cjs/components/Spinner/Spinner.styles.js +1 -1
  250. package/styled-components/cjs/components/Spinner/utils/index.js +1 -1
  251. package/styled-components/cjs/components/Switch/Switch.js +1 -1
  252. package/styled-components/cjs/components/Tabs/TabsContext.js +2 -3
  253. package/styled-components/cjs/components/Tabs/createTabsController.js +1 -1
  254. package/styled-components/cjs/components/Tabs/ui/TabItem/TabItem.js +2 -2
  255. package/styled-components/cjs/components/Tabs/ui/TabItem/TabItem.styles.js +1 -1
  256. package/styled-components/cjs/components/Tabs/ui/Tabs/Tabs.js +3 -3
  257. package/styled-components/cjs/components/Tabs/ui/Tabs/Tabs.styles.js +1 -1
  258. package/styled-components/cjs/components/TextArea/TextArea.js +2 -2
  259. package/styled-components/cjs/components/TextField/TextField.js +3 -3
  260. package/styled-components/cjs/components/TextField/hooks/useKeyNavigation.js +9 -9
  261. package/styled-components/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.js +2 -2
  262. package/styled-components/cjs/components/Toast/Toast.js +2 -2
  263. package/styled-components/cjs/components/Toast/Toast.styles.js +1 -1
  264. package/styled-components/cjs/components/Toast/ToastController.js +2 -2
  265. package/styled-components/cjs/components/Toast/ToastProvider/ToastProvider.js +3 -3
  266. package/styled-components/cjs/components/Toolbar/Toolbar.js +1 -1
  267. package/styled-components/cjs/components/Toolbar/ui/ToolbarDivider/ToolbarDivider.js +1 -1
  268. package/styled-components/cjs/components/Tooltip/Tooltip.js +2 -2
  269. package/styled-components/cjs/components/Typography/Old/Subtitle/Subtitle.js +2 -2
  270. package/styled-components/cjs/components/Typography/Old/TypographyOld.js +2 -2
  271. package/styled-components/cjs/components/Typography/Typography.js +2 -2
  272. package/styled-components/cjs/engines/common.js +1 -1
  273. package/styled-components/cjs/engines/styled-components.js +1 -1
  274. package/styled-components/cjs/examples/_helpers.js +1 -1
  275. package/styled-components/cjs/examples/plasma_b2c/components/Grid/Grid.config.js +1 -1
  276. package/styled-components/cjs/examples/plasma_web/components/Grid/Grid.config.js +1 -1
  277. package/styled-components/cjs/examples/sds_engineer/components/Grid/Grid.config.js +1 -1
  278. package/styled-components/cjs/mixins/applySpacing.js +1 -1
  279. package/styled-components/cjs/mixins/typography.js +1 -1
  280. package/styled-components/es/components/Button/Button.js +1 -1
  281. package/styled-components/es/components/Calendar/CalendarBase/CalendarBase.js +1 -1
  282. package/styled-components/es/components/Calendar/CalendarDouble/CalendarDouble.js +1 -1
  283. package/styled-components/es/components/Calendar/hoc/withRange.js +1 -1
  284. package/styled-components/es/components/Calendar/hooks/useKeyNavigation.js +20 -20
  285. package/styled-components/es/components/Calendar/store/reducer.js +1 -1
  286. package/styled-components/es/components/Calendar/ui/CalendarDays/CalendarDays.js +3 -3
  287. package/styled-components/es/components/Calendar/ui/CalendarHeader/CalendarHeader.js +2 -2
  288. package/styled-components/es/components/Calendar/ui/CalendarMonths/CalendarMonths.js +1 -1
  289. package/styled-components/es/components/Calendar/ui/CalendarYears/CalendarYears.js +1 -1
  290. package/styled-components/es/components/Chip/Chip.js +2 -2
  291. package/styled-components/es/components/Combobox/Combobox.js +5 -5
  292. package/styled-components/es/components/Combobox/hooks/useFocusController.js +9 -9
  293. package/styled-components/es/components/Combobox/ui/ComboboxChip/ComboboxChip.js +1 -1
  294. package/styled-components/es/components/Combobox/ui/ComboboxTarget/ComboboxTarget.js +6 -6
  295. package/styled-components/es/components/Divider/Divider.js +1 -1
  296. package/styled-components/es/components/Drawer/DrawerContext.js +1 -1
  297. package/styled-components/es/components/Drawer/hooks/useDrawer.js +1 -1
  298. package/styled-components/es/components/Drawer/ui/DrawerContent/DrawerContent.js +1 -1
  299. package/styled-components/es/components/Drawer/ui/DrawerFooter/DrawerFooter.js +1 -1
  300. package/styled-components/es/components/Drawer/ui/DrawerHeader/DrawerHeader.js +1 -1
  301. package/styled-components/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +3 -3
  302. package/styled-components/es/components/Grid/Grid.js +1 -1
  303. package/styled-components/es/components/Grid/ui/Col/Col.js +1 -1
  304. package/styled-components/es/components/Grid/utils/index.js +1 -1
  305. package/styled-components/es/components/Image/Image.js +1 -1
  306. package/styled-components/es/components/Modal/ModalContext.js +1 -1
  307. package/styled-components/es/components/Modal/hooks/useModal.js +1 -1
  308. package/styled-components/es/components/Notification/NotificationsStore.js +1 -1
  309. package/styled-components/es/components/Overlay/Overlay.js +1 -1
  310. package/styled-components/es/components/Pagination/Pagination.js +2 -2
  311. package/styled-components/es/components/Pagination/ui/PaginationQuickJumpToPage/PaginationQuickJumpToPage.js +1 -1
  312. package/styled-components/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.js +1 -1
  313. package/styled-components/es/components/Panel/Panel.js +1 -1
  314. package/styled-components/es/components/Popover/Popover.js +8 -8
  315. package/styled-components/es/components/Popup/Popup.js +1 -1
  316. package/styled-components/es/components/Popup/hooks/usePopup.js +1 -1
  317. package/styled-components/es/components/Segment/ui/SegmentItem/SegmentItem.js +2 -2
  318. package/styled-components/es/components/Select/Select.js +5 -5
  319. package/styled-components/es/components/Select/hooks/useKeyNavigation.js +12 -12
  320. package/styled-components/es/components/Select/ui/SelectChip/SelectChip.js +1 -1
  321. package/styled-components/es/components/Select/ui/SelectTarget/SelectTarget.js +2 -2
  322. package/styled-components/es/components/Select/utils/index.js +3 -3
  323. package/styled-components/es/components/Skeleton/TextSkeleton/TextSkeleton.js +1 -1
  324. package/styled-components/es/components/Skeleton/hoc/withSkeleton.js +1 -1
  325. package/styled-components/es/components/Spinner/utils/index.js +1 -1
  326. package/styled-components/es/components/Tabs/TabsContext.js +2 -3
  327. package/styled-components/es/components/Tabs/ui/TabItem/TabItem.js +1 -1
  328. package/styled-components/es/components/Tabs/ui/Tabs/Tabs.js +2 -2
  329. package/styled-components/es/components/TextArea/TextArea.js +1 -1
  330. package/styled-components/es/components/TextField/TextField.js +2 -2
  331. package/styled-components/es/components/TextField/hooks/useKeyNavigation.js +9 -9
  332. package/styled-components/es/components/TextField/ui/TextFieldChip/TextFieldChip.js +1 -1
  333. package/styled-components/es/components/Toast/Toast.js +1 -1
  334. package/styled-components/es/components/Toast/ToastController.js +1 -1
  335. package/styled-components/es/components/Toast/ToastProvider/ToastProvider.js +2 -2
  336. package/styled-components/es/components/Toolbar/ui/ToolbarDivider/ToolbarDivider.js +1 -1
  337. package/styled-components/es/components/Tooltip/Tooltip.js +1 -1
  338. package/styled-components/es/components/Typography/Old/Subtitle/Subtitle.js +1 -1
  339. package/styled-components/es/components/Typography/Old/TypographyOld.js +1 -1
  340. package/styled-components/es/components/Typography/Typography.js +1 -1
  341. package/styled-components/es/engines/common.js +1 -1
  342. package/styled-components/es/examples/_helpers.js +1 -1
  343. package/styled-components/es/examples/plasma_b2c/components/Grid/Grid.config.js +1 -1
  344. package/styled-components/es/examples/plasma_web/components/Grid/Grid.config.js +1 -1
  345. package/styled-components/es/examples/sds_engineer/components/Grid/Grid.config.js +1 -1
  346. package/styled-components/es/mixins/applySpacing.js +1 -1
  347. package/styled-components/es/mixins/typography.js +1 -1
@@ -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","_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;AAC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A,MAAA;AACJ,SAAA;MACA,KAAKsI,mBAAI,CAACwB,KAAK,CAAA;MACf,KAAKxB,mBAAI,CAACyB,KAAK;AAAE,QAAA;UAAA,IAAAC,mBAAA,EAAAC,qBAAA,CAAA;UACb,CAAAD,mBAAA,GAAAhE,SAAS,CAACpF,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;;;;"}
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,IAAI,CAAC,IAAIA,gBAAgB,GAAGC,cAAQ,EAAE;AACtD,IAAA,OAAO,OAAO,CAAA;AAClB,GAAA;EAEA,IAAID,gBAAgB,IAAIC,cAAQ,IAAID,gBAAgB,GAAGC,cAAQ,GAAG,CAAC,EAAE;AACjE,IAAA,OAAO,QAAQ,CAAA;AACnB,GAAA;AAEA,EAAA,OAAO,EAAE,CAAA;AACb,CAAC,CAAA;AAED,IAAMC,YAAY,GAAG,SAAfA,YAAYA,CAAAC,IAAA,EAAuCC,OAAe,EAAEC,UAAkB,EAAA;AAAA,EAAA,IAAAC,KAAA,GAAAC,uCAAA,CAAAJ,IAAA,EAAA,CAAA,CAAA;AAArEK,IAAAA,QAAQ,GAAAF,KAAA,CAAA,CAAA,CAAA;AAAEG,IAAAA,WAAW,GAAAH,KAAA,CAAA,CAAA,CAAA,CAAA;EAAA,OACxCG,WAAW,KAAK,CAAC,CAAC,IAAIA,WAAW,KAAKJ,UAAU,GAAG,CAAC,IAAIG,QAAQ,KAAK,CAAC,CAAC,IAAIA,QAAQ,KAAKJ,OAAO,GAAG,CAAC,CAAA;AAAA,CAAA,CAAA;AAEvG,IAAMM,SAAS,GAAG,SAAZA,SAASA,CAAIC,IAAgD,EAAEC,GAAW,EAAEC,MAAc,EAAA;AAAA,EAAA,IAAAC,aAAA,CAAA;EAAA,OAAAA,CAAAA,aAAA,GAC5FH,IAAI,CAACI,OAAO,MAAAD,IAAAA,IAAAA,aAAA,gBAAAA,a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AAK;AAAE,QAAA;AAAA,UAAA,IAAAC,mBAAA,CAAA;UACb,CAAAA,mBAAA,GAAA/D,SAAS,CAAC7E,OAAO,cAAA4I,mBAAA,KAAA,KAAA,CAAA,IAAA,CAAAA,mBAAA,GAAjBA,mBAAA,CAAoBpH,WAAW,CAAC,MAAA,IAAA,IAAAoH,mBAAA,KAAA,KAAA,CAAA,IAAhCA,mBAAA,CAAmCnH,cAAc,CAAC,CAACoH,KAAK,EAAE,CAAA;AAC1D,UAAA,MAAA;AACJ,SAAA;AAEA,MAAA;AACI,QAAA,OAAA;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;;;;"}
@@ -59,7 +59,7 @@ var CalendarDays = function CalendarDays(_ref) {
59
59
  }
60
60
  onChangeDay(selectedDate, [i + offset, j]);
61
61
  if (index.isSelectProcess(value)) {
62
- onHoverDay === null || onHoverDay === void 0 ? void 0 : onHoverDay(undefined);
62
+ onHoverDay === null || onHoverDay === void 0 || onHoverDay(undefined);
63
63
  }
64
64
  };
65
65
  }, [getSelectedDate, onChangeDay, offset, value, onHoverDay]);
@@ -69,7 +69,7 @@ var CalendarDays = function CalendarDays(_ref) {
69
69
  if (!selectedDate || !Array.isArray(value) || isSelectedDone) {
70
70
  return;
71
71
  }
72
- onHoverDay === null || onHoverDay === void 0 ? void 0 : onHoverDay(selectedDate);
72
+ onHoverDay === null || onHoverDay === void 0 || onHoverDay(selectedDate);
73
73
  }, [getSelectedDate, onHoverDay, value]);
74
74
  var handleOnFocusDay = React.useCallback(function () {
75
75
  // заглушка будет убрана при реализации доступности
@@ -82,7 +82,7 @@ var CalendarDays = function CalendarDays(_ref) {
82
82
  React.useEffect(function () {
83
83
  if (selectedRef.current) {
84
84
  var _onSetSelectedRef$cur;
85
- (_onSetSelectedRef$cur = onSetSelectedRef.current) === null || _onSetSelectedRef$cur === void 0 ? void 0 : _onSetSelectedRef$cur.call(onSetSelectedRef, selectedRef.current);
85
+ (_onSetSelectedRef$cur = onSetSelectedRef.current) === null || _onSetSelectedRef$cur === void 0 || _onSetSelectedRef$cur.call(onSetSelectedRef, selectedRef.current);
86
86
  }
87
87
  }, []);
88
88
  return /*#__PURE__*/React.createElement(CalendarDays_styles.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,eAAO,CAACjB,WAAW,EAAEE,KAAK,EAAEC,SAAS,EAAEC,YAAY,EAAEC,GAAG,EAAEC,GAAG,CAAC;IAAAY,SAAA,GAAAC,uCAAA,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,YAAM,CAACF,QAAQ,CAAC,CAAA;AACpC,EAAA,IAAMG,gBA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;AACDJ,QAAAA,UAAU,EAAEA,UAAW;AACvBC,QAAAA,SAAS,EAAEA,SAAU;AACrBxB,QAAAA,mBAAmB,EAAEA,mBAAoB;AACzC1C,QAAAA,QAAQ,EAAEA,QAAS;AACnB0E,QAAAA,SAAS,EAAEC,eAAS,CAACnF,IAAI,EAAEM,UAAU,CAAE;QACvCqE,OAAO,EAAES,gBAAU,CAACnF,KAAK,EAAED,IAAI,EAAEM,UAAU,EAAEqE,OAAO,CAAE;QACtDU,WAAW,EAAEC,oBAAc,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,S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+28,10 @@ var CalendarHeader = function CalendarHeader(_ref) {
28
28
  onUpdateCalendarState = _ref.onUpdateCalendarState;
29
29
  var handleCalendarState = React.useCallback(function () {
30
30
  if (type === types.CalendarState.Days) {
31
- onUpdateCalendarState === null || onUpdateCalendarState === void 0 ? void 0 : onUpdateCalendarState(types.CalendarState.Months, [3, 2]);
31
+ onUpdateCalendarState === null || onUpdateCalendarState === void 0 || onUpdateCalendarState(types.CalendarState.Months, [3, 2]);
32
32
  }
33
33
  if (type === types.CalendarState.Months) {
34
- onUpdateCalendarState === null || onUpdateCalendarState === void 0 ? void 0 : onUpdateCalendarState(types.CalendarState.Years, [3, 2]);
34
+ onUpdateCalendarState === null || onUpdateCalendarState === void 0 || onUpdateCalendarState(types.CalendarState.Years, [3, 2]);
35
35
  }
36
36
  }, [type, onUpdateCalendarState]);
37
37
  var getHeaderContent = React.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,iBAAW,CAAC,YAAM;AAC1C,IAAA,IAAIV,IAAI,KAAKW,mBAAa,CAACC,IAAI,EAAE;AAC7BJ,MAAAA,qBAAqB,KAArBA,IAAAA,IAAAA,qBAAqB,KAArBA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,qBAAqB,CAAGG,mBAAa,CAACE,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;AACzD,KAAA;AAEA,IAAA,IAAIb,IAAI,KAAKW,mBAAa,CAACE,MAAM,EAAE;AAC/BL,MAAAA,qBAAqB,KAArBA,IAAAA,IAAAA,qBAAqB,KAAr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AAgB,CAACX,UAAU,CAAsB,CAAC,EACzF6B,UACa,CAAC,gBAEnBP,KAAA,CAAAC,aAAA,CAAAD,KAAA,CAAAa,QAAA,qBACIb,KAAA,CAAAC,aAAA,CAACa,kCAAY,EAAA;AACTxC,IAAAA,IAAI,EAAC,QAAQ;AACb,IAAA,WAAA,EAAU,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,kCAAY,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,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,iBAAW,CAAC,YAAM;AAC1C,IAAA,IAAIV,IAAI,KAAKW,mBAAa,CAACC,IAAI,EAAE;AAC7BJ,MAAAA,qBAAqB,KAArBA,IAAAA,IAAAA,qBAAqB,KAArBA,KAAAA,CAAAA,IAAAA,qBAAqB,CAAGG,mBAAa,CAACE,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;AACzD,KAAA;AAEA,IAAA,IAAIb,IAAI,KAAKW,mBAAa,CAACE,MAAM,EAAE;AAC/BL,MAAAA,qBAAqB,KAArBA,IAAAA,IAAAA,qBAAqB,KAArBA,KAAAA,CAAAA,IAAAA,qBAAqB,CAAGG,mBAAa,CAACG,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,C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CAAAC,aAAA,CAACa,kCAAY,EAAA;AACTxC,IAAAA,IAAI,EAAC,QAAQ;AACb,IAAA,WAAA,EAAU,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,kCAAY,EACRlB,IAAAA,EAAAA,cAAc,EACdS,UACS,CAChB,CAEY,CAAC,CAAA;AAE/B;;;;"}
@@ -41,7 +41,7 @@ var CalendarMonths = function CalendarMonths(_ref) {
41
41
  React.useEffect(function () {
42
42
  if (selectedRef.current) {
43
43
  var _onSetSelectedRef$cur;
44
- (_onSetSelectedRef$cur = onSetSelectedRef.current) === null || _onSetSelectedRef$cur === void 0 ? void 0 : _onSetSelectedRef$cur.call(onSetSelectedRef, selectedRef.current);
44
+ (_onSetSelectedRef$cur = onSetSelectedRef.current) === null || _onSetSelectedRef$cur === void 0 || _onSetSelectedRef$cur.call(onSetSelectedRef, selectedRef.current);
45
45
  }
46
46
  }, []);
47
47
  return /*#__PURE__*/React.createElement(CalendarMonths_styles.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","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,mBAAS,CAACR,WAAW,CAAC;IAAAS,WAAA,GAAAC,uCAAA,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,YAAM,CAACF,QAAQ,CAAC,CAAA;AACpC,EAAA,IAAMG,gBAAgB,GAAGD,YAAM,CAACT,aAAa,CAAC,CAAA;AAE9C,EAAA,IAAMW,mBAAmB,GAAGC,iBAAW,CACnC,UAACC,KAAuC,EAAK;AACzC;AACZ;AACA;AACA;AACA;AACYA,IAAAA,KAAK,CAACC,WAAW,CAACC,wBAAwB,EAAE,CAAA;IAE5C,IAAQC,UAAU,GAAKH,KAAK,CAACI,aAAa,CAACC,OAAO,CAA1CF,UAAU,CAAA;AAClBjB,IAAAA,aAAa,CAACoB,MAAM,CAACH,UAAU,CAAC,CAAC,CAAA;AACr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,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,mBAAS,CAACR,WAAW,CAAC;IAAAS,WAAA,GAAAC,uCAAA,CAAAH,UAAA,EAAA,CAAA,CAAA;AAA1CI,IAAAA,MAAM,GAAAF,WAAA,C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,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,iCAAW,EAAEnB,IAAAA,EAAAA,SAAuB,CACxB,CAAC,CAAA;AAE1B,KAAC,CACO,CAAC,CAAA;AAAA,GAChB,CACiB,CAAC,CAAA;AAE/B;;;;"}
@@ -42,7 +42,7 @@ var CalendarYears = function CalendarYears(_ref) {
42
42
  React.useEffect(function () {
43
43
  if (selectedRef.current) {
44
44
  var _onSetSelectedRef$cur;
45
- (_onSetSelectedRef$cur = onSetSelectedRef.current) === null || _onSetSelectedRef$cur === void 0 ? void 0 : _onSetSelectedRef$cur.call(onSetSelectedRef, selectedRef.current);
45
+ (_onSetSelectedRef$cur = onSetSelectedRef.current) === null || _onSetSelectedRef$cur === void 0 || _onSetSelectedRef$cur.call(onSetSelectedRef, selectedRef.current);
46
46
  }
47
47
  }, []);
48
48
  return /*#__PURE__*/React.createElement(CalendarYears_styles.StyledCalendarYears, {
@@ -1 +1 @@
1
- {"version":3,"file":"CalendarYears.js","sources":["../../../../../src/components/Calendar/ui/CalendarYears/CalendarYears.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef } from 'react';\n\nimport { cx } from '../../../../utils';\nimport { useYears } from '../../hooks';\nimport { classes } from '../../Calendar.tokens';\n\nimport type { CalendarYearsProps } from './CalendarYears.types';\nimport { StyledCalendarYears, StyledFlex, StyledYear, StyledYearRoot } from './CalendarYears.styles';\n\n/**\n * Компонент годов в календаре.\n */\nexport const CalendarYears: React.FC<CalendarYearsProps> = ({\n date: currentDate,\n startYear,\n selectIndexes,\n outerRefs,\n onChangeYear,\n onSetSelected,\n onKeyDown,\n}) => {\n const [years, selected] = useYears(currentDate, startYear);\n const selectedRef = useRef(selected);\n const onSetSelectedRef = useRef(onSetSelected);\n\n const handleOnChangeYear = useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n /**\n * нужно вызвать stopImmediatePropagation для случаев, когда\n * обработчик события onClick навешивается снаружи.\n * Как, например, в компоненте Popup\n */\n event.nativeEvent.stopImmediatePropagation();\n\n const { year } = event.currentTarget.dataset;\n onChangeYear(Number(year));\n },\n [onChangeYear],\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 <StyledCalendarYears role=\"grid\" aria-labelledby=\"id-grid-label\" onKeyDown={onKeyDown}>\n {years.map((year, i) => (\n <StyledFlex role=\"row\" key={i}>\n {year.map(({ yearValue, isSelected, isCurrent }, j) => {\n const selectedClass = isSelected ? classes.selectedItem : undefined;\n const currentClass = !isSelected && isCurrent ? classes.currentItem : undefined;\n\n return (\n <StyledYearRoot\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={handleOnChangeYear}\n data-year={yearValue}\n aria-selected={isSelected}\n role=\"gridcell\"\n key={`StyledYear-${i}-${j}`}\n aria-label={String(yearValue)}\n >\n <StyledYear>{yearValue}</StyledYear>\n </StyledYearRoot>\n );\n })}\n </StyledFlex>\n ))}\n </StyledCalendarYears>\n );\n};\n"],"names":["CalendarYears","_ref","currentDate","date","startYear","selectIndexes","outerRefs","onChangeYear","onSetSelected","onKeyDown","_useYears","useYears","_useYears2","_slicedToArray","years","selected","selectedRef","useRef","onSetSelectedRef","handleOnChangeYear","useCallback","event","nativeEvent","stopImmediatePropagation","year","currentTarget","dataset","Number","getRefs","element","i","j","current","useEffect","_onSetSelectedRef$cur","call","React","createElement","StyledCalendarYears","role","map","StyledFlex","key","_ref2","yearValue","isSelected","isCurrent","selectedClass","classes","selectedItem","undefined","currentClass","currentItem","StyledYearRoot","className","cx","selectableItem","ref","tabIndex","onClick","concat","String","StyledYear"],"mappings":";;;;;;;;;;;AASA;AACA;AACA;IACaA,aAA2C,GAAG,SAA9CA,aAA2CA,CAAAC,IAAA,EAQlD;AAAA,EAAA,IAPIC,WAAW,GAAAD,IAAA,CAAjBE,IAAI;IACJC,SAAS,GAAAH,IAAA,CAATG,SAAS;IACTC,aAAa,GAAAJ,IAAA,CAAbI,aAAa;IACbC,SAAS,GAAAL,IAAA,CAATK,SAAS;IACTC,YAAY,GAAAN,IAAA,CAAZM,YAAY;IACZC,aAAa,GAAAP,IAAA,CAAbO,aAAa;IACbC,SAAS,GAAAR,IAAA,CAATQ,SAAS,CAAA;AAET,EAAA,IAAAC,SAAA,GAA0BC,iBAAQ,CAACT,WAAW,EAAEE,SAAS,CAAC;IAAAQ,UAAA,GAAAC,uCAAA,CAAAH,SAAA,EAAA,CAAA,CAAA;AAAnDI,IAAAA,KAAK,GAAAF,UAAA,CAAA,CAAA,CAAA;AAAEG,IAAAA,QAAQ,GAAAH,UAAA,CAAA,CAAA,CAAA,CAAA;AACtB,EAAA,IAAMI,WAAW,GAAGC,YAAM,CAACF,QAAQ,CAAC,CAAA;AACpC,EAAA,IAAMG,gBAAgB,GAAGD,YAAM,CAACT,aAAa,CAAC,CAAA;AAE9C,EAAA,IAAMW,kBAAkB,GAAGC,iBAAW,CAClC,UAACC,KAAuC,EAAK;AACzC;AACZ;AACA;AACA;AACA;AACYA,IAAAA,KAAK,CAACC,WAAW,CAACC,wBAAwB,EAAE,CAAA;IA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AAA;AAAA,GAChB,CACgB,CAAC,CAAA;AAE9B;;;;"}
1
+ {"version":3,"file":"CalendarYears.js","sources":["../../../../../src/components/Calendar/ui/CalendarYears/CalendarYears.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef } from 'react';\n\nimport { cx } from '../../../../utils';\nimport { useYears } from '../../hooks';\nimport { classes } from '../../Calendar.tokens';\n\nimport type { CalendarYearsProps } from './CalendarYears.types';\nimport { StyledCalendarYears, StyledFlex, StyledYear, StyledYearRoot } from './CalendarYears.styles';\n\n/**\n * Компонент годов в календаре.\n */\nexport const CalendarYears: React.FC<CalendarYearsProps> = ({\n date: currentDate,\n startYear,\n selectIndexes,\n outerRefs,\n onChangeYear,\n onSetSelected,\n onKeyDown,\n}) => {\n const [years, selected] = useYears(currentDate, startYear);\n const selectedRef = useRef(selected);\n const onSetSelectedRef = useRef(onSetSelected);\n\n const handleOnChangeYear = useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n /**\n * нужно вызвать stopImmediatePropagation для случаев, когда\n * обработчик события onClick навешивается снаружи.\n * Как, например, в компоненте Popup\n */\n event.nativeEvent.stopImmediatePropagation();\n\n const { year } = event.currentTarget.dataset;\n onChangeYear(Number(year));\n },\n [onChangeYear],\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 <StyledCalendarYears role=\"grid\" aria-labelledby=\"id-grid-label\" onKeyDown={onKeyDown}>\n {years.map((year, i) => (\n <StyledFlex role=\"row\" key={i}>\n {year.map(({ yearValue, isSelected, isCurrent }, j) => {\n const selectedClass = isSelected ? classes.selectedItem : undefined;\n const currentClass = !isSelected && isCurrent ? classes.currentItem : undefined;\n\n return (\n <StyledYearRoot\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={handleOnChangeYear}\n data-year={yearValue}\n aria-selected={isSelected}\n role=\"gridcell\"\n key={`StyledYear-${i}-${j}`}\n aria-label={String(yearValue)}\n >\n <StyledYear>{yearValue}</StyledYear>\n </StyledYearRoot>\n );\n })}\n </StyledFlex>\n ))}\n </StyledCalendarYears>\n );\n};\n"],"names":["CalendarYears","_ref","currentDate","date","startYear","selectIndexes","outerRefs","onChangeYear","onSetSelected","onKeyDown","_useYears","useYears","_useYears2","_slicedToArray","years","selected","selectedRef","useRef","onSetSelectedRef","handleOnChangeYear","useCallback","event","nativeEvent","stopImmediatePropagation","year","currentTarget","dataset","Number","getRefs","element","i","j","current","useEffect","_onSetSelectedRef$cur","call","React","createElement","StyledCalendarYears","role","map","StyledFlex","key","_ref2","yearValue","isSelected","isCurrent","selectedClass","classes","selectedItem","undefined","currentClass","currentItem","StyledYearRoot","className","cx","selectableItem","ref","tabIndex","onClick","concat","String","StyledYear"],"mappings":";;;;;;;;;;;AASA;AACA;AACA;IACaA,aAA2C,GAAG,SAA9CA,aAA2CA,CAAAC,IAAA,EAQlD;AAAA,EAAA,IAPIC,WAAW,GAAAD,IAAA,CAAjBE,IAAI;IACJC,SAAS,GAAAH,IAAA,CAATG,SAAS;IACTC,aAAa,GAAAJ,IAAA,CAAbI,aAAa;IACbC,SAAS,GAAAL,IAAA,CAATK,SAAS;IACTC,YAAY,GAAAN,IAAA,CAAZM,YAAY;IACZC,aAAa,GAAAP,IAAA,CAAbO,aAAa;IACbC,SAAS,GAAAR,IAAA,CAATQ,SAAS,CAAA;AAET,EAAA,IAAAC,SAAA,GAA0BC,iBAAQ,CAACT,WAAW,EAAEE,SAAS,CAAC;IAAAQ,UAAA,GAAAC,uCAAA,CAAAH,SAAA,EAAA,CAAA,CAAA;AAAnDI,IAAAA,KAAK,GAAAF,UAAA,CAAA,CAAA,CAAA;AAAEG,IAAAA,QAAQ,GAA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,UAAW;AAC1BN,QAAAA,IAAI,EAAC,UAAU;QACfG,GAAG,EAAA,aAAA,CAAAkB,MAAA,CAAgB9B,CAAC,OAAA8B,MAAA,CAAI7B,CAAC,CAAG;QAC5B,YAAY8B,EAAAA,MAAM,CAACjB,SAAS,CAAA;OAE5BR,eAAAA,KAAA,CAAAC,aAAA,CAACyB,+BAAU,EAAElB,IAAAA,EAAAA,SAAsB,CACvB,CAAC,CAAA;AAEzB,KAAC,CACO,CAAC,CAAA;AAAA,GAChB,CACgB,CAAC,CAAA;AAE9B;;;;"}
@@ -40,8 +40,8 @@ var chipRoot = function chipRoot(Root) {
40
40
  if (disabled || readOnly) {
41
41
  return;
42
42
  }
43
- onClick === null || onClick === void 0 ? void 0 : onClick(event);
44
- onClear === null || onClear === void 0 ? void 0 : onClear();
43
+ onClick === null || onClick === void 0 || onClick(event);
44
+ onClear === null || onClear === void 0 || onClear();
45
45
  };
46
46
  var ClearContent = React.useMemo(function () {
47
47
  return contentClearButton || /*#__PURE__*/React.createElement(Chip_styles.StyledContentClear, null, /*#__PURE__*/React.createElement(IconClose.IconClose, {
@@ -1 +1 @@
1
- {"version":3,"file":"Chip.js","sources":["../../../src/components/Chip/Chip.tsx"],"sourcesContent":["import React, { forwardRef, useMemo } from 'react';\n\nimport type { RootProps } from '../../engines';\nimport { IconClose } from '../_Icon/Icons/IconClose';\nimport { cx } from '../../utils';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { base as disabledCSS } from './variations/_disabled/base';\nimport { base as readonlyCSS } from './variations/_readonly/base';\nimport { base as focusedCSS } from './variations/_focused/base';\nimport { base as pilledCSS } from './variations/_pilled/base';\nimport type { ChipProps } from './Chip.types';\nimport { StyledContentClear, StyledContentLeft, StyledContentMain, StyledContentRight, base } from './Chip.styles';\nimport { classes, tokens } from './Chip.tokens';\n\nexport const chipRoot = (Root: RootProps<HTMLButtonElement, ChipProps>) =>\n forwardRef<HTMLButtonElement, ChipProps>((props, ref) => {\n const {\n children,\n text,\n contentLeft,\n contentRight,\n contentClearButton,\n size,\n className,\n onClear,\n onClick,\n pilled = false,\n readOnly = false,\n disabled = false,\n ...rest\n } = props;\n\n const txt = !text && typeof children === 'string' ? children : text;\n const pilledClass = pilled ? classes.pilled : undefined;\n\n const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n if (disabled || readOnly) {\n return;\n }\n\n onClick?.(event);\n onClear?.();\n };\n\n const ClearContent = useMemo(() => {\n return (\n contentClearButton || (\n <StyledContentClear>\n <IconClose sizeCustomProperty={tokens.closeIconSize} color=\"inherit\" />\n </StyledContentClear>\n )\n );\n }, [contentClearButton, tokens.closeIconSize]);\n\n return (\n <Root\n type=\"button\"\n ref={ref}\n className={cx(pilledClass, className)}\n tabIndex={readOnly ? -1 : 0}\n onClick={handleClick}\n disabled={disabled}\n pilled={pilled}\n readOnly={!disabled && readOnly}\n size={size}\n {...rest}\n >\n {contentLeft && <StyledContentLeft>{contentLeft}</StyledContentLeft>}\n {txt ? <StyledContentMain>{txt}</StyledContentMain> : children}\n {contentRight && <StyledContentRight>{contentRight}</StyledContentRight>}\n {ClearContent}\n </Root>\n );\n });\n\nexport const chipConfig = {\n name: 'Chip',\n tag: 'button',\n layout: chipRoot,\n base,\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n disabled: {\n css: disabledCSS,\n attrs: true,\n },\n readOnly: {\n css: readonlyCSS,\n attrs: true,\n },\n focused: {\n css: focusedCSS,\n },\n pilled: {\n css: pilledCSS,\n attrs: true,\n },\n },\n defaults: {\n view: 'default',\n size: 'm',\n },\n};\n"],"names":["chipRoot","Root","forwardRef","props","ref","children","text","contentLeft","contentRight","contentClearButton","size","className","onClear","onClick","_props$pilled","pilled","_props$readOnly","readOnly","_props$disabled","disabled","rest","_objectWithoutProperties","_excluded","txt","pilledClass","classes","undefined","handleClick","event","ClearContent","useMemo","React","createElement","StyledContentClear","IconClose","sizeCustomProperty","tokens","closeIconSize","color","_extends","type","cx","tabIndex","StyledContentLeft","StyledContentMain","StyledContentRight","chipConfig","name","tag","layout","base","variations","view","css","viewCSS","sizeCSS","disabledCSS","attrs","readonlyCSS","focused","focusedCSS","pilledCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;IAgBaA,QAAQ,GAAG,SAAXA,QAAQA,CAAIC,IAA6C,EAAA;AAAA,EAAA,oBAClEC,gBAAU,CAA+B,UAACC,KAAK,EAAEC,GAAG,EAAK;AACrD,IAAA,IACIC,QAAQ,GAaRF,KAAK,CAbLE,QAAQ;MACRC,IAAI,GAYJH,KAAK,CAZLG,IAAI;MACJC,WAAW,GAWXJ,KAAK,CAXLI,WAAW;MACXC,YAAY,GAUZL,KAAK,CAVLK,YAAY;MACZC,kBAAkB,GASlBN,KAAK,CATLM,kBAAkB;MAClBC,IAAI,GAQJP,KAAK,CARLO,IAAI;MACJC,SAAS,GAOTR,KAAK,CAPLQ,SAAS;MACTC,OAAO,GAMPT,KAAK,CANLS,OAAO;MACPC,OAAO,GAKPV,KAAK,CALLU,OAAO;MAAAC,aAAA,GAKPX,KAAK,CAJLY,MAAM;AAANA,MAAAA,MAAM,GAAAD,aAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,aAAA;MAAAE,eAAA,GAIdb,KAAK,CAHLc,QAAQ;AAARA,MAAAA,QAAQ,GAAAD,eAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,eAAA;MAAAE,eAAA,GAGhBf,KAAK,CAFLgB,QAAQ;AAARA,MAAAA,QAAQ,GAAAD,eAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,eAAA;AACbE,MAAAA,IAAI,GAAAC,iDAAA,CACPlB,KAAK,EAAAmB,SAAA,CAAA,CAAA;AAET,IAAA,IAAMC,GAAG,GAAG,CAACjB,IAAI,IAAI,OAAOD,QAAQ,KAAK,QAAQ,GAAGA,QAAQ,GAAGC,IAAI,CAAA;IACnE,IAAMkB,WAAW,GAAGT,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../../../src/components/Chip/Chip.tsx"],"sourcesContent":["import React, { forwardRef, useMemo } from 'react';\n\nimport type { RootProps } from '../../engines';\nimport { IconClose } from '../_Icon/Icons/IconClose';\nimport { cx } from '../../utils';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { base as disabledCSS } from './variations/_disabled/base';\nimport { base as readonlyCSS } from './variations/_readonly/base';\nimport { base as focusedCSS } from './variations/_focused/base';\nimport { base as pilledCSS } from './variations/_pilled/base';\nimport type { ChipProps } from './Chip.types';\nimport { StyledContentClear, StyledContentLeft, StyledContentMain, StyledContentRight, base } from './Chip.styles';\nimport { classes, tokens } from './Chip.tokens';\n\nexport const chipRoot = (Root: RootProps<HTMLButtonElement, ChipProps>) =>\n forwardRef<HTMLButtonElement, ChipProps>((props, ref) => {\n const {\n children,\n text,\n contentLeft,\n contentRight,\n contentClearButton,\n size,\n className,\n onClear,\n onClick,\n pilled = false,\n readOnly = false,\n disabled = false,\n ...rest\n } = props;\n\n const txt = !text && typeof children === 'string' ? children : text;\n const pilledClass = pilled ? classes.pilled : undefined;\n\n const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n if (disabled || readOnly) {\n return;\n }\n\n onClick?.(event);\n onClear?.();\n };\n\n const ClearContent = useMemo(() => {\n return (\n contentClearButton || (\n <StyledContentClear>\n <IconClose sizeCustomProperty={tokens.closeIconSize} color=\"inherit\" />\n </StyledContentClear>\n )\n );\n }, [contentClearButton, tokens.closeIconSize]);\n\n return (\n <Root\n type=\"button\"\n ref={ref}\n className={cx(pilledClass, className)}\n tabIndex={readOnly ? -1 : 0}\n onClick={handleClick}\n disabled={disabled}\n pilled={pilled}\n readOnly={!disabled && readOnly}\n size={size}\n {...rest}\n >\n {contentLeft && <StyledContentLeft>{contentLeft}</StyledContentLeft>}\n {txt ? <StyledContentMain>{txt}</StyledContentMain> : children}\n {contentRight && <StyledContentRight>{contentRight}</StyledContentRight>}\n {ClearContent}\n </Root>\n );\n });\n\nexport const chipConfig = {\n name: 'Chip',\n tag: 'button',\n layout: chipRoot,\n base,\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n disabled: {\n css: disabledCSS,\n attrs: true,\n },\n readOnly: {\n css: readonlyCSS,\n attrs: true,\n },\n focused: {\n css: focusedCSS,\n },\n pilled: {\n css: pilledCSS,\n attrs: true,\n },\n },\n defaults: {\n view: 'default',\n size: 'm',\n },\n};\n"],"names":["chipRoot","Root","forwardRef","props","ref","children","text","contentLeft","contentRight","contentClearButton","size","className","onClear","onClick","_props$pilled","pilled","_props$readOnly","readOnly","_props$disabled","disabled","rest","_objectWithoutProperties","_excluded","txt","pilledClass","classes","undefined","handleClick","event","ClearContent","useMemo","React","createElement","StyledContentClear","IconClose","sizeCustomProperty","tokens","closeIconSize","color","_extends","type","cx","tabIndex","StyledContentLeft","StyledContentMain","StyledContentRight","chipConfig","name","tag","layout","base","variations","view","css","viewCSS","sizeCSS","disabledCSS","attrs","readonlyCSS","focused","focusedCSS","pilledCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;IAgBaA,QAAQ,GAAG,SAAXA,QAAQA,CAAIC,IAA6C,EAAA;AAAA,EAAA,oBAClEC,gBAAU,CAA+B,UAACC,KAAK,EAAEC,GAAG,EAAK;AACrD,IAAA,IACIC,QAAQ,GAaRF,KAAK,CAbLE,QAAQ;MACRC,IAAI,GAYJH,KAAK,CAZLG,IAAI;MACJC,WAAW,GAWXJ,KAAK,CAXLI,WAAW;MACXC,YAAY,GAUZL,KAAK,CAVLK,YAAY;MACZC,kBAAkB,GASlBN,KAAK,CATLM,kBAAkB;MAClBC,IAAI,GAQJP,KAAK,CARLO,IAAI;MACJC,SAAS,GAOTR,KAAK,CAPLQ,SAAS;MACTC,OAAO,GAMPT,KAAK,CANLS,OAAO;MACPC,OAAO,GAKPV,KAAK,CALLU,OAAO;MAAAC,aAAA,GAKPX,KAAK,CAJLY,MAAM;AAANA,MAAAA,MAAM,GAAA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