@jetbrains/ring-ui-built 6.0.30 → 6.0.32

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