@jetbrains/ring-ui-built 6.0.32 → 6.0.33

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 (224) hide show
  1. package/components/_helpers/_rollupPluginBabelHelpers.js +567 -1
  2. package/components/_helpers/anchor.js +6 -7
  3. package/components/_helpers/button__classes.js +14 -16
  4. package/components/_helpers/caption.js +20 -14
  5. package/components/_helpers/card.js +105 -95
  6. package/components/_helpers/dialog__body-scroll-preventer.js +19 -11
  7. package/components/_helpers/icon__svg.js +25 -22
  8. package/components/_helpers/input.js +177 -146
  9. package/components/_helpers/query-assist__suggestions.js +90 -74
  10. package/components/_helpers/select__filter.js +69 -48
  11. package/components/_helpers/services-link.js +37 -29
  12. package/components/_helpers/sidebar.js +107 -99
  13. package/components/_helpers/tab-link.js +7 -7
  14. package/components/_helpers/theme.js +40 -31
  15. package/components/_helpers/title.js +72 -57
  16. package/components/alert/alert.js +202 -150
  17. package/components/alert/container.js +41 -32
  18. package/components/alert-service/alert-service.js +170 -105
  19. package/components/analytics/analytics.js +22 -12
  20. package/components/analytics/analytics__custom-plugin.js +75 -54
  21. package/components/auth/auth.js +36 -4
  22. package/components/auth/auth__core.js +1471 -746
  23. package/components/auth/background-flow.js +127 -87
  24. package/components/auth/down-notification.js +73 -30
  25. package/components/auth/iframe-flow.js +133 -75
  26. package/components/auth/request-builder.js +82 -46
  27. package/components/auth/response-parser.js +116 -86
  28. package/components/auth/storage.js +334 -171
  29. package/components/auth/token-validator.js +242 -137
  30. package/components/auth/window-flow.js +134 -92
  31. package/components/auth-dialog/auth-dialog.js +172 -114
  32. package/components/auth-dialog-service/auth-dialog-service.js +31 -8
  33. package/components/avatar/avatar-example-datauri.js +1 -23
  34. package/components/avatar/avatar.js +152 -119
  35. package/components/avatar/fallback-avatar.js +38 -22
  36. package/components/badge/badge.js +45 -35
  37. package/components/button/button.js +107 -86
  38. package/components/button-group/button-group.js +33 -19
  39. package/components/button-set/button-set.js +32 -20
  40. package/components/button-toolbar/button-toolbar.js +31 -19
  41. package/components/caret/caret.js +220 -186
  42. package/components/checkbox/checkbox.js +101 -76
  43. package/components/clipboard/clipboard-fallback.js +10 -10
  44. package/components/clipboard/clipboard.js +132 -35
  45. package/components/code/code.js +166 -92
  46. package/components/collapse/collapse-content.js +64 -42
  47. package/components/collapse/collapse-context.js +2 -2
  48. package/components/collapse/collapse-control.js +14 -12
  49. package/components/collapse/collapse.js +17 -11
  50. package/components/collapse/consts.js +4 -4
  51. package/components/collapse/utils.js +3 -1
  52. package/components/confirm/confirm.js +104 -66
  53. package/components/confirm-service/confirm-service.js +59 -37
  54. package/components/content-layout/content-layout.js +64 -43
  55. package/components/content-layout/sidebar.js +1 -0
  56. package/components/contenteditable/contenteditable.js +59 -50
  57. package/components/control-label/control-label.js +9 -9
  58. package/components/data-list/data-list.js +182 -129
  59. package/components/data-list/data-list.mock.js +6 -2
  60. package/components/data-list/item.js +170 -143
  61. package/components/data-list/selection.js +136 -76
  62. package/components/data-list/title.js +12 -1
  63. package/components/date-picker/consts.js +26 -19
  64. package/components/date-picker/date-input.js +144 -113
  65. package/components/date-picker/date-picker.js +282 -227
  66. package/components/date-picker/date-popup.js +395 -350
  67. package/components/date-picker/day.js +116 -87
  68. package/components/date-picker/month-names.js +66 -43
  69. package/components/date-picker/month-slider.js +76 -51
  70. package/components/date-picker/month.js +25 -16
  71. package/components/date-picker/months.js +50 -43
  72. package/components/date-picker/weekdays.js +22 -12
  73. package/components/date-picker/years.js +110 -83
  74. package/components/dialog/dialog.js +190 -142
  75. package/components/dialog/dialog__body-scroll-preventer.js +4 -0
  76. package/components/dropdown/anchor.js +9 -0
  77. package/components/dropdown/dropdown.js +213 -182
  78. package/components/dropdown-menu/dropdown-menu.js +97 -71
  79. package/components/editable-heading/editable-heading.js +127 -75
  80. package/components/error-bubble/error-bubble.js +60 -31
  81. package/components/error-message/error-message.js +59 -39
  82. package/components/footer/footer.js +30 -27
  83. package/components/global/compose.js +10 -1
  84. package/components/global/composeRefs.js +12 -7
  85. package/components/global/controls-height.js +2 -2
  86. package/components/global/create-stateful-context.js +15 -15
  87. package/components/global/data-tests.js +14 -6
  88. package/components/global/dom.js +86 -47
  89. package/components/global/focus-sensor-hoc.js +132 -122
  90. package/components/global/fuzzy-highlight.js +36 -22
  91. package/components/global/get-event-key.js +8 -8
  92. package/components/global/get-uid.js +8 -4
  93. package/components/global/inject-styles.js +15 -10
  94. package/components/global/listeners.js +51 -27
  95. package/components/global/memoize.js +12 -6
  96. package/components/global/normalize-indent.js +50 -19
  97. package/components/global/promise-with-timeout.js +8 -6
  98. package/components/global/prop-types.js +5 -3
  99. package/components/global/react-dom-renderer.js +44 -28
  100. package/components/global/react-render-adapter.js +1 -1
  101. package/components/global/rerender-hoc.js +30 -12
  102. package/components/global/schedule-raf.js +6 -5
  103. package/components/global/sniffer.js +1 -1
  104. package/components/global/theme.js +22 -0
  105. package/components/global/trivial-template-tag.js +10 -3
  106. package/components/global/typescript-utils.js +6 -2
  107. package/components/global/url.js +26 -20
  108. package/components/global/use-event-callback.js +4 -6
  109. package/components/grid/col.js +52 -35
  110. package/components/grid/grid.js +31 -17
  111. package/components/grid/row.js +47 -35
  112. package/components/group/group.js +25 -17
  113. package/components/header/header.js +78 -33
  114. package/components/header/logo.js +36 -20
  115. package/components/header/profile.js +199 -166
  116. package/components/header/services-link.js +4 -0
  117. package/components/header/services.js +116 -73
  118. package/components/header/smart-profile.js +203 -111
  119. package/components/header/smart-services.js +113 -62
  120. package/components/header/tray-icon.js +37 -21
  121. package/components/header/tray.js +32 -21
  122. package/components/heading/heading.js +25 -24
  123. package/components/http/http.js +353 -203
  124. package/components/http/http.mock.js +101 -49
  125. package/components/hub-source/hub-source.js +190 -83
  126. package/components/hub-source/hub-source__user.js +44 -11
  127. package/components/hub-source/hub-source__users-groups.js +65 -37
  128. package/components/i18n/i18n-context.js +10 -7
  129. package/components/i18n/i18n.js +10 -7
  130. package/components/icon/icon.js +93 -76
  131. package/components/icon/icon__svg.js +8 -0
  132. package/components/icon/index.js +8 -0
  133. package/components/input/input.js +13 -0
  134. package/components/island/adaptive-island-hoc.js +43 -30
  135. package/components/island/content.js +132 -115
  136. package/components/island/header.js +70 -57
  137. package/components/island/island.js +40 -28
  138. package/components/island-legacy/content-legacy.js +25 -17
  139. package/components/island-legacy/header-legacy.js +27 -19
  140. package/components/island-legacy/island-legacy.js +25 -17
  141. package/components/link/clickableLink.js +59 -44
  142. package/components/link/link.js +68 -57
  143. package/components/list/consts.js +2 -2
  144. package/components/list/list.js +698 -611
  145. package/components/list/list__custom.js +62 -44
  146. package/components/list/list__hint.js +19 -10
  147. package/components/list/list__item.js +174 -133
  148. package/components/list/list__link.js +50 -37
  149. package/components/list/list__separator.js +24 -14
  150. package/components/list/list__title.js +32 -22
  151. package/components/list/list__users-groups-source.js +126 -54
  152. package/components/loader/loader.js +74 -43
  153. package/components/loader/loader__core.js +263 -198
  154. package/components/loader-inline/loader-inline.js +35 -23
  155. package/components/loader-screen/loader-screen.js +46 -25
  156. package/components/login-dialog/login-dialog.js +158 -111
  157. package/components/login-dialog/service.js +34 -8
  158. package/components/markdown/markdown.js +23 -15
  159. package/components/message/message.js +203 -161
  160. package/components/old-browsers-message/old-browsers-message.js +18 -11
  161. package/components/old-browsers-message/old-browsers-message__stop.js +7 -0
  162. package/components/old-browsers-message/white-list.js +16 -8
  163. package/components/pager/pager.js +271 -212
  164. package/components/panel/panel.js +25 -17
  165. package/components/permissions/permissions.js +172 -127
  166. package/components/permissions/permissions__cache.js +224 -194
  167. package/components/popup/popup.consts.js +1 -1
  168. package/components/popup/popup.js +343 -284
  169. package/components/popup/popup.target.js +8 -9
  170. package/components/popup/position.js +106 -96
  171. package/components/popup-menu/popup-menu.js +81 -44
  172. package/components/progress-bar/progress-bar.js +104 -87
  173. package/components/query-assist/query-assist.js +916 -838
  174. package/components/query-assist/query-assist__suggestions.js +30 -1
  175. package/components/radio/radio.js +34 -19
  176. package/components/radio/radio__item.js +69 -52
  177. package/components/select/select.js +957 -852
  178. package/components/select/select__filter.js +30 -0
  179. package/components/select/select__popup.js +487 -373
  180. package/components/shortcuts/core.js +217 -166
  181. package/components/shortcuts/shortcut-title.js +11 -6
  182. package/components/shortcuts/shortcuts-hoc.js +45 -19
  183. package/components/shortcuts/shortcuts.js +75 -50
  184. package/components/slider/slider.js +122 -99
  185. package/components/slider/slider.utils.js +24 -14
  186. package/components/storage/storage.js +33 -4
  187. package/components/storage/storage__fallback.js +224 -149
  188. package/components/storage/storage__local.js +153 -90
  189. package/components/tab-trap/tab-trap.js +153 -122
  190. package/components/table/cell.js +26 -14
  191. package/components/table/disable-hover-hoc.js +51 -33
  192. package/components/table/header-cell.js +89 -64
  193. package/components/table/header.js +132 -104
  194. package/components/table/multitable.js +125 -107
  195. package/components/table/row-with-focus-sensor.js +69 -25
  196. package/components/table/row.js +216 -175
  197. package/components/table/selection-adapter.js +3 -1
  198. package/components/table/selection-shortcuts-hoc.js +181 -180
  199. package/components/table/selection.js +226 -156
  200. package/components/table/smart-table.js +88 -50
  201. package/components/table/table.js +358 -289
  202. package/components/tabs/collapsible-more.js +79 -46
  203. package/components/tabs/collapsible-tab.js +38 -31
  204. package/components/tabs/collapsible-tabs.js +153 -88
  205. package/components/tabs/custom-item.js +2 -4
  206. package/components/tabs/dumb-tabs.js +117 -74
  207. package/components/tabs/smart-tabs.js +69 -29
  208. package/components/tabs/tab-link.js +5 -1
  209. package/components/tabs/tab.js +31 -19
  210. package/components/tabs/tabs.js +31 -0
  211. package/components/tag/tag.js +173 -133
  212. package/components/tags-input/tags-input.js +427 -329
  213. package/components/tags-list/tags-list.js +78 -57
  214. package/components/text/text.js +39 -28
  215. package/components/toggle/toggle.js +70 -56
  216. package/components/tooltip/tooltip.js +190 -146
  217. package/components/user-agreement/service.js +371 -228
  218. package/components/user-agreement/toolbox.eula.js +1 -160
  219. package/components/user-agreement/user-agreement.js +120 -85
  220. package/components/user-card/card.js +29 -0
  221. package/components/user-card/smart-user-card-tooltip.js +111 -51
  222. package/components/user-card/tooltip.js +84 -47
  223. package/components/user-card/user-card.js +29 -0
  224. package/package.json +1 -1
@@ -1,3 +1,14 @@
1
+ import { j as _slicedToArray, k as _toConsumableArray } from '../_helpers/_rollupPluginBabelHelpers.js';
2
+ import 'core-js/modules/es.array.filter.js';
3
+ import 'core-js/modules/es.array.find.js';
4
+ import 'core-js/modules/es.array.find-index.js';
5
+ import 'core-js/modules/es.array.map.js';
6
+ import 'core-js/modules/es.array.reduce.js';
7
+ import 'core-js/modules/es.array.slice.js';
8
+ import 'core-js/modules/es.object.to-string.js';
9
+ import 'core-js/modules/es.regexp.exec.js';
10
+ import 'core-js/modules/es.string.replace.js';
11
+ import 'core-js/modules/web.dom-collections.for-each.js';
1
12
  import React from 'react';
2
13
  import PropTypes from 'prop-types';
3
14
  import classNames from 'classnames';
@@ -6,27 +17,41 @@ import { m as modules_02138f4a } from '../_helpers/tab-link.js';
6
17
  import { MoreButton, FakeMoreButton } from './collapsible-more.js';
7
18
  import getTabTitles from './collapsible-tab.js';
8
19
  import '../link/link.js';
9
- import '../_helpers/_rollupPluginBabelHelpers.js';
10
20
  import '../global/data-tests.js';
21
+ import 'core-js/modules/es.array.concat.js';
22
+ import 'core-js/modules/es.object.entries.js';
11
23
  import '../link/clickableLink.js';
12
24
  import '../_helpers/link.js';
13
25
  import '@jetbrains/icons/chevron-10px';
14
26
  import '../popup/popup.consts.js';
15
27
  import '../popup-menu/popup-menu.js';
16
28
  import '../popup/popup.js';
29
+ import 'core-js/modules/es.regexp.to-string.js';
17
30
  import 'react-dom';
18
31
  import '../global/get-uid.js';
19
32
  import '../global/schedule-raf.js';
20
33
  import '../global/dom.js';
34
+ import 'core-js/modules/es.array.iterator.js';
35
+ import 'core-js/modules/es.object.assign.js';
36
+ import 'core-js/modules/es.set.js';
37
+ import 'core-js/modules/es.string.split.js';
38
+ import 'core-js/modules/web.dom-collections.iterator.js';
21
39
  import '../shortcuts/shortcuts.js';
22
40
  import '../shortcuts/core.js';
41
+ import 'core-js/modules/es.array.includes.js';
42
+ import 'core-js/modules/es.array.splice.js';
43
+ import 'core-js/modules/es.string.includes.js';
44
+ import 'core-js/modules/es.string.match.js';
23
45
  import 'combokeys';
24
46
  import '../global/sniffer.js';
25
47
  import 'sniffr';
26
48
  import '../tab-trap/tab-trap.js';
27
49
  import '../popup/position.js';
50
+ import 'core-js/modules/es.array.sort.js';
28
51
  import '../popup/popup.target.js';
29
52
  import '../list/list.js';
53
+ import 'core-js/modules/es.symbol.js';
54
+ import 'core-js/modules/es.symbol.description.js';
30
55
  import 'react-virtualized/dist/es/List';
31
56
  import 'react-virtualized/dist/es/AutoSizer';
32
57
  import 'react-virtualized/dist/es/WindowScroller';
@@ -34,19 +59,24 @@ import 'react-virtualized/dist/es/CellMeasurer';
34
59
  import 'util-deprecate';
35
60
  import 'memoize-one';
36
61
  import '../global/memoize.js';
62
+ import 'core-js/modules/es.map.js';
63
+ import 'core-js/modules/es.weak-map.js';
37
64
  import '../global/create-stateful-context.js';
38
65
  import '../list/list__link.js';
39
66
  import '../_helpers/list.js';
40
67
  import '../list/list__item.js';
68
+ import 'core-js/modules/es.array.index-of.js';
41
69
  import '../avatar/avatar.js';
42
70
  import '../global/url.js';
43
71
  import '../avatar/fallback-avatar.js';
72
+ import 'core-js/modules/es.array.from.js';
44
73
  import '../checkbox/checkbox.js';
45
74
  import '@jetbrains/icons/checkmark-12px';
46
75
  import '@jetbrains/icons/remove-12px';
47
76
  import '../icon/icon.js';
48
77
  import '../icon/icon__constants.js';
49
78
  import '../_helpers/icon__svg.js';
79
+ import 'core-js/modules/es.string.starts-with.js';
50
80
  import '../global/prop-types.js';
51
81
  import '../global/composeRefs.js';
52
82
  import '../list/list__custom.js';
@@ -63,44 +93,57 @@ import '../global/controls-height.js';
63
93
  import '../_helpers/button__classes.js';
64
94
  import './custom-item.js';
65
95
 
66
- const DEFAULT_DEBOUNCE_INTERVAL = 100;
67
- const MEASURE_TOLERANCE = 0.5;
68
- const CollapsibleTabs = _ref => {
69
- let {
70
- children,
71
- selected,
72
- onSelect,
73
- moreClassName,
74
- moreActiveClassName,
75
- morePopupClassName,
76
- morePopupBeforeEnd,
77
- morePopupItemClassName,
78
- initialVisibleItems
79
- } = _ref;
80
- const [sizes, setSizes] = React.useState({
81
- tabs: [],
82
- more: undefined
83
- });
84
- const [lastVisibleIndex, setLastVisibleIndex] = React.useState(null);
85
- const elements = {
96
+ var DEFAULT_DEBOUNCE_INTERVAL = 100;
97
+ var MEASURE_TOLERANCE = 0.5;
98
+ var CollapsibleTabs = function CollapsibleTabs(_ref) {
99
+ var children = _ref.children,
100
+ selected = _ref.selected,
101
+ onSelect = _ref.onSelect,
102
+ moreClassName = _ref.moreClassName,
103
+ moreActiveClassName = _ref.moreActiveClassName,
104
+ morePopupClassName = _ref.morePopupClassName,
105
+ morePopupBeforeEnd = _ref.morePopupBeforeEnd,
106
+ morePopupItemClassName = _ref.morePopupItemClassName,
107
+ initialVisibleItems = _ref.initialVisibleItems;
108
+ var _React$useState = React.useState({
109
+ tabs: [],
110
+ more: undefined
111
+ }),
112
+ _React$useState2 = _slicedToArray(_React$useState, 2),
113
+ sizes = _React$useState2[0],
114
+ setSizes = _React$useState2[1];
115
+ var _React$useState3 = React.useState(null),
116
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
117
+ lastVisibleIndex = _React$useState4[0],
118
+ setLastVisibleIndex = _React$useState4[1];
119
+ var elements = {
86
120
  sizes,
87
121
  lastVisibleIndex
88
122
  };
89
- const [preparedElements, setPreparedElements] = React.useState({
90
- visible: [],
91
- hidden: []
92
- });
93
- const measureRef = React.useRef(null);
94
- const selectedIndex = React.useMemo(() => {
123
+ var _React$useState5 = React.useState({
124
+ visible: [],
125
+ hidden: []
126
+ }),
127
+ _React$useState6 = _slicedToArray(_React$useState5, 2),
128
+ preparedElements = _React$useState6[0],
129
+ setPreparedElements = _React$useState6[1];
130
+ var measureRef = React.useRef(null);
131
+ var selectedIndex = React.useMemo(function () {
95
132
  var _children$filter$find;
96
- return (_children$filter$find = children.filter(tab => tab.props.alwaysHidden !== true).findIndex(tab => tab.props.id === selected)) !== null && _children$filter$find !== void 0 ? _children$filter$find : null;
133
+ return (_children$filter$find = children.filter(function (tab) {
134
+ return tab.props.alwaysHidden !== true;
135
+ }).findIndex(function (tab) {
136
+ return tab.props.id === selected;
137
+ })) !== null && _children$filter$find !== void 0 ? _children$filter$find : null;
97
138
  }, [children, selected]);
98
- const visibleElements = React.useMemo(() => {
99
- let items;
139
+ var visibleElements = React.useMemo(function () {
140
+ var items;
100
141
  if (preparedElements.ready) {
101
142
  items = preparedElements.visible;
102
143
  } else {
103
- items = initialVisibleItems ? children.filter(item => item.props.alwaysHidden !== true).slice(0, initialVisibleItems) : [];
144
+ items = initialVisibleItems ? children.filter(function (item) {
145
+ return item.props.alwaysHidden !== true;
146
+ }).slice(0, initialVisibleItems) : [];
104
147
  }
105
148
  return getTabTitles({
106
149
  items,
@@ -108,16 +151,18 @@ const CollapsibleTabs = _ref => {
108
151
  onSelect
109
152
  });
110
153
  }, [initialVisibleItems, children, preparedElements.ready, preparedElements.visible, onSelect, selected]);
111
- const adjustTabs = React.useCallback(entry => {
112
- const containerWidth = entry.contentRect.width;
113
- const {
114
- tabs: tabsSizes,
115
- more = 0
116
- } = elements.sizes;
117
- let renderMore = children.some(tab => tab.props.alwaysHidden);
118
- const tabsToRender = [];
119
- let filledWidth = renderMore ? more !== null && more !== void 0 ? more : 0 : 0;
120
- for (let i = 0; i < tabsSizes.length; i++) {
154
+ var adjustTabs = React.useCallback(function (entry) {
155
+ var containerWidth = entry.contentRect.width;
156
+ var _elements$sizes = elements.sizes,
157
+ tabsSizes = _elements$sizes.tabs,
158
+ _elements$sizes$more = _elements$sizes.more,
159
+ more = _elements$sizes$more === void 0 ? 0 : _elements$sizes$more;
160
+ var renderMore = children.some(function (tab) {
161
+ return tab.props.alwaysHidden;
162
+ });
163
+ var tabsToRender = [];
164
+ var filledWidth = renderMore ? more !== null && more !== void 0 ? more : 0 : 0;
165
+ for (var i = 0; i < tabsSizes.length; i++) {
121
166
  if (filledWidth + tabsSizes[i] < containerWidth + MEASURE_TOLERANCE) {
122
167
  filledWidth += tabsSizes[i];
123
168
  tabsToRender.push(tabsSizes[i]);
@@ -126,25 +171,25 @@ const CollapsibleTabs = _ref => {
126
171
  }
127
172
  }
128
173
  if (tabsToRender.length < tabsSizes.length && !renderMore) {
129
- for (let i = tabsToRender.length - 1; i >= 0; i--) {
174
+ for (var _i = tabsToRender.length - 1; _i >= 0; _i--) {
130
175
  if (filledWidth + more < containerWidth + MEASURE_TOLERANCE) {
131
176
  filledWidth += more;
132
177
  renderMore = true;
133
178
  break;
134
179
  } else {
135
- filledWidth -= tabsToRender[i];
180
+ filledWidth -= tabsToRender[_i];
136
181
  tabsToRender.pop();
137
182
  }
138
183
  }
139
184
  }
140
185
  if (selectedIndex > tabsToRender.length - 1) {
141
- const selectedWidth = tabsSizes[selectedIndex];
142
- for (let i = tabsToRender.length - 1; i >= 0; i--) {
186
+ var selectedWidth = tabsSizes[selectedIndex];
187
+ for (var _i2 = tabsToRender.length - 1; _i2 >= 0; _i2--) {
143
188
  if (filledWidth + selectedWidth < containerWidth + MEASURE_TOLERANCE) {
144
189
  filledWidth += selectedWidth;
145
190
  break;
146
191
  } else {
147
- filledWidth -= tabsToRender[i];
192
+ filledWidth -= tabsToRender[_i2];
148
193
  tabsToRender.pop();
149
194
  }
150
195
  }
@@ -154,10 +199,10 @@ const CollapsibleTabs = _ref => {
154
199
  }
155
200
  }, [children, elements.lastVisibleIndex, elements.sizes, selectedIndex]);
156
201
  // Prepare list of visible and hidden elements
157
- React.useEffect(() => {
158
- const timeout = setTimeout(() => {
202
+ React.useEffect(function () {
203
+ var timeout = setTimeout(function () {
159
204
  var _elements$lastVisible2;
160
- const res = children.reduce((accumulator, tab) => {
205
+ var res = children.reduce(function (accumulator, tab) {
161
206
  var _elements$lastVisible;
162
207
  if (tab.props.alwaysHidden !== true && accumulator.visible.length - 1 < ((_elements$lastVisible = elements.lastVisibleIndex) !== null && _elements$lastVisible !== void 0 ? _elements$lastVisible : 0)) {
163
208
  accumulator.visible.push(tab);
@@ -171,86 +216,104 @@ const CollapsibleTabs = _ref => {
171
216
  ready: elements.lastVisibleIndex !== null
172
217
  });
173
218
  if (selectedIndex > ((_elements$lastVisible2 = elements.lastVisibleIndex) !== null && _elements$lastVisible2 !== void 0 ? _elements$lastVisible2 : 0)) {
174
- const selectedItem = children.find(tab => !tab.props.alwaysHidden && tab.props.id === selected);
219
+ var selectedItem = children.find(function (tab) {
220
+ return !tab.props.alwaysHidden && tab.props.id === selected;
221
+ });
175
222
  if (selectedItem != null) {
176
223
  res.visible.push(selectedItem);
177
224
  }
178
225
  }
179
- const allVisibleTheSame = res.visible.length === preparedElements.visible.length && res.visible.every((item, index) => item === preparedElements.visible[index]);
180
- const allHiddenTheSame = res.hidden.length === preparedElements.hidden.length && res.hidden.every((item, index) => item === preparedElements.hidden[index]);
226
+ var allVisibleTheSame = res.visible.length === preparedElements.visible.length && res.visible.every(function (item, index) {
227
+ return item === preparedElements.visible[index];
228
+ });
229
+ var allHiddenTheSame = res.hidden.length === preparedElements.hidden.length && res.hidden.every(function (item, index) {
230
+ return item === preparedElements.hidden[index];
231
+ });
181
232
  if (!allVisibleTheSame || !allHiddenTheSame || preparedElements.ready !== res.ready) {
182
- fastdom.mutate(() => setPreparedElements(res));
233
+ fastdom.mutate(function () {
234
+ return setPreparedElements(res);
235
+ });
183
236
  }
184
237
  }, DEFAULT_DEBOUNCE_INTERVAL);
185
- return () => {
238
+ return function () {
186
239
  clearTimeout(timeout);
187
240
  };
188
241
  }, [children, elements.lastVisibleIndex, preparedElements, selected, selectedIndex]);
189
242
  // Get list of all possibly visible elements to render in a measure container
190
- const childrenToMeasure = React.useMemo(() => {
191
- const items = children.filter(tab => tab.props.alwaysHidden !== true);
243
+ var childrenToMeasure = React.useMemo(function () {
244
+ var items = children.filter(function (tab) {
245
+ return tab.props.alwaysHidden !== true;
246
+ });
192
247
  return getTabTitles({
193
248
  items,
194
249
  tabIndex: -1
195
250
  });
196
251
  }, [children]);
197
252
  // Initial measure for tabs and more button sizes
198
- React.useEffect(() => {
253
+ React.useEffect(function () {
199
254
  if (measureRef.current == null) {
200
255
  return undefined;
201
256
  }
202
- const measureTask = fastdom.measure(() => {
257
+ var measureTask = fastdom.measure(function () {
203
258
  var _container$children, _moreButton$offsetWid;
204
- const container = measureRef.current;
205
- const descendants = [...((_container$children = container?.children) !== null && _container$children !== void 0 ? _container$children : [])];
206
- const moreButton = descendants.pop();
207
- let moreButtonWidth = (_moreButton$offsetWid = moreButton?.offsetWidth) !== null && _moreButton$offsetWid !== void 0 ? _moreButton$offsetWid : 0;
208
- const {
209
- marginLeft: moreButtonMarginLeft = '0',
210
- marginRight: moreButtonMarginRight = '0'
211
- } = moreButton ? getComputedStyle(moreButton) : {};
259
+ var container = measureRef.current;
260
+ var descendants = _toConsumableArray((_container$children = container === null || container === void 0 ? void 0 : container.children) !== null && _container$children !== void 0 ? _container$children : []);
261
+ var moreButton = descendants.pop();
262
+ var moreButtonWidth = (_moreButton$offsetWid = moreButton === null || moreButton === void 0 ? void 0 : moreButton.offsetWidth) !== null && _moreButton$offsetWid !== void 0 ? _moreButton$offsetWid : 0;
263
+ var _ref2 = moreButton ? getComputedStyle(moreButton) : {},
264
+ _ref2$marginLeft = _ref2.marginLeft,
265
+ moreButtonMarginLeft = _ref2$marginLeft === void 0 ? '0' : _ref2$marginLeft,
266
+ _ref2$marginRight = _ref2.marginRight,
267
+ moreButtonMarginRight = _ref2$marginRight === void 0 ? '0' : _ref2$marginRight;
212
268
  moreButtonWidth += +moreButtonMarginLeft.replace('px', '') + +moreButtonMarginRight.replace('px', '');
213
- const tabsWidth = descendants.map(node => {
214
- const {
215
- marginLeft,
216
- marginRight
217
- } = getComputedStyle(node);
218
- const width = node.getBoundingClientRect().width;
269
+ var tabsWidth = descendants.map(function (node) {
270
+ var _getComputedStyle = getComputedStyle(node),
271
+ marginLeft = _getComputedStyle.marginLeft,
272
+ marginRight = _getComputedStyle.marginRight;
273
+ var width = node.getBoundingClientRect().width;
219
274
  return width + +marginLeft.replace('px', '') + +marginRight.replace('px', '');
220
275
  });
221
- const newSummaryWidth = tabsWidth.reduce((acc, curr) => acc + curr, 0);
222
- const oldSummaryWidth = elements.sizes.tabs.reduce((acc, curr) => acc + curr, 0);
276
+ var newSummaryWidth = tabsWidth.reduce(function (acc, curr) {
277
+ return acc + curr;
278
+ }, 0);
279
+ var oldSummaryWidth = elements.sizes.tabs.reduce(function (acc, curr) {
280
+ return acc + curr;
281
+ }, 0);
223
282
  if (elements.sizes.more !== moreButtonWidth || newSummaryWidth !== oldSummaryWidth) {
224
- fastdom.mutate(() => setSizes({
225
- more: moreButtonWidth,
226
- tabs: tabsWidth
227
- }));
283
+ fastdom.mutate(function () {
284
+ return setSizes({
285
+ more: moreButtonWidth,
286
+ tabs: tabsWidth
287
+ });
288
+ });
228
289
  }
229
290
  });
230
- return () => {
291
+ return function () {
231
292
  fastdom.clear(measureTask);
232
293
  };
233
294
  }, [children, elements.sizes.more, elements.sizes.tabs]);
234
295
  // Start observers to listen resizing and mutation
235
- React.useEffect(() => {
296
+ React.useEffect(function () {
236
297
  if (measureRef.current === null) {
237
298
  return undefined;
238
299
  }
239
- let measureTask = () => {};
240
- const resizeObserver = new ResizeObserver(entries => {
241
- entries.forEach(entry => {
300
+ var measureTask = function measureTask() {};
301
+ var resizeObserver = new ResizeObserver(function (entries) {
302
+ entries.forEach(function (entry) {
242
303
  fastdom.clear(measureTask);
243
- measureTask = fastdom.mutate(() => adjustTabs(entry));
304
+ measureTask = fastdom.mutate(function () {
305
+ return adjustTabs(entry);
306
+ });
244
307
  });
245
308
  });
246
309
  resizeObserver.observe(measureRef.current);
247
- return () => {
310
+ return function () {
248
311
  fastdom.clear(measureTask);
249
312
  resizeObserver.disconnect();
250
313
  };
251
314
  }, [adjustTabs]);
252
- const isAdjusted = elements.lastVisibleIndex !== null && preparedElements.ready === true || initialVisibleItems;
253
- const className = classNames(modules_02138f4a.titles, modules_02138f4a.autoCollapse, isAdjusted && modules_02138f4a.adjusted);
315
+ var isAdjusted = elements.lastVisibleIndex !== null && preparedElements.ready === true || initialVisibleItems;
316
+ var className = classNames(modules_02138f4a.titles, modules_02138f4a.autoCollapse, isAdjusted && modules_02138f4a.adjusted);
254
317
  return /*#__PURE__*/React.createElement("div", {
255
318
  className: modules_02138f4a.autoCollapseContainer
256
319
  }, /*#__PURE__*/React.createElement("div", {
@@ -268,7 +331,9 @@ const CollapsibleTabs = _ref => {
268
331
  ref: measureRef,
269
332
  className: classNames(className, modules_02138f4a.measure)
270
333
  }, childrenToMeasure, /*#__PURE__*/React.createElement(FakeMoreButton, {
271
- hasActiveChildren: preparedElements.hidden.some(item => item.props.alwaysHidden && item.props.id === selected),
334
+ hasActiveChildren: preparedElements.hidden.some(function (item) {
335
+ return item.props.alwaysHidden && item.props.id === selected;
336
+ }),
272
337
  moreClassName: moreClassName,
273
338
  moreActiveClassName: moreActiveClassName
274
339
  })));
@@ -1,9 +1,7 @@
1
1
  import PropTypes from 'prop-types';
2
2
 
3
- const CustomItem = _ref => {
4
- let {
5
- children
6
- } = _ref;
3
+ var CustomItem = function CustomItem(_ref) {
4
+ var children = _ref.children;
7
5
  return children;
8
6
  };
9
7
  CustomItem.propTypes = {
@@ -1,4 +1,10 @@
1
- import { _ as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
1
+ import { _ as _defineProperty, a as _inherits, b as _createClass, c as _objectWithoutProperties, e as _extends, f as _classCallCheck, g as _callSuper } from '../_helpers/_rollupPluginBabelHelpers.js';
2
+ import 'core-js/modules/es.array.concat.js';
3
+ import 'core-js/modules/es.array.filter.js';
4
+ import 'core-js/modules/es.array.find.js';
5
+ import 'core-js/modules/es.array.map.js';
6
+ import 'core-js/modules/es.object.to-string.js';
7
+ import 'core-js/modules/es.promise.js';
2
8
  import React, { PureComponent } from 'react';
3
9
  import PropTypes from 'prop-types';
4
10
  import classNames from 'classnames';
@@ -7,28 +13,50 @@ import joinDataTestAttributes from '../global/data-tests.js';
7
13
  import { m as modules_02138f4a, T as TabLink } from '../_helpers/tab-link.js';
8
14
  import CollapsibleTabs from './collapsible-tabs.js';
9
15
  import { CustomItem } from './custom-item.js';
16
+ import 'core-js/modules/es.array.iterator.js';
17
+ import 'core-js/modules/es.map.js';
18
+ import 'core-js/modules/es.weak-map.js';
19
+ import 'core-js/modules/web.dom-collections.iterator.js';
20
+ import 'core-js/modules/es.array.reduce.js';
21
+ import 'core-js/modules/es.object.entries.js';
10
22
  import '../link/link.js';
11
23
  import '../link/clickableLink.js';
12
24
  import '../_helpers/link.js';
25
+ import 'core-js/modules/es.array.find-index.js';
26
+ import 'core-js/modules/es.array.slice.js';
27
+ import 'core-js/modules/es.regexp.exec.js';
28
+ import 'core-js/modules/es.string.replace.js';
29
+ import 'core-js/modules/web.dom-collections.for-each.js';
13
30
  import 'fastdom';
14
31
  import './collapsible-more.js';
15
32
  import '@jetbrains/icons/chevron-10px';
16
33
  import '../popup/popup.consts.js';
17
34
  import '../popup-menu/popup-menu.js';
18
35
  import '../popup/popup.js';
36
+ import 'core-js/modules/es.regexp.to-string.js';
19
37
  import 'react-dom';
20
38
  import '../global/get-uid.js';
21
39
  import '../global/schedule-raf.js';
22
40
  import '../global/dom.js';
41
+ import 'core-js/modules/es.object.assign.js';
42
+ import 'core-js/modules/es.set.js';
43
+ import 'core-js/modules/es.string.split.js';
23
44
  import '../shortcuts/shortcuts.js';
24
45
  import '../shortcuts/core.js';
46
+ import 'core-js/modules/es.array.includes.js';
47
+ import 'core-js/modules/es.array.splice.js';
48
+ import 'core-js/modules/es.string.includes.js';
49
+ import 'core-js/modules/es.string.match.js';
25
50
  import 'combokeys';
26
51
  import '../global/sniffer.js';
27
52
  import 'sniffr';
28
53
  import '../tab-trap/tab-trap.js';
29
54
  import '../popup/position.js';
55
+ import 'core-js/modules/es.array.sort.js';
30
56
  import '../popup/popup.target.js';
31
57
  import '../list/list.js';
58
+ import 'core-js/modules/es.symbol.js';
59
+ import 'core-js/modules/es.symbol.description.js';
32
60
  import 'react-virtualized/dist/es/List';
33
61
  import 'react-virtualized/dist/es/AutoSizer';
34
62
  import 'react-virtualized/dist/es/WindowScroller';
@@ -39,15 +67,18 @@ import '../global/create-stateful-context.js';
39
67
  import '../list/list__link.js';
40
68
  import '../_helpers/list.js';
41
69
  import '../list/list__item.js';
70
+ import 'core-js/modules/es.array.index-of.js';
42
71
  import '../avatar/avatar.js';
43
72
  import '../global/url.js';
44
73
  import '../avatar/fallback-avatar.js';
74
+ import 'core-js/modules/es.array.from.js';
45
75
  import '../checkbox/checkbox.js';
46
76
  import '@jetbrains/icons/checkmark-12px';
47
77
  import '@jetbrains/icons/remove-12px';
48
78
  import '../icon/icon.js';
49
79
  import '../icon/icon__constants.js';
50
80
  import '../_helpers/icon__svg.js';
81
+ import 'core-js/modules/es.string.starts-with.js';
51
82
  import '../global/prop-types.js';
52
83
  import '../global/composeRefs.js';
53
84
  import '../list/list__custom.js';
@@ -64,81 +95,93 @@ import '../global/controls-height.js';
64
95
  import '../_helpers/button__classes.js';
65
96
  import './collapsible-tab.js';
66
97
 
67
- class Tabs extends PureComponent {
68
- static propTypes = {
69
- selected: PropTypes.string,
70
- className: PropTypes.string,
71
- tabContainerClassName: PropTypes.string,
72
- href: PropTypes.string,
73
- children: PropTypes.node.isRequired,
74
- onSelect: PropTypes.func,
75
- 'data-test': PropTypes.string,
76
- autoCollapse: PropTypes.bool
77
- };
78
- static defaultProps = {
79
- onSelect() {}
80
- };
81
- handleSelect = memoize(key => () => this.props.onSelect(key));
82
- getTabTitle = (child, i) => {
83
- if (child == null || typeof child !== 'object' || child.type === CustomItem) {
84
- return child;
98
+ var _excluded = ["className", "tabContainerClassName", "children", "selected", "autoCollapse", "data-test"];
99
+ var Tabs = /*#__PURE__*/function (_PureComponent) {
100
+ function Tabs() {
101
+ var _this;
102
+ _classCallCheck(this, Tabs);
103
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
104
+ args[_key] = arguments[_key];
85
105
  }
86
- const {
87
- selected
88
- } = this.props;
89
- const {
90
- title,
91
- titleProps,
92
- id,
93
- disabled,
94
- href,
95
- className,
96
- activeClassName
97
- } = child.props;
98
- const key = id || String(i);
99
- const isSelected = key === selected;
100
- const titleClasses = classNames(modules_02138f4a.title, className, isSelected && activeClassName, {
101
- [modules_02138f4a.selected]: isSelected
106
+ _this = _callSuper(this, Tabs, [].concat(args));
107
+ _defineProperty(_this, "handleSelect", memoize(function (key) {
108
+ return function () {
109
+ return _this.props.onSelect(key);
110
+ };
111
+ }));
112
+ _defineProperty(_this, "getTabTitle", function (child, i) {
113
+ if (child == null || typeof child !== 'object' || child.type === CustomItem) {
114
+ return child;
115
+ }
116
+ var selected = _this.props.selected;
117
+ var _child$props = child.props,
118
+ title = _child$props.title,
119
+ titleProps = _child$props.titleProps,
120
+ id = _child$props.id,
121
+ disabled = _child$props.disabled,
122
+ href = _child$props.href,
123
+ className = _child$props.className,
124
+ activeClassName = _child$props.activeClassName;
125
+ var key = id || String(i);
126
+ var isSelected = key === selected;
127
+ var titleClasses = classNames(modules_02138f4a.title, className, isSelected && activeClassName, {
128
+ [modules_02138f4a.selected]: isSelected
129
+ });
130
+ return /*#__PURE__*/React.createElement(TabLink, _extends({
131
+ title: title,
132
+ isSelected: isSelected,
133
+ key: key,
134
+ href: href,
135
+ className: titleClasses,
136
+ disabled: disabled,
137
+ onPlainLeftClick: _this.handleSelect(key)
138
+ }, titleProps));
102
139
  });
103
- return /*#__PURE__*/React.createElement(TabLink, _extends({
104
- title: title,
105
- isSelected: isSelected,
106
- key: key,
107
- href: href,
108
- className: titleClasses,
109
- disabled: disabled,
110
- onPlainLeftClick: this.handleSelect(key)
111
- }, titleProps));
112
- };
113
- render() {
114
- const {
115
- className,
116
- tabContainerClassName,
117
- children,
118
- selected,
119
- autoCollapse,
120
- 'data-test': dataTest,
121
- ...restProps
122
- } = this.props;
123
- const classes = classNames(modules_02138f4a.tabs, className);
124
- const childrenArray = React.Children.toArray(children).filter(Boolean);
125
- return /*#__PURE__*/React.createElement("div", {
126
- className: classes,
127
- "data-test": joinDataTestAttributes('ring-dumb-tabs', dataTest)
128
- }, autoCollapse === true ? /*#__PURE__*/React.createElement(CollapsibleTabs, _extends({}, restProps, {
129
- onSelect: this.handleSelect,
130
- selected: selected
131
- }), childrenArray) : /*#__PURE__*/React.createElement("div", {
132
- className: modules_02138f4a.titles
133
- }, childrenArray.map(this.getTabTitle)), /*#__PURE__*/React.createElement("div", {
134
- className: classNames(tabContainerClassName)
135
- }, childrenArray.find((_ref, i) => {
136
- let {
137
- props
138
- } = _ref;
139
- return (props.id || String(i)) === selected;
140
- })));
140
+ return _this;
141
141
  }
142
- }
142
+ _inherits(Tabs, _PureComponent);
143
+ return _createClass(Tabs, [{
144
+ key: "render",
145
+ value: function render() {
146
+ var _this$props = this.props,
147
+ className = _this$props.className,
148
+ tabContainerClassName = _this$props.tabContainerClassName,
149
+ children = _this$props.children,
150
+ selected = _this$props.selected,
151
+ autoCollapse = _this$props.autoCollapse,
152
+ dataTest = _this$props['data-test'],
153
+ restProps = _objectWithoutProperties(_this$props, _excluded);
154
+ var classes = classNames(modules_02138f4a.tabs, className);
155
+ var childrenArray = React.Children.toArray(children).filter(Boolean);
156
+ return /*#__PURE__*/React.createElement("div", {
157
+ className: classes,
158
+ "data-test": joinDataTestAttributes('ring-dumb-tabs', dataTest)
159
+ }, autoCollapse === true ? /*#__PURE__*/React.createElement(CollapsibleTabs, _extends({}, restProps, {
160
+ onSelect: this.handleSelect,
161
+ selected: selected
162
+ }), childrenArray) : /*#__PURE__*/React.createElement("div", {
163
+ className: modules_02138f4a.titles
164
+ }, childrenArray.map(this.getTabTitle)), /*#__PURE__*/React.createElement("div", {
165
+ className: classNames(tabContainerClassName)
166
+ }, childrenArray.find(function (_ref, i) {
167
+ var props = _ref.props;
168
+ return (props.id || String(i)) === selected;
169
+ })));
170
+ }
171
+ }]);
172
+ }(PureComponent);
173
+ _defineProperty(Tabs, "propTypes", {
174
+ selected: PropTypes.string,
175
+ className: PropTypes.string,
176
+ tabContainerClassName: PropTypes.string,
177
+ href: PropTypes.string,
178
+ children: PropTypes.node.isRequired,
179
+ onSelect: PropTypes.func,
180
+ 'data-test': PropTypes.string,
181
+ autoCollapse: PropTypes.bool
182
+ });
183
+ _defineProperty(Tabs, "defaultProps", {
184
+ onSelect() {}
185
+ });
143
186
 
144
187
  export { CustomItem, Tabs as default };