@jetbrains/ring-ui 5.1.27 → 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.
@@ -36,6 +36,8 @@ export interface ProfileProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onSe
36
36
  onRevertPostponement?: (() => void) | null | undefined;
37
37
  menuProps?: PopupMenuAttrs | null | undefined;
38
38
  activeClassName?: string | null | undefined;
39
+ onShow?: (() => void);
40
+ onHide?: (() => void);
39
41
  }
40
42
  export default class Profile extends PureComponent<ProfileProps> {
41
43
  static propTypes: {
@@ -72,6 +74,8 @@ export default class Profile extends PureComponent<ProfileProps> {
72
74
  onRevertPostponement: PropTypes.Requireable<(...args: any[]) => any>;
73
75
  renderGuest: PropTypes.Requireable<(...args: any[]) => any>;
74
76
  menuProps: PropTypes.Requireable<object>;
77
+ onShow: PropTypes.Requireable<(...args: any[]) => any>;
78
+ onHide: PropTypes.Requireable<(...args: any[]) => any>;
75
79
  };
76
80
  static defaultProps: ProfileProps;
77
81
  static contextType: React.Context<import("../i18n/i18n-context").I18nContextProps>;
@@ -47,7 +47,9 @@ export default class Profile extends PureComponent {
47
47
  showApplyChangedUser: PropTypes.bool,
48
48
  onRevertPostponement: PropTypes.func,
49
49
  renderGuest: PropTypes.func,
50
- menuProps: PropTypes.object
50
+ menuProps: PropTypes.object,
51
+ onShow: PropTypes.func,
52
+ onHide: PropTypes.func
51
53
  };
52
54
  static defaultProps = {
53
55
  closeOnSelect: true,
@@ -64,7 +66,7 @@ export default class Profile extends PureComponent {
64
66
  static contextType = I18nContext;
65
67
  static Size = Size;
66
68
  render() {
67
- const { className, activeClassName, 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;
68
70
  const { translate } = this.context;
69
71
  if (!user) {
70
72
  return (<div {...props} className={classNames(styles.profileEmpty, className)}>
@@ -115,7 +117,7 @@ export default class Profile extends PureComponent {
115
117
  onClick: onLogout
116
118
  }
117
119
  ].filter(isTruthy);
118
- return (<DropdownMenu {...props} title={user.name} anchor={anchor} data={renderPopupItems(items)} data-test="ring-profile" className={classNames(styles.profile, className)} activeClassName={activeClassName} 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={{
119
121
  closeOnSelect,
120
122
  left: -2,
121
123
  top: -8,
@@ -36,6 +36,8 @@ export interface ProfileProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onSe
36
36
  onRevertPostponement?: (() => void) | null | undefined;
37
37
  menuProps?: PopupMenuAttrs | null | undefined;
38
38
  activeClassName?: string | null | undefined;
39
+ onShow?: (() => void);
40
+ onHide?: (() => void);
39
41
  }
40
42
  export default class Profile extends PureComponent<ProfileProps> {
41
43
  static propTypes: {
@@ -72,6 +74,8 @@ export default class Profile extends PureComponent<ProfileProps> {
72
74
  onRevertPostponement: PropTypes.Requireable<(...args: any[]) => any>;
73
75
  renderGuest: PropTypes.Requireable<(...args: any[]) => any>;
74
76
  menuProps: PropTypes.Requireable<object>;
77
+ onShow: PropTypes.Requireable<(...args: any[]) => any>;
78
+ onHide: PropTypes.Requireable<(...args: any[]) => any>;
75
79
  };
76
80
  static defaultProps: ProfileProps;
77
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", "activeClassName", "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);
@@ -131,6 +131,8 @@ var Profile = /*#__PURE__*/function (_PureComponent) {
131
131
  _this$props.loading;
132
132
  _this$props.onLogin;
133
133
  var menuProps = _this$props.menuProps,
134
+ onShow = _this$props.onShow,
135
+ onHide = _this$props.onHide,
134
136
  props = _objectWithoutProperties(_this$props, _excluded);
135
137
  var translate = this.context.translate;
136
138
  if (!user) {
@@ -185,6 +187,8 @@ var Profile = /*#__PURE__*/function (_PureComponent) {
185
187
  onClick: onLogout
186
188
  }].filter(isTruthy);
187
189
  return /*#__PURE__*/React.createElement(DropdownMenu, _extends({}, props, {
190
+ onShow: onShow,
191
+ onHide: onHide,
188
192
  title: user.name,
189
193
  anchor: anchor,
190
194
  data: renderPopupItems(items),
@@ -235,7 +239,9 @@ _defineProperty(Profile, "propTypes", {
235
239
  showApplyChangedUser: PropTypes.bool,
236
240
  onRevertPostponement: PropTypes.func,
237
241
  renderGuest: PropTypes.func,
238
- menuProps: PropTypes.object
242
+ menuProps: PropTypes.object,
243
+ onShow: PropTypes.func,
244
+ onHide: PropTypes.func
239
245
  });
240
246
  _defineProperty(Profile, "defaultProps", {
241
247
  closeOnSelect: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetbrains/ring-ui",
3
- "version": "5.1.27",
3
+ "version": "5.1.28",
4
4
  "description": "JetBrains UI library",
5
5
  "author": "JetBrains",
6
6
  "license": "Apache-2.0",