@jetbrains/ring-ui 5.0.108 → 5.0.110

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.
@@ -15,7 +15,7 @@ export declare const LOGOUT_POSTPONED_EVENT = "logoutPostponed";
15
15
  export declare const USER_CHANGE_POSTPONED_EVENT = "changePostponed";
16
16
  export interface AuthUser {
17
17
  guest?: boolean;
18
- id: number | string;
18
+ id: string;
19
19
  name: string;
20
20
  login: string;
21
21
  banned?: boolean;
@@ -5,7 +5,7 @@ export interface HubSourceUsersGroupsOptions {
5
5
  searchSideThreshold: number;
6
6
  }
7
7
  export interface UserGroup extends Item {
8
- id: number;
8
+ id: string;
9
9
  total?: number;
10
10
  userCount: number;
11
11
  iconUrl?: string;
@@ -46,6 +46,9 @@ const nonActivatableTypes = [
46
46
  function isActivatable(item) {
47
47
  return item != null && !nonActivatableTypes.includes(item.rgItemType) && !item.disabled;
48
48
  }
49
+ function getDataHash(data) {
50
+ return data.map(it => it.key).join('-');
51
+ }
49
52
  const shouldActivateFirstItem = (props) => props.activateFirstItem ||
50
53
  props.activateSingleItem && props.data.length === 1;
51
54
  export const ActiveItemContext = createStatefulContext(undefined, 'ActiveItem');
@@ -158,7 +161,7 @@ export default class List extends Component {
158
161
  this.virtualizedList.recomputeRowHeights();
159
162
  }
160
163
  if (this.props.activeIndex == null &&
161
- this.props.data !== prevProps.data &&
164
+ getDataHash(this.props.data) !== getDataHash(prevProps.data) &&
162
165
  shouldActivateFirstItem(this.props)) {
163
166
  this.activateFirst();
164
167
  }
@@ -295,7 +295,7 @@ Popup.propTypes = {
295
295
  autoCorrectTopOverflow: PropTypes.bool,
296
296
  left: PropTypes.number,
297
297
  top: PropTypes.number,
298
- maxHeight: PropTypes.number,
298
+ maxHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
299
299
  minWidth: PropTypes.number,
300
300
  sidePadding: PropTypes.number,
301
301
  attached: PropTypes.bool,
@@ -15,7 +15,7 @@ export declare const LOGOUT_POSTPONED_EVENT = "logoutPostponed";
15
15
  export declare const USER_CHANGE_POSTPONED_EVENT = "changePostponed";
16
16
  export interface AuthUser {
17
17
  guest?: boolean;
18
- id: number | string;
18
+ id: string;
19
19
  name: string;
20
20
  login: string;
21
21
  banned?: boolean;
@@ -5,7 +5,7 @@ export interface HubSourceUsersGroupsOptions {
5
5
  searchSideThreshold: number;
6
6
  }
7
7
  export interface UserGroup extends Item {
8
- id: number;
8
+ id: string;
9
9
  total?: number;
10
10
  userCount: number;
11
11
  iconUrl?: string;
package/dist/list/list.js CHANGED
@@ -63,6 +63,9 @@ const nonActivatableTypes = [Type.SEPARATOR, Type.TITLE, Type.MARGIN];
63
63
  function isActivatable(item) {
64
64
  return item != null && !nonActivatableTypes.includes(item.rgItemType) && !item.disabled;
65
65
  }
66
+ function getDataHash(data) {
67
+ return data.map(it => it.key).join('-');
68
+ }
66
69
  const shouldActivateFirstItem = props => props.activateFirstItem || props.activateSingleItem && props.data.length === 1;
67
70
  const ActiveItemContext = createStatefulContext(undefined, 'ActiveItem');
68
71
  /**
@@ -468,7 +471,7 @@ class List extends Component {
468
471
  if (this.virtualizedList && prevProps.data !== this.props.data) {
469
472
  this.virtualizedList.recomputeRowHeights();
470
473
  }
471
- if (this.props.activeIndex == null && this.props.data !== prevProps.data && shouldActivateFirstItem(this.props)) {
474
+ if (this.props.activeIndex == null && getDataHash(this.props.data) !== getDataHash(prevProps.data) && shouldActivateFirstItem(this.props)) {
472
475
  this.activateFirst();
473
476
  }
474
477
  this.checkOverflow();
@@ -338,7 +338,7 @@ Popup.propTypes = {
338
338
  autoCorrectTopOverflow: PropTypes.bool,
339
339
  left: PropTypes.number,
340
340
  top: PropTypes.number,
341
- maxHeight: PropTypes.number,
341
+ maxHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
342
342
  minWidth: PropTypes.number,
343
343
  sidePadding: PropTypes.number,
344
344
  attached: PropTypes.bool,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetbrains/ring-ui",
3
- "version": "5.0.108",
3
+ "version": "5.0.110",
4
4
  "description": "JetBrains UI library",
5
5
  "author": "JetBrains",
6
6
  "license": "Apache-2.0",
@@ -158,14 +158,14 @@
158
158
  "react-test-renderer": "^18.2.0",
159
159
  "regenerator-runtime": "^0.13.11",
160
160
  "rimraf": "^4.1.2",
161
- "rollup": "^3.14.0",
161
+ "rollup": "^3.15.0",
162
162
  "rollup-plugin-clear": "^2.0.7",
163
163
  "rollup-plugin-styles": "^4.0.0",
164
164
  "sinon": "^15.0.1",
165
165
  "sinon-chai": "^3.7.0",
166
166
  "storage-mock": "^2.1.0",
167
167
  "storybook-addon-themes": "^6.1.0",
168
- "stylelint": "^14.16.1",
168
+ "stylelint": "^15.0.0",
169
169
  "svg-inline-loader": "^0.8.2",
170
170
  "teamcity-service-messages": "^0.1.14",
171
171
  "terser-webpack-plugin": "^5.3.6",