@skbkontur/react-ui 6.0.7-b5d2c.0 → 6.0.7-eab55.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (232) hide show
  1. package/components/Autocomplete/Autocomplete.js +15 -4
  2. package/components/Autocomplete/Autocomplete.js.map +1 -1
  3. package/components/Calendar/Calendar.d.ts +14 -14
  4. package/components/Calendar/Calendar.js +2 -2
  5. package/components/Calendar/Calendar.js.map +1 -1
  6. package/components/Calendar/CalendarDay.d.ts +2 -2
  7. package/components/Calendar/CalendarDay.js +4 -1
  8. package/components/Calendar/CalendarDay.js.map +1 -1
  9. package/components/Calendar/DayCellView.styles.d.ts +1 -0
  10. package/components/Calendar/DayCellView.styles.js +6 -3
  11. package/components/Calendar/DayCellView.styles.js.map +1 -1
  12. package/components/Center/Center.d.ts +3 -3
  13. package/components/Center/Center.js +2 -2
  14. package/components/Center/Center.js.map +1 -1
  15. package/components/Checkbox/Checkbox.d.ts +14 -11
  16. package/components/Checkbox/Checkbox.js +6 -3
  17. package/components/Checkbox/Checkbox.js.map +1 -1
  18. package/components/ComboBox/ComboBox.d.ts +3 -3
  19. package/components/ComboBox/ComboBox.js.map +1 -1
  20. package/components/DateInput/DateInput.d.ts +15 -15
  21. package/components/DateInput/DateInput.js +1 -1
  22. package/components/DateInput/DateInput.js.map +1 -1
  23. package/components/DatePicker/DatePicker.d.ts +16 -14
  24. package/components/DatePicker/DatePicker.js +5 -4
  25. package/components/DatePicker/DatePicker.js.map +1 -1
  26. package/components/DatePicker/MobilePicker.js +1 -1
  27. package/components/DatePicker/MobilePicker.js.map +1 -1
  28. package/components/DateRangePicker/DateRangePicker.d.ts +3 -4
  29. package/components/DateRangePicker/DateRangePicker.js +4 -6
  30. package/components/DateRangePicker/DateRangePicker.js.map +1 -1
  31. package/components/DateRangePicker/DateRangePickerInput.js +4 -6
  32. package/components/DateRangePicker/DateRangePickerInput.js.map +1 -1
  33. package/components/Dropdown/Dropdown.d.ts +15 -8
  34. package/components/Dropdown/Dropdown.js +8 -1
  35. package/components/Dropdown/Dropdown.js.map +1 -1
  36. package/components/DropdownMenu/DropdownMenu.d.ts +1 -2
  37. package/components/DropdownMenu/DropdownMenu.js +1 -2
  38. package/components/DropdownMenu/DropdownMenu.js.map +1 -1
  39. package/components/FileUploader/FileUploader.d.ts +6 -4
  40. package/components/FileUploader/FileUploader.js +3 -1
  41. package/components/FileUploader/FileUploader.js.map +1 -1
  42. package/components/FileUploader/FileUploaderFile.d.ts +3 -3
  43. package/components/FileUploader/FileUploaderFile.js +1 -1
  44. package/components/FileUploader/FileUploaderFile.js.map +1 -1
  45. package/components/Input/Input.d.ts +2 -2
  46. package/components/Input/Input.js.map +1 -1
  47. package/components/Loader/Loader.d.ts +12 -4
  48. package/components/Loader/Loader.js +18 -7
  49. package/components/Loader/Loader.js.map +1 -1
  50. package/components/MenuFooter/MenuFooter.d.ts +1 -1
  51. package/components/MenuFooter/MenuFooter.js +1 -1
  52. package/components/MenuFooter/MenuFooter.js.map +1 -1
  53. package/components/MenuHeader/MenuHeader.d.ts +2 -2
  54. package/components/MenuHeader/MenuHeader.js +1 -1
  55. package/components/MenuHeader/MenuHeader.js.map +1 -1
  56. package/components/MenuItem/MenuItem.d.ts +1 -0
  57. package/components/MenuItem/MenuItem.js +17 -1
  58. package/components/MenuItem/MenuItem.js.map +1 -1
  59. package/components/MenuItem/MenuItem.styles.d.ts +3 -0
  60. package/components/MenuItem/MenuItem.styles.js +25 -16
  61. package/components/MenuItem/MenuItem.styles.js.map +1 -1
  62. package/components/MenuSeparator/MenuSeparator.d.ts +1 -1
  63. package/components/MenuSeparator/MenuSeparator.js +1 -1
  64. package/components/MenuSeparator/MenuSeparator.js.map +1 -1
  65. package/components/MiniModal/MiniModal.d.ts +1 -1
  66. package/components/MiniModal/MiniModal.js +1 -1
  67. package/components/MiniModal/MiniModal.js.map +1 -1
  68. package/components/MiniModal/MiniModalBody.d.ts +1 -1
  69. package/components/MiniModal/MiniModalBody.js +1 -1
  70. package/components/MiniModal/MiniModalBody.js.map +1 -1
  71. package/components/MiniModal/MiniModalFooter.d.ts +1 -1
  72. package/components/MiniModal/MiniModalFooter.js +1 -1
  73. package/components/MiniModal/MiniModalFooter.js.map +1 -1
  74. package/components/MiniModal/MiniModalHeader.d.ts +1 -1
  75. package/components/MiniModal/MiniModalHeader.js +1 -1
  76. package/components/MiniModal/MiniModalHeader.js.map +1 -1
  77. package/components/Paging/Paging.d.ts +2 -2
  78. package/components/Paging/Paging.js.map +1 -1
  79. package/components/Radio/Radio.d.ts +7 -7
  80. package/components/Radio/Radio.js.map +1 -1
  81. package/components/RadioGroup/RadioGroup.d.ts +2 -2
  82. package/components/RadioGroup/RadioGroup.js.map +1 -1
  83. package/components/Select/Select.d.ts +4 -4
  84. package/components/Select/Select.js +11 -1
  85. package/components/Select/Select.js.map +1 -1
  86. package/components/SingleToast/SingleToast.d.ts +10 -7
  87. package/components/SingleToast/SingleToast.js +10 -7
  88. package/components/SingleToast/SingleToast.js.map +1 -1
  89. package/components/Spinner/Spinner.d.ts +23 -33
  90. package/components/Spinner/Spinner.js +23 -19
  91. package/components/Spinner/Spinner.js.map +1 -1
  92. package/components/Spinner/Spinner.styles.d.ts +0 -3
  93. package/components/Spinner/Spinner.styles.js +6 -15
  94. package/components/Spinner/Spinner.styles.js.map +1 -1
  95. package/components/Sticky/Sticky.d.ts +4 -0
  96. package/components/Sticky/Sticky.js +4 -0
  97. package/components/Sticky/Sticky.js.map +1 -1
  98. package/components/Switcher/Switcher.d.ts +10 -8
  99. package/components/Switcher/Switcher.js +3 -1
  100. package/components/Switcher/Switcher.js.map +1 -1
  101. package/components/Textarea/Textarea.js +1 -1
  102. package/components/Textarea/Textarea.js.map +1 -1
  103. package/components/Textarea/Textarea.styles.d.ts +1 -0
  104. package/components/Textarea/Textarea.styles.js +7 -4
  105. package/components/Textarea/Textarea.styles.js.map +1 -1
  106. package/components/Textarea/TextareaCounter.d.ts +2 -0
  107. package/components/Textarea/TextareaCounter.js +22 -4
  108. package/components/Textarea/TextareaCounter.js.map +1 -1
  109. package/components/TimePicker/TimeFragmentsView.js.map +1 -1
  110. package/components/TimePicker/TimeFragmentsView.styles.js +4 -4
  111. package/components/TimePicker/TimeFragmentsView.styles.js.map +1 -1
  112. package/components/TimePicker/TimeInput.d.ts +5 -7
  113. package/components/TimePicker/TimeInput.js +19 -7
  114. package/components/TimePicker/TimeInput.js.map +1 -1
  115. package/components/TimePicker/TimePicker.d.ts +39 -7
  116. package/components/TimePicker/TimePicker.js +275 -148
  117. package/components/TimePicker/TimePicker.js.map +1 -1
  118. package/components/TimePicker/TimePicker.styles.d.ts +3 -4
  119. package/components/TimePicker/TimePicker.styles.js +11 -14
  120. package/components/TimePicker/TimePicker.styles.js.map +1 -1
  121. package/components/TimePicker/TimePickerMobilePopup.d.ts +31 -0
  122. package/components/TimePicker/TimePickerMobilePopup.js +21 -0
  123. package/components/TimePicker/TimePickerMobilePopup.js.map +1 -0
  124. package/components/TimePicker/TimePickerPopup.d.ts +19 -0
  125. package/components/TimePicker/TimePickerPopup.js +18 -0
  126. package/components/TimePicker/TimePickerPopup.js.map +1 -0
  127. package/components/TimePicker/TimePickerSlots.d.ts +16 -0
  128. package/components/TimePicker/TimePickerSlots.js +67 -0
  129. package/components/TimePicker/TimePickerSlots.js.map +1 -0
  130. package/components/TimePicker/helpers/TimePicker.constants.d.ts +0 -1
  131. package/components/TimePicker/helpers/TimePicker.constants.js +0 -1
  132. package/components/TimePicker/helpers/TimePicker.constants.js.map +1 -1
  133. package/components/TimePicker/helpers/TimePicker.editing.js +10 -1
  134. package/components/TimePicker/helpers/TimePicker.editing.js.map +1 -1
  135. package/components/TimePicker/helpers/TimePicker.shared.d.ts +1 -2
  136. package/components/TimePicker/helpers/TimePicker.shared.js +4 -4
  137. package/components/TimePicker/helpers/TimePicker.shared.js.map +1 -1
  138. package/components/TimePicker/helpers/TimePicker.value.d.ts +3 -5
  139. package/components/TimePicker/helpers/TimePicker.value.js +21 -7
  140. package/components/TimePicker/helpers/TimePicker.value.js.map +1 -1
  141. package/components/TimePicker/hooks/useTimePickerValue.d.ts +1 -1
  142. package/components/TimePicker/hooks/useTimePickerValue.js +8 -7
  143. package/components/TimePicker/hooks/useTimePickerValue.js.map +1 -1
  144. package/components/Toast/Toast.d.ts +13 -14
  145. package/components/Toast/Toast.js +3 -3
  146. package/components/Toast/Toast.js.map +1 -1
  147. package/components/Toast/ToastView.d.ts +8 -5
  148. package/components/Toast/ToastView.js +28 -8
  149. package/components/Toast/ToastView.js.map +1 -1
  150. package/components/Toast/ToastView.styles.d.ts +7 -0
  151. package/components/Toast/ToastView.styles.js +30 -8
  152. package/components/Toast/ToastView.styles.js.map +1 -1
  153. package/components/Tooltip/Tooltip.d.ts +4 -4
  154. package/components/Tooltip/Tooltip.js.map +1 -1
  155. package/internal/CloseButtonIcon/CloseButtonIcon.js +1 -1
  156. package/internal/CloseButtonIcon/CloseButtonIcon.js.map +1 -1
  157. package/internal/CommonWrapper/CommonWrapper.js +5 -0
  158. package/internal/CommonWrapper/CommonWrapper.js.map +1 -1
  159. package/internal/CustomComboBox/ComboBoxMenu.js +1 -1
  160. package/internal/CustomComboBox/ComboBoxMenu.js.map +1 -1
  161. package/internal/CustomComboBox/ComboBoxView.js +13 -2
  162. package/internal/CustomComboBox/ComboBoxView.js.map +1 -1
  163. package/internal/Menu/Menu.js +3 -0
  164. package/internal/Menu/Menu.js.map +1 -1
  165. package/internal/Menu/Menu.styles.d.ts +1 -0
  166. package/internal/Menu/Menu.styles.js +13 -10
  167. package/internal/Menu/Menu.styles.js.map +1 -1
  168. package/internal/MenuMessage/MenuMessage.js +17 -1
  169. package/internal/MenuMessage/MenuMessage.js.map +1 -1
  170. package/internal/MenuMessage/MenuMessage.styles.d.ts +3 -0
  171. package/internal/MenuMessage/MenuMessage.styles.js +13 -4
  172. package/internal/MenuMessage/MenuMessage.styles.js.map +1 -1
  173. package/internal/MobilePopup/MobilePopup.d.ts +8 -0
  174. package/internal/MobilePopup/MobilePopup.js +34 -11
  175. package/internal/MobilePopup/MobilePopup.js.map +1 -1
  176. package/internal/MobilePopup/MobilePopup.styles.d.ts +7 -0
  177. package/internal/MobilePopup/MobilePopup.styles.js +34 -10
  178. package/internal/MobilePopup/MobilePopup.styles.js.map +1 -1
  179. package/internal/MobilePopup/MobilePopupFooter/MobilePopupFooter.d.ts +8 -1
  180. package/internal/MobilePopup/MobilePopupFooter/MobilePopupFooter.js +18 -1
  181. package/internal/MobilePopup/MobilePopupFooter/MobilePopupFooter.js.map +1 -1
  182. package/internal/MobilePopup/MobilePopupFooter/MobilePopupFooter.styles.d.ts +3 -0
  183. package/internal/MobilePopup/MobilePopupFooter/MobilePopupFooter.styles.js +14 -4
  184. package/internal/MobilePopup/MobilePopupFooter/MobilePopupFooter.styles.js.map +1 -1
  185. package/internal/MobilePopup/MobilePopupHeader/MobilePopupHeader.d.ts +4 -0
  186. package/internal/MobilePopup/MobilePopupHeader/MobilePopupHeader.js +48 -11
  187. package/internal/MobilePopup/MobilePopupHeader/MobilePopupHeader.js.map +1 -1
  188. package/internal/MobilePopup/MobilePopupHeader/MobilePopupHeader.styles.d.ts +6 -0
  189. package/internal/MobilePopup/MobilePopupHeader/MobilePopupHeader.styles.js +28 -8
  190. package/internal/MobilePopup/MobilePopupHeader/MobilePopupHeader.styles.js.map +1 -1
  191. package/internal/NativeTimeInput/NativeTimeInput.d.ts +16 -0
  192. package/internal/NativeTimeInput/NativeTimeInput.js +25 -0
  193. package/internal/NativeTimeInput/NativeTimeInput.js.map +1 -0
  194. package/internal/NativeTimeInput/NativeTimeInput.styles.d.ts +3 -0
  195. package/internal/NativeTimeInput/NativeTimeInput.styles.js +15 -0
  196. package/internal/NativeTimeInput/NativeTimeInput.styles.js.map +1 -0
  197. package/internal/NativeTimeInput/index.d.ts +1 -0
  198. package/internal/NativeTimeInput/index.js +2 -0
  199. package/internal/NativeTimeInput/index.js.map +1 -0
  200. package/internal/NativeTimeInput/utils.d.ts +7 -0
  201. package/internal/NativeTimeInput/utils.js +28 -0
  202. package/internal/NativeTimeInput/utils.js.map +1 -0
  203. package/internal/SpinnerIcon/SpinnerIcon.d.ts +3 -3
  204. package/internal/SpinnerIcon/SpinnerIcon.js +4 -4
  205. package/internal/SpinnerIcon/SpinnerIcon.js.map +1 -1
  206. package/internal/icons2022/LoadingIcon.js +1 -1
  207. package/internal/icons2022/LoadingIcon.js.map +1 -1
  208. package/internal/icons2022/QuestionCircleIcon/QuestionCircleIcon16Light.d.ts +2 -0
  209. package/internal/icons2022/QuestionCircleIcon/QuestionCircleIcon16Light.js +21 -0
  210. package/internal/icons2022/QuestionCircleIcon/QuestionCircleIcon16Light.js.map +1 -0
  211. package/internal/icons2022/QuestionCircleIcon/QuestionCircleIcon20Regular.d.ts +2 -0
  212. package/internal/icons2022/QuestionCircleIcon/QuestionCircleIcon20Regular.js +21 -0
  213. package/internal/icons2022/QuestionCircleIcon/QuestionCircleIcon20Regular.js.map +1 -0
  214. package/internal/icons2022/QuestionCircleIcon/QuestionCircleIcon24Regular.d.ts +2 -0
  215. package/internal/icons2022/QuestionCircleIcon/QuestionCircleIcon24Regular.js +21 -0
  216. package/internal/icons2022/QuestionCircleIcon/QuestionCircleIcon24Regular.js.map +1 -0
  217. package/internal/themes/BasicTheme.d.ts +48 -4
  218. package/internal/themes/BasicTheme.js +139 -5
  219. package/internal/themes/BasicTheme.js.map +1 -1
  220. package/internal/themes/DarkTheme6_1.d.ts +1 -0
  221. package/internal/themes/DarkTheme6_1.js +164 -0
  222. package/internal/themes/DarkTheme6_1.js.map +1 -0
  223. package/internal/themes/LightTheme6_1.d.ts +1 -0
  224. package/internal/themes/LightTheme6_1.js +164 -0
  225. package/internal/themes/LightTheme6_1.js.map +1 -0
  226. package/lib/theming/themes/DarkTheme.d.ts +1 -0
  227. package/lib/theming/themes/DarkTheme.js +3 -1
  228. package/lib/theming/themes/DarkTheme.js.map +1 -1
  229. package/lib/theming/themes/LightTheme.d.ts +1 -0
  230. package/lib/theming/themes/LightTheme.js +3 -1
  231. package/lib/theming/themes/LightTheme.js.map +1 -1
  232. package/package.json +3 -1
@@ -15,31 +15,53 @@ export var getStyles = memoizeGetStyles(function (_a) {
15
15
  var _a = getVerticalPaddings(t), paddingTop = _a[0], paddingBottom = _a[1];
16
16
  return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border-radius: ", ";\n border: ", ";\n display: inline-flex;\n font-size: ", ";\n line-height: ", ";\n opacity: 1;\n padding: ", " ", " ", ";\n position: relative;\n top: ", ";\n "], ["\n border-radius: ", ";\n border: ", ";\n display: inline-flex;\n font-size: ", ";\n line-height: ", ";\n opacity: 1;\n padding: ", " ", " ", ";\n position: relative;\n top: ", ";\n "])), t.toastBorderRadius, t.toastBorder, t.toastFontSize, t.toastLineHeight, paddingTop, t.toastPaddingX, paddingBottom, t.toastTop);
17
17
  },
18
+ root_6_1: function () {
19
+ return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: 0;\n "], ["\n padding: 0;\n "])));
20
+ },
21
+ rootMobile: function (t) {
22
+ return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n top: ", ";\n font-size: ", ";\n "], ["\n top: ", ";\n font-size: ", ";\n "])), t.mobileToastTop, t.mobileToastFontSize);
23
+ },
18
24
  default: function (t) {
19
- return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background: ", ";\n color: ", ";\n "], ["\n background: ", ";\n color: ", ";\n "])), t.toastBg, t.toastColor);
25
+ return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n background: ", ";\n color: ", ";\n "], ["\n background: ", ";\n color: ", ";\n "])), t.toastBg, t.toastColor);
20
26
  },
21
27
  error: function (t) {
22
- return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n background: ", ";\n color: ", ";\n "], ["\n background: ", ";\n color: ", ";\n "])), t.toastErrorBg, t.toastColorError);
28
+ return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n background: ", ";\n color: ", ";\n "], ["\n background: ", ";\n color: ", ";\n "])), t.toastErrorBg, t.toastColorError);
23
29
  },
24
30
  wrapper: function (t) {
25
- return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n height: 0;\n text-align: center;\n border-radius: ", ";\n "], ["\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n height: 0;\n text-align: center;\n border-radius: ", ";\n "])), t.toastBorderRadius);
31
+ return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n height: 0;\n text-align: center;\n border-radius: ", ";\n "], ["\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n height: 0;\n text-align: center;\n border-radius: ", ";\n "])), t.toastBorderRadius);
32
+ },
33
+ wrapper_6_1: function (t) {
34
+ return css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n padding: 0 ", ";\n "], ["\n padding: 0 ", ";\n "])), t.toastPaddingX);
35
+ },
36
+ content: function (t) {
37
+ var _a = getVerticalPaddings(t), paddingTop = _a[0], paddingBottom = _a[1];
38
+ return css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n padding: ", " ", " ", ";\n "], ["\n padding: ", " ", " ", ";\n "])), paddingTop, t.toastPaddingX, paddingBottom);
39
+ },
40
+ ellipsisContent: function () {
41
+ return css(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n text-align: start;\n "], ["\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n text-align: start;\n "])));
26
42
  },
27
43
  closeWrapper: function (t) {
28
44
  var _a = getVerticalPaddings(t), paddingTop = _a[0], paddingBottom = _a[1];
29
- return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n margin: -", " -", " -", " 0;\n "], ["\n display: flex;\n margin: -", " -", " -", " 0;\n "])), paddingTop, t.toastPaddingX, paddingBottom);
45
+ return css(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n display: flex;\n margin: -", " -", " -", " 0;\n "], ["\n display: flex;\n margin: -", " -", " -", " 0;\n "])), paddingTop, t.toastPaddingX, paddingBottom);
46
+ },
47
+ closeWrapper_6_1: function () {
48
+ return css(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n margin: 0;\n "], ["\n margin: 0;\n "])));
30
49
  },
31
50
  link: function (t) {
32
51
  var _a = getVerticalPaddings(t), paddingTop = _a[0], paddingBottom = _a[1];
33
52
  var padding = "".concat(paddingTop, " ").concat(t.toastLinkPadding);
34
- return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n border: none;\n font: inherit;\n color: ", ";\n cursor: pointer;\n display: inline-block;\n font-weight: 600;\n background-color: transparent;\n\n margin: -", " 0 -", " ", ";\n\n padding: ", ";\n transition: background ", " ", ";\n &:hover {\n background: ", ";\n text-decoration: ", ";\n }\n padding: ", ";\n transition: background ", " ", ";\n "], ["\n border: none;\n font: inherit;\n color: ", ";\n cursor: pointer;\n display: inline-block;\n font-weight: 600;\n background-color: transparent;\n\n margin: -", " 0 -", " ", ";\n\n padding: ", ";\n transition: background ", " ", ";\n &:hover {\n background: ", ";\n text-decoration: ", ";\n }\n padding: ", ";\n transition: background ", " ", ";\n "])), t.toastLinkColor, paddingTop, paddingBottom, t.toastPaddingX, padding, t.transitionDuration, t.transitionTimingFunction, t.toastLinkBgHover, t.toastLinkTextDecorationHover, padding, t.transitionDuration, t.transitionTimingFunction);
53
+ return css(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n border: none;\n font: inherit;\n color: ", ";\n cursor: pointer;\n display: inline-block;\n font-weight: 600;\n background-color: transparent;\n\n margin: -", " 0 -", " ", ";\n\n padding: ", ";\n transition: background ", " ", ";\n &:hover {\n background: ", ";\n text-decoration: ", ";\n }\n padding: ", ";\n transition: background ", " ", ";\n "], ["\n border: none;\n font: inherit;\n color: ", ";\n cursor: pointer;\n display: inline-block;\n font-weight: 600;\n background-color: transparent;\n\n margin: -", " 0 -", " ", ";\n\n padding: ", ";\n transition: background ", " ", ";\n &:hover {\n background: ", ";\n text-decoration: ", ";\n }\n padding: ", ";\n transition: background ", " ", ";\n "])), t.toastLinkColor, paddingTop, paddingBottom, t.toastPaddingX, padding, t.transitionDuration, t.transitionTimingFunction, t.toastLinkBgHover, t.toastLinkTextDecorationHover, padding, t.transitionDuration, t.transitionTimingFunction);
54
+ },
55
+ link_6_1: function (t) {
56
+ return css(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n margin: 0;\n padding: 0 ", ";\n "], ["\n margin: 0;\n padding: 0 ", ";\n "])), t.toastLinkPadding);
35
57
  },
36
58
  toastActionErrorColor: function (t) {
37
- return css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n color: ", ";\n\n &:hover {\n background: ", ";\n text-decoration: ", ";\n }\n\n &:active {\n background: ", ";\n color: ", ";\n }\n "], ["\n color: ", ";\n\n &:hover {\n background: ", ";\n text-decoration: ", ";\n }\n\n &:active {\n background: ", ";\n color: ", ";\n }\n "])), t.toastLinkColorError, t.toastLinkBgHoverError, t.toastLinkTextDecorationHover, t.toastLinkBgActiveError, t.toastLinkColorActiveError);
59
+ return css(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n color: ", ";\n\n &:hover {\n background: ", ";\n text-decoration: ", ";\n }\n\n &:active {\n background: ", ";\n color: ", ";\n }\n "], ["\n color: ", ";\n\n &:hover {\n background: ", ";\n text-decoration: ", ";\n }\n\n &:active {\n background: ", ";\n color: ", ";\n }\n "])), t.toastLinkColorError, t.toastLinkBgHoverError, t.toastLinkTextDecorationHover, t.toastLinkBgActiveError, t.toastLinkColorActiveError);
38
60
  },
39
61
  toastActionDefaultColor: function (t) {
40
- return css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n color: ", ";\n\n &:hover {\n background: ", ";\n text-decoration: ", ";\n }\n\n &:active {\n background: ", ";\n }\n "], ["\n color: ", ";\n\n &:hover {\n background: ", ";\n text-decoration: ", ";\n }\n\n &:active {\n background: ", ";\n }\n "])), t.toastLinkColor, t.toastLinkBgHover, t.toastLinkTextDecorationHover, t.toastLinkBgActive);
62
+ return css(templateObject_15 || (templateObject_15 = __makeTemplateObject(["\n color: ", ";\n\n &:hover {\n background: ", ";\n text-decoration: ", ";\n }\n\n &:active {\n background: ", ";\n }\n "], ["\n color: ", ";\n\n &:hover {\n background: ", ";\n text-decoration: ", ";\n }\n\n &:active {\n background: ", ";\n }\n "])), t.toastLinkColor, t.toastLinkBgHover, t.toastLinkTextDecorationHover, t.toastLinkBgActive);
41
63
  },
42
64
  });
43
65
  });
44
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
66
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15;
45
67
  //# sourceMappingURL=ToastView.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ToastView.styles.js","sourceRoot":"","sources":["../../../components/Toast/ToastView.styles.ts"],"names":[],"mappings":";;;;AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAGhE,IAAM,mBAAmB,GAAG,UAAC,KAAY;IAC/B,IAAA,aAAa,GAAK,KAAK,cAAV,CAAW;IAChC,IAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAC;IAEzC,OAAO,CAAC,UAAG,QAAQ,OAAI,EAAE,UAAG,QAAQ,OAAI,CAAC,CAAC;AAC5C,CAAC,CAAC;AAEF,MAAM,CAAC,IAAM,SAAS,GAAG,gBAAgB,CAAC,UAAC,EAAgB;QAAd,GAAG,SAAA;IAAgB,OAAA,CAAC;QAC/D,IAAI,YAAC,CAAQ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AAC,CAAC,gBAAgB,CAAE,CAAC;YAEtD,OAAO,GAAG,yfAAA,4DAGC,EAAgB,2IAMd,EAAU,MAAO,EAAa,GAAI,EAAe,sBAEjD,EAAO,kCACO,EAAoB,GAAI,EAA0B,0CAE3D,EAAkB,8BACb,EAA8B,6BAExC,EAAO,kCACO,EAAoB,GAAI,EAA0B,SAC5E,KAhBU,CAAC,CAAC,cAAc,EAMd,UAAU,EAAO,aAAa,EAAI,CAAC,CAAC,aAAa,EAEjD,OAAO,EACO,CAAC,CAAC,kBAAkB,EAAI,CAAC,CAAC,wBAAwB,EAE3D,CAAC,CAAC,gBAAgB,EACb,CAAC,CAAC,4BAA4B,EAExC,OAAO,EACO,CAAC,CAAC,kBAAkB,EAAI,CAAC,CAAC,wBAAwB,EAC3E;QACJ,CAAC;QAED,qBAAqB,YAAC,CAAQ;YAC5B,OAAO,GAAG,oQAAA,iBACC,EAAqB,4CAGd,EAAuB,8BAClB,EAA8B,sDAInC,EAAwB,oBAC7B,EAA2B,kBAEvC,KAXU,CAAC,CAAC,mBAAmB,EAGd,CAAC,CAAC,qBAAqB,EAClB,CAAC,CAAC,4BAA4B,EAInC,CAAC,CAAC,sBAAsB,EAC7B,CAAC,CAAC,yBAAyB,EAEtC;QACJ,CAAC;QAED,uBAAuB,YAAC,CAAQ;YAC9B,OAAO,GAAG,8OAAA,iBACC,EAAgB,4CAGT,EAAkB,8BACb,EAA8B,sDAInC,EAAmB,kBAEpC,KAVU,CAAC,CAAC,cAAc,EAGT,CAAC,CAAC,gBAAgB,EACb,CAAC,CAAC,4BAA4B,EAInC,CAAC,CAAC,iBAAiB,EAEnC;QACJ,CAAC;KACF,CAAC;AA1G8D,CA0G9D,CAAC,CAAC","sourcesContent":["import type { Emotion } from '@emotion/css/create-instance';\n\nimport { memoizeGetStyles } from '../../lib/theming/Emotion.js';\nimport type { Theme } from '../../lib/theming/Theme.js';\n\nconst getVerticalPaddings = (theme: Theme) => {\n const { toastPaddingY } = theme;\n const paddingY = parseInt(toastPaddingY);\n\n return [`${paddingY}px`, `${paddingY}px`];\n};\n\nexport const getStyles = memoizeGetStyles(({ css }: Emotion) => ({\n root(t: Theme) {\n const [paddingTop, paddingBottom] = getVerticalPaddings(t);\n return css`\n border-radius: ${t.toastBorderRadius};\n border: ${t.toastBorder};\n display: inline-flex;\n font-size: ${t.toastFontSize};\n line-height: ${t.toastLineHeight};\n opacity: 1;\n padding: ${paddingTop} ${t.toastPaddingX} ${paddingBottom};\n position: relative;\n top: ${t.toastTop};\n `;\n },\n\n default(t: Theme) {\n return css`\n background: ${t.toastBg};\n color: ${t.toastColor};\n `;\n },\n\n error(t: Theme) {\n return css`\n background: ${t.toastErrorBg};\n color: ${t.toastColorError};\n `;\n },\n\n wrapper(t: Theme) {\n return css`\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n height: 0;\n text-align: center;\n border-radius: ${t.toastBorderRadius};\n `;\n },\n\n closeWrapper(t: Theme) {\n const [paddingTop, paddingBottom] = getVerticalPaddings(t);\n return css`\n display: flex;\n margin: -${paddingTop} -${t.toastPaddingX} -${paddingBottom} 0;\n `;\n },\n\n link(t: Theme) {\n const [paddingTop, paddingBottom] = getVerticalPaddings(t);\n const padding = `${paddingTop} ${t.toastLinkPadding}`;\n\n return css`\n border: none;\n font: inherit;\n color: ${t.toastLinkColor};\n cursor: pointer;\n display: inline-block;\n font-weight: 600;\n background-color: transparent;\n\n margin: -${paddingTop} 0 -${paddingBottom} ${t.toastPaddingX};\n\n padding: ${padding};\n transition: background ${t.transitionDuration} ${t.transitionTimingFunction};\n &:hover {\n background: ${t.toastLinkBgHover};\n text-decoration: ${t.toastLinkTextDecorationHover};\n }\n padding: ${padding};\n transition: background ${t.transitionDuration} ${t.transitionTimingFunction};\n `;\n },\n\n toastActionErrorColor(t: Theme) {\n return css`\n color: ${t.toastLinkColorError};\n\n &:hover {\n background: ${t.toastLinkBgHoverError};\n text-decoration: ${t.toastLinkTextDecorationHover};\n }\n\n &:active {\n background: ${t.toastLinkBgActiveError};\n color: ${t.toastLinkColorActiveError};\n }\n `;\n },\n\n toastActionDefaultColor(t: Theme) {\n return css`\n color: ${t.toastLinkColor};\n\n &:hover {\n background: ${t.toastLinkBgHover};\n text-decoration: ${t.toastLinkTextDecorationHover};\n }\n\n &:active {\n background: ${t.toastLinkBgActive};\n }\n `;\n },\n}));\n"]}
1
+ {"version":3,"file":"ToastView.styles.js","sourceRoot":"","sources":["../../../components/Toast/ToastView.styles.ts"],"names":[],"mappings":";;;;AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAGhE,IAAM,mBAAmB,GAAG,UAAC,KAAY;IAC/B,IAAA,aAAa,GAAK,KAAK,cAAV,CAAW;IAChC,IAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAC;IAEzC,OAAO,CAAC,UAAG,QAAQ,OAAI,EAAE,UAAG,QAAQ,OAAI,CAAC,CAAC;AAC5C,CAAC,CAAC;AAEF,MAAM,CAAC,IAAM,SAAS,GAAG,gBAAgB,CAAC,UAAC,EAAgB;QAAd,GAAG,SAAA;IAAgB,OAAA,CAAC;QAC/D,IAAI,YAAC,CAAQ;YACL,IAAA,KAA8B,mBAAmB,CAAC,CAAC,CAAC,EAAnD,UAAU,QAAA,EAAE,aAAa,QAA0B,CAAC;YAC3D,OAAO,GAAG,2SAAA,yBACS,EAAmB,mBAC1B,EAAa,mDAEV,EAAe,wBACb,EAAiB,uCAErB,EAAU,GAAI,EAAe,GAAI,EAAa,2CAElD,EAAU,SAClB,KATkB,CAAC,CAAC,iBAAiB,EAC1B,CAAC,CAAC,WAAW,EAEV,CAAC,CAAC,aAAa,EACb,CAAC,CAAC,eAAe,EAErB,UAAU,EAAI,CAAC,CAAC,aAAa,EAAI,aAAa,EAElD,CAAC,CAAC,QAAQ,EACjB;QACJ,CAAC;QAED,QAAQ;YACN,OAAO,GAAG,8FAAA,2BAET,KAAC;QACJ,CAAC;QAED,UAAU,YAAC,CAAQ;YACjB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AAC,CAAC,gBAAgB,EACb,CAAC,CAAC,4BAA4B,EAInC,CAAC,CAAC,iBAAiB,EAEnC;QACJ,CAAC;KACF,CAAC;AA5J8D,CA4J9D,CAAC,CAAC","sourcesContent":["import type { Emotion } from '@emotion/css/create-instance';\n\nimport { memoizeGetStyles } from '../../lib/theming/Emotion.js';\nimport type { Theme } from '../../lib/theming/Theme.js';\n\nconst getVerticalPaddings = (theme: Theme) => {\n const { toastPaddingY } = theme;\n const paddingY = parseInt(toastPaddingY);\n\n return [`${paddingY}px`, `${paddingY}px`];\n};\n\nexport const getStyles = memoizeGetStyles(({ css }: Emotion) => ({\n root(t: Theme) {\n const [paddingTop, paddingBottom] = getVerticalPaddings(t);\n return css`\n border-radius: ${t.toastBorderRadius};\n border: ${t.toastBorder};\n display: inline-flex;\n font-size: ${t.toastFontSize};\n line-height: ${t.toastLineHeight};\n opacity: 1;\n padding: ${paddingTop} ${t.toastPaddingX} ${paddingBottom};\n position: relative;\n top: ${t.toastTop};\n `;\n },\n\n root_6_1() {\n return css`\n padding: 0;\n `;\n },\n\n rootMobile(t: Theme) {\n return css`\n top: ${t.mobileToastTop};\n font-size: ${t.mobileToastFontSize};\n `;\n },\n\n default(t: Theme) {\n return css`\n background: ${t.toastBg};\n color: ${t.toastColor};\n `;\n },\n\n error(t: Theme) {\n return css`\n background: ${t.toastErrorBg};\n color: ${t.toastColorError};\n `;\n },\n\n wrapper(t: Theme) {\n return css`\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n height: 0;\n text-align: center;\n border-radius: ${t.toastBorderRadius};\n `;\n },\n\n wrapper_6_1(t: Theme) {\n return css`\n padding: 0 ${t.toastPaddingX};\n `;\n },\n\n content(t: Theme) {\n const [paddingTop, paddingBottom] = getVerticalPaddings(t);\n return css`\n padding: ${paddingTop} ${t.toastPaddingX} ${paddingBottom};\n `;\n },\n\n ellipsisContent() {\n return css`\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n text-align: start;\n `;\n },\n\n closeWrapper(t: Theme) {\n const [paddingTop, paddingBottom] = getVerticalPaddings(t);\n return css`\n display: flex;\n margin: -${paddingTop} -${t.toastPaddingX} -${paddingBottom} 0;\n `;\n },\n\n closeWrapper_6_1() {\n return css`\n margin: 0;\n `;\n },\n\n link(t: Theme) {\n const [paddingTop, paddingBottom] = getVerticalPaddings(t);\n const padding = `${paddingTop} ${t.toastLinkPadding}`;\n\n return css`\n border: none;\n font: inherit;\n color: ${t.toastLinkColor};\n cursor: pointer;\n display: inline-block;\n font-weight: 600;\n background-color: transparent;\n\n margin: -${paddingTop} 0 -${paddingBottom} ${t.toastPaddingX};\n\n padding: ${padding};\n transition: background ${t.transitionDuration} ${t.transitionTimingFunction};\n &:hover {\n background: ${t.toastLinkBgHover};\n text-decoration: ${t.toastLinkTextDecorationHover};\n }\n padding: ${padding};\n transition: background ${t.transitionDuration} ${t.transitionTimingFunction};\n `;\n },\n\n link_6_1(t: Theme) {\n return css`\n margin: 0;\n padding: 0 ${t.toastLinkPadding};\n `;\n },\n\n toastActionErrorColor(t: Theme) {\n return css`\n color: ${t.toastLinkColorError};\n\n &:hover {\n background: ${t.toastLinkBgHoverError};\n text-decoration: ${t.toastLinkTextDecorationHover};\n }\n\n &:active {\n background: ${t.toastLinkBgActiveError};\n color: ${t.toastLinkColorActiveError};\n }\n `;\n },\n\n toastActionDefaultColor(t: Theme) {\n return css`\n color: ${t.toastLinkColor};\n\n &:hover {\n background: ${t.toastLinkBgHover};\n text-decoration: ${t.toastLinkTextDecorationHover};\n }\n\n &:active {\n background: ${t.toastLinkBgActive};\n }\n `;\n },\n}));\n"]}
@@ -50,13 +50,13 @@ export interface TooltipProps extends CommonProps {
50
50
  useWrapper?: boolean;
51
51
  /** Задержка в миллисекундах до появления тултипа. */
52
52
  delayBeforeShow?: number;
53
- /** Событие нажатия на крестик. */
53
+ /** Вызывается при клике по крестику. */
54
54
  onCloseClick?: React.MouseEventHandler<HTMLElement>;
55
- /** Событие нажатия на крестик или снаружи тултипа. */
55
+ /** Вызывается при клике по крестику или снаружи тултипа. */
56
56
  onCloseRequest?: (event?: Event | React.MouseEvent) => void;
57
- /** Событие закрытия тултипа. */
57
+ /** Вызывается при закрытии тултипа. */
58
58
  onClose?: () => void;
59
- /** Событие открытия тултипа. */
59
+ /** Вызывается при открытии тултипа. */
60
60
  onOpen?: () => void;
61
61
  }
62
62
  export interface TooltipState {
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../../../components/Tooltip/Tooltip.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAE,eAAe,EAAE,MAAM,mDAAmD,CAAC;AAEpF,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAEtE,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAElE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAG5D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,+BAA+B,EAAE,MAAM,iCAAiC,CAAC;AAClF,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAE7E,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAE3D,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAEjE,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,OAAO,EA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OAAO","sourcesContent":["import type { Emotion } from '@emotion/css/create-instance';\nimport React, { type JSX } from 'react';\nimport warning from 'warning';\n\nimport { CloseButtonIcon } from '../../internal/CloseButtonIcon/CloseButtonIcon.js';\nimport type { CommonProps } from '../../internal/CommonWrapper/index.js';\nimport { CommonWrapper } from '../../internal/CommonWrapper/index.js';\nimport type { PopupPositionsType, PopupProps, ShortPopupPositionsType } from '../../internal/Popup/index.js';\nimport { Popup } from '../../internal/Popup/index.js';\nimport { RenderLayer } from '../../internal/RenderLayer/index.js';\nimport type { RenderLayerProps } from '../../internal/RenderLayer/index.js';\nimport { createPropsGetter } from '../../lib/createPropsGetter.js';\nimport { isTestEnv } from '../../lib/currentEnvironment.js';\nimport type { GlobalObject, SafeTimer } from '../../lib/globalObject.js';\nimport type { InstanceWithAnchorElement } from '../../lib/InstanceWithAnchorElement.js';\nimport { isInstanceOf } from '../../lib/isInstanceOf.js';\nimport { containsTargetOrRenderContainer } from '../../lib/listenFocusOutside.js';\nimport { withRenderEnvironment } from '../../lib/renderEnvironment/index.js';\nimport type { TGetRootNode, TSetRootNode } from '../../lib/rootNode/index.js';\nimport { rootNode } from '../../lib/rootNode/index.js';\nimport { withSize } from '../../lib/size/SizeDecorator.js';\nimport type { Theme } from '../../lib/theming/Theme.js';\nimport { ThemeContext } from '../../lib/theming/ThemeContext.js';\nimport { ThemeFactory } from '../../lib/theming/ThemeFactory.js';\nimport type { SizeProp } from '../../lib/types/props.js';\nimport { isNullable } from '../../lib/utils.js';\nimport type { MouseEventType } from '../../typings/event-types.js';\nimport type { Nullable } from '../../typings/utility-types.js';\nimport { getStyles } from './Tooltip.styles.js';\n\nexport type TooltipTrigger =\n /** Наведение на children и на тултип */\n | 'hover'\n /** Клик на children */\n | 'click'\n /** Фокус на children */\n | 'focus'\n /** Наведение на children и на тултип и фокус на children */\n | 'hover&focus'\n /** Просто открыт */\n | 'opened'\n /** Просто закрыт */\n | 'closed'\n /** Наведение ТОЛЬКО на children, а не на тултип */\n | 'hoverAnchor'\n /** Управление через публичные функции show и hide */\n | 'manual';\n\nexport interface TooltipProps extends CommonProps {\n /** @ignore */\n children?: React.ReactNode;\n\n /** Функция, возвращающая содержимое тултипа. При возврате `null` тултип не показывается. */\n render?: Nullable<() => React.ReactNode>;\n\n /** Размер тултипа.\n * @default small */\n size?: SizeProp;\n\n /** Приоритетное расположение тултипа относительно элемента. */\n pos?: ShortPopupPositionsType | PopupPositionsType;\n\n /** Список позиций, которые может занимать тултип. В списке обязательно должна быть позиция из пропа `pos`. */\n allowedPositions?: PopupPositionsType[];\n\n /** Триггер открытия тултипа. */\n trigger?: TooltipTrigger;\n\n /** Показывает крестик для закрытия тултипа.\n * По умолчанию крестик показывается, если проп `trigger` не равен `hover` или `focus`. */\n closeButton?: boolean;\n\n /** Элемент, относительно которого позиционируется тултип. */\n anchorElement?: HTMLElement;\n\n /** Отключает анимацию.\n * @default false */\n disableAnimations?: boolean;\n\n /** Оборачивает вложенные элементы в `<span />`.\n *\n * _Примечание_: при двух и более вложенных элементах обёртка будет добавлена автоматически. */\n useWrapper?: boolean;\n\n /** Задержка в миллисекундах до появления тултипа. */\n delayBeforeShow?: number;\n\n /** Событие нажатия на крестик. */\n onCloseClick?: React.MouseEventHandler<HTMLElement>;\n\n /** Событие нажатия на крестик или снаружи тултипа. */\n onCloseRequest?: (event?: Event | React.MouseEvent) => void;\n\n /** Событие закрытия тултипа. */\n onClose?: () => void;\n\n /** Событие открытия тултипа. */\n onOpen?: () => void;\n}\n\nconst DEFAULT_DELAY = 100;\n\nexport interface TooltipState {\n opened: boolean;\n focused: boolean;\n}\n\nexport const TooltipDataTids = {\n root: 'Tooltip__root',\n content: 'Tooltip__content',\n crossIcon: 'Tooltip__crossIcon',\n} as const;\n\nconst DefaultPositions: PopupPositionsType[] = [\n 'right bottom',\n 'right middle',\n 'right top',\n 'top right',\n 'top center',\n 'top left',\n 'left top',\n 'left middle',\n 'left bottom',\n 'bottom left',\n 'bottom center',\n 'bottom right',\n];\n\ninterface TooltipSizeVariables {\n closeButtonStyle: string;\n contentStyle: string;\n borderRadius: string;\n pinSize: string;\n pinOffsetX: string;\n pinOffsetY: string;\n margin: string;\n}\n\ntype DefaultProps = Required<Pick<TooltipProps, 'trigger' | 'disableAnimations' | 'useWrapper' | 'delayBeforeShow'>>;\n\n/**\n * Подсказка, которая объясняет состояние контрола или даёт контекстную справку.\n *\n * Открывается по клику, фокусу на элемент или наведению.\n * Может содержать изображения, кнопки, ссылки и прочие интерактивные элементы.\n */\n@withRenderEnvironment\n@rootNode\n@withSize\nexport class Tooltip extends React.PureComponent<TooltipProps, TooltipState> implements InstanceWithAnchorElement {\n public static __KONTUR_REACT_UI__ = 'Tooltip';\n public static displayName = 'Tooltip';\n\n public static defaultProps: DefaultProps = {\n trigger: 'hover',\n disableAnimations: isTestEnv,\n useWrapper: false,\n delayBeforeShow: DEFAULT_DELAY,\n };\n\n private getProps = createPropsGetter(Tooltip.defaultProps);\n private validateProps(props: TooltipProps): void {\n warning(\n props.children || props.anchorElement,\n `[Tooltip]: you must provide either 'children' or 'anchorElement' prop for Tooltip to work properly`,\n );\n }\n\n public static delay = DEFAULT_DELAY;\n private static triggersWithoutCloseButton: TooltipTrigger[] = ['hover', 'hoverAnchor', 'focus', 'hover&focus'];\n\n public state: TooltipState = { opened: false, focused: false };\n private globalObject!: GlobalObject;\n private emotion!: Emotion;\n private cx!: Emotion['cx'];\n private styles!: ReturnType<typeof getStyles>;\n private theme!: Theme;\n private size!: SizeProp;\n private sizeVariables!: TooltipSizeVariables;\n private hoverTimeout: SafeTimer;\n private contentElement: Nullable<HTMLElement> = null;\n private clickedOutside = true;\n public getRootNode!: TGetRootNode;\n private setRootNode!: TSetRootNode;\n\n private popupRef = React.createRef<Popup>();\n\n public getAllowedPositions(): string[] {\n return this.props.allowedPositions ? this.props.allowedPositions : DefaultPositions;\n }\n\n public componentDidMount(): void {\n this.validateProps(this.getProps());\n }\n\n public componentDidUpdate() {\n const { trigger } = this.getProps();\n\n this.validateProps(this.getProps());\n if (trigger === 'closed' && this.state.opened) {\n this.close();\n }\n }\n\n public componentWillUnmount() {\n this.clearHoverTimeout();\n }\n\n public render(): React.JSX.Element {\n this.styles = getStyles(this.emotion);\n\n return (\n <ThemeContext.Consumer>\n {(theme) => {\n this.theme = theme;\n this.sizeVariables = this.getSizeVariables();\n return (\n <ThemeContext.Provider\n value={ThemeFactory.create(\n {\n popupBackground: theme.tooltipBg,\n popupBorder: theme.tooltipBorder,\n popupBorderRadius: this.sizeVariables.borderRadius,\n popupPinSize: this.sizeVariables.pinSize,\n popupPinOffsetX: this.sizeVariables.pinOffsetX,\n popupPinOffsetY: this.sizeVariables.pinOffsetY,\n popupMargin: this.sizeVariables.margin,\n },\n theme,\n )}\n >\n {this.renderMain()}\n </ThemeContext.Provider>\n );\n }}\n </ThemeContext.Consumer>\n );\n }\n\n public renderContent = (): React.JSX.Element | null => {\n const content = this.props.render ? this.props.render() : null;\n if (isNullable(content)) {\n return null;\n }\n\n return (\n <div\n ref={this.refContent}\n className={this.cx(this.styles.tooltipContent(this.theme), this.sizeVariables.contentStyle)}\n data-tid={TooltipDataTids.content}\n >\n {content}\n {this.renderCloseButton()}\n </div>\n );\n };\n\n public renderCloseButton(): React.JSX.Element | null {\n const hasCross =\n this.props.closeButton === undefined\n ? !Tooltip.triggersWithoutCloseButton.includes(this.getProps().trigger)\n : this.props.closeButton;\n\n if (!hasCross) {\n return null;\n }\n\n const icon = (\n <CloseButtonIcon\n tabbable={false}\n side={parseInt(this.theme.tooltipCloseBtnSide)}\n color={this.theme.tooltipCloseBtnColor}\n colorHover={this.theme.tooltipCloseBtnHoverColor}\n />\n );\n\n return (\n <div\n className={this.cx(this.styles.closeButton(this.theme), this.sizeVariables.closeButtonStyle)}\n onClick={this.handleCloseButtonClick}\n data-tid={TooltipDataTids.crossIcon}\n >\n {icon}\n </div>\n );\n }\n\n public getAnchorElement = (): Nullable<Element> => {\n return this.popupRef.current?.anchorElement;\n };\n\n /**\n * Открывает тултип.\n * <p>Не работает при `trigger` = \"opened\" | \"closed\"`.</p>\n * @public\n */\n public show(): void {\n if (this.state.opened) {\n return;\n }\n const trigger = this.getProps().trigger;\n if (trigger === 'opened' || trigger === 'closed') {\n warning(false, `Function 'show' is not supported with trigger specified '${trigger}'`);\n return;\n }\n this.open();\n }\n\n /**\n * Закрывает тултип.\n * <p>Не работает при `trigger` = \"opened\" | \"closed\"`.</p>\n * @public\n */\n public hide(): void {\n const trigger = this.getProps().trigger;\n if (trigger === 'opened' || trigger === 'closed') {\n warning(false, `Function 'hide' is not supported with trigger specified '${trigger}'`);\n return;\n }\n this.close();\n }\n\n private renderMain() {\n const props = this.props;\n const content = this.renderContent();\n const { popupProps, layerProps = { active: false } } = this.getPopupAndLayerProps();\n const anchorElement = props.children || props.anchorElement;\n const popup = this.renderPopup(anchorElement, popupProps, content);\n\n return (\n <RenderLayer {...layerProps} getAnchorElement={this.getAnchorElement}>\n {popup}\n </RenderLayer>\n );\n }\n\n private renderPopup(\n anchorElement: React.ReactNode | HTMLElement,\n popupProps: Partial<PopupProps>,\n content: JSX.Element | null,\n ) {\n const { disableAnimations, trigger } = this.getProps();\n return (\n <CommonWrapper rootNodeRef={this.setRootNode} {...this.props}>\n <Popup\n data-tid={TooltipDataTids.root}\n anchorElement={anchorElement}\n hasPin\n hasShadow\n maxWidth=\"none\"\n opened={this.state.opened}\n disableAnimations={disableAnimations}\n positions={this.getPositions()}\n pos={this.props.pos}\n ignoreHover={trigger === 'hoverAnchor'}\n onOpen={this.props.onOpen}\n onClose={this.props.onClose}\n tryPreserveFirstRenderedPosition\n ref={this.popupRef}\n withoutMobile\n {...popupProps}\n >\n {content}\n </Popup>\n </CommonWrapper>\n );\n }\n\n private getPositions = (): PopupPositionsType[] =>\n this.props.allowedPositions\n ? this.props.allowedPositions.filter((item) => DefaultPositions.includes(item))\n : DefaultPositions;\n\n private refContent = (node: HTMLElement | null) => {\n this.contentElement = node;\n };\n\n private getPopupAndLayerProps(): {\n layerProps?: Partial<RenderLayerProps>;\n popupProps: Partial<PopupProps>;\n } {\n const props = this.props;\n const useWrapper = !!props.children && this.getProps().useWrapper;\n const trigger = this.getProps().trigger;\n\n const defaultPopupAndLayerProps: ReturnType<typeof this.getPopupAndLayerProps> = {\n popupProps: {\n onMouseEnter: this.handleMouseEnter,\n onMouseLeave: this.handleMouseLeave,\n useWrapper,\n },\n };\n\n switch (trigger) {\n case 'opened':\n return {\n layerProps: {\n active: true,\n onClickOutside: this.handleClickOutsideAnchor,\n },\n popupProps: {\n opened: true,\n useWrapper,\n },\n };\n\n case 'closed':\n return {\n popupProps: {\n opened: false,\n useWrapper,\n },\n };\n\n case 'manual':\n return {\n popupProps: {\n useWrapper,\n },\n };\n case 'click':\n return {\n layerProps: {\n active: this.state.opened,\n onClickOutside: this.handleClickOutsideAnchor,\n },\n popupProps: {\n onClick: this.handleClick,\n useWrapper,\n },\n };\n\n case 'focus':\n return {\n popupProps: {\n onFocus: this.handleFocus,\n onBlur: this.handleBlur,\n useWrapper,\n },\n };\n\n case 'hover&focus':\n return {\n layerProps: {\n active: this.state.opened,\n onClickOutside: this.handleClickOutsideAnchor,\n },\n popupProps: {\n onFocus: this.handleFocus,\n onBlur: this.handleBlur,\n onMouseEnter: this.handleMouseEnter,\n onMouseLeave: this.handleMouseLeave,\n useWrapper,\n },\n };\n\n case 'hoverAnchor':\n case 'hover':\n return defaultPopupAndLayerProps;\n default:\n warning(false, `Unknown trigger specified: ${trigger}. Returning default value.`);\n return defaultPopupAndLayerProps;\n }\n }\n\n private open = () => this.setState({ opened: true });\n\n private close = () => this.setState({ opened: false });\n\n private clearHoverTimeout() {\n if (this.hoverTimeout) {\n clearTimeout(this.hoverTimeout);\n this.hoverTimeout = null;\n }\n }\n\n private handleMouseEnter = (event: MouseEventType) => {\n const isHoverAnchor = this.getProps().trigger === 'hoverAnchor';\n if (isHoverAnchor && event.target === this.contentElement) {\n return;\n }\n\n this.clearHoverTimeout();\n this.hoverTimeout = setTimeout(this.open, this.getProps().delayBeforeShow);\n };\n\n private handleMouseLeave = (event: MouseEventType) => {\n const trigger = this.getProps().trigger;\n if (\n (trigger === 'hover&focus' && this.state.focused) ||\n (trigger === 'hover' && event.relatedTarget === this.contentElement)\n ) {\n return;\n }\n\n this.clearHoverTimeout();\n\n if (trigger === 'hoverAnchor') {\n this.close();\n } else {\n this.hoverTimeout = setTimeout(this.close, Tooltip.delay);\n }\n };\n\n private handleClick = () => {\n this.open();\n };\n\n private handleClickOutsideAnchor = (event: Event) => {\n this.clickedOutside = this.isClickOutsideContent(event);\n if (this.clickedOutside) {\n if (this.props.onCloseRequest) {\n this.props.onCloseRequest(event);\n }\n this.close();\n }\n };\n\n private isClickOutsideContent(event: Event) {\n if (this.contentElement && isInstanceOf(event.target, this.globalObject.Element)) {\n return !containsTargetOrRenderContainer(event.target)(this.contentElement);\n }\n\n return true;\n }\n\n private handleFocus = () => {\n this.setState({ focused: true });\n this.open();\n };\n\n private handleBlur = () => {\n const trigger = this.getProps().trigger;\n if (trigger === 'hover&focus' && this.clickedOutside) {\n this.close();\n }\n\n if (trigger === 'focus') {\n this.close();\n }\n\n this.clickedOutside = true;\n this.setState({ focused: false });\n };\n\n private handleCloseButtonClick = (event: React.MouseEvent<HTMLElement>) => {\n event.stopPropagation();\n\n if (this.props.onCloseClick) {\n this.props.onCloseClick(event);\n }\n\n if (event.defaultPrevented) {\n return;\n }\n\n if (this.props.onCloseRequest) {\n this.props.onCloseRequest(event);\n }\n\n this.close();\n };\n\n private getSizeVariables = (): TooltipSizeVariables => {\n switch (this.size) {\n case 'small':\n return {\n closeButtonStyle: this.styles.closeButtonSmall(this.theme),\n contentStyle: this.styles.tooltipContentSmall(this.theme),\n borderRadius: this.theme.tooltipBorderRadiusSmall,\n pinSize: this.theme.tooltipPinSizeSmall,\n pinOffsetX: this.theme.tooltipPinOffsetXSmall,\n pinOffsetY: this.theme.tooltipPinOffsetYSmall,\n margin: this.theme.tooltipMarginSmall,\n };\n case 'medium':\n return {\n closeButtonStyle: this.styles.closeButtonMedium(this.theme),\n contentStyle: this.styles.tooltipContentMedium(this.theme),\n borderRadius: this.theme.tooltipBorderRadiusMedium,\n pinSize: this.theme.tooltipPinSizeMedium,\n pinOffsetX: this.theme.tooltipPinOffsetXMedium,\n pinOffsetY: this.theme.tooltipPinOffsetYMedium,\n margin: this.theme.tooltipMarginMedium,\n };\n case 'large':\n return {\n closeButtonStyle: this.styles.closeButtonLarge(this.theme),\n contentStyle: this.styles.tooltipContentLarge(this.theme),\n borderRadius: this.theme.tooltipBorderRadiusLarge,\n pinSize: this.theme.tooltipPinSizeLarge,\n pinOffsetX: this.theme.tooltipPinOffsetXLarge,\n pinOffsetY: this.theme.tooltipPinOffsetYLarge,\n margin: this.theme.tooltipMarginLarge,\n };\n default:\n warning(false, `Can't get size variables: invalid value in size prop '${this.props.size}'. Returning default`);\n return {\n closeButtonStyle: this.styles.closeButtonSmall(this.theme),\n contentStyle: this.styles.tooltipContentSmall(this.theme),\n borderRadius: this.theme.tooltipBorderRadiusSmall,\n pinSize: this.theme.tooltipPinSizeSmall,\n pinOffsetX: this.theme.tooltipPinOffsetXSmall,\n pinOffsetY: this.theme.tooltipPinOffsetYSmall,\n margin: this.theme.tooltipMarginSmall,\n };\n }\n };\n}\n"]}
1
+ {"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../../../components/Tooltip/Tooltip.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAE,eAAe,EAAE,MAAM,mDAAmD,CAAC;AAEpF,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAEtE,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAElE,OAAO,EAAE,iBAAiB,EAAE,MAAM,g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,CAAC;;IAtXa,2BAAmB,GAAG,SAAS,AAAZ,CAAa;IAChC,mBAAW,GAAG,SAAS,AAAZ,CAAa;IAExB,oBAAY,GAAiB;QACzC,OAAO,EAAE,OAAO;QAChB,iBAAiB,EAAE,SAAS;QAC5B,UAAU,EAAE,KAAK;QACjB,eAAe,EAAE,aAAa;KAC/B,AALyB,CAKxB;IAUY,aAAK,GAAG,aAAa,AAAhB,CAAiB;IACrB,kCAA0B,GAAqB,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,aAAa,CAAC,AAArE,CAAsE;IApBpG,OAAO;QAHnB,qBAAqB;QACrB,QAAQ;QACR,QAAQ;OACI,OAAO,CA2cnB;IAAD,cAAC;CAAA,AA3cD,CAA6B,KAAK,CAAC,aAAa,GA2c/C;SA3cY,OAAO","sourcesContent":["import type { Emotion } from '@emotion/css/create-instance';\nimport React, { type JSX } from 'react';\nimport warning from 'warning';\n\nimport { CloseButtonIcon } from '../../internal/CloseButtonIcon/CloseButtonIcon.js';\nimport type { CommonProps } from '../../internal/CommonWrapper/index.js';\nimport { CommonWrapper } from '../../internal/CommonWrapper/index.js';\nimport type { PopupPositionsType, PopupProps, ShortPopupPositionsType } from '../../internal/Popup/index.js';\nimport { Popup } from '../../internal/Popup/index.js';\nimport { RenderLayer } from '../../internal/RenderLayer/index.js';\nimport type { RenderLayerProps } from '../../internal/RenderLayer/index.js';\nimport { createPropsGetter } from '../../lib/createPropsGetter.js';\nimport { isTestEnv } from '../../lib/currentEnvironment.js';\nimport type { GlobalObject, SafeTimer } from '../../lib/globalObject.js';\nimport type { InstanceWithAnchorElement } from '../../lib/InstanceWithAnchorElement.js';\nimport { isInstanceOf } from '../../lib/isInstanceOf.js';\nimport { containsTargetOrRenderContainer } from '../../lib/listenFocusOutside.js';\nimport { withRenderEnvironment } from '../../lib/renderEnvironment/index.js';\nimport type { TGetRootNode, TSetRootNode } from '../../lib/rootNode/index.js';\nimport { rootNode } from '../../lib/rootNode/index.js';\nimport { withSize } from '../../lib/size/SizeDecorator.js';\nimport type { Theme } from '../../lib/theming/Theme.js';\nimport { ThemeContext } from '../../lib/theming/ThemeContext.js';\nimport { ThemeFactory } from '../../lib/theming/ThemeFactory.js';\nimport type { SizeProp } from '../../lib/types/props.js';\nimport { isNullable } from '../../lib/utils.js';\nimport type { MouseEventType } from '../../typings/event-types.js';\nimport type { Nullable } from '../../typings/utility-types.js';\nimport { getStyles } from './Tooltip.styles.js';\n\nexport type TooltipTrigger =\n /** Наведение на children и на тултип */\n | 'hover'\n /** Клик на children */\n | 'click'\n /** Фокус на children */\n | 'focus'\n /** Наведение на children и на тултип и фокус на children */\n | 'hover&focus'\n /** Просто открыт */\n | 'opened'\n /** Просто закрыт */\n | 'closed'\n /** Наведение ТОЛЬКО на children, а не на тултип */\n | 'hoverAnchor'\n /** Управление через публичные функции show и hide */\n | 'manual';\n\nexport interface TooltipProps extends CommonProps {\n /** @ignore */\n children?: React.ReactNode;\n\n /** Функция, возвращающая содержимое тултипа. При возврате `null` тултип не показывается. */\n render?: Nullable<() => React.ReactNode>;\n\n /** Размер тултипа.\n * @default small */\n size?: SizeProp;\n\n /** Приоритетное расположение тултипа относительно элемента. */\n pos?: ShortPopupPositionsType | PopupPositionsType;\n\n /** Список позиций, которые может занимать тултип. В списке обязательно должна быть позиция из пропа `pos`. */\n allowedPositions?: PopupPositionsType[];\n\n /** Триггер открытия тултипа. */\n trigger?: TooltipTrigger;\n\n /** Показывает крестик для закрытия тултипа.\n * По умолчанию крестик показывается, если проп `trigger` не равен `hover` или `focus`. */\n closeButton?: boolean;\n\n /** Элемент, относительно которого позиционируется тултип. */\n anchorElement?: HTMLElement;\n\n /** Отключает анимацию.\n * @default false */\n disableAnimations?: boolean;\n\n /** Оборачивает вложенные элементы в `<span />`.\n *\n * _Примечание_: при двух и более вложенных элементах обёртка будет добавлена автоматически. */\n useWrapper?: boolean;\n\n /** Задержка в миллисекундах до появления тултипа. */\n delayBeforeShow?: number;\n\n /** Вызывается при клике по крестику. */\n onCloseClick?: React.MouseEventHandler<HTMLElement>;\n\n /** Вызывается при клике по крестику или снаружи тултипа. */\n onCloseRequest?: (event?: Event | React.MouseEvent) => void;\n\n /** Вызывается при закрытии тултипа. */\n onClose?: () => void;\n\n /** Вызывается при открытии тултипа. */\n onOpen?: () => void;\n}\n\nconst DEFAULT_DELAY = 100;\n\nexport interface TooltipState {\n opened: boolean;\n focused: boolean;\n}\n\nexport const TooltipDataTids = {\n root: 'Tooltip__root',\n content: 'Tooltip__content',\n crossIcon: 'Tooltip__crossIcon',\n} as const;\n\nconst DefaultPositions: PopupPositionsType[] = [\n 'right bottom',\n 'right middle',\n 'right top',\n 'top right',\n 'top center',\n 'top left',\n 'left top',\n 'left middle',\n 'left bottom',\n 'bottom left',\n 'bottom center',\n 'bottom right',\n];\n\ninterface TooltipSizeVariables {\n closeButtonStyle: string;\n contentStyle: string;\n borderRadius: string;\n pinSize: string;\n pinOffsetX: string;\n pinOffsetY: string;\n margin: string;\n}\n\ntype DefaultProps = Required<Pick<TooltipProps, 'trigger' | 'disableAnimations' | 'useWrapper' | 'delayBeforeShow'>>;\n\n/**\n * Подсказка, которая объясняет состояние контрола или даёт контекстную справку.\n *\n * Открывается по клику, фокусу на элемент или наведению.\n * Может содержать изображения, кнопки, ссылки и прочие интерактивные элементы.\n */\n@withRenderEnvironment\n@rootNode\n@withSize\nexport class Tooltip extends React.PureComponent<TooltipProps, TooltipState> implements InstanceWithAnchorElement {\n public static __KONTUR_REACT_UI__ = 'Tooltip';\n public static displayName = 'Tooltip';\n\n public static defaultProps: DefaultProps = {\n trigger: 'hover',\n disableAnimations: isTestEnv,\n useWrapper: false,\n delayBeforeShow: DEFAULT_DELAY,\n };\n\n private getProps = createPropsGetter(Tooltip.defaultProps);\n private validateProps(props: TooltipProps): void {\n warning(\n props.children || props.anchorElement,\n `[Tooltip]: you must provide either 'children' or 'anchorElement' prop for Tooltip to work properly`,\n );\n }\n\n public static delay = DEFAULT_DELAY;\n private static triggersWithoutCloseButton: TooltipTrigger[] = ['hover', 'hoverAnchor', 'focus', 'hover&focus'];\n\n public state: TooltipState = { opened: false, focused: false };\n private globalObject!: GlobalObject;\n private emotion!: Emotion;\n private cx!: Emotion['cx'];\n private styles!: ReturnType<typeof getStyles>;\n private theme!: Theme;\n private size!: SizeProp;\n private sizeVariables!: TooltipSizeVariables;\n private hoverTimeout: SafeTimer;\n private contentElement: Nullable<HTMLElement> = null;\n private clickedOutside = true;\n public getRootNode!: TGetRootNode;\n private setRootNode!: TSetRootNode;\n\n private popupRef = React.createRef<Popup>();\n\n public getAllowedPositions(): string[] {\n return this.props.allowedPositions ? this.props.allowedPositions : DefaultPositions;\n }\n\n public componentDidMount(): void {\n this.validateProps(this.getProps());\n }\n\n public componentDidUpdate() {\n const { trigger } = this.getProps();\n\n this.validateProps(this.getProps());\n if (trigger === 'closed' && this.state.opened) {\n this.close();\n }\n }\n\n public componentWillUnmount() {\n this.clearHoverTimeout();\n }\n\n public render(): React.JSX.Element {\n this.styles = getStyles(this.emotion);\n\n return (\n <ThemeContext.Consumer>\n {(theme) => {\n this.theme = theme;\n this.sizeVariables = this.getSizeVariables();\n return (\n <ThemeContext.Provider\n value={ThemeFactory.create(\n {\n popupBackground: theme.tooltipBg,\n popupBorder: theme.tooltipBorder,\n popupBorderRadius: this.sizeVariables.borderRadius,\n popupPinSize: this.sizeVariables.pinSize,\n popupPinOffsetX: this.sizeVariables.pinOffsetX,\n popupPinOffsetY: this.sizeVariables.pinOffsetY,\n popupMargin: this.sizeVariables.margin,\n },\n theme,\n )}\n >\n {this.renderMain()}\n </ThemeContext.Provider>\n );\n }}\n </ThemeContext.Consumer>\n );\n }\n\n public renderContent = (): React.JSX.Element | null => {\n const content = this.props.render ? this.props.render() : null;\n if (isNullable(content)) {\n return null;\n }\n\n return (\n <div\n ref={this.refContent}\n className={this.cx(this.styles.tooltipContent(this.theme), this.sizeVariables.contentStyle)}\n data-tid={TooltipDataTids.content}\n >\n {content}\n {this.renderCloseButton()}\n </div>\n );\n };\n\n public renderCloseButton(): React.JSX.Element | null {\n const hasCross =\n this.props.closeButton === undefined\n ? !Tooltip.triggersWithoutCloseButton.includes(this.getProps().trigger)\n : this.props.closeButton;\n\n if (!hasCross) {\n return null;\n }\n\n const icon = (\n <CloseButtonIcon\n tabbable={false}\n side={parseInt(this.theme.tooltipCloseBtnSide)}\n color={this.theme.tooltipCloseBtnColor}\n colorHover={this.theme.tooltipCloseBtnHoverColor}\n />\n );\n\n return (\n <div\n className={this.cx(this.styles.closeButton(this.theme), this.sizeVariables.closeButtonStyle)}\n onClick={this.handleCloseButtonClick}\n data-tid={TooltipDataTids.crossIcon}\n >\n {icon}\n </div>\n );\n }\n\n public getAnchorElement = (): Nullable<Element> => {\n return this.popupRef.current?.anchorElement;\n };\n\n /**\n * Открывает тултип.\n * <p>Не работает при `trigger` = \"opened\" | \"closed\"`.</p>\n * @public\n */\n public show(): void {\n if (this.state.opened) {\n return;\n }\n const trigger = this.getProps().trigger;\n if (trigger === 'opened' || trigger === 'closed') {\n warning(false, `Function 'show' is not supported with trigger specified '${trigger}'`);\n return;\n }\n this.open();\n }\n\n /**\n * Закрывает тултип.\n * <p>Не работает при `trigger` = \"opened\" | \"closed\"`.</p>\n * @public\n */\n public hide(): void {\n const trigger = this.getProps().trigger;\n if (trigger === 'opened' || trigger === 'closed') {\n warning(false, `Function 'hide' is not supported with trigger specified '${trigger}'`);\n return;\n }\n this.close();\n }\n\n private renderMain() {\n const props = this.props;\n const content = this.renderContent();\n const { popupProps, layerProps = { active: false } } = this.getPopupAndLayerProps();\n const anchorElement = props.children || props.anchorElement;\n const popup = this.renderPopup(anchorElement, popupProps, content);\n\n return (\n <RenderLayer {...layerProps} getAnchorElement={this.getAnchorElement}>\n {popup}\n </RenderLayer>\n );\n }\n\n private renderPopup(\n anchorElement: React.ReactNode | HTMLElement,\n popupProps: Partial<PopupProps>,\n content: JSX.Element | null,\n ) {\n const { disableAnimations, trigger } = this.getProps();\n return (\n <CommonWrapper rootNodeRef={this.setRootNode} {...this.props}>\n <Popup\n data-tid={TooltipDataTids.root}\n anchorElement={anchorElement}\n hasPin\n hasShadow\n maxWidth=\"none\"\n opened={this.state.opened}\n disableAnimations={disableAnimations}\n positions={this.getPositions()}\n pos={this.props.pos}\n ignoreHover={trigger === 'hoverAnchor'}\n onOpen={this.props.onOpen}\n onClose={this.props.onClose}\n tryPreserveFirstRenderedPosition\n ref={this.popupRef}\n withoutMobile\n {...popupProps}\n >\n {content}\n </Popup>\n </CommonWrapper>\n );\n }\n\n private getPositions = (): PopupPositionsType[] =>\n this.props.allowedPositions\n ? this.props.allowedPositions.filter((item) => DefaultPositions.includes(item))\n : DefaultPositions;\n\n private refContent = (node: HTMLElement | null) => {\n this.contentElement = node;\n };\n\n private getPopupAndLayerProps(): {\n layerProps?: Partial<RenderLayerProps>;\n popupProps: Partial<PopupProps>;\n } {\n const props = this.props;\n const useWrapper = !!props.children && this.getProps().useWrapper;\n const trigger = this.getProps().trigger;\n\n const defaultPopupAndLayerProps: ReturnType<typeof this.getPopupAndLayerProps> = {\n popupProps: {\n onMouseEnter: this.handleMouseEnter,\n onMouseLeave: this.handleMouseLeave,\n useWrapper,\n },\n };\n\n switch (trigger) {\n case 'opened':\n return {\n layerProps: {\n active: true,\n onClickOutside: this.handleClickOutsideAnchor,\n },\n popupProps: {\n opened: true,\n useWrapper,\n },\n };\n\n case 'closed':\n return {\n popupProps: {\n opened: false,\n useWrapper,\n },\n };\n\n case 'manual':\n return {\n popupProps: {\n useWrapper,\n },\n };\n case 'click':\n return {\n layerProps: {\n active: this.state.opened,\n onClickOutside: this.handleClickOutsideAnchor,\n },\n popupProps: {\n onClick: this.handleClick,\n useWrapper,\n },\n };\n\n case 'focus':\n return {\n popupProps: {\n onFocus: this.handleFocus,\n onBlur: this.handleBlur,\n useWrapper,\n },\n };\n\n case 'hover&focus':\n return {\n layerProps: {\n active: this.state.opened,\n onClickOutside: this.handleClickOutsideAnchor,\n },\n popupProps: {\n onFocus: this.handleFocus,\n onBlur: this.handleBlur,\n onMouseEnter: this.handleMouseEnter,\n onMouseLeave: this.handleMouseLeave,\n useWrapper,\n },\n };\n\n case 'hoverAnchor':\n case 'hover':\n return defaultPopupAndLayerProps;\n default:\n warning(false, `Unknown trigger specified: ${trigger}. Returning default value.`);\n return defaultPopupAndLayerProps;\n }\n }\n\n private open = () => this.setState({ opened: true });\n\n private close = () => this.setState({ opened: false });\n\n private clearHoverTimeout() {\n if (this.hoverTimeout) {\n clearTimeout(this.hoverTimeout);\n this.hoverTimeout = null;\n }\n }\n\n private handleMouseEnter = (event: MouseEventType) => {\n const isHoverAnchor = this.getProps().trigger === 'hoverAnchor';\n if (isHoverAnchor && event.target === this.contentElement) {\n return;\n }\n\n this.clearHoverTimeout();\n this.hoverTimeout = setTimeout(this.open, this.getProps().delayBeforeShow);\n };\n\n private handleMouseLeave = (event: MouseEventType) => {\n const trigger = this.getProps().trigger;\n if (\n (trigger === 'hover&focus' && this.state.focused) ||\n (trigger === 'hover' && event.relatedTarget === this.contentElement)\n ) {\n return;\n }\n\n this.clearHoverTimeout();\n\n if (trigger === 'hoverAnchor') {\n this.close();\n } else {\n this.hoverTimeout = setTimeout(this.close, Tooltip.delay);\n }\n };\n\n private handleClick = () => {\n this.open();\n };\n\n private handleClickOutsideAnchor = (event: Event) => {\n this.clickedOutside = this.isClickOutsideContent(event);\n if (this.clickedOutside) {\n if (this.props.onCloseRequest) {\n this.props.onCloseRequest(event);\n }\n this.close();\n }\n };\n\n private isClickOutsideContent(event: Event) {\n if (this.contentElement && isInstanceOf(event.target, this.globalObject.Element)) {\n return !containsTargetOrRenderContainer(event.target)(this.contentElement);\n }\n\n return true;\n }\n\n private handleFocus = () => {\n this.setState({ focused: true });\n this.open();\n };\n\n private handleBlur = () => {\n const trigger = this.getProps().trigger;\n if (trigger === 'hover&focus' && this.clickedOutside) {\n this.close();\n }\n\n if (trigger === 'focus') {\n this.close();\n }\n\n this.clickedOutside = true;\n this.setState({ focused: false });\n };\n\n private handleCloseButtonClick = (event: React.MouseEvent<HTMLElement>) => {\n event.stopPropagation();\n\n if (this.props.onCloseClick) {\n this.props.onCloseClick(event);\n }\n\n if (event.defaultPrevented) {\n return;\n }\n\n if (this.props.onCloseRequest) {\n this.props.onCloseRequest(event);\n }\n\n this.close();\n };\n\n private getSizeVariables = (): TooltipSizeVariables => {\n switch (this.size) {\n case 'small':\n return {\n closeButtonStyle: this.styles.closeButtonSmall(this.theme),\n contentStyle: this.styles.tooltipContentSmall(this.theme),\n borderRadius: this.theme.tooltipBorderRadiusSmall,\n pinSize: this.theme.tooltipPinSizeSmall,\n pinOffsetX: this.theme.tooltipPinOffsetXSmall,\n pinOffsetY: this.theme.tooltipPinOffsetYSmall,\n margin: this.theme.tooltipMarginSmall,\n };\n case 'medium':\n return {\n closeButtonStyle: this.styles.closeButtonMedium(this.theme),\n contentStyle: this.styles.tooltipContentMedium(this.theme),\n borderRadius: this.theme.tooltipBorderRadiusMedium,\n pinSize: this.theme.tooltipPinSizeMedium,\n pinOffsetX: this.theme.tooltipPinOffsetXMedium,\n pinOffsetY: this.theme.tooltipPinOffsetYMedium,\n margin: this.theme.tooltipMarginMedium,\n };\n case 'large':\n return {\n closeButtonStyle: this.styles.closeButtonLarge(this.theme),\n contentStyle: this.styles.tooltipContentLarge(this.theme),\n borderRadius: this.theme.tooltipBorderRadiusLarge,\n pinSize: this.theme.tooltipPinSizeLarge,\n pinOffsetX: this.theme.tooltipPinOffsetXLarge,\n pinOffsetY: this.theme.tooltipPinOffsetYLarge,\n margin: this.theme.tooltipMarginLarge,\n };\n default:\n warning(false, `Can't get size variables: invalid value in size prop '${this.props.size}'. Returning default`);\n return {\n closeButtonStyle: this.styles.closeButtonSmall(this.theme),\n contentStyle: this.styles.tooltipContentSmall(this.theme),\n borderRadius: this.theme.tooltipBorderRadiusSmall,\n pinSize: this.theme.tooltipPinSizeSmall,\n pinOffsetX: this.theme.tooltipPinOffsetXSmall,\n pinOffsetY: this.theme.tooltipPinOffsetYSmall,\n margin: this.theme.tooltipMarginSmall,\n };\n }\n };\n}\n"]}
@@ -54,7 +54,7 @@ export var CloseButtonIcon = function (_a) {
54
54
  var handleBlur = function () { return setFocusedByTab(false); };
55
55
  var tabIndex = !tabbable || rest.disabled ? -1 : 0;
56
56
  return (React.createElement(CommonWrapper, __assign({}, rest),
57
- React.createElement("button", __assign({ tabIndex: tabIndex, className: cx(styles.root(theme), !rest.disabled && focusedByTab && styles.focus(theme), rest.disabled && styles.rootDisabled(theme)), style: __assign(__assign({}, style), { width: side, height: side }), onFocus: handleFocus, onBlur: handleBlur }, rest),
57
+ React.createElement("button", __assign({ tabIndex: tabIndex, className: cx(styles.root(theme), !rest.disabled && focusedByTab && styles.focus(theme), rest.disabled && styles.rootDisabled(theme)), style: __assign({ width: side, height: side }, style), onFocus: handleFocus, onBlur: handleBlur }, rest),
58
58
  React.createElement("span", { className: styles.wrapper() },
59
59
  React.createElement(CrossIcon, { size: side < size ? side : size, focusable: tabIndex >= 0 })))));
60
60
  };
@@ -1 +1 @@
1
- {"version":3,"file":"CloseButtonIcon.js","sourceRoot":"","sources":["../../../internal/CloseButtonIcon/CloseButtonIcon.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAEjE,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MA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C,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAErD,OAAO,CACL,oBAAC,aAAa,eAAK,IAAI;QACrB,yCACE,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,EAAE,CACX,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAClB,CAAC,IAAI,CAAC,QAAQ,IAAI,YAAY,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EACrD,IAAI,CAAC,QAAQ,IAAI,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CAC5C,EACD,KAAK,wBAAO,KAAK,KAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,KAC5C,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,UAAU,IACd,IAAI;YAER,8BAAM,SAAS,EAAE,MAAM,CAAC,OAAO,EAAE;gBAC/B,oBAAC,SAAS,IAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,IAAI,CAAC,GAAI,CACnE,CACA,CACK,CACjB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,CAAC,mBAAmB,GAAG,iBAAiB,CAAC;AACxD,eAAe,CAAC,WAAW,GAAG,iBAAiB,CAAC","sourcesContent":["import type { AriaAttributes, CSSProperties } from 'react';\nimport React from 'react';\n\nimport { useKeyListener } from '../../lib/events/keyListener.js';\nimport { useEmotion, useGlobal, useStyles } from '../../lib/renderEnvironment/index.js';\nimport { ThemeContext } from '../../lib/theming/ThemeContext.js';\nimport { ThemeFactory } from '../../lib/theming/ThemeFactory.js';\nimport type { CommonProps } from '../CommonWrapper/index.js';\nimport { CommonWrapper } from '../CommonWrapper/index.js';\nimport { DEFAULT_ICON_SIZE } from '../icons2022/iconConstants.js';\nimport { getStyles } from './CloseButtonIcon.styles.js';\nimport { CrossIcon } from './CrossIcon.js';\n\nexport interface CloseButtonIconProps\n extends Pick<AriaAttributes, 'aria-label'>, React.ButtonHTMLAttributes<HTMLButtonElement>, CommonProps {\n /**\n * Ширина и высота иконки крестика\n *\n * @default 16\n */\n size?: number;\n /**\n * Ширина и высота всей кнопки\n *\n * @default 16\n */\n side?: number;\n /**\n * Цвет иконки\n *\n * Переменная темы: `closeBtnIconColor`\n */\n color?: CSSProperties['color'];\n /**\n * Цвет иконки при наведении мышью и при фокусе\n *\n * Переменная темы: `closeBtnIconHoverColor`\n */\n colorHover?: CSSProperties['color'];\n /**\n * Возможность сфокусироваться на кнопке клавишей TAB\n *\n * @default true\n * */\n tabbable?: boolean;\n}\n\nexport const CloseButtonIcon: React.FunctionComponent<CloseButtonIconProps> = ({\n side = DEFAULT_ICON_SIZE,\n size = DEFAULT_ICON_SIZE,\n color,\n colorHover,\n tabbable = true,\n style,\n ...rest\n}) => {\n const globalObject = useGlobal();\n const { cx } = useEmotion();\n const styles = useStyles(getStyles);\n const _theme = React.useContext(ThemeContext);\n const theme = ThemeFactory.create(\n {\n closeBtnIconColor: color ?? _theme.closeBtnIconColor,\n closeBtnIconHoverColor: colorHover ?? _theme.closeBtnIconHoverColor,\n },\n _theme,\n );\n const keyListener = useKeyListener();\n const [focusedByTab, setFocusedByTab] = React.useState(false);\n\n const handleFocus = () => {\n // focus event fires before keyDown eventlistener\n // so we should check tabPressed in async way\n globalObject.requestAnimationFrame?.(() => {\n if (keyListener.isTabPressed) {\n setFocusedByTab(true);\n }\n });\n };\n const handleBlur = () => setFocusedByTab(false);\n\n const tabIndex = !tabbable || rest.disabled ? -1 : 0;\n\n return (\n <CommonWrapper {...rest}>\n <button\n tabIndex={tabIndex}\n className={cx(\n styles.root(theme),\n !rest.disabled && focusedByTab && styles.focus(theme),\n rest.disabled && styles.rootDisabled(theme),\n )}\n style={{ ...style, width: side, height: side }}\n onFocus={handleFocus}\n onBlur={handleBlur}\n {...rest}\n >\n <span className={styles.wrapper()}>\n <CrossIcon size={side < size ? side : size} focusable={tabIndex >= 0} />\n </span>\n </button>\n </CommonWrapper>\n );\n};\n\nCloseButtonIcon.__KONTUR_REACT_UI__ = 'CloseButtonIcon';\nCloseButtonIcon.displayName = 'CloseButtonIcon';\n"]}
1
+ {"version":3,"file":"CloseButtonIcon.js","sourceRoot":"","sources":["../../../internal/CloseButtonIcon/CloseButtonIcon.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAEjE,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAoC3C,MAAM,CAAC,IAAM,eAAe,GAAkD,UAAC,EAQ9E;IAPC,IAAA,YAAwB,EAAxB,IAAI,mBAAG,iBAAiB,KAAA,EACxB,YAAwB,EAAxB,IAAI,mBAAG,iBAAiB,KAAA,EACxB,KAAK,WAAA,EACL,UAAU,gBAAA,EACV,gBAAe,EAAf,QAAQ,mBAAG,IAAI,KAAA,EACf,KAAK,WAAA,EACF,IAAI,cAPsE,4DAQ9E,CADQ;IAEP,IAAM,YAAY,GAAG,SAAS,EAAE,CAAC;IACzB,IAAA,EAAE,GAAK,UAAU,EAAE,GAAjB,CAAkB;IAC5B,IAAM,MAAM,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC;IACpC,IAAM,MAAM,GAAG,KAAK,CAAC,UAAU,C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MAAM,EAAE,UAAU,IACd,IAAI;YAER,8BAAM,SAAS,EAAE,MAAM,CAAC,OAAO,EAAE;gBAC/B,oBAAC,SAAS,IAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,IAAI,CAAC,GAAI,CACnE,CACA,CACK,CACjB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,CAAC,mBAAmB,GAAG,iBAAiB,CAAC;AACxD,eAAe,CAAC,WAAW,GAAG,iBAAiB,CAAC","sourcesContent":["import type { AriaAttributes, CSSProperties } from 'react';\nimport React from 'react';\n\nimport { useKeyListener } from '../../lib/events/keyListener.js';\nimport { useEmotion, useGlobal, useStyles } from '../../lib/renderEnvironment/index.js';\nimport { ThemeContext } from '../../lib/theming/ThemeContext.js';\nimport { ThemeFactory } from '../../lib/theming/ThemeFactory.js';\nimport type { CommonProps } from '../CommonWrapper/index.js';\nimport { CommonWrapper } from '../CommonWrapper/index.js';\nimport { DEFAULT_ICON_SIZE } from '../icons2022/iconConstants.js';\nimport { getStyles } from './CloseButtonIcon.styles.js';\nimport { CrossIcon } from './CrossIcon.js';\n\nexport interface CloseButtonIconProps\n extends Pick<AriaAttributes, 'aria-label'>, React.ButtonHTMLAttributes<HTMLButtonElement>, CommonProps {\n /**\n * Ширина и высота иконки крестика\n *\n * @default 16\n */\n size?: number;\n /**\n * Ширина и высота всей кнопки\n *\n * @default 16\n */\n side?: number;\n /**\n * Цвет иконки\n *\n * Переменная темы: `closeBtnIconColor`\n */\n color?: CSSProperties['color'];\n /**\n * Цвет иконки при наведении мышью и при фокусе\n *\n * Переменная темы: `closeBtnIconHoverColor`\n */\n colorHover?: CSSProperties['color'];\n /**\n * Возможность сфокусироваться на кнопке клавишей TAB\n *\n * @default true\n * */\n tabbable?: boolean;\n}\n\nexport const CloseButtonIcon: React.FunctionComponent<CloseButtonIconProps> = ({\n side = DEFAULT_ICON_SIZE,\n size = DEFAULT_ICON_SIZE,\n color,\n colorHover,\n tabbable = true,\n style,\n ...rest\n}) => {\n const globalObject = useGlobal();\n const { cx } = useEmotion();\n const styles = useStyles(getStyles);\n const _theme = React.useContext(ThemeContext);\n const theme = ThemeFactory.create(\n {\n closeBtnIconColor: color ?? _theme.closeBtnIconColor,\n closeBtnIconHoverColor: colorHover ?? _theme.closeBtnIconHoverColor,\n },\n _theme,\n );\n const keyListener = useKeyListener();\n const [focusedByTab, setFocusedByTab] = React.useState(false);\n\n const handleFocus = () => {\n // focus event fires before keyDown eventlistener\n // so we should check tabPressed in async way\n globalObject.requestAnimationFrame?.(() => {\n if (keyListener.isTabPressed) {\n setFocusedByTab(true);\n }\n });\n };\n const handleBlur = () => setFocusedByTab(false);\n\n const tabIndex = !tabbable || rest.disabled ? -1 : 0;\n\n return (\n <CommonWrapper {...rest}>\n <button\n tabIndex={tabIndex}\n className={cx(\n styles.root(theme),\n !rest.disabled && focusedByTab && styles.focus(theme),\n rest.disabled && styles.rootDisabled(theme),\n )}\n style={{ width: side, height: side, ...style }}\n onFocus={handleFocus}\n onBlur={handleBlur}\n {...rest}\n >\n <span className={styles.wrapper()}>\n <CrossIcon size={side < size ? side : size} focusable={tabIndex >= 0} />\n </span>\n </button>\n </CommonWrapper>\n );\n};\n\nCloseButtonIcon.__KONTUR_REACT_UI__ = 'CloseButtonIcon';\nCloseButtonIcon.displayName = 'CloseButtonIcon';\n"]}
@@ -42,6 +42,7 @@ var __rest = (this && this.__rest) || function (s, e) {
42
42
  return t;
43
43
  };
44
44
  import React from 'react';
45
+ import warning from 'warning';
45
46
  import { callChildRef } from '../../lib/callChildRef/callChildRef.js';
46
47
  import { getElementRef } from '../../lib/getElementRef.js';
47
48
  import { withRenderEnvironment } from '../../lib/renderEnvironment/index.js';
@@ -80,6 +81,10 @@ var CommonWrapper = /** @class */ (function (_super) {
80
81
  var _this = this;
81
82
  var _a = extractCommonProps(this.props), _b = _a[0], _c = _a[1], className = _b.className, style = _b.style, children = _b.children, rootNodeRef = _b.rootNodeRef, dataProps = __rest(_b, ["className", "style", "children", "rootNodeRef"]), rest = __rest(_c, []);
82
83
  this.child = isFunction(children) ? children(rest) : children;
84
+ // TODO: replace count with only in 7.0
85
+ if (React.Children.count(this.child) > 1) {
86
+ warning(false, 'CommonWrapper expects a single child');
87
+ }
83
88
  var getChildProps = function (child) {
84
89
  var childProps = __assign(__assign({}, getCommonVisualStateDataAttributes(rest)), dataProps);
85
90
  isRefableElement(child) && (childProps.ref = _this.ref);
@@ -1 +1 @@
1
- {"version":3,"file":"CommonWrapper.js","sourceRoot":"","sources":["../../../internal/CommonWrapper/CommonWrapper.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAE7E,OAAO,EAAE,WAAW,EAAE,sBAAsB,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAC5F,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGlE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,kCAAkC,EAAE,MAAM,+CAA+C,CAAC;AAMnG;IAAyE,iCAExE;IAFD;;QAUU,0BAAoB,GAAoC,IAAI,CAAC;QA4B7D,SAAG,GAAG,UAAC,QAAuC;;YACpD,KAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;YAC3B,MAAA,MAAA,KAAI,CAAC,KAAK,EAAC,WAAW,mDAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC;YAEhD,yCAAyC;YACzC,iDAAiD;YACjD,MAAA,KAAI,CAAC,oBAAoB,0CA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YAEvD,IAAM,UAAU,GAAW,KAAI,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;YACrE,UAAU,IAAI,CAAC,UAAU,CAAC,SAAS,GAAG,UAAU,CAAC,CAAC;YAElD,IAAM,MAAM,yBAA6B,KAAK,CAAC,KAAK,CAAC,KAAK,GAAK,KAAK,CAAE,CAAC;YACvE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,GAAG,MAAM,CAAC,CAAC;YAE1D,OAAO,UAAU,CAAC;QACpB,CAAC,CAAC;QAEF,OAAO,KAAK,CAAC,cAAc,CAAyC,IAAI,CAAC,KAAK,CAAC;YAC7E,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,EAAE,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC3D,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;IACjB,CAAC;IAjCa,iCAAmB,GAAG,eAAe,AAAlB,CAAmB;IACtC,yBAAW,GAAG,eAAe,AAAlB,CAAmB;IAJjC,aAAa;QAFzB,qBAAqB;QACrB,QAAQ;OACI,aAAa,CA2DzB;IAAD,oBAAC;CAAA,AA3DD,CAAyE,KAAK,CAAC,SAAS,GA2DvF;SA3DY,aAAa","sourcesContent":["import type { Emotion } from '@emotion/css/create-instance';\nimport React from 'react';\n\nimport { callChildRef } from '../../lib/callChildRef/callChildRef.js';\nimport { getElementRef } from '../../lib/getElementRef.js';\nimport { withRenderEnvironment } from '../../lib/renderEnvironment/index.js';\nimport type { TGetRootNode, TRootNodeSubscription, TSetRootNode } from '../../lib/rootNode/index.js';\nimport { getRootNode, isInstanceWithRootNode, rootNode } from '../../lib/rootNode/index.js';\nimport { isFunction, isRefableElement } from '../../lib/utils.js';\nimport type { Nullable } from '../../typings/utility-types.js';\nimport type { CommonProps, CommonPropsRootNodeRef, CommonWrapperProps } from './types.js';\nimport { extractCommonProps } from './utils/extractCommonProps.js';\nimport { getCommonVisualStateDataAttributes } from './utils/getCommonVisualStateDataAttributes.js';\n\nexport type CommonPropsWithRootNodeRef = CommonProps & CommonPropsRootNodeRef;\n\n@withRenderEnvironment\n@rootNode\nexport class CommonWrapper<P extends CommonPropsWithRootNodeRef> extends React.Component<\n CommonWrapperProps<P> & CommonPropsRootNodeRef\n> {\n public static __KONTUR_REACT_UI__ = 'CommonWrapper';\n public static displayName = 'CommonWrapper';\n\n private cx!: Emotion['cx'];\n private child: React.ReactNode;\n public getRootNode!: TGetRootNode;\n private setRootNode!: TSetRootNode;\n private rootNodeSubscription: Nullable<TRootNodeSubscription> = null;\n\n render() {\n const [{ className, style, children, rootNodeRef, ...dataProps }, { ...rest }] = extractCommonProps(this.props);\n this.child = isFunction(children) ? children(rest) : children;\n\n const getChildProps = (child: React.ReactElement<CommonProps & React.RefAttributes<any>>) => {\n const childProps: Record<string, unknown> = {\n ...getCommonVisualStateDataAttributes(rest),\n ...dataProps,\n };\n\n isRefableElement(child) && (childProps.ref = this.ref);\n\n const classNames: string = this.cx(child.props.className, className);\n classNames && (childProps.className = classNames);\n\n const styles: React.CSSProperties = { ...child.props.style, ...style };\n Object.keys(styles).length && (childProps.style = styles);\n\n return childProps;\n };\n\n return React.isValidElement<CommonProps & React.RefAttributes<any>>(this.child)\n ? React.cloneElement(this.child, getChildProps(this.child))\n : this.child;\n }\n\n private ref = (instance: Nullable<React.ReactInstance>) => {\n this.setRootNode(instance);\n this.props.rootNodeRef?.(getRootNode(instance));\n\n // refs are called when instances change,\n // so we have to renew or remove old subscription\n this.rootNodeSubscription?.remove();\n this.rootNodeSubscription = null;\n\n if (instance && isInstanceWithRootNode(instance)) {\n this.rootNodeSubscription = instance.addRootNodeChangeListener?.((node) => {\n this.setRootNode(node);\n this.props.rootNodeRef?.(node);\n });\n }\n\n const originalRef = getElementRef(this.child as React.ReactElement);\n if (typeof originalRef === 'function' || (originalRef && typeof originalRef === 'object')) {\n originalRef && callChildRef(originalRef, instance);\n }\n };\n}\n"]}
1
+ {"version":3,"file":"CommonWrapper.js","sourceRoot":"","sources":["../../../internal/CommonWrapper/CommonWrapper.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAE7E,OAAO,EAAE,WAAW,EAAE,sBAAsB,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAC5F,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGlE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,kCAAkC,EAAE,MAAM,+CAA+C,CAAC;AAMnG;IAAyE,iCAExE;IAFD;;QAUU,0BAAoB,GAAoC,IAAI,CAAC;QAiC7D,SAAG,GAAG,UAAC,QAAuC;;YACpD,KAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;YAC3B,MAAA,MAAA,KAAI,CAAC,KAAK,EAAC,WAAW,mDAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC;YAEhD,yCAAyC;YACzC,iDAAiD;YACjD,MAAA,KAAI,CAAC,oBAAoB,0CAAE,MAAM,EAAE,CAAC;YACpC,KAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC;YAEjC,IAAI,QAAQ,IAAI,sBAAsB,CAAC,QAAQ,CAAC,EAAE,CAAC;gBACjD,KAAI,CAAC,oBAAoB,GAAG,MAAA,QAAQ,CAAC,yBAAyB,yDAAG,UAAC,IAAI;;oBACpE,KAAI,CAAC,WAAW,CAAC,IAAI,CAAC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,SAAS,CAAC,CAAC;YACrE,UAAU,IAAI,CAAC,UAAU,CAAC,SAAS,GAAG,UAAU,CAAC,CAAC;YAElD,IAAM,MAAM,yBAA6B,KAAK,CAAC,KAAK,CAAC,KAAK,GAAK,KAAK,CAAE,CAAC;YACvE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,GAAG,MAAM,CAAC,CAAC;YAE1D,OAAO,UAAU,CAAC;QACpB,CAAC,CAAC;QAEF,OAAO,KAAK,CAAC,cAAc,CAAyC,IAAI,CAAC,KAAK,CAAC;YAC7E,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,EAAE,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC3D,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;IACjB,CAAC;IAtCa,iCAAmB,GAAG,eAAe,AAAlB,CAAmB;IACtC,yBAAW,GAAG,eAAe,AAAlB,CAAmB;IAJjC,aAAa;QAFzB,qBAAqB;QACrB,QAAQ;OACI,aAAa,CAgEzB;IAAD,oBAAC;CAAA,AAhED,CAAyE,KAAK,CAAC,SAAS,GAgEvF;SAhEY,aAAa","sourcesContent":["import type { Emotion } from '@emotion/css/create-instance';\nimport React from 'react';\nimport warning from 'warning';\n\nimport { callChildRef } from '../../lib/callChildRef/callChildRef.js';\nimport { getElementRef } from '../../lib/getElementRef.js';\nimport { withRenderEnvironment } from '../../lib/renderEnvironment/index.js';\nimport type { TGetRootNode, TRootNodeSubscription, TSetRootNode } from '../../lib/rootNode/index.js';\nimport { getRootNode, isInstanceWithRootNode, rootNode } from '../../lib/rootNode/index.js';\nimport { isFunction, isRefableElement } from '../../lib/utils.js';\nimport type { Nullable } from '../../typings/utility-types.js';\nimport type { CommonProps, CommonPropsRootNodeRef, CommonWrapperProps } from './types.js';\nimport { extractCommonProps } from './utils/extractCommonProps.js';\nimport { getCommonVisualStateDataAttributes } from './utils/getCommonVisualStateDataAttributes.js';\n\nexport type CommonPropsWithRootNodeRef = CommonProps & CommonPropsRootNodeRef;\n\n@withRenderEnvironment\n@rootNode\nexport class CommonWrapper<P extends CommonPropsWithRootNodeRef> extends React.Component<\n CommonWrapperProps<P> & CommonPropsRootNodeRef\n> {\n public static __KONTUR_REACT_UI__ = 'CommonWrapper';\n public static displayName = 'CommonWrapper';\n\n private cx!: Emotion['cx'];\n private child: React.ReactNode;\n public getRootNode!: TGetRootNode;\n private setRootNode!: TSetRootNode;\n private rootNodeSubscription: Nullable<TRootNodeSubscription> = null;\n\n render() {\n const [{ className, style, children, rootNodeRef, ...dataProps }, { ...rest }] = extractCommonProps(this.props);\n this.child = isFunction(children) ? children(rest) : children;\n\n // TODO: replace count with only in 7.0\n if (React.Children.count(this.child) > 1) {\n warning(false, 'CommonWrapper expects a single child');\n }\n\n const getChildProps = (child: React.ReactElement<CommonProps & React.RefAttributes<any>>) => {\n const childProps: Record<string, unknown> = {\n ...getCommonVisualStateDataAttributes(rest),\n ...dataProps,\n };\n\n isRefableElement(child) && (childProps.ref = this.ref);\n\n const classNames: string = this.cx(child.props.className, className);\n classNames && (childProps.className = classNames);\n\n const styles: React.CSSProperties = { ...child.props.style, ...style };\n Object.keys(styles).length && (childProps.style = styles);\n\n return childProps;\n };\n\n return React.isValidElement<CommonProps & React.RefAttributes<any>>(this.child)\n ? React.cloneElement(this.child, getChildProps(this.child))\n : this.child;\n }\n\n private ref = (instance: Nullable<React.ReactInstance>) => {\n this.setRootNode(instance);\n this.props.rootNodeRef?.(getRootNode(instance));\n\n // refs are called when instances change,\n // so we have to renew or remove old subscription\n this.rootNodeSubscription?.remove();\n this.rootNodeSubscription = null;\n\n if (instance && isInstanceWithRootNode(instance)) {\n this.rootNodeSubscription = instance.addRootNodeChangeListener?.((node) => {\n this.setRootNode(node);\n this.props.rootNodeRef?.(node);\n });\n }\n\n const originalRef = getElementRef(this.child as React.ReactElement);\n if (typeof originalRef === 'function' || (originalRef && typeof originalRef === 'object')) {\n originalRef && callChildRef(originalRef, instance);\n }\n };\n}\n"]}
@@ -83,7 +83,7 @@ var ComboBoxMenu = /** @class */ (function (_super) {
83
83
  if (loading && (!items || !items.length)) {
84
84
  return (React.createElement(Menu, { maxHeight: maxHeight, ref: refMenu, hasMargin: this.props.hasMargin, disableScrollContainer: isMobile, id: this.props.menuId, "data-tid": "".concat(ComboBoxMenuDataTids.loading, " ").concat(MenuDataTids.root) },
85
85
  React.createElement(MenuMessage, { size: this.props.size, as: "div" },
86
- React.createElement(Spinner, { type: "mini", dimmed: true }))));
86
+ React.createElement(Spinner, { size: "small", dimmed: true }))));
87
87
  }
88
88
  if (items === null && requestStatus === ComboBoxRequestStatus.Failed) {
89
89
  return (React.createElement(Menu, { ref: refMenu, maxHeight: maxHeight, hasMargin: this.props.hasMargin, disableScrollContainer: isMobile, id: this.props.menuId, "data-tid": "".concat(ComboBoxMenuDataTids.failed, " ").concat(MenuDataTids.root) },
@@ -1 +1 @@
1
- {"version":3,"file":"ComboBoxMenu.js","sourceRoot":"","sources":["../../../internal/CustomComboBox/ComboBoxMenu.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAE1E,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAEjE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAE5D,OAAO,EAAE,IAAI,EAAE,Y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AAE,0BAA0B,CAAC;OAClC,YAAY,CA2LxB;IAAD,mBAAC;CAAA,AA3LD,CAAqC,KAAK,CAAC,SAAS,GA2LnD;SA3LY,YAAY;AA6LzB,SAAS,YAAY,CAAI,IAA6B;IACpD,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;AAC1D,CAAC","sourcesContent":["import React from 'react';\n\nimport type { ComboBoxExtendedItem } from '../../components/ComboBox/index.js';\nimport { MenuFooter } from '../../components/MenuFooter/index.js';\nimport { MenuItem, isMenuItem } from '../../components/MenuItem/index.js';\nimport type { MenuItemState } from '../../components/MenuItem/index.js';\nimport { MenuSeparator } from '../../components/MenuSeparator/index.js';\nimport { Spinner } from '../../components/Spinner/index.js';\nimport { createPropsGetter } from '../../lib/createPropsGetter.js';\nimport { locale } from '../../lib/locale/decorators.js';\nimport type { Theme } from '../../lib/theming/Theme.js';\nimport { ThemeContext } from '../../lib/theming/ThemeContext.js';\nimport type { SizeProp } from '../../lib/types/props.js';\nimport { isFunction, isNullable } from '../../lib/utils.js';\nimport type { Nullable } from '../../typings/utility-types.js';\nimport { Menu, MenuDataTids } from '../Menu/index.js';\nimport { MenuMessage } from '../MenuMessage/index.js';\nimport { ComboBoxRequestStatus } from './CustomComboBoxTypes.js';\nimport type { ComboBoxLocale } from './locale/index.js';\nimport { CustomComboBoxLocaleHelper } from './locale/index.js';\n\nexport interface ComboBoxMenuProps<T> {\n opened?: boolean;\n items?: Nullable<Array<ComboBoxExtendedItem<T>>>;\n totalCount?: number;\n loading?: boolean;\n hasMargin?: boolean;\n maxMenuHeight?: number | string;\n refMenu?: (menu: Nullable<Menu>) => void;\n renderNotFound?: () => React.ReactNode;\n renderTotalCount?: (found: number, total: number) => React.ReactNode;\n renderItem: (item: T, state: MenuItemState) => React.ReactNode;\n itemWrapper?: (item: T) => React.ComponentType;\n onValueChange: (value: T) => any;\n renderAddButton?: () => React.ReactNode;\n caption?: React.ReactNode;\n repeatRequest?: () => void;\n requestStatus?: ComboBoxRequestStatus;\n isMobile?: boolean;\n menuId?: string;\n size?: SizeProp;\n preventIconsOffset?: boolean;\n}\n\nexport const ComboBoxMenuDataTids = {\n loading: 'ComboBoxMenu__loading',\n failed: 'ComboBoxMenu__failed',\n notFound: 'ComboBoxMenu__notFound',\n items: 'ComboBoxMenu__items',\n item: 'ComboBoxMenu__item',\n} as const;\n\ntype DefaultProps<T> = Required<Pick<ComboBoxMenuProps<T>, 'repeatRequest' | 'requestStatus'>>;\n\n@locale('ComboBox', CustomComboBoxLocaleHelper)\nexport class ComboBoxMenu<T> extends React.Component<ComboBoxMenuProps<T>> {\n public static __KONTUR_REACT_UI__ = 'ComboBoxMenu';\n public static displayName = 'ComboBoxMenu';\n\n public static defaultProps: DefaultProps<unknown> = {\n repeatRequest: () => undefined,\n requestStatus: ComboBoxRequestStatus.Unknown,\n };\n\n private getProps = createPropsGetter(ComboBoxMenu.defaultProps);\n\n private readonly locale!: ComboBoxLocale;\n\n private theme!: Theme;\n public render() {\n return (\n <ThemeContext.Consumer>\n {(theme) => {\n this.theme = theme;\n return <ThemeContext.Provider value={this.theme}>{this.renderMain()}</ThemeContext.Provider>;\n }}\n </ThemeContext.Consumer>\n );\n }\n\n public renderMain() {\n const {\n opened,\n items,\n totalCount,\n loading,\n refMenu,\n renderNotFound = () => notFound,\n renderTotalCount,\n maxMenuHeight,\n isMobile,\n } = this.props;\n\n const requestStatus = this.getProps().requestStatus;\n\n const { notFound, errorNetworkButton, errorNetworkMessage } = this.locale;\n\n if (!opened) {\n return null;\n }\n\n let renderAddButton = null;\n if (this.props.renderAddButton) {\n renderAddButton = this.props.renderAddButton();\n }\n\n const maxHeight = isMobile ? 'auto' : maxMenuHeight;\n\n if (loading && (!items || !items.length)) {\n return (\n <Menu\n maxHeight={maxHeight}\n ref={refMenu}\n hasMargin={this.props.hasMargin}\n disableScrollContainer={isMobile}\n id={this.props.menuId}\n data-tid={`${ComboBoxMenuDataTids.loading} ${MenuDataTids.root}`}\n >\n <MenuMessage size={this.props.size} as=\"div\">\n <Spinner type=\"mini\" dimmed />\n </MenuMessage>\n </Menu>\n );\n }\n\n if (items === null && requestStatus === ComboBoxRequestStatus.Failed) {\n return (\n <Menu\n ref={refMenu}\n maxHeight={maxHeight}\n hasMargin={this.props.hasMargin}\n disableScrollContainer={isMobile}\n id={this.props.menuId}\n data-tid={`${ComboBoxMenuDataTids.failed} ${MenuDataTids.root}`}\n >\n <MenuMessage size={this.props.size} key=\"message\">\n <div style={{ maxWidth: 300, whiteSpace: 'normal' }}>{errorNetworkMessage}</div>\n </MenuMessage>\n <MenuItem onClick={this.getProps().repeatRequest} size={this.props.size} key=\"retry\" isMobile={isMobile}>\n {errorNetworkButton}\n </MenuItem>\n </Menu>\n );\n }\n\n if ((isNullable(items) || items.length === 0) && renderNotFound) {\n const notFoundValue = renderNotFound();\n if (renderAddButton) {\n return (\n <Menu\n id={this.props.menuId}\n hasMargin={this.props.hasMargin}\n maxHeight={maxHeight}\n ref={refMenu}\n disableScrollContainer={isMobile}\n preventIconsOffset={this.props.preventIconsOffset}\n >\n {renderAddButton}\n </Menu>\n );\n }\n\n if (notFoundValue) {\n return (\n <Menu\n id={this.props.menuId}\n hasMargin={this.props.hasMargin}\n maxHeight={maxHeight}\n ref={refMenu}\n disableScrollContainer={isMobile}\n >\n <MenuMessage size={this.props.size} data-tid={ComboBoxMenuDataTids.notFound}>\n {notFoundValue}\n </MenuMessage>\n </Menu>\n );\n }\n\n return null;\n }\n\n let total = null;\n const renderedItems = items && items.map(this.renderItem);\n const menuItems = renderedItems?.filter((item) => {\n return isMenuItem(item);\n });\n const countItems = menuItems?.length;\n if (countItems && renderTotalCount && totalCount && countItems < totalCount) {\n total = (\n <MenuFooter size={this.props.size} key=\"total\">\n <div>{renderTotalCount(countItems, totalCount)}</div>\n </MenuFooter>\n );\n }\n\n return (\n <Menu\n id={this.props.menuId}\n data-tid={`${ComboBoxMenuDataTids.items} ${MenuDataTids.root}`}\n ref={refMenu}\n maxHeight={maxHeight}\n hasMargin={this.props.hasMargin}\n disableScrollContainer={isMobile}\n preventIconsOffset={this.props.preventIconsOffset}\n >\n {renderedItems}\n {total}\n {renderAddButton && [<MenuSeparator key=\"separator\" />, renderAddButton]}\n </Menu>\n );\n }\n\n private renderItem = (item: ComboBoxExtendedItem<T>, index: number): React.ReactNode => {\n // NOTE this is undesireable feature, better\n // to remove it from further versions\n const { renderItem, onValueChange, itemWrapper } = this.props;\n\n if (!isSimpleItem<T>(item)) {\n const element = isFunction(item) ? item() : item;\n const props = Object.assign(\n {\n key: index,\n onClick: () => onValueChange(element.props),\n },\n element.props,\n );\n return React.cloneElement(element, props);\n }\n\n return (\n <MenuItem\n component={itemWrapper?.(item)}\n data-tid={ComboBoxMenuDataTids.item}\n onClick={() => onValueChange(item)}\n key={index}\n size={this.props.size}\n isMobile={this.props.isMobile}\n >\n {(state) => renderItem(item, state)}\n </MenuItem>\n );\n };\n}\n\nfunction isSimpleItem<T>(item: ComboBoxExtendedItem<T>): item is T {\n return !isFunction(item) && !React.isValidElement(item);\n}\n"]}
1
+ {"version":3,"file":"ComboBoxMenu.js","sourceRoot":"","sources":["../../../internal/CustomComboBox/ComboBoxMenu.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAE1E,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AA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B,aAAa,EAAE,qBAAqB,CAAC,OAAO;KAC7C,AAHyB,CAGxB;IAPS,YAAY;QADxB,MAAM,CAAC,UAAU,EAAE,0BAA0B,CAAC;OAClC,YAAY,CA2LxB;IAAD,mBAAC;CAAA,AA3LD,CAAqC,KAAK,CAAC,SAAS,GA2LnD;SA3LY,YAAY;AA6LzB,SAAS,YAAY,CAAI,IAA6B;IACpD,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;AAC1D,CAAC","sourcesContent":["import React from 'react';\n\nimport type { ComboBoxExtendedItem } from '../../components/ComboBox/index.js';\nimport { MenuFooter } from '../../components/MenuFooter/index.js';\nimport { MenuItem, isMenuItem } from '../../components/MenuItem/index.js';\nimport type { MenuItemState } from '../../components/MenuItem/index.js';\nimport { MenuSeparator } from '../../components/MenuSeparator/index.js';\nimport { Spinner } from '../../components/Spinner/index.js';\nimport { createPropsGetter } from '../../lib/createPropsGetter.js';\nimport { locale } from '../../lib/locale/decorators.js';\nimport type { Theme } from '../../lib/theming/Theme.js';\nimport { ThemeContext } from '../../lib/theming/ThemeContext.js';\nimport type { SizeProp } from '../../lib/types/props.js';\nimport { isFunction, isNullable } from '../../lib/utils.js';\nimport type { Nullable } from '../../typings/utility-types.js';\nimport { Menu, MenuDataTids } from '../Menu/index.js';\nimport { MenuMessage } from '../MenuMessage/index.js';\nimport { ComboBoxRequestStatus } from './CustomComboBoxTypes.js';\nimport type { ComboBoxLocale } from './locale/index.js';\nimport { CustomComboBoxLocaleHelper } from './locale/index.js';\n\nexport interface ComboBoxMenuProps<T> {\n opened?: boolean;\n items?: Nullable<Array<ComboBoxExtendedItem<T>>>;\n totalCount?: number;\n loading?: boolean;\n hasMargin?: boolean;\n maxMenuHeight?: number | string;\n refMenu?: (menu: Nullable<Menu>) => void;\n renderNotFound?: () => React.ReactNode;\n renderTotalCount?: (found: number, total: number) => React.ReactNode;\n renderItem: (item: T, state: MenuItemState) => React.ReactNode;\n itemWrapper?: (item: T) => React.ComponentType;\n onValueChange: (value: T) => any;\n renderAddButton?: () => React.ReactNode;\n caption?: React.ReactNode;\n repeatRequest?: () => void;\n requestStatus?: ComboBoxRequestStatus;\n isMobile?: boolean;\n menuId?: string;\n size?: SizeProp;\n preventIconsOffset?: boolean;\n}\n\nexport const ComboBoxMenuDataTids = {\n loading: 'ComboBoxMenu__loading',\n failed: 'ComboBoxMenu__failed',\n notFound: 'ComboBoxMenu__notFound',\n items: 'ComboBoxMenu__items',\n item: 'ComboBoxMenu__item',\n} as const;\n\ntype DefaultProps<T> = Required<Pick<ComboBoxMenuProps<T>, 'repeatRequest' | 'requestStatus'>>;\n\n@locale('ComboBox', CustomComboBoxLocaleHelper)\nexport class ComboBoxMenu<T> extends React.Component<ComboBoxMenuProps<T>> {\n public static __KONTUR_REACT_UI__ = 'ComboBoxMenu';\n public static displayName = 'ComboBoxMenu';\n\n public static defaultProps: DefaultProps<unknown> = {\n repeatRequest: () => undefined,\n requestStatus: ComboBoxRequestStatus.Unknown,\n };\n\n private getProps = createPropsGetter(ComboBoxMenu.defaultProps);\n\n private readonly locale!: ComboBoxLocale;\n\n private theme!: Theme;\n public render() {\n return (\n <ThemeContext.Consumer>\n {(theme) => {\n this.theme = theme;\n return <ThemeContext.Provider value={this.theme}>{this.renderMain()}</ThemeContext.Provider>;\n }}\n </ThemeContext.Consumer>\n );\n }\n\n public renderMain() {\n const {\n opened,\n items,\n totalCount,\n loading,\n refMenu,\n renderNotFound = () => notFound,\n renderTotalCount,\n maxMenuHeight,\n isMobile,\n } = this.props;\n\n const requestStatus = this.getProps().requestStatus;\n\n const { notFound, errorNetworkButton, errorNetworkMessage } = this.locale;\n\n if (!opened) {\n return null;\n }\n\n let renderAddButton = null;\n if (this.props.renderAddButton) {\n renderAddButton = this.props.renderAddButton();\n }\n\n const maxHeight = isMobile ? 'auto' : maxMenuHeight;\n\n if (loading && (!items || !items.length)) {\n return (\n <Menu\n maxHeight={maxHeight}\n ref={refMenu}\n hasMargin={this.props.hasMargin}\n disableScrollContainer={isMobile}\n id={this.props.menuId}\n data-tid={`${ComboBoxMenuDataTids.loading} ${MenuDataTids.root}`}\n >\n <MenuMessage size={this.props.size} as=\"div\">\n <Spinner size=\"small\" dimmed />\n </MenuMessage>\n </Menu>\n );\n }\n\n if (items === null && requestStatus === ComboBoxRequestStatus.Failed) {\n return (\n <Menu\n ref={refMenu}\n maxHeight={maxHeight}\n hasMargin={this.props.hasMargin}\n disableScrollContainer={isMobile}\n id={this.props.menuId}\n data-tid={`${ComboBoxMenuDataTids.failed} ${MenuDataTids.root}`}\n >\n <MenuMessage size={this.props.size} key=\"message\">\n <div style={{ maxWidth: 300, whiteSpace: 'normal' }}>{errorNetworkMessage}</div>\n </MenuMessage>\n <MenuItem onClick={this.getProps().repeatRequest} size={this.props.size} key=\"retry\" isMobile={isMobile}>\n {errorNetworkButton}\n </MenuItem>\n </Menu>\n );\n }\n\n if ((isNullable(items) || items.length === 0) && renderNotFound) {\n const notFoundValue = renderNotFound();\n if (renderAddButton) {\n return (\n <Menu\n id={this.props.menuId}\n hasMargin={this.props.hasMargin}\n maxHeight={maxHeight}\n ref={refMenu}\n disableScrollContainer={isMobile}\n preventIconsOffset={this.props.preventIconsOffset}\n >\n {renderAddButton}\n </Menu>\n );\n }\n\n if (notFoundValue) {\n return (\n <Menu\n id={this.props.menuId}\n hasMargin={this.props.hasMargin}\n maxHeight={maxHeight}\n ref={refMenu}\n disableScrollContainer={isMobile}\n >\n <MenuMessage size={this.props.size} data-tid={ComboBoxMenuDataTids.notFound}>\n {notFoundValue}\n </MenuMessage>\n </Menu>\n );\n }\n\n return null;\n }\n\n let total = null;\n const renderedItems = items && items.map(this.renderItem);\n const menuItems = renderedItems?.filter((item) => {\n return isMenuItem(item);\n });\n const countItems = menuItems?.length;\n if (countItems && renderTotalCount && totalCount && countItems < totalCount) {\n total = (\n <MenuFooter size={this.props.size} key=\"total\">\n <div>{renderTotalCount(countItems, totalCount)}</div>\n </MenuFooter>\n );\n }\n\n return (\n <Menu\n id={this.props.menuId}\n data-tid={`${ComboBoxMenuDataTids.items} ${MenuDataTids.root}`}\n ref={refMenu}\n maxHeight={maxHeight}\n hasMargin={this.props.hasMargin}\n disableScrollContainer={isMobile}\n preventIconsOffset={this.props.preventIconsOffset}\n >\n {renderedItems}\n {total}\n {renderAddButton && [<MenuSeparator key=\"separator\" />, renderAddButton]}\n </Menu>\n );\n }\n\n private renderItem = (item: ComboBoxExtendedItem<T>, index: number): React.ReactNode => {\n // NOTE this is undesireable feature, better\n // to remove it from further versions\n const { renderItem, onValueChange, itemWrapper } = this.props;\n\n if (!isSimpleItem<T>(item)) {\n const element = isFunction(item) ? item() : item;\n const props = Object.assign(\n {\n key: index,\n onClick: () => onValueChange(element.props),\n },\n element.props,\n );\n return React.cloneElement(element, props);\n }\n\n return (\n <MenuItem\n component={itemWrapper?.(item)}\n data-tid={ComboBoxMenuDataTids.item}\n onClick={() => onValueChange(item)}\n key={index}\n size={this.props.size}\n isMobile={this.props.isMobile}\n >\n {(state) => renderItem(item, state)}\n </MenuItem>\n );\n };\n}\n\nfunction isSimpleItem<T>(item: ComboBoxExtendedItem<T>): item is T {\n return !isFunction(item) && !React.isValidElement(item);\n}\n"]}
@@ -42,6 +42,7 @@ import { withRenderEnvironment } from '../../lib/renderEnvironment/index.js';
42
42
  import { getRootNode, rootNode } from '../../lib/rootNode/index.js';
43
43
  import { withSize } from '../../lib/size/SizeDecorator.js';
44
44
  import { ThemeContext } from '../../lib/theming/ThemeContext.js';
45
+ import { isThemeGTE } from '../../lib/theming/ThemeHelpers.js';
45
46
  import { getRandomID, isNonNullable } from '../../lib/utils.js';
46
47
  import { CommonWrapper } from '../CommonWrapper/index.js';
47
48
  import { LoadingIcon } from '../icons2022/LoadingIcon.js';
@@ -90,6 +91,7 @@ var ComboBoxView = /** @class */ (function (_super) {
90
91
  if (loading && items && !!items.length) {
91
92
  rightIcon = _this.renderSpinner();
92
93
  }
94
+ var themeGTE6_1 = isThemeGTE(_this.theme, '6.1');
93
95
  var inputProps = {
94
96
  autoComplete: 'off',
95
97
  autoFocus: true,
@@ -100,8 +102,17 @@ var ComboBoxView = /** @class */ (function (_super) {
100
102
  value: textValue,
101
103
  placeholder: placeholder,
102
104
  rightIcon: rightIcon,
105
+ size: themeGTE6_1 ? _this.size : undefined,
103
106
  };
104
- return (opened && (React.createElement(MobilePopup, { headerChildComponent: React.createElement(Input, __assign({ ref: _this.refMobileInput }, inputProps)), onCloseRequest: _this.props.onMobileClose, opened: true }, _this.getComboBoxMenu())));
107
+ var themeDependantProps = themeGTE6_1
108
+ ? {
109
+ footerChildComponent: React.createElement(Input, __assign({ ref: _this.refMobileInput }, inputProps)),
110
+ size: _this.size,
111
+ }
112
+ : {
113
+ headerChildComponent: React.createElement(Input, __assign({ ref: _this.refMobileInput }, inputProps)),
114
+ };
115
+ return (opened && (React.createElement(MobilePopup, __assign({}, themeDependantProps, { onCloseRequest: _this.props.onMobileClose, opened: true }), _this.getComboBoxMenu())));
105
116
  };
106
117
  _this.getParent = function () {
107
118
  return getRootNode(_this);
@@ -130,7 +141,7 @@ var ComboBoxView = /** @class */ (function (_super) {
130
141
  _this.input = input;
131
142
  };
132
143
  _this.renderSpinner = function () { return (React.createElement("span", { className: _this.styles.spinnerWrapper() },
133
- React.createElement(Spinner, { type: "mini", caption: "", dimmed: true }))); };
144
+ React.createElement(Spinner, { size: "small", caption: "", dimmed: true }))); };
134
145
  _this.getRightIcon = function () {
135
146
  var _a = _this.props, loading = _a.loading, items = _a.items, drawArrow = _a.drawArrow, rightIcon = _a.rightIcon;
136
147
  var size = _this.size;