react-dropdown
Advanced tools
Comparing version 1.4.2 to 1.5.0
@@ -43,3 +43,3 @@ 'use strict'; | ||
selected: props.value || { | ||
label: props.placeholder || DEFAULT_PLACEHOLDER_STRING, | ||
label: typeof props.placeholder === 'undefined' ? DEFAULT_PLACEHOLDER_STRING : props.placeholder, | ||
value: '' | ||
@@ -62,3 +62,3 @@ }, | ||
this.setState({ selected: { | ||
label: newProps.placeholder || DEFAULT_PLACEHOLDER_STRING, | ||
label: typeof newProps.placeholder === 'undefined' ? DEFAULT_PLACEHOLDER_STRING : newProps.placeholder, | ||
value: '' | ||
@@ -193,6 +193,7 @@ } }); | ||
value: function render() { | ||
var _classNames, _classNames2, _classNames3, _classNames4; | ||
var _classNames, _classNames2, _classNames3, _classNames4, _classNames5; | ||
var _props2 = this.props, | ||
baseClassName = _props2.baseClassName, | ||
controlClassName = _props2.controlClassName, | ||
placeholderClassName = _props2.placeholderClassName, | ||
@@ -208,5 +209,6 @@ menuClassName = _props2.menuClassName, | ||
var dropdownClass = (0, _classnames2.default)((_classNames = {}, _defineProperty(_classNames, baseClassName + '-root', true), _defineProperty(_classNames, className, !!className), _defineProperty(_classNames, 'is-open', this.state.isOpen), _classNames)); | ||
var placeholderClass = (0, _classnames2.default)((_classNames2 = {}, _defineProperty(_classNames2, baseClassName + '-placeholder', true), _defineProperty(_classNames2, placeholderClassName, !!placeholderClassName), _classNames2)); | ||
var menuClass = (0, _classnames2.default)((_classNames3 = {}, _defineProperty(_classNames3, baseClassName + '-menu', true), _defineProperty(_classNames3, menuClassName, !!menuClassName), _classNames3)); | ||
var arrowClass = (0, _classnames2.default)((_classNames4 = {}, _defineProperty(_classNames4, baseClassName + '-arrow', true), _defineProperty(_classNames4, arrowClassName, !!arrowClassName), _classNames4)); | ||
var controlClass = (0, _classnames2.default)((_classNames2 = {}, _defineProperty(_classNames2, baseClassName + '-control', true), _defineProperty(_classNames2, controlClassName, !!controlClassName), _defineProperty(_classNames2, disabledClass, !!disabledClass), _classNames2)); | ||
var placeholderClass = (0, _classnames2.default)((_classNames3 = {}, _defineProperty(_classNames3, baseClassName + '-placeholder', true), _defineProperty(_classNames3, placeholderClassName, !!placeholderClassName), _classNames3)); | ||
var menuClass = (0, _classnames2.default)((_classNames4 = {}, _defineProperty(_classNames4, baseClassName + '-menu', true), _defineProperty(_classNames4, menuClassName, !!menuClassName), _classNames4)); | ||
var arrowClass = (0, _classnames2.default)((_classNames5 = {}, _defineProperty(_classNames5, baseClassName + '-arrow', true), _defineProperty(_classNames5, arrowClassName, !!arrowClassName), _classNames5)); | ||
@@ -229,3 +231,3 @@ var value = _react2.default.createElement( | ||
'div', | ||
{ className: baseClassName + '-control ' + disabledClass, onMouseDown: this.handleMouseDown.bind(this), onTouchEnd: this.handleMouseDown.bind(this) }, | ||
{ className: controlClass, onMouseDown: this.handleMouseDown.bind(this), onTouchEnd: this.handleMouseDown.bind(this) }, | ||
value, | ||
@@ -232,0 +234,0 @@ _react2.default.createElement('span', { className: arrowClass }) |
@@ -17,4 +17,6 @@ declare module "react-dropdown" { | ||
className?: string; | ||
controlClassName?: string; | ||
placeholderClassName?: string; | ||
menuClassName?: string; | ||
arrowClassName?: string; | ||
disabled?: boolean; | ||
@@ -21,0 +23,0 @@ onChange?: (arg: Option) => void; |
{ | ||
"name": "react-dropdown", | ||
"version": "1.4.2", | ||
"version": "1.5.0", | ||
"description": "React dropdown component", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -19,3 +19,6 @@ react-dropdown | ||
``` | ||
//with npm | ||
$ npm install react-dropdown --save | ||
//with yarn | ||
$ yarn add react-dropdown | ||
``` | ||
@@ -87,2 +90,8 @@ | ||
The `controlClassName` prop is passed down to the control `div`, which also has the `Dropdown-control` class. | ||
```JavaScript | ||
<Dropdown controlClassName='myControlClassName' /> | ||
``` | ||
The `placeholderClassName` prop is passed down to the placeholder `div`, which also has the `Dropdown-placeholder` class. | ||
@@ -89,0 +98,0 @@ |
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
18549
319
129