Skip to content

Commit

Permalink
Updated dist + build files
Browse files Browse the repository at this point in the history
  • Loading branch information
dcneiner committed Mar 23, 2016
1 parent de738b3 commit d35d7d0
Show file tree
Hide file tree
Showing 13 changed files with 263 additions and 158 deletions.
1 change: 1 addition & 0 deletions dist/react-select.css → dist/@lk/react-select.css
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
vertical-align: middle;
}
.Select-input > input {
width: 100%;
background: none transparent;
border: 0 none;
box-shadow: none;
Expand Down
73 changes: 58 additions & 15 deletions dist/react-select.js → dist/@lk/react-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ var Select = _react2['default'].createClass({

propTypes: {
addLabelText: _react2['default'].PropTypes.string, // placeholder displayed when you want to add a label on a multi-value input
autosize: _react2['default'].PropTypes.bool, // whether to enable autosizing or not
allowCreate: _react2['default'].PropTypes.bool, // whether to allow creation of new entries
autoBlur: _react2['default'].PropTypes.bool,
autofocus: _react2['default'].PropTypes.bool, // autofocus the component on mount
Expand All @@ -355,6 +356,7 @@ var Select = _react2['default'].createClass({
ignoreCase: _react2['default'].PropTypes.bool, // whether to perform case-insensitive filtering
inputProps: _react2['default'].PropTypes.object, // custom attributes for the Input
isLoading: _react2['default'].PropTypes.bool, // whether the Select is loading externally or not (such as options being loaded)
joinValues: _react2['default'].PropTypes.bool, // joins multiple values into a single form field with the delimiter (legacy mode)
labelKey: _react2['default'].PropTypes.string, // path of the label value in option objects
matchPos: _react2['default'].PropTypes.string, // (any|start) match the start or entire string when filtering
matchProp: _react2['default'].PropTypes.string, // (any|label|value) which option property to filter on
Expand Down Expand Up @@ -396,6 +398,7 @@ var Select = _react2['default'].createClass({
getDefaultProps: function getDefaultProps() {
return {
addLabelText: 'Add "{label}"?',
autosize: true,
allowCreate: false,
backspaceRemoves: true,
clearable: true,
Expand All @@ -409,6 +412,7 @@ var Select = _react2['default'].createClass({
ignoreCase: true,
inputProps: {},
isLoading: false,
joinValues: false,
labelKey: 'label',
matchPos: 'any',
matchProp: 'any',
Expand Down Expand Up @@ -444,6 +448,14 @@ var Select = _react2['default'].createClass({
}
},

componentWillReceiveProps: function componentWillReceiveProps(nextProps) {
if (this.props.value !== nextProps.value && nextProps.required) {
this.setState({
required: this.handleRequired(nextProps.value, nextProps.multi)
});
}
},

componentWillUpdate: function componentWillUpdate(nextProps, nextState) {
if (nextState.isOpen !== this.state.isOpen) {
var handler = nextState.isOpen ? nextProps.onOpen : nextProps.onClose;
Expand Down Expand Up @@ -609,6 +621,7 @@ var Select = _react2['default'].createClass({

handleInputBlur: function handleInputBlur(event) {
if (this.refs.menu && document.activeElement.isEqualNode(this.refs.menu)) {
this.refs.input.focus();
return;
}

Expand Down Expand Up @@ -930,17 +943,32 @@ var Select = _react2['default'].createClass({
ref: 'input',
style: { border: 0, width: 1, display: 'inline-block' } }));
}
return _react2['default'].createElement(_reactInputAutosize2['default'], _extends({}, this.props.inputProps, {
className: className,
tabIndex: this.props.tabIndex,
onBlur: this.handleInputBlur,
onChange: this.handleInputChange,
onFocus: this.handleInputFocus,
minWidth: '5',
ref: 'input',
required: this.state.required,
value: this.state.inputValue
}));
if (this.props.autosize) {
return _react2['default'].createElement(_reactInputAutosize2['default'], _extends({}, this.props.inputProps, {
className: className,
tabIndex: this.props.tabIndex,
onBlur: this.handleInputBlur,
onChange: this.handleInputChange,
onFocus: this.handleInputFocus,
minWidth: '5',
ref: 'input',
required: this.state.required,
value: this.state.inputValue
}));
}
return _react2['default'].createElement(
'div',
{ className: className },
_react2['default'].createElement('input', _extends({}, this.props.inputProps, {
tabIndex: this.props.tabIndex,
onBlur: this.handleInputBlur,
onChange: this.handleInputChange,
onFocus: this.handleInputFocus,
ref: 'input',
required: this.state.required,
value: this.state.inputValue
}))
);
},

renderClear: function renderClear() {
Expand Down Expand Up @@ -1058,10 +1086,25 @@ var Select = _react2['default'].createClass({
var _this5 = this;

if (!this.props.name) return;
var value = valueArray.map(function (i) {
return stringifyValue(i[_this5.props.valueKey]);
}).join(this.props.delimiter);
return _react2['default'].createElement('input', { type: 'hidden', ref: 'value', name: this.props.name, value: value, disabled: this.props.disabled });
if (this.props.joinValues) {
var value = valueArray.map(function (i) {
return stringifyValue(i[_this5.props.valueKey]);
}).join(this.props.delimiter);
return _react2['default'].createElement('input', {
type: 'hidden',
ref: 'value',
name: this.props.name,
value: value,
disabled: this.props.disabled });
}
return valueArray.map(function (item, index) {
return _react2['default'].createElement('input', { key: 'hidden.' + index,
type: 'hidden',
ref: 'value' + index,
name: _this5.props.name,
value: stringifyValue(item[_this5.props.valueKey]),
disabled: _this5.props.disabled });
});
},

getFocusableOption: function getFocusableOption(selectedOption) {
Expand Down
1 change: 1 addition & 0 deletions dist/@lk/react-select.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions dist/@lk/react-select.min.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion dist/react-select.min.css

This file was deleted.

1 change: 0 additions & 1 deletion dist/react-select.min.js

This file was deleted.

Loading

0 comments on commit d35d7d0

Please sign in to comment.