@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.
- package/components/_helpers/_rollupPluginBabelHelpers.js +567 -1
- package/components/_helpers/anchor.js +6 -7
- package/components/_helpers/button__classes.js +14 -16
- package/components/_helpers/caption.js +20 -14
- package/components/_helpers/card.js +105 -95
- package/components/_helpers/dialog__body-scroll-preventer.js +19 -11
- package/components/_helpers/icon__svg.js +25 -22
- package/components/_helpers/input.js +177 -146
- package/components/_helpers/query-assist__suggestions.js +90 -74
- package/components/_helpers/select__filter.js +69 -48
- package/components/_helpers/services-link.js +37 -29
- package/components/_helpers/sidebar.js +107 -99
- package/components/_helpers/tab-link.js +7 -7
- package/components/_helpers/theme.js +40 -31
- package/components/_helpers/title.js +72 -57
- package/components/alert/alert.js +202 -150
- package/components/alert/container.js +41 -32
- package/components/alert-service/alert-service.js +170 -105
- package/components/analytics/analytics.js +22 -12
- package/components/analytics/analytics__custom-plugin.js +75 -54
- package/components/auth/auth.js +36 -4
- package/components/auth/auth__core.js +1471 -746
- package/components/auth/background-flow.js +127 -87
- package/components/auth/down-notification.js +73 -30
- package/components/auth/iframe-flow.js +133 -75
- package/components/auth/request-builder.js +82 -46
- package/components/auth/response-parser.js +116 -86
- package/components/auth/storage.js +334 -171
- package/components/auth/token-validator.js +242 -137
- package/components/auth/window-flow.js +134 -92
- package/components/auth-dialog/auth-dialog.js +172 -114
- package/components/auth-dialog-service/auth-dialog-service.js +31 -8
- package/components/avatar/avatar-example-datauri.js +1 -23
- package/components/avatar/avatar.js +152 -119
- package/components/avatar/fallback-avatar.js +38 -22
- package/components/badge/badge.js +45 -35
- package/components/button/button.js +107 -86
- package/components/button-group/button-group.js +33 -19
- package/components/button-set/button-set.js +32 -20
- package/components/button-toolbar/button-toolbar.js +31 -19
- package/components/caret/caret.js +220 -186
- package/components/checkbox/checkbox.js +101 -76
- package/components/clipboard/clipboard-fallback.js +10 -10
- package/components/clipboard/clipboard.js +132 -35
- package/components/code/code.js +166 -92
- package/components/collapse/collapse-content.js +64 -42
- package/components/collapse/collapse-context.js +2 -2
- package/components/collapse/collapse-control.js +14 -12
- package/components/collapse/collapse.js +17 -11
- package/components/collapse/consts.js +4 -4
- package/components/collapse/utils.js +3 -1
- package/components/confirm/confirm.js +104 -66
- package/components/confirm-service/confirm-service.js +59 -37
- package/components/content-layout/content-layout.js +64 -43
- package/components/content-layout/sidebar.js +1 -0
- package/components/contenteditable/contenteditable.js +59 -50
- package/components/control-label/control-label.js +9 -9
- package/components/data-list/data-list.js +182 -129
- package/components/data-list/data-list.mock.js +6 -2
- package/components/data-list/item.js +170 -143
- package/components/data-list/selection.js +136 -76
- package/components/data-list/title.js +12 -1
- package/components/date-picker/consts.js +26 -19
- package/components/date-picker/date-input.js +144 -113
- package/components/date-picker/date-picker.js +282 -227
- package/components/date-picker/date-popup.js +395 -350
- package/components/date-picker/day.js +116 -87
- package/components/date-picker/month-names.js +66 -43
- package/components/date-picker/month-slider.js +76 -51
- package/components/date-picker/month.js +25 -16
- package/components/date-picker/months.js +50 -43
- package/components/date-picker/weekdays.js +22 -12
- package/components/date-picker/years.js +110 -83
- package/components/dialog/dialog.js +190 -142
- package/components/dialog/dialog__body-scroll-preventer.js +4 -0
- package/components/dropdown/anchor.js +9 -0
- package/components/dropdown/dropdown.js +213 -182
- package/components/dropdown-menu/dropdown-menu.js +97 -71
- package/components/editable-heading/editable-heading.js +127 -75
- package/components/error-bubble/error-bubble.js +60 -31
- package/components/error-message/error-message.js +59 -39
- package/components/footer/footer.js +30 -27
- package/components/global/compose.js +10 -1
- package/components/global/composeRefs.js +12 -7
- package/components/global/controls-height.js +2 -2
- package/components/global/create-stateful-context.js +15 -15
- package/components/global/data-tests.js +14 -6
- package/components/global/dom.js +86 -47
- package/components/global/focus-sensor-hoc.js +132 -122
- package/components/global/fuzzy-highlight.js +36 -22
- package/components/global/get-event-key.js +8 -8
- package/components/global/get-uid.js +8 -4
- package/components/global/inject-styles.js +15 -10
- package/components/global/listeners.js +51 -27
- package/components/global/memoize.js +12 -6
- package/components/global/normalize-indent.js +50 -19
- package/components/global/promise-with-timeout.js +8 -6
- package/components/global/prop-types.js +5 -3
- package/components/global/react-dom-renderer.js +44 -28
- package/components/global/react-render-adapter.js +1 -1
- package/components/global/rerender-hoc.js +30 -12
- package/components/global/schedule-raf.js +6 -5
- package/components/global/sniffer.js +1 -1
- package/components/global/theme.js +22 -0
- package/components/global/trivial-template-tag.js +10 -3
- package/components/global/typescript-utils.js +6 -2
- package/components/global/url.js +26 -20
- package/components/global/use-event-callback.js +4 -6
- package/components/grid/col.js +52 -35
- package/components/grid/grid.js +31 -17
- package/components/grid/row.js +47 -35
- package/components/group/group.js +25 -17
- package/components/header/header.js +78 -33
- package/components/header/logo.js +36 -20
- package/components/header/profile.js +199 -166
- package/components/header/services-link.js +4 -0
- package/components/header/services.js +116 -73
- package/components/header/smart-profile.js +203 -111
- package/components/header/smart-services.js +113 -62
- package/components/header/tray-icon.js +37 -21
- package/components/header/tray.js +32 -21
- package/components/heading/heading.js +25 -24
- package/components/http/http.js +353 -203
- package/components/http/http.mock.js +101 -49
- package/components/hub-source/hub-source.js +190 -83
- package/components/hub-source/hub-source__user.js +44 -11
- package/components/hub-source/hub-source__users-groups.js +65 -37
- package/components/i18n/i18n-context.js +10 -7
- package/components/i18n/i18n.js +10 -7
- package/components/icon/icon.js +93 -76
- package/components/icon/icon__svg.js +8 -0
- package/components/icon/index.js +8 -0
- package/components/input/input.js +13 -0
- package/components/island/adaptive-island-hoc.js +43 -30
- package/components/island/content.js +132 -115
- package/components/island/header.js +70 -57
- package/components/island/island.js +40 -28
- package/components/island-legacy/content-legacy.js +25 -17
- package/components/island-legacy/header-legacy.js +27 -19
- package/components/island-legacy/island-legacy.js +25 -17
- package/components/link/clickableLink.js +59 -44
- package/components/link/link.js +68 -57
- package/components/list/consts.js +2 -2
- package/components/list/list.js +698 -611
- package/components/list/list__custom.js +62 -44
- package/components/list/list__hint.js +19 -10
- package/components/list/list__item.js +174 -133
- package/components/list/list__link.js +50 -37
- package/components/list/list__separator.js +24 -14
- package/components/list/list__title.js +32 -22
- package/components/list/list__users-groups-source.js +126 -54
- package/components/loader/loader.js +74 -43
- package/components/loader/loader__core.js +263 -198
- package/components/loader-inline/loader-inline.js +35 -23
- package/components/loader-screen/loader-screen.js +46 -25
- package/components/login-dialog/login-dialog.js +158 -111
- package/components/login-dialog/service.js +34 -8
- package/components/markdown/markdown.js +23 -15
- package/components/message/message.js +203 -161
- package/components/old-browsers-message/old-browsers-message.js +18 -11
- package/components/old-browsers-message/old-browsers-message__stop.js +7 -0
- package/components/old-browsers-message/white-list.js +16 -8
- package/components/pager/pager.js +271 -212
- package/components/panel/panel.js +25 -17
- package/components/permissions/permissions.js +172 -127
- package/components/permissions/permissions__cache.js +224 -194
- package/components/popup/popup.consts.js +1 -1
- package/components/popup/popup.js +343 -284
- package/components/popup/popup.target.js +8 -9
- package/components/popup/position.js +106 -96
- package/components/popup-menu/popup-menu.js +81 -44
- package/components/progress-bar/progress-bar.js +104 -87
- package/components/query-assist/query-assist.js +916 -838
- package/components/query-assist/query-assist__suggestions.js +30 -1
- package/components/radio/radio.js +34 -19
- package/components/radio/radio__item.js +69 -52
- package/components/select/select.js +957 -852
- package/components/select/select__filter.js +30 -0
- package/components/select/select__popup.js +487 -373
- package/components/shortcuts/core.js +217 -166
- package/components/shortcuts/shortcut-title.js +11 -6
- package/components/shortcuts/shortcuts-hoc.js +45 -19
- package/components/shortcuts/shortcuts.js +75 -50
- package/components/slider/slider.js +122 -99
- package/components/slider/slider.utils.js +24 -14
- package/components/storage/storage.js +33 -4
- package/components/storage/storage__fallback.js +224 -149
- package/components/storage/storage__local.js +153 -90
- package/components/tab-trap/tab-trap.js +153 -122
- package/components/table/cell.js +26 -14
- package/components/table/disable-hover-hoc.js +51 -33
- package/components/table/header-cell.js +89 -64
- package/components/table/header.js +132 -104
- package/components/table/multitable.js +125 -107
- package/components/table/row-with-focus-sensor.js +69 -25
- package/components/table/row.js +216 -175
- package/components/table/selection-adapter.js +3 -1
- package/components/table/selection-shortcuts-hoc.js +181 -180
- package/components/table/selection.js +226 -156
- package/components/table/smart-table.js +88 -50
- package/components/table/table.js +358 -289
- package/components/tabs/collapsible-more.js +79 -46
- package/components/tabs/collapsible-tab.js +38 -31
- package/components/tabs/collapsible-tabs.js +153 -88
- package/components/tabs/custom-item.js +2 -4
- package/components/tabs/dumb-tabs.js +117 -74
- package/components/tabs/smart-tabs.js +69 -29
- package/components/tabs/tab-link.js +5 -1
- package/components/tabs/tab.js +31 -19
- package/components/tabs/tabs.js +31 -0
- package/components/tag/tag.js +173 -133
- package/components/tags-input/tags-input.js +427 -329
- package/components/tags-list/tags-list.js +78 -57
- package/components/text/text.js +39 -28
- package/components/toggle/toggle.js +70 -56
- package/components/tooltip/tooltip.js +190 -146
- package/components/user-agreement/service.js +371 -228
- package/components/user-agreement/toolbox.eula.js +1 -160
- package/components/user-agreement/user-agreement.js +120 -85
- package/components/user-card/card.js +29 -0
- package/components/user-card/smart-user-card-tooltip.js +111 -51
- package/components/user-card/tooltip.js +84 -47
- package/components/user-card/user-card.js +29 -0
- package/package.json +1 -1
@@ -1,5 +1,7 @@
|
|
1
|
-
import { _ as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
-
import
|
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
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
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(
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
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
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
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
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
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
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
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
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
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
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
return
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
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
|
-
|
115
|
-
|
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 };
|