@consta/uikit 4.7.1 → 4.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (335) hide show
  1. package/__internal__/src/components/Attach/Attach.d.ts +1 -16
  2. package/__internal__/src/components/Attachment/Attachment.css +1 -1
  3. package/__internal__/src/components/Attachment/Attachment.d.ts +2 -18
  4. package/__internal__/src/components/Attachment/Attachment.js +1 -1
  5. package/__internal__/src/components/Attachment/Attachment.js.map +1 -1
  6. package/__internal__/src/components/Attachment/index.d.ts +1 -0
  7. package/__internal__/src/components/Attachment/index.js +1 -1
  8. package/__internal__/src/components/Attachment/index.js.map +1 -1
  9. package/__internal__/src/components/Attachment/types.d.ts +21 -0
  10. package/__internal__/src/components/Attachment/types.js +2 -0
  11. package/__internal__/src/components/Attachment/types.js.map +1 -0
  12. package/__internal__/src/components/AutoCompleteCanary/helpers.d.ts +1 -1
  13. package/__internal__/src/components/AvatarGroup/AvatarGroup.css +1 -1
  14. package/__internal__/src/components/AvatarGroup/AvatarGroup.js +1 -1
  15. package/__internal__/src/components/AvatarGroup/AvatarGroup.js.map +1 -1
  16. package/__internal__/src/components/AvatarGroup/helpers.d.ts +44 -44
  17. package/__internal__/src/components/AvatarGroup/types.d.ts +1 -1
  18. package/__internal__/src/components/AvatarGroup/types.js.map +1 -1
  19. package/__internal__/src/components/Breadcrumbs/BreadcrumbsFitModeDropdown/BreadcrumbsFitModeDropdown.js +1 -1
  20. package/__internal__/src/components/Breadcrumbs/BreadcrumbsFitModeDropdown/BreadcrumbsFitModeDropdown.js.map +1 -1
  21. package/__internal__/src/components/Breadcrumbs/helpers.d.ts +43 -43
  22. package/__internal__/src/components/Breadcrumbs/useElements.d.ts +4 -6
  23. package/__internal__/src/components/Breadcrumbs/useElements.js +1 -1
  24. package/__internal__/src/components/Breadcrumbs/useElements.js.map +1 -1
  25. package/__internal__/src/components/CalendarDeprecated/CalendarDay/CalendarDay.d.ts +1 -1
  26. package/__internal__/src/components/CheckboxGroup/helper.d.ts +42 -42
  27. package/__internal__/src/components/ChoiceGroup/helper.d.ts +44 -44
  28. package/__internal__/src/components/CollapseGroup/helpers.d.ts +6 -6
  29. package/__internal__/src/components/Combobox/helpers.d.ts +2 -2
  30. package/__internal__/src/components/ContextMenu/ContextMenu.d.ts +0 -1
  31. package/__internal__/src/components/ContextMenu/ContextMenu.js +1 -1
  32. package/__internal__/src/components/ContextMenu/ContextMenu.js.map +1 -1
  33. package/__internal__/src/components/ContextMenu/ContextMenuLevel/ContextMenuLevel.css +1 -1
  34. package/__internal__/src/components/ContextMenu/ContextMenuLevel/ContextMenuLevel.js +1 -1
  35. package/__internal__/src/components/ContextMenu/ContextMenuLevel/ContextMenuLevel.js.map +1 -1
  36. package/__internal__/src/components/ContextMenu/ContextMenuLevelWrapper/ContextMenuLevelWrapper.css +1 -0
  37. package/__internal__/src/components/ContextMenu/ContextMenuLevelWrapper/ContextMenuLevelWrapper.d.ts +4 -0
  38. package/__internal__/src/components/ContextMenu/ContextMenuLevelWrapper/ContextMenuLevelWrapper.js +2 -0
  39. package/__internal__/src/components/ContextMenu/ContextMenuLevelWrapper/ContextMenuLevelWrapper.js.map +1 -0
  40. package/__internal__/src/components/ContextMenu/ContextMenuLevelWrapper/index.d.ts +1 -0
  41. package/__internal__/src/components/ContextMenu/ContextMenuLevelWrapper/index.js +2 -0
  42. package/__internal__/src/components/ContextMenu/ContextMenuLevelWrapper/index.js.map +1 -0
  43. package/__internal__/src/components/ContextMenu/ContextMenuLevels/ContextMenuLevels.d.ts +2 -2
  44. package/__internal__/src/components/ContextMenu/ContextMenuLevels/ContextMenuLevels.js +1 -1
  45. package/__internal__/src/components/ContextMenu/ContextMenuLevels/ContextMenuLevels.js.map +1 -1
  46. package/__internal__/src/components/ContextMenu/ContextMenuLevels/useSize.d.ts +2 -0
  47. package/__internal__/src/components/ContextMenu/ContextMenuLevels/useSize.js +2 -0
  48. package/__internal__/src/components/ContextMenu/ContextMenuLevels/useSize.js.map +1 -0
  49. package/__internal__/src/components/ContextMenu/ContextMenuWrapper/ContextMenuWrapper.css +1 -0
  50. package/__internal__/src/components/ContextMenu/ContextMenuWrapper/ContextMenuWrapper.d.ts +3 -0
  51. package/__internal__/src/components/ContextMenu/ContextMenuWrapper/ContextMenuWrapper.js +2 -0
  52. package/__internal__/src/components/ContextMenu/ContextMenuWrapper/ContextMenuWrapper.js.map +1 -0
  53. package/__internal__/src/components/ContextMenu/ContextMenuWrapper/index.d.ts +1 -0
  54. package/__internal__/src/components/ContextMenu/ContextMenuWrapper/index.js +2 -0
  55. package/__internal__/src/components/ContextMenu/ContextMenuWrapper/index.js.map +1 -0
  56. package/__internal__/src/components/ContextMenu/helpers.d.ts +16 -17
  57. package/__internal__/src/components/ContextMenu/helpers.js +1 -1
  58. package/__internal__/src/components/ContextMenu/helpers.js.map +1 -1
  59. package/__internal__/src/components/ContextMenu/types.d.ts +52 -3
  60. package/__internal__/src/components/ContextMenu/types.js.map +1 -1
  61. package/__internal__/src/components/ContextMenuDeprecated/ContextMenuDivider/ContextMenuDivider.css +1 -1
  62. package/__internal__/src/components/ContextMenuDeprecated/ContextMenuDivider/ContextMenuDivider.js +1 -1
  63. package/__internal__/src/components/ContextMenuDeprecated/ContextMenuDivider/ContextMenuDivider.js.map +1 -1
  64. package/__internal__/src/components/ContextMenuDeprecated/ContextMenuGroupHeader/ContextMenuGroupHeader.css +1 -1
  65. package/__internal__/src/components/ContextMenuDeprecated/ContextMenuGroupHeader/ContextMenuGroupHeader.js +1 -1
  66. package/__internal__/src/components/ContextMenuDeprecated/ContextMenuGroupHeader/ContextMenuGroupHeader.js.map +1 -1
  67. package/__internal__/src/components/ContextMenuDeprecated/ContextMenuLevel/ContextMenuLevel.css +1 -1
  68. package/__internal__/src/components/ContextMenuDeprecated/ContextMenuLevel/ContextMenuLevel.js +1 -1
  69. package/__internal__/src/components/ContextMenuDeprecated/ContextMenuLevel/ContextMenuLevel.js.map +1 -1
  70. package/__internal__/src/components/DatePicker/DatePickerFieldTypeDate/DatePickerFieldTypeDate.d.ts +3 -3
  71. package/__internal__/src/components/DatePicker/DatePickerFieldTypeDateRange/DatePickerFieldTypeDateRange.d.ts +1 -1
  72. package/__internal__/src/components/DatePicker/DatePickerFieldTypeDateTime/DatePickerFieldTypeDateTime.d.ts +3 -3
  73. package/__internal__/src/components/DatePicker/DatePickerFieldTypeDateTimeRange/DatePickerFieldTypeDateTimeRange.d.ts +1 -1
  74. package/__internal__/src/components/DatePicker/DatePickerFieldTypeMonth/DatePickerFieldTypeMonth.d.ts +3 -3
  75. package/__internal__/src/components/DatePicker/DatePickerFieldTypeMonthRange/DatePickerFieldTypeMonthRange.d.ts +1 -1
  76. package/__internal__/src/components/DatePicker/DatePickerFieldTypeTime/DatePickerFieldTypeTime.d.ts +3 -3
  77. package/__internal__/src/components/DatePicker/DatePickerFieldTypeYear/DatePickerFieldTypeYear.d.ts +3 -3
  78. package/__internal__/src/components/DatePicker/DatePickerFieldTypeYearRange/DatePickerFieldTypeYearRange.d.ts +1 -1
  79. package/__internal__/src/components/DateTime/DateTimeItem/DateTimeItem.d.ts +1 -1
  80. package/__internal__/src/components/DragNDropField/DragNDropField.d.ts +1 -1
  81. package/__internal__/src/components/EventInterceptor/propsHandlers/useCheckboxEventsHandler.d.ts +2 -2
  82. package/__internal__/src/components/EventInterceptor/propsHandlers/useTextFieldEventsHandler.d.ts +3 -3
  83. package/__internal__/src/components/FieldGroup/FieldGroup.d.ts +1 -1
  84. package/__internal__/src/components/Header/Login/HeaderLogin.d.ts +1 -1
  85. package/__internal__/src/components/ListCanary/ListAddItem/ListAddItem.d.ts +1 -1
  86. package/__internal__/src/components/ListCanary/ListBox/ListBox.d.ts +1 -1
  87. package/__internal__/src/components/ListCanary/ListDivider/ListDivider.d.ts +1 -1
  88. package/__internal__/src/components/ListCanary/ListGroupLabel/ListGroupLabel.d.ts +1 -1
  89. package/__internal__/src/components/ListCanary/ListItem/ListItem.css +1 -1
  90. package/__internal__/src/components/ListCanary/ListLoader/ListLoader.d.ts +1 -1
  91. package/__internal__/src/components/ListCanary/helper.d.ts +1 -1
  92. package/__internal__/src/components/Popover/Popover.d.ts +1 -1
  93. package/__internal__/src/components/ProgressLine/helpers.d.ts +43 -43
  94. package/__internal__/src/components/ProgressStepBar/helpers.d.ts +2 -2
  95. package/__internal__/src/components/RadioGroup/helper.d.ts +42 -42
  96. package/__internal__/src/components/Responses/Responses.d.ts +1 -1
  97. package/__internal__/src/components/Select/helpers.d.ts +2 -2
  98. package/__internal__/src/components/SelectComponents/SelectContainer/SelectContainer.d.ts +1 -1
  99. package/__internal__/src/components/SnackBar/helper.d.ts +42 -42
  100. package/__internal__/src/components/Steps/helper.d.ts +41 -41
  101. package/__internal__/src/components/SwitchGroup/helpers.d.ts +41 -41
  102. package/__internal__/src/components/Table/Table.js +1 -1
  103. package/__internal__/src/components/Table/Table.js.map +1 -1
  104. package/__internal__/src/components/Tabs/helpers.d.ts +74 -74
  105. package/__internal__/src/components/TagBase/TagBase.d.ts +1 -1
  106. package/__internal__/src/components/ThemeToggler/helpers.d.ts +42 -42
  107. package/__internal__/src/components/Timer/Timer.d.ts +1 -1
  108. package/__internal__/src/components/Tooltip/Tooltip.d.ts +1 -1
  109. package/__internal__/src/components/UserSelect/helpers.d.ts +2 -2
  110. package/__internal__/src/fileIcons/FileIcon/FileIcon.d.ts +1 -1
  111. package/__internal__/src/hooks/useBreakpoints/useBreakpoints.d.ts +1 -1
  112. package/__internal__/src/hooks/useComponentSize/useComponentSize.d.ts +2 -2
  113. package/__internal__/src/hooks/useComponentSize/useComponentSize.js +1 -1
  114. package/__internal__/src/hooks/useComponentSize/useComponentSize.js.map +1 -1
  115. package/__internal__/src/hooks/useHideElementsInLineCanary/helpers/getHiddenCount.d.ts +1 -0
  116. package/__internal__/src/hooks/useHideElementsInLineCanary/helpers/getHiddenCount.js +2 -0
  117. package/__internal__/src/hooks/useHideElementsInLineCanary/helpers/getHiddenCount.js.map +1 -0
  118. package/__internal__/src/hooks/useHideElementsInLineCanary/index.d.ts +2 -0
  119. package/__internal__/src/hooks/useHideElementsInLineCanary/index.js +2 -0
  120. package/__internal__/src/hooks/useHideElementsInLineCanary/index.js.map +1 -0
  121. package/__internal__/src/hooks/useHideElementsInLineCanary/useHideElementsInLineCanary.d.ts +8 -0
  122. package/__internal__/src/hooks/useHideElementsInLineCanary/useHideElementsInLineCanary.js +2 -0
  123. package/__internal__/src/hooks/useHideElementsInLineCanary/useHideElementsInLineCanary.js.map +1 -0
  124. package/__internal__/src/icons/IconAdd/IconAdd.d.ts +1 -1
  125. package/__internal__/src/icons/IconAddToComparison/IconAddToComparison.d.ts +1 -1
  126. package/__internal__/src/icons/IconAlert/IconAlert.d.ts +1 -1
  127. package/__internal__/src/icons/IconAlignBlocksLeft/IconAlignBlocksLeft.d.ts +1 -1
  128. package/__internal__/src/icons/IconAlignBlocksRight/IconAlignBlocksRight.d.ts +1 -1
  129. package/__internal__/src/icons/IconAlignCenter/IconAlignCenter.d.ts +1 -1
  130. package/__internal__/src/icons/IconAlignJustify/IconAlignJustify.d.ts +1 -1
  131. package/__internal__/src/icons/IconAlignLeft/IconAlignLeft.d.ts +1 -1
  132. package/__internal__/src/icons/IconAlignRight/IconAlignRight.d.ts +1 -1
  133. package/__internal__/src/icons/IconAllDone/IconAllDone.d.ts +1 -1
  134. package/__internal__/src/icons/IconArrowDown/IconArrowDown.d.ts +1 -1
  135. package/__internal__/src/icons/IconArrowLeft/IconArrowLeft.d.ts +1 -1
  136. package/__internal__/src/icons/IconArrowRight/IconArrowRight.d.ts +1 -1
  137. package/__internal__/src/icons/IconArrowUp/IconArrowUp.d.ts +1 -1
  138. package/__internal__/src/icons/IconArtBrush/IconArtBrush.d.ts +1 -1
  139. package/__internal__/src/icons/IconAttach/IconAttach.d.ts +1 -1
  140. package/__internal__/src/icons/IconAxesRotate/IconAxesRotate.d.ts +1 -1
  141. package/__internal__/src/icons/IconBackward/IconBackward.d.ts +1 -1
  142. package/__internal__/src/icons/IconBag/IconBag.d.ts +1 -1
  143. package/__internal__/src/icons/IconBarrier/IconBarrier.d.ts +1 -1
  144. package/__internal__/src/icons/IconBento/IconBento.d.ts +1 -1
  145. package/__internal__/src/icons/IconBit/IconBit.d.ts +1 -1
  146. package/__internal__/src/icons/IconBold/IconBold.d.ts +1 -1
  147. package/__internal__/src/icons/IconBook/IconBook.d.ts +1 -1
  148. package/__internal__/src/icons/IconBookmarkFilled/IconBookmarkFilled.d.ts +1 -1
  149. package/__internal__/src/icons/IconBookmarkStroked/IconBookmarkStroked.d.ts +1 -1
  150. package/__internal__/src/icons/IconCalculator/IconCalculator.d.ts +1 -1
  151. package/__internal__/src/icons/IconCalendar/IconCalendar.d.ts +1 -1
  152. package/__internal__/src/icons/IconCamera/IconCamera.d.ts +1 -1
  153. package/__internal__/src/icons/IconCancel/IconCancel.d.ts +1 -1
  154. package/__internal__/src/icons/IconCards/IconCards.d.ts +1 -1
  155. package/__internal__/src/icons/IconChatFilled/IconChatFilled.d.ts +1 -1
  156. package/__internal__/src/icons/IconChatStroked/IconChatStroked.d.ts +1 -1
  157. package/__internal__/src/icons/IconCheck/IconCheck.d.ts +1 -1
  158. package/__internal__/src/icons/IconClose/IconClose.d.ts +1 -1
  159. package/__internal__/src/icons/IconCollapse/IconCollapse.d.ts +1 -1
  160. package/__internal__/src/icons/IconColorFill/IconColorFill.d.ts +1 -1
  161. package/__internal__/src/icons/IconColorText/IconColorText.d.ts +1 -1
  162. package/__internal__/src/icons/IconColumns/IconColumns.d.ts +1 -1
  163. package/__internal__/src/icons/IconCommentFilled/IconCommentFilled.d.ts +1 -1
  164. package/__internal__/src/icons/IconCommentStroked/IconCommentStroked.d.ts +1 -1
  165. package/__internal__/src/icons/IconConnection/IconConnection.d.ts +1 -1
  166. package/__internal__/src/icons/IconCopy/IconCopy.d.ts +1 -1
  167. package/__internal__/src/icons/IconCrown/IconCrown.d.ts +1 -1
  168. package/__internal__/src/icons/IconCursorMouse/IconCursorMouse.d.ts +1 -1
  169. package/__internal__/src/icons/IconDataNull/IconDataNull.d.ts +1 -1
  170. package/__internal__/src/icons/IconDiamond/IconDiamond.d.ts +1 -1
  171. package/__internal__/src/icons/IconDinosaur/IconDinosaur.d.ts +1 -1
  172. package/__internal__/src/icons/IconDisconnection/IconDisconnection.d.ts +1 -1
  173. package/__internal__/src/icons/IconDocAdd/IconDocAdd.d.ts +1 -1
  174. package/__internal__/src/icons/IconDocBlank/IconDocBlank.d.ts +1 -1
  175. package/__internal__/src/icons/IconDocDelete/IconDocDelete.d.ts +1 -1
  176. package/__internal__/src/icons/IconDocExport/IconDocExport.d.ts +1 -1
  177. package/__internal__/src/icons/IconDocFilled/IconDocFilled.d.ts +1 -1
  178. package/__internal__/src/icons/IconDown/IconDown.d.ts +1 -1
  179. package/__internal__/src/icons/IconDownload/IconDownload.d.ts +1 -1
  180. package/__internal__/src/icons/IconDrag/IconDrag.d.ts +1 -1
  181. package/__internal__/src/icons/IconDraggable/IconDraggable.d.ts +1 -1
  182. package/__internal__/src/icons/IconDrillingPartLeftFilled/IconDrillingPartLeftFilled.d.ts +1 -1
  183. package/__internal__/src/icons/IconDrillingPartLeftStroked/IconDrillingPartLeftStroked.d.ts +1 -1
  184. package/__internal__/src/icons/IconDrillingPartRightFilled/IconDrillingPartRightFilled.d.ts +1 -1
  185. package/__internal__/src/icons/IconDrillingPartRightStroked/IconDrillingPartRightStroked.d.ts +1 -1
  186. package/__internal__/src/icons/IconDrillingRig/IconDrillingRig.d.ts +1 -1
  187. package/__internal__/src/icons/IconDrop/IconDrop.d.ts +1 -1
  188. package/__internal__/src/icons/IconEdit/IconEdit.d.ts +1 -1
  189. package/__internal__/src/icons/IconExit/IconExit.d.ts +1 -1
  190. package/__internal__/src/icons/IconExpand/IconExpand.d.ts +1 -1
  191. package/__internal__/src/icons/IconEye/IconEye.d.ts +1 -1
  192. package/__internal__/src/icons/IconEyeClose/IconEyeClose.d.ts +1 -1
  193. package/__internal__/src/icons/IconFavorite/IconFavorite.d.ts +1 -1
  194. package/__internal__/src/icons/IconFilter/IconFilter.d.ts +1 -1
  195. package/__internal__/src/icons/IconFishboneFilled/IconFishboneFilled.d.ts +1 -1
  196. package/__internal__/src/icons/IconFishboneStroked/IconFishboneStroked.d.ts +1 -1
  197. package/__internal__/src/icons/IconFitToDefault/IconFitToDefault.d.ts +1 -1
  198. package/__internal__/src/icons/IconFlagFilled/IconFlagFilled.d.ts +1 -1
  199. package/__internal__/src/icons/IconFlagStroked/IconFlagStroked.d.ts +1 -1
  200. package/__internal__/src/icons/IconFolders/IconFolders.d.ts +1 -1
  201. package/__internal__/src/icons/IconForward/IconForward.d.ts +1 -1
  202. package/__internal__/src/icons/IconFunnel/IconFunnel.d.ts +1 -1
  203. package/__internal__/src/icons/IconGas/IconGas.d.ts +1 -1
  204. package/__internal__/src/icons/IconGeo/IconGeo.d.ts +1 -1
  205. package/__internal__/src/icons/IconGradients/IconGradients.d.ts +1 -1
  206. package/__internal__/src/icons/IconGrouping/IconGrouping.d.ts +1 -1
  207. package/__internal__/src/icons/IconHamburger/IconHamburger.d.ts +1 -1
  208. package/__internal__/src/icons/IconHand/IconHand.d.ts +1 -1
  209. package/__internal__/src/icons/IconHealth/IconHealth.d.ts +1 -1
  210. package/__internal__/src/icons/IconHome/IconHome.d.ts +1 -1
  211. package/__internal__/src/icons/IconInComparison/IconInComparison.d.ts +1 -1
  212. package/__internal__/src/icons/IconIncident/IconIncident.d.ts +1 -1
  213. package/__internal__/src/icons/IconInfo/IconInfo.d.ts +1 -1
  214. package/__internal__/src/icons/IconIntroduction/IconIntroduction.d.ts +1 -1
  215. package/__internal__/src/icons/IconIpad/IconIpad.d.ts +1 -1
  216. package/__internal__/src/icons/IconItalic/IconItalic.d.ts +1 -1
  217. package/__internal__/src/icons/IconKebab/IconKebab.d.ts +1 -1
  218. package/__internal__/src/icons/IconKernFilled/IconKernFilled.d.ts +1 -1
  219. package/__internal__/src/icons/IconKernStroked/IconKernStroked.d.ts +1 -1
  220. package/__internal__/src/icons/IconLaptop/IconLaptop.d.ts +1 -1
  221. package/__internal__/src/icons/IconLayers/IconLayers.d.ts +1 -1
  222. package/__internal__/src/icons/IconLeaf/IconLeaf.d.ts +1 -1
  223. package/__internal__/src/icons/IconLightningBolt/IconLightningBolt.d.ts +1 -1
  224. package/__internal__/src/icons/IconLineAndBarChart/IconLineAndBarChart.d.ts +1 -1
  225. package/__internal__/src/icons/IconLink/IconLink.d.ts +1 -1
  226. package/__internal__/src/icons/IconList/IconList.d.ts +1 -1
  227. package/__internal__/src/icons/IconListNumbered/IconListNumbered.d.ts +1 -1
  228. package/__internal__/src/icons/IconLithologyFilled/IconLithologyFilled.d.ts +1 -1
  229. package/__internal__/src/icons/IconLithologyStroked/IconLithologyStroked.d.ts +1 -1
  230. package/__internal__/src/icons/IconLock/IconLock.d.ts +1 -1
  231. package/__internal__/src/icons/IconLogicalElement/IconLogicalElement.d.ts +1 -1
  232. package/__internal__/src/icons/IconMBU/IconMBU.d.ts +1 -1
  233. package/__internal__/src/icons/IconMGRP/IconMGRP.d.ts +1 -1
  234. package/__internal__/src/icons/IconMLSP/IconMLSP.d.ts +1 -1
  235. package/__internal__/src/icons/IconMMP/IconMMP.d.ts +1 -1
  236. package/__internal__/src/icons/IconMail/IconMail.d.ts +1 -1
  237. package/__internal__/src/icons/IconMap/IconMap.d.ts +1 -1
  238. package/__internal__/src/icons/IconMaxHeight/IconMaxHeight.d.ts +1 -1
  239. package/__internal__/src/icons/IconMaxWidth/IconMaxWidth.d.ts +1 -1
  240. package/__internal__/src/icons/IconMeatball/IconMeatball.d.ts +1 -1
  241. package/__internal__/src/icons/IconMic/IconMic.d.ts +1 -1
  242. package/__internal__/src/icons/IconMolecules/IconMolecules.d.ts +1 -1
  243. package/__internal__/src/icons/IconMoon/IconMoon.d.ts +1 -1
  244. package/__internal__/src/icons/IconNodeEnd/IconNodeEnd.d.ts +1 -1
  245. package/__internal__/src/icons/IconNodeStart/IconNodeStart.d.ts +1 -1
  246. package/__internal__/src/icons/IconNodeStep/IconNodeStep.d.ts +1 -1
  247. package/__internal__/src/icons/IconNodes/IconNodes.d.ts +1 -1
  248. package/__internal__/src/icons/IconOilBarrel/IconOilBarrel.d.ts +1 -1
  249. package/__internal__/src/icons/IconOpenInNew/IconOpenInNew.d.ts +1 -1
  250. package/__internal__/src/icons/IconOperators/IconOperators.d.ts +1 -1
  251. package/__internal__/src/icons/IconPanelBottom/IconPanelBottom.d.ts +1 -1
  252. package/__internal__/src/icons/IconPanelLeft/IconPanelLeft.d.ts +1 -1
  253. package/__internal__/src/icons/IconPanelRight/IconPanelRight.d.ts +1 -1
  254. package/__internal__/src/icons/IconPanelTop/IconPanelTop.d.ts +1 -1
  255. package/__internal__/src/icons/IconPaste/IconPaste.d.ts +1 -1
  256. package/__internal__/src/icons/IconPause/IconPause.d.ts +1 -1
  257. package/__internal__/src/icons/IconPhone/IconPhone.d.ts +1 -1
  258. package/__internal__/src/icons/IconPhoto/IconPhoto.d.ts +1 -1
  259. package/__internal__/src/icons/IconPicture/IconPicture.d.ts +1 -1
  260. package/__internal__/src/icons/IconPlay/IconPlay.d.ts +1 -1
  261. package/__internal__/src/icons/IconPressureFilled/IconPressureFilled.d.ts +1 -1
  262. package/__internal__/src/icons/IconPressureStroked/IconPressureStroked.d.ts +1 -1
  263. package/__internal__/src/icons/IconPriceLabel/IconPriceLabel.d.ts +1 -1
  264. package/__internal__/src/icons/IconProcessing/IconProcessing.d.ts +1 -1
  265. package/__internal__/src/icons/IconQuestion/IconQuestion.d.ts +1 -1
  266. package/__internal__/src/icons/IconQuote/IconQuote.d.ts +1 -1
  267. package/__internal__/src/icons/IconRUO/IconRUO.d.ts +1 -1
  268. package/__internal__/src/icons/IconRUS/IconRUS.d.ts +1 -1
  269. package/__internal__/src/icons/IconRecord/IconRecord.d.ts +1 -1
  270. package/__internal__/src/icons/IconRemove/IconRemove.d.ts +1 -1
  271. package/__internal__/src/icons/IconRemoveFromComparison/IconRemoveFromComparison.d.ts +1 -1
  272. package/__internal__/src/icons/IconReply/IconReply.d.ts +1 -1
  273. package/__internal__/src/icons/IconResize/IconResize.d.ts +1 -1
  274. package/__internal__/src/icons/IconRestart/IconRestart.d.ts +1 -1
  275. package/__internal__/src/icons/IconRevert/IconRevert.d.ts +1 -1
  276. package/__internal__/src/icons/IconRing/IconRing.d.ts +1 -1
  277. package/__internal__/src/icons/IconRouble/IconRouble.d.ts +1 -1
  278. package/__internal__/src/icons/IconRuler/IconRuler.d.ts +1 -1
  279. package/__internal__/src/icons/IconSave/IconSave.d.ts +1 -1
  280. package/__internal__/src/icons/IconScreen/IconScreen.d.ts +1 -1
  281. package/__internal__/src/icons/IconSearch/IconSearch.d.ts +1 -1
  282. package/__internal__/src/icons/IconSelect/IconSelect.d.ts +1 -1
  283. package/__internal__/src/icons/IconSelectOpen/IconSelectOpen.d.ts +1 -1
  284. package/__internal__/src/icons/IconSendMessage/IconSendMessage.d.ts +1 -1
  285. package/__internal__/src/icons/IconSettings/IconSettings.d.ts +1 -1
  286. package/__internal__/src/icons/IconShape/IconShape.d.ts +1 -1
  287. package/__internal__/src/icons/IconShuffle/IconShuffle.d.ts +1 -1
  288. package/__internal__/src/icons/IconSmile/IconSmile.d.ts +1 -1
  289. package/__internal__/src/icons/IconSnowflake/IconSnowflake.d.ts +1 -1
  290. package/__internal__/src/icons/IconSortDown/IconSortDown.d.ts +1 -1
  291. package/__internal__/src/icons/IconSortDownCenter/IconSortDownCenter.d.ts +1 -1
  292. package/__internal__/src/icons/IconSortUp/IconSortUp.d.ts +1 -1
  293. package/__internal__/src/icons/IconSortUpCenter/IconSortUpCenter.d.ts +1 -1
  294. package/__internal__/src/icons/IconSpeed/IconSpeed.d.ts +1 -1
  295. package/__internal__/src/icons/IconStop/IconStop.d.ts +1 -1
  296. package/__internal__/src/icons/IconStorage/IconStorage.d.ts +1 -1
  297. package/__internal__/src/icons/IconStrikethrough/IconStrikethrough.d.ts +1 -1
  298. package/__internal__/src/icons/IconString/IconString.d.ts +1 -1
  299. package/__internal__/src/icons/IconSun/IconSun.d.ts +1 -1
  300. package/__internal__/src/icons/IconTable/IconTable.d.ts +1 -1
  301. package/__internal__/src/icons/IconTable2/IconTable2.d.ts +1 -1
  302. package/__internal__/src/icons/IconTarget/IconTarget.d.ts +1 -1
  303. package/__internal__/src/icons/IconTeam/IconTeam.d.ts +1 -1
  304. package/__internal__/src/icons/IconTechResponse/IconTechResponse.d.ts +1 -1
  305. package/__internal__/src/icons/IconTest/IconTest.d.ts +1 -1
  306. package/__internal__/src/icons/IconThumbUp/IconThumbUp.d.ts +1 -1
  307. package/__internal__/src/icons/IconTie/IconTie.d.ts +1 -1
  308. package/__internal__/src/icons/IconTop/IconTop.d.ts +1 -1
  309. package/__internal__/src/icons/IconTrajectory/IconTrajectory.d.ts +1 -1
  310. package/__internal__/src/icons/IconTrash/IconTrash.d.ts +1 -1
  311. package/__internal__/src/icons/IconType/IconType.d.ts +1 -1
  312. package/__internal__/src/icons/IconUnderline/IconUnderline.d.ts +1 -1
  313. package/__internal__/src/icons/IconUnlock/IconUnlock.d.ts +1 -1
  314. package/__internal__/src/icons/IconUnsort/IconUnsort.d.ts +1 -1
  315. package/__internal__/src/icons/IconUnsortCenter/IconUnsortCenter.d.ts +1 -1
  316. package/__internal__/src/icons/IconUpload/IconUpload.d.ts +1 -1
  317. package/__internal__/src/icons/IconUser/IconUser.d.ts +1 -1
  318. package/__internal__/src/icons/IconVZD/IconVZD.d.ts +1 -1
  319. package/__internal__/src/icons/IconVideo/IconVideo.d.ts +1 -1
  320. package/__internal__/src/icons/IconWarning/IconWarning.d.ts +1 -1
  321. package/__internal__/src/icons/IconWatch/IconWatch.d.ts +1 -1
  322. package/__internal__/src/icons/IconWellOpen/IconWellOpen.d.ts +1 -1
  323. package/__internal__/src/icons/IconWellPipe/IconWellPipe.d.ts +1 -1
  324. package/__internal__/src/icons/IconWideScreen/IconWideScreen.d.ts +1 -1
  325. package/__internal__/src/icons/IconWorldFilled/IconWorldFilled.d.ts +1 -1
  326. package/__internal__/src/icons/IconWorldStroked/IconWorldStroked.d.ts +1 -1
  327. package/__internal__/src/icons/IconWrench/IconWrench.d.ts +1 -1
  328. package/__internal__/src/icons/IconYandexDzen/IconYandexDzen.d.ts +1 -1
  329. package/__internal__/src/icons/IconYoutube/IconYoutube.d.ts +1 -1
  330. package/__internal__/src/icons/createIcon/createIcon.d.ts +1 -1
  331. package/__internal__/src/mixs/MixPopoverAnimate/MixPopoverAnimate.css +1 -1
  332. package/package.json +2 -2
  333. package/useHideElementsInLineCanary/index.d.ts +1 -0
  334. package/useHideElementsInLineCanary/index.js +1 -0
  335. package/__internal__/src/components/ContextMenu/ContextMenu.css +0 -1
@@ -0,0 +1,2 @@
1
+ import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["isMobile","children","className","size"];import"./ContextMenuLevelWrapper.css";import React,{forwardRef}from"react";import{mapVerticalSpase}from"../../ListCanary";import{Popover}from"../../Popover";import{cnMixSpace}from"../../../mixs/MixSpace";import{cn}from"../../../utils/bem";import{contextMenuDefaultSize}from"../types";var cnContextMenuLevelWrapper=cn("ContextMenuLevelWrapper");export var ContextMenuLevelWrapper=forwardRef(function(a,b){var c=a.isMobile,d=a.children,e=a.className,f=a.size,g=void 0===f?contextMenuDefaultSize:f,h=_objectWithoutProperties(a,_excluded);return c?React.createElement("div",{className:e},React.createElement("div",{className:cnContextMenuLevelWrapper("Mobile",[cnMixSpace({pV:mapVerticalSpase[g]})]),ref:b},d)):React.createElement(Popover,Object.assign({},h,{ref:b,className:e}),d)});
2
+ //# sourceMappingURL=ContextMenuLevelWrapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContextMenuLevelWrapper.js","names":["React","forwardRef","mapVerticalSpase","Popover","cnMixSpace","cn","contextMenuDefaultSize","cnContextMenuLevelWrapper","ContextMenuLevelWrapper","props","ref","isMobile","children","className","size","otherProps","pV"],"sources":["../../../../../../src/components/ContextMenu/ContextMenuLevelWrapper/ContextMenuLevelWrapper.tsx"],"sourcesContent":["import './ContextMenuLevelWrapper.css';\n\nimport React, { forwardRef } from 'react';\n\nimport { mapVerticalSpase } from '##/components/ListCanary';\nimport { Popover } from '##/components/Popover';\nimport { cnMixSpace } from '##/mixs/MixSpace';\nimport { cn } from '##/utils/bem';\n\nimport { contextMenuDefaultSize, ContextMenuLevelWrapperProps } from '../types';\n\nconst cnContextMenuLevelWrapper = cn('ContextMenuLevelWrapper');\n\nexport const ContextMenuLevelWrapper = forwardRef(\n (props: ContextMenuLevelWrapperProps, ref: React.Ref<HTMLDivElement>) => {\n const {\n isMobile,\n children,\n className,\n size = contextMenuDefaultSize,\n ...otherProps\n } = props;\n\n if (isMobile) {\n return (\n <div className={className}>\n <div\n className={cnContextMenuLevelWrapper('Mobile', [\n cnMixSpace({\n pV: mapVerticalSpase[size],\n }),\n ])}\n ref={ref}\n >\n {children}\n </div>\n </div>\n );\n }\n\n return (\n <Popover {...otherProps} ref={ref} className={className}>\n {children}\n </Popover>\n );\n },\n);\n"],"mappings":"8IAAA,sCAEA,MAAOA,MAAP,EAAgBC,UAAhB,KAAkC,OAAlC,CAEA,OAASC,gBAAT,wBACA,OAASC,OAAT,qBACA,OAASC,UAAT,8BACA,OAASC,EAAT,0BAEA,OAASC,sBAAT,gBAEA,GAAMC,0BAAyB,CAAGF,EAAE,CAAC,yBAAD,CAApC,CAEA,MAAO,IAAMG,wBAAuB,CAAGP,UAAU,CAC/C,SAACQ,CAAD,CAAsCC,CAAtC,CAAyE,CACvE,GACEC,EADF,CAMIF,CANJ,CACEE,QADF,CAEEC,CAFF,CAMIH,CANJ,CAEEG,QAFF,CAGEC,CAHF,CAMIJ,CANJ,CAGEI,SAHF,GAMIJ,CANJ,CAIEK,IAJF,CAIEA,CAJF,YAISR,sBAJT,GAKKS,CALL,0BAMIN,CANJ,YADuE,MASnEE,EATmE,CAWnE,2BAAK,SAAS,CAAEE,CAAhB,EACE,2BACE,SAAS,CAAEN,yBAAyB,CAAC,QAAD,CAAW,CAC7CH,UAAU,CAAC,CACTY,EAAE,CAAEd,gBAAgB,CAACY,CAAD,CADX,CAAD,CADmC,CAAX,CADtC,CAME,GAAG,CAAEJ,CANP,EAQGE,CARH,CADF,CAXmE,CA2BrE,oBAAC,OAAD,kBAAaG,CAAb,EAAyB,GAAG,CAAEL,CAA9B,CAAmC,SAAS,CAAEG,CAA9C,GACGD,CADH,CAIH,CAhC8C,CAA1C"}
@@ -0,0 +1 @@
1
+ export * from './ContextMenuLevelWrapper';
@@ -0,0 +1,2 @@
1
+ export*from"./ContextMenuLevelWrapper";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../../src/components/ContextMenu/ContextMenuLevelWrapper/index.ts"],"sourcesContent":["export * from './ContextMenuLevelWrapper';\n"],"mappings":"AAAA"}
@@ -1,2 +1,2 @@
1
- import { ContextMenuComponent } from '../types';
2
- export declare const ContextMenuLevels: ContextMenuComponent;
1
+ import { ContextMenuLevelsComponent } from '../types';
2
+ export declare const ContextMenuLevels: ContextMenuLevelsComponent;
@@ -1,2 +1,2 @@
1
- import _defineProperty from"@babel/runtime/helpers/defineProperty";import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["items","anchorRef","position","direction","possibleDirections","offset","onClickOutside","getItemKey","getItemLabel","getItemSubMenu","style","spareDirection","subMenuDirection"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import React,{useEffect,useState}from"react";import{directions}from"../../Popover";import{useClickOutside}from"../../../hooks/useClickOutside";import{useForkRef}from"../../../hooks/useForkRef";import{useRefs}from"../../../hooks/useRefs";import{clearTimers,ContextMenuLevel}from"../ContextMenuLevel";import{getLevels,withDefaultGetters}from"../helpers";import{contextMenuPropDefaultSubMenuDirection,contextMenuPropSubMenuDirections}from"../types";var ContextMenuLevelsRender=function(a,b){var c=withDefaultGetters(a),d=c.items,e=c.anchorRef,f=c.position,g=c.direction,h=c.possibleDirections,i=void 0===h?directions:h,j=c.offset,k=c.onClickOutside,l=c.getItemKey,m=c.getItemLabel,n=c.getItemSubMenu,o=c.style,p=c.spareDirection,q=c.subMenuDirection,r=void 0===q?contextMenuPropDefaultSubMenuDirection:q,s=_objectWithoutProperties(c,_excluded),t=[{items:d,anchorRef:e,position:f,direction:g,possibleDirections:i,offset:j}],u=useState(t),v=_slicedToArray(u,2),w=v[0],x=v[1],y=useState(r),z=_slicedToArray(y,2),A=z[0],B=z[1],C=useState(-1),D=_slicedToArray(C,2),E=D[0],F=D[1],G=useRefs(w.length),H=function(a){var b=a.level,c=a.items,d=a.anchorRef,e=a.activeItem,f=_toConsumableArray(w),g=f[b]&&1<f.length-b?f[b].direction:void 0;f[b]&&1<f.length-b&&g&&B(g),f[b-1].activeItem=e,f.splice(b),f.push({items:c,anchorRef:d,direction:g||A,possibleDirections:contextMenuPropSubMenuDirections,position:void 0}),x(f)},I=function(a){var b=_toConsumableArray(w);b.splice(a),b[a-1]=_objectSpread(_objectSpread({},b[a-1]),{},{activeItem:void 0}),x(b)};useClickOutside({isActive:!!k,ignoreClicksInsideRefs:[].concat(_toConsumableArray(G),[e||{current:null}]),handler:function handler(a){return null===k||void 0===k?void 0:k(a)}}),useEffect(function(){return clearTimers(),x(getLevels({levels:w,items:d,getItemKey:l,getItemSubMenu:n})),function(){return clearTimers()}},[d]);var J=useForkRef([G[0],b]);return useEffect(function(){x(t)},[f]),React.createElement(React.Fragment,null,w.map(function(a,b){return React.createElement(ContextMenuLevel,Object.assign({},s,a,{key:"ContextMenu-".concat(b),style:_objectSpread(_objectSpread({},o),{zIndex:"number"==typeof(null===o||void 0===o?void 0:o.zIndex)?o.zIndex+1:void 0}),levelDepth:b,getItemLabel:m,addLevel:H,deleteLevel:I,onSetDirection:0<b?B:c.onSetDirection,hoveredParenLevel:E,setHoveredParenLevel:F,getItemSubMenu:n,getItemKey:l,ref:0===b?J:G[b],spareDirection:0===b?p:"rightStartUp"}))}))};export var ContextMenuLevels=React.forwardRef(ContextMenuLevelsRender);
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["items","anchorRef","position","direction","possibleDirections","offset","onClickOutside","getItemKey","getItemLabel","getItemSubMenu","style","spareDirection","subMenuDirection","isMobile","isOpen","setComponentSize","enableAnimationBack","disableAnimationBack"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import React,{Fragment,useEffect,useState}from"react";import{Transition,TransitionGroup}from"react-transition-group";import{useClickOutside}from"../../../hooks/useClickOutside";import{useForkRef}from"../../../hooks/useForkRef";import{useMutableRef}from"../../../hooks/useMutableRef";import{useRefs}from"../../../hooks/useRefs";import{animateTimeout}from"../../../mixs/MixPopoverAnimate";import{clearTimers,ContextMenuLevel}from"../ContextMenuLevel";import{getLevels,withDefaultGetters}from"../helpers";import{contextMenuPropDefaultSubMenuDirection,contextMenuPropSubMenuDirections}from"../types";import{useSize}from"./useSize";var ContextMenuLevelsRender=function(a,b){var c=withDefaultGetters(a),d=c.items,e=c.anchorRef,f=c.position,g=c.direction,h=c.possibleDirections,i=c.offset,j=c.onClickOutside,k=c.getItemKey,l=c.getItemLabel,m=c.getItemSubMenu,n=c.style,o=c.spareDirection,p=c.subMenuDirection,q=void 0===p?contextMenuPropDefaultSubMenuDirection:p,r=c.isMobile,s=c.isOpen,t=c.setComponentSize,u=c.enableAnimationBack,v=c.disableAnimationBack,w=_objectWithoutProperties(c,_excluded),x=useMutableRef(s),y=[{items:d,anchorRef:e,position:f,direction:g,possibleDirections:h,offset:i}],z=useState(r?y:[]),A=_slicedToArray(z,2),B=A[0],C=A[1],D=useState(q),E=_slicedToArray(D,2),F=E[0],G=E[1],H=useState(-1),I=_slicedToArray(H,2),J=I[0],K=I[1],L=useRefs(B.length),M=function(a){var b=a.level,d=a.items,e=a.anchorRef,f=a.activeItem,g=a.parent,h=_toConsumableArray(B),i=h[b]&&1<h.length-b?h[b].direction:void 0;h[b]&&1<h.length-b&&i&&G(i),h[b-1].activeItem=f,h.splice(b),h.push({items:d,anchorRef:r?c.anchorRef:e,direction:r?c.direction:i||F,possibleDirections:r?c.possibleDirections:contextMenuPropSubMenuDirections,position:r?c.position:void 0,offset:r?c.offset:void 0,parent:g}),x.current?C(h):C([])},N=function(a){u();var b=_toConsumableArray(B);b.splice(a),b[a-1]=_objectSpread(_objectSpread({},b[a-1]),{},{activeItem:void 0}),C(b),v()};useClickOutside({isActive:!!j,ignoreClicksInsideRefs:[].concat(_toConsumableArray(L),[e||{current:null}]),handler:function handler(a){return null===j||void 0===j?void 0:j(a)}}),useEffect(function(){return clearTimers(),C(getLevels({levels:B,items:d,getItemKey:k,getItemSubMenu:m})),function(){return clearTimers()}},[d]);var O=useForkRef([L[0],b]);return useEffect(function(){C(y)},[f]),useEffect(function(){C(s?y:[])},[s]),useSize(L,t,r),React.createElement(TransitionGroup,{component:Fragment},B.map(function(a,b){var d="".concat(b,"-").concat(a.parent?k(a.parent):""),e=b!==B.length-1;return r&&e?React.createElement(Fragment,{key:b}):React.createElement(Transition,{key:d,timeout:animateTimeout,nodeRef:L[b]},function(d){return React.createElement(ContextMenuLevel,Object.assign({},w,a,{key:"".concat(b,"-").concat(a.parent?k(a.parent):""),isMobile:r,isOpen:s,style:_objectSpread(_objectSpread({},n),{zIndex:"number"==typeof(null===n||void 0===n?void 0:n.zIndex)?n.zIndex+1:void 0}),levelDepth:b,getItemLabel:l,addLevel:M,deleteLevel:N,onSetDirection:0<b?G:c.onSetDirection,hoveredParenLevel:J,setHoveredParenLevel:K,getItemSubMenu:m,getItemKey:k,ref:0===b?O:L[b],spareDirection:0===b?o:"rightStartUp",parent:r?a.parent:void 0,animate:d}))})}))};export var ContextMenuLevels=React.forwardRef(ContextMenuLevelsRender);
2
2
  //# sourceMappingURL=ContextMenuLevels.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ContextMenuLevels.js","names":["React","useEffect","useState","directions","useClickOutside","useForkRef","useRefs","clearTimers","ContextMenuLevel","getLevels","withDefaultGetters","contextMenuPropDefaultSubMenuDirection","contextMenuPropSubMenuDirections","ContextMenuLevelsRender","propsComponent","ref","props","items","anchorRef","position","direction","possibleDirections","offset","onClickOutside","getItemKey","getItemLabel","getItemSubMenu","style","spareDirection","subMenuDirection","subMenuDirectionProp","otherProps","defaultLevels","levels","setLevels","setSubMenuDirection","hoveredParenLevel","setHoveredParenLevel","levelsRefs","length","addLevel","level","activeItem","newLevels","oldDirection","splice","push","deleteLevel","isActive","ignoreClicksInsideRefs","current","handler","e","firstLevelRef","map","index","zIndex","onSetDirection","ContextMenuLevels","forwardRef"],"sources":["../../../../../../src/components/ContextMenu/ContextMenuLevels/ContextMenuLevels.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\n\nimport { Direction, directions } from '##/components/Popover';\nimport { useClickOutside } from '##/hooks/useClickOutside';\nimport { useForkRef } from '##/hooks/useForkRef';\nimport { useRefs } from '##/hooks/useRefs';\n\nimport { clearTimers, ContextMenuLevel } from '../ContextMenuLevel';\nimport { getLevels, withDefaultGetters } from '../helpers';\nimport {\n AddLevel,\n ContextMenuComponent,\n contextMenuPropDefaultSubMenuDirection,\n ContextMenuProps,\n contextMenuPropSubMenuDirections,\n Level,\n} from '../types';\n\nconst ContextMenuLevelsRender = (\n propsComponent: ContextMenuProps,\n ref: React.Ref<HTMLDivElement>,\n) => {\n const props = withDefaultGetters(propsComponent);\n const {\n items,\n anchorRef,\n position,\n direction,\n possibleDirections = directions,\n offset,\n onClickOutside,\n getItemKey,\n getItemLabel,\n getItemSubMenu,\n style,\n spareDirection,\n subMenuDirection:\n subMenuDirectionProp = contextMenuPropDefaultSubMenuDirection,\n ...otherProps\n } = props;\n\n type Item = typeof items[number];\n\n const defaultLevels: Level<Item>[] = [\n {\n items,\n anchorRef,\n position,\n direction,\n possibleDirections,\n offset,\n } as Level<Item>,\n ];\n\n const [levels, setLevels] = useState<Level<Item>[]>(defaultLevels);\n const [subMenuDirection, setSubMenuDirection] =\n useState<Direction>(subMenuDirectionProp);\n const [hoveredParenLevel, setHoveredParenLevel] = useState<number>(-1);\n\n const levelsRefs = useRefs<HTMLDivElement>(levels.length);\n\n const addLevel: AddLevel<Item> = ({\n level,\n items,\n anchorRef,\n activeItem,\n }) => {\n const newLevels = [...levels];\n const oldDirection =\n newLevels[level] && newLevels.length - level > 1\n ? newLevels[level].direction\n : undefined;\n\n if (newLevels[level] && newLevels.length - level > 1 && oldDirection) {\n setSubMenuDirection(oldDirection);\n }\n\n newLevels[level - 1].activeItem = activeItem;\n newLevels.splice(level);\n newLevels.push({\n items,\n anchorRef,\n direction: oldDirection || subMenuDirection,\n possibleDirections: contextMenuPropSubMenuDirections,\n position: undefined,\n });\n setLevels(newLevels);\n };\n\n const deleteLevel = (level: number) => {\n const newLevels = [...levels];\n newLevels.splice(level);\n newLevels[level - 1] = { ...newLevels[level - 1], activeItem: undefined };\n setLevels(newLevels);\n };\n\n useClickOutside({\n isActive: !!onClickOutside,\n ignoreClicksInsideRefs: [...levelsRefs, anchorRef || { current: null }],\n handler: (e) => onClickOutside?.(e),\n });\n\n useEffect(() => {\n clearTimers();\n setLevels(\n getLevels({\n levels,\n items,\n getItemKey,\n getItemSubMenu,\n }),\n );\n return () => clearTimers();\n }, [items]);\n\n const firstLevelRef = useForkRef([levelsRefs[0], ref]);\n\n useEffect(() => {\n setLevels(defaultLevels);\n }, [position]);\n\n return (\n <>\n {levels.map((level, index) => (\n <ContextMenuLevel\n {...otherProps}\n {...level}\n key={`ContextMenu-${index}`}\n style={{\n ...style,\n ...{\n zIndex:\n typeof style?.zIndex === 'number'\n ? style.zIndex + 1\n : undefined,\n },\n }}\n levelDepth={index}\n getItemLabel={getItemLabel}\n addLevel={addLevel}\n deleteLevel={deleteLevel}\n onSetDirection={\n index > 0 ? setSubMenuDirection : props.onSetDirection\n }\n hoveredParenLevel={hoveredParenLevel}\n setHoveredParenLevel={setHoveredParenLevel}\n getItemSubMenu={getItemSubMenu}\n getItemKey={getItemKey}\n ref={index === 0 ? firstLevelRef : levelsRefs[index]}\n spareDirection={index === 0 ? spareDirection : 'rightStartUp'}\n />\n ))}\n </>\n );\n};\n\nexport const ContextMenuLevels = React.forwardRef(\n ContextMenuLevelsRender,\n) as ContextMenuComponent;\n"],"mappings":"ukCAAA,MAAOA,MAAP,EAAgBC,SAAhB,CAA2BC,QAA3B,KAA2C,OAA3C,CAEA,OAAoBC,UAApB,qBACA,OAASC,eAAT,sCACA,OAASC,UAAT,iCACA,OAASC,OAAT,8BAEA,OAASC,WAAT,CAAsBC,gBAAtB,2BACA,OAASC,SAAT,CAAoBC,kBAApB,k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F,CAvBd,CAwBE,GAAG,CAAY,CAAV,GAAA+B,CAAK,CAASF,CAAT,CAAyBf,CAAU,CAACiB,CAAD,CAxB/C,CAyBE,cAAc,CAAY,CAAV,GAAAA,CAAK,CAAS3B,CAAT,CAA0B,cAzBjD,GADU,CAAX,CADH,CAgCH,CAxID,CA0IA,MAAO,IAAM8B,kBAAiB,CAAG1D,KAAK,CAAC2D,UAAN,CAC/B9C,uBAD+B,CAA1B"}
1
+ {"version":3,"file":"ContextMenuLevels.js","names":["React","Fragment","useEffect","useState","Transition","TransitionGroup","useClickOutside","useForkRef","useMutableRef","useRefs","animateTimeout","clearTimers","ContextMenuLevel","getLevels","withDefaultGetters","contextMenuPropDefaultSubMenuDirection","contextMenuPropSubMenuDirections","useSize","ContextMenuLevelsRender","propsComponent","ref","props","items","anchorRef","position","direction","possibleDirections","offset","onClickOutside","getItemKey","getItemLabel","getItemSubMenu","style","spareDirection","subMenuDirection","subMenuDirectionProp","isMobile","isOpen","setComponentSize","enableAnimationBack","disableAnimationBack","otherProps","isOpenRef","defaultLevels","levels","setLevels","setSubMenuDirection","hoveredParenLevel","setHoveredParenLevel","levelsRefs","length","addLevel","level","activeItem","parent","newLevels","oldDirection","splice","push","current","deleteLevel","isActive","ignoreClicksInsideRefs","handler","e","firstLevelRef","map","index","key","last","animate","zIndex","onSetDirection","ContextMenuLevels","forwardRef"],"sources":["../../../../../../src/components/ContextMenu/ContextMenuLevels/ContextMenuLevels.tsx"],"sourcesContent":["import React, { Fragment, useEffect, useState } from 'react';\nimport { Transition, TransitionGroup } from 'react-transition-group';\n\nimport { Direction } from '##/components/Popover';\nimport { useClickOutside } from '##/hooks/useClickOutside';\nimport { useForkRef } from '##/hooks/useForkRef';\nimport { useMutableRef } from '##/hooks/useMutableRef';\nimport { useRefs } from '##/hooks/useRefs';\nimport { animateTimeout } from '##/mixs/MixPopoverAnimate';\n\nimport { clearTimers, ContextMenuLevel } from '../ContextMenuLevel';\nimport { getLevels, withDefaultGetters } from '../helpers';\nimport {\n AddLevel,\n ContextMenuItemDefault,\n ContextMenuLevelsComponent,\n ContextMenuLevelsProps,\n contextMenuPropDefaultSubMenuDirection,\n contextMenuPropSubMenuDirections,\n Level,\n} from '../types';\nimport { useSize } from './useSize';\n\nconst ContextMenuLevelsRender = (\n propsComponent: ContextMenuLevelsProps,\n ref: React.Ref<HTMLDivElement>,\n) => {\n const props = withDefaultGetters(propsComponent);\n const {\n items,\n anchorRef,\n position,\n direction,\n possibleDirections,\n offset,\n onClickOutside,\n getItemKey,\n getItemLabel,\n getItemSubMenu,\n style,\n spareDirection,\n subMenuDirection:\n subMenuDirectionProp = contextMenuPropDefaultSubMenuDirection,\n isMobile,\n isOpen,\n setComponentSize,\n enableAnimationBack,\n disableAnimationBack,\n ...otherProps\n } = props;\n\n const isOpenRef = useMutableRef(isOpen);\n\n type Item = typeof items[number];\n\n const defaultLevels: Level<ContextMenuItemDefault>[] = [\n {\n items,\n anchorRef,\n position,\n direction,\n possibleDirections,\n offset,\n },\n ];\n\n const [levels, setLevels] = useState<\n Level<ContextMenuItemDefault & { isParent?: boolean }>[]\n >(isMobile ? defaultLevels : []);\n const [subMenuDirection, setSubMenuDirection] =\n useState<Direction>(subMenuDirectionProp);\n const [hoveredParenLevel, setHoveredParenLevel] = useState<number>(-1);\n\n const levelsRefs = useRefs<HTMLDivElement>(levels.length);\n\n const addLevel: AddLevel<Item> = ({\n level,\n items,\n anchorRef,\n activeItem,\n parent,\n }) => {\n const newLevels: Level<ContextMenuItemDefault & { isParent?: boolean }>[] =\n [...levels];\n const oldDirection =\n newLevels[level] && newLevels.length - level > 1\n ? newLevels[level].direction\n : undefined;\n\n if (newLevels[level] && newLevels.length - level > 1 && oldDirection) {\n setSubMenuDirection(oldDirection);\n }\n\n newLevels[level - 1].activeItem = activeItem;\n newLevels.splice(level);\n newLevels.push({\n items,\n anchorRef: isMobile ? props.anchorRef : anchorRef,\n direction: isMobile ? props.direction : oldDirection || subMenuDirection,\n possibleDirections: isMobile\n ? props.possibleDirections\n : contextMenuPropSubMenuDirections,\n position: isMobile ? props.position : undefined,\n offset: isMobile ? props.offset : undefined,\n parent,\n });\n\n isOpenRef.current ? setLevels(newLevels) : setLevels([]);\n };\n\n const deleteLevel = (level: number) => {\n enableAnimationBack();\n const newLevels = [...levels];\n newLevels.splice(level);\n newLevels[level - 1] = { ...newLevels[level - 1], activeItem: undefined };\n setLevels(newLevels);\n disableAnimationBack();\n };\n\n useClickOutside({\n isActive: !!onClickOutside,\n ignoreClicksInsideRefs: [...levelsRefs, anchorRef || { current: null }],\n handler: (e) => onClickOutside?.(e),\n });\n\n useEffect(() => {\n clearTimers();\n setLevels(\n getLevels({\n levels,\n items,\n getItemKey,\n getItemSubMenu,\n }),\n );\n return () => clearTimers();\n }, [items]);\n\n const firstLevelRef = useForkRef([levelsRefs[0], ref]);\n\n useEffect(() => {\n setLevels(defaultLevels);\n }, [position]);\n\n useEffect(() => {\n setLevels(isOpen ? defaultLevels : []);\n }, [isOpen]);\n\n useSize(levelsRefs, setComponentSize, isMobile);\n\n return (\n <TransitionGroup component={Fragment}>\n {levels.map((level, index) => {\n const key = `${index}-${level.parent ? getItemKey(level.parent) : ''}`;\n\n const last = index !== levels.length - 1;\n\n if (isMobile && last) {\n return <Fragment key={index} />;\n }\n\n return (\n <Transition\n key={key}\n timeout={animateTimeout}\n nodeRef={levelsRefs[index]}\n >\n {(animate) => (\n <ContextMenuLevel\n {...otherProps}\n {...level}\n key={`${index}-${level.parent ? getItemKey(level.parent) : ''}`}\n isMobile={isMobile}\n isOpen={isOpen}\n style={{\n ...style,\n ...{\n zIndex:\n typeof style?.zIndex === 'number'\n ? style.zIndex + 1\n : undefined,\n },\n }}\n levelDepth={index}\n getItemLabel={getItemLabel}\n addLevel={addLevel}\n deleteLevel={deleteLevel}\n onSetDirection={\n index > 0 ? setSubMenuDirection : props.onSetDirection\n }\n hoveredParenLevel={hoveredParenLevel}\n setHoveredParenLevel={setHoveredParenLevel}\n getItemSubMenu={getItemSubMenu}\n getItemKey={getItemKey}\n ref={index === 0 ? firstLevelRef : levelsRefs[index]}\n spareDirection={index === 0 ? spareDirection : 'rightStartUp'}\n parent={isMobile ? level.parent : undefined}\n animate={animate}\n />\n )}\n </Transition>\n );\n })}\n </TransitionGroup>\n );\n};\n\nexport const ContextMenuLevels = React.forwardRef(\n ContextMenuLevelsRender,\n) as ContextMenuLevelsComponent;\n"],"mappings":"2pCAAA,MAAOA,MAAP,EAAgBC,QAAhB,CAA0BC,SAA1B,CAAqCC,QAArC,KAAqD,OAArD,CACA,OAASC,UAAT,CAAqBC,eAArB,KAA4C,wBAA5C,CAGA,OAASC,eAAT,sCACA,OAASC,UAAT,iCACA,OAASC,aAAT,oCACA,OAASC,OAAT,8BACA,OAASC,cAAT,uCAEA,OAASC,WAAT,CAAsBC,gBAAtB,2BACA,OAASC,SAAT,CAAoBC,kBAApB,kBACA,OAKEC,sCALF,CAMEC,gCANF,gBASA,OAASC,OAAT,iBAEA,GAAMC,wBAAuB,CAAG,SAC9BC,CAD8B,CAE9BC,CAF8B,CAG3B,IACGC,EAAK,CAAGP,kBAAkB,CAACK,CAAD,CAD7B,CAGDG,CAHC,CAuBCD,CAvBD,CAGDC,KAHC,CAIDC,CAJC,CAuBCF,CAvBD,CAIDE,SAJC,CAKDC,CALC,CAuBCH,CAvBD,CAKDG,QALC,CAMDC,CANC,CAuBCJ,CAvBD,CAMDI,SANC,CAODC,CAPC,CAuBCL,CAvBD,CAODK,kBAPC,CAQDC,CARC,CAuBCN,CAvBD,CAQDM,MARC,CASDC,CATC,CAuBCP,CAvBD,CASDO,cATC,CAUDC,CAVC,CAuBCR,CAvBD,CAUDQ,UAVC,CAWDC,CAXC,CAuBCT,CAvBD,CAWDS,YAXC,CAYDC,CAZC,CAuBCV,CAvBD,CAYDU,cAZC,CAaDC,CAbC,CAuBCX,CAvBD,CAaDW,KAbC,CAcDC,CAdC,CAuBCZ,CAvBD,CAcDY,cAdC,GAuBCZ,CAvBD,CAe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";
2
+ export declare const useSize: (refs: React.RefObject<HTMLDivElement>[], setFn: React.Dispatch<React.SetStateAction<ComponentSize>>, isActive?: boolean) => void;
@@ -0,0 +1,2 @@
1
+ import{useEffect,useLayoutEffect}from"react";import{getElementSize}from"../../../hooks/useComponentSize";import{useMutableRef}from"../../../hooks/useMutableRef";export var useSize=function(a,b,c){var d=useMutableRef(function(a){c&&b(function(b){return a.height&&a.width&&(b.height!==a.height||b.width!==a.width)?a:b})}),e=null===a||void 0===a?void 0:a[a.length-1];useLayoutEffect(function(){d.current(getElementSize(null===e||void 0===e?void 0:e.current))},[e]),useEffect(function(){var a=null===e||void 0===e?void 0:e.current,b=new ResizeObserver(function(a){d.current(getElementSize(a[0].target))});return a&&b.observe(a),function(){b.disconnect()}},[e])};
2
+ //# sourceMappingURL=useSize.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSize.js","names":["useEffect","useLayoutEffect","getElementSize","useMutableRef","useSize","refs","setFn","isActive","setRef","newState","oldState","height","width","elementRef","length","current","element","resizeObserver","ResizeObserver","res","target","observe","disconnect"],"sources":["../../../../../../src/components/ContextMenu/ContextMenuLevels/useSize.ts"],"sourcesContent":["import { useEffect, useLayoutEffect } from 'react';\n\nimport { ComponentSize, getElementSize } from '##/hooks/useComponentSize';\nimport { useMutableRef } from '##/hooks/useMutableRef';\n\nexport const useSize = (\n refs: React.RefObject<HTMLDivElement>[],\n setFn: React.Dispatch<React.SetStateAction<ComponentSize>>,\n isActive?: boolean,\n) => {\n const setRef = useMutableRef((newState: ComponentSize) => {\n if (!isActive) {\n return;\n }\n\n setFn((oldState) => {\n if (\n newState.height &&\n newState.width &&\n (oldState.height !== newState.height ||\n oldState.width !== newState.width)\n ) {\n return newState;\n }\n return oldState;\n });\n });\n\n const elementRef = refs?.[refs.length - 1];\n\n useLayoutEffect(() => {\n setRef.current(getElementSize(elementRef?.current));\n }, [elementRef]);\n\n useEffect(() => {\n const element = elementRef?.current;\n\n const resizeObserver = new ResizeObserver((res) => {\n setRef.current(getElementSize(res[0].target as HTMLElement));\n });\n\n element && resizeObserver.observe(element);\n\n return () => {\n resizeObserver.disconnect();\n };\n }, [elementRef]);\n};\n"],"mappings":"AAAA,OAASA,SAAT,CAAoBC,eAApB,KAA2C,OAA3C,CAEA,OAAwBC,cAAxB,uCACA,OAASC,aAAT,oCAEA,MAAO,IAAMC,QAAO,CAAG,SACrBC,CADqB,CAErBC,CAFqB,CAGrBC,CAHqB,CAIlB,IACGC,EAAM,CAAGL,aAAa,CAAC,SAACM,CAAD,CAA6B,CACnDF,CADmD,EAKxDD,CAAK,CAAC,SAACI,CAAD,CAAc,OAEhBD,EAAQ,CAACE,MAAT,EACAF,CAAQ,CAACG,KADT,GAECF,CAAQ,CAACC,MAAT,GAAoBF,CAAQ,CAACE,MAA7B,EACCD,CAAQ,CAACE,KAAT,GAAmBH,CAAQ,CAACG,KAH9B,CAFgB,CAOTH,CAPS,CASXC,CACR,CAVI,CAWN,CAhB2B,CADzB,CAmBGG,CAAU,QAAGR,CAAH,WAAGA,CAAH,QAAGA,CAAI,CAAGA,CAAI,CAACS,MAAL,CAAc,CAAjB,CAnBpB,CAqBHb,eAAe,CAAC,UAAM,CACpBO,CAAM,CAACO,OAAP,CAAeb,cAAc,QAACW,CAAD,WAACA,CAAD,QAACA,CAAU,CAAEE,OAAb,CAA7B,CACD,CAFc,CAEZ,CAACF,CAAD,CAFY,CArBZ,CAyBHb,SAAS,CAAC,UAAM,IACRgB,EAAO,QAAGH,CAAH,WAAGA,CAAH,QAAGA,CAAU,CAAEE,OADd,CAGRE,CAAc,CAAG,GAAIC,eAAJ,CAAmB,SAACC,CAAD,CAAS,CACjDX,CAAM,CAACO,OAAP,CAAeb,cAAc,CAACiB,CAAG,CAAC,CAAD,CAAH,CAAOC,MAAR,CAA7B,CACD,CAFsB,CAHT,CASd,MAFAJ,EAAO,EAAIC,CAAc,CAACI,OAAf,CAAuBL,CAAvB,CAEX,CAAO,UAAM,CACXC,CAAc,CAACK,UAAf,EACD,CACF,CAZQ,CAYN,CAACT,CAAD,CAZM,CAaV,CA1CM"}
@@ -0,0 +1 @@
1
+ .ContextMenuWrapper{overflow:hidden;width:240px}.MixPopoverAnimate.ContextMenuWrapper{--mix-dropdown-animate-trasition:opacity var(--mix-dropdown-animate-timeout),transform var(--mix-dropdown-animate-timeout),height var(--mix-dropdown-animate-timeout)}
@@ -0,0 +1,3 @@
1
+ import './ContextMenuWrapper.css';
2
+ import { ContextMenuWrapperProps } from '../types';
3
+ export declare const ContextMenuWrapper: (props: ContextMenuWrapperProps) => JSX.Element;
@@ -0,0 +1,2 @@
1
+ import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import"./ContextMenuWrapper.css";import React,{Fragment,useCallback,useState}from"react";import{Transition}from"react-transition-group";import{cnListBox,mapVerticalSpase}from"../../ListCanary";import{Popover}from"../../Popover";import{useFlag}from"../../../hooks/useFlag";import{useMutableRef}from"../../../hooks/useMutableRef";import{animateTimeout,cnMixPopoverAnimate}from"../../../mixs/MixPopoverAnimate";import{cnMixSpace}from"../../../mixs/MixSpace";import{cn}from"../../../utils/bem";import{contextMenuDefaultSize,defaultContextMenuForm}from"../types";var cnContextMenuWrapper=cn("ContextMenuWrapper");export var ContextMenuWrapper=function(a){var b=a.isMobile,c=a.children,d=a.form,e=void 0===d?defaultContextMenuForm:d,f=a.isOpen,g=a.size,h=void 0===g?contextMenuDefaultSize:g,i=a.anchorRef,j=a.possibleDirections,k=a.position,l=a.direction,m=a.spareDirection,n=a.onClickOutside,o=a.offset,p=a.onSetDirection,q=a.className,r=a.animationBack,s=a.style,t=useFlag(b),u=_slicedToArray(t,2),v=u[0],w=u[1],x=useState(l),y=_slicedToArray(x,2),z=y[0],A=y[1],B=useMutableRef(p),C=useCallback(function(a){var b;A(a),null===(b=B.current)||void 0===b?void 0:b.call(B,a)},[]);return b?React.createElement(Transition,{timeout:animateTimeout,in:f,unmountOnExit:!0,onEntered:w.on,onExit:w.off},function(a){return React.createElement(Popover,{className:cnContextMenuWrapper({animationBack:r,innerAnimation:v},[cnListBox({size:h,form:e,border:!0,shadow:!0}),cnMixSpace({pV:mapVerticalSpase[h]}),cnMixPopoverAnimate({animate:a}),q]),anchorRef:i,possibleDirections:j,position:k,direction:z,spareDirection:m,onClickOutside:n,offset:o,onSetDirection:C,style:s},c)}):React.createElement(Fragment,{key:ContextMenuWrapper.name},c)};
2
+ //# sourceMappingURL=ContextMenuWrapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContextMenuWrapper.js","names":["React","Fragment","useCallback","useState","Transition","cnListBox","mapVerticalSpase","Popover","useFlag","useMutableRef","animateTimeout","cnMixPopoverAnimate","cnMixSpace","cn","contextMenuDefaultSize","defaultContextMenuForm","cnContextMenuWrapper","ContextMenuWrapper","props","isMobile","children","form","isOpen","size","anchorRef","possibleDirections","position","directionProp","direction","spareDirection","onClickOutside","offset","onSetDirectionProp","onSetDirection","className","animationBack","style","innerAnimation","setInnerAnimation","setSirection","onSetDirectionRef","current","on","off","animate","border","shadow","pV","name"],"sources":["../../../../../../src/components/ContextMenu/ContextMenuWrapper/ContextMenuWrapper.tsx"],"sourcesContent":["import './ContextMenuWrapper.css';\n\nimport React, { Fragment, useCallback, useState } from 'react';\nimport { Transition } from 'react-transition-group';\n\nimport { cnListBox, mapVerticalSpase } from '##/components/ListCanary';\nimport { Direction, Popover } from '##/components/Popover';\nimport { useFlag } from '##/hooks/useFlag';\nimport { useMutableRef } from '##/hooks/useMutableRef';\nimport { animateTimeout, cnMixPopoverAnimate } from '##/mixs/MixPopoverAnimate';\nimport { cnMixSpace } from '##/mixs/MixSpace';\nimport { cn } from '##/utils/bem';\n\nimport {\n contextMenuDefaultSize,\n ContextMenuWrapperProps,\n defaultContextMenuForm,\n} from '../types';\n\nconst cnContextMenuWrapper = cn('ContextMenuWrapper');\n\nexport const ContextMenuWrapper = (props: ContextMenuWrapperProps) => {\n const {\n isMobile,\n children,\n form = defaultContextMenuForm,\n isOpen,\n size = contextMenuDefaultSize,\n anchorRef,\n possibleDirections,\n position,\n direction: directionProp,\n spareDirection,\n onClickOutside,\n offset,\n onSetDirection: onSetDirectionProp,\n className,\n animationBack,\n style,\n } = props;\n\n const [innerAnimation, setInnerAnimation] = useFlag(isMobile);\n // запоминаем позицию посднего удовлетворяющего разворота,\n // для того чтоб следующий экран разворачивался в эту же строну.\n const [direction, setSirection] = useState(directionProp);\n\n const onSetDirectionRef = useMutableRef(onSetDirectionProp);\n\n const onSetDirection = useCallback((direction: Direction) => {\n setSirection(direction);\n onSetDirectionRef.current?.(direction);\n }, []);\n\n if (isMobile) {\n return (\n <Transition\n timeout={animateTimeout}\n in={isOpen}\n unmountOnExit\n onEntered={setInnerAnimation.on}\n onExit={setInnerAnimation.off}\n >\n {(animate) => (\n <Popover\n className={cnContextMenuWrapper({ animationBack, innerAnimation }, [\n cnListBox({ size, form, border: true, shadow: true }),\n cnMixSpace({\n pV: mapVerticalSpase[size],\n }),\n cnMixPopoverAnimate({ animate }),\n className,\n ])}\n anchorRef={anchorRef}\n possibleDirections={possibleDirections}\n position={position}\n direction={direction}\n spareDirection={spareDirection}\n onClickOutside={onClickOutside}\n offset={offset}\n onSetDirection={onSetDirection}\n style={style}\n >\n {children}\n </Popover>\n )}\n </Transition>\n );\n }\n\n return <Fragment key={ContextMenuWrapper.name}>{children}</Fragment>;\n};\n"],"mappings":"iEAAA,iCAEA,MAAOA,MAAP,EAAgBC,QAAhB,CAA0BC,WAA1B,CAAuCC,QAAvC,KAAuD,OAAvD,CACA,OAASC,UAAT,KAA2B,wBAA3B,CAEA,OAASC,SAAT,CAAoBC,gBAApB,wBACA,OAAoBC,OAApB,qBACA,OAASC,OAAT,8BACA,OAASC,aAAT,oCACA,OAASC,cAAT,CAAyBC,mBAAzB,uCACA,OAASC,UAAT,8BACA,OAASC,EAAT,0BAEA,OACEC,sBADF,CAGEC,sBAHF,gBAMA,GAAMC,qBAAoB,CAAGH,EAAE,CAAC,oBAAD,CAA/B,CAEA,MAAO,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C,CAG/B,EAH+B,CA3BkC,OAgChET,EAhCgE,CAkChE,oBAAC,UAAD,EACE,OAAO,CAAET,cADX,CAEE,GAAIY,CAFN,CAGE,aAAa,GAHf,CAIE,SAAS,CAAEgB,CAAiB,CAACI,EAJ/B,CAKE,MAAM,CAAEJ,CAAiB,CAACK,GAL5B,EAOG,SAACC,CAAD,QACC,qBAAC,OAAD,EACE,SAAS,CAAE5B,oBAAoB,CAAC,CAAEmB,aAAa,CAAbA,CAAF,CAAiBE,cAAc,CAAdA,CAAjB,CAAD,CAAoC,CACjEhC,SAAS,CAAC,CAAEkB,IAAI,CAAJA,CAAF,CAAQF,IAAI,CAAJA,CAAR,CAAcwB,MAAM,GAApB,CAA4BC,MAAM,GAAlC,CAAD,CADwD,CAEjElC,UAAU,CAAC,CACTmC,EAAE,CAAEzC,gBAAgB,CAACiB,CAAD,CADX,CAAD,CAFuD,CAKjEZ,mBAAmB,CAAC,CAAEiC,OAAO,CAAPA,CAAF,CAAD,CAL8C,CAMjEV,CANiE,CAApC,CADjC,CASE,SAAS,CAAEV,CATb,CAUE,kBAAkB,CAAEC,CAVtB,CAWE,QAAQ,CAAEC,CAXZ,CAYE,SAAS,CAAEE,CAZb,CAaE,cAAc,CAAEC,CAblB,CAcE,cAAc,CAAEC,CAdlB,CAeE,MAAM,CAAEC,CAfV,CAgBE,cAAc,CAAEE,CAhBlB,CAiBE,KAAK,CAAEG,CAjBT,EAmBGhB,CAnBH,CADD,CAPH,CAlCgE,CAoE7D,oBAAC,QAAD,EAAU,GAAG,CAAEH,kBAAkB,CAAC+B,IAAlC,EAAyC5B,CAAzC,CACR,CArEM"}
@@ -0,0 +1 @@
1
+ export * from './ContextMenuWrapper';
@@ -0,0 +1,2 @@
1
+ export*from"./ContextMenuWrapper";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../../src/components/ContextMenu/ContextMenuWrapper/index.ts"],"sourcesContent":["export * from './ContextMenuWrapper';\n"],"mappings":"AAAA"}
@@ -1,10 +1,8 @@
1
1
  /// <reference types="react" />
2
- import { IconPropSize } from '@consta/icons/Icon';
3
- import { TextPropSize } from '../Text/Text';
4
- import { ContextMenuGroupDefault, ContextMenuItemDefault, ContextMenuPropGetGroupId, ContextMenuPropGetGroupLabel, ContextMenuPropGetItemAs, ContextMenuPropGetItemAttributes, ContextMenuPropGetItemDisabled, ContextMenuPropGetItemGroupId, ContextMenuPropGetItemKey, ContextMenuPropGetItemLabel, ContextMenuPropGetItemLeftIcon, ContextMenuPropGetItemLeftSide, ContextMenuPropGetItemOnClick, ContextMenuPropGetItemRightIcon, ContextMenuPropGetItemRightSide, ContextMenuPropGetItemStatus, ContextMenuPropGetItemSubMenu, ContextMenuProps, ContextMenuPropSize, GetLevelsParams, Level, MappersGroup } from './types';
5
- export declare function withDefaultGetters<ITEM, GROUP>(props: ContextMenuProps<ITEM, GROUP>): ({
2
+ import { ContextMenuGroupDefault, ContextMenuItemDefault, ContextMenuLevelsProps, ContextMenuPropGetGroupId, ContextMenuPropGetGroupLabel, ContextMenuPropGetItemAs, ContextMenuPropGetItemAttributes, ContextMenuPropGetItemDisabled, ContextMenuPropGetItemGroupId, ContextMenuPropGetItemKey, ContextMenuPropGetItemLabel, ContextMenuPropGetItemLeftIcon, ContextMenuPropGetItemLeftSide, ContextMenuPropGetItemOnClick, ContextMenuPropGetItemRightIcon, ContextMenuPropGetItemRightSide, ContextMenuPropGetItemStatus, ContextMenuPropGetItemSubMenu, GetLevelsParams, Level } from './types';
3
+ export declare function withDefaultGetters<ITEM, GROUP>(props: ContextMenuLevelsProps<ITEM, GROUP>): ({
6
4
  items: ITEM[];
7
- size?: "s" | "m" | "xs" | "l" | undefined;
5
+ size?: "m" | "s" | "xs" | "l" | undefined;
8
6
  direction?: "downCenter" | "upCenter" | "downRight" | "downLeft" | "upRight" | "upLeft" | "leftUp" | "leftCenter" | "leftDown" | "rightUp" | "rightCenter" | "rightDown" | "downStartLeft" | "upStartLeft" | "downStartRight" | "upStartRight" | "leftStartUp" | "leftStartDown" | "rightStartUp" | "rightStartDown" | undefined;
9
7
  offset?: import("../Popover").PopoverPropOffset | undefined;
10
8
  groups?: GROUP[] | undefined;
@@ -17,10 +15,11 @@ export declare function withDefaultGetters<ITEM, GROUP>(props: ContextMenuProps<
17
15
  onClickOutside?: import("../../hooks/useClickOutside").ClickOutsideHandler | undefined;
18
16
  isOpen?: boolean | undefined;
19
17
  form?: "default" | "round" | "brick" | undefined;
20
- } & import("./types").MappersItem<ITEM> & MappersGroup<GROUP> & {
18
+ isMobile?: boolean | undefined;
19
+ } & import("./types").MappersItem<ITEM> & import("./types").MappersGroup<GROUP> & {
21
20
  anchorRef: import("react").RefObject<HTMLElement>;
22
21
  position?: undefined;
23
- } & Omit<import("react").HTMLAttributes<HTMLDivElement>, "form" | "direction" | "offset" | "size" | "css" | "items" | "groups" | "position" | "isOpen" | "onItemClick" | "sortGroup" | "possibleDirections" | "spareDirection" | "onClickOutside" | "onSetDirection" | "anchorRef" | "subMenuDirection" | keyof import("./types").MappersItem<ITEM_1> | keyof MappersGroup<GROUP_1>> & import("react").RefAttributes<HTMLDivElement> & (GROUP extends {
22
+ } & Omit<import("react").HTMLAttributes<HTMLDivElement>, "css" | "size" | "form" | "direction" | "offset" | "items" | "groups" | "position" | "isOpen" | "onItemClick" | "sortGroup" | "possibleDirections" | "spareDirection" | "onClickOutside" | "onSetDirection" | "anchorRef" | "subMenuDirection" | "isMobile" | keyof import("./types").MappersItem<ITEM_1> | keyof import("./types").MappersGroup<GROUP_1>> & import("react").RefAttributes<HTMLDivElement> & (GROUP extends {
24
23
  id: unknown;
25
24
  } ? {} : {
26
25
  getGroupId: ContextMenuPropGetGroupId<GROUP>;
@@ -44,9 +43,12 @@ export declare function withDefaultGetters<ITEM, GROUP>(props: ContextMenuProps<
44
43
  getItemGroupId: ContextMenuPropGetItemGroupId<ContextMenuItemDefault> | ContextMenuPropGetItemGroupId<ITEM>;
45
44
  getGroupId: ContextMenuPropGetGroupId<ContextMenuGroupDefault> | ContextMenuPropGetGroupId<GROUP>;
46
45
  getGroupLabel: ContextMenuPropGetGroupLabel<ContextMenuGroupDefault> | ContextMenuPropGetGroupLabel<GROUP>;
46
+ setComponentSize: import("react").Dispatch<import("react").SetStateAction<import("../../hooks/useComponentSize").ComponentSize>>;
47
+ disableAnimationBack: () => void;
48
+ enableAnimationBack: () => void;
47
49
  }) | ({
48
50
  items: ITEM[];
49
- size?: "s" | "m" | "xs" | "l" | undefined;
51
+ size?: "m" | "s" | "xs" | "l" | undefined;
50
52
  direction?: "downCenter" | "upCenter" | "downRight" | "downLeft" | "upRight" | "upLeft" | "leftUp" | "leftCenter" | "leftDown" | "rightUp" | "rightCenter" | "rightDown" | "downStartLeft" | "upStartLeft" | "downStartRight" | "upStartRight" | "leftStartUp" | "leftStartDown" | "rightStartUp" | "rightStartDown" | undefined;
51
53
  offset?: import("../Popover").PopoverPropOffset | undefined;
52
54
  groups?: GROUP[] | undefined;
@@ -59,10 +61,11 @@ export declare function withDefaultGetters<ITEM, GROUP>(props: ContextMenuProps<
59
61
  onClickOutside?: import("../../hooks/useClickOutside").ClickOutsideHandler | undefined;
60
62
  isOpen?: boolean | undefined;
61
63
  form?: "default" | "round" | "brick" | undefined;
62
- } & import("./types").MappersItem<ITEM> & MappersGroup<GROUP> & {
64
+ isMobile?: boolean | undefined;
65
+ } & import("./types").MappersItem<ITEM> & import("./types").MappersGroup<GROUP> & {
63
66
  anchorRef?: undefined;
64
67
  position: import("../Popover").Position;
65
- } & Omit<import("react").HTMLAttributes<HTMLDivElement>, "form" | "direction" | "offset" | "size" | "css" | "items" | "groups" | "position" | "isOpen" | "onItemClick" | "sortGroup" | "possibleDirections" | "spareDirection" | "onClickOutside" | "onSetDirection" | "anchorRef" | "subMenuDirection" | keyof import("./types").MappersItem<ITEM_1> | keyof MappersGroup<GROUP_1>> & import("react").RefAttributes<HTMLDivElement> & (GROUP extends {
68
+ } & Omit<import("react").HTMLAttributes<HTMLDivElement>, "css" | "size" | "form" | "direction" | "offset" | "items" | "groups" | "position" | "isOpen" | "onItemClick" | "sortGroup" | "possibleDirections" | "spareDirection" | "onClickOutside" | "onSetDirection" | "anchorRef" | "subMenuDirection" | "isMobile" | keyof import("./types").MappersItem<ITEM_1> | keyof import("./types").MappersGroup<GROUP_1>> & import("react").RefAttributes<HTMLDivElement> & (GROUP extends {
66
69
  id: unknown;
67
70
  } ? {} : {
68
71
  getGroupId: ContextMenuPropGetGroupId<GROUP>;
@@ -86,12 +89,8 @@ export declare function withDefaultGetters<ITEM, GROUP>(props: ContextMenuProps<
86
89
  getItemGroupId: ContextMenuPropGetItemGroupId<ContextMenuItemDefault> | ContextMenuPropGetItemGroupId<ITEM>;
87
90
  getGroupId: ContextMenuPropGetGroupId<ContextMenuGroupDefault> | ContextMenuPropGetGroupId<GROUP>;
88
91
  getGroupLabel: ContextMenuPropGetGroupLabel<ContextMenuGroupDefault> | ContextMenuPropGetGroupLabel<GROUP>;
92
+ setComponentSize: import("react").Dispatch<import("react").SetStateAction<import("../../hooks/useComponentSize").ComponentSize>>;
93
+ disableAnimationBack: () => void;
94
+ enableAnimationBack: () => void;
89
95
  });
90
- export declare const getGroup: <GROUP>(group: GROUP, props: Required<MappersGroup<GROUP>>) => {
91
- id: number;
92
- name: string | undefined;
93
- };
94
96
  export declare const getLevels: <ITEM>(params: GetLevelsParams<ITEM>) => Level<ITEM>[];
95
- export declare const getItemIndex: (groupId: number | string, itemIndex: number) => string;
96
- export declare const sizeMapHeader: Record<ContextMenuPropSize, TextPropSize>;
97
- export declare const sizeMapIcon: Record<ContextMenuPropSize, IconPropSize>;
@@ -1,2 +1,2 @@
1
- import _defineProperty from"@babel/runtime/helpers/defineProperty";function _createForOfIteratorHelper(a,b){var c="undefined"!=typeof Symbol&&a[Symbol.iterator]||a["@@iterator"];if(!c){if(Array.isArray(a)||(c=_unsupportedIterableToArray(a))||b&&a&&"number"==typeof a.length){c&&(a=c);var d=0,e=function(){};return{s:e,n:function n(){return d>=a.length?{done:!0}:{done:!1,value:a[d++]}},e:function e(a){throw a},f:e}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var f,g=!0,h=!1;return{s:function s(){c=c.call(a)},n:function n(){var a=c.next();return g=a.done,a},e:function e(a){h=!0,f=a},f:function f(){try{g||null==c["return"]||c["return"]()}finally{if(h)throw f}}}}function _unsupportedIterableToArray(a,b){if(a){if("string"==typeof a)return _arrayLikeToArray(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);return"Object"===c&&a.constructor&&(c=a.constructor.name),"Map"===c||"Set"===c?Array.from(a):"Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?_arrayLikeToArray(a,b):void 0}}function _arrayLikeToArray(a,b){(null==b||b>a.length)&&(b=a.length);for(var c=0,d=Array(b);c<b;c++)d[c]=a[c];return d}function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{isNotNil}from"../../utils/type-guards";var defaultGetItemKey=function(a){return a.key||a.label},defaultGetItemRightSide=function(a){return a.rightSide},defaultGetItemLeftSide=function(a){return a.leftSide},defaultGetItemRightIcon=function(a){return a.rightIcon},defaultGetItemLeftIcon=function(a){return a.leftIcon},defaultGetItemStatus=function(a){return a.status},defaultGetItemDisabled=function(a){return a.disabled},defaultGetItemLabel=function(a){return a.label},defaultGetItemOnClick=function(a){return a.onClick},defaultGetItemSubMenu=function(a){return a.subMenu},defaultGetItemAs=function(a){return a.as},defaultGetItemAttributes=function(a){return a.attributes},defaultGetItemGroupId=function(a){return a.groupId},defaultGetGroupId=function(a){return a.id},defaultGetGroupLabel=function(a){return a.label};export function withDefaultGetters(a){return _objectSpread(_objectSpread({},a),{},{getItemKey:a.getItemKey||defaultGetItemKey,getItemLabel:a.getItemLabel||defaultGetItemLabel,getItemRightSide:a.getItemRightSide||defaultGetItemRightSide,getItemLeftSide:a.getItemLeftSide||defaultGetItemLeftSide,getItemRightIcon:a.getItemRightIcon||defaultGetItemRightIcon,getItemLeftIcon:a.getItemLeftIcon||defaultGetItemLeftIcon,getItemSubMenu:a.getItemSubMenu||defaultGetItemSubMenu,getItemStatus:a.getItemStatus||defaultGetItemStatus,getItemDisabled:a.getItemDisabled||defaultGetItemDisabled,getItemOnClick:a.getItemOnClick||defaultGetItemOnClick,getItemAs:a.getItemAs||defaultGetItemAs,getItemAttributes:a.getItemAttributes||defaultGetItemAttributes,getItemGroupId:a.getItemGroupId||defaultGetItemGroupId,getGroupId:a.getGroupId||defaultGetGroupId,getGroupLabel:a.getGroupLabel||defaultGetGroupLabel})}export var getGroup=function(a,b){var c=b.getGroupId,d=b.getGroupLabel;return{id:c(a),name:d(a)}};var findItem=function(a){var b,c=a.items,d=a.getItemKey,e=a.getItemSubMenu,f=a.key,g=_createForOfIteratorHelper(c);try{for(g.s();!(b=g.n()).done;){var h=b.value;if(d(h)===f)return h;var i="function"==typeof e&&e(h);if(i){var j=findItem({items:i,key:f,getItemKey:d,getItemSubMenu:e});if(j)return j}}}catch(a){g.e(a)}finally{g.f()}};export var getLevels=function(a){var b=a.levels,c=a.items,d=a.getItemKey,e=a.getItemSubMenu;return b.map(function(a){return _objectSpread(_objectSpread({},a),{},{items:a.items.map(function(a){return findItem({items:c,getItemSubMenu:e,getItemKey:d,key:d(a)})}).filter(isNotNil)})})};export var getItemIndex=function(a,b){return"".concat(a,"-").concat(b)};export var sizeMapHeader={xs:"2xs",s:"2xs",m:"xs",l:"s"};export var sizeMapIcon={xs:"xs",s:"s",m:"s",l:"s"};
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";function _createForOfIteratorHelper(a,b){var c="undefined"!=typeof Symbol&&a[Symbol.iterator]||a["@@iterator"];if(!c){if(Array.isArray(a)||(c=_unsupportedIterableToArray(a))||b&&a&&"number"==typeof a.length){c&&(a=c);var d=0,e=function(){};return{s:e,n:function n(){return d>=a.length?{done:!0}:{done:!1,value:a[d++]}},e:function e(a){throw a},f:e}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var f,g=!0,h=!1;return{s:function s(){c=c.call(a)},n:function n(){var a=c.next();return g=a.done,a},e:function e(a){h=!0,f=a},f:function f(){try{g||null==c["return"]||c["return"]()}finally{if(h)throw f}}}}function _unsupportedIterableToArray(a,b){if(a){if("string"==typeof a)return _arrayLikeToArray(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);return"Object"===c&&a.constructor&&(c=a.constructor.name),"Map"===c||"Set"===c?Array.from(a):"Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?_arrayLikeToArray(a,b):void 0}}function _arrayLikeToArray(a,b){(null==b||b>a.length)&&(b=a.length);for(var c=0,d=Array(b);c<b;c++)d[c]=a[c];return d}function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{isNotNil}from"../../utils/type-guards";var defaultGetItemKey=function(a){return a.key||a.label},defaultGetItemRightSide=function(a){return a.rightSide},defaultGetItemLeftSide=function(a){return a.leftSide},defaultGetItemRightIcon=function(a){return a.rightIcon},defaultGetItemLeftIcon=function(a){return a.leftIcon},defaultGetItemStatus=function(a){return a.status},defaultGetItemDisabled=function(a){return a.disabled},defaultGetItemLabel=function(a){return a.label},defaultGetItemOnClick=function(a){return a.onClick},defaultGetItemSubMenu=function(a){return a.subMenu},defaultGetItemAs=function(a){return a.as},defaultGetItemAttributes=function(a){return a.attributes},defaultGetItemGroupId=function(a){return a.groupId},defaultGetGroupId=function(a){return a.id},defaultGetGroupLabel=function(a){return a.label};export function withDefaultGetters(a){return _objectSpread(_objectSpread({},a),{},{getItemKey:a.getItemKey||defaultGetItemKey,getItemLabel:a.getItemLabel||defaultGetItemLabel,getItemRightSide:a.getItemRightSide||defaultGetItemRightSide,getItemLeftSide:a.getItemLeftSide||defaultGetItemLeftSide,getItemRightIcon:a.getItemRightIcon||defaultGetItemRightIcon,getItemLeftIcon:a.getItemLeftIcon||defaultGetItemLeftIcon,getItemSubMenu:a.getItemSubMenu||defaultGetItemSubMenu,getItemStatus:a.getItemStatus||defaultGetItemStatus,getItemDisabled:a.getItemDisabled||defaultGetItemDisabled,getItemOnClick:a.getItemOnClick||defaultGetItemOnClick,getItemAs:a.getItemAs||defaultGetItemAs,getItemAttributes:a.getItemAttributes||defaultGetItemAttributes,getItemGroupId:a.getItemGroupId||defaultGetItemGroupId,getGroupId:a.getGroupId||defaultGetGroupId,getGroupLabel:a.getGroupLabel||defaultGetGroupLabel})}var findItem=function(a){var b,c=a.items,d=a.getItemKey,e=a.getItemSubMenu,f=a.key,g=_createForOfIteratorHelper(c);try{for(g.s();!(b=g.n()).done;){var h=b.value;if(d(h)===f)return h;var i="function"==typeof e&&e(h);if(i){var j=findItem({items:i,key:f,getItemKey:d,getItemSubMenu:e});if(j)return j}}}catch(a){g.e(a)}finally{g.f()}};export var getLevels=function(a){var b=a.levels,c=a.items,d=a.getItemKey,e=a.getItemSubMenu;return b.map(function(a){return _objectSpread(_objectSpread({},a),{},{items:a.items.map(function(a){return findItem({items:c,getItemSubMenu:e,getItemKey:d,key:d(a)})}).filter(isNotNil)})})};
2
2
  //# sourceMappingURL=helpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","names":["isNotNil","defaultGetItemKey","item","key","label","defaultGetItemRightSide","rightSide","defaultGetItemLeftSide","leftSide","defaultGetItemRightIcon","rightIcon","defaultGetItemLeftIcon","leftIcon","defaultGetItemStatus","status","defaultGetItemDisabled","disabled","defaultGetItemLabel","defaultGetItemOnClick","onClick","defaultGetItemSubMenu","subMenu","defaultGetItemAs","as","defaultGetItemAttributes","attributes","defaultGetItemGroupId","groupId","defaultGetGroupId","group","id","defaultGetGroupLabel","withDefaultGetters","props","getItemKey","getItemLabel","getItemRightSide","getItemLeftSide","getItemRightIcon","getItemLeftIcon","getItemSubMenu","getItemStatus","getItemDisabled","getItemOnClick","getItemAs","getItemAttributes","getItemGroupId","getGroupId","getGroupLabel","getGroup","name","findItem","params","items","subItems","subItem","getLevels","levels","map","level","filter","getItemIndex","itemIndex","sizeMapHeader","xs","s","m","l","sizeMapIcon"],"sources":["../../../../../src/components/ContextMenu/helpers.ts"],"sourcesContent":["import { IconPropSize } from '@consta/icons/Icon';\n\nimport { isNotNil } from '../../utils/type-guards';\nimport { TextPropSize } from '../Text/Text';\nimport {\n ContextMenuGroupDefault,\n ContextMenuItemDefault,\n ContextMenuPropGetGroupId,\n ContextMenuPropGetGroupLabel,\n ContextMenuPropGetItemAs,\n ContextMenuPropGetItemAttributes,\n ContextMenuPropGetItemDisabled,\n ContextMenuPropGetItemGroupId,\n ContextMenuPropGetItemKey,\n ContextMenuPropGetItemLabel,\n ContextMenuPropGetItemLeftIcon,\n ContextMenuPropGetItemLeftSide,\n ContextMenuPropGetItemOnClick,\n ContextMenuPropGetItemRightIcon,\n ContextMenuPropGetItemRightSide,\n ContextMenuPropGetItemStatus,\n ContextMenuPropGetItemSubMenu,\n ContextMenuProps,\n ContextMenuPropSize,\n GetLevelsParams,\n Level,\n MappersGroup,\n} from './types';\n\nconst defaultGetItemKey: ContextMenuPropGetItemKey<ContextMenuItemDefault> = (\n item,\n) => item.key || item.label;\nconst defaultGetItemRightSide: ContextMenuPropGetItemRightSide<\n ContextMenuItemDefault\n> = (item) => item.rightSide;\nconst defaultGetItemLeftSide: ContextMenuPropGetItemLeftSide<\n ContextMenuItemDefault\n> = (item) => item.leftSide;\nconst defaultGetItemRightIcon: ContextMenuPropGetItemRightIcon<\n ContextMenuItemDefault\n> = (item) => item.rightIcon;\nconst defaultGetItemLeftIcon: ContextMenuPropGetItemLeftIcon<\n ContextMenuItemDefault\n> = (item) => item.leftIcon;\nconst defaultGetItemStatus: ContextMenuPropGetItemStatus<\n ContextMenuItemDefault\n> = (item) => item.status;\nconst defaultGetItemDisabled: ContextMenuPropGetItemDisabled<\n ContextMenuItemDefault\n> = (item) => item.disabled;\nconst defaultGetItemLabel: ContextMenuPropGetItemLabel<\n ContextMenuItemDefault\n> = (item) => item.label;\nconst defaultGetItemOnClick: ContextMenuPropGetItemOnClick<\n ContextMenuItemDefault\n> = (item) => item.onClick;\nconst defaultGetItemSubMenu: ContextMenuPropGetItemSubMenu<\n ContextMenuItemDefault\n> = (item) => item.subMenu;\nconst defaultGetItemAs: ContextMenuPropGetItemAs<ContextMenuItemDefault> = (\n item,\n) => item.as;\nconst defaultGetItemAttributes: ContextMenuPropGetItemAttributes<\n ContextMenuItemDefault\n> = (item) => item.attributes;\nconst defaultGetItemGroupId: ContextMenuPropGetItemGroupId<\n ContextMenuItemDefault\n> = (item) => item.groupId;\n\nconst defaultGetGroupId: ContextMenuPropGetGroupId<ContextMenuGroupDefault> = (\n group,\n) => group.id;\nconst defaultGetGroupLabel: ContextMenuPropGetGroupLabel<\n ContextMenuGroupDefault\n> = (group) => group.label;\n\nexport function withDefaultGetters<ITEM, GROUP>(\n props: ContextMenuProps<ITEM, GROUP>,\n) {\n return {\n ...props,\n getItemKey: props.getItemKey || defaultGetItemKey,\n getItemLabel: props.getItemLabel || defaultGetItemLabel,\n getItemRightSide: props.getItemRightSide || defaultGetItemRightSide,\n getItemLeftSide: props.getItemLeftSide || defaultGetItemLeftSide,\n getItemRightIcon: props.getItemRightIcon || defaultGetItemRightIcon,\n getItemLeftIcon: props.getItemLeftIcon || defaultGetItemLeftIcon,\n getItemSubMenu: props.getItemSubMenu || defaultGetItemSubMenu,\n getItemStatus: props.getItemStatus || defaultGetItemStatus,\n getItemDisabled: props.getItemDisabled || defaultGetItemDisabled,\n getItemOnClick: props.getItemOnClick || defaultGetItemOnClick,\n getItemAs: props.getItemAs || defaultGetItemAs,\n getItemAttributes: props.getItemAttributes || defaultGetItemAttributes,\n getItemGroupId: props.getItemGroupId || defaultGetItemGroupId,\n getGroupId: props.getGroupId || defaultGetGroupId,\n getGroupLabel: props.getGroupLabel || defaultGetGroupLabel,\n };\n}\n\nexport const getGroup = <GROUP>(\n group: GROUP,\n props: Required<MappersGroup<GROUP>>,\n) => {\n const { getGroupId, getGroupLabel } = props;\n return {\n id: getGroupId(group),\n name: getGroupLabel(group),\n };\n};\n\nconst findItem = <ITEM>(\n params: Omit<GetLevelsParams<ITEM>, 'levels'> & {\n key: ContextMenuItemDefault['key'];\n },\n): ITEM | undefined => {\n const { items, getItemKey, getItemSubMenu, key } = params;\n for (const item of items) {\n if (getItemKey(item) === key) {\n return item;\n }\n const subItems =\n typeof getItemSubMenu === 'function' && getItemSubMenu(item);\n if (subItems) {\n const subItem = findItem({\n items: subItems,\n key,\n getItemKey,\n getItemSubMenu,\n });\n if (subItem) {\n return subItem;\n }\n }\n }\n return undefined;\n};\n\nexport const getLevels = <ITEM>(\n params: GetLevelsParams<ITEM>,\n): Level<ITEM>[] => {\n const { levels, items, getItemKey, getItemSubMenu } = params;\n\n return levels.map((level) => ({\n ...level,\n items: level.items\n .map((item) =>\n findItem({\n items,\n getItemSubMenu,\n getItemKey,\n key: getItemKey(item),\n }),\n )\n .filter(isNotNil),\n }));\n};\n\nexport const getItemIndex = (groupId: number | string, itemIndex: number) =>\n `${groupId}-${itemIndex}`;\n\nexport const sizeMapHeader: Record<ContextMenuPropSize, TextPropSize> = {\n xs: '2xs',\n s: '2xs',\n m: 'xs',\n l: 's',\n};\n\nexport const sizeMapIcon: Record<ContextMenuPropSize, IconPropSize> = {\n xs: 'xs',\n s: 's',\n m: 's',\n l: 's',\n};\n"],"mappings":"0zDAEA,OAASA,QAAT,+B,GA2BMC,kBAAoE,CAAG,SAC3EC,CAD2E,QAExEA,EAAI,CAACC,GAAL,EAAYD,CAAI,CAACE,KAFuD,C,CAGvEC,uBAEL,CAAG,SAACH,CAAD,QAAUA,EAAI,CAACI,SAAf,C,CACEC,sBAEL,CAAG,SAACL,CAAD,QAAUA,EAAI,CAACM,QAAf,C,CACEC,uBAEL,CAAG,SAACP,CAAD,QAAUA,EAAI,CAACQ,SAAf,C,CACEC,sBAEL,CAAG,SAACT,CAAD,QAAUA,EAAI,CAACU,QAAf,C,CACEC,oBAEL,CAAG,SAACX,CAAD,QAAUA,EAAI,CAACY,MAAf,C,CACEC,sBAEL,CAAG,SAACb,CAAD,QAAUA,EAAI,CAACc,QAAf,C,CACEC,mBAEL,CAAG,SAACf,CAAD,QAAUA,EAAI,CAACE,KAAf,C,CACEc,qBAEL,CAAG,SAAChB,CAAD,QAAUA,EAAI,CAACiB,OAAf,C,CACEC,qBAEL,CAAG,SAAClB,CAAD,QAAUA,EAAI,CAACmB,OAAf,C,CACEC,gBAAkE,CAAG,SACzEpB,CADyE,QAEtEA,EAAI,CAACqB,EAFiE,C,CAGrEC,wBAEL,CAAG,SAACtB,CAAD,QAAUA,EAAI,CAACuB,UAAf,C,CACEC,qBAEL,CAAG,SAACxB,CAAD,QAAUA,EAAI,CAACyB,OAAf,C,CAEEC,iBAAqE,CAAG,SAC5EC,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O,CAIP/B,GAAG,CAAE+B,CAAU,CAAChC,CAAD,CAJR,CAAD,CADL,CADA,EASJ0D,MATI,CASG5D,QATH,CAFS,GAAX,CAaR,CAlBM,CAoBP,MAAO,IAAM6D,aAAY,CAAG,SAAClC,CAAD,CAA2BmC,CAA3B,kBACvBnC,CADuB,aACZmC,CADY,EAArB,CAGP,MAAO,IAAMC,cAAwD,CAAG,CACtEC,EAAE,CAAE,KADkE,CAEtEC,CAAC,CAAE,KAFmE,CAGtEC,CAAC,CAAE,IAHmE,CAItEC,CAAC,CAAE,GAJmE,CAAjE,CAOP,MAAO,IAAMC,YAAsD,CAAG,CACpEJ,EAAE,CAAE,IADgE,CAEpEC,CAAC,CAAE,GAFiE,CAGpEC,CAAC,CAAE,GAHiE,CAIpEC,CAAC,CAAE,GAJiE,CAA/D"}
1
+ {"version":3,"file":"helpers.js","names":["isNotNil","defaultGetItemKey","item","key","label","defaultGetItemRightSide","rightSide","defaultGetItemLeftSide","leftSide","defaultGetItemRightIcon","rightIcon","defaultGetItemLeftIcon","leftIcon","defaultGetItemStatus","status","defaultGetItemDisabled","disabled","defaultGetItemLabel","defaultGetItemOnClick","onClick","defaultGetItemSubMenu","subMenu","defaultGetItemAs","as","defaultGetItemAttributes","attributes","defaultGetItemGroupId","groupId","defaultGetGroupId","group","id","defaultGetGroupLabel","withDefaultGetters","props","getItemKey","getItemLabel","getItemRightSide","getItemLeftSide","getItemRightIcon","getItemLeftIcon","getItemSubMenu","getItemStatus","getItemDisabled","getItemOnClick","getItemAs","getItemAttributes","getItemGroupId","getGroupId","getGroupLabel","findItem","params","items","subItems","subItem","getLevels","levels","map","level","filter"],"sources":["../../../../../src/components/ContextMenu/helpers.ts"],"sourcesContent":["import { isNotNil } from '../../utils/type-guards';\nimport {\n ContextMenuGroupDefault,\n ContextMenuItemDefault,\n ContextMenuLevelsProps,\n ContextMenuPropGetGroupId,\n ContextMenuPropGetGroupLabel,\n ContextMenuPropGetItemAs,\n ContextMenuPropGetItemAttributes,\n ContextMenuPropGetItemDisabled,\n ContextMenuPropGetItemGroupId,\n ContextMenuPropGetItemKey,\n ContextMenuPropGetItemLabel,\n ContextMenuPropGetItemLeftIcon,\n ContextMenuPropGetItemLeftSide,\n ContextMenuPropGetItemOnClick,\n ContextMenuPropGetItemRightIcon,\n ContextMenuPropGetItemRightSide,\n ContextMenuPropGetItemStatus,\n ContextMenuPropGetItemSubMenu,\n GetLevelsParams,\n Level,\n} from './types';\n\nconst defaultGetItemKey: ContextMenuPropGetItemKey<ContextMenuItemDefault> = (\n item,\n) => item.key || item.label;\nconst defaultGetItemRightSide: ContextMenuPropGetItemRightSide<\n ContextMenuItemDefault\n> = (item) => item.rightSide;\nconst defaultGetItemLeftSide: ContextMenuPropGetItemLeftSide<\n ContextMenuItemDefault\n> = (item) => item.leftSide;\nconst defaultGetItemRightIcon: ContextMenuPropGetItemRightIcon<\n ContextMenuItemDefault\n> = (item) => item.rightIcon;\nconst defaultGetItemLeftIcon: ContextMenuPropGetItemLeftIcon<\n ContextMenuItemDefault\n> = (item) => item.leftIcon;\nconst defaultGetItemStatus: ContextMenuPropGetItemStatus<\n ContextMenuItemDefault\n> = (item) => item.status;\nconst defaultGetItemDisabled: ContextMenuPropGetItemDisabled<\n ContextMenuItemDefault\n> = (item) => item.disabled;\nconst defaultGetItemLabel: ContextMenuPropGetItemLabel<\n ContextMenuItemDefault\n> = (item) => item.label;\nconst defaultGetItemOnClick: ContextMenuPropGetItemOnClick<\n ContextMenuItemDefault\n> = (item) => item.onClick;\nconst defaultGetItemSubMenu: ContextMenuPropGetItemSubMenu<\n ContextMenuItemDefault\n> = (item) => item.subMenu;\nconst defaultGetItemAs: ContextMenuPropGetItemAs<ContextMenuItemDefault> = (\n item,\n) => item.as;\nconst defaultGetItemAttributes: ContextMenuPropGetItemAttributes<\n ContextMenuItemDefault\n> = (item) => item.attributes;\nconst defaultGetItemGroupId: ContextMenuPropGetItemGroupId<\n ContextMenuItemDefault\n> = (item) => item.groupId;\n\nconst defaultGetGroupId: ContextMenuPropGetGroupId<ContextMenuGroupDefault> = (\n group,\n) => group.id;\nconst defaultGetGroupLabel: ContextMenuPropGetGroupLabel<\n ContextMenuGroupDefault\n> = (group) => group.label;\n\nexport function withDefaultGetters<ITEM, GROUP>(\n props: ContextMenuLevelsProps<ITEM, GROUP>,\n) {\n return {\n ...props,\n getItemKey: props.getItemKey || defaultGetItemKey,\n getItemLabel: props.getItemLabel || defaultGetItemLabel,\n getItemRightSide: props.getItemRightSide || defaultGetItemRightSide,\n getItemLeftSide: props.getItemLeftSide || defaultGetItemLeftSide,\n getItemRightIcon: props.getItemRightIcon || defaultGetItemRightIcon,\n getItemLeftIcon: props.getItemLeftIcon || defaultGetItemLeftIcon,\n getItemSubMenu: props.getItemSubMenu || defaultGetItemSubMenu,\n getItemStatus: props.getItemStatus || defaultGetItemStatus,\n getItemDisabled: props.getItemDisabled || defaultGetItemDisabled,\n getItemOnClick: props.getItemOnClick || defaultGetItemOnClick,\n getItemAs: props.getItemAs || defaultGetItemAs,\n getItemAttributes: props.getItemAttributes || defaultGetItemAttributes,\n getItemGroupId: props.getItemGroupId || defaultGetItemGroupId,\n getGroupId: props.getGroupId || defaultGetGroupId,\n getGroupLabel: props.getGroupLabel || defaultGetGroupLabel,\n };\n}\n\nconst findItem = <ITEM>(\n params: Omit<GetLevelsParams<ITEM>, 'levels'> & {\n key: ContextMenuItemDefault['key'];\n },\n): ITEM | undefined => {\n const { items, getItemKey, getItemSubMenu, key } = params;\n for (const item of items) {\n if (getItemKey(item) === key) {\n return item;\n }\n const subItems =\n typeof getItemSubMenu === 'function' && getItemSubMenu(item);\n if (subItems) {\n const subItem = findItem({\n items: subItems,\n key,\n getItemKey,\n getItemSubMenu,\n });\n if (subItem) {\n return subItem;\n }\n }\n }\n return undefined;\n};\n\nexport const getLevels = <ITEM>(\n params: GetLevelsParams<ITEM>,\n): Level<ITEM>[] => {\n const { levels, items, getItemKey, getItemSubMenu } = params;\n\n return levels.map((level) => ({\n ...level,\n items: level.items\n .map((item) =>\n findItem({\n items,\n getItemSubMenu,\n getItemKey,\n key: getItemKey(item),\n }),\n )\n .filter(isNotNil),\n }));\n};\n"],"mappings":"0zDAAA,OAASA,QAAT,+B,GAwBMC,kBAAoE,CAAG,SAC3EC,CAD2E,QAExEA,EAAI,CAACC,GAAL,EAAYD,CAAI,CAACE,KAFuD,C,CAGvEC,uBAEL,CAAG,SAACH,CAAD,QAAUA,EAAI,CAACI,SAAf,C,CACEC,sBAEL,CAAG,SAACL,CAAD,QAAUA,EAAI,CAACM,QAAf,C,CACEC,uBAEL,CAAG,SAACP,CAAD,QAAUA,EAAI,CAACQ,SAAf,C,CACEC,sBAEL,CAAG,SAACT,CAAD,QAAUA,EAAI,CAACU,QAAf,C,CACEC,oBAEL,CAAG,SAACX,CAAD,QAAUA,EAAI,CAACY,MAAf,C,CACEC,sBAEL,CAAG,SAACb,CAAD,QAAUA,EAAI,CAACc,QAAf,C,CACEC,mBAEL,CAAG,SAACf,CAAD,QAAUA,EAAI,CAACE,KAAf,C,CACEc,qBAEL,CAAG,SAAChB,CAAD,QAAUA,EAAI,CAACiB,OAAf,C,CACEC,qBAEL,CAAG,SAAClB,CAAD,QAAUA,EAAI,CAACmB,OAAf,C,CACEC,gBAAkE,CAAG,SACzEpB,CADyE,QAEtEA,EAAI,CAACqB,EAFiE,C,CAGrEC,wBAEL,CAAG,SAACtB,CAAD,QAAUA,EAAI,CAACuB,UAAf,C,CACEC,qBAEL,CAAG,SAACxB,CAAD,QAAUA,EAAI,CAACyB,OAAf,C,CAEEC,iBAAqE,CAAG,SAC5EC,CAD4E,QAEzEA,EAAK,CAACC,EAFmE,C,CAGxEC,oBAEL,CAAG,SAACF,CAAD,QAAWA,EAAK,CAACzB,KAAjB,C,CAEJ,MAAO,SAAS4B,mBAAT,CACLC,CADK,CAEL,CACA,sCACKA,CADL,MAEEC,UAAU,CAAED,CAAK,CAACC,UAAN,EAAoBjC,iBAFlC,CAGEkC,YAAY,C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AJ,CAAc,CACZ,GAAMC,EAAO,CAAGJ,QAAQ,CAAC,CACvBE,KAAK,CAAEC,CADgB,CAEvBjD,GAAG,CAAHA,CAFuB,CAGvB+B,UAAU,CAAVA,CAHuB,CAIvBM,cAAc,CAAdA,CAJuB,CAAD,CAAxB,CAMA,GAAIa,CAAJ,CACE,MAAOA,EAEV,CACF,CAnBoB,+BAqBtB,CAzBD,CA2BA,MAAO,IAAMC,UAAS,CAAG,SACvBJ,CADuB,CAEL,CAClB,GAAQK,EAAR,CAAsDL,CAAtD,CAAQK,MAAR,CAAgBJ,CAAhB,CAAsDD,CAAtD,CAAgBC,KAAhB,CAAuBjB,CAAvB,CAAsDgB,CAAtD,CAAuBhB,UAAvB,CAAmCM,CAAnC,CAAsDU,CAAtD,CAAmCV,cAAnC,CAEA,MAAOe,EAAM,CAACC,GAAP,CAAW,SAACC,CAAD,wCACbA,CADa,MAEhBN,KAAK,CAAEM,CAAK,CAACN,KAAN,CACJK,GADI,CACA,SAACtD,CAAD,QACH+C,SAAQ,CAAC,CACPE,KAAK,CAALA,CADO,CAEPX,cAAc,CAAdA,CAFO,CAGPN,UAAU,CAAVA,CAHO,CAIP/B,GAAG,CAAE+B,CAAU,CAAChC,CAAD,CAJR,CAAD,CADL,CADA,EASJwD,MATI,CASG1D,QATH,CAFS,GAAX,CAaR,CAlBM"}
@@ -1,9 +1,11 @@
1
1
  /// <reference types="react" />
2
2
  import { IconComponent } from '@consta/icons/Icon';
3
3
  import { ListPropForm } from "../ListCanary";
4
+ import { ComponentSize } from "../../hooks/useComponentSize";
5
+ import { Animate } from "../../mixs/MixPopoverAnimate";
4
6
  import { ClickOutsideHandler } from '../../hooks/useClickOutside/useClickOutside';
5
7
  import { PropsWithAsAttributes } from '../../utils/types/PropsWithAsAttributes';
6
- import { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';
8
+ import { PropsWithHTMLAttributes, PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';
7
9
  import { Direction, PopoverPropOffset, Position } from '../Popover/Popover';
8
10
  export declare const contextMenuSizes: readonly ["m", "xs", "s", "l"];
9
11
  export declare type ContextMenuPropSize = typeof contextMenuSizes[number];
@@ -88,11 +90,16 @@ export declare type Level<ITEM> = {
88
90
  direction?: Direction;
89
91
  possibleDirections?: readonly Direction[];
90
92
  offset?: PopoverPropOffset;
91
- } & PositioningProps;
93
+ parent?: ITEM;
94
+ anchorRef?: React.RefObject<HTMLElement>;
95
+ position?: Position;
96
+ };
92
97
  export declare type AddLevel<ITEM> = (params: {
93
98
  level: number;
94
99
  items: ITEM[];
100
+ parent?: ITEM;
95
101
  anchorRef?: React.RefObject<HTMLElement>;
102
+ position?: Position;
96
103
  activeItem: string;
97
104
  }) => void;
98
105
  export declare type ContextMenuProps<ITEM = ContextMenuItemDefault, GROUP = ContextMenuGroupDefault> = PropsWithHTMLAttributesAndRef<{
@@ -110,6 +117,7 @@ export declare type ContextMenuProps<ITEM = ContextMenuItemDefault, GROUP = Cont
110
117
  onClickOutside?: ClickOutsideHandler;
111
118
  isOpen?: boolean;
112
119
  form?: ContextMenuForm;
120
+ isMobile?: boolean;
113
121
  } & MappersItem<ITEM> & MappersGroup<GROUP> & PositioningProps, HTMLDivElement> & (GROUP extends {
114
122
  id: ContextMenuGroupDefault['id'] | unknown;
115
123
  } ? {} : {
@@ -119,8 +127,15 @@ export declare type ContextMenuProps<ITEM = ContextMenuItemDefault, GROUP = Cont
119
127
  } ? {} : {
120
128
  getItemLabel: ContextMenuPropGetItemLabel<ITEM>;
121
129
  });
130
+ export declare type ContextMenuLevelsProps<ITEM = ContextMenuItemDefault, GROUP = ContextMenuGroupDefault> = ContextMenuProps<ITEM, GROUP> & {
131
+ setComponentSize: React.Dispatch<React.SetStateAction<ComponentSize>>;
132
+ disableAnimationBack: () => void;
133
+ enableAnimationBack: () => void;
134
+ };
135
+ export declare type ContextMenuLevelsComponent = <ITEM = ContextMenuItemDefault, GROUP = ContextMenuGroupDefault>(props: ContextMenuLevelsProps<ITEM, GROUP>) => React.ReactElement | null;
122
136
  export declare type ContextMenuComponent = <ITEM = ContextMenuItemDefault, GROUP = ContextMenuGroupDefault>(props: ContextMenuProps<ITEM, GROUP>) => React.ReactElement | null;
123
- export declare type ContextMenuLevelProps<ITEM = ContextMenuItemDefault, GROUP = ContextMenuGroupDefault> = Omit<ContextMenuProps<ITEM, GROUP>, 'subMenuDirection' | 'onClickOutside' | keyof MappersItem<ITEM> | keyof MappersGroup<GROUP>> & {
137
+ export declare type ContextMenuLevelProps<ITEM = ContextMenuItemDefault, GROUP = ContextMenuGroupDefault> = Omit<ContextMenuProps<ITEM, GROUP>, 'subMenuDirection' | 'onClickOutside' | 'setComponentSize' | 'animationBack' | 'disableAnimationBack' | 'enableAnimationBack' | keyof MappersItem<ITEM> | keyof MappersGroup<GROUP>> & {
138
+ parent?: ITEM;
124
139
  levelDepth: number;
125
140
  addLevel: AddLevel<ITEM>;
126
141
  deleteLevel: (level: number) => void;
@@ -128,6 +143,7 @@ export declare type ContextMenuLevelProps<ITEM = ContextMenuItemDefault, GROUP =
128
143
  onSetDirection?: (direction: Direction) => void;
129
144
  hoveredParenLevel: number;
130
145
  setHoveredParenLevel: (level: number) => void;
146
+ animate: Animate;
131
147
  } & Required<MappersItem<ITEM>> & Required<MappersGroup<GROUP>>;
132
148
  export declare type ContextMenuLevelComponent = <ITEM, GROUP>(props: ContextMenuLevelProps<ITEM, GROUP>, ref: React.Ref<HTMLElement>) => React.ReactElement | null;
133
149
  export declare type ContextMenuItemProps<AS extends keyof JSX.IntrinsicElements = 'div'> = PropsWithAsAttributes<Omit<ContextMenuItemDefault, 'onClick' | 'attributes' | 'key'> & {
@@ -142,4 +158,37 @@ export declare type GetLevelsParams<ITEM> = {
142
158
  getItemSubMenu: ContextMenuPropGetItemSubMenu<ITEM>;
143
159
  getItemKey: ContextMenuPropGetItemKey<ITEM>;
144
160
  };
161
+ export declare type ContextMenuWrapperProps = PropsWithHTMLAttributes<{
162
+ children: React.ReactNode;
163
+ isOpen?: boolean;
164
+ isMobile?: boolean;
165
+ form?: ContextMenuForm;
166
+ onClickOutside?: ClickOutsideHandler;
167
+ spareDirection?: Direction;
168
+ possibleDirections?: readonly Direction[];
169
+ size?: ContextMenuPropSize;
170
+ direction?: Direction;
171
+ offset?: PopoverPropOffset;
172
+ anchorRef?: React.RefObject<HTMLElement>;
173
+ position?: Position;
174
+ onSetDirection?: (direction: Direction) => void;
175
+ className?: string;
176
+ animationBack?: boolean;
177
+ }, HTMLDivElement>;
178
+ export declare type ContextMenuLevelWrapperProps = PropsWithHTMLAttributesAndRef<{
179
+ children: React.ReactNode;
180
+ isOpen?: boolean;
181
+ isMobile?: boolean;
182
+ form?: ContextMenuForm;
183
+ onClickOutside?: ClickOutsideHandler;
184
+ spareDirection?: Direction;
185
+ possibleDirections?: readonly Direction[];
186
+ size?: ContextMenuPropSize;
187
+ direction?: Direction;
188
+ offset?: PopoverPropOffset;
189
+ anchorRef?: React.RefObject<HTMLElement>;
190
+ position?: Position;
191
+ onSetDirection?: (direction: Direction) => void;
192
+ classname?: string;
193
+ }, HTMLDivElement>;
145
194
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":["defaultListPropForm","listPropForm","contextMenuSizes","contextMenuDefaultSize","contextMenuStatus","contextMenuDefaultStatus","contextMenuForm","defaultContextMenuForm","contextMenuPropSubMenuDirections","contextMenuPropDefaultSubMenuDirection"],"sources":["../../../../../src/components/ContextMenu/types.ts"],"sourcesContent":["import { IconComponent } from '@consta/icons/Icon';\n\nimport {\n defaultListPropForm,\n ListPropForm,\n listPropForm,\n} from '##/components/ListCanary';\n\nimport { ClickOutsideHandler } from '../../hooks/useClickOutside/useClickOutside';\nimport { PropsWithAsAttributes } from '../../utils/types/PropsWithAsAttributes';\nimport { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';\nimport { Direction, PopoverPropOffset, Position } from '../Popover/Popover';\n\nexport const contextMenuSizes = ['m', 'xs', 's', 'l'] as const;\nexport type ContextMenuPropSize = typeof contextMenuSizes[number];\nexport const contextMenuDefaultSize: ContextMenuPropSize = contextMenuSizes[0];\n\nexport const contextMenuStatus = ['alert', 'success', 'warning'] as const;\nexport type ContextMenuStatus = typeof contextMenuStatus[number];\nexport const contextMenuDefaultStatus: ContextMenuStatus = contextMenuStatus[0];\n\nexport const contextMenuForm = listPropForm;\nexport type ContextMenuForm = ListPropForm;\nexport const defaultContextMenuForm = defaultListPropForm;\n\nexport const contextMenuPropSubMenuDirections = [\n 'rightStartUp',\n 'rightStartDown',\n 'leftStartUp',\n 'leftStartDown',\n] as const;\nexport type ContextMenuPropSubMenuDirection =\n typeof contextMenuPropSubMenuDirections[number];\nexport const contextMenuPropDefaultSubMenuDirection: ContextMenuPropSubMenuDirection =\n contextMenuPropSubMenuDirections[0];\n\nexport type ContextMenuPropOnClick<ITEM> = (params: {\n e: React.MouseEvent<HTMLDivElement>;\n item: ITEM;\n}) => void;\n\nexport type ContextMenuGroupDefault = {\n label?: string;\n id: number;\n};\n\nexport type ContextMenuItemDefault = {\n label: string | number;\n key?: string | number;\n rightSide?: React.ReactNode;\n rightIcon?: IconComponent;\n leftSide?: React.ReactNode;\n leftIcon?: IconComponent;\n subMenu?: ContextMenuItemDefault[];\n status?: ContextMenuStatus;\n disabled?: boolean;\n groupId?: number;\n onClick?: ContextMenuPropOnClick<ContextMenuItemDefault>;\n as?: keyof JSX.IntrinsicElements;\n attributes?: JSX.IntrinsicElements[keyof JSX.IntrinsicElements];\n};\n\nexport type ContextMenuPropSortGroup = (\n a: string | number,\n b: string | number,\n) => number;\n\nexport type ContextMenuPropGetItemLabel<ITEM> = (item: ITEM) => string | number;\n\nexport type ContextMenuPropGetItemRightSide<ITEM> = (\n item: ITEM,\n) => React.ReactNode | undefined;\n\nexport type ContextMenuPropGetItemLeftSide<ITEM> = (\n item: ITEM,\n) => React.ReactNode | undefined;\n\nexport type ContextMenuPropGetItemSubMenu<ITEM> = (\n item: ITEM,\n) => ITEM[] | undefined;\n\nexport type ContextMenuPropGetItemStatus<ITEM> = (\n item: ITEM,\n) => ContextMenuStatus | undefined;\n\nexport type ContextMenuPropGetItemKey<ITEM> = (\n item: ITEM,\n) => string | number | undefined;\n\nexport type ContextMenuPropGetItemOnClick<ITEM> = (\n item: ITEM,\n) => ContextMenuPropOnClick<ITEM> | undefined;\n\nexport type ContextMenuPropGetItemDisabled<ITEM> = (\n item: ITEM,\n) => boolean | undefined;\n\nexport type ContextMenuPropGetItemAs<ITEM> = (\n item: ITEM,\n) => keyof JSX.IntrinsicElements | undefined;\n\nexport type ContextMenuPropGetItemAttributes<ITEM> = (\n item: ITEM,\n) => JSX.IntrinsicElements[keyof JSX.IntrinsicElements] | undefined;\n\nexport type ContextMenuPropGetItemGroupId<ITEM> = (\n item: ITEM,\n) => number | undefined;\n\nexport type ContextMenuPropGetItemRightIcon<ITEM> = (\n item: ITEM,\n) => IconComponent | undefined;\n\nexport type ContextMenuPropGetItemLeftIcon<ITEM> = (\n item: ITEM,\n) => IconComponent | undefined;\n\nexport type ContextMenuPropGetGroupLabel<GROUP> = (\n group: GROUP,\n) => string | undefined;\nexport type ContextMenuPropGetGroupId<GROUP> = (group: GROUP) => number;\n\ntype PositioningProps =\n | {\n anchorRef: React.RefObject<HTMLElement>;\n position?: never;\n }\n | {\n anchorRef?: never;\n position: Position;\n };\n\nexport type MappersItem<ITEM> = {\n getItemLabel?: ContextMenuPropGetItemLabel<ITEM>;\n getItemRightSide?: ContextMenuPropGetItemRightSide<ITEM>;\n getItemLeftSide?: ContextMenuPropGetItemLeftSide<ITEM>;\n getItemSubMenu?: ContextMenuPropGetItemSubMenu<ITEM>;\n getItemStatus?: ContextMenuPropGetItemStatus<ITEM>;\n getItemDisabled?: ContextMenuPropGetItemDisabled<ITEM>;\n getItemKey?: ContextMenuPropGetItemKey<ITEM>;\n getItemOnClick?: ContextMenuPropGetItemOnClick<ITEM>;\n getItemAs?: ContextMenuPropGetItemAs<ITEM>;\n getItemAttributes?: ContextMenuPropGetItemAttributes<ITEM>;\n getItemGroupId?: ContextMenuPropGetItemGroupId<ITEM>;\n getItemLeftIcon?: ContextMenuPropGetItemLeftIcon<ITEM>;\n getItemRightIcon?: ContextMenuPropGetItemRightIcon<ITEM>;\n};\n\nexport type MappersGroup<GROUP> = {\n getGroupLabel?: ContextMenuPropGetGroupLabel<GROUP>;\n getGroupId?: ContextMenuPropGetGroupId<GROUP>;\n};\n\nexport type Level<ITEM> = {\n items: ITEM[];\n activeItem?: string;\n direction?: Direction;\n possibleDirections?: readonly Direction[];\n offset?: PopoverPropOffset;\n} & PositioningProps;\n\nexport type AddLevel<ITEM> = (params: {\n level: number;\n items: ITEM[];\n anchorRef?: React.RefObject<HTMLElement>;\n activeItem: string;\n}) => void;\n\nexport type ContextMenuProps<\n ITEM = ContextMenuItemDefault,\n GROUP = ContextMenuGroupDefault,\n> = PropsWithHTMLAttributesAndRef<\n {\n items: ITEM[];\n size?: ContextMenuPropSize;\n direction?: Direction;\n offset?: PopoverPropOffset;\n groups?: GROUP[];\n sortGroup?: ContextMenuPropSortGroup;\n onItemClick?: ContextMenuPropOnClick<ITEM>;\n possibleDirections?: readonly Direction[];\n subMenuDirection?: ContextMenuPropSubMenuDirection;\n spareDirection?: Direction;\n onSetDirection?: (direction: Direction) => void;\n onClickOutside?: ClickOutsideHandler;\n isOpen?: boolean;\n form?: ContextMenuForm;\n } & MappersItem<ITEM> &\n MappersGroup<GROUP> &\n PositioningProps,\n HTMLDivElement\n> &\n (GROUP extends { id: ContextMenuGroupDefault['id'] | unknown }\n ? {}\n : { getGroupId: ContextMenuPropGetGroupId<GROUP> }) &\n (ITEM extends { label: ContextMenuItemDefault['label'] }\n ? {}\n : { getItemLabel: ContextMenuPropGetItemLabel<ITEM> });\n\nexport type ContextMenuComponent = <\n ITEM = ContextMenuItemDefault,\n GROUP = ContextMenuGroupDefault,\n>(\n props: ContextMenuProps<ITEM, GROUP>,\n) => React.ReactElement | null;\n\nexport type ContextMenuLevelProps<\n ITEM = ContextMenuItemDefault,\n GROUP = ContextMenuGroupDefault,\n> = Omit<\n ContextMenuProps<ITEM, GROUP>,\n | 'subMenuDirection'\n | 'onClickOutside'\n | keyof MappersItem<ITEM>\n | keyof MappersGroup<GROUP>\n> & {\n levelDepth: number;\n addLevel: AddLevel<ITEM>;\n deleteLevel: (level: number) => void;\n activeItem?: string;\n onSetDirection?: (direction: Direction) => void;\n hoveredParenLevel: number;\n setHoveredParenLevel: (level: number) => void;\n} & Required<MappersItem<ITEM>> &\n Required<MappersGroup<GROUP>>;\n\nexport type ContextMenuLevelComponent = <ITEM, GROUP>(\n props: ContextMenuLevelProps<ITEM, GROUP>,\n ref: React.Ref<HTMLElement>,\n) => React.ReactElement | null;\n\nexport type ContextMenuItemProps<\n AS extends keyof JSX.IntrinsicElements = 'div',\n> = PropsWithAsAttributes<\n Omit<ContextMenuItemDefault, 'onClick' | 'attributes' | 'key'> & {\n size?: ContextMenuPropSize;\n active: boolean;\n withSubMenu: boolean;\n },\n AS\n> &\n React.RefAttributes<HTMLDivElement>;\n\nexport type ContextMenuItemComponent = <\n AS extends keyof JSX.IntrinsicElements = 'div',\n>(\n props: ContextMenuItemProps<AS>,\n ref: React.Ref<HTMLElement>,\n) => React.ReactElement | null;\n\nexport type GetLevelsParams<ITEM> = {\n levels: Level<ITEM>[];\n items: ITEM[];\n getItemSubMenu: ContextMenuPropGetItemSubMenu<ITEM>;\n getItemKey: ContextMenuPropGetItemKey<ITEM>;\n};\n"],"mappings":"AAEA,OACEA,mBADF,CAGEC,YAHF,qBAWA,MAAO,IAAMC,iBAAgB,CAAG,CAAC,GAAD,CAAM,IAAN,CAAY,GAAZ,CAAiB,GAAjB,CAAzB,CAEP,MAAO,IAAMC,uBAA2C,CAAGD,gBAAgB,CAAC,CAAD,CAApE,CAEP,MAAO,IAAME,kBAAiB,CAAG,CAAC,OAAD,CAAU,SAAV,CAAqB,SAArB,CAA1B,CAEP,MAAO,IAAMC,yBAA2C,CAAGD,iBAAiB,CAAC,CAAD,CAArE,CAEP,MAAO,IAAME,gBAAe,CAAGL,YAAxB,CAEP,MAAO,IAAMM,uBAAsB,CAAGP,mBAA/B,CAEP,MAAO,IAAMQ,iCAAgC,CAAG,CAC9C,cAD8C,CAE9C,gBAF8C,CAG9C,aAH8C,CAI9C,eAJ8C,CAAzC,CAQP,MAAO,IAAMC,uCAAuE,CAClFD,gCAAgC,CAAC,CAAD,CAD3B"}
1
+ {"version":3,"file":"types.js","names":["defaultListPropForm","listPropForm","contextMenuSizes","contextMenuDefaultSize","contextMenuStatus","contextMenuDefaultStatus","contextMenuForm","defaultContextMenuForm","contextMenuPropSubMenuDirections","contextMenuPropDefaultSubMenuDirection"],"sources":["../../../../../src/components/ContextMenu/types.ts"],"sourcesContent":["import { IconComponent } from '@consta/icons/Icon';\n\nimport {\n defaultListPropForm,\n ListPropForm,\n listPropForm,\n} from '##/components/ListCanary';\nimport { ComponentSize } from '##/hooks/useComponentSize';\nimport { Animate } from '##/mixs/MixPopoverAnimate';\n\nimport { ClickOutsideHandler } from '../../hooks/useClickOutside/useClickOutside';\nimport { PropsWithAsAttributes } from '../../utils/types/PropsWithAsAttributes';\nimport {\n PropsWithHTMLAttributes,\n PropsWithHTMLAttributesAndRef,\n} from '../../utils/types/PropsWithHTMLAttributes';\nimport { Direction, PopoverPropOffset, Position } from '../Popover/Popover';\n\nexport const contextMenuSizes = ['m', 'xs', 's', 'l'] as const;\nexport type ContextMenuPropSize = typeof contextMenuSizes[number];\nexport const contextMenuDefaultSize: ContextMenuPropSize = contextMenuSizes[0];\n\nexport const contextMenuStatus = ['alert', 'success', 'warning'] as const;\nexport type ContextMenuStatus = typeof contextMenuStatus[number];\nexport const contextMenuDefaultStatus: ContextMenuStatus = contextMenuStatus[0];\n\nexport const contextMenuForm = listPropForm;\nexport type ContextMenuForm = ListPropForm;\nexport const defaultContextMenuForm = defaultListPropForm;\n\nexport const contextMenuPropSubMenuDirections = [\n 'rightStartUp',\n 'rightStartDown',\n 'leftStartUp',\n 'leftStartDown',\n] as const;\nexport type ContextMenuPropSubMenuDirection =\n typeof contextMenuPropSubMenuDirections[number];\nexport const contextMenuPropDefaultSubMenuDirection: ContextMenuPropSubMenuDirection =\n contextMenuPropSubMenuDirections[0];\n\nexport type ContextMenuPropOnClick<ITEM> = (params: {\n e: React.MouseEvent<HTMLDivElement>;\n item: ITEM;\n}) => void;\n\nexport type ContextMenuGroupDefault = {\n label?: string;\n id: number;\n};\n\nexport type ContextMenuItemDefault = {\n label: string | number;\n key?: string | number;\n rightSide?: React.ReactNode;\n rightIcon?: IconComponent;\n leftSide?: React.ReactNode;\n leftIcon?: IconComponent;\n subMenu?: ContextMenuItemDefault[];\n status?: ContextMenuStatus;\n disabled?: boolean;\n groupId?: number;\n onClick?: ContextMenuPropOnClick<ContextMenuItemDefault>;\n as?: keyof JSX.IntrinsicElements;\n attributes?: JSX.IntrinsicElements[keyof JSX.IntrinsicElements];\n};\n\nexport type ContextMenuPropSortGroup = (\n a: string | number,\n b: string | number,\n) => number;\n\nexport type ContextMenuPropGetItemLabel<ITEM> = (item: ITEM) => string | number;\n\nexport type ContextMenuPropGetItemRightSide<ITEM> = (\n item: ITEM,\n) => React.ReactNode | undefined;\n\nexport type ContextMenuPropGetItemLeftSide<ITEM> = (\n item: ITEM,\n) => React.ReactNode | undefined;\n\nexport type ContextMenuPropGetItemSubMenu<ITEM> = (\n item: ITEM,\n) => ITEM[] | undefined;\n\nexport type ContextMenuPropGetItemStatus<ITEM> = (\n item: ITEM,\n) => ContextMenuStatus | undefined;\n\nexport type ContextMenuPropGetItemKey<ITEM> = (\n item: ITEM,\n) => string | number | undefined;\n\nexport type ContextMenuPropGetItemOnClick<ITEM> = (\n item: ITEM,\n) => ContextMenuPropOnClick<ITEM> | undefined;\n\nexport type ContextMenuPropGetItemDisabled<ITEM> = (\n item: ITEM,\n) => boolean | undefined;\n\nexport type ContextMenuPropGetItemAs<ITEM> = (\n item: ITEM,\n) => keyof JSX.IntrinsicElements | undefined;\n\nexport type ContextMenuPropGetItemAttributes<ITEM> = (\n item: ITEM,\n) => JSX.IntrinsicElements[keyof JSX.IntrinsicElements] | undefined;\n\nexport type ContextMenuPropGetItemGroupId<ITEM> = (\n item: ITEM,\n) => number | undefined;\n\nexport type ContextMenuPropGetItemRightIcon<ITEM> = (\n item: ITEM,\n) => IconComponent | undefined;\n\nexport type ContextMenuPropGetItemLeftIcon<ITEM> = (\n item: ITEM,\n) => IconComponent | undefined;\n\nexport type ContextMenuPropGetGroupLabel<GROUP> = (\n group: GROUP,\n) => string | undefined;\nexport type ContextMenuPropGetGroupId<GROUP> = (group: GROUP) => number;\n\ntype PositioningProps =\n | {\n anchorRef: React.RefObject<HTMLElement>;\n position?: never;\n }\n | {\n anchorRef?: never;\n position: Position;\n };\n\nexport type MappersItem<ITEM> = {\n getItemLabel?: ContextMenuPropGetItemLabel<ITEM>;\n getItemRightSide?: ContextMenuPropGetItemRightSide<ITEM>;\n getItemLeftSide?: ContextMenuPropGetItemLeftSide<ITEM>;\n getItemSubMenu?: ContextMenuPropGetItemSubMenu<ITEM>;\n getItemStatus?: ContextMenuPropGetItemStatus<ITEM>;\n getItemDisabled?: ContextMenuPropGetItemDisabled<ITEM>;\n getItemKey?: ContextMenuPropGetItemKey<ITEM>;\n getItemOnClick?: ContextMenuPropGetItemOnClick<ITEM>;\n getItemAs?: ContextMenuPropGetItemAs<ITEM>;\n getItemAttributes?: ContextMenuPropGetItemAttributes<ITEM>;\n getItemGroupId?: ContextMenuPropGetItemGroupId<ITEM>;\n getItemLeftIcon?: ContextMenuPropGetItemLeftIcon<ITEM>;\n getItemRightIcon?: ContextMenuPropGetItemRightIcon<ITEM>;\n};\n\nexport type MappersGroup<GROUP> = {\n getGroupLabel?: ContextMenuPropGetGroupLabel<GROUP>;\n getGroupId?: ContextMenuPropGetGroupId<GROUP>;\n};\n\nexport type Level<ITEM> = {\n items: ITEM[];\n activeItem?: string;\n direction?: Direction;\n possibleDirections?: readonly Direction[];\n offset?: PopoverPropOffset;\n parent?: ITEM;\n anchorRef?: React.RefObject<HTMLElement>;\n position?: Position;\n};\n\nexport type AddLevel<ITEM> = (params: {\n level: number;\n items: ITEM[];\n parent?: ITEM;\n anchorRef?: React.RefObject<HTMLElement>;\n position?: Position;\n activeItem: string;\n}) => void;\n\nexport type ContextMenuProps<\n ITEM = ContextMenuItemDefault,\n GROUP = ContextMenuGroupDefault,\n> = PropsWithHTMLAttributesAndRef<\n {\n items: ITEM[];\n size?: ContextMenuPropSize;\n direction?: Direction;\n offset?: PopoverPropOffset;\n groups?: GROUP[];\n sortGroup?: ContextMenuPropSortGroup;\n onItemClick?: ContextMenuPropOnClick<ITEM>;\n possibleDirections?: readonly Direction[];\n subMenuDirection?: ContextMenuPropSubMenuDirection;\n spareDirection?: Direction;\n onSetDirection?: (direction: Direction) => void;\n onClickOutside?: ClickOutsideHandler;\n isOpen?: boolean;\n form?: ContextMenuForm;\n isMobile?: boolean;\n } & MappersItem<ITEM> &\n MappersGroup<GROUP> &\n PositioningProps,\n HTMLDivElement\n> &\n (GROUP extends { id: ContextMenuGroupDefault['id'] | unknown }\n ? {}\n : { getGroupId: ContextMenuPropGetGroupId<GROUP> }) &\n (ITEM extends { label: ContextMenuItemDefault['label'] }\n ? {}\n : { getItemLabel: ContextMenuPropGetItemLabel<ITEM> });\n\nexport type ContextMenuLevelsProps<\n ITEM = ContextMenuItemDefault,\n GROUP = ContextMenuGroupDefault,\n> = ContextMenuProps<ITEM, GROUP> & {\n setComponentSize: React.Dispatch<React.SetStateAction<ComponentSize>>;\n disableAnimationBack: () => void;\n enableAnimationBack: () => void;\n};\n\nexport type ContextMenuLevelsComponent = <\n ITEM = ContextMenuItemDefault,\n GROUP = ContextMenuGroupDefault,\n>(\n props: ContextMenuLevelsProps<ITEM, GROUP>,\n) => React.ReactElement | null;\n\nexport type ContextMenuComponent = <\n ITEM = ContextMenuItemDefault,\n GROUP = ContextMenuGroupDefault,\n>(\n props: ContextMenuProps<ITEM, GROUP>,\n) => React.ReactElement | null;\n\nexport type ContextMenuLevelProps<\n ITEM = ContextMenuItemDefault,\n GROUP = ContextMenuGroupDefault,\n> = Omit<\n ContextMenuProps<ITEM, GROUP>,\n | 'subMenuDirection'\n | 'onClickOutside'\n | 'setComponentSize'\n | 'animationBack'\n | 'disableAnimationBack'\n | 'enableAnimationBack'\n | keyof MappersItem<ITEM>\n | keyof MappersGroup<GROUP>\n> & {\n parent?: ITEM;\n levelDepth: number;\n addLevel: AddLevel<ITEM>;\n deleteLevel: (level: number) => void;\n activeItem?: string;\n onSetDirection?: (direction: Direction) => void;\n hoveredParenLevel: number;\n setHoveredParenLevel: (level: number) => void;\n animate: Animate;\n} & Required<MappersItem<ITEM>> &\n Required<MappersGroup<GROUP>>;\n\nexport type ContextMenuLevelComponent = <ITEM, GROUP>(\n props: ContextMenuLevelProps<ITEM, GROUP>,\n ref: React.Ref<HTMLElement>,\n) => React.ReactElement | null;\n\nexport type ContextMenuItemProps<\n AS extends keyof JSX.IntrinsicElements = 'div',\n> = PropsWithAsAttributes<\n Omit<ContextMenuItemDefault, 'onClick' | 'attributes' | 'key'> & {\n size?: ContextMenuPropSize;\n active: boolean;\n withSubMenu: boolean;\n },\n AS\n> &\n React.RefAttributes<HTMLDivElement>;\n\nexport type ContextMenuItemComponent = <\n AS extends keyof JSX.IntrinsicElements = 'div',\n>(\n props: ContextMenuItemProps<AS>,\n ref: React.Ref<HTMLElement>,\n) => React.ReactElement | null;\n\nexport type GetLevelsParams<ITEM> = {\n levels: Level<ITEM>[];\n items: ITEM[];\n getItemSubMenu: ContextMenuPropGetItemSubMenu<ITEM>;\n getItemKey: ContextMenuPropGetItemKey<ITEM>;\n};\n\nexport type ContextMenuWrapperProps = PropsWithHTMLAttributes<\n {\n children: React.ReactNode;\n isOpen?: boolean;\n isMobile?: boolean;\n form?: ContextMenuForm;\n onClickOutside?: ClickOutsideHandler;\n spareDirection?: Direction;\n possibleDirections?: readonly Direction[];\n size?: ContextMenuPropSize;\n direction?: Direction;\n offset?: PopoverPropOffset;\n anchorRef?: React.RefObject<HTMLElement>;\n position?: Position;\n onSetDirection?: (direction: Direction) => void;\n className?: string;\n animationBack?: boolean;\n },\n HTMLDivElement\n>;\n\nexport type ContextMenuLevelWrapperProps = PropsWithHTMLAttributesAndRef<\n {\n children: React.ReactNode;\n isOpen?: boolean;\n isMobile?: boolean;\n form?: ContextMenuForm;\n onClickOutside?: ClickOutsideHandler;\n spareDirection?: Direction;\n possibleDirections?: readonly Direction[];\n size?: ContextMenuPropSize;\n direction?: Direction;\n offset?: PopoverPropOffset;\n anchorRef?: React.RefObject<HTMLElement>;\n position?: Position;\n onSetDirection?: (direction: Direction) => void;\n classname?: string;\n },\n HTMLDivElement\n>;\n"],"mappings":"AAEA,OACEA,mBADF,CAGEC,YAHF,qBAgBA,MAAO,IAAMC,iBAAgB,CAAG,CAAC,GAAD,CAAM,IAAN,CAAY,GAAZ,CAAiB,GAAjB,CAAzB,CAEP,MAAO,IAAMC,uBAA2C,CAAGD,gBAAgB,CAAC,CAAD,CAApE,CAEP,MAAO,IAAME,kBAAiB,CAAG,CAAC,OAAD,CAAU,SAAV,CAAqB,SAArB,CAA1B,CAEP,MAAO,IAAMC,yBAA2C,CAAGD,iBAAiB,CAAC,CAAD,CAArE,CAEP,MAAO,IAAME,gBAAe,CAAGL,YAAxB,CAEP,MAAO,IAAMM,uBAAsB,CAAGP,mBAA/B,CAEP,MAAO,IAAMQ,iCAAgC,CAAG,CAC9C,cAD8C,CAE9C,gBAF8C,CAG9C,aAH8C,CAI9C,eAJ8C,CAAzC,CAQP,MAAO,IAAMC,uCAAuE,CAClFD,gCAAgC,CAAC,CAAD,CAD3B"}
@@ -1 +1 @@
1
- .ContextMenuDivider{--vertical-space:0;background:var(--color-control-bg-border-default);height:var(--control-border-width);margin:var(--vertical-space) var(--space-s)}.ContextMenuDivider_size_l{--vertical-space:var(--space-xs)}.ContextMenuDivider_size_m,.ContextMenuDivider_size_s{--vertical-space:var(--space-2xs)}
1
+ .ContextMenuDividerDeprecated{--vertical-space:0;background:var(--color-control-bg-border-default);height:var(--control-border-width);margin:var(--vertical-space) var(--space-s)}.ContextMenuDividerDeprecated_size_l{--vertical-space:var(--space-xs)}.ContextMenuDividerDeprecated_size_m,.ContextMenuDividerDeprecated_size_s{--vertical-space:var(--space-2xs)}
@@ -1,2 +1,2 @@
1
- import"./ContextMenuDivider.css";import React from"react";import{cn}from"../../../utils/bem";import{contextMenuDefaultSize}from"../helpers";var cnContextMenuDivider=cn("ContextMenuDivider");export var ContextMenuDivider=function(a){var b=a.size,c=void 0===b?contextMenuDefaultSize:b;return React.createElement("div",{className:cnContextMenuDivider({size:c})})};
1
+ import"./ContextMenuDivider.css";import React from"react";import{cn}from"../../../utils/bem";import{contextMenuDefaultSize}from"../helpers";var cnContextMenuDivider=cn("ContextMenuDividerDeprecated");export var ContextMenuDivider=function(a){var b=a.size,c=void 0===b?contextMenuDefaultSize:b;return React.createElement("div",{className:cnContextMenuDivider({size:c})})};
2
2
  //# sourceMappingURL=ContextMenuDivider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ContextMenuDivider.js","names":["React","cn","contextMenuDefaultSize","cnContextMenuDivider","ContextMenuDivider","props","size"],"sources":["../../../../../../src/components/ContextMenuDeprecated/ContextMenuDivider/ContextMenuDivider.tsx"],"sourcesContent":["import './ContextMenuDivider.css';\n\nimport React from 'react';\n\nimport { cn } from '../../../utils/bem';\nimport { contextMenuDefaultSize, ContextMenuPropSize } from '../helpers';\n\nconst cnContextMenuDivider = cn('ContextMenuDivider');\n\nexport const ContextMenuDivider: React.FC<{\n size?: ContextMenuPropSize;\n children?: never;\n}> = (props) => {\n const { size = contextMenuDefaultSize } = props;\n return <div className={cnContextMenuDivider({ size })} />;\n};\n"],"mappings":"AAAA,iCAEA,MAAOA,MAAP,KAAkB,OAAlB,CAEA,OAASC,EAAT,0BACA,OAASC,sBAAT,kBAEA,GAAMC,qBAAoB,CAAGF,EAAE,CAAC,oBAAD,CAA/B,CAEA,MAAO,IAAMG,mBAGX,CAAG,SAACC,CAAD,CAAW,CACd,MAA0CA,CAA1C,CAAQC,IAAR,CAAQA,CAAR,YAAeJ,sBAAf,GACA,MAAO,4BAAK,SAAS,CAAEC,oBAAoB,CAAC,CAAEG,IAAI,CAAJA,CAAF,CAAD,CAApC,EACR,CANM"}
1
+ {"version":3,"file":"ContextMenuDivider.js","names":["React","cn","contextMenuDefaultSize","cnContextMenuDivider","ContextMenuDivider","props","size"],"sources":["../../../../../../src/components/ContextMenuDeprecated/ContextMenuDivider/ContextMenuDivider.tsx"],"sourcesContent":["import './ContextMenuDivider.css';\n\nimport React from 'react';\n\nimport { cn } from '../../../utils/bem';\nimport { contextMenuDefaultSize, ContextMenuPropSize } from '../helpers';\n\nconst cnContextMenuDivider = cn('ContextMenuDividerDeprecated');\n\nexport const ContextMenuDivider: React.FC<{\n size?: ContextMenuPropSize;\n children?: never;\n}> = (props) => {\n const { size = contextMenuDefaultSize } = props;\n return <div className={cnContextMenuDivider({ size })} />;\n};\n"],"mappings":"AAAA,iCAEA,MAAOA,MAAP,KAAkB,OAAlB,CAEA,OAASC,EAAT,0BACA,OAASC,sBAAT,kBAEA,GAAMC,qBAAoB,CAAGF,EAAE,CAAC,8BAAD,CAA/B,CAEA,MAAO,IAAMG,mBAGX,CAAG,SAACC,CAAD,CAAW,CACd,MAA0CA,CAA1C,CAAQC,IAAR,CAAQA,CAAR,YAAeJ,sBAAf,GACA,MAAO,4BAAK,SAAS,CAAEC,oBAAoB,CAAC,CAAEG,IAAI,CAAJA,CAAF,CAAD,CAApC,EACR,CANM"}
@@ -1 +1 @@
1
- .ContextMenuGroupHeader{--top-space:0;--bottom-space:0;border-bottom:solid var(--control-border-width) var(--color-control-bg-border-default);letter-spacing:.05em;margin:0 var(--space-s);padding:var(--top-space) 0 var(--bottom-space) 0}.ContextMenuGroupHeader_size_s{--top-space:var(--space-xs);--bottom-space:var(--space-2xs)}.ContextMenuGroupHeader_size_m{--top-space:var(--space-s);--bottom-space:var(--space-xs)}.ContextMenuGroupHeader_size_l{--top-space:var(--space-s);--bottom-space:var(--space-s)}.ContextMenuGroupHeader_first{padding:calc(var(--top-space) - var(--space-xs)) 0 var(--bottom-space) 0}
1
+ .ContextMenuGroupHeaderDeprecated{--top-space:0;--bottom-space:0;border-bottom:solid var(--control-border-width) var(--color-control-bg-border-default);letter-spacing:.05em;margin:0 var(--space-s);padding:var(--top-space) 0 var(--bottom-space) 0}.ContextMenuGroupHeaderDeprecated_size_s{--top-space:var(--space-xs);--bottom-space:var(--space-2xs)}.ContextMenuGroupHeaderDeprecated_size_m{--top-space:var(--space-s);--bottom-space:var(--space-xs)}.ContextMenuGroupHeaderDeprecated_size_l{--top-space:var(--space-s);--bottom-space:var(--space-s)}.ContextMenuGroupHeaderDeprecated_first{padding:calc(var(--top-space) - var(--space-xs)) 0 var(--bottom-space) 0}
@@ -1,2 +1,2 @@
1
- import"./ContextMenuGroupHeader.css";import React from"react";import{cn}from"../../../utils/bem";import{getByMap}from"../../../utils/getByMap";import{Text}from"../../Text/Text";import{contextMenuDefaultSize}from"../helpers";export var cnContextMenuGroupHeader=cn("ContextMenuGroupHeader");var sizeMap={s:"2xs",m:"xs",l:"s"};export var ContextMenuGroupHeader=function(a){var b=a.label,c=a.size,d=void 0===c?contextMenuDefaultSize:c,e=a.first;return React.createElement(Text,{view:"secondary",transform:"uppercase",className:cnContextMenuGroupHeader({size:d,first:e}),size:getByMap(sizeMap,d)},b)};
1
+ import"./ContextMenuGroupHeader.css";import React from"react";import{cn}from"../../../utils/bem";import{getByMap}from"../../../utils/getByMap";import{Text}from"../../Text/Text";import{contextMenuDefaultSize}from"../helpers";export var cnContextMenuGroupHeader=cn("ContextMenuGroupHeaderDeprecated");var sizeMap={s:"2xs",m:"xs",l:"s"};export var ContextMenuGroupHeader=function(a){var b=a.label,c=a.size,d=void 0===c?contextMenuDefaultSize:c,e=a.first;return React.createElement(Text,{view:"secondary",transform:"uppercase",className:cnContextMenuGroupHeader({size:d,first:e}),size:getByMap(sizeMap,d)},b)};
2
2
  //# sourceMappingURL=ContextMenuGroupHeader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ContextMenuGroupHeader.js","names":["React","cn","getByMap","Text","contextMenuDefaultSize","cnContextMenuGroupHeader","sizeMap","s","m","l","ContextMenuGroupHeader","label","size","first"],"sources":["../../../../../../src/components/ContextMenuDeprecated/ContextMenuGroupHeader/ContextMenuGroupHeader.tsx"],"sourcesContent":["import './ContextMenuGroupHeader.css';\n\nimport React from 'react';\n\nimport { cn } from '../../../utils/bem';\nimport { getByMap } from '../../../utils/getByMap';\nimport { Text, TextPropSize } from '../../Text/Text';\nimport { contextMenuDefaultSize, ContextMenuPropSize } from '../helpers';\n\nexport const cnContextMenuGroupHeader = cn('ContextMenuGroupHeader');\n\nconst sizeMap: Record<ContextMenuPropSize, TextPropSize> = {\n s: '2xs',\n m: 'xs',\n l: 's',\n};\n\nexport const ContextMenuGroupHeader: React.FC<{\n label: string | number;\n size?: ContextMenuPropSize;\n children?: never;\n first: boolean;\n}> = ({ label, size = contextMenuDefaultSize, first }) => (\n <Text\n view=\"secondary\"\n transform=\"uppercase\"\n className={cnContextMenuGroupHeader({ size, first })}\n size={getByMap(sizeMap, size)}\n >\n {label}\n </Text>\n);\n"],"mappings":"AAAA,qCAEA,MAAOA,MAAP,KAAkB,OAAlB,CAEA,OAASC,EAAT,0BACA,OAASC,QAAT,+BACA,OAASC,IAAT,uBACA,OAASC,sBAAT,kBAEA,MAAO,IAAMC,yBAAwB,CAAGJ,EAAE,CAAC,wBAAD,CAAnC,CAEP,GAAMK,QAAkD,CAAG,CACzDC,CAAC,CAAE,KADsD,CAEzDC,CAAC,CAAE,IAFsD,CAGzDC,CAAC,CAAE,GAHsD,CAA3D,CAMA,MAAO,IAAMC,uBAKX,CAAG,eAAGC,EAAH,GAAGA,KAAH,KAAUC,IAAV,CAAUA,CAAV,YAAiBR,sBAAjB,GAAyCS,CAAzC,GAAyCA,KAAzC,OACH,qBAAC,IAAD,EACE,IAAI,CAAC,WADP,CAEE,SAAS,CAAC,WAFZ,CAGE,SAAS,CAAER,wBAAwB,CAAC,CAAEO,IAAI,CAAJA,CAAF,CAAQC,KAAK,CAALA,CAAR,CAAD,CAHrC,CAIE,IAAI,CAAEX,QAAQ,CAACI,OAAD,CAAUM,CAAV,CAJhB,EAMGD,CANH,CADG,CALE"}
1
+ {"version":3,"file":"ContextMenuGroupHeader.js","names":["React","cn","getByMap","Text","contextMenuDefaultSize","cnContextMenuGroupHeader","sizeMap","s","m","l","ContextMenuGroupHeader","label","size","first"],"sources":["../../../../../../src/components/ContextMenuDeprecated/ContextMenuGroupHeader/ContextMenuGroupHeader.tsx"],"sourcesContent":["import './ContextMenuGroupHeader.css';\n\nimport React from 'react';\n\nimport { cn } from '../../../utils/bem';\nimport { getByMap } from '../../../utils/getByMap';\nimport { Text, TextPropSize } from '../../Text/Text';\nimport { contextMenuDefaultSize, ContextMenuPropSize } from '../helpers';\n\nexport const cnContextMenuGroupHeader = cn('ContextMenuGroupHeaderDeprecated');\n\nconst sizeMap: Record<ContextMenuPropSize, TextPropSize> = {\n s: '2xs',\n m: 'xs',\n l: 's',\n};\n\nexport const ContextMenuGroupHeader: React.FC<{\n label: string | number;\n size?: ContextMenuPropSize;\n children?: never;\n first: boolean;\n}> = ({ label, size = contextMenuDefaultSize, first }) => (\n <Text\n view=\"secondary\"\n transform=\"uppercase\"\n className={cnContextMenuGroupHeader({ size, first })}\n size={getByMap(sizeMap, size)}\n >\n {label}\n </Text>\n);\n"],"mappings":"AAAA,qCAEA,MAAOA,MAAP,KAAkB,OAAlB,CAEA,OAASC,EAAT,0BACA,OAASC,QAAT,+BACA,OAASC,IAAT,uBACA,OAASC,sBAAT,kBAEA,MAAO,IAAMC,yBAAwB,CAAGJ,EAAE,CAAC,kCAAD,CAAnC,CAEP,GAAMK,QAAkD,CAAG,CACzDC,CAAC,CAAE,KADsD,CAEzDC,CAAC,CAAE,IAFsD,CAGzDC,CAAC,CAAE,GAHsD,CAA3D,CAMA,MAAO,IAAMC,uBAKX,CAAG,eAAGC,EAAH,GAAGA,KAAH,KAAUC,IAAV,CAAUA,CAAV,YAAiBR,sBAAjB,GAAyCS,CAAzC,GAAyCA,KAAzC,OACH,qBAAC,IAAD,EACE,IAAI,CAAC,WADP,CAEE,SAAS,CAAC,WAFZ,CAGE,SAAS,CAAER,wBAAwB,CAAC,CAAEO,IAAI,CAAJA,CAAF,CAAQC,KAAK,CAALA,CAAR,CAAD,CAHrC,CAIE,IAAI,CAAEX,QAAQ,CAACI,OAAD,CAAUM,CAAV,CAJhB,EAMGD,CANH,CADG,CALE"}
@@ -1 +1 @@
1
- .ContextMenuLevel{background:var(--color-bg-default);border:var(--control-border-width) solid var(--color-control-bg-border-default);border-radius:var(--control-radius);box-shadow:var(--shadow-layer);box-sizing:border-box;padding:var(--space-xs) 0;width:240px;z-index:9999}.ContextMenuLevel:not(.ContextMenuLevel_firstLevel).ContextMenuLevel_direction_leftStartUp,.ContextMenuLevel:not(.ContextMenuLevel_firstLevel).ContextMenuLevel_direction_rightStartUp{transform:translateY(calc((var(--space-xs) + 1px)*-1))}.ContextMenuLevel:not(.ContextMenuLevel_firstLevel).ContextMenuLevel_direction_leftStartDown,.ContextMenuLevel:not(.ContextMenuLevel_firstLevel).ContextMenuLevel_direction_rightStartDown{transform:translateY(calc(var(--space-xs) + 1px))}
1
+ .ContextMenuLevelDeprecated{background:var(--color-bg-default);border:var(--control-border-width) solid var(--color-control-bg-border-default);border-radius:var(--control-radius);box-shadow:var(--shadow-layer);box-sizing:border-box;padding:var(--space-xs) 0;width:240px;z-index:9999}.ContextMenuLevelDeprecated:not(.ContextMenuLevelDeprecated_firstLevel).ContextMenuLevelDeprecated_direction_leftStartUp,.ContextMenuLevelDeprecated:not(.ContextMenuLevelDeprecated_firstLevel).ContextMenuLevelDeprecated_direction_rightStartUp{transform:translateY(calc((var(--space-xs) + 1px)*-1))}.ContextMenuLevelDeprecated:not(.ContextMenuLevelDeprecated_firstLevel).ContextMenuLevelDeprecated_direction_leftStartDown,.ContextMenuLevelDeprecated:not(.ContextMenuLevelDeprecated_firstLevel).ContextMenuLevelDeprecated_direction_rightStartDown{transform:translateY(calc(var(--space-xs) + 1px))}