select2-component
Advanced tools
Comparing version 4.0.3 to 4.0.4
{ | ||
"name": "select2-component", | ||
"version": "4.0.3", | ||
"version": "4.0.4", | ||
"description": "A vuejs, reactjs and angular select component.", | ||
@@ -5,0 +5,0 @@ "scripts": { |
12
react.js
@@ -101,12 +101,12 @@ "use strict"; | ||
var _this = this; | ||
var results = this.filteredData.map(function (groupOrOption) { | ||
var results = this.filteredData.map(function (groupOrOption, i) { | ||
var options = groupOrOption.options; | ||
if (options) { | ||
var optionsElements = options.map(function (option) { | ||
var optionsElements = options.map(function (option, j) { | ||
var optionElement = option.component | ||
? React.createElement(option.component, { option: option }) | ||
: option.label; | ||
return (React.createElement("li", { className: _this.getOptionStyle(option.value), 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" }, | ||
return (React.createElement("li", { className: "select2-results__option", role: "group", key: i }, | ||
React.createElement("strong", { className: "select2-results__group" }, groupOrOption.label), | ||
@@ -120,3 +120,3 @@ React.createElement("ul", { className: "select2-results__options select2-results__options--nested" }, optionsElements))); | ||
: option_1.label; | ||
return (React.createElement("li", { className: _this.getOptionStyle(option_1.value), 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)); | ||
} | ||
@@ -126,3 +126,3 @@ }); | ||
if (this.props.multiple) { | ||
var items = this.option.map(function (op) { return (React.createElement("li", { className: "select2-selection__choice", title: op.label }, | ||
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"), | ||
@@ -129,0 +129,0 @@ op.label)); }); |
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
220283