@jetbrains/ring-ui 5.1.6 → 5.1.8
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.
|
@@ -239,11 +239,12 @@ export default class QueryAssist extends Component {
|
|
|
239
239
|
this.setupRequestHandler(delay);
|
|
240
240
|
const shouldSetCaret = typeof caret === 'number' && caret !== prevProps.caret;
|
|
241
241
|
if (shouldSetCaret) {
|
|
242
|
+
this.immediateState.prevCaret = prevProps.caret;
|
|
242
243
|
this.immediateState.caret = caret;
|
|
243
244
|
}
|
|
244
245
|
if (typeof query === 'string' && queryChanged && query !== this.immediateState.query) {
|
|
245
246
|
this.immediateState.query = query;
|
|
246
|
-
if (prevProps.autoOpen && query
|
|
247
|
+
if (query && (this.props.autoOpen === 'force' || prevProps.autoOpen && query.length > 0)) {
|
|
247
248
|
this.requestData?.();
|
|
248
249
|
}
|
|
249
250
|
else if (query) {
|
|
@@ -447,13 +448,14 @@ export default class QueryAssist extends Component {
|
|
|
447
448
|
: currentCaret?.position ?? 0;
|
|
448
449
|
const popupHidden = (!this.state.showPopup) && e.type === 'click';
|
|
449
450
|
if (!this.props.disabled && (caret !== this.immediateState.caret || popupHidden)) {
|
|
451
|
+
this.immediateState.prevCaret = this.immediateState.caret;
|
|
450
452
|
this.immediateState.caret = caret;
|
|
451
453
|
this.scrollInput();
|
|
452
454
|
if (this.immediateState.query.length > 0) {
|
|
453
455
|
this.requestData?.();
|
|
454
456
|
}
|
|
455
457
|
}
|
|
456
|
-
if (this.immediateState.query.length < 1) {
|
|
458
|
+
if (this.props.autoOpen !== 'force' && this.immediateState.query.length < 1) {
|
|
457
459
|
this.setState({ showPopup: false });
|
|
458
460
|
}
|
|
459
461
|
};
|
|
@@ -472,7 +474,7 @@ export default class QueryAssist extends Component {
|
|
|
472
474
|
placeholderEnabled: !query,
|
|
473
475
|
query,
|
|
474
476
|
suggestions,
|
|
475
|
-
showPopup: !!suggestions.length && !afterCompletion
|
|
477
|
+
showPopup: !!suggestions.length && (this.props.autoOpen === 'force' || !afterCompletion)
|
|
476
478
|
};
|
|
477
479
|
this.immediateState.suggestionsQuery = query;
|
|
478
480
|
// Do not update deep equal styleRanges to simplify shouldComponentUpdate check
|
|
@@ -506,6 +508,7 @@ export default class QueryAssist extends Component {
|
|
|
506
508
|
const prefix = suggestion.prefix || '';
|
|
507
509
|
const suffix = suggestion.suffix || '';
|
|
508
510
|
const state = {
|
|
511
|
+
prevCaret: currentCaret,
|
|
509
512
|
caret: suggestion.caret ?? 0,
|
|
510
513
|
selection: suggestion.caret ?? 0,
|
|
511
514
|
query: query.substr(0, suggestion.completionStart) + prefix + suggestion.option + suffix
|
|
@@ -342,6 +342,7 @@ var QueryAssist = /*#__PURE__*/function (_Component) {
|
|
|
342
342
|
var caret = typeof currentCaret === 'number' ? currentCaret : (_currentCaret$positio2 = currentCaret === null || currentCaret === void 0 ? void 0 : currentCaret.position) !== null && _currentCaret$positio2 !== void 0 ? _currentCaret$positio2 : 0;
|
|
343
343
|
var popupHidden = !_this.state.showPopup && e.type === 'click';
|
|
344
344
|
if (!_this.props.disabled && (caret !== _this.immediateState.caret || popupHidden)) {
|
|
345
|
+
_this.immediateState.prevCaret = _this.immediateState.caret;
|
|
345
346
|
_this.immediateState.caret = caret;
|
|
346
347
|
_this.scrollInput();
|
|
347
348
|
if (_this.immediateState.query.length > 0) {
|
|
@@ -349,7 +350,7 @@ var QueryAssist = /*#__PURE__*/function (_Component) {
|
|
|
349
350
|
(_this$requestData2 = (_this3 = _this).requestData) === null || _this$requestData2 === void 0 ? void 0 : _this$requestData2.call(_this3);
|
|
350
351
|
}
|
|
351
352
|
}
|
|
352
|
-
if (_this.immediateState.query.length < 1) {
|
|
353
|
+
if (_this.props.autoOpen !== 'force' && _this.immediateState.query.length < 1) {
|
|
353
354
|
_this.setState({
|
|
354
355
|
showPopup: false
|
|
355
356
|
});
|
|
@@ -382,7 +383,7 @@ var QueryAssist = /*#__PURE__*/function (_Component) {
|
|
|
382
383
|
placeholderEnabled: !query,
|
|
383
384
|
query: query,
|
|
384
385
|
suggestions: suggestions,
|
|
385
|
-
showPopup: !!suggestions.length && !afterCompletion
|
|
386
|
+
showPopup: !!suggestions.length && (_this.props.autoOpen === 'force' || !afterCompletion)
|
|
386
387
|
};
|
|
387
388
|
_this.immediateState.suggestionsQuery = query;
|
|
388
389
|
// Do not update deep equal styleRanges to simplify shouldComponentUpdate check
|
|
@@ -421,6 +422,7 @@ var QueryAssist = /*#__PURE__*/function (_Component) {
|
|
|
421
422
|
var prefix = suggestion.prefix || '';
|
|
422
423
|
var suffix = suggestion.suffix || '';
|
|
423
424
|
var state = {
|
|
425
|
+
prevCaret: currentCaret,
|
|
424
426
|
caret: (_suggestion$caret = suggestion.caret) !== null && _suggestion$caret !== void 0 ? _suggestion$caret : 0,
|
|
425
427
|
selection: (_suggestion$caret2 = suggestion.caret) !== null && _suggestion$caret2 !== void 0 ? _suggestion$caret2 : 0,
|
|
426
428
|
query: query.substr(0, suggestion.completionStart) + prefix + suggestion.option + suffix
|
|
@@ -608,11 +610,12 @@ var QueryAssist = /*#__PURE__*/function (_Component) {
|
|
|
608
610
|
this.setupRequestHandler(delay);
|
|
609
611
|
var shouldSetCaret = typeof caret === 'number' && caret !== prevProps.caret;
|
|
610
612
|
if (shouldSetCaret) {
|
|
613
|
+
this.immediateState.prevCaret = prevProps.caret;
|
|
611
614
|
this.immediateState.caret = caret;
|
|
612
615
|
}
|
|
613
616
|
if (typeof query === 'string' && queryChanged && query !== this.immediateState.query) {
|
|
614
617
|
this.immediateState.query = query;
|
|
615
|
-
if (
|
|
618
|
+
if (query && (this.props.autoOpen === 'force' || prevProps.autoOpen && query.length > 0)) {
|
|
616
619
|
var _this$requestData5;
|
|
617
620
|
(_this$requestData5 = this.requestData) === null || _this$requestData5 === void 0 ? void 0 : _this$requestData5.call(this);
|
|
618
621
|
} else if (query) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jetbrains/ring-ui",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.8",
|
|
4
4
|
"description": "JetBrains UI library",
|
|
5
5
|
"author": "JetBrains",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -75,42 +75,42 @@
|
|
|
75
75
|
},
|
|
76
76
|
"readmeFilename": "README.md",
|
|
77
77
|
"devDependencies": {
|
|
78
|
-
"@babel/cli": "^7.
|
|
78
|
+
"@babel/cli": "^7.23.0",
|
|
79
79
|
"@babel/eslint-parser": "^7.22.15",
|
|
80
80
|
"@csstools/stylelint-no-at-nest-rule": "^1.0.0",
|
|
81
81
|
"@jetbrains/eslint-config": "^5.4.1",
|
|
82
82
|
"@jetbrains/stylelint-config": "^4.0.1",
|
|
83
|
-
"@primer/octicons": "^19.
|
|
83
|
+
"@primer/octicons": "^19.8.0",
|
|
84
84
|
"@rollup/plugin-babel": "^6.0.3",
|
|
85
85
|
"@rollup/plugin-json": "^6.0.0",
|
|
86
86
|
"@rollup/plugin-node-resolve": "^15.2.1",
|
|
87
87
|
"@rollup/plugin-replace": "^5.0.2",
|
|
88
|
-
"@storybook/addon-a11y": "7.4.
|
|
89
|
-
"@storybook/addon-docs": "7.4.
|
|
90
|
-
"@storybook/addon-essentials": "7.4.
|
|
91
|
-
"@storybook/addon-storyshots": "7.4.
|
|
92
|
-
"@storybook/addon-storyshots-puppeteer": "7.4.
|
|
93
|
-
"@storybook/addon-storysource": "7.4.
|
|
94
|
-
"@storybook/addons": "7.4.
|
|
95
|
-
"@storybook/html": "7.4.
|
|
96
|
-
"@storybook/html-webpack5": "^7.4.
|
|
97
|
-
"@storybook/preview-api": "7.4.
|
|
98
|
-
"@storybook/react": "7.4.
|
|
99
|
-
"@storybook/source-loader": "7.4.
|
|
100
|
-
"@storybook/theming": "7.4.
|
|
88
|
+
"@storybook/addon-a11y": "7.4.5",
|
|
89
|
+
"@storybook/addon-docs": "7.4.5",
|
|
90
|
+
"@storybook/addon-essentials": "7.4.5",
|
|
91
|
+
"@storybook/addon-storyshots": "7.4.5",
|
|
92
|
+
"@storybook/addon-storyshots-puppeteer": "7.4.5",
|
|
93
|
+
"@storybook/addon-storysource": "7.4.5",
|
|
94
|
+
"@storybook/addons": "7.4.5",
|
|
95
|
+
"@storybook/html": "7.4.5",
|
|
96
|
+
"@storybook/html-webpack5": "^7.4.5",
|
|
97
|
+
"@storybook/preview-api": "7.4.5",
|
|
98
|
+
"@storybook/react": "7.4.5",
|
|
99
|
+
"@storybook/source-loader": "7.4.5",
|
|
100
|
+
"@storybook/theming": "7.4.5",
|
|
101
101
|
"@testing-library/react": "^14.0.0",
|
|
102
102
|
"@testing-library/user-event": "^14.5.1",
|
|
103
103
|
"@types/chai": "^4.3.6",
|
|
104
104
|
"@types/chai-as-promised": "^7.1.6",
|
|
105
105
|
"@types/chai-dom": "0.0.10",
|
|
106
106
|
"@types/chai-enzyme": "^0.6.11",
|
|
107
|
-
"@types/enzyme": "^3.10.
|
|
107
|
+
"@types/enzyme": "^3.10.14",
|
|
108
108
|
"@types/react": "^18.2.21",
|
|
109
|
-
"@types/react-dom": "^18.2.
|
|
110
|
-
"@types/sinon": "^10.0.
|
|
111
|
-
"@types/sinon-chai": "^3.2.
|
|
112
|
-
"@typescript-eslint/eslint-plugin": "^6.7.
|
|
113
|
-
"@typescript-eslint/parser": "^6.7.
|
|
109
|
+
"@types/react-dom": "^18.2.8",
|
|
110
|
+
"@types/sinon": "^10.0.17",
|
|
111
|
+
"@types/sinon-chai": "^3.2.10",
|
|
112
|
+
"@typescript-eslint/eslint-plugin": "^6.7.3",
|
|
113
|
+
"@typescript-eslint/parser": "^6.7.3",
|
|
114
114
|
"@wojtekmaj/enzyme-adapter-react-17": "^0.8.0",
|
|
115
115
|
"acorn": "^8.10.0",
|
|
116
116
|
"angular": "^1.8.3",
|
|
@@ -118,8 +118,8 @@
|
|
|
118
118
|
"angular-route": "^1.8.3",
|
|
119
119
|
"babel-plugin-react-docgen": "^4.2.1",
|
|
120
120
|
"babel-plugin-require-context-hook": "^1.0.0",
|
|
121
|
-
"caniuse-lite": "^1.0.
|
|
122
|
-
"chai": "^4.3.
|
|
121
|
+
"caniuse-lite": "^1.0.30001540",
|
|
122
|
+
"chai": "^4.3.9",
|
|
123
123
|
"chai-as-promised": "^7.1.1",
|
|
124
124
|
"chai-dom": "^1.10.0",
|
|
125
125
|
"chai-enzyme": "1.0.0-beta.1",
|
|
@@ -127,16 +127,16 @@
|
|
|
127
127
|
"core-js": "^3.32.2",
|
|
128
128
|
"cpy-cli": "^3.1.1",
|
|
129
129
|
"enzyme": "^3.11.0",
|
|
130
|
-
"eslint": "^8.
|
|
130
|
+
"eslint": "^8.50.0",
|
|
131
131
|
"eslint-import-resolver-webpack": "^0.13.7",
|
|
132
132
|
"eslint-plugin-angular": "^4.1.0",
|
|
133
133
|
"eslint-plugin-bdd": "^2.1.1",
|
|
134
134
|
"eslint-plugin-import": "^2.28.1",
|
|
135
135
|
"eslint-plugin-jsx-a11y": "^6.7.1",
|
|
136
136
|
"eslint-plugin-react": "^7.33.2",
|
|
137
|
-
"eslint-plugin-storybook": "^0.6.
|
|
137
|
+
"eslint-plugin-storybook": "^0.6.14",
|
|
138
138
|
"events": "^3.3.0",
|
|
139
|
-
"glob": "^10.3.
|
|
139
|
+
"glob": "^10.3.10",
|
|
140
140
|
"html-webpack-plugin": "^5.5.3",
|
|
141
141
|
"husky": "^8.0.3",
|
|
142
142
|
"identity-obj-proxy": "^3.0.0",
|
|
@@ -161,14 +161,14 @@
|
|
|
161
161
|
"react-dom": "^18.2.0",
|
|
162
162
|
"react-test-renderer": "^18.2.0",
|
|
163
163
|
"regenerator-runtime": "^0.14.0",
|
|
164
|
-
"rimraf": "^5.0.
|
|
165
|
-
"rollup": "^3.29.
|
|
164
|
+
"rimraf": "^5.0.5",
|
|
165
|
+
"rollup": "^3.29.3",
|
|
166
166
|
"rollup-plugin-clear": "^2.0.7",
|
|
167
167
|
"rollup-plugin-styles": "^4.0.0",
|
|
168
168
|
"sinon": "^16.0.0",
|
|
169
169
|
"sinon-chai": "^3.7.0",
|
|
170
170
|
"storage-mock": "^2.1.0",
|
|
171
|
-
"storybook": "^7.4.
|
|
171
|
+
"storybook": "^7.4.5",
|
|
172
172
|
"storybook-addon-themes": "^6.1.0",
|
|
173
173
|
"storybook-zeplin": "^2.0.2",
|
|
174
174
|
"stylelint": "^15.10.3",
|
|
@@ -201,23 +201,23 @@
|
|
|
201
201
|
}
|
|
202
202
|
},
|
|
203
203
|
"dependencies": {
|
|
204
|
-
"@babel/core": "^7.
|
|
205
|
-
"@babel/preset-typescript": "^7.
|
|
204
|
+
"@babel/core": "^7.23.0",
|
|
205
|
+
"@babel/preset-typescript": "^7.23.0",
|
|
206
206
|
"@jetbrains/babel-preset-jetbrains": "^2.3.2",
|
|
207
207
|
"@jetbrains/icons": "^3.21.0",
|
|
208
|
-
"@jetbrains/logos": "^2.2.
|
|
208
|
+
"@jetbrains/logos": "^2.2.21",
|
|
209
209
|
"@jetbrains/postcss-require-hover": "^0.1.2",
|
|
210
210
|
"@types/combokeys": "^2.4.7",
|
|
211
|
-
"@types/deep-equal": "^1.0.
|
|
212
|
-
"@types/element-resize-detector": "^1.1.
|
|
213
|
-
"@types/google.analytics": "0.0.
|
|
211
|
+
"@types/deep-equal": "^1.0.2",
|
|
212
|
+
"@types/element-resize-detector": "^1.1.4",
|
|
213
|
+
"@types/google.analytics": "0.0.43",
|
|
214
214
|
"@types/prop-types": "^15.7.5",
|
|
215
|
-
"@types/react-virtualized": "9.21.
|
|
215
|
+
"@types/react-virtualized": "9.21.23",
|
|
216
216
|
"@types/util-deprecate": "^1.0.0",
|
|
217
217
|
"@ungap/url-search-params": "^0.2.2",
|
|
218
218
|
"babel-loader": "9.1.3",
|
|
219
|
-
"babel-plugin-transform-define": "^2.1.
|
|
220
|
-
"browserslist": "^4.
|
|
219
|
+
"babel-plugin-transform-define": "^2.1.4",
|
|
220
|
+
"browserslist": "^4.22.0",
|
|
221
221
|
"change-case": "^4.1.1",
|
|
222
222
|
"classnames": "^2.3.2",
|
|
223
223
|
"combokeys": "^3.0.1",
|
|
@@ -232,7 +232,7 @@
|
|
|
232
232
|
"extricate-loader": "^3.0.0",
|
|
233
233
|
"fastdom": "^1.0.11",
|
|
234
234
|
"file-loader": "^6.2.0",
|
|
235
|
-
"focus-trap": "^7.5.
|
|
235
|
+
"focus-trap": "^7.5.3",
|
|
236
236
|
"highlight.js": "^10.7.2",
|
|
237
237
|
"html-loader": "^4.2.0",
|
|
238
238
|
"interpolate-loader": "^2.0.1",
|
|
@@ -250,7 +250,7 @@
|
|
|
250
250
|
"react-movable": "^3.0.4",
|
|
251
251
|
"react-virtualized": "^9.22.5",
|
|
252
252
|
"react-waypoint": "^10.3.0",
|
|
253
|
-
"remark-breaks": "^
|
|
253
|
+
"remark-breaks": "^4.0.0",
|
|
254
254
|
"remark-gfm": "^3.0.1",
|
|
255
255
|
"scrollbar-width": "^3.1.1",
|
|
256
256
|
"simply-uuid": "^1.0.1",
|