@jetbrains/ring-ui 5.0.30 → 5.0.31

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.
@@ -40,7 +40,7 @@ export interface QueryAssistProps {
40
40
  onClear: () => void;
41
41
  onFocusChange: (change: FocusChange) => void;
42
42
  translations: QueryAssistTranslations;
43
- autoOpen?: boolean | null | undefined;
43
+ autoOpen?: boolean | null | undefined | 'force';
44
44
  caret?: number | null | undefined;
45
45
  clear?: boolean | null | undefined;
46
46
  className?: string | null | undefined;
@@ -128,7 +128,7 @@ export default class QueryAssist extends Component<QueryAssistProps> {
128
128
  /**
129
129
  * Open suggestions popup during the initial render
130
130
  */
131
- autoOpen: PropTypes.Requireable<boolean>;
131
+ autoOpen: PropTypes.Requireable<string | boolean>;
132
132
  /**
133
133
  * Initial caret position
134
134
  */
@@ -70,7 +70,7 @@ export default class QueryAssist extends Component {
70
70
  /**
71
71
  * Open suggestions popup during the initial render
72
72
  */
73
- autoOpen: PropTypes.bool,
73
+ autoOpen: PropTypes.oneOf([true, false, 'force']),
74
74
  /**
75
75
  * Initial caret position
76
76
  */
@@ -201,7 +201,7 @@ export default class QueryAssist extends Component {
201
201
  focus: Boolean(this.props.autoOpen || this.props.focus)
202
202
  };
203
203
  this.setupRequestHandler(this.props.delay);
204
- if (this.props.autoOpen && query.length > 0) {
204
+ if (this.props.autoOpen === 'force' || this.props.autoOpen && query.length > 0) {
205
205
  this.requestHandler().
206
206
  catch(noop);
207
207
  }
@@ -238,7 +238,7 @@ export default class QueryAssist extends Component {
238
238
  }
239
239
  if (typeof query === 'string' && queryChanged && query !== this.immediateState.query) {
240
240
  this.immediateState.query = query;
241
- if (query && prevProps.autoOpen && query.length > 0) {
241
+ if (query && (this.props.autoOpen === 'force' || prevProps.autoOpen && query.length > 0)) {
242
242
  this.requestData?.();
243
243
  }
244
244
  else if (query) {
@@ -354,7 +354,7 @@ export default class QueryAssist extends Component {
354
354
  }
355
355
  this.immediateState = props;
356
356
  this.props.onChange(props);
357
- if (props.query.length > 0) {
357
+ if (this.props.autoOpen === 'force' || props.query.length > 0) {
358
358
  this.requestData?.();
359
359
  }
360
360
  };
@@ -427,11 +427,11 @@ export default class QueryAssist extends Component {
427
427
  if (!this.props.disabled && (caret !== this.immediateState.caret || popupHidden)) {
428
428
  this.immediateState.caret = caret;
429
429
  this.scrollInput();
430
- if (this.immediateState.query.length > 0) {
430
+ if (this.props.autoOpen === 'force' || this.immediateState.query.length > 0) {
431
431
  this.requestData?.();
432
432
  }
433
433
  }
434
- if (this.immediateState.query.length < 1) {
434
+ if (this.props.autoOpen !== 'force' && this.immediateState.query.length < 1) {
435
435
  this.setState({ showPopup: false });
436
436
  }
437
437
  };
@@ -450,7 +450,7 @@ export default class QueryAssist extends Component {
450
450
  placeholderEnabled: !query,
451
451
  query,
452
452
  suggestions,
453
- showPopup: !!suggestions.length && !afterCompletion
453
+ showPopup: !!suggestions.length && (this.props.autoOpen === 'force' || !afterCompletion)
454
454
  };
455
455
  this.immediateState.suggestionsQuery = query;
456
456
  // Do not update deep equal styleRanges to simplify shouldComponentUpdate check
@@ -40,7 +40,7 @@ export interface QueryAssistProps {
40
40
  onClear: () => void;
41
41
  onFocusChange: (change: FocusChange) => void;
42
42
  translations: QueryAssistTranslations;
43
- autoOpen?: boolean | null | undefined;
43
+ autoOpen?: boolean | null | undefined | 'force';
44
44
  caret?: number | null | undefined;
45
45
  clear?: boolean | null | undefined;
46
46
  className?: string | null | undefined;
@@ -128,7 +128,7 @@ export default class QueryAssist extends Component<QueryAssistProps> {
128
128
  /**
129
129
  * Open suggestions popup during the initial render
130
130
  */
131
- autoOpen: PropTypes.Requireable<boolean>;
131
+ autoOpen: PropTypes.Requireable<string | boolean>;
132
132
  /**
133
133
  * Initial caret position
134
134
  */
@@ -263,7 +263,7 @@ class QueryAssist extends Component {
263
263
  this.immediateState = props;
264
264
  this.props.onChange(props);
265
265
 
266
- if (props.query.length > 0) {
266
+ if (this.props.autoOpen === 'force' || props.query.length > 0) {
267
267
  var _this$requestData;
268
268
 
269
269
  (_this$requestData = this.requestData) === null || _this$requestData === void 0 ? void 0 : _this$requestData.call(this);
@@ -349,14 +349,14 @@ class QueryAssist extends Component {
349
349
  this.immediateState.caret = caret;
350
350
  this.scrollInput();
351
351
 
352
- if (this.immediateState.query.length > 0) {
352
+ if (this.props.autoOpen === 'force' || this.immediateState.query.length > 0) {
353
353
  var _this$requestData2;
354
354
 
355
355
  (_this$requestData2 = this.requestData) === null || _this$requestData2 === void 0 ? void 0 : _this$requestData2.call(this);
356
356
  }
357
357
  }
358
358
 
359
- if (this.immediateState.query.length < 1) {
359
+ if (this.props.autoOpen !== 'force' && this.immediateState.query.length < 1) {
360
360
  this.setState({
361
361
  showPopup: false
362
362
  });
@@ -394,7 +394,7 @@ class QueryAssist extends Component {
394
394
  placeholderEnabled: !query,
395
395
  query,
396
396
  suggestions,
397
- showPopup: !!suggestions.length && !afterCompletion
397
+ showPopup: !!suggestions.length && (_this.props.autoOpen === 'force' || !afterCompletion)
398
398
  };
399
399
  _this.immediateState.suggestionsQuery = query; // Do not update deep equal styleRanges to simplify shouldComponentUpdate check
400
400
 
@@ -633,7 +633,7 @@ class QueryAssist extends Component {
633
633
  };
634
634
  this.setupRequestHandler(this.props.delay);
635
635
 
636
- if (this.props.autoOpen && query.length > 0) {
636
+ if (this.props.autoOpen === 'force' || this.props.autoOpen && query.length > 0) {
637
637
  this.requestHandler().catch(noop);
638
638
  } else {
639
639
  this.requestStyleRanges().catch(noop);
@@ -666,7 +666,7 @@ class QueryAssist extends Component {
666
666
  if (typeof query === 'string' && queryChanged && query !== this.immediateState.query) {
667
667
  this.immediateState.query = query;
668
668
 
669
- if (query && prevProps.autoOpen && query.length > 0) {
669
+ if (query && (this.props.autoOpen === 'force' || prevProps.autoOpen && query.length > 0)) {
670
670
  var _this$requestData5;
671
671
 
672
672
  (_this$requestData5 = this.requestData) === null || _this$requestData5 === void 0 ? void 0 : _this$requestData5.call(this);
@@ -1033,7 +1033,7 @@ _defineProperty(QueryAssist, "propTypes", {
1033
1033
  /**
1034
1034
  * Open suggestions popup during the initial render
1035
1035
  */
1036
- autoOpen: PropTypes.bool,
1036
+ autoOpen: PropTypes.oneOf([true, false, 'force']),
1037
1037
 
1038
1038
  /**
1039
1039
  * Initial caret position
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetbrains/ring-ui",
3
- "version": "5.0.30",
3
+ "version": "5.0.31",
4
4
  "description": "JetBrains UI library",
5
5
  "author": "JetBrains",
6
6
  "license": "Apache-2.0",
@@ -103,12 +103,12 @@
103
103
  "@types/chai-dom": "0.0.10",
104
104
  "@types/chai-enzyme": "^0.6.8",
105
105
  "@types/enzyme": "^3.10.12",
106
- "@types/react": "^18.0.20",
106
+ "@types/react": "^18.0.21",
107
107
  "@types/react-dom": "^18.0.6",
108
108
  "@types/sinon": "^10.0.13",
109
109
  "@types/sinon-chai": "^3.2.8",
110
- "@typescript-eslint/eslint-plugin": "^5.38.0",
111
- "@typescript-eslint/parser": "^5.38.0",
110
+ "@typescript-eslint/eslint-plugin": "^5.38.1",
111
+ "@typescript-eslint/parser": "^5.38.1",
112
112
  "@wojtekmaj/enzyme-adapter-react-17": "^0.6.7",
113
113
  "angular": "^1.8.3",
114
114
  "angular-mocks": "^1.8.3",
@@ -120,10 +120,10 @@
120
120
  "chai-dom": "^1.10.0",
121
121
  "chai-enzyme": "1.0.0-beta.1",
122
122
  "cheerio": "^0.22.0",
123
- "core-js": "^3.25.2",
123
+ "core-js": "^3.25.3",
124
124
  "cpy-cli": "^3.1.1",
125
125
  "enzyme": "^3.11.0",
126
- "eslint": "^8.23.1",
126
+ "eslint": "^8.24.0",
127
127
  "eslint-import-resolver-webpack": "^0.13.2",
128
128
  "eslint-plugin-angular": "^4.1.0",
129
129
  "eslint-plugin-bdd": "^2.1.1",
@@ -150,20 +150,20 @@
150
150
  "merge-options": "^3.0.4",
151
151
  "mocha": "^10.0.0",
152
152
  "pinst": "^3.0.0",
153
- "puppeteer": "^18.0.4",
153
+ "puppeteer": "^18.0.5",
154
154
  "raw-loader": "^4.0.2",
155
155
  "react": "^18.2.0",
156
156
  "react-dom": "^18.2.0",
157
157
  "react-test-renderer": "^18.2.0",
158
158
  "regenerator-runtime": "^0.13.9",
159
159
  "rimraf": "^3.0.2",
160
- "rollup": "^2.79.0",
160
+ "rollup": "^2.79.1",
161
161
  "rollup-plugin-clear": "^2.0.7",
162
162
  "rollup-plugin-styles": "^4.0.0",
163
163
  "sinon": "^14.0.0",
164
164
  "sinon-chai": "^3.7.0",
165
165
  "storage-mock": "^2.1.0",
166
- "stylelint": "^14.12.0",
166
+ "stylelint": "^14.12.1",
167
167
  "svg-inline-loader": "^0.8.2",
168
168
  "teamcity-service-messages": "^0.1.14",
169
169
  "terser-webpack-plugin": "^5.3.6",
@@ -228,7 +228,7 @@
228
228
  "focus-trap": "^7.0.0",
229
229
  "focus-visible": "^5.2.0",
230
230
  "highlight.js": "^10.7.2",
231
- "html-loader": "^4.1.0",
231
+ "html-loader": "^4.2.0",
232
232
  "interpolate-loader": "^2.0.1",
233
233
  "just-debounce-it": "^3.1.1",
234
234
  "memoize-one": "^6.0.0",
@@ -249,7 +249,7 @@
249
249
  "scrollbar-width": "^3.1.1",
250
250
  "simply-uuid": "^1.0.1",
251
251
  "sniffr": "^1.2.0",
252
- "storybook-zeplin": "^1.7.2",
252
+ "storybook-zeplin": "^1.7.3",
253
253
  "style-inject": "^0.3.0",
254
254
  "style-loader": "~3.3.1",
255
255
  "url-loader": "^4.1.1",
@@ -259,5 +259,5 @@
259
259
  "node": ">=14.0",
260
260
  "npm": ">=6.0.0"
261
261
  },
262
- "gitHead": "1b39cd18bd5b798cc6988b64e78ec27b5ce54086"
262
+ "gitHead": "e8e24573cc2391bd814538c2b8a43684df802e5d"
263
263
  }