Add files
This commit is contained in:
commit
bb80829159
18195 changed files with 2122994 additions and 0 deletions
8
509bba0_unpacked_with_node_modules/~/react-select-1/index.js
generated
vendored
Executable file
8
509bba0_unpacked_with_node_modules/~/react-select-1/index.js
generated
vendored
Executable file
|
@ -0,0 +1,8 @@
|
|||
module.exports = require('react-select');
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-select-1/index.js
|
||||
// module id = 700
|
||||
// module chunks = 4
|
172
509bba0_unpacked_with_node_modules/~/react-select-1/~/react-input-autosize/lib/AutosizeInput.js
generated
vendored
Executable file
172
509bba0_unpacked_with_node_modules/~/react-select-1/~/react-input-autosize/lib/AutosizeInput.js
generated
vendored
Executable file
|
@ -0,0 +1,172 @@
|
|||
'use strict';
|
||||
|
||||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
||||
|
||||
var React = require('react');
|
||||
var PropTypes = require('prop-types');
|
||||
var createClass = require('create-react-class');
|
||||
|
||||
var sizerStyle = {
|
||||
position: 'absolute',
|
||||
top: 0,
|
||||
left: 0,
|
||||
visibility: 'hidden',
|
||||
height: 0,
|
||||
overflow: 'scroll',
|
||||
whiteSpace: 'pre'
|
||||
};
|
||||
|
||||
var AutosizeInput = createClass({
|
||||
propTypes: {
|
||||
className: PropTypes.string, // className for the outer element
|
||||
defaultValue: PropTypes.any, // default field value
|
||||
inputClassName: PropTypes.string, // className for the input element
|
||||
inputStyle: PropTypes.object, // css styles for the input element
|
||||
minWidth: PropTypes.oneOfType([// minimum width for input element
|
||||
PropTypes.number, PropTypes.string]),
|
||||
onAutosize: PropTypes.func, // onAutosize handler: function(newWidth) {}
|
||||
onChange: PropTypes.func, // onChange handler: function(newValue) {}
|
||||
placeholder: PropTypes.string, // placeholder text
|
||||
placeholderIsMinWidth: PropTypes.bool, // don't collapse size to less than the placeholder
|
||||
style: PropTypes.object, // css styles for the outer element
|
||||
value: PropTypes.any },
|
||||
// field value
|
||||
getDefaultProps: function getDefaultProps() {
|
||||
return {
|
||||
minWidth: 1
|
||||
};
|
||||
},
|
||||
getInitialState: function getInitialState() {
|
||||
return {
|
||||
inputWidth: this.props.minWidth
|
||||
};
|
||||
},
|
||||
componentDidMount: function componentDidMount() {
|
||||
this.mounted = true;
|
||||
this.copyInputStyles();
|
||||
this.updateInputWidth();
|
||||
},
|
||||
componentDidUpdate: function componentDidUpdate(prevProps, prevState) {
|
||||
if (prevState.inputWidth !== this.state.inputWidth) {
|
||||
if (typeof this.props.onAutosize === 'function') {
|
||||
this.props.onAutosize(this.state.inputWidth);
|
||||
}
|
||||
}
|
||||
this.updateInputWidth();
|
||||
},
|
||||
componentWillUnmount: function componentWillUnmount() {
|
||||
this.mounted = false;
|
||||
},
|
||||
inputRef: function inputRef(el) {
|
||||
this.input = el;
|
||||
},
|
||||
placeHolderSizerRef: function placeHolderSizerRef(el) {
|
||||
this.placeHolderSizer = el;
|
||||
},
|
||||
sizerRef: function sizerRef(el) {
|
||||
this.sizer = el;
|
||||
},
|
||||
copyInputStyles: function copyInputStyles() {
|
||||
if (this.mounted || !window.getComputedStyle) {
|
||||
return;
|
||||
}
|
||||
var inputStyle = this.input && window.getComputedStyle(this.input);
|
||||
if (!inputStyle) {
|
||||
return;
|
||||
}
|
||||
var widthNode = this.sizer;
|
||||
widthNode.style.fontSize = inputStyle.fontSize;
|
||||
widthNode.style.fontFamily = inputStyle.fontFamily;
|
||||
widthNode.style.fontWeight = inputStyle.fontWeight;
|
||||
widthNode.style.fontStyle = inputStyle.fontStyle;
|
||||
widthNode.style.letterSpacing = inputStyle.letterSpacing;
|
||||
widthNode.style.textTransform = inputStyle.textTransform;
|
||||
if (this.props.placeholder) {
|
||||
var placeholderNode = this.placeHolderSizer;
|
||||
placeholderNode.style.fontSize = inputStyle.fontSize;
|
||||
placeholderNode.style.fontFamily = inputStyle.fontFamily;
|
||||
placeholderNode.style.fontWeight = inputStyle.fontWeight;
|
||||
placeholderNode.style.fontStyle = inputStyle.fontStyle;
|
||||
placeholderNode.style.letterSpacing = inputStyle.letterSpacing;
|
||||
placeholderNode.style.textTransform = inputStyle.textTransform;
|
||||
}
|
||||
},
|
||||
updateInputWidth: function updateInputWidth() {
|
||||
if (!this.mounted || !this.sizer || typeof this.sizer.scrollWidth === 'undefined') {
|
||||
return;
|
||||
}
|
||||
var newInputWidth = undefined;
|
||||
if (this.props.placeholder && (!this.props.value || this.props.value && this.props.placeholderIsMinWidth)) {
|
||||
newInputWidth = Math.max(this.sizer.scrollWidth, this.placeHolderSizer.scrollWidth) + 2;
|
||||
} else {
|
||||
newInputWidth = this.sizer.scrollWidth + 2;
|
||||
}
|
||||
if (newInputWidth < this.props.minWidth) {
|
||||
newInputWidth = this.props.minWidth;
|
||||
}
|
||||
if (newInputWidth !== this.state.inputWidth) {
|
||||
this.setState({
|
||||
inputWidth: newInputWidth
|
||||
});
|
||||
}
|
||||
},
|
||||
getInput: function getInput() {
|
||||
return this.input;
|
||||
},
|
||||
focus: function focus() {
|
||||
this.input.focus();
|
||||
},
|
||||
blur: function blur() {
|
||||
this.input.blur();
|
||||
},
|
||||
select: function select() {
|
||||
this.input.select();
|
||||
},
|
||||
render: function render() {
|
||||
var sizerValue = [this.props.defaultValue, this.props.value, ''].reduce(function (previousValue, currentValue) {
|
||||
if (previousValue !== null && previousValue !== undefined) {
|
||||
return previousValue;
|
||||
}
|
||||
return currentValue;
|
||||
});
|
||||
|
||||
var wrapperStyle = this.props.style || {};
|
||||
if (!wrapperStyle.display) wrapperStyle.display = 'inline-block';
|
||||
var inputStyle = _extends({}, this.props.inputStyle);
|
||||
inputStyle.width = this.state.inputWidth + 'px';
|
||||
inputStyle.boxSizing = 'content-box';
|
||||
var inputProps = _extends({}, this.props);
|
||||
inputProps.className = this.props.inputClassName;
|
||||
inputProps.style = inputStyle;
|
||||
// ensure props meant for `AutosizeInput` don't end up on the `input`
|
||||
delete inputProps.inputClassName;
|
||||
delete inputProps.inputStyle;
|
||||
delete inputProps.minWidth;
|
||||
delete inputProps.onAutosize;
|
||||
delete inputProps.placeholderIsMinWidth;
|
||||
return React.createElement(
|
||||
'div',
|
||||
{ className: this.props.className, style: wrapperStyle },
|
||||
React.createElement('input', _extends({}, inputProps, { ref: this.inputRef })),
|
||||
React.createElement(
|
||||
'div',
|
||||
{ ref: this.sizerRef, style: sizerStyle },
|
||||
sizerValue
|
||||
),
|
||||
this.props.placeholder ? React.createElement(
|
||||
'div',
|
||||
{ ref: this.placeHolderSizerRef, style: sizerStyle },
|
||||
this.props.placeholder
|
||||
) : null
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = AutosizeInput;
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-select-1/~/react-input-autosize/lib/AutosizeInput.js
|
||||
// module id = 2791
|
||||
// module chunks = 4
|
277
509bba0_unpacked_with_node_modules/~/react-select-1/~/react-select/lib/Async.js
generated
vendored
Executable file
277
509bba0_unpacked_with_node_modules/~/react-select-1/~/react-select/lib/Async.js
generated
vendored
Executable file
|
@ -0,0 +1,277 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
||||
|
||||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
|
||||
|
||||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
var _react = require('react');
|
||||
|
||||
var _react2 = _interopRequireDefault(_react);
|
||||
|
||||
var _propTypes = require('prop-types');
|
||||
|
||||
var _propTypes2 = _interopRequireDefault(_propTypes);
|
||||
|
||||
var _Select = require('./Select');
|
||||
|
||||
var _Select2 = _interopRequireDefault(_Select);
|
||||
|
||||
var _utilsStripDiacritics = require('./utils/stripDiacritics');
|
||||
|
||||
var _utilsStripDiacritics2 = _interopRequireDefault(_utilsStripDiacritics);
|
||||
|
||||
var propTypes = {
|
||||
autoload: _propTypes2['default'].bool.isRequired, // automatically call the `loadOptions` prop on-mount; defaults to true
|
||||
cache: _propTypes2['default'].any, // object to use to cache results; set to null/false to disable caching
|
||||
children: _propTypes2['default'].func.isRequired, // Child function responsible for creating the inner Select component; (props: Object): PropTypes.element
|
||||
ignoreAccents: _propTypes2['default'].bool, // strip diacritics when filtering; defaults to true
|
||||
ignoreCase: _propTypes2['default'].bool, // perform case-insensitive filtering; defaults to true
|
||||
loadingPlaceholder: _propTypes2['default'].oneOfType([// replaces the placeholder while options are loading
|
||||
_propTypes2['default'].string, _propTypes2['default'].node]),
|
||||
loadOptions: _propTypes2['default'].func.isRequired, // callback to load options asynchronously; (inputValue: string, callback: Function): ?Promise
|
||||
multi: _propTypes2['default'].bool, // multi-value input
|
||||
options: _propTypes2['default'].array.isRequired, // array of options
|
||||
placeholder: _propTypes2['default'].oneOfType([// field placeholder, displayed when there's no value (shared with Select)
|
||||
_propTypes2['default'].string, _propTypes2['default'].node]),
|
||||
noResultsText: _propTypes2['default'].oneOfType([// field noResultsText, displayed when no options come back from the server
|
||||
_propTypes2['default'].string, _propTypes2['default'].node]),
|
||||
onChange: _propTypes2['default'].func, // onChange handler: function (newValue) {}
|
||||
searchPromptText: _propTypes2['default'].oneOfType([// label to prompt for search input
|
||||
_propTypes2['default'].string, _propTypes2['default'].node]),
|
||||
onInputChange: _propTypes2['default'].func, // optional for keeping track of what is being typed
|
||||
value: _propTypes2['default'].any };
|
||||
|
||||
// initial field value
|
||||
var defaultCache = {};
|
||||
|
||||
var defaultProps = {
|
||||
autoload: true,
|
||||
cache: defaultCache,
|
||||
children: defaultChildren,
|
||||
ignoreAccents: true,
|
||||
ignoreCase: true,
|
||||
loadingPlaceholder: 'Loading...',
|
||||
options: [],
|
||||
searchPromptText: 'Type to search'
|
||||
};
|
||||
|
||||
var Async = (function (_Component) {
|
||||
_inherits(Async, _Component);
|
||||
|
||||
function Async(props, context) {
|
||||
_classCallCheck(this, Async);
|
||||
|
||||
_get(Object.getPrototypeOf(Async.prototype), 'constructor', this).call(this, props, context);
|
||||
|
||||
this._cache = props.cache === defaultCache ? {} : props.cache;
|
||||
|
||||
this.state = {
|
||||
isLoading: false,
|
||||
options: props.options
|
||||
};
|
||||
|
||||
this._onInputChange = this._onInputChange.bind(this);
|
||||
}
|
||||
|
||||
_createClass(Async, [{
|
||||
key: 'componentDidMount',
|
||||
value: function componentDidMount() {
|
||||
var autoload = this.props.autoload;
|
||||
|
||||
if (autoload) {
|
||||
this.loadOptions('');
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: 'componentWillUpdate',
|
||||
value: function componentWillUpdate(nextProps, nextState) {
|
||||
var _this = this;
|
||||
|
||||
var propertiesToSync = ['options'];
|
||||
propertiesToSync.forEach(function (prop) {
|
||||
if (_this.props[prop] !== nextProps[prop]) {
|
||||
_this.setState(_defineProperty({}, prop, nextProps[prop]));
|
||||
}
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: 'clearOptions',
|
||||
value: function clearOptions() {
|
||||
this.setState({ options: [] });
|
||||
}
|
||||
}, {
|
||||
key: 'loadOptions',
|
||||
value: function loadOptions(inputValue) {
|
||||
var _this2 = this;
|
||||
|
||||
var loadOptions = this.props.loadOptions;
|
||||
|
||||
var cache = this._cache;
|
||||
|
||||
if (cache && cache.hasOwnProperty(inputValue)) {
|
||||
this.setState({
|
||||
options: cache[inputValue]
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
var callback = function callback(error, data) {
|
||||
if (callback === _this2._callback) {
|
||||
_this2._callback = null;
|
||||
|
||||
var options = data && data.options || [];
|
||||
|
||||
if (cache) {
|
||||
cache[inputValue] = options;
|
||||
}
|
||||
|
||||
_this2.setState({
|
||||
isLoading: false,
|
||||
options: options
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// Ignore all but the most recent request
|
||||
this._callback = callback;
|
||||
|
||||
var promise = loadOptions(inputValue, callback);
|
||||
if (promise) {
|
||||
promise.then(function (data) {
|
||||
return callback(null, data);
|
||||
}, function (error) {
|
||||
return callback(error);
|
||||
});
|
||||
}
|
||||
|
||||
if (this._callback && !this.state.isLoading) {
|
||||
this.setState({
|
||||
isLoading: true
|
||||
});
|
||||
}
|
||||
|
||||
return inputValue;
|
||||
}
|
||||
}, {
|
||||
key: '_onInputChange',
|
||||
value: function _onInputChange(inputValue) {
|
||||
var _props = this.props;
|
||||
var ignoreAccents = _props.ignoreAccents;
|
||||
var ignoreCase = _props.ignoreCase;
|
||||
var onInputChange = _props.onInputChange;
|
||||
|
||||
if (ignoreAccents) {
|
||||
inputValue = (0, _utilsStripDiacritics2['default'])(inputValue);
|
||||
}
|
||||
|
||||
if (ignoreCase) {
|
||||
inputValue = inputValue.toLowerCase();
|
||||
}
|
||||
|
||||
if (onInputChange) {
|
||||
onInputChange(inputValue);
|
||||
}
|
||||
|
||||
return this.loadOptions(inputValue);
|
||||
}
|
||||
}, {
|
||||
key: 'inputValue',
|
||||
value: function inputValue() {
|
||||
if (this.select) {
|
||||
return this.select.state.inputValue;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
}, {
|
||||
key: 'noResultsText',
|
||||
value: function noResultsText() {
|
||||
var _props2 = this.props;
|
||||
var loadingPlaceholder = _props2.loadingPlaceholder;
|
||||
var noResultsText = _props2.noResultsText;
|
||||
var searchPromptText = _props2.searchPromptText;
|
||||
var isLoading = this.state.isLoading;
|
||||
|
||||
var inputValue = this.inputValue();
|
||||
|
||||
if (isLoading) {
|
||||
return loadingPlaceholder;
|
||||
}
|
||||
if (inputValue && noResultsText) {
|
||||
return noResultsText;
|
||||
}
|
||||
return searchPromptText;
|
||||
}
|
||||
}, {
|
||||
key: 'focus',
|
||||
value: function focus() {
|
||||
this.select.focus();
|
||||
}
|
||||
}, {
|
||||
key: 'render',
|
||||
value: function render() {
|
||||
var _this3 = this;
|
||||
|
||||
var _props3 = this.props;
|
||||
var children = _props3.children;
|
||||
var loadingPlaceholder = _props3.loadingPlaceholder;
|
||||
var placeholder = _props3.placeholder;
|
||||
var _state = this.state;
|
||||
var isLoading = _state.isLoading;
|
||||
var options = _state.options;
|
||||
|
||||
var props = {
|
||||
noResultsText: this.noResultsText(),
|
||||
placeholder: isLoading ? loadingPlaceholder : placeholder,
|
||||
options: isLoading && loadingPlaceholder ? [] : options,
|
||||
ref: function ref(_ref) {
|
||||
return _this3.select = _ref;
|
||||
},
|
||||
onChange: function onChange(newValues) {
|
||||
if (_this3.props.multi && _this3.props.value && newValues.length > _this3.props.value.length) {
|
||||
_this3.clearOptions();
|
||||
}
|
||||
_this3.props.onChange(newValues);
|
||||
}
|
||||
};
|
||||
|
||||
return children(_extends({}, this.props, props, {
|
||||
isLoading: isLoading,
|
||||
onInputChange: this._onInputChange
|
||||
}));
|
||||
}
|
||||
}]);
|
||||
|
||||
return Async;
|
||||
})(_react.Component);
|
||||
|
||||
exports['default'] = Async;
|
||||
|
||||
Async.propTypes = propTypes;
|
||||
Async.defaultProps = defaultProps;
|
||||
|
||||
function defaultChildren(props) {
|
||||
return _react2['default'].createElement(_Select2['default'], props);
|
||||
}
|
||||
module.exports = exports['default'];
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-select-1/~/react-select/lib/Async.js
|
||||
// module id = 2792
|
||||
// module chunks = 4
|
72
509bba0_unpacked_with_node_modules/~/react-select-1/~/react-select/lib/AsyncCreatable.js
generated
vendored
Executable file
72
509bba0_unpacked_with_node_modules/~/react-select-1/~/react-select/lib/AsyncCreatable.js
generated
vendored
Executable file
|
@ -0,0 +1,72 @@
|
|||
'use strict';
|
||||
|
||||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||||
|
||||
var _react = require('react');
|
||||
|
||||
var _react2 = _interopRequireDefault(_react);
|
||||
|
||||
var _createReactClass = require('create-react-class');
|
||||
|
||||
var _createReactClass2 = _interopRequireDefault(_createReactClass);
|
||||
|
||||
var _Select = require('./Select');
|
||||
|
||||
var _Select2 = _interopRequireDefault(_Select);
|
||||
|
||||
function reduce(obj) {
|
||||
var props = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
|
||||
|
||||
return Object.keys(obj).reduce(function (props, key) {
|
||||
var value = obj[key];
|
||||
if (value !== undefined) props[key] = value;
|
||||
return props;
|
||||
}, props);
|
||||
}
|
||||
|
||||
var AsyncCreatable = (0, _createReactClass2['default'])({
|
||||
displayName: 'AsyncCreatableSelect',
|
||||
|
||||
focus: function focus() {
|
||||
this.select.focus();
|
||||
},
|
||||
|
||||
render: function render() {
|
||||
var _this = this;
|
||||
|
||||
return _react2['default'].createElement(
|
||||
_Select2['default'].Async,
|
||||
this.props,
|
||||
function (asyncProps) {
|
||||
return _react2['default'].createElement(
|
||||
_Select2['default'].Creatable,
|
||||
_this.props,
|
||||
function (creatableProps) {
|
||||
return _react2['default'].createElement(_Select2['default'], _extends({}, reduce(asyncProps, reduce(creatableProps, {})), {
|
||||
onInputChange: function (input) {
|
||||
creatableProps.onInputChange(input);
|
||||
return asyncProps.onInputChange(input);
|
||||
},
|
||||
ref: function (ref) {
|
||||
_this.select = ref;
|
||||
creatableProps.ref(ref);
|
||||
asyncProps.ref(ref);
|
||||
}
|
||||
}));
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = AsyncCreatable;
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-select-1/~/react-select/lib/AsyncCreatable.js
|
||||
// module id = 2793
|
||||
// module chunks = 4
|
335
509bba0_unpacked_with_node_modules/~/react-select-1/~/react-select/lib/Creatable.js
generated
vendored
Executable file
335
509bba0_unpacked_with_node_modules/~/react-select-1/~/react-select/lib/Creatable.js
generated
vendored
Executable file
|
@ -0,0 +1,335 @@
|
|||
'use strict';
|
||||
|
||||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||||
|
||||
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
||||
|
||||
var _react = require('react');
|
||||
|
||||
var _react2 = _interopRequireDefault(_react);
|
||||
|
||||
var _createReactClass = require('create-react-class');
|
||||
|
||||
var _createReactClass2 = _interopRequireDefault(_createReactClass);
|
||||
|
||||
var _propTypes = require('prop-types');
|
||||
|
||||
var _propTypes2 = _interopRequireDefault(_propTypes);
|
||||
|
||||
var _Select = require('./Select');
|
||||
|
||||
var _Select2 = _interopRequireDefault(_Select);
|
||||
|
||||
var _utilsDefaultFilterOptions = require('./utils/defaultFilterOptions');
|
||||
|
||||
var _utilsDefaultFilterOptions2 = _interopRequireDefault(_utilsDefaultFilterOptions);
|
||||
|
||||
var _utilsDefaultMenuRenderer = require('./utils/defaultMenuRenderer');
|
||||
|
||||
var _utilsDefaultMenuRenderer2 = _interopRequireDefault(_utilsDefaultMenuRenderer);
|
||||
|
||||
var Creatable = (0, _createReactClass2['default'])({
|
||||
displayName: 'CreatableSelect',
|
||||
|
||||
propTypes: {
|
||||
// Child function responsible for creating the inner Select component
|
||||
// This component can be used to compose HOCs (eg Creatable and Async)
|
||||
// (props: Object): PropTypes.element
|
||||
children: _propTypes2['default'].func,
|
||||
|
||||
// See Select.propTypes.filterOptions
|
||||
filterOptions: _propTypes2['default'].any,
|
||||
|
||||
// Searches for any matching option within the set of options.
|
||||
// This function prevents duplicate options from being created.
|
||||
// ({ option: Object, options: Array, labelKey: string, valueKey: string }): boolean
|
||||
isOptionUnique: _propTypes2['default'].func,
|
||||
|
||||
// Determines if the current input text represents a valid option.
|
||||
// ({ label: string }): boolean
|
||||
isValidNewOption: _propTypes2['default'].func,
|
||||
|
||||
// See Select.propTypes.menuRenderer
|
||||
menuRenderer: _propTypes2['default'].any,
|
||||
|
||||
// Factory to create new option.
|
||||
// ({ label: string, labelKey: string, valueKey: string }): Object
|
||||
newOptionCreator: _propTypes2['default'].func,
|
||||
|
||||
// input change handler: function (inputValue) {}
|
||||
onInputChange: _propTypes2['default'].func,
|
||||
|
||||
// input keyDown handler: function (event) {}
|
||||
onInputKeyDown: _propTypes2['default'].func,
|
||||
|
||||
// new option click handler: function (option) {}
|
||||
onNewOptionClick: _propTypes2['default'].func,
|
||||
|
||||
// See Select.propTypes.options
|
||||
options: _propTypes2['default'].array,
|
||||
|
||||
// Creates prompt/placeholder option text.
|
||||
// (filterText: string): string
|
||||
promptTextCreator: _propTypes2['default'].func,
|
||||
|
||||
// Decides if a keyDown event (eg its `keyCode`) should result in the creation of a new option.
|
||||
shouldKeyDownEventCreateNewOption: _propTypes2['default'].func
|
||||
},
|
||||
|
||||
// Default prop methods
|
||||
statics: {
|
||||
isOptionUnique: isOptionUnique,
|
||||
isValidNewOption: isValidNewOption,
|
||||
newOptionCreator: newOptionCreator,
|
||||
promptTextCreator: promptTextCreator,
|
||||
shouldKeyDownEventCreateNewOption: shouldKeyDownEventCreateNewOption
|
||||
},
|
||||
|
||||
getDefaultProps: function getDefaultProps() {
|
||||
return {
|
||||
filterOptions: _utilsDefaultFilterOptions2['default'],
|
||||
isOptionUnique: isOptionUnique,
|
||||
isValidNewOption: isValidNewOption,
|
||||
menuRenderer: _utilsDefaultMenuRenderer2['default'],
|
||||
newOptionCreator: newOptionCreator,
|
||||
promptTextCreator: promptTextCreator,
|
||||
shouldKeyDownEventCreateNewOption: shouldKeyDownEventCreateNewOption
|
||||
};
|
||||
},
|
||||
|
||||
createNewOption: function createNewOption() {
|
||||
var _props = this.props;
|
||||
var isValidNewOption = _props.isValidNewOption;
|
||||
var newOptionCreator = _props.newOptionCreator;
|
||||
var onNewOptionClick = _props.onNewOptionClick;
|
||||
var _props$options = _props.options;
|
||||
var options = _props$options === undefined ? [] : _props$options;
|
||||
var shouldKeyDownEventCreateNewOption = _props.shouldKeyDownEventCreateNewOption;
|
||||
|
||||
if (isValidNewOption({ label: this.inputValue })) {
|
||||
var option = newOptionCreator({ label: this.inputValue, labelKey: this.labelKey, valueKey: this.valueKey });
|
||||
var _isOptionUnique = this.isOptionUnique({ option: option });
|
||||
|
||||
// Don't add the same option twice.
|
||||
if (_isOptionUnique) {
|
||||
if (onNewOptionClick) {
|
||||
onNewOptionClick(option);
|
||||
} else {
|
||||
options.unshift(option);
|
||||
|
||||
this.select.selectValue(option);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
filterOptions: function filterOptions() {
|
||||
var _props2 = this.props;
|
||||
var filterOptions = _props2.filterOptions;
|
||||
var isValidNewOption = _props2.isValidNewOption;
|
||||
var options = _props2.options;
|
||||
var promptTextCreator = _props2.promptTextCreator;
|
||||
|
||||
// TRICKY Check currently selected options as well.
|
||||
// Don't display a create-prompt for a value that's selected.
|
||||
// This covers async edge-cases where a newly-created Option isn't yet in the async-loaded array.
|
||||
var excludeOptions = arguments[2] || [];
|
||||
|
||||
var filteredOptions = filterOptions.apply(undefined, arguments) || [];
|
||||
|
||||
if (isValidNewOption({ label: this.inputValue })) {
|
||||
var _newOptionCreator = this.props.newOptionCreator;
|
||||
|
||||
var option = _newOptionCreator({
|
||||
label: this.inputValue,
|
||||
labelKey: this.labelKey,
|
||||
valueKey: this.valueKey
|
||||
});
|
||||
|
||||
// TRICKY Compare to all options (not just filtered options) in case option has already been selected).
|
||||
// For multi-selects, this would remove it from the filtered list.
|
||||
var _isOptionUnique2 = this.isOptionUnique({
|
||||
option: option,
|
||||
options: excludeOptions.concat(filteredOptions)
|
||||
});
|
||||
|
||||
if (_isOptionUnique2) {
|
||||
var _prompt = promptTextCreator(this.inputValue);
|
||||
|
||||
this._createPlaceholderOption = _newOptionCreator({
|
||||
label: _prompt,
|
||||
labelKey: this.labelKey,
|
||||
valueKey: this.valueKey
|
||||
});
|
||||
|
||||
filteredOptions.unshift(this._createPlaceholderOption);
|
||||
}
|
||||
}
|
||||
|
||||
return filteredOptions;
|
||||
},
|
||||
|
||||
isOptionUnique: function isOptionUnique(_ref2) {
|
||||
var option = _ref2.option;
|
||||
var options = _ref2.options;
|
||||
var isOptionUnique = this.props.isOptionUnique;
|
||||
|
||||
options = options || this.select.filterOptions();
|
||||
|
||||
return isOptionUnique({
|
||||
labelKey: this.labelKey,
|
||||
option: option,
|
||||
options: options,
|
||||
valueKey: this.valueKey
|
||||
});
|
||||
},
|
||||
|
||||
menuRenderer: function menuRenderer(params) {
|
||||
var menuRenderer = this.props.menuRenderer;
|
||||
|
||||
return menuRenderer(_extends({}, params, {
|
||||
onSelect: this.onOptionSelect,
|
||||
selectValue: this.onOptionSelect
|
||||
}));
|
||||
},
|
||||
|
||||
onInputChange: function onInputChange(input) {
|
||||
var onInputChange = this.props.onInputChange;
|
||||
|
||||
if (onInputChange) {
|
||||
onInputChange(input);
|
||||
}
|
||||
|
||||
// This value may be needed in between Select mounts (when this.select is null)
|
||||
this.inputValue = input;
|
||||
},
|
||||
|
||||
onInputKeyDown: function onInputKeyDown(event) {
|
||||
var _props3 = this.props;
|
||||
var shouldKeyDownEventCreateNewOption = _props3.shouldKeyDownEventCreateNewOption;
|
||||
var onInputKeyDown = _props3.onInputKeyDown;
|
||||
|
||||
var focusedOption = this.select.getFocusedOption();
|
||||
|
||||
if (focusedOption && focusedOption === this._createPlaceholderOption && shouldKeyDownEventCreateNewOption({ keyCode: event.keyCode })) {
|
||||
this.createNewOption();
|
||||
|
||||
// Prevent decorated Select from doing anything additional with this keyDown event
|
||||
event.preventDefault();
|
||||
} else if (onInputKeyDown) {
|
||||
onInputKeyDown(event);
|
||||
}
|
||||
},
|
||||
|
||||
onOptionSelect: function onOptionSelect(option, event) {
|
||||
if (option === this._createPlaceholderOption) {
|
||||
this.createNewOption();
|
||||
} else {
|
||||
this.select.selectValue(option);
|
||||
}
|
||||
},
|
||||
|
||||
focus: function focus() {
|
||||
this.select.focus();
|
||||
},
|
||||
|
||||
render: function render() {
|
||||
var _this = this;
|
||||
|
||||
var _props4 = this.props;
|
||||
var newOptionCreator = _props4.newOptionCreator;
|
||||
var shouldKeyDownEventCreateNewOption = _props4.shouldKeyDownEventCreateNewOption;
|
||||
|
||||
var restProps = _objectWithoutProperties(_props4, ['newOptionCreator', 'shouldKeyDownEventCreateNewOption']);
|
||||
|
||||
var children = this.props.children;
|
||||
|
||||
// We can't use destructuring default values to set the children,
|
||||
// because it won't apply work if `children` is null. A falsy check is
|
||||
// more reliable in real world use-cases.
|
||||
if (!children) {
|
||||
children = defaultChildren;
|
||||
}
|
||||
|
||||
var props = _extends({}, restProps, {
|
||||
allowCreate: true,
|
||||
filterOptions: this.filterOptions,
|
||||
menuRenderer: this.menuRenderer,
|
||||
onInputChange: this.onInputChange,
|
||||
onInputKeyDown: this.onInputKeyDown,
|
||||
ref: function ref(_ref) {
|
||||
_this.select = _ref;
|
||||
|
||||
// These values may be needed in between Select mounts (when this.select is null)
|
||||
if (_ref) {
|
||||
_this.labelKey = _ref.props.labelKey;
|
||||
_this.valueKey = _ref.props.valueKey;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return children(props);
|
||||
}
|
||||
});
|
||||
|
||||
function defaultChildren(props) {
|
||||
return _react2['default'].createElement(_Select2['default'], props);
|
||||
};
|
||||
|
||||
function isOptionUnique(_ref3) {
|
||||
var option = _ref3.option;
|
||||
var options = _ref3.options;
|
||||
var labelKey = _ref3.labelKey;
|
||||
var valueKey = _ref3.valueKey;
|
||||
|
||||
return options.filter(function (existingOption) {
|
||||
return existingOption[labelKey] === option[labelKey] || existingOption[valueKey] === option[valueKey];
|
||||
}).length === 0;
|
||||
};
|
||||
|
||||
function isValidNewOption(_ref4) {
|
||||
var label = _ref4.label;
|
||||
|
||||
return !!label;
|
||||
};
|
||||
|
||||
function newOptionCreator(_ref5) {
|
||||
var label = _ref5.label;
|
||||
var labelKey = _ref5.labelKey;
|
||||
var valueKey = _ref5.valueKey;
|
||||
|
||||
var option = {};
|
||||
option[valueKey] = label;
|
||||
option[labelKey] = label;
|
||||
option.className = 'Select-create-option-placeholder';
|
||||
return option;
|
||||
};
|
||||
|
||||
function promptTextCreator(label) {
|
||||
return 'Create option "' + label + '"';
|
||||
}
|
||||
|
||||
function shouldKeyDownEventCreateNewOption(_ref6) {
|
||||
var keyCode = _ref6.keyCode;
|
||||
|
||||
switch (keyCode) {
|
||||
case 9: // TAB
|
||||
case 13: // ENTER
|
||||
case 188:
|
||||
// COMMA
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
module.exports = Creatable;
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-select-1/~/react-select/lib/Creatable.js
|
||||
// module id = 2794
|
||||
// module chunks = 4
|
124
509bba0_unpacked_with_node_modules/~/react-select-1/~/react-select/lib/Option.js
generated
vendored
Executable file
124
509bba0_unpacked_with_node_modules/~/react-select-1/~/react-select/lib/Option.js
generated
vendored
Executable file
|
@ -0,0 +1,124 @@
|
|||
'use strict';
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||||
|
||||
var _react = require('react');
|
||||
|
||||
var _react2 = _interopRequireDefault(_react);
|
||||
|
||||
var _createReactClass = require('create-react-class');
|
||||
|
||||
var _createReactClass2 = _interopRequireDefault(_createReactClass);
|
||||
|
||||
var _propTypes = require('prop-types');
|
||||
|
||||
var _propTypes2 = _interopRequireDefault(_propTypes);
|
||||
|
||||
var _classnames = require('classnames');
|
||||
|
||||
var _classnames2 = _interopRequireDefault(_classnames);
|
||||
|
||||
var Option = (0, _createReactClass2['default'])({
|
||||
propTypes: {
|
||||
children: _propTypes2['default'].node,
|
||||
className: _propTypes2['default'].string, // className (based on mouse position)
|
||||
instancePrefix: _propTypes2['default'].string.isRequired, // unique prefix for the ids (used for aria)
|
||||
isDisabled: _propTypes2['default'].bool, // the option is disabled
|
||||
isFocused: _propTypes2['default'].bool, // the option is focused
|
||||
isSelected: _propTypes2['default'].bool, // the option is selected
|
||||
onFocus: _propTypes2['default'].func, // method to handle mouseEnter on option element
|
||||
onSelect: _propTypes2['default'].func, // method to handle click on option element
|
||||
onUnfocus: _propTypes2['default'].func, // method to handle mouseLeave on option element
|
||||
option: _propTypes2['default'].object.isRequired, // object that is base for that option
|
||||
optionIndex: _propTypes2['default'].number },
|
||||
// index of the option, used to generate unique ids for aria
|
||||
blockEvent: function blockEvent(event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
if (event.target.tagName !== 'A' || !('href' in event.target)) {
|
||||
return;
|
||||
}
|
||||
if (event.target.target) {
|
||||
window.open(event.target.href, event.target.target);
|
||||
} else {
|
||||
window.location.href = event.target.href;
|
||||
}
|
||||
},
|
||||
|
||||
handleMouseDown: function handleMouseDown(event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
this.props.onSelect(this.props.option, event);
|
||||
},
|
||||
|
||||
handleMouseEnter: function handleMouseEnter(event) {
|
||||
this.onFocus(event);
|
||||
},
|
||||
|
||||
handleMouseMove: function handleMouseMove(event) {
|
||||
this.onFocus(event);
|
||||
},
|
||||
|
||||
handleTouchEnd: function handleTouchEnd(event) {
|
||||
// Check if the view is being dragged, In this case
|
||||
// we don't want to fire the click event (because the user only wants to scroll)
|
||||
if (this.dragging) return;
|
||||
|
||||
this.handleMouseDown(event);
|
||||
},
|
||||
|
||||
handleTouchMove: function handleTouchMove(event) {
|
||||
// Set a flag that the view is being dragged
|
||||
this.dragging = true;
|
||||
},
|
||||
|
||||
handleTouchStart: function handleTouchStart(event) {
|
||||
// Set a flag that the view is not being dragged
|
||||
this.dragging = false;
|
||||
},
|
||||
|
||||
onFocus: function onFocus(event) {
|
||||
if (!this.props.isFocused) {
|
||||
this.props.onFocus(this.props.option, event);
|
||||
}
|
||||
},
|
||||
render: function render() {
|
||||
var _props = this.props;
|
||||
var option = _props.option;
|
||||
var instancePrefix = _props.instancePrefix;
|
||||
var optionIndex = _props.optionIndex;
|
||||
|
||||
var className = (0, _classnames2['default'])(this.props.className, option.className);
|
||||
|
||||
return option.disabled ? _react2['default'].createElement(
|
||||
'div',
|
||||
{ className: className,
|
||||
onMouseDown: this.blockEvent,
|
||||
onClick: this.blockEvent },
|
||||
this.props.children
|
||||
) : _react2['default'].createElement(
|
||||
'div',
|
||||
{ className: className,
|
||||
style: option.style,
|
||||
role: 'option',
|
||||
onMouseDown: this.handleMouseDown,
|
||||
onMouseEnter: this.handleMouseEnter,
|
||||
onMouseMove: this.handleMouseMove,
|
||||
onTouchStart: this.handleTouchStart,
|
||||
onTouchMove: this.handleTouchMove,
|
||||
onTouchEnd: this.handleTouchEnd,
|
||||
id: instancePrefix + '-option-' + optionIndex,
|
||||
title: option.title },
|
||||
this.props.children
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = Option;
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-select-1/~/react-select/lib/Option.js
|
||||
// module id = 2795
|
||||
// module chunks = 4
|
1249
509bba0_unpacked_with_node_modules/~/react-select-1/~/react-select/lib/Select.js
generated
vendored
Executable file
1249
509bba0_unpacked_with_node_modules/~/react-select-1/~/react-select/lib/Select.js
generated
vendored
Executable file
File diff suppressed because it is too large
Load diff
121
509bba0_unpacked_with_node_modules/~/react-select-1/~/react-select/lib/Value.js
generated
vendored
Executable file
121
509bba0_unpacked_with_node_modules/~/react-select-1/~/react-select/lib/Value.js
generated
vendored
Executable file
|
@ -0,0 +1,121 @@
|
|||
'use strict';
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||||
|
||||
var _react = require('react');
|
||||
|
||||
var _react2 = _interopRequireDefault(_react);
|
||||
|
||||
var _createReactClass = require('create-react-class');
|
||||
|
||||
var _createReactClass2 = _interopRequireDefault(_createReactClass);
|
||||
|
||||
var _propTypes = require('prop-types');
|
||||
|
||||
var _propTypes2 = _interopRequireDefault(_propTypes);
|
||||
|
||||
var _classnames = require('classnames');
|
||||
|
||||
var _classnames2 = _interopRequireDefault(_classnames);
|
||||
|
||||
var Value = (0, _createReactClass2['default'])({
|
||||
|
||||
displayName: 'Value',
|
||||
|
||||
propTypes: {
|
||||
children: _propTypes2['default'].node,
|
||||
disabled: _propTypes2['default'].bool, // disabled prop passed to ReactSelect
|
||||
id: _propTypes2['default'].string, // Unique id for the value - used for aria
|
||||
onClick: _propTypes2['default'].func, // method to handle click on value label
|
||||
onRemove: _propTypes2['default'].func, // method to handle removal of the value
|
||||
value: _propTypes2['default'].object.isRequired },
|
||||
|
||||
// the option object for this value
|
||||
handleMouseDown: function handleMouseDown(event) {
|
||||
if (event.type === 'mousedown' && event.button !== 0) {
|
||||
return;
|
||||
}
|
||||
if (this.props.onClick) {
|
||||
event.stopPropagation();
|
||||
this.props.onClick(this.props.value, event);
|
||||
return;
|
||||
}
|
||||
if (this.props.value.href) {
|
||||
event.stopPropagation();
|
||||
}
|
||||
},
|
||||
|
||||
onRemove: function onRemove(event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
this.props.onRemove(this.props.value);
|
||||
},
|
||||
|
||||
handleTouchEndRemove: function handleTouchEndRemove(event) {
|
||||
// Check if the view is being dragged, In this case
|
||||
// we don't want to fire the click event (because the user only wants to scroll)
|
||||
if (this.dragging) return;
|
||||
|
||||
// Fire the mouse events
|
||||
this.onRemove(event);
|
||||
},
|
||||
|
||||
handleTouchMove: function handleTouchMove(event) {
|
||||
// Set a flag that the view is being dragged
|
||||
this.dragging = true;
|
||||
},
|
||||
|
||||
handleTouchStart: function handleTouchStart(event) {
|
||||
// Set a flag that the view is not being dragged
|
||||
this.dragging = false;
|
||||
},
|
||||
|
||||
renderRemoveIcon: function renderRemoveIcon() {
|
||||
if (this.props.disabled || !this.props.onRemove) return;
|
||||
return _react2['default'].createElement(
|
||||
'span',
|
||||
{ className: 'Select-value-icon',
|
||||
'aria-hidden': 'true',
|
||||
onMouseDown: this.onRemove,
|
||||
onTouchEnd: this.handleTouchEndRemove,
|
||||
onTouchStart: this.handleTouchStart,
|
||||
onTouchMove: this.handleTouchMove },
|
||||
'×'
|
||||
);
|
||||
},
|
||||
|
||||
renderLabel: function renderLabel() {
|
||||
var className = 'Select-value-label';
|
||||
return this.props.onClick || this.props.value.href ? _react2['default'].createElement(
|
||||
'a',
|
||||
{ className: className, href: this.props.value.href, target: this.props.value.target, onMouseDown: this.handleMouseDown, onTouchEnd: this.handleMouseDown },
|
||||
this.props.children
|
||||
) : _react2['default'].createElement(
|
||||
'span',
|
||||
{ className: className, role: 'option', 'aria-selected': 'true', id: this.props.id },
|
||||
this.props.children
|
||||
);
|
||||
},
|
||||
|
||||
render: function render() {
|
||||
return _react2['default'].createElement(
|
||||
'div',
|
||||
{ className: (0, _classnames2['default'])('Select-value', this.props.value.className),
|
||||
style: this.props.value.style,
|
||||
title: this.props.value.title
|
||||
},
|
||||
this.renderRemoveIcon(),
|
||||
this.renderLabel()
|
||||
);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
module.exports = Value;
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-select-1/~/react-select/lib/Value.js
|
||||
// module id = 2796
|
||||
// module chunks = 4
|
31
509bba0_unpacked_with_node_modules/~/react-select-1/~/react-select/lib/utils/defaultArrowRenderer.js
generated
vendored
Executable file
31
509bba0_unpacked_with_node_modules/~/react-select-1/~/react-select/lib/utils/defaultArrowRenderer.js
generated
vendored
Executable file
|
@ -0,0 +1,31 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = arrowRenderer;
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
||||
|
||||
var _react = require('react');
|
||||
|
||||
var _react2 = _interopRequireDefault(_react);
|
||||
|
||||
function arrowRenderer(_ref) {
|
||||
var onMouseDown = _ref.onMouseDown;
|
||||
|
||||
return _react2["default"].createElement("span", {
|
||||
className: "Select-arrow",
|
||||
onMouseDown: onMouseDown
|
||||
});
|
||||
}
|
||||
|
||||
;
|
||||
module.exports = exports["default"];
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-select-1/~/react-select/lib/utils/defaultArrowRenderer.js
|
||||
// module id = 2797
|
||||
// module chunks = 4
|
29
509bba0_unpacked_with_node_modules/~/react-select-1/~/react-select/lib/utils/defaultClearRenderer.js
generated
vendored
Executable file
29
509bba0_unpacked_with_node_modules/~/react-select-1/~/react-select/lib/utils/defaultClearRenderer.js
generated
vendored
Executable file
|
@ -0,0 +1,29 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports['default'] = clearRenderer;
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||||
|
||||
var _react = require('react');
|
||||
|
||||
var _react2 = _interopRequireDefault(_react);
|
||||
|
||||
function clearRenderer() {
|
||||
return _react2['default'].createElement('span', {
|
||||
className: 'Select-clear',
|
||||
dangerouslySetInnerHTML: { __html: '×' }
|
||||
});
|
||||
}
|
||||
|
||||
;
|
||||
module.exports = exports['default'];
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-select-1/~/react-select/lib/utils/defaultClearRenderer.js
|
||||
// module id = 2798
|
||||
// module chunks = 4
|
49
509bba0_unpacked_with_node_modules/~/react-select-1/~/react-select/lib/utils/defaultFilterOptions.js
generated
vendored
Executable file
49
509bba0_unpacked_with_node_modules/~/react-select-1/~/react-select/lib/utils/defaultFilterOptions.js
generated
vendored
Executable file
|
@ -0,0 +1,49 @@
|
|||
'use strict';
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||||
|
||||
var _stripDiacritics = require('./stripDiacritics');
|
||||
|
||||
var _stripDiacritics2 = _interopRequireDefault(_stripDiacritics);
|
||||
|
||||
function filterOptions(options, filterValue, excludeOptions, props) {
|
||||
var _this = this;
|
||||
|
||||
if (props.ignoreAccents) {
|
||||
filterValue = (0, _stripDiacritics2['default'])(filterValue);
|
||||
}
|
||||
|
||||
if (props.ignoreCase) {
|
||||
filterValue = filterValue.toLowerCase();
|
||||
}
|
||||
|
||||
if (excludeOptions) excludeOptions = excludeOptions.map(function (i) {
|
||||
return i[props.valueKey];
|
||||
});
|
||||
|
||||
return options.filter(function (option) {
|
||||
if (excludeOptions && excludeOptions.indexOf(option[props.valueKey]) > -1) return false;
|
||||
if (props.filterOption) return props.filterOption.call(_this, option, filterValue);
|
||||
if (!filterValue) return true;
|
||||
var valueTest = String(option[props.valueKey]);
|
||||
var labelTest = String(option[props.labelKey]);
|
||||
if (props.ignoreAccents) {
|
||||
if (props.matchProp !== 'label') valueTest = (0, _stripDiacritics2['default'])(valueTest);
|
||||
if (props.matchProp !== 'value') labelTest = (0, _stripDiacritics2['default'])(labelTest);
|
||||
}
|
||||
if (props.ignoreCase) {
|
||||
if (props.matchProp !== 'label') valueTest = valueTest.toLowerCase();
|
||||
if (props.matchProp !== 'value') labelTest = labelTest.toLowerCase();
|
||||
}
|
||||
return props.matchPos === 'start' ? props.matchProp !== 'label' && valueTest.substr(0, filterValue.length) === filterValue || props.matchProp !== 'value' && labelTest.substr(0, filterValue.length) === filterValue : props.matchProp !== 'label' && valueTest.indexOf(filterValue) >= 0 || props.matchProp !== 'value' && labelTest.indexOf(filterValue) >= 0;
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = filterOptions;
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-select-1/~/react-select/lib/utils/defaultFilterOptions.js
|
||||
// module id = 1132
|
||||
// module chunks = 4
|
68
509bba0_unpacked_with_node_modules/~/react-select-1/~/react-select/lib/utils/defaultMenuRenderer.js
generated
vendored
Executable file
68
509bba0_unpacked_with_node_modules/~/react-select-1/~/react-select/lib/utils/defaultMenuRenderer.js
generated
vendored
Executable file
|
@ -0,0 +1,68 @@
|
|||
'use strict';
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
||||
|
||||
var _classnames = require('classnames');
|
||||
|
||||
var _classnames2 = _interopRequireDefault(_classnames);
|
||||
|
||||
var _react = require('react');
|
||||
|
||||
var _react2 = _interopRequireDefault(_react);
|
||||
|
||||
function menuRenderer(_ref) {
|
||||
var focusedOption = _ref.focusedOption;
|
||||
var instancePrefix = _ref.instancePrefix;
|
||||
var labelKey = _ref.labelKey;
|
||||
var onFocus = _ref.onFocus;
|
||||
var onSelect = _ref.onSelect;
|
||||
var optionClassName = _ref.optionClassName;
|
||||
var optionComponent = _ref.optionComponent;
|
||||
var optionRenderer = _ref.optionRenderer;
|
||||
var options = _ref.options;
|
||||
var valueArray = _ref.valueArray;
|
||||
var valueKey = _ref.valueKey;
|
||||
var onOptionRef = _ref.onOptionRef;
|
||||
|
||||
var Option = optionComponent;
|
||||
|
||||
return options.map(function (option, i) {
|
||||
var isSelected = valueArray && valueArray.indexOf(option) > -1;
|
||||
var isFocused = option === focusedOption;
|
||||
var optionClass = (0, _classnames2['default'])(optionClassName, {
|
||||
'Select-option': true,
|
||||
'is-selected': isSelected,
|
||||
'is-focused': isFocused,
|
||||
'is-disabled': option.disabled
|
||||
});
|
||||
|
||||
return _react2['default'].createElement(
|
||||
Option,
|
||||
{
|
||||
className: optionClass,
|
||||
instancePrefix: instancePrefix,
|
||||
isDisabled: option.disabled,
|
||||
isFocused: isFocused,
|
||||
isSelected: isSelected,
|
||||
key: 'option-' + i + '-' + option[valueKey],
|
||||
onFocus: onFocus,
|
||||
onSelect: onSelect,
|
||||
option: option,
|
||||
optionIndex: i,
|
||||
ref: function (ref) {
|
||||
onOptionRef(ref, isFocused);
|
||||
}
|
||||
},
|
||||
optionRenderer(option, i)
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = menuRenderer;
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/react-select-1/~/react-select/lib/utils/defaultMenuRenderer.js
|
||||
// module id = 1133
|
||||
// module chunks = 4
|
17
509bba0_unpacked_with_node_modules/~/react-select-1/~/react-select/lib/utils/stripDiacritics.js
generated
vendored
Executable file
17
509bba0_unpacked_with_node_modules/~/react-select-1/~/react-select/lib/utils/stripDiacritics.js
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue