react-selectize
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -28,1 +28,6 @@ # React Selectize | ||
* changed the signature of renderOption & renderValue props from `Int -> Item -> ReactElement` to `Item -> ReactElement` | ||
## v0.2.1 / 20th September 2015 | ||
* fixed React Warnings caused by missing key property for ValueWrapper components | ||
* allowing for wide range of react versions including 0.14.x-rc* | ||
* uid property for MultiSelect components |
{ | ||
"name": "react-selectize", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "react implementation of selectize", | ||
@@ -13,3 +13,3 @@ "main": "src/index.js", | ||
"prelude-ls": "^1.1.1", | ||
"react": "^0.13.1" | ||
"react": ">=0.13.3 || ^0.14.0-beta" | ||
}, | ||
@@ -31,2 +31,3 @@ "devDependencies": { | ||
"jquery-browserify": "^1.8.1", | ||
"jsdom": "^3.1.2", | ||
"liveify": "^2.0.0", | ||
@@ -33,0 +34,0 @@ "livescript": "^1.4.0", |
@@ -37,5 +37,5 @@ (function(){ | ||
render: function(){ | ||
var ref$, anchor, search, values, onAnchorChange, onSearchChange, onValuesChange, filteredOptions, options, autosize, disabled, dropdownDirection, groupId, groups, groupsAsColumns, renderGroupTitle, this$ = this; | ||
var ref$, anchor, search, values, onAnchorChange, onSearchChange, onValuesChange, filteredOptions, options, autosize, disabled, dropdownDirection, groupId, groups, groupsAsColumns, renderGroupTitle, uid, this$ = this; | ||
ref$ = this.getComputedState(), anchor = ref$.anchor, search = ref$.search, values = ref$.values, onAnchorChange = ref$.onAnchorChange, onSearchChange = ref$.onSearchChange, onValuesChange = ref$.onValuesChange, filteredOptions = ref$.filteredOptions, options = ref$.options; | ||
ref$ = this.props, autosize = ref$.autosize, disabled = ref$.disabled, dropdownDirection = ref$.dropdownDirection, groupId = ref$.groupId, groups = ref$.groups, groupsAsColumns = ref$.groupsAsColumns, renderGroupTitle = ref$.renderGroupTitle; | ||
ref$ = this.props, autosize = ref$.autosize, disabled = ref$.disabled, dropdownDirection = ref$.dropdownDirection, groupId = ref$.groupId, groups = ref$.groups, groupsAsColumns = ref$.groupsAsColumns, renderGroupTitle = ref$.renderGroupTitle, uid = ref$.uid; | ||
return ReactSelectize(import$({ | ||
@@ -50,2 +50,3 @@ autosize: autosize, | ||
renderGroupTitle: renderGroupTitle, | ||
uid: uid, | ||
ref: 'select', | ||
@@ -52,0 +53,0 @@ anchor: anchor, |
(function(){ | ||
var ref$, each, filter, find, findIndex, initial, last, map, objToPairs, partition, reject, reverse, sortBy, sum, clamp, isEqualToObject, React, div, input, span, createClass, createFactory, cancelEvent, OptionWrapper, ValueWrapper; | ||
var ref$, each, filter, find, findIndex, initial, last, map, objToPairs, partition, reject, reverse, sortBy, sum, clamp, isEqualToObject, React, div, input, span, createClass, createFactory, findDOMNode, cancelEvent, OptionWrapper, ValueWrapper; | ||
ref$ = require('prelude-ls'), each = ref$.each, filter = ref$.filter, find = ref$.find, findIndex = ref$.findIndex, initial = ref$.initial, last = ref$.last, map = ref$.map, objToPairs = ref$.objToPairs, partition = ref$.partition, reject = ref$.reject, reverse = ref$.reverse, sortBy = ref$.sortBy, sum = ref$.sum; | ||
ref$ = require('prelude-extension'), clamp = ref$.clamp, isEqualToObject = ref$.isEqualToObject; | ||
React = require('react'), ref$ = React.DOM, div = ref$.div, input = ref$.input, span = ref$.span, createClass = React.createClass, createFactory = React.createFactory; | ||
React = require('react'), ref$ = React.DOM, div = ref$.div, input = ref$.input, span = ref$.span, createClass = React.createClass, createFactory = React.createFactory, findDOMNode = React.findDOMNode; | ||
cancelEvent = function(e){ | ||
@@ -130,3 +130,3 @@ e.preventDefault(); | ||
render: function(){ | ||
var anchorIndex, renderOptions, ref$, ref1$, groups, this$ = this; | ||
var anchorIndex, renderSelectedValues, renderOptions, ref$, ref1$, groups, this$ = this; | ||
anchorIndex = (function(){ | ||
@@ -145,2 +145,16 @@ var ref$; | ||
}.call(this)); | ||
renderSelectedValues = function(it){ | ||
return map(function(index){ | ||
var item, uid; | ||
item = this$.props.values[index]; | ||
uid = this$.props.uid(item); | ||
return ValueWrapper({ | ||
uid: uid, | ||
key: uid, | ||
item: item, | ||
renderItem: this$.props.renderValue | ||
}); | ||
})( | ||
it); | ||
}; | ||
return div({ | ||
@@ -161,12 +175,3 @@ className: ("react-selectize \n" + this.props.className + " \n" + (this.props.disabled ? 'disabled' : '') + " \n" + (this.props.open ? 'open' : '') + " \n" + (this.props.dropdownDirection === -1 ? 'flipped' : '')).replace(/\s+/g, ' '), | ||
className: 'placeholder' | ||
}, this.props.placeholder) : void 8, map(function(index){ | ||
var item; | ||
item = this$.props.values[index]; | ||
return ValueWrapper({ | ||
uid: this$.props.uid(item), | ||
item: item, | ||
renderItem: this$.props.renderValue | ||
}); | ||
})( | ||
(function(){ | ||
}, this.props.placeholder) : void 8, renderSelectedValues((function(){ | ||
var i$, to$, results$ = []; | ||
@@ -315,12 +320,3 @@ for (i$ = 0, to$ = anchorIndex; i$ <= to$; ++i$) { | ||
} | ||
}), map(function(index){ | ||
var item; | ||
item = this$.props.values[index]; | ||
return ValueWrapper({ | ||
uid: this$.props.uid(item), | ||
item: item, | ||
renderItem: this$.props.renderValue | ||
}); | ||
})( | ||
(function(){ | ||
}), renderSelectedValues((function(){ | ||
var i$, to$, results$ = []; | ||
@@ -460,3 +456,3 @@ for (i$ = anchorIndex + 1, to$ = this.props.values.length; i$ < to$; ++i$) { | ||
} | ||
if (element === this$.getDOMNode()) { | ||
if (element === findDOMNode(this$)) { | ||
return true; | ||
@@ -485,7 +481,7 @@ } | ||
} | ||
x$ = $search = this.refs.search.getDOMNode(); | ||
x$ = $search = findDOMNode(this.refs.search); | ||
x$.style.width = 0; | ||
x$.style.width = this.props.autosize($search); | ||
if (!!this.refs.dropdown) { | ||
this.refs.dropdown.getDOMNode().style.bottom = this.props.dropdownDirection === -1 ? this.refs.control.getDOMNode().offsetHeight : ""; | ||
findDOMNode(this.refs.dropdown).style.bottom = this.props.dropdownDirection === -1 ? findDOMNode(this.refs.control).offsetHeight : ""; | ||
} | ||
@@ -506,9 +502,9 @@ }, | ||
blur: function(){ | ||
this.refs.search.getDOMNode().blur(); | ||
findDOMNode(this.refs.search).blur(); | ||
this.props.onBlur(this.props.values, 'blur'); | ||
}, | ||
focus: function(){ | ||
if (this.refs.search.getDOMNode() !== document.activeElement) { | ||
if (findDOMNode(this.refs.search) !== document.activeElement) { | ||
this.focusLock = true; | ||
this.refs.search.getDOMNode().focus(); | ||
findDOMNode(this.refs.search).focus(); | ||
} | ||
@@ -521,6 +517,6 @@ }, | ||
var ref$, ref1$, optionElement, parentElement, optionHeight; | ||
if ((ref$ = (ref1$ = this$.refs) != null ? ref1$["option-" + uid].getDOMNode() : void 8) != null) { | ||
if ((ref$ = findDOMNode((ref1$ = this$.refs) != null ? ref1$["option-" + uid] : void 8)) != null) { | ||
optionElement = ref$; | ||
} | ||
parentElement = this$.refs.dropdown.getDOMNode(); | ||
parentElement = findDOMNode(this$.refs.dropdown); | ||
if (!!optionElement) { | ||
@@ -527,0 +523,0 @@ optionHeight = optionElement.offsetHeight - 1; |
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
84067
22
1781
+ Addedjs-tokens@4.0.0(transitive)
+ Addedloose-envify@1.4.0(transitive)
+ Addedreact@18.3.1(transitive)
- Removedacorn@5.7.4(transitive)
- Removedamdefine@1.0.1(transitive)
- Removedast-types@0.9.6(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedbase62@1.2.8(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedcommander@2.20.3(transitive)
- Removedcommoner@0.10.8(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removeddefined@1.0.1(transitive)
- Removeddetective@4.7.1(transitive)
- Removedenvify@3.4.1(transitive)
- Removedesprima@3.1.3(transitive)
- Removedesprima-fb@15001.1.0-dev-harmony-fb(transitive)
- Removedglob@5.0.15(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removediconv-lite@0.4.24(transitive)
- Removedinflight@1.0.6(transitive)
- Removedinherits@2.0.4(transitive)
- Removedjstransform@11.0.3(transitive)
- Removedminimatch@3.1.2(transitive)
- Removedminimist@1.2.8(transitive)
- Removedmkdirp@0.5.6(transitive)
- Removedobject-assign@2.1.1(transitive)
- Removedonce@1.4.0(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedprivate@0.1.8(transitive)
- Removedq@1.5.1(transitive)
- Removedreact@0.13.3(transitive)
- Removedrecast@0.11.23(transitive)
- Removedsafer-buffer@2.1.2(transitive)
- Removedsource-map@0.4.40.5.7(transitive)
- Removedthrough@2.3.8(transitive)
- Removedwrappy@1.0.2(transitive)