@plesk/ui-library 3.28.2 → 3.28.3

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.
@@ -67,7 +67,9 @@ class AutoClosable extends Component {
67
67
  }
68
68
 
69
69
  componentDidMount() {
70
- document.body.addEventListener('click', this.onOutsideClick);
70
+ document.body.addEventListener('click', this.onOutsideClick, {
71
+ capture: true
72
+ });
71
73
 
72
74
  if (this.context) {
73
75
  this.context.addChild(this);
@@ -75,7 +77,9 @@ class AutoClosable extends Component {
75
77
  }
76
78
 
77
79
  componentWillUnmount() {
78
- document.body.removeEventListener('click', this.onOutsideClick);
80
+ document.body.removeEventListener('click', this.onOutsideClick, {
81
+ capture: true
82
+ });
79
83
 
80
84
  if (this.context) {
81
85
  this.context.removeChild(this);
@@ -199,7 +199,7 @@ class FormField extends Component {
199
199
  multi
200
200
  } = this.props;
201
201
 
202
- if (!description || multi && this.state.value.length - 1 > index) {
202
+ if (!description || multi && this.fieldApi.getValue().length - 1 > index) {
203
203
  return null;
204
204
  }
205
205
 
@@ -87,8 +87,6 @@ export default class Overlay extends Component {
87
87
  isExist: true
88
88
  }, () => {
89
89
  this.prevFocusElement = document.activeElement;
90
- });
91
- setTimeout(() => {
92
90
  this.setState({
93
91
  isOpened: true
94
92
  }, () => {
@@ -172,8 +172,8 @@ const Select = ({
172
172
 
173
173
  if (filterValue) {
174
174
  const lowerFilterValue = filterValue.toLowerCase();
175
- groupFns.push(group => !!group.label && group.label.toLowerCase().indexOf(lowerFilterValue) === 0);
176
- optionFns.push(option => option.label.toLowerCase().indexOf(lowerFilterValue) === 0);
175
+ groupFns.push(group => !!group.label && group.label.toLowerCase().includes(lowerFilterValue));
176
+ optionFns.push(option => option.label.toLowerCase().includes(lowerFilterValue));
177
177
  }
178
178
 
179
179
  if (groupFns.length || optionFns.length) {
@@ -253,7 +253,7 @@ const Select = ({
253
253
 
254
254
  const handleHighlightSearch = query => {
255
255
  const lowerQuery = query.toLowerCase();
256
- const index = options.findIndex(o => !o.disabled && o.label.toLowerCase().indexOf(lowerQuery) === 0);
256
+ const index = options.findIndex(o => !o.disabled && o.label.toLowerCase().includes(lowerQuery));
257
257
 
258
258
  if (index !== -1) {
259
259
  setHighlightedIndex(index);
package/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // Copyright 1999-2018. Plesk International GmbH. All rights reserved.
2
2
  import svg4everybody from 'svg4everybody';
3
- const version = "3.28.2";
3
+ const version = "3.28.3";
4
4
  export * from './publicPath';
5
5
  export { version };
6
6
  export * from './utils';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plesk/ui-library",
3
- "version": "3.28.2",
3
+ "version": "3.28.3",
4
4
  "description": "Plesk UI Library",
5
5
  "main": "index.js",
6
6
  "module": "esm/index.js",