@jetbrains/ring-ui 5.0.82 → 5.0.84

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.
@@ -1,7 +1,7 @@
1
1
  import { _ as _defineProperty, a as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
2
2
  import React, { PureComponent } from 'react';
3
3
  import PropTypes from 'prop-types';
4
- import Selection from './selection.js';
4
+ import Selection$1 from './selection.js';
5
5
 
6
6
  function extractPropTypes(_ref) {
7
7
  let {
@@ -188,7 +188,7 @@ function selectionShortcutsHOC(ComposedComponent) {
188
188
  }
189
189
  SelectionShortcuts.propTypes = {
190
190
  ...extractPropTypes(ComposedComponent),
191
- selection: PropTypes.instanceOf(Selection).isRequired,
191
+ selection: PropTypes.instanceOf(Selection$1).isRequired,
192
192
  selectable: PropTypes.bool,
193
193
  onSelect: PropTypes.func,
194
194
  shortcuts: PropTypes.object
@@ -1,6 +1,6 @@
1
1
  import { _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
2
2
 
3
- class Selection {
3
+ let Selection$1 = class Selection {
4
4
  constructor() {
5
5
  let {
6
6
  data = [],
@@ -183,6 +183,6 @@ class Selection {
183
183
  return new Set();
184
184
  }
185
185
  }
186
- }
186
+ };
187
187
 
188
- export { Selection as default };
188
+ export { Selection$1 as default };
@@ -2,7 +2,7 @@ import { _ as _defineProperty, a as _extends } from '../_helpers/_rollupPluginBa
2
2
  import React, { PureComponent } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import TableContainer from './table.js';
5
- import Selection from './selection.js';
5
+ import Selection$1 from './selection.js';
6
6
  import 'classnames';
7
7
  import 'react-movable';
8
8
  import '../global/focus-sensor-hoc.js';
@@ -66,7 +66,7 @@ class SmartTable extends PureComponent {
66
66
  constructor() {
67
67
  super(...arguments);
68
68
  _defineProperty(this, "state", {
69
- selection: new Selection({
69
+ selection: new Selection$1({
70
70
  data: this.props.data,
71
71
  isItemSelectable: this.props.isItemSelectable
72
72
  })
@@ -90,7 +90,7 @@ class SmartTable extends PureComponent {
90
90
  });
91
91
  } else if (this.props.data !== data || this.props.isItemSelectable !== isItemSelectable) {
92
92
  this.setState({
93
- selection: new Selection({
93
+ selection: new Selection$1({
94
94
  data,
95
95
  isItemSelectable
96
96
  })
@@ -7,7 +7,7 @@ import focusSensorHOC from '../global/focus-sensor-hoc.js';
7
7
  import getUID from '../global/get-uid.js';
8
8
  import Shortcuts from '../shortcuts/shortcuts.js';
9
9
  import Loader from '../loader/loader.js';
10
- import Selection from './selection.js';
10
+ import Selection$1 from './selection.js';
11
11
  import Header from './header.js';
12
12
  import { m as modules_1db4bbca } from '../_helpers/table.js';
13
13
  import selectionShortcutsHOC from './selection-shortcuts-hoc.js';
@@ -370,7 +370,7 @@ Table.propTypes = {
370
370
  onFocusRestore: PropTypes.func,
371
371
  innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.string, PropTypes.func]),
372
372
  // selectionShortcutsHOC
373
- selection: PropTypes.instanceOf(Selection).isRequired,
373
+ selection: PropTypes.instanceOf(Selection$1).isRequired,
374
374
  selectable: PropTypes.bool,
375
375
  onSelect: PropTypes.func,
376
376
  shortcutsMap: PropTypes.object,
@@ -132,12 +132,11 @@ class TagsInput extends PureComponent {
132
132
  }
133
133
  });
134
134
  _defineProperty(this, "clickHandler", event => {
135
- var _this$getInputNode2;
136
- if (event.target !== this.node) {
135
+ var _this$select3;
136
+ if (event.target !== this.node && event.target.parentElement !== this.node) {
137
137
  return;
138
138
  }
139
- this.loadSuggestions((_this$getInputNode2 = this.getInputNode()) === null || _this$getInputNode2 === void 0 ? void 0 : _this$getInputNode2.value);
140
- this.focusInput();
139
+ (_this$select3 = this.select) === null || _this$select3 === void 0 ? void 0 : _this$select3._clickHandler();
141
140
  });
142
141
  _defineProperty(this, "filterExistingTags", suggestions => {
143
142
  const tagsMap = new Map(this.state.tags.map(tag => [tag.key, tag]));
@@ -192,22 +191,22 @@ class TagsInput extends PureComponent {
192
191
  }
193
192
  });
194
193
  _defineProperty(this, "handleKeyDown", event => {
195
- var _this$select3, _this$select3$_popup;
194
+ var _this$select4, _this$select4$_popup;
196
195
  const key = getEventKey(event);
197
196
  const isInputFocused = () => {
198
- var _this$getInputNode$ta, _this$getInputNode3;
199
- return event.target instanceof Element && event.target.matches((_this$getInputNode$ta = (_this$getInputNode3 = this.getInputNode()) === null || _this$getInputNode3 === void 0 ? void 0 : _this$getInputNode3.tagName) !== null && _this$getInputNode$ta !== void 0 ? _this$getInputNode$ta : '');
197
+ var _this$getInputNode$ta, _this$getInputNode2;
198
+ return event.target instanceof Element && event.target.matches((_this$getInputNode$ta = (_this$getInputNode2 = this.getInputNode()) === null || _this$getInputNode2 === void 0 ? void 0 : _this$getInputNode2.tagName) !== null && _this$getInputNode$ta !== void 0 ? _this$getInputNode$ta : '');
200
199
  };
201
200
  if (key === ' ' && this.props.allowAddNewTags) {
202
- var _this$getInputNode4;
201
+ var _this$getInputNode3;
203
202
  event.stopPropagation();
204
- const value = (_this$getInputNode4 = this.getInputNode()) === null || _this$getInputNode4 === void 0 ? void 0 : _this$getInputNode4.value;
203
+ const value = (_this$getInputNode3 = this.getInputNode()) === null || _this$getInputNode3 === void 0 ? void 0 : _this$getInputNode3.value;
205
204
  if (value != null && value !== '') {
206
205
  this.handleTagCreation(value);
207
206
  }
208
207
  return true;
209
208
  }
210
- if ((_this$select3 = this.select) !== null && _this$select3 !== void 0 && (_this$select3$_popup = _this$select3._popup) !== null && _this$select3$_popup !== void 0 && _this$select3$_popup.isVisible()) {
209
+ if ((_this$select4 = this.select) !== null && _this$select4 !== void 0 && (_this$select4$_popup = _this$select4._popup) !== null && _this$select4$_popup !== void 0 && _this$select4$_popup.isVisible()) {
211
210
  return true;
212
211
  }
213
212
  if (key === 'ArrowLeft') {
@@ -220,8 +219,8 @@ class TagsInput extends PureComponent {
220
219
  if (key === 'ArrowRight' && !isInputFocused()) {
221
220
  if (this.state.activeIndex === this.state.tags.length - 1) {
222
221
  if (!this.props.disabled) {
223
- var _this$getInputNode5;
224
- (_this$getInputNode5 = this.getInputNode()) === null || _this$getInputNode5 === void 0 ? void 0 : _this$getInputNode5.focus();
222
+ var _this$getInputNode4;
223
+ (_this$getInputNode4 = this.getInputNode()) === null || _this$getInputNode4 === void 0 ? void 0 : _this$getInputNode4.focus();
225
224
  this.setActiveIndex();
226
225
  }
227
226
  } else {
@@ -230,12 +229,12 @@ class TagsInput extends PureComponent {
230
229
  return false;
231
230
  }
232
231
  if (!this.props.disabled) {
233
- var _this$getInputNode6;
234
- if (key === 'Backspace' && !((_this$getInputNode6 = this.getInputNode()) !== null && _this$getInputNode6 !== void 0 && _this$getInputNode6.value)) {
235
- var _this$select4;
232
+ var _this$getInputNode5;
233
+ if (key === 'Backspace' && !((_this$getInputNode5 = this.getInputNode()) !== null && _this$getInputNode5 !== void 0 && _this$getInputNode5.value)) {
234
+ var _this$select5;
236
235
  event.preventDefault();
237
236
  const tagsLength = this.state.tags.length;
238
- (_this$select4 = this.select) === null || _this$select4 === void 0 ? void 0 : _this$select4._hidePopup(true); // otherwise confirmation may be overlapped by popup
237
+ (_this$select5 = this.select) === null || _this$select5 === void 0 ? void 0 : _this$select5._hidePopup(true); // otherwise confirmation may be overlapped by popup
239
238
  this.onRemoveTag(this.state.tags[tagsLength - 1]);
240
239
  return false;
241
240
  }
@@ -282,16 +281,16 @@ class TagsInput extends PureComponent {
282
281
  }
283
282
  componentDidMount() {
284
283
  if (this.props.autoOpen && !this.props.disabled) {
285
- var _this$select5;
284
+ var _this$select6;
286
285
  this.focusInput();
287
286
  this.loadSuggestions();
288
- (_this$select5 = this.select) === null || _this$select5 === void 0 ? void 0 : _this$select5._showPopup();
287
+ (_this$select6 = this.select) === null || _this$select6 === void 0 ? void 0 : _this$select6._showPopup();
289
288
  }
290
289
  }
291
290
  getInputNode() {
292
291
  if (!this.input) {
293
- var _this$select6;
294
- this.input = (_this$select6 = this.select) === null || _this$select6 === void 0 ? void 0 : _this$select6.filter;
292
+ var _this$select7;
293
+ this.input = (_this$select7 = this.select) === null || _this$select7 === void 0 ? void 0 : _this$select7.filter;
295
294
  if (this.input) {
296
295
  this.caret = new Caret(this.input);
297
296
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetbrains/ring-ui",
3
- "version": "5.0.82",
3
+ "version": "5.0.84",
4
4
  "description": "JetBrains UI library",
5
5
  "author": "JetBrains",
6
6
  "license": "Apache-2.0",
@@ -80,20 +80,20 @@
80
80
  "@primer/octicons": "^17.10.0",
81
81
  "@rollup/plugin-babel": "^6.0.3",
82
82
  "@rollup/plugin-node-resolve": "^15.0.1",
83
- "@rollup/plugin-replace": "^5.0.1",
84
- "@storybook/addon-a11y": "6.5.14",
85
- "@storybook/addon-docs": "6.5.14",
86
- "@storybook/addon-essentials": "6.5.14",
87
- "@storybook/addon-storyshots": "6.5.14",
88
- "@storybook/addon-storyshots-puppeteer": "6.5.14",
89
- "@storybook/addon-storysource": "6.5.14",
83
+ "@rollup/plugin-replace": "^5.0.2",
84
+ "@storybook/addon-a11y": "6.5.15",
85
+ "@storybook/addon-docs": "6.5.15",
86
+ "@storybook/addon-essentials": "6.5.15",
87
+ "@storybook/addon-storyshots": "6.5.15",
88
+ "@storybook/addon-storyshots-puppeteer": "6.5.15",
89
+ "@storybook/addon-storysource": "6.5.15",
90
90
  "@storybook/addons": "6.5.14",
91
- "@storybook/builder-webpack5": "6.5.14",
92
- "@storybook/client-api": "6.5.14",
93
- "@storybook/core": "6.5.14",
94
- "@storybook/html": "6.5.14",
91
+ "@storybook/builder-webpack5": "6.5.15",
92
+ "@storybook/client-api": "6.5.15",
93
+ "@storybook/core": "6.5.15",
94
+ "@storybook/html": "6.5.15",
95
95
  "@storybook/manager-webpack5": "6.5.14",
96
- "@storybook/react": "6.5.14",
96
+ "@storybook/react": "6.5.15",
97
97
  "@storybook/source-loader": "6.5.14",
98
98
  "@storybook/theming": "6.5.14",
99
99
  "@testing-library/react": "^13.4.0",
@@ -107,8 +107,8 @@
107
107
  "@types/react-dom": "^18.0.9",
108
108
  "@types/sinon": "^10.0.13",
109
109
  "@types/sinon-chai": "^3.2.9",
110
- "@typescript-eslint/eslint-plugin": "^5.46.1",
111
- "@typescript-eslint/parser": "^5.46.1",
110
+ "@typescript-eslint/eslint-plugin": "^5.47.0",
111
+ "@typescript-eslint/parser": "^5.47.0",
112
112
  "@wojtekmaj/enzyme-adapter-react-17": "^0.8.0",
113
113
  "angular": "^1.8.3",
114
114
  "angular-mocks": "^1.8.3",
@@ -123,7 +123,7 @@
123
123
  "core-js": "^3.26.1",
124
124
  "cpy-cli": "^3.1.1",
125
125
  "enzyme": "^3.11.0",
126
- "eslint": "^8.29.0",
126
+ "eslint": "^8.30.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,17 +150,17 @@
150
150
  "merge-options": "^3.0.4",
151
151
  "mocha": "^10.2.0",
152
152
  "pinst": "^3.0.0",
153
- "puppeteer": "^19.4.0",
153
+ "puppeteer": "^19.4.1",
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.11",
159
159
  "rimraf": "^3.0.2",
160
- "rollup": "^3.7.4",
160
+ "rollup": "^3.7.5",
161
161
  "rollup-plugin-clear": "^2.0.7",
162
162
  "rollup-plugin-styles": "^4.0.0",
163
- "sinon": "^15.0.0",
163
+ "sinon": "^15.0.1",
164
164
  "sinon-chai": "^3.7.0",
165
165
  "storage-mock": "^2.1.0",
166
166
  "stylelint": "^14.16.0",
@@ -215,7 +215,7 @@
215
215
  "classnames": "^2.3.2",
216
216
  "combokeys": "^3.0.1",
217
217
  "compile-code-loader": "^1.0.0",
218
- "css-loader": "^6.7.2",
218
+ "css-loader": "^6.7.3",
219
219
  "csstype": "^3.1.1",
220
220
  "date-fns": "^2.29.3",
221
221
  "deep-equal": "^2.1.0",
@@ -230,7 +230,7 @@
230
230
  "highlight.js": "^10.7.2",
231
231
  "html-loader": "^4.2.0",
232
232
  "interpolate-loader": "^2.0.1",
233
- "just-debounce-it": "^3.1.1",
233
+ "just-debounce-it": "^3.2.0",
234
234
  "memoize-one": "^6.0.0",
235
235
  "postcss": "^8.4.20",
236
236
  "postcss-calc": "^8.2.4",
@@ -259,5 +259,5 @@
259
259
  "node": ">=14.0",
260
260
  "npm": ">=6.0.0"
261
261
  },
262
- "gitHead": "dfb2391c3b72202358e2bff7bd7b7b6a6918b163"
262
+ "gitHead": "f0130a92836a5f891fb37169b9e5b42d46fab135"
263
263
  }