@jetbrains/ring-ui 5.1.26 → 5.1.28

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.
@@ -35,10 +35,14 @@ export interface ProfileProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onSe
35
35
  showApplyChangedUser?: boolean | null | undefined;
36
36
  onRevertPostponement?: (() => void) | null | undefined;
37
37
  menuProps?: PopupMenuAttrs | null | undefined;
38
+ activeClassName?: string | null | undefined;
39
+ onShow?: (() => void);
40
+ onHide?: (() => void);
38
41
  }
39
42
  export default class Profile extends PureComponent<ProfileProps> {
40
43
  static propTypes: {
41
44
  className: PropTypes.Requireable<string>;
45
+ activeClassName: PropTypes.Requireable<string>;
42
46
  closeOnSelect: PropTypes.Requireable<boolean>;
43
47
  hasUpdates: PropTypes.Requireable<boolean>;
44
48
  loading: PropTypes.Requireable<boolean>;
@@ -70,6 +74,8 @@ export default class Profile extends PureComponent<ProfileProps> {
70
74
  onRevertPostponement: PropTypes.Requireable<(...args: any[]) => any>;
71
75
  renderGuest: PropTypes.Requireable<(...args: any[]) => any>;
72
76
  menuProps: PropTypes.Requireable<object>;
77
+ onShow: PropTypes.Requireable<(...args: any[]) => any>;
78
+ onHide: PropTypes.Requireable<(...args: any[]) => any>;
73
79
  };
74
80
  static defaultProps: ProfileProps;
75
81
  static contextType: React.Context<import("../i18n/i18n-context").I18nContextProps>;
@@ -12,6 +12,7 @@ const rgItemType = PopupMenu.ListProps.Type.LINK;
12
12
  export default class Profile extends PureComponent {
13
13
  static propTypes = {
14
14
  className: PropTypes.string,
15
+ activeClassName: PropTypes.string,
15
16
  closeOnSelect: PropTypes.bool,
16
17
  hasUpdates: PropTypes.bool,
17
18
  loading: PropTypes.bool,
@@ -46,7 +47,9 @@ export default class Profile extends PureComponent {
46
47
  showApplyChangedUser: PropTypes.bool,
47
48
  onRevertPostponement: PropTypes.func,
48
49
  renderGuest: PropTypes.func,
49
- menuProps: PropTypes.object
50
+ menuProps: PropTypes.object,
51
+ onShow: PropTypes.func,
52
+ onHide: PropTypes.func
50
53
  };
51
54
  static defaultProps = {
52
55
  closeOnSelect: true,
@@ -63,7 +66,7 @@ export default class Profile extends PureComponent {
63
66
  static contextType = I18nContext;
64
67
  static Size = Size;
65
68
  render() {
66
- const { className, closeOnSelect, hasUpdates, onLogout, user, profileUrl, LinkComponent, onSwitchUser, renderPopupItems, onRevertPostponement, showApplyChangedUser, showName, showLogIn, showLogOut, showSwitchUser, renderGuest, translations, size, round, loading, onLogin, menuProps, ...props } = this.props;
69
+ const { 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, ...props } = this.props;
67
70
  const { translate } = this.context;
68
71
  if (!user) {
69
72
  return (<div {...props} className={classNames(styles.profileEmpty, className)}>
@@ -114,7 +117,7 @@ export default class Profile extends PureComponent {
114
117
  onClick: onLogout
115
118
  }
116
119
  ].filter(isTruthy);
117
- return (<DropdownMenu {...props} title={user.name} anchor={anchor} data={renderPopupItems(items)} data-test="ring-profile" className={classNames(styles.profile, className)} menuProps={{
120
+ return (<DropdownMenu {...props} onShow={onShow} onHide={onHide} title={user.name} anchor={anchor} data={renderPopupItems(items)} data-test="ring-profile" className={classNames(styles.profile, className)} activeClassName={activeClassName} menuProps={{
118
121
  closeOnSelect,
119
122
  left: -2,
120
123
  top: -8,
@@ -35,10 +35,14 @@ export interface ProfileProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onSe
35
35
  showApplyChangedUser?: boolean | null | undefined;
36
36
  onRevertPostponement?: (() => void) | null | undefined;
37
37
  menuProps?: PopupMenuAttrs | null | undefined;
38
+ activeClassName?: string | null | undefined;
39
+ onShow?: (() => void);
40
+ onHide?: (() => void);
38
41
  }
39
42
  export default class Profile extends PureComponent<ProfileProps> {
40
43
  static propTypes: {
41
44
  className: PropTypes.Requireable<string>;
45
+ activeClassName: PropTypes.Requireable<string>;
42
46
  closeOnSelect: PropTypes.Requireable<boolean>;
43
47
  hasUpdates: PropTypes.Requireable<boolean>;
44
48
  loading: PropTypes.Requireable<boolean>;
@@ -70,6 +74,8 @@ export default class Profile extends PureComponent<ProfileProps> {
70
74
  onRevertPostponement: PropTypes.Requireable<(...args: any[]) => any>;
71
75
  renderGuest: PropTypes.Requireable<(...args: any[]) => any>;
72
76
  menuProps: PropTypes.Requireable<object>;
77
+ onShow: PropTypes.Requireable<(...args: any[]) => any>;
78
+ onHide: PropTypes.Requireable<(...args: any[]) => any>;
73
79
  };
74
80
  static defaultProps: ProfileProps;
75
81
  static contextType: React.Context<import("../i18n/i18n-context").I18nContextProps>;
@@ -94,7 +94,7 @@ import '../popup/popup.consts.js';
94
94
  import '../popup/popup.target.js';
95
95
  import '../i18n/i18n.js';
96
96
 
97
- var _excluded = ["className", "closeOnSelect", "hasUpdates", "onLogout", "user", "profileUrl", "LinkComponent", "onSwitchUser", "renderPopupItems", "onRevertPostponement", "showApplyChangedUser", "showName", "showLogIn", "showLogOut", "showSwitchUser", "renderGuest", "translations", "size", "round", "loading", "onLogin", "menuProps"];
97
+ 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"];
98
98
  var rgItemType = PopupMenu.ListProps.Type.LINK;
99
99
  var Profile = /*#__PURE__*/function (_PureComponent) {
100
100
  _inherits(Profile, _PureComponent);
@@ -109,6 +109,7 @@ var Profile = /*#__PURE__*/function (_PureComponent) {
109
109
  var _translations$applyCh, _translations$login, _translations$profile, _translations$switchU, _translations$logout;
110
110
  var _this$props = this.props,
111
111
  className = _this$props.className,
112
+ activeClassName = _this$props.activeClassName,
112
113
  closeOnSelect = _this$props.closeOnSelect,
113
114
  hasUpdates = _this$props.hasUpdates,
114
115
  onLogout = _this$props.onLogout,
@@ -130,6 +131,8 @@ var Profile = /*#__PURE__*/function (_PureComponent) {
130
131
  _this$props.loading;
131
132
  _this$props.onLogin;
132
133
  var menuProps = _this$props.menuProps,
134
+ onShow = _this$props.onShow,
135
+ onHide = _this$props.onHide,
133
136
  props = _objectWithoutProperties(_this$props, _excluded);
134
137
  var translate = this.context.translate;
135
138
  if (!user) {
@@ -184,11 +187,14 @@ var Profile = /*#__PURE__*/function (_PureComponent) {
184
187
  onClick: onLogout
185
188
  }].filter(isTruthy);
186
189
  return /*#__PURE__*/React.createElement(DropdownMenu, _extends({}, props, {
190
+ onShow: onShow,
191
+ onHide: onHide,
187
192
  title: user.name,
188
193
  anchor: anchor,
189
194
  data: renderPopupItems(items),
190
195
  "data-test": "ring-profile",
191
196
  className: classNames(modules_47759f5e.profile, className),
197
+ activeClassName: activeClassName,
192
198
  menuProps: _objectSpread2({
193
199
  closeOnSelect,
194
200
  left: -2,
@@ -202,6 +208,7 @@ var Profile = /*#__PURE__*/function (_PureComponent) {
202
208
  }(PureComponent);
203
209
  _defineProperty(Profile, "propTypes", {
204
210
  className: PropTypes.string,
211
+ activeClassName: PropTypes.string,
205
212
  closeOnSelect: PropTypes.bool,
206
213
  hasUpdates: PropTypes.bool,
207
214
  loading: PropTypes.bool,
@@ -232,7 +239,9 @@ _defineProperty(Profile, "propTypes", {
232
239
  showApplyChangedUser: PropTypes.bool,
233
240
  onRevertPostponement: PropTypes.func,
234
241
  renderGuest: PropTypes.func,
235
- menuProps: PropTypes.object
242
+ menuProps: PropTypes.object,
243
+ onShow: PropTypes.func,
244
+ onHide: PropTypes.func
236
245
  });
237
246
  _defineProperty(Profile, "defaultProps", {
238
247
  closeOnSelect: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetbrains/ring-ui",
3
- "version": "5.1.26",
3
+ "version": "5.1.28",
4
4
  "description": "JetBrains UI library",
5
5
  "author": "JetBrains",
6
6
  "license": "Apache-2.0",