@skbkontur/react-ui 4.0.6 → 4.1.2-fix-zindex

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 (822) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/README.md +1 -1
  3. package/cjs/components/Autocomplete/Autocomplete.d.ts +3 -0
  4. package/cjs/components/Autocomplete/Autocomplete.js +20 -7
  5. package/cjs/components/Autocomplete/Autocomplete.js.map +1 -1
  6. package/cjs/components/Button/Button.d.ts +4 -5
  7. package/cjs/components/Button/Button.js +8 -12
  8. package/cjs/components/Button/Button.js.map +1 -1
  9. package/cjs/components/Center/Center.d.ts +3 -0
  10. package/cjs/components/Center/Center.js +8 -3
  11. package/cjs/components/Center/Center.js.map +1 -1
  12. package/cjs/components/Checkbox/Checkbox.d.ts +8 -0
  13. package/cjs/components/Checkbox/Checkbox.js +37 -3
  14. package/cjs/components/Checkbox/Checkbox.js.map +1 -1
  15. package/cjs/components/Checkbox/Checkbox.styles.d.ts +1 -0
  16. package/cjs/components/Checkbox/Checkbox.styles.js +27 -24
  17. package/cjs/components/Checkbox/Checkbox.styles.js.map +1 -1
  18. package/cjs/components/CurrencyInput/CurrencyHelper.js +18 -12
  19. package/cjs/components/CurrencyInput/CurrencyHelper.js.map +1 -1
  20. package/cjs/components/CurrencyInput/CurrencyInput.d.ts +3 -0
  21. package/cjs/components/CurrencyInput/CurrencyInput.js +23 -10
  22. package/cjs/components/CurrencyInput/CurrencyInput.js.map +1 -1
  23. package/cjs/components/CurrencyInput/CurrencyInputHelper.js +7 -5
  24. package/cjs/components/CurrencyInput/CurrencyInputHelper.js.map +1 -1
  25. package/cjs/components/CurrencyInput/CursorHelper.js +19 -16
  26. package/cjs/components/CurrencyInput/CursorHelper.js.map +1 -1
  27. package/cjs/components/CurrencyLabel/CurrencyLabel.d.ts +3 -0
  28. package/cjs/components/CurrencyLabel/CurrencyLabel.js +6 -2
  29. package/cjs/components/CurrencyLabel/CurrencyLabel.js.map +1 -1
  30. package/cjs/components/DateInput/DateInput.js +5 -1
  31. package/cjs/components/DateInput/DateInput.js.map +1 -1
  32. package/cjs/components/DateInput/helpers/InternalDateMediator.d.ts +2 -2
  33. package/cjs/components/DateInput/helpers/InternalDateMediator.js +12 -2
  34. package/cjs/components/DateInput/helpers/InternalDateMediator.js.map +1 -1
  35. package/cjs/components/DateInput/helpers/inputNumber.d.ts +1 -1
  36. package/cjs/components/DateInput/helpers/inputNumber.js +45 -12
  37. package/cjs/components/DateInput/helpers/inputNumber.js.map +1 -1
  38. package/cjs/components/DatePicker/DatePicker.d.ts +5 -0
  39. package/cjs/components/DatePicker/DatePicker.js +14 -3
  40. package/cjs/components/DatePicker/DatePicker.js.map +1 -1
  41. package/cjs/components/DatePicker/Picker.js +7 -2
  42. package/cjs/components/DatePicker/Picker.js.map +1 -1
  43. package/cjs/components/Dropdown/Dropdown.d.ts +3 -0
  44. package/cjs/components/Dropdown/Dropdown.js +7 -2
  45. package/cjs/components/Dropdown/Dropdown.js.map +1 -1
  46. package/cjs/components/DropdownMenu/DropdownMenu.d.ts +1 -4
  47. package/cjs/components/DropdownMenu/DropdownMenu.js +2 -16
  48. package/cjs/components/DropdownMenu/DropdownMenu.js.map +1 -1
  49. package/cjs/components/FileUploader/FileUploader.d.ts +5 -0
  50. package/cjs/components/FileUploader/FileUploader.js +18 -9
  51. package/cjs/components/FileUploader/FileUploader.js.map +1 -1
  52. package/cjs/components/FileUploader/FileUploader.styles.d.ts +3 -2
  53. package/cjs/components/FileUploader/FileUploader.styles.js +21 -15
  54. package/cjs/components/FileUploader/FileUploader.styles.js.map +1 -1
  55. package/cjs/components/FxInput/FxInput.d.ts +3 -0
  56. package/cjs/components/FxInput/FxInput.js +7 -3
  57. package/cjs/components/FxInput/FxInput.js.map +1 -1
  58. package/cjs/components/Gapped/Gapped.d.ts +4 -0
  59. package/cjs/components/Gapped/Gapped.js +13 -7
  60. package/cjs/components/Gapped/Gapped.js.map +1 -1
  61. package/cjs/components/GlobalLoader/GlobalLoader.d.ts +3 -0
  62. package/cjs/components/GlobalLoader/GlobalLoader.js +9 -7
  63. package/cjs/components/GlobalLoader/GlobalLoader.js.map +1 -1
  64. package/cjs/components/GlobalLoader/GlobalLoaderView.styles.js +5 -7
  65. package/cjs/components/GlobalLoader/GlobalLoaderView.styles.js.map +1 -1
  66. package/cjs/components/Group/Group.d.ts +3 -0
  67. package/cjs/components/Group/Group.js +80 -33
  68. package/cjs/components/Group/Group.js.map +1 -1
  69. package/cjs/components/Input/Input.d.ts +4 -5
  70. package/cjs/components/Input/Input.js +21 -24
  71. package/cjs/components/Input/Input.js.map +1 -1
  72. package/cjs/components/Kebab/Kebab.d.ts +2 -13
  73. package/cjs/components/Kebab/Kebab.js +5 -29
  74. package/cjs/components/Kebab/Kebab.js.map +1 -1
  75. package/cjs/components/Link/Link.d.ts +3 -0
  76. package/cjs/components/Link/Link.js +7 -3
  77. package/cjs/components/Link/Link.js.map +1 -1
  78. package/cjs/components/Loader/Loader.d.ts +4 -0
  79. package/cjs/components/Loader/Loader.js +8 -3
  80. package/cjs/components/Loader/Loader.js.map +1 -1
  81. package/cjs/components/MenuHeader/MenuHeader.d.ts +3 -0
  82. package/cjs/components/MenuHeader/MenuHeader.js +7 -2
  83. package/cjs/components/MenuHeader/MenuHeader.js.map +1 -1
  84. package/cjs/components/MenuItem/MenuItem.d.ts +4 -0
  85. package/cjs/components/MenuItem/MenuItem.js +10 -4
  86. package/cjs/components/MenuItem/MenuItem.js.map +1 -1
  87. package/cjs/components/MenuItem/MenuItem.styles.js +3 -2
  88. package/cjs/components/MenuItem/MenuItem.styles.js.map +1 -1
  89. package/cjs/components/MenuSeparator/MenuSeparator.d.ts +3 -0
  90. package/cjs/components/MenuSeparator/MenuSeparator.js +7 -3
  91. package/cjs/components/MenuSeparator/MenuSeparator.js.map +1 -1
  92. package/cjs/components/Modal/Modal.d.ts +5 -0
  93. package/cjs/components/Modal/Modal.js +10 -3
  94. package/cjs/components/Modal/Modal.js.map +1 -1
  95. package/cjs/components/Modal/Modal.styles.js +10 -6
  96. package/cjs/components/Modal/Modal.styles.js.map +1 -1
  97. package/cjs/components/Modal/ModalClose.js +3 -2
  98. package/cjs/components/Modal/ModalClose.js.map +1 -1
  99. package/cjs/components/Modal/ModalFooter.d.ts +3 -0
  100. package/cjs/components/Modal/ModalFooter.js +8 -3
  101. package/cjs/components/Modal/ModalFooter.js.map +1 -1
  102. package/cjs/components/Modal/ModalHeader.d.ts +3 -0
  103. package/cjs/components/Modal/ModalHeader.js +9 -3
  104. package/cjs/components/Modal/ModalHeader.js.map +1 -1
  105. package/cjs/components/Paging/Paging.d.ts +20 -3
  106. package/cjs/components/Paging/Paging.js +29 -10
  107. package/cjs/components/Paging/Paging.js.map +1 -1
  108. package/cjs/components/Paging/PagingDefaultComponent.d.ts +9 -0
  109. package/cjs/components/Paging/PagingDefaultComponent.js +21 -0
  110. package/cjs/components/Paging/PagingDefaultComponent.js.map +1 -0
  111. package/cjs/components/PasswordInput/PasswordInput.d.ts +7 -0
  112. package/cjs/components/PasswordInput/PasswordInput.js +36 -11
  113. package/cjs/components/PasswordInput/PasswordInput.js.map +1 -1
  114. package/cjs/components/PasswordInput/PasswordInputIcon.d.ts +3 -0
  115. package/cjs/components/PasswordInput/PasswordInputIcon.js +15 -0
  116. package/cjs/components/PasswordInput/PasswordInputIcon.js.map +1 -0
  117. package/cjs/components/Radio/Radio.d.ts +3 -0
  118. package/cjs/components/Radio/Radio.js +7 -3
  119. package/cjs/components/Radio/Radio.js.map +1 -1
  120. package/cjs/components/Radio/Radio.styles.js +4 -7
  121. package/cjs/components/Radio/Radio.styles.js.map +1 -1
  122. package/cjs/components/RadioGroup/RadioGroup.d.ts +9 -0
  123. package/cjs/components/RadioGroup/RadioGroup.js +22 -5
  124. package/cjs/components/RadioGroup/RadioGroup.js.map +1 -1
  125. package/cjs/components/ResponsiveLayout/ResponsiveLayout.js +7 -2
  126. package/cjs/components/ResponsiveLayout/ResponsiveLayout.js.map +1 -1
  127. package/cjs/components/ResponsiveLayout/ResponsiveLayoutEvents.js +3 -4
  128. package/cjs/components/ResponsiveLayout/ResponsiveLayoutEvents.js.map +1 -1
  129. package/cjs/components/ScrollContainer/ScrollContainer.d.ts +4 -0
  130. package/cjs/components/ScrollContainer/ScrollContainer.js +14 -4
  131. package/cjs/components/ScrollContainer/ScrollContainer.js.map +1 -1
  132. package/cjs/components/Select/Select.d.ts +3 -0
  133. package/cjs/components/Select/Select.js +43 -17
  134. package/cjs/components/Select/Select.js.map +1 -1
  135. package/cjs/components/SidePage/SidePage.d.ts +4 -0
  136. package/cjs/components/SidePage/SidePage.js +9 -3
  137. package/cjs/components/SidePage/SidePage.js.map +1 -1
  138. package/cjs/components/SidePage/SidePageBody.d.ts +3 -0
  139. package/cjs/components/SidePage/SidePageBody.js +10 -3
  140. package/cjs/components/SidePage/SidePageBody.js.map +1 -1
  141. package/cjs/components/SidePage/SidePageContainer.d.ts +3 -0
  142. package/cjs/components/SidePage/SidePageContainer.js +7 -2
  143. package/cjs/components/SidePage/SidePageContainer.js.map +1 -1
  144. package/cjs/components/SidePage/SidePageFooter.d.ts +3 -0
  145. package/cjs/components/SidePage/SidePageFooter.js +11 -3
  146. package/cjs/components/SidePage/SidePageFooter.js.map +1 -1
  147. package/cjs/components/SidePage/SidePageHeader.d.ts +4 -0
  148. package/cjs/components/SidePage/SidePageHeader.js +9 -4
  149. package/cjs/components/SidePage/SidePageHeader.js.map +1 -1
  150. package/cjs/components/Spinner/Spinner.d.ts +3 -1
  151. package/cjs/components/Spinner/Spinner.js +8 -8
  152. package/cjs/components/Spinner/Spinner.js.map +1 -1
  153. package/cjs/components/Spinner/SpinnerFallbackAnimation.js +16 -5
  154. package/cjs/components/Spinner/SpinnerFallbackAnimation.js.map +1 -1
  155. package/cjs/components/Sticky/Sticky.d.ts +3 -0
  156. package/cjs/components/Sticky/Sticky.js +7 -3
  157. package/cjs/components/Sticky/Sticky.js.map +1 -1
  158. package/cjs/components/Switcher/Switcher.d.ts +3 -0
  159. package/cjs/components/Switcher/Switcher.js +7 -3
  160. package/cjs/components/Switcher/Switcher.js.map +1 -1
  161. package/cjs/components/Switcher/Switcher.styles.js +2 -2
  162. package/cjs/components/Switcher/Switcher.styles.js.map +1 -1
  163. package/cjs/components/Tabs/Indicator.js +4 -2
  164. package/cjs/components/Tabs/Indicator.js.map +1 -1
  165. package/cjs/components/Tabs/Tab.d.ts +3 -0
  166. package/cjs/components/Tabs/Tab.js +7 -2
  167. package/cjs/components/Tabs/Tab.js.map +1 -1
  168. package/cjs/components/Tabs/Tabs.d.ts +4 -0
  169. package/cjs/components/Tabs/Tabs.js +12 -3
  170. package/cjs/components/Tabs/Tabs.js.map +1 -1
  171. package/cjs/components/Textarea/Textarea.d.ts +6 -2
  172. package/cjs/components/Textarea/Textarea.js +14 -9
  173. package/cjs/components/Textarea/Textarea.js.map +1 -1
  174. package/cjs/components/Textarea/TextareaCounter.d.ts +1 -2
  175. package/cjs/components/Textarea/TextareaCounter.js +21 -12
  176. package/cjs/components/Textarea/TextareaCounter.js.map +1 -1
  177. package/cjs/components/Toast/Toast.d.ts +6 -0
  178. package/cjs/components/Toast/Toast.js +9 -2
  179. package/cjs/components/Toast/Toast.js.map +1 -1
  180. package/cjs/components/Toast/ToastStatic.js +1 -1
  181. package/cjs/components/Toast/ToastStatic.js.map +1 -1
  182. package/cjs/components/Toast/ToastView.js +6 -5
  183. package/cjs/components/Toast/ToastView.js.map +1 -1
  184. package/cjs/components/Toast/ToastView.styles.d.ts +1 -1
  185. package/cjs/components/Toast/ToastView.styles.js +3 -2
  186. package/cjs/components/Toast/ToastView.styles.js.map +1 -1
  187. package/cjs/components/Toggle/Toggle.d.ts +4 -1
  188. package/cjs/components/Toggle/Toggle.js +7 -3
  189. package/cjs/components/Toggle/Toggle.js.map +1 -1
  190. package/cjs/components/Toggle/Toggle.styles.js +12 -10
  191. package/cjs/components/Toggle/Toggle.styles.js.map +1 -1
  192. package/cjs/components/Token/Token.d.ts +3 -0
  193. package/cjs/components/Token/Token.js +20 -3
  194. package/cjs/components/Token/Token.js.map +1 -1
  195. package/cjs/components/Token/Token.styles.js +13 -6
  196. package/cjs/components/Token/Token.styles.js.map +1 -1
  197. package/cjs/components/TokenInput/TokenInput.d.ts +14 -0
  198. package/cjs/components/TokenInput/TokenInput.js +36 -13
  199. package/cjs/components/TokenInput/TokenInput.js.map +1 -1
  200. package/cjs/components/TokenInput/TokenInput.styles.js +3 -2
  201. package/cjs/components/TokenInput/TokenInput.styles.js.map +1 -1
  202. package/cjs/components/TokenInput/TokenInputMenu.js +4 -3
  203. package/cjs/components/TokenInput/TokenInputMenu.js.map +1 -1
  204. package/cjs/components/Tooltip/Tooltip.d.ts +3 -0
  205. package/cjs/components/Tooltip/Tooltip.js +12 -4
  206. package/cjs/components/Tooltip/Tooltip.js.map +1 -1
  207. package/cjs/components/TooltipMenu/TooltipMenu.d.ts +4 -1
  208. package/cjs/components/TooltipMenu/TooltipMenu.js +9 -2
  209. package/cjs/components/TooltipMenu/TooltipMenu.js.map +1 -1
  210. package/cjs/hooks/useDrop.js +3 -1
  211. package/cjs/hooks/useDrop.js.map +1 -1
  212. package/cjs/index.d.ts +2 -0
  213. package/cjs/index.js +2 -0
  214. package/cjs/index.js.map +1 -1
  215. package/cjs/internal/Calendar/Calendar.d.ts +6 -0
  216. package/cjs/internal/Calendar/Calendar.js +12 -5
  217. package/cjs/internal/Calendar/Calendar.js.map +1 -1
  218. package/cjs/internal/Calendar/CalendarDateShape.d.ts +1 -1
  219. package/cjs/internal/Calendar/MonthView.js +5 -4
  220. package/cjs/internal/Calendar/MonthView.js.map +1 -1
  221. package/cjs/internal/Calendar/MonthViewModel.js +36 -17
  222. package/cjs/internal/Calendar/MonthViewModel.js.map +1 -1
  223. package/cjs/internal/CommonWrapper/CommonWrapper.d.ts +1 -0
  224. package/cjs/internal/CommonWrapper/CommonWrapper.js +7 -5
  225. package/cjs/internal/CommonWrapper/CommonWrapper.js.map +1 -1
  226. package/cjs/internal/CustomComboBox/ComboBoxMenu.d.ts +7 -0
  227. package/cjs/internal/CustomComboBox/ComboBoxMenu.js +28 -5
  228. package/cjs/internal/CustomComboBox/ComboBoxMenu.js.map +1 -1
  229. package/cjs/internal/CustomComboBox/ComboBoxView.js +4 -2
  230. package/cjs/internal/CustomComboBox/ComboBoxView.js.map +1 -1
  231. package/cjs/internal/CustomComboBox/CustomComboBox.d.ts +3 -0
  232. package/cjs/internal/CustomComboBox/CustomComboBox.js +9 -4
  233. package/cjs/internal/CustomComboBox/CustomComboBox.js.map +1 -1
  234. package/cjs/internal/CustomComboBox/CustomComboBoxReducer.d.ts +16 -16
  235. package/cjs/internal/CustomComboBox/CustomComboBoxReducer.js +35 -35
  236. package/cjs/internal/CustomComboBox/CustomComboBoxReducer.js.map +1 -1
  237. package/cjs/internal/DataTids/DATATIDS.md +12 -0
  238. package/cjs/internal/DataTids/DataTids.d.ts +12 -0
  239. package/cjs/internal/DataTids/DataTids.js +46 -0
  240. package/cjs/internal/DataTids/DataTids.js.map +1 -0
  241. package/cjs/internal/DataTids/DataTids.styles.d.ts +7 -0
  242. package/cjs/internal/DataTids/DataTids.styles.js +41 -0
  243. package/cjs/internal/DataTids/DataTids.styles.js.map +1 -0
  244. package/cjs/internal/DataTids/componentsDataTids.d.ts +5 -0
  245. package/cjs/internal/DataTids/componentsDataTids.js +16 -0
  246. package/cjs/internal/DataTids/componentsDataTids.js.map +1 -0
  247. package/cjs/internal/DateSelect/DateSelect.d.ts +4 -0
  248. package/cjs/internal/DateSelect/DateSelect.js +28 -12
  249. package/cjs/internal/DateSelect/DateSelect.js.map +1 -1
  250. package/cjs/internal/FileUploaderControl/FileUploaderControlProvider.js +3 -1
  251. package/cjs/internal/FileUploaderControl/FileUploaderControlProvider.js.map +1 -1
  252. package/cjs/internal/FileUploaderControl/FileUploaderFile/FileUploaderFile.d.ts +7 -0
  253. package/cjs/internal/FileUploaderControl/FileUploaderFile/FileUploaderFile.js +14 -6
  254. package/cjs/internal/FileUploaderControl/FileUploaderFile/FileUploaderFile.js.map +1 -1
  255. package/cjs/internal/FileUploaderControl/FileUploaderFileList/FileUploaderFileList.d.ts +3 -0
  256. package/cjs/internal/FileUploaderControl/FileUploaderFileList/FileUploaderFileList.js +6 -2
  257. package/cjs/internal/FileUploaderControl/FileUploaderFileList/FileUploaderFileList.js.map +1 -1
  258. package/cjs/internal/FileUploaderControl/withFileUploaderControlProvider.js +14 -10
  259. package/cjs/internal/FileUploaderControl/withFileUploaderControlProvider.js.map +1 -1
  260. package/cjs/internal/InputLikeText/InputLikeText.d.ts +5 -1
  261. package/cjs/internal/InputLikeText/InputLikeText.js +10 -4
  262. package/cjs/internal/InputLikeText/InputLikeText.js.map +1 -1
  263. package/cjs/internal/InternalMenu/InternalMenu.d.ts +3 -0
  264. package/cjs/internal/InternalMenu/InternalMenu.js +10 -12
  265. package/cjs/internal/InternalMenu/InternalMenu.js.map +1 -1
  266. package/cjs/internal/InternalMenu/InternalMenu.styles.js +2 -2
  267. package/cjs/internal/InternalMenu/InternalMenu.styles.js.map +1 -1
  268. package/cjs/internal/InternalMenu/addIconPaddingIfPartOfMenu.d.ts +2 -0
  269. package/cjs/internal/InternalMenu/addIconPaddingIfPartOfMenu.js +16 -0
  270. package/cjs/internal/InternalMenu/addIconPaddingIfPartOfMenu.js.map +1 -0
  271. package/cjs/internal/MaskedInput/MaskedInput.d.ts +3 -0
  272. package/cjs/internal/MaskedInput/MaskedInput.js +16 -5
  273. package/cjs/internal/MaskedInput/MaskedInput.js.map +1 -1
  274. package/cjs/internal/Menu/Menu.d.ts +3 -0
  275. package/cjs/internal/Menu/Menu.js +22 -21
  276. package/cjs/internal/Menu/Menu.js.map +1 -1
  277. package/cjs/internal/Menu/Menu.styles.js +5 -3
  278. package/cjs/internal/Menu/Menu.styles.js.map +1 -1
  279. package/cjs/internal/MobilePopup/MobilePopup.d.ts +4 -0
  280. package/cjs/internal/MobilePopup/MobilePopup.js +10 -3
  281. package/cjs/internal/MobilePopup/MobilePopup.js.map +1 -1
  282. package/cjs/internal/Popup/Popup.d.ts +6 -0
  283. package/cjs/internal/Popup/Popup.js +18 -13
  284. package/cjs/internal/Popup/Popup.js.map +1 -1
  285. package/cjs/internal/Popup/PopupPin.js +2 -1
  286. package/cjs/internal/Popup/PopupPin.js.map +1 -1
  287. package/cjs/internal/PopupMenu/PopupMenu.d.ts +8 -0
  288. package/cjs/internal/PopupMenu/PopupMenu.js +22 -4
  289. package/cjs/internal/PopupMenu/PopupMenu.js.map +1 -1
  290. package/cjs/internal/PopupMenu/validatePositions.js +6 -6
  291. package/cjs/internal/PopupMenu/validatePositions.js.map +1 -1
  292. package/cjs/internal/RenderContainer/RenderContainerTypes.d.ts +1 -0
  293. package/cjs/internal/RenderContainer/RenderInnerContainer.d.ts +9 -1
  294. package/cjs/internal/RenderContainer/RenderInnerContainer.js +9 -1
  295. package/cjs/internal/RenderContainer/RenderInnerContainer.js.map +1 -1
  296. package/cjs/internal/RenderLayer/RenderLayer.js +4 -1
  297. package/cjs/internal/RenderLayer/RenderLayer.js.map +1 -1
  298. package/cjs/internal/ThemePlayground/Playground.js +11 -19
  299. package/cjs/internal/ThemePlayground/Playground.js.map +1 -1
  300. package/cjs/internal/ThemePlayground/SizesGroup.d.ts +4 -0
  301. package/cjs/internal/ThemePlayground/SizesGroup.js +20 -0
  302. package/cjs/internal/ThemePlayground/SizesGroup.js.map +1 -0
  303. package/cjs/internal/ThemePlayground/ThemeContextPlayground.d.ts +4 -0
  304. package/cjs/internal/ThemePlayground/ThemeContextPlayground.js +14 -2
  305. package/cjs/internal/ThemePlayground/ThemeContextPlayground.js.map +1 -1
  306. package/cjs/internal/ThemePlayground/ThemeEditor.js +6 -1
  307. package/cjs/internal/ThemePlayground/ThemeEditor.js.map +1 -1
  308. package/cjs/internal/ThemePlayground/VariableValue.js +18 -6
  309. package/cjs/internal/ThemePlayground/VariableValue.js.map +1 -1
  310. package/cjs/internal/ThemePlayground/constants.d.ts +3 -1
  311. package/cjs/internal/ThemePlayground/constants.js +3 -1
  312. package/cjs/internal/ThemePlayground/constants.js.map +1 -1
  313. package/cjs/internal/ThemeShowcase/ThemeShowcase.js +4 -7
  314. package/cjs/internal/ThemeShowcase/ThemeShowcase.js.map +1 -1
  315. package/cjs/internal/ThemeShowcase/VariablesCollector.d.ts +1 -1
  316. package/cjs/internal/ThemeShowcase/VariablesCollector.js +5 -6
  317. package/cjs/internal/ThemeShowcase/VariablesCollector.js.map +1 -1
  318. package/cjs/internal/ZIndex/ZIndex.d.ts +8 -0
  319. package/cjs/internal/ZIndex/ZIndex.js +25 -3
  320. package/cjs/internal/ZIndex/ZIndex.js.map +1 -1
  321. package/cjs/internal/ZIndex/ZIndexStorage.d.ts +2 -1
  322. package/cjs/internal/ZIndex/ZIndexStorage.js +13 -6
  323. package/cjs/internal/ZIndex/ZIndexStorage.js.map +1 -1
  324. package/cjs/internal/icons/16px/index.d.ts +19 -19
  325. package/cjs/internal/icons/16px/index.js +45 -38
  326. package/cjs/internal/icons/16px/index.js.map +1 -1
  327. package/cjs/internal/icons/20px/svg.js +6 -0
  328. package/cjs/internal/icons/20px/svg.js.map +1 -1
  329. package/cjs/internal/themes/DefaultTheme.d.ts +20 -1
  330. package/cjs/internal/themes/DefaultTheme.js +40 -5
  331. package/cjs/internal/themes/DefaultTheme.js.map +1 -1
  332. package/cjs/internal/themes/NotFlat.d.ts +6 -0
  333. package/cjs/internal/themes/NotFlat.js +12 -2
  334. package/cjs/internal/themes/NotFlat.js.map +1 -1
  335. package/cjs/internal/themes/Theme2022.d.ts +66 -0
  336. package/cjs/internal/themes/Theme2022.js +100 -0
  337. package/cjs/internal/themes/Theme2022.js.map +1 -0
  338. package/cjs/internal/themes/Theme2022Dark.d.ts +5 -0
  339. package/cjs/internal/themes/Theme2022Dark.js +9 -0
  340. package/cjs/internal/themes/Theme2022Dark.js.map +1 -0
  341. package/cjs/lib/animation/index.d.ts +1 -1
  342. package/cjs/lib/animation/index.js +3 -3
  343. package/cjs/lib/animation/index.js.map +1 -1
  344. package/cjs/lib/date/InternalDate.js +23 -9
  345. package/cjs/lib/date/InternalDate.js.map +1 -1
  346. package/cjs/lib/date/InternalDateCalculator.js +16 -2
  347. package/cjs/lib/date/InternalDateCalculator.js.map +1 -1
  348. package/cjs/lib/date/InternalDateGetter.d.ts +1 -1
  349. package/cjs/lib/date/InternalDateGetter.js +27 -7
  350. package/cjs/lib/date/InternalDateGetter.js.map +1 -1
  351. package/cjs/lib/date/InternalDateTransformer.js +11 -2
  352. package/cjs/lib/date/InternalDateTransformer.js.map +1 -1
  353. package/cjs/lib/date/InternalDateValidator.js +52 -17
  354. package/cjs/lib/date/InternalDateValidator.js.map +1 -1
  355. package/cjs/lib/date/types.d.ts +4 -0
  356. package/cjs/lib/date/types.js.map +1 -1
  357. package/cjs/lib/events/MouseDrag.js +5 -1
  358. package/cjs/lib/events/MouseDrag.js.map +1 -1
  359. package/cjs/lib/events/keyboard/extractCode.js +7 -5
  360. package/cjs/lib/events/keyboard/extractCode.js.map +1 -1
  361. package/cjs/lib/needsPolyfillPlaceholder.d.ts +6 -0
  362. package/cjs/lib/needsPolyfillPlaceholder.js +19 -0
  363. package/cjs/lib/needsPolyfillPlaceholder.js.map +1 -0
  364. package/cjs/lib/rootNode/getRootNode.d.ts +9 -0
  365. package/cjs/lib/rootNode/getRootNode.js +37 -8
  366. package/cjs/lib/rootNode/getRootNode.js.map +1 -1
  367. package/cjs/lib/rootNode/rootNodeDecorator.d.ts +9 -1
  368. package/cjs/lib/rootNode/rootNodeDecorator.js +11 -2
  369. package/cjs/lib/rootNode/rootNodeDecorator.js.map +1 -1
  370. package/cjs/lib/stringUtils.js +3 -1
  371. package/cjs/lib/stringUtils.js.map +1 -1
  372. package/cjs/lib/styles/ColorFactory.js +9 -9
  373. package/cjs/lib/styles/ColorFactory.js.map +1 -1
  374. package/cjs/lib/styles/ColorHelpers.d.ts +1 -0
  375. package/cjs/lib/styles/ColorHelpers.js +33 -10
  376. package/cjs/lib/styles/ColorHelpers.js.map +1 -1
  377. package/cjs/lib/styles/ColorObject.js +3 -2
  378. package/cjs/lib/styles/ColorObject.js.map +1 -1
  379. package/cjs/lib/styles/getLabGrotesqueBaselineCompensation.d.ts +1 -0
  380. package/cjs/lib/styles/getLabGrotesqueBaselineCompensation.js +9 -0
  381. package/cjs/lib/styles/getLabGrotesqueBaselineCompensation.js.map +1 -0
  382. package/cjs/lib/taskWithDelayAndMinimalDuration.js +3 -1
  383. package/cjs/lib/taskWithDelayAndMinimalDuration.js.map +1 -1
  384. package/cjs/lib/theming/Emotion.js +5 -2
  385. package/cjs/lib/theming/Emotion.js.map +1 -1
  386. package/cjs/lib/theming/ThemeFactory.js +5 -1
  387. package/cjs/lib/theming/ThemeFactory.js.map +1 -1
  388. package/cjs/lib/theming/ThemeHelpers.js +7 -2
  389. package/cjs/lib/theming/ThemeHelpers.js.map +1 -1
  390. package/cjs/lib/theming/themes/Theme2022.d.ts +1 -0
  391. package/cjs/lib/theming/themes/Theme2022.js +6 -0
  392. package/cjs/lib/theming/themes/Theme2022.js.map +1 -0
  393. package/cjs/lib/theming/themes/Theme2022Dark.d.ts +1 -0
  394. package/cjs/lib/theming/themes/Theme2022Dark.js +9 -0
  395. package/cjs/lib/theming/themes/Theme2022Dark.js.map +1 -0
  396. package/cjs/lib/utils.d.ts +15 -0
  397. package/cjs/lib/utils.js +45 -9
  398. package/cjs/lib/utils.js.map +1 -1
  399. package/components/Autocomplete/Autocomplete/Autocomplete.js +16 -11
  400. package/components/Autocomplete/Autocomplete/Autocomplete.js.map +1 -1
  401. package/components/Autocomplete/Autocomplete.d.ts +3 -0
  402. package/components/Button/Button/Button.js +8 -10
  403. package/components/Button/Button/Button.js.map +1 -1
  404. package/components/Button/Button.d.ts +4 -5
  405. package/components/Center/Center/Center.js +10 -5
  406. package/components/Center/Center/Center.js.map +1 -1
  407. package/components/Center/Center.d.ts +3 -0
  408. package/components/Checkbox/Checkbox/Checkbox.js +33 -2
  409. package/components/Checkbox/Checkbox/Checkbox.js.map +1 -1
  410. package/components/Checkbox/Checkbox.d.ts +8 -0
  411. package/components/Checkbox/Checkbox.styles/Checkbox.styles.js +22 -18
  412. package/components/Checkbox/Checkbox.styles/Checkbox.styles.js.map +1 -1
  413. package/components/Checkbox/Checkbox.styles.d.ts +1 -0
  414. package/components/CurrencyInput/CurrencyHelper/CurrencyHelper.js +12 -11
  415. package/components/CurrencyInput/CurrencyHelper/CurrencyHelper.js.map +1 -1
  416. package/components/CurrencyInput/CurrencyInput/CurrencyInput.js +30 -17
  417. package/components/CurrencyInput/CurrencyInput/CurrencyInput.js.map +1 -1
  418. package/components/CurrencyInput/CurrencyInput.d.ts +3 -0
  419. package/components/CurrencyInput/CurrencyInputHelper/CurrencyInputHelper.js +7 -1
  420. package/components/CurrencyInput/CurrencyInputHelper/CurrencyInputHelper.js.map +1 -1
  421. package/components/CurrencyInput/CursorHelper/CursorHelper.js +18 -11
  422. package/components/CurrencyInput/CursorHelper/CursorHelper.js.map +1 -1
  423. package/components/CurrencyLabel/CurrencyLabel/CurrencyLabel.js +6 -1
  424. package/components/CurrencyLabel/CurrencyLabel/CurrencyLabel.js.map +1 -1
  425. package/components/CurrencyLabel/CurrencyLabel.d.ts +3 -0
  426. package/components/DateInput/DateInput/DateInput.js +9 -1
  427. package/components/DateInput/DateInput/DateInput.js.map +1 -1
  428. package/components/DateInput/helpers/InternalDateMediator/InternalDateMediator.js +16 -10
  429. package/components/DateInput/helpers/InternalDateMediator/InternalDateMediator.js.map +1 -1
  430. package/components/DateInput/helpers/InternalDateMediator.d.ts +2 -2
  431. package/components/DateInput/helpers/inputNumber/inputNumber.js +53 -16
  432. package/components/DateInput/helpers/inputNumber/inputNumber.js.map +1 -1
  433. package/components/DateInput/helpers/inputNumber.d.ts +1 -1
  434. package/components/DatePicker/DatePicker/DatePicker.js +6 -0
  435. package/components/DatePicker/DatePicker/DatePicker.js.map +1 -1
  436. package/components/DatePicker/DatePicker.d.ts +5 -0
  437. package/components/DatePicker/Picker/Picker.js +3 -1
  438. package/components/DatePicker/Picker/Picker.js.map +1 -1
  439. package/components/Dropdown/Dropdown/Dropdown.js +9 -5
  440. package/components/Dropdown/Dropdown/Dropdown.js.map +1 -1
  441. package/components/Dropdown/Dropdown.d.ts +3 -0
  442. package/components/DropdownMenu/DropdownMenu/DropdownMenu.js +3 -16
  443. package/components/DropdownMenu/DropdownMenu/DropdownMenu.js.map +1 -1
  444. package/components/DropdownMenu/DropdownMenu.d.ts +1 -4
  445. package/components/FileUploader/FileUploader/FileUploader.js +18 -9
  446. package/components/FileUploader/FileUploader/FileUploader.js.map +1 -1
  447. package/components/FileUploader/FileUploader.d.ts +5 -0
  448. package/components/FileUploader/FileUploader.styles/FileUploader.styles.js +15 -12
  449. package/components/FileUploader/FileUploader.styles/FileUploader.styles.js.map +1 -1
  450. package/components/FileUploader/FileUploader.styles.d.ts +3 -2
  451. package/components/FxInput/FxInput/FxInput.js +6 -2
  452. package/components/FxInput/FxInput/FxInput.js.map +1 -1
  453. package/components/FxInput/FxInput.d.ts +3 -0
  454. package/components/Gapped/Gapped/Gapped.js +16 -8
  455. package/components/Gapped/Gapped/Gapped.js.map +1 -1
  456. package/components/Gapped/Gapped.d.ts +4 -0
  457. package/components/GlobalLoader/GlobalLoader/GlobalLoader.js +9 -8
  458. package/components/GlobalLoader/GlobalLoader/GlobalLoader.js.map +1 -1
  459. package/components/GlobalLoader/GlobalLoader.d.ts +3 -0
  460. package/components/GlobalLoader/GlobalLoaderView.styles/GlobalLoaderView.styles.js +1 -2
  461. package/components/GlobalLoader/GlobalLoaderView.styles/GlobalLoaderView.styles.js.map +1 -1
  462. package/components/Group/Group/Group.js +66 -30
  463. package/components/Group/Group/Group.js.map +1 -1
  464. package/components/Group/Group.d.ts +3 -0
  465. package/components/Input/Input/Input.js +18 -31
  466. package/components/Input/Input/Input.js.map +1 -1
  467. package/components/Input/Input.d.ts +4 -5
  468. package/components/Kebab/Kebab/Kebab.js +3 -13
  469. package/components/Kebab/Kebab/Kebab.js.map +1 -1
  470. package/components/Kebab/Kebab.d.ts +2 -13
  471. package/components/Link/Link/Link.js +10 -5
  472. package/components/Link/Link/Link.js.map +1 -1
  473. package/components/Link/Link.d.ts +3 -0
  474. package/components/Loader/Loader/Loader.js +10 -6
  475. package/components/Loader/Loader/Loader.js.map +1 -1
  476. package/components/Loader/Loader.d.ts +4 -0
  477. package/components/MenuHeader/MenuHeader/MenuHeader.js +4 -0
  478. package/components/MenuHeader/MenuHeader/MenuHeader.js.map +1 -1
  479. package/components/MenuHeader/MenuHeader.d.ts +3 -0
  480. package/components/MenuItem/MenuItem/MenuItem.js +15 -9
  481. package/components/MenuItem/MenuItem/MenuItem.js.map +1 -1
  482. package/components/MenuItem/MenuItem.d.ts +4 -0
  483. package/components/MenuItem/MenuItem.styles/MenuItem.styles.js +1 -1
  484. package/components/MenuItem/MenuItem.styles/MenuItem.styles.js.map +1 -1
  485. package/components/MenuSeparator/MenuSeparator/MenuSeparator.js +4 -0
  486. package/components/MenuSeparator/MenuSeparator/MenuSeparator.js.map +1 -1
  487. package/components/MenuSeparator/MenuSeparator.d.ts +3 -0
  488. package/components/Modal/Modal/Modal.js +9 -3
  489. package/components/Modal/Modal/Modal.js.map +1 -1
  490. package/components/Modal/Modal.d.ts +5 -0
  491. package/components/Modal/Modal.styles/Modal.styles.js +4 -4
  492. package/components/Modal/Modal.styles/Modal.styles.js.map +1 -1
  493. package/components/Modal/ModalClose/ModalClose.js +2 -1
  494. package/components/Modal/ModalClose/ModalClose.js.map +1 -1
  495. package/components/Modal/ModalFooter/ModalFooter.js +5 -1
  496. package/components/Modal/ModalFooter/ModalFooter.js.map +1 -1
  497. package/components/Modal/ModalFooter.d.ts +3 -0
  498. package/components/Modal/ModalHeader/ModalHeader.js +5 -1
  499. package/components/Modal/ModalHeader/ModalHeader.js.map +1 -1
  500. package/components/Modal/ModalHeader.d.ts +3 -0
  501. package/components/Paging/Paging/Paging.js +24 -18
  502. package/components/Paging/Paging/Paging.js.map +1 -1
  503. package/components/Paging/Paging.d.ts +20 -3
  504. package/components/Paging/PagingDefaultComponent/PagingDefaultComponent.js +19 -0
  505. package/components/Paging/PagingDefaultComponent/PagingDefaultComponent.js.map +1 -0
  506. package/components/Paging/PagingDefaultComponent/package.json +6 -0
  507. package/components/Paging/PagingDefaultComponent.d.ts +9 -0
  508. package/components/PasswordInput/PasswordInput/PasswordInput.js +39 -14
  509. package/components/PasswordInput/PasswordInput/PasswordInput.js.map +1 -1
  510. package/components/PasswordInput/PasswordInput.d.ts +7 -0
  511. package/components/PasswordInput/PasswordInputIcon/PasswordInputIcon.js +15 -0
  512. package/components/PasswordInput/PasswordInputIcon/PasswordInputIcon.js.map +1 -0
  513. package/components/PasswordInput/PasswordInputIcon/package.json +6 -0
  514. package/components/PasswordInput/PasswordInputIcon.d.ts +3 -0
  515. package/components/Radio/Radio/Radio.js +10 -5
  516. package/components/Radio/Radio/Radio.js.map +1 -1
  517. package/components/Radio/Radio.d.ts +3 -0
  518. package/components/Radio/Radio.styles/Radio.styles.js +2 -1
  519. package/components/Radio/Radio.styles/Radio.styles.js.map +1 -1
  520. package/components/RadioGroup/RadioGroup/RadioGroup.js +25 -13
  521. package/components/RadioGroup/RadioGroup/RadioGroup.js.map +1 -1
  522. package/components/RadioGroup/RadioGroup.d.ts +9 -0
  523. package/components/ResponsiveLayout/ResponsiveLayout/ResponsiveLayout.js +5 -0
  524. package/components/ResponsiveLayout/ResponsiveLayout/ResponsiveLayout.js.map +1 -1
  525. package/components/ResponsiveLayout/ResponsiveLayoutEvents/ResponsiveLayoutEvents.js +3 -3
  526. package/components/ResponsiveLayout/ResponsiveLayoutEvents/ResponsiveLayoutEvents.js.map +1 -1
  527. package/components/ScrollContainer/ScrollContainer/ScrollContainer.js +6 -1
  528. package/components/ScrollContainer/ScrollContainer/ScrollContainer.js.map +1 -1
  529. package/components/ScrollContainer/ScrollContainer.d.ts +4 -0
  530. package/components/Select/Select/Select.js +35 -15
  531. package/components/Select/Select/Select.js.map +1 -1
  532. package/components/Select/Select.d.ts +3 -0
  533. package/components/SidePage/SidePage/SidePage.js +8 -3
  534. package/components/SidePage/SidePage/SidePage.js.map +1 -1
  535. package/components/SidePage/SidePage.d.ts +4 -0
  536. package/components/SidePage/SidePageBody/SidePageBody.js +10 -6
  537. package/components/SidePage/SidePageBody/SidePageBody.js.map +1 -1
  538. package/components/SidePage/SidePageBody.d.ts +3 -0
  539. package/components/SidePage/SidePageContainer/SidePageContainer.js +10 -6
  540. package/components/SidePage/SidePageContainer/SidePageContainer.js.map +1 -1
  541. package/components/SidePage/SidePageContainer.d.ts +3 -0
  542. package/components/SidePage/SidePageFooter/SidePageFooter.js +10 -6
  543. package/components/SidePage/SidePageFooter/SidePageFooter.js.map +1 -1
  544. package/components/SidePage/SidePageFooter.d.ts +3 -0
  545. package/components/SidePage/SidePageHeader/SidePageHeader.js +12 -7
  546. package/components/SidePage/SidePageHeader/SidePageHeader.js.map +1 -1
  547. package/components/SidePage/SidePageHeader.d.ts +4 -0
  548. package/components/Spinner/Spinner/Spinner.js +14 -6
  549. package/components/Spinner/Spinner/Spinner.js.map +1 -1
  550. package/components/Spinner/Spinner.d.ts +3 -1
  551. package/components/Spinner/SpinnerFallbackAnimation/SpinnerFallbackAnimation.js +18 -4
  552. package/components/Spinner/SpinnerFallbackAnimation/SpinnerFallbackAnimation.js.map +1 -1
  553. package/components/Sticky/Sticky/Sticky.js +4 -0
  554. package/components/Sticky/Sticky/Sticky.js.map +1 -1
  555. package/components/Sticky/Sticky.d.ts +3 -0
  556. package/components/Switcher/Switcher/Switcher.js +4 -0
  557. package/components/Switcher/Switcher/Switcher.js.map +1 -1
  558. package/components/Switcher/Switcher.d.ts +3 -0
  559. package/components/Switcher/Switcher.styles/Switcher.styles.js +1 -1
  560. package/components/Switcher/Switcher.styles/Switcher.styles.js.map +1 -1
  561. package/components/Tabs/Indicator/Indicator.js +2 -0
  562. package/components/Tabs/Indicator/Indicator.js.map +1 -1
  563. package/components/Tabs/Tab/Tab.js +4 -0
  564. package/components/Tabs/Tab/Tab.js.map +1 -1
  565. package/components/Tabs/Tab.d.ts +3 -0
  566. package/components/Tabs/Tabs/Tabs.js +11 -6
  567. package/components/Tabs/Tabs/Tabs.js.map +1 -1
  568. package/components/Tabs/Tabs.d.ts +4 -0
  569. package/components/Textarea/Textarea/Textarea.js +21 -15
  570. package/components/Textarea/Textarea/Textarea.js.map +1 -1
  571. package/components/Textarea/Textarea.d.ts +6 -2
  572. package/components/Textarea/TextareaCounter/TextareaCounter.js +13 -2
  573. package/components/Textarea/TextareaCounter/TextareaCounter.js.map +1 -1
  574. package/components/Textarea/TextareaCounter.d.ts +1 -2
  575. package/components/Toast/Toast/Toast.js +16 -10
  576. package/components/Toast/Toast/Toast.js.map +1 -1
  577. package/components/Toast/Toast.d.ts +6 -0
  578. package/components/Toast/ToastStatic/ToastStatic.js +2 -2
  579. package/components/Toast/ToastStatic/ToastStatic.js.map +1 -1
  580. package/components/Toast/ToastView/ToastView.js +5 -4
  581. package/components/Toast/ToastView/ToastView.js.map +1 -1
  582. package/components/Toast/ToastView.styles/ToastView.styles.js +2 -2
  583. package/components/Toast/ToastView.styles/ToastView.styles.js.map +1 -1
  584. package/components/Toast/ToastView.styles.d.ts +1 -1
  585. package/components/Toggle/Toggle/Toggle.js +8 -4
  586. package/components/Toggle/Toggle/Toggle.js.map +1 -1
  587. package/components/Toggle/Toggle.d.ts +4 -1
  588. package/components/Toggle/Toggle.styles/Toggle.styles.js +3 -4
  589. package/components/Toggle/Toggle.styles/Toggle.styles.js.map +1 -1
  590. package/components/Token/Token/Token.js +16 -1
  591. package/components/Token/Token/Token.js.map +1 -1
  592. package/components/Token/Token.d.ts +3 -0
  593. package/components/Token/Token.styles/Token.styles.js +11 -4
  594. package/components/Token/Token.styles/Token.styles.js.map +1 -1
  595. package/components/TokenInput/TokenInput/TokenInput.js +30 -16
  596. package/components/TokenInput/TokenInput/TokenInput.js.map +1 -1
  597. package/components/TokenInput/TokenInput.d.ts +14 -0
  598. package/components/TokenInput/TokenInput.styles/TokenInput.styles.js +1 -1
  599. package/components/TokenInput/TokenInput.styles/TokenInput.styles.js.map +1 -1
  600. package/components/TokenInput/TokenInputMenu/TokenInputMenu.js +2 -0
  601. package/components/TokenInput/TokenInputMenu/TokenInputMenu.js.map +1 -1
  602. package/components/Tooltip/Tooltip/Tooltip.js +9 -2
  603. package/components/Tooltip/Tooltip/Tooltip.js.map +1 -1
  604. package/components/Tooltip/Tooltip.d.ts +3 -0
  605. package/components/TooltipMenu/TooltipMenu/TooltipMenu.js +18 -12
  606. package/components/TooltipMenu/TooltipMenu/TooltipMenu.js.map +1 -1
  607. package/components/TooltipMenu/TooltipMenu.d.ts +4 -1
  608. package/hooks/useDrop/useDrop.js +5 -1
  609. package/hooks/useDrop/useDrop.js.map +1 -1
  610. package/index.d.ts +2 -0
  611. package/index.js +2 -0
  612. package/index.js.map +1 -1
  613. package/internal/Calendar/Calendar/Calendar.js +13 -5
  614. package/internal/Calendar/Calendar/Calendar.js.map +1 -1
  615. package/internal/Calendar/Calendar.d.ts +6 -0
  616. package/internal/Calendar/CalendarDateShape.d.ts +1 -1
  617. package/internal/Calendar/MonthView/MonthView.js +4 -3
  618. package/internal/Calendar/MonthView/MonthView.js.map +1 -1
  619. package/internal/Calendar/MonthViewModel/MonthViewModel.js +35 -18
  620. package/internal/Calendar/MonthViewModel/MonthViewModel.js.map +1 -1
  621. package/internal/CommonWrapper/CommonWrapper/CommonWrapper.js +7 -8
  622. package/internal/CommonWrapper/CommonWrapper/CommonWrapper.js.map +1 -1
  623. package/internal/CommonWrapper/CommonWrapper.d.ts +1 -0
  624. package/internal/CustomComboBox/ComboBoxMenu/ComboBoxMenu.js +34 -19
  625. package/internal/CustomComboBox/ComboBoxMenu/ComboBoxMenu.js.map +1 -1
  626. package/internal/CustomComboBox/ComboBoxMenu.d.ts +7 -0
  627. package/internal/CustomComboBox/ComboBoxView/ComboBoxView.js +2 -0
  628. package/internal/CustomComboBox/ComboBoxView/ComboBoxView.js.map +1 -1
  629. package/internal/CustomComboBox/CustomComboBox/CustomComboBox.js +21 -17
  630. package/internal/CustomComboBox/CustomComboBox/CustomComboBox.js.map +1 -1
  631. package/internal/CustomComboBox/CustomComboBox.d.ts +3 -0
  632. package/internal/CustomComboBox/CustomComboBoxReducer/CustomComboBoxReducer.js +35 -35
  633. package/internal/CustomComboBox/CustomComboBoxReducer/CustomComboBoxReducer.js.map +1 -1
  634. package/internal/CustomComboBox/CustomComboBoxReducer.d.ts +16 -16
  635. package/internal/DataTids/DATATIDS.md +12 -0
  636. package/internal/DataTids/DataTids/DataTids.js +69 -0
  637. package/internal/DataTids/DataTids/DataTids.js.map +1 -0
  638. package/internal/DataTids/DataTids/package.json +6 -0
  639. package/internal/DataTids/DataTids.d.ts +12 -0
  640. package/internal/DataTids/DataTids.styles/DataTids.styles.js +22 -0
  641. package/internal/DataTids/DataTids.styles/DataTids.styles.js.map +1 -0
  642. package/internal/DataTids/DataTids.styles/package.json +6 -0
  643. package/internal/DataTids/DataTids.styles.d.ts +7 -0
  644. package/internal/DataTids/componentsDataTids/componentsDataTids.js +14 -0
  645. package/internal/DataTids/componentsDataTids/componentsDataTids.js.map +1 -0
  646. package/internal/DataTids/componentsDataTids/package.json +6 -0
  647. package/internal/DataTids/componentsDataTids.d.ts +5 -0
  648. package/internal/DateSelect/DateSelect/DateSelect.js +27 -17
  649. package/internal/DateSelect/DateSelect/DateSelect.js.map +1 -1
  650. package/internal/DateSelect/DateSelect.d.ts +4 -0
  651. package/internal/FileUploaderControl/FileUploaderControlProvider/FileUploaderControlProvider.js +5 -1
  652. package/internal/FileUploaderControl/FileUploaderControlProvider/FileUploaderControlProvider.js.map +1 -1
  653. package/internal/FileUploaderControl/FileUploaderFile/FileUploaderFile/FileUploaderFile.js +12 -5
  654. package/internal/FileUploaderControl/FileUploaderFile/FileUploaderFile/FileUploaderFile.js.map +1 -1
  655. package/internal/FileUploaderControl/FileUploaderFile/FileUploaderFile.d.ts +7 -0
  656. package/internal/FileUploaderControl/FileUploaderFileList/FileUploaderFileList/FileUploaderFileList.js +4 -1
  657. package/internal/FileUploaderControl/FileUploaderFileList/FileUploaderFileList/FileUploaderFileList.js.map +1 -1
  658. package/internal/FileUploaderControl/FileUploaderFileList/FileUploaderFileList.d.ts +3 -0
  659. package/internal/FileUploaderControl/withFileUploaderControlProvider/withFileUploaderControlProvider.js +2 -0
  660. package/internal/FileUploaderControl/withFileUploaderControlProvider/withFileUploaderControlProvider.js.map +1 -1
  661. package/internal/InputLikeText/InputLikeText/InputLikeText.js +8 -2
  662. package/internal/InputLikeText/InputLikeText/InputLikeText.js.map +1 -1
  663. package/internal/InputLikeText/InputLikeText.d.ts +5 -1
  664. package/internal/InternalMenu/InternalMenu/InternalMenu.js +18 -21
  665. package/internal/InternalMenu/InternalMenu/InternalMenu.js.map +1 -1
  666. package/internal/InternalMenu/InternalMenu.d.ts +3 -0
  667. package/internal/InternalMenu/InternalMenu.styles/InternalMenu.styles.js +1 -1
  668. package/internal/InternalMenu/InternalMenu.styles/InternalMenu.styles.js.map +1 -1
  669. package/internal/InternalMenu/addIconPaddingIfPartOfMenu/addIconPaddingIfPartOfMenu.js +14 -0
  670. package/internal/InternalMenu/addIconPaddingIfPartOfMenu/addIconPaddingIfPartOfMenu.js.map +1 -0
  671. package/internal/InternalMenu/addIconPaddingIfPartOfMenu/package.json +6 -0
  672. package/internal/InternalMenu/addIconPaddingIfPartOfMenu.d.ts +2 -0
  673. package/internal/MaskedInput/MaskedInput/MaskedInput.js +14 -3
  674. package/internal/MaskedInput/MaskedInput/MaskedInput.js.map +1 -1
  675. package/internal/MaskedInput/MaskedInput.d.ts +3 -0
  676. package/internal/Menu/Menu/Menu.js +15 -19
  677. package/internal/Menu/Menu/Menu.js.map +1 -1
  678. package/internal/Menu/Menu.d.ts +3 -0
  679. package/internal/Menu/Menu.styles/Menu.styles.js +1 -1
  680. package/internal/Menu/Menu.styles/Menu.styles.js.map +1 -1
  681. package/internal/MobilePopup/MobilePopup/MobilePopup.js +6 -0
  682. package/internal/MobilePopup/MobilePopup/MobilePopup.js.map +1 -1
  683. package/internal/MobilePopup/MobilePopup.d.ts +4 -0
  684. package/internal/Popup/Popup/Popup.js +15 -9
  685. package/internal/Popup/Popup/Popup.js.map +1 -1
  686. package/internal/Popup/Popup.d.ts +6 -0
  687. package/internal/Popup/PopupPin/PopupPin.js +2 -0
  688. package/internal/Popup/PopupPin/PopupPin.js.map +1 -1
  689. package/internal/PopupMenu/PopupMenu/PopupMenu.js +15 -2
  690. package/internal/PopupMenu/PopupMenu/PopupMenu.js.map +1 -1
  691. package/internal/PopupMenu/PopupMenu.d.ts +8 -0
  692. package/internal/PopupMenu/validatePositions/validatePositions.js +6 -6
  693. package/internal/PopupMenu/validatePositions/validatePositions.js.map +1 -1
  694. package/internal/RenderContainer/RenderContainerTypes.d.ts +1 -0
  695. package/internal/RenderContainer/RenderInnerContainer/RenderInnerContainer.js +11 -2
  696. package/internal/RenderContainer/RenderInnerContainer/RenderInnerContainer.js.map +1 -1
  697. package/internal/RenderContainer/RenderInnerContainer.d.ts +9 -1
  698. package/internal/RenderLayer/RenderLayer/RenderLayer.js +5 -1
  699. package/internal/RenderLayer/RenderLayer/RenderLayer.js.map +1 -1
  700. package/internal/ThemePlayground/Playground/Playground.js +15 -29
  701. package/internal/ThemePlayground/Playground/Playground.js.map +1 -1
  702. package/internal/ThemePlayground/SizesGroup/SizesGroup.js +29 -0
  703. package/internal/ThemePlayground/SizesGroup/SizesGroup.js.map +1 -0
  704. package/internal/ThemePlayground/SizesGroup/package.json +6 -0
  705. package/internal/ThemePlayground/SizesGroup.d.ts +4 -0
  706. package/internal/ThemePlayground/ThemeContextPlayground/ThemeContextPlayground.js +14 -2
  707. package/internal/ThemePlayground/ThemeContextPlayground/ThemeContextPlayground.js.map +1 -1
  708. package/internal/ThemePlayground/ThemeContextPlayground.d.ts +4 -0
  709. package/internal/ThemePlayground/ThemeEditor/ThemeEditor.js +5 -1
  710. package/internal/ThemePlayground/ThemeEditor/ThemeEditor.js.map +1 -1
  711. package/internal/ThemePlayground/VariableValue/VariableValue.js +16 -5
  712. package/internal/ThemePlayground/VariableValue/VariableValue.js.map +1 -1
  713. package/internal/ThemePlayground/constants/constants.js +2 -0
  714. package/internal/ThemePlayground/constants/constants.js.map +1 -1
  715. package/internal/ThemePlayground/constants.d.ts +3 -1
  716. package/internal/ThemeShowcase/ThemeShowcase/ThemeShowcase.js +3 -6
  717. package/internal/ThemeShowcase/ThemeShowcase/ThemeShowcase.js.map +1 -1
  718. package/internal/ThemeShowcase/VariablesCollector/VariablesCollector.js +4 -6
  719. package/internal/ThemeShowcase/VariablesCollector/VariablesCollector.js.map +1 -1
  720. package/internal/ThemeShowcase/VariablesCollector.d.ts +1 -1
  721. package/internal/ZIndex/ZIndex/ZIndex.js +23 -8
  722. package/internal/ZIndex/ZIndex/ZIndex.js.map +1 -1
  723. package/internal/ZIndex/ZIndex.d.ts +8 -0
  724. package/internal/ZIndex/ZIndexStorage/ZIndexStorage.js +12 -6
  725. package/internal/ZIndex/ZIndexStorage/ZIndexStorage.js.map +1 -1
  726. package/internal/ZIndex/ZIndexStorage.d.ts +2 -1
  727. package/internal/icons/16px/index/index.js +28 -20
  728. package/internal/icons/16px/index/index.js.map +1 -1
  729. package/internal/icons/16px/index.d.ts +19 -19
  730. package/internal/icons/20px/svg/svg.js +5 -0
  731. package/internal/icons/20px/svg/svg.js.map +1 -1
  732. package/internal/themes/DefaultTheme/DefaultTheme.js +48 -4
  733. package/internal/themes/DefaultTheme/DefaultTheme.js.map +1 -1
  734. package/internal/themes/DefaultTheme.d.ts +20 -1
  735. package/internal/themes/NotFlat/NotFlat.js +15 -0
  736. package/internal/themes/NotFlat/NotFlat.js.map +1 -1
  737. package/internal/themes/NotFlat.d.ts +6 -0
  738. package/internal/themes/Theme2022/Theme2022.js +78 -0
  739. package/internal/themes/Theme2022/Theme2022.js.map +1 -0
  740. package/internal/themes/Theme2022/package.json +6 -0
  741. package/internal/themes/Theme2022.d.ts +66 -0
  742. package/internal/themes/Theme2022Dark/Theme2022Dark.js +17 -0
  743. package/internal/themes/Theme2022Dark/Theme2022Dark.js.map +1 -0
  744. package/internal/themes/Theme2022Dark/package.json +6 -0
  745. package/internal/themes/Theme2022Dark.d.ts +5 -0
  746. package/lib/animation/index/index.js +1 -1
  747. package/lib/animation/index/index.js.map +1 -1
  748. package/lib/animation/index.d.ts +1 -1
  749. package/lib/date/InternalDate/InternalDate.js +16 -1
  750. package/lib/date/InternalDate/InternalDate.js.map +1 -1
  751. package/lib/date/InternalDateCalculator/InternalDateCalculator.js +14 -2
  752. package/lib/date/InternalDateCalculator/InternalDateCalculator.js.map +1 -1
  753. package/lib/date/InternalDateGetter/InternalDateGetter.js +23 -7
  754. package/lib/date/InternalDateGetter/InternalDateGetter.js.map +1 -1
  755. package/lib/date/InternalDateGetter.d.ts +1 -1
  756. package/lib/date/InternalDateTransformer/InternalDateTransformer.js +11 -1
  757. package/lib/date/InternalDateTransformer/InternalDateTransformer.js.map +1 -1
  758. package/lib/date/InternalDateValidator/InternalDateValidator.js +75 -34
  759. package/lib/date/InternalDateValidator/InternalDateValidator.js.map +1 -1
  760. package/lib/date/types/types.js.map +1 -1
  761. package/lib/date/types.d.ts +4 -0
  762. package/lib/events/MouseDrag/MouseDrag.js +5 -1
  763. package/lib/events/MouseDrag/MouseDrag.js.map +1 -1
  764. package/lib/events/keyboard/extractCode/extractCode.js +5 -5
  765. package/lib/events/keyboard/extractCode/extractCode.js.map +1 -1
  766. package/lib/needsPolyfillPlaceholder/needsPolyfillPlaceholder.js +21 -0
  767. package/lib/needsPolyfillPlaceholder/needsPolyfillPlaceholder.js.map +1 -0
  768. package/lib/needsPolyfillPlaceholder/package.json +6 -0
  769. package/lib/needsPolyfillPlaceholder.d.ts +6 -0
  770. package/lib/rootNode/getRootNode/getRootNode.js +36 -8
  771. package/lib/rootNode/getRootNode/getRootNode.js.map +1 -1
  772. package/lib/rootNode/getRootNode.d.ts +9 -0
  773. package/lib/rootNode/rootNodeDecorator/rootNodeDecorator.js +3 -1
  774. package/lib/rootNode/rootNodeDecorator/rootNodeDecorator.js.map +1 -1
  775. package/lib/rootNode/rootNodeDecorator.d.ts +9 -1
  776. package/lib/stringUtils/stringUtils.js +4 -1
  777. package/lib/stringUtils/stringUtils.js.map +1 -1
  778. package/lib/styles/ColorFactory/ColorFactory.js +9 -9
  779. package/lib/styles/ColorFactory/ColorFactory.js.map +1 -1
  780. package/lib/styles/ColorHelpers/ColorHelpers.js +26 -9
  781. package/lib/styles/ColorHelpers/ColorHelpers.js.map +1 -1
  782. package/lib/styles/ColorHelpers.d.ts +1 -0
  783. package/lib/styles/ColorObject/ColorObject.js +2 -2
  784. package/lib/styles/ColorObject/ColorObject.js.map +1 -1
  785. package/lib/styles/getLabGrotesqueBaselineCompensation/getLabGrotesqueBaselineCompensation.js +9 -0
  786. package/lib/styles/getLabGrotesqueBaselineCompensation/getLabGrotesqueBaselineCompensation.js.map +1 -0
  787. package/lib/styles/getLabGrotesqueBaselineCompensation/package.json +6 -0
  788. package/lib/styles/getLabGrotesqueBaselineCompensation.d.ts +1 -0
  789. package/lib/taskWithDelayAndMinimalDuration/taskWithDelayAndMinimalDuration.js +4 -1
  790. package/lib/taskWithDelayAndMinimalDuration/taskWithDelayAndMinimalDuration.js.map +1 -1
  791. package/lib/theming/Emotion/Emotion.js +5 -2
  792. package/lib/theming/Emotion/Emotion.js.map +1 -1
  793. package/lib/theming/ThemeFactory/ThemeFactory.js +5 -2
  794. package/lib/theming/ThemeFactory/ThemeFactory.js.map +1 -1
  795. package/lib/theming/ThemeHelpers/ThemeHelpers.js +5 -1
  796. package/lib/theming/ThemeHelpers/ThemeHelpers.js.map +1 -1
  797. package/lib/theming/themes/Theme2022/Theme2022.js +4 -0
  798. package/lib/theming/themes/Theme2022/Theme2022.js.map +1 -0
  799. package/lib/theming/themes/Theme2022/package.json +6 -0
  800. package/lib/theming/themes/Theme2022.d.ts +1 -0
  801. package/lib/theming/themes/Theme2022Dark/Theme2022Dark.js +5 -0
  802. package/lib/theming/themes/Theme2022Dark/Theme2022Dark.js.map +1 -0
  803. package/lib/theming/themes/Theme2022Dark/package.json +6 -0
  804. package/lib/theming/themes/Theme2022Dark.d.ts +1 -0
  805. package/lib/utils/utils.js +42 -6
  806. package/lib/utils/utils.js.map +1 -1
  807. package/lib/utils.d.ts +15 -0
  808. package/package.json +5 -6
  809. package/cjs/components/Button/Corners.d.ts +0 -6
  810. package/cjs/components/Button/Corners.js +0 -5
  811. package/cjs/components/Button/Corners.js.map +0 -1
  812. package/cjs/lib/polyfillPlaceholder.d.ts +0 -1
  813. package/cjs/lib/polyfillPlaceholder.js +0 -17
  814. package/cjs/lib/polyfillPlaceholder.js.map +0 -1
  815. package/components/Button/Corners/Corners.js +0 -6
  816. package/components/Button/Corners/Corners.js.map +0 -1
  817. package/components/Button/Corners/package.json +0 -6
  818. package/components/Button/Corners.d.ts +0 -6
  819. package/lib/polyfillPlaceholder/package.json +0 -6
  820. package/lib/polyfillPlaceholder/polyfillPlaceholder.js +0 -12
  821. package/lib/polyfillPlaceholder/polyfillPlaceholder.js.map +0 -1
  822. package/lib/polyfillPlaceholder.d.ts +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["SidePageFooter.tsx"],"names":["SidePageFooter","responsiveLayout","rootNode","context","state","fixed","content","layoutSub","update","setProperStyles","refContent","node","wrapper","wrapperRect","contentRect","top","setState","componentDidMount","footerRef","LayoutEvents","addListener","setHasFooter","setHasPanel","props","panel","componentDidUpdate","prevProps","componentWillUnmount","remove","getSticky","sticky","isMobileLayout","render","theme","renderMain","setRootNode","height","getContentHeight","styles","footerWrapper","getWidth","footer","positionStatic","width","footerContent","footerFixed","panelFixed","mobileFooterContent","children","React","Component","__KONTUR_REACT_UI__","contextType","SidePageContext"],"mappings":"0bAAA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,oD;;;;;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OM,aAAP,CAAqB,MAAI,CAACX,KAA1B,CAAH,mBACRK,iBAAOO,WAAP,CAAmB,MAAI,CAACZ,KAAxB,CADQ,IACyB,MAAI,CAAC7B,KAAL,CAAWC,KADpC,OAERiC,iBAAOd,KAAP,CAAa,MAAI,CAACS,KAAlB,CAFQ,IAEmB,CAAC,CAAC,MAAI,CAACV,KAAL,CAAWC,KAFhC,OAGRc,iBAAOQ,UAAP,CAAkB,MAAI,CAACb,KAAvB,CAHQ,IAGwB,CAAC,CAAC,MAAI,CAACV,KAAL,CAAWC,KAAb,IAAsB,MAAI,CAACpB,KAAL,CAAWC,KAHzD,OAIRiC,iBAAOS,mBAAP,CAA2B,MAAI,CAACd,KAAhC,CAJQ,IAIiC,MAAI,CAACF,cAJtC,QADb,EAOE,GAAG,EAAE,MAAI,CAACrB,UAPZ,IASG,MAAI,CAACa,KAAL,CAAWyB,QATd,CARF,CADD,EADH,CADF,CADF,CADF,CA8BD,C;;AAgBOX,EAAAA,gB,GAAR,4BAA2B;AACzB,QAAI,CAAC,KAAK/B,OAAV,EAAmB;AACjB,aAAO,MAAP;AACD;AACD,WAAO,4BAAW,KAAKA,OAAhB,EAAyB8B,MAAhC;AACD,G,yBApHiCa,eAAMC,S,WAC1BC,mB,GAAsB,gB,UAEtBC,W,GAAcC,gC","sourcesContent":["import React from 'react';\n\nimport * as LayoutEvents from '../../lib/LayoutEvents';\nimport { ThemeContext } from '../../lib/theming/ThemeContext';\nimport { Theme } from '../../lib/theming/Theme';\nimport { CommonProps, CommonWrapper } from '../../internal/CommonWrapper';\nimport { cx } from '../../lib/theming/Emotion';\nimport { responsiveLayout } from '../ResponsiveLayout/decorator';\nimport { getRootNode, rootNode, TSetRootNode } from '../../lib/rootNode';\nimport { getDOMRect } from '../../lib/dom/getDOMRect';\n\nimport { styles } from './SidePage.styles';\nimport { SidePageContext, SidePageContextType } from './SidePageContext';\n\nexport interface SidePageFooterProps extends CommonProps {\n children?: React.ReactNode | ((fixed: boolean) => React.ReactNode);\n /**\n * Включает серый цвет в футере\n */\n panel?: boolean;\n sticky?: boolean;\n}\n\n/**\n * Футер сайдпейджа.\n *\n * @visibleName SidePage.Footer\n */\n@responsiveLayout\n@rootNode\nexport class SidePageFooter extends React.Component<SidePageFooterProps> {\n public static __KONTUR_REACT_UI__ = 'SidePageFooter';\n\n public static contextType = SidePageContext;\n public context: SidePageContextType = this.context;\n private isMobileLayout!: boolean;\n\n public state = {\n fixed: false,\n };\n\n private theme!: Theme;\n private content: HTMLElement | null = null;\n private layoutSub: ReturnType<typeof LayoutEvents.addListener> | null = null;\n private setRootNode!: TSetRootNode;\n\n public componentDidMount() {\n this.context.footerRef(this);\n this.update();\n this.layoutSub = LayoutEvents.addListener(this.update);\n this.context.setHasFooter?.();\n this.context.setHasPanel?.(this.props.panel);\n }\n\n public componentDidUpdate(prevProps: Readonly<SidePageFooterProps>) {\n this.props.panel !== prevProps.panel && this.context.setHasPanel?.(this.props.panel);\n }\n\n public componentWillUnmount() {\n this.context.footerRef(null);\n if (this.layoutSub) {\n this.layoutSub.remove();\n }\n this.context.setHasFooter?.(false);\n this.context.setHasPanel?.(false);\n }\n\n public getSticky() {\n if (typeof this.props.sticky !== 'undefined') {\n return this.props.sticky;\n }\n\n if (this.isMobileLayout) {\n return false;\n }\n\n return true;\n }\n\n public render(): JSX.Element {\n return (\n <ThemeContext.Consumer>\n {(theme) => {\n this.theme = theme;\n return this.renderMain();\n }}\n </ThemeContext.Consumer>\n );\n }\n\n public update = () => {\n this.setProperStyles();\n };\n\n private renderMain() {\n return (\n <CommonWrapper rootNodeRef={this.setRootNode} {...this.props}>\n <div style={{ height: this.getContentHeight() }} className={styles.footerWrapper()}>\n <SidePageContext.Consumer>\n {({ getWidth }) => (\n <div\n className={cx(styles.footer(this.theme), {\n [styles.positionStatic()]: !this.getSticky(),\n })}\n style={{\n width: getWidth(),\n }}\n >\n <div\n className={cx(styles.footerContent(this.theme), {\n [styles.footerFixed(this.theme)]: this.state.fixed,\n [styles.panel(this.theme)]: !!this.props.panel,\n [styles.panelFixed(this.theme)]: !!this.props.panel && this.state.fixed,\n [styles.mobileFooterContent(this.theme)]: this.isMobileLayout,\n })}\n ref={this.refContent}\n >\n {this.props.children}\n </div>\n </div>\n )}\n </SidePageContext.Consumer>\n </div>\n </CommonWrapper>\n );\n }\n\n private refContent = (node: HTMLElement | null) => {\n this.content = node;\n };\n\n private setProperStyles = () => {\n const wrapper = getRootNode(this);\n if (wrapper && this.content) {\n const wrapperRect = getDOMRect(wrapper);\n const contentRect = getDOMRect(this.content);\n const fixed = wrapperRect.top > contentRect.top;\n this.setState({ fixed });\n }\n };\n\n private getContentHeight() {\n if (!this.content) {\n return 'auto';\n }\n return getDOMRect(this.content).height;\n }\n}\n"]}
1
+ {"version":3,"sources":["SidePageFooter.tsx"],"names":["SidePageFooterDataTids","root","SidePageFooter","responsiveLayout","rootNode","context","state","fixed","content","layoutSub","update","setProperStyles","refContent","node","wrapper","wrapperRect","contentRect","top","setState","componentDidMount","footerRef","LayoutEvents","addListener","setHasFooter","setHasPanel","props","panel","componentDidUpdate","prevProps","componentWillUnmount","remove","getSticky","sticky","isMobileLayout","render","theme","renderMain","setRootNode","height","getContentHeight","styles","footerWrapper","getWidth","footer","positionStatic","width","footerContent","footerFixed","panelFixed","mobileFooterContent","children","React","Component","__KONTUR_REACT_UI__","contextType","SidePageContext"],"mappings":"2dAAA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,oD;;;;;;;;;;;AAWO,IAAMA,sBAAsB,GAAG;AACpCC,EAAAA,IAAI,EAAE,sBAD8B,EAA/B;;;AAIP;AACA;AACA;AACA;AACA,G;;;AAGaC,c,OAFZC,2B,eACAC,kB;;;;AAKQC,IAAAA,O,GAA+B,MAAKA,O;;;AAGpCC,IAAAA,K,GAAQ;AACbC,MAAAA,KAAK,EAAE,KADM,E;;;;AAKPC,IAAAA,O,GAA8B,I;AAC9BC,IAAAA,S,GAAgE,I;;;;;;;;;;;;;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AAC,CAAC,MAAI,CAACV,KAAL,CAAWC,KAFhC,OAGRc,iBAAOQ,UAAP,CAAkB,MAAI,CAACb,KAAvB,CAHQ,IAGwB,CAAC,CAAC,MAAI,CAACV,KAAL,CAAWC,KAAb,IAAsB,MAAI,CAACpB,KAAL,CAAWC,KAHzD,OAIRiC,iBAAOS,mBAAP,CAA2B,MAAI,CAACd,KAAhC,CAJQ,IAIiC,MAAI,CAACF,cAJtC,QADb,EAOE,GAAG,EAAE,MAAI,CAACrB,UAPZ,IASG,MAAI,CAACa,KAAL,CAAWyB,QATd,CARF,CADD,EADH,CALF,CADF,CADF,CAkCD,C;;AAgBOX,EAAAA,gB,GAAR,4BAA2B;AACzB,QAAI,CAAC,KAAK/B,OAAV,EAAmB;AACjB,aAAO,MAAP;AACD;AACD,WAAO,4BAAW,KAAKA,OAAhB,EAAyB8B,MAAhC;AACD,G,yBAxHiCa,eAAMC,S,WAC1BC,mB,GAAsB,gB,UAEtBC,W,GAAcC,gC","sourcesContent":["import React from 'react';\n\nimport * as LayoutEvents from '../../lib/LayoutEvents';\nimport { ThemeContext } from '../../lib/theming/ThemeContext';\nimport { Theme } from '../../lib/theming/Theme';\nimport { CommonProps, CommonWrapper } from '../../internal/CommonWrapper';\nimport { cx } from '../../lib/theming/Emotion';\nimport { responsiveLayout } from '../ResponsiveLayout/decorator';\nimport { getRootNode, rootNode, TSetRootNode } from '../../lib/rootNode';\nimport { getDOMRect } from '../../lib/dom/getDOMRect';\n\nimport { styles } from './SidePage.styles';\nimport { SidePageContext, SidePageContextType } from './SidePageContext';\n\nexport interface SidePageFooterProps extends CommonProps {\n children?: React.ReactNode | ((fixed: boolean) => React.ReactNode);\n /**\n * Включает серый цвет в футере\n */\n panel?: boolean;\n sticky?: boolean;\n}\n\nexport const SidePageFooterDataTids = {\n root: 'SidePageFooter__root',\n} as const;\n\n/**\n * Футер сайдпейджа.\n *\n * @visibleName SidePage.Footer\n */\n@responsiveLayout\n@rootNode\nexport class SidePageFooter extends React.Component<SidePageFooterProps> {\n public static __KONTUR_REACT_UI__ = 'SidePageFooter';\n\n public static contextType = SidePageContext;\n public context: SidePageContextType = this.context;\n private isMobileLayout!: boolean;\n\n public state = {\n fixed: false,\n };\n\n private theme!: Theme;\n private content: HTMLElement | null = null;\n private layoutSub: ReturnType<typeof LayoutEvents.addListener> | null = null;\n private setRootNode!: TSetRootNode;\n\n public componentDidMount() {\n this.context.footerRef(this);\n this.update();\n this.layoutSub = LayoutEvents.addListener(this.update);\n this.context.setHasFooter?.();\n this.context.setHasPanel?.(this.props.panel);\n }\n\n public componentDidUpdate(prevProps: Readonly<SidePageFooterProps>) {\n this.props.panel !== prevProps.panel && this.context.setHasPanel?.(this.props.panel);\n }\n\n public componentWillUnmount() {\n this.context.footerRef(null);\n if (this.layoutSub) {\n this.layoutSub.remove();\n }\n this.context.setHasFooter?.(false);\n this.context.setHasPanel?.(false);\n }\n\n public getSticky() {\n if (typeof this.props.sticky !== 'undefined') {\n return this.props.sticky;\n }\n\n if (this.isMobileLayout) {\n return false;\n }\n\n return true;\n }\n\n public render(): JSX.Element {\n return (\n <ThemeContext.Consumer>\n {(theme) => {\n this.theme = theme;\n return this.renderMain();\n }}\n </ThemeContext.Consumer>\n );\n }\n\n public update = () => {\n this.setProperStyles();\n };\n\n private renderMain() {\n return (\n <CommonWrapper rootNodeRef={this.setRootNode} {...this.props}>\n <div\n data-tid={SidePageFooterDataTids.root}\n style={{ height: this.getContentHeight() }}\n className={styles.footerWrapper()}\n >\n <SidePageContext.Consumer>\n {({ getWidth }) => (\n <div\n className={cx(styles.footer(this.theme), {\n [styles.positionStatic()]: !this.getSticky(),\n })}\n style={{\n width: getWidth(),\n }}\n >\n <div\n className={cx(styles.footerContent(this.theme), {\n [styles.footerFixed(this.theme)]: this.state.fixed,\n [styles.panel(this.theme)]: !!this.props.panel,\n [styles.panelFixed(this.theme)]: !!this.props.panel && this.state.fixed,\n [styles.mobileFooterContent(this.theme)]: this.isMobileLayout,\n })}\n ref={this.refContent}\n >\n {this.props.children}\n </div>\n </div>\n )}\n </SidePageContext.Consumer>\n </div>\n </CommonWrapper>\n );\n }\n\n private refContent = (node: HTMLElement | null) => {\n this.content = node;\n };\n\n private setProperStyles = () => {\n const wrapper = getRootNode(this);\n if (wrapper && this.content) {\n const wrapperRect = getDOMRect(wrapper);\n const contentRect = getDOMRect(this.content);\n const fixed = wrapperRect.top > contentRect.top;\n this.setState({ fixed });\n }\n };\n\n private getContentHeight() {\n if (!this.content) {\n return 'auto';\n }\n return getDOMRect(this.content).height;\n }\n}\n"]}
@@ -9,6 +9,10 @@ export interface SidePageHeaderState {
9
9
  isReadyToFix: boolean;
10
10
  focusedByTab: boolean;
11
11
  }
12
+ export declare const SidePageHeaderDataTids: {
13
+ readonly root: "SidePageHeader__root";
14
+ readonly close: "SidePage__close";
15
+ };
12
16
  /**
13
17
  * Шапка сайдпейджа
14
18
  *
@@ -1,4 +1,4 @@
1
- "use strict";var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule = true;exports.SidePageHeader = void 0;var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));var _react = _interopRequireDefault(require("react"));
1
+ "use strict";var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule = true;exports.SidePageHeaderDataTids = exports.SidePageHeader = void 0;var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));var _react = _interopRequireDefault(require("react"));
2
2
 
3
3
  var _Sticky = require("../Sticky");
4
4
  var _CrossIcon = require("../../internal/icons/CrossIcon");
@@ -25,11 +25,16 @@ var _SidePageContext = require("./SidePageContext");var _class, _class2, _temp;
25
25
 
26
26
 
27
27
 
28
+ var SidePageHeaderDataTids = {
29
+ root: 'SidePageHeader__root',
30
+ close: 'SidePage__close' };
31
+
32
+
28
33
  /**
29
34
  * Шапка сайдпейджа
30
35
  *
31
36
  * @visibleName SidePage.Header
32
- */var
37
+ */exports.SidePageHeaderDataTids = SidePageHeaderDataTids;var
33
38
 
34
39
 
35
40
  SidePageHeader = (0, _decorator.responsiveLayout)(_class = (0, _rootNode.rootNode)(_class = (_temp = _class2 = /*#__PURE__*/function (_React$Component) {(0, _inheritsLoose2.default)(SidePageHeader, _React$Component);function SidePageHeader() {var _this;for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {args[_key] = arguments[_key];}_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;_this.
@@ -179,7 +184,7 @@ SidePageHeader = (0, _decorator.responsiveLayout)(_class = (0, _rootNode.rootNod
179
184
  onFocus: _this.handleFocus,
180
185
  onBlur: _this.handleBlur,
181
186
  onClick: requestClose,
182
- "data-tid": "SidePage__close",
187
+ "data-tid": SidePageHeaderDataTids.close,
183
188
  tabIndex: 0 }, /*#__PURE__*/
184
189
 
185
190
  _react.default.createElement(_CrossIcon.CrossIcon, null)));}));};_this.
@@ -214,4 +219,4 @@ SidePageHeader = (0, _decorator.responsiveLayout)(_class = (0, _rootNode.rootNod
214
219
 
215
220
  handleBlur = function () {
216
221
  _this.setState({ focusedByTab: false });
217
- };return _this;}var _proto = SidePageHeader.prototype;_proto.render = function render() {var _this2 = this;return /*#__PURE__*/_react.default.createElement(_ThemeContext.ThemeContext.Consumer, null, function (theme) {_this2.theme = theme;return _this2.renderMain();});};_proto.getStickyProp = function getStickyProp() {if (typeof this.props.sticky !== 'undefined') {return this.props.sticky;}if (this.isMobileLayout) {return false;}return true;};_proto.renderMain = function renderMain() {var isReadyToFix = this.state.isReadyToFix;var isStickyDesktop = !this.isMobileLayout && this.getStickyProp() && isReadyToFix;var isStickyMobile = this.isMobileLayout && this.getStickyProp();return /*#__PURE__*/_react.default.createElement(_CommonWrapper.CommonWrapper, (0, _extends2.default)({ rootNodeRef: this.setRootNode }, this.props), /*#__PURE__*/_react.default.createElement("div", { ref: this.wrapperRef, className: _SidePage.styles.headerWrapper() }, isStickyDesktop || isStickyMobile ? /*#__PURE__*/_react.default.createElement(_Sticky.Sticky, { ref: this.stickyRef, side: "top" }, this.renderHeader) : this.renderHeader()));};(0, _createClass2.default)(SidePageHeader, [{ key: "regularHeight", get: function get() {var isReadyToFix = this.state.isReadyToFix;if (!this.wrapper) {return 0;}if (!isReadyToFix) {this.lastRegularHeight = (0, _getDOMRect.getDOMRect)(this.wrapper).height;}return this.lastRegularHeight;} }, { key: "fixedHeaderHeight", get: function get() {var theme = this.theme;return parseInt(theme.sidePageHeaderFixedLineHeight) + parseInt(theme.sidePageHeaderFixedPaddingY) * 2;} }]);return SidePageHeader;}(_react.default.Component), _class2.__KONTUR_REACT_UI__ = 'SidePageHeader', _class2.contextType = _SidePageContext.SidePageContext, _temp)) || _class) || _class;exports.SidePageHeader = SidePageHeader;
222
+ };return _this;}var _proto = SidePageHeader.prototype;_proto.render = function render() {var _this2 = this;return /*#__PURE__*/_react.default.createElement(_ThemeContext.ThemeContext.Consumer, null, function (theme) {_this2.theme = theme;return _this2.renderMain();});};_proto.getStickyProp = function getStickyProp() {if (typeof this.props.sticky !== 'undefined') {return this.props.sticky;}if (this.isMobileLayout) {return false;}return true;};_proto.renderMain = function renderMain() {var isReadyToFix = this.state.isReadyToFix;var isStickyDesktop = !this.isMobileLayout && this.getStickyProp() && isReadyToFix;var isStickyMobile = this.isMobileLayout && this.getStickyProp();return /*#__PURE__*/_react.default.createElement(_CommonWrapper.CommonWrapper, (0, _extends2.default)({ rootNodeRef: this.setRootNode }, this.props), /*#__PURE__*/_react.default.createElement("div", { "data-tid": SidePageHeaderDataTids.root, ref: this.wrapperRef, className: _SidePage.styles.headerWrapper() }, isStickyDesktop || isStickyMobile ? /*#__PURE__*/_react.default.createElement(_Sticky.Sticky, { ref: this.stickyRef, side: "top" }, this.renderHeader) : this.renderHeader()));};(0, _createClass2.default)(SidePageHeader, [{ key: "regularHeight", get: function get() {var isReadyToFix = this.state.isReadyToFix;if (!this.wrapper) {return 0;}if (!isReadyToFix) {this.lastRegularHeight = (0, _getDOMRect.getDOMRect)(this.wrapper).height;}return this.lastRegularHeight;} }, { key: "fixedHeaderHeight", get: function get() {var theme = this.theme;return parseInt(theme.sidePageHeaderFixedLineHeight) + parseInt(theme.sidePageHeaderFixedPaddingY) * 2;} }]);return SidePageHeader;}(_react.default.Component), _class2.__KONTUR_REACT_UI__ = 'SidePageHeader', _class2.contextType = _SidePageContext.SidePageContext, _temp)) || _class) || _class;exports.SidePageHeader = SidePageHeader;
@@ -1 +1 @@
1
- {"version":3,"sources":["SidePageHeader.tsx"],"names":["SidePageHeader","responsiveLayout","rootNode","context","state","isReadyToFix","focusedByTab","wrapper","sticky","lastRegularHeight","componentDidMount","window","addEventListener","update","setHasHeader","headerRef","componentWillUnmount","removeEventListener","reflow","updateReadyToFix","renderHeader","fixed","styles","header","theme","headerFixed","mobileHeader","isMobileLayout","renderClose","title","mobileTitle","titleFixed","props","children","stickyOffset","parseInt","sidePageHeaderStickyOffset","wrapperClose","wrapperCloseFixed","mobileWrapperClose","closeIcon","requestClose","close","closeFocus","handleFocus","handleBlur","wrapperScrolledUp","top","regularHeight","fixedHeaderHeight","setState","wrapperRef","el","stickyRef","requestAnimationFrame","keyListener","isTabPressed","render","renderMain","getStickyProp","isStickyDesktop","isStickyMobile","setRootNode","headerWrapper","height","sidePageHeaderFixedLineHeight","sidePageHeaderFixedPaddingY","React","Component","__KONTUR_REACT_UI__","contextType","SidePageContext"],"mappings":"ohBAAA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,oD;;;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AAcC,gC","sourcesContent":["import React from 'react';\n\nimport { Sticky } from '../Sticky';\nimport { CrossIcon } from '../../internal/icons/CrossIcon';\nimport { isFunction } from '../../lib/utils';\nimport { ThemeContext } from '../../lib/theming/ThemeContext';\nimport { Theme } from '../../lib/theming/Theme';\nimport { CommonProps, CommonWrapper } from '../../internal/CommonWrapper';\nimport { cx } from '../../lib/theming/Emotion';\nimport { keyListener } from '../../lib/events/keyListener';\nimport { responsiveLayout } from '../ResponsiveLayout/decorator';\nimport { rootNode, TSetRootNode } from '../../lib/rootNode';\nimport { getDOMRect } from '../../lib/dom/getDOMRect';\n\nimport { styles } from './SidePage.styles';\nimport { SidePageContext, SidePageContextType } from './SidePageContext';\n\nexport interface SidePageHeaderProps extends CommonProps {\n children?: React.ReactNode | ((fixed: boolean) => React.ReactNode);\n sticky?: boolean;\n}\n\nexport interface SidePageHeaderState {\n isReadyToFix: boolean;\n focusedByTab: boolean;\n}\n\n/**\n * Шапка сайдпейджа\n *\n * @visibleName SidePage.Header\n */\n@responsiveLayout\n@rootNode\nexport class SidePageHeader extends React.Component<SidePageHeaderProps, SidePageHeaderState> {\n public static __KONTUR_REACT_UI__ = 'SidePageHeader';\n\n public static contextType = SidePageContext;\n public context: SidePageContextType = this.context;\n\n private isMobileLayout!: boolean;\n\n public state: SidePageHeaderState = {\n isReadyToFix: false,\n focusedByTab: false,\n };\n\n private theme!: Theme;\n private wrapper: HTMLElement | null = null;\n private sticky: Sticky | null = null;\n private lastRegularHeight = 0;\n private setRootNode!: TSetRootNode;\n\n public get regularHeight(): number {\n const { isReadyToFix } = this.state;\n if (!this.wrapper) {\n return 0;\n }\n if (!isReadyToFix) {\n this.lastRegularHeight = getDOMRect(this.wrapper).height;\n }\n return this.lastRegularHeight;\n }\n\n public get fixedHeaderHeight(): number {\n const { theme } = this;\n return parseInt(theme.sidePageHeaderFixedLineHeight) + parseInt(theme.sidePageHeaderFixedPaddingY) * 2;\n }\n\n public componentDidMount = () => {\n window.addEventListener('scroll', this.update, true);\n this.context.setHasHeader?.();\n this.context.headerRef(this);\n };\n\n public componentWillUnmount = () => {\n window.removeEventListener('scroll', this.update, true);\n this.context.setHasHeader?.(false);\n this.context.headerRef(null);\n };\n\n public update = () => {\n this.sticky?.reflow();\n this.updateReadyToFix();\n };\n\n public render(): JSX.Element {\n return (\n <ThemeContext.Consumer>\n {(theme) => {\n this.theme = theme;\n return this.renderMain();\n }}\n </ThemeContext.Consumer>\n );\n }\n\n public getStickyProp() {\n if (typeof this.props.sticky !== 'undefined') {\n return this.props.sticky;\n }\n\n if (this.isMobileLayout) {\n return false;\n }\n\n return true;\n }\n\n private renderMain() {\n const { isReadyToFix } = this.state;\n\n const isStickyDesktop = !this.isMobileLayout && this.getStickyProp() && isReadyToFix;\n const isStickyMobile = this.isMobileLayout && this.getStickyProp();\n\n return (\n <CommonWrapper rootNodeRef={this.setRootNode} {...this.props}>\n <div ref={this.wrapperRef} className={styles.headerWrapper()}>\n {isStickyDesktop || isStickyMobile ? (\n <Sticky ref={this.stickyRef} side=\"top\">\n {this.renderHeader}\n </Sticky>\n ) : (\n this.renderHeader()\n )}\n </div>\n </CommonWrapper>\n );\n }\n\n private renderHeader = (fixed = false) => {\n return (\n <div\n className={cx(styles.header(this.theme), {\n [styles.headerFixed(this.theme)]: fixed,\n [styles.mobileHeader(this.theme)]: this.isMobileLayout,\n })}\n >\n {this.renderClose(fixed)}\n <div\n className={cx(styles.title(this.theme), {\n [styles.mobileTitle(this.theme)]: this.isMobileLayout,\n [styles.titleFixed()]: fixed,\n })}\n >\n {isFunction(this.props.children) ? this.props.children(fixed) : this.props.children}\n </div>\n </div>\n );\n };\n\n private renderClose = (fixed: boolean) => {\n const stickyOffset = parseInt(this.theme.sidePageHeaderStickyOffset);\n return (\n <div\n className={cx(styles.wrapperClose(this.theme), {\n [styles.wrapperCloseFixed(this.theme)]: fixed,\n [styles.mobileWrapperClose(this.theme)]: this.isMobileLayout,\n })}\n >\n {this.isMobileLayout ? (\n this.closeIcon\n ) : (\n <Sticky side=\"top\" offset={stickyOffset}>\n {this.closeIcon}\n </Sticky>\n )}\n </div>\n );\n };\n\n private closeIcon = () => (\n <SidePageContext.Consumer>\n {({ requestClose }) => (\n <button\n className={cx(styles.close(this.theme), {\n [styles.closeFocus(this.theme)]: this.state.focusedByTab,\n })}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n onClick={requestClose}\n data-tid=\"SidePage__close\"\n tabIndex={0}\n >\n <CrossIcon />\n </button>\n )}\n </SidePageContext.Consumer>\n );\n\n private updateReadyToFix = () => {\n if (this.wrapper) {\n const wrapperScrolledUp = getDOMRect(this.wrapper).top;\n const isReadyToFix = this.regularHeight + wrapperScrolledUp <= this.fixedHeaderHeight;\n this.setState((state) => (state.isReadyToFix !== isReadyToFix ? { ...state, isReadyToFix } : state));\n }\n };\n\n private wrapperRef = (el: HTMLElement | null) => {\n this.wrapper = el;\n };\n\n private stickyRef = (el: Sticky | null) => {\n this.sticky = el;\n };\n\n private handleFocus = () => {\n requestAnimationFrame(() => {\n if (keyListener.isTabPressed) {\n this.setState({ focusedByTab: true });\n }\n });\n };\n\n private handleBlur = () => {\n this.setState({ focusedByTab: false });\n };\n}\n"]}
1
+ {"version":3,"sources":["SidePageHeader.tsx"],"names":["SidePageHeaderDataTids","root","close","SidePageHeader","responsiveLayout","rootNode","context","state","isReadyToFix","focusedByTab","wrapper","sticky","lastRegularHeight","componentDidMount","window","addEventListener","update","setHasHeader","headerRef","componentWillUnmount","removeEventListener","reflow","updateReadyToFix","renderHeader","fixed","styles","header","theme","headerFixed","mobileHeader","isMobileLayout","renderClose","title","mobileTitle","titleFixed","props","children","stickyOffset","parseInt","sidePageHeaderStickyOffset","wrapperClose","wrapperCloseFixed","mobileWrapperClose","closeIcon","requestClose","closeFocus","handleFocus","handleBlur","wrapperScrolledUp","top","regularHeight","fixedHeaderHeight","setState","wrapperRef","el","stickyRef","requestAnimationFrame","keyListener","isTabPressed","render","renderMain","getStickyProp","isStickyDesktop","isStickyMobile","setRootNode","headerWrapper","height","sidePageHeaderFixedLineHeight","sidePageHeaderFixedPaddingY","React","Component","__KONTUR_REACT_UI__","contextType","SidePageContext"],"mappings":"qjBAAA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,oD;;;;;;;;;;;;AAYO,IAAMA,sBAAsB,GAAG;AACpCC,EAAAA,IAAI,EAAE,sBAD8B;AAEpCC,EAAAA,KAAK,EAAE,iBAF6B,EAA/B;;;AAKP;AACA;AACA;AACA;AACA,G;;;AAGaC,c,OAFZC,2B,eACAC,kB;;;;AAKQC,IAAAA,O,GAA+B,MAAKA,O;;;;AAIpCC,IAAAA,K,GAA6B;AAClCC,MAAAA,YAAY,EAAE,KADoB;AAElCC,MAAAA,YAAY,EAAE,KAFoB,E;;;;AAM5BC,IAAAA,O,GAA8B,I;AAC9BC,IAAAA,M,GAAwB,I;AACxBC,IAAAA,iB,GAAoB,C;;;;;;;;;;;;;;;;;;;AAmBrBC,IAAAA,iB,GAAoB,YAAM;AAC/BC,MAAAA,MAAM,CAACC,gBAAP,CAAwB,QAAxB,EAAkC,MAAKC,MAAvC,EAA+C,IAA/C;AACA,YAAKV,OAAL,CAAaW,YAAb,0BAAKX,OAAL,CAAaW,YAAb;AACA,YAAKX,OAAL,CAAaY,SAAb;AACD,K;;AAEMC,IAAAA,oB,GAAuB,YAAM;AAClCL,MAAAA,MAAM,CAACM,mBAAP,CAA2B,QAA3B,EAAqC,MAAKJ,MAA1C,EAAkD,IAAlD;AACA,YAAKV,OAAL,CAAaW,YAAb,0BAAKX,OAAL,CAAaW,YAAb,CAA4B,KAA5B;AACA,YAAKX,OAAL,CAAaY,SAAb,CAAuB,IAAvB;AACD,K;;AAEMF,IAAAA,M,GAAS,YAAM;AACpB,4BAAKL,MAAL,kCAAaU,MAAb;AACA,YAAKC,gBAAL;AACD,K;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8COC,I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,YAAL,EAAmB,CACjB,KAAKI,iBAAL,GAAyB,4BAAW,KAAKF,OAAhB,EAAyBwD,MAAlD,CACD,CACD,OAAO,KAAKtD,iBAAZ,CACD,C,qCAED,eAAuC,CACrC,IAAQe,KAAR,GAAkB,IAAlB,CAAQA,KAAR,CACA,OAAOW,QAAQ,CAACX,KAAK,CAACwC,6BAAP,CAAR,GAAgD7B,QAAQ,CAACX,KAAK,CAACyC,2BAAP,CAAR,GAA8C,CAArG,CACD,C,6BAjCiCC,eAAMC,S,WAC1BC,mB,GAAsB,gB,UAEtBC,W,GAAcC,gC","sourcesContent":["import React from 'react';\n\nimport { Sticky } from '../Sticky';\nimport { CrossIcon } from '../../internal/icons/CrossIcon';\nimport { isFunction } from '../../lib/utils';\nimport { ThemeContext } from '../../lib/theming/ThemeContext';\nimport { Theme } from '../../lib/theming/Theme';\nimport { CommonProps, CommonWrapper } from '../../internal/CommonWrapper';\nimport { cx } from '../../lib/theming/Emotion';\nimport { keyListener } from '../../lib/events/keyListener';\nimport { responsiveLayout } from '../ResponsiveLayout/decorator';\nimport { rootNode, TSetRootNode } from '../../lib/rootNode';\nimport { getDOMRect } from '../../lib/dom/getDOMRect';\n\nimport { styles } from './SidePage.styles';\nimport { SidePageContext, SidePageContextType } from './SidePageContext';\n\nexport interface SidePageHeaderProps extends CommonProps {\n children?: React.ReactNode | ((fixed: boolean) => React.ReactNode);\n sticky?: boolean;\n}\n\nexport interface SidePageHeaderState {\n isReadyToFix: boolean;\n focusedByTab: boolean;\n}\n\nexport const SidePageHeaderDataTids = {\n root: 'SidePageHeader__root',\n close: 'SidePage__close',\n} as const;\n\n/**\n * Шапка сайдпейджа\n *\n * @visibleName SidePage.Header\n */\n@responsiveLayout\n@rootNode\nexport class SidePageHeader extends React.Component<SidePageHeaderProps, SidePageHeaderState> {\n public static __KONTUR_REACT_UI__ = 'SidePageHeader';\n\n public static contextType = SidePageContext;\n public context: SidePageContextType = this.context;\n\n private isMobileLayout!: boolean;\n\n public state: SidePageHeaderState = {\n isReadyToFix: false,\n focusedByTab: false,\n };\n\n private theme!: Theme;\n private wrapper: HTMLElement | null = null;\n private sticky: Sticky | null = null;\n private lastRegularHeight = 0;\n private setRootNode!: TSetRootNode;\n\n public get regularHeight(): number {\n const { isReadyToFix } = this.state;\n if (!this.wrapper) {\n return 0;\n }\n if (!isReadyToFix) {\n this.lastRegularHeight = getDOMRect(this.wrapper).height;\n }\n return this.lastRegularHeight;\n }\n\n public get fixedHeaderHeight(): number {\n const { theme } = this;\n return parseInt(theme.sidePageHeaderFixedLineHeight) + parseInt(theme.sidePageHeaderFixedPaddingY) * 2;\n }\n\n public componentDidMount = () => {\n window.addEventListener('scroll', this.update, true);\n this.context.setHasHeader?.();\n this.context.headerRef(this);\n };\n\n public componentWillUnmount = () => {\n window.removeEventListener('scroll', this.update, true);\n this.context.setHasHeader?.(false);\n this.context.headerRef(null);\n };\n\n public update = () => {\n this.sticky?.reflow();\n this.updateReadyToFix();\n };\n\n public render(): JSX.Element {\n return (\n <ThemeContext.Consumer>\n {(theme) => {\n this.theme = theme;\n return this.renderMain();\n }}\n </ThemeContext.Consumer>\n );\n }\n\n public getStickyProp() {\n if (typeof this.props.sticky !== 'undefined') {\n return this.props.sticky;\n }\n\n if (this.isMobileLayout) {\n return false;\n }\n\n return true;\n }\n\n private renderMain() {\n const { isReadyToFix } = this.state;\n\n const isStickyDesktop = !this.isMobileLayout && this.getStickyProp() && isReadyToFix;\n const isStickyMobile = this.isMobileLayout && this.getStickyProp();\n\n return (\n <CommonWrapper rootNodeRef={this.setRootNode} {...this.props}>\n <div data-tid={SidePageHeaderDataTids.root} ref={this.wrapperRef} className={styles.headerWrapper()}>\n {isStickyDesktop || isStickyMobile ? (\n <Sticky ref={this.stickyRef} side=\"top\">\n {this.renderHeader}\n </Sticky>\n ) : (\n this.renderHeader()\n )}\n </div>\n </CommonWrapper>\n );\n }\n\n private renderHeader = (fixed = false) => {\n return (\n <div\n className={cx(styles.header(this.theme), {\n [styles.headerFixed(this.theme)]: fixed,\n [styles.mobileHeader(this.theme)]: this.isMobileLayout,\n })}\n >\n {this.renderClose(fixed)}\n <div\n className={cx(styles.title(this.theme), {\n [styles.mobileTitle(this.theme)]: this.isMobileLayout,\n [styles.titleFixed()]: fixed,\n })}\n >\n {isFunction(this.props.children) ? this.props.children(fixed) : this.props.children}\n </div>\n </div>\n );\n };\n\n private renderClose = (fixed: boolean) => {\n const stickyOffset = parseInt(this.theme.sidePageHeaderStickyOffset);\n return (\n <div\n className={cx(styles.wrapperClose(this.theme), {\n [styles.wrapperCloseFixed(this.theme)]: fixed,\n [styles.mobileWrapperClose(this.theme)]: this.isMobileLayout,\n })}\n >\n {this.isMobileLayout ? (\n this.closeIcon\n ) : (\n <Sticky side=\"top\" offset={stickyOffset}>\n {this.closeIcon}\n </Sticky>\n )}\n </div>\n );\n };\n\n private closeIcon = () => (\n <SidePageContext.Consumer>\n {({ requestClose }) => (\n <button\n className={cx(styles.close(this.theme), {\n [styles.closeFocus(this.theme)]: this.state.focusedByTab,\n })}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n onClick={requestClose}\n data-tid={SidePageHeaderDataTids.close}\n tabIndex={0}\n >\n <CrossIcon />\n </button>\n )}\n </SidePageContext.Consumer>\n );\n\n private updateReadyToFix = () => {\n if (this.wrapper) {\n const wrapperScrolledUp = getDOMRect(this.wrapper).top;\n const isReadyToFix = this.regularHeight + wrapperScrolledUp <= this.fixedHeaderHeight;\n this.setState((state) => (state.isReadyToFix !== isReadyToFix ? { ...state, isReadyToFix } : state));\n }\n };\n\n private wrapperRef = (el: HTMLElement | null) => {\n this.wrapper = el;\n };\n\n private stickyRef = (el: Sticky | null) => {\n this.sticky = el;\n };\n\n private handleFocus = () => {\n requestAnimationFrame(() => {\n if (keyListener.isTabPressed) {\n this.setState({ focusedByTab: true });\n }\n });\n };\n\n private handleBlur = () => {\n this.setState({ focusedByTab: false });\n };\n}\n"]}
@@ -21,6 +21,9 @@ export interface SpinnerProps extends CommonProps {
21
21
  */
22
22
  color?: React.CSSProperties['color'];
23
23
  }
24
+ export declare const SpinnerDataTids: {
25
+ readonly root: "Spinner__root";
26
+ };
24
27
  /**
25
28
  * DRAFT - инлайн-лоадер
26
29
  */
@@ -48,7 +51,6 @@ export declare class Spinner extends React.Component<SpinnerProps> {
48
51
  private theme;
49
52
  private readonly locale;
50
53
  private setRootNode;
51
- constructor(props: SpinnerProps);
52
54
  render(): JSX.Element;
53
55
  private renderMain;
54
56
  private renderSpinner;
@@ -1,4 +1,4 @@
1
- "use strict";var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule = true;exports.Spinner = void 0;var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));var _react = _interopRequireDefault(require("react"));
1
+ "use strict";var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule = true;exports.SpinnerDataTids = exports.Spinner = void 0;var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));var _react = _interopRequireDefault(require("react"));
2
2
  var _propTypes = _interopRequireDefault(require("prop-types"));
3
3
 
4
4
  var _decorators = require("../../lib/locale/decorators");
@@ -39,15 +39,17 @@ var types = {
39
39
 
40
40
 
41
41
 
42
- /**
43
- * DRAFT - инлайн-лоадер
44
- */var
42
+ var SpinnerDataTids = {
43
+ root: 'Spinner__root' };
45
44
 
46
45
 
46
+ /**
47
+ * DRAFT - инлайн-лоадер
48
+ */exports.SpinnerDataTids = SpinnerDataTids;var
47
49
 
48
- Spinner = (_dec = (0, _decorators.locale)('Spinner', _locale.SpinnerLocaleHelper), (0, _rootNode.rootNode)(_class = _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_React$Component) {(0, _inheritsLoose2.default)(Spinner, _React$Component);
49
50
 
50
51
 
52
+ Spinner = (_dec = (0, _decorators.locale)('Spinner', _locale.SpinnerLocaleHelper), (0, _rootNode.rootNode)(_class = _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_React$Component) {(0, _inheritsLoose2.default)(Spinner, _React$Component);function Spinner() {var _this;for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {args[_key] = arguments[_key];}_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;_this.
51
53
 
52
54
 
53
55
 
@@ -77,8 +79,6 @@ Spinner = (_dec = (0, _decorators.locale)('Spinner', _locale.SpinnerLocaleHelper
77
79
 
78
80
 
79
81
 
80
- function Spinner(props) {var _this;
81
- _this = _React$Component.call(this, props) || this;_this.
82
82
 
83
83
 
84
84
 
@@ -123,7 +123,7 @@ Spinner = (_dec = (0, _decorators.locale)('Spinner', _locale.SpinnerLocaleHelper
123
123
  };_this.
124
124
 
125
125
  renderCaption = function (type, caption) {return /*#__PURE__*/(
126
- _react.default.createElement("span", { className: (0, _Emotion.cx)(_Spinner.styles[type](_this.theme), _Spinner.styles.captionColor(_this.theme)) }, caption));};return _this;}var _proto = Spinner.prototype;_proto.render = function render() {var _this2 = this;return /*#__PURE__*/_react.default.createElement(_ThemeContext.ThemeContext.Consumer, null, function (theme) {_this2.theme = theme;return _this2.renderMain();});};_proto.renderMain = function renderMain() {var _this$props = this.props,type = _this$props.type,_this$props$caption = _this$props.caption,caption = _this$props$caption === void 0 ? this.locale.loading : _this$props$caption,dimmed = _this$props.dimmed,inline = _this$props.inline;return /*#__PURE__*/_react.default.createElement(_CommonWrapper.CommonWrapper, (0, _extends2.default)({ rootNodeRef: this.setRootNode }, this.props), /*#__PURE__*/_react.default.createElement("div", { className: _Spinner.styles.spinner() }, /*#__PURE__*/_react.default.createElement("span", { className: _Spinner.styles.inner() }, this.renderSpinner(type, dimmed, inline)), caption && this.renderCaption(type, caption)));};return Spinner;}(_react.default.Component), _class2.__KONTUR_REACT_UI__ = 'Spinner', _class2.propTypes = { /**
126
+ _react.default.createElement("span", { className: (0, _Emotion.cx)(_Spinner.styles[type](_this.theme), _Spinner.styles.captionColor(_this.theme)) }, caption));};return _this;}var _proto = Spinner.prototype;_proto.render = function render() {var _this2 = this;return /*#__PURE__*/_react.default.createElement(_ThemeContext.ThemeContext.Consumer, null, function (theme) {_this2.theme = theme;return _this2.renderMain();});};_proto.renderMain = function renderMain() {var _this$props = this.props,type = _this$props.type,_this$props$caption = _this$props.caption,caption = _this$props$caption === void 0 ? this.locale.loading : _this$props$caption,dimmed = _this$props.dimmed,inline = _this$props.inline;return /*#__PURE__*/_react.default.createElement(_CommonWrapper.CommonWrapper, (0, _extends2.default)({ rootNodeRef: this.setRootNode }, this.props), /*#__PURE__*/_react.default.createElement("div", { "data-tid": SpinnerDataTids.root, className: _Spinner.styles.spinner() }, /*#__PURE__*/_react.default.createElement("span", { className: _Spinner.styles.inner() }, this.renderSpinner(type, dimmed, inline)), caption && this.renderCaption(type, caption)));};return Spinner;}(_react.default.Component), _class2.__KONTUR_REACT_UI__ = 'Spinner', _class2.propTypes = { /**
127
127
  * Текст рядом с мини-лоадером.
128
128
  *
129
129
  * 'Загрузка' - значение по-умолчанию
@@ -1 +1 @@
1
- {"version":3,"sources":["Spinner.tsx"],"names":["types","big","mini","normal","Spinner","SpinnerLocaleHelper","rootNode","props","renderSpinner","type","dimmed","inline","styles","circle","theme","color","circleDimmedColor","circleWithoutColorAnimation","width","renderCaption","caption","captionColor","render","renderMain","locale","loading","setRootNode","spinner","inner","React","Component","__KONTUR_REACT_UI__","propTypes","PropTypes","node","bool","oneOf","Object","keys","defaultProps","Types"],"mappings":"qUAAA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,kC;;AAEA,IAAMA,KAAuC,GAAG;AAC9CC,EAAAA,GAAG,EAAE,KADyC;AAE9CC,EAAAA,IAAI,EAAE,MAFwC;AAG9CC,EAAAA,MAAM,EAAE,QAHsC,EAAhD;;;;;;;;;;;;;;;;;;;;;;;;AA2BA;AACA;AACA,G;;;;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,CAQD,C,QAEOA,U,GAAR,sBAAqB,CACnB,kBAAgE,KAAKhB,KAArE,CAAQE,IAAR,eAAQA,IAAR,mCAAcW,OAAd,CAAcA,OAAd,oCAAwB,KAAKI,MAAL,CAAYC,OAApC,uBAA6Cf,MAA7C,eAA6CA,MAA7C,CAAqDC,MAArD,eAAqDA,MAArD,CAEA,oBACE,6BAAC,4BAAD,2BAAe,WAAW,EAAE,KAAKe,WAAjC,IAAkD,KAAKnB,KAAvD,gBACE,sCAAK,SAAS,EAAEK,gBAAOe,OAAP,EAAhB,iBACE,uCAAM,SAAS,EAAEf,gBAAOgB,KAAP,EAAjB,IAAkC,KAAKpB,aAAL,CAAmBC,IAAnB,EAAyBC,MAAzB,EAAiCC,MAAjC,CAAlC,CADF,EAEGS,OAAO,IAAI,KAAKD,aAAL,CAAmBV,IAAnB,EAAyBW,OAAzB,CAFd,CADF,CADF,CAQD,C,kBA1D0BS,eAAMC,S,WACnBC,mB,GAAsB,S,UAEtBC,S,GAAY,EACxB;AACJ;AACA;AACA;AACA,KACIZ,OAAO,EAAEa,mBAAUC,IANK,EAQxBxB,MAAM,EAAEuB,mBAAUE,IARM,EAUxB;AACJ;AACA;AACA;AACA;AACA;AACA,KACI1B,IAAI,EAAEwB,mBAAUG,KAAV,CAAgBC,MAAM,CAACC,IAAP,CAAYtC,KAAZ,CAAhB,CAjBkB,E,UAoBZuC,Y,GAA6B,EACzC9B,IAAI,EAAE,QADmC,E,UAI7B+B,K,GAAsBxC,K","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport { locale } from '../../lib/locale/decorators';\nimport { Theme } from '../../lib/theming/Theme';\nimport { ThemeContext } from '../../lib/theming/ThemeContext';\nimport { SpinnerIcon } from '../../internal/icons/SpinnerIcon';\nimport { CommonProps, CommonWrapper } from '../../internal/CommonWrapper';\nimport { cx } from '../../lib/theming/Emotion';\nimport { rootNode, TSetRootNode } from '../../lib/rootNode';\n\nimport { styles } from './Spinner.styles';\nimport { SpinnerLocale, SpinnerLocaleHelper } from './locale';\n\nconst types: Record<SpinnerType, SpinnerType> = {\n big: 'big',\n mini: 'mini',\n normal: 'normal',\n};\n\nexport type SpinnerType = 'mini' | 'normal' | 'big';\n\nexport interface SpinnerProps extends CommonProps {\n caption?: React.ReactNode;\n dimmed?: boolean;\n /**\n * Тип спиннера\n * @default normal\n */\n type: SpinnerType;\n inline?: boolean;\n /**\n * Толщина спиннера\n */\n width?: number;\n /**\n * Цвет спиннера\n */\n color?: React.CSSProperties['color'];\n}\n\n/**\n * DRAFT - инлайн-лоадер\n */\n\n@rootNode\n@locale('Spinner', SpinnerLocaleHelper)\nexport class Spinner extends React.Component<SpinnerProps> {\n public static __KONTUR_REACT_UI__ = 'Spinner';\n\n public static propTypes = {\n /**\n * Текст рядом с мини-лоадером.\n *\n * 'Загрузка' - значение по-умолчанию\n */\n caption: PropTypes.node,\n\n dimmed: PropTypes.bool,\n\n /**\n * Тип спиннера: mini, normal, big\n *\n * Значение по-умолчанию - normal\n *\n * Spinner.types - все доступные типы\n */\n type: PropTypes.oneOf(Object.keys(types)),\n };\n\n public static defaultProps: SpinnerProps = {\n type: 'normal',\n };\n\n public static Types: typeof types = types;\n private theme!: Theme;\n private readonly locale!: SpinnerLocale;\n private setRootNode!: TSetRootNode;\n\n constructor(props: SpinnerProps) {\n super(props);\n }\n\n public render() {\n return (\n <ThemeContext.Consumer>\n {(theme) => {\n this.theme = theme;\n return this.renderMain();\n }}\n </ThemeContext.Consumer>\n );\n }\n\n private renderMain() {\n const { type, caption = this.locale.loading, dimmed, inline } = this.props;\n\n return (\n <CommonWrapper rootNodeRef={this.setRootNode} {...this.props}>\n <div className={styles.spinner()}>\n <span className={styles.inner()}>{this.renderSpinner(type, dimmed, inline)}</span>\n {caption && this.renderCaption(type, caption)}\n </div>\n </CommonWrapper>\n );\n }\n\n private renderSpinner = (type: SpinnerType, dimmed?: boolean, inline?: boolean) => {\n return (\n <SpinnerIcon\n size={type}\n className={cx({\n [styles.circle(this.theme)]: !dimmed && !this.props.color,\n [styles.circleDimmedColor(this.theme)]: dimmed,\n [styles.circleWithoutColorAnimation(this.theme)]: dimmed || !!this.props.color,\n })}\n dimmed={dimmed}\n width={this.props.width}\n color={this.props.color}\n inline={inline}\n />\n );\n };\n\n private renderCaption = (type: SpinnerType, caption: React.ReactNode) => (\n <span className={cx(styles[type](this.theme), styles.captionColor(this.theme))}>{caption}</span>\n );\n}\n"]}
1
+ {"version":3,"sources":["Spinner.tsx"],"names":["types","big","mini","normal","SpinnerDataTids","root","Spinner","SpinnerLocaleHelper","rootNode","renderSpinner","type","dimmed","inline","styles","circle","theme","props","color","circleDimmedColor","circleWithoutColorAnimation","width","renderCaption","caption","captionColor","render","renderMain","locale","loading","setRootNode","spinner","inner","React","Component","__KONTUR_REACT_UI__","propTypes","PropTypes","node","bool","oneOf","Object","keys","defaultProps","Types"],"mappings":"+VAAA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,kC;;AAEA,IAAMA,KAAuC,GAAG;AAC9CC,EAAAA,GAAG,EAAE,KADyC;AAE9CC,EAAAA,IAAI,EAAE,MAFwC;AAG9CC,EAAAA,MAAM,EAAE,QAHsC,EAAhD;;;;;;;;;;;;;;;;;;;;;;;;AA2BO,IAAMC,eAAe,GAAG;AAC7BC,EAAAA,IAAI,EAAE,eADuB,EAAxB;;;AAIP;AACA;AACA,G;;;;AAIaC,O,WADZ,wBAAO,SAAP,EAAkBC,2BAAlB,C,MADAC,kB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0DSC,IAAAA,a,GAAgB,UAACC,IAAD,EAAoBC,MAApB,EAAsCC,MAAtC,EAA2D;AACjF;AACE,qCAAC,wBAAD;AACE,UAAA,IAAI,EAAEF,IADR;AAEE,UAAA,SAAS,EAAE;AACRG,0BAAOC,MAAP,CAAc,MAAKC,KAAnB,CADQ,IACoB,CAACJ,MAAD,IAAW,CAAC,MAAKK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AmBC,IAAnB,EAAyBC,MAAzB,EAAiCC,MAAjC,CAAlC,CADF,EAEGU,OAAO,IAAI,KAAKD,aAAL,CAAmBX,IAAnB,EAAyBY,OAAzB,CAFd,CADF,CADF,CAQD,C,kBAtD0BS,eAAMC,S,WACnBC,mB,GAAsB,S,UAEtBC,S,GAAY,EACxB;AACJ;AACA;AACA;AACA,KACIZ,OAAO,EAAEa,mBAAUC,IANK,EAQxBzB,MAAM,EAAEwB,mBAAUE,IARM,EAUxB;AACJ;AACA;AACA;AACA;AACA;AACA,KACI3B,IAAI,EAAEyB,mBAAUG,KAAV,CAAgBC,MAAM,CAACC,IAAP,CAAYxC,KAAZ,CAAhB,CAjBkB,E,UAoBZyC,Y,GAA6B,EACzC/B,IAAI,EAAE,QADmC,E,UAI7BgC,K,GAAsB1C,K","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport { locale } from '../../lib/locale/decorators';\nimport { Theme } from '../../lib/theming/Theme';\nimport { ThemeContext } from '../../lib/theming/ThemeContext';\nimport { SpinnerIcon } from '../../internal/icons/SpinnerIcon';\nimport { CommonProps, CommonWrapper } from '../../internal/CommonWrapper';\nimport { cx } from '../../lib/theming/Emotion';\nimport { rootNode, TSetRootNode } from '../../lib/rootNode';\n\nimport { styles } from './Spinner.styles';\nimport { SpinnerLocale, SpinnerLocaleHelper } from './locale';\n\nconst types: Record<SpinnerType, SpinnerType> = {\n big: 'big',\n mini: 'mini',\n normal: 'normal',\n};\n\nexport type SpinnerType = 'mini' | 'normal' | 'big';\n\nexport interface SpinnerProps extends CommonProps {\n caption?: React.ReactNode;\n dimmed?: boolean;\n /**\n * Тип спиннера\n * @default normal\n */\n type: SpinnerType;\n inline?: boolean;\n /**\n * Толщина спиннера\n */\n width?: number;\n /**\n * Цвет спиннера\n */\n color?: React.CSSProperties['color'];\n}\n\nexport const SpinnerDataTids = {\n root: 'Spinner__root',\n} as const;\n\n/**\n * DRAFT - инлайн-лоадер\n */\n\n@rootNode\n@locale('Spinner', SpinnerLocaleHelper)\nexport class Spinner extends React.Component<SpinnerProps> {\n public static __KONTUR_REACT_UI__ = 'Spinner';\n\n public static propTypes = {\n /**\n * Текст рядом с мини-лоадером.\n *\n * 'Загрузка' - значение по-умолчанию\n */\n caption: PropTypes.node,\n\n dimmed: PropTypes.bool,\n\n /**\n * Тип спиннера: mini, normal, big\n *\n * Значение по-умолчанию - normal\n *\n * Spinner.types - все доступные типы\n */\n type: PropTypes.oneOf(Object.keys(types)),\n };\n\n public static defaultProps: SpinnerProps = {\n type: 'normal',\n };\n\n public static Types: typeof types = types;\n private theme!: Theme;\n private readonly locale!: SpinnerLocale;\n private setRootNode!: TSetRootNode;\n\n public render() {\n return (\n <ThemeContext.Consumer>\n {(theme) => {\n this.theme = theme;\n return this.renderMain();\n }}\n </ThemeContext.Consumer>\n );\n }\n\n private renderMain() {\n const { type, caption = this.locale.loading, dimmed, inline } = this.props;\n\n return (\n <CommonWrapper rootNodeRef={this.setRootNode} {...this.props}>\n <div data-tid={SpinnerDataTids.root} className={styles.spinner()}>\n <span className={styles.inner()}>{this.renderSpinner(type, dimmed, inline)}</span>\n {caption && this.renderCaption(type, caption)}\n </div>\n </CommonWrapper>\n );\n }\n\n private renderSpinner = (type: SpinnerType, dimmed?: boolean, inline?: boolean) => {\n return (\n <SpinnerIcon\n size={type}\n className={cx({\n [styles.circle(this.theme)]: !dimmed && !this.props.color,\n [styles.circleDimmedColor(this.theme)]: dimmed,\n [styles.circleWithoutColorAnimation(this.theme)]: dimmed || !!this.props.color,\n })}\n dimmed={dimmed}\n width={this.props.width}\n color={this.props.color}\n inline={inline}\n />\n );\n };\n\n private renderCaption = (type: SpinnerType, caption: React.ReactNode) => (\n <span className={cx(styles[type](this.theme), styles.captionColor(this.theme))}>{caption}</span>\n );\n}\n"]}
@@ -1,4 +1,5 @@
1
- "use strict";exports.__esModule = true;exports.createRotationAnimation = exports.createOffsetAnimation = exports.createLengthAnimation = exports.createColorAnimation = exports.SpinnerFallbackAnimationRunner = void 0;var _ColorFactory = require("../../lib/styles/ColorFactory");var
1
+ "use strict";exports.__esModule = true;exports.createRotationAnimation = exports.createOffsetAnimation = exports.createLengthAnimation = exports.createColorAnimation = exports.SpinnerFallbackAnimationRunner = void 0;
2
+ var _ColorFactory = require("../../lib/styles/ColorFactory"); /* eslint-disable no-useless-constructor */var
2
3
 
3
4
  SpinnerFallbackAnimationRunner =
4
5
 
@@ -28,9 +29,14 @@ var rafInterval = function rafInterval(fn, delay) {
28
29
  var rafId = 0;
29
30
 
30
31
  var interval = function interval() {
31
- if (cleared) return;
32
+ if (cleared) {
33
+ return;
34
+ }
35
+
32
36
  var timestamp = new Date().getTime();
33
- if (!lastcall) lastcall = timestamp;
37
+ if (!lastcall) {
38
+ lastcall = timestamp;
39
+ }
34
40
  if (timestamp - lastcall > delay) {
35
41
  fn();
36
42
  lastcall = timestamp;
@@ -58,9 +64,14 @@ onFinish)
58
64
  {var _this2 = this;this.startTime = 0;this.isFinished = false;this.
59
65
 
60
66
  step = function () {
61
- if (_this2.isFinished) return;
67
+ if (_this2.isFinished) {
68
+ return;
69
+ }
70
+
62
71
  var timestamp = new Date().getTime();
63
- if (!_this2.startTime) _this2.startTime = timestamp;
72
+ if (!_this2.startTime) {
73
+ _this2.startTime = timestamp;
74
+ }
64
75
  var progress = (timestamp - _this2.startTime) / _this2.duration;
65
76
 
66
77
  _this2.onProgress(progress);
@@ -1 +1 @@
1
- {"version":3,"sources":["SpinnerFallbackAnimation.ts"],"names":["SpinnerFallbackAnimationRunner","animations","FPS","interval","start","forEach","animation","rafInterval","step","stop","clear","finish","fn","delay","lastcall","cleared","rafId","timestamp","Date","getTime","requestAnimationFrame","cancelAnimationFrame","Animation","duration","onProgress","onFinish","startTime","isFinished","progress","reset","createOffsetAnimation","from","to","setStyleProperty","units","current","createLengthAnimation","reverse","p","createColorAnimation","colors","rgbColors","map","color","ColorFactory","create","rgb","currentIndex","nextIndex","Math","round","length","createRotationAnimation"],"mappings":"wNAA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,WAAkBE,OAAlB,OAAhB;AACD;AACF,GAbI;AAcL,YAAC7B,SAAD,EAAe;AACbA,IAAAA,SAAS,CAACuB,KAAV;AACAkB,IAAAA,YAAY,GAAGC,SAAf;AACAA,IAAAA,SAAS,GAAG,CAACA,SAAS,GAAG,CAAb,IAAkBR,MAAM,CAACW,MAArC;AACD,GAlBI,CAAP;;AAoBD,CA7BM,C;;AA+BA,IAAMC,uBAAuB,GAAG,SAA1BA,uBAA0B;AACrCrB,IADqC;AAErCC,EAFqC;AAGrCT,QAHqC;AAIrCU,gBAJqC;AAKrCC,KALqC;AAMlC,KADHA,KACG,cADHA,KACG,GADK,KACL;AACH,SAAO,IAAIZ,SAAJ;AACLC,EAAAA,QADK;AAEL,YAACK,QAAD,EAAc;AACZ,QAAMO,OAAO,GAAGc,IAAI,CAACC,KAAL,CAAWnB,IAAI,GAAG,CAACC,EAAE,GAAGD,IAAN,IAAcH,QAAhC,CAAhB;AACAK,IAAAA,gBAAgB,CAAC,WAAD,cAAwBE,OAAxB,GAAkCD,KAAlC,OAAhB;AACD,GALI;AAML,YAAC5B,SAAD,EAAe;AACbA,IAAAA,SAAS,CAACuB,KAAV;AACD,GARI,CAAP;;AAUD,CAjBM,C","sourcesContent":["import { ColorFactory } from '../../lib/styles/ColorFactory';\n\nexport class SpinnerFallbackAnimationRunner {\n private interval: ReturnType<typeof rafInterval> | null = null;\n\n constructor(private animations: Animation[], private FPS: number) {\n this.start();\n }\n\n public start = () => {\n this.animations.forEach((animation) => animation.start());\n this.interval = rafInterval(() => {\n this.animations.forEach((animation) => animation.step());\n }, this.FPS);\n };\n\n public stop = () => {\n if (this.interval) {\n this.interval.clear();\n this.animations.forEach((animation) => animation.finish());\n }\n };\n}\n\nconst rafInterval = (fn: () => void, delay: number) => {\n let lastcall = 0;\n let cleared = false;\n let rafId = 0;\n\n const interval = () => {\n if (cleared) return;\n const timestamp = new Date().getTime();\n if (!lastcall) lastcall = timestamp;\n if (timestamp - lastcall > delay) {\n fn();\n lastcall = timestamp;\n }\n rafId = requestAnimationFrame(interval);\n };\n interval();\n\n return {\n clear: () => {\n cleared = true;\n cancelAnimationFrame(rafId);\n },\n };\n};\n\nclass Animation {\n private startTime = 0;\n private isFinished = false;\n\n constructor(\n private duration: number,\n private onProgress: (progress: number) => void,\n private onFinish?: (animation: Animation) => void,\n ) {}\n\n public step = () => {\n if (this.isFinished) return;\n const timestamp = new Date().getTime();\n if (!this.startTime) this.startTime = timestamp;\n const progress = (timestamp - this.startTime) / this.duration;\n\n this.onProgress(progress);\n\n if (progress >= 1) {\n this.finish();\n }\n };\n\n public reset = () => {\n this.startTime = 0;\n this.isFinished = false;\n };\n\n public finish = () => {\n this.isFinished = true;\n this.onFinish && this.onFinish(this);\n };\n\n public start = () => {\n if (!this.isFinished) {\n this.step();\n }\n };\n}\n\nexport const createOffsetAnimation = (\n from: number,\n to: number,\n duration: number,\n setStyleProperty: CSSStyleDeclaration['setProperty'],\n units = '',\n) => {\n return new Animation(\n duration,\n (progress) => {\n const current = from + (to - from) * progress;\n setStyleProperty('stroke-dashoffset', `${current}${units}`);\n },\n (animation) => {\n animation.reset();\n },\n );\n};\n\nexport const createLengthAnimation = (\n from: number[],\n to: number[],\n duration: number,\n setStyleProperty: CSSStyleDeclaration['setProperty'],\n units = '',\n) => {\n let reverse = false;\n return new Animation(\n duration,\n (progress) => {\n const p = reverse ? 1 - progress : progress;\n const current = [from[0] + (to[0] - from[0]) * p, from[1] + (to[1] - from[1]) * p];\n setStyleProperty('stroke-dasharray', `${current[0]}${units} ${current[1]}${units}`);\n },\n (animation) => {\n reverse = !reverse;\n animation.reset();\n },\n );\n};\n\nexport const createColorAnimation = (\n colors: string[],\n duration: number,\n setStyleProperty: CSSStyleDeclaration['setProperty'],\n) => {\n const rgbColors = colors.map((color) => ColorFactory.create(color).rgb);\n let currentIndex = 0;\n let nextIndex = 1;\n\n return new Animation(\n duration,\n (progress) => {\n const from = rgbColors[currentIndex];\n const to = rgbColors[nextIndex];\n if (from && to) {\n const current = [\n Math.round(from[0] + (to[0] - from[0]) * progress),\n Math.round(from[1] + (to[1] - from[1]) * progress),\n Math.round(from[2] + (to[2] - from[2]) * progress),\n ];\n setStyleProperty('stroke', `rgb(${current})`);\n }\n },\n (animation) => {\n animation.reset();\n currentIndex = nextIndex;\n nextIndex = (nextIndex + 1) % colors.length;\n },\n );\n};\n\nexport const createRotationAnimation = (\n from: number,\n to: number,\n duration: number,\n setStyleProperty: CSSStyleDeclaration['setProperty'],\n units = 'deg',\n) => {\n return new Animation(\n duration,\n (progress) => {\n const current = Math.round(from + (to - from) * progress);\n setStyleProperty('transform', `rotate(${current}${units})`);\n },\n (animation) => {\n animation.reset();\n },\n );\n};\n"]}
1
+ {"version":3,"sources":["SpinnerFallbackAnimation.ts"],"names":["SpinnerFallbackAnimationRunner","animations","FPS","interval","start","forEach","animation","rafInterval","step","stop","clear","finish","fn","delay","lastcall","cleared","rafId","timestamp","Date","getTime","requestAnimationFrame","cancelAnimationFrame","Animation","duration","onProgress","onFinish","startTime","isFinished","progress","reset","createOffsetAnimation","from","to","setStyleProperty","units","current","createLengthAnimation","reverse","p","createColorAnimation","colors","rgbColors","map","color","ColorFactory","create","rgb","currentIndex","nextIndex","Math","round","length","createRotationAnimation"],"mappings":";AACA,6D,CADA,2C;;AAGaA,8B;;;AAGX,wCAAoBC,UAApB,EAAqDC,GAArD,EAAkE,uBAF1DC,QAE0D,GAFR,IAEQ;;;;AAI3DC,EAAAA,KAJ2D,GAInD,YAAM;AACnB,IAAA,KAAI,CAACH,UAAL,CAAgBI,OAAhB,CAAwB,UAACC,SAAD,UAAeA,SAAS,CAACF,KAAV,EAAf,EAAxB;AACA,IAAA,KAAI,CAACD,QAAL,GAAgBI,WAAW,CAAC,YAAM;AAChC,MAAA,KAAI,CAACN,UAAL,CAAgBI,OAAhB,CAAwB,UAACC,SAAD,UAAeA,SAAS,CAACE,IAAV,EAAf,EAAxB;AACD,KAF0B,EAExB,KAAI,CAACN,GAFmB,C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C,KADHA,KACG,cADHA,KACG,GADK,KACL;AACH,SAAO,IAAIZ,SAAJ;AACLC,EAAAA,QADK;AAEL,YAACK,QAAD,EAAc;AACZ,QAAMO,OAAO,GAAGc,IAAI,CAACC,KAAL,CAAWnB,IAAI,GAAG,CAACC,EAAE,GAAGD,IAAN,IAAcH,QAAhC,CAAhB;AACAK,IAAAA,gBAAgB,CAAC,WAAD,cAAwBE,OAAxB,GAAkCD,KAAlC,OAAhB;AACD,GALI;AAML,YAAC5B,SAAD,EAAe;AACbA,IAAAA,SAAS,CAACuB,KAAV;AACD,GARI,CAAP;;AAUD,CAjBM,C","sourcesContent":["/* eslint-disable no-useless-constructor */\nimport { ColorFactory } from '../../lib/styles/ColorFactory';\n\nexport class SpinnerFallbackAnimationRunner {\n private interval: ReturnType<typeof rafInterval> | null = null;\n\n constructor(private animations: Animation[], private FPS: number) {\n this.start();\n }\n\n public start = () => {\n this.animations.forEach((animation) => animation.start());\n this.interval = rafInterval(() => {\n this.animations.forEach((animation) => animation.step());\n }, this.FPS);\n };\n\n public stop = () => {\n if (this.interval) {\n this.interval.clear();\n this.animations.forEach((animation) => animation.finish());\n }\n };\n}\n\nconst rafInterval = (fn: () => void, delay: number) => {\n let lastcall = 0;\n let cleared = false;\n let rafId = 0;\n\n const interval = () => {\n if (cleared) {\n return;\n }\n\n const timestamp = new Date().getTime();\n if (!lastcall) {\n lastcall = timestamp;\n }\n if (timestamp - lastcall > delay) {\n fn();\n lastcall = timestamp;\n }\n rafId = requestAnimationFrame(interval);\n };\n interval();\n\n return {\n clear: () => {\n cleared = true;\n cancelAnimationFrame(rafId);\n },\n };\n};\n\nclass Animation {\n private startTime = 0;\n private isFinished = false;\n\n constructor(\n private duration: number,\n private onProgress: (progress: number) => void,\n private onFinish?: (animation: Animation) => void,\n ) {}\n\n public step = () => {\n if (this.isFinished) {\n return;\n }\n\n const timestamp = new Date().getTime();\n if (!this.startTime) {\n this.startTime = timestamp;\n }\n const progress = (timestamp - this.startTime) / this.duration;\n\n this.onProgress(progress);\n\n if (progress >= 1) {\n this.finish();\n }\n };\n\n public reset = () => {\n this.startTime = 0;\n this.isFinished = false;\n };\n\n public finish = () => {\n this.isFinished = true;\n this.onFinish && this.onFinish(this);\n };\n\n public start = () => {\n if (!this.isFinished) {\n this.step();\n }\n };\n}\n\nexport const createOffsetAnimation = (\n from: number,\n to: number,\n duration: number,\n setStyleProperty: CSSStyleDeclaration['setProperty'],\n units = '',\n) => {\n return new Animation(\n duration,\n (progress) => {\n const current = from + (to - from) * progress;\n setStyleProperty('stroke-dashoffset', `${current}${units}`);\n },\n (animation) => {\n animation.reset();\n },\n );\n};\n\nexport const createLengthAnimation = (\n from: number[],\n to: number[],\n duration: number,\n setStyleProperty: CSSStyleDeclaration['setProperty'],\n units = '',\n) => {\n let reverse = false;\n return new Animation(\n duration,\n (progress) => {\n const p = reverse ? 1 - progress : progress;\n const current = [from[0] + (to[0] - from[0]) * p, from[1] + (to[1] - from[1]) * p];\n setStyleProperty('stroke-dasharray', `${current[0]}${units} ${current[1]}${units}`);\n },\n (animation) => {\n reverse = !reverse;\n animation.reset();\n },\n );\n};\n\nexport const createColorAnimation = (\n colors: string[],\n duration: number,\n setStyleProperty: CSSStyleDeclaration['setProperty'],\n) => {\n const rgbColors = colors.map((color) => ColorFactory.create(color).rgb);\n let currentIndex = 0;\n let nextIndex = 1;\n\n return new Animation(\n duration,\n (progress) => {\n const from = rgbColors[currentIndex];\n const to = rgbColors[nextIndex];\n if (from && to) {\n const current = [\n Math.round(from[0] + (to[0] - from[0]) * progress),\n Math.round(from[1] + (to[1] - from[1]) * progress),\n Math.round(from[2] + (to[2] - from[2]) * progress),\n ];\n setStyleProperty('stroke', `rgb(${current})`);\n }\n },\n (animation) => {\n animation.reset();\n currentIndex = nextIndex;\n nextIndex = (nextIndex + 1) % colors.length;\n },\n );\n};\n\nexport const createRotationAnimation = (\n from: number,\n to: number,\n duration: number,\n setStyleProperty: CSSStyleDeclaration['setProperty'],\n units = 'deg',\n) => {\n return new Animation(\n duration,\n (progress) => {\n const current = Math.round(from + (to - from) * progress);\n setStyleProperty('transform', `rotate(${current}${units})`);\n },\n (animation) => {\n animation.reset();\n },\n );\n};\n"]}
@@ -21,6 +21,9 @@ export interface StickyState {
21
21
  stopped: boolean;
22
22
  relativeTop: number;
23
23
  }
24
+ export declare const StickyDataTids: {
25
+ readonly root: "Spinner__root";
26
+ };
24
27
  export declare class Sticky extends React.Component<StickyProps, StickyState> {
25
28
  static __KONTUR_REACT_UI__: string;
26
29
  static propTypes: {
@@ -1,4 +1,4 @@
1
- "use strict";var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule = true;exports.Sticky = void 0;var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));var _react = _interopRequireDefault(require("react"));
1
+ "use strict";var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule = true;exports.StickyDataTids = exports.Sticky = void 0;var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));var _react = _interopRequireDefault(require("react"));
2
2
  var _propTypes = _interopRequireDefault(require("prop-types"));
3
3
  var _shallowequal = _interopRequireDefault(require("shallowequal"));
4
4
 
@@ -13,7 +13,7 @@ var _getDOMRect3 = require("../../lib/dom/getDOMRect");
13
13
 
14
14
  var _Sticky = require("./Sticky.styles");var _class, _class2, _temp;function _getRequireWildcardCache(nodeInterop) {if (typeof WeakMap !== "function") return null;var cacheBabelInterop = new WeakMap();var cacheNodeInterop = new WeakMap();return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) {return nodeInterop ? cacheNodeInterop : cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj, nodeInterop) {if (!nodeInterop && obj && obj.__esModule) {return obj;}if (obj === null || typeof obj !== "object" && typeof obj !== "function") {return { default: obj };}var cache = _getRequireWildcardCache(nodeInterop);if (cache && cache.has(obj)) {return cache.get(obj);}var newObj = {};var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;for (var key in obj) {if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;if (desc && (desc.get || desc.set)) {Object.defineProperty(newObj, key, desc);} else {newObj[key] = obj[key];}}}newObj.default = obj;if (cache) {cache.set(obj, newObj);}return newObj;}
15
15
 
16
- var MAX_REFLOW_RETRIES = 5;var
16
+ var MAX_REFLOW_RETRIES = 5;
17
17
 
18
18
 
19
19
 
@@ -34,6 +34,10 @@ var MAX_REFLOW_RETRIES = 5;var
34
34
 
35
35
 
36
36
 
37
+
38
+
39
+ var StickyDataTids = {
40
+ root: 'Spinner__root' };exports.StickyDataTids = StickyDataTids;var
37
41
 
38
42
 
39
43
 
@@ -188,7 +192,7 @@ Sticky = (0, _rootNode.rootNode)(_class = (_temp = _class2 = /*#__PURE__*/functi
188
192
  _this.setState({ relativeTop: relativeTop, deltaHeight: deltaHeight, stopped: stopped });
189
193
  }
190
194
  }
191
- };return _this;}var _proto = Sticky.prototype;_proto.componentDidMount = function componentDidMount() {this.reflow();this.layoutSubscription = LayoutEvents.addListener(this.reflow);};_proto.componentWillUnmount = function componentWillUnmount() {if (this.layoutSubscription.remove) {this.layoutSubscription.remove();}};_proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {if (!(0, _shallowequal.default)(prevProps, this.props) || !(0, _shallowequal.default)(prevState, this.state)) {if (this.reflowCounter < MAX_REFLOW_RETRIES) {LayoutEvents.emit();this.reflowCounter += 1;return;}}this.reflowCounter = 0;};_proto.render = function render() {var _cx;var children = this.props.children;var _this$props2 = this.props,side = _this$props2.side,offset = _this$props2.offset;var _this$state2 = this.state,fixed = _this$state2.fixed,stopped = _this$state2.stopped,relativeTop = _this$state2.relativeTop,deltaHeight = _this$state2.deltaHeight,width = _this$state2.width,height = _this$state2.height,left = _this$state2.left;var innerStyle = {};if (fixed) {if (stopped) {innerStyle.top = relativeTop;innerStyle[side === 'top' ? 'marginTop' : 'marginBottom'] = deltaHeight;} else {innerStyle.width = width;innerStyle[side] = offset;innerStyle.left = left;}}if ((0, _utils.isFunction)(children)) {children = children(fixed);}return /*#__PURE__*/_react.default.createElement(_CommonWrapper.CommonWrapper, (0, _extends2.default)({ rootNodeRef: this.setRootNode }, this.props), /*#__PURE__*/_react.default.createElement("div", { ref: this.refWrapper, className: _Sticky.styles.wrapper() }, /*#__PURE__*/_react.default.createElement(_ZIndex.ZIndex, { priority: "Sticky", applyZIndex: fixed, className: (0, _Emotion.cx)(_Sticky.styles.inner(), (_cx = {}, _cx[_Sticky.styles.fixed()] = fixed && !stopped, _cx[_Sticky.styles.stopped()] = stopped, _cx)), style: innerStyle, wrapperRef: this.refInner }, /*#__PURE__*/_react.default.createElement("div", { className: _Sticky.styles.container() }, children)), fixed && !stopped ? /*#__PURE__*/_react.default.createElement("div", { style: { width: width, height: height } }) : null));};return Sticky;}(_react.default.Component), _class2.__KONTUR_REACT_UI__ = 'Sticky', _class2.propTypes = { children: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]), /**
195
+ };return _this;}var _proto = Sticky.prototype;_proto.componentDidMount = function componentDidMount() {this.reflow();this.layoutSubscription = LayoutEvents.addListener(this.reflow);};_proto.componentWillUnmount = function componentWillUnmount() {if (this.layoutSubscription.remove) {this.layoutSubscription.remove();}};_proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {if (!(0, _shallowequal.default)(prevProps, this.props) || !(0, _shallowequal.default)(prevState, this.state)) {if (this.reflowCounter < MAX_REFLOW_RETRIES) {LayoutEvents.emit();this.reflowCounter += 1;return;}}this.reflowCounter = 0;};_proto.render = function render() {var _cx;var children = this.props.children;var _this$props2 = this.props,side = _this$props2.side,offset = _this$props2.offset;var _this$state2 = this.state,fixed = _this$state2.fixed,stopped = _this$state2.stopped,relativeTop = _this$state2.relativeTop,deltaHeight = _this$state2.deltaHeight,width = _this$state2.width,height = _this$state2.height,left = _this$state2.left;var innerStyle = {};if (fixed) {if (stopped) {innerStyle.top = relativeTop;innerStyle[side === 'top' ? 'marginTop' : 'marginBottom'] = deltaHeight;} else {innerStyle.width = width;innerStyle[side] = offset;innerStyle.left = left;}}if ((0, _utils.isFunction)(children)) {children = children(fixed);}return /*#__PURE__*/_react.default.createElement(_CommonWrapper.CommonWrapper, (0, _extends2.default)({ rootNodeRef: this.setRootNode }, this.props), /*#__PURE__*/_react.default.createElement("div", { "data-tid": StickyDataTids.root, ref: this.refWrapper, className: _Sticky.styles.wrapper() }, /*#__PURE__*/_react.default.createElement(_ZIndex.ZIndex, { priority: "Sticky", applyZIndex: fixed, className: (0, _Emotion.cx)(_Sticky.styles.inner(), (_cx = {}, _cx[_Sticky.styles.fixed()] = fixed && !stopped, _cx[_Sticky.styles.stopped()] = stopped, _cx)), style: innerStyle, wrapperRef: this.refInner }, /*#__PURE__*/_react.default.createElement("div", { className: _Sticky.styles.container() }, children)), fixed && !stopped ? /*#__PURE__*/_react.default.createElement("div", { style: { width: width, height: height } }) : null));};return Sticky;}(_react.default.Component), _class2.__KONTUR_REACT_UI__ = 'Sticky', _class2.propTypes = { children: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]), /**
192
196
  * Функция, которая возвращает DOM-элемент, который нельзя пересекать.
193
197
  */getStop: _propTypes.default.func, /**
194
198
  * Отступ от границы в пикселях
@@ -1 +1 @@
1
- {"version":3,"sources":["Sticky.tsx"],"names":["MAX_REFLOW_RETRIES","Sticky","rootNode","state","fixed","deltaHeight","stopped","relativeTop","layoutSubscription","remove","reflowCounter","refWrapper","ref","wrapper","refInner","inner","reflow","document","documentElement","Error","windowHeight","window","innerHeight","clientHeight","top","bottom","left","width","height","props","offset","getStop","side","prevFixed","prevHeight","Math","floor","setState","stop","stopRect","outerHeight","componentDidMount","LayoutEvents","addListener","componentWillUnmount","componentDidUpdate","prevProps","prevState","emit","render","children","innerStyle","setRootNode","styles","container","React","Component","__KONTUR_REACT_UI__","propTypes","PropTypes","oneOfType","node","func","number","oneOf","isRequired","defaultProps"],"mappings":"oUAAA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,yC;;AAEA,IAAMA,kBAAkB,GAAG,CAA3B,C;;;;;;;;;;;;;;;;;;;;;;;;AAwBaC,M,OADZC,kB;;;;;;;;;;;;;;;;;;;;;AAsBQC,IAAAA,K,GAAqB;AAC1BC,MAAAA,KAAK,EAAE,KADmB;AAE1BC,MAAAA,WAAW,EAAE,CAFa;AAG1BC,MAAAA,OAAO,EAAE,KAHiB;AAI1BC,MAAAA,WAAW,EAAE,CAJa,E;;;;;AASpBC,IAAAA,kB,GAAuD,EAAEC,MAAM,EAAE,IAAV,E;AACvDC,IAAAA,a,GAAgB,C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoEhBC,IAAAA,U,GAAa,UAACC,GAAD,UAAiC,MAAKC,OAAL,GAAeD,GAAhD,E;;AAEbE,IAAAA,Q,GAAW,UAACF,GAAD,UAAiC,MAAKG,KAAL,GAAaH,GAA9C,E;;;;;;;AAOZI,IAAAA,M,GAAS,YAAM;AACpB,sBAA4BC,QAA5B,CAAQC,eAAR,aAAQA,eAAR;;AAEA,UAAI,CAACA,eAAL,EAAsB;AACpB,cAAMC,KAAK,CAAC,2CAAD,CAAX;AACD;;AAED,UAAMC,YAAY,GAAGC,MAAM,CAACC,WAAP,IAAsBJ,eAAe,CAACK,YAA3D;AACA,UAAI,CAAC,MAAKV,OAAN,IAAiB,CAAC,MAAKE,KAA3B,EAAkC;AAChC;AACD;AACD,wBAA8B,6BAAW,MAAKF,OAAhB,CAA9B,CAAQW,GAAR,eAAQA,GAAR,CAAaC,MAAb,eAAaA,MAAb,CAAqBC,IAArB,eAAqBA,IAArB;AACA,yBAA0B,6BAA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,GAAY,EACxBR,QAAQ,EAAES,mBAAUC,SAAV,CAAoB,CAACD,mBAAUE,IAAX,EAAiBF,mBAAUG,IAA3B,CAApB,CADc,EAGxB;AACJ;AACA,KACI/B,OAAO,EAAE4B,mBAAUG,IANK,EAQxB;AACJ;AACA,KACIhC,MAAM,EAAE6B,mBAAUI,MAXM,EAaxB/B,IAAI,EAAE2B,mBAAUK,KAAV,CAAgB,CAAC,KAAD,EAAQ,QAAR,CAAhB,EAAmCC,UAbjB,E,UAgBZC,Y,GAAe,EAAEpC,MAAM,EAAE,CAAV,E","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport shallowEqual from 'shallowequal';\n\nimport * as LayoutEvents from '../../lib/LayoutEvents';\nimport { Nullable } from '../../typings/utility-types';\nimport { isFunction } from '../../lib/utils';\nimport { ZIndex } from '../../internal/ZIndex';\nimport { CommonWrapper, CommonProps } from '../../internal/CommonWrapper';\nimport { cx } from '../../lib/theming/Emotion';\nimport { rootNode, TSetRootNode } from '../../lib/rootNode';\nimport { getDOMRect } from '../../lib/dom/getDOMRect';\n\nimport { styles } from './Sticky.styles';\n\nconst MAX_REFLOW_RETRIES = 5;\n\nexport interface StickyProps extends CommonProps {\n side: 'top' | 'bottom';\n /**\n * Отступ в пикселях от края экрана, на сколько сдвигается элемент в залипшем состоянии\n * @default 0\n */\n offset: number;\n getStop?: () => Nullable<HTMLElement>;\n children?: React.ReactNode | ((fixed: boolean) => React.ReactNode);\n}\n\nexport interface StickyState {\n fixed: boolean;\n deltaHeight: number;\n height?: number;\n width?: number;\n left?: number;\n stopped: boolean;\n relativeTop: number;\n}\n\n@rootNode\nexport class Sticky extends React.Component<StickyProps, StickyState> {\n public static __KONTUR_REACT_UI__ = 'Sticky';\n\n public static propTypes = {\n children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),\n\n /**\n * Функция, которая возвращает DOM-элемент, который нельзя пересекать.\n */\n getStop: PropTypes.func,\n\n /**\n * Отступ от границы в пикселях\n */\n offset: PropTypes.number,\n\n side: PropTypes.oneOf(['top', 'bottom']).isRequired,\n };\n\n public static defaultProps = { offset: 0 };\n\n public state: StickyState = {\n fixed: false,\n deltaHeight: 0,\n stopped: false,\n relativeTop: 0,\n };\n\n private wrapper: Nullable<HTMLElement>;\n private inner: Nullable<HTMLElement>;\n private layoutSubscription: { remove: Nullable<() => void> } = { remove: null };\n private reflowCounter = 0;\n private setRootNode!: TSetRootNode;\n\n public componentDidMount() {\n this.reflow();\n\n this.layoutSubscription = LayoutEvents.addListener(this.reflow);\n }\n\n public componentWillUnmount() {\n if (this.layoutSubscription.remove) {\n this.layoutSubscription.remove();\n }\n }\n\n public componentDidUpdate(prevProps: StickyProps, prevState: StickyState) {\n if (!shallowEqual(prevProps, this.props) || !shallowEqual(prevState, this.state)) {\n if (this.reflowCounter < MAX_REFLOW_RETRIES) {\n LayoutEvents.emit();\n this.reflowCounter += 1;\n return;\n }\n }\n this.reflowCounter = 0;\n }\n\n public render() {\n let { children } = this.props;\n const { side, offset } = this.props;\n const { fixed, stopped, relativeTop, deltaHeight, width, height, left } = this.state;\n const innerStyle: React.CSSProperties = {};\n\n if (fixed) {\n if (stopped) {\n innerStyle.top = relativeTop;\n innerStyle[side === 'top' ? 'marginTop' : 'marginBottom'] = deltaHeight;\n } else {\n innerStyle.width = width;\n innerStyle[side] = offset;\n innerStyle.left = left;\n }\n }\n\n if (isFunction(children)) {\n children = children(fixed);\n }\n\n return (\n <CommonWrapper rootNodeRef={this.setRootNode} {...this.props}>\n <div ref={this.refWrapper} className={styles.wrapper()}>\n <ZIndex\n priority=\"Sticky\"\n applyZIndex={fixed}\n className={cx(styles.inner(), {\n [styles.fixed()]: fixed && !stopped,\n [styles.stopped()]: stopped,\n })}\n style={innerStyle}\n wrapperRef={this.refInner}\n >\n <div className={styles.container()}>{children}</div>\n </ZIndex>\n {fixed && !stopped ? <div style={{ width, height }} /> : null}\n </div>\n </CommonWrapper>\n );\n }\n\n private refWrapper = (ref: Nullable<HTMLElement>) => (this.wrapper = ref);\n\n private refInner = (ref: Nullable<HTMLElement>) => (this.inner = ref);\n\n /**\n * Пересчитать габариты и позицию залипшего элемента\n *\n * @public\n */\n public reflow = () => {\n const { documentElement } = document;\n\n if (!documentElement) {\n throw Error('There is no \"documentElement\" in document');\n }\n\n const windowHeight = window.innerHeight || documentElement.clientHeight;\n if (!this.wrapper || !this.inner) {\n return;\n }\n const { top, bottom, left } = getDOMRect(this.wrapper);\n const { width, height } = getDOMRect(this.inner);\n const { offset, getStop, side } = this.props;\n const { fixed: prevFixed, height: prevHeight = height } = this.state;\n const fixed = side === 'top' ? top < offset : Math.floor(bottom) > windowHeight - offset;\n\n this.setState({ fixed, left });\n\n if (fixed && !prevFixed) {\n this.setState({ width, height });\n }\n\n if (fixed) {\n const stop = getStop && getStop();\n if (stop) {\n const deltaHeight = prevHeight - height;\n const stopRect = getDOMRect(stop);\n const outerHeight = height + offset;\n let stopped = false;\n let relativeTop = 0;\n\n if (side === 'top') {\n stopped = stopRect.top - outerHeight < 0;\n relativeTop = stopRect.top - prevHeight - top;\n } else {\n stopped = stopRect.bottom + outerHeight > windowHeight;\n relativeTop = stopRect.bottom - top;\n }\n\n this.setState({ relativeTop, deltaHeight, stopped });\n }\n }\n };\n}\n"]}
1
+ {"version":3,"sources":["Sticky.tsx"],"names":["MAX_REFLOW_RETRIES","StickyDataTids","root","Sticky","rootNode","state","fixed","deltaHeight","stopped","relativeTop","layoutSubscription","remove","reflowCounter","refWrapper","ref","wrapper","refInner","inner","reflow","document","documentElement","Error","windowHeight","window","innerHeight","clientHeight","top","bottom","left","width","height","props","offset","getStop","side","prevFixed","prevHeight","Math","floor","setState","stop","stopRect","outerHeight","componentDidMount","LayoutEvents","addListener","componentWillUnmount","componentDidUpdate","prevProps","prevState","emit","render","children","innerStyle","setRootNode","styles","container","React","Component","__KONTUR_REACT_UI__","propTypes","PropTypes","oneOfType","node","func","number","oneOf","isRequired","defaultProps"],"mappings":"6VAAA;AACA;AACA;;AA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CAAoB,CAACD,mBAAUE,IAAX,EAAiBF,mBAAUG,IAA3B,CAApB,CADc,EAGxB;AACJ;AACA,KACI/B,OAAO,EAAE4B,mBAAUG,IANK,EAQxB;AACJ;AACA,KACIhC,MAAM,EAAE6B,mBAAUI,MAXM,EAaxB/B,IAAI,EAAE2B,mBAAUK,KAAV,CAAgB,CAAC,KAAD,EAAQ,QAAR,CAAhB,EAAmCC,UAbjB,E,UAgBZC,Y,GAAe,EAAEpC,MAAM,EAAE,CAAV,E","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport shallowEqual from 'shallowequal';\n\nimport * as LayoutEvents from '../../lib/LayoutEvents';\nimport { Nullable } from '../../typings/utility-types';\nimport { isFunction } from '../../lib/utils';\nimport { ZIndex } from '../../internal/ZIndex';\nimport { CommonWrapper, CommonProps } from '../../internal/CommonWrapper';\nimport { cx } from '../../lib/theming/Emotion';\nimport { rootNode, TSetRootNode } from '../../lib/rootNode';\nimport { getDOMRect } from '../../lib/dom/getDOMRect';\n\nimport { styles } from './Sticky.styles';\n\nconst MAX_REFLOW_RETRIES = 5;\n\nexport interface StickyProps extends CommonProps {\n side: 'top' | 'bottom';\n /**\n * Отступ в пикселях от края экрана, на сколько сдвигается элемент в залипшем состоянии\n * @default 0\n */\n offset: number;\n getStop?: () => Nullable<HTMLElement>;\n children?: React.ReactNode | ((fixed: boolean) => React.ReactNode);\n}\n\nexport interface StickyState {\n fixed: boolean;\n deltaHeight: number;\n height?: number;\n width?: number;\n left?: number;\n stopped: boolean;\n relativeTop: number;\n}\n\nexport const StickyDataTids = {\n root: 'Spinner__root',\n} as const;\n\n@rootNode\nexport class Sticky extends React.Component<StickyProps, StickyState> {\n public static __KONTUR_REACT_UI__ = 'Sticky';\n\n public static propTypes = {\n children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),\n\n /**\n * Функция, которая возвращает DOM-элемент, который нельзя пересекать.\n */\n getStop: PropTypes.func,\n\n /**\n * Отступ от границы в пикселях\n */\n offset: PropTypes.number,\n\n side: PropTypes.oneOf(['top', 'bottom']).isRequired,\n };\n\n public static defaultProps = { offset: 0 };\n\n public state: StickyState = {\n fixed: false,\n deltaHeight: 0,\n stopped: false,\n relativeTop: 0,\n };\n\n private wrapper: Nullable<HTMLElement>;\n private inner: Nullable<HTMLElement>;\n private layoutSubscription: { remove: Nullable<() => void> } = { remove: null };\n private reflowCounter = 0;\n private setRootNode!: TSetRootNode;\n\n public componentDidMount() {\n this.reflow();\n\n this.layoutSubscription = LayoutEvents.addListener(this.reflow);\n }\n\n public componentWillUnmount() {\n if (this.layoutSubscription.remove) {\n this.layoutSubscription.remove();\n }\n }\n\n public componentDidUpdate(prevProps: StickyProps, prevState: StickyState) {\n if (!shallowEqual(prevProps, this.props) || !shallowEqual(prevState, this.state)) {\n if (this.reflowCounter < MAX_REFLOW_RETRIES) {\n LayoutEvents.emit();\n this.reflowCounter += 1;\n return;\n }\n }\n this.reflowCounter = 0;\n }\n\n public render() {\n let { children } = this.props;\n const { side, offset } = this.props;\n const { fixed, stopped, relativeTop, deltaHeight, width, height, left } = this.state;\n const innerStyle: React.CSSProperties = {};\n\n if (fixed) {\n if (stopped) {\n innerStyle.top = relativeTop;\n innerStyle[side === 'top' ? 'marginTop' : 'marginBottom'] = deltaHeight;\n } else {\n innerStyle.width = width;\n innerStyle[side] = offset;\n innerStyle.left = left;\n }\n }\n\n if (isFunction(children)) {\n children = children(fixed);\n }\n\n return (\n <CommonWrapper rootNodeRef={this.setRootNode} {...this.props}>\n <div data-tid={StickyDataTids.root} ref={this.refWrapper} className={styles.wrapper()}>\n <ZIndex\n priority=\"Sticky\"\n applyZIndex={fixed}\n className={cx(styles.inner(), {\n [styles.fixed()]: fixed && !stopped,\n [styles.stopped()]: stopped,\n })}\n style={innerStyle}\n wrapperRef={this.refInner}\n >\n <div className={styles.container()}>{children}</div>\n </ZIndex>\n {fixed && !stopped ? <div style={{ width, height }} /> : null}\n </div>\n </CommonWrapper>\n );\n }\n\n private refWrapper = (ref: Nullable<HTMLElement>) => (this.wrapper = ref);\n\n private refInner = (ref: Nullable<HTMLElement>) => (this.inner = ref);\n\n /**\n * Пересчитать габариты и позицию залипшего элемента\n *\n * @public\n */\n public reflow = () => {\n const { documentElement } = document;\n\n if (!documentElement) {\n throw Error('There is no \"documentElement\" in document');\n }\n\n const windowHeight = window.innerHeight || documentElement.clientHeight;\n if (!this.wrapper || !this.inner) {\n return;\n }\n const { top, bottom, left } = getDOMRect(this.wrapper);\n const { width, height } = getDOMRect(this.inner);\n const { offset, getStop, side } = this.props;\n const { fixed: prevFixed, height: prevHeight = height } = this.state;\n const fixed = side === 'top' ? top < offset : Math.floor(bottom) > windowHeight - offset;\n\n this.setState({ fixed, left });\n\n if (fixed && !prevFixed) {\n this.setState({ width, height });\n }\n\n if (fixed) {\n const stop = getStop && getStop();\n if (stop) {\n const deltaHeight = prevHeight - height;\n const stopRect = getDOMRect(stop);\n const outerHeight = height + offset;\n let stopped = false;\n let relativeTop = 0;\n\n if (side === 'top') {\n stopped = stopRect.top - outerHeight < 0;\n relativeTop = stopRect.top - prevHeight - top;\n } else {\n stopped = stopRect.bottom + outerHeight > windowHeight;\n relativeTop = stopRect.bottom - top;\n }\n\n this.setState({ relativeTop, deltaHeight, stopped });\n }\n }\n };\n}\n"]}
@@ -5,6 +5,9 @@ import { Nullable } from '../../typings/utility-types';
5
5
  import { CommonProps } from '../../internal/CommonWrapper';
6
6
  export declare type SwitcherSize = ButtonSize;
7
7
  declare type SwitcherItems = string | SwitcherItem;
8
+ export declare const SwitcherDataTids: {
9
+ readonly root: "Switcher__root";
10
+ };
8
11
  export interface SwitcherProps extends CommonProps {
9
12
  /**
10
13
  * Список строк или список элементов типа `{ label: string, value: string }`
@@ -1,4 +1,4 @@
1
- "use strict";var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule = true;exports.Switcher = void 0;var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));var _react = _interopRequireDefault(require("react"));
1
+ "use strict";var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule = true;exports.SwitcherDataTids = exports.Switcher = void 0;var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));var _react = _interopRequireDefault(require("react"));
2
2
  var _propTypes = _interopRequireDefault(require("prop-types"));
3
3
 
4
4
  var _identifiers = require("../../lib/events/keyboard/identifiers");
@@ -12,11 +12,15 @@ var _Emotion = require("../../lib/theming/Emotion");
12
12
  var _rootNode = require("../../lib/rootNode");
13
13
 
14
14
  var _Switcher = require("./Switcher.styles");
15
- var _switcherTheme = require("./switcherTheme");var _class, _class2, _temp;var
15
+ var _switcherTheme = require("./switcherTheme");var _class, _class2, _temp;
16
16
 
17
17
 
18
18
 
19
19
 
20
+ var SwitcherDataTids = {
21
+ root: 'Switcher__root' };exports.SwitcherDataTids = SwitcherDataTids;var
22
+
23
+
20
24
 
21
25
 
22
26
 
@@ -221,4 +225,4 @@ Switcher = (0, _rootNode.rootNode)(_class = (_temp = _class2 = /*#__PURE__*/func
221
225
  default:
222
226
  return _Switcher.styles.captionSmall(_this.theme);}
223
227
 
224
- };return _this;}var _proto = Switcher.prototype;_proto.render = function render() {var _this2 = this;return /*#__PURE__*/_react.default.createElement(_ThemeContext.ThemeContext.Consumer, null, function (theme) {_this2.theme = (0, _switcherTheme.getSwitcherTheme)(theme);return /*#__PURE__*/_react.default.createElement(_ThemeContext.ThemeContext.Provider, { value: _this2.theme }, _this2.renderMain());});};_proto.renderMain = function renderMain() {var _cx;var listClassName = (0, _Emotion.cx)((_cx = {}, _cx[_Switcher.styles.error(this.theme)] = !!this.props.error, _cx));var inputProps = { type: 'checkbox', onKeyDown: this.handleKey, onFocus: this._handleFocus, onBlur: this._handleBlur, className: _Switcher.styles.input() };var captionClassName = (0, _Emotion.cx)(_Switcher.styles.caption(this.theme), this.getLabelSizeClassName());return /*#__PURE__*/_react.default.createElement(_CommonWrapper.CommonWrapper, (0, _extends2.default)({ rootNodeRef: this.setRootNode }, this.props), /*#__PURE__*/_react.default.createElement("div", { className: _Switcher.styles.root() }, this.props.caption ? /*#__PURE__*/_react.default.createElement("div", { className: captionClassName }, this.props.caption) : null, /*#__PURE__*/_react.default.createElement("div", { className: _Switcher.styles.wrap() }, /*#__PURE__*/_react.default.createElement("input", inputProps), /*#__PURE__*/_react.default.createElement("div", { className: listClassName }, /*#__PURE__*/_react.default.createElement(_Group.Group, null, this._renderItems())))));};return Switcher;}(_react.default.Component), _class2.__KONTUR_REACT_UI__ = 'Switcher', _class2.propTypes = { error: _propTypes.default.bool, disabled: _propTypes.default.bool, items: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.string), _propTypes.default.arrayOf(_propTypes.default.shape({ label: _propTypes.default.string, value: _propTypes.default.string }))]).isRequired, caption: _propTypes.default.string, value: _propTypes.default.string, onValueChange: _propTypes.default.func }, _temp)) || _class;exports.Switcher = Switcher;
228
+ };return _this;}var _proto = Switcher.prototype;_proto.render = function render() {var _this2 = this;return /*#__PURE__*/_react.default.createElement(_ThemeContext.ThemeContext.Consumer, null, function (theme) {_this2.theme = (0, _switcherTheme.getSwitcherTheme)(theme);return /*#__PURE__*/_react.default.createElement(_ThemeContext.ThemeContext.Provider, { value: _this2.theme }, _this2.renderMain());});};_proto.renderMain = function renderMain() {var _cx;var listClassName = (0, _Emotion.cx)((_cx = {}, _cx[_Switcher.styles.error(this.theme)] = !!this.props.error, _cx));var inputProps = { type: 'checkbox', onKeyDown: this.handleKey, onFocus: this._handleFocus, onBlur: this._handleBlur, className: _Switcher.styles.input() };var captionClassName = (0, _Emotion.cx)(_Switcher.styles.caption(this.theme), this.getLabelSizeClassName());return /*#__PURE__*/_react.default.createElement(_CommonWrapper.CommonWrapper, (0, _extends2.default)({ rootNodeRef: this.setRootNode }, this.props), /*#__PURE__*/_react.default.createElement("div", { "data-tid": SwitcherDataTids.root, className: _Switcher.styles.root() }, this.props.caption ? /*#__PURE__*/_react.default.createElement("div", { className: captionClassName }, this.props.caption) : null, /*#__PURE__*/_react.default.createElement("div", { className: _Switcher.styles.wrap() }, /*#__PURE__*/_react.default.createElement("input", inputProps), /*#__PURE__*/_react.default.createElement("div", { className: listClassName }, /*#__PURE__*/_react.default.createElement(_Group.Group, null, this._renderItems())))));};return Switcher;}(_react.default.Component), _class2.__KONTUR_REACT_UI__ = 'Switcher', _class2.propTypes = { error: _propTypes.default.bool, disabled: _propTypes.default.bool, items: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.string), _propTypes.default.arrayOf(_propTypes.default.shape({ label: _propTypes.default.string, value: _propTypes.default.string }))]).isRequired, caption: _propTypes.default.string, value: _propTypes.default.string, onValueChange: _propTypes.default.func }, _temp)) || _class;exports.Switcher = Switcher;