@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.
- package/components/_helpers/_rollupPluginBabelHelpers.js +7 -629
- package/components/_helpers/anchor.js +7 -6
- package/components/_helpers/button__classes.js +16 -14
- package/components/_helpers/caption.js +14 -20
- package/components/_helpers/card.js +95 -105
- package/components/_helpers/dialog__body-scroll-preventer.js +11 -19
- package/components/_helpers/icon__svg.js +22 -25
- package/components/_helpers/input.js +146 -177
- package/components/_helpers/query-assist__suggestions.js +74 -90
- package/components/_helpers/select__filter.js +48 -69
- package/components/_helpers/services-link.js +29 -37
- package/components/_helpers/sidebar.js +99 -107
- package/components/_helpers/tab-link.js +7 -7
- package/components/_helpers/theme.js +31 -40
- package/components/_helpers/title.js +57 -72
- package/components/alert/alert.js +150 -202
- package/components/alert/container.js +32 -41
- package/components/alert-service/alert-service.js +105 -170
- package/components/analytics/analytics.js +12 -22
- package/components/analytics/analytics__custom-plugin.js +54 -75
- package/components/auth/auth.js +4 -36
- package/components/auth/auth__core.js +746 -1471
- package/components/auth/background-flow.js +87 -127
- package/components/auth/down-notification.js +30 -73
- package/components/auth/iframe-flow.js +75 -133
- package/components/auth/request-builder.js +46 -82
- package/components/auth/response-parser.js +86 -116
- package/components/auth/storage.js +171 -334
- package/components/auth/token-validator.js +137 -242
- package/components/auth/window-flow.js +92 -134
- package/components/auth-dialog/auth-dialog.js +114 -172
- package/components/auth-dialog-service/auth-dialog-service.js +8 -31
- package/components/avatar/avatar-example-datauri.js +23 -1
- package/components/avatar/avatar.js +119 -152
- package/components/avatar/fallback-avatar.js +22 -38
- package/components/badge/badge.js +35 -45
- package/components/button/button.js +86 -107
- package/components/button-group/button-group.js +19 -33
- package/components/button-set/button-set.js +20 -32
- package/components/button-toolbar/button-toolbar.js +19 -31
- package/components/caret/caret.js +186 -220
- package/components/checkbox/checkbox.js +76 -101
- package/components/clipboard/clipboard-fallback.js +10 -10
- package/components/clipboard/clipboard.js +35 -132
- package/components/code/code.js +92 -166
- package/components/collapse/collapse-content.js +42 -64
- package/components/collapse/collapse-context.js +2 -2
- package/components/collapse/collapse-control.js +12 -14
- package/components/collapse/collapse.js +11 -17
- package/components/collapse/consts.js +4 -4
- package/components/collapse/utils.js +1 -3
- package/components/confirm/confirm.js +66 -104
- package/components/confirm-service/confirm-service.js +37 -59
- package/components/content-layout/content-layout.js +43 -64
- package/components/content-layout/sidebar.js +0 -1
- package/components/contenteditable/contenteditable.js +50 -59
- package/components/control-label/control-label.js +9 -9
- package/components/data-list/data-list.js +129 -182
- package/components/data-list/data-list.mock.js +2 -6
- package/components/data-list/item.js +143 -170
- package/components/data-list/selection.js +76 -136
- package/components/data-list/title.js +1 -12
- package/components/date-picker/consts.js +19 -26
- package/components/date-picker/date-input.js +113 -144
- package/components/date-picker/date-picker.js +227 -282
- package/components/date-picker/date-popup.js +350 -395
- package/components/date-picker/day.js +87 -116
- package/components/date-picker/month-names.js +43 -66
- package/components/date-picker/month-slider.js +51 -76
- package/components/date-picker/month.js +16 -25
- package/components/date-picker/months.js +43 -50
- package/components/date-picker/weekdays.js +12 -22
- package/components/date-picker/years.js +83 -110
- package/components/dialog/dialog.js +142 -190
- package/components/dialog/dialog__body-scroll-preventer.js +0 -4
- package/components/dropdown/anchor.js +0 -9
- package/components/dropdown/dropdown.js +182 -213
- package/components/dropdown-menu/dropdown-menu.js +71 -97
- package/components/editable-heading/editable-heading.js +75 -127
- package/components/error-bubble/error-bubble.js +31 -60
- package/components/error-message/error-message.js +39 -59
- package/components/footer/footer.js +27 -30
- package/components/global/compose.js +1 -10
- package/components/global/composeRefs.js +7 -12
- package/components/global/controls-height.js +2 -2
- package/components/global/create-stateful-context.js +15 -15
- package/components/global/data-tests.js +6 -14
- package/components/global/dom.js +47 -86
- package/components/global/focus-sensor-hoc.js +122 -132
- package/components/global/fuzzy-highlight.js +22 -36
- package/components/global/get-event-key.js +8 -8
- package/components/global/get-uid.js +4 -8
- package/components/global/inject-styles.js +10 -15
- package/components/global/listeners.js +27 -51
- package/components/global/memoize.js +6 -12
- package/components/global/normalize-indent.js +19 -50
- package/components/global/promise-with-timeout.js +6 -8
- package/components/global/prop-types.js +3 -5
- package/components/global/react-dom-renderer.js +28 -44
- package/components/global/react-render-adapter.js +1 -1
- package/components/global/rerender-hoc.js +12 -30
- package/components/global/schedule-raf.js +5 -6
- package/components/global/sniffer.js +1 -1
- package/components/global/theme.js +0 -22
- package/components/global/trivial-template-tag.js +3 -10
- package/components/global/typescript-utils.js +2 -6
- package/components/global/url.js +20 -26
- package/components/global/use-event-callback.js +6 -4
- package/components/grid/col.js +35 -52
- package/components/grid/grid.js +17 -31
- package/components/grid/row.js +35 -47
- package/components/group/group.js +17 -25
- package/components/header/header.js +33 -78
- package/components/header/logo.js +20 -36
- package/components/header/profile.js +166 -199
- package/components/header/services-link.js +0 -4
- package/components/header/services.js +73 -116
- package/components/header/smart-profile.js +111 -203
- package/components/header/smart-services.js +62 -113
- package/components/header/tray-icon.js +21 -37
- package/components/header/tray.js +21 -32
- package/components/heading/heading.js +24 -25
- package/components/http/http.d.ts +1 -3
- package/components/http/http.js +203 -353
- package/components/http/http.mock.js +49 -101
- package/components/hub-source/hub-source.js +83 -190
- package/components/hub-source/hub-source__user.js +11 -44
- package/components/hub-source/hub-source__users-groups.js +37 -65
- package/components/i18n/i18n-context.js +7 -10
- package/components/i18n/i18n.js +7 -10
- package/components/icon/icon.js +76 -93
- package/components/icon/icon__svg.js +0 -8
- package/components/icon/index.js +0 -8
- package/components/input/input.js +0 -13
- package/components/island/adaptive-island-hoc.js +30 -43
- package/components/island/content.js +115 -132
- package/components/island/header.js +57 -70
- package/components/island/island.js +28 -40
- package/components/island-legacy/content-legacy.js +17 -25
- package/components/island-legacy/header-legacy.js +19 -27
- package/components/island-legacy/island-legacy.js +17 -25
- package/components/link/clickableLink.js +44 -59
- package/components/link/link.js +57 -68
- package/components/list/consts.js +2 -2
- package/components/list/list.js +611 -698
- package/components/list/list__custom.js +44 -62
- package/components/list/list__hint.js +10 -19
- package/components/list/list__item.js +133 -174
- package/components/list/list__link.js +37 -50
- package/components/list/list__separator.js +14 -24
- package/components/list/list__title.js +22 -32
- package/components/list/list__users-groups-source.js +54 -126
- package/components/loader/loader.js +43 -74
- package/components/loader/loader__core.js +198 -263
- package/components/loader-inline/loader-inline.js +23 -35
- package/components/loader-screen/loader-screen.js +25 -46
- package/components/login-dialog/login-dialog.js +111 -158
- package/components/login-dialog/service.js +8 -34
- package/components/markdown/markdown.js +15 -23
- package/components/message/message.js +161 -203
- package/components/old-browsers-message/old-browsers-message.js +11 -18
- package/components/old-browsers-message/old-browsers-message__stop.js +0 -7
- package/components/old-browsers-message/white-list.js +8 -16
- package/components/pager/pager.js +212 -271
- package/components/panel/panel.js +17 -25
- package/components/permissions/permissions.js +127 -172
- package/components/permissions/permissions__cache.js +194 -224
- package/components/popup/popup.consts.js +1 -1
- package/components/popup/popup.js +284 -343
- package/components/popup/popup.target.js +9 -8
- package/components/popup/position.js +96 -106
- package/components/popup-menu/popup-menu.js +44 -80
- package/components/progress-bar/progress-bar.js +87 -104
- package/components/query-assist/query-assist.js +838 -916
- package/components/query-assist/query-assist__suggestions.js +1 -30
- package/components/radio/radio.js +19 -34
- package/components/radio/radio__item.js +52 -69
- package/components/select/select.js +852 -957
- package/components/select/select__filter.js +0 -30
- package/components/select/select__popup.js +373 -487
- package/components/shortcuts/core.js +166 -217
- package/components/shortcuts/shortcut-title.js +6 -11
- package/components/shortcuts/shortcuts-hoc.js +19 -45
- package/components/shortcuts/shortcuts.js +50 -75
- package/components/slider/slider.js +99 -122
- package/components/slider/slider.utils.js +14 -24
- package/components/storage/storage.js +4 -33
- package/components/storage/storage__fallback.js +149 -224
- package/components/storage/storage__local.js +90 -153
- package/components/style.css +1 -1
- package/components/tab-trap/tab-trap.js +122 -153
- package/components/table/cell.js +14 -26
- package/components/table/disable-hover-hoc.js +33 -51
- package/components/table/header-cell.js +64 -89
- package/components/table/header.js +104 -132
- package/components/table/multitable.js +107 -125
- package/components/table/row-with-focus-sensor.js +25 -69
- package/components/table/row.js +175 -216
- package/components/table/selection-adapter.js +1 -3
- package/components/table/selection-shortcuts-hoc.js +180 -181
- package/components/table/selection.js +156 -226
- package/components/table/smart-table.js +50 -88
- package/components/table/table.js +289 -358
- package/components/tabs/collapsible-more.js +46 -79
- package/components/tabs/collapsible-tab.js +31 -38
- package/components/tabs/collapsible-tabs.js +88 -153
- package/components/tabs/custom-item.js +4 -2
- package/components/tabs/dumb-tabs.js +74 -117
- package/components/tabs/smart-tabs.js +29 -69
- package/components/tabs/tab-link.js +1 -5
- package/components/tabs/tab.js +19 -31
- package/components/tabs/tabs.js +0 -31
- package/components/tag/tag.js +133 -173
- package/components/tags-input/tags-input.js +329 -427
- package/components/tags-list/tags-list.js +57 -78
- package/components/text/text.js +28 -39
- package/components/toggle/toggle.js +56 -70
- package/components/tooltip/tooltip.js +146 -190
- package/components/user-agreement/service.js +228 -371
- package/components/user-agreement/toolbox.eula.js +160 -1
- package/components/user-agreement/user-agreement.js +85 -120
- package/components/user-card/card.js +0 -29
- package/components/user-card/smart-user-card-tooltip.js +51 -111
- package/components/user-card/tooltip.js +47 -84
- package/components/user-card/user-card.js +0 -29
- package/package.json +1 -1
@@ -1,49 +1,33 @@
|
|
1
|
-
import { _ as _defineProperty, a as _inherits, b as _createClass, c as _objectWithoutProperties, f as _classCallCheck, g as _callSuper } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
1
|
import React, { PureComponent } from 'react';
|
3
2
|
import PropTypes from 'prop-types';
|
4
3
|
import classNames from 'classnames';
|
5
4
|
import Icon from '../icon/icon.js';
|
6
5
|
import { m as modules_47759f5e } from '../_helpers/header.js';
|
7
6
|
import { Size } from '../icon/icon__constants.js';
|
7
|
+
import '../_helpers/_rollupPluginBabelHelpers.js';
|
8
8
|
import 'util-deprecate';
|
9
9
|
import '../_helpers/icon__svg.js';
|
10
|
-
import 'core-js/modules/es.regexp.exec.js';
|
11
|
-
import 'core-js/modules/es.string.replace.js';
|
12
|
-
import 'core-js/modules/es.string.starts-with.js';
|
13
10
|
import '../global/memoize.js';
|
14
|
-
import 'core-js/modules/es.array.iterator.js';
|
15
|
-
import 'core-js/modules/es.map.js';
|
16
|
-
import 'core-js/modules/es.object.to-string.js';
|
17
|
-
import 'core-js/modules/es.weak-map.js';
|
18
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
19
11
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
12
|
+
class Logo extends PureComponent {
|
13
|
+
static propTypes = {
|
14
|
+
className: PropTypes.string
|
15
|
+
};
|
16
|
+
static defaultProps = {
|
17
|
+
size: Size.Size48,
|
18
|
+
suppressSizeWarning: true
|
19
|
+
};
|
20
|
+
static Size = Size;
|
21
|
+
render() {
|
22
|
+
const {
|
23
|
+
className,
|
24
|
+
...restProps
|
25
|
+
} = this.props;
|
26
|
+
const classes = classNames(modules_47759f5e.logo, className);
|
27
|
+
return /*#__PURE__*/React.createElement("div", {
|
28
|
+
className: classes
|
29
|
+
}, /*#__PURE__*/React.createElement(Icon, restProps));
|
25
30
|
}
|
26
|
-
|
27
|
-
return _createClass(Logo, [{
|
28
|
-
key: "render",
|
29
|
-
value: function render() {
|
30
|
-
var _this$props = this.props,
|
31
|
-
className = _this$props.className,
|
32
|
-
restProps = _objectWithoutProperties(_this$props, _excluded);
|
33
|
-
var classes = classNames(modules_47759f5e.logo, className);
|
34
|
-
return /*#__PURE__*/React.createElement("div", {
|
35
|
-
className: classes
|
36
|
-
}, /*#__PURE__*/React.createElement(Icon, restProps));
|
37
|
-
}
|
38
|
-
}]);
|
39
|
-
}(PureComponent);
|
40
|
-
_defineProperty(Logo, "propTypes", {
|
41
|
-
className: PropTypes.string
|
42
|
-
});
|
43
|
-
_defineProperty(Logo, "defaultProps", {
|
44
|
-
size: Size.Size48,
|
45
|
-
suppressSizeWarning: true
|
46
|
-
});
|
47
|
-
_defineProperty(Logo, "Size", Size);
|
31
|
+
}
|
48
32
|
|
49
33
|
export { Logo as default };
|
@@ -1,7 +1,5 @@
|
|
1
|
-
import { _ as
|
2
|
-
import '
|
3
|
-
import 'core-js/modules/es.object.to-string.js';
|
4
|
-
import React, { Component, PureComponent } from 'react';
|
1
|
+
import { _ as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
+
import React, { PureComponent, Component } from 'react';
|
5
3
|
import PropTypes from 'prop-types';
|
6
4
|
import classNames from 'classnames';
|
7
5
|
import Avatar, { Size } from '../avatar/avatar.js';
|
@@ -11,56 +9,29 @@ import PopupMenu from '../popup-menu/popup-menu.js';
|
|
11
9
|
import { I18nContext } from '../i18n/i18n-context.js';
|
12
10
|
import { isTruthy } from '../global/typescript-utils.js';
|
13
11
|
import { m as modules_47759f5e } from '../_helpers/header.js';
|
14
|
-
import 'core-js/modules/es.array.concat.js';
|
15
12
|
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';
|
20
13
|
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';
|
28
14
|
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';
|
32
15
|
import '../global/get-uid.js';
|
33
|
-
import 'core-js/modules/es.regexp.to-string.js';
|
34
16
|
import '@jetbrains/icons/chevron-10px';
|
35
17
|
import '../icon/icon.js';
|
36
18
|
import 'util-deprecate';
|
37
19
|
import '../icon/icon__constants.js';
|
38
20
|
import '../_helpers/icon__svg.js';
|
39
|
-
import 'core-js/modules/es.string.starts-with.js';
|
40
21
|
import '../global/memoize.js';
|
41
|
-
import 'core-js/modules/es.map.js';
|
42
|
-
import 'core-js/modules/es.weak-map.js';
|
43
22
|
import '../link/clickableLink.js';
|
44
23
|
import '../global/controls-height.js';
|
45
24
|
import '../_helpers/button__classes.js';
|
46
25
|
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';
|
53
26
|
import 'react-virtualized/dist/es/List';
|
54
27
|
import 'react-virtualized/dist/es/AutoSizer';
|
55
28
|
import 'react-virtualized/dist/es/WindowScroller';
|
56
29
|
import 'react-virtualized/dist/es/CellMeasurer';
|
57
30
|
import 'memoize-one';
|
58
31
|
import '../global/data-tests.js';
|
59
|
-
import 'core-js/modules/es.array.reduce.js';
|
60
32
|
import '../global/schedule-raf.js';
|
61
33
|
import '../shortcuts/shortcuts.js';
|
62
34
|
import '../shortcuts/core.js';
|
63
|
-
import 'core-js/modules/es.array.splice.js';
|
64
35
|
import 'combokeys';
|
65
36
|
import '../global/sniffer.js';
|
66
37
|
import 'sniffr';
|
@@ -87,185 +58,181 @@ import '../popup/popup.js';
|
|
87
58
|
import 'react-dom';
|
88
59
|
import '../tab-trap/tab-trap.js';
|
89
60
|
import '../popup/position.js';
|
90
|
-
import 'core-js/modules/es.array.sort.js';
|
91
61
|
import '../popup/popup.consts.js';
|
92
62
|
import '../popup/popup.target.js';
|
93
63
|
import '../i18n/i18n.js';
|
94
64
|
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
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", {
|
137
121
|
className: classNames(modules_47759f5e.profileEmpty, className)
|
138
|
-
}
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
}
|
146
|
-
var avatarWrapper = classNames(modules_47759f5e.avatarWrapper, {
|
147
|
-
[modules_47759f5e.hasUpdates]: hasUpdates
|
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')));
|
148
129
|
});
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
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, {
|
156
171
|
size: size,
|
157
172
|
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)
|
201
173
|
}));
|
202
174
|
}
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
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')));
|
175
|
+
if (user.guest) {
|
176
|
+
return renderGuest(this.props);
|
177
|
+
}
|
178
|
+
const avatarWrapper = classNames(modules_47759f5e.avatarWrapper, {
|
179
|
+
[modules_47759f5e.hasUpdates]: hasUpdates
|
265
180
|
});
|
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
|
+
}));
|
266
235
|
}
|
267
|
-
}
|
268
|
-
_defineProperty(Profile, "contextType", I18nContext);
|
269
|
-
_defineProperty(Profile, "Size", Size);
|
236
|
+
}
|
270
237
|
|
271
238
|
export { Profile as default };
|
@@ -5,9 +5,5 @@ 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';
|
12
8
|
import '../link/clickableLink.js';
|
13
9
|
import '../_helpers/link.js';
|