@consta/uikit 5.30.0 → 5.32.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 (510) hide show
  1. package/ColorPicker/index.d.ts +1 -0
  2. package/ColorPicker/index.js +1 -0
  3. package/FileCanary/index.d.ts +1 -0
  4. package/FileCanary/index.js +1 -0
  5. package/__internal__/src/components/Attachment/Attachment.css +1 -1
  6. package/__internal__/src/components/Attachment/types.d.ts +1 -1
  7. package/__internal__/src/components/Attachment/types.js.map +1 -1
  8. package/__internal__/src/components/AttachmentDeprecated/Attachment.css +1 -1
  9. package/__internal__/src/components/AttachmentDeprecated/AttachmentDeprecated.js.map +1 -1
  10. package/__internal__/src/components/AttachmentDeprecated/types.d.ts +1 -1
  11. package/__internal__/src/components/AttachmentDeprecated/types.js.map +1 -1
  12. package/__internal__/src/components/AutoComplete/AutoComplete.js +1 -1
  13. package/__internal__/src/components/AutoComplete/AutoComplete.js.map +1 -1
  14. package/__internal__/src/components/AutoComplete/helpers.d.ts +1 -0
  15. package/__internal__/src/components/AutoComplete/types.d.ts +1 -0
  16. package/__internal__/src/components/AutoComplete/types.js.map +1 -1
  17. package/__internal__/src/components/AutoCompleteCanary/AutoCompleteTypeText/AutoCompleteTypeText.js +1 -1
  18. package/__internal__/src/components/AutoCompleteCanary/AutoCompleteTypeText/AutoCompleteTypeText.js.map +1 -1
  19. package/__internal__/src/components/AutoCompleteCanary/AutoCompleteTypeTextArray/AutoCompleteTypeTextArray.js +1 -1
  20. package/__internal__/src/components/AutoCompleteCanary/AutoCompleteTypeTextArray/AutoCompleteTypeTextArray.js.map +1 -1
  21. package/__internal__/src/components/AutoCompleteCanary/helpers.d.ts +1 -0
  22. package/__internal__/src/components/AutoCompleteCanary/types.d.ts +1 -0
  23. package/__internal__/src/components/AutoCompleteCanary/types.js.map +1 -1
  24. package/__internal__/src/components/Avatar/Avatar.d.ts +2 -2
  25. package/__internal__/src/components/Avatar/Avatar.js.map +1 -1
  26. package/__internal__/src/components/AvatarGroup/types.d.ts +2 -2
  27. package/__internal__/src/components/AvatarGroup/types.js.map +1 -1
  28. package/__internal__/src/components/Badge/Badge.css +2 -2
  29. package/__internal__/src/components/Badge/maps.js.map +1 -1
  30. package/__internal__/src/components/Badge/types.d.ts +4 -4
  31. package/__internal__/src/components/Badge/types.js.map +1 -1
  32. package/__internal__/src/components/Banner/Banner.d.ts +4 -4
  33. package/__internal__/src/components/Banner/Banner.js.map +1 -1
  34. package/__internal__/src/components/BookmarkTabs/BookmarkTabs.js.map +1 -1
  35. package/__internal__/src/components/BookmarkTabs/types.d.ts +3 -3
  36. package/__internal__/src/components/BookmarkTabs/types.js.map +1 -1
  37. package/__internal__/src/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
  38. package/__internal__/src/components/Breadcrumbs/types.d.ts +2 -2
  39. package/__internal__/src/components/Breadcrumbs/types.js.map +1 -1
  40. package/__internal__/src/components/Button/Button.d.ts +4 -4
  41. package/__internal__/src/components/Button/Button.js.map +1 -1
  42. package/__internal__/src/components/Card/Card.d.ts +3 -3
  43. package/__internal__/src/components/Card/Card.js.map +1 -1
  44. package/__internal__/src/components/Checkbox/Checkbox.css +2 -2
  45. package/__internal__/src/components/Checkbox/Checkbox.d.ts +3 -3
  46. package/__internal__/src/components/Checkbox/Checkbox.js.map +1 -1
  47. package/__internal__/src/components/CheckboxDeprecated/Checkbox.css +2 -2
  48. package/__internal__/src/components/CheckboxDeprecated/CheckboxDeprecated.d.ts +3 -3
  49. package/__internal__/src/components/CheckboxDeprecated/CheckboxDeprecated.js.map +1 -1
  50. package/__internal__/src/components/CheckboxGroup/types.d.ts +4 -4
  51. package/__internal__/src/components/CheckboxGroup/types.js.map +1 -1
  52. package/__internal__/src/components/Chips/ChipsItem/ChipsItem.css +2 -2
  53. package/__internal__/src/components/Chips/types.d.ts +2 -2
  54. package/__internal__/src/components/Chips/types.js.map +1 -1
  55. package/__internal__/src/components/ChoiceGroup/ChoiceGroup.js.map +1 -1
  56. package/__internal__/src/components/ChoiceGroup/types.d.ts +4 -4
  57. package/__internal__/src/components/ChoiceGroup/types.js.map +1 -1
  58. package/__internal__/src/components/Collapse/types.d.ts +7 -7
  59. package/__internal__/src/components/Collapse/types.js.map +1 -1
  60. package/__internal__/src/components/ColorPicker/ColorControl/ColorControl.css +7 -0
  61. package/__internal__/src/components/ColorPicker/ColorControl/ColorControl.d.ts +6 -0
  62. package/__internal__/src/components/ColorPicker/ColorControl/ColorControl.js +2 -0
  63. package/__internal__/src/components/ColorPicker/ColorControl/ColorControl.js.map +1 -0
  64. package/__internal__/src/components/ColorPicker/ColorControl/index.d.ts +2 -0
  65. package/__internal__/src/components/ColorPicker/ColorControl/index.js +2 -0
  66. package/__internal__/src/components/ColorPicker/ColorControl/index.js.map +1 -0
  67. package/__internal__/src/components/ColorPicker/ColorControl/types.d.ts +6 -0
  68. package/__internal__/src/components/ColorPicker/ColorControl/types.js +2 -0
  69. package/__internal__/src/components/ColorPicker/ColorControl/types.js.map +1 -0
  70. package/__internal__/src/components/ColorPicker/ColorInputTypeChanger/ColorInputTypeChanger.css +1 -0
  71. package/__internal__/src/components/ColorPicker/ColorInputTypeChanger/ColorInputTypeChanger.d.ts +4 -0
  72. package/__internal__/src/components/ColorPicker/ColorInputTypeChanger/ColorInputTypeChanger.js +2 -0
  73. package/__internal__/src/components/ColorPicker/ColorInputTypeChanger/ColorInputTypeChanger.js.map +1 -0
  74. package/__internal__/src/components/ColorPicker/ColorInputTypeChanger/index.d.ts +1 -0
  75. package/__internal__/src/components/ColorPicker/ColorInputTypeChanger/index.js +2 -0
  76. package/__internal__/src/components/ColorPicker/ColorInputTypeChanger/index.js.map +1 -0
  77. package/__internal__/src/components/ColorPicker/ColorInputTypeChanger/types.d.ts +6 -0
  78. package/__internal__/src/components/ColorPicker/ColorInputTypeChanger/types.js +2 -0
  79. package/__internal__/src/components/ColorPicker/ColorInputTypeChanger/types.js.map +1 -0
  80. package/__internal__/src/components/ColorPicker/ColorMarker/ColorMarker.css +1 -0
  81. package/__internal__/src/components/ColorPicker/ColorMarker/ColorMarker.d.ts +16 -0
  82. package/__internal__/src/components/ColorPicker/ColorMarker/ColorMarker.js +2 -0
  83. package/__internal__/src/components/ColorPicker/ColorMarker/ColorMarker.js.map +1 -0
  84. package/__internal__/src/components/ColorPicker/ColorMarker/index.d.ts +1 -0
  85. package/__internal__/src/components/ColorPicker/ColorMarker/index.js +2 -0
  86. package/__internal__/src/components/ColorPicker/ColorMarker/index.js.map +1 -0
  87. package/__internal__/src/components/ColorPicker/ColorPalette/ColorPalette.d.ts +13 -0
  88. package/__internal__/src/components/ColorPicker/ColorPalette/ColorPalette.js +2 -0
  89. package/__internal__/src/components/ColorPicker/ColorPalette/ColorPalette.js.map +1 -0
  90. package/__internal__/src/components/ColorPicker/ColorPalette/index.d.ts +1 -0
  91. package/__internal__/src/components/ColorPicker/ColorPalette/index.js +2 -0
  92. package/__internal__/src/components/ColorPicker/ColorPalette/index.js.map +1 -0
  93. package/__internal__/src/components/ColorPicker/ColorPicker/ColorPicker.css +1 -0
  94. package/__internal__/src/components/ColorPicker/ColorPicker/ColorPicker.d.ts +3 -0
  95. package/__internal__/src/components/ColorPicker/ColorPicker/ColorPicker.js +2 -0
  96. package/__internal__/src/components/ColorPicker/ColorPicker/ColorPicker.js.map +1 -0
  97. package/__internal__/src/components/ColorPicker/ColorPicker/index.d.ts +2 -0
  98. package/__internal__/src/components/ColorPicker/ColorPicker/index.js +2 -0
  99. package/__internal__/src/components/ColorPicker/ColorPicker/index.js.map +1 -0
  100. package/__internal__/src/components/ColorPicker/ColorPicker/types.d.ts +25 -0
  101. package/__internal__/src/components/ColorPicker/ColorPicker/types.js +2 -0
  102. package/__internal__/src/components/ColorPicker/ColorPicker/types.js.map +1 -0
  103. package/__internal__/src/components/ColorPicker/ColorPickerAlpha/ColorPickerAlpha.css +1 -0
  104. package/__internal__/src/components/ColorPicker/ColorPickerAlpha/ColorPickerAlpha.d.ts +12 -0
  105. package/__internal__/src/components/ColorPicker/ColorPickerAlpha/ColorPickerAlpha.js +2 -0
  106. package/__internal__/src/components/ColorPicker/ColorPickerAlpha/ColorPickerAlpha.js.map +1 -0
  107. package/__internal__/src/components/ColorPicker/ColorPickerAlpha/index.d.ts +1 -0
  108. package/__internal__/src/components/ColorPicker/ColorPickerAlpha/index.js +2 -0
  109. package/__internal__/src/components/ColorPicker/ColorPickerAlpha/index.js.map +1 -0
  110. package/__internal__/src/components/ColorPicker/ColorPickerBase/ColorPickerBase.d.ts +12 -0
  111. package/__internal__/src/components/ColorPicker/ColorPickerBase/ColorPickerBase.js +2 -0
  112. package/__internal__/src/components/ColorPicker/ColorPickerBase/ColorPickerBase.js.map +1 -0
  113. package/__internal__/src/components/ColorPicker/ColorPickerBase/index.d.ts +1 -0
  114. package/__internal__/src/components/ColorPicker/ColorPickerBase/index.js +2 -0
  115. package/__internal__/src/components/ColorPicker/ColorPickerBase/index.js.map +1 -0
  116. package/__internal__/src/components/ColorPicker/ColorPickerHue/ColorPickerHue.css +1 -0
  117. package/__internal__/src/components/ColorPicker/ColorPickerHue/ColorPickerHue.d.ts +12 -0
  118. package/__internal__/src/components/ColorPicker/ColorPickerHue/ColorPickerHue.js +2 -0
  119. package/__internal__/src/components/ColorPicker/ColorPickerHue/ColorPickerHue.js.map +1 -0
  120. package/__internal__/src/components/ColorPicker/ColorPickerHue/index.d.ts +1 -0
  121. package/__internal__/src/components/ColorPicker/ColorPickerHue/index.js +2 -0
  122. package/__internal__/src/components/ColorPicker/ColorPickerHue/index.js.map +1 -0
  123. package/__internal__/src/components/ColorPicker/ColorPickerInput/ColorPickerInput.css +3 -0
  124. package/__internal__/src/components/ColorPicker/ColorPickerInput/ColorPickerInput.d.ts +5 -0
  125. package/__internal__/src/components/ColorPicker/ColorPickerInput/ColorPickerInput.js +2 -0
  126. package/__internal__/src/components/ColorPicker/ColorPickerInput/ColorPickerInput.js.map +1 -0
  127. package/__internal__/src/components/ColorPicker/ColorPickerInput/helpers.d.ts +12 -0
  128. package/__internal__/src/components/ColorPicker/ColorPickerInput/helpers.js +2 -0
  129. package/__internal__/src/components/ColorPicker/ColorPickerInput/helpers.js.map +1 -0
  130. package/__internal__/src/components/ColorPicker/ColorPickerInput/index.d.ts +2 -0
  131. package/__internal__/src/components/ColorPicker/ColorPickerInput/index.js +2 -0
  132. package/__internal__/src/components/ColorPicker/ColorPickerInput/index.js.map +1 -0
  133. package/__internal__/src/components/ColorPicker/ColorPickerInput/types.d.ts +25 -0
  134. package/__internal__/src/components/ColorPicker/ColorPickerInput/types.js +2 -0
  135. package/__internal__/src/components/ColorPicker/ColorPickerInput/types.js.map +1 -0
  136. package/__internal__/src/components/ColorPicker/ColorPickerInteractive/ColorPickerInteractive.css +1 -0
  137. package/__internal__/src/components/ColorPicker/ColorPickerInteractive/ColorPickerInteractive.d.ts +15 -0
  138. package/__internal__/src/components/ColorPicker/ColorPickerInteractive/ColorPickerInteractive.js +2 -0
  139. package/__internal__/src/components/ColorPicker/ColorPickerInteractive/ColorPickerInteractive.js.map +1 -0
  140. package/__internal__/src/components/ColorPicker/ColorPickerInteractive/index.d.ts +1 -0
  141. package/__internal__/src/components/ColorPicker/ColorPickerInteractive/index.js +2 -0
  142. package/__internal__/src/components/ColorPicker/ColorPickerInteractive/index.js.map +1 -0
  143. package/__internal__/src/components/ColorPicker/ColorPickerPoint/ColorPickerPoint.css +1 -0
  144. package/__internal__/src/components/ColorPicker/ColorPickerPoint/ColorPickerPoint.d.ts +8 -0
  145. package/__internal__/src/components/ColorPicker/ColorPickerPoint/ColorPickerPoint.js +2 -0
  146. package/__internal__/src/components/ColorPicker/ColorPickerPoint/ColorPickerPoint.js.map +1 -0
  147. package/__internal__/src/components/ColorPicker/ColorPickerPoint/index.d.ts +1 -0
  148. package/__internal__/src/components/ColorPicker/ColorPickerPoint/index.js +2 -0
  149. package/__internal__/src/components/ColorPicker/ColorPickerPoint/index.js.map +1 -0
  150. package/__internal__/src/components/ColorPicker/ColorPickerRoot/ColorPickerRoot.css +1 -0
  151. package/__internal__/src/components/ColorPicker/ColorPickerRoot/ColorPickerRoot.d.ts +16 -0
  152. package/__internal__/src/components/ColorPicker/ColorPickerRoot/ColorPickerRoot.js +2 -0
  153. package/__internal__/src/components/ColorPicker/ColorPickerRoot/ColorPickerRoot.js.map +1 -0
  154. package/__internal__/src/components/ColorPicker/ColorPickerRoot/index.d.ts +1 -0
  155. package/__internal__/src/components/ColorPicker/ColorPickerRoot/index.js +2 -0
  156. package/__internal__/src/components/ColorPicker/ColorPickerRoot/index.js.map +1 -0
  157. package/__internal__/src/components/ColorPicker/ColorPickerSaturation/ColorPickerSaturation.css +1 -0
  158. package/__internal__/src/components/ColorPicker/ColorPickerSaturation/ColorPickerSaturation.d.ts +13 -0
  159. package/__internal__/src/components/ColorPicker/ColorPickerSaturation/ColorPickerSaturation.js +2 -0
  160. package/__internal__/src/components/ColorPicker/ColorPickerSaturation/ColorPickerSaturation.js.map +1 -0
  161. package/__internal__/src/components/ColorPicker/ColorPickerSaturation/index.d.ts +1 -0
  162. package/__internal__/src/components/ColorPicker/ColorPickerSaturation/index.js +2 -0
  163. package/__internal__/src/components/ColorPicker/ColorPickerSaturation/index.js.map +1 -0
  164. package/__internal__/src/components/ColorPicker/hooks/useColorManipulation.d.ts +2 -0
  165. package/__internal__/src/components/ColorPicker/hooks/useColorManipulation.js +2 -0
  166. package/__internal__/src/components/ColorPicker/hooks/useColorManipulation.js.map +1 -0
  167. package/__internal__/src/components/ColorPicker/hooks/useEventCallback.d.ts +1 -0
  168. package/__internal__/src/components/ColorPicker/hooks/useEventCallback.js +2 -0
  169. package/__internal__/src/components/ColorPicker/hooks/useEventCallback.js.map +1 -0
  170. package/__internal__/src/components/ColorPicker/index.d.ts +10 -0
  171. package/__internal__/src/components/ColorPicker/index.js +2 -0
  172. package/__internal__/src/components/ColorPicker/index.js.map +1 -0
  173. package/__internal__/src/components/ColorPicker/models/hexAlphaModel.d.ts +2 -0
  174. package/__internal__/src/components/ColorPicker/models/hexAlphaModel.js +2 -0
  175. package/__internal__/src/components/ColorPicker/models/hexAlphaModel.js.map +1 -0
  176. package/__internal__/src/components/ColorPicker/models/hexModel.d.ts +2 -0
  177. package/__internal__/src/components/ColorPicker/models/hexModel.js +2 -0
  178. package/__internal__/src/components/ColorPicker/models/hexModel.js.map +1 -0
  179. package/__internal__/src/components/ColorPicker/models/hslModel.d.ts +2 -0
  180. package/__internal__/src/components/ColorPicker/models/hslModel.js +2 -0
  181. package/__internal__/src/components/ColorPicker/models/hslModel.js.map +1 -0
  182. package/__internal__/src/components/ColorPicker/models/hslStringModel.d.ts +2 -0
  183. package/__internal__/src/components/ColorPicker/models/hslStringModel.js +2 -0
  184. package/__internal__/src/components/ColorPicker/models/hslStringModel.js.map +1 -0
  185. package/__internal__/src/components/ColorPicker/models/hslaModel.d.ts +2 -0
  186. package/__internal__/src/components/ColorPicker/models/hslaModel.js +2 -0
  187. package/__internal__/src/components/ColorPicker/models/hslaModel.js.map +1 -0
  188. package/__internal__/src/components/ColorPicker/models/hslaStringModel.d.ts +2 -0
  189. package/__internal__/src/components/ColorPicker/models/hslaStringModel.js +2 -0
  190. package/__internal__/src/components/ColorPicker/models/hslaStringModel.js.map +1 -0
  191. package/__internal__/src/components/ColorPicker/models/hsvModel.d.ts +2 -0
  192. package/__internal__/src/components/ColorPicker/models/hsvModel.js +2 -0
  193. package/__internal__/src/components/ColorPicker/models/hsvModel.js.map +1 -0
  194. package/__internal__/src/components/ColorPicker/models/hsvStringModel.d.ts +2 -0
  195. package/__internal__/src/components/ColorPicker/models/hsvStringModel.js +2 -0
  196. package/__internal__/src/components/ColorPicker/models/hsvStringModel.js.map +1 -0
  197. package/__internal__/src/components/ColorPicker/models/hsvaModel.d.ts +2 -0
  198. package/__internal__/src/components/ColorPicker/models/hsvaModel.js +2 -0
  199. package/__internal__/src/components/ColorPicker/models/hsvaModel.js.map +1 -0
  200. package/__internal__/src/components/ColorPicker/models/hsvaStringModel.d.ts +2 -0
  201. package/__internal__/src/components/ColorPicker/models/hsvaStringModel.js +2 -0
  202. package/__internal__/src/components/ColorPicker/models/hsvaStringModel.js.map +1 -0
  203. package/__internal__/src/components/ColorPicker/models/index.d.ts +14 -0
  204. package/__internal__/src/components/ColorPicker/models/index.js +2 -0
  205. package/__internal__/src/components/ColorPicker/models/index.js.map +1 -0
  206. package/__internal__/src/components/ColorPicker/models/rgbModel.d.ts +2 -0
  207. package/__internal__/src/components/ColorPicker/models/rgbModel.js +2 -0
  208. package/__internal__/src/components/ColorPicker/models/rgbModel.js.map +1 -0
  209. package/__internal__/src/components/ColorPicker/models/rgbStringModel.d.ts +2 -0
  210. package/__internal__/src/components/ColorPicker/models/rgbStringModel.js +2 -0
  211. package/__internal__/src/components/ColorPicker/models/rgbStringModel.js.map +1 -0
  212. package/__internal__/src/components/ColorPicker/models/rgbaModel.d.ts +2 -0
  213. package/__internal__/src/components/ColorPicker/models/rgbaModel.js +2 -0
  214. package/__internal__/src/components/ColorPicker/models/rgbaModel.js.map +1 -0
  215. package/__internal__/src/components/ColorPicker/models/rgbaStringModel.d.ts +2 -0
  216. package/__internal__/src/components/ColorPicker/models/rgbaStringModel.js +2 -0
  217. package/__internal__/src/components/ColorPicker/models/rgbaStringModel.js.map +1 -0
  218. package/__internal__/src/components/ColorPicker/types.d.ts +33 -0
  219. package/__internal__/src/components/ColorPicker/types.js +2 -0
  220. package/__internal__/src/components/ColorPicker/types.js.map +1 -0
  221. package/__internal__/src/components/ColorPicker/utils/clamp.d.ts +1 -0
  222. package/__internal__/src/components/ColorPicker/utils/clamp.js +2 -0
  223. package/__internal__/src/components/ColorPicker/utils/clamp.js.map +1 -0
  224. package/__internal__/src/components/ColorPicker/utils/compare.d.ts +4 -0
  225. package/__internal__/src/components/ColorPicker/utils/compare.js +2 -0
  226. package/__internal__/src/components/ColorPicker/utils/compare.js.map +1 -0
  227. package/__internal__/src/components/ColorPicker/utils/convert.d.ts +32 -0
  228. package/__internal__/src/components/ColorPicker/utils/convert.js +2 -0
  229. package/__internal__/src/components/ColorPicker/utils/convert.js.map +1 -0
  230. package/__internal__/src/components/ColorPicker/utils/format.d.ts +1 -0
  231. package/__internal__/src/components/ColorPicker/utils/format.js +2 -0
  232. package/__internal__/src/components/ColorPicker/utils/format.js.map +1 -0
  233. package/__internal__/src/components/ColorPicker/utils/round.d.ts +1 -0
  234. package/__internal__/src/components/ColorPicker/utils/round.js +2 -0
  235. package/__internal__/src/components/ColorPicker/utils/round.js.map +1 -0
  236. package/__internal__/src/components/ColorPicker/utils/validate.d.ts +1 -0
  237. package/__internal__/src/components/ColorPicker/utils/validate.js +2 -0
  238. package/__internal__/src/components/ColorPicker/utils/validate.js.map +1 -0
  239. package/__internal__/src/components/Combobox/Combobox.js +1 -1
  240. package/__internal__/src/components/Combobox/Combobox.js.map +1 -1
  241. package/__internal__/src/components/Combobox/helpers.d.ts +3 -1
  242. package/__internal__/src/components/Combobox/helpers.js.map +1 -1
  243. package/__internal__/src/components/ContextMenu/ContextMenuLevel/ContextMenuLevel.js.map +1 -1
  244. package/__internal__/src/components/ContextMenu/ContextMenuLevelWrapper/ContextMenuLevelWrapper.js +1 -1
  245. package/__internal__/src/components/ContextMenu/ContextMenuLevelWrapper/ContextMenuLevelWrapper.js.map +1 -1
  246. package/__internal__/src/components/ContextMenu/ContextMenuLevels/ContextMenuLevels.js.map +1 -1
  247. package/__internal__/src/components/ContextMenu/ContextMenuWrapper/ContextMenuWrapper.js +1 -1
  248. package/__internal__/src/components/ContextMenu/ContextMenuWrapper/ContextMenuWrapper.js.map +1 -1
  249. package/__internal__/src/components/ContextMenu/helpers.d.ts +4 -2
  250. package/__internal__/src/components/ContextMenu/types.d.ts +6 -3
  251. package/__internal__/src/components/ContextMenu/types.js.map +1 -1
  252. package/__internal__/src/components/DatePicker/DatePickerDropdown/DatePickerDropdown.d.ts +2 -0
  253. package/__internal__/src/components/DatePicker/DatePickerDropdown/DatePickerDropdown.js +1 -1
  254. package/__internal__/src/components/DatePicker/DatePickerDropdown/DatePickerDropdown.js.map +1 -1
  255. package/__internal__/src/components/DatePicker/DatePickerFieldTypeDate/DatePickerFieldTypeDate.d.ts +1 -1
  256. package/__internal__/src/components/DatePicker/DatePickerFieldTypeDateTime/DatePickerFieldTypeDateTime.d.ts +1 -1
  257. package/__internal__/src/components/DatePicker/DatePickerFieldTypeMonth/DatePickerFieldTypeMonth.d.ts +1 -1
  258. package/__internal__/src/components/DatePicker/DatePickerFieldTypeTime/DatePickerFieldTypeTime.d.ts +1 -1
  259. package/__internal__/src/components/DatePicker/DatePickerFieldTypeYear/DatePickerFieldTypeYear.d.ts +1 -1
  260. package/__internal__/src/components/DatePicker/DatePickerTypeDate/DatePickerTypeDate.js +1 -1
  261. package/__internal__/src/components/DatePicker/DatePickerTypeDate/DatePickerTypeDate.js.map +1 -1
  262. package/__internal__/src/components/DatePicker/DatePickerTypeDateRange/DatePickerTypeDateRange.js +1 -1
  263. package/__internal__/src/components/DatePicker/DatePickerTypeDateRange/DatePickerTypeDateRange.js.map +1 -1
  264. package/__internal__/src/components/DatePicker/DatePickerTypeDateTime/DatePickerTypeDateTime.js +1 -1
  265. package/__internal__/src/components/DatePicker/DatePickerTypeDateTime/DatePickerTypeDateTime.js.map +1 -1
  266. package/__internal__/src/components/DatePicker/DatePickerTypeDateTimeRange/DatePickerTypeDateTimeRange.js +1 -1
  267. package/__internal__/src/components/DatePicker/DatePickerTypeDateTimeRange/DatePickerTypeDateTimeRange.js.map +1 -1
  268. package/__internal__/src/components/DatePicker/DatePickerTypeMonth/DatePickerTypeMonth.js +1 -1
  269. package/__internal__/src/components/DatePicker/DatePickerTypeMonth/DatePickerTypeMonth.js.map +1 -1
  270. package/__internal__/src/components/DatePicker/DatePickerTypeMonthRange/DatePickerTypeMonthRange.js +1 -1
  271. package/__internal__/src/components/DatePicker/DatePickerTypeMonthRange/DatePickerTypeMonthRange.js.map +1 -1
  272. package/__internal__/src/components/DatePicker/DatePickerTypeTime/DatePickerTypeTime.js +1 -1
  273. package/__internal__/src/components/DatePicker/DatePickerTypeTime/DatePickerTypeTime.js.map +1 -1
  274. package/__internal__/src/components/DatePicker/DatePickerTypeYear/DatePickerTypeYear.js +1 -1
  275. package/__internal__/src/components/DatePicker/DatePickerTypeYear/DatePickerTypeYear.js.map +1 -1
  276. package/__internal__/src/components/DatePicker/DatePickerTypeYearRange/DatePickerTypeYearRange.js +1 -1
  277. package/__internal__/src/components/DatePicker/DatePickerTypeYearRange/DatePickerTypeYearRange.js.map +1 -1
  278. package/__internal__/src/components/DatePicker/getChangeFnRange.js +1 -1
  279. package/__internal__/src/components/DatePicker/getChangeFnRange.js.map +1 -1
  280. package/__internal__/src/components/DatePicker/helpers.js.map +1 -1
  281. package/__internal__/src/components/DatePicker/types.d.ts +7 -6
  282. package/__internal__/src/components/DatePicker/types.js.map +1 -1
  283. package/__internal__/src/components/DateTime/DateTime100YearSlider/DateTime100YearSlider.js +1 -1
  284. package/__internal__/src/components/DateTime/DateTime100YearSlider/DateTime100YearSlider.js.map +1 -1
  285. package/__internal__/src/components/DateTime/DateTime10YearSlider/DateTime10YearSlider.js +1 -1
  286. package/__internal__/src/components/DateTime/DateTime10YearSlider/DateTime10YearSlider.js.map +1 -1
  287. package/__internal__/src/components/DateTime/DateTimeCell/DateTimeCell.d.ts +1 -1
  288. package/__internal__/src/components/DateTime/DateTimeCell/DateTimeCell.js.map +1 -1
  289. package/__internal__/src/components/DateTime/DateTimeGrid/DateTimeGrid.css +1 -1
  290. package/__internal__/src/components/DateTime/DateTimeTypeDate/DateTimeTypeDate.js +1 -1
  291. package/__internal__/src/components/DateTime/DateTimeTypeDate/DateTimeTypeDate.js.map +1 -1
  292. package/__internal__/src/components/DateTime/DateTimeTypeMonth/DateTimeTypeMonth.js +1 -1
  293. package/__internal__/src/components/DateTime/DateTimeTypeMonth/DateTimeTypeMonth.js.map +1 -1
  294. package/__internal__/src/components/DateTime/DateTimeTypeYear/DateTimeTypeYear.js +1 -1
  295. package/__internal__/src/components/DateTime/DateTimeTypeYear/DateTimeTypeYear.js.map +1 -1
  296. package/__internal__/src/components/DateTime/DateTimeYearSlider/DateTimeYearSlider.js +1 -1
  297. package/__internal__/src/components/DateTime/DateTimeYearSlider/DateTimeYearSlider.js.map +1 -1
  298. package/__internal__/src/components/DateTime/helpers/index.js +1 -1
  299. package/__internal__/src/components/DateTime/helpers/index.js.map +1 -1
  300. package/__internal__/src/components/DateTime/helpers/types.d.ts +4 -3
  301. package/__internal__/src/components/DateTime/helpers/types.js.map +1 -1
  302. package/__internal__/src/components/DragNDropField/DragNDropFieldTooltip/DragNDropFieldTooltip.css +1 -1
  303. package/__internal__/src/components/DragNDropFieldCanary/types.d.ts +1 -1
  304. package/__internal__/src/components/DragNDropFieldCanary/types.js.map +1 -1
  305. package/__internal__/src/components/FieldComponents/FieldControlLayout/FieldControlLayout.css +4 -2
  306. package/__internal__/src/components/FieldComponents/FieldControlLayout/FieldControlLayout.js +1 -1
  307. package/__internal__/src/components/FieldComponents/FieldControlLayout/FieldControlLayout.js.map +1 -1
  308. package/__internal__/src/components/FieldComponents/FieldControlLayout/helpers.d.ts +5 -2
  309. package/__internal__/src/components/FieldComponents/FieldControlLayout/helpers.js +1 -1
  310. package/__internal__/src/components/FieldComponents/FieldControlLayout/helpers.js.map +1 -1
  311. package/__internal__/src/components/FieldComponents/FieldControlLayout/maps.d.ts +1 -0
  312. package/__internal__/src/components/FieldComponents/FieldControlLayout/maps.js +1 -1
  313. package/__internal__/src/components/FieldComponents/FieldControlLayout/maps.js.map +1 -1
  314. package/__internal__/src/components/FieldGroup/getForm.js +1 -1
  315. package/__internal__/src/components/FieldGroup/getForm.js.map +1 -1
  316. package/__internal__/src/components/FileCanary/FileCanary.d.ts +1 -0
  317. package/__internal__/src/components/FileCanary/FileCanary.js +2 -0
  318. package/__internal__/src/components/FileCanary/FileCanary.js.map +1 -0
  319. package/__internal__/src/components/FileCanary/FileCanaryBase/FileCanaryBase.css +1 -0
  320. package/__internal__/src/components/FileCanary/FileCanaryBase/FileCanaryBase.d.ts +4 -0
  321. package/__internal__/src/components/FileCanary/FileCanaryBase/FileCanaryBase.js +2 -0
  322. package/__internal__/src/components/FileCanary/FileCanaryBase/FileCanaryBase.js.map +1 -0
  323. package/__internal__/src/components/FileCanary/config.d.ts +2 -0
  324. package/__internal__/src/components/FileCanary/config.js +2 -0
  325. package/__internal__/src/components/FileCanary/config.js.map +1 -0
  326. package/__internal__/src/components/FileCanary/fileCanaryGenerator.d.ts +2 -0
  327. package/__internal__/src/components/FileCanary/fileCanaryGenerator.js +2 -0
  328. package/__internal__/src/components/FileCanary/fileCanaryGenerator.js.map +1 -0
  329. package/__internal__/src/components/FileCanary/index.d.ts +4 -0
  330. package/__internal__/src/components/FileCanary/index.js +2 -0
  331. package/__internal__/src/components/FileCanary/index.js.map +1 -0
  332. package/__internal__/src/components/FileCanary/types.d.ts +25 -0
  333. package/__internal__/src/components/FileCanary/types.js +2 -0
  334. package/__internal__/src/components/FileCanary/types.js.map +1 -0
  335. package/__internal__/src/components/FlatSelect/FlatSelect.css +8 -8
  336. package/__internal__/src/components/FlatSelect/FlatSelect.js +1 -1
  337. package/__internal__/src/components/FlatSelect/FlatSelect.js.map +1 -1
  338. package/__internal__/src/components/FlatSelect/FlatSelectList/FlatSelectList.d.ts +1 -1
  339. package/__internal__/src/components/FlatSelect/FlatSelectList/FlatSelectList.js.map +1 -1
  340. package/__internal__/src/components/FlatSelect/FlatSelectRoot/FlatSelectRoot.d.ts +1 -0
  341. package/__internal__/src/components/FlatSelect/FlatSelectRoot/FlatSelectRoot.js +1 -1
  342. package/__internal__/src/components/FlatSelect/FlatSelectRoot/FlatSelectRoot.js.map +1 -1
  343. package/__internal__/src/components/FlatSelect/types.d.ts +1 -0
  344. package/__internal__/src/components/FlatSelect/types.js.map +1 -1
  345. package/__internal__/src/components/Grid/types.d.ts +4 -4
  346. package/__internal__/src/components/Grid/types.js.map +1 -1
  347. package/__internal__/src/components/GridDeprecated/Grid.css +1 -1
  348. package/__internal__/src/components/GridDeprecated/GridDeprecated.d.ts +4 -4
  349. package/__internal__/src/components/GridDeprecated/GridDeprecated.js.map +1 -1
  350. package/__internal__/src/components/Informer/Informer.d.ts +3 -3
  351. package/__internal__/src/components/Informer/Informer.js.map +1 -1
  352. package/__internal__/src/components/Layout/Layout.d.ts +3 -3
  353. package/__internal__/src/components/Layout/Layout.js.map +1 -1
  354. package/__internal__/src/components/Layout/useFixed.d.ts +2 -2
  355. package/__internal__/src/components/Layout/useFixed.js.map +1 -1
  356. package/__internal__/src/components/ListCanary/ListCanary.js.map +1 -1
  357. package/__internal__/src/components/ListCanary/ListItemGrid/ListItemGrid.css +1 -1
  358. package/__internal__/src/components/ListCanary/types.d.ts +4 -4
  359. package/__internal__/src/components/ListCanary/types.js.map +1 -1
  360. package/__internal__/src/components/LoaderDeprecated/Loader.css +2 -2
  361. package/__internal__/src/components/LoaderDeprecated/LoaderDeprecated.d.ts +1 -1
  362. package/__internal__/src/components/LoaderDeprecated/LoaderDeprecated.js.map +1 -1
  363. package/__internal__/src/components/Modal/ModalLayout/ModalLayout.css +4 -4
  364. package/__internal__/src/components/ModalDeprecated/ModalDeprecated.d.ts +2 -2
  365. package/__internal__/src/components/ModalDeprecated/ModalDeprecated.js.map +1 -1
  366. package/__internal__/src/components/Notification/helpers/defaultDateFormat.js +1 -1
  367. package/__internal__/src/components/Notification/helpers/defaultDateFormat.js.map +1 -1
  368. package/__internal__/src/components/Pagination/types.d.ts +3 -3
  369. package/__internal__/src/components/Pagination/types.js.map +1 -1
  370. package/__internal__/src/components/PaginationDeprecated/PaginationDeprecated.d.ts +4 -4
  371. package/__internal__/src/components/PaginationDeprecated/PaginationDeprecated.js.map +1 -1
  372. package/__internal__/src/components/Popover/Popover.d.ts +2 -2
  373. package/__internal__/src/components/Popover/Popover.js.map +1 -1
  374. package/__internal__/src/components/ProgressLine/ProgressLine.css +1 -1
  375. package/__internal__/src/components/ProgressLine/types.d.ts +1 -1
  376. package/__internal__/src/components/ProgressLine/types.js.map +1 -1
  377. package/__internal__/src/components/ProgressSpin/ProgressSpin.d.ts +1 -1
  378. package/__internal__/src/components/ProgressSpin/ProgressSpin.js.map +1 -1
  379. package/__internal__/src/components/ProgressStepBar/ProgressStepBarItem/ProgressStepBarItem.css +8 -8
  380. package/__internal__/src/components/ProgressStepBar/helpers.d.ts +5 -5
  381. package/__internal__/src/components/ProgressStepBar/helpers.js.map +1 -1
  382. package/__internal__/src/components/Radio/Radio.css +1 -1
  383. package/__internal__/src/components/Radio/Radio.d.ts +3 -3
  384. package/__internal__/src/components/Radio/Radio.js.map +1 -1
  385. package/__internal__/src/components/RadioGroup/types.d.ts +4 -4
  386. package/__internal__/src/components/RadioGroup/types.js.map +1 -1
  387. package/__internal__/src/components/Responses/Responses.d.ts +1 -1
  388. package/__internal__/src/components/Responses/Responses.js.map +1 -1
  389. package/__internal__/src/components/Select/Select.js +1 -1
  390. package/__internal__/src/components/Select/Select.js.map +1 -1
  391. package/__internal__/src/components/Select/helpers.d.ts +3 -1
  392. package/__internal__/src/components/Select/helpers.js.map +1 -1
  393. package/__internal__/src/components/SelectCanary/SelectDropdown/SelectDropdown.d.ts +2 -1
  394. package/__internal__/src/components/SelectCanary/SelectDropdown/SelectDropdown.js +1 -1
  395. package/__internal__/src/components/SelectCanary/SelectDropdown/SelectDropdown.js.map +1 -1
  396. package/__internal__/src/components/SelectCanary/SelectMultiple/SelectMultiple.css +2 -2
  397. package/__internal__/src/components/SelectCanary/SelectMultiple/SelectMultiple.js +1 -1
  398. package/__internal__/src/components/SelectCanary/SelectMultiple/SelectMultiple.js.map +1 -1
  399. package/__internal__/src/components/SelectCanary/SelectMultiple/__test__/SelectMultiple.test.js +1 -1
  400. package/__internal__/src/components/SelectCanary/SelectMultiple/__test__/SelectMultiple.test.js.map +1 -1
  401. package/__internal__/src/components/SelectCanary/SelectPopover/SelectPopover.d.ts +2 -1
  402. package/__internal__/src/components/SelectCanary/SelectPopover/SelectPopover.js +1 -1
  403. package/__internal__/src/components/SelectCanary/SelectPopover/SelectPopover.js.map +1 -1
  404. package/__internal__/src/components/SelectCanary/SelectSingle/SelectSingle.js +1 -1
  405. package/__internal__/src/components/SelectCanary/SelectSingle/SelectSingle.js.map +1 -1
  406. package/__internal__/src/components/SelectCanary/SelectSingle/__test__/SelectSingle.test.js +1 -1
  407. package/__internal__/src/components/SelectCanary/SelectSingle/__test__/SelectSingle.test.js.map +1 -1
  408. package/__internal__/src/components/SelectCanary/helpers.d.ts +2 -1
  409. package/__internal__/src/components/SelectCanary/types.d.ts +1 -0
  410. package/__internal__/src/components/SelectCanary/types.js.map +1 -1
  411. package/__internal__/src/components/SelectComponents/SelectDropdown/SelectDropdown.d.ts +2 -1
  412. package/__internal__/src/components/SelectComponents/SelectDropdown/SelectDropdown.js +1 -1
  413. package/__internal__/src/components/SelectComponents/SelectDropdown/SelectDropdown.js.map +1 -1
  414. package/__internal__/src/components/SelectComponents/SelectValueTag/SelectValueTag.css +1 -1
  415. package/__internal__/src/components/SelectComponents/types.d.ts +4 -4
  416. package/__internal__/src/components/SelectComponents/types.js.map +1 -1
  417. package/__internal__/src/components/SelectComponents/useSelect/useSelect.js +1 -1
  418. package/__internal__/src/components/SelectComponents/useSelect/useSelect.js.map +1 -1
  419. package/__internal__/src/components/SelectComponentsDeprecated/SelectDropdown/SelectDropdown.d.ts +1 -1
  420. package/__internal__/src/components/SelectComponentsDeprecated/SelectDropdown/SelectDropdown.js.map +1 -1
  421. package/__internal__/src/components/SelectComponentsDeprecated/SelectValueTag/SelectValueTag.css +1 -1
  422. package/__internal__/src/components/SelectComponentsDeprecated/types.d.ts +4 -4
  423. package/__internal__/src/components/SelectComponentsDeprecated/types.js.map +1 -1
  424. package/__internal__/src/components/Sidebar/types.d.ts +2 -2
  425. package/__internal__/src/components/Sidebar/types.js.map +1 -1
  426. package/__internal__/src/components/SidebarDeprecated/SidebarDeprecated.d.ts +2 -2
  427. package/__internal__/src/components/SidebarDeprecated/SidebarDeprecated.js.map +1 -1
  428. package/__internal__/src/components/Skeleton/Skeleton.css +1 -1
  429. package/__internal__/src/components/Slider/helper.d.ts +2 -2
  430. package/__internal__/src/components/Slider/helper.js.map +1 -1
  431. package/__internal__/src/components/SnackBar/types.d.ts +4 -4
  432. package/__internal__/src/components/SnackBar/types.js.map +1 -1
  433. package/__internal__/src/components/Spoiler/types.d.ts +2 -2
  434. package/__internal__/src/components/Spoiler/types.js.map +1 -1
  435. package/__internal__/src/components/Steps/StepsStep/StepsStep.css +1 -1
  436. package/__internal__/src/components/Steps/types.d.ts +1 -1
  437. package/__internal__/src/components/Steps/types.js.map +1 -1
  438. package/__internal__/src/components/Switch/Switch.css +1 -1
  439. package/__internal__/src/components/Switch/types.d.ts +3 -3
  440. package/__internal__/src/components/Switch/types.js.map +1 -1
  441. package/__internal__/src/components/SwitchGroup/types.d.ts +1 -1
  442. package/__internal__/src/components/SwitchGroup/types.js.map +1 -1
  443. package/__internal__/src/components/Table/Cell/TableCell.css +1 -1
  444. package/__internal__/src/components/Table/Cell/TableCell.d.ts +2 -2
  445. package/__internal__/src/components/Table/Cell/TableCell.js.map +1 -1
  446. package/__internal__/src/components/Table/Header/TableHeader.d.ts +1 -1
  447. package/__internal__/src/components/Table/Header/TableHeader.js.map +1 -1
  448. package/__internal__/src/components/Table/Table.d.ts +3 -3
  449. package/__internal__/src/components/Table/Table.js.map +1 -1
  450. package/__internal__/src/components/Table/__mock__/data.mock.d.ts +10 -10
  451. package/__internal__/src/components/Table/__mock__/data.mock.js.map +1 -1
  452. package/__internal__/src/components/Table/helpers.d.ts +1 -1
  453. package/__internal__/src/components/Table/helpers.js.map +1 -1
  454. package/__internal__/src/components/Tabs/Tabs.js.map +1 -1
  455. package/__internal__/src/components/Tabs/types.d.ts +4 -4
  456. package/__internal__/src/components/Tabs/types.js.map +1 -1
  457. package/__internal__/src/components/Tag/Tag.d.ts +1 -1
  458. package/__internal__/src/components/Tag/Tag.js.map +1 -1
  459. package/__internal__/src/components/TagBase/TagBase.d.ts +3 -3
  460. package/__internal__/src/components/TagBase/TagBase.js.map +1 -1
  461. package/__internal__/src/components/Text/Text.d.ts +13 -13
  462. package/__internal__/src/components/Text/Text.js.map +1 -1
  463. package/__internal__/src/components/TextAreaAutoSize/TextAreaAutoSize.css +1 -1
  464. package/__internal__/src/components/TextDeprecated/TextDeprecated.d.ts +13 -13
  465. package/__internal__/src/components/TextDeprecated/TextDeprecated.js.map +1 -1
  466. package/__internal__/src/components/TextField/types.d.ts +4 -4
  467. package/__internal__/src/components/TextField/types.js.map +1 -1
  468. package/__internal__/src/components/TextFieldCanary/TextFieldTypeNumber/TextFieldTypeNumber.js +1 -1
  469. package/__internal__/src/components/TextFieldCanary/TextFieldTypeNumber/TextFieldTypeNumber.js.map +1 -1
  470. package/__internal__/src/components/TextFieldCanary/TextFieldTypeTextArea/TextFieldTypeTextArea.css +2 -2
  471. package/__internal__/src/components/TextFieldCanary/useTextField.js.map +1 -1
  472. package/__internal__/src/components/Theme/_font/Silkscreen-Regular.woff +0 -0
  473. package/__internal__/src/components/Theme/_font/Silkscreen-Regular.woff2 +0 -0
  474. package/__internal__/src/components/Theme/_font/Theme_font_gpnDefault.css +1 -1
  475. package/__internal__/src/components/ThemeToggler/ThemeToggler.js.map +1 -1
  476. package/__internal__/src/components/ThemeToggler/types.d.ts +1 -1
  477. package/__internal__/src/components/ThemeToggler/types.js.map +1 -1
  478. package/__internal__/src/components/Timer/Timer.d.ts +1 -1
  479. package/__internal__/src/components/Timer/Timer.js.map +1 -1
  480. package/__internal__/src/components/Tooltip/types.d.ts +2 -2
  481. package/__internal__/src/components/Tooltip/types.js.map +1 -1
  482. package/__internal__/src/components/TooltipDeprecated/TooltipDeprecated.d.ts +2 -2
  483. package/__internal__/src/components/TooltipDeprecated/TooltipDeprecated.js.map +1 -1
  484. package/__internal__/src/components/User/User.css +1 -1
  485. package/__internal__/src/components/User/User.d.ts +4 -4
  486. package/__internal__/src/components/User/User.js.map +1 -1
  487. package/__internal__/src/components/UserSelect/UserSelect.js +1 -1
  488. package/__internal__/src/components/UserSelect/UserSelect.js.map +1 -1
  489. package/__internal__/src/components/UserSelect/UserSelectItem/UserSelectItem.css +1 -1
  490. package/__internal__/src/components/UserSelect/helpers.d.ts +3 -1
  491. package/__internal__/src/components/UserSelect/helpers.js.map +1 -1
  492. package/__internal__/src/fileIcons/FileIcon/FileIcon.d.ts +1 -1
  493. package/__internal__/src/fileIcons/FileIcon/FileIcon.js.map +1 -1
  494. package/__internal__/src/hocs/withTooltip/withTooltip.d.ts +1 -1
  495. package/__internal__/src/hocs/withTooltip/withTooltip.js.map +1 -1
  496. package/__internal__/src/hooks/useBreakpointsDeprecated/useBreakpointsDeprecated.d.ts +1 -1
  497. package/__internal__/src/hooks/useBreakpointsDeprecated/useBreakpointsDeprecated.js.map +1 -1
  498. package/__internal__/src/hooks/useRefs/useRefs.js.map +1 -1
  499. package/__internal__/src/hooks/useStyleProps/types.js.map +1 -1
  500. package/__internal__/src/mixs/MixCard/MixCard.d.ts +2 -2
  501. package/__internal__/src/mixs/MixCard/MixCard.js.map +1 -1
  502. package/__internal__/src/mixs/MixFlex/MixFlex.d.ts +5 -5
  503. package/__internal__/src/mixs/MixFlex/MixFlex.js.map +1 -1
  504. package/__internal__/src/mixs/MixScrollBar/MixScrollBar.d.ts +2 -2
  505. package/__internal__/src/mixs/MixScrollBar/MixScrollBar.js.map +1 -1
  506. package/__internal__/src/mixs/MixVisuallyHidden/MixVisuallyHidden.css +1 -1
  507. package/__internal__/src/utils/array.js.map +1 -1
  508. package/__internal__/src/utils/date/index.js +1 -1
  509. package/__internal__/src/utils/date/index.js.map +1 -1
  510. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"Combobox.js","names":["IconClear","IconSelect","React","forwardRef","useRef","usePropsHandler","cnSelect","defaultLabelForCreate","defaultLabelForEmptyItems","defaultLabelForNotFound","getInputWidth","SelectContainer","SelectDropdown","SelectItem","SelectValueTag","defaultPropForm","defaultPropSize","defaultPropView","useSelect","useForkRef","isNotNil","Text","clearSizeMap","iconSizeMap","isMultipleParams","isNotMultipleParams","withDefaultGetters","COMPONENT_NAME","ComboboxRender","props","ref","defaultDropdownRef","controlInnerRef","helperInputFakeElement","controlRef","placeholder","onBlur","onFocus","items","onChange","value","disabled","ariaLabel","id","required","dropdownRef","form","view","size","dropdownClassName","name","groups","getItemLabel","getItemKey","getItemGroupKey","getItemDisabled","getGroupKey","getGroupLabel","renderItem","allSelectedAllLabel","searchValueProp","searchValue","renderValueProp","renderValue","onCreate","inputRefProp","inputRef","labelForNotFound","labelForCreate","labelForEmptyItems","searchFunction","selectAll","isLoading","multiple","style","dropdownForm","virtualScroll","onScrollToBottom","onDropdownOpen","onSearchValueChange","dropdownOpen","ignoreOutsideClicksRefs","dropdownViewportRef","otherProps","getKeyProps","getOptionProps","isOpen","visibleItems","isFocused","handleInputFocus","handleInputBlur","handleToggleDropdown","handleInputClick","handleInputChange","clearValue","getHandleRemoveValue","notFound","hasItems","optionsRefs","allItemsSelected","inputId","renderValueDefaultMultiple","item","handleRemove","renderValueDefaultNotMultiple","valueLabel","inputRefForRender","renderControlValue","width","Array","isArray","map","length","hide","isClearButtonVisible","hasInput","renderValueList","renderItemDefault","active","hovered","onClick","onMouseEnter","zIndex","Combobox"],"sources":["../../../../../src/components/Combobox/Combobox.tsx"],"sourcesContent":["import '##/components/SelectComponents/Select.css';\n\nimport { IconClear } from '@consta/icons/IconClear';\nimport { IconSelect } from '@consta/icons/IconSelect';\nimport React, { forwardRef, useRef } from 'react';\n\nimport { usePropsHandler } from '##/components/EventInterceptor/usePropsHandler';\nimport { cnSelect } from '##/components/SelectComponents/cnSelect';\nimport {\n defaultLabelForCreate,\n defaultLabelForEmptyItems,\n defaultLabelForNotFound,\n getInputWidth,\n} from '##/components/SelectComponents/helpers';\nimport { SelectContainer } from '##/components/SelectComponents/SelectContainer';\nimport { SelectDropdown } from '##/components/SelectComponents/SelectDropdown';\nimport { SelectItem } from '##/components/SelectComponents/SelectItem';\nimport { SelectValueTag } from '##/components/SelectComponents/SelectValueTag';\nimport {\n defaultPropForm,\n defaultPropSize,\n defaultPropView,\n} from '##/components/SelectComponents/types';\nimport { useSelect } from '##/components/SelectComponents/useSelect';\nimport { useForkRef } from '##/hooks/useForkRef';\nimport { isNotNil } from '##/utils/type-guards';\n\nimport { Text } from '../Text';\nimport {\n clearSizeMap,\n ComboboxComponent,\n ComboboxGroupDefault,\n ComboboxItemDefault,\n ComboboxPropRenderItem,\n ComboboxPropRenderValue,\n ComboboxProps,\n iconSizeMap,\n isMultipleParams,\n isNotMultipleParams,\n withDefaultGetters,\n} from './helpers';\n\nexport const COMPONENT_NAME = 'Combobox' as const;\n\nconst ComboboxRender = <\n ITEM = ComboboxItemDefault,\n GROUP = ComboboxGroupDefault,\n MULTIPLE extends boolean = false,\n>(\n props: ComboboxProps<ITEM, GROUP, MULTIPLE>,\n ref: React.Ref<HTMLDivElement>,\n) => {\n const defaultDropdownRef = useRef<HTMLDivElement | null>(null);\n const controlInnerRef = useRef<HTMLDivElement>(null);\n const helperInputFakeElement = useRef<HTMLDivElement>(null);\n const controlRef = useRef<HTMLDivElement | null>(null);\n\n const {\n placeholder,\n onBlur,\n onFocus,\n items,\n onChange,\n value,\n disabled,\n ariaLabel,\n id,\n required,\n dropdownRef,\n form = defaultPropForm,\n view = defaultPropView,\n size = defaultPropSize,\n dropdownClassName,\n name,\n groups = [],\n getItemLabel,\n getItemKey,\n getItemGroupKey,\n getItemDisabled,\n getGroupKey,\n getGroupLabel,\n renderItem,\n allSelectedAllLabel = 'Все',\n searchValue: searchValueProp,\n renderValue: renderValueProp,\n onCreate,\n inputRef: inputRefProp,\n labelForNotFound = defaultLabelForNotFound,\n labelForCreate = defaultLabelForCreate,\n labelForEmptyItems = defaultLabelForEmptyItems,\n searchFunction,\n selectAll,\n isLoading,\n multiple = false,\n style,\n dropdownForm = 'default',\n virtualScroll,\n onScrollToBottom,\n onDropdownOpen,\n onSearchValueChange,\n dropdownOpen,\n ignoreOutsideClicksRefs,\n dropdownViewportRef,\n ...otherProps\n } = usePropsHandler(COMPONENT_NAME, withDefaultGetters(props), controlRef);\n\n const {\n getKeyProps,\n getOptionProps,\n isOpen,\n visibleItems,\n isFocused,\n handleInputFocus,\n handleInputBlur,\n handleToggleDropdown,\n inputRef,\n handleInputClick,\n handleInputChange,\n searchValue,\n clearValue,\n getHandleRemoveValue,\n notFound,\n hasItems,\n optionsRefs,\n allItemsSelected,\n } = useSelect({\n items,\n groups,\n value,\n onChange,\n selectAll,\n dropdownRef: defaultDropdownRef,\n controlRef,\n disabled,\n getItemLabel,\n getItemKey,\n getGroupKey,\n searchValue: searchValueProp,\n getItemGroupKey,\n getItemDisabled,\n multiple,\n onBlur,\n onFocus,\n onCreate,\n searchFunction,\n onDropdownOpen,\n onSearchValueChange,\n dropdownOpen,\n ignoreOutsideClicksRefs,\n });\n\n const inputId = id ? `${id}-input` : id;\n\n const renderItemDefault: ComboboxPropRenderItem<ITEM> = (props) => {\n const { item, active, hovered, onClick, onMouseEnter, ref } = props;\n\n return (\n <SelectItem\n label={getItemLabel(item)}\n active={active}\n hovered={hovered}\n multiple={multiple}\n size={size}\n indent={dropdownForm === 'round' ? 'increased' : 'normal'}\n onClick={onClick}\n onMouseEnter={onMouseEnter}\n disabled={getItemDisabled(item)}\n ref={ref}\n />\n );\n };\n\n const renderValueDefaultMultiple: ComboboxPropRenderValue<ITEM> = ({\n item,\n handleRemove,\n }) => {\n return (\n <SelectValueTag\n label={getItemLabel(item)}\n key={getItemKey(item)}\n size={size}\n disabled={disabled || getItemDisabled(item)}\n handleRemove={handleRemove}\n />\n );\n };\n\n const renderValueDefaultNotMultiple: ComboboxPropRenderValue<ITEM> = (\n props,\n ) => {\n const valueLabel = getItemLabel(props.item);\n\n return (\n <span className={cnSelect('ControlValue')} title={valueLabel}>\n {valueLabel}\n </span>\n );\n };\n\n const renderValue =\n renderValueProp ||\n (multiple ? renderValueDefaultMultiple : renderValueDefaultNotMultiple);\n\n const inputRefForRender = useForkRef([inputRef, inputRefProp]);\n\n const renderControlValue = () => {\n const width = multiple\n ? getInputWidth(controlInnerRef, helperInputFakeElement)\n : undefined;\n return (\n <>\n {isMultipleParams(props) &&\n Array.isArray(props.value) &&\n props.value.map((item) =>\n renderValue({ item, handleRemove: getHandleRemoveValue(item) }),\n )}\n {isNotMultipleParams(props) &&\n isNotNil(props.value) &&\n renderValue({ item: props.value })}\n {(!isNotNil(value) || (Array.isArray(value) && value.length === 0)) &&\n !searchValue &&\n placeholder && (\n <span className={cnSelect('Placeholder')} title=\"placeholder\">\n {placeholder}\n </span>\n )}\n <input\n {...getKeyProps()}\n type=\"text\"\n name={name}\n id={inputId}\n onFocus={handleInputFocus}\n onBlur={handleInputBlur}\n aria-label={ariaLabel}\n onChange={handleInputChange}\n ref={inputRefForRender}\n className={cnSelect('Input', {\n size,\n hide: !multiple && isNotNil(value),\n multiple,\n })}\n value={searchValue}\n style={{ width }}\n />\n </>\n );\n };\n\n const renderValueList = () => {\n if (allItemsSelected) {\n return (\n <Text\n view=\"primary\"\n size={size}\n className={cnSelect('SelectAll')}\n lineHeight=\"m\"\n >\n {allSelectedAllLabel}\n </Text>\n );\n }\n if (multiple) {\n return (\n <div className={cnSelect('ControlValue')}>{renderControlValue()}</div>\n );\n }\n return renderControlValue();\n };\n\n const isClearButtonVisible = isMultipleParams(props)\n ? isNotNil(props.value) && props.value.length > 0\n : isNotNil(props.value);\n\n return (\n <>\n <SelectContainer\n focused={isFocused}\n disabled={disabled}\n size={size}\n view={view}\n required={required}\n form={form}\n multiple={multiple}\n ref={ref}\n type=\"combobox\"\n style={style}\n id={inputId}\n {...otherProps}\n >\n <div\n className={cnSelect('Control', { hasInput: true })}\n ref={controlRef}\n aria-expanded={isOpen}\n aria-haspopup=\"listbox\"\n id={id}\n >\n <div\n className={cnSelect('ControlInner')}\n onClick={handleInputClick}\n role=\"button\"\n ref={controlInnerRef}\n aria-hidden=\"true\"\n >\n <div className={cnSelect('ControlValueContainer')}>\n {renderValueList()}\n </div>\n </div>\n <span className={cnSelect('Indicators')}>\n {isClearButtonVisible && (\n <button\n type=\"button\"\n onClick={clearValue}\n tabIndex={-1}\n className={cnSelect('ClearIndicator')}\n >\n <IconClear\n size={clearSizeMap[size]}\n className={cnSelect('ClearIndicatorIcon')}\n />\n </button>\n )}\n <span className={cnSelect('Delimiter')} />\n <button\n type=\"button\"\n className={cnSelect('IndicatorsDropdown')}\n tabIndex={-1}\n onClick={handleToggleDropdown}\n >\n <IconSelect\n size={iconSizeMap[size]}\n className={cnSelect('DropdownIndicatorIcon')}\n />\n </button>\n </span>\n </div>\n <div\n className={cnSelect('HelperInputFakeElement')}\n ref={helperInputFakeElement}\n >\n {searchValue}\n </div>\n </SelectContainer>\n <SelectDropdown\n viewportRef={dropdownViewportRef}\n isOpen={isOpen}\n size={size}\n controlRef={controlRef}\n getOptionProps={getOptionProps}\n dropdownRef={useForkRef([dropdownRef, defaultDropdownRef])}\n form={dropdownForm}\n className={dropdownClassName}\n renderItem={renderItem || renderItemDefault}\n getGroupLabel={getGroupLabel}\n visibleItems={visibleItems}\n labelForNotFound={labelForNotFound}\n labelForCreate={labelForCreate}\n isLoading={isLoading}\n labelForEmptyItems={labelForEmptyItems}\n notFound={notFound}\n hasItems={hasItems}\n itemsRefs={optionsRefs}\n virtualScroll={virtualScroll}\n onScrollToBottom={onScrollToBottom}\n style={\n typeof style?.zIndex === 'number'\n ? { zIndex: style.zIndex + 1 }\n : undefined\n }\n />\n </>\n );\n};\n\nexport const Combobox = forwardRef(ComboboxRender) as ComboboxComponent;\n"],"mappings":"+sBAAA,uCAEA,OAASA,SAAT,KAA0B,yBAA1B,CACA,OAASC,UAAT,KAA2B,0BAA3B,CACA,MAAOC,MAAP,EAAgBC,UAAhB,CAA4BC,MAA5B,KAA0C,OAA1C,CAEA,OAASC,eAAT,2CACA,OAASC,QAAT,oCACA,OACEC,qBADF,CAEEC,yBAFF,CAGEC,uBAHF,CAIEC,aAJF,mCA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CAeE,kBAAkB,CAAEH,CAftB,CAgBE,QAAQ,CAAE2B,EAhBZ,CAiBE,QAAQ,CAAEC,EAjBZ,CAkBE,SAAS,CAAEC,EAlBb,CAmBE,aAAa,CAAEtB,EAnBjB,CAoBE,gBAAgB,CAAEC,EApBpB,CAqBE,KAAK,CACsB,QAAzB,gBAAOH,CAAP,WAAOA,CAAP,QAAOA,CAAK,CAAEgD,MAAd,EACI,CAAEA,MAAM,CAAEhD,CAAK,CAACgD,MAAN,CAAe,CAAzB,CADJ,OAtBJ,EApEF,CAiGH,CAvUD,CAyUA,MAAO,IAAMC,SAAQ,CAAGxH,UAAU,CAACyB,cAAD,CAA3B"}
1
+ {"version":3,"file":"Combobox.js","names":["IconClear","IconSelect","React","forwardRef","useRef","usePropsHandler","cnSelect","defaultLabelForCreate","defaultLabelForEmptyItems","defaultLabelForNotFound","getInputWidth","SelectContainer","SelectDropdown","SelectItem","SelectValueTag","defaultPropForm","defaultPropSize","defaultPropView","useSelect","useForkRef","isNotNil","Text","clearSizeMap","iconSizeMap","isMultipleParams","isNotMultipleParams","withDefaultGetters","COMPONENT_NAME","ComboboxRender","props","ref","defaultDropdownRef","controlInnerRef","helperInputFakeElement","controlRef","placeholder","onBlur","onFocus","items","onChange","value","disabled","ariaLabel","id","required","dropdownRef","form","view","size","dropdownClassName","name","groups","getItemLabel","getItemKey","getItemGroupKey","getItemDisabled","getGroupKey","getGroupLabel","renderItem","allSelectedAllLabel","searchValueProp","searchValue","renderValueProp","renderValue","onCreate","inputRefProp","inputRef","labelForNotFound","labelForCreate","labelForEmptyItems","searchFunction","selectAll","isLoading","multiple","style","dropdownForm","virtualScroll","onScrollToBottom","onDropdownOpen","onSearchValueChange","dropdownOpen","ignoreOutsideClicksRefs","dropdownViewportRef","dropdownContainer","otherProps","getKeyProps","getOptionProps","isOpen","visibleItems","isFocused","handleInputFocus","handleInputBlur","handleToggleDropdown","handleInputClick","handleInputChange","clearValue","getHandleRemoveValue","notFound","hasItems","optionsRefs","allItemsSelected","inputId","renderValueDefaultMultiple","item","handleRemove","renderValueDefaultNotMultiple","valueLabel","inputRefForRender","renderControlValue","width","Array","isArray","map","length","hide","isClearButtonVisible","hasInput","renderValueList","renderItemDefault","active","hovered","onClick","onMouseEnter","zIndex","Combobox"],"sources":["../../../../../src/components/Combobox/Combobox.tsx"],"sourcesContent":["import '##/components/SelectComponents/Select.css';\n\nimport { IconClear } from '@consta/icons/IconClear';\nimport { IconSelect } from '@consta/icons/IconSelect';\nimport React, { forwardRef, useRef } from 'react';\n\nimport { usePropsHandler } from '##/components/EventInterceptor/usePropsHandler';\nimport { cnSelect } from '##/components/SelectComponents/cnSelect';\nimport {\n defaultLabelForCreate,\n defaultLabelForEmptyItems,\n defaultLabelForNotFound,\n getInputWidth,\n} from '##/components/SelectComponents/helpers';\nimport { SelectContainer } from '##/components/SelectComponents/SelectContainer';\nimport { SelectDropdown } from '##/components/SelectComponents/SelectDropdown';\nimport { SelectItem } from '##/components/SelectComponents/SelectItem';\nimport { SelectValueTag } from '##/components/SelectComponents/SelectValueTag';\nimport {\n defaultPropForm,\n defaultPropSize,\n defaultPropView,\n} from '##/components/SelectComponents/types';\nimport { useSelect } from '##/components/SelectComponents/useSelect';\nimport { useForkRef } from '##/hooks/useForkRef';\nimport { isNotNil } from '##/utils/type-guards';\n\nimport { Text } from '../Text';\nimport {\n clearSizeMap,\n ComboboxComponent,\n ComboboxGroupDefault,\n ComboboxItemDefault,\n ComboboxPropRenderItem,\n ComboboxPropRenderValue,\n ComboboxProps,\n iconSizeMap,\n isMultipleParams,\n isNotMultipleParams,\n withDefaultGetters,\n} from './helpers';\n\nexport const COMPONENT_NAME = 'Combobox' as const;\n\nconst ComboboxRender = <\n ITEM = ComboboxItemDefault,\n GROUP = ComboboxGroupDefault,\n MULTIPLE extends boolean = false,\n>(\n props: ComboboxProps<ITEM, GROUP, MULTIPLE>,\n ref: React.Ref<HTMLDivElement>,\n) => {\n const defaultDropdownRef = useRef<HTMLDivElement | null>(null);\n const controlInnerRef = useRef<HTMLDivElement>(null);\n const helperInputFakeElement = useRef<HTMLDivElement>(null);\n const controlRef = useRef<HTMLDivElement | null>(null);\n\n const {\n placeholder,\n onBlur,\n onFocus,\n items,\n onChange,\n value,\n disabled,\n ariaLabel,\n id,\n required,\n dropdownRef,\n form = defaultPropForm,\n view = defaultPropView,\n size = defaultPropSize,\n dropdownClassName,\n name,\n groups = [],\n getItemLabel,\n getItemKey,\n getItemGroupKey,\n getItemDisabled,\n getGroupKey,\n getGroupLabel,\n renderItem,\n allSelectedAllLabel = 'Все',\n searchValue: searchValueProp,\n renderValue: renderValueProp,\n onCreate,\n inputRef: inputRefProp,\n labelForNotFound = defaultLabelForNotFound,\n labelForCreate = defaultLabelForCreate,\n labelForEmptyItems = defaultLabelForEmptyItems,\n searchFunction,\n selectAll,\n isLoading,\n multiple = false,\n style,\n dropdownForm = 'default',\n virtualScroll,\n onScrollToBottom,\n onDropdownOpen,\n onSearchValueChange,\n dropdownOpen,\n ignoreOutsideClicksRefs,\n dropdownViewportRef,\n dropdownContainer,\n ...otherProps\n } = usePropsHandler(COMPONENT_NAME, withDefaultGetters(props), controlRef);\n\n const {\n getKeyProps,\n getOptionProps,\n isOpen,\n visibleItems,\n isFocused,\n handleInputFocus,\n handleInputBlur,\n handleToggleDropdown,\n inputRef,\n handleInputClick,\n handleInputChange,\n searchValue,\n clearValue,\n getHandleRemoveValue,\n notFound,\n hasItems,\n optionsRefs,\n allItemsSelected,\n } = useSelect({\n items,\n groups,\n value,\n onChange,\n selectAll,\n dropdownRef: defaultDropdownRef,\n controlRef,\n disabled,\n getItemLabel,\n getItemKey,\n getGroupKey,\n searchValue: searchValueProp,\n getItemGroupKey,\n getItemDisabled,\n multiple,\n onBlur,\n onFocus,\n onCreate,\n searchFunction,\n onDropdownOpen,\n onSearchValueChange,\n dropdownOpen,\n ignoreOutsideClicksRefs,\n });\n\n const inputId = id ? `${id}-input` : id;\n\n const renderItemDefault: ComboboxPropRenderItem<ITEM> = (props) => {\n const { item, active, hovered, onClick, onMouseEnter, ref } = props;\n\n return (\n <SelectItem\n label={getItemLabel(item)}\n active={active}\n hovered={hovered}\n multiple={multiple}\n size={size}\n indent={dropdownForm === 'round' ? 'increased' : 'normal'}\n onClick={onClick}\n onMouseEnter={onMouseEnter}\n disabled={getItemDisabled(item)}\n ref={ref}\n />\n );\n };\n\n const renderValueDefaultMultiple: ComboboxPropRenderValue<ITEM> = ({\n item,\n handleRemove,\n }) => {\n return (\n <SelectValueTag\n label={getItemLabel(item)}\n key={getItemKey(item)}\n size={size}\n disabled={disabled || getItemDisabled(item)}\n handleRemove={handleRemove}\n />\n );\n };\n\n const renderValueDefaultNotMultiple: ComboboxPropRenderValue<ITEM> = (\n props,\n ) => {\n const valueLabel = getItemLabel(props.item);\n\n return (\n <span className={cnSelect('ControlValue')} title={valueLabel}>\n {valueLabel}\n </span>\n );\n };\n\n const renderValue =\n renderValueProp ||\n (multiple ? renderValueDefaultMultiple : renderValueDefaultNotMultiple);\n\n const inputRefForRender = useForkRef([inputRef, inputRefProp]);\n\n const renderControlValue = () => {\n const width = multiple\n ? getInputWidth(controlInnerRef, helperInputFakeElement)\n : undefined;\n return (\n <>\n {isMultipleParams(props) &&\n Array.isArray(props.value) &&\n props.value.map((item) =>\n renderValue({ item, handleRemove: getHandleRemoveValue(item) }),\n )}\n {isNotMultipleParams(props) &&\n isNotNil(props.value) &&\n renderValue({ item: props.value })}\n {(!isNotNil(value) || (Array.isArray(value) && value.length === 0)) &&\n !searchValue &&\n placeholder && (\n <span className={cnSelect('Placeholder')} title=\"placeholder\">\n {placeholder}\n </span>\n )}\n <input\n {...getKeyProps()}\n type=\"text\"\n name={name}\n id={inputId}\n onFocus={handleInputFocus}\n onBlur={handleInputBlur}\n aria-label={ariaLabel}\n onChange={handleInputChange}\n ref={inputRefForRender}\n className={cnSelect('Input', {\n size,\n hide: !multiple && isNotNil(value),\n multiple,\n })}\n value={searchValue}\n style={{ width }}\n />\n </>\n );\n };\n\n const renderValueList = () => {\n if (allItemsSelected) {\n return (\n <Text\n view=\"primary\"\n size={size}\n className={cnSelect('SelectAll')}\n lineHeight=\"m\"\n >\n {allSelectedAllLabel}\n </Text>\n );\n }\n if (multiple) {\n return (\n <div className={cnSelect('ControlValue')}>{renderControlValue()}</div>\n );\n }\n return renderControlValue();\n };\n\n const isClearButtonVisible = isMultipleParams(props)\n ? isNotNil(props.value) && props.value.length > 0\n : isNotNil(props.value);\n\n return (\n <>\n <SelectContainer\n focused={isFocused}\n disabled={disabled}\n size={size}\n view={view}\n required={required}\n form={form}\n multiple={multiple}\n ref={ref}\n type=\"combobox\"\n style={style}\n id={inputId}\n {...otherProps}\n >\n <div\n className={cnSelect('Control', { hasInput: true })}\n ref={controlRef}\n aria-expanded={isOpen}\n aria-haspopup=\"listbox\"\n id={id}\n >\n <div\n className={cnSelect('ControlInner')}\n onClick={handleInputClick}\n role=\"button\"\n ref={controlInnerRef}\n aria-hidden=\"true\"\n >\n <div className={cnSelect('ControlValueContainer')}>\n {renderValueList()}\n </div>\n </div>\n <span className={cnSelect('Indicators')}>\n {isClearButtonVisible && (\n <button\n type=\"button\"\n onClick={clearValue}\n tabIndex={-1}\n className={cnSelect('ClearIndicator')}\n >\n <IconClear\n size={clearSizeMap[size]}\n className={cnSelect('ClearIndicatorIcon')}\n />\n </button>\n )}\n <span className={cnSelect('Delimiter')} />\n <button\n type=\"button\"\n className={cnSelect('IndicatorsDropdown')}\n tabIndex={-1}\n onClick={handleToggleDropdown}\n >\n <IconSelect\n size={iconSizeMap[size]}\n className={cnSelect('DropdownIndicatorIcon')}\n />\n </button>\n </span>\n </div>\n <div\n className={cnSelect('HelperInputFakeElement')}\n ref={helperInputFakeElement}\n >\n {searchValue}\n </div>\n </SelectContainer>\n <SelectDropdown\n viewportRef={dropdownViewportRef}\n isOpen={isOpen}\n size={size}\n controlRef={controlRef}\n getOptionProps={getOptionProps}\n dropdownRef={useForkRef([dropdownRef, defaultDropdownRef])}\n form={dropdownForm}\n className={dropdownClassName}\n renderItem={renderItem || renderItemDefault}\n getGroupLabel={getGroupLabel}\n visibleItems={visibleItems}\n labelForNotFound={labelForNotFound}\n labelForCreate={labelForCreate}\n isLoading={isLoading}\n labelForEmptyItems={labelForEmptyItems}\n notFound={notFound}\n hasItems={hasItems}\n itemsRefs={optionsRefs}\n virtualScroll={virtualScroll}\n onScrollToBottom={onScrollToBottom}\n container={dropdownContainer}\n style={\n typeof style?.zIndex === 'number'\n ? { zIndex: style.zIndex + 1 }\n : undefined\n }\n />\n </>\n );\n};\n\nexport const Combobox = forwardRef(ComboboxRender) as ComboboxComponent;\n"],"mappings":"muBAAA,uCAEA,OAASA,SAAT,KAA0B,yBAA1B,CACA,OAASC,UAAT,KAA2B,0BAA3B,CACA,MAAOC,MAAP,EAAgBC,UAAhB,CAA4BC,MAA5B,KAA0C,OAA1C,CAEA,OAASC,eAAT,2CACA,OAASC,QAAT,oCACA,OACEC,qBADF,CAEEC,yBAFF,CAGEC,uBAHF,CAIEC,aAJF,mCAMA,OAASC,eAAT,2CACA,OAASC,cAAT,0CACA,OAASC,UAAT,sCACA,OAASC,cAAT,0CACA,OACEC,eADF,CAEEC,eAFF,CAGEC,eAHF,iCAKA,OAASC,SAAT,qCACA,OAASC,UAAT,8BACA,OAASC,QAAT,+BAEA,OAASC,IAAT,eACA,OACEC,YADF,CAQEC,WARF,CASEC,gBATF,CAUEC,mBAVF,CAWEC,kBAXF,iBAcA,MAAO,IAAMC,eAAc,CAAG,UAAvB,CAEP,GAAMC,eAAc,CAAG,SAKrBC,CALqB,CAMrBC,CANqB,CAOlB,IACGC,EAAkB,CAAG3B,MAAM,CAAwB,IAAxB,CAD9B,CAEG4B,CAAe,CAAG5B,MAAM,CAAiB,IAAjB,CAF3B,CAGG6B,CAAsB,CAAG7B,MAAM,CAAiB,IAAjB,CAHlC,CAIG8B,CAAU,CAAG9B,MAAM,CAAwB,IAAxB,CAJtB,GAsDCC,eAAe,CAACsB,cAAD,CAAi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ownOpen?: boolean;
80
80
  dropdownViewportRef?: React.RefObject<HTMLElement>;
81
+ dropdownContainer?: Element;
81
82
  ignoreOutsideClicksRefs?: ReadonlyArray<React.RefObject<HTMLElement>>;
82
83
  }, HTMLDivElement> & (MULTIPLE extends true ? {
83
84
  selectAll?: boolean;
@@ -157,8 +158,9 @@ export declare function withDefaultGetters<ITEM = ComboboxItemDefault, GROUP = C
157
158
  onDropdownOpen?: (isOpen: boolean) => void;
158
159
  dropdownOpen?: boolean;
159
160
  dropdownViewportRef?: React.RefObject<HTMLElement>;
161
+ dropdownContainer?: Element;
160
162
  ignoreOutsideClicksRefs?: ReadonlyArray<React.RefObject<HTMLElement>>;
161
- } & Omit<React.HTMLAttributes<HTMLDivElement>, "css" | "onFocus" | "onBlur" | "onChange" | "size" | "view" | "form" | "status" | "caption" | "label" | "name" | "disabled" | "value" | "multiple" | "placeholder" | "required" | "inputRef" | "items" | "dropdownForm" | "ariaLabel" | "dropdownClassName" | "dropdownRef" | "isLoading" | "labelForEmptyItems" | "renderItem" | "renderValue" | "groups" | "getItemLabel" | "getItemKey" | "getItemGroupKey" | "getItemDisabled" | "getGroupLabel" | "getGroupKey" | "labelIcon" | "labelPosition" | "onScrollToBottom" | "labelForCreate" | "searchFunction" | "searchValue" | "onDropdownOpen" | "onSearchValueChange" | "dropdownOpen" | "ignoreOutsideClicksRefs" | "labelForNotFound" | "virtualScroll" | "dropdownViewportRef" | "onCreate"> & React.RefAttributes<HTMLDivElement> & (MULTIPLE extends true ? {
163
+ } & Omit<React.HTMLAttributes<HTMLDivElement>, "css" | "onFocus" | "onBlur" | "onChange" | "size" | "view" | "form" | "status" | "caption" | "label" | "name" | "disabled" | "value" | "multiple" | "placeholder" | "required" | "inputRef" | "items" | "dropdownForm" | "ariaLabel" | "dropdownClassName" | "dropdownRef" | "isLoading" | "labelForEmptyItems" | "renderItem" | "renderValue" | "groups" | "getItemLabel" | "getItemKey" | "getItemGroupKey" | "getItemDisabled" | "getGroupLabel" | "getGroupKey" | "labelIcon" | "labelPosition" | "onScrollToBottom" | "labelForCreate" | "searchFunction" | "searchValue" | "onDropdownOpen" | "onSearchValueChange" | "dropdownOpen" | "ignoreOutsideClicksRefs" | "labelForNotFound" | "virtualScroll" | "dropdownViewportRef" | "dropdownContainer" | "onCreate"> & React.RefAttributes<HTMLDivElement> & (MULTIPLE extends true ? {
162
164
  selectAll?: boolean;
163
165
  allSelectedAllLabel?: string;
164
166
  } : {
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","names":["defaultGetItemKey","item","id","defaultGetItemLabel","label","defaultGetItemGroupKey","groupId","defaultGetItemDisabled","disabled","defaultGetGroupKey","group","defaultGetGroupLabel","isMultipleParams","params","multiple","isNotMultipleParams","withDefaultGetters","props","getItemLabel","getItemKey","getItemGroupKey","getItemDisabled","getGroupLabel","getGroupKey","clearSizeMap","xs","s","m","l","iconSizeMap"],"sources":["../../../../../src/components/Combobox/helpers.ts"],"sourcesContent":["import { IconComponent, IconPropSize } from '@consta/icons/Icon';\nimport React from 'react';\n\nimport {\n PropForm,\n PropSize,\n PropStatus,\n PropView,\n RenderItemProps,\n} from '##/components/SelectComponents/types';\nimport { PropsWithHTMLAttributesAndRef } from '##/utils/types/PropsWithHTMLAttributes';\n\nexport type ComboboxItemDefault = {\n label: string;\n id: string | number;\n groupId?: string | number;\n disabled?: boolean;\n};\n\nexport type ComboboxGroupDefault = {\n label: string;\n id: string | number;\n};\n\ntype RenderValueProps<ITEM> = {\n item: ITEM;\n handleRemove?: (e: React.SyntheticEvent) => void;\n};\n\nexport type ComboboxPropGetItemLabel<ITEM> = (item: ITEM) => string;\nexport type ComboboxPropGetItemKey<ITEM> = (item: ITEM) => string | number;\nexport type ComboboxPropGetItemGroupKey<ITEM> = (\n item: ITEM,\n) => string | number | undefined;\nexport type ComboboxPropGetItemDisabled<ITEM> = (\n item: ITEM,\n) => boolean | undefined;\nexport type ComboboxPropGetGroupKey<GROUP> = (group: GROUP) => string | number;\nexport type ComboboxPropGetGroupLabel<GROUP> = (group: GROUP) => string;\ntype ComboboxPropSearchFunction<ITEM> = (\n item: ITEM,\n searchValue: string,\n) => boolean;\ntype ComboboxPropOnChange<ITEM, MULTIPLE extends boolean> = (\n value: (MULTIPLE extends true ? ITEM[] : ITEM) | null,\n props: {\n e: React.SyntheticEvent;\n },\n) => void;\ntype ComboboxPropValue<ITEM, MULTIPLE extends boolean> =\n | (MULTIPLE extends true ? ITEM[] : ITEM)\n | null\n | undefined;\n\nexport type ComboboxPropRenderItem<ITEM> = (\n props: RenderItemProps<ITEM>,\n) => React.ReactNode | null;\nexport type ComboboxPropRenderValue<ITEM> = (\n props: RenderValueProps<ITEM>,\n) => React.ReactNode | null;\n\ntype ComboboxPropOnCreate = (\n label: string,\n props: { e: React.SyntheticEvent },\n) => void;\n\nexport type ComboboxProps<\n ITEM = ComboboxItemDefault,\n GROUP = ComboboxGroupDefault,\n MULTIPLE extends boolean = false,\n> = PropsWithHTMLAttributesAndRef<\n {\n items: ITEM[];\n onChange: ComboboxPropOnChange<ITEM, MULTIPLE>;\n disabled?: boolean;\n form?: PropForm;\n dropdownForm?: 'default' | 'brick' | 'round';\n size?: PropSize;\n view?: PropView;\n placeholder?: string;\n ariaLabel?: string;\n status?: PropStatus;\n isLoading?: boolean;\n dropdownClassName?: string;\n dropdownRef?: React.Ref<HTMLDivElement>;\n name?: string;\n renderItem?: ComboboxPropRenderItem<ITEM>;\n renderValue?: ComboboxPropRenderValue<ITEM>;\n onFocus?: React.FocusEventHandler<HTMLInputElement>;\n onBlur?: React.FocusEventHandler<HTMLInputElement>;\n onCreate?: ComboboxPropOnCreate;\n inputRef?: React.Ref<HTMLInputElement>;\n labelForNotFound?: string;\n required?: boolean;\n labelForCreate?: string;\n labelForEmptyItems?: string;\n searchFunction?: ComboboxPropSearchFunction<ITEM>;\n searchValue?: string;\n multiple?: MULTIPLE;\n value?: ComboboxPropValue<ITEM, MULTIPLE>;\n groups?: GROUP[];\n getItemLabel?: ComboboxPropGetItemLabel<ITEM>;\n getItemKey?: ComboboxPropGetItemKey<ITEM>;\n getItemGroupKey?: ComboboxPropGetItemGroupKey<ITEM>;\n getItemDisabled?: ComboboxPropGetItemDisabled<ITEM>;\n getGroupLabel?: ComboboxPropGetGroupLabel<GROUP>;\n getGroupKey?: ComboboxPropGetGroupKey<GROUP>;\n label?: string;\n labelIcon?: IconComponent;\n caption?: string;\n labelPosition?: 'top' | 'left';\n virtualScroll?: boolean;\n onScrollToBottom?: (length: number) => void;\n onSearchValueChange?: (value: string) => void;\n onDropdownOpen?: (isOpen: boolean) => void;\n dropdownOpen?: boolean;\n dropdownViewportRef?: React.RefObject<HTMLElement>;\n ignoreOutsideClicksRefs?: ReadonlyArray<React.RefObject<HTMLElement>>;\n },\n HTMLDivElement\n> &\n (MULTIPLE extends true\n ? {\n selectAll?: boolean;\n allSelectedAllLabel?: string;\n }\n : {\n selectAll?: never;\n allSelectedAllLabel?: never;\n }) &\n (ITEM extends { label: ComboboxItemDefault['label'] }\n ? {}\n : { getItemLabel: ComboboxPropGetItemLabel<ITEM> }) &\n (ITEM extends { id: ComboboxItemDefault['id'] }\n ? {}\n : { getItemKey: ComboboxPropGetItemKey<ITEM> }) &\n (GROUP extends { label: ComboboxGroupDefault['label'] }\n ? {}\n : { getGroupLabel: ComboboxPropGetGroupLabel<GROUP> }) &\n (GROUP extends { id: ComboboxGroupDefault['id'] }\n ? {}\n : { getGroupKey: ComboboxPropGetGroupKey<GROUP> });\n\nexport type ComboboxComponent = <\n ITEM = ComboboxItemDefault,\n GROUP = ComboboxGroupDefault,\n MULTIPLE extends boolean = false,\n>(\n props: ComboboxProps<ITEM, GROUP, MULTIPLE>,\n) => React.ReactNode | null;\n\nexport const defaultGetItemKey: ComboboxPropGetItemKey<ComboboxItemDefault> = (\n item,\n) => item.id;\nexport const defaultGetItemLabel: ComboboxPropGetItemLabel<\n ComboboxItemDefault\n> = (item) => item.label;\nexport const defaultGetItemGroupKey: ComboboxPropGetItemGroupKey<\n ComboboxItemDefault\n> = (item) => item.groupId;\nexport const defaultGetItemDisabled: ComboboxPropGetItemDisabled<\n ComboboxItemDefault\n> = (item) => item.disabled;\n\nexport const defaultGetGroupKey: ComboboxPropGetGroupKey<\n ComboboxGroupDefault\n> = (group) => group.id;\nexport const defaultGetGroupLabel: ComboboxPropGetGroupLabel<\n ComboboxGroupDefault\n> = (group) => group.label;\n\nexport const isMultipleParams = <ITEM, GROUP>(\n params: ComboboxProps<ITEM, GROUP, boolean>,\n): params is ComboboxProps<ITEM, GROUP, true> => {\n return !!params.multiple;\n};\n\nexport const isNotMultipleParams = <ITEM, GROUP>(\n params: ComboboxProps<ITEM, GROUP, boolean>,\n): params is ComboboxProps<ITEM, GROUP, false> => {\n return !params.multiple;\n};\n\nexport function withDefaultGetters<\n ITEM = ComboboxItemDefault,\n GROUP = ComboboxGroupDefault,\n MULTIPLE extends boolean = false,\n>(props: ComboboxProps<ITEM, GROUP, MULTIPLE>) {\n return {\n ...props,\n getItemLabel: props.getItemLabel || defaultGetItemLabel,\n getItemKey: props.getItemKey || defaultGetItemKey,\n getItemGroupKey: props.getItemGroupKey || defaultGetItemGroupKey,\n getItemDisabled: props.getItemDisabled || defaultGetItemDisabled,\n getGroupLabel: props.getGroupLabel || defaultGetGroupLabel,\n getGroupKey: props.getGroupKey || defaultGetGroupKey,\n };\n}\n\nexport const clearSizeMap: Record<PropSize, IconPropSize> = {\n xs: 'xs',\n s: 's',\n m: 's',\n l: 'm',\n};\n\nexport const iconSizeMap: Record<PropSize, IconPropSize> = {\n xs: 'xs',\n s: 's',\n m: 'm',\n l: 'm',\n};\n"],"mappings":"qqBAuJA,MAAO,IAAMA,kBAA8D,CAAG,SAC5EC,CAD4E,QAEzEA,EAAI,CAACC,EAFoE,CAAvE,CAGP,MAAO,IAAMC,oBAEZ,CAAG,SAACF,CAAD,QAAUA,EAAI,CAACG,KAAf,CAFG,CAGP,MAAO,IAAMC,uBAEZ,CAAG,SAACJ,CAAD,QAAUA,EAAI,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groupId","defaultGetItemDisabled","disabled","defaultGetGroupKey","group","defaultGetGroupLabel","isMultipleParams","params","multiple","isNotMultipleParams","withDefaultGetters","props","getItemLabel","getItemKey","getItemGroupKey","getItemDisabled","getGroupLabel","getGroupKey","clearSizeMap","xs","s","m","l","iconSizeMap"],"sources":["../../../../../src/components/Combobox/helpers.ts"],"sourcesContent":["import { IconComponent, IconPropSize } from '@consta/icons/Icon';\nimport React from 'react';\n\nimport {\n PropForm,\n PropSize,\n PropStatus,\n PropView,\n RenderItemProps,\n} from '##/components/SelectComponents/types';\nimport { PropsWithHTMLAttributesAndRef } from '##/utils/types/PropsWithHTMLAttributes';\n\nexport type ComboboxItemDefault = {\n label: string;\n id: string | number;\n groupId?: string | number;\n disabled?: boolean;\n};\n\nexport type ComboboxGroupDefault = {\n label: string;\n id: string | number;\n};\n\ntype RenderValueProps<ITEM> = {\n item: ITEM;\n handleRemove?: (e: React.SyntheticEvent) => void;\n};\n\nexport type ComboboxPropGetItemLabel<ITEM> = (item: ITEM) => string;\nexport type ComboboxPropGetItemKey<ITEM> = (item: ITEM) => string | number;\nexport type ComboboxPropGetItemGroupKey<ITEM> = (\n item: ITEM,\n) => string | number | undefined;\nexport type ComboboxPropGetItemDisabled<ITEM> = (\n item: ITEM,\n) => boolean | undefined;\nexport type ComboboxPropGetGroupKey<GROUP> = (group: GROUP) => string | number;\nexport type ComboboxPropGetGroupLabel<GROUP> = (group: GROUP) => string;\ntype ComboboxPropSearchFunction<ITEM> = (\n item: ITEM,\n searchValue: string,\n) => boolean;\ntype ComboboxPropOnChange<ITEM, MULTIPLE extends boolean> = (\n value: (MULTIPLE extends true ? ITEM[] : ITEM) | null,\n props: {\n e: React.SyntheticEvent;\n },\n) => void;\ntype ComboboxPropValue<ITEM, MULTIPLE extends boolean> =\n | (MULTIPLE extends true ? ITEM[] : ITEM)\n | null\n | undefined;\n\nexport type ComboboxPropRenderItem<ITEM> = (\n props: RenderItemProps<ITEM>,\n) => React.ReactNode | null;\nexport type ComboboxPropRenderValue<ITEM> = (\n props: RenderValueProps<ITEM>,\n) => React.ReactNode | null;\n\ntype ComboboxPropOnCreate = (\n label: string,\n props: { e: React.SyntheticEvent },\n) => void;\n\nexport type ComboboxProps<\n ITEM = ComboboxItemDefault,\n GROUP = ComboboxGroupDefault,\n MULTIPLE extends boolean = false,\n> = PropsWithHTMLAttributesAndRef<\n {\n items: ITEM[];\n onChange: ComboboxPropOnChange<ITEM, MULTIPLE>;\n disabled?: boolean;\n form?: PropForm;\n dropdownForm?: 'default' | 'brick' | 'round';\n size?: PropSize;\n view?: PropView;\n placeholder?: string;\n ariaLabel?: string;\n status?: PropStatus;\n isLoading?: boolean;\n dropdownClassName?: string;\n dropdownRef?: React.Ref<HTMLDivElement>;\n name?: string;\n renderItem?: ComboboxPropRenderItem<ITEM>;\n renderValue?: ComboboxPropRenderValue<ITEM>;\n onFocus?: React.FocusEventHandler<HTMLInputElement>;\n onBlur?: React.FocusEventHandler<HTMLInputElement>;\n onCreate?: ComboboxPropOnCreate;\n inputRef?: React.Ref<HTMLInputElement>;\n labelForNotFound?: string;\n required?: boolean;\n labelForCreate?: string;\n labelForEmptyItems?: string;\n searchFunction?: ComboboxPropSearchFunction<ITEM>;\n searchValue?: string;\n multiple?: MULTIPLE;\n value?: ComboboxPropValue<ITEM, MULTIPLE>;\n groups?: GROUP[];\n getItemLabel?: ComboboxPropGetItemLabel<ITEM>;\n getItemKey?: ComboboxPropGetItemKey<ITEM>;\n getItemGroupKey?: ComboboxPropGetItemGroupKey<ITEM>;\n getItemDisabled?: ComboboxPropGetItemDisabled<ITEM>;\n getGroupLabel?: ComboboxPropGetGroupLabel<GROUP>;\n getGroupKey?: ComboboxPropGetGroupKey<GROUP>;\n label?: string;\n labelIcon?: IconComponent;\n caption?: string;\n labelPosition?: 'top' | 'left';\n virtualScroll?: boolean;\n onScrollToBottom?: (length: number) => void;\n onSearchValueChange?: (value: string) => void;\n onDropdownOpen?: (isOpen: boolean) => void;\n dropdownOpen?: boolean;\n dropdownViewportRef?: React.RefObject<HTMLElement>;\n dropdownContainer?: Element;\n ignoreOutsideClicksRefs?: ReadonlyArray<React.RefObject<HTMLElement>>;\n },\n HTMLDivElement\n> &\n (MULTIPLE extends true\n ? {\n selectAll?: boolean;\n allSelectedAllLabel?: string;\n }\n : {\n selectAll?: never;\n allSelectedAllLabel?: never;\n }) &\n (ITEM extends { label: ComboboxItemDefault['label'] }\n ? {}\n : { getItemLabel: ComboboxPropGetItemLabel<ITEM> }) &\n (ITEM extends { id: ComboboxItemDefault['id'] }\n ? {}\n : { getItemKey: ComboboxPropGetItemKey<ITEM> }) &\n (GROUP extends { label: ComboboxGroupDefault['label'] }\n ? {}\n : { getGroupLabel: ComboboxPropGetGroupLabel<GROUP> }) &\n (GROUP extends { id: ComboboxGroupDefault['id'] }\n ? {}\n : { getGroupKey: ComboboxPropGetGroupKey<GROUP> });\n\nexport type ComboboxComponent = <\n ITEM = ComboboxItemDefault,\n GROUP = ComboboxGroupDefault,\n MULTIPLE extends boolean = false,\n>(\n props: ComboboxProps<ITEM, GROUP, MULTIPLE>,\n) => React.ReactNode | null;\n\nexport const defaultGetItemKey: ComboboxPropGetItemKey<ComboboxItemDefault> = (\n item,\n) => item.id;\nexport const defaultGetItemLabel: ComboboxPropGetItemLabel<\n ComboboxItemDefault\n> = (item) => item.label;\nexport const defaultGetItemGroupKey: ComboboxPropGetItemGroupKey<\n ComboboxItemDefault\n> = (item) => item.groupId;\nexport const defaultGetItemDisabled: ComboboxPropGetItemDisabled<\n ComboboxItemDefault\n> = (item) => item.disabled;\n\nexport const defaultGetGroupKey: ComboboxPropGetGroupKey<\n ComboboxGroupDefault\n> = (group) => group.id;\nexport const defaultGetGroupLabel: ComboboxPropGetGroupLabel<\n ComboboxGroupDefault\n> = (group) => group.label;\n\nexport const isMultipleParams = <ITEM, GROUP>(\n params: ComboboxProps<ITEM, GROUP, boolean>,\n): params is ComboboxProps<ITEM, GROUP, true> => {\n return !!params.multiple;\n};\n\nexport const isNotMultipleParams = <ITEM, GROUP>(\n params: ComboboxProps<ITEM, GROUP, boolean>,\n): params is ComboboxProps<ITEM, GROUP, false> => {\n return !params.multiple;\n};\n\nexport function withDefaultGetters<\n ITEM = ComboboxItemDefault,\n GROUP = ComboboxGroupDefault,\n MULTIPLE extends boolean = false,\n>(props: ComboboxProps<ITEM, GROUP, MULTIPLE>) {\n return {\n ...props,\n getItemLabel: props.getItemLabel || defaultGetItemLabel,\n getItemKey: props.getItemKey || defaultGetItemKey,\n getItemGroupKey: props.getItemGroupKey || defaultGetItemGroupKey,\n getItemDisabled: props.getItemDisabled || defaultGetItemDisabled,\n getGroupLabel: props.getGroupLabel || defaultGetGroupLabel,\n getGroupKey: props.getGroupKey || defaultGetGroupKey,\n };\n}\n\nexport const clearSizeMap: Record<PropSize, IconPropSize> = {\n xs: 'xs',\n s: 's',\n m: 's',\n l: 'm',\n};\n\nexport const iconSizeMap: Record<PropSize, IconPropSize> = {\n xs: 'xs',\n s: 's',\n m: 'm',\n l: 'm',\n};\n"],"mappings":"qqBAwJA,MAAO,IAAMA,kBAA8D,CAAG,SAC5EC,CAD4E,QAEzEA,EAAI,CAACC,EAFoE,CAAvE,CAGP,MAAO,IAAMC,oBAEZ,CAAG,SAACF,CAAD,QAAUA,EAAI,CAACG,KAAf,CAFG,CAGP,MAAO,IAAMC,uBAEZ,CAAG,SAACJ,CAAD,QAAUA,EAAI,CAACK,OAAf,CAFG,CAGP,MAAO,IAAMC,uBAEZ,CAAG,SAACN,CAAD,QAAUA,EAAI,CAACO,QAAf,CAFG,CAIP,MAAO,IAAMC,mBAEZ,CAAG,SAACC,CAAD,QAAWA,EAAK,CAACR,EAAjB,CAFG,CAGP,MAAO,IAAMS,qBAEZ,CAAG,SAACD,CAAD,QAAWA,EAAK,CAACN,KAAjB,CAFG,CAIP,MAAO,IAAMQ,iBAAgB,CAAG,SAC9BC,CAD8B,CAEiB,CAC/C,MAAO,CAAC,CAACA,CAAM,CAACC,QACjB,CAJM,CAMP,MAAO,IAAMC,oBAAmB,CAAG,SACjCF,CADiC,CAEe,CAChD,MAAO,CAACA,CAAM,CAACC,QAChB,CAJM,CAMP,MAAO,SAASE,mBAAT,CAILC,CAJK,CAIwC,CAC7C,sCACKA,CADL,MAEEC,YAAY,CAAED,CAAK,CAACC,YAAN,EAAsBf,mBAFtC,CAGEgB,UAAU,CAAEF,CAAK,CAACE,UAAN,EAAoBnB,iBAHlC,CAIEoB,eAAe,CAAEH,CAAK,CAACG,eAAN,EAAyBf,sBAJ5C,CAKEgB,eAAe,CAAEJ,CAAK,CAACI,eAAN,EAAyBd,sBAL5C,CAMEe,aAAa,CAAEL,CAAK,CAACK,aAAN,EAAuBX,oBANxC,CAOEY,WAAW,CAAEN,CAAK,CAACM,WAAN,EAAqBd,kBAPpC,EASD,CAED,MAAO,IAAMe,aAA4C,CAAG,CAC1DC,EAAE,CAAE,IADsD,CAE1DC,CAAC,CAAE,GAFuD,CAG1DC,CAAC,CAAE,GAHuD,CAI1DC,CAAC,CAAE,GAJuD,CAArD,CAOP,MAAO,IAAMC,YAA2C,CAAG,CACzDJ,EAAE,CAAE,IADqD,CAEzDC,CAAC,CAAE,GAFsD,CAGzDC,CAAC,CAAE,GAHsD,CAIzDC,CAAC,CAAE,GAJsD,CAApD"}
@@ -1 +1 @@
1
- {"version":3,"file":"ContextMenuLevel.js","names":["IconArrowLeft","IconArrowRight","React","forwardRef","useEffect","useMemo","cnListBox","List","ListDivider","ListItem","mapIconSize","mapVerticalSpace","useFlag","useForkRef","cnMixPopoverAnimate","cnMixSpace","cn","ContextMenuLevelWrapper","contextMenuDefaultSize","useMenuNavigation","cnContextMenuLevel","timers","clearTimers","timer","clearTimeout","closeDelay","ContextMenuLevelRender","props","ref","size","items","groupsProp","groups","className","form","animate","levelDepth","activeLevelDepth","activeItem","addLevel","deleteLevel","setHoveredParenLevel","hoveredParenLevel","sortGroup","onItemClickProp","onItemClick","onEsc","isOpen","parent","isMobile","viewportRef","direction","possibleDirections","offset","onSetDirection","spareDirection","anchorRef","getItemLabel","getItemRightSideProp","getItemRightSide","getItemLeftSide","getItemSubMenu","getItemStatus","getItemDisabled","getItemKey","getItemOnClickProp","getItemOnClick","getItemAs","getItemAttributesProp","getItemAttributes","getItemGroupId","getItemLeftIcon","getItemRightIcon","getGroupLabel","getGroupId","otherProps","firstLevel","hovered","setHovered","getKey","item","toString","addCurrentLevel","subMenu","disabled","Array","isArray","key","level","itemsRefs","active","handleEscClick","e","current","focus","refs","onKeyDown","activeIndex","setActiveIndex","setDirection","parentRef","containerRef","map","reduce","a","v","index","activeKey","onMouseEnter","indexOf","setTimeout","border","shadow","pV","on","onMouseLeave","off","mV","b","tabIndex","side","sides","push","getItemActive","ContextMenuLevel"],"sources":["../../../../../../src/components/ContextMenu/ContextMenuLevel/ContextMenuLevel.tsx"],"sourcesContent":["import './ContextMenuLevel.css';\n\nimport { IconArrowLeft } from '@consta/icons/IconArrowLeft';\nimport { IconArrowRight } from '@consta/icons/IconArrowRight';\nimport React, { forwardRef, useEffect, useMemo } from 'react';\n\nimport {\n cnListBox,\n List,\n ListDivider,\n ListItem,\n ListPropOnItemClick,\n mapIconSize,\n mapVerticalSpace,\n} from '##/components/ListCanary';\nimport { useFlag } from '##/hooks/useFlag/useFlag';\nimport { useForkRef } from '##/hooks/useForkRef';\nimport { cnMixPopoverAnimate } from '##/mixs/MixPopoverAnimate';\nimport { cnMixSpace } from '##/mixs/MixSpace';\nimport { cn } from '##/utils/bem';\nimport { AsAttributes, AsTagAttribute } from '##/utils/types/AsTags';\n\nimport { ContextMenuLevelWrapper } from '../ContextMenuLevelWrapper';\nimport {\n contextMenuDefaultSize,\n ContextMenuItemDefault,\n ContextMenuLevelComponent,\n ContextMenuLevelProps,\n} from '../types';\nimport { useMenuNavigation } from '../useMenuNavigation';\n\nexport const cnContextMenuLevel = cn('ContextMenuLevel');\n\nlet timers: ReturnType<typeof setTimeout>[] = [];\nexport function clearTimers() {\n for (const timer of timers) {\n clearTimeout(timer);\n }\n timers = [];\n}\n\nconst closeDelay = 300;\n\nconst ContextMenuLevelRender = (\n props: ContextMenuLevelProps,\n ref: React.Ref<HTMLDivElement>,\n) => {\n const {\n size = contextMenuDefaultSize,\n items,\n groups: groupsProp,\n className,\n form = 'default',\n animate,\n // Свойства относящиеся к меню\n levelDepth,\n activeLevelDepth,\n activeItem,\n addLevel,\n deleteLevel,\n setHoveredParenLevel,\n hoveredParenLevel,\n sortGroup,\n onItemClick: onItemClickProp,\n onEsc,\n isOpen,\n parent,\n isMobile,\n viewportRef,\n // Свойства для поповера\n direction,\n possibleDirections,\n offset,\n onSetDirection,\n spareDirection,\n anchorRef,\n // Геттеры для ITEM\n getItemLabel,\n getItemRightSide: getItemRightSideProp,\n getItemLeftSide,\n getItemSubMenu,\n getItemStatus,\n getItemDisabled,\n getItemKey,\n getItemOnClick: getItemOnClickProp,\n getItemAs,\n getItemAttributes: getItemAttributesProp,\n getItemGroupId,\n getItemLeftIcon,\n getItemRightIcon,\n // Геттеры для GROUP\n getGroupLabel,\n getGroupId,\n ...otherProps\n } = props;\n\n const firstLevel = levelDepth === 0;\n\n const [hovered, setHovered] = useFlag(false);\n\n const getKey = (item: ContextMenuItemDefault) =>\n (getItemKey(item) || getItemLabel(item)).toString();\n\n const addCurrentLevel = (item: ContextMenuItemDefault) => {\n const subMenu = getItemSubMenu(item);\n const disabled = getItemDisabled(item);\n\n if (Array.isArray(subMenu) && !disabled) {\n const key = getKey(item);\n addLevel({\n level: levelDepth + 1,\n items: subMenu,\n anchorRef: itemsRefs[key],\n activeItem: key,\n parent: item,\n });\n setHoveredParenLevel(levelDepth + 1);\n } else {\n setHoveredParenLevel(levelDepth);\n }\n };\n\n const handleEscClick: React.KeyboardEventHandler = (e) => {\n onEsc?.(e);\n anchorRef?.current?.focus();\n };\n\n const {\n refs,\n onKeyDown,\n activeIndex,\n setActiveIndex,\n setDirection,\n parentRef,\n containerRef,\n } = useMenuNavigation({\n items,\n getItemSubMenu,\n addLevel: addCurrentLevel,\n active: activeLevelDepth === levelDepth,\n deleteLevel: () => deleteLevel(levelDepth),\n onEsc: handleEscClick,\n level: levelDepth,\n isMobile,\n });\n\n const itemsRefs = useMemo(() => {\n return items\n .map((item) => getKey(item))\n .reduce((a, v, index) => ({ ...a, [v]: refs[index] }), {}) as Record<\n string,\n React.RefObject<HTMLDivElement>\n >;\n }, [groupsProp, refs]);\n\n const activeKey = useMemo(() => {\n const item = items[activeIndex];\n return item ? getKey(item) : undefined;\n }, [items, activeIndex]);\n\n const onMouseEnter = isMobile\n ? undefined\n : (item: ContextMenuItemDefault): AsTagAttribute<'div'>['onMouseEnter'] =>\n (e) => {\n addCurrentLevel(item);\n const onMouseEnter = getItemAttributesProp(item)\n ?.onMouseEnter as AsTagAttribute<'div'>['onMouseEnter'];\n setActiveIndex(items.indexOf(item));\n onMouseEnter?.(e);\n };\n\n // GETTERS\n\n const getItemOnClick = getItemOnClickProp\n ? (item: ContextMenuItemDefault) => (e: React.MouseEvent) =>\n getItemOnClickProp(item)?.(e as React.MouseEvent<HTMLDivElement>)\n : undefined;\n\n const getItemAttributes = (item: ContextMenuItemDefault) =>\n ({\n ...getItemAttributesProp(item),\n tabIndex: 0,\n onMouseEnter: onMouseEnter?.(item),\n } as AsAttributes);\n\n const getItemActive = (item: ContextMenuItemDefault) => {\n const key = getKey(item);\n return key === activeItem || key === activeKey;\n };\n\n const getItemRightSide = (item: ContextMenuItemDefault) => {\n const side = getItemRightSideProp(item);\n if (!getItemSubMenu(item)) {\n return side;\n }\n\n const sides: React.ReactNode[] = Array.isArray(side) ? side : [side];\n sides.push(<IconArrowRight size={mapIconSize[size]} />);\n return sides;\n };\n\n const onMouseLeave: React.MouseEventHandler = () => {\n setHovered.off();\n setActiveIndex(-1);\n };\n\n const onItemClick: ListPropOnItemClick<ContextMenuItemDefault> = (\n item,\n { e },\n ) => {\n if (isMobile) {\n addCurrentLevel(item);\n setActiveIndex(items.indexOf(item));\n }\n onItemClickProp?.(item, {\n e: e as React.MouseEvent<HTMLDivElement>,\n });\n };\n\n // EFFECTS\n\n useEffect(() => {\n if (levelDepth !== 0 && !hovered && hoveredParenLevel < levelDepth) {\n clearTimeout(timers[levelDepth]);\n timers[levelDepth] = setTimeout(\n () => deleteLevel(levelDepth),\n closeDelay,\n );\n }\n return () => clearTimeout(timers[levelDepth]);\n }, [hovered, hoveredParenLevel]);\n\n useEffect(() => {\n if (!isOpen) {\n clearTimeout(timers[levelDepth]);\n }\n }, [isOpen]);\n\n return (\n <ContextMenuLevelWrapper\n anchorRef={anchorRef}\n className={\n isMobile\n ? cnContextMenuLevel(\n 'Mobile',\n { animate, firstLevel, level: levelDepth.toString() },\n [className],\n )\n : cnContextMenuLevel(\n 'Desktop',\n { firstLevel, level: levelDepth.toString() },\n [\n cnListBox({ size, form, border: true, shadow: true }),\n cnMixSpace({\n pV: mapVerticalSpace[size],\n }),\n cnMixPopoverAnimate({ animate }),\n className,\n ],\n )\n }\n possibleDirections={possibleDirections}\n spareDirection={spareDirection}\n direction={direction}\n offset={offset}\n tabIndex={0}\n onKeyDown={onKeyDown}\n onSetDirection={(direction) => {\n onSetDirection?.(direction);\n setDirection(direction);\n }}\n onMouseEnter={setHovered.on}\n onMouseLeave={onMouseLeave}\n ref={useForkRef([ref, containerRef])}\n isMobile={isMobile}\n viewportRef={viewportRef}\n {...otherProps}\n >\n {parent && (\n <>\n <ListItem\n label={getItemLabel(parent)}\n size={size}\n tabIndex={0}\n ref={parentRef}\n leftIcon={IconArrowLeft}\n onClick={() => deleteLevel(levelDepth)}\n active={activeIndex === -1}\n className={cnContextMenuLevel('Item', {\n active: activeIndex === -1,\n })}\n />\n <ListDivider size={size} space={{ mV: mapVerticalSpace[size] }} />\n </>\n )}\n <List\n size={size}\n items={items}\n getItemLabel={getItemLabel}\n onItemClick={onItemClick}\n sortGroup={sortGroup ? (a, b) => sortGroup(a.key, b.key) : undefined}\n getItemOnClick={getItemOnClick}\n getItemAs={getItemAs}\n getItemAttributes={getItemAttributes}\n getItemGroupKey={getItemGroupId}\n getItemLeftIcon={getItemLeftIcon}\n getItemRightIcon={getItemRightIcon}\n getItemLeftSide={getItemLeftSide}\n getItemRightSide={getItemRightSide}\n getGroupKey={getGroupId}\n getGroupLabel={getGroupLabel}\n getItemDisabled={getItemDisabled}\n getItemStatus={getItemStatus}\n getItemActive={getItemActive}\n getItemAdditionalClassName={(item) =>\n cnContextMenuLevel('Item', {\n active: getKey(item) === activeItem,\n })\n }\n getItemRef={(item) => itemsRefs[getKey(item)]}\n groups={groupsProp}\n innerOffset={form === 'round' ? 'increased' : 'normal'}\n />\n </ContextMenuLevelWrapper>\n );\n};\n\nexport const ContextMenuLevel = forwardRef(\n ContextMenuLevelRender,\n) as ContextMenuLevelComponent;\n"],"mappings":"miFAAA,+BAEA,OAASA,aAAT,KAA8B,6BAA9B,CACA,OAASC,cAAT,KAA+B,8BAA/B,CACA,MAAOC,MAAP,EAAgBC,UAAhB,CAA4BC,SAA5B,CAAuCC,OAAvC,KAAsD,OAAtD,CAEA,OACEC,SADF,CAEEC,IAFF,CAGEC,WAHF,CAIEC,QAJF,CAMEC,WANF,CAOEC,gBAPF,wBASA,OAASC,OAAT,sCACA,OAASC,UAAT,iCACA,OAASC,mBAAT,uCACA,OAASC,UAAT,8BACA,OAASC,EAAT,0BAGA,OAASC,uBAAT,kCACA,OACEC,sBADF,gBAMA,OAASC,iBAAT,4BAEA,MAAO,IAAMC,mBAAkB,CAAGJ,EAAE,CAAC,kBAAD,CAA7B,CAEP,GAAIK,OAAuC,CAAG,EAA9C,CACA,MAAO,SAASC,YAAT,EAAuB,oCACRD,MADQ,MAC5B,2BAA4B,IAAjBE,EAAiB,SAC1BC,YAAY,CAACD,CAAD,CACb,CAH2B,+BAI5BF,MAAM,CAAG,EACV,C,GAEKI,WAAU,CAAG,G,CAEbC,sBAAsB,CAAG,SAC7BC,CAD6B,CAE7BC,CAF6B,CAG1B,OAgDCD,CAhDD,CAEDE,IAFC,CAEDA,CAFC,YA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C,CAAD,QAAUS,GAAS,CAACV,CAAM,CAACC,CAAD,CAAP,CAAnB,CAxBd,CAyBE,MAAM,CAAEjD,CAzBV,CA0BE,WAAW,CAAW,OAAT,GAAAG,CAAI,CAAe,WAAf,CAA6B,QA1BhD,EAxDF,CAsFH,C,CAED,MAAO,IAAM0F,iBAAgB,CAAGzH,UAAU,CACxCuB,sBADwC,CAAnC"}
1
+ {"version":3,"file":"ContextMenuLevel.js","names":["IconArrowLeft","IconArrowRight","React","forwardRef","useEffect","useMemo","cnListBox","List","ListDivider","ListItem","mapIconSize","mapVerticalSpace","useFlag","useForkRef","cnMixPopoverAnimate","cnMixSpace","cn","ContextMenuLevelWrapper","contextMenuDefaultSize","useMenuNavigation","cnContextMenuLevel","timers","clearTimers","timer","clearTimeout","closeDelay","ContextMenuLevelRender","props","ref","size","items","groupsProp","groups","className","form","animate","levelDepth","activeLevelDepth","activeItem","addLevel","deleteLevel","setHoveredParenLevel","hoveredParenLevel","sortGroup","onItemClickProp","onItemClick","onEsc","isOpen","parent","isMobile","viewportRef","direction","possibleDirections","offset","onSetDirection","spareDirection","anchorRef","getItemLabel","getItemRightSideProp","getItemRightSide","getItemLeftSide","getItemSubMenu","getItemStatus","getItemDisabled","getItemKey","getItemOnClickProp","getItemOnClick","getItemAs","getItemAttributesProp","getItemAttributes","getItemGroupId","getItemLeftIcon","getItemRightIcon","getGroupLabel","getGroupId","otherProps","firstLevel","hovered","setHovered","getKey","item","toString","addCurrentLevel","subMenu","disabled","Array","isArray","key","level","itemsRefs","active","handleEscClick","e","current","focus","refs","onKeyDown","activeIndex","setActiveIndex","setDirection","parentRef","containerRef","map","reduce","a","v","index","activeKey","onMouseEnter","indexOf","setTimeout","border","shadow","pV","on","onMouseLeave","off","mV","b","tabIndex","side","sides","push","getItemActive","ContextMenuLevel"],"sources":["../../../../../../src/components/ContextMenu/ContextMenuLevel/ContextMenuLevel.tsx"],"sourcesContent":["import './ContextMenuLevel.css';\n\nimport { IconArrowLeft } from '@consta/icons/IconArrowLeft';\nimport { IconArrowRight } from '@consta/icons/IconArrowRight';\nimport React, { forwardRef, useEffect, useMemo } from 'react';\n\nimport {\n cnListBox,\n List,\n ListDivider,\n ListItem,\n ListPropOnItemClick,\n mapIconSize,\n mapVerticalSpace,\n} from '##/components/ListCanary';\nimport { useFlag } from '##/hooks/useFlag/useFlag';\nimport { useForkRef } from '##/hooks/useForkRef';\nimport { cnMixPopoverAnimate } from '##/mixs/MixPopoverAnimate';\nimport { cnMixSpace } from '##/mixs/MixSpace';\nimport { cn } from '##/utils/bem';\nimport { AsAttributes, AsTagAttribute } from '##/utils/types/AsTags';\n\nimport { ContextMenuLevelWrapper } from '../ContextMenuLevelWrapper';\nimport {\n contextMenuDefaultSize,\n ContextMenuItemDefault,\n ContextMenuLevelComponent,\n ContextMenuLevelProps,\n} from '../types';\nimport { useMenuNavigation } from '../useMenuNavigation';\n\nexport const cnContextMenuLevel = cn('ContextMenuLevel');\n\nlet timers: ReturnType<typeof setTimeout>[] = [];\nexport function clearTimers() {\n for (const timer of timers) {\n clearTimeout(timer);\n }\n timers = [];\n}\n\nconst closeDelay = 300;\n\nconst ContextMenuLevelRender = (\n props: ContextMenuLevelProps,\n ref: React.Ref<HTMLDivElement>,\n) => {\n const {\n size = contextMenuDefaultSize,\n items,\n groups: groupsProp,\n className,\n form = 'default',\n animate,\n // Свойства относящиеся к меню\n levelDepth,\n activeLevelDepth,\n activeItem,\n addLevel,\n deleteLevel,\n setHoveredParenLevel,\n hoveredParenLevel,\n sortGroup,\n onItemClick: onItemClickProp,\n onEsc,\n isOpen,\n parent,\n isMobile,\n viewportRef,\n // Свойства для поповера\n direction,\n possibleDirections,\n offset,\n onSetDirection,\n spareDirection,\n anchorRef,\n // Геттеры для ITEM\n getItemLabel,\n getItemRightSide: getItemRightSideProp,\n getItemLeftSide,\n getItemSubMenu,\n getItemStatus,\n getItemDisabled,\n getItemKey,\n getItemOnClick: getItemOnClickProp,\n getItemAs,\n getItemAttributes: getItemAttributesProp,\n getItemGroupId,\n getItemLeftIcon,\n getItemRightIcon,\n // Геттеры для GROUP\n getGroupLabel,\n getGroupId,\n ...otherProps\n } = props;\n\n const firstLevel = levelDepth === 0;\n\n const [hovered, setHovered] = useFlag(false);\n\n const getKey = (item: ContextMenuItemDefault) =>\n (getItemKey(item) || getItemLabel(item)).toString();\n\n const addCurrentLevel = (item: ContextMenuItemDefault) => {\n const subMenu = getItemSubMenu(item);\n const disabled = getItemDisabled(item);\n\n if (Array.isArray(subMenu) && !disabled) {\n const key = getKey(item);\n addLevel({\n level: levelDepth + 1,\n items: subMenu,\n anchorRef: itemsRefs[key],\n activeItem: key,\n parent: item,\n });\n setHoveredParenLevel(levelDepth + 1);\n } else {\n setHoveredParenLevel(levelDepth);\n }\n };\n\n const handleEscClick: React.KeyboardEventHandler = (e) => {\n onEsc?.(e);\n anchorRef?.current?.focus();\n };\n\n const {\n refs,\n onKeyDown,\n activeIndex,\n setActiveIndex,\n setDirection,\n parentRef,\n containerRef,\n } = useMenuNavigation({\n items,\n getItemSubMenu,\n addLevel: addCurrentLevel,\n active: activeLevelDepth === levelDepth,\n deleteLevel: () => deleteLevel(levelDepth),\n onEsc: handleEscClick,\n level: levelDepth,\n isMobile,\n });\n\n const itemsRefs = useMemo(() => {\n return items\n .map((item) => getKey(item))\n .reduce((a, v, index) => ({ ...a, [v]: refs[index] }), {}) as Record<\n string,\n React.RefObject<HTMLDivElement>\n >;\n }, [groupsProp, refs]);\n\n const activeKey = useMemo(() => {\n const item = items[activeIndex];\n return item ? getKey(item) : undefined;\n }, [items, activeIndex]);\n\n const onMouseEnter = isMobile\n ? undefined\n : (item: ContextMenuItemDefault): AsTagAttribute<'div'>['onMouseEnter'] =>\n (e) => {\n addCurrentLevel(item);\n const onMouseEnter = getItemAttributesProp(item)\n ?.onMouseEnter as AsTagAttribute<'div'>['onMouseEnter'];\n setActiveIndex(items.indexOf(item));\n onMouseEnter?.(e);\n };\n\n // GETTERS\n\n const getItemOnClick = getItemOnClickProp\n ? (item: ContextMenuItemDefault) => (e: React.MouseEvent) =>\n getItemOnClickProp(item)?.(e as React.MouseEvent<HTMLDivElement>)\n : undefined;\n\n const getItemAttributes = (item: ContextMenuItemDefault) =>\n ({\n ...getItemAttributesProp(item),\n tabIndex: 0,\n onMouseEnter: onMouseEnter?.(item),\n }) as AsAttributes;\n\n const getItemActive = (item: ContextMenuItemDefault) => {\n const key = getKey(item);\n return key === activeItem || key === activeKey;\n };\n\n const getItemRightSide = (item: ContextMenuItemDefault) => {\n const side = getItemRightSideProp(item);\n if (!getItemSubMenu(item)) {\n return side;\n }\n\n const sides: React.ReactNode[] = Array.isArray(side) ? side : [side];\n sides.push(<IconArrowRight size={mapIconSize[size]} />);\n return sides;\n };\n\n const onMouseLeave: React.MouseEventHandler = () => {\n setHovered.off();\n setActiveIndex(-1);\n };\n\n const onItemClick: ListPropOnItemClick<ContextMenuItemDefault> = (\n item,\n { e },\n ) => {\n if (isMobile) {\n addCurrentLevel(item);\n setActiveIndex(items.indexOf(item));\n }\n onItemClickProp?.(item, {\n e: e as React.MouseEvent<HTMLDivElement>,\n });\n };\n\n // EFFECTS\n\n useEffect(() => {\n if (levelDepth !== 0 && !hovered && hoveredParenLevel < levelDepth) {\n clearTimeout(timers[levelDepth]);\n timers[levelDepth] = setTimeout(\n () => deleteLevel(levelDepth),\n closeDelay,\n );\n }\n return () => clearTimeout(timers[levelDepth]);\n }, [hovered, hoveredParenLevel]);\n\n useEffect(() => {\n if (!isOpen) {\n clearTimeout(timers[levelDepth]);\n }\n }, [isOpen]);\n\n return (\n <ContextMenuLevelWrapper\n anchorRef={anchorRef}\n className={\n isMobile\n ? cnContextMenuLevel(\n 'Mobile',\n { animate, firstLevel, level: levelDepth.toString() },\n [className],\n )\n : cnContextMenuLevel(\n 'Desktop',\n { firstLevel, level: levelDepth.toString() },\n [\n cnListBox({ size, form, border: true, shadow: true }),\n cnMixSpace({\n pV: mapVerticalSpace[size],\n }),\n cnMixPopoverAnimate({ animate }),\n className,\n ],\n )\n }\n possibleDirections={possibleDirections}\n spareDirection={spareDirection}\n direction={direction}\n offset={offset}\n tabIndex={0}\n onKeyDown={onKeyDown}\n onSetDirection={(direction) => {\n onSetDirection?.(direction);\n setDirection(direction);\n }}\n onMouseEnter={setHovered.on}\n onMouseLeave={onMouseLeave}\n ref={useForkRef([ref, containerRef])}\n isMobile={isMobile}\n viewportRef={viewportRef}\n {...otherProps}\n >\n {parent && (\n <>\n <ListItem\n label={getItemLabel(parent)}\n size={size}\n tabIndex={0}\n ref={parentRef}\n leftIcon={IconArrowLeft}\n onClick={() => deleteLevel(levelDepth)}\n active={activeIndex === -1}\n className={cnContextMenuLevel('Item', {\n active: activeIndex === -1,\n })}\n />\n <ListDivider size={size} space={{ mV: mapVerticalSpace[size] }} />\n </>\n )}\n <List\n size={size}\n items={items}\n getItemLabel={getItemLabel}\n onItemClick={onItemClick}\n sortGroup={sortGroup ? (a, b) => sortGroup(a.key, b.key) : undefined}\n getItemOnClick={getItemOnClick}\n getItemAs={getItemAs}\n getItemAttributes={getItemAttributes}\n getItemGroupKey={getItemGroupId}\n getItemLeftIcon={getItemLeftIcon}\n getItemRightIcon={getItemRightIcon}\n getItemLeftSide={getItemLeftSide}\n getItemRightSide={getItemRightSide}\n getGroupKey={getGroupId}\n getGroupLabel={getGroupLabel}\n getItemDisabled={getItemDisabled}\n getItemStatus={getItemStatus}\n getItemActive={getItemActive}\n getItemAdditionalClassName={(item) =>\n cnContextMenuLevel('Item', {\n active: getKey(item) === activeItem,\n })\n }\n getItemRef={(item) => itemsRefs[getKey(item)]}\n groups={groupsProp}\n innerOffset={form === 'round' ? 'increased' : 'normal'}\n />\n </ContextMenuLevelWrapper>\n );\n};\n\nexport const ContextMenuLevel = forwardRef(\n ContextMenuLevelRender,\n) as ContextMenuLevelComponent;\n"],"mappings":"miFAAA,+BAEA,OAASA,aAAT,KAA8B,6BAA9B,CACA,OAASC,cAAT,KAA+B,8BAA/B,CACA,MAAOC,MA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AACC,OAAN,CAAckC,CAAd,EAAsBA,CAAtB,CAA6B,CAACA,CAAD,CAA9D,CAEA,MADAC,EAAK,CAACC,IAAN,CAAW,oBAAC,cAAD,EAAgB,IAAI,CAAEhH,WAAW,CAACmB,CAAD,CAAjC,EAAX,CACA,CAAO4F,CACR,CAgGG,CAcE,WAAW,CAAE/C,CAdf,CAeE,aAAa,CAAED,CAfjB,CAgBE,eAAe,CAAEV,CAhBnB,CAiBE,aAAa,CAAED,CAjBjB,CAkBE,aAAa,CAhIG,QAAhB6D,cAAgB,CAAC3C,CAAD,CAAkC,CACtD,GAAMO,EAAG,CAAGR,CAAM,CAACC,CAAD,CAAlB,CACA,MAAOO,EAAG,GAAKjD,CAAR,EAAsBiD,CAAG,GAAKoB,EACtC,CA2GG,CAmBE,0BAA0B,CAAE,oCAAC3B,CAAD,QAC1B5D,mBAAkB,CAAC,MAAD,CAAS,CACzBsE,MAAM,CAAEX,CAAM,CAACC,CAAD,CAAN,GAAiB1C,CADA,CAAT,CADQ,CAnB9B,CAwBE,UAAU,CAAE,oBAAC0C,CAAD,QAAUS,GAAS,CAACV,CAAM,CAACC,CAAD,CAAP,CAAnB,CAxBd,CAyBE,MAAM,CAAEjD,CAzBV,CA0BE,WAAW,CAAW,OAAT,GAAAG,CAAI,CAAe,WAAf,CAA6B,QA1BhD,EAxDF,CAsFH,C,CAED,MAAO,IAAM0F,iBAAgB,CAAGzH,UAAU,CACxCuB,sBADwC,CAAnC"}
@@ -1,2 +1,2 @@
1
- import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["isMobile","children","className","size","onClickOutside","spareDirection","possibleDirections","direction","offset","anchorRef","position","onSetDirection","viewportRef"];import"./ContextMenuLevelWrapper.css";import React,{forwardRef}from"react";import{mapVerticalSpace}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=a.onClickOutside,i=a.spareDirection,j=a.possibleDirections,k=a.direction,l=a.offset,m=a.anchorRef,n=a.position,o=a.onSetDirection,p=a.viewportRef,q=_objectWithoutProperties(a,_excluded);return c?React.createElement("div",{className:e},React.createElement("div",Object.assign({className:cnContextMenuLevelWrapper("Mobile",[cnMixSpace({pV:mapVerticalSpace[g]})]),ref:b},q),d)):React.createElement(Popover,Object.assign({},q,{viewportRef:p,ref:b,className:e,onClickOutside:h,spareDirection:i,possibleDirections:j,direction:k,offset:l,anchorRef:m,position:n,onSetDirection:o}),d)});
1
+ import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["isMobile","children","className","size","onClickOutside","spareDirection","possibleDirections","direction","offset","anchorRef","position","onSetDirection","viewportRef","container"];import"./ContextMenuLevelWrapper.css";import React,{forwardRef}from"react";import{mapVerticalSpace}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=a.onClickOutside,i=a.spareDirection,j=a.possibleDirections,k=a.direction,l=a.offset,m=a.anchorRef,n=a.position,o=a.onSetDirection,p=a.viewportRef,q=a.container,r=_objectWithoutProperties(a,_excluded);return c?React.createElement("div",{className:e},React.createElement("div",Object.assign({className:cnContextMenuLevelWrapper("Mobile",[cnMixSpace({pV:mapVerticalSpace[g]})]),ref:b},r),d)):React.createElement(Popover,Object.assign({},r,{viewportRef:p,ref:b,className:e,onClickOutside:h,spareDirection:i,possibleDirections:j,direction:k,offset:l,anchorRef:m,position:n,onSetDirection:o,container:q}),d)});
2
2
  //# sourceMappingURL=ContextMenuLevelWrapper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ContextMenuLevelWrapper.js","names":["React","forwardRef","mapVerticalSpace","Popover","cnMixSpace","cn","contextMenuDefaultSize","cnContextMenuLevelWrapper","ContextMenuLevelWrapper","props","ref","isMobile","children","className","size","onClickOutside","spareDirection","possibleDirections","direction","offset","anchorRef","position","onSetDirection","viewportRef","otherProps","pV"],"sources":["../../../../../../src/components/ContextMenu/ContextMenuLevelWrapper/ContextMenuLevelWrapper.tsx"],"sourcesContent":["import './ContextMenuLevelWrapper.css';\n\nimport React, { forwardRef } from 'react';\n\nimport { mapVerticalSpace } 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 onClickOutside,\n spareDirection,\n possibleDirections,\n direction,\n offset,\n anchorRef,\n position,\n onSetDirection,\n viewportRef,\n ...otherProps\n } = props;\n\n if (isMobile) {\n return (\n <div className={className}>\n <div\n className={cnContextMenuLevelWrapper('Mobile', [\n cnMixSpace({\n pV: mapVerticalSpace[size],\n }),\n ])}\n ref={ref}\n {...otherProps}\n >\n {children}\n </div>\n </div>\n );\n }\n\n return (\n <Popover\n {...otherProps}\n viewportRef={viewportRef}\n ref={ref}\n className={className}\n onClickOutside={onClickOutside}\n spareDirection={spareDirection}\n possibleDirections={possibleDirections}\n direction={direction}\n offset={offset}\n anchorRef={anchorRef}\n position={position}\n onSetDirection={onSetDirection}\n >\n {children}\n </Popover>\n );\n },\n);\n"],"mappings":"gRAAA,sCAEA,MAAOA,MAAP,EA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c,CAAEC,CANlB,CAOE,kBAAkB,CAAEC,CAPtB,CAQE,SAAS,CAAEC,CARb,CASE,MAAM,CAAEC,CATV,CAUE,SAAS,CAAEC,CAVb,CAWE,QAAQ,CAAEC,CAXZ,CAYE,cAAc,CAAEC,CAZlB,GAcGV,CAdH,CAiBH,CAvD8C,CAA1C"}
1
+ {"version":3,"file":"ContextMenuLevelWrapper.js","names":["React","forwardRef","mapVerticalSpace","Popover","cnMixSpace","cn","contextMenuDefaultSize","cnContextMenuLevelWrapper","ContextMenuLevelWrapper","props","ref","isMobile","children","className","size","onClickOutside","spareDirection","possibleDirections","direction","offset","anchorRef","position","onSetDirection","viewportRef","container","otherProps","pV"],"sources":["../../../../../../src/components/ContextMenu/ContextMenuLevelWrapper/ContextMenuLevelWrapper.tsx"],"sourcesContent":["import './ContextMenuLevelWrapper.css';\n\nimport React, { forwardRef } from 'react';\n\nimport { mapVerticalSpace } 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 onClickOutside,\n spareDirection,\n possibleDirections,\n direction,\n offset,\n anchorRef,\n position,\n onSetDirection,\n viewportRef,\n container,\n ...otherProps\n } = props;\n\n if (isMobile) {\n return (\n <div className={className}>\n <div\n className={cnContextMenuLevelWrapper('Mobile', [\n cnMixSpace({\n pV: mapVerticalSpace[size],\n }),\n ])}\n ref={ref}\n {...otherProps}\n >\n {children}\n </div>\n </div>\n );\n }\n\n return (\n <Popover\n {...otherProps}\n viewportRef={viewportRef}\n ref={ref}\n className={className}\n onClickOutside={onClickOutside}\n spareDirection={spareDirection}\n possibleDirections={possibleDirections}\n direction={direction}\n offset={offset}\n anchorRef={anchorRef}\n position={position}\n onSetDirection={onSetDirection}\n container={container}\n >\n {children}\n </Popover>\n );\n },\n);\n"],"mappings":"4RAAA,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,CAgBIF,CAhBJ,CACEE,QADF,CAEEC,CAFF,CAgBIH,CAhBJ,CAEEG,QAFF,CAGEC,CAHF,CAgBIJ,CAhBJ,CAGEI,SAHF,GAgBIJ,CAhBJ,CAIEK,IAJF,CAIEA,CAJF,YAISR,sBAJT,GAKES,CALF,CAgBIN,CAhBJ,CAKEM,cALF,CAMEC,CANF,CAgBIP,CAhBJ,CAMEO,cANF,CAOEC,CAPF,CAgBIR,CAhBJ,CAOEQ,kBAPF,CAQEC,CARF,CAgBIT,CAhBJ,CAQES,SARF,CASEC,CATF,CAgBIV,CAhBJ,CASEU,MATF,CAUEC,CAVF,CAgBIX,CAhBJ,CAUEW,SAVF,CAWEC,CAXF,CAgBIZ,CAhBJ,CAWEY,QAXF,CAYEC,CAZF,CAgBIb,CAhBJ,CAYEa,cAZF,CAaEC,CAbF,CAgBId,CAhBJ,CAaEc,WAbF,CAcEC,CAdF,CAgBIf,CAhBJ,CAcEe,SAdF,CAeKC,CAfL,0BAgBIhB,CAhBJ,YADuE,MAmBnEE,EAnBmE,CAqBnE,2BAAK,SAAS,CAAEE,CAAhB,EACE,yCACE,SAAS,CAAEN,yBAAyB,CAAC,QAAD,CAAW,CAC7CH,UAAU,CAAC,CACTsB,EAAE,CAAExB,gBAAgB,CAACY,CAAD,CADX,CAAD,CADmC,CAAX,CADtC,CAME,GAAG,CAAEJ,CANP,EAOMe,CAPN,EASGb,CATH,CADF,CArBmE,CAsCrE,oBAAC,OAAD,kBACMa,CADN,EAEE,WAAW,CAAEF,CAFf,CAGE,GAAG,CAAEb,CAHP,CAIE,SAAS,CAAEG,CAJb,CAKE,cAAc,CAAEE,CALlB,CAME,cAAc,CAAEC,CANlB,CAOE,kBAAkB,CAAEC,CAPtB,CAQE,SAAS,CAAEC,CARb,CASE,MAAM,CAAEC,CATV,CAUE,SAAS,CAAEC,CAVb,CAWE,QAAQ,CAAEC,CAXZ,CAYE,cAAc,CAAEC,CAZlB,CAaE,SAAS,CAAEE,CAbb,GAeGZ,CAfH,CAkBH,CAzD8C,CAA1C"}
@@ -1 +1 @@
1
- {"version":3,"file":"ContextMenuLevels.js","names":["React","Fragment","useEffect","useState","Transition","TransitionGroup","useClickOutside","useMutableRef","useRefs","animateTimeout","setRef","clearTimers","ContextMenuLevel","getLevels","withDefaultGetters","contextMenuPropDefaultSubMenuDirection","contextMenuPropSubMenuDirections","useSize","ContextMenuLevels","propsComponent","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","map","index","key","last","animate","zIndex","onSetDirection","el"],"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 { useMutableRef } from '##/hooks/useMutableRef';\nimport { useRefs } from '##/hooks/useRefs';\nimport { animateTimeout } from '##/mixs/MixPopoverAnimate';\nimport { setRef } from '##/utils/setRef';\n\nimport { clearTimers, ContextMenuLevel } from '../ContextMenuLevel';\nimport { getLevels, withDefaultGetters } from '../helpers';\nimport {\n AddLevel,\n ContextMenuItemDefault,\n ContextMenuLevelsProps,\n contextMenuPropDefaultSubMenuDirection,\n contextMenuPropSubMenuDirections,\n Level,\n} from '../types';\nimport { useSize } from './useSize';\n\nexport const ContextMenuLevels = (propsComponent: ContextMenuLevelsProps) => {\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 if (level > 0) {\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\n useClickOutside({\n isActive: onClickOutside && isOpen,\n ignoreClicksInsideRefs: [...levelsRefs, anchorRef || { current: null }],\n handler: onClickOutside,\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 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 activeLevelDepth={levels.length - 1}\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={(el) => setRef(levelsRefs[index], el)}\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"],"mappings":"2pCAAA,MAAOA,MAAP,EAAgBC,QAAhB,CAA0BC,SAA1B,CAAqCC,QAArC,KAAqD,OAArD,CACA,OAASC,UAAT,CAAqBC,eAArB,KAA4C,wBAA5C,CAGA,OAASC,eAAT,sCACA,OAASC,aAAT,oCACA,OAASC,OAAT,8BACA,OAASC,cAAT,uCACA,OAASC,MAAT,6BAEA,OAASC,WAAT,CAAsBC,gBAAtB,2BACA,OAASC,SAAT,CAAoBC,kBAApB,kBACA,OAIEC,sCAJF,CAKEC,gCALF,gBAQA,OAASC,OAAT,iBAEA,MAAO,IAAMC,kBAAiB,CAAG,SAACC,CAAD,CAA4C,IACrEC,EAAK,CAAGN,kBAAkB,CAACK,CAAD,CAD2C,CAGzEE,CAHyE,CAuBvED,CAvBuE,CAGzEC,KAHyE,CAIzEC,CAJyE,CAuBvEF,CAvBuE,CAIzEE,SAJyE,CAKzEC,CALyE,CAuBvEH,CAvBuE,CAKzEG,QALyE,CAMzEC,CANyE,CAuBvEJ,CAvBuE,CAMzEI,SANyE,CAOzEC,CAPyE,CAuBvEL,CAvBuE,CAOzEK,kBAPyE,CAQzEC,CARyE,CAuBvEN,CAvBuE,CAQzEM,MARyE,CASzEC,CATyE,CAuBvEP,CAvBuE,CASzEO,cATyE,CAUzEC,CAVyE,CAuBvER,CAvBuE,CAUzEQ,UAVyE,CAWzEC,CAXyE,CAuBvET,CAvBuE,CAWzES,YAXyE,CAYzEC,CAZyE,CAuBvEV,CAvBuE,CAYzEU,cAZyE,CAazEC,CAbyE,CAuB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useState","Transition","TransitionGroup","useClickOutside","useMutableRef","useRefs","animateTimeout","setRef","clearTimers","ContextMenuLevel","getLevels","withDefaultGetters","contextMenuPropDefaultSubMenuDirection","contextMenuPropSubMenuDirections","useSize","ContextMenuLevels","propsComponent","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","map","index","key","last","animate","zIndex","onSetDirection","el"],"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 { useMutableRef } from '##/hooks/useMutableRef';\nimport { useRefs } from '##/hooks/useRefs';\nimport { animateTimeout } from '##/mixs/MixPopoverAnimate';\nimport { setRef } from '##/utils/setRef';\n\nimport { clearTimers, ContextMenuLevel } from '../ContextMenuLevel';\nimport { getLevels, withDefaultGetters } from '../helpers';\nimport {\n AddLevel,\n ContextMenuItemDefault,\n ContextMenuLevelsProps,\n contextMenuPropDefaultSubMenuDirection,\n contextMenuPropSubMenuDirections,\n Level,\n} from '../types';\nimport { useSize } from './useSize';\n\nexport const ContextMenuLevels = (propsComponent: ContextMenuLevelsProps) => {\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 if (level > 0) {\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\n useClickOutside({\n isActive: onClickOutside && isOpen,\n ignoreClicksInsideRefs: [...levelsRefs, anchorRef || { current: null }],\n handler: onClickOutside,\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 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 activeLevelDepth={levels.length - 1}\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={(el) => setRef(levelsRefs[index], el)}\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"],"mappings":"2pCAAA,MAAOA,MAAP,EAAgBC,QAAhB,CAA0BC,SAA1B,CAAqCC,QAArC,KAAqD,OAArD,CACA,OAASC,UAAT,CAAqBC,eAArB,KAA4C,wBAA5C,CAGA,OAASC,eAAT,sCACA,OAASC,aAAT,oCACA,OAASC,OAAT,8BACA,OAASC,cAAT,uCACA,OAASC,MAAT,6BAEA,OAASC,WAAT,CAAsBC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,CAAgB,CAfpC,CAgBE,UAAU,CAAEe,CAhBd,CAiBE,YAAY,CAAEnC,CAjBhB,CAkBE,QAAQ,CAAEqB,CAlBZ,CAmBE,WAAW,CAAES,CAnBf,CAoBE,cAAc,CACJ,CAAR,CAAAK,CAAK,CAAOnB,CAAP,CAA6BzB,CAAK,CAACiD,cArB5C,CAuBE,iBAAiB,CAAEvB,CAvBrB,CAwBE,oBAAoB,CAAEC,CAxBxB,CAyBE,cAAc,CAAEjB,CAzBlB,CA0BE,UAAU,CAAEF,CA1Bd,CA2BE,GAAG,CAAE,aAAC0C,CAAD,QAAQ5D,OAAM,CAACsC,CAAU,CAACgB,CAAD,CAAX,CAAoBM,CAApB,CAAd,CA3BP,CA4BE,cAAc,CAAY,CAAV,GAAAN,CAAK,CAAShC,CAAT,CAA0B,cA5BjD,CA6BE,MAAM,CAAEG,CAAQ,CAAGgB,CAAK,CAACE,MAAT,OA7BlB,CA8BE,OAAO,CAAEc,CA9BX,GADD,CALH,CAyCH,CAnDA,CADH,CAuDH,CApLM"}
@@ -1,2 +1,2 @@
1
- import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import"./ContextMenuWrapper.css";import React,{Fragment,useCallback,useRef,useState}from"react";import{Transition}from"react-transition-group";import{cnListBox,mapVerticalSpace}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=useRef(null),D=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,nodeRef:C},function(a){return React.createElement(Popover,{className:cnContextMenuWrapper({animationBack:r,innerAnimation:v},[cnListBox({size:h,form:e,border:!0,shadow:!0}),cnMixSpace({pV:mapVerticalSpace[h]}),cnMixPopoverAnimate({animate:a}),q]),ref:C,anchorRef:i,possibleDirections:j,position:k,direction:z,spareDirection:m,onClickOutside:n,offset:o,onSetDirection:D,style:s},c)}):React.createElement(Fragment,{key:ContextMenuWrapper.name},c)};
1
+ import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import"./ContextMenuWrapper.css";import React,{Fragment,useCallback,useRef,useState}from"react";import{Transition}from"react-transition-group";import{cnListBox,mapVerticalSpace}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.container,t=a.style,u=useFlag(b),v=_slicedToArray(u,2),w=v[0],x=v[1],y=useState(l),z=_slicedToArray(y,2),A=z[0],B=z[1],C=useMutableRef(p),D=useRef(null),E=useCallback(function(a){var b;B(a),null===(b=C.current)||void 0===b?void 0:b.call(C,a)},[]);return b?React.createElement(Transition,{timeout:animateTimeout,in:f,unmountOnExit:!0,onEntered:x.on,onExit:x.off,nodeRef:D},function(a){return React.createElement(Popover,{className:cnContextMenuWrapper({animationBack:r,innerAnimation:w},[cnListBox({size:h,form:e,border:!0,shadow:!0}),cnMixSpace({pV:mapVerticalSpace[h]}),cnMixPopoverAnimate({animate:a}),q]),ref:D,anchorRef:i,possibleDirections:j,position:k,direction:A,spareDirection:m,onClickOutside:n,offset:o,onSetDirection:E,container:s,style:t},c)}):React.createElement(Fragment,{key:ContextMenuWrapper.name},c)};
2
2
  //# sourceMappingURL=ContextMenuWrapper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ContextMenuWrapper.js","names":["React","Fragment","useCallback","useRef","useState","Transition","cnListBox","mapVerticalSpace","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","setDirection","onSetDirectionRef","rootRef","current","on","off","animate","border","shadow","pV","name"],"sources":["../../../../../../src/components/ContextMenu/ContextMenuWrapper/ContextMenuWrapper.tsx"],"sourcesContent":["import './ContextMenuWrapper.css';\n\nimport React, { Fragment, useCallback, useRef, useState } from 'react';\nimport { Transition } from 'react-transition-group';\n\nimport { cnListBox, mapVerticalSpace } 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, setDirection] = useState(directionProp);\n\n const onSetDirectionRef = useMutableRef(onSetDirectionProp);\n\n const rootRef = useRef<HTMLDivElement>(null);\n\n const onSetDirection = useCallback((direction: Direction) => {\n setDirection(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 nodeRef={rootRef}\n >\n {(animate) => (\n <Popover\n className={cnContextMenuWrapper({ animationBack, innerAnimation }, [\n cnListBox({ size, form, border: true, shadow: true }),\n cnMixSpace({\n pV: mapVerticalSpace[size],\n }),\n cnMixPopoverAnimate({ animate }),\n className,\n ])}\n ref={rootRef}\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,MAAvC,CAA+CC,QAA/C,KAA+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hBV,CAiBE,cAAc,CAAEE,CAjBlB,CAkBE,KAAK,CAAEG,CAlBT,EAoBGhB,CApBH,CADD,CARH,CApCgE,CAwE7D,oBAAC,QAAD,EAAU,GAAG,CAAEH,kBAAkB,CAACgC,IAAlC,EAAyC7B,CAAzC,CACR,CAzEM"}
1
+ {"version":3,"file":"ContextMenuWrapper.js","names":["React","Fragment","useCallback","useRef","useState","Transition","cnListBox","mapVerticalSpace","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","container","style","innerAnimation","setInnerAnimation","setDirection","onSetDirectionRef","rootRef","current","on","off","animate","border","shadow","pV","name"],"sources":["../../../../../../src/components/ContextMenu/ContextMenuWrapper/ContextMenuWrapper.tsx"],"sourcesContent":["import './ContextMenuWrapper.css';\n\nimport React, { Fragment, useCallback, useRef, useState } from 'react';\nimport { Transition } from 'react-transition-group';\n\nimport { cnListBox, mapVerticalSpace } 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 container,\n style,\n } = props;\n\n const [innerAnimation, setInnerAnimation] = useFlag(isMobile);\n // запоминаем позицию последнего удовлетворяющего разворота,\n // для того чтоб следующий экран разворачивался в эту же строну.\n const [direction, setDirection] = useState(directionProp);\n\n const onSetDirectionRef = useMutableRef(onSetDirectionProp);\n\n const rootRef = useRef<HTMLDivElement>(null);\n\n const onSetDirection = useCallback((direction: Direction) => {\n setDirection(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 nodeRef={rootRef}\n >\n {(animate) => (\n <Popover\n className={cnContextMenuWrapper({ animationBack, innerAnimation }, [\n cnListBox({ size, form, border: true, shadow: true }),\n cnMixSpace({\n pV: mapVerticalSpace[size],\n }),\n cnMixPopoverAnimate({ animate }),\n className,\n ])}\n ref={rootRef}\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 container={container}\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,MAAvC,CAA+CC,QAA/C,KAA+D,OAA/D,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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ultGetters<ITEM, GROUP>(props: ContextMenuLevels
17
17
  isMobile?: boolean;
18
18
  onEsc?: React.KeyboardEventHandler;
19
19
  viewportRef?: React.RefObject<HTMLElement>;
20
+ container?: Element;
20
21
  } & import("./types").MappersItem<ITEM> & import("./types").MappersGroup<GROUP> & {
21
22
  anchorRef: React.RefObject<HTMLElement>;
22
23
  position?: never;
23
- } & Omit<import("react").HTMLAttributes<HTMLDivElement>, "css" | "size" | "form" | "items" | "groups" | "direction" | "position" | "offset" | "onItemClick" | "sortGroup" | "onClickOutside" | "possibleDirections" | "spareDirection" | "onSetDirection" | "viewportRef" | "anchorRef" | "isOpen" | "subMenuDirection" | "isMobile" | "onEsc" | keyof import("./types").MappersItem<ITEM_1> | keyof import("./types").MappersGroup<GROUP_1>> & import("react").RefAttributes<HTMLDivElement> & (GROUP extends {
24
+ } & Omit<import("react").HTMLAttributes<HTMLDivElement>, "css" | "size" | "form" | "items" | "groups" | "direction" | "position" | "offset" | "onItemClick" | "sortGroup" | "container" | "onClickOutside" | "possibleDirections" | "spareDirection" | "onSetDirection" | "viewportRef" | "anchorRef" | "isOpen" | "subMenuDirection" | "isMobile" | "onEsc" | keyof import("./types").MappersItem<ITEM_1> | keyof import("./types").MappersGroup<GROUP_1>> & import("react").RefAttributes<HTMLDivElement> & (GROUP extends {
24
25
  id: ContextMenuGroupDefault["id"] | unknown;
25
26
  } ? {} : {
26
27
  getGroupId: ContextMenuPropGetGroupId<GROUP>;
@@ -65,10 +66,11 @@ export declare function withDefaultGetters<ITEM, GROUP>(props: ContextMenuLevels
65
66
  isMobile?: boolean;
66
67
  onEsc?: React.KeyboardEventHandler;
67
68
  viewportRef?: React.RefObject<HTMLElement>;
69
+ container?: Element;
68
70
  } & import("./types").MappersItem<ITEM> & import("./types").MappersGroup<GROUP> & {
69
71
  anchorRef?: never;
70
72
  position: import("../Popover").Position;
71
- } & Omit<import("react").HTMLAttributes<HTMLDivElement>, "css" | "size" | "form" | "items" | "groups" | "direction" | "position" | "offset" | "onItemClick" | "sortGroup" | "onClickOutside" | "possibleDirections" | "spareDirection" | "onSetDirection" | "viewportRef" | "anchorRef" | "isOpen" | "subMenuDirection" | "isMobile" | "onEsc" | keyof import("./types").MappersItem<ITEM_1> | keyof import("./types").MappersGroup<GROUP_1>> & import("react").RefAttributes<HTMLDivElement> & (GROUP extends {
73
+ } & Omit<import("react").HTMLAttributes<HTMLDivElement>, "css" | "size" | "form" | "items" | "groups" | "direction" | "position" | "offset" | "onItemClick" | "sortGroup" | "container" | "onClickOutside" | "possibleDirections" | "spareDirection" | "onSetDirection" | "viewportRef" | "anchorRef" | "isOpen" | "subMenuDirection" | "isMobile" | "onEsc" | keyof import("./types").MappersItem<ITEM_1> | keyof import("./types").MappersGroup<GROUP_1>> & import("react").RefAttributes<HTMLDivElement> & (GROUP extends {
72
74
  id: ContextMenuGroupDefault["id"] | unknown;
73
75
  } ? {} : {
74
76
  getGroupId: ContextMenuPropGetGroupId<GROUP>;
@@ -8,16 +8,16 @@ import { PropsWithAsAttributes } from '../../utils/types/PropsWithAsAttributes';
8
8
  import { PropsWithHTMLAttributes, PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';
9
9
  import { Direction, PopoverPropOffset, Position } from '../Popover/Popover';
10
10
  export declare const contextMenuSizes: readonly ["m", "xs", "s", "l"];
11
- export type ContextMenuPropSize = typeof contextMenuSizes[number];
11
+ export type ContextMenuPropSize = (typeof contextMenuSizes)[number];
12
12
  export declare const contextMenuDefaultSize: ContextMenuPropSize;
13
13
  export declare const contextMenuStatus: readonly ["alert", "success", "warning"];
14
- export type ContextMenuStatus = typeof contextMenuStatus[number];
14
+ export type ContextMenuStatus = (typeof contextMenuStatus)[number];
15
15
  export declare const contextMenuDefaultStatus: ContextMenuStatus;
16
16
  export declare const contextMenuForm: readonly ["default", "brick", "round"];
17
17
  export type ContextMenuForm = ListPropForm;
18
18
  export declare const defaultContextMenuForm: "default";
19
19
  export declare const contextMenuPropSubMenuDirections: Direction[];
20
- export type ContextMenuPropSubMenuDirection = typeof contextMenuPropSubMenuDirections[number];
20
+ export type ContextMenuPropSubMenuDirection = (typeof contextMenuPropSubMenuDirections)[number];
21
21
  export declare const contextMenuPropDefaultSubMenuDirection: ContextMenuPropSubMenuDirection;
22
22
  export type ContextMenuPropOnItemClick<ITEM> = (item: ITEM, params: {
23
23
  e: React.MouseEvent;
@@ -119,6 +119,7 @@ export type ContextMenuProps<ITEM = ContextMenuItemDefault, GROUP = ContextMenuG
119
119
  isMobile?: boolean;
120
120
  onEsc?: React.KeyboardEventHandler;
121
121
  viewportRef?: React.RefObject<HTMLElement>;
122
+ container?: Element;
122
123
  } & MappersItem<ITEM> & MappersGroup<GROUP> & PositioningProps, HTMLDivElement> & (GROUP extends {
123
124
  id: ContextMenuGroupDefault['id'] | unknown;
124
125
  } ? {} : {
@@ -177,6 +178,7 @@ export type ContextMenuWrapperProps = PropsWithHTMLAttributes<{
177
178
  onSetDirection?: (direction: Direction) => void;
178
179
  className?: string;
179
180
  animationBack?: boolean;
181
+ container?: Element;
180
182
  }, HTMLDivElement>;
181
183
  export type ContextMenuLevelWrapperProps = PropsWithHTMLAttributesAndRef<{
182
184
  children: React.ReactNode;
@@ -191,5 +193,6 @@ export type ContextMenuLevelWrapperProps = PropsWithHTMLAttributesAndRef<{
191
193
  position?: Position;
192
194
  onSetDirection?: (direction: Direction) => void;
193
195
  viewportRef?: React.RefObject<HTMLElement>;
196
+ container?: Element;
194
197
  }, HTMLDivElement>;
195
198
  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';\nimport { ComponentSize } from '##/hooks/useComponentSize';\nimport { Animate } from '##/mixs/MixPopoverAnimate';\nimport { AsAttributes, AsTags } from '##/utils/types/AsTags';\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: Direction[] = [\n 'rightStartUp',\n 'rightStartDown',\n 'leftStartUp',\n 'leftStartDown',\n];\nexport type ContextMenuPropSubMenuDirection =\n typeof contextMenuPropSubMenuDirections[number];\nexport const contextMenuPropDefaultSubMenuDirection: ContextMenuPropSubMenuDirection =\n contextMenuPropSubMenuDirections[0];\n\nexport type ContextMenuPropOnItemClick<ITEM> = (\n item: ITEM,\n params: {\n e: React.MouseEvent;\n },\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?: React.MouseEventHandler;\n as?: AsTags;\n attributes?: AsAttributes;\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) => React.MouseEventHandler | undefined;\n\nexport type ContextMenuPropGetItemDisabled<ITEM> = (\n item: ITEM,\n) => boolean | undefined;\n\nexport type ContextMenuPropGetItemAs<ITEM> = (item: ITEM) => AsTags | undefined;\n\nexport type ContextMenuPropGetItemAttributes<ITEM> = (\n item: ITEM,\n) => AsAttributes | 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?: 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?: ContextMenuPropOnItemClick<ITEM>;\n possibleDirections?: 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 onEsc?: React.KeyboardEventHandler;\n viewportRef?: React.RefObject<HTMLElement>;\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.ReactNode | null;\n\nexport type ContextMenuComponent = <\n ITEM = ContextMenuItemDefault,\n GROUP = ContextMenuGroupDefault,\n>(\n props: ContextMenuProps<ITEM, GROUP>,\n) => React.ReactNode | 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 activeLevelDepth: number;\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 onEsc?: React.KeyboardEventHandler;\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.ReactNode | null;\n\nexport type ContextMenuItemProps<AS extends AsTags = '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 = <AS extends AsTags = 'div'>(\n props: ContextMenuItemProps<AS>,\n ref: React.Ref<HTMLElement>,\n) => React.ReactNode | 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?: 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 isMobile?: boolean;\n onClickOutside?: ClickOutsideHandler;\n spareDirection?: Direction;\n possibleDirections?: Direction[];\n size?: ContextMenuPropSize;\n direction?: Direction;\n offset?: PopoverPropOffset;\n anchorRef?: React.RefObject<HTMLElement>;\n position?: Position;\n onSetDirection?: (direction: Direction) => void;\n viewportRef?: React.RefObject<HTMLElement>;\n },\n HTMLDivElement\n>;\n"],"mappings":"AAEA,OACEA,mBADF,CAGEC,YAHF,qBAiBA,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,iCAA6C,CAAG,CAC3D,cAD2D,CAE3D,gBAF2D,CAG3D,aAH2D,CAI3D,eAJ2D,CAAtD,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';\nimport { AsAttributes, AsTags } from '##/utils/types/AsTags';\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: Direction[] = [\n 'rightStartUp',\n 'rightStartDown',\n 'leftStartUp',\n 'leftStartDown',\n];\nexport type ContextMenuPropSubMenuDirection =\n (typeof contextMenuPropSubMenuDirections)[number];\nexport const contextMenuPropDefaultSubMenuDirection: ContextMenuPropSubMenuDirection =\n contextMenuPropSubMenuDirections[0];\n\nexport type ContextMenuPropOnItemClick<ITEM> = (\n item: ITEM,\n params: {\n e: React.MouseEvent;\n },\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?: React.MouseEventHandler;\n as?: AsTags;\n attributes?: AsAttributes;\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) => React.MouseEventHandler | undefined;\n\nexport type ContextMenuPropGetItemDisabled<ITEM> = (\n item: ITEM,\n) => boolean | undefined;\n\nexport type ContextMenuPropGetItemAs<ITEM> = (item: ITEM) => AsTags | undefined;\n\nexport type ContextMenuPropGetItemAttributes<ITEM> = (\n item: ITEM,\n) => AsAttributes | 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?: 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?: ContextMenuPropOnItemClick<ITEM>;\n possibleDirections?: 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 onEsc?: React.KeyboardEventHandler;\n viewportRef?: React.RefObject<HTMLElement>;\n container?: Element;\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.ReactNode | null;\n\nexport type ContextMenuComponent = <\n ITEM = ContextMenuItemDefault,\n GROUP = ContextMenuGroupDefault,\n>(\n props: ContextMenuProps<ITEM, GROUP>,\n) => React.ReactNode | 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 activeLevelDepth: number;\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 onEsc?: React.KeyboardEventHandler;\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.ReactNode | null;\n\nexport type ContextMenuItemProps<AS extends AsTags = '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 = <AS extends AsTags = 'div'>(\n props: ContextMenuItemProps<AS>,\n ref: React.Ref<HTMLElement>,\n) => React.ReactNode | 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?: 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 container?: Element;\n },\n HTMLDivElement\n>;\n\nexport type ContextMenuLevelWrapperProps = PropsWithHTMLAttributesAndRef<\n {\n children: React.ReactNode;\n isMobile?: boolean;\n onClickOutside?: ClickOutsideHandler;\n spareDirection?: Direction;\n possibleDirections?: Direction[];\n size?: ContextMenuPropSize;\n direction?: Direction;\n offset?: PopoverPropOffset;\n anchorRef?: React.RefObject<HTMLElement>;\n position?: Position;\n onSetDirection?: (direction: Direction) => void;\n viewportRef?: React.RefObject<HTMLElement>;\n container?: Element;\n },\n HTMLDivElement\n>;\n"],"mappings":"AAEA,OACEA,mBADF,CAGEC,YAHF,qBAiBA,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,iCAA6C,CAAG,CAC3D,cAD2D,CAE3D,gBAF2D,CAG3D,aAH2D,CAI3D,eAJ2D,CAAtD,CAQP,MAAO,IAAMC,uCAAuE,CAClFD,gCAAgC,CAAC,CAAD,CAD3B"}
@@ -1,4 +1,5 @@
1
1
  import './DatePickerDropdown.css';
2
+ import { Locale } from 'date-fns';
2
3
  import React from 'react';
3
4
  import { DateTimePropOnChange, DateTimePropType } from '../../DateTime';
4
5
  import { DateTimePropDisableDates, TimeOptions } from '../../DateTime/helpers/types';
@@ -27,6 +28,7 @@ export type DatePickerDropdownProps = PropsWithHTMLAttributesAndRef<{
27
28
  timeFor?: 'start' | 'end';
28
29
  disableDates?: DateTimePropDisableDates;
29
30
  viewportRef?: React.RefObject<HTMLElement>;
31
+ container?: Element;
30
32
  }, HTMLDivElement>;
31
33
  type DatePickerDropdownComponent = (props: DatePickerDropdownProps) => React.ReactNode | null;
32
34
  export declare const DatePickerDropdown: DatePickerDropdownComponent;