@skbkontur/react-ui 5.4.7-7ccf0.0 → 5.4.7-a27a4.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 (281) hide show
  1. package/cjs/components/Button/Button.d.ts +1 -0
  2. package/cjs/components/Button/Button.js.map +1 -1
  3. package/cjs/components/Calendar/Calendar.d.ts +1 -1
  4. package/cjs/components/Calendar/Calendar.js.map +1 -1
  5. package/cjs/components/DateInput/DateFragmentsView.d.ts +2 -2
  6. package/cjs/components/DateInput/DateFragmentsView.js.map +1 -1
  7. package/cjs/components/DateRangePicker/DateRangePicker.d.ts +2 -2
  8. package/cjs/components/DateRangePicker/DateRangePicker.js.map +1 -1
  9. package/cjs/components/DateRangePicker/DateRangePickerContext.d.ts +3 -3
  10. package/cjs/components/DateRangePicker/DateRangePickerContext.js.map +1 -1
  11. package/cjs/components/DateRangePicker/DateRangePickerInput.js.map +1 -1
  12. package/cjs/components/Dropdown/Dropdown.d.ts +4 -4
  13. package/cjs/components/Dropdown/Dropdown.js.map +1 -1
  14. package/cjs/components/DropdownMenu/DropdownMenu.js +3 -1
  15. package/cjs/components/DropdownMenu/DropdownMenu.js.map +1 -1
  16. package/cjs/components/FileUploader/FileUploader.d.ts +1 -1
  17. package/cjs/components/FileUploader/FileUploaderFile.js.map +1 -1
  18. package/cjs/components/GlobalLoader/GlobalLoaderView.d.ts +3 -2
  19. package/cjs/components/GlobalLoader/GlobalLoaderView.js +49 -50
  20. package/cjs/components/GlobalLoader/GlobalLoaderView.js.map +1 -1
  21. package/cjs/components/Input/Input.d.ts +2 -2
  22. package/cjs/components/Input/Input.js.map +1 -1
  23. package/cjs/components/Input/InputLayout/InputLayout.d.ts +3 -1
  24. package/cjs/components/Input/InputLayout/InputLayout.js +2 -1
  25. package/cjs/components/Input/InputLayout/InputLayout.js.map +1 -1
  26. package/cjs/components/Input/InputLayout/InputLayoutAsideIcon.js +6 -4
  27. package/cjs/components/Input/InputLayout/InputLayoutAsideIcon.js.map +1 -1
  28. package/cjs/components/Kebab/Kebab.d.ts +1 -1
  29. package/cjs/components/Kebab/Kebab.js.map +1 -1
  30. package/cjs/components/Link/Link.d.ts +1 -1
  31. package/cjs/components/Link/Link.js.map +1 -1
  32. package/cjs/components/MaskedInput/ColorableInputElement/ColorableInputElement.d.ts +1 -1
  33. package/cjs/components/MaskedInput/ColorableInputElement/ColorableInputElement.js +1 -1
  34. package/cjs/components/MaskedInput/ColorableInputElement/ColorableInputElement.js.map +1 -1
  35. package/cjs/components/MaskedInput/FixedIMaskInput.js +3 -1
  36. package/cjs/components/MaskedInput/FixedIMaskInput.js.map +1 -1
  37. package/cjs/components/MaskedInput/MaskedInput.js +2 -2
  38. package/cjs/components/MaskedInput/MaskedInput.js.map +1 -1
  39. package/cjs/components/MenuItem/MenuItem.d.ts +1 -1
  40. package/cjs/components/MenuItem/MenuItem.js.map +1 -1
  41. package/cjs/components/Modal/Modal.d.ts +4 -1
  42. package/cjs/components/Modal/Modal.js +8 -3
  43. package/cjs/components/Modal/Modal.js.map +1 -1
  44. package/cjs/components/Modal/ModalBody.d.ts +2 -2
  45. package/cjs/components/Modal/ModalBody.js.map +1 -1
  46. package/cjs/components/Paging/Paging.d.ts +2 -2
  47. package/cjs/components/Paging/Paging.js.map +1 -1
  48. package/cjs/components/PasswordInput/PasswordInput.d.ts +1 -1
  49. package/cjs/components/PasswordInput/PasswordInput.js.map +1 -1
  50. package/cjs/components/RadioGroup/RadioGroup.d.ts +2 -2
  51. package/cjs/components/RadioGroup/RadioGroup.js.map +1 -1
  52. package/cjs/components/ResponsiveLayout/decorator.d.ts +0 -3
  53. package/cjs/components/ScrollContainer/ScrollContainer.d.ts +1 -1
  54. package/cjs/components/ScrollContainer/ScrollContainer.js.map +1 -1
  55. package/cjs/components/Select/Select.d.ts +1 -1
  56. package/cjs/components/Select/Select.js.map +1 -1
  57. package/cjs/components/SidePage/SidePage.d.ts +5 -2
  58. package/cjs/components/SidePage/SidePage.js +9 -3
  59. package/cjs/components/SidePage/SidePage.js.map +1 -1
  60. package/cjs/components/SidePage/SidePageFooter.d.ts +1 -1
  61. package/cjs/components/SidePage/SidePageFooter.js.map +1 -1
  62. package/cjs/components/SidePage/SidePageHeader.d.ts +1 -1
  63. package/cjs/components/SidePage/SidePageHeader.js.map +1 -1
  64. package/cjs/components/SingleToast/SingleToast.d.ts +1 -1
  65. package/cjs/components/Sticky/Sticky.js +6 -2
  66. package/cjs/components/Sticky/Sticky.js.map +1 -1
  67. package/cjs/components/Tabs/Tabs.d.ts +1 -1
  68. package/cjs/components/Tabs/Tabs.js.map +1 -1
  69. package/cjs/components/Token/TokenView.d.ts +2 -1
  70. package/cjs/components/Token/TokenView.js +4 -4
  71. package/cjs/components/Token/TokenView.js.map +1 -1
  72. package/cjs/components/TokenInput/TextWidthHelper.js +3 -1
  73. package/cjs/components/TokenInput/TextWidthHelper.js.map +1 -1
  74. package/cjs/components/TokenInput/TokenInput.js +14 -7
  75. package/cjs/components/TokenInput/TokenInput.js.map +1 -1
  76. package/cjs/components/Tooltip/Tooltip.d.ts +4 -4
  77. package/cjs/components/Tooltip/Tooltip.js.map +1 -1
  78. package/cjs/hooks/useDrop.js +1 -1
  79. package/cjs/hooks/useDrop.js.map +1 -1
  80. package/cjs/internal/CommonWrapper/CommonWrapper.js +3 -2
  81. package/cjs/internal/CommonWrapper/CommonWrapper.js.map +1 -1
  82. package/cjs/internal/FileUploaderControl/FileUploaderControlProvider.d.ts +3 -6
  83. package/cjs/internal/FileUploaderControl/FileUploaderControlProvider.js +84 -83
  84. package/cjs/internal/FileUploaderControl/FileUploaderControlProvider.js.map +1 -1
  85. package/cjs/internal/FileUploaderControl/withFileUploaderControlProvider.d.ts +1 -1
  86. package/cjs/internal/FileUploaderControl/withFileUploaderControlProvider.js +11 -12
  87. package/cjs/internal/FileUploaderControl/withFileUploaderControlProvider.js.map +1 -1
  88. package/cjs/internal/FocusControlWrapper/FocusControlWrapper.d.ts +5 -6
  89. package/cjs/internal/FocusControlWrapper/FocusControlWrapper.js +28 -23
  90. package/cjs/internal/FocusControlWrapper/FocusControlWrapper.js.map +1 -1
  91. package/cjs/internal/IgnoreLayerClick/IgnoreLayerClick.d.ts +1 -1
  92. package/cjs/internal/InputLikeText/InputLikeText.d.ts +2 -2
  93. package/cjs/internal/InputLikeText/InputLikeText.js.map +1 -1
  94. package/cjs/internal/Menu/Menu.js +6 -2
  95. package/cjs/internal/Menu/Menu.js.map +1 -1
  96. package/cjs/internal/Menu/MenuNavigation.d.ts +1 -1
  97. package/cjs/internal/Menu/MenuNavigation.js.map +1 -1
  98. package/cjs/internal/MobilePopup/MobilePopup.d.ts +1 -0
  99. package/cjs/internal/MobilePopup/MobilePopup.js +9 -1
  100. package/cjs/internal/MobilePopup/MobilePopup.js.map +1 -1
  101. package/cjs/internal/Popup/Popup.js +2 -4
  102. package/cjs/internal/Popup/Popup.js.map +1 -1
  103. package/cjs/internal/PopupMenu/PopupMenu.d.ts +1 -1
  104. package/cjs/internal/PopupMenu/PopupMenu.js +9 -3
  105. package/cjs/internal/PopupMenu/PopupMenu.js.map +1 -1
  106. package/cjs/internal/RenderLayer/RenderLayer.d.ts +2 -2
  107. package/cjs/internal/RenderLayer/RenderLayer.js.map +1 -1
  108. package/cjs/internal/TextWidthHelper/TextWidthHelper.js +3 -1
  109. package/cjs/internal/TextWidthHelper/TextWidthHelper.js.map +1 -1
  110. package/cjs/internal/ThemePlayground/FxInputPlayground.d.ts +1 -1
  111. package/cjs/internal/ThemePlayground/FxInputPlayground.js.map +1 -1
  112. package/cjs/lib/dom/getDOMRect.d.ts +1 -1
  113. package/cjs/lib/dom/getDOMRect.js +3 -1
  114. package/cjs/lib/dom/getDOMRect.js.map +1 -1
  115. package/cjs/lib/events/fixFirefoxModifiedClickOnLabel.d.ts +1 -1
  116. package/cjs/lib/events/fixFirefoxModifiedClickOnLabel.js.map +1 -1
  117. package/cjs/lib/forwardRefAndName.d.ts +3 -2
  118. package/cjs/lib/forwardRefAndName.js +2 -1
  119. package/cjs/lib/forwardRefAndName.js.map +1 -1
  120. package/cjs/lib/getElementRef.d.ts +5 -0
  121. package/cjs/lib/getElementRef.js +16 -0
  122. package/cjs/lib/getElementRef.js.map +1 -0
  123. package/cjs/lib/locale/decorators.d.ts +0 -3
  124. package/cjs/lib/mergeRefs.d.ts +2 -3
  125. package/cjs/lib/mergeRefs.js +1 -1
  126. package/cjs/lib/mergeRefs.js.map +1 -1
  127. package/cjs/lib/reactGetTextContent.js +6 -1
  128. package/cjs/lib/reactGetTextContent.js.map +1 -1
  129. package/cjs/lib/renderEnvironment/RenderEnvironmentDecorator.d.ts +0 -3
  130. package/cjs/lib/rootNode/getRootNode.js +1 -24
  131. package/cjs/lib/rootNode/getRootNode.js.map +1 -1
  132. package/cjs/lib/rootNode/rootNodeDecorator.d.ts +0 -3
  133. package/cjs/lib/size/SizeDecorator.d.ts +0 -3
  134. package/cjs/lib/types/polymorphic-component.d.ts +2 -1
  135. package/cjs/lib/types/polymorphic-component.js.map +1 -1
  136. package/cjs/lib/utils.d.ts +4 -3
  137. package/cjs/lib/utils.js +4 -3
  138. package/cjs/lib/utils.js.map +1 -1
  139. package/cjs/lib/withClassWrapper.d.ts +3 -8
  140. package/components/Button/Button/Button.js +1 -1
  141. package/components/Button/Button/Button.js.map +1 -1
  142. package/components/Button/Button.d.ts +1 -0
  143. package/components/Calendar/Calendar/Calendar.js.map +1 -1
  144. package/components/Calendar/Calendar.d.ts +1 -1
  145. package/components/DateInput/DateFragmentsView/DateFragmentsView.js.map +1 -1
  146. package/components/DateInput/DateFragmentsView.d.ts +2 -2
  147. package/components/DateRangePicker/DateRangePicker/DateRangePicker.js +1 -1
  148. package/components/DateRangePicker/DateRangePicker/DateRangePicker.js.map +1 -1
  149. package/components/DateRangePicker/DateRangePicker.d.ts +2 -2
  150. package/components/DateRangePicker/DateRangePickerContext/DateRangePickerContext.js.map +1 -1
  151. package/components/DateRangePicker/DateRangePickerContext.d.ts +3 -3
  152. package/components/DateRangePicker/DateRangePickerInput/DateRangePickerInput.js.map +1 -1
  153. package/components/Dropdown/Dropdown/Dropdown.js.map +1 -1
  154. package/components/Dropdown/Dropdown.d.ts +4 -4
  155. package/components/DropdownMenu/DropdownMenu/DropdownMenu.js +1 -1
  156. package/components/DropdownMenu/DropdownMenu/DropdownMenu.js.map +1 -1
  157. package/components/FileUploader/FileUploader.d.ts +1 -1
  158. package/components/FileUploader/FileUploaderFile/FileUploaderFile.js +1 -1
  159. package/components/FileUploader/FileUploaderFile/FileUploaderFile.js.map +1 -1
  160. package/components/GlobalLoader/GlobalLoaderView/GlobalLoaderView.js +5 -4
  161. package/components/GlobalLoader/GlobalLoaderView/GlobalLoaderView.js.map +1 -1
  162. package/components/GlobalLoader/GlobalLoaderView.d.ts +3 -2
  163. package/components/Input/Input/Input.js.map +1 -1
  164. package/components/Input/Input.d.ts +2 -2
  165. package/components/Input/InputLayout/InputLayout/InputLayout.js +4 -2
  166. package/components/Input/InputLayout/InputLayout/InputLayout.js.map +1 -1
  167. package/components/Input/InputLayout/InputLayout.d.ts +3 -1
  168. package/components/Input/InputLayout/InputLayoutAsideIcon/InputLayoutAsideIcon.js +2 -2
  169. package/components/Input/InputLayout/InputLayoutAsideIcon/InputLayoutAsideIcon.js.map +1 -1
  170. package/components/Kebab/Kebab/Kebab.js.map +1 -1
  171. package/components/Kebab/Kebab.d.ts +1 -1
  172. package/components/Link/Link/Link.js.map +1 -1
  173. package/components/Link/Link.d.ts +1 -1
  174. package/components/MaskedInput/ColorableInputElement/ColorableInputElement/ColorableInputElement.js +1 -1
  175. package/components/MaskedInput/ColorableInputElement/ColorableInputElement/ColorableInputElement.js.map +1 -1
  176. package/components/MaskedInput/ColorableInputElement/ColorableInputElement.d.ts +1 -1
  177. package/components/MaskedInput/FixedIMaskInput/FixedIMaskInput.js +1 -1
  178. package/components/MaskedInput/FixedIMaskInput/FixedIMaskInput.js.map +1 -1
  179. package/components/MaskedInput/MaskedInput/MaskedInput.js +2 -2
  180. package/components/MaskedInput/MaskedInput/MaskedInput.js.map +1 -1
  181. package/components/MenuItem/MenuItem/MenuItem.js.map +1 -1
  182. package/components/MenuItem/MenuItem.d.ts +1 -1
  183. package/components/Modal/Modal/Modal.js +7 -3
  184. package/components/Modal/Modal/Modal.js.map +1 -1
  185. package/components/Modal/Modal.d.ts +4 -1
  186. package/components/Modal/ModalBody/ModalBody.js.map +1 -1
  187. package/components/Modal/ModalBody.d.ts +2 -2
  188. package/components/Paging/Paging/Paging.js.map +1 -1
  189. package/components/Paging/Paging.d.ts +2 -2
  190. package/components/PasswordInput/PasswordInput/PasswordInput.js.map +1 -1
  191. package/components/PasswordInput/PasswordInput.d.ts +1 -1
  192. package/components/RadioGroup/RadioGroup/RadioGroup.js.map +1 -1
  193. package/components/RadioGroup/RadioGroup.d.ts +2 -2
  194. package/components/ResponsiveLayout/decorator.d.ts +0 -3
  195. package/components/ScrollContainer/ScrollContainer/ScrollContainer.js +1 -1
  196. package/components/ScrollContainer/ScrollContainer/ScrollContainer.js.map +1 -1
  197. package/components/ScrollContainer/ScrollContainer.d.ts +1 -1
  198. package/components/Select/Select/Select.js.map +1 -1
  199. package/components/Select/Select.d.ts +1 -1
  200. package/components/SidePage/SidePage/SidePage.js +7 -3
  201. package/components/SidePage/SidePage/SidePage.js.map +1 -1
  202. package/components/SidePage/SidePage.d.ts +5 -2
  203. package/components/SidePage/SidePageFooter/SidePageFooter.js.map +1 -1
  204. package/components/SidePage/SidePageFooter.d.ts +1 -1
  205. package/components/SidePage/SidePageHeader/SidePageHeader.js.map +1 -1
  206. package/components/SidePage/SidePageHeader.d.ts +1 -1
  207. package/components/SingleToast/SingleToast.d.ts +1 -1
  208. package/components/Sticky/Sticky/Sticky.js +2 -2
  209. package/components/Sticky/Sticky/Sticky.js.map +1 -1
  210. package/components/Tabs/Tabs/Tabs.js.map +1 -1
  211. package/components/Tabs/Tabs.d.ts +1 -1
  212. package/components/Token/TokenView/TokenView.js +6 -4
  213. package/components/Token/TokenView/TokenView.js.map +1 -1
  214. package/components/Token/TokenView.d.ts +2 -1
  215. package/components/TokenInput/TextWidthHelper/TextWidthHelper.js +1 -1
  216. package/components/TokenInput/TextWidthHelper/TextWidthHelper.js.map +1 -1
  217. package/components/TokenInput/TokenInput/TokenInput.js +5 -5
  218. package/components/TokenInput/TokenInput/TokenInput.js.map +1 -1
  219. package/components/Tooltip/Tooltip/Tooltip.js.map +1 -1
  220. package/components/Tooltip/Tooltip.d.ts +4 -4
  221. package/hooks/useDrop/useDrop.js +1 -1
  222. package/hooks/useDrop/useDrop.js.map +1 -1
  223. package/internal/CommonWrapper/CommonWrapper/CommonWrapper.js +3 -2
  224. package/internal/CommonWrapper/CommonWrapper/CommonWrapper.js.map +1 -1
  225. package/internal/FileUploaderControl/FileUploaderControlProvider/FileUploaderControlProvider.js +2 -2
  226. package/internal/FileUploaderControl/FileUploaderControlProvider/FileUploaderControlProvider.js.map +1 -1
  227. package/internal/FileUploaderControl/FileUploaderControlProvider.d.ts +3 -6
  228. package/internal/FileUploaderControl/withFileUploaderControlProvider/withFileUploaderControlProvider.js +2 -3
  229. package/internal/FileUploaderControl/withFileUploaderControlProvider/withFileUploaderControlProvider.js.map +1 -1
  230. package/internal/FileUploaderControl/withFileUploaderControlProvider.d.ts +1 -1
  231. package/internal/FocusControlWrapper/FocusControlWrapper/FocusControlWrapper.js +7 -4
  232. package/internal/FocusControlWrapper/FocusControlWrapper/FocusControlWrapper.js.map +1 -1
  233. package/internal/FocusControlWrapper/FocusControlWrapper.d.ts +5 -6
  234. package/internal/IgnoreLayerClick/IgnoreLayerClick.d.ts +1 -1
  235. package/internal/InputLikeText/InputLikeText/InputLikeText.js.map +1 -1
  236. package/internal/InputLikeText/InputLikeText.d.ts +2 -2
  237. package/internal/Menu/Menu/Menu.js +2 -2
  238. package/internal/Menu/Menu/Menu.js.map +1 -1
  239. package/internal/Menu/MenuNavigation/MenuNavigation.js.map +1 -1
  240. package/internal/Menu/MenuNavigation.d.ts +1 -1
  241. package/internal/MobilePopup/MobilePopup/MobilePopup.js +5 -2
  242. package/internal/MobilePopup/MobilePopup/MobilePopup.js.map +1 -1
  243. package/internal/MobilePopup/MobilePopup.d.ts +1 -0
  244. package/internal/Popup/Popup/Popup.js +2 -2
  245. package/internal/Popup/Popup/Popup.js.map +1 -1
  246. package/internal/PopupMenu/PopupMenu/PopupMenu.js +3 -3
  247. package/internal/PopupMenu/PopupMenu/PopupMenu.js.map +1 -1
  248. package/internal/PopupMenu/PopupMenu.d.ts +1 -1
  249. package/internal/RenderLayer/RenderLayer/RenderLayer.js.map +1 -1
  250. package/internal/RenderLayer/RenderLayer.d.ts +2 -2
  251. package/internal/TextWidthHelper/TextWidthHelper/TextWidthHelper.js +1 -1
  252. package/internal/TextWidthHelper/TextWidthHelper/TextWidthHelper.js.map +1 -1
  253. package/internal/ThemePlayground/FxInputPlayground/FxInputPlayground.js.map +1 -1
  254. package/internal/ThemePlayground/FxInputPlayground.d.ts +1 -1
  255. package/lib/dom/getDOMRect/getDOMRect.js.map +1 -1
  256. package/lib/dom/getDOMRect.d.ts +1 -1
  257. package/lib/events/fixFirefoxModifiedClickOnLabel/fixFirefoxModifiedClickOnLabel.js.map +1 -1
  258. package/lib/events/fixFirefoxModifiedClickOnLabel.d.ts +1 -1
  259. package/lib/forwardRefAndName/forwardRefAndName.js.map +1 -1
  260. package/lib/forwardRefAndName.d.ts +3 -2
  261. package/lib/getElementRef/getElementRef.js +11 -0
  262. package/lib/getElementRef/getElementRef.js.map +1 -0
  263. package/lib/getElementRef/package.json +6 -0
  264. package/lib/getElementRef.d.ts +5 -0
  265. package/lib/locale/decorators.d.ts +0 -3
  266. package/lib/mergeRefs/mergeRefs.js.map +1 -1
  267. package/lib/mergeRefs.d.ts +2 -3
  268. package/lib/reactGetTextContent/reactGetTextContent.js +1 -1
  269. package/lib/reactGetTextContent/reactGetTextContent.js.map +1 -1
  270. package/lib/renderEnvironment/RenderEnvironmentDecorator.d.ts +0 -3
  271. package/lib/rootNode/getRootNode/getRootNode.js +0 -15
  272. package/lib/rootNode/getRootNode/getRootNode.js.map +1 -1
  273. package/lib/rootNode/rootNodeDecorator.d.ts +0 -3
  274. package/lib/size/SizeDecorator.d.ts +0 -3
  275. package/lib/types/polymorphic-component/polymorphic-component.js.map +1 -1
  276. package/lib/types/polymorphic-component.d.ts +2 -1
  277. package/lib/utils/utils.js +2 -2
  278. package/lib/utils/utils.js.map +1 -1
  279. package/lib/utils.d.ts +4 -3
  280. package/lib/withClassWrapper.d.ts +3 -8
  281. package/package.json +10 -9
@@ -1 +1 @@
1
- {"version":3,"names":["React","warning","isNullable","ThemeFactory","Popup","RenderLayer","containsTargetOrRenderContainer","ThemeContext","isTestEnv","CommonWrapper","rootNode","createPropsGetter","CloseButtonIcon","isInstanceOf","withSize","withRenderEnvironment","getStyles","DEFAULT_DELAY","TooltipDataTids","root","content","crossIcon","DefaultPositions","Tooltip","_class","_Tooltip","_React$PureComponent","_this","_len","arguments","length","args","Array","_key","call","apply","concat","getProps","defaultProps","state","opened","focused","contentElement","clickedOutside","popupRef","createRef","renderContent","props","render","createElement","ref","refContent","className","cx","styles","tooltipContent","theme","sizeVariables","contentStyle","renderCloseButton","getAnchorElement","_this$popupRef$curren","current","anchorElement","getPositions","allowedPositions","filter","item","includes","node","open","setState","close","handleMouseEnter","event","isHoverAnchor","trigger","target","clearHoverTimeout","hoverTimeout","setTimeout","delayBeforeShow","handleMouseLeave","relatedTarget","delay","handleClick","handleClickOutsideAnchor","isClickOutsideContent","onCloseRequest","handleFocus","handleBlur","handleCloseButtonClick","stopPropagation","onCloseClick","defaultPrevented","getSizeVariables","size","closeButtonStyle","closeButtonSmall","tooltipContentSmall","borderRadius","tooltipBorderRadiusSmall","pinSize","tooltipPinSizeSmall","pinOffsetX","tooltipPinOffsetXSmall","pinOffsetY","tooltipPinOffsetYSmall","margin","tooltipMarginSmall","closeButtonMedium","tooltipContentMedium","tooltipBorderRadiusMedium","tooltipPinSizeMedium","tooltipPinOffsetXMedium","tooltipPinOffsetYMedium","tooltipMarginMedium","closeButtonLarge","tooltipContentLarge","tooltipBorderRadiusLarge","tooltipPinSizeLarge","tooltipPinOffsetXLarge","tooltipPinOffsetYLarge","tooltipMarginLarge","_inheritsLoose","_proto","prototype","validateProps","children","getAllowedPositions","componentDidMount","componentDidUpdate","_this$getProps","componentWillUnmount","_this2","emotion","Consumer","Provider","value","create","popupBackground","tooltipBg","popupBorder","tooltipBorder","popupBorderRadius","popupPinSize","popupPinOffsetX","popupPinOffsetY","popupMargin","renderMain","hasCross","closeButton","undefined","triggersWithoutCloseButton","icon","tabbable","side","parseInt","tooltipCloseBtnSide","color","tooltipCloseBtnColor","colorHover","tooltipCloseBtnHoverColor","onClick","show","hide","_this$getPopupAndLaye","getPopupAndLayerProps","popupProps","_this$getPopupAndLaye2","layerProps","active","popup","renderPopup","_extends","_this$getProps2","disableAnimations","rootNodeRef","setRootNode","hasPin","hasShadow","maxWidth","positions","pos","ignoreHover","onOpen","onClose","tryPreserveFirstRenderedPosition","withoutMobile","useWrapper","defaultPopupAndLayerProps","onMouseEnter","onMouseLeave","onClickOutside","onFocus","onBlur","clearTimeout","globalObject","Element","PureComponent","__KONTUR_REACT_UI__","displayName"],"sources":["Tooltip.tsx"],"sourcesContent":["import React from 'react';\nimport warning from 'warning';\nimport type { Emotion } from '@emotion/css/types/create-instance';\n\nimport type { GlobalObject, SafeTimer } from '../../lib/globalObject';\nimport { isNullable } from '../../lib/utils';\nimport { ThemeFactory } from '../../lib/theming/ThemeFactory';\nimport type { PopupProps, PopupPositionsType, ShortPopupPositionsType } from '../../internal/Popup';\nimport { Popup } from '../../internal/Popup';\nimport type { RenderLayerProps } from '../../internal/RenderLayer';\nimport { RenderLayer } from '../../internal/RenderLayer';\nimport type { Nullable } from '../../typings/utility-types';\nimport type { MouseEventType } from '../../typings/event-types';\nimport { containsTargetOrRenderContainer } from '../../lib/listenFocusOutside';\nimport { ThemeContext } from '../../lib/theming/ThemeContext';\nimport type { Theme } from '../../lib/theming/Theme';\nimport { isTestEnv } from '../../lib/currentEnvironment';\nimport type { CommonProps } from '../../internal/CommonWrapper';\nimport { CommonWrapper } from '../../internal/CommonWrapper';\nimport type { TGetRootNode, TSetRootNode } from '../../lib/rootNode';\nimport { rootNode } from '../../lib/rootNode';\nimport type { InstanceWithAnchorElement } from '../../lib/InstanceWithAnchorElement';\nimport { createPropsGetter } from '../../lib/createPropsGetter';\nimport { CloseButtonIcon } from '../../internal/CloseButtonIcon/CloseButtonIcon';\nimport { isInstanceOf } from '../../lib/isInstanceOf';\nimport type { SizeProp } from '../../lib/types/props';\nimport { withSize } from '../../lib/size/SizeDecorator';\nimport { withRenderEnvironment } from '../../lib/renderEnvironment';\n\nimport { getStyles } from './Tooltip.styles';\n\nexport type TooltipTrigger =\n /** Наведение на children и на тултип */\n | 'hover'\n /** Клик на children */\n | 'click'\n /** Фокус на children */\n | 'focus'\n /** Наведение на children и на тултип и фокус на children */\n | 'hover&focus'\n /** Просто открыт */\n | 'opened'\n /** Просто закрыт */\n | 'closed'\n /** Наведение ТОЛЬКО на children, а не на тултип */\n | 'hoverAnchor'\n /** Управление через публичные функции show и hide */\n | 'manual';\n\nexport interface TooltipProps extends CommonProps {\n /** Указывает элемент, относительно которого позиционировать тултип. */\n anchorElement?: HTMLElement;\n\n /** @ignore */\n children?: React.ReactNode;\n\n /** Задает HTML-атрибут class. */\n className?: string;\n\n /** Отображает крестик для закрытия тултипа. По-умолчанию крестик виден, если проп *trigger* не равен `hover` или `focus`. */\n closeButton?: boolean;\n\n /** Задает функцию, которая возвращает содержимое тултипа. Если функция вернула `null`, то тултип не показывается. */\n render?: Nullable<() => React.ReactNode>;\n\n /** Задает приоритетное расположение подсказки относительно текста. */\n pos?: ShortPopupPositionsType | PopupPositionsType;\n\n /** Задает размер тултипа.\n * @default 'small' */\n size?: SizeProp;\n\n /** Задает триггер открытия тултипа. */\n trigger?: TooltipTrigger;\n\n /** Задает хендлер, который вызывается при клике по крестику. */\n onCloseClick?: React.MouseEventHandler<HTMLElement>;\n\n /** Задает хендлер, который вызывается при клике по крестику или снаружи тултипа. */\n onCloseRequest?: (event?: Event | React.MouseEvent) => void;\n\n /** Задает хендлер, который вызывается при закрытии тултипа. */\n onClose?: () => void;\n\n /** Задает хендлер, который вызывается при открытии тултипа. */\n onOpen?: () => void;\n\n /** Задает список позиций, которые тултип будет занимать.\n * Если положение тултипа в определенной позиции будет выходить за край экрана, то будет выбрана следующая позиция.\n * Обязательно должен включать позицию указанную в `pos`. */\n allowedPositions?: PopupPositionsType[];\n\n /** Отключает анимацию.\n * @default false */\n disableAnimations?: boolean;\n\n /** Явно указывает, что вложенные элементы должны быть обёрнуты в `<span/>`.\n * Используется для корректного позиционирования тултипа при двух и более вложенных элементах.\n * _Примечание_: при **двух и более** вложенных элементах обёртка будет добавлена автоматически. */\n useWrapper?: boolean;\n\n /** Устанавливает задержку в миллисекундах до появления лоадера. */\n delayBeforeShow?: number;\n}\n\nconst DEFAULT_DELAY = 100;\n\nexport interface TooltipState {\n opened: boolean;\n focused: boolean;\n}\n\nexport const TooltipDataTids = {\n root: 'Tooltip__root',\n content: 'Tooltip__content',\n crossIcon: 'Tooltip__crossIcon',\n} as const;\n\nconst DefaultPositions: PopupPositionsType[] = [\n 'right bottom',\n 'right middle',\n 'right top',\n 'top right',\n 'top center',\n 'top left',\n 'left top',\n 'left middle',\n 'left bottom',\n 'bottom left',\n 'bottom center',\n 'bottom right',\n];\n\ninterface TooltipSizeVariables {\n closeButtonStyle: string;\n contentStyle: string;\n borderRadius: string;\n pinSize: string;\n pinOffsetX: string;\n pinOffsetY: string;\n margin: string;\n}\n\ntype DefaultProps = Required<Pick<TooltipProps, 'trigger' | 'disableAnimations' | 'useWrapper' | 'delayBeforeShow'>>;\n\n/**\n * `Tooltip` — это подсказка, которая объясняет состояние контрола или даёт контекстную справку.\n *\n * Открывается по клику, фокусом на элемент или по наведению. В отличие от `Hint`, `Tooltip` может содержать\n * изображения, кнопки, ссылки и прочие интерактивные элементы.\n */\n@withRenderEnvironment\n@rootNode\n@withSize\nexport class Tooltip extends React.PureComponent<TooltipProps, TooltipState> implements InstanceWithAnchorElement {\n public static __KONTUR_REACT_UI__ = 'Tooltip';\n public static displayName = 'Tooltip';\n\n public static defaultProps: DefaultProps = {\n trigger: 'hover',\n disableAnimations: isTestEnv,\n useWrapper: false,\n delayBeforeShow: DEFAULT_DELAY,\n };\n\n private getProps = createPropsGetter(Tooltip.defaultProps);\n private validateProps(props: TooltipProps): void {\n warning(\n props.children || props.anchorElement,\n `[Tooltip]: you must provide either 'children' or 'anchorElement' prop for Tooltip to work properly`,\n );\n }\n\n public static delay = DEFAULT_DELAY;\n private static triggersWithoutCloseButton: TooltipTrigger[] = ['hover', 'hoverAnchor', 'focus', 'hover&focus'];\n\n public state: TooltipState = { opened: false, focused: false };\n private globalObject!: GlobalObject;\n private emotion!: Emotion;\n private cx!: Emotion['cx'];\n private styles!: ReturnType<typeof getStyles>;\n private theme!: Theme;\n private size!: SizeProp;\n private sizeVariables!: TooltipSizeVariables;\n private hoverTimeout: SafeTimer;\n private contentElement: Nullable<HTMLElement> = null;\n private clickedOutside = true;\n public getRootNode!: TGetRootNode;\n private setRootNode!: TSetRootNode;\n\n private popupRef = React.createRef<Popup>();\n\n public getAllowedPositions() {\n return this.props.allowedPositions ? this.props.allowedPositions : DefaultPositions;\n }\n\n public componentDidMount(): void {\n this.validateProps(this.getProps());\n }\n\n public componentDidUpdate() {\n const { trigger } = this.getProps();\n\n this.validateProps(this.getProps());\n if (trigger === 'closed' && this.state.opened) {\n this.close();\n }\n }\n\n public componentWillUnmount() {\n this.clearHoverTimeout();\n }\n\n public render() {\n this.styles = getStyles(this.emotion);\n\n return (\n <ThemeContext.Consumer>\n {(theme) => {\n this.theme = theme;\n this.sizeVariables = this.getSizeVariables();\n return (\n <ThemeContext.Provider\n value={ThemeFactory.create(\n {\n popupBackground: theme.tooltipBg,\n popupBorder: theme.tooltipBorder,\n popupBorderRadius: this.sizeVariables.borderRadius,\n popupPinSize: this.sizeVariables.pinSize,\n popupPinOffsetX: this.sizeVariables.pinOffsetX,\n popupPinOffsetY: this.sizeVariables.pinOffsetY,\n popupMargin: this.sizeVariables.margin,\n },\n theme,\n )}\n >\n {this.renderMain()}\n </ThemeContext.Provider>\n );\n }}\n </ThemeContext.Consumer>\n );\n }\n\n public renderContent = () => {\n const content = this.props.render ? this.props.render() : null;\n if (isNullable(content)) {\n return null;\n }\n\n return (\n <div\n ref={this.refContent}\n className={this.cx(this.styles.tooltipContent(this.theme), this.sizeVariables.contentStyle)}\n data-tid={TooltipDataTids.content}\n >\n {content}\n {this.renderCloseButton()}\n </div>\n );\n };\n\n public renderCloseButton() {\n const hasCross =\n this.props.closeButton === undefined\n ? !Tooltip.triggersWithoutCloseButton.includes(this.getProps().trigger)\n : this.props.closeButton;\n\n if (!hasCross) {\n return null;\n }\n\n const icon = (\n <CloseButtonIcon\n tabbable={false}\n side={parseInt(this.theme.tooltipCloseBtnSide)}\n color={this.theme.tooltipCloseBtnColor}\n colorHover={this.theme.tooltipCloseBtnHoverColor}\n />\n );\n\n return (\n <div\n className={this.cx(this.styles.closeButton(this.theme), this.sizeVariables.closeButtonStyle)}\n onClick={this.handleCloseButtonClick}\n data-tid={TooltipDataTids.crossIcon}\n >\n {icon}\n </div>\n );\n }\n\n public getAnchorElement = (): Nullable<Element> => {\n return this.popupRef.current?.anchorElement;\n };\n\n /**\n * Программно открывает тултип.\n * <p>Не действует если проп *trigger* `'opened'` или `'closed'`.</p>\n * @public\n */\n public show() {\n if (this.state.opened) {\n return;\n }\n const trigger = this.getProps().trigger;\n if (trigger === 'opened' || trigger === 'closed') {\n warning(false, `Function 'show' is not supported with trigger specified '${trigger}'`);\n return;\n }\n this.open();\n }\n\n /**\n * Программно закрывает тултип.\n * <p>Не действует если проп *trigger* `'opened'` или `'closed'`.</p>\n * @public\n */\n public hide() {\n const trigger = this.getProps().trigger;\n if (trigger === 'opened' || trigger === 'closed') {\n warning(false, `Function 'hide' is not supported with trigger specified '${trigger}'`);\n return;\n }\n this.close();\n }\n\n private renderMain() {\n const props = this.props;\n const content = this.renderContent();\n const { popupProps, layerProps = { active: false } } = this.getPopupAndLayerProps();\n const anchorElement = props.children || props.anchorElement;\n const popup = this.renderPopup(anchorElement, popupProps, content);\n\n return (\n <RenderLayer {...layerProps} getAnchorElement={this.getAnchorElement}>\n {popup}\n </RenderLayer>\n );\n }\n\n private renderPopup(\n anchorElement: React.ReactNode | HTMLElement,\n popupProps: Partial<PopupProps>,\n content: JSX.Element | null,\n ) {\n const { disableAnimations, trigger } = this.getProps();\n return (\n <CommonWrapper rootNodeRef={this.setRootNode} {...this.props}>\n <Popup\n data-tid={TooltipDataTids.root}\n anchorElement={anchorElement}\n hasPin\n hasShadow\n maxWidth=\"none\"\n opened={this.state.opened}\n disableAnimations={disableAnimations}\n positions={this.getPositions()}\n pos={this.props.pos}\n ignoreHover={trigger === 'hoverAnchor'}\n onOpen={this.props.onOpen}\n onClose={this.props.onClose}\n tryPreserveFirstRenderedPosition\n ref={this.popupRef}\n withoutMobile\n {...popupProps}\n >\n {content}\n </Popup>\n </CommonWrapper>\n );\n }\n\n private getPositions = (): PopupPositionsType[] =>\n this.props.allowedPositions\n ? this.props.allowedPositions.filter((item) => DefaultPositions.includes(item))\n : DefaultPositions;\n\n private refContent = (node: HTMLElement | null) => {\n this.contentElement = node;\n };\n\n private getPopupAndLayerProps(): {\n layerProps?: Partial<RenderLayerProps>;\n popupProps: Partial<PopupProps>;\n } {\n const props = this.props;\n const useWrapper = !!props.children && this.getProps().useWrapper;\n const trigger = this.getProps().trigger;\n\n const defaultPopupAndLayerProps: ReturnType<typeof this.getPopupAndLayerProps> = {\n popupProps: {\n onMouseEnter: this.handleMouseEnter,\n onMouseLeave: this.handleMouseLeave,\n useWrapper,\n },\n };\n\n switch (trigger) {\n case 'opened':\n return {\n layerProps: {\n active: true,\n onClickOutside: this.handleClickOutsideAnchor,\n },\n popupProps: {\n opened: true,\n useWrapper,\n },\n };\n\n case 'closed':\n return {\n popupProps: {\n opened: false,\n useWrapper,\n },\n };\n\n case 'manual':\n return {\n popupProps: {\n useWrapper,\n },\n };\n case 'click':\n return {\n layerProps: {\n active: this.state.opened,\n onClickOutside: this.handleClickOutsideAnchor,\n },\n popupProps: {\n onClick: this.handleClick,\n useWrapper,\n },\n };\n\n case 'focus':\n return {\n popupProps: {\n onFocus: this.handleFocus,\n onBlur: this.handleBlur,\n useWrapper,\n },\n };\n\n case 'hover&focus':\n return {\n layerProps: {\n active: this.state.opened,\n onClickOutside: this.handleClickOutsideAnchor,\n },\n popupProps: {\n onFocus: this.handleFocus,\n onBlur: this.handleBlur,\n onMouseEnter: this.handleMouseEnter,\n onMouseLeave: this.handleMouseLeave,\n useWrapper,\n },\n };\n\n case 'hoverAnchor':\n case 'hover':\n return defaultPopupAndLayerProps;\n default:\n warning(false, `Unknown trigger specified: ${trigger}. Returning default value.`);\n return defaultPopupAndLayerProps;\n }\n }\n\n private open = () => this.setState({ opened: true });\n\n private close = () => this.setState({ opened: false });\n\n private clearHoverTimeout() {\n if (this.hoverTimeout) {\n clearTimeout(this.hoverTimeout);\n this.hoverTimeout = null;\n }\n }\n\n private handleMouseEnter = (event: MouseEventType) => {\n const isHoverAnchor = this.getProps().trigger === 'hoverAnchor';\n if (isHoverAnchor && event.target === this.contentElement) {\n return;\n }\n\n this.clearHoverTimeout();\n this.hoverTimeout = setTimeout(this.open, this.getProps().delayBeforeShow);\n };\n\n private handleMouseLeave = (event: MouseEventType) => {\n const trigger = this.getProps().trigger;\n if (\n (trigger === 'hover&focus' && this.state.focused) ||\n (trigger === 'hover' && event.relatedTarget === this.contentElement)\n ) {\n return;\n }\n\n this.clearHoverTimeout();\n\n if (trigger === 'hoverAnchor') {\n this.close();\n } else {\n this.hoverTimeout = setTimeout(this.close, Tooltip.delay);\n }\n };\n\n private handleClick = () => {\n this.open();\n };\n\n private handleClickOutsideAnchor = (event: Event) => {\n this.clickedOutside = this.isClickOutsideContent(event);\n if (this.clickedOutside) {\n if (this.props.onCloseRequest) {\n this.props.onCloseRequest(event);\n }\n this.close();\n }\n };\n\n private isClickOutsideContent(event: Event) {\n if (this.contentElement && isInstanceOf(event.target, this.globalObject.Element)) {\n return !containsTargetOrRenderContainer(event.target)(this.contentElement);\n }\n\n return true;\n }\n\n private handleFocus = () => {\n this.setState({ focused: true });\n this.open();\n };\n\n private handleBlur = () => {\n const trigger = this.getProps().trigger;\n if (trigger === 'hover&focus' && this.clickedOutside) {\n this.close();\n }\n\n if (trigger === 'focus') {\n this.close();\n }\n\n this.clickedOutside = true;\n this.setState({ focused: false });\n };\n\n private handleCloseButtonClick = (event: React.MouseEvent<HTMLElement>) => {\n event.stopPropagation();\n\n if (this.props.onCloseClick) {\n this.props.onCloseClick(event);\n }\n\n if (event.defaultPrevented) {\n return;\n }\n\n if (this.props.onCloseRequest) {\n this.props.onCloseRequest(event);\n }\n\n this.close();\n };\n\n private getSizeVariables = (): TooltipSizeVariables => {\n switch (this.size) {\n case 'small':\n return {\n closeButtonStyle: this.styles.closeButtonSmall(this.theme),\n contentStyle: this.styles.tooltipContentSmall(this.theme),\n borderRadius: this.theme.tooltipBorderRadiusSmall,\n pinSize: this.theme.tooltipPinSizeSmall,\n pinOffsetX: this.theme.tooltipPinOffsetXSmall,\n pinOffsetY: this.theme.tooltipPinOffsetYSmall,\n margin: this.theme.tooltipMarginSmall,\n };\n case 'medium':\n return {\n closeButtonStyle: this.styles.closeButtonMedium(this.theme),\n contentStyle: this.styles.tooltipContentMedium(this.theme),\n borderRadius: this.theme.tooltipBorderRadiusMedium,\n pinSize: this.theme.tooltipPinSizeMedium,\n pinOffsetX: this.theme.tooltipPinOffsetXMedium,\n pinOffsetY: this.theme.tooltipPinOffsetYMedium,\n margin: this.theme.tooltipMarginMedium,\n };\n case 'large':\n return {\n closeButtonStyle: this.styles.closeButtonLarge(this.theme),\n contentStyle: this.styles.tooltipContentLarge(this.theme),\n borderRadius: this.theme.tooltipBorderRadiusLarge,\n pinSize: this.theme.tooltipPinSizeLarge,\n pinOffsetX: this.theme.tooltipPinOffsetXLarge,\n pinOffsetY: this.theme.tooltipPinOffsetYLarge,\n margin: this.theme.tooltipMarginLarge,\n };\n default:\n warning(false, `Can't get size variables: invalid value in size prop '${this.props.size}'. Returning default`);\n return {\n closeButtonStyle: this.styles.closeButtonSmall(this.theme),\n contentStyle: this.styles.tooltipContentSmall(this.theme),\n borderRadius: this.theme.tooltipBorderRadiusSmall,\n pinSize: this.theme.tooltipPinSizeSmall,\n pinOffsetX: this.theme.tooltipPinOffsetXSmall,\n pinOffsetY: this.theme.tooltipPinOffsetYSmall,\n margin: this.theme.tooltipMarginSmall,\n };\n }\n };\n}\n"],"mappings":"qJAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,OAAO,MAAM,SAAS;;;;AAI7B,SAASC,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,YAAY,QAAQ,gCAAgC;;AAE7D,SAASC,KAAK,QAAQ,sBAAsB;;AAE5C,SAASC,WAAW,QAAQ,4BAA4B;;;AAGxD,SAASC,+BAA+B,QAAQ,8BAA8B;AAC9E,SAASC,YAAY,QAAQ,gCAAgC;;AAE7D,SAASC,SAAS,QAAQ,8BAA8B;;AAExD,SAASC,aAAa,QAAQ,8BAA8B;;AAE5D,SAASC,QAAQ,QAAQ,oBAAoB;;AAE7C,SAASC,iBAAiB,QAAQ,6BAA6B;AAC/D,SAASC,eAAe,QAAQ,gDAAgD;AAChF,SAASC,YAAY,QAAQ,wBAAwB;;AAErD,SAASC,QAAQ,QAAQ,8BAA8B;AACvD,SAASC,qBAAqB,QAAQ,6BAA6B;;AAEnE,SAASC,SAAS,QAAQ,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4E5C,IAAMC,aAAa,GAAG,GAAG;;;;;;;AAOzB,OAAO,IAAMC,eAAe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jE,MAAA,CAMO/C,iBAAiB,GAAzB,SAAAA,kBAAA,EAA4B,CAC1B,IAAI,IAAI,CAACC,YAAY,EAAE,CACrBqH,YAAY,CAAC,IAAI,CAACrH,YAAY,CAAC,CAC/B,IAAI,CAACA,YAAY,GAAG,IAAI,CAC1B,CACF,CAAC,CAAA8C,MAAA,CA4COtC,qBAAqB,GAA7B,SAAAA,sBAA8Bb,KAAY,EAAE,CAC1C,IAAI,IAAI,CAAChC,cAAc,IAAI7B,YAAY,CAAC6D,KAAK,CAACG,MAAM,EAAE,IAAI,CAACwH,YAAY,CAACC,OAAO,CAAC,EAAE,CAChF,OAAO,CAAChM,+BAA+B,CAACoE,KAAK,CAACG,MAAM,CAAC,CAAC,IAAI,CAACnC,cAAc,CAAC,CAC5E,CAEA,OAAO,IAAI,CACb,CAAC,QAAAnB,OAAA,GAvX0BvB,KAAK,CAACuM,aAAa,GAAA9K,QAAA,CAChC+K,mBAAmB,GAAG,SAAS,EAAA/K,QAAA,CAC/BgL,WAAW,GAAG,SAAS,EAAAhL,QAAA,CAEvBa,YAAY,GAAiB,EACzCsC,OAAO,EAAE,OAAO,EAChBoG,iBAAiB,EAAExK,SAAS,EAC5BqL,UAAU,EAAE,KAAK,EACjB5G,eAAe,EAAEhE,aAAa,CAChC,CAAC,EAAAQ,QAAA,CAUa2D,KAAK,GAAGnE,aAAa,EAAAQ,QAAA,CACpBgI,0BAA0B,GAAqB,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,aAAa,CAAC,EAAAhI,QAAA,MAAAD,MAAA,KAAAA,MAAA,KAAAA,MAAA","ignoreList":[]}
1
+ {"version":3,"names":["React","warning","isNullable","ThemeFactory","Popup","RenderLayer","containsTargetOrRenderContainer","ThemeContext","isTestEnv","CommonWrapper","rootNode","createPropsGetter","CloseButtonIcon","isInstanceOf","withSize","withRenderEnvironment","getStyles","DEFAULT_DELAY","TooltipDataTids","root","content","crossIcon","DefaultPositions","Tooltip","_class","_Tooltip","_React$PureComponent","_this","_len","arguments","length","args","Array","_key","call","apply","concat","getProps","defaultProps","state","opened","focused","contentElement","clickedOutside","popupRef","createRef","renderContent","props","render","createElement","ref","refContent","className","cx","styles","tooltipContent","theme","sizeVariables","contentStyle","renderCloseButton","getAnchorElement","_this$popupRef$curren","current","anchorElement","getPositions","allowedPositions","filter","item","includes","node","open","setState","close","handleMouseEnter","event","isHoverAnchor","trigger","target","clearHoverTimeout","hoverTimeout","setTimeout","delayBeforeShow","handleMouseLeave","relatedTarget","delay","handleClick","handleClickOutsideAnchor","isClickOutsideContent","onCloseRequest","handleFocus","handleBlur","handleCloseButtonClick","stopPropagation","onCloseClick","defaultPrevented","getSizeVariables","size","closeButtonStyle","closeButtonSmall","tooltipContentSmall","borderRadius","tooltipBorderRadiusSmall","pinSize","tooltipPinSizeSmall","pinOffsetX","tooltipPinOffsetXSmall","pinOffsetY","tooltipPinOffsetYSmall","margin","tooltipMarginSmall","closeButtonMedium","tooltipContentMedium","tooltipBorderRadiusMedium","tooltipPinSizeMedium","tooltipPinOffsetXMedium","tooltipPinOffsetYMedium","tooltipMarginMedium","closeButtonLarge","tooltipContentLarge","tooltipBorderRadiusLarge","tooltipPinSizeLarge","tooltipPinOffsetXLarge","tooltipPinOffsetYLarge","tooltipMarginLarge","_inheritsLoose","_proto","prototype","validateProps","children","getAllowedPositions","componentDidMount","componentDidUpdate","_this$getProps","componentWillUnmount","_this2","emotion","Consumer","Provider","value","create","popupBackground","tooltipBg","popupBorder","tooltipBorder","popupBorderRadius","popupPinSize","popupPinOffsetX","popupPinOffsetY","popupMargin","renderMain","hasCross","closeButton","undefined","triggersWithoutCloseButton","icon","tabbable","side","parseInt","tooltipCloseBtnSide","color","tooltipCloseBtnColor","colorHover","tooltipCloseBtnHoverColor","onClick","show","hide","_this$getPopupAndLaye","getPopupAndLayerProps","popupProps","_this$getPopupAndLaye2","layerProps","active","popup","renderPopup","_extends","_this$getProps2","disableAnimations","rootNodeRef","setRootNode","hasPin","hasShadow","maxWidth","positions","pos","ignoreHover","onOpen","onClose","tryPreserveFirstRenderedPosition","withoutMobile","useWrapper","defaultPopupAndLayerProps","onMouseEnter","onMouseLeave","onClickOutside","onFocus","onBlur","clearTimeout","globalObject","Element","PureComponent","__KONTUR_REACT_UI__","displayName"],"sources":["Tooltip.tsx"],"sourcesContent":["import React, { type JSX } from 'react';\nimport warning from 'warning';\nimport type { Emotion } from '@emotion/css/types/create-instance';\n\nimport type { GlobalObject, SafeTimer } from '../../lib/globalObject';\nimport { isNullable } from '../../lib/utils';\nimport { ThemeFactory } from '../../lib/theming/ThemeFactory';\nimport type { PopupPositionsType, PopupProps, ShortPopupPositionsType } from '../../internal/Popup';\nimport { Popup } from '../../internal/Popup';\nimport type { RenderLayerProps } from '../../internal/RenderLayer';\nimport { RenderLayer } from '../../internal/RenderLayer';\nimport type { Nullable } from '../../typings/utility-types';\nimport type { MouseEventType } from '../../typings/event-types';\nimport { containsTargetOrRenderContainer } from '../../lib/listenFocusOutside';\nimport { ThemeContext } from '../../lib/theming/ThemeContext';\nimport type { Theme } from '../../lib/theming/Theme';\nimport { isTestEnv } from '../../lib/currentEnvironment';\nimport type { CommonProps } from '../../internal/CommonWrapper';\nimport { CommonWrapper } from '../../internal/CommonWrapper';\nimport type { TGetRootNode, TSetRootNode } from '../../lib/rootNode';\nimport { rootNode } from '../../lib/rootNode';\nimport type { InstanceWithAnchorElement } from '../../lib/InstanceWithAnchorElement';\nimport { createPropsGetter } from '../../lib/createPropsGetter';\nimport { CloseButtonIcon } from '../../internal/CloseButtonIcon/CloseButtonIcon';\nimport { isInstanceOf } from '../../lib/isInstanceOf';\nimport type { SizeProp } from '../../lib/types/props';\nimport { withSize } from '../../lib/size/SizeDecorator';\nimport { withRenderEnvironment } from '../../lib/renderEnvironment';\n\nimport { getStyles } from './Tooltip.styles';\n\nexport type TooltipTrigger =\n /** Наведение на children и на тултип */\n | 'hover'\n /** Клик на children */\n | 'click'\n /** Фокус на children */\n | 'focus'\n /** Наведение на children и на тултип и фокус на children */\n | 'hover&focus'\n /** Просто открыт */\n | 'opened'\n /** Просто закрыт */\n | 'closed'\n /** Наведение ТОЛЬКО на children, а не на тултип */\n | 'hoverAnchor'\n /** Управление через публичные функции show и hide */\n | 'manual';\n\nexport interface TooltipProps extends CommonProps {\n /** Указывает элемент, относительно которого позиционировать тултип. */\n anchorElement?: HTMLElement;\n\n /** @ignore */\n children?: React.ReactNode;\n\n /** Задает HTML-атрибут class. */\n className?: string;\n\n /** Отображает крестик для закрытия тултипа. По-умолчанию крестик виден, если проп *trigger* не равен `hover` или `focus`. */\n closeButton?: boolean;\n\n /** Задает функцию, которая возвращает содержимое тултипа. Если функция вернула `null`, то тултип не показывается. */\n render?: Nullable<() => React.ReactNode>;\n\n /** Задает приоритетное расположение подсказки относительно текста. */\n pos?: ShortPopupPositionsType | PopupPositionsType;\n\n /** Задает размер тултипа.\n * @default 'small' */\n size?: SizeProp;\n\n /** Задает триггер открытия тултипа. */\n trigger?: TooltipTrigger;\n\n /** Задает хендлер, который вызывается при клике по крестику. */\n onCloseClick?: React.MouseEventHandler<HTMLElement>;\n\n /** Задает хендлер, который вызывается при клике по крестику или снаружи тултипа. */\n onCloseRequest?: (event?: Event | React.MouseEvent) => void;\n\n /** Задает хендлер, который вызывается при закрытии тултипа. */\n onClose?: () => void;\n\n /** Задает хендлер, который вызывается при открытии тултипа. */\n onOpen?: () => void;\n\n /** Задает список позиций, которые тултип будет занимать.\n * Если положение тултипа в определенной позиции будет выходить за край экрана, то будет выбрана следующая позиция.\n * Обязательно должен включать позицию указанную в `pos`. */\n allowedPositions?: PopupPositionsType[];\n\n /** Отключает анимацию.\n * @default false */\n disableAnimations?: boolean;\n\n /** Явно указывает, что вложенные элементы должны быть обёрнуты в `<span/>`.\n * Используется для корректного позиционирования тултипа при двух и более вложенных элементах.\n * _Примечание_: при **двух и более** вложенных элементах обёртка будет добавлена автоматически. */\n useWrapper?: boolean;\n\n /** Устанавливает задержку в миллисекундах до появления лоадера. */\n delayBeforeShow?: number;\n}\n\nconst DEFAULT_DELAY = 100;\n\nexport interface TooltipState {\n opened: boolean;\n focused: boolean;\n}\n\nexport const TooltipDataTids = {\n root: 'Tooltip__root',\n content: 'Tooltip__content',\n crossIcon: 'Tooltip__crossIcon',\n} as const;\n\nconst DefaultPositions: PopupPositionsType[] = [\n 'right bottom',\n 'right middle',\n 'right top',\n 'top right',\n 'top center',\n 'top left',\n 'left top',\n 'left middle',\n 'left bottom',\n 'bottom left',\n 'bottom center',\n 'bottom right',\n];\n\ninterface TooltipSizeVariables {\n closeButtonStyle: string;\n contentStyle: string;\n borderRadius: string;\n pinSize: string;\n pinOffsetX: string;\n pinOffsetY: string;\n margin: string;\n}\n\ntype DefaultProps = Required<Pick<TooltipProps, 'trigger' | 'disableAnimations' | 'useWrapper' | 'delayBeforeShow'>>;\n\n/**\n * `Tooltip` — это подсказка, которая объясняет состояние контрола или даёт контекстную справку.\n *\n * Открывается по клику, фокусом на элемент или по наведению. В отличие от `Hint`, `Tooltip` может содержать\n * изображения, кнопки, ссылки и прочие интерактивные элементы.\n */\n@withRenderEnvironment\n@rootNode\n@withSize\nexport class Tooltip extends React.PureComponent<TooltipProps, TooltipState> implements InstanceWithAnchorElement {\n public static __KONTUR_REACT_UI__ = 'Tooltip';\n public static displayName = 'Tooltip';\n\n public static defaultProps: DefaultProps = {\n trigger: 'hover',\n disableAnimations: isTestEnv,\n useWrapper: false,\n delayBeforeShow: DEFAULT_DELAY,\n };\n\n private getProps = createPropsGetter(Tooltip.defaultProps);\n private validateProps(props: TooltipProps): void {\n warning(\n props.children || props.anchorElement,\n `[Tooltip]: you must provide either 'children' or 'anchorElement' prop for Tooltip to work properly`,\n );\n }\n\n public static delay = DEFAULT_DELAY;\n private static triggersWithoutCloseButton: TooltipTrigger[] = ['hover', 'hoverAnchor', 'focus', 'hover&focus'];\n\n public state: TooltipState = { opened: false, focused: false };\n private globalObject!: GlobalObject;\n private emotion!: Emotion;\n private cx!: Emotion['cx'];\n private styles!: ReturnType<typeof getStyles>;\n private theme!: Theme;\n private size!: SizeProp;\n private sizeVariables!: TooltipSizeVariables;\n private hoverTimeout: SafeTimer;\n private contentElement: Nullable<HTMLElement> = null;\n private clickedOutside = true;\n public getRootNode!: TGetRootNode;\n private setRootNode!: TSetRootNode;\n\n private popupRef = React.createRef<Popup>();\n\n public getAllowedPositions() {\n return this.props.allowedPositions ? this.props.allowedPositions : DefaultPositions;\n }\n\n public componentDidMount(): void {\n this.validateProps(this.getProps());\n }\n\n public componentDidUpdate() {\n const { trigger } = this.getProps();\n\n this.validateProps(this.getProps());\n if (trigger === 'closed' && this.state.opened) {\n this.close();\n }\n }\n\n public componentWillUnmount() {\n this.clearHoverTimeout();\n }\n\n public render() {\n this.styles = getStyles(this.emotion);\n\n return (\n <ThemeContext.Consumer>\n {(theme) => {\n this.theme = theme;\n this.sizeVariables = this.getSizeVariables();\n return (\n <ThemeContext.Provider\n value={ThemeFactory.create(\n {\n popupBackground: theme.tooltipBg,\n popupBorder: theme.tooltipBorder,\n popupBorderRadius: this.sizeVariables.borderRadius,\n popupPinSize: this.sizeVariables.pinSize,\n popupPinOffsetX: this.sizeVariables.pinOffsetX,\n popupPinOffsetY: this.sizeVariables.pinOffsetY,\n popupMargin: this.sizeVariables.margin,\n },\n theme,\n )}\n >\n {this.renderMain()}\n </ThemeContext.Provider>\n );\n }}\n </ThemeContext.Consumer>\n );\n }\n\n public renderContent = () => {\n const content = this.props.render ? this.props.render() : null;\n if (isNullable(content)) {\n return null;\n }\n\n return (\n <div\n ref={this.refContent}\n className={this.cx(this.styles.tooltipContent(this.theme), this.sizeVariables.contentStyle)}\n data-tid={TooltipDataTids.content}\n >\n {content}\n {this.renderCloseButton()}\n </div>\n );\n };\n\n public renderCloseButton() {\n const hasCross =\n this.props.closeButton === undefined\n ? !Tooltip.triggersWithoutCloseButton.includes(this.getProps().trigger)\n : this.props.closeButton;\n\n if (!hasCross) {\n return null;\n }\n\n const icon = (\n <CloseButtonIcon\n tabbable={false}\n side={parseInt(this.theme.tooltipCloseBtnSide)}\n color={this.theme.tooltipCloseBtnColor}\n colorHover={this.theme.tooltipCloseBtnHoverColor}\n />\n );\n\n return (\n <div\n className={this.cx(this.styles.closeButton(this.theme), this.sizeVariables.closeButtonStyle)}\n onClick={this.handleCloseButtonClick}\n data-tid={TooltipDataTids.crossIcon}\n >\n {icon}\n </div>\n );\n }\n\n public getAnchorElement = (): Nullable<Element> => {\n return this.popupRef.current?.anchorElement;\n };\n\n /**\n * Программно открывает тултип.\n * <p>Не действует если проп *trigger* `'opened'` или `'closed'`.</p>\n * @public\n */\n public show() {\n if (this.state.opened) {\n return;\n }\n const trigger = this.getProps().trigger;\n if (trigger === 'opened' || trigger === 'closed') {\n warning(false, `Function 'show' is not supported with trigger specified '${trigger}'`);\n return;\n }\n this.open();\n }\n\n /**\n * Программно закрывает тултип.\n * <p>Не действует если проп *trigger* `'opened'` или `'closed'`.</p>\n * @public\n */\n public hide() {\n const trigger = this.getProps().trigger;\n if (trigger === 'opened' || trigger === 'closed') {\n warning(false, `Function 'hide' is not supported with trigger specified '${trigger}'`);\n return;\n }\n this.close();\n }\n\n private renderMain() {\n const props = this.props;\n const content = this.renderContent();\n const { popupProps, layerProps = { active: false } } = this.getPopupAndLayerProps();\n const anchorElement = props.children || props.anchorElement;\n const popup = this.renderPopup(anchorElement, popupProps, content);\n\n return (\n <RenderLayer {...layerProps} getAnchorElement={this.getAnchorElement}>\n {popup}\n </RenderLayer>\n );\n }\n\n private renderPopup(\n anchorElement: React.ReactNode | HTMLElement,\n popupProps: Partial<PopupProps>,\n content: JSX.Element | null,\n ) {\n const { disableAnimations, trigger } = this.getProps();\n return (\n <CommonWrapper rootNodeRef={this.setRootNode} {...this.props}>\n <Popup\n data-tid={TooltipDataTids.root}\n anchorElement={anchorElement}\n hasPin\n hasShadow\n maxWidth=\"none\"\n opened={this.state.opened}\n disableAnimations={disableAnimations}\n positions={this.getPositions()}\n pos={this.props.pos}\n ignoreHover={trigger === 'hoverAnchor'}\n onOpen={this.props.onOpen}\n onClose={this.props.onClose}\n tryPreserveFirstRenderedPosition\n ref={this.popupRef}\n withoutMobile\n {...popupProps}\n >\n {content}\n </Popup>\n </CommonWrapper>\n );\n }\n\n private getPositions = (): PopupPositionsType[] =>\n this.props.allowedPositions\n ? this.props.allowedPositions.filter((item) => DefaultPositions.includes(item))\n : DefaultPositions;\n\n private refContent = (node: HTMLElement | null) => {\n this.contentElement = node;\n };\n\n private getPopupAndLayerProps(): {\n layerProps?: Partial<RenderLayerProps>;\n popupProps: Partial<PopupProps>;\n } {\n const props = this.props;\n const useWrapper = !!props.children && this.getProps().useWrapper;\n const trigger = this.getProps().trigger;\n\n const defaultPopupAndLayerProps: ReturnType<typeof this.getPopupAndLayerProps> = {\n popupProps: {\n onMouseEnter: this.handleMouseEnter,\n onMouseLeave: this.handleMouseLeave,\n useWrapper,\n },\n };\n\n switch (trigger) {\n case 'opened':\n return {\n layerProps: {\n active: true,\n onClickOutside: this.handleClickOutsideAnchor,\n },\n popupProps: {\n opened: true,\n useWrapper,\n },\n };\n\n case 'closed':\n return {\n popupProps: {\n opened: false,\n useWrapper,\n },\n };\n\n case 'manual':\n return {\n popupProps: {\n useWrapper,\n },\n };\n case 'click':\n return {\n layerProps: {\n active: this.state.opened,\n onClickOutside: this.handleClickOutsideAnchor,\n },\n popupProps: {\n onClick: this.handleClick,\n useWrapper,\n },\n };\n\n case 'focus':\n return {\n popupProps: {\n onFocus: this.handleFocus,\n onBlur: this.handleBlur,\n useWrapper,\n },\n };\n\n case 'hover&focus':\n return {\n layerProps: {\n active: this.state.opened,\n onClickOutside: this.handleClickOutsideAnchor,\n },\n popupProps: {\n onFocus: this.handleFocus,\n onBlur: this.handleBlur,\n onMouseEnter: this.handleMouseEnter,\n onMouseLeave: this.handleMouseLeave,\n useWrapper,\n },\n };\n\n case 'hoverAnchor':\n case 'hover':\n return defaultPopupAndLayerProps;\n default:\n warning(false, `Unknown trigger specified: ${trigger}. Returning default value.`);\n return defaultPopupAndLayerProps;\n }\n }\n\n private open = () => this.setState({ opened: true });\n\n private close = () => this.setState({ opened: false });\n\n private clearHoverTimeout() {\n if (this.hoverTimeout) {\n clearTimeout(this.hoverTimeout);\n this.hoverTimeout = null;\n }\n }\n\n private handleMouseEnter = (event: MouseEventType) => {\n const isHoverAnchor = this.getProps().trigger === 'hoverAnchor';\n if (isHoverAnchor && event.target === this.contentElement) {\n return;\n }\n\n this.clearHoverTimeout();\n this.hoverTimeout = setTimeout(this.open, this.getProps().delayBeforeShow);\n };\n\n private handleMouseLeave = (event: MouseEventType) => {\n const trigger = this.getProps().trigger;\n if (\n (trigger === 'hover&focus' && this.state.focused) ||\n (trigger === 'hover' && event.relatedTarget === this.contentElement)\n ) {\n return;\n }\n\n this.clearHoverTimeout();\n\n if (trigger === 'hoverAnchor') {\n this.close();\n } else {\n this.hoverTimeout = setTimeout(this.close, Tooltip.delay);\n }\n };\n\n private handleClick = () => {\n this.open();\n };\n\n private handleClickOutsideAnchor = (event: Event) => {\n this.clickedOutside = this.isClickOutsideContent(event);\n if (this.clickedOutside) {\n if (this.props.onCloseRequest) {\n this.props.onCloseRequest(event);\n }\n this.close();\n }\n };\n\n private isClickOutsideContent(event: Event) {\n if (this.contentElement && isInstanceOf(event.target, this.globalObject.Element)) {\n return !containsTargetOrRenderContainer(event.target)(this.contentElement);\n }\n\n return true;\n }\n\n private handleFocus = () => {\n this.setState({ focused: true });\n this.open();\n };\n\n private handleBlur = () => {\n const trigger = this.getProps().trigger;\n if (trigger === 'hover&focus' && this.clickedOutside) {\n this.close();\n }\n\n if (trigger === 'focus') {\n this.close();\n }\n\n this.clickedOutside = true;\n this.setState({ focused: false });\n };\n\n private handleCloseButtonClick = (event: React.MouseEvent<HTMLElement>) => {\n event.stopPropagation();\n\n if (this.props.onCloseClick) {\n this.props.onCloseClick(event);\n }\n\n if (event.defaultPrevented) {\n return;\n }\n\n if (this.props.onCloseRequest) {\n this.props.onCloseRequest(event);\n }\n\n this.close();\n };\n\n private getSizeVariables = (): TooltipSizeVariables => {\n switch (this.size) {\n case 'small':\n return {\n closeButtonStyle: this.styles.closeButtonSmall(this.theme),\n contentStyle: this.styles.tooltipContentSmall(this.theme),\n borderRadius: this.theme.tooltipBorderRadiusSmall,\n pinSize: this.theme.tooltipPinSizeSmall,\n pinOffsetX: this.theme.tooltipPinOffsetXSmall,\n pinOffsetY: this.theme.tooltipPinOffsetYSmall,\n margin: this.theme.tooltipMarginSmall,\n };\n case 'medium':\n return {\n closeButtonStyle: this.styles.closeButtonMedium(this.theme),\n contentStyle: this.styles.tooltipContentMedium(this.theme),\n borderRadius: this.theme.tooltipBorderRadiusMedium,\n pinSize: this.theme.tooltipPinSizeMedium,\n pinOffsetX: this.theme.tooltipPinOffsetXMedium,\n pinOffsetY: this.theme.tooltipPinOffsetYMedium,\n margin: this.theme.tooltipMarginMedium,\n };\n case 'large':\n return {\n closeButtonStyle: this.styles.closeButtonLarge(this.theme),\n contentStyle: this.styles.tooltipContentLarge(this.theme),\n borderRadius: this.theme.tooltipBorderRadiusLarge,\n pinSize: this.theme.tooltipPinSizeLarge,\n pinOffsetX: this.theme.tooltipPinOffsetXLarge,\n pinOffsetY: this.theme.tooltipPinOffsetYLarge,\n margin: this.theme.tooltipMarginLarge,\n };\n default:\n warning(false, `Can't get size variables: invalid value in size prop '${this.props.size}'. Returning default`);\n return {\n closeButtonStyle: this.styles.closeButtonSmall(this.theme),\n contentStyle: this.styles.tooltipContentSmall(this.theme),\n borderRadius: this.theme.tooltipBorderRadiusSmall,\n pinSize: this.theme.tooltipPinSizeSmall,\n pinOffsetX: this.theme.tooltipPinOffsetXSmall,\n pinOffsetY: this.theme.tooltipPinOffsetYSmall,\n margin: this.theme.tooltipMarginSmall,\n };\n }\n };\n}\n"],"mappings":"qJAAA,OAAOA,KAAK,MAAoB,OAAO;AACvC,OAAOC,OAAO,MAAM,SAAS;;;;AAI7B,SAASC,UAAU,QAAQ,iBAAiB;AAC5C,SAASC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AmB,GAAG,SAAS,EAAA/K,QAAA,CAC/BgL,WAAW,GAAG,SAAS,EAAAhL,QAAA,CAEvBa,YAAY,GAAiB,EACzCsC,OAAO,EAAE,OAAO,EAChBoG,iBAAiB,EAAExK,SAAS,EAC5BqL,UAAU,EAAE,KAAK,EACjB5G,eAAe,EAAEhE,aAAa,CAChC,CAAC,EAAAQ,QAAA,CAUa2D,KAAK,GAAGnE,aAAa,EAAAQ,QAAA,CACpBgI,0BAA0B,GAAqB,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,aAAa,CAAC,EAAAhI,QAAA,MAAAD,MAAA,KAAAA,MAAA,KAAAA,MAAA","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { type JSX } from 'react';
2
2
  import type { PopupPositionsType, ShortPopupPositionsType } from '../../internal/Popup';
3
3
  import type { Nullable } from '../../typings/utility-types';
4
4
  import type { CommonProps } from '../../internal/CommonWrapper';
@@ -104,9 +104,9 @@ export declare class Tooltip extends React.PureComponent<TooltipProps, TooltipSt
104
104
  componentDidMount(): void;
105
105
  componentDidUpdate(): void;
106
106
  componentWillUnmount(): void;
107
- render(): React.JSX.Element;
108
- renderContent: () => React.JSX.Element | null;
109
- renderCloseButton(): React.JSX.Element | null;
107
+ render(): JSX.Element;
108
+ renderContent: () => JSX.Element | null;
109
+ renderCloseButton(): JSX.Element | null;
110
110
  getAnchorElement: () => Nullable<Element>;
111
111
  /**
112
112
  * Программно открывает тултип.
@@ -7,7 +7,7 @@ export var useDrop = function useDrop(props) {
7
7
  onDrop = _props.onDrop;
8
8
  var droppableRef = useRef(null);
9
9
  var overRef = useRef(false);
10
- var timerId = useRef();
10
+ var timerId = useRef(undefined);
11
11
  var _useState = useState(false),
12
12
  isDraggable = _useState[0],
13
13
  setIsDraggable = _useState[1];
@@ -1 +1 @@
1
- {"version":3,"names":["useCallback","useEffect","useRef","useState","useDrop","props","_props","onDrop","droppableRef","overRef","timerId","_useState","isDraggable","setIsDraggable","clearTimer","current","clearTimeout","handleDragOver","event","preventDefault","setTimeout","stopPropagation","handleDrop","ref","addEventListener","removeEventListener"],"sources":["useDrop.ts"],"sourcesContent":["import type { MutableRefObject } from 'react';\nimport { useCallback, useEffect, useRef, useState } from 'react';\n\nimport type { SafeTimer } from '../lib/globalObject';\n\ninterface IUseDropProps {\n onDrop?: (event: DragEvent) => void;\n}\n\ntype IElementWithListener = Pick<HTMLElement, 'addEventListener' | 'removeEventListener'>;\n\ninterface IUseDropResult<TElement extends IElementWithListener> {\n isDraggable: boolean;\n ref: MutableRefObject<TElement | null>;\n}\n\nexport const useDrop = <TElement extends IElementWithListener>(props: IUseDropProps = {}): IUseDropResult<TElement> => {\n const { onDrop } = props;\n\n const droppableRef = useRef<TElement>(null);\n const overRef = useRef<boolean>(false);\n const timerId = useRef<SafeTimer>();\n const [isDraggable, setIsDraggable] = useState<boolean>(false);\n\n const clearTimer = useCallback(() => {\n timerId.current && clearTimeout(timerId.current);\n }, []);\n\n const handleDragOver = useCallback(\n (event: DragEvent) => {\n event.preventDefault();\n setIsDraggable(true);\n\n clearTimer();\n timerId.current = setTimeout(() => {\n overRef.current = false;\n setIsDraggable(false);\n }, 200);\n },\n [clearTimer],\n );\n\n const preventDefault = useCallback((event: DragEvent) => {\n event.preventDefault();\n event.stopPropagation();\n }, []);\n\n const handleDrop = useCallback(\n (event: DragEvent) => {\n preventDefault(event);\n setIsDraggable(false);\n overRef.current = false;\n\n onDrop?.(event);\n },\n [preventDefault, onDrop],\n );\n\n useEffect(() => {\n const ref = droppableRef.current;\n\n if (!ref) {\n return;\n }\n\n ref.addEventListener('dragenter', preventDefault);\n ref.addEventListener('dragleave', preventDefault);\n ref.addEventListener('dragover', handleDragOver);\n ref.addEventListener('drop', handleDrop);\n\n return () => {\n ref.removeEventListener('dragenter', preventDefault);\n ref.removeEventListener('dragleave', preventDefault);\n ref.removeEventListener('dragover', handleDragOver);\n ref.removeEventListener('drop', handleDrop);\n };\n }, [handleDrop, hand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EAAE,CAAC;;EAEN,IAAMC,UAAU,GAAGtB,WAAW;IAC5B,UAACkB,KAAgB,EAAK;MACpBC,cAAc,CAACD,KAAK,CAAC;MACrBL,cAAc,CAAC,KAAK,CAAC;MACrBJ,OAAO,CAACM,OAAO,GAAG,KAAK;;MAEvBR,MAAM,YAANA,MAAM,CAAGW,KAAK,CAAC;IACjB,CAAC;IACD,CAACC,cAAc,EAAEZ,MAAM;EACzB,CAAC;;EAEDN,SAAS,CAAC,YAAM;IACd,IAAMsB,GAAG,GAAGf,YAAY,CAACO,OAAO;;IAEhC,IAAI,CAACQ,GAAG,EAAE;MACR;IACF;;IAEAA,GAAG,CAACC,gBAAgB,CAAC,WAAW,EAAEL,cAAc,CAAC;IACjDI,GAAG,CAACC,gBAAgB,CAAC,WAAW,EAAEL,cAAc,CAAC;IACjDI,GAAG,CAACC,gBAAgB,CAAC,UAAU,EAAEP,cAAc,CAAC;IAChDM,GAAG,CAACC,gBAAgB,CAAC,MAAM,EAAEF,UAAU,CAAC;;IAExC,OAAO,YAAM;MACXC,GAAG,CAACE,mBAAmB,CAAC,WAAW,EAAEN,cAAc,CAAC;MACpDI,GAAG,CAACE,mBAAmB,CAAC,WAAW,EAAEN,cAAc,CAAC;MACpDI,GAAG,CAACE,mBAAmB,CAAC,UAAU,EAAER,cAAc,CAAC;MACnDM,GAAG,CAACE,mBAAmB,CAAC,MAAM,EAAEH,UAAU,CAAC;IAC7C,CAAC;EACH,CAAC,EAAE,CAACA,UAAU,EAAEL,cAAc,EAAEE,cAAc,CAAC,CAAC;;EAEhD,OAAO,EAAEP,WAAW,EAAXA,WAAW,EAAEW,GAAG,EAAEf,YAAY,CAAC,CAAC;AAC3C,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["useCallback","useEffect","useRef","useState","useDrop","props","_props","onDrop","droppableRef","overRef","timerId","undefined","_useState","isDraggable","setIsDraggable","clearTimer","current","clearTimeout","handleDragOver","event","preventDefault","setTimeout","stopPropagation","handleDrop","ref","addEventListener","removeEventListener"],"sources":["useDrop.ts"],"sourcesContent":["import type { MutableRefObject } from 'react';\nimport { useCallback, useEffect, useRef, useState } from 'react';\n\nimport type { SafeTimer } from '../lib/globalObject';\n\ninterface IUseDropProps {\n onDrop?: (event: DragEvent) => void;\n}\n\ntype IElementWithListener = Pick<HTMLElement, 'addEventListener' | 'removeEventListener'>;\n\ninterface IUseDropResult<TElement extends IElementWithListener> {\n isDraggable: boolean;\n ref: MutableRefObject<TElement | null>;\n}\n\nexport const useDrop = <TElement extends IElementWithListener>(props: IUseDropProps = {}): IUseDropResult<TElement> => {\n const { onDrop } = props;\n\n const droppableRef = useRef<TElement>(null);\n const overRef = useRef<boolean>(false);\n const timerId = useRef<SafeTimer>(undefined);\n const [isDraggable, setIsDraggable] = useState<boolean>(false);\n\n const clearTimer = useCallback(() => {\n timerId.current && clearTimeout(timerId.current);\n }, []);\n\n const handleDragOver = useCallback(\n (event: DragEvent) => {\n event.preventDefault();\n setIsDraggable(true);\n\n clearTimer();\n timerId.current = setTimeout(() => {\n overRef.current = false;\n setIsDraggable(false);\n }, 200);\n },\n [clearTimer],\n );\n\n const preventDefault = useCallback((event: DragEvent) => {\n event.preventDefault();\n event.stopPropagation();\n }, []);\n\n const handleDrop = useCallback(\n (event: DragEvent) => {\n preventDefault(event);\n setIsDraggable(false);\n overRef.current = false;\n\n onDrop?.(event);\n },\n [preventDefault, onDrop],\n );\n\n useEffect(() => {\n const ref = droppableRef.current;\n\n if (!ref) {\n return;\n }\n\n ref.addEventListener('dragenter', preventDefault);\n ref.addEventListener('dragleave', preventDefault);\n ref.addEventListener('dragover', handleDragOver);\n ref.addEventListener('drop', handleDrop);\n\n return () => {\n ref.removeEventListener('dragenter', preventDefault);\n ref.removeEventListener('dragleave', preventDefault);\n ref.removeEventListener('dragover', handleDragOver);\n ref.removeEventListener('drop', handleDrop);\n };\n }, [handleDrop, handleDragOver, preventDefault]);\n\n return { isDraggable, ref: droppableRef };\n};\n"],"mappings":";AACA,SAASA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mB,KAAgB,EAAK;MACpBC,cAAc,CAACD,KAAK,CAAC;MACrBL,cAAc,CAAC,KAAK,CAAC;MACrBL,OAAO,CAACO,OAAO,GAAG,KAAK;;MAEvBT,MAAM,YAANA,MAAM,CAAGY,KAAK,CAAC;IACjB,CAAC;IACD,CAACC,cAAc,EAAEb,MAAM;EACzB,CAAC;;EAEDN,SAAS,CAAC,YAAM;IACd,IAAMuB,GAAG,GAAGhB,YAAY,CAACQ,OAAO;;IAEhC,IAAI,CAACQ,GAAG,EAAE;MACR;IACF;;IAEAA,GAAG,CAACC,gBAAgB,CAAC,WAAW,EAAEL,cAAc,CAAC;IACjDI,GAAG,CAACC,gBAAgB,CAAC,WAAW,EAAEL,cAAc,CAAC;IACjDI,GAAG,CAACC,gBAAgB,CAAC,UAAU,EAAEP,cAAc,CAAC;IAChDM,GAAG,CAACC,gBAAgB,CAAC,MAAM,EAAEF,UAAU,CAAC;;IAExC,OAAO,YAAM;MACXC,GAAG,CAACE,mBAAmB,CAAC,WAAW,EAAEN,cAAc,CAAC;MACpDI,GAAG,CAACE,mBAAmB,CAAC,WAAW,EAAEN,cAAc,CAAC;MACpDI,GAAG,CAACE,mBAAmB,CAAC,UAAU,EAAER,cAAc,CAAC;MACnDM,GAAG,CAACE,mBAAmB,CAAC,MAAM,EAAEH,UAAU,CAAC;IAC7C,CAAC;EACH,CAAC,EAAE,CAACA,UAAU,EAAEL,cAAc,EAAEE,cAAc,CAAC,CAAC;;EAEhD,OAAO,EAAEP,WAAW,EAAXA,WAAW,EAAEW,GAAG,EAAEhB,YAAY,CAAC,CAAC;AAC3C,CAAC","ignoreList":[]}
@@ -8,6 +8,7 @@ import React from 'react';
8
8
  import { isFunction, isRefableElement } from "../../../lib/utils";
9
9
  import { getRootNode, isInstanceWithRootNode, rootNode } from "../../../lib/rootNode";
10
10
  import { callChildRef } from "../../../lib/callChildRef/callChildRef";
11
+ import { getElementRef } from "../../../lib/getElementRef";
11
12
  import { withRenderEnvironment } from "../../../lib/renderEnvironment";
12
13
  import { extractCommonProps } from "../utils/extractCommonProps";
13
14
  import { getCommonVisualStateDataAttributes } from "../utils/getCommonVisualStateDataAttributes";
@@ -20,7 +21,7 @@ export var CommonWrapper = withRenderEnvironment(_class = rootNode(_class = (_Co
20
21
  _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
21
22
  _this.rootNodeSubscription = null;
22
23
  _this.ref = function (instance) {
23
- var _this$rootNodeSubscri, _this$child;
24
+ var _this$rootNodeSubscri;
24
25
  _this.setRootNode(instance);
25
26
  _this.props.rootNodeRef == null || _this.props.rootNodeRef(getRootNode(instance));
26
27
 
@@ -34,7 +35,7 @@ export var CommonWrapper = withRenderEnvironment(_class = rootNode(_class = (_Co
34
35
  _this.props.rootNodeRef == null || _this.props.rootNodeRef(node);
35
36
  });
36
37
  }
37
- var originalRef = (_this$child = _this.child) == null ? void 0 : _this$child.ref;
38
+ var originalRef = getElementRef(_this.child);
38
39
  if (typeof originalRef === 'function' || originalRef && typeof originalRef === 'object') {
39
40
  originalRef && callChildRef(originalRef, instance);
40
41
  }
@@ -1 +1 @@
1
- {"version":3,"names":["React","isFunction","isRefableElement","getRootNode","isInstanceWithRootNode","rootNode","callChildRef","withRenderEnvironment","extractCommonProps","getCommonVisualStateDataAttributes","CommonWrapper","_class","_CommonWrapper","_React$Component","_this","_len","arguments","length","args","Array","_key","call","apply","concat","rootNodeSubscription","ref","instance","_this$rootNodeSubscri","_this$child","setRootNode","props","rootNodeRef","remove","addRootNodeChangeListener","node","originalRef","child","_inheritsLoose","_proto","prototype","render","_this2","_extractCommonProps","_extractCommonProps$","className","style","children","dataProps","_objectWithoutPropertiesLoose","_excluded","rest","_extends","_objectDestructuringEmpty","getChildProps","childProps","classNames","cx","styles","Object","keys","isValidElement","cloneElement","Component","__KONTUR_REACT_UI__","displayName"],"sources":["CommonWrapper.tsx"],"sourcesContent":["import React from 'react';\nimport type { Emotion } from '@emotion/css/types/create-instance';\n\nimport { isFunction, isRefableElement } from '../../lib/utils';\nimport type { Nullable } from '../../typings/utility-types';\nimport type { TGetRootNode, TRootNodeSubscription, TSetRootNode } from '../../lib/rootNode';\nimport { getRootNode, isInstanceWithRootNode, rootNode } from '../../lib/rootNode';\nimport { callChildRef } from '../../lib/callChildRef/callChildRef';\nimport { withRenderEnvironment } from '../../lib/renderEnvironment';\n\nimport type { CommonProps, CommonPropsRootNodeRef, CommonWrapperProps } from './types';\nimport { extractCommonProps } from './utils/extractCommonProps';\nimport { getCommonVisualStateDataAttributes } from './utils/getCommonVisualStateDataAttributes';\n\nexport type CommonPropsWithRootNodeRef = CommonProps & CommonPropsRootNodeRef;\n\n@withRenderEnvironment\n@rootNode\nexport class CommonWrapper<P extends CommonPropsWithRootNodeRef> extends React.Component<\n CommonWrapperProps<P> & CommonPropsRootNodeRef\n> {\n public static __KONTUR_REACT_UI__ = 'CommonWrapper';\n public static displayName = 'CommonWrapper';\n\n private cx!: Emotion['cx'];\n private child: React.ReactNode;\n public getRootNode!: TGetRootNode;\n private setRootNode!: TSetRootNode;\n private rootNodeSubscription: Nullable<TRootNodeSubscription> = null;\n\n render() {\n const [{ className, style, children, rootNodeRef, ...dataProps }, { ...rest }] = extractCommonProps(this.props);\n this.child = isFunction(children) ? children(rest) : children;\n\n const getChildProps = (child: React.ReactElement<CommonProps & React.RefAttributes<any>>) => {\n const childProps: Record<string, unknown> = {\n ...getCommonVisualStateDataAttributes(rest),\n ...dataProps,\n };\n\n isRefableElement(child) && (childProps.ref = this.ref);\n\n const classNames: string = this.cx(child.props.className, className);\n classNames && (childProps.className = classNames);\n\n const styles: React.CSSProperties = { ...child.props.style, ...style };\n Object.keys(styles).length && (childProps.style = styles);\n\n return childProps;\n };\n\n return React.isValidElement<CommonProps & React.RefAttributes<any>>(this.child)\n ? React.cloneElement(this.child, getChildProps(this.child))\n : this.child;\n }\n\n private ref = (instance: Nullable<React.ReactInstance>) => {\n this.setRootNode(instance);\n this.props.rootNodeRef?.(getRootNode(instance));\n\n // refs are called when instances change,\n // so we have to renew or remove old subscription\n this.rootNodeSubscription?.remove();\n this.rootNodeSubscription = null;\n\n if (instance && isInstanceWithRootNode(instance)) {\n this.rootNodeSubscription = instance.addRootNodeChangeListener?.((node) => {\n this.setRootNode(node);\n this.props.rootNodeRef?.(node);\n });\n }\n\n const originalRef = (this.child as React.RefAttributes<any>)?.ref;\n if (typeof originalRef === 'function' || (originalRef && typeof originalRef === 'object')) {\n originalRef && callChildRef(originalRef, instance);\n }\n };\n}\n"],"mappings":"6ZAAA,OAAOA,KAAK,MAAM,OAAO;;;AAGzB,SAASC,UAAU,EAAEC,gBAAgB,QAAQ,iBAAiB;;;AAG9D,SAASC,WAAW,EAAEC,sBAAsB,EAAEC,QAAQ,QAAQ,oBAAoB;AAClF,SAASC,YAAY,QAAQ,qCAAqC;AAClE,SAASC,qBAAqB,QAAQ,6BAA6B;;;AAGnE,SAASC,kBAAkB,QAAQ,4BAA4B;AAC/D,SAASC,kCAAkC,QAAQ,4CAA4C;;;;AAI/F;;AAEaC,aAAa,GAFzBH,qBAAqB,CAAAI,MAAA,GACrBN,QAAQ,CAAAM,MAAA,IAAAC,cAAA,0BAAAC,gBAAA,YAAAH,cAAA,OAAAI,KAAA,UAAAC,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAC,IAAA,OAAAC,KAAA,CAAAJ,IAAA,GAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA,KAAAF,IAAA,CAAAE,IAAA,IAAAJ,SAAA,CAAAI,IAAA,GAAAN,KAAA,GAAAD,gBAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,gBAAA,SAAAU,MAAA,CAAAL,IAAA,WAAAJ,KAAA;;;;;;;;;;IAWCU,oBAAoB,GAAoC,IAAI,CAAAV,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA4B5DW,GAAG,GAAG,UAACC,QAAuC,EAAK,KAAAC,qBAAA,EAAAC,WAAA;MACzDd,KAAA,CAAKe,WAAW,C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,cAAA,CAGxEmD,mBAAmB,GAAG,eAAe,EAAAnD,cAAA,CACrCoD,WAAW,GAAG,eAAe,EAAApD,cAAA,MAAAD,MAAA,KAAAA,MAAA","ignoreList":[]}
1
+ {"version":3,"names":["React","isFunction","isRefableElement","getRootNode","isInstanceWithRootNode","rootNode","callChildRef","getElementRef","withRenderEnvironment","extractCommonProps","getCommonVisualStateDataAttributes","CommonWrapper","_class","_CommonWrapper","_React$Component","_this","_len","arguments","length","args","Array","_key","call","apply","concat","rootNodeSubscription","ref","instance","_this$rootNodeSubscri","setRootNode","props","rootNodeRef","remove","addRootNodeChangeListener","node","originalRef","child","_inheritsLoose","_proto","prototype","render","_this2","_extractCommonProps","_extractCommonProps$","className","style","children","dataProps","_objectWithoutPropertiesLoose","_excluded","rest","_extends","_objectDestructuringEmpty","getChildProps","childProps","classNames","cx","styles","Object","keys","isValidElement","cloneElement","Component","__KONTUR_REACT_UI__","displayName"],"sources":["CommonWrapper.tsx"],"sourcesContent":["import React from 'react';\nimport type { Emotion } from '@emotion/css/types/create-instance';\n\nimport { isFunction, isRefableElement } from '../../lib/utils';\nimport type { Nullable } from '../../typings/utility-types';\nimport type { TGetRootNode, TRootNodeSubscription, TSetRootNode } from '../../lib/rootNode';\nimport { getRootNode, isInstanceWithRootNode, rootNode } from '../../lib/rootNode';\nimport { callChildRef } from '../../lib/callChildRef/callChildRef';\nimport { getElementRef } from '../../lib/getElementRef';\nimport { withRenderEnvironment } from '../../lib/renderEnvironment';\n\nimport type { CommonProps, CommonPropsRootNodeRef, CommonWrapperProps } from './types';\nimport { extractCommonProps } from './utils/extractCommonProps';\nimport { getCommonVisualStateDataAttributes } from './utils/getCommonVisualStateDataAttributes';\n\nexport type CommonPropsWithRootNodeRef = CommonProps & CommonPropsRootNodeRef;\n\n@withRenderEnvironment\n@rootNode\nexport class CommonWrapper<P extends CommonPropsWithRootNodeRef> extends React.Component<\n CommonWrapperProps<P> & CommonPropsRootNodeRef\n> {\n public static __KONTUR_REACT_UI__ = 'CommonWrapper';\n public static displayName = 'CommonWrapper';\n\n private cx!: Emotion['cx'];\n private child: React.ReactNode;\n public getRootNode!: TGetRootNode;\n private setRootNode!: TSetRootNode;\n private rootNodeSubscription: Nullable<TRootNodeSubscription> = null;\n\n render() {\n const [{ className, style, children, rootNodeRef, ...dataProps }, { ...rest }] = extractCommonProps(this.props);\n this.child = isFunction(children) ? children(rest) : children;\n\n const getChildProps = (child: React.ReactElement<CommonProps & React.RefAttributes<any>>) => {\n const childProps: Record<string, unknown> = {\n ...getCommonVisualStateDataAttributes(rest),\n ...dataProps,\n };\n\n isRefableElement(child) && (childProps.ref = this.ref);\n\n const classNames: string = this.cx(child.props.className, className);\n classNames && (childProps.className = classNames);\n\n const styles: React.CSSProperties = { ...child.props.style, ...style };\n Object.keys(styles).length && (childProps.style = styles);\n\n return childProps;\n };\n\n return React.isValidElement<CommonProps & React.RefAttributes<any>>(this.child)\n ? React.cloneElement(this.child, getChildProps(this.child))\n : this.child;\n }\n\n private ref = (instance: Nullable<React.ReactInstance>) => {\n this.setRootNode(instance);\n this.props.rootNodeRef?.(getRootNode(instance));\n\n // refs are called when instances change,\n // so we have to renew or remove old subscription\n this.rootNodeSubscription?.remove();\n this.rootNodeSubscription = null;\n\n if (instance && isInstanceWithRootNode(instance)) {\n this.rootNodeSubscription = instance.addRootNodeChangeListener?.((node) => {\n this.setRootNode(node);\n this.props.rootNodeRef?.(node);\n });\n }\n\n const originalRef = getElementRef(this.child as React.ReactElement);\n if (typeof originalRef === 'function' || (originalRef && typeof originalRef === 'object')) {\n originalRef && callChildRef(originalRef, instance);\n }\n };\n}\n"],"mappings":"6ZAAA,OAAOA,KAAK,MAAM,OAAO;;;AAGzB,SAASC,UAAU,EAAEC,gBAAgB,QAAQ,iBAAiB;;;AAG9D,SAASC,WAAW,EAAEC,sBAAsB,EAAEC,QAAQ,QAAQ,oBAAoB;AAClF,SAASC,YAAY,QAAQ,qCAAqC;AAClE,SAASC,aAAa,QAAQ,yB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CAAC5B,GAAG,GAAGe,MAAI,CAACf,GAAG,CAAC,CAEtD,IAAM6B,UAAkB,GAAGd,MAAI,CAACe,EAAE,CAACpB,KAAK,CAACN,KAAK,CAACc,SAAS,EAAEA,SAAS,CAAC,CACpEW,UAAU,KAAKD,UAAU,CAACV,SAAS,GAAGW,UAAU,CAAC,CAEjD,IAAME,MAA2B,GAAAN,QAAA,KAAQf,KAAK,CAACN,KAAK,CAACe,KAAK,EAAKA,KAAK,CAAE,CACtEa,MAAM,CAACC,IAAI,CAACF,MAAM,CAAC,CAACvC,MAAM,KAAKoC,UAAU,CAACT,KAAK,GAAGY,MAAM,CAAC,CAEzD,OAAOH,UAAU,CACnB,CAAC,CAED,OAAO,aAAAtD,KAAK,CAAC4D,cAAc,CAAyC,IAAI,CAACxB,KAAK,CAAC,gBAC3EpC,KAAK,CAAC6D,YAAY,CAAC,IAAI,CAACzB,KAAK,EAAEiB,aAAa,CAAC,IAAI,CAACjB,KAAK,CAAC,CAAC,GACzD,IAAI,CAACA,KAAK,CAChB,CAAC,QAAAzB,aAAA,GApCsEX,KAAK,CAAC8D,SAAS,GAAAjD,cAAA,CAGxEkD,mBAAmB,GAAG,eAAe,EAAAlD,cAAA,CACrCmD,WAAW,GAAG,eAAe,EAAAnD,cAAA,MAAAD,MAAA,KAAAA,MAAA","ignoreList":[]}
@@ -19,7 +19,7 @@ var updateFile = function updateFile(files, fileId, getFileUpdatedProps) {
19
19
  newFiles[fileIndex] = _extends({}, file, updatedProps);
20
20
  return newFiles;
21
21
  };
22
- export var FileUploaderControlProvider = function FileUploaderControlProvider(props) {
22
+ export var FileUploaderControlProvider = /*#__PURE__*/React.memo(function (props) {
23
23
  var initialFiles = props.initialFiles,
24
24
  multiple = props.multiple,
25
25
  children = props.children,
@@ -97,5 +97,5 @@ export var FileUploaderControlProvider = function FileUploaderControlProvider(pr
97
97
  })
98
98
  }, children)
99
99
  );
100
- };
100
+ });
101
101
  FileUploaderControlProvider.displayName = 'FileUploaderControlProvider';
@@ -1 +1 @@
1
- {"version":3,"names":["React","useCallback","useState","useMemoObject","useEffectWithoutInitCall","FileUploaderFileStatus","getAttachedFile","FileUploaderControlContext","useControlLocale","FileUploaderFileValidationResult","updateFile","files","fileId","getFileUpdatedProps","fileIndex","findIndex","file","id","newFiles","concat","updatedProps","_extends","FileUploaderControlProvider","props","initialFiles","multiple","children","onValueChange","onRemove","onAttach","_useState","length","attachedFiles","map","item","setFiles","_useState2","isMinLengthReached","setIsMinLengthReached","locale","setFileStatus","status","validationResult","Error","Warning","error","requestErrorText","handleExternalSetFiles","state","removeFile","filter","setFileValidationResult","reset","createElement","Provider","value","displayName"],"sources":["FileUploaderControlProvider.tsx"],"sourcesContent":["import type { PropsWithChildren } from 'react';\nimport React, { useCallback, useState } from 'react';\n\nimport { useMemoObject } from '../../hooks/useMemoObject';\nimport { useEffectWithoutInitCall } from '../../hooks/useEffectWithoutInitCall';\n\nimport type { FileUploaderAttachedFile } from './fileUtils';\nimport { FileUploaderFileStatus, getAttachedFile } from './fileUtils';\nimport { FileUploaderControlContext } from './FileUploaderControlContext';\nimport { useControlLocale } from './hooks/useControlLocale';\nimport { FileUploaderFileValidationResult } from './FileUploaderFileValidationResult';\n\nexport interface FileUploaderControlProviderProps {\n /** Начальное состояние загруженных файлов */\n initialFiles?: File[];\n /** Срабатывает при выборе файлов */\n onAttach?: (files: FileUploaderAttachedFile[]) => void;\n /** Срабатывает при удалении файла из контрола */\n onRemove?: (fileId: string) => void;\n /** Срабатывает при onAttach, onRemove и других изменениях файлов. В files передает текущее состояние всего списка файлов */\n onValueChange?: (files: FileUploaderAttachedFile[]) => void;\n}\n\nconst updateFile = (\n files: FileUploaderAttachedFile[],\n fileId: string,\n getFileUpdatedProps: (file: FileUploaderAttachedFile) => Partial<FileUploaderAttachedFile>,\n): FileUploaderAttachedFile[] => {\n const fileIndex = files.findIndex((file) => file.id === fileId);\n if (fileIndex === -1) {\n return files;\n }\n\n const newFiles = [...files];\n const file = files[fileIndex];\n\n const updatedProps = getFileUpdatedProps(file);\n\n newFiles[fileIndex] = {\n ...file,\n ...updatedProps,\n };\n\n return newFiles;\n};\n\nexport const FileUploaderControlProvider = (\n props: PropsWithChildren<\n FileUploaderControlProviderProps & {\n multiple?: boolean;\n }\n >,\n) => {\n const { initialFiles, multiple, children, onValueChange, onRemove, onAttach } = props;\n\n const [files, setFiles] = useState<FileUploaderAttachedFile[]>(() => {\n if (initialFiles && initialFiles.length > 0) {\n const attachedFiles = initialFiles.map((item: File) => getAttachedFile(item));\n\n return multiple ? attachedFiles : [attachedFiles[0]];\n }\n return [];\n });\n const [isMinLengthReached, setIsMinLengthReached] = useState<boolean>(false);\n const locale = useControlLocale();\n\n useEffectWithoutInitCall(() => {\n onValueChange?.(files);\n }, [files]);\n\n const setFileStatus = useCallback(\n (fileId: string, status: FileUploaderFileStatus) => {\n setFiles((files) =>\n updateFile(files, fileId, (file) => ({\n status,\n validationResult:\n status === FileUploaderFileStatus.Error || status === FileUploaderFileStatus.Warning\n ? FileUploaderFileValidationResult.error(locale.requestErrorText)\n : file.validationResult,\n })),\n );\n },\n [locale],\n );\n\n const handleExternalSetFiles = useCallback(\n (files: FileUploaderAttachedFile[]) => {\n onAttach?.(files);\n setFiles((state) => [...state, ...files]);\n },\n [onAttach],\n );\n\n const removeFile = useCallback(\n (fileId: string) => {\n onRemove?.(fileId);\n setFiles((state) => state.filter((file) => file.id !== fileId));\n },\n [onRemove],\n );\n\n const setFileValidationResult = useCallback(\n (fileId: string, validationResult: FileUploaderFileValidationResult, status?: FileUploaderFileStatus) => {\n setFiles((files) => updateFile(files, fileId, () => ({ validationResult, status })));\n },\n [],\n );\n\n const reset = React.useCallback(() => {\n setFiles(() => [] as FileUploaderAttachedFile[]);\n }, []);\n\n return (\n <FileUploaderControlContext.Provider\n value={useMemoObject({\n setFileStatus,\n files,\n setFiles: handleExternalSetFiles,\n removeFile,\n setFileValidationResult,\n reset,\n isMinLengthReached,\n setIsMinLengthReached,\n })}\n >\n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;;IAEFZ;IACkC,CAAC;;AAE1C,CAAC;;AAEDJ,2BAA2B,CAACkC,WAAW,GAAG,6BAA6B","ignoreList":[]}
1
+ {"version":3,"names":["React","useCallback","useState","useMemoObject","useEffectWithoutInitCall","FileUploaderFileStatus","getAttachedFile","FileUploaderControlContext","useControlLocale","FileUploaderFileValidationResult","updateFile","files","fileId","getFileUpdatedProps","fileIndex","findIndex","file","id","newFiles","concat","updatedProps","_extends","FileUploaderControlProvider","memo","props","initialFiles","multiple","children","onValueChange","onRemove","onAttach","_useState","length","attachedFiles","map","item","setFiles","_useState2","isMinLengthReached","setIsMinLengthReached","locale","setFileStatus","status","validationResult","Error","Warning","error","requestErrorText","handleExternalSetFiles","state","removeFile","filter","setFileValidationResult","reset","createElement","Provider","value","displayName"],"sources":["FileUploaderControlProvider.tsx"],"sourcesContent":["import type { PropsWithChildren } from 'react';\nimport React, { useCallback, useState } from 'react';\n\nimport { useMemoObject } from '../../hooks/useMemoObject';\nimport { useEffectWithoutInitCall } from '../../hooks/useEffectWithoutInitCall';\n\nimport type { FileUploaderAttachedFile } from './fileUtils';\nimport { FileUploaderFileStatus, getAttachedFile } from './fileUtils';\nimport { FileUploaderControlContext } from './FileUploaderControlContext';\nimport { useControlLocale } from './hooks/useControlLocale';\nimport { FileUploaderFileValidationResult } from './FileUploaderFileValidationResult';\n\nexport interface FileUploaderControlProviderProps {\n /** Начальное состояние загруженных файлов */\n initialFiles?: File[];\n /** Срабатывает при выборе файлов */\n onAttach?: (files: FileUploaderAttachedFile[]) => void;\n /** Срабатывает при удалении файла из контрола */\n onRemove?: (fileId: string) => void;\n /** Срабатывает при onAttach, onRemove и других изменениях файлов. В files передает текущее состояние всего списка файлов */\n onValueChange?: (files: FileUploaderAttachedFile[]) => void;\n}\n\nconst updateFile = (\n files: FileUploaderAttachedFile[],\n fileId: string,\n getFileUpdatedProps: (file: FileUploaderAttachedFile) => Partial<FileUploaderAttachedFile>,\n): FileUploaderAttachedFile[] => {\n const fileIndex = files.findIndex((file) => file.id === fileId);\n if (fileIndex === -1) {\n return files;\n }\n\n const newFiles = [...files];\n const file = files[fileIndex];\n\n const updatedProps = getFileUpdatedProps(file);\n\n newFiles[fileIndex] = {\n ...file,\n ...updatedProps,\n };\n\n return newFiles;\n};\n\nexport const FileUploaderControlProvider = React.memo(\n (\n props: PropsWithChildren<\n FileUploaderControlProviderProps & {\n multiple?: boolean;\n }\n >,\n ) => {\n const { initialFiles, multiple, children, onValueChange, onRemove, onAttach } = props;\n\n const [files, setFiles] = useState<FileUploaderAttachedFile[]>(() => {\n if (initialFiles && initialFiles.length > 0) {\n const attachedFiles = initialFiles.map((item: File) => getAttachedFile(item));\n\n return multiple ? attachedFiles : [attachedFiles[0]];\n }\n return [];\n });\n const [isMinLengthReached, setIsMinLengthReached] = useState<boolean>(false);\n const locale = useControlLocale();\n\n useEffectWithoutInitCall(() => {\n onValueChange?.(files);\n }, [files]);\n\n const setFileStatus = useCallback(\n (fileId: string, status: FileUploaderFileStatus) => {\n setFiles((files) =>\n updateFile(files, fileId, (file) => ({\n status,\n validationResult:\n status === FileUploaderFileStatus.Error || status === FileUploaderFileStatus.Warning\n ? FileUploaderFileValidationResult.error(locale.requestErrorText)\n : file.validationResult,\n })),\n );\n },\n [locale],\n );\n\n const handleExternalSetFiles = useCallback(\n (files: FileUploaderAttachedFile[]) => {\n onAttach?.(files);\n setFiles((state) => [...state, ...files]);\n },\n [onAttach],\n );\n\n const removeFile = useCallback(\n (fileId: string) => {\n onRemove?.(fileId);\n setFiles((state) => state.filter((file) => file.id !== fileId));\n },\n [onRemove],\n );\n\n const setFileValidationResult = useCallback(\n (fileId: string, validationResult: FileUploaderFileValidationResult, status?: FileUploaderFileStatus) => {\n setFiles((files) => updateFile(files, fileId, () => ({ validationResult, status })));\n },\n [],\n );\n\n const reset = React.useCallback(() => {\n setFiles(() => [] as FileUploaderAttachedFile[]);\n }, []);\n\n return (\n <FileUploaderControlContext.Provider\n value={useMemoObject({\n setFileStatus,\n files,\n setFiles: handleExternalSetFiles,\n removeFile,\n setFileValidationResult,\n reset,\n isMinLengthReached,\n setIsMinLengthReached,\n })}\n >\n {children}\n </FileUploaderControlContext.Provider>\n );\n },\n);\nFileUploaderControlProvider.displayName = 'FileUploaderControlProvider';\n"],"mappings":";AACA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,QAAQ,QAAQ,OAAO;;AAEpD,SAASC,aAAa,QAAQ,2BAA2B;AACzD,SAASC,wBAAwB,QAAQ,sCAAsC;;;AAG/E,SAASC,sBAAsB,EAAEC,eAAe,QAAQ,aAAa;AACrE,SAASC,0BAA0B,QAAQ,8BAA8B;AACzE,SAASC,gBAAgB,QAAQ,0BAA0B;AAC3D,SAASC,gCAAgC,QAAQ,oCAAoC;;;;;;;;;;;;;AAarF,IAAMC,UAAU,GAAG,SAAbA,UAAUA;AACdC,KAAiC;AACjCC,MAAc;AACdC,mBAA0F;AAC3D;EAC/B,IAAMC,SAAS,GAAGH,KAAK,CAACI,SAAS,CAAC,UAACC,IAAI,UAAKA,IAAI,CAACC,EAAE,KAAKL,MAAM,GAAC;EAC/D,IAAIE,SAAS,KAAK,CAAC,CAAC,EAAE;IACpB,OAAOH,KAAK;EACd;;EAEA,IAAMO,QAAQ,MAAAC,MAAA,CAAOR,KAAK,CAAC;EAC3B,IAAMK,IAAI,GAAGL,KAAK,CAACG,SAAS,CAAC;;EAE7B,IAAMM,YAAY,GAAGP,mBAAmB,CAACG,IAAI,CAAC;;EAE9CE,QAAQ,CAACJ,SAAS,CAAC,GAAAO,QAAA;EACdL,IAAI;EACJI,YAAY,CAChB;;;EAED,OAAOF,QAAQ;AACjB,CAAC;;AAED,OAAO,IAAMI,2BAA2B,gBAAGtB,KAAK,CAACuB,IAAI;EACnD;EACEC,KAIC;;;;;EACE;IACH,IAAQC,YAAY,GAA4DD,KAAK,CAA7EC,YAAY,CAAEC,QAAQ,GAAkDF,KAAK,CAA/DE,QAAQ,CAAEC,QAAQ,GAAwCH,KAAK,CAArDG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uBAAuB;UACvBC,KAAK,EAALA,KAAK;UACLf,kBAAkB,EAAlBA,kBAAkB;UAClBC,qBAAqB,EAArBA;QACF,CAAC,CAAE;;MAEFZ;MACkC,CAAC;;EAE1C;AACF,CAAC;AACDL,2BAA2B,CAACmC,WAAW,GAAG,6BAA6B","ignoreList":[]}
@@ -11,9 +11,6 @@ export interface FileUploaderControlProviderProps {
11
11
  /** Срабатывает при onAttach, onRemove и других изменениях файлов. В files передает текущее состояние всего списка файлов */
12
12
  onValueChange?: (files: FileUploaderAttachedFile[]) => void;
13
13
  }
14
- export declare const FileUploaderControlProvider: {
15
- (props: PropsWithChildren<FileUploaderControlProviderProps & {
16
- multiple?: boolean;
17
- }>): React.JSX.Element;
18
- displayName: string;
19
- };
14
+ export declare const FileUploaderControlProvider: React.MemoExoticComponent<(props: PropsWithChildren<FileUploaderControlProviderProps & {
15
+ multiple?: boolean;
16
+ }>) => React.JSX.Element>;
@@ -4,8 +4,7 @@ var _excluded = ["onRemove", "onValueChange", "onAttach", "initialFiles"];
4
4
  import React from 'react';
5
5
  import { FileUploaderControlProvider } from "../FileUploaderControlProvider";
6
6
  export var withFileUploaderControlProvider = function withFileUploaderControlProvider(Component) {
7
- return /*#__PURE__*/React.memo( /*#__PURE__*/
8
- React.forwardRef(function (props, ref) {
7
+ return /*#__PURE__*/React.forwardRef(function (props, ref) {
9
8
  var onRemove = props.onRemove,
10
9
  onValueChange = props.onValueChange,
11
10
  onAttach = props.onAttach,
@@ -17,5 +16,5 @@ export var withFileUploaderControlProvider = function withFileUploaderControlPro
17
16
  ref: ref
18
17
  }, rest)))
19
18
  );
20
- }));
19
+ });
21
20
  };
@@ -1 +1 @@
1
- {"version":3,"names":["React","FileUploaderControlProvider","withFileUploaderControlProvider","Component","memo","forwardRef","props","ref","onRemove","onValueChange","onAttach","initialFiles","rest","_objectWithoutPropertiesLoose","_excluded","createElement","_extends"],"sources":["withFileUploaderControlProvider.tsx"],"sourcesContent":["import type { ComponentType } from 'react';\nimport React from 'react';\n\nimport type { FileUploaderControlProviderProps } from './FileUploaderControlProvider';\nimport { FileUploaderControlProvider } from './FileUploaderControlProvider';\n\nexport const withFileUploaderControlProvider = <TProps extends Record<string, any>, TRef extends Record<string, any>>(\n Component: ComponentType<\n Pick<TProps & FileUploaderControlProviderProps, Exclude<keyof TProps, keyof FileUploaderControlProviderProps>>\n >,\n) => {\n return React.memo(\n React.forwardRef<TRef, TProps & FileUploaderControlProviderProps>(\n (props: TProps & FileUploaderControlProviderProps, ref) => {\n const { onRemove, onValueChange, onAttach, initialFiles, ...rest } = props;\n return (\n <FileUploaderControlProvider {...props}>\n <Component ref={ref} {...rest} />\n </FileUploaderControlProvider>\n );\n },\n ),\n );\n};\n"],"mappings":";AACA,OAAOA,KAAK,MAAM,OAAO;;;AAGzB,SAASC,2BAA2B,QAAQ,+BAA+B;;AAE3E,OAAO,IAAMC,+BAA+B,GAAG,SAAlCA,+BAA+BA;AAC1CC,SAEC;;;AACE;EACH,oBAAOH,KAAK,CAACI,IAAI;IACfJ,KAAK,CAACK,UAAU;MACd,UAACC,KAAgD,EAAEC,GAAG,EAAK;QACzD,IAAQC,QAAQ,GAAqDF,KAAK,CAAlEE,QAAQ,CAAEC,aAAa,GAAsCH,KAAK,CAAxDG,aAAa,CAAEC,QAAQ,GAA4BJ,KAAK,CAAzCI,QAAQ,CAAEC,YAAY,GAAcL,KAAK,CAA/BK,YAAY,CAAKC,IAAI,GAAAC,6BAAA,CAAKP,KAAK,EAAAQ,SAAA;QAC1E;UACEd,KAAA,CAAAe,aAAA,CAACd,2BAA2B,EAAKK,KAAK;UACpCN,KAAA,CAAAe,aAAA,CAACZ,SAAS,EAAAa,QAAA,GAACT,GAAG,EAAEA,GAAI,IAAKK,IAAI,CAAG;UACL,CAAC;;MAElC;IACF;EACF,CAAC;AACH,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","FileUploaderControlProvider","withFileUploaderControlProvider","Component","forwardRef","props","ref","onRemove","onValueChange","onAttach","initialFiles","rest","_objectWithoutPropertiesLoose","_excluded","createElement","_extends"],"sources":["withFileUploaderControlProvider.tsx"],"sourcesContent":["import type { ComponentType } from 'react';\nimport React from 'react';\n\nimport type { FileUploaderControlProviderProps } from './FileUploaderControlProvider';\nimport { FileUploaderControlProvider } from './FileUploaderControlProvider';\n\nexport const withFileUploaderControlProvider = <TProps extends Record<string, any>, TRef extends Record<string, any>>(\n Component: ComponentType<\n Omit<\n React.PropsWithoutRef<TProps & FileUploaderControlProviderProps>,\n 'onAttach' | 'onRemove' | 'onValueChange' | 'initialFiles'\n >\n >,\n) => {\n return React.forwardRef<TRef, TProps & FileUploaderControlProviderProps>((props, ref) => {\n const { onRemove, onValueChange, onAttach, initialFiles, ...rest } = props;\n return (\n <FileUploaderControlProvider {...props}>\n <Component ref={ref} {...rest} />\n </FileUploaderControlProvider>\n );\n });\n};\n"],"mappings":";AACA,OAAOA,KAAK,MAAM,OAAO;;;AAGzB,SAASC,2BAA2B,QAAQ,+BAA+B;;AAE3E,OAAO,IAAMC,+BAA+B,GAAG,SAAlCA,+BAA+BA;AAC1CC,SAKC;;;;;;AACE;EACH,oBAAOH,KAAK,CAACI,UAAU,CAAkD,UAACC,KAAK,EAAEC,GAAG,EAAK;IACvF,IAAQC,QAAQ,GAAqDF,KAAK,CAAlEE,QAAQ,CAAEC,aAAa,GAAsCH,KAAK,CAAxDG,aAAa,CAAEC,QAAQ,GAA4BJ,KAAK,CAAzCI,QAAQ,CAAEC,YAAY,GAAcL,KAAK,CAA/BK,YAAY,CAAKC,IAAI,GAAAC,6BAAA,CAAKP,KAAK,EAAAQ,SAAA;IAC1E;MACEb,KAAA,CAAAc,aAAA,CAACb,2BAA2B,EAAKI,KAAK;MACpCL,KAAA,CAAAc,aAAA,CAACX,SAAS,EAAAY,QAAA,GAACT,GAAG,EAAEA,GAAI,IAAKK,IAAI,CAAG;MACL,CAAC;;EAElC,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
1
  import type { ComponentType } from 'react';
2
2
  import React from 'react';
3
3
  import type { FileUploaderControlProviderProps } from './FileUploaderControlProvider';
4
- export declare const withFileUploaderControlProvider: <TProps extends Record<string, any>, TRef extends Record<string, any>>(Component: ComponentType<Pick<TProps & FileUploaderControlProviderProps, Exclude<keyof TProps, keyof FileUploaderControlProviderProps>>>) => React.MemoExoticComponent<React.ForwardRefExoticComponent<React.PropsWithoutRef<TProps & FileUploaderControlProviderProps> & React.RefAttributes<TRef>>>;
4
+ export declare const withFileUploaderControlProvider: <TProps extends Record<string, any>, TRef extends Record<string, any>>(Component: ComponentType<Omit<React.PropsWithoutRef<TProps & FileUploaderControlProviderProps>, "onAttach" | "onRemove" | "onValueChange" | "initialFiles">>) => React.ForwardRefExoticComponent<React.PropsWithoutRef<TProps & FileUploaderControlProviderProps> & React.RefAttributes<TRef>>;
@@ -1,9 +1,10 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
1
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
3
  var _excluded = ["disabled", "children", "onBlurWhenDisabled"];
3
- import React, { isValidElement, cloneElement } from 'react';
4
+ import React, { cloneElement, forwardRef, isValidElement } from 'react';
4
5
  import { CommonWrapper } from "../../CommonWrapper";
5
6
  import { useFocusControl } from "../useFocusControl";
6
- export function FocusControlWrapper(_ref) {
7
+ export var FocusControlWrapper = /*#__PURE__*/forwardRef(function (_ref, ref) {
7
8
  var disabled = _ref.disabled,
8
9
  children = _ref.children,
9
10
  onBlurWhenDisabled = _ref.onBlurWhenDisabled,
@@ -21,12 +22,14 @@ export function FocusControlWrapper(_ref) {
21
22
  return null;
22
23
  }
23
24
  return /*#__PURE__*/(
24
- React.createElement(CommonWrapper, rest, React.Children.only( /*#__PURE__*/
25
+ React.createElement(CommonWrapper, _extends({}, rest, {
26
+ ref: ref
27
+ }), React.Children.only( /*#__PURE__*/
25
28
  cloneElement(children, {
26
29
  onFocus: handleFocus,
27
30
  onBlur: handleBlur
28
31
  })))
29
32
  );
30
- }
33
+ });
31
34
  FocusControlWrapper.__KONTUR_REACT_UI__ = 'FocusControlWrapper';
32
35
  FocusControlWrapper.displayName = 'FocusControlWrapper';
@@ -1 +1 @@
1
- {"version":3,"names":["React","isValidElement","cloneElement","CommonWrapper","useFocusControl","FocusControlWrapper","_ref","disabled","children","onBlurWhenDisabled","rest","_objectWithoutPropertiesLoose","_excluded","isValidChildren","_useFocusControl","props","undefined","onFocus","onBlur","handleFocus","handleBlur","createElement","Children","only","__KONTUR_REACT_UI__","displayName"],"sources":["FocusControlWrapper.tsx"],"sourcesContent":["import type { PropsWithChildren, ReactElement } from 'react';\nimport React, { isValidElement, cloneElement } from 'react';\n\nimport { CommonWrapper } from '../CommonWrapper';\n\nimport { useFocusControl } from './useFocusControl';\n\ninterface Props {\n /**\n * Использовать только когда на children нет пропса disabled\n */\n disabled?: boolean;\n\n /**\n * Событие вызывается когда элемент потеряет фокус, и при этом он задисэйблен\n */\n onBlurWhenDisabled(): void | undefined;\n}\n\nexport function FocusControlWrapper({ disabled, children, onBlurWhenDisabled, ...rest }: PropsWithChildren<Props>) {\n const isValidChildren = children && isValidElement(children);\n\n const { handleFocus, handleBlur } = useFocusControl({\n disabled: disabled ?? (isValidChildren ? (children as ReactElement).props.disabled : undefined),\n onFocus: isValidChildren ? (children as ReactElement).props.onFocus : undefined,\n onBlur: isValidChildren ? (children as ReactElement).props.onBlur : undefined,\n onBlurWhenDisabled,\n });\n\n if (!isValidChildren) {\n return null;\n }\n\n return (\n <CommonWrapper {...rest}>\n {React.Children.only(\n cloneElement(children as ReactElement, {\n onFocus: handleFocus,\n onBlur: handleBlur,\n }),\n )}\n </CommonWrapper>\n );\n}\n\nFocusControlWrapper.__KONTUR_REACT_UI__ = 'FocusControlWrapper';\nFocusControlWrapper.displayName = 'FocusControlWrapper';\n"],"mappings":";AACA,OAAOA,KAAK,IAAIC,cAAc,EAAEC,YAAY,QAAQ,OAAO;;AAE3D,S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idElement","CommonWrapper","useFocusControl","FocusControlWrapper","_ref","ref","disabled","children","onBlurWhenDisabled","rest","_objectWithoutPropertiesLoose","_excluded","isValidChildren","_useFocusControl","props","undefined","onFocus","onBlur","handleFocus","handleBlur","createElement","_extends","Children","only","__KONTUR_REACT_UI__","displayName"],"sources":["FocusControlWrapper.tsx"],"sourcesContent":["import type { PropsWithChildren, ReactElement, Ref } from 'react';\nimport React, { cloneElement, forwardRef, isValidElement } from 'react';\n\nimport { CommonWrapper } from '../CommonWrapper';\n\nimport { useFocusControl } from './useFocusControl';\n\ninterface Props {\n /**\n * Использовать только когда на children нет пропса disabled\n */\n disabled?: boolean;\n\n /**\n * Событие вызывается когда элемент потеряет фокус, и при этом он задисэйблен\n */\n onBlurWhenDisabled(): void | undefined;\n\n onFocus?: (e: React.FocusEvent) => void;\n onBlur?: (e: React.FocusEvent) => void;\n}\n\nexport const FocusControlWrapper = forwardRef(\n ({ disabled, children, onBlurWhenDisabled, ...rest }: PropsWithChildren<Props>, ref: Ref<any>) => {\n const isValidChildren = children && isValidElement(children);\n\n const { handleFocus, handleBlur } = useFocusControl({\n disabled: disabled ?? (isValidChildren ? (children as ReactElement<Props>).props.disabled : undefined),\n onFocus: isValidChildren ? (children as ReactElement<Props>).props.onFocus : undefined,\n onBlur: isValidChildren ? (children as ReactElement<Props>).props.onBlur : undefined,\n onBlurWhenDisabled,\n });\n\n if (!isValidChildren) {\n return null;\n }\n\n return (\n <CommonWrapper {...rest} ref={ref}>\n {React.Children.only(\n cloneElement(children as ReactElement<Props>, {\n onFocus: handleFocus,\n onBlur: handleBlur,\n }),\n )}\n </CommonWrapper>\n );\n },\n);\n\nFocusControlWrapper.__KONTUR_REACT_UI__ = 'FocusControlWrapper';\nFocusControlWrapper.displayName = 'FocusControlWrapper';\n"],"mappings":";AACA,OAAOA,KAAK,IAAIC,YAAY,EAAEC,UAAU,EAAEC,cAAc,QAAQ,OAAO;;AAEvE,SAASC,aAAa,QAAQ,kBAAkB;;AAEh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,GAAG,qBAAqB","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- import type { PropsWithChildren } from 'react';
2
1
  import React from 'react';
3
2
  interface Props {
4
3
  /**
@@ -9,10 +8,10 @@ interface Props {
9
8
  * Событие вызывается когда элемент потеряет фокус, и при этом он задисэйблен
10
9
  */
11
10
  onBlurWhenDisabled(): void | undefined;
11
+ onFocus?: (e: React.FocusEvent) => void;
12
+ onBlur?: (e: React.FocusEvent) => void;
12
13
  }
13
- export declare function FocusControlWrapper({ disabled, children, onBlurWhenDisabled, ...rest }: PropsWithChildren<Props>): React.JSX.Element | null;
14
- export declare namespace FocusControlWrapper {
15
- var __KONTUR_REACT_UI__: string;
16
- var displayName: string;
17
- }
14
+ export declare const FocusControlWrapper: React.ForwardRefExoticComponent<Props & {
15
+ children?: React.ReactNode | undefined;
16
+ } & React.RefAttributes<any>>;
18
17
  export {};
@@ -4,5 +4,5 @@ export interface IgnoreLayerClickProps {
4
4
  active: boolean;
5
5
  }
6
6
  export declare class IgnoreLayerClick extends React.Component<IgnoreLayerClickProps> {
7
- render(): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
7
+ render(): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
8
8
  }