@jetbrains/ring-ui-built 6.0.32 → 6.0.34

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 +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 +176 -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.d.ts +1 -2
  124. package/components/http/http.js +345 -203
  125. package/components/http/http.mock.d.ts +1 -5
  126. package/components/http/http.mock.js +101 -49
  127. package/components/hub-source/hub-source.js +190 -83
  128. package/components/hub-source/hub-source__user.js +44 -11
  129. package/components/hub-source/hub-source__users-groups.js +65 -37
  130. package/components/i18n/i18n-context.js +10 -7
  131. package/components/i18n/i18n.js +10 -7
  132. package/components/icon/icon.js +93 -76
  133. package/components/icon/icon__svg.js +8 -0
  134. package/components/icon/index.js +8 -0
  135. package/components/input/input.js +13 -0
  136. package/components/island/adaptive-island-hoc.js +43 -30
  137. package/components/island/content.js +132 -115
  138. package/components/island/header.js +70 -57
  139. package/components/island/island.js +40 -28
  140. package/components/island-legacy/content-legacy.js +25 -17
  141. package/components/island-legacy/header-legacy.js +27 -19
  142. package/components/island-legacy/island-legacy.js +25 -17
  143. package/components/link/clickableLink.js +59 -44
  144. package/components/link/link.js +68 -57
  145. package/components/list/consts.js +2 -2
  146. package/components/list/list.js +698 -611
  147. package/components/list/list__custom.js +62 -44
  148. package/components/list/list__hint.js +19 -10
  149. package/components/list/list__item.js +174 -133
  150. package/components/list/list__link.js +50 -37
  151. package/components/list/list__separator.js +24 -14
  152. package/components/list/list__title.js +32 -22
  153. package/components/list/list__users-groups-source.js +126 -54
  154. package/components/loader/loader.js +74 -43
  155. package/components/loader/loader__core.js +263 -198
  156. package/components/loader-inline/loader-inline.js +35 -23
  157. package/components/loader-screen/loader-screen.js +46 -25
  158. package/components/login-dialog/login-dialog.js +158 -111
  159. package/components/login-dialog/service.js +34 -8
  160. package/components/markdown/markdown.js +23 -15
  161. package/components/message/message.js +203 -161
  162. package/components/old-browsers-message/old-browsers-message.js +18 -11
  163. package/components/old-browsers-message/old-browsers-message__stop.js +7 -0
  164. package/components/old-browsers-message/white-list.js +17 -9
  165. package/components/pager/pager.js +271 -212
  166. package/components/panel/panel.js +25 -17
  167. package/components/permissions/permissions.js +172 -127
  168. package/components/permissions/permissions__cache.js +224 -194
  169. package/components/popup/popup.consts.js +1 -1
  170. package/components/popup/popup.js +343 -284
  171. package/components/popup/popup.target.js +8 -9
  172. package/components/popup/position.js +106 -96
  173. package/components/popup-menu/popup-menu.js +81 -44
  174. package/components/progress-bar/progress-bar.js +104 -87
  175. package/components/query-assist/query-assist.js +916 -838
  176. package/components/query-assist/query-assist__suggestions.js +30 -1
  177. package/components/radio/radio.js +34 -19
  178. package/components/radio/radio__item.js +69 -52
  179. package/components/select/select.js +957 -852
  180. package/components/select/select__filter.js +30 -0
  181. package/components/select/select__popup.js +487 -373
  182. package/components/shortcuts/core.js +217 -166
  183. package/components/shortcuts/shortcut-title.js +11 -6
  184. package/components/shortcuts/shortcuts-hoc.js +45 -19
  185. package/components/shortcuts/shortcuts.js +75 -50
  186. package/components/slider/slider.js +122 -99
  187. package/components/slider/slider.utils.js +24 -14
  188. package/components/storage/storage.js +33 -4
  189. package/components/storage/storage__fallback.js +224 -149
  190. package/components/storage/storage__local.js +153 -90
  191. package/components/tab-trap/tab-trap.js +153 -122
  192. package/components/table/cell.js +26 -14
  193. package/components/table/disable-hover-hoc.js +51 -33
  194. package/components/table/header-cell.js +89 -64
  195. package/components/table/header.js +132 -104
  196. package/components/table/multitable.js +125 -107
  197. package/components/table/row-with-focus-sensor.js +69 -25
  198. package/components/table/row.js +216 -175
  199. package/components/table/selection-adapter.js +3 -1
  200. package/components/table/selection-shortcuts-hoc.js +181 -180
  201. package/components/table/selection.js +226 -156
  202. package/components/table/smart-table.js +88 -50
  203. package/components/table/table.js +358 -289
  204. package/components/tabs/collapsible-more.js +79 -46
  205. package/components/tabs/collapsible-tab.js +38 -31
  206. package/components/tabs/collapsible-tabs.js +153 -88
  207. package/components/tabs/custom-item.js +2 -4
  208. package/components/tabs/dumb-tabs.js +117 -74
  209. package/components/tabs/smart-tabs.js +69 -29
  210. package/components/tabs/tab-link.js +5 -1
  211. package/components/tabs/tab.js +31 -19
  212. package/components/tabs/tabs.js +31 -0
  213. package/components/tag/tag.js +173 -133
  214. package/components/tags-input/tags-input.js +427 -329
  215. package/components/tags-list/tags-list.js +78 -57
  216. package/components/text/text.js +39 -28
  217. package/components/toggle/toggle.js +70 -56
  218. package/components/tooltip/tooltip.js +190 -146
  219. package/components/user-agreement/service.js +371 -228
  220. package/components/user-agreement/toolbox.eula.js +1 -160
  221. package/components/user-agreement/user-agreement.js +120 -85
  222. package/components/user-card/card.js +29 -0
  223. package/components/user-card/smart-user-card-tooltip.js +111 -51
  224. package/components/user-card/tooltip.js +84 -47
  225. package/components/user-card/user-card.js +29 -0
  226. package/package.json +1 -2
@@ -1,5 +1,7 @@
1
- import { _ as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
2
- import React, { PureComponent, Component } from 'react';
1
+ import { _ as _defineProperty, a as _inherits, b as _createClass, c as _objectWithoutProperties, e as _extends, d as _objectSpread2, f as _classCallCheck, g as _callSuper } from '../_helpers/_rollupPluginBabelHelpers.js';
2
+ import 'core-js/modules/es.array.filter.js';
3
+ import 'core-js/modules/es.object.to-string.js';
4
+ import React, { Component, PureComponent } from 'react';
3
5
  import PropTypes from 'prop-types';
4
6
  import classNames from 'classnames';
5
7
  import Avatar, { Size } from '../avatar/avatar.js';
@@ -9,29 +11,56 @@ import PopupMenu from '../popup-menu/popup-menu.js';
9
11
  import { I18nContext } from '../i18n/i18n-context.js';
10
12
  import { isTruthy } from '../global/typescript-utils.js';
11
13
  import { m as modules_47759f5e } from '../_helpers/header.js';
14
+ import 'core-js/modules/es.array.concat.js';
12
15
  import '../global/url.js';
16
+ import 'core-js/modules/es.array.index-of.js';
17
+ import 'core-js/modules/es.regexp.exec.js';
18
+ import 'core-js/modules/es.string.match.js';
19
+ import 'core-js/modules/es.string.replace.js';
13
20
  import '../global/dom.js';
21
+ import 'core-js/modules/es.array.iterator.js';
22
+ import 'core-js/modules/es.object.assign.js';
23
+ import 'core-js/modules/es.object.entries.js';
24
+ import 'core-js/modules/es.set.js';
25
+ import 'core-js/modules/es.string.split.js';
26
+ import 'core-js/modules/web.dom-collections.for-each.js';
27
+ import 'core-js/modules/web.dom-collections.iterator.js';
14
28
  import '../avatar/fallback-avatar.js';
29
+ import 'core-js/modules/es.array.from.js';
30
+ import 'core-js/modules/es.array.map.js';
31
+ import 'core-js/modules/es.array.slice.js';
15
32
  import '../global/get-uid.js';
33
+ import 'core-js/modules/es.regexp.to-string.js';
16
34
  import '@jetbrains/icons/chevron-10px';
17
35
  import '../icon/icon.js';
18
36
  import 'util-deprecate';
19
37
  import '../icon/icon__constants.js';
20
38
  import '../_helpers/icon__svg.js';
39
+ import 'core-js/modules/es.string.starts-with.js';
21
40
  import '../global/memoize.js';
41
+ import 'core-js/modules/es.map.js';
42
+ import 'core-js/modules/es.weak-map.js';
22
43
  import '../link/clickableLink.js';
23
44
  import '../global/controls-height.js';
24
45
  import '../_helpers/button__classes.js';
25
46
  import '../list/list.js';
47
+ import 'core-js/modules/es.symbol.js';
48
+ import 'core-js/modules/es.symbol.description.js';
49
+ import 'core-js/modules/es.array.find.js';
50
+ import 'core-js/modules/es.array.find-index.js';
51
+ import 'core-js/modules/es.array.includes.js';
52
+ import 'core-js/modules/es.string.includes.js';
26
53
  import 'react-virtualized/dist/es/List';
27
54
  import 'react-virtualized/dist/es/AutoSizer';
28
55
  import 'react-virtualized/dist/es/WindowScroller';
29
56
  import 'react-virtualized/dist/es/CellMeasurer';
30
57
  import 'memoize-one';
31
58
  import '../global/data-tests.js';
59
+ import 'core-js/modules/es.array.reduce.js';
32
60
  import '../global/schedule-raf.js';
33
61
  import '../shortcuts/shortcuts.js';
34
62
  import '../shortcuts/core.js';
63
+ import 'core-js/modules/es.array.splice.js';
35
64
  import 'combokeys';
36
65
  import '../global/sniffer.js';
37
66
  import 'sniffr';
@@ -58,181 +87,185 @@ import '../popup/popup.js';
58
87
  import 'react-dom';
59
88
  import '../tab-trap/tab-trap.js';
60
89
  import '../popup/position.js';
90
+ import 'core-js/modules/es.array.sort.js';
61
91
  import '../popup/popup.consts.js';
62
92
  import '../popup/popup.target.js';
63
93
  import '../i18n/i18n.js';
64
94
 
65
- const rgItemType = PopupMenu.ListProps.Type.LINK;
66
- class Profile extends PureComponent {
67
- static propTypes = {
68
- className: PropTypes.string,
69
- activeClassName: PropTypes.string,
70
- closeOnSelect: PropTypes.bool,
71
- hasUpdates: PropTypes.bool,
72
- loading: PropTypes.bool,
73
- onLogin: PropTypes.func,
74
- onLogout: PropTypes.func,
75
- onSwitchUser: PropTypes.func,
76
- profileUrl: PropTypes.string,
77
- renderPopupItems: PropTypes.func,
78
- LinkComponent: PropTypes.oneOfType([PropTypes.instanceOf(Component), PropTypes.func, PropTypes.string]),
79
- translations: PropTypes.shape({
80
- profile: PropTypes.string,
81
- login: PropTypes.string,
82
- logout: PropTypes.string,
83
- applyChangedUser: PropTypes.string,
84
- switchUser: PropTypes.string
85
- }),
86
- user: PropTypes.shape({
87
- guest: PropTypes.bool,
88
- profile: PropTypes.object,
89
- name: PropTypes.string
90
- }),
91
- size: PropTypes.number,
92
- round: PropTypes.bool,
93
- showName: PropTypes.bool,
94
- showLogIn: PropTypes.bool,
95
- showLogOut: PropTypes.bool,
96
- showSwitchUser: PropTypes.bool,
97
- showApplyChangedUser: PropTypes.bool,
98
- onRevertPostponement: PropTypes.func,
99
- renderGuest: PropTypes.func,
100
- menuProps: PropTypes.object,
101
- onShow: PropTypes.func,
102
- onHide: PropTypes.func
103
- };
104
- static defaultProps = {
105
- closeOnSelect: true,
106
- renderPopupItems: items => items,
107
- size: Size.Size32,
108
- renderGuest: _ref => {
109
- let {
110
- loading,
111
- onLogin,
112
- className,
113
- translations
114
- } = _ref;
115
- return /*#__PURE__*/React.createElement(I18nContext.Consumer, null, _ref2 => {
116
- var _translations$login;
117
- let {
118
- translate
119
- } = _ref2;
120
- return /*#__PURE__*/React.createElement("div", {
95
+ var _excluded = ["className", "activeClassName", "closeOnSelect", "hasUpdates", "onLogout", "user", "profileUrl", "LinkComponent", "onSwitchUser", "renderPopupItems", "onRevertPostponement", "showApplyChangedUser", "showName", "showLogIn", "showLogOut", "showSwitchUser", "renderGuest", "translations", "size", "round", "loading", "onLogin", "menuProps", "onShow", "onHide"];
96
+ var rgItemType = PopupMenu.ListProps.Type.LINK;
97
+ var Profile = /*#__PURE__*/function (_PureComponent) {
98
+ function Profile() {
99
+ _classCallCheck(this, Profile);
100
+ return _callSuper(this, Profile, arguments);
101
+ }
102
+ _inherits(Profile, _PureComponent);
103
+ return _createClass(Profile, [{
104
+ key: "render",
105
+ value: function render() {
106
+ var _translations$applyCh, _translations$login, _translations$profile, _translations$switchU, _translations$logout;
107
+ var _this$props = this.props,
108
+ className = _this$props.className,
109
+ activeClassName = _this$props.activeClassName,
110
+ closeOnSelect = _this$props.closeOnSelect,
111
+ hasUpdates = _this$props.hasUpdates,
112
+ onLogout = _this$props.onLogout,
113
+ user = _this$props.user,
114
+ profileUrl = _this$props.profileUrl,
115
+ LinkComponent = _this$props.LinkComponent,
116
+ onSwitchUser = _this$props.onSwitchUser,
117
+ renderPopupItems = _this$props.renderPopupItems,
118
+ onRevertPostponement = _this$props.onRevertPostponement,
119
+ showApplyChangedUser = _this$props.showApplyChangedUser,
120
+ showName = _this$props.showName,
121
+ showLogIn = _this$props.showLogIn,
122
+ showLogOut = _this$props.showLogOut,
123
+ showSwitchUser = _this$props.showSwitchUser,
124
+ renderGuest = _this$props.renderGuest,
125
+ translations = _this$props.translations,
126
+ size = _this$props.size,
127
+ round = _this$props.round;
128
+ _this$props.loading;
129
+ _this$props.onLogin;
130
+ var menuProps = _this$props.menuProps,
131
+ onShow = _this$props.onShow,
132
+ onHide = _this$props.onHide,
133
+ props = _objectWithoutProperties(_this$props, _excluded);
134
+ var translate = this.context.translate;
135
+ if (!user) {
136
+ return /*#__PURE__*/React.createElement("div", _extends({}, props, {
121
137
  className: classNames(modules_47759f5e.profileEmpty, className)
122
- }, /*#__PURE__*/React.createElement(Button, {
123
- primary: true,
124
- "data-test": "ring-header-login-button",
125
- disabled: loading,
126
- loader: loading,
127
- onClick: onLogin
128
- }, (_translations$login = translations?.login) !== null && _translations$login !== void 0 ? _translations$login : translate('login')));
138
+ }), /*#__PURE__*/React.createElement(Avatar, {
139
+ size: size,
140
+ round: round
141
+ }));
142
+ }
143
+ if (user.guest) {
144
+ return renderGuest(this.props);
145
+ }
146
+ var avatarWrapper = classNames(modules_47759f5e.avatarWrapper, {
147
+ [modules_47759f5e.hasUpdates]: hasUpdates
129
148
  });
130
- }
131
- };
132
- static contextType = I18nContext;
133
- static Size = Size;
134
- render() {
135
- var _translations$applyCh, _translations$login2, _translations$profile, _translations$switchU, _translations$logout;
136
- const {
137
- className,
138
- activeClassName,
139
- closeOnSelect,
140
- hasUpdates,
141
- onLogout,
142
- user,
143
- profileUrl,
144
- LinkComponent,
145
- onSwitchUser,
146
- renderPopupItems,
147
- onRevertPostponement,
148
- showApplyChangedUser,
149
- showName,
150
- showLogIn,
151
- showLogOut,
152
- showSwitchUser,
153
- renderGuest,
154
- translations,
155
- size,
156
- round,
157
- loading,
158
- onLogin,
159
- menuProps,
160
- onShow,
161
- onHide,
162
- ...props
163
- } = this.props;
164
- const {
165
- translate
166
- } = this.context;
167
- if (!user) {
168
- return /*#__PURE__*/React.createElement("div", _extends({}, props, {
169
- className: classNames(modules_47759f5e.profileEmpty, className)
170
- }), /*#__PURE__*/React.createElement(Avatar, {
149
+ var anchor = /*#__PURE__*/React.createElement("button", {
150
+ type: "button",
151
+ className: modules_47759f5e.anchorClassName
152
+ }, /*#__PURE__*/React.createElement("span", {
153
+ className: avatarWrapper
154
+ }, /*#__PURE__*/React.createElement(Avatar, {
155
+ url: user.profile && user.profile.avatar && user.profile.avatar.url,
171
156
  size: size,
172
157
  round: round
158
+ })), showName && /*#__PURE__*/React.createElement("span", null, user.name));
159
+ var items = [showApplyChangedUser && {
160
+ rgItemType,
161
+ label: (_translations$applyCh = translations === null || translations === void 0 ? void 0 : translations.applyChangedUser) !== null && _translations$applyCh !== void 0 ? _translations$applyCh : translate('applyChangedUser'),
162
+ className: modules_47759f5e.profileMenuItem,
163
+ onClick: onRevertPostponement
164
+ }, showLogIn && {
165
+ rgItemType,
166
+ label: (_translations$login = translations === null || translations === void 0 ? void 0 : translations.login) !== null && _translations$login !== void 0 ? _translations$login : translate('login'),
167
+ className: modules_47759f5e.profileMenuItem,
168
+ onClick: onRevertPostponement
169
+ }, {
170
+ rgItemType: PopupMenu.ListProps.Type.LINK,
171
+ label: (_translations$profile = translations === null || translations === void 0 ? void 0 : translations.profile) !== null && _translations$profile !== void 0 ? _translations$profile : translate('profile'),
172
+ target: '_self',
173
+ // Full page reload in Angular
174
+ href: profileUrl,
175
+ LinkComponent
176
+ }, showSwitchUser && {
177
+ rgItemType,
178
+ label: (_translations$switchU = translations === null || translations === void 0 ? void 0 : translations.switchUser) !== null && _translations$switchU !== void 0 ? _translations$switchU : translate('switchUser'),
179
+ className: modules_47759f5e.profileMenuItem,
180
+ onClick: onSwitchUser
181
+ }, showLogOut && {
182
+ rgItemType,
183
+ label: (_translations$logout = translations === null || translations === void 0 ? void 0 : translations.logout) !== null && _translations$logout !== void 0 ? _translations$logout : translate('logout'),
184
+ onClick: onLogout
185
+ }].filter(isTruthy);
186
+ return /*#__PURE__*/React.createElement(DropdownMenu, _extends({}, props, {
187
+ onShow: onShow,
188
+ onHide: onHide,
189
+ title: user.name,
190
+ anchor: anchor,
191
+ data: renderPopupItems(items),
192
+ "data-test": "ring-profile",
193
+ className: classNames(modules_47759f5e.profile, className),
194
+ activeClassName: activeClassName,
195
+ menuProps: _objectSpread2({
196
+ closeOnSelect,
197
+ left: -2,
198
+ top: -8,
199
+ sidePadding: 32
200
+ }, menuProps)
173
201
  }));
174
202
  }
175
- if (user.guest) {
176
- return renderGuest(this.props);
177
- }
178
- const avatarWrapper = classNames(modules_47759f5e.avatarWrapper, {
179
- [modules_47759f5e.hasUpdates]: hasUpdates
203
+ }]);
204
+ }(PureComponent);
205
+ _defineProperty(Profile, "propTypes", {
206
+ className: PropTypes.string,
207
+ activeClassName: PropTypes.string,
208
+ closeOnSelect: PropTypes.bool,
209
+ hasUpdates: PropTypes.bool,
210
+ loading: PropTypes.bool,
211
+ onLogin: PropTypes.func,
212
+ onLogout: PropTypes.func,
213
+ onSwitchUser: PropTypes.func,
214
+ profileUrl: PropTypes.string,
215
+ renderPopupItems: PropTypes.func,
216
+ LinkComponent: PropTypes.oneOfType([PropTypes.instanceOf(Component), PropTypes.func, PropTypes.string]),
217
+ translations: PropTypes.shape({
218
+ profile: PropTypes.string,
219
+ login: PropTypes.string,
220
+ logout: PropTypes.string,
221
+ applyChangedUser: PropTypes.string,
222
+ switchUser: PropTypes.string
223
+ }),
224
+ user: PropTypes.shape({
225
+ guest: PropTypes.bool,
226
+ profile: PropTypes.object,
227
+ name: PropTypes.string
228
+ }),
229
+ size: PropTypes.number,
230
+ round: PropTypes.bool,
231
+ showName: PropTypes.bool,
232
+ showLogIn: PropTypes.bool,
233
+ showLogOut: PropTypes.bool,
234
+ showSwitchUser: PropTypes.bool,
235
+ showApplyChangedUser: PropTypes.bool,
236
+ onRevertPostponement: PropTypes.func,
237
+ renderGuest: PropTypes.func,
238
+ menuProps: PropTypes.object,
239
+ onShow: PropTypes.func,
240
+ onHide: PropTypes.func
241
+ });
242
+ _defineProperty(Profile, "defaultProps", {
243
+ closeOnSelect: true,
244
+ renderPopupItems: function renderPopupItems(items) {
245
+ return items;
246
+ },
247
+ size: Size.Size32,
248
+ renderGuest: function renderGuest(_ref) {
249
+ var loading = _ref.loading,
250
+ onLogin = _ref.onLogin,
251
+ className = _ref.className,
252
+ translations = _ref.translations;
253
+ return /*#__PURE__*/React.createElement(I18nContext.Consumer, null, function (_ref2) {
254
+ var _translations$login2;
255
+ var translate = _ref2.translate;
256
+ return /*#__PURE__*/React.createElement("div", {
257
+ className: classNames(modules_47759f5e.profileEmpty, className)
258
+ }, /*#__PURE__*/React.createElement(Button, {
259
+ primary: true,
260
+ "data-test": "ring-header-login-button",
261
+ disabled: loading,
262
+ loader: loading,
263
+ onClick: onLogin
264
+ }, (_translations$login2 = translations === null || translations === void 0 ? void 0 : translations.login) !== null && _translations$login2 !== void 0 ? _translations$login2 : translate('login')));
180
265
  });
181
- const anchor = /*#__PURE__*/React.createElement("button", {
182
- type: "button",
183
- className: modules_47759f5e.anchorClassName
184
- }, /*#__PURE__*/React.createElement("span", {
185
- className: avatarWrapper
186
- }, /*#__PURE__*/React.createElement(Avatar, {
187
- url: user.profile && user.profile.avatar && user.profile.avatar.url,
188
- size: size,
189
- round: round
190
- })), showName && /*#__PURE__*/React.createElement("span", null, user.name));
191
- const items = [showApplyChangedUser && {
192
- rgItemType,
193
- label: (_translations$applyCh = translations?.applyChangedUser) !== null && _translations$applyCh !== void 0 ? _translations$applyCh : translate('applyChangedUser'),
194
- className: modules_47759f5e.profileMenuItem,
195
- onClick: onRevertPostponement
196
- }, showLogIn && {
197
- rgItemType,
198
- label: (_translations$login2 = translations?.login) !== null && _translations$login2 !== void 0 ? _translations$login2 : translate('login'),
199
- className: modules_47759f5e.profileMenuItem,
200
- onClick: onRevertPostponement
201
- }, {
202
- rgItemType: PopupMenu.ListProps.Type.LINK,
203
- label: (_translations$profile = translations?.profile) !== null && _translations$profile !== void 0 ? _translations$profile : translate('profile'),
204
- target: '_self',
205
- // Full page reload in Angular
206
- href: profileUrl,
207
- LinkComponent
208
- }, showSwitchUser && {
209
- rgItemType,
210
- label: (_translations$switchU = translations?.switchUser) !== null && _translations$switchU !== void 0 ? _translations$switchU : translate('switchUser'),
211
- className: modules_47759f5e.profileMenuItem,
212
- onClick: onSwitchUser
213
- }, showLogOut && {
214
- rgItemType,
215
- label: (_translations$logout = translations?.logout) !== null && _translations$logout !== void 0 ? _translations$logout : translate('logout'),
216
- onClick: onLogout
217
- }].filter(isTruthy);
218
- return /*#__PURE__*/React.createElement(DropdownMenu, _extends({}, props, {
219
- onShow: onShow,
220
- onHide: onHide,
221
- title: user.name,
222
- anchor: anchor,
223
- data: renderPopupItems(items),
224
- "data-test": "ring-profile",
225
- className: classNames(modules_47759f5e.profile, className),
226
- activeClassName: activeClassName,
227
- menuProps: {
228
- closeOnSelect,
229
- left: -2,
230
- top: -8,
231
- sidePadding: 32,
232
- ...menuProps
233
- }
234
- }));
235
266
  }
236
- }
267
+ });
268
+ _defineProperty(Profile, "contextType", I18nContext);
269
+ _defineProperty(Profile, "Size", Size);
237
270
 
238
271
  export { Profile as default };
@@ -5,5 +5,9 @@ import '../link/link.js';
5
5
  export { S as default } from '../_helpers/services-link.js';
6
6
  import 'classnames';
7
7
  import '../global/data-tests.js';
8
+ import 'core-js/modules/es.array.concat.js';
9
+ import 'core-js/modules/es.array.reduce.js';
10
+ import 'core-js/modules/es.object.entries.js';
11
+ import 'core-js/modules/es.object.to-string.js';
8
12
  import '../link/clickableLink.js';
9
13
  import '../_helpers/link.js';
@@ -1,4 +1,9 @@
1
- import { _ as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
1
+ import { _ as _defineProperty, a as _inherits, b as _createClass, c as _objectWithoutProperties, e as _extends, k as _toConsumableArray, 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.map.js';
5
+ import 'core-js/modules/es.array.sort.js';
6
+ import 'core-js/modules/es.object.to-string.js';
2
7
  import React, { PureComponent } from 'react';
3
8
  import PropTypes from 'prop-types';
4
9
  import servicesIcon from '@jetbrains/icons/services-20px';
@@ -9,6 +14,8 @@ import { T as Theme, m as modules_59717246 } from '../_helpers/theme.js';
9
14
  import TrayIcon from './tray-icon.js';
10
15
  import { S as ServicesLink, m as modules_74a7bf8b } from '../_helpers/services-link.js';
11
16
  import '../global/data-tests.js';
17
+ import 'core-js/modules/es.array.reduce.js';
18
+ import 'core-js/modules/es.object.entries.js';
12
19
  import '../global/typescript-utils.js';
13
20
  import '../_helpers/anchor.js';
14
21
  import '@jetbrains/icons/chevron-10px';
@@ -16,17 +23,35 @@ import '../icon/icon.js';
16
23
  import 'util-deprecate';
17
24
  import '../icon/icon__constants.js';
18
25
  import '../_helpers/icon__svg.js';
26
+ import 'core-js/modules/es.regexp.exec.js';
27
+ import 'core-js/modules/es.string.replace.js';
28
+ import 'core-js/modules/es.string.starts-with.js';
19
29
  import '../global/memoize.js';
30
+ import 'core-js/modules/es.array.iterator.js';
31
+ import 'core-js/modules/es.map.js';
32
+ import 'core-js/modules/es.weak-map.js';
33
+ import 'core-js/modules/web.dom-collections.iterator.js';
20
34
  import '../button/button.js';
21
35
  import '../link/clickableLink.js';
22
36
  import '../global/controls-height.js';
23
37
  import '../_helpers/button__classes.js';
38
+ import 'core-js/modules/es.regexp.to-string.js';
39
+ import 'core-js/modules/web.dom-collections.for-each.js';
24
40
  import 'react-dom';
25
41
  import '../global/get-uid.js';
26
42
  import '../global/schedule-raf.js';
27
43
  import '../global/dom.js';
44
+ import 'core-js/modules/es.object.assign.js';
45
+ import 'core-js/modules/es.set.js';
46
+ import 'core-js/modules/es.string.split.js';
28
47
  import '../shortcuts/shortcuts.js';
29
48
  import '../shortcuts/core.js';
49
+ import 'core-js/modules/es.array.find-index.js';
50
+ import 'core-js/modules/es.array.includes.js';
51
+ import 'core-js/modules/es.array.slice.js';
52
+ import 'core-js/modules/es.array.splice.js';
53
+ import 'core-js/modules/es.string.includes.js';
54
+ import 'core-js/modules/es.string.match.js';
30
55
  import 'combokeys';
31
56
  import '../global/sniffer.js';
32
57
  import 'sniffr';
@@ -38,11 +63,10 @@ import '../_helpers/header.js';
38
63
  import '../link/link.js';
39
64
  import '../_helpers/link.js';
40
65
 
41
- const makeAnchor = loading => {
42
- const Anchor = _ref => {
43
- let {
44
- active
45
- } = _ref;
66
+ var _excluded = ["clientId", "loading", "services", "initShown", "theme"];
67
+ var makeAnchor = function makeAnchor(loading) {
68
+ var Anchor = function Anchor(_ref) {
69
+ var active = _ref.active;
46
70
  return /*#__PURE__*/React.createElement(TrayIcon, {
47
71
  loader: loading,
48
72
  active: active,
@@ -55,75 +79,94 @@ const makeAnchor = loading => {
55
79
  };
56
80
  return Anchor;
57
81
  };
58
- class Services extends PureComponent {
59
- static sort = (a, b) => {
60
- const aApplicationName = a.applicationName || '';
61
- const bApplicationName = b.applicationName || '';
62
- return aApplicationName.localeCompare(bApplicationName) || a.name.localeCompare(b.name);
63
- };
64
- static propTypes = {
65
- className: PropTypes.string,
66
- clientId: PropTypes.string,
67
- initShown: PropTypes.bool,
68
- loading: PropTypes.bool,
69
- onClick: PropTypes.func,
70
- services: PropTypes.arrayOf(ServicesLink.propTypes.service)
71
- };
72
- static defaultProps = {
73
- theme: Theme.DARK
74
- };
75
- static Link = ServicesLink;
76
- serviceIsActive = service => service.id === this.props.clientId;
77
- render() {
78
- const {
79
- clientId,
80
- loading,
81
- services,
82
- initShown,
83
- theme,
84
- ...props
85
- } = this.props;
86
- if (!services) {
87
- return /*#__PURE__*/React.createElement(TrayIcon, _extends({}, props, {
88
- loader: loading,
89
- active: loading,
90
- icon: servicesIcon,
91
- "aria-label": "Services"
92
- }));
82
+ var Services = /*#__PURE__*/function (_PureComponent) {
83
+ function Services() {
84
+ var _this;
85
+ _classCallCheck(this, Services);
86
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
87
+ args[_key] = arguments[_key];
93
88
  }
94
- const sortedServices = [...services].sort(Services.sort);
95
- const servicesWithIcons = sortedServices.filter(service => service.iconUrl && service.homeUrl);
96
- const servicesWithOutIcons = sortedServices.filter(service => !service.iconUrl && service.homeUrl);
97
- const separatorIsRequired = servicesWithIcons.length !== 0 && servicesWithOutIcons.length !== 0;
98
- return /*#__PURE__*/React.createElement(Dropdown, _extends({}, props, {
99
- anchor: makeAnchor(loading),
100
- initShown: initShown
101
- }), /*#__PURE__*/React.createElement(Popup, {
102
- className: classNames(modules_74a7bf8b.services, {
103
- [modules_59717246.dark]: theme === Theme.DARK
104
- }),
105
- top: -3
106
- }, servicesWithIcons.map(service => {
107
- const isActive = this.serviceIsActive(service);
108
- return /*#__PURE__*/React.createElement(Services.Link, {
109
- active: isActive,
110
- className: isActive ? modules_74a7bf8b.activeItem : modules_74a7bf8b.item,
111
- key: service.id,
112
- service: service
89
+ _this = _callSuper(this, Services, [].concat(args));
90
+ _defineProperty(_this, "serviceIsActive", function (service) {
91
+ return service.id === _this.props.clientId;
92
+ });
93
+ return _this;
94
+ }
95
+ _inherits(Services, _PureComponent);
96
+ return _createClass(Services, [{
97
+ key: "render",
98
+ value: function render() {
99
+ var _this2 = this;
100
+ var _this$props = this.props;
101
+ _this$props.clientId;
102
+ var loading = _this$props.loading,
103
+ services = _this$props.services,
104
+ initShown = _this$props.initShown,
105
+ theme = _this$props.theme,
106
+ props = _objectWithoutProperties(_this$props, _excluded);
107
+ if (!services) {
108
+ return /*#__PURE__*/React.createElement(TrayIcon, _extends({}, props, {
109
+ loader: loading,
110
+ active: loading,
111
+ icon: servicesIcon,
112
+ "aria-label": "Services"
113
+ }));
114
+ }
115
+ var sortedServices = _toConsumableArray(services).sort(Services.sort);
116
+ var servicesWithIcons = sortedServices.filter(function (service) {
117
+ return service.iconUrl && service.homeUrl;
113
118
  });
114
- }), separatorIsRequired && /*#__PURE__*/React.createElement("div", {
115
- className: modules_74a7bf8b.line,
116
- key: "separator"
117
- }), servicesWithOutIcons.map(service => {
118
- const isActive = this.serviceIsActive(service);
119
- return /*#__PURE__*/React.createElement(Services.Link, {
120
- active: isActive,
121
- className: isActive ? modules_74a7bf8b.activeItemStacked : modules_74a7bf8b.itemStacked,
122
- key: service.id,
123
- service: service
119
+ var servicesWithOutIcons = sortedServices.filter(function (service) {
120
+ return !service.iconUrl && service.homeUrl;
124
121
  });
125
- })));
126
- }
127
- }
122
+ var separatorIsRequired = servicesWithIcons.length !== 0 && servicesWithOutIcons.length !== 0;
123
+ return /*#__PURE__*/React.createElement(Dropdown, _extends({}, props, {
124
+ anchor: makeAnchor(loading),
125
+ initShown: initShown
126
+ }), /*#__PURE__*/React.createElement(Popup, {
127
+ className: classNames(modules_74a7bf8b.services, {
128
+ [modules_59717246.dark]: theme === Theme.DARK
129
+ }),
130
+ top: -3
131
+ }, servicesWithIcons.map(function (service) {
132
+ var isActive = _this2.serviceIsActive(service);
133
+ return /*#__PURE__*/React.createElement(Services.Link, {
134
+ active: isActive,
135
+ className: isActive ? modules_74a7bf8b.activeItem : modules_74a7bf8b.item,
136
+ key: service.id,
137
+ service: service
138
+ });
139
+ }), separatorIsRequired && /*#__PURE__*/React.createElement("div", {
140
+ className: modules_74a7bf8b.line,
141
+ key: "separator"
142
+ }), servicesWithOutIcons.map(function (service) {
143
+ var isActive = _this2.serviceIsActive(service);
144
+ return /*#__PURE__*/React.createElement(Services.Link, {
145
+ active: isActive,
146
+ className: isActive ? modules_74a7bf8b.activeItemStacked : modules_74a7bf8b.itemStacked,
147
+ key: service.id,
148
+ service: service
149
+ });
150
+ })));
151
+ }
152
+ }]);
153
+ }(PureComponent);
154
+ _defineProperty(Services, "sort", function (a, b) {
155
+ var aApplicationName = a.applicationName || '';
156
+ var bApplicationName = b.applicationName || '';
157
+ return aApplicationName.localeCompare(bApplicationName) || a.name.localeCompare(b.name);
158
+ });
159
+ _defineProperty(Services, "propTypes", {
160
+ className: PropTypes.string,
161
+ clientId: PropTypes.string,
162
+ initShown: PropTypes.bool,
163
+ loading: PropTypes.bool,
164
+ onClick: PropTypes.func,
165
+ services: PropTypes.arrayOf(ServicesLink.propTypes.service)
166
+ });
167
+ _defineProperty(Services, "defaultProps", {
168
+ theme: Theme.DARK
169
+ });
170
+ _defineProperty(Services, "Link", ServicesLink);
128
171
 
129
172
  export { Services as default };