@jetbrains/ring-ui 4.1.7 → 4.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.
@@ -1,14 +1,13 @@
1
1
  import React from 'react';
2
2
 
3
+ import youtrackLogo from '!file-loader!@jetbrains/logos/youtrack/youtrack.svg';
4
+
3
5
  import reactDecorator from '../../.storybook/react-decorator';
4
6
 
5
7
  import Button from '@jetbrains/ring-ui/components/button/button';
6
8
 
7
9
  import AuthDialog from '@jetbrains/ring-ui/components/auth-dialog/auth-dialog';
8
10
 
9
- import youtrackLogo from '!file-loader!@jetbrains/logos/youtrack/youtrack.svg';
10
-
11
-
12
11
  export default {
13
12
  title: 'Components/Auth Dialog',
14
13
  decorators: [reactDecorator()],
@@ -727,9 +727,9 @@ export default class Select extends Component {
727
727
  return isInputMode(this.props.type);
728
728
  }
729
729
 
730
- _clickHandler = (forceShowPopup = false) => {
730
+ _clickHandler = () => {
731
731
  if (!this.props.disabled) {
732
- if (this.state.showPopup && !forceShowPopup) {
732
+ if (this.state.showPopup) {
733
733
  this._hidePopup();
734
734
  } else {
735
735
  this.props.onBeforeOpen();
@@ -738,6 +738,14 @@ export default class Select extends Component {
738
738
  }
739
739
  };
740
740
 
741
+ _openPopupIfClosed = () => {
742
+ if (this.props.disabled || this.state.showPopup) {
743
+ return;
744
+ }
745
+ this.props.onBeforeOpen();
746
+ this._showPopup();
747
+ };
748
+
741
749
  _filterChangeHandler = e => {
742
750
  this._setFilter(e.target.value, e);
743
751
  };
@@ -59,12 +59,10 @@ class SelectLazy {
59
59
  this.detachEvents();
60
60
  if (this.type === 'dropdown') {
61
61
  this.ctrl.selectInstance = render(this.reactSelect, this.container);
62
- // In "dropdown" mode we don't click select itself, so need to force click handler
63
- this.ctrl.selectInstance._clickHandler();
64
62
  } else {
65
63
  this.ctrl.selectInstance = hydrate(this.reactSelect, this.container);
66
- this.ctrl.selectInstance._clickHandler(true);
67
64
  }
65
+ this.ctrl.selectInstance._openPopupIfClosed();
68
66
  }
69
67
  }
70
68
 
@@ -379,20 +379,28 @@ class Select extends Component {
379
379
 
380
380
  _defineProperty(this, "doesLabelMatch", doesLabelMatch);
381
381
 
382
- _defineProperty(this, "_clickHandler", function () {
383
- let forceShowPopup = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
384
-
385
- if (!_this.props.disabled) {
386
- if (_this.state.showPopup && !forceShowPopup) {
387
- _this._hidePopup();
382
+ _defineProperty(this, "_clickHandler", () => {
383
+ if (!this.props.disabled) {
384
+ if (this.state.showPopup) {
385
+ this._hidePopup();
388
386
  } else {
389
- _this.props.onBeforeOpen();
387
+ this.props.onBeforeOpen();
390
388
 
391
- _this._showPopup();
389
+ this._showPopup();
392
390
  }
393
391
  }
394
392
  });
395
393
 
394
+ _defineProperty(this, "_openPopupIfClosed", () => {
395
+ if (this.props.disabled || this.state.showPopup) {
396
+ return;
397
+ }
398
+
399
+ this.props.onBeforeOpen();
400
+
401
+ this._showPopup();
402
+ });
403
+
396
404
  _defineProperty(this, "_filterChangeHandler", e => {
397
405
  this._setFilter(e.target.value, e);
398
406
  });
@@ -137,14 +137,12 @@ class SelectLazy {
137
137
  this.detachEvents();
138
138
 
139
139
  if (this.type === 'dropdown') {
140
- this.ctrl.selectInstance = render(this.reactSelect, this.container); // In "dropdown" mode we don't click select itself, so need to force click handler
141
-
142
- this.ctrl.selectInstance._clickHandler();
140
+ this.ctrl.selectInstance = render(this.reactSelect, this.container);
143
141
  } else {
144
142
  this.ctrl.selectInstance = hydrate(this.reactSelect, this.container);
145
-
146
- this.ctrl.selectInstance._clickHandler(true);
147
143
  }
144
+
145
+ this.ctrl.selectInstance._openPopupIfClosed();
148
146
  }
149
147
 
150
148
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetbrains/ring-ui",
3
- "version": "4.1.7",
3
+ "version": "4.1.8",
4
4
  "description": "JetBrains UI library",
5
5
  "author": "JetBrains",
6
6
  "license": "Apache-2.0",
@@ -70,7 +70,7 @@
70
70
  "@babel/cli": "^7.16.7",
71
71
  "@babel/eslint-parser": "^7.16.5",
72
72
  "@jetbrains/eslint-config": "^5.3.1",
73
- "@jetbrains/generator-ring-ui": "^4.1.3",
73
+ "@jetbrains/generator-ring-ui": "^4.1.4",
74
74
  "@jetbrains/stylelint-config": "^3.0.2",
75
75
  "@primer/octicons": "^16.2.0",
76
76
  "@rollup/plugin-babel": "^5.3.0",
@@ -108,7 +108,7 @@
108
108
  "eslint-import-resolver-webpack": "^0.13.2",
109
109
  "eslint-plugin-angular": "^4.1.0",
110
110
  "eslint-plugin-bdd": "^2.1.1",
111
- "eslint-plugin-import": "^2.25.3",
111
+ "eslint-plugin-import": "^2.25.4",
112
112
  "eslint-plugin-jsx-a11y": "^6.5.1",
113
113
  "eslint-plugin-react": "^7.28.0",
114
114
  "events": "^3.3.0",
@@ -117,7 +117,7 @@
117
117
  "husky": "^7.0.4",
118
118
  "identity-obj-proxy": "^3.0.0",
119
119
  "imports-loader": "^3.1.1",
120
- "jest": "~27.4.5",
120
+ "jest": "~27.4.7",
121
121
  "jest-teamcity": "^1.10.0",
122
122
  "karma": "^6.3.9",
123
123
  "karma-chrome-launcher": "3.1.0",
@@ -202,7 +202,7 @@
202
202
  "postcss-loader": "^6.2.1",
203
203
  "postcss-modules-values-replace": "^3.4.0",
204
204
  "postcss-preset-env": "^7.2.0",
205
- "prop-types": "^15.8.0",
205
+ "prop-types": "^15.8.1",
206
206
  "react-markdown": "^5.0.3",
207
207
  "react-movable": "^3.0.2",
208
208
  "react-virtualized": "^9.22.3",
@@ -221,5 +221,5 @@
221
221
  "node": ">=7.4",
222
222
  "npm": ">=6.0.0"
223
223
  },
224
- "gitHead": "882b425327661b41b8234af5416e4a7db850addd"
224
+ "gitHead": "dca1856fa248b940b4375685e61b9e8687317b4d"
225
225
  }