select2-react-component
Advanced tools
Comparing version 5.3.0 to 5.4.0
@@ -1,2 +0,1 @@ | ||
/// <reference types="react" /> | ||
import * as React from 'react'; | ||
@@ -37,17 +36,20 @@ import * as common from 'select2-component'; | ||
render(): JSX.Element; | ||
private getFilteredData(canSetState); | ||
private getOptionStyle(value); | ||
private mouseenter(option); | ||
private click(option); | ||
private toggleOpenAndClose(); | ||
private focusout(); | ||
private moveUp(); | ||
private moveDown(); | ||
private selectByEnter(); | ||
private select(option); | ||
private keyDown(e); | ||
private renderSelection; | ||
private renderResult; | ||
private getFilteredData; | ||
private getOptionStyle; | ||
private mouseenter; | ||
private click; | ||
private toggleOpenAndClose; | ||
private focusout; | ||
private moveUp; | ||
private moveDown; | ||
private selectByEnter; | ||
private select; | ||
private keyDown; | ||
private onChange; | ||
private isSelected(option); | ||
private isDisabled(option); | ||
private removeSelection(e, option); | ||
private isSelected; | ||
private isDisabled; | ||
private focusSearchboxOrResultsElement; | ||
private removeSelection; | ||
} |
@@ -79,3 +79,37 @@ import * as tslib_1 from "tslib"; | ||
var _this = this; | ||
var results = this.getFilteredData(false).map(function (groupOrOption, i) { | ||
var results = this.renderResult(); | ||
var selection = this.renderSelection(); | ||
return (React.createElement("div", { className: this.containerStyle }, | ||
React.createElement("div", { className: 'selection', onClick: function () { return _this.toggleOpenAndClose(); } }, | ||
React.createElement("div", { className: this.selectionStyle, role: 'combobox' }, selection)), | ||
React.createElement("div", { className: this.dropdownStyle }, | ||
React.createElement("div", { className: 'select2-dropdown select2-dropdown--below' }, | ||
React.createElement("div", { className: this.searchStyle }, | ||
React.createElement("input", { value: this.searchText, onChange: this.onChange, onKeyDown: function (e) { return _this.keyDown(e); }, onBlur: function () { return _this.focusout(); }, className: 'select2-search__field', type: 'search', role: 'textbox', autoComplete: 'off', autoCorrect: 'off', autoCapitalize: 'off', spellCheck: false })), | ||
React.createElement("div", { className: 'select2-results' }, | ||
React.createElement("ul", { className: 'select2-results__options', role: 'tree', tabIndex: -1, onKeyDown: function (e) { return _this.keyDown(e); }, onBlur: function () { return _this.focusout(); } }, results)))))); | ||
}; | ||
Select2.prototype.renderSelection = function () { | ||
var _this = this; | ||
if (this.props.multiple) { | ||
var items = this.option.map(function (op, i) { return (React.createElement("li", { className: 'select2-selection__choice', title: op.label, key: i }, | ||
React.createElement("span", { onClick: function (e) { return _this.removeSelection(e, op); }, className: 'select2-selection__choice__remove', role: 'presentation' }, "\u00D7"), | ||
op.label)); }); | ||
return (React.createElement("ul", { className: 'select2-selection__rendered' }, items)); | ||
} | ||
else { | ||
var option = this.option; | ||
var label = option | ||
? (option.component ? React.createElement(option.component, { option: option }) : option.label) | ||
: React.createElement("span", { className: 'select2-selection__placeholder' }, this.props.placeholder); | ||
return [ | ||
React.createElement("span", { key: 'label', className: 'select2-selection__rendered', title: option ? option.label : '' }, label), | ||
React.createElement("span", { key: 'arrow', className: 'select2-selection__arrow', role: 'presentation' }, | ||
React.createElement("b", { role: 'presentation' })) | ||
]; | ||
} | ||
}; | ||
Select2.prototype.renderResult = function () { | ||
var _this = this; | ||
return this.getFilteredData(false).map(function (groupOrOption, i) { | ||
var options = groupOrOption.options; | ||
@@ -101,29 +135,2 @@ if (options) { | ||
}); | ||
var selection; | ||
if (this.props.multiple) { | ||
var items = this.option.map(function (op, i) { return (React.createElement("li", { className: 'select2-selection__choice', title: op.label, key: i }, | ||
React.createElement("span", { onClick: function (e) { return _this.removeSelection(e, op); }, className: 'select2-selection__choice__remove', role: 'presentation' }, "\u00D7"), | ||
op.label)); }); | ||
selection = (React.createElement("ul", { className: 'select2-selection__rendered' }, items)); | ||
} | ||
else { | ||
var option = this.option; | ||
var label = option | ||
? (option.component ? React.createElement(option.component, { option: option }) : option.label) | ||
: React.createElement("span", { className: 'select2-selection__placeholder' }, this.props.placeholder); | ||
selection = [ | ||
React.createElement("span", { key: 'label', className: 'select2-selection__rendered', title: option ? option.label : '' }, label), | ||
React.createElement("span", { key: 'arrow', className: 'select2-selection__arrow', role: 'presentation' }, | ||
React.createElement("b", { role: 'presentation' })) | ||
]; | ||
} | ||
return (React.createElement("div", { className: this.containerStyle }, | ||
React.createElement("div", { className: 'selection', onClick: function () { return _this.toggleOpenAndClose(); } }, | ||
React.createElement("div", { className: this.selectionStyle, role: 'combobox' }, selection)), | ||
React.createElement("div", { className: this.dropdownStyle }, | ||
React.createElement("div", { className: 'select2-dropdown select2-dropdown--below' }, | ||
React.createElement("div", { className: this.searchStyle }, | ||
React.createElement("input", { value: this.searchText, onChange: this.onChange, onKeyDown: function (e) { return _this.keyDown(e); }, onBlur: function () { return _this.focusout(); }, className: 'select2-search__field', type: 'search', role: 'textbox', autoComplete: 'off', autoCorrect: 'off', autoCapitalize: 'off', spellCheck: false })), | ||
React.createElement("div", { className: 'select2-results' }, | ||
React.createElement("ul", { className: 'select2-results__options', role: 'tree', tabIndex: -1, onKeyDown: function (e) { return _this.keyDown(e); }, onBlur: function () { return _this.focusout(); } }, results)))))); | ||
}; | ||
@@ -178,12 +185,3 @@ Select2.prototype.getFilteredData = function (canSetState) { | ||
this.setState({ searchText: this.searchText }, function () { | ||
if (!_this.isSearchboxHidden) { | ||
if (_this.searchInputElement) { | ||
_this.searchInputElement.focus(); | ||
} | ||
} | ||
else { | ||
if (_this.resultsElement) { | ||
_this.resultsElement.focus(); | ||
} | ||
} | ||
_this.focusSearchboxOrResultsElement(); | ||
if (_this.resultsElement) { | ||
@@ -244,9 +242,3 @@ var lastScrollTopIndex = common.getLastScrollTopIndex(_this.hoveringValue, _this.resultsElement, _this.props.data, _this.lastScrollTopIndex); | ||
var options = this.option; | ||
var index = -1; | ||
for (var i = 0; i < options.length; i++) { | ||
if (options[i].value === option.value) { | ||
index = i; | ||
break; | ||
} | ||
} | ||
var index = options.findIndex(function (op) { return op.value === option.value; }); | ||
if (index === -1) { | ||
@@ -295,2 +287,14 @@ options.push(option); | ||
}; | ||
Select2.prototype.focusSearchboxOrResultsElement = function () { | ||
if (!this.isSearchboxHidden) { | ||
if (this.searchInputElement) { | ||
this.searchInputElement.focus(); | ||
} | ||
} | ||
else { | ||
if (this.resultsElement) { | ||
this.resultsElement.focus(); | ||
} | ||
} | ||
}; | ||
Select2.prototype.removeSelection = function (e, option) { | ||
@@ -306,12 +310,3 @@ var _this = this; | ||
this.setState({ option: this.option }, function () { | ||
if (!_this.isSearchboxHidden) { | ||
if (_this.searchInputElement) { | ||
_this.searchInputElement.focus(); | ||
} | ||
} | ||
else { | ||
if (_this.resultsElement) { | ||
_this.resultsElement.focus(); | ||
} | ||
} | ||
_this.focusSearchboxOrResultsElement(); | ||
}); | ||
@@ -318,0 +313,0 @@ } |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","react","react-dom"],t):t(e.Select2={},e.React,e.ReactDOM)}(this,function(e,t,r){"use strict";var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};function o(e){var t="function"==typeof Symbol&&e[Symbol.iterator],r=0;return t?t.call(e):{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}var l=[{l:"a",s:/[ⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ]/gi},{l:"aa",s:/ꜳ/gi},{l:"ae",s:/[æǽǣ]/gi},{l:"ao",s:/ꜵ/gi},{l:"au",s:/ꜷ/gi},{l:"av",s:/[ꜹꜻ]/gi},{l:"ay",s:/ꜽ/gi},{l:"b",s:/[ⓑbḃḅḇƀƃɓ]/gi},{l:"c",s:/[ⓒcćĉċčçḉƈȼꜿↄ]/gi},{l:"d",s:/[ⓓdḋďḍḑḓḏđƌɖɗꝺ]/gi},{l:"dz",s:/[dzdž]/gi},{l:"e",s:/[ⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ]/gi},{l:"f",s:/[ⓕfḟƒꝼ]/gi},{l:"g",s:/[ⓖgǵĝḡğġǧģǥɠꞡᵹꝿ]/gi},{l:"h",s:/[ⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ]/gi},{l:"hv",s:/ƕ/gi},{l:"i",s:/[ⓘiìíîĩīĭİïḯỉǐȉȋịįḭɨı]/gi},{l:"j",s:/[ⓙjĵǰɉ]/gi},{l:"k",s:/[ⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ]/gi},{l:"l",s:/[ⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇꝆ]/gi},{l:"lj",s:/lj/gi},{l:"m",s:/[ⓜmḿṁṃɱɯ]/gi},{l:"n",s:/[ⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ]/gi},{l:"nj",s:/nj/gi},{l:"o",s:/[ⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔƟꝋꝍɵ]/gi},{l:"oi",s:/ƣ/gi},{l:"oe",s:/œ/gi},{l:"oo",s:/ꝏ/gi},{l:"ou",s:/ȣ/gi},{l:"p",s:/[ⓟpṕṗƥᵽꝑꝓꝕ]/gi},{l:"q",s:/[ⓠqɋꝗꝙ]/gi},{l:"r",s:/[ⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ]/gi},{l:"s",s:/[ⓢsßẞśṥŝṡšṧṣṩșşȿꞩꞅẛ]/gi},{l:"t",s:/[ⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ]/gi},{l:"tz",s:/ꜩ/gi},{l:"u",s:/[ⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ]/gi},{l:"v",s:/[ⓥvṽṿʋꝟʌ]/gi},{l:"vy",s:/ꝡ/gi},{l:"w",s:/[ⓦwẁẃŵẇẅẘẉⱳ]/gi},{l:"x",s:/[ⓧxẋẍ]/gi},{l:"y",s:/[ⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ]/gi},{l:"z",s:/[ⓩzźẑżžẓẕƶȥɀⱬꝣ]/gi}];function i(e,t){try{for(var r=o(e),n=r.next();!n.done;n=r.next()){var l=n.value,i=l.options;if(i)try{for(var s=o(i),a=s.next();!a.done;a=s.next()){var c=a.value;if(c.value===t)return c}}catch(e){h={error:e}}finally{try{a&&!a.done&&(f=s.return)&&f.call(s)}finally{if(h)throw h.error}}else if(l.value===t)return l}}catch(e){u={error:e}}finally{try{n&&!n.done&&(p=r.return)&&p.call(r)}finally{if(u)throw u.error}}return null;var u,p,h,f}function s(e,t,r){if(r){var n=Array.isArray(t)?t:[],l=[];try{for(var s=o(n),a=s.next();!a.done;a=s.next()){var c=i(e,a.value);c&&l.push(c)}}catch(e){u={error:e}}finally{try{a&&!a.done&&(p=s.return)&&p.call(s)}finally{if(u)throw u.error}}return l}return i(e,t);var u,p}function a(e){try{for(var t=o(e),r=t.next();!r.done;r=t.next()){var n=r.value,l=n.options;if(l)try{for(var i=o(l),s=i.next();!s.done;s=i.next()){var a;if(!(a=s.value).disabled)return a.value}}catch(e){p={error:e}}finally{try{s&&!s.done&&(h=i.return)&&h.call(i)}finally{if(p)throw p.error}}else if(!(a=n).disabled)return a.value}}catch(e){c={error:e}}finally{try{r&&!r.done&&(u=t.return)&&u.call(t)}finally{if(c)throw c.error}}return null;var c,u,p,h}function c(e,t){if(null===t||void 0===t)return!0;try{for(var r=o(e),n=r.next();!n.done;n=r.next()){var l=n.value,i=l.options;if(i)try{for(var s=o(i),a=s.next();!a.done;a=s.next()){if(a.value.value===t)return!1}}catch(e){p={error:e}}finally{try{a&&!a.done&&(h=s.return)&&h.call(s)}finally{if(p)throw p.error}}else if(l.value===t)return!1}}catch(e){c={error:e}}finally{try{n&&!n.done&&(u=r.return)&&u.call(r)}finally{if(c)throw c.error}}return!0;var c,u,p,h}function u(e,t){for(var r=null===t||void 0===t,n=e.length-1;n>=0;n--){var o=e[n],l=o.options;if(l)for(var i=l.length-1;i>=0;i--){var s=l[i];if(r&&!s.disabled)return s.value;r=s.value===t}else{s=o;if(r&&!s.disabled)return s.value;r=s.value===t}}return r?t:null}function p(e,t){var r,n,l,i,s=null===t||void 0===t;try{for(var a=o(e),c=a.next();!c.done;c=a.next()){var u=c.value,p=u.options;if(p)try{for(var h=o(p),f=h.next();!f.done;f=h.next()){var d=f.value;if(s){if(!d.disabled)return d.value}else s=d.value===t}}catch(e){l={error:e}}finally{try{f&&!f.done&&(i=h.return)&&i.call(h)}finally{if(l)throw l.error}}else{d=u;if(s){if(!d.disabled)return d.value}else s=d.value===t}}}catch(e){r={error:e}}finally{try{c&&!c.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return s?t:null}function h(e,t,r,n){if(null===e||void 0===e)return t.scrollTop=0,0;var l,i=function(e,t){var r,n,l,i,s=0;try{for(var a=o(e),c=a.next();!c.done;c=a.next()){var u=c.value,p=u.options;if(p){s++;try{for(var h=o(p),f=h.next();!f.done;f=h.next()){if(f.value.value===t)return s;s++}}catch(e){l={error:e}}finally{try{f&&!f.done&&(i=h.return)&&i.call(h)}finally{if(l)throw l.error}}}else{if(u.value===t)return s;s++}}}catch(e){r={error:e}}finally{try{c&&!c.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return 0}(r,e);return i-n>5?(n+=i-n-5,(l=t.querySelectorAll("li").item(i))&&(t.scrollTop=l.offsetTop-t.offsetHeight),n):n-i>0?(n-=n-i,(l=t.querySelectorAll("li").item(n-1))&&(t.scrollTop=l.offsetTop),n):null}function f(e,t,r){return!t||null!==d(e).match(new RegExp(function(e,t){e=d(function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}(e)),t&&"function"==typeof t&&(e=t(e));return e}(t,r),"i"))}function d(e){try{for(var t=o(l),r=t.next();!r.done;r=t.next()){var n=r.value;e=e.replace(n.s,n.l)}}catch(e){i={error:e}}finally{try{r&&!r.done&&(s=t.return)&&s.call(t)}finally{if(i)throw i.error}}return e;var i,s}function v(e,t,r){if(t){var n=[];try{for(var l=o(e),i=l.next();!i.done;i=l.next()){var s=i.value,a=s.options;if(a){if(a.some(function(e){return f(e.label,t,r)})){var c=a.filter(function(e){return f(e.label,t,r)});n.push({label:s.label,options:c})}}else f(s.label,t,r)&&n.push(s)}}catch(e){u={error:e}}finally{try{i&&!i.done&&(p=l.return)&&p.call(l)}finally{if(u)throw u.error}}return n}return e;var u,p}function y(e,t){return e===t?"select2-results__option select2-results__option--highlighted":"select2-results__option"}function m(e){return e?"select2-container select2-container--default select2-container-dropdown select2-container--open":"select2-container select2-container--default select2-container-dropdown"}function g(e,t){return"select2 select2-container select2-container--default "+(e?"select2-container--disabled":"")+" "+(t?"select2-container--open":"")+" select2-container--below select2-container--focus"}function S(e){return"select2-selection select2-selection--"+(e?"multiple":"single")}var x=6;function b(e,t){return"number"!=typeof t&&(t=x),function(e){var t,r,n=0;try{for(var l=o(e),i=l.next();!i.done;i=l.next()){var s=i.value.options;s?n+=s.length:n++}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}return n}(e)<t}function E(e){return e?"select2-search select2-search--dropdown select2-search--hide":"select2-search select2-search--dropdown"}function T(e,t,r){return r?e&&e.some(function(e){return e.value===t.value})?"true":"false":e&&t.value===e.value?"true":"false"}function _(e,t){for(var r=0;r<e.length;r++)if(e[r].value===t.value)return void e.splice(r,1)}var w=function(e){function o(){var t=null!==e&&e.apply(this,arguments)||this;return t.hoveringValue=null,t.option=null,t.isOpen=!1,t.innerSearchText="",t.lastScrollTopIndex=0,t.onChange=function(e){t.searchText=e.currentTarget.value,t.setState({searchText:t.searchText})},t}return function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(o,e),Object.defineProperty(o.prototype,"searchText",{get:function(){return this.innerSearchText},set:function(e){this.props.customSearchEnabled&&this.props.search&&this.props.search(e),this.innerSearchText=e},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"dropdownStyle",{get:function(){return m(this.isOpen)},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"containerStyle",{get:function(){return g(this.props.disabled,this.isOpen)},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"selectionStyle",{get:function(){return S(this.props.multiple)},enumerable:!0,configurable:!0}),o.prototype.componentWillMount=function(){var e=s(this.props.data,this.props.value,this.props.multiple);null!==e&&(this.option=e,this.setState({option:this.option})),Array.isArray(e)||(this.hoveringValue=this.props.value),this.setState({hoveringValue:this.hoveringValue}),this.isSearchboxHidden=!this.props.customSearchEnabled&&b(this.props.data,this.props.minCountForSearch),this.searchStyle=E(this.isSearchboxHidden)},o.prototype.componentDidMount=function(){this.searchInputElement=r.findDOMNode(this).childNodes[1].childNodes[0].childNodes[0].childNodes[0],this.resultsElement=r.findDOMNode(this).childNodes[1].childNodes[0].childNodes[1].childNodes[0]},o.prototype.render=function(){var e,r=this,n=this.getFilteredData(!1).map(function(e,n){var o=e.options;if(o){var l=o.map(function(e,n){var o=e.component?t.createElement(e.component,{option:e}):e.label;return t.createElement("li",{className:r.getOptionStyle(e.value),key:n,role:"treeitem","aria-selected":r.isSelected(e),"aria-disabled":r.isDisabled(e),onMouseEnter:function(){return r.mouseenter(e)},onClick:function(){return r.click(e)}},o)});return t.createElement("li",{className:"select2-results__option",role:"group",key:n},t.createElement("strong",{className:"select2-results__group"},e.label),t.createElement("ul",{className:"select2-results__options select2-results__options--nested"},l))}var i=e,s=i.component?t.createElement(i.component,{option:i}):i.label;return t.createElement("li",{className:r.getOptionStyle(i.value),key:n,role:"treeitem","aria-selected":r.isSelected(i),"aria-disabled":r.isDisabled(i),onMouseEnter:function(){return r.mouseenter(i)},onClick:function(){return r.click(i)}},s)});if(this.props.multiple){var o=this.option.map(function(e,n){return t.createElement("li",{className:"select2-selection__choice",title:e.label,key:n},t.createElement("span",{onClick:function(t){return r.removeSelection(t,e)},className:"select2-selection__choice__remove",role:"presentation"},"×"),e.label)});e=t.createElement("ul",{className:"select2-selection__rendered"},o)}else{var l=this.option,i=l?l.component?t.createElement(l.component,{option:l}):l.label:t.createElement("span",{className:"select2-selection__placeholder"},this.props.placeholder);e=[t.createElement("span",{key:"label",className:"select2-selection__rendered",title:l?l.label:""},i),t.createElement("span",{key:"arrow",className:"select2-selection__arrow",role:"presentation"},t.createElement("b",{role:"presentation"}))]}return t.createElement("div",{className:this.containerStyle},t.createElement("div",{className:"selection",onClick:function(){return r.toggleOpenAndClose()}},t.createElement("div",{className:this.selectionStyle,role:"combobox"},e)),t.createElement("div",{className:this.dropdownStyle},t.createElement("div",{className:"select2-dropdown select2-dropdown--below"},t.createElement("div",{className:this.searchStyle},t.createElement("input",{value:this.searchText,onChange:this.onChange,onKeyDown:function(e){return r.keyDown(e)},onBlur:function(){return r.focusout()},className:"select2-search__field",type:"search",role:"textbox",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1})),t.createElement("div",{className:"select2-results"},t.createElement("ul",{className:"select2-results__options",role:"tree",tabIndex:-1,onKeyDown:function(e){return r.keyDown(e)},onBlur:function(){return r.focusout()}},n)))))},o.prototype.getFilteredData=function(e){var t=this.props.customSearchEnabled?this.props.data:v(this.props.data,this.searchText);if(c(t,this.hoveringValue)&&(this.hoveringValue=a(t),e&&this.setState({hoveringValue:this.hoveringValue}),this.resultsElement)){var r=h(this.hoveringValue,this.resultsElement,t,this.lastScrollTopIndex);null!==r&&(this.lastScrollTopIndex=r,e&&this.setState({lastScrollTopIndex:this.lastScrollTopIndex}))}return t},o.prototype.getOptionStyle=function(e){return y(e,this.hoveringValue)},o.prototype.mouseenter=function(e){e.disabled||(this.hoveringValue=e.value,this.setState({hoveringValue:this.hoveringValue}))},o.prototype.click=function(e){e.disabled||this.select(e),this.focusoutTimer&&clearTimeout(this.focusoutTimer)},o.prototype.toggleOpenAndClose=function(){var e=this;this.props.disabled||(this.isOpen=!this.isOpen,this.setState({isOpen:this.isOpen}),this.isOpen&&(this.innerSearchText="",this.setState({searchText:this.searchText},function(){if(e.isSearchboxHidden?e.resultsElement&&e.resultsElement.focus():e.searchInputElement&&e.searchInputElement.focus(),e.resultsElement){var t=h(e.hoveringValue,e.resultsElement,e.props.data,e.lastScrollTopIndex);null!==t&&(e.lastScrollTopIndex=t)}}),this.props.open&&this.props.open()),this.focusoutTimer&&clearTimeout(this.focusoutTimer))},o.prototype.focusout=function(){var e=this;this.focusoutTimer=setTimeout(function(){e.isOpen=!1,e.setState({isOpen:e.isOpen}),e.focusoutTimer=void 0},200)},o.prototype.moveUp=function(){if(this.hoveringValue=u(this.getFilteredData(!0),this.hoveringValue),this.setState({hoveringValue:this.hoveringValue}),this.resultsElement){var e=h(this.hoveringValue,this.resultsElement,this.getFilteredData(!0),this.lastScrollTopIndex);null!==e&&(this.lastScrollTopIndex=e,this.setState({lastScrollTopIndex:this.lastScrollTopIndex}))}},o.prototype.moveDown=function(){if(this.hoveringValue=p(this.getFilteredData(!0),this.hoveringValue),this.setState({hoveringValue:this.hoveringValue}),this.resultsElement){var e=h(this.hoveringValue,this.resultsElement,this.getFilteredData(!0),this.lastScrollTopIndex);null!==e&&(this.lastScrollTopIndex=e,this.setState({lastScrollTopIndex:this.lastScrollTopIndex}))}},o.prototype.selectByEnter=function(){if(this.hoveringValue){var e=i(this.props.data,this.hoveringValue);this.select(e)}},o.prototype.select=function(e){if(null!==e)if(this.props.multiple){for(var t=this.option,r=-1,n=0;n<t.length;n++)if(t[n].value===e.value){r=n;break}-1===r?t.push(e):t.splice(r,1),this.setState({option:this.option})}else this.option=e,this.isOpen=!1,this.setState({option:this.option,isOpen:this.isOpen});this.props.update&&this.props.update(this.props.multiple?this.option.map(function(e){return e.value}):this.option.value)},o.prototype.keyDown=function(e){40===e.keyCode?(this.moveDown(),e.preventDefault()):38===e.keyCode?(this.moveUp(),e.preventDefault()):13===e.keyCode&&(this.selectByEnter(),e.preventDefault())},o.prototype.isSelected=function(e){return T(this.option,e,this.props.multiple)},o.prototype.isDisabled=function(e){return e.disabled?"true":"false"},o.prototype.removeSelection=function(e,t){var r=this;_(this.option,t),this.props.update&&this.props.update(this.option.map(function(e){return e.value})),e.preventDefault(),e.stopPropagation(),this.isOpen&&this.setState({option:this.option},function(){r.isSearchboxHidden?r.resultsElement&&r.resultsElement.focus():r.searchInputElement&&r.searchInputElement.focus()}),this.focusoutTimer&&clearTimeout(this.focusoutTimer)},o}(t.PureComponent);e.Select2=w,e.timeout=200,e.getOptionByValue=i,e.getOptionsByValue=s,e.getFirstAvailableOption=a,e.valueIsNotInFilteredData=c,e.getPreviousOption=u,e.getNextOption=p,e.getLastScrollTopIndex=h,e.getFilteredData=v,e.getOptionStyle=y,e.getDropdownStyle=m,e.getContainerStyle=g,e.getSelectionStyle=S,e.isSearchboxHiddex=b,e.getSearchStyle=E,e.isSelected=T,e.removeSelection=_,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","react","react-dom"],t):t(e.Select2={},e.React,e.ReactDOM)}(this,function(e,s,r){"use strict";var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function d(e){var t="function"==typeof Symbol&&e[Symbol.iterator],r=0;return t?t.call(e):{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}var i=[{l:"a",s:/[ⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ]/gi},{l:"aa",s:/ꜳ/gi},{l:"ae",s:/[æǽǣ]/gi},{l:"ao",s:/ꜵ/gi},{l:"au",s:/ꜷ/gi},{l:"av",s:/[ꜹꜻ]/gi},{l:"ay",s:/ꜽ/gi},{l:"b",s:/[ⓑbḃḅḇƀƃɓ]/gi},{l:"c",s:/[ⓒcćĉċčçḉƈȼꜿↄ]/gi},{l:"d",s:/[ⓓdḋďḍḑḓḏđƌɖɗꝺ]/gi},{l:"dz",s:/[dzdž]/gi},{l:"e",s:/[ⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ]/gi},{l:"f",s:/[ⓕfḟƒꝼ]/gi},{l:"g",s:/[ⓖgǵĝḡğġǧģǥɠꞡᵹꝿ]/gi},{l:"h",s:/[ⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ]/gi},{l:"hv",s:/ƕ/gi},{l:"i",s:/[ⓘiìíîĩīĭİïḯỉǐȉȋịįḭɨı]/gi},{l:"j",s:/[ⓙjĵǰɉ]/gi},{l:"k",s:/[ⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ]/gi},{l:"l",s:/[ⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇꝆ]/gi},{l:"lj",s:/lj/gi},{l:"m",s:/[ⓜmḿṁṃɱɯ]/gi},{l:"n",s:/[ⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ]/gi},{l:"nj",s:/nj/gi},{l:"o",s:/[ⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔƟꝋꝍɵ]/gi},{l:"oi",s:/ƣ/gi},{l:"oe",s:/œ/gi},{l:"oo",s:/ꝏ/gi},{l:"ou",s:/ȣ/gi},{l:"p",s:/[ⓟpṕṗƥᵽꝑꝓꝕ]/gi},{l:"q",s:/[ⓠqɋꝗꝙ]/gi},{l:"r",s:/[ⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ]/gi},{l:"s",s:/[ⓢsßẞśṥŝṡšṧṣṩșşȿꞩꞅẛ]/gi},{l:"t",s:/[ⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ]/gi},{l:"tz",s:/ꜩ/gi},{l:"u",s:/[ⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ]/gi},{l:"v",s:/[ⓥvṽṿʋꝟʌ]/gi},{l:"vy",s:/ꝡ/gi},{l:"w",s:/[ⓦwẁẃŵẇẅẘẉⱳ]/gi},{l:"x",s:/[ⓧxẋẍ]/gi},{l:"y",s:/[ⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ]/gi},{l:"z",s:/[ⓩzźẑżžẓẕƶȥɀⱬꝣ]/gi}];function c(e,t){var r,n,o,l;try{for(var i=d(e),s=i.next();!s.done;s=i.next()){var a=s.value,u=a.options;if(u)try{for(var c=d(u),p=c.next();!p.done;p=c.next()){var h=p.value;if(h.value===t)return h}}catch(e){o={error:e}}finally{try{p&&!p.done&&(l=c.return)&&l.call(c)}finally{if(o)throw o.error}}else if(a.value===t)return a}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return null}function o(e,t,r){var n,o;if(r){var l=Array.isArray(t)?t:[],i=[];try{for(var s=d(l),a=s.next();!a.done;a=s.next()){var u=c(e,a.value);u&&i.push(u)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}return i}return c(e,t)}function l(e){var t,r,n,o;try{for(var l=d(e),i=l.next();!i.done;i=l.next()){var s=i.value,a=s.options;if(a)try{for(var u=d(a),c=u.next();!c.done;c=u.next()){var p;if(!(p=c.value).disabled)return p.value}}catch(e){n={error:e}}finally{try{c&&!c.done&&(o=u.return)&&o.call(u)}finally{if(n)throw n.error}}else if(!(p=s).disabled)return p.value}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}return null}function a(e,t){var r,n,o,l;if(v(t))return!0;try{for(var i=d(e),s=i.next();!s.done;s=i.next()){var a=s.value,u=a.options;if(u)try{for(var c=d(u),p=c.next();!p.done;p=c.next()){if(p.value.value===t)return!1}}catch(e){o={error:e}}finally{try{p&&!p.done&&(l=c.return)&&l.call(c)}finally{if(o)throw o.error}}else if(a.value===t)return!1}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!0}function u(e,t){for(var r=v(t),n=e.length-1;0<=n;n--){var o=e[n],l=o.options;if(l)for(var i=l.length-1;0<=i;i--){var s=l[i];if(r&&!s.disabled)return s.value;r=s.value===t}else{s=o;if(r&&!s.disabled)return s.value;r=s.value===t}}return r?t:null}function p(e,t){var r,n,o,l,i=v(t);try{for(var s=d(e),a=s.next();!a.done;a=s.next()){var u=a.value,c=u.options;if(c)try{for(var p=d(c),h=p.next();!h.done;h=p.next()){var f=h.value;if(i){if(!f.disabled)return f.value}else i=f.value===t}}catch(e){o={error:e}}finally{try{h&&!h.done&&(l=p.return)&&l.call(p)}finally{if(o)throw o.error}}else{f=u;if(i){if(!f.disabled)return f.value}else i=f.value===t}}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return i?t:null}function v(e){return null==e}function h(e,t,r,n){if(v(e))return t.scrollTop=0;var o,l=function(e,t){var r,n,o=0;try{for(var l=d(e),i=l.next();!i.done;i=l.next()){var s=i.value,a=s.options;if(a){o++;var u=a.findIndex(function(e){return e.value===t});if(-1!==u)return o+u;o+=a.length}else{if(s.value===t)return o;o++}}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}return 0}(r,e);return 5<l-n?(n+=l-n-5,(o=t.querySelectorAll("li").item(l))&&(t.scrollTop=o.offsetTop-t.offsetHeight),n):0<n-l?(n-=n-l,(o=t.querySelectorAll("li").item(n-1))&&(t.scrollTop=o.offsetTop),n):null}function f(e,t,r){return!t||null!==y(e).match(new RegExp(function(e,t){e=y((r=e,r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"))),t&&"function"==typeof t&&(e=t(e));var r;return e}(t,r),"i"))}function y(e){var t,r;try{for(var n=d(i),o=n.next();!o.done;o=n.next()){var l=o.value;e=e.replace(l.s,l.l)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return e}function m(e,t,r){var n,o;if(t){var l=[];try{for(var i=d(e),s=i.next();!s.done;s=i.next()){var a=s.value,u=a.options;if(u){if(u.some(function(e){return f(e.label,t,r)})){var c=u.filter(function(e){return f(e.label,t,r)});l.push({label:a.label,options:c})}}else f(a.label,t,r)&&l.push(a)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}return l}return e}function g(e,t){return e===t?"select2-results__option select2-results__option--highlighted":"select2-results__option"}function S(e){return e?"select2-container select2-container--default select2-container-dropdown select2-container--open":"select2-container select2-container--default select2-container-dropdown"}function x(e,t){return"select2 select2-container select2-container--default "+(e?"select2-container--disabled":"")+" "+(t?"select2-container--open":"")+" select2-container--below select2-container--focus"}function b(e){return"select2-selection select2-selection--"+(e?"multiple":"single")}function E(e,t){return"number"!=typeof t&&(t=6),function(e){var t,r,n=0;try{for(var o=d(e),l=o.next();!l.done;l=o.next()){var i=l.value.options;i?n+=i.length:n++}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return n}(e)<t}function T(e){return e?"select2-search select2-search--dropdown select2-search--hide":"select2-search select2-search--dropdown"}function _(e,t,r){return r?e&&e.some(function(e){return e.value===t.value})?"true":"false":e&&t.value===e.value?"true":"false"}function O(e,t){for(var r=0;r<e.length;r++)if(e[r].value===t.value)return void e.splice(r,1)}var t=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.hoveringValue=null,t.option=null,t.isOpen=!1,t.innerSearchText="",t.lastScrollTopIndex=0,t.onChange=function(e){t.searchText=e.currentTarget.value,t.setState({searchText:t.searchText})},t}return function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(t,e),Object.defineProperty(t.prototype,"searchText",{get:function(){return this.innerSearchText},set:function(e){this.props.customSearchEnabled&&this.props.search&&this.props.search(e),this.innerSearchText=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dropdownStyle",{get:function(){return S(this.isOpen)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"containerStyle",{get:function(){return x(this.props.disabled,this.isOpen)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selectionStyle",{get:function(){return b(this.props.multiple)},enumerable:!0,configurable:!0}),t.prototype.componentWillMount=function(){var e=o(this.props.data,this.props.value,this.props.multiple);null!==e&&(this.option=e,this.setState({option:this.option})),Array.isArray(e)||(this.hoveringValue=this.props.value),this.setState({hoveringValue:this.hoveringValue}),this.isSearchboxHidden=!this.props.customSearchEnabled&&E(this.props.data,this.props.minCountForSearch),this.searchStyle=T(this.isSearchboxHidden)},t.prototype.componentDidMount=function(){this.searchInputElement=r.findDOMNode(this).childNodes[1].childNodes[0].childNodes[0].childNodes[0],this.resultsElement=r.findDOMNode(this).childNodes[1].childNodes[0].childNodes[1].childNodes[0]},t.prototype.render=function(){var t=this,e=this.renderResult(),r=this.renderSelection();return s.createElement("div",{className:this.containerStyle},s.createElement("div",{className:"selection",onClick:function(){return t.toggleOpenAndClose()}},s.createElement("div",{className:this.selectionStyle,role:"combobox"},r)),s.createElement("div",{className:this.dropdownStyle},s.createElement("div",{className:"select2-dropdown select2-dropdown--below"},s.createElement("div",{className:this.searchStyle},s.createElement("input",{value:this.searchText,onChange:this.onChange,onKeyDown:function(e){return t.keyDown(e)},onBlur:function(){return t.focusout()},className:"select2-search__field",type:"search",role:"textbox",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1})),s.createElement("div",{className:"select2-results"},s.createElement("ul",{className:"select2-results__options",role:"tree",tabIndex:-1,onKeyDown:function(e){return t.keyDown(e)},onBlur:function(){return t.focusout()}},e)))))},t.prototype.renderSelection=function(){var r=this;if(this.props.multiple){var e=this.option.map(function(t,e){return s.createElement("li",{className:"select2-selection__choice",title:t.label,key:e},s.createElement("span",{onClick:function(e){return r.removeSelection(e,t)},className:"select2-selection__choice__remove",role:"presentation"},"×"),t.label)});return s.createElement("ul",{className:"select2-selection__rendered"},e)}var t=this.option,n=t?t.component?s.createElement(t.component,{option:t}):t.label:s.createElement("span",{className:"select2-selection__placeholder"},this.props.placeholder);return[s.createElement("span",{key:"label",className:"select2-selection__rendered",title:t?t.label:""},n),s.createElement("span",{key:"arrow",className:"select2-selection__arrow",role:"presentation"},s.createElement("b",{role:"presentation"}))]},t.prototype.renderResult=function(){var i=this;return this.getFilteredData(!1).map(function(e,t){var r=e.options;if(r){var n=r.map(function(e,t){var r=e.component?s.createElement(e.component,{option:e}):e.label;return s.createElement("li",{className:i.getOptionStyle(e.value),key:t,role:"treeitem","aria-selected":i.isSelected(e),"aria-disabled":i.isDisabled(e),onMouseEnter:function(){return i.mouseenter(e)},onClick:function(){return i.click(e)}},r)});return s.createElement("li",{className:"select2-results__option",role:"group",key:t},s.createElement("strong",{className:"select2-results__group"},e.label),s.createElement("ul",{className:"select2-results__options select2-results__options--nested"},n))}var o=e,l=o.component?s.createElement(o.component,{option:o}):o.label;return s.createElement("li",{className:i.getOptionStyle(o.value),key:t,role:"treeitem","aria-selected":i.isSelected(o),"aria-disabled":i.isDisabled(o),onMouseEnter:function(){return i.mouseenter(o)},onClick:function(){return i.click(o)}},l)})},t.prototype.getFilteredData=function(e){var t=this.props.customSearchEnabled?this.props.data:m(this.props.data,this.searchText);if(a(t,this.hoveringValue)&&(this.hoveringValue=l(t),e&&this.setState({hoveringValue:this.hoveringValue}),this.resultsElement)){var r=h(this.hoveringValue,this.resultsElement,t,this.lastScrollTopIndex);null!==r&&(this.lastScrollTopIndex=r,e&&this.setState({lastScrollTopIndex:this.lastScrollTopIndex}))}return t},t.prototype.getOptionStyle=function(e){return g(e,this.hoveringValue)},t.prototype.mouseenter=function(e){e.disabled||(this.hoveringValue=e.value,this.setState({hoveringValue:this.hoveringValue}))},t.prototype.click=function(e){e.disabled||this.select(e),this.focusoutTimer&&clearTimeout(this.focusoutTimer)},t.prototype.toggleOpenAndClose=function(){var t=this;this.props.disabled||(this.isOpen=!this.isOpen,this.setState({isOpen:this.isOpen}),this.isOpen&&(this.innerSearchText="",this.setState({searchText:this.searchText},function(){if(t.focusSearchboxOrResultsElement(),t.resultsElement){var e=h(t.hoveringValue,t.resultsElement,t.props.data,t.lastScrollTopIndex);null!==e&&(t.lastScrollTopIndex=e)}}),this.props.open&&this.props.open()),this.focusoutTimer&&clearTimeout(this.focusoutTimer))},t.prototype.focusout=function(){var e=this;this.focusoutTimer=setTimeout(function(){e.isOpen=!1,e.setState({isOpen:e.isOpen}),e.focusoutTimer=void 0},200)},t.prototype.moveUp=function(){if(this.hoveringValue=u(this.getFilteredData(!0),this.hoveringValue),this.setState({hoveringValue:this.hoveringValue}),this.resultsElement){var e=h(this.hoveringValue,this.resultsElement,this.getFilteredData(!0),this.lastScrollTopIndex);null!==e&&(this.lastScrollTopIndex=e,this.setState({lastScrollTopIndex:this.lastScrollTopIndex}))}},t.prototype.moveDown=function(){if(this.hoveringValue=p(this.getFilteredData(!0),this.hoveringValue),this.setState({hoveringValue:this.hoveringValue}),this.resultsElement){var e=h(this.hoveringValue,this.resultsElement,this.getFilteredData(!0),this.lastScrollTopIndex);null!==e&&(this.lastScrollTopIndex=e,this.setState({lastScrollTopIndex:this.lastScrollTopIndex}))}},t.prototype.selectByEnter=function(){if(this.hoveringValue){var e=c(this.props.data,this.hoveringValue);this.select(e)}},t.prototype.select=function(t){if(null!==t)if(this.props.multiple){var e=this.option,r=e.findIndex(function(e){return e.value===t.value});-1===r?e.push(t):e.splice(r,1),this.setState({option:this.option})}else this.option=t,this.isOpen=!1,this.setState({option:this.option,isOpen:this.isOpen});this.props.update&&this.props.update(this.props.multiple?this.option.map(function(e){return e.value}):this.option.value)},t.prototype.keyDown=function(e){40===e.keyCode?(this.moveDown(),e.preventDefault()):38===e.keyCode?(this.moveUp(),e.preventDefault()):13===e.keyCode&&(this.selectByEnter(),e.preventDefault())},t.prototype.isSelected=function(e){return _(this.option,e,this.props.multiple)},t.prototype.isDisabled=function(e){return e.disabled?"true":"false"},t.prototype.focusSearchboxOrResultsElement=function(){this.isSearchboxHidden?this.resultsElement&&this.resultsElement.focus():this.searchInputElement&&this.searchInputElement.focus()},t.prototype.removeSelection=function(e,t){var r=this;O(this.option,t),this.props.update&&this.props.update(this.option.map(function(e){return e.value})),e.preventDefault(),e.stopPropagation(),this.isOpen&&this.setState({option:this.option},function(){r.focusSearchboxOrResultsElement()}),this.focusoutTimer&&clearTimeout(this.focusoutTimer)},t}(s.PureComponent);e.Select2=t,e.timeout=200,e.getOptionByValue=c,e.getOptionsByValue=o,e.getFirstAvailableOption=l,e.valueIsNotInFilteredData=a,e.getPreviousOption=u,e.getNextOption=p,e.getLastScrollTopIndex=h,e.getFilteredData=m,e.getOptionStyle=g,e.getDropdownStyle=S,e.getContainerStyle=x,e.getSelectionStyle=b,e.isSearchboxHiddex=E,e.getSearchStyle=T,e.isSelected=_,e.removeSelection=O,Object.defineProperty(e,"__esModule",{value:!0})}); |
{ | ||
"name": "select2-react-component", | ||
"version": "5.3.0", | ||
"version": "5.4.0", | ||
"description": "A reactjs select component.", | ||
@@ -25,9 +25,9 @@ "main": "dist/index.js", | ||
"@types/node": "*", | ||
"react": "15 || 16", | ||
"react-dom": "15 || 16", | ||
"select2-component": "^5.3.0" | ||
"react": "16", | ||
"react-dom": "16", | ||
"select2-component": "^5.4.0" | ||
}, | ||
"devDependencies": { | ||
"@types/react": "16.3.10", | ||
"@types/react-dom": "16.0.5" | ||
"@types/react": "16.4.6", | ||
"@types/react-dom": "16.0.6" | ||
}, | ||
@@ -34,0 +34,0 @@ "peerDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32910
433
Updatedreact@16
Updatedreact-dom@16
Updatedselect2-component@^5.4.0