select2-react-component
Advanced tools
Comparing version 5.1.2 to 5.1.3
/// <reference types="react" /> | ||
import * as React from "react"; | ||
import * as common from "select2-component"; | ||
export * from "select2-component"; | ||
import * as React from 'react'; | ||
import * as common from 'select2-component'; | ||
export * from 'select2-component'; | ||
/** | ||
@@ -6,0 +6,0 @@ * @public |
@@ -1,11 +0,10 @@ | ||
"use strict"; | ||
import * as tslib_1 from "tslib"; | ||
import * as React from "react"; | ||
import * as ReactDOM from "react-dom"; | ||
import * as common from "select2-component"; | ||
export * from "select2-component"; | ||
import * as React from 'react'; | ||
import * as ReactDOM from 'react-dom'; | ||
import * as common from 'select2-component'; | ||
export * from 'select2-component'; | ||
/** | ||
* @public | ||
*/ | ||
var Select2 = (function (_super) { | ||
var Select2 = /** @class */ (function (_super) { | ||
tslib_1.__extends(Select2, _super); | ||
@@ -17,3 +16,3 @@ function Select2() { | ||
_this.isOpen = false; | ||
_this.innerSearchText = ""; | ||
_this.innerSearchText = ''; | ||
_this.lastScrollTopIndex = 0; | ||
@@ -88,7 +87,7 @@ _this.onChange = function (e) { | ||
: option.label; | ||
return (React.createElement("li", { className: _this.getOptionStyle(option.value), key: j, role: "treeitem", "aria-selected": _this.isSelected(option), "aria-disabled": _this.isDisabled(option), onMouseEnter: function () { return _this.mouseenter(option); }, onClick: function () { return _this.click(option); } }, optionElement)); | ||
return (React.createElement("li", { className: _this.getOptionStyle(option.value), key: j, role: 'treeitem', "aria-selected": _this.isSelected(option), "aria-disabled": _this.isDisabled(option), onMouseEnter: function () { return _this.mouseenter(option); }, onClick: function () { return _this.click(option); } }, optionElement)); | ||
}); | ||
return (React.createElement("li", { className: "select2-results__option", role: "group", key: i }, | ||
React.createElement("strong", { className: "select2-results__group" }, groupOrOption.label), | ||
React.createElement("ul", { className: "select2-results__options select2-results__options--nested" }, optionsElements))); | ||
return (React.createElement("li", { className: 'select2-results__option', role: 'group', key: i }, | ||
React.createElement("strong", { className: 'select2-results__group' }, groupOrOption.label), | ||
React.createElement("ul", { className: 'select2-results__options select2-results__options--nested' }, optionsElements))); | ||
} | ||
@@ -100,3 +99,3 @@ else { | ||
: option_1.label; | ||
return (React.createElement("li", { className: _this.getOptionStyle(option_1.value), key: i, role: "treeitem", "aria-selected": _this.isSelected(option_1), "aria-disabled": _this.isDisabled(option_1), onMouseEnter: function () { return _this.mouseenter(option_1); }, onClick: function () { return _this.click(option_1); } }, optionElement)); | ||
return (React.createElement("li", { className: _this.getOptionStyle(option_1.value), key: i, role: 'treeitem', "aria-selected": _this.isSelected(option_1), "aria-disabled": _this.isDisabled(option_1), onMouseEnter: function () { return _this.mouseenter(option_1); }, onClick: function () { return _this.click(option_1); } }, optionElement)); | ||
} | ||
@@ -106,6 +105,6 @@ }); | ||
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"), | ||
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)); | ||
selection = (React.createElement("ul", { className: 'select2-selection__rendered' }, items)); | ||
} | ||
@@ -116,18 +115,18 @@ else { | ||
? (option.component ? React.createElement(option.component, { option: option }) : option.label) | ||
: React.createElement("span", { className: "select2-selection__placeholder" }, this.props.placeholder); | ||
: 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" })), | ||
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: '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: '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)))))); | ||
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)))))); | ||
}; | ||
@@ -180,3 +179,3 @@ Select2.prototype.getFilteredData = function (canSetState) { | ||
if (this.isOpen) { | ||
this.innerSearchText = ""; | ||
this.innerSearchText = ''; | ||
this.setState({ searchText: this.searchText }, function () { | ||
@@ -262,3 +261,3 @@ if (!_this.isSearchboxHidden) { | ||
this.setState({ | ||
option: this.option, | ||
option: this.option | ||
}); | ||
@@ -271,3 +270,3 @@ } | ||
option: this.option, | ||
isOpen: this.isOpen, | ||
isOpen: this.isOpen | ||
}); | ||
@@ -298,3 +297,3 @@ } | ||
Select2.prototype.isDisabled = function (option) { | ||
return option.disabled ? "true" : "false"; | ||
return option.disabled ? 'true' : 'false'; | ||
}; | ||
@@ -301,0 +300,0 @@ Select2.prototype.removeSelection = function (e, option) { |
{ | ||
"name": "select2-react-component", | ||
"version": "5.1.2", | ||
"version": "5.1.3", | ||
"description": "A reactjs select component.", | ||
@@ -24,7 +24,7 @@ "main": "dist/index.js", | ||
"react-dom": "15 || 16", | ||
"select2-component": "^5.1.2" | ||
"select2-component": "^5.1.3" | ||
}, | ||
"devDependencies": { | ||
"@types/react": "16.0.34", | ||
"@types/react-dom": "16.0.3" | ||
"@types/react": "16.0.38", | ||
"@types/react-dom": "16.0.4" | ||
}, | ||
@@ -35,4 +35,4 @@ "peerDependencies": { | ||
"react-dom": "15 || 16", | ||
"select2-component": "^5.1.2" | ||
"select2-component": "^5.1.3" | ||
} | ||
} |
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
17032
374
Updatedselect2-component@^5.1.3