(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("react"), require("react-dom"));
else if(typeof define === 'function' && define.amd)
define(["react", "react-dom"], factory);
else if(typeof exports === 'object')
exports["ReactBootstrapTypeahead"] = factory(require("react"), require("react-dom"));
else
root["ReactBootstrapTypeahead"] = factory(root["React"], root["ReactDOM"]);
})(this, function(__WEBPACK_EXTERNAL_MODULE_0__, __WEBPACK_EXTERNAL_MODULE_2__) {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 119);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_0__;
/***/ }),
/* 1 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
if (process.env.NODE_ENV !== 'production') {
var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&
Symbol.for &&
Symbol.for('react.element')) ||
0xeac7;
var isValidElement = function(object) {
return typeof object === 'object' &&
object !== null &&
object.$$typeof === REACT_ELEMENT_TYPE;
};
// By explicitly using `prop-types` you are opting into new development behavior.
// http://fb.me/prop-types-in-prod
var throwOnDirectAccess = true;
module.exports = __webpack_require__(126)(isValidElement, throwOnDirectAccess);
} else {
// By explicitly using `prop-types` you are opting into new production behavior.
// http://fb.me/prop-types-in-prod
module.exports = __webpack_require__(128)();
}
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 2 */
/***/ (function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_2__;
/***/ }),
/* 3 */
/***/ (function(module, exports, __webpack_require__) {
var freeGlobal = __webpack_require__(67);
/** Detect free variable `self`. */
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
/** Used as a reference to the global object. */
var root = freeGlobal || freeSelf || Function('return this')();
module.exports = root;
/***/ }),
/* 4 */
/***/ (function(module, exports) {
// shim for using process in browser
var process = module.exports = {};
// cached from whatever global is present so that test runners that stub it
// don't break things. But we need to wrap it in a try catch in case it is
// wrapped in strict mode code which doesn't define any globals. It's inside a
// function because try/catches deoptimize in certain engines.
var cachedSetTimeout;
var cachedClearTimeout;
function defaultSetTimout() {
throw new Error('setTimeout has not been defined');
}
function defaultClearTimeout () {
throw new Error('clearTimeout has not been defined');
}
(function () {
try {
if (typeof setTimeout === 'function') {
cachedSetTimeout = setTimeout;
} else {
cachedSetTimeout = defaultSetTimout;
}
} catch (e) {
cachedSetTimeout = defaultSetTimout;
}
try {
if (typeof clearTimeout === 'function') {
cachedClearTimeout = clearTimeout;
} else {
cachedClearTimeout = defaultClearTimeout;
}
} catch (e) {
cachedClearTimeout = defaultClearTimeout;
}
} ())
function runTimeout(fun) {
if (cachedSetTimeout === setTimeout) {
//normal enviroments in sane situations
return setTimeout(fun, 0);
}
// if setTimeout wasn't available but was latter defined
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
cachedSetTimeout = setTimeout;
return setTimeout(fun, 0);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedSetTimeout(fun, 0);
} catch(e){
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedSetTimeout.call(null, fun, 0);
} catch(e){
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
return cachedSetTimeout.call(this, fun, 0);
}
}
}
function runClearTimeout(marker) {
if (cachedClearTimeout === clearTimeout) {
//normal enviroments in sane situations
return clearTimeout(marker);
}
// if clearTimeout wasn't available but was latter defined
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
cachedClearTimeout = clearTimeout;
return clearTimeout(marker);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedClearTimeout(marker);
} catch (e){
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedClearTimeout.call(null, marker);
} catch (e){
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
return cachedClearTimeout.call(this, marker);
}
}
}
var queue = [];
var draining = false;
var currentQueue;
var queueIndex = -1;
function cleanUpNextTick() {
if (!draining || !currentQueue) {
return;
}
draining = false;
if (currentQueue.length) {
queue = currentQueue.concat(queue);
} else {
queueIndex = -1;
}
if (queue.length) {
drainQueue();
}
}
function drainQueue() {
if (draining) {
return;
}
var timeout = runTimeout(cleanUpNextTick);
draining = true;
var len = queue.length;
while(len) {
currentQueue = queue;
queue = [];
while (++queueIndex < len) {
if (currentQueue) {
currentQueue[queueIndex].run();
}
}
queueIndex = -1;
len = queue.length;
}
currentQueue = null;
draining = false;
runClearTimeout(timeout);
}
process.nextTick = function (fun) {
var args = new Array(arguments.length - 1);
if (arguments.length > 1) {
for (var i = 1; i < arguments.length; i++) {
args[i - 1] = arguments[i];
}
}
queue.push(new Item(fun, args));
if (queue.length === 1 && !draining) {
runTimeout(drainQueue);
}
};
// v8 likes predictible objects
function Item(fun, array) {
this.fun = fun;
this.array = array;
}
Item.prototype.run = function () {
this.fun.apply(null, this.array);
};
process.title = 'browser';
process.browser = true;
process.env = {};
process.argv = [];
process.version = ''; // empty string to avoid regexp issues
process.versions = {};
function noop() {}
process.on = noop;
process.addListener = noop;
process.once = noop;
process.off = noop;
process.removeListener = noop;
process.removeAllListeners = noop;
process.emit = noop;
process.prependListener = noop;
process.prependOnceListener = noop;
process.listeners = function (name) { return [] }
process.binding = function (name) {
throw new Error('process.binding is not supported');
};
process.cwd = function () { return '/' };
process.chdir = function (dir) {
throw new Error('process.chdir is not supported');
};
process.umask = function() { return 0; };
/***/ }),
/* 5 */
/***/ (function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
Copyright (c) 2016 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
/* global define */
(function () {
'use strict';
var hasOwn = {}.hasOwnProperty;
function classNames () {
var classes = [];
for (var i = 0; i < arguments.length; i++) {
var arg = arguments[i];
if (!arg) continue;
var argType = typeof arg;
if (argType === 'string' || argType === 'number') {
classes.push(arg);
} else if (Array.isArray(arg)) {
classes.push(classNames.apply(null, arg));
} else if (argType === 'object') {
for (var key in arg) {
if (hasOwn.call(arg, key) && arg[key]) {
classes.push(key);
}
}
}
}
return classes.join(' ');
}
if (typeof module !== 'undefined' && module.exports) {
module.exports = classNames;
} else if (true) {
// register as 'classnames', consistent with npm package name
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function () {
return classNames;
}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
} else {
window.classNames = classNames;
}
}());
/***/ }),
/* 6 */
/***/ (function(module, exports) {
/**
* Checks if `value` is classified as an `Array` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
* @example
*
* _.isArray([1, 2, 3]);
* // => true
*
* _.isArray(document.body.children);
* // => false
*
* _.isArray('abc');
* // => false
*
* _.isArray(_.noop);
* // => false
*/
var isArray = Array.isArray;
module.exports = isArray;
/***/ }),
/* 7 */
/***/ (function(module, exports) {
/**
* Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
* @example
*
* _.isObject({});
* // => true
*
* _.isObject([1, 2, 3]);
* // => true
*
* _.isObject(_.noop);
* // => true
*
* _.isObject(null);
* // => false
*/
function isObject(value) {
var type = typeof value;
return value != null && (type == 'object' || type == 'function');
}
module.exports = isObject;
/***/ }),
/* 8 */
/***/ (function(module, exports, __webpack_require__) {
var baseIsNative = __webpack_require__(143),
getValue = __webpack_require__(146);
/**
* Gets the native function at `key` of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {string} key The key of the method to get.
* @returns {*} Returns the function if it's native, else `undefined`.
*/
function getNative(object, key) {
var value = getValue(object, key);
return baseIsNative(value) ? value : undefined;
}
module.exports = getNative;
/***/ }),
/* 9 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
module.exports = exports['default'];
/***/ }),
/* 10 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
exports.default = function (componentOrElement) {
return (0, _ownerDocument2.default)(_reactDom2.default.findDOMNode(componentOrElement));
};
var _reactDom = __webpack_require__(2);
var _reactDom2 = _interopRequireDefault(_reactDom);
var _ownerDocument = __webpack_require__(15);
var _ownerDocument2 = _interopRequireDefault(_ownerDocument);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
module.exports = exports['default'];
/***/ }),
/* 11 */
/***/ (function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(12),
getRawTag = __webpack_require__(124),
objectToString = __webpack_require__(125);
/** `Object#toString` result references. */
var nullTag = '[object Null]',
undefinedTag = '[object Undefined]';
/** Built-in value references. */
var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
/**
* The base implementation of `getTag` without fallbacks for buggy environments.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the `toStringTag`.
*/
function baseGetTag(value) {
if (value == null) {
return value === undefined ? undefinedTag : nullTag;
}
return (symToStringTag && symToStringTag in Object(value))
? getRawTag(value)
: objectToString(value);
}
module.exports = baseGetTag;
/***/ }),
/* 12 */
/***/ (function(module, exports, __webpack_require__) {
var root = __webpack_require__(3);
/** Built-in value references. */
var Symbol = root.Symbol;
module.exports = Symbol;
/***/ }),
/* 13 */
/***/ (function(module, exports) {
/**
* Checks if `value` is object-like. A value is object-like if it's not `null`
* and has a `typeof` result of "object".
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
* @example
*
* _.isObjectLike({});
* // => true
*
* _.isObjectLike([1, 2, 3]);
* // => true
*
* _.isObjectLike(_.noop);
* // => false
*
* _.isObjectLike(null);
* // => false
*/
function isObjectLike(value) {
return value != null && typeof value == 'object';
}
module.exports = isObjectLike;
/***/ }),
/* 14 */
/***/ (function(module, exports, __webpack_require__) {
var arrayLikeKeys = __webpack_require__(81),
baseKeys = __webpack_require__(172),
isArrayLike = __webpack_require__(20);
/**
* Creates an array of the own enumerable property names of `object`.
*
* **Note:** Non-object values are coerced to objects. See the
* [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* for more details.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.keys(new Foo);
* // => ['a', 'b'] (iteration order is not guaranteed)
*
* _.keys('hi');
* // => ['0', '1']
*/
function keys(object) {
return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
}
module.exports = keys;
/***/ }),
/* 15 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = ownerDocument;
function ownerDocument(node) {
return node && node.ownerDocument || document;
}
module.exports = exports["default"];
/***/ }),
/* 16 */
/***/ (function(module, exports, __webpack_require__) {
var isArray = __webpack_require__(6),
isKey = __webpack_require__(60),
stringToPath = __webpack_require__(232),
toString = __webpack_require__(106);
/**
* Casts `value` to a path array if it's not one.
*
* @private
* @param {*} value The value to inspect.
* @param {Object} [object] The object to query keys on.
* @returns {Array} Returns the cast property path array.
*/
function castPath(value, object) {
if (isArray(value)) {
return value;
}
return isKey(value, object) ? [value] : stringToPath(toString(value));
}
module.exports = castPath;
/***/ }),
/* 17 */
/***/ (function(module, exports, __webpack_require__) {
var isSymbol = __webpack_require__(25);
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0;
/**
* Converts `value` to a string key if it's not a string or symbol.
*
* @private
* @param {*} value The value to inspect.
* @returns {string|symbol} Returns the key.
*/
function toKey(value) {
if (typeof value == 'string' || isSymbol(value)) {
return value;
}
var result = (value + '');
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
}
module.exports = toKey;
/***/ }),
/* 18 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(process) {
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isPlainObject2 = __webpack_require__(61);
var _isPlainObject3 = _interopRequireDefault(_isPlainObject2);
var _invariant = __webpack_require__(111);
var _invariant2 = _interopRequireDefault(_invariant);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Retrieves the display string from an option. Options can be the string
* themselves, or an object with a defined display string. Anything else throws
* an error.
*/
function getOptionLabel(option, labelKey) {
var optionLabel = void 0;
if (typeof option === 'string') {
optionLabel = option;
}
if (typeof labelKey === 'function') {
// This overwrites string options, but we assume the consumer wants to do
// something custom if `labelKey` is a function.
optionLabel = labelKey(option);
} else if (typeof labelKey === 'string' && (0, _isPlainObject3.default)(option)) {
optionLabel = option[labelKey];
}
!(typeof optionLabel === 'string') ? process.env.NODE_ENV !== 'production' ? (0, _invariant2.default)(false, 'One or more options does not have a valid label string. Check the ' + '`labelKey` prop to ensure that it matches the correct option key and ' + 'provides a string for filtering and display.') : (0, _invariant2.default)(false) : void 0;
return optionLabel;
}
exports.default = getOptionLabel;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 19 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = warn;
exports._resetWarned = _resetWarned;
var _warning = __webpack_require__(54);
var _warning2 = _interopRequireDefault(_warning);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var warned = {}; /**
* This code is copied from: https://github.com/ReactTraining/react-router/blob/master/modules/routerWarning.js
*/
function warn(falseToWarn, message) {
// Only issue deprecation warnings once.
if (message.indexOf('deprecated') !== -1) {
if (warned[message]) {
return;
}
warned[message] = true;
}
message = '[react-bootstrap-typeahead] ' + message;
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
args[_key - 2] = arguments[_key];
}
_warning2.default.apply(undefined, [falseToWarn, message].concat(args));
}
function _resetWarned() {
warned = {};
}
/***/ }),
/* 20 */
/***/ (function(module, exports, __webpack_require__) {
var isFunction = __webpack_require__(42),
isLength = __webpack_require__(49);
/**
* Checks if `value` is array-like. A value is considered array-like if it's
* not a function and has a `value.length` that's an integer greater than or
* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
* @example
*
* _.isArrayLike([1, 2, 3]);
* // => true
*
* _.isArrayLike(document.body.children);
* // => true
*
* _.isArrayLike('abc');
* // => true
*
* _.isArrayLike(_.noop);
* // => false
*/
function isArrayLike(value) {
return value != null && isLength(value.length) && !isFunction(value);
}
module.exports = isArrayLike;
/***/ }),
/* 21 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = offset;
var _contains = __webpack_require__(51);
var _contains2 = _interopRequireDefault(_contains);
var _isWindow = __webpack_require__(22);
var _isWindow2 = _interopRequireDefault(_isWindow);
var _ownerDocument = __webpack_require__(15);
var _ownerDocument2 = _interopRequireDefault(_ownerDocument);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function offset(node) {
var doc = (0, _ownerDocument2.default)(node),
win = (0, _isWindow2.default)(doc),
docElem = doc && doc.documentElement,
box = { top: 0, left: 0, height: 0, width: 0 };
if (!doc) return;
// Make sure it's not a disconnected DOM node
if (!(0, _contains2.default)(docElem, node)) return box;
if (node.getBoundingClientRect !== undefined) box = node.getBoundingClientRect();
// IE8 getBoundingClientRect doesn't support width & height
box = {
top: box.top + (win.pageYOffset || docElem.scrollTop) - (docElem.clientTop || 0),
left: box.left + (win.pageXOffset || docElem.scrollLeft) - (docElem.clientLeft || 0),
width: (box.width == null ? node.offsetWidth : box.width) || 0,
height: (box.height == null ? node.offsetHeight : box.height) || 0
};
return box;
}
module.exports = exports['default'];
/***/ }),
/* 22 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = getWindow;
function getWindow(node) {
return node === node.window ? node : node.nodeType === 9 ? node.defaultView || node.parentWindow : false;
}
module.exports = exports["default"];
/***/ }),
/* 23 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _createChainableTypeChecker = __webpack_require__(91);
var _createChainableTypeChecker2 = _interopRequireDefault(_createChainableTypeChecker);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
var propType = typeof propValue === 'undefined' ? 'undefined' : _typeof(propValue);
if (_react2.default.isValidElement(propValue)) {
return new Error('Invalid ' + location + ' `' + propFullName + '` of type ReactElement ' + ('supplied to `' + componentName + '`, expected a ReactComponent or a ') + 'DOMElement. You can usually obtain a ReactComponent or DOMElement ' + 'from a ReactElement by attaching a ref to it.');
}
if ((propType !== 'object' || typeof propValue.render !== 'function') && propValue.nodeType !== 1) {
return new Error('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected a ReactComponent or a ') + 'DOMElement.');
}
return null;
}
exports.default = (0, _createChainableTypeChecker2.default)(validate);
module.exports = exports['default'];
/***/ }),
/* 24 */
/***/ (function(module, exports, __webpack_require__) {
var assignValue = __webpack_require__(57),
baseAssignValue = __webpack_require__(100);
/**
* Copies properties of `source` to `object`.
*
* @private
* @param {Object} source The object to copy properties from.
* @param {Array} props The property identifiers to copy.
* @param {Object} [object={}] The object to copy properties to.
* @param {Function} [customizer] The function to customize copied values.
* @returns {Object} Returns `object`.
*/
function copyObject(source, props, object, customizer) {
var isNew = !object;
object || (object = {});
var index = -1,
length = props.length;
while (++index < length) {
var key = props[index];
var newValue = customizer
? customizer(object[key], source[key], key, object, source)
: undefined;
if (newValue === undefined) {
newValue = source[key];
}
if (isNew) {
baseAssignValue(object, key, newValue);
} else {
assignValue(object, key, newValue);
}
}
return object;
}
module.exports = copyObject;
/***/ }),
/* 25 */
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(11),
isObjectLike = __webpack_require__(13);
/** `Object#toString` result references. */
var symbolTag = '[object Symbol]';
/**
* Checks if `value` is classified as a `Symbol` primitive or object.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
* @example
*
* _.isSymbol(Symbol.iterator);
* // => true
*
* _.isSymbol('abc');
* // => false
*/
function isSymbol(value) {
return typeof value == 'symbol' ||
(isObjectLike(value) && baseGetTag(value) == symbolTag);
}
module.exports = isSymbol;
/***/ }),
/* 26 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
/**
* Use invariant() to assert state which your program assumes to be true.
*
* Provide sprintf-style format (only %s is supported) and arguments
* to provide information about what broke and what you were
* expecting.
*
* The invariant message will be stripped in production, but the invariant
* will remain to ensure logic does not differ in production.
*/
var validateFormat = function validateFormat(format) {};
if (process.env.NODE_ENV !== 'production') {
validateFormat = function validateFormat(format) {
if (format === undefined) {
throw new Error('invariant requires an error message argument');
}
};
}
function invariant(condition, format, a, b, c, d, e, f) {
validateFormat(format);
if (!condition) {
var error;
if (format === undefined) {
error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
} else {
var args = [a, b, c, d, e, f];
var argIndex = 0;
error = new Error(format.replace(/%s/g, function () {
return args[argIndex++];
}));
error.name = 'Invariant Violation';
}
error.framesToPop = 1; // we don't care about invariant's own frame
throw error;
}
}
module.exports = invariant;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 27 */
/***/ (function(module, exports, __webpack_require__) {
var listCacheClear = __webpack_require__(133),
listCacheDelete = __webpack_require__(134),
listCacheGet = __webpack_require__(135),
listCacheHas = __webpack_require__(136),
listCacheSet = __webpack_require__(137);
/**
* Creates an list cache object.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function ListCache(entries) {
var index = -1,
length = entries == null ? 0 : entries.length;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
// Add methods to `ListCache`.
ListCache.prototype.clear = listCacheClear;
ListCache.prototype['delete'] = listCacheDelete;
ListCache.prototype.get = listCacheGet;
ListCache.prototype.has = listCacheHas;
ListCache.prototype.set = listCacheSet;
module.exports = ListCache;
/***/ }),
/* 28 */
/***/ (function(module, exports, __webpack_require__) {
var eq = __webpack_require__(29);
/**
* Gets the index at which the `key` is found in `array` of key-value pairs.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} key The key to search for.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function assocIndexOf(array, key) {
var length = array.length;
while (length--) {
if (eq(array[length][0], key)) {
return length;
}
}
return -1;
}
module.exports = assocIndexOf;
/***/ }),
/* 29 */
/***/ (function(module, exports) {
/**
* Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
* @example
*
* var object = { 'a': 1 };
* var other = { 'a': 1 };
*
* _.eq(object, object);
* // => true
*
* _.eq(object, other);
* // => false
*
* _.eq('a', 'a');
* // => true
*
* _.eq('a', Object('a'));
* // => false
*
* _.eq(NaN, NaN);
* // => true
*/
function eq(value, other) {
return value === other || (value !== value && other !== other);
}
module.exports = eq;
/***/ }),
/* 30 */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(8);
/* Built-in method references that are verified to be native. */
var nativeCreate = getNative(Object, 'create');
module.exports = nativeCreate;
/***/ }),
/* 31 */
/***/ (function(module, exports, __webpack_require__) {
var isKeyable = __webpack_require__(155);
/**
* Gets the data for `map`.
*
* @private
* @param {Object} map The map to query.
* @param {string} key The reference key.
* @returns {*} Returns the map data.
*/
function getMapData(map, key) {
var data = map.__data__;
return isKeyable(key)
? data[typeof key == 'string' ? 'string' : 'hash']
: data.map;
}
module.exports = getMapData;
/***/ }),
/* 32 */
/***/ (function(module, exports) {
/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER = 9007199254740991;
/** Used to detect unsigned integer values. */
var reIsUint = /^(?:0|[1-9]\d*)$/;
/**
* Checks if `value` is a valid array-like index.
*
* @private
* @param {*} value The value to check.
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
*/
function isIndex(value, length) {
length = length == null ? MAX_SAFE_INTEGER : length;
return !!length &&
(typeof value == 'number' || reIsUint.test(value)) &&
(value > -1 && value % 1 == 0 && value < length);
}
module.exports = isIndex;
/***/ }),
/* 33 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
exports.default = function (node, event, handler, capture) {
(0, _on2.default)(node, event, handler, capture);
return {
remove: function remove() {
(0, _off2.default)(node, event, handler, capture);
}
};
};
var _on = __webpack_require__(187);
var _on2 = _interopRequireDefault(_on);
var _off = __webpack_require__(188);
var _off2 = _interopRequireDefault(_off);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
module.exports = exports['default'];
/***/ }),
/* 34 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
exports.default = getContainer;
var _reactDom = __webpack_require__(2);
var _reactDom2 = _interopRequireDefault(_reactDom);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function getContainer(container, defaultContainer) {
container = typeof container === 'function' ? container() : container;
return _reactDom2.default.findDOMNode(container) || defaultContainer;
}
module.exports = exports['default'];
/***/ }),
/* 35 */
/***/ (function(module, exports, __webpack_require__) {
var castPath = __webpack_require__(16),
toKey = __webpack_require__(17);
/**
* The base implementation of `_.get` without support for default values.
*
* @private
* @param {Object} object The object to query.
* @param {Array|string} path The path of the property to get.
* @returns {*} Returns the resolved value.
*/
function baseGet(object, path) {
path = castPath(path, object);
var index = 0,
length = path.length;
while (object != null && index < length) {
object = object[toKey(path[index++])];
}
return (index && index == length) ? object : undefined;
}
module.exports = baseGet;
/***/ }),
/* 36 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
function makeEmptyFunction(arg) {
return function () {
return arg;
};
}
/**
* This function accepts and discards inputs; it has no side effects. This is
* primarily useful idiomatically for overridable function endpoints which
* always need to be callable, since JS lacks a null-call idiom ala Cocoa.
*/
var emptyFunction = function emptyFunction() {};
emptyFunction.thatReturns = makeEmptyFunction;
emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
emptyFunction.thatReturnsNull = makeEmptyFunction(null);
emptyFunction.thatReturnsThis = function () {
return this;
};
emptyFunction.thatReturnsArgument = function (arg) {
return arg;
};
module.exports = emptyFunction;
/***/ }),
/* 37 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright (c) 2014-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
var emptyFunction = __webpack_require__(36);
/**
* Similar to invariant but only logs a warning if the condition is not met.
* This can be used to log issues in development environments in critical
* paths. Removing the logging code for production environments will keep the
* same logic and follow the same code paths.
*/
var warning = emptyFunction;
if (process.env.NODE_ENV !== 'production') {
var printWarning = function printWarning(format) {
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
var argIndex = 0;
var message = 'Warning: ' + format.replace(/%s/g, function () {
return args[argIndex++];
});
if (typeof console !== 'undefined') {
console.error(message);
}
try {
// --- Welcome to debugging React ---
// This error was thrown as a convenience so that you can use this stack
// to find the callsite that caused this warning to fire.
throw new Error(message);
} catch (x) {}
};
warning = function warning(condition, format) {
if (format === undefined) {
throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
}
if (format.indexOf('Failed Composite propType: ') === 0) {
return; // Ignore CompositeComponent proptype check.
}
if (!condition) {
for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
args[_key2 - 2] = arguments[_key2];
}
printWarning.apply(undefined, [format].concat(args));
}
};
}
module.exports = warning;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 38 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
module.exports = ReactPropTypesSecret;
/***/ }),
/* 39 */
/***/ (function(module, exports, __webpack_require__) {
var baseIsEqualDeep = __webpack_require__(132),
isObjectLike = __webpack_require__(13);
/**
* The base implementation of `_.isEqual` which supports partial comparisons
* and tracks traversed objects.
*
* @private
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @param {boolean} bitmask The bitmask flags.
* 1 - Unordered comparison
* 2 - Partial comparison
* @param {Function} [customizer] The function to customize comparisons.
* @param {Object} [stack] Tracks traversed `value` and `other` objects.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
*/
function baseIsEqual(value, other, bitmask, customizer, stack) {
if (value === other) {
return true;
}
if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
return value !== value && other !== other;
}
return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
}
module.exports = baseIsEqual;
/***/ }),
/* 40 */
/***/ (function(module, exports, __webpack_require__) {
var ListCache = __webpack_require__(27),
stackClear = __webpack_require__(138),
stackDelete = __webpack_require__(139),
stackGet = __webpack_require__(140),
stackHas = __webpack_require__(141),
stackSet = __webpack_require__(142);
/**
* Creates a stack cache object to store key-value pairs.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function Stack(entries) {
var data = this.__data__ = new ListCache(entries);
this.size = data.size;
}
// Add methods to `Stack`.
Stack.prototype.clear = stackClear;
Stack.prototype['delete'] = stackDelete;
Stack.prototype.get = stackGet;
Stack.prototype.has = stackHas;
Stack.prototype.set = stackSet;
module.exports = Stack;
/***/ }),
/* 41 */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(8),
root = __webpack_require__(3);
/* Built-in method references that are verified to be native. */
var Map = getNative(root, 'Map');
module.exports = Map;
/***/ }),
/* 42 */
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(11),
isObject = __webpack_require__(7);
/** `Object#toString` result references. */
var asyncTag = '[object AsyncFunction]',
funcTag = '[object Function]',
genTag = '[object GeneratorFunction]',
proxyTag = '[object Proxy]';
/**
* Checks if `value` is classified as a `Function` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
* @example
*
* _.isFunction(_);
* // => true
*
* _.isFunction(/abc/);
* // => false
*/
function isFunction(value) {
if (!isObject(value)) {
return false;
}
// The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 9 which returns 'object' for typed arrays and other constructors.
var tag = baseGetTag(value);
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
}
module.exports = isFunction;
/***/ }),
/* 43 */
/***/ (function(module, exports, __webpack_require__) {
var mapCacheClear = __webpack_require__(147),
mapCacheDelete = __webpack_require__(154),
mapCacheGet = __webpack_require__(156),
mapCacheHas = __webpack_require__(157),
mapCacheSet = __webpack_require__(158);
/**
* Creates a map cache object to store key-value pairs.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function MapCache(entries) {
var index = -1,
length = entries == null ? 0 : entries.length;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
// Add methods to `MapCache`.
MapCache.prototype.clear = mapCacheClear;
MapCache.prototype['delete'] = mapCacheDelete;
MapCache.prototype.get = mapCacheGet;
MapCache.prototype.has = mapCacheHas;
MapCache.prototype.set = mapCacheSet;
module.exports = MapCache;
/***/ }),
/* 44 */
/***/ (function(module, exports) {
/**
* Appends the elements of `values` to `array`.
*
* @private
* @param {Array} array The array to modify.
* @param {Array} values The values to append.
* @returns {Array} Returns `array`.
*/
function arrayPush(array, values) {
var index = -1,
length = values.length,
offset = array.length;
while (++index < length) {
array[offset + index] = values[index];
}
return array;
}
module.exports = arrayPush;
/***/ }),
/* 45 */
/***/ (function(module, exports, __webpack_require__) {
var arrayFilter = __webpack_require__(165),
stubArray = __webpack_require__(80);
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Built-in value references. */
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetSymbols = Object.getOwnPropertySymbols;
/**
* Creates an array of the own enumerable symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of symbols.
*/
var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
if (object == null) {
return [];
}
object = Object(object);
return arrayFilter(nativeGetSymbols(object), function(symbol) {
return propertyIsEnumerable.call(object, symbol);
});
};
module.exports = getSymbols;
/***/ }),
/* 46 */
/***/ (function(module, exports, __webpack_require__) {
var baseIsArguments = __webpack_require__(167),
isObjectLike = __webpack_require__(13);
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/** Built-in value references. */
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
/**
* Checks if `value` is likely an `arguments` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
* else `false`.
* @example
*
* _.isArguments(function() { return arguments; }());
* // => true
*
* _.isArguments([1, 2, 3]);
* // => false
*/
var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
!propertyIsEnumerable.call(value, 'callee');
};
module.exports = isArguments;
/***/ }),
/* 47 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(3),
stubFalse = __webpack_require__(168);
/** Detect free variable `exports`. */
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
/** Detect free variable `module`. */
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = freeModule && freeModule.exports === freeExports;
/** Built-in value references. */
var Buffer = moduleExports ? root.Buffer : undefined;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
/**
* Checks if `value` is a buffer.
*
* @static
* @memberOf _
* @since 4.3.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
* @example
*
* _.isBuffer(new Buffer(2));
* // => true
*
* _.isBuffer(new Uint8Array(2));
* // => false
*/
var isBuffer = nativeIsBuffer || stubFalse;
module.exports = isBuffer;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(48)(module)))
/***/ }),
/* 48 */
/***/ (function(module, exports) {
module.exports = function(module) {
if(!module.webpackPolyfill) {
module.deprecate = function() {};
module.paths = [];
// module.parent = undefined by default
if(!module.children) module.children = [];
Object.defineProperty(module, "loaded", {
enumerable: true,
get: function() {
return module.l;
}
});
Object.defineProperty(module, "id", {
enumerable: true,
get: function() {
return module.i;
}
});
module.webpackPolyfill = 1;
}
return module;
};
/***/ }),
/* 49 */
/***/ (function(module, exports) {
/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER = 9007199254740991;
/**
* Checks if `value` is a valid array-like length.
*
* **Note:** This method is loosely based on
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
* @example
*
* _.isLength(3);
* // => true
*
* _.isLength(Number.MIN_VALUE);
* // => false
*
* _.isLength(Infinity);
* // => false
*
* _.isLength('3');
* // => false
*/
function isLength(value) {
return typeof value == 'number' &&
value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
}
module.exports = isLength;
/***/ }),
/* 50 */
/***/ (function(module, exports) {
/** Used for built-in method references. */
var objectProto = Object.prototype;
/**
* Checks if `value` is likely a prototype object.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
*/
function isPrototype(value) {
var Ctor = value && value.constructor,
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
return value === proto;
}
module.exports = isPrototype;
/***/ }),
/* 51 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _inDOM = __webpack_require__(9);
var _inDOM2 = _interopRequireDefault(_inDOM);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = function () {
// HTML DOM and SVG DOM may have different support levels,
// so we need to check on context instead of a document root element.
return _inDOM2.default ? function (context, node) {
if (context.contains) {
return context.contains(node);
} else if (context.compareDocumentPosition) {
return context === node || !!(context.compareDocumentPosition(node) & 16);
} else {
return fallback(context, node);
}
} : fallback;
}();
function fallback(context, node) {
if (node) do {
if (node === context) return true;
} while (node = node.parentNode);
return false;
}
module.exports = exports['default'];
/***/ }),
/* 52 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = style;
var _camelizeStyle = __webpack_require__(87);
var _camelizeStyle2 = _interopRequireDefault(_camelizeStyle);
var _hyphenateStyle = __webpack_require__(181);
var _hyphenateStyle2 = _interopRequireDefault(_hyphenateStyle);
var _getComputedStyle2 = __webpack_require__(183);
var _getComputedStyle3 = _interopRequireDefault(_getComputedStyle2);
var _removeStyle = __webpack_require__(184);
var _removeStyle2 = _interopRequireDefault(_removeStyle);
var _properties = __webpack_require__(185);
var _isTransform = __webpack_require__(186);
var _isTransform2 = _interopRequireDefault(_isTransform);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function style(node, property, value) {
var css = '';
var transforms = '';
var props = property;
if (typeof property === 'string') {
if (value === undefined) {
return node.style[(0, _camelizeStyle2.default)(property)] || (0, _getComputedStyle3.default)(node).getPropertyValue((0, _hyphenateStyle2.default)(property));
} else {
(props = {})[property] = value;
}
}
Object.keys(props).forEach(function (key) {
var value = props[key];
if (!value && value !== 0) {
(0, _removeStyle2.default)(node, (0, _hyphenateStyle2.default)(key));
} else if ((0, _isTransform2.default)(key)) {
transforms += key + '(' + value + ') ';
} else {
css += (0, _hyphenateStyle2.default)(key) + ': ' + value + ';';
}
});
if (transforms) {
css += _properties.transform + ': ' + transforms + ';';
}
node.style.cssText += ';' + css;
}
module.exports = exports['default'];
/***/ }),
/* 53 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = scrollTop;
var _isWindow = __webpack_require__(22);
var _isWindow2 = _interopRequireDefault(_isWindow);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function scrollTop(node, val) {
var win = (0, _isWindow2.default)(node);
if (val === undefined) return win ? 'pageYOffset' in win ? win.pageYOffset : win.document.documentElement.scrollTop : node.scrollTop;
if (win) win.scrollTo('pageXOffset' in win ? win.pageXOffset : win.document.documentElement.scrollLeft, val);else node.scrollTop = val;
}
module.exports = exports['default'];
/***/ }),
/* 54 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2014-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
/**
* Similar to invariant but only logs a warning if the condition is not met.
* This can be used to log issues in development environments in critical
* paths. Removing the logging code for production environments will keep the
* same logic and follow the same code paths.
*/
var warning = function() {};
if (process.env.NODE_ENV !== 'production') {
warning = function(condition, format, args) {
var len = arguments.length;
args = new Array(len > 2 ? len - 2 : 0);
for (var key = 2; key < len; key++) {
args[key - 2] = arguments[key];
}
if (format === undefined) {
throw new Error(
'`warning(condition, format, ...args)` requires a warning ' +
'message argument'
);
}
if (format.length < 10 || (/^[s\W]*$/).test(format)) {
throw new Error(
'The warning format should be able to uniquely identify this ' +
'warning. Please, use a more descriptive format than: ' + format
);
}
if (!condition) {
var argIndex = 0;
var message = 'Warning: ' +
format.replace(/%s/g, function() {
return args[argIndex++];
});
if (typeof console !== 'undefined') {
console.error(message);
}
try {
// This error was thrown as a convenience so that you can use this stack
// to find the callsite that caused this warning to fire.
throw new Error(message);
} catch(x) {}
}
};
}
module.exports = warning;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 55 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _componentOrElement = __webpack_require__(23);
var _componentOrElement2 = _interopRequireDefault(_componentOrElement);
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _reactDom = __webpack_require__(2);
var _reactDom2 = _interopRequireDefault(_reactDom);
var _getContainer = __webpack_require__(34);
var _getContainer2 = _interopRequireDefault(_getContainer);
var _ownerDocument = __webpack_require__(10);
var _ownerDocument2 = _interopRequireDefault(_ownerDocument);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
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; }
/**
* The `` component renders its children into a new "subtree" outside of current component hierarchy.
* You can think of it as a declarative `appendChild()`, or jQuery's `$.fn.appendTo()`.
* The children of `` component will be appended to the `container` specified.
*/
var Portal = function (_React$Component) {
_inherits(Portal, _React$Component);
function Portal() {
var _temp, _this, _ret;
_classCallCheck(this, Portal);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this._mountOverlayTarget = function () {
if (!_this._overlayTarget) {
_this._overlayTarget = document.createElement('div');
_this._portalContainerNode = (0, _getContainer2.default)(_this.props.container, (0, _ownerDocument2.default)(_this).body);
_this._portalContainerNode.appendChild(_this._overlayTarget);
}
}, _this._unmountOverlayTarget = function () {
if (_this._overlayTarget) {
_this._portalContainerNode.removeChild(_this._overlayTarget);
_this._overlayTarget = null;
}
_this._portalContainerNode = null;
}, _this._renderOverlay = function () {
var overlay = !_this.props.children ? null : _react2.default.Children.only(_this.props.children);
// Save reference for future access.
if (overlay !== null) {
_this._mountOverlayTarget();
_this._overlayInstance = _reactDom2.default.unstable_renderSubtreeIntoContainer(_this, overlay, _this._overlayTarget);
} else {
// Unrender if the component is null for transitions to null
_this._unrenderOverlay();
_this._unmountOverlayTarget();
}
}, _this._unrenderOverlay = function () {
if (_this._overlayTarget) {
_reactDom2.default.unmountComponentAtNode(_this._overlayTarget);
_this._overlayInstance = null;
}
}, _this.getMountNode = function () {
return _this._overlayTarget;
}, _this.getOverlayDOMNode = function () {
if (!_this._isMounted) {
throw new Error('getOverlayDOMNode(): A component must be mounted to have a DOM node.');
}
if (_this._overlayInstance) {
return _reactDom2.default.findDOMNode(_this._overlayInstance);
}
return null;
}, _temp), _possibleConstructorReturn(_this, _ret);
}
Portal.prototype.componentDidMount = function componentDidMount() {
this._isMounted = true;
this._renderOverlay();
};
Portal.prototype.componentDidUpdate = function componentDidUpdate() {
this._renderOverlay();
};
Portal.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
if (this._overlayTarget && nextProps.container !== this.props.container) {
this._portalContainerNode.removeChild(this._overlayTarget);
this._portalContainerNode = (0, _getContainer2.default)(nextProps.container, (0, _ownerDocument2.default)(this).body);
this._portalContainerNode.appendChild(this._overlayTarget);
}
};
Portal.prototype.componentWillUnmount = function componentWillUnmount() {
this._isMounted = false;
this._unrenderOverlay();
this._unmountOverlayTarget();
};
Portal.prototype.render = function render() {
return null;
};
return Portal;
}(_react2.default.Component);
Portal.displayName = 'Portal';
Portal.propTypes = {
/**
* A Node, Component instance, or function that returns either. The `container` will have the Portal children
* appended to it.
*/
container: _propTypes2.default.oneOfType([_componentOrElement2.default, _propTypes2.default.func])
};
exports.default = Portal;
module.exports = exports['default'];
/***/ }),
/* 56 */
/***/ (function(module, exports) {
/**
* This method returns `undefined`.
*
* @static
* @memberOf _
* @since 2.3.0
* @category Util
* @example
*
* _.times(2, _.noop);
* // => [undefined, undefined]
*/
function noop() {
// No operation performed.
}
module.exports = noop;
/***/ }),
/* 57 */
/***/ (function(module, exports, __webpack_require__) {
var baseAssignValue = __webpack_require__(100),
eq = __webpack_require__(29);
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Assigns `value` to `key` of `object` if the existing value is not equivalent
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons.
*
* @private
* @param {Object} object The object to modify.
* @param {string} key The key of the property to assign.
* @param {*} value The value to assign.
*/
function assignValue(object, key, value) {
var objValue = object[key];
if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
(value === undefined && !(key in object))) {
baseAssignValue(object, key, value);
}
}
module.exports = assignValue;
/***/ }),
/* 58 */
/***/ (function(module, exports, __webpack_require__) {
var overArg = __webpack_require__(83);
/** Built-in value references. */
var getPrototype = overArg(Object.getPrototypeOf, Object);
module.exports = getPrototype;
/***/ }),
/* 59 */
/***/ (function(module, exports, __webpack_require__) {
var Uint8Array = __webpack_require__(75);
/**
* Creates a clone of `arrayBuffer`.
*
* @private
* @param {ArrayBuffer} arrayBuffer The array buffer to clone.
* @returns {ArrayBuffer} Returns the cloned array buffer.
*/
function cloneArrayBuffer(arrayBuffer) {
var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
new Uint8Array(result).set(new Uint8Array(arrayBuffer));
return result;
}
module.exports = cloneArrayBuffer;
/***/ }),
/* 60 */
/***/ (function(module, exports, __webpack_require__) {
var isArray = __webpack_require__(6),
isSymbol = __webpack_require__(25);
/** Used to match property names within property paths. */
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
reIsPlainProp = /^\w*$/;
/**
* Checks if `value` is a property name and not a property path.
*
* @private
* @param {*} value The value to check.
* @param {Object} [object] The object to query keys on.
* @returns {boolean} Returns `true` if `value` is a property name, else `false`.
*/
function isKey(value, object) {
if (isArray(value)) {
return false;
}
var type = typeof value;
if (type == 'number' || type == 'symbol' || type == 'boolean' ||
value == null || isSymbol(value)) {
return true;
}
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
(object != null && value in Object(object));
}
module.exports = isKey;
/***/ }),
/* 61 */
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(11),
getPrototype = __webpack_require__(58),
isObjectLike = __webpack_require__(13);
/** `Object#toString` result references. */
var objectTag = '[object Object]';
/** Used for built-in method references. */
var funcProto = Function.prototype,
objectProto = Object.prototype;
/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/** Used to infer the `Object` constructor. */
var objectCtorString = funcToString.call(Object);
/**
* Checks if `value` is a plain object, that is, an object created by the
* `Object` constructor or one with a `[[Prototype]]` of `null`.
*
* @static
* @memberOf _
* @since 0.8.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
* @example
*
* function Foo() {
* this.a = 1;
* }
*
* _.isPlainObject(new Foo);
* // => false
*
* _.isPlainObject([1, 2, 3]);
* // => false
*
* _.isPlainObject({ 'x': 0, 'y': 0 });
* // => true
*
* _.isPlainObject(Object.create(null));
* // => true
*/
function isPlainObject(value) {
if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
return false;
}
var proto = getPrototype(value);
if (proto === null) {
return true;
}
var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
return typeof Ctor == 'function' && Ctor instanceof Ctor &&
funcToString.call(Ctor) == objectCtorString;
}
module.exports = isPlainObject;
/***/ }),
/* 62 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* KeyCode
*
* Map of common (non-printable) keycodes for the `keydown` and `keyup` events.
* Note that `keypress` handles things differently and may not return the same
* values.
*/
module.exports = {
BACKSPACE: 8,
TAB: 9,
RETURN: 13,
ESC: 27,
SPACE: 32,
LEFT: 37,
UP: 38,
RIGHT: 39,
DOWN: 40
};
/***/ }),
/* 63 */
/***/ (function(module, exports) {
/**
* Gets the first element of `array`.
*
* @static
* @memberOf _
* @since 0.1.0
* @alias first
* @category Array
* @param {Array} array The array to query.
* @returns {*} Returns the first element of `array`.
* @example
*
* _.head([1, 2, 3]);
* // => 1
*
* _.head([]);
* // => undefined
*/
function head(array) {
return (array && array.length) ? array[0] : undefined;
}
module.exports = head;
/***/ }),
/* 64 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.BaseMenuItem = undefined;
var _noop2 = __webpack_require__(56);
var _noop3 = _interopRequireDefault(_noop2);
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 _classnames = __webpack_require__(5);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _menuItemContainer = __webpack_require__(115);
var _menuItemContainer2 = _interopRequireDefault(_menuItemContainer);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
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 BaseMenuItem = function (_React$Component) {
_inherits(BaseMenuItem, _React$Component);
function BaseMenuItem(props) {
_classCallCheck(this, BaseMenuItem);
var _this = _possibleConstructorReturn(this, (BaseMenuItem.__proto__ || Object.getPrototypeOf(BaseMenuItem)).call(this, props));
_this.displayName = 'BaseMenuItem';
_this._handleClick = _this._handleClick.bind(_this);
return _this;
}
_createClass(BaseMenuItem, [{
key: 'render',
value: function render() {
var _props = this.props,
active = _props.active,
children = _props.children,
className = _props.className,
disabled = _props.disabled;
var conditionalClassNames = {
'active': active,
'disabled': disabled
};
return _react2.default.createElement(
'li',
{
className: (0, _classnames2.default)(conditionalClassNames, className) },
_react2.default.createElement(
'a',
{
className: (0, _classnames2.default)('dropdown-item', conditionalClassNames),
href: '#',
onClick: this._handleClick,
role: 'button' },
children
)
);
}
}, {
key: '_handleClick',
value: function _handleClick(e) {
var _props2 = this.props,
disabled = _props2.disabled,
onClick = _props2.onClick;
e.preventDefault();
!disabled && onClick(e);
}
}]);
return BaseMenuItem;
}(_react2.default.Component);
BaseMenuItem.defaultProps = {
onClick: _noop3.default
};
var MenuItem = (0, _menuItemContainer2.default)(BaseMenuItem);
exports.BaseMenuItem = BaseMenuItem;
exports.default = MenuItem;
/***/ }),
/* 65 */
/***/ (function(module, exports, __webpack_require__) {
var baseMatches = __webpack_require__(272),
baseMatchesProperty = __webpack_require__(275),
identity = __webpack_require__(108),
isArray = __webpack_require__(6),
property = __webpack_require__(277);
/**
* The base implementation of `_.iteratee`.
*
* @private
* @param {*} [value=_.identity] The value to convert to an iteratee.
* @returns {Function} Returns the iteratee.
*/
function baseIteratee(value) {
// Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
// See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
if (typeof value == 'function') {
return value;
}
if (value == null) {
return identity;
}
if (typeof value == 'object') {
return isArray(value)
? baseMatchesProperty(value[0], value[1])
: baseMatches(value);
}
return property(value);
}
module.exports = baseIteratee;
/***/ }),
/* 66 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _debounce2 = __webpack_require__(121);
var _debounce3 = _interopRequireDefault(_debounce2);
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 _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
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; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
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 DEFAULT_DELAY_MS = 200;
/**
* HoC that encapsulates common behavior and functionality for doing
* asynchronous searches, including:
*
* - Debouncing user input
* - Query caching (optional)
* - Search prompt and empty results behaviors
*/
var asyncContainer = function asyncContainer(Typeahead) {
var Container = function (_React$Component) {
_inherits(Container, _React$Component);
function Container(props) {
_classCallCheck(this, Container);
var _this = _possibleConstructorReturn(this, (Container.__proto__ || Object.getPrototypeOf(Container)).call(this, props));
_this._handleChange = _this._handleChange.bind(_this);
_this._handleInputChange = _this._handleInputChange.bind(_this);
_this._handleSearch = _this._handleSearch.bind(_this);
_this.state = {
hasSelection: false,
query: '',
requestPending: false
};
return _this;
}
_createClass(Container, [{
key: 'componentWillMount',
value: function componentWillMount() {
this._cache = {};
this._handleSearchDebounced = (0, _debounce3.default)(this._handleSearch, this.props.delay);
}
}, {
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(nextProps) {
var options = nextProps.options,
useCache = nextProps.useCache;
var _state = this.state,
query = _state.query,
requestPending = _state.requestPending;
if (!requestPending) {
return;
}
if (useCache) {
this._cache[query] = options;
}
this.setState({ requestPending: false });
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
this._cache = {};
this._handleSearchDebounced.cancel();
}
}, {
key: 'render',
value: function render() {
var _this2 = this;
var _props = this.props,
allowNew = _props.allowNew,
options = _props.options,
useCache = _props.useCache,
props = _objectWithoutProperties(_props, ['allowNew', 'options', 'useCache']);
var cachedQuery = this._cache[this.state.query];
var emptyLabel = this._getEmptyLabel();
// Short-circuit the creation of custom selections while the user is in
// the process of searching. The logic for whether or not to display the
// custom menu option is basically the same as whether we display the
// empty label, so use that as a proxy.
var shouldAllowNew = allowNew && emptyLabel === props.emptyLabel;
return _react2.default.createElement(Typeahead, _extends({}, props, {
allowNew: shouldAllowNew,
emptyLabel: emptyLabel,
isLoading: this.state.requestPending,
onChange: this._handleChange,
onInputChange: this._handleInputChange,
options: useCache && cachedQuery ? cachedQuery : options,
ref: function ref(instance) {
return _this2._instance = instance;
}
}));
}
/**
* Make the component instance available.
*/
}, {
key: 'getInstance',
value: function getInstance() {
return this._instance.getInstance();
}
}, {
key: '_getEmptyLabel',
value: function _getEmptyLabel() {
var _props2 = this.props,
emptyLabel = _props2.emptyLabel,
multiple = _props2.multiple,
promptText = _props2.promptText,
searchText = _props2.searchText,
useCache = _props2.useCache;
var _state2 = this.state,
hasSelection = _state2.hasSelection,
query = _state2.query,
requestPending = _state2.requestPending;
if (!query.length || !multiple && hasSelection) {
return promptText;
}
if (requestPending || useCache && !this._cache[query]) {
return searchText;
}
return emptyLabel;
}
}, {
key: '_handleChange',
value: function _handleChange(selected) {
this.props.onChange && this.props.onChange(selected);
this.setState({ hasSelection: !!selected.length });
}
}, {
key: '_handleInputChange',
value: function _handleInputChange(query) {
this.props.onInputChange && this.props.onInputChange(query);
this._handleSearchDebounced(query);
}
}, {
key: '_handleSearch',
value: function _handleSearch(initialQuery) {
var _props3 = this.props,
caseSensitive = _props3.caseSensitive,
minLength = _props3.minLength,
multiple = _props3.multiple,
onSearch = _props3.onSearch,
useCache = _props3.useCache;
var query = initialQuery.trim();
if (!caseSensitive) {
query = query.toLowerCase();
}
this.setState({ query: query });
if (!query || minLength && query.length < minLength) {
return;
}
// Use cached results, if available.
if (useCache && this._cache[query]) {
return;
}
// In the single-selection case, perform a search only on user input
// not selection.
if (!multiple && this.state.hasSelection) {
return;
}
// Perform the async search.
this.setState({ requestPending: true }, function () {
return onSearch(query);
});
}
}]);
return Container;
}(_react2.default.Component);
Container.propTypes = {
/**
* Delay, in milliseconds, before performing search.
*/
delay: _propTypes2.default.number,
/**
* Callback to perform when the search is executed.
*/
onSearch: _propTypes2.default.func.isRequired,
/**
* Options to be passed to the typeahead. Will typically be the query
* results, but can also be initial default options.
*/
options: _propTypes2.default.array,
/**
* Text displayed in the menu when there is no user input.
*/
promptText: _propTypes2.default.string,
/**
* Text displayed in the menu while the request is pending.
*/
searchText: _propTypes2.default.string,
/**
* Whether or not the component should cache query results.
*/
useCache: _propTypes2.default.bool
};
Container.defaultProps = {
delay: DEFAULT_DELAY_MS,
minLength: 2,
options: [],
promptText: 'Type to search...',
searchText: 'Searching...',
useCache: true
};
return Container;
};
exports.default = asyncContainer;
/***/ }),
/* 67 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
module.exports = freeGlobal;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(123)))
/***/ }),
/* 68 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(7),
isSymbol = __webpack_require__(25);
/** Used as references for various `Number` constants. */
var NAN = 0 / 0;
/** Used to match leading and trailing whitespace. */
var reTrim = /^\s+|\s+$/g;
/** Used to detect bad signed hexadecimal string values. */
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
/** Used to detect binary string values. */
var reIsBinary = /^0b[01]+$/i;
/** Used to detect octal string values. */
var reIsOctal = /^0o[0-7]+$/i;
/** Built-in method references without a dependency on `root`. */
var freeParseInt = parseInt;
/**
* Converts `value` to a number.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to process.
* @returns {number} Returns the number.
* @example
*
* _.toNumber(3.2);
* // => 3.2
*
* _.toNumber(Number.MIN_VALUE);
* // => 5e-324
*
* _.toNumber(Infinity);
* // => Infinity
*
* _.toNumber('3.2');
* // => 3.2
*/
function toNumber(value) {
if (typeof value == 'number') {
return value;
}
if (isSymbol(value)) {
return NAN;
}
if (isObject(value)) {
var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
value = isObject(other) ? (other + '') : other;
}
if (typeof value != 'string') {
return value === 0 ? value : +value;
}
value = value.replace(reTrim, '');
var isBinary = reIsBinary.test(value);
return (isBinary || reIsOctal.test(value))
? freeParseInt(value.slice(2), isBinary ? 2 : 8)
: (reIsBadHex.test(value) ? NAN : +value);
}
module.exports = toNumber;
/***/ }),
/* 69 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
/* eslint-disable no-unused-vars */
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
var hasOwnProperty = Object.prototype.hasOwnProperty;
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
function toObject(val) {
if (val === null || val === undefined) {
throw new TypeError('Object.assign cannot be called with null or undefined');
}
return Object(val);
}
function shouldUseNative() {
try {
if (!Object.assign) {
return false;
}
// Detect buggy property enumeration order in older V8 versions.
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
test1[5] = 'de';
if (Object.getOwnPropertyNames(test1)[0] === '5') {
return false;
}
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
var test2 = {};
for (var i = 0; i < 10; i++) {
test2['_' + String.fromCharCode(i)] = i;
}
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
return test2[n];
});
if (order2.join('') !== '0123456789') {
return false;
}
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
var test3 = {};
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
test3[letter] = letter;
});
if (Object.keys(Object.assign({}, test3)).join('') !==
'abcdefghijklmnopqrst') {
return false;
}
return true;
} catch (err) {
// We don't expect any of the above to throw, but better to be safe.
return false;
}
}
module.exports = shouldUseNative() ? Object.assign : function (target, source) {
var from;
var to = toObject(target);
var symbols;
for (var s = 1; s < arguments.length; s++) {
from = Object(arguments[s]);
for (var key in from) {
if (hasOwnProperty.call(from, key)) {
to[key] = from[key];
}
}
if (getOwnPropertySymbols) {
symbols = getOwnPropertySymbols(from);
for (var i = 0; i < symbols.length; i++) {
if (propIsEnumerable.call(from, symbols[i])) {
to[symbols[i]] = from[symbols[i]];
}
}
}
}
return to;
};
/***/ }),
/* 70 */
/***/ (function(module, exports, __webpack_require__) {
"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 _classnames = __webpack_require__(5);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _ClearButton = __webpack_require__(129);
var _ClearButton2 = _interopRequireDefault(_ClearButton);
var _Loader = __webpack_require__(130);
var _Loader2 = _interopRequireDefault(_Loader);
var _Overlay = __webpack_require__(131);
var _Overlay2 = _interopRequireDefault(_Overlay);
var _TypeaheadInput = __webpack_require__(205);
var _TypeaheadInput2 = _interopRequireDefault(_TypeaheadInput);
var _TypeaheadMenu = __webpack_require__(254);
var _TypeaheadMenu2 = _interopRequireDefault(_TypeaheadMenu);
var _addCustomOption = __webpack_require__(269);
var _addCustomOption2 = _interopRequireDefault(_addCustomOption);
var _getTruncatedOptions = __webpack_require__(284);
var _getTruncatedOptions2 = _interopRequireDefault(_getTruncatedOptions);
var _typeaheadContainer = __webpack_require__(285);
var _typeaheadContainer2 = _interopRequireDefault(_typeaheadContainer);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
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 Typeahead = function (_React$Component) {
_inherits(Typeahead, _React$Component);
function Typeahead() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, Typeahead);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Typeahead.__proto__ || Object.getPrototypeOf(Typeahead)).call.apply(_ref, [this].concat(args))), _this), _this._renderMenu = function (results, shouldPaginate) {
var _this$props = _this.props,
align = _this$props.align,
bodyContainer = _this$props.bodyContainer,
className = _this$props.className,
dropup = _this$props.dropup,
emptyLabel = _this$props.emptyLabel,
labelKey = _this$props.labelKey,
maxHeight = _this$props.maxHeight,
minLength = _this$props.minLength,
newSelectionPrefix = _this$props.newSelectionPrefix,
onMenuHide = _this$props.onMenuHide,
onMenuShow = _this$props.onMenuShow,
onPaginate = _this$props.onPaginate,
paginationText = _this$props.paginationText,
renderMenu = _this$props.renderMenu,
renderMenuItemChildren = _this$props.renderMenuItemChildren,
showMenu = _this$props.showMenu,
text = _this$props.text;
var menuProps = {
align: align,
dropup: dropup,
emptyLabel: emptyLabel,
labelKey: labelKey,
maxHeight: maxHeight,
newSelectionPrefix: newSelectionPrefix,
paginationText: paginationText,
onPaginate: onPaginate,
paginate: shouldPaginate,
text: text
};
var menu = typeof renderMenu === 'function' ? renderMenu(results, menuProps) : _react2.default.createElement(_TypeaheadMenu2.default, _extends({}, menuProps, {
options: results,
renderMenuItemChildren: renderMenuItemChildren
}));
var show = !!(showMenu && text.length >= minLength && (results.length || emptyLabel !== ''));
return _react2.default.createElement(
_Overlay2.default,
{
align: align,
className: className,
container: bodyContainer ? document.body : _this,
dropup: dropup,
onMenuHide: onMenuHide,
onMenuShow: onMenuShow,
show: show,
target: _this },
menu
);
}, _this._renderAux = function () {
var _this$props2 = _this.props,
bsSize = _this$props2.bsSize,
clearButton = _this$props2.clearButton,
disabled = _this$props2.disabled,
isLoading = _this$props2.isLoading,
onClear = _this$props2.onClear,
selected = _this$props2.selected;
if (isLoading) {
return _react2.default.createElement(
'div',
{ className: 'rbt-aux' },
_react2.default.createElement(_Loader2.default, { bsSize: bsSize })
);
}
if (clearButton && !disabled && selected.length) {
return _react2.default.createElement(
'div',
{ className: 'rbt-aux' },
_react2.default.createElement(_ClearButton2.default, {
bsSize: bsSize,
onClick: onClear
})
);
}
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(Typeahead, [{
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(nextProps) {
var allowNew = nextProps.allowNew,
onInitialItemChange = nextProps.onInitialItemChange,
onResultsChange = nextProps.onResultsChange,
results = nextProps.results;
// Clear the initial item when there are no results.
if (!(allowNew || results.length)) {
onInitialItemChange(null);
}
if (results.length !== this.props.results.length) {
onResultsChange(results);
}
}
}, {
key: 'render',
value: function render() {
var _this2 = this;
var _props = this.props,
allowNew = _props.allowNew,
bsSize = _props.bsSize,
className = _props.className,
disabled = _props.disabled,
dropup = _props.dropup,
isFocused = _props.isFocused,
labelKey = _props.labelKey,
onInputChange = _props.onInputChange,
onInputFocus = _props.onInputFocus,
_onKeyDown = _props.onKeyDown,
onSelectionAdd = _props.onSelectionAdd,
onSelectionRemove = _props.onSelectionRemove,
paginate = _props.paginate,
shownResults = _props.shownResults,
text = _props.text;
var results = this.props.results.slice();
// This must come before we truncate.
var shouldPaginate = paginate && results.length > shownResults;
// Truncate if necessary.
results = (0, _getTruncatedOptions2.default)(results, shownResults);
// Add the custom option.
if (allowNew) {
results = (0, _addCustomOption2.default)(results, text, labelKey);
}
return _react2.default.createElement(
'div',
{
className: (0, _classnames2.default)('rbt', 'open', 'form-control', {
'dropup': dropup,
'focus': isFocused,
'input-lg form-control-lg': bsSize === 'large' || bsSize === 'lg',
'input-sm form-control-sm': bsSize === 'small' || bsSize === 'sm'
}, className),
disabled: disabled,
onClick: onInputFocus,
onFocus: onInputFocus,
style: { position: 'relative' },
tabIndex: -1 },
_react2.default.createElement(_TypeaheadInput2.default, _extends({}, this.props, {
onAdd: onSelectionAdd,
onChange: onInputChange,
onKeyDown: function onKeyDown(e) {
return _onKeyDown(results, e);
},
onRemove: onSelectionRemove,
options: results,
ref: function ref(input) {
return _this2._input = input;
}
})),
this._renderAux(),
this._renderMenu(results, shouldPaginate)
);
}
}, {
key: 'getInputNode',
value: function getInputNode() {
return this._input.getInputNode();
}
}]);
return Typeahead;
}(_react2.default.Component);
exports.default = (0, _typeaheadContainer2.default)(Typeahead);
/***/ }),
/* 71 */
/***/ (function(module, exports, __webpack_require__) {
var baseIsEqual = __webpack_require__(39);
/**
* Performs a deep comparison between two values to determine if they are
* equivalent.
*
* **Note:** This method supports comparing arrays, array buffers, booleans,
* date objects, error objects, maps, numbers, `Object` objects, regexes,
* sets, strings, symbols, and typed arrays. `Object` objects are compared
* by their own, not inherited, enumerable properties. Functions and DOM
* nodes are compared by strict equality, i.e. `===`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
* @example
*
* var object = { 'a': 1 };
* var other = { 'a': 1 };
*
* _.isEqual(object, other);
* // => true
*
* object === other;
* // => false
*/
function isEqual(value, other) {
return baseIsEqual(value, other);
}
module.exports = isEqual;
/***/ }),
/* 72 */
/***/ (function(module, exports) {
/** Used for built-in method references. */
var funcProto = Function.prototype;
/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;
/**
* Converts `func` to its source code.
*
* @private
* @param {Function} func The function to convert.
* @returns {string} Returns the source code.
*/
function toSource(func) {
if (func != null) {
try {
return funcToString.call(func);
} catch (e) {}
try {
return (func + '');
} catch (e) {}
}
return '';
}
module.exports = toSource;
/***/ }),
/* 73 */
/***/ (function(module, exports, __webpack_require__) {
var SetCache = __webpack_require__(159),
arraySome = __webpack_require__(74),
cacheHas = __webpack_require__(162);
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1,
COMPARE_UNORDERED_FLAG = 2;
/**
* A specialized version of `baseIsEqualDeep` for arrays with support for
* partial deep comparisons.
*
* @private
* @param {Array} array The array to compare.
* @param {Array} other The other array to compare.
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
* @param {Function} customizer The function to customize comparisons.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Object} stack Tracks traversed `array` and `other` objects.
* @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
*/
function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
arrLength = array.length,
othLength = other.length;
if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
return false;
}
// Assume cyclic values are equal.
var stacked = stack.get(array);
if (stacked && stack.get(other)) {
return stacked == other;
}
var index = -1,
result = true,
seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
stack.set(array, other);
stack.set(other, array);
// Ignore non-index properties.
while (++index < arrLength) {
var arrValue = array[index],
othValue = other[index];
if (customizer) {
var compared = isPartial
? customizer(othValue, arrValue, index, other, array, stack)
: customizer(arrValue, othValue, index, array, other, stack);
}
if (compared !== undefined) {
if (compared) {
continue;
}
result = false;
break;
}
// Recursively compare arrays (susceptible to call stack limits).
if (seen) {
if (!arraySome(other, function(othValue, othIndex) {
if (!cacheHas(seen, othIndex) &&
(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
return seen.push(othIndex);
}
})) {
result = false;
break;
}
} else if (!(
arrValue === othValue ||
equalFunc(arrValue, othValue, bitmask, customizer, stack)
)) {
result = false;
break;
}
}
stack['delete'](array);
stack['delete'](other);
return result;
}
module.exports = equalArrays;
/***/ }),
/* 74 */
/***/ (function(module, exports) {
/**
* A specialized version of `_.some` for arrays without support for iteratee
* shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {boolean} Returns `true` if any element passes the predicate check,
* else `false`.
*/
function arraySome(array, predicate) {
var index = -1,
length = array == null ? 0 : array.length;
while (++index < length) {
if (predicate(array[index], index, array)) {
return true;
}
}
return false;
}
module.exports = arraySome;
/***/ }),
/* 75 */
/***/ (function(module, exports, __webpack_require__) {
var root = __webpack_require__(3);
/** Built-in value references. */
var Uint8Array = root.Uint8Array;
module.exports = Uint8Array;
/***/ }),
/* 76 */
/***/ (function(module, exports) {
/**
* Converts `map` to its key-value pairs.
*
* @private
* @param {Object} map The map to convert.
* @returns {Array} Returns the key-value pairs.
*/
function mapToArray(map) {
var index = -1,
result = Array(map.size);
map.forEach(function(value, key) {
result[++index] = [key, value];
});
return result;
}
module.exports = mapToArray;
/***/ }),
/* 77 */
/***/ (function(module, exports) {
/**
* Converts `set` to an array of its values.
*
* @private
* @param {Object} set The set to convert.
* @returns {Array} Returns the values.
*/
function setToArray(set) {
var index = -1,
result = Array(set.size);
set.forEach(function(value) {
result[++index] = value;
});
return result;
}
module.exports = setToArray;
/***/ }),
/* 78 */
/***/ (function(module, exports, __webpack_require__) {
var baseGetAllKeys = __webpack_require__(79),
getSymbols = __webpack_require__(45),
keys = __webpack_require__(14);
/**
* Creates an array of own enumerable property names and symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names and symbols.
*/
function getAllKeys(object) {
return baseGetAllKeys(object, keys, getSymbols);
}
module.exports = getAllKeys;
/***/ }),
/* 79 */
/***/ (function(module, exports, __webpack_require__) {
var arrayPush = __webpack_require__(44),
isArray = __webpack_require__(6);
/**
* The base implementation of `getAllKeys` and `getAllKeysIn` which uses
* `keysFunc` and `symbolsFunc` to get the enumerable property names and
* symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {Function} keysFunc The function to get the keys of `object`.
* @param {Function} symbolsFunc The function to get the symbols of `object`.
* @returns {Array} Returns the array of property names and symbols.
*/
function baseGetAllKeys(object, keysFunc, symbolsFunc) {
var result = keysFunc(object);
return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
}
module.exports = baseGetAllKeys;
/***/ }),
/* 80 */
/***/ (function(module, exports) {
/**
* This method returns a new empty array.
*
* @static
* @memberOf _
* @since 4.13.0
* @category Util
* @returns {Array} Returns the new empty array.
* @example
*
* var arrays = _.times(2, _.stubArray);
*
* console.log(arrays);
* // => [[], []]
*
* console.log(arrays[0] === arrays[1]);
* // => false
*/
function stubArray() {
return [];
}
module.exports = stubArray;
/***/ }),
/* 81 */
/***/ (function(module, exports, __webpack_require__) {
var baseTimes = __webpack_require__(166),
isArguments = __webpack_require__(46),
isArray = __webpack_require__(6),
isBuffer = __webpack_require__(47),
isIndex = __webpack_require__(32),
isTypedArray = __webpack_require__(82);
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Creates an array of the enumerable property names of the array-like `value`.
*
* @private
* @param {*} value The value to query.
* @param {boolean} inherited Specify returning inherited property names.
* @returns {Array} Returns the array of property names.
*/
function arrayLikeKeys(value, inherited) {
var isArr = isArray(value),
isArg = !isArr && isArguments(value),
isBuff = !isArr && !isArg && isBuffer(value),
isType = !isArr && !isArg && !isBuff && isTypedArray(value),
skipIndexes = isArr || isArg || isBuff || isType,
result = skipIndexes ? baseTimes(value.length, String) : [],
length = result.length;
for (var key in value) {
if ((inherited || hasOwnProperty.call(value, key)) &&
!(skipIndexes && (
// Safari 9 has enumerable `arguments.length` in strict mode.
key == 'length' ||
// Node.js 0.10 has enumerable non-index properties on buffers.
(isBuff && (key == 'offset' || key == 'parent')) ||
// PhantomJS 2 has enumerable non-index properties on typed arrays.
(isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
// Skip index properties.
isIndex(key, length)
))) {
result.push(key);
}
}
return result;
}
module.exports = arrayLikeKeys;
/***/ }),
/* 82 */
/***/ (function(module, exports, __webpack_require__) {
var baseIsTypedArray = __webpack_require__(169),
baseUnary = __webpack_require__(170),
nodeUtil = __webpack_require__(171);
/* Node.js helper references. */
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
/**
* Checks if `value` is classified as a typed array.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
* @example
*
* _.isTypedArray(new Uint8Array);
* // => true
*
* _.isTypedArray([]);
* // => false
*/
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
module.exports = isTypedArray;
/***/ }),
/* 83 */
/***/ (function(module, exports) {
/**
* Creates a unary function that invokes `func` with its argument transformed.
*
* @private
* @param {Function} func The function to wrap.
* @param {Function} transform The argument transform.
* @returns {Function} Returns the new function.
*/
function overArg(func, transform) {
return function(arg) {
return func(transform(arg));
};
}
module.exports = overArg;
/***/ }),
/* 84 */
/***/ (function(module, exports, __webpack_require__) {
var DataView = __webpack_require__(174),
Map = __webpack_require__(41),
Promise = __webpack_require__(175),
Set = __webpack_require__(176),
WeakMap = __webpack_require__(177),
baseGetTag = __webpack_require__(11),
toSource = __webpack_require__(72);
/** `Object#toString` result references. */
var mapTag = '[object Map]',
objectTag = '[object Object]',
promiseTag = '[object Promise]',
setTag = '[object Set]',
weakMapTag = '[object WeakMap]';
var dataViewTag = '[object DataView]';
/** Used to detect maps, sets, and weakmaps. */
var dataViewCtorString = toSource(DataView),
mapCtorString = toSource(Map),
promiseCtorString = toSource(Promise),
setCtorString = toSource(Set),
weakMapCtorString = toSource(WeakMap);
/**
* Gets the `toStringTag` of `value`.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the `toStringTag`.
*/
var getTag = baseGetTag;
// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
(Map && getTag(new Map) != mapTag) ||
(Promise && getTag(Promise.resolve()) != promiseTag) ||
(Set && getTag(new Set) != setTag) ||
(WeakMap && getTag(new WeakMap) != weakMapTag)) {
getTag = function(value) {
var result = baseGetTag(value),
Ctor = result == objectTag ? value.constructor : undefined,
ctorString = Ctor ? toSource(Ctor) : '';
if (ctorString) {
switch (ctorString) {
case dataViewCtorString: return dataViewTag;
case mapCtorString: return mapTag;
case promiseCtorString: return promiseTag;
case setCtorString: return setTag;
case weakMapCtorString: return weakMapTag;
}
}
return result;
};
}
module.exports = getTag;
/***/ }),
/* 85 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = 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 _classnames = __webpack_require__(5);
var _classnames2 = _interopRequireDefault(_classnames);
var _height = __webpack_require__(179);
var _height2 = _interopRequireDefault(_height);
var _offset = __webpack_require__(21);
var _offset2 = _interopRequireDefault(_offset);
var _offsetParent = __webpack_require__(86);
var _offsetParent2 = _interopRequireDefault(_offsetParent);
var _scrollTop = __webpack_require__(53);
var _scrollTop2 = _interopRequireDefault(_scrollTop);
var _requestAnimationFrame = __webpack_require__(88);
var _requestAnimationFrame2 = _interopRequireDefault(_requestAnimationFrame);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _reactDom = __webpack_require__(2);
var _reactDom2 = _interopRequireDefault(_reactDom);
var _addEventListener = __webpack_require__(33);
var _addEventListener2 = _interopRequireDefault(_addEventListener);
var _getDocumentHeight = __webpack_require__(89);
var _getDocumentHeight2 = _interopRequireDefault(_getDocumentHeight);
var _ownerDocument = __webpack_require__(10);
var _ownerDocument2 = _interopRequireDefault(_ownerDocument);
var _ownerWindow = __webpack_require__(90);
var _ownerWindow2 = _interopRequireDefault(_ownerWindow);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
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; }
/**
* The `` component toggles `position: fixed;` on and off, emulating
* the effect found with `position: sticky;`.
*/
var Affix = function (_React$Component) {
_inherits(Affix, _React$Component);
function Affix(props, context) {
_classCallCheck(this, Affix);
var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context));
_this.onWindowScroll = function () {
_this.onUpdate();
};
_this.onDocumentClick = function () {
(0, _requestAnimationFrame2.default)(function () {
return _this.onUpdate();
});
};
_this.onUpdate = function () {
if (!_this._isMounted) {
return;
}
var _this$props = _this.props,
offsetTop = _this$props.offsetTop,
viewportOffsetTop = _this$props.viewportOffsetTop;
var scrollTop = (0, _scrollTop2.default)((0, _ownerWindow2.default)(_this));
var positionTopMin = scrollTop + (viewportOffsetTop || 0);
if (positionTopMin <= offsetTop) {
_this.updateState('top', null, null);
return;
}
if (positionTopMin > _this.getPositionTopMax()) {
if (_this.state.affixed === 'bottom') {
_this.updateStateAtBottom();
} else {
// Setting position away from `fixed` can change the offset parent of
// the affix, so we can't calculate the correct position until after
// we've updated its position.
_this.setState({
affixed: 'bottom',
position: 'absolute',
top: null
}, function () {
if (!_this._isMounted) {
return;
}
_this.updateStateAtBottom();
});
}
return;
}
_this.updateState('affix', 'fixed', viewportOffsetTop);
};
_this.getPositionTopMax = function () {
var documentHeight = (0, _getDocumentHeight2.default)((0, _ownerDocument2.default)(_this));
var height = (0, _height2.default)(_reactDom2.default.findDOMNode(_this));
return documentHeight - height - _this.props.offsetBottom;
};
_this.updateState = function (affixed, position, top) {
if (affixed === _this.state.affixed && position === _this.state.position && top === _this.state.top) {
return;
}
var upperName = affixed === 'affix' ? '' : affixed.charAt(0).toUpperCase() + affixed.substr(1);
if (_this.props['onAffix' + upperName]) {
_this.props['onAffix' + upperName]();
}
_this.setState({ affixed: affixed, position: position, top: top }, function () {
if (_this.props['onAffixed' + upperName]) {
_this.props['onAffixed' + upperName]();
}
});
};
_this.updateStateAtBottom = function () {
var positionTopMax = _this.getPositionTopMax();
var offsetParent = (0, _offsetParent2.default)(_reactDom2.default.findDOMNode(_this));
var parentTop = (0, _offset2.default)(offsetParent).top;
_this.updateState('bottom', 'absolute', positionTopMax - parentTop);
};
_this.state = {
affixed: 'top',
position: null,
top: null
};
_this._needPositionUpdate = false;
return _this;
}
Affix.prototype.componentDidMount = function componentDidMount() {
var _this2 = this;
this._isMounted = true;
this._windowScrollListener = (0, _addEventListener2.default)((0, _ownerWindow2.default)(this), 'scroll', function () {
return _this2.onWindowScroll();
});
this._documentClickListener = (0, _addEventListener2.default)((0, _ownerDocument2.default)(this), 'click', function () {
return _this2.onDocumentClick();
});
this.onUpdate();
};
Affix.prototype.componentWillReceiveProps = function componentWillReceiveProps() {
this._needPositionUpdate = true;
};
Affix.prototype.componentDidUpdate = function componentDidUpdate() {
if (this._needPositionUpdate) {
this._needPositionUpdate = false;
this.onUpdate();
}
};
Affix.prototype.componentWillUnmount = function componentWillUnmount() {
this._isMounted = false;
if (this._windowScrollListener) {
this._windowScrollListener.remove();
}
if (this._documentClickListener) {
this._documentClickListener.remove();
}
};
Affix.prototype.render = function render() {
var child = _react2.default.Children.only(this.props.children);
var _child$props = child.props,
className = _child$props.className,
style = _child$props.style;
var _state = this.state,
affixed = _state.affixed,
position = _state.position,
top = _state.top;
var positionStyle = { position: position, top: top };
var affixClassName = void 0;
var affixStyle = void 0;
if (affixed === 'top') {
affixClassName = this.props.topClassName;
affixStyle = this.props.topStyle;
} else if (affixed === 'bottom') {
affixClassName = this.props.bottomClassName;
affixStyle = this.props.bottomStyle;
} else {
affixClassName = this.props.affixClassName;
affixStyle = this.props.affixStyle;
}
return _react2.default.cloneElement(child, {
className: (0, _classnames2.default)(affixClassName, className),
style: _extends({}, positionStyle, affixStyle, style)
});
};
return Affix;
}(_react2.default.Component);
Affix.propTypes = {
/**
* Pixels to offset from top of screen when calculating position
*/
offsetTop: _propTypes2.default.number,
/**
* When affixed, pixels to offset from top of viewport
*/
viewportOffsetTop: _propTypes2.default.number,
/**
* Pixels to offset from bottom of screen when calculating position
*/
offsetBottom: _propTypes2.default.number,
/**
* CSS class or classes to apply when at top
*/
topClassName: _propTypes2.default.string,
/**
* Style to apply when at top
*/
topStyle: _propTypes2.default.object,
/**
* CSS class or classes to apply when affixed
*/
affixClassName: _propTypes2.default.string,
/**
* Style to apply when affixed
*/
affixStyle: _propTypes2.default.object,
/**
* CSS class or classes to apply when at bottom
*/
bottomClassName: _propTypes2.default.string,
/**
* Style to apply when at bottom
*/
bottomStyle: _propTypes2.default.object,
/**
* Callback fired when the right before the `affixStyle` and `affixStyle` props are rendered
*/
onAffix: _propTypes2.default.func,
/**
* Callback fired after the component `affixStyle` and `affixClassName` props have been rendered.
*/
onAffixed: _propTypes2.default.func,
/**
* Callback fired when the right before the `topStyle` and `topClassName` props are rendered
*/
onAffixTop: _propTypes2.default.func,
/**
* Callback fired after the component `topStyle` and `topClassName` props have been rendered.
*/
onAffixedTop: _propTypes2.default.func,
/**
* Callback fired when the right before the `bottomStyle` and `bottomClassName` props are rendered
*/
onAffixBottom: _propTypes2.default.func,
/**
* Callback fired after the component `bottomStyle` and `bottomClassName` props have been rendered.
*/
onAffixedBottom: _propTypes2.default.func
};
Affix.defaultProps = {
offsetTop: 0,
viewportOffsetTop: null,
offsetBottom: 0
};
exports.default = Affix;
module.exports = exports['default'];
/***/ }),
/* 86 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = offsetParent;
var _ownerDocument = __webpack_require__(15);
var _ownerDocument2 = _interopRequireDefault(_ownerDocument);
var _style = __webpack_require__(52);
var _style2 = _interopRequireDefault(_style);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function nodeName(node) {
return node.nodeName && node.nodeName.toLowerCase();
}
function offsetParent(node) {
var doc = (0, _ownerDocument2.default)(node),
offsetParent = node && node.offsetParent;
while (offsetParent && nodeName(node) !== 'html' && (0, _style2.default)(offsetParent, 'position') === 'static') {
offsetParent = offsetParent.offsetParent;
}
return offsetParent || doc.documentElement;
}
module.exports = exports['default'];
/***/ }),
/* 87 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = camelizeStyleName;
var _camelize = __webpack_require__(180);
var _camelize2 = _interopRequireDefault(_camelize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var msPattern = /^-ms-/; /**
* Copyright 2014-2015, Facebook, Inc.
* All rights reserved.
* https://github.com/facebook/react/blob/2aeb8a2a6beb00617a4217f7f8284924fa2ad819/src/vendor/core/camelizeStyleName.js
*/
function camelizeStyleName(string) {
return (0, _camelize2.default)(string.replace(msPattern, 'ms-'));
}
module.exports = exports['default'];
/***/ }),
/* 88 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _inDOM = __webpack_require__(9);
var _inDOM2 = _interopRequireDefault(_inDOM);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var vendors = ['', 'webkit', 'moz', 'o', 'ms'];
var cancel = 'clearTimeout';
var raf = fallback;
var compatRaf = void 0;
var getKey = function getKey(vendor, k) {
return vendor + (!vendor ? k : k[0].toUpperCase() + k.substr(1)) + 'AnimationFrame';
};
if (_inDOM2.default) {
vendors.some(function (vendor) {
var rafKey = getKey(vendor, 'request');
if (rafKey in window) {
cancel = getKey(vendor, 'cancel');
return raf = function raf(cb) {
return window[rafKey](cb);
};
}
});
}
/* https://github.com/component/raf */
var prev = new Date().getTime();
function fallback(fn) {
var curr = new Date().getTime(),
ms = Math.max(0, 16 - (curr - prev)),
req = setTimeout(fn, ms);
prev = curr;
return req;
}
compatRaf = function compatRaf(cb) {
return raf(cb);
};
compatRaf.cancel = function (id) {
window[cancel] && typeof window[cancel] === 'function' && window[cancel](id);
};
exports.default = compatRaf;
module.exports = exports['default'];
/***/ }),
/* 89 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
exports.default = function (doc) {
return Math.max(doc.documentElement.offsetHeight || 0, doc.height || 0, doc.body.scrollHeight || 0, doc.body.offsetHeight || 0);
};
module.exports = exports["default"]; /**
* Get the height of the document
*
* @returns {documentHeight: number}
*/
/***/ }),
/* 90 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
exports.default = function (componentOrElement) {
return (0, _ownerWindow2.default)(_reactDom2.default.findDOMNode(componentOrElement));
};
var _reactDom = __webpack_require__(2);
var _reactDom2 = _interopRequireDefault(_reactDom);
var _ownerWindow = __webpack_require__(189);
var _ownerWindow2 = _interopRequireDefault(_ownerWindow);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
module.exports = exports['default'];
/***/ }),
/* 91 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = createChainableTypeChecker;
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
// Mostly taken from ReactPropTypes.
function createChainableTypeChecker(validate) {
function checkType(isRequired, props, propName, componentName, location, propFullName) {
var componentNameSafe = componentName || '<>';
var propFullNameSafe = propFullName || propName;
if (props[propName] == null) {
if (isRequired) {
return new Error('Required ' + location + ' `' + propFullNameSafe + '` was not specified ' + ('in `' + componentNameSafe + '`.'));
}
return null;
}
for (var _len = arguments.length, args = Array(_len > 6 ? _len - 6 : 0), _key = 6; _key < _len; _key++) {
args[_key - 6] = arguments[_key];
}
return validate.apply(undefined, [props, propName, componentNameSafe, location, propFullNameSafe].concat(args));
}
var chainedCheckType = checkType.bind(null, false);
chainedCheckType.isRequired = checkType.bind(null, true);
return chainedCheckType;
}
module.exports = exports['default'];
/***/ }),
/* 92 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = deprecated;
var _warning = __webpack_require__(54);
var _warning2 = _interopRequireDefault(_warning);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var warned = {};
function deprecated(validator, reason) {
return function validate(props, propName, componentName, location, propFullName) {
var componentNameSafe = componentName || '<>';
var propFullNameSafe = propFullName || propName;
if (props[propName] != null) {
var messageKey = componentName + '.' + propName;
(0, _warning2.default)(warned[messageKey], 'The ' + location + ' `' + propFullNameSafe + '` of ' + ('`' + componentNameSafe + '` is deprecated. ' + reason + '.'));
warned[messageKey] = true;
}
for (var _len = arguments.length, args = Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) {
args[_key - 5] = arguments[_key];
}
return validator.apply(undefined, [props, propName, componentName, location, propFullName].concat(args));
};
}
/* eslint-disable no-underscore-dangle */
function _resetWarned() {
warned = {};
}
deprecated._resetWarned = _resetWarned;
/* eslint-enable no-underscore-dangle */
module.exports = exports['default'];
/***/ }),
/* 93 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _createChainableTypeChecker = __webpack_require__(91);
var _createChainableTypeChecker2 = _interopRequireDefault(_createChainableTypeChecker);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function elementType(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
var propType = typeof propValue === 'undefined' ? 'undefined' : _typeof(propValue);
if (_react2.default.isValidElement(propValue)) {
return new Error('Invalid ' + location + ' `' + propFullName + '` of type ReactElement ' + ('supplied to `' + componentName + '`, expected an element type (a string ') + 'or a ReactClass).');
}
if (propType !== 'function' && propType !== 'string') {
return new Error('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected an element type (a string ') + 'or a ReactClass).');
}
return null;
}
exports.default = (0, _createChainableTypeChecker2.default)(elementType);
module.exports = exports['default'];
/***/ }),
/* 94 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = hasClass;
function hasClass(element, className) {
if (element.classList) return !!className && element.classList.contains(className);else return (" " + element.className + " ").indexOf(" " + className + " ") !== -1;
}
module.exports = exports["default"];
/***/ }),
/* 95 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = 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 _classnames = __webpack_require__(5);
var _classnames2 = _interopRequireDefault(_classnames);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _componentOrElement = __webpack_require__(23);
var _componentOrElement2 = _interopRequireDefault(_componentOrElement);
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _reactDom = __webpack_require__(2);
var _reactDom2 = _interopRequireDefault(_reactDom);
var _calculatePosition = __webpack_require__(202);
var _calculatePosition2 = _interopRequireDefault(_calculatePosition);
var _getContainer = __webpack_require__(34);
var _getContainer2 = _interopRequireDefault(_getContainer);
var _ownerDocument = __webpack_require__(10);
var _ownerDocument2 = _interopRequireDefault(_ownerDocument);
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; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
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; }
/**
* The Position component calculates the coordinates for its child, to position
* it relative to a `target` component or node. Useful for creating callouts
* and tooltips, the Position component injects a `style` props with `left` and
* `top` values for positioning your component.
*
* It also injects "arrow" `left`, and `top` values for styling callout arrows
* for giving your components a sense of directionality.
*/
var Position = function (_React$Component) {
_inherits(Position, _React$Component);
function Position(props, context) {
_classCallCheck(this, Position);
var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context));
_this.getTarget = function () {
var target = _this.props.target;
var targetElement = typeof target === 'function' ? target() : target;
return targetElement && _reactDom2.default.findDOMNode(targetElement) || null;
};
_this.maybeUpdatePosition = function (placementChanged) {
var target = _this.getTarget();
if (!_this.props.shouldUpdatePosition && target === _this._lastTarget && !placementChanged) {
return;
}
_this.updatePosition(target);
};
_this.state = {
positionLeft: 0,
positionTop: 0,
arrowOffsetLeft: null,
arrowOffsetTop: null
};
_this._needsFlush = false;
_this._lastTarget = null;
return _this;
}
Position.prototype.componentDidMount = function componentDidMount() {
this.updatePosition(this.getTarget());
};
Position.prototype.componentWillReceiveProps = function componentWillReceiveProps() {
this._needsFlush = true;
};
Position.prototype.componentDidUpdate = function componentDidUpdate(prevProps) {
if (this._needsFlush) {
this._needsFlush = false;
this.maybeUpdatePosition(this.props.placement !== prevProps.placement);
}
};
Position.prototype.render = function render() {
var _props = this.props,
children = _props.children,
className = _props.className,
props = _objectWithoutProperties(_props, ['children', 'className']);
var _state = this.state,
positionLeft = _state.positionLeft,
positionTop = _state.positionTop,
arrowPosition = _objectWithoutProperties(_state, ['positionLeft', 'positionTop']);
// These should not be forwarded to the child.
delete props.target;
delete props.container;
delete props.containerPadding;
delete props.shouldUpdatePosition;
var child = _react2.default.Children.only(children);
return (0, _react.cloneElement)(child, _extends({}, props, arrowPosition, {
// FIXME: Don't forward `positionLeft` and `positionTop` via both props
// and `props.style`.
positionLeft: positionLeft,
positionTop: positionTop,
className: (0, _classnames2.default)(className, child.props.className),
style: _extends({}, child.props.style, {
left: positionLeft,
top: positionTop
})
}));
};
Position.prototype.updatePosition = function updatePosition(target) {
this._lastTarget = target;
if (!target) {
this.setState({
positionLeft: 0,
positionTop: 0,
arrowOffsetLeft: null,
arrowOffsetTop: null
});
return;
}
var overlay = _reactDom2.default.findDOMNode(this);
var container = (0, _getContainer2.default)(this.props.container, (0, _ownerDocument2.default)(this).body);
this.setState((0, _calculatePosition2.default)(this.props.placement, overlay, target, container, this.props.containerPadding));
};
return Position;
}(_react2.default.Component);
Position.propTypes = {
/**
* A node, element, or function that returns either. The child will be
* be positioned next to the `target` specified.
*/
target: _propTypes2.default.oneOfType([_componentOrElement2.default, _propTypes2.default.func]),
/**
* "offsetParent" of the component
*/
container: _propTypes2.default.oneOfType([_componentOrElement2.default, _propTypes2.default.func]),
/**
* Minimum spacing in pixels between container border and component border
*/
containerPadding: _propTypes2.default.number,
/**
* How to position the component relative to the target
*/
placement: _propTypes2.default.oneOf(['top', 'right', 'bottom', 'left']),
/**
* Whether the position should be changed on each update
*/
shouldUpdatePosition: _propTypes2.default.bool
};
Position.displayName = 'Position';
Position.defaultProps = {
containerPadding: 0,
placement: 'right',
shouldUpdatePosition: false
};
exports.default = Position;
module.exports = exports['default'];
/***/ }),
/* 96 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _contains = __webpack_require__(51);
var _contains2 = _interopRequireDefault(_contains);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _reactDom = __webpack_require__(2);
var _reactDom2 = _interopRequireDefault(_reactDom);
var _addEventListener = __webpack_require__(33);
var _addEventListener2 = _interopRequireDefault(_addEventListener);
var _ownerDocument = __webpack_require__(10);
var _ownerDocument2 = _interopRequireDefault(_ownerDocument);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
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 escapeKeyCode = 27;
function isLeftClickEvent(event) {
return event.button === 0;
}
function isModifiedEvent(event) {
return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
}
/**
* The `` component registers your callback on the document
* when rendered. Powers the `` component. This is used achieve modal
* style behavior where your callback is triggered when the user tries to
* interact with the rest of the document or hits the `esc` key.
*/
var RootCloseWrapper = function (_React$Component) {
_inherits(RootCloseWrapper, _React$Component);
function RootCloseWrapper(props, context) {
_classCallCheck(this, RootCloseWrapper);
var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context));
_this.addEventListeners = function () {
var event = _this.props.event;
var doc = (0, _ownerDocument2.default)(_this);
// Use capture for this listener so it fires before React's listener, to
// avoid false positives in the contains() check below if the target DOM
// element is removed in the React mouse callback.
_this.documentMouseCaptureListener = (0, _addEventListener2.default)(doc, event, _this.handleMouseCapture, true);
_this.documentMouseListener = (0, _addEventListener2.default)(doc, event, _this.handleMouse);
_this.documentKeyupListener = (0, _addEventListener2.default)(doc, 'keyup', _this.handleKeyUp);
};
_this.removeEventListeners = function () {
if (_this.documentMouseCaptureListener) {
_this.documentMouseCaptureListener.remove();
}
if (_this.documentMouseListener) {
_this.documentMouseListener.remove();
}
if (_this.documentKeyupListener) {
_this.documentKeyupListener.remove();
}
};
_this.handleMouseCapture = function (e) {
_this.preventMouseRootClose = isModifiedEvent(e) || !isLeftClickEvent(e) || (0, _contains2.default)(_reactDom2.default.findDOMNode(_this), e.target);
};
_this.handleMouse = function (e) {
if (!_this.preventMouseRootClose && _this.props.onRootClose) {
_this.props.onRootClose(e);
}
};
_this.handleKeyUp = function (e) {
if (e.keyCode === escapeKeyCode && _this.props.onRootClose) {
_this.props.onRootClose(e);
}
};
_this.preventMouseRootClose = false;
return _this;
}
RootCloseWrapper.prototype.componentDidMount = function componentDidMount() {
if (!this.props.disabled) {
this.addEventListeners();
}
};
RootCloseWrapper.prototype.componentDidUpdate = function componentDidUpdate(prevProps) {
if (!this.props.disabled && prevProps.disabled) {
this.addEventListeners();
} else if (this.props.disabled && !prevProps.disabled) {
this.removeEventListeners();
}
};
RootCloseWrapper.prototype.componentWillUnmount = function componentWillUnmount() {
if (!this.props.disabled) {
this.removeEventListeners();
}
};
RootCloseWrapper.prototype.render = function render() {
return this.props.children;
};
return RootCloseWrapper;
}(_react2.default.Component);
RootCloseWrapper.displayName = 'RootCloseWrapper';
RootCloseWrapper.propTypes = {
/**
* Callback fired after click or mousedown. Also triggers when user hits `esc`.
*/
onRootClose: _propTypes2.default.func,
/**
* Children to render.
*/
children: _propTypes2.default.element,
/**
* Disable the the RootCloseWrapper, preventing it from triggering `onRootClose`.
*/
disabled: _propTypes2.default.bool,
/**
* Choose which document mouse event to bind to.
*/
event: _propTypes2.default.oneOf(['click', 'mousedown'])
};
RootCloseWrapper.defaultProps = {
event: 'click'
};
exports.default = RootCloseWrapper;
module.exports = exports['default'];
/***/ }),
/* 97 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _noop2 = __webpack_require__(56);
var _noop3 = _interopRequireDefault(_noop2);
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 _classnames = __webpack_require__(5);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _tokenContainer = __webpack_require__(98);
var _tokenContainer2 = _interopRequireDefault(_tokenContainer);
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; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
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; }
/**
* Token
*
* Individual token component, generally displayed within the TokenizerInput
* component, but can also be rendered on its own.
*/
var Token = function (_React$Component) {
_inherits(Token, _React$Component);
function Token() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, Token);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Token.__proto__ || Object.getPrototypeOf(Token)).call.apply(_ref, [this].concat(args))), _this), _this.displayName = 'Token', _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(Token, [{
key: 'render',
value: function render() {
return this.props.onRemove && !this.props.disabled ? this._renderRemoveableToken() : this._renderToken();
}
}, {
key: '_renderRemoveableToken',
value: function _renderRemoveableToken() {
var _props = this.props,
children = _props.children,
className = _props.className,
onRemove = _props.onRemove,
selected = _props.selected,
otherProps = _objectWithoutProperties(_props, ['children', 'className', 'onRemove', 'selected']);
return _react2.default.createElement(
'div',
_extends({}, otherProps, {
className: (0, _classnames2.default)('rbt-token', 'rbt-token-removeable', {
'rbt-token-selected': selected
}, className) }),
children,
_react2.default.createElement(
'span',
{
className: 'rbt-token-close-button',
onClick: onRemove,
role: 'button' },
'\xD7'
)
);
}
}, {
key: '_renderToken',
value: function _renderToken() {
var _props2 = this.props,
children = _props2.children,
className = _props2.className,
disabled = _props2.disabled,
href = _props2.href;
var classnames = (0, _classnames2.default)('rbt-token', {
'rbt-token-disabled': disabled
}, className);
if (href) {
return _react2.default.createElement(
'a',
{ className: classnames, href: href },
children
);
}
return _react2.default.createElement(
'div',
{ className: classnames },
children
);
}
}]);
return Token;
}(_react2.default.Component);
Token.propTypes = {
/**
* Handler for removing/deleting the token. If not defined, the token will
* be rendered in a read-only state.
*/
onRemove: _propTypes2.default.func,
selected: _propTypes2.default.bool,
tabIndex: _propTypes2.default.number
};
Token.defaultProps = {
onRemove: _noop3.default,
selected: false,
tabIndex: 0
};
exports.default = (0, _tokenContainer2.default)(Token);
/***/ }),
/* 98 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _omit2 = __webpack_require__(208);
var _omit3 = _interopRequireDefault(_omit2);
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 _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _reactDom = __webpack_require__(2);
var _reactOnclickoutside = __webpack_require__(109);
var _reactOnclickoutside2 = _interopRequireDefault(_reactOnclickoutside);
var _getDisplayName = __webpack_require__(110);
var _getDisplayName2 = _interopRequireDefault(_getDisplayName);
var _keyCode = __webpack_require__(62);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
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; }
/**
* Higher-order component that encapsulates Token behaviors, allowing them to
* be easily re-used.
*/
var tokenContainer = function tokenContainer(Component) {
var WrappedComponent = function (_React$Component) {
_inherits(WrappedComponent, _React$Component);
function WrappedComponent(props) {
_classCallCheck(this, WrappedComponent);
var _this = _possibleConstructorReturn(this, (WrappedComponent.__proto__ || Object.getPrototypeOf(WrappedComponent)).call(this, props));
_this.displayName = 'tokenContainer(' + (0, _getDisplayName2.default)(Component) + ')';
_this._handleBlur = _this._handleBlur.bind(_this);
_this._handleKeyDown = _this._handleKeyDown.bind(_this);
_this._handleRemove = _this._handleRemove.bind(_this);
_this._handleSelect = _this._handleSelect.bind(_this);
_this.handleClickOutside = _this.handleClickOutside.bind(_this);
_this.state = {
selected: false
};
return _this;
}
_createClass(WrappedComponent, [{
key: 'render',
value: function render() {
var tokenProps = (0, _omit3.default)(this.props, ['disableOnClickOutside', 'enableOnClickOutside', 'eventTypes', 'outsideClickIgnoreClass', 'preventDefault', 'stopPropagation']);
return _react2.default.createElement(Component, _extends({}, tokenProps, this.state, {
onBlur: this._handleBlur,
onClick: this._handleSelect,
onFocus: this._handleSelect,
onKeyDown: this._handleKeyDown
}));
}
}, {
key: '_handleBlur',
value: function _handleBlur(e) {
(0, _reactDom.findDOMNode)(this).blur();
this.setState({ selected: false });
this.props.disableOnClickOutside && this.props.disableOnClickOutside();
}
}, {
key: '_handleKeyDown',
value: function _handleKeyDown(e) {
switch (e.keyCode) {
case _keyCode.BACKSPACE:
if (this.state.selected) {
// Prevent backspace keypress from triggering the browser "back"
// action.
e.preventDefault();
this._handleRemove();
}
break;
}
}
/**
* From `onClickOutside` HOC.
*/
}, {
key: 'handleClickOutside',
value: function handleClickOutside(e) {
this._handleBlur();
}
}, {
key: '_handleRemove',
value: function _handleRemove(e) {
this.props.onRemove && this.props.onRemove();
}
}, {
key: '_handleSelect',
value: function _handleSelect(e) {
e.stopPropagation();
this.setState({ selected: true });
this.props.enableOnClickOutside && this.props.enableOnClickOutside();
}
}]);
return WrappedComponent;
}(_react2.default.Component);
return (0, _reactOnclickoutside2.default)(WrappedComponent);
};
exports.default = tokenContainer;
/***/ }),
/* 99 */
/***/ (function(module, exports) {
/**
* A specialized version of `_.map` for arrays without support for iteratee
* shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns the new mapped array.
*/
function arrayMap(array, iteratee) {
var index = -1,
length = array == null ? 0 : array.length,
result = Array(length);
while (++index < length) {
result[index] = iteratee(array[index], index, array);
}
return result;
}
module.exports = arrayMap;
/***/ }),
/* 100 */
/***/ (function(module, exports, __webpack_require__) {
var defineProperty = __webpack_require__(101);
/**
* The base implementation of `assignValue` and `assignMergeValue` without
* value checks.
*
* @private
* @param {Object} object The object to modify.
* @param {string} key The key of the property to assign.
* @param {*} value The value to assign.
*/
function baseAssignValue(object, key, value) {
if (key == '__proto__' && defineProperty) {
defineProperty(object, key, {
'configurable': true,
'enumerable': true,
'value': value,
'writable': true
});
} else {
object[key] = value;
}
}
module.exports = baseAssignValue;
/***/ }),
/* 101 */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(8);
var defineProperty = (function() {
try {
var func = getNative(Object, 'defineProperty');
func({}, '', {});
return func;
} catch (e) {}
}());
module.exports = defineProperty;
/***/ }),
/* 102 */
/***/ (function(module, exports, __webpack_require__) {
var arrayLikeKeys = __webpack_require__(81),
baseKeysIn = __webpack_require__(213),
isArrayLike = __webpack_require__(20);
/**
* Creates an array of the own and inherited enumerable property names of `object`.
*
* **Note:** Non-object values are coerced to objects.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.keysIn(new Foo);
* // => ['a', 'b', 'c'] (iteration order is not guaranteed)
*/
function keysIn(object) {
return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
}
module.exports = keysIn;
/***/ }),
/* 103 */
/***/ (function(module, exports, __webpack_require__) {
var arrayPush = __webpack_require__(44),
getPrototype = __webpack_require__(58),
getSymbols = __webpack_require__(45),
stubArray = __webpack_require__(80);
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetSymbols = Object.getOwnPropertySymbols;
/**
* Creates an array of the own and inherited enumerable symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of symbols.
*/
var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
var result = [];
while (object) {
arrayPush(result, getSymbols(object));
object = getPrototype(object);
}
return result;
};
module.exports = getSymbolsIn;
/***/ }),
/* 104 */
/***/ (function(module, exports, __webpack_require__) {
var baseGetAllKeys = __webpack_require__(79),
getSymbolsIn = __webpack_require__(103),
keysIn = __webpack_require__(102);
/**
* Creates an array of own and inherited enumerable property names and
* symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names and symbols.
*/
function getAllKeysIn(object) {
return baseGetAllKeys(object, keysIn, getSymbolsIn);
}
module.exports = getAllKeysIn;
/***/ }),
/* 105 */
/***/ (function(module, exports) {
/**
* A specialized version of `_.reduce` for arrays without support for
* iteratee shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @param {*} [accumulator] The initial value.
* @param {boolean} [initAccum] Specify using the first element of `array` as
* the initial value.
* @returns {*} Returns the accumulated value.
*/
function arrayReduce(array, iteratee, accumulator, initAccum) {
var index = -1,
length = array == null ? 0 : array.length;
if (initAccum && length) {
accumulator = array[++index];
}
while (++index < length) {
accumulator = iteratee(accumulator, array[index], index, array);
}
return accumulator;
}
module.exports = arrayReduce;
/***/ }),
/* 106 */
/***/ (function(module, exports, __webpack_require__) {
var baseToString = __webpack_require__(235);
/**
* Converts `value` to a string. An empty string is returned for `null`
* and `undefined` values. The sign of `-0` is preserved.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to convert.
* @returns {string} Returns the converted string.
* @example
*
* _.toString(null);
* // => ''
*
* _.toString(-0);
* // => '-0'
*
* _.toString([1, 2, 3]);
* // => '1,2,3'
*/
function toString(value) {
return value == null ? '' : baseToString(value);
}
module.exports = toString;
/***/ }),
/* 107 */
/***/ (function(module, exports, __webpack_require__) {
var flatten = __webpack_require__(240),
overRest = __webpack_require__(243),
setToString = __webpack_require__(245);
/**
* A specialized version of `baseRest` which flattens the rest array.
*
* @private
* @param {Function} func The function to apply a rest parameter to.
* @returns {Function} Returns the new function.
*/
function flatRest(func) {
return setToString(overRest(func, undefined, flatten), func + '');
}
module.exports = flatRest;
/***/ }),
/* 108 */
/***/ (function(module, exports) {
/**
* This method returns the first argument it receives.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Util
* @param {*} value Any value.
* @returns {*} Returns `value`.
* @example
*
* var object = { 'a': 1 };
*
* console.log(_.identity(object) === object);
* // => true
*/
function identity(value) {
return value;
}
module.exports = identity;
/***/ }),
/* 109 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IGNORE_CLASS_NAME", function() { return IGNORE_CLASS_NAME; });
/* harmony export (immutable) */ __webpack_exports__["default"] = onClickOutsideHOC;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react_dom__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react_dom___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_react_dom__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__dom_helpers__ = __webpack_require__(249);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__uid__ = __webpack_require__(250);
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
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 handlersMap = {};
var touchEvents = ['touchstart', 'touchmove'];
var IGNORE_CLASS_NAME = 'ignore-react-onclickoutside';
/**
* This function generates the HOC function that you'll use
* in order to impart onOutsideClick listening to an
* arbitrary component. It gets called at the end of the
* bootstrapping code to yield an instance of the
* onClickOutsideHOC function defined inside setupHOC().
*/
function onClickOutsideHOC(WrappedComponent, config) {
var _class, _temp2;
return _temp2 = _class = function (_Component) {
_inherits(onClickOutside, _Component);
function onClickOutside() {
var _temp, _this, _ret;
_classCallCheck(this, onClickOutside);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.__outsideClickHandler = function (event) {
if (typeof _this.__clickOutsideHandlerProp === 'function') {
_this.__clickOutsideHandlerProp(event);
return;
}
var instance = _this.getInstance();
if (typeof instance.props.handleClickOutside === 'function') {
instance.props.handleClickOutside(event);
return;
}
if (typeof instance.handleClickOutside === 'function') {
instance.handleClickOutside(event);
return;
}
throw new Error('WrappedComponent lacks a handleClickOutside(event) function for processing outside click events.');
}, _this.enableOnClickOutside = function () {
if (typeof document === 'undefined') return;
var events = _this.props.eventTypes;
if (!events.forEach) {
events = [events];
}
handlersMap[_this._uid] = function (event) {
if (_this.props.disableOnClickOutside) return;
if (_this.componentNode === null) return;
if (_this.props.preventDefault) {
event.preventDefault();
}
if (_this.props.stopPropagation) {
event.stopPropagation();
}
if (_this.props.excludeScrollbar && __WEBPACK_IMPORTED_MODULE_2__dom_helpers__["a" /* clickedScrollbar */](event)) return;
var current = event.target;
if (__WEBPACK_IMPORTED_MODULE_2__dom_helpers__["b" /* findHighest */](current, _this.componentNode, _this.props.outsideClickIgnoreClass) !== document) {
return;
}
_this.__outsideClickHandler(event);
};
events.forEach(function (eventName) {
var handlerOptions = null;
var isTouchEvent = touchEvents.indexOf(eventName) !== -1;
if (isTouchEvent) {
handlerOptions = { passive: !_this.props.preventDefault };
}
document.addEventListener(eventName, handlersMap[_this._uid], handlerOptions);
});
}, _this.disableOnClickOutside = function () {
var fn = handlersMap[_this._uid];
if (fn && typeof document !== 'undefined') {
var events = _this.props.eventTypes;
if (!events.forEach) {
events = [events];
}
events.forEach(function (eventName) {
return document.removeEventListener(eventName, fn);
});
delete handlersMap[_this._uid];
}
}, _this.getRef = function (ref) {
return _this.instanceRef = ref;
}, _temp), _possibleConstructorReturn(_this, _ret);
}
/**
* Access the WrappedComponent's instance.
*/
onClickOutside.prototype.getInstance = function getInstance() {
if (!WrappedComponent.prototype.isReactComponent) {
return this;
}
var ref = this.instanceRef;
return ref.getInstance ? ref.getInstance() : ref;
};
/**
* Add click listeners to the current document,
* linked to this component's state.
*/
onClickOutside.prototype.componentDidMount = function componentDidMount() {
this._uid = Object(__WEBPACK_IMPORTED_MODULE_3__uid__["a" /* default */])();
// If we are in an environment without a DOM such
// as shallow rendering or snapshots then we exit
// early to prevent any unhandled errors being thrown.
if (typeof document === 'undefined' || !document.createElement) {
return;
}
var instance = this.getInstance();
if (config && typeof config.handleClickOutside === 'function') {
this.__clickOutsideHandlerProp = config.handleClickOutside(instance);
if (typeof this.__clickOutsideHandlerProp !== 'function') {
throw new Error('WrappedComponent lacks a function for processing outside click events specified by the handleClickOutside config option.');
}
}
this.componentNode = Object(__WEBPACK_IMPORTED_MODULE_1_react_dom__["findDOMNode"])(this.getInstance());
this.enableOnClickOutside();
};
onClickOutside.prototype.componentDidUpdate = function componentDidUpdate() {
this.componentNode = Object(__WEBPACK_IMPORTED_MODULE_1_react_dom__["findDOMNode"])(this.getInstance());
};
/**
* Remove all document's event listeners for this component
*/
onClickOutside.prototype.componentWillUnmount = function componentWillUnmount() {
this.disableOnClickOutside();
};
/**
* Can be called to explicitly enable event listening
* for clicks and touches outside of this element.
*/
/**
* Can be called to explicitly disable event listening
* for clicks and touches outside of this element.
*/
/**
* Pass-through render
*/
onClickOutside.prototype.render = function render() {
var _this2 = this;
var props = Object.keys(this.props).filter(function (prop) {
return prop !== 'excludeScrollbar';
}).reduce(function (props, prop) {
props[prop] = _this2.props[prop];
return props;
}, {});
if (WrappedComponent.prototype.isReactComponent) {
props.ref = this.getRef;
} else {
props.wrappedRef = this.getRef;
}
props.disableOnClickOutside = this.disableOnClickOutside;
props.enableOnClickOutside = this.enableOnClickOutside;
return Object(__WEBPACK_IMPORTED_MODULE_0_react__["createElement"])(WrappedComponent, props);
};
return onClickOutside;
}(__WEBPACK_IMPORTED_MODULE_0_react__["Component"]), _class.displayName = 'OnClickOutside(' + (WrappedComponent.displayName || WrappedComponent.name || 'Component') + ')', _class.defaultProps = {
eventTypes: ['mousedown', 'touchstart'],
excludeScrollbar: config && config.excludeScrollbar || false,
outsideClickIgnoreClass: IGNORE_CLASS_NAME,
preventDefault: false,
stopPropagation: false
}, _class.getClass = function () {
return WrappedComponent.getClass ? WrappedComponent.getClass() : WrappedComponent;
}, _temp2;
}
/***/ }),
/* 110 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = getDisplayName;
function getDisplayName(WrappedComponent) {
return WrappedComponent.displayName || WrappedComponent.name || 'Component';
}
/***/ }),
/* 111 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
/**
* Use invariant() to assert state which your program assumes to be true.
*
* Provide sprintf-style format (only %s is supported) and arguments
* to provide information about what broke and what you were
* expecting.
*
* The invariant message will be stripped in production, but the invariant
* will remain to ensure logic does not differ in production.
*/
var invariant = function(condition, format, a, b, c, d, e, f) {
if (process.env.NODE_ENV !== 'production') {
if (format === undefined) {
throw new Error('invariant requires an error message argument');
}
}
if (!condition) {
var error;
if (format === undefined) {
error = new Error(
'Minified exception occurred; use the non-minified dev environment ' +
'for the full error message and additional helpful warnings.'
);
} else {
var args = [a, b, c, d, e, f];
var argIndex = 0;
error = new Error(
format.replace(/%s/g, function() { return args[argIndex++]; })
);
error.name = 'Invariant Violation';
}
error.framesToPop = 1; // we don't care about invariant's own frame
throw error;
}
};
module.exports = invariant;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 112 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = stripDiacritics;
/**
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Taken from: http://stackoverflow.com/questions/990904/remove-accents-diacritics-in-a-string-in-javascript/18391901#18391901
*/
/* eslint-disable max-len */
var map = [{ 'base': 'A', 'letters': 'A\u24B6\uFF21\xC0\xC1\xC2\u1EA6\u1EA4\u1EAA\u1EA8\xC3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\xC4\u01DE\u1EA2\xC5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F' }, { 'base': 'AA', 'letters': '\uA732' }, { 'base': 'AE', 'letters': '\xC6\u01FC\u01E2' }, { 'base': 'AO', 'letters': '\uA734' }, { 'base': 'AU', 'letters': '\uA736' }, { 'base': 'AV', 'letters': '\uA738\uA73A' }, { 'base': 'AY', 'letters': '\uA73C' }, { 'base': 'B', 'letters': 'B\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181' }, { 'base': 'C', 'letters': 'C\u24B8\uFF23\u0106\u0108\u010A\u010C\xC7\u1E08\u0187\u023B\uA73E' }, { 'base': 'D', 'letters': 'D\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779\xD0' }, { 'base': 'DZ', 'letters': '\u01F1\u01C4' }, { 'base': 'Dz', 'letters': '\u01F2\u01C5' }, { 'base': 'E', 'letters': 'E\u24BA\uFF25\xC8\xC9\xCA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\xCB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E' }, { 'base': 'F', 'letters': 'F\u24BB\uFF26\u1E1E\u0191\uA77B' }, { 'base': 'G', 'letters': 'G\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E' }, { 'base': 'H', 'letters': 'H\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D' }, { 'base': 'I', 'letters': 'I\u24BE\uFF29\xCC\xCD\xCE\u0128\u012A\u012C\u0130\xCF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197' }, { 'base': 'J', 'letters': 'J\u24BF\uFF2A\u0134\u0248' }, { 'base': 'K', 'letters': 'K\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2' }, { 'base': 'L', 'letters': 'L\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780' }, { 'base': 'LJ', 'letters': '\u01C7' }, { 'base': 'Lj', 'letters': '\u01C8' }, { 'base': 'M', 'letters': 'M\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C' }, { 'base': 'N', 'letters': 'N\u24C3\uFF2E\u01F8\u0143\xD1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4' }, { 'base': 'NJ', 'letters': '\u01CA' }, { 'base': 'Nj', 'letters': '\u01CB' }, { 'base': 'O', 'letters': 'O\u24C4\uFF2F\xD2\xD3\xD4\u1ED2\u1ED0\u1ED6\u1ED4\xD5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\xD6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\xD8\u01FE\u0186\u019F\uA74A\uA74C' }, { 'base': 'OI', 'letters': '\u01A2' }, { 'base': 'OO', 'letters': '\uA74E' }, { 'base': 'OU', 'letters': '\u0222' }, { 'base': 'OE', 'letters': '\x8C\u0152' }, { 'base': 'oe', 'letters': '\x9C\u0153' }, { 'base': 'P', 'letters': 'P\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754' }, { 'base': 'Q', 'letters': 'Q\u24C6\uFF31\uA756\uA758\u024A' }, { 'base': 'R', 'letters': 'R\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782' }, { 'base': 'S', 'letters': 'S\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784' }, { 'base': 'T', 'letters': 'T\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786' }, { 'base': 'TZ', 'letters': '\uA728' }, { 'base': 'U', 'letters': 'U\u24CA\uFF35\xD9\xDA\xDB\u0168\u1E78\u016A\u1E7A\u016C\xDC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244' }, { 'base': 'V', 'letters': 'V\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245' }, { 'base': 'VY', 'letters': '\uA760' }, { 'base': 'W', 'letters': 'W\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72' }, { 'base': 'X', 'letters': 'X\u24CD\uFF38\u1E8A\u1E8C' }, { 'base': 'Y', 'letters': 'Y\u24CE\uFF39\u1EF2\xDD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE' }, { 'base': 'Z', 'letters': 'Z\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762' }, { 'base': 'a', 'letters': 'a\u24D0\uFF41\u1E9A\xE0\xE1\xE2\u1EA7\u1EA5\u1EAB\u1EA9\xE3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\xE4\u01DF\u1EA3\xE5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250' }, { 'base': 'aa', 'letters': '\uA733' }, { 'base': 'ae', 'letters': '\xE6\u01FD\u01E3' }, { 'base': 'ao', 'letters': '\uA735' }, { 'base': 'au', 'letters': '\uA737' }, { 'base': 'av', 'letters': '\uA739\uA73B' }, { 'base': 'ay', 'letters': '\uA73D' }, { 'base': 'b', 'letters': 'b\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253' }, { 'base': 'c', 'letters': 'c\u24D2\uFF43\u0107\u0109\u010B\u010D\xE7\u1E09\u0188\u023C\uA73F\u2184' }, { 'base': 'd', 'letters': 'd\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A' }, { 'base': 'dz', 'letters': '\u01F3\u01C6' }, { 'base': 'e', 'letters': 'e\u24D4\uFF45\xE8\xE9\xEA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\xEB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD' }, { 'base': 'f', 'letters': 'f\u24D5\uFF46\u1E1F\u0192\uA77C' }, { 'base': 'g', 'letters': 'g\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F' }, { 'base': 'h', 'letters': 'h\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265' }, { 'base': 'hv', 'letters': '\u0195' }, { 'base': 'i', 'letters': 'i\u24D8\uFF49\xEC\xED\xEE\u0129\u012B\u012D\xEF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131' }, { 'base': 'j', 'letters': 'j\u24D9\uFF4A\u0135\u01F0\u0249' }, { 'base': 'k', 'letters': 'k\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3' }, { 'base': 'l', 'letters': 'l\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747' }, { 'base': 'lj', 'letters': '\u01C9' }, { 'base': 'm', 'letters': 'm\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F' }, { 'base': 'n', 'letters': 'n\u24DD\uFF4E\u01F9\u0144\xF1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5' }, { 'base': 'nj', 'letters': '\u01CC' }, { 'base': 'o', 'letters': 'o\u24DE\uFF4F\xF2\xF3\xF4\u1ED3\u1ED1\u1ED7\u1ED5\xF5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\xF6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\xF8\u01FF\u0254\uA74B\uA74D\u0275' }, { 'base': 'oi', 'letters': '\u01A3' }, { 'base': 'ou', 'letters': '\u0223' }, { 'base': 'oo', 'letters': '\uA74F' }, { 'base': 'p', 'letters': 'p\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755' }, { 'base': 'q', 'letters': 'q\u24E0\uFF51\u024B\uA757\uA759' }, { 'base': 'r', 'letters': 'r\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783' }, { 'base': 's', 'letters': 's\u24E2\uFF53\xDF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B' }, { 'base': 't', 'letters': 't\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787' }, { 'base': 'tz', 'letters': '\uA729' }, { 'base': 'u', 'letters': 'u\u24E4\uFF55\xF9\xFA\xFB\u0169\u1E79\u016B\u1E7B\u016D\xFC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289' }, { 'base': 'v', 'letters': 'v\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C' }, { 'base': 'vy', 'letters': '\uA761' }, { 'base': 'w', 'letters': 'w\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73' }, { 'base': 'x', 'letters': 'x\u24E7\uFF58\u1E8B\u1E8D' }, { 'base': 'y', 'letters': 'y\u24E8\uFF59\u1EF3\xFD\u0177\u1EF9\u0233\u1E8F\xFF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF' }, { 'base': 'z', 'letters': 'z\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763' }];
/* eslint-enable max-len */
var diacriticsMap = {};
for (var ii = 0; ii < map.length; ii++) {
var letters = map[ii].letters;
for (var jj = 0; jj < letters.length; jj++) {
diacriticsMap[letters[jj]] = map[ii].base;
}
}
// "what?" version ... http://jsperf.com/diacritics/12
function stripDiacritics(str) {
return str.replace(/[^\u0000-\u007E]/g, function (a) {
return diacriticsMap[a] || a;
});
}
/***/ }),
/* 113 */
/***/ (function(module, exports, __webpack_require__) {
var baseHasIn = __webpack_require__(259),
hasPath = __webpack_require__(260);
/**
* Checks if `path` is a direct or inherited property of `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path to check.
* @returns {boolean} Returns `true` if `path` exists, else `false`.
* @example
*
* var object = _.create({ 'a': _.create({ 'b': 2 }) });
*
* _.hasIn(object, 'a');
* // => true
*
* _.hasIn(object, 'a.b');
* // => true
*
* _.hasIn(object, ['a', 'b']);
* // => true
*
* _.hasIn(object, 'b');
* // => false
*/
function hasIn(object, path) {
return object != null && hasPath(object, path, baseHasIn);
}
module.exports = hasIn;
/***/ }),
/* 114 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
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 _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 _classnames = __webpack_require__(5);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _MenuItem = __webpack_require__(64);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
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 BaseMenu = function BaseMenu(props) {
return _react2.default.createElement(
'ul',
_extends({}, props, {
className: (0, _classnames2.default)('dropdown-menu', props.className) }),
props.children
);
};
/**
* Menu component that automatically handles pagination and empty state when
* passed a set of filtered and truncated results.
*/
var Menu = function (_React$Component) {
_inherits(Menu, _React$Component);
function Menu() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, Menu);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Menu.__proto__ || Object.getPrototypeOf(Menu)).call.apply(_ref, [this].concat(args))), _this), _this.displayName = 'Menu', _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(Menu, [{
key: 'render',
value: function render() {
var _props = this.props,
align = _props.align,
children = _props.children,
className = _props.className,
emptyLabel = _props.emptyLabel,
maxHeight = _props.maxHeight,
style = _props.style;
var contents = _react.Children.count(children) === 0 ? _react2.default.createElement(
_MenuItem.BaseMenuItem,
{ disabled: true },
emptyLabel
) : children;
return _react2.default.createElement(
BaseMenu,
{
className: (0, _classnames2.default)('rbt-menu', {
'dropdown-menu-justify': align === 'justify',
'dropdown-menu-right': align === 'right'
}, className),
style: _extends({}, style, {
display: 'block',
maxHeight: maxHeight + 'px',
overflow: 'auto'
}) },
contents,
this._renderPaginationMenuItem()
);
}
/**
* Allow user to see more results, if available.
*/
}, {
key: '_renderPaginationMenuItem',
value: function _renderPaginationMenuItem() {
var _props2 = this.props,
children = _props2.children,
onPaginate = _props2.onPaginate,
paginate = _props2.paginate,
paginationText = _props2.paginationText;
if (paginate && _react.Children.count(children)) {
return [_react2.default.createElement('li', {
className: 'divider',
key: 'pagination-item-divider',
role: 'separator'
}), _react2.default.createElement(
_MenuItem.BaseMenuItem,
{
className: 'rbt-menu-paginator',
key: 'pagination-item',
onClick: onPaginate },
paginationText
)];
}
}
}]);
return Menu;
}(_react2.default.Component);
Menu.PropTypes = {
/**
* Specify menu alignment. The default value is `justify`, which makes the
* menu as wide as the input and truncates long values. Specifying `left`
* or `right` will align the menu to that side and the width will be
* determined by the length of menu item values.
*/
align: _propTypes2.default.oneOf(['justify', 'left', 'right']),
/**
* Message to display in the menu if there are no valid results.
*/
emptyLabel: _propTypes2.default.string,
/**
* Maximum height of the dropdown menu, in px.
*/
maxHeight: _propTypes2.default.number,
/**
* Prompt displayed when large data sets are paginated.
*/
paginationText: _propTypes2.default.string
};
Menu.defaultProps = {
align: 'justify',
emptyLabel: 'No matches found.',
maxHeight: 300,
paginate: true,
paginationText: 'Display additional results...'
};
exports.default = Menu;
/***/ }),
/* 115 */
/***/ (function(module, exports, __webpack_require__) {
"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 _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _reactDom = __webpack_require__(2);
var _getDisplayName = __webpack_require__(110);
var _getDisplayName2 = _interopRequireDefault(_getDisplayName);
var _scrollIntoViewIfNeeded = __webpack_require__(268);
var _scrollIntoViewIfNeeded2 = _interopRequireDefault(_scrollIntoViewIfNeeded);
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; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
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 menuItemContainer = function menuItemContainer(Component) {
var WrappedMenuItem = function (_React$Component) {
_inherits(WrappedMenuItem, _React$Component);
function WrappedMenuItem() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, WrappedMenuItem);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = WrappedMenuItem.__proto__ || Object.getPrototypeOf(WrappedMenuItem)).call.apply(_ref, [this].concat(args))), _this), _this._handleClick = function (e) {
var _this$props = _this.props,
option = _this$props.option,
onClick = _this$props.onClick;
_this.context.onMenuItemClick(option);
onClick && onClick(e);
}, _this._updateInitialItem = function (props) {
var option = props.option,
position = props.position;
if (position === 0) {
_this.context.onInitialItemChange(option);
}
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(WrappedMenuItem, [{
key: 'componentWillMount',
value: function componentWillMount() {
this._updateInitialItem(this.props);
}
}, {
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(nextProps, nextContext) {
var currentlyActive = this.context.activeIndex === this.props.position;
var option = nextProps.option,
position = nextProps.position;
var activeIndex = nextContext.activeIndex,
onActiveItemChange = nextContext.onActiveItemChange;
if (position == null) {
return;
}
// The item will become active.
if (activeIndex === position) {
// Ensures that if the menu items exceed the bounds of the menu, the
// menu will scroll up or down as the user hits the arrow keys.
(0, _scrollIntoViewIfNeeded2.default)((0, _reactDom.findDOMNode)(this));
// Fire the change handler when the menu item becomes active.
!currentlyActive && onActiveItemChange(option);
}
this._updateInitialItem(nextProps);
}
}, {
key: 'render',
value: function render() {
var _context = this.context,
activeIndex = _context.activeIndex,
isOnlyResult = _context.isOnlyResult;
var _props = this.props,
position = _props.position,
props = _objectWithoutProperties(_props, ['position']);
var active = isOnlyResult || activeIndex === position;
return _react2.default.createElement(Component, _extends({}, props, {
active: active,
onClick: this._handleClick
}));
}
}]);
return WrappedMenuItem;
}(_react2.default.Component);
WrappedMenuItem.displayName = 'menuItemContainer(' + (0, _getDisplayName2.default)(Component) + ')';
WrappedMenuItem.propTypes = {
option: _propTypes2.default.oneOfType([_propTypes2.default.object, _propTypes2.default.string]).isRequired,
position: _propTypes2.default.number
};
WrappedMenuItem.contextTypes = {
activeIndex: _propTypes2.default.number.isRequired,
isOnlyResult: _propTypes2.default.bool.isRequired,
onActiveItemChange: _propTypes2.default.func.isRequired,
onInitialItemChange: _propTypes2.default.func.isRequired,
onMenuItemClick: _propTypes2.default.func.isRequired
};
return WrappedMenuItem;
};
exports.default = menuItemContainer;
/***/ }),
/* 116 */
/***/ (function(module, exports, __webpack_require__) {
var createFind = __webpack_require__(271),
findIndex = __webpack_require__(280);
/**
* Iterates over elements of `collection`, returning the first element
* `predicate` returns truthy for. The predicate is invoked with three
* arguments: (value, index|key, collection).
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to inspect.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @param {number} [fromIndex=0] The index to search from.
* @returns {*} Returns the matched element, else `undefined`.
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36, 'active': true },
* { 'user': 'fred', 'age': 40, 'active': false },
* { 'user': 'pebbles', 'age': 1, 'active': true }
* ];
*
* _.find(users, function(o) { return o.age < 40; });
* // => object for 'barney'
*
* // The `_.matches` iteratee shorthand.
* _.find(users, { 'age': 1, 'active': true });
* // => object for 'pebbles'
*
* // The `_.matchesProperty` iteratee shorthand.
* _.find(users, ['active', false]);
* // => object for 'fred'
*
* // The `_.property` iteratee shorthand.
* _.find(users, 'active');
* // => object for 'barney'
*/
var find = createFind(findIndex);
module.exports = find;
/***/ }),
/* 117 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(7);
/**
* Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` if suitable for strict
* equality comparisons, else `false`.
*/
function isStrictComparable(value) {
return value === value && !isObject(value);
}
module.exports = isStrictComparable;
/***/ }),
/* 118 */
/***/ (function(module, exports) {
/**
* A specialized version of `matchesProperty` for source values suitable
* for strict equality comparisons, i.e. `===`.
*
* @private
* @param {string} key The key of the property to get.
* @param {*} srcValue The value to match.
* @returns {Function} Returns the new spec function.
*/
function matchesStrictComparable(key, srcValue) {
return function(object) {
if (object == null) {
return false;
}
return object[key] === srcValue &&
(srcValue !== undefined || (key in Object(object)));
};
}
module.exports = matchesStrictComparable;
/***/ }),
/* 119 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.tokenContainer = exports.menuItemContainer = exports.asyncContainer = exports.Typeahead = exports.Token = exports.MenuItem = exports.Menu = exports.AsyncTypeahead = undefined;
var _AsyncTypeahead2 = __webpack_require__(120);
var _AsyncTypeahead3 = _interopRequireDefault(_AsyncTypeahead2);
var _Menu2 = __webpack_require__(114);
var _Menu3 = _interopRequireDefault(_Menu2);
var _MenuItem2 = __webpack_require__(64);
var _MenuItem3 = _interopRequireDefault(_MenuItem2);
var _Token2 = __webpack_require__(97);
var _Token3 = _interopRequireDefault(_Token2);
var _Typeahead2 = __webpack_require__(70);
var _Typeahead3 = _interopRequireDefault(_Typeahead2);
var _asyncContainer2 = __webpack_require__(66);
var _asyncContainer3 = _interopRequireDefault(_asyncContainer2);
var _menuItemContainer2 = __webpack_require__(115);
var _menuItemContainer3 = _interopRequireDefault(_menuItemContainer2);
var _tokenContainer2 = __webpack_require__(98);
var _tokenContainer3 = _interopRequireDefault(_tokenContainer2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.AsyncTypeahead = _AsyncTypeahead3.default; /* eslint-disable object-curly-spacing */
// Components
exports.Menu = _Menu3.default;
exports.MenuItem = _MenuItem3.default;
exports.Token = _Token3.default;
exports.Typeahead = _Typeahead3.default;
// HOCs
exports.asyncContainer = _asyncContainer3.default;
exports.menuItemContainer = _menuItemContainer3.default;
exports.tokenContainer = _tokenContainer3.default;
/* eslint-enable object-curly-spacing */
/***/ }),
/* 120 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _asyncContainer = __webpack_require__(66);
var _asyncContainer2 = _interopRequireDefault(_asyncContainer);
var _Typeahead = __webpack_require__(70);
var _Typeahead2 = _interopRequireDefault(_Typeahead);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = (0, _asyncContainer2.default)(_Typeahead2.default);
/***/ }),
/* 121 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(7),
now = __webpack_require__(122),
toNumber = __webpack_require__(68);
/** Error message constants. */
var FUNC_ERROR_TEXT = 'Expected a function';
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max,
nativeMin = Math.min;
/**
* Creates a debounced function that delays invoking `func` until after `wait`
* milliseconds have elapsed since the last time the debounced function was
* invoked. The debounced function comes with a `cancel` method to cancel
* delayed `func` invocations and a `flush` method to immediately invoke them.
* Provide `options` to indicate whether `func` should be invoked on the
* leading and/or trailing edge of the `wait` timeout. The `func` is invoked
* with the last arguments provided to the debounced function. Subsequent
* calls to the debounced function return the result of the last `func`
* invocation.
*
* **Note:** If `leading` and `trailing` options are `true`, `func` is
* invoked on the trailing edge of the timeout only if the debounced function
* is invoked more than once during the `wait` timeout.
*
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
*
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
* for details over the differences between `_.debounce` and `_.throttle`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to debounce.
* @param {number} [wait=0] The number of milliseconds to delay.
* @param {Object} [options={}] The options object.
* @param {boolean} [options.leading=false]
* Specify invoking on the leading edge of the timeout.
* @param {number} [options.maxWait]
* The maximum time `func` is allowed to be delayed before it's invoked.
* @param {boolean} [options.trailing=true]
* Specify invoking on the trailing edge of the timeout.
* @returns {Function} Returns the new debounced function.
* @example
*
* // Avoid costly calculations while the window size is in flux.
* jQuery(window).on('resize', _.debounce(calculateLayout, 150));
*
* // Invoke `sendMail` when clicked, debouncing subsequent calls.
* jQuery(element).on('click', _.debounce(sendMail, 300, {
* 'leading': true,
* 'trailing': false
* }));
*
* // Ensure `batchLog` is invoked once after 1 second of debounced calls.
* var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
* var source = new EventSource('/stream');
* jQuery(source).on('message', debounced);
*
* // Cancel the trailing debounced invocation.
* jQuery(window).on('popstate', debounced.cancel);
*/
function debounce(func, wait, options) {
var lastArgs,
lastThis,
maxWait,
result,
timerId,
lastCallTime,
lastInvokeTime = 0,
leading = false,
maxing = false,
trailing = true;
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
wait = toNumber(wait) || 0;
if (isObject(options)) {
leading = !!options.leading;
maxing = 'maxWait' in options;
maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
trailing = 'trailing' in options ? !!options.trailing : trailing;
}
function invokeFunc(time) {
var args = lastArgs,
thisArg = lastThis;
lastArgs = lastThis = undefined;
lastInvokeTime = time;
result = func.apply(thisArg, args);
return result;
}
function leadingEdge(time) {
// Reset any `maxWait` timer.
lastInvokeTime = time;
// Start the timer for the trailing edge.
timerId = setTimeout(timerExpired, wait);
// Invoke the leading edge.
return leading ? invokeFunc(time) : result;
}
function remainingWait(time) {
var timeSinceLastCall = time - lastCallTime,
timeSinceLastInvoke = time - lastInvokeTime,
result = wait - timeSinceLastCall;
return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;
}
function shouldInvoke(time) {
var timeSinceLastCall = time - lastCallTime,
timeSinceLastInvoke = time - lastInvokeTime;
// Either this is the first call, activity has stopped and we're at the
// trailing edge, the system time has gone backwards and we're treating
// it as the trailing edge, or we've hit the `maxWait` limit.
return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
(timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
}
function timerExpired() {
var time = now();
if (shouldInvoke(time)) {
return trailingEdge(time);
}
// Restart the timer.
timerId = setTimeout(timerExpired, remainingWait(time));
}
function trailingEdge(time) {
timerId = undefined;
// Only invoke if we have `lastArgs` which means `func` has been
// debounced at least once.
if (trailing && lastArgs) {
return invokeFunc(time);
}
lastArgs = lastThis = undefined;
return result;
}
function cancel() {
if (timerId !== undefined) {
clearTimeout(timerId);
}
lastInvokeTime = 0;
lastArgs = lastCallTime = lastThis = timerId = undefined;
}
function flush() {
return timerId === undefined ? result : trailingEdge(now());
}
function debounced() {
var time = now(),
isInvoking = shouldInvoke(time);
lastArgs = arguments;
lastThis = this;
lastCallTime = time;
if (isInvoking) {
if (timerId === undefined) {
return leadingEdge(lastCallTime);
}
if (maxing) {
// Handle invocations in a tight loop.
timerId = setTimeout(timerExpired, wait);
return invokeFunc(lastCallTime);
}
}
if (timerId === undefined) {
timerId = setTimeout(timerExpired, wait);
}
return result;
}
debounced.cancel = cancel;
debounced.flush = flush;
return debounced;
}
module.exports = debounce;
/***/ }),
/* 122 */
/***/ (function(module, exports, __webpack_require__) {
var root = __webpack_require__(3);
/**
* Gets the timestamp of the number of milliseconds that have elapsed since
* the Unix epoch (1 January 1970 00:00:00 UTC).
*
* @static
* @memberOf _
* @since 2.4.0
* @category Date
* @returns {number} Returns the timestamp.
* @example
*
* _.defer(function(stamp) {
* console.log(_.now() - stamp);
* }, _.now());
* // => Logs the number of milliseconds it took for the deferred invocation.
*/
var now = function() {
return root.Date.now();
};
module.exports = now;
/***/ }),
/* 123 */
/***/ (function(module, exports) {
var g;
// This works in non-strict mode
g = (function() {
return this;
})();
try {
// This works if eval is allowed (see CSP)
g = g || Function("return this")() || (1,eval)("this");
} catch(e) {
// This works if the window reference is available
if(typeof window === "object")
g = window;
}
// g can still be undefined, but nothing to do about it...
// We return undefined, instead of nothing here, so it's
// easier to handle this case. if(!global) { ...}
module.exports = g;
/***/ }),
/* 124 */
/***/ (function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(12);
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var nativeObjectToString = objectProto.toString;
/** Built-in value references. */
var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
/**
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the raw `toStringTag`.
*/
function getRawTag(value) {
var isOwn = hasOwnProperty.call(value, symToStringTag),
tag = value[symToStringTag];
try {
value[symToStringTag] = undefined;
var unmasked = true;
} catch (e) {}
var result = nativeObjectToString.call(value);
if (unmasked) {
if (isOwn) {
value[symToStringTag] = tag;
} else {
delete value[symToStringTag];
}
}
return result;
}
module.exports = getRawTag;
/***/ }),
/* 125 */
/***/ (function(module, exports) {
/** Used for built-in method references. */
var objectProto = Object.prototype;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var nativeObjectToString = objectProto.toString;
/**
* Converts `value` to a string using `Object.prototype.toString`.
*
* @private
* @param {*} value The value to convert.
* @returns {string} Returns the converted string.
*/
function objectToString(value) {
return nativeObjectToString.call(value);
}
module.exports = objectToString;
/***/ }),
/* 126 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var emptyFunction = __webpack_require__(36);
var invariant = __webpack_require__(26);
var warning = __webpack_require__(37);
var assign = __webpack_require__(69);
var ReactPropTypesSecret = __webpack_require__(38);
var checkPropTypes = __webpack_require__(127);
module.exports = function(isValidElement, throwOnDirectAccess) {
/* global Symbol */
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
/**
* Returns the iterator method function contained on the iterable object.
*
* Be sure to invoke the function with the iterable as context:
*
* var iteratorFn = getIteratorFn(myIterable);
* if (iteratorFn) {
* var iterator = iteratorFn.call(myIterable);
* ...
* }
*
* @param {?object} maybeIterable
* @return {?function}
*/
function getIteratorFn(maybeIterable) {
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
if (typeof iteratorFn === 'function') {
return iteratorFn;
}
}
/**
* Collection of methods that allow declaration and validation of props that are
* supplied to React components. Example usage:
*
* var Props = require('ReactPropTypes');
* var MyArticle = React.createClass({
* propTypes: {
* // An optional string prop named "description".
* description: Props.string,
*
* // A required enum prop named "category".
* category: Props.oneOf(['News','Photos']).isRequired,
*
* // A prop named "dialog" that requires an instance of Dialog.
* dialog: Props.instanceOf(Dialog).isRequired
* },
* render: function() { ... }
* });
*
* A more formal specification of how these methods are used:
*
* type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
* decl := ReactPropTypes.{type}(.isRequired)?
*
* Each and every declaration produces a function with the same signature. This
* allows the creation of custom validation functions. For example:
*
* var MyLink = React.createClass({
* propTypes: {
* // An optional string or URI prop named "href".
* href: function(props, propName, componentName) {
* var propValue = props[propName];
* if (propValue != null && typeof propValue !== 'string' &&
* !(propValue instanceof URI)) {
* return new Error(
* 'Expected a string or an URI for ' + propName + ' in ' +
* componentName
* );
* }
* }
* },
* render: function() {...}
* });
*
* @internal
*/
var ANONYMOUS = '<>';
// Important!
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
var ReactPropTypes = {
array: createPrimitiveTypeChecker('array'),
bool: createPrimitiveTypeChecker('boolean'),
func: createPrimitiveTypeChecker('function'),
number: createPrimitiveTypeChecker('number'),
object: createPrimitiveTypeChecker('object'),
string: createPrimitiveTypeChecker('string'),
symbol: createPrimitiveTypeChecker('symbol'),
any: createAnyTypeChecker(),
arrayOf: createArrayOfTypeChecker,
element: createElementTypeChecker(),
instanceOf: createInstanceTypeChecker,
node: createNodeChecker(),
objectOf: createObjectOfTypeChecker,
oneOf: createEnumTypeChecker,
oneOfType: createUnionTypeChecker,
shape: createShapeTypeChecker,
exact: createStrictShapeTypeChecker,
};
/**
* inlined Object.is polyfill to avoid requiring consumers ship their own
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
*/
/*eslint-disable no-self-compare*/
function is(x, y) {
// SameValue algorithm
if (x === y) {
// Steps 1-5, 7-10
// Steps 6.b-6.e: +0 != -0
return x !== 0 || 1 / x === 1 / y;
} else {
// Step 6.a: NaN == NaN
return x !== x && y !== y;
}
}
/*eslint-enable no-self-compare*/
/**
* We use an Error-like object for backward compatibility as people may call
* PropTypes directly and inspect their output. However, we don't use real
* Errors anymore. We don't inspect their stack anyway, and creating them
* is prohibitively expensive if they are created too often, such as what
* happens in oneOfType() for any type before the one that matched.
*/
function PropTypeError(message) {
this.message = message;
this.stack = '';
}
// Make `instanceof Error` still work for returned errors.
PropTypeError.prototype = Error.prototype;
function createChainableTypeChecker(validate) {
if (process.env.NODE_ENV !== 'production') {
var manualPropTypeCallCache = {};
var manualPropTypeWarningCount = 0;
}
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
componentName = componentName || ANONYMOUS;
propFullName = propFullName || propName;
if (secret !== ReactPropTypesSecret) {
if (throwOnDirectAccess) {
// New behavior only for users of `prop-types` package
invariant(
false,
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
'Use `PropTypes.checkPropTypes()` to call them. ' +
'Read more at http://fb.me/use-check-prop-types'
);
} else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
// Old behavior for people using React.PropTypes
var cacheKey = componentName + ':' + propName;
if (
!manualPropTypeCallCache[cacheKey] &&
// Avoid spamming the console because they are often not actionable except for lib authors
manualPropTypeWarningCount < 3
) {
warning(
false,
'You are manually calling a React.PropTypes validation ' +
'function for the `%s` prop on `%s`. This is deprecated ' +
'and will throw in the standalone `prop-types` package. ' +
'You may be seeing this warning due to a third-party PropTypes ' +
'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.',
propFullName,
componentName
);
manualPropTypeCallCache[cacheKey] = true;
manualPropTypeWarningCount++;
}
}
}
if (props[propName] == null) {
if (isRequired) {
if (props[propName] === null) {
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
}
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
}
return null;
} else {
return validate(props, propName, componentName, location, propFullName);
}
}
var chainedCheckType = checkType.bind(null, false);
chainedCheckType.isRequired = checkType.bind(null, true);
return chainedCheckType;
}
function createPrimitiveTypeChecker(expectedType) {
function validate(props, propName, componentName, location, propFullName, secret) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== expectedType) {
// `propValue` being instance of, say, date/regexp, pass the 'object'
// check, but we can offer a more precise error message here rather than
// 'of type `object`'.
var preciseType = getPreciseType(propValue);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createAnyTypeChecker() {
return createChainableTypeChecker(emptyFunction.thatReturnsNull);
}
function createArrayOfTypeChecker(typeChecker) {
function validate(props, propName, componentName, location, propFullName) {
if (typeof typeChecker !== 'function') {
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
}
var propValue = props[propName];
if (!Array.isArray(propValue)) {
var propType = getPropType(propValue);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
}
for (var i = 0; i < propValue.length; i++) {
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
if (error instanceof Error) {
return error;
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function createElementTypeChecker() {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
if (!isValidElement(propValue)) {
var propType = getPropType(propValue);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createInstanceTypeChecker(expectedClass) {
function validate(props, propName, componentName, location, propFullName) {
if (!(props[propName] instanceof expectedClass)) {
var expectedClassName = expectedClass.name || ANONYMOUS;
var actualClassName = getClassName(props[propName]);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createEnumTypeChecker(expectedValues) {
if (!Array.isArray(expectedValues)) {
process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0;
return emptyFunction.thatReturnsNull;
}
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
for (var i = 0; i < expectedValues.length; i++) {
if (is(propValue, expectedValues[i])) {
return null;
}
}
var valuesString = JSON.stringify(expectedValues);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
}
return createChainableTypeChecker(validate);
}
function createObjectOfTypeChecker(typeChecker) {
function validate(props, propName, componentName, location, propFullName) {
if (typeof typeChecker !== 'function') {
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
}
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== 'object') {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
}
for (var key in propValue) {
if (propValue.hasOwnProperty(key)) {
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
if (error instanceof Error) {
return error;
}
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function createUnionTypeChecker(arrayOfTypeCheckers) {
if (!Array.isArray(arrayOfTypeCheckers)) {
process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
return emptyFunction.thatReturnsNull;
}
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
var checker = arrayOfTypeCheckers[i];
if (typeof checker !== 'function') {
warning(
false,
'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
'received %s at index %s.',
getPostfixForTypeWarning(checker),
i
);
return emptyFunction.thatReturnsNull;
}
}
function validate(props, propName, componentName, location, propFullName) {
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
var checker = arrayOfTypeCheckers[i];
if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {
return null;
}
}
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
}
return createChainableTypeChecker(validate);
}
function createNodeChecker() {
function validate(props, propName, componentName, location, propFullName) {
if (!isNode(props[propName])) {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createShapeTypeChecker(shapeTypes) {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== 'object') {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
}
for (var key in shapeTypes) {
var checker = shapeTypes[key];
if (!checker) {
continue;
}
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
if (error) {
return error;
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function createStrictShapeTypeChecker(shapeTypes) {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== 'object') {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
}
// We need to check all keys in case some are required but missing from
// props.
var allKeys = assign({}, props[propName], shapeTypes);
for (var key in allKeys) {
var checker = shapeTypes[key];
if (!checker) {
return new PropTypeError(
'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
'\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
'\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
);
}
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
if (error) {
return error;
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function isNode(propValue) {
switch (typeof propValue) {
case 'number':
case 'string':
case 'undefined':
return true;
case 'boolean':
return !propValue;
case 'object':
if (Array.isArray(propValue)) {
return propValue.every(isNode);
}
if (propValue === null || isValidElement(propValue)) {
return true;
}
var iteratorFn = getIteratorFn(propValue);
if (iteratorFn) {
var iterator = iteratorFn.call(propValue);
var step;
if (iteratorFn !== propValue.entries) {
while (!(step = iterator.next()).done) {
if (!isNode(step.value)) {
return false;
}
}
} else {
// Iterator will provide entry [k,v] tuples rather than values.
while (!(step = iterator.next()).done) {
var entry = step.value;
if (entry) {
if (!isNode(entry[1])) {
return false;
}
}
}
}
} else {
return false;
}
return true;
default:
return false;
}
}
function isSymbol(propType, propValue) {
// Native Symbol.
if (propType === 'symbol') {
return true;
}
// 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
if (propValue['@@toStringTag'] === 'Symbol') {
return true;
}
// Fallback for non-spec compliant Symbols which are polyfilled.
if (typeof Symbol === 'function' && propValue instanceof Symbol) {
return true;
}
return false;
}
// Equivalent of `typeof` but with special handling for array and regexp.
function getPropType(propValue) {
var propType = typeof propValue;
if (Array.isArray(propValue)) {
return 'array';
}
if (propValue instanceof RegExp) {
// Old webkits (at least until Android 4.0) return 'function' rather than
// 'object' for typeof a RegExp. We'll normalize this here so that /bla/
// passes PropTypes.object.
return 'object';
}
if (isSymbol(propType, propValue)) {
return 'symbol';
}
return propType;
}
// This handles more types than `getPropType`. Only used for error messages.
// See `createPrimitiveTypeChecker`.
function getPreciseType(propValue) {
if (typeof propValue === 'undefined' || propValue === null) {
return '' + propValue;
}
var propType = getPropType(propValue);
if (propType === 'object') {
if (propValue instanceof Date) {
return 'date';
} else if (propValue instanceof RegExp) {
return 'regexp';
}
}
return propType;
}
// Returns a string that is postfixed to a warning about an invalid type.
// For example, "undefined" or "of type array"
function getPostfixForTypeWarning(value) {
var type = getPreciseType(value);
switch (type) {
case 'array':
case 'object':
return 'an ' + type;
case 'boolean':
case 'date':
case 'regexp':
return 'a ' + type;
default:
return type;
}
}
// Returns class name of the object, if any.
function getClassName(propValue) {
if (!propValue.constructor || !propValue.constructor.name) {
return ANONYMOUS;
}
return propValue.constructor.name;
}
ReactPropTypes.checkPropTypes = checkPropTypes;
ReactPropTypes.PropTypes = ReactPropTypes;
return ReactPropTypes;
};
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 127 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
if (process.env.NODE_ENV !== 'production') {
var invariant = __webpack_require__(26);
var warning = __webpack_require__(37);
var ReactPropTypesSecret = __webpack_require__(38);
var loggedTypeFailures = {};
}
/**
* Assert that the values match with the type specs.
* Error messages are memorized and will only be shown once.
*
* @param {object} typeSpecs Map of name to a ReactPropType
* @param {object} values Runtime values that need to be type-checked
* @param {string} location e.g. "prop", "context", "child context"
* @param {string} componentName Name of the component for error messages.
* @param {?Function} getStack Returns the component stack.
* @private
*/
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
if (process.env.NODE_ENV !== 'production') {
for (var typeSpecName in typeSpecs) {
if (typeSpecs.hasOwnProperty(typeSpecName)) {
var error;
// Prop type validation may throw. In case they do, we don't want to
// fail the render phase where it didn't fail before. So we log it.
// After these have been cleaned up, we'll let them throw.
try {
// This is intentionally an invariant that gets caught. It's the same
// behavior as without this statement except with a better message.
invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'the `prop-types` package, but received `%s`.', componentName || 'React class', location, typeSpecName, typeof typeSpecs[typeSpecName]);
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
} catch (ex) {
error = ex;
}
warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error);
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
// Only monitor this failure once because there tends to be a lot of the
// same error.
loggedTypeFailures[error.message] = true;
var stack = getStack ? getStack() : '';
warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');
}
}
}
}
}
module.exports = checkPropTypes;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 128 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var emptyFunction = __webpack_require__(36);
var invariant = __webpack_require__(26);
var ReactPropTypesSecret = __webpack_require__(38);
module.exports = function() {
function shim(props, propName, componentName, location, propFullName, secret) {
if (secret === ReactPropTypesSecret) {
// It is still safe when called from React.
return;
}
invariant(
false,
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
'Use PropTypes.checkPropTypes() to call them. ' +
'Read more at http://fb.me/use-check-prop-types'
);
};
shim.isRequired = shim;
function getShim() {
return shim;
};
// Important!
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
var ReactPropTypes = {
array: shim,
bool: shim,
func: shim,
number: shim,
object: shim,
string: shim,
symbol: shim,
any: shim,
arrayOf: getShim,
element: shim,
instanceOf: getShim,
node: shim,
objectOf: getShim,
oneOf: getShim,
oneOfType: getShim,
shape: getShim,
exact: getShim
};
ReactPropTypes.checkPropTypes = emptyFunction;
ReactPropTypes.PropTypes = ReactPropTypes;
return ReactPropTypes;
};
/***/ }),
/* 129 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _classnames = __webpack_require__(5);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* CloseButton
*
* http://getbootstrap.com/css/#helper-classes-close
*/
var ClearButton = function ClearButton(_ref) {
var bsSize = _ref.bsSize,
className = _ref.className,
_onClick = _ref.onClick;
return _react2.default.createElement(
'button',
{
'aria-label': 'Close',
className: (0, _classnames2.default)('close', 'rbt-close', {
'rbt-close-lg': bsSize === 'large' || bsSize === 'lg'
}, className),
onClick: function onClick(e) {
e.stopPropagation();
_onClick(e);
},
type: 'button' },
_react2.default.createElement(
'span',
{ 'aria-hidden': 'true' },
'\xD7'
),
_react2.default.createElement(
'span',
{ className: 'sr-only' },
'Close'
)
);
};
ClearButton.displayName = 'ClearButton';
ClearButton.propTypes = {
bsSize: _propTypes2.default.oneOf(['large', 'lg', 'small', 'sm'])
};
exports.default = ClearButton;
/***/ }),
/* 130 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _classnames = __webpack_require__(5);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var Loader = function Loader(_ref) {
var bsSize = _ref.bsSize;
return _react2.default.createElement('div', {
className: (0, _classnames2.default)('rbt-loader', {
'rbt-loader-lg': bsSize === 'large' || bsSize === 'lg',
'rbt-loader-sm': bsSize === 'small' || bsSize === 'sm'
})
});
};
Loader.propTypes = {
bsSize: _propTypes2.default.oneOf(['large', 'lg', 'small', 'sm'])
};
exports.default = Loader;
/***/ }),
/* 131 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isEqual2 = __webpack_require__(71);
var _isEqual3 = _interopRequireDefault(_isEqual2);
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 _classnames = __webpack_require__(5);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _reactDom = __webpack_require__(2);
var _reactOverlays = __webpack_require__(178);
var _componentOrElement = __webpack_require__(23);
var _componentOrElement2 = _interopRequireDefault(_componentOrElement);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
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 DROPUP_SPACING = -4;
// When appending the overlay to `document.body`, clicking on it will register
// as an "outside" click and immediately close the overlay. This classname tells
// `react-onclickoutside` to ignore the click.
var IGNORE_CLICK_OUTSIDE = 'ignore-react-onclickoutside';
function isBody(container) {
return container === document.body;
}
/**
* Custom `Overlay` component, since the version in `react-overlays` doesn't
* work for our needs. Specifically, the `Position` component doesn't provide
* the customized placement we need.
*/
var Overlay = function (_React$Component) {
_inherits(Overlay, _React$Component);
function Overlay(props) {
_classCallCheck(this, Overlay);
var _this = _possibleConstructorReturn(this, (Overlay.__proto__ || Object.getPrototypeOf(Overlay)).call(this, props));
_this.displayName = 'Overlay';
_this._update = function () {
var _this$props = _this.props,
className = _this$props.className,
container = _this$props.container,
show = _this$props.show;
// Positioning is only used when body is the container.
if (!(show && isBody(container) && _this._mounted && _this._portal)) {
return;
}
var mountNode = _this._portal.getMountNode();
if (mountNode) {
mountNode.className = (0, _classnames2.default)('rbt-body-container', className);
}
_this._updatePosition();
};
_this._updatePosition = function () {
var _this$props2 = _this.props,
align = _this$props2.align,
dropup = _this$props2.dropup,
target = _this$props2.target;
var menuNode = _this._portal.getOverlayDOMNode();
var targetNode = (0, _reactDom.findDOMNode)(target);
if (menuNode && targetNode) {
var _window = window,
innerWidth = _window.innerWidth,
pageYOffset = _window.pageYOffset;
var _targetNode$getBoundi = targetNode.getBoundingClientRect(),
bottom = _targetNode$getBoundi.bottom,
left = _targetNode$getBoundi.left,
top = _targetNode$getBoundi.top,
width = _targetNode$getBoundi.width;
var newState = {
left: align === 'right' ? 'auto' : left,
right: align === 'left' ? 'auto' : innerWidth - left - width,
top: dropup ? pageYOffset - menuNode.offsetHeight + top + DROPUP_SPACING : pageYOffset + bottom
};
// Don't update unless the target element position has changed.
if (!(0, _isEqual3.default)(_this.state, newState)) {
_this.setState(newState);
}
}
};
_this.state = {
left: 0,
right: 0,
top: 0
};
return _this;
}
_createClass(Overlay, [{
key: 'componentDidMount',
value: function componentDidMount() {
this._mounted = true;
this._update();
this._updateThrottled = requestAnimationFrame.bind(null, this._update);
window.addEventListener('resize', this._updateThrottled);
window.addEventListener('scroll', this._updateThrottled, true);
}
}, {
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(nextProps) {
var onMenuHide = nextProps.onMenuHide,
onMenuShow = nextProps.onMenuShow,
show = nextProps.show;
if (this.props.show && !show) {
onMenuHide();
}
if (!this.props.show && show) {
onMenuShow();
}
this._updateThrottled();
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
this._mounted = false;
window.removeEventListener('resize', this._updateThrottled);
window.removeEventListener('scroll', this._updateThrottled);
}
}, {
key: 'render',
value: function render() {
var _this2 = this;
if (!this.props.show) {
return null;
}
var _props = this.props,
container = _props.container,
children = _props.children;
var child = _react.Children.only(children);
// When not attaching the overlay to `document.body` treat the child as a
// simple inline element.
if (!isBody(container)) {
return child;
}
child = (0, _react.cloneElement)(child, _extends({}, child.props, {
className: (0, _classnames2.default)(child.props.className, IGNORE_CLICK_OUTSIDE),
style: this.state
}));
return _react2.default.createElement(
_reactOverlays.Portal,
{ container: container, ref: function ref(portal) {
return _this2._portal = portal;
} },
child
);
}
}]);
return Overlay;
}(_react2.default.Component);
Overlay.propTypes = {
container: _componentOrElement2.default.isRequired,
onMenuHide: _propTypes2.default.func.isRequired,
onMenuShow: _propTypes2.default.func.isRequired,
show: _propTypes2.default.bool,
target: _componentOrElement2.default.isRequired
};
Overlay.defaultProps = {
show: false
};
exports.default = Overlay;
/***/ }),
/* 132 */
/***/ (function(module, exports, __webpack_require__) {
var Stack = __webpack_require__(40),
equalArrays = __webpack_require__(73),
equalByTag = __webpack_require__(163),
equalObjects = __webpack_require__(164),
getTag = __webpack_require__(84),
isArray = __webpack_require__(6),
isBuffer = __webpack_require__(47),
isTypedArray = __webpack_require__(82);
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1;
/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
arrayTag = '[object Array]',
objectTag = '[object Object]';
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* A specialized version of `baseIsEqual` for arrays and objects which performs
* deep comparisons and tracks traversed objects enabling objects with circular
* references to be compared.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
* @param {Function} customizer The function to customize comparisons.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Object} [stack] Tracks traversed `object` and `other` objects.
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
*/
function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
var objIsArr = isArray(object),
othIsArr = isArray(other),
objTag = objIsArr ? arrayTag : getTag(object),
othTag = othIsArr ? arrayTag : getTag(other);
objTag = objTag == argsTag ? objectTag : objTag;
othTag = othTag == argsTag ? objectTag : othTag;
var objIsObj = objTag == objectTag,
othIsObj = othTag == objectTag,
isSameTag = objTag == othTag;
if (isSameTag && isBuffer(object)) {
if (!isBuffer(other)) {
return false;
}
objIsArr = true;
objIsObj = false;
}
if (isSameTag && !objIsObj) {
stack || (stack = new Stack);
return (objIsArr || isTypedArray(object))
? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
: equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
}
if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
if (objIsWrapped || othIsWrapped) {
var objUnwrapped = objIsWrapped ? object.value() : object,
othUnwrapped = othIsWrapped ? other.value() : other;
stack || (stack = new Stack);
return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
}
}
if (!isSameTag) {
return false;
}
stack || (stack = new Stack);
return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
}
module.exports = baseIsEqualDeep;
/***/ }),
/* 133 */
/***/ (function(module, exports) {
/**
* Removes all key-value entries from the list cache.
*
* @private
* @name clear
* @memberOf ListCache
*/
function listCacheClear() {
this.__data__ = [];
this.size = 0;
}
module.exports = listCacheClear;
/***/ }),
/* 134 */
/***/ (function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__(28);
/** Used for built-in method references. */
var arrayProto = Array.prototype;
/** Built-in value references. */
var splice = arrayProto.splice;
/**
* Removes `key` and its value from the list cache.
*
* @private
* @name delete
* @memberOf ListCache
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function listCacheDelete(key) {
var data = this.__data__,
index = assocIndexOf(data, key);
if (index < 0) {
return false;
}
var lastIndex = data.length - 1;
if (index == lastIndex) {
data.pop();
} else {
splice.call(data, index, 1);
}
--this.size;
return true;
}
module.exports = listCacheDelete;
/***/ }),
/* 135 */
/***/ (function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__(28);
/**
* Gets the list cache value for `key`.
*
* @private
* @name get
* @memberOf ListCache
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function listCacheGet(key) {
var data = this.__data__,
index = assocIndexOf(data, key);
return index < 0 ? undefined : data[index][1];
}
module.exports = listCacheGet;
/***/ }),
/* 136 */
/***/ (function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__(28);
/**
* Checks if a list cache value for `key` exists.
*
* @private
* @name has
* @memberOf ListCache
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function listCacheHas(key) {
return assocIndexOf(this.__data__, key) > -1;
}
module.exports = listCacheHas;
/***/ }),
/* 137 */
/***/ (function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__(28);
/**
* Sets the list cache `key` to `value`.
*
* @private
* @name set
* @memberOf ListCache
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the list cache instance.
*/
function listCacheSet(key, value) {
var data = this.__data__,
index = assocIndexOf(data, key);
if (index < 0) {
++this.size;
data.push([key, value]);
} else {
data[index][1] = value;
}
return this;
}
module.exports = listCacheSet;
/***/ }),
/* 138 */
/***/ (function(module, exports, __webpack_require__) {
var ListCache = __webpack_require__(27);
/**
* Removes all key-value entries from the stack.
*
* @private
* @name clear
* @memberOf Stack
*/
function stackClear() {
this.__data__ = new ListCache;
this.size = 0;
}
module.exports = stackClear;
/***/ }),
/* 139 */
/***/ (function(module, exports) {
/**
* Removes `key` and its value from the stack.
*
* @private
* @name delete
* @memberOf Stack
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function stackDelete(key) {
var data = this.__data__,
result = data['delete'](key);
this.size = data.size;
return result;
}
module.exports = stackDelete;
/***/ }),
/* 140 */
/***/ (function(module, exports) {
/**
* Gets the stack value for `key`.
*
* @private
* @name get
* @memberOf Stack
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function stackGet(key) {
return this.__data__.get(key);
}
module.exports = stackGet;
/***/ }),
/* 141 */
/***/ (function(module, exports) {
/**
* Checks if a stack value for `key` exists.
*
* @private
* @name has
* @memberOf Stack
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function stackHas(key) {
return this.__data__.has(key);
}
module.exports = stackHas;
/***/ }),
/* 142 */
/***/ (function(module, exports, __webpack_require__) {
var ListCache = __webpack_require__(27),
Map = __webpack_require__(41),
MapCache = __webpack_require__(43);
/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;
/**
* Sets the stack `key` to `value`.
*
* @private
* @name set
* @memberOf Stack
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the stack cache instance.
*/
function stackSet(key, value) {
var data = this.__data__;
if (data instanceof ListCache) {
var pairs = data.__data__;
if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
pairs.push([key, value]);
this.size = ++data.size;
return this;
}
data = this.__data__ = new MapCache(pairs);
}
data.set(key, value);
this.size = data.size;
return this;
}
module.exports = stackSet;
/***/ }),
/* 143 */
/***/ (function(module, exports, __webpack_require__) {
var isFunction = __webpack_require__(42),
isMasked = __webpack_require__(144),
isObject = __webpack_require__(7),
toSource = __webpack_require__(72);
/**
* Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
/** Used to detect host constructors (Safari). */
var reIsHostCtor = /^\[object .+?Constructor\]$/;
/** Used for built-in method references. */
var funcProto = Function.prototype,
objectProto = Object.prototype;
/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/** Used to detect if a method is native. */
var reIsNative = RegExp('^' +
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
);
/**
* The base implementation of `_.isNative` without bad shim checks.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a native function,
* else `false`.
*/
function baseIsNative(value) {
if (!isObject(value) || isMasked(value)) {
return false;
}
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
return pattern.test(toSource(value));
}
module.exports = baseIsNative;
/***/ }),
/* 144 */
/***/ (function(module, exports, __webpack_require__) {
var coreJsData = __webpack_require__(145);
/** Used to detect methods masquerading as native. */
var maskSrcKey = (function() {
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
return uid ? ('Symbol(src)_1.' + uid) : '';
}());
/**
* Checks if `func` has its source masked.
*
* @private
* @param {Function} func The function to check.
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
*/
function isMasked(func) {
return !!maskSrcKey && (maskSrcKey in func);
}
module.exports = isMasked;
/***/ }),
/* 145 */
/***/ (function(module, exports, __webpack_require__) {
var root = __webpack_require__(3);
/** Used to detect overreaching core-js shims. */
var coreJsData = root['__core-js_shared__'];
module.exports = coreJsData;
/***/ }),
/* 146 */
/***/ (function(module, exports) {
/**
* Gets the value at `key` of `object`.
*
* @private
* @param {Object} [object] The object to query.
* @param {string} key The key of the property to get.
* @returns {*} Returns the property value.
*/
function getValue(object, key) {
return object == null ? undefined : object[key];
}
module.exports = getValue;
/***/ }),
/* 147 */
/***/ (function(module, exports, __webpack_require__) {
var Hash = __webpack_require__(148),
ListCache = __webpack_require__(27),
Map = __webpack_require__(41);
/**
* Removes all key-value entries from the map.
*
* @private
* @name clear
* @memberOf MapCache
*/
function mapCacheClear() {
this.size = 0;
this.__data__ = {
'hash': new Hash,
'map': new (Map || ListCache),
'string': new Hash
};
}
module.exports = mapCacheClear;
/***/ }),
/* 148 */
/***/ (function(module, exports, __webpack_require__) {
var hashClear = __webpack_require__(149),
hashDelete = __webpack_require__(150),
hashGet = __webpack_require__(151),
hashHas = __webpack_require__(152),
hashSet = __webpack_require__(153);
/**
* Creates a hash object.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function Hash(entries) {
var index = -1,
length = entries == null ? 0 : entries.length;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
// Add methods to `Hash`.
Hash.prototype.clear = hashClear;
Hash.prototype['delete'] = hashDelete;
Hash.prototype.get = hashGet;
Hash.prototype.has = hashHas;
Hash.prototype.set = hashSet;
module.exports = Hash;
/***/ }),
/* 149 */
/***/ (function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__(30);
/**
* Removes all key-value entries from the hash.
*
* @private
* @name clear
* @memberOf Hash
*/
function hashClear() {
this.__data__ = nativeCreate ? nativeCreate(null) : {};
this.size = 0;
}
module.exports = hashClear;
/***/ }),
/* 150 */
/***/ (function(module, exports) {
/**
* Removes `key` and its value from the hash.
*
* @private
* @name delete
* @memberOf Hash
* @param {Object} hash The hash to modify.
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function hashDelete(key) {
var result = this.has(key) && delete this.__data__[key];
this.size -= result ? 1 : 0;
return result;
}
module.exports = hashDelete;
/***/ }),
/* 151 */
/***/ (function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__(30);
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Gets the hash value for `key`.
*
* @private
* @name get
* @memberOf Hash
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function hashGet(key) {
var data = this.__data__;
if (nativeCreate) {
var result = data[key];
return result === HASH_UNDEFINED ? undefined : result;
}
return hasOwnProperty.call(data, key) ? data[key] : undefined;
}
module.exports = hashGet;
/***/ }),
/* 152 */
/***/ (function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__(30);
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Checks if a hash value for `key` exists.
*
* @private
* @name has
* @memberOf Hash
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function hashHas(key) {
var data = this.__data__;
return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
}
module.exports = hashHas;
/***/ }),
/* 153 */
/***/ (function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__(30);
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/**
* Sets the hash `key` to `value`.
*
* @private
* @name set
* @memberOf Hash
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the hash instance.
*/
function hashSet(key, value) {
var data = this.__data__;
this.size += this.has(key) ? 0 : 1;
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
return this;
}
module.exports = hashSet;
/***/ }),
/* 154 */
/***/ (function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__(31);
/**
* Removes `key` and its value from the map.
*
* @private
* @name delete
* @memberOf MapCache
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function mapCacheDelete(key) {
var result = getMapData(this, key)['delete'](key);
this.size -= result ? 1 : 0;
return result;
}
module.exports = mapCacheDelete;
/***/ }),
/* 155 */
/***/ (function(module, exports) {
/**
* Checks if `value` is suitable for use as unique object key.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
*/
function isKeyable(value) {
var type = typeof value;
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
? (value !== '__proto__')
: (value === null);
}
module.exports = isKeyable;
/***/ }),
/* 156 */
/***/ (function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__(31);
/**
* Gets the map value for `key`.
*
* @private
* @name get
* @memberOf MapCache
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function mapCacheGet(key) {
return getMapData(this, key).get(key);
}
module.exports = mapCacheGet;
/***/ }),
/* 157 */
/***/ (function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__(31);
/**
* Checks if a map value for `key` exists.
*
* @private
* @name has
* @memberOf MapCache
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function mapCacheHas(key) {
return getMapData(this, key).has(key);
}
module.exports = mapCacheHas;
/***/ }),
/* 158 */
/***/ (function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__(31);
/**
* Sets the map `key` to `value`.
*
* @private
* @name set
* @memberOf MapCache
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the map cache instance.
*/
function mapCacheSet(key, value) {
var data = getMapData(this, key),
size = data.size;
data.set(key, value);
this.size += data.size == size ? 0 : 1;
return this;
}
module.exports = mapCacheSet;
/***/ }),
/* 159 */
/***/ (function(module, exports, __webpack_require__) {
var MapCache = __webpack_require__(43),
setCacheAdd = __webpack_require__(160),
setCacheHas = __webpack_require__(161);
/**
*
* Creates an array cache object to store unique values.
*
* @private
* @constructor
* @param {Array} [values] The values to cache.
*/
function SetCache(values) {
var index = -1,
length = values == null ? 0 : values.length;
this.__data__ = new MapCache;
while (++index < length) {
this.add(values[index]);
}
}
// Add methods to `SetCache`.
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
SetCache.prototype.has = setCacheHas;
module.exports = SetCache;
/***/ }),
/* 160 */
/***/ (function(module, exports) {
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/**
* Adds `value` to the array cache.
*
* @private
* @name add
* @memberOf SetCache
* @alias push
* @param {*} value The value to cache.
* @returns {Object} Returns the cache instance.
*/
function setCacheAdd(value) {
this.__data__.set(value, HASH_UNDEFINED);
return this;
}
module.exports = setCacheAdd;
/***/ }),
/* 161 */
/***/ (function(module, exports) {
/**
* Checks if `value` is in the array cache.
*
* @private
* @name has
* @memberOf SetCache
* @param {*} value The value to search for.
* @returns {number} Returns `true` if `value` is found, else `false`.
*/
function setCacheHas(value) {
return this.__data__.has(value);
}
module.exports = setCacheHas;
/***/ }),
/* 162 */
/***/ (function(module, exports) {
/**
* Checks if a `cache` value for `key` exists.
*
* @private
* @param {Object} cache The cache to query.
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function cacheHas(cache, key) {
return cache.has(key);
}
module.exports = cacheHas;
/***/ }),
/* 163 */
/***/ (function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(12),
Uint8Array = __webpack_require__(75),
eq = __webpack_require__(29),
equalArrays = __webpack_require__(73),
mapToArray = __webpack_require__(76),
setToArray = __webpack_require__(77);
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1,
COMPARE_UNORDERED_FLAG = 2;
/** `Object#toString` result references. */
var boolTag = '[object Boolean]',
dateTag = '[object Date]',
errorTag = '[object Error]',
mapTag = '[object Map]',
numberTag = '[object Number]',
regexpTag = '[object RegExp]',
setTag = '[object Set]',
stringTag = '[object String]',
symbolTag = '[object Symbol]';
var arrayBufferTag = '[object ArrayBuffer]',
dataViewTag = '[object DataView]';
/** Used to convert symbols to primitives and strings. */
var symbolProto = Symbol ? Symbol.prototype : undefined,
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
/**
* A specialized version of `baseIsEqualDeep` for comparing objects of
* the same `toStringTag`.
*
* **Note:** This function only supports comparing values with tags of
* `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {string} tag The `toStringTag` of the objects to compare.
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
* @param {Function} customizer The function to customize comparisons.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Object} stack Tracks traversed `object` and `other` objects.
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
*/
function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
switch (tag) {
case dataViewTag:
if ((object.byteLength != other.byteLength) ||
(object.byteOffset != other.byteOffset)) {
return false;
}
object = object.buffer;
other = other.buffer;
case arrayBufferTag:
if ((object.byteLength != other.byteLength) ||
!equalFunc(new Uint8Array(object), new Uint8Array(other))) {
return false;
}
return true;
case boolTag:
case dateTag:
case numberTag:
// Coerce booleans to `1` or `0` and dates to milliseconds.
// Invalid dates are coerced to `NaN`.
return eq(+object, +other);
case errorTag:
return object.name == other.name && object.message == other.message;
case regexpTag:
case stringTag:
// Coerce regexes to strings and treat strings, primitives and objects,
// as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
// for more details.
return object == (other + '');
case mapTag:
var convert = mapToArray;
case setTag:
var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
convert || (convert = setToArray);
if (object.size != other.size && !isPartial) {
return false;
}
// Assume cyclic values are equal.
var stacked = stack.get(object);
if (stacked) {
return stacked == other;
}
bitmask |= COMPARE_UNORDERED_FLAG;
// Recursively compare objects (susceptible to call stack limits).
stack.set(object, other);
var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
stack['delete'](object);
return result;
case symbolTag:
if (symbolValueOf) {
return symbolValueOf.call(object) == symbolValueOf.call(other);
}
}
return false;
}
module.exports = equalByTag;
/***/ }),
/* 164 */
/***/ (function(module, exports, __webpack_require__) {
var getAllKeys = __webpack_require__(78);
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1;
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* A specialized version of `baseIsEqualDeep` for objects with support for
* partial deep comparisons.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
* @param {Function} customizer The function to customize comparisons.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Object} stack Tracks traversed `object` and `other` objects.
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
*/
function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
objProps = getAllKeys(object),
objLength = objProps.length,
othProps = getAllKeys(other),
othLength = othProps.length;
if (objLength != othLength && !isPartial) {
return false;
}
var index = objLength;
while (index--) {
var key = objProps[index];
if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
return false;
}
}
// Assume cyclic values are equal.
var stacked = stack.get(object);
if (stacked && stack.get(other)) {
return stacked == other;
}
var result = true;
stack.set(object, other);
stack.set(other, object);
var skipCtor = isPartial;
while (++index < objLength) {
key = objProps[index];
var objValue = object[key],
othValue = other[key];
if (customizer) {
var compared = isPartial
? customizer(othValue, objValue, key, other, object, stack)
: customizer(objValue, othValue, key, object, other, stack);
}
// Recursively compare objects (susceptible to call stack limits).
if (!(compared === undefined
? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
: compared
)) {
result = false;
break;
}
skipCtor || (skipCtor = key == 'constructor');
}
if (result && !skipCtor) {
var objCtor = object.constructor,
othCtor = other.constructor;
// Non `Object` object instances with different constructors are not equal.
if (objCtor != othCtor &&
('constructor' in object && 'constructor' in other) &&
!(typeof objCtor == 'function' && objCtor instanceof objCtor &&
typeof othCtor == 'function' && othCtor instanceof othCtor)) {
result = false;
}
}
stack['delete'](object);
stack['delete'](other);
return result;
}
module.exports = equalObjects;
/***/ }),
/* 165 */
/***/ (function(module, exports) {
/**
* A specialized version of `_.filter` for arrays without support for
* iteratee shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {Array} Returns the new filtered array.
*/
function arrayFilter(array, predicate) {
var index = -1,
length = array == null ? 0 : array.length,
resIndex = 0,
result = [];
while (++index < length) {
var value = array[index];
if (predicate(value, index, array)) {
result[resIndex++] = value;
}
}
return result;
}
module.exports = arrayFilter;
/***/ }),
/* 166 */
/***/ (function(module, exports) {
/**
* The base implementation of `_.times` without support for iteratee shorthands
* or max array length checks.
*
* @private
* @param {number} n The number of times to invoke `iteratee`.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns the array of results.
*/
function baseTimes(n, iteratee) {
var index = -1,
result = Array(n);
while (++index < n) {
result[index] = iteratee(index);
}
return result;
}
module.exports = baseTimes;
/***/ }),
/* 167 */
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(11),
isObjectLike = __webpack_require__(13);
/** `Object#toString` result references. */
var argsTag = '[object Arguments]';
/**
* The base implementation of `_.isArguments`.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
*/
function baseIsArguments(value) {
return isObjectLike(value) && baseGetTag(value) == argsTag;
}
module.exports = baseIsArguments;
/***/ }),
/* 168 */
/***/ (function(module, exports) {
/**
* This method returns `false`.
*
* @static
* @memberOf _
* @since 4.13.0
* @category Util
* @returns {boolean} Returns `false`.
* @example
*
* _.times(2, _.stubFalse);
* // => [false, false]
*/
function stubFalse() {
return false;
}
module.exports = stubFalse;
/***/ }),
/* 169 */
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(11),
isLength = __webpack_require__(49),
isObjectLike = __webpack_require__(13);
/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
arrayTag = '[object Array]',
boolTag = '[object Boolean]',
dateTag = '[object Date]',
errorTag = '[object Error]',
funcTag = '[object Function]',
mapTag = '[object Map]',
numberTag = '[object Number]',
objectTag = '[object Object]',
regexpTag = '[object RegExp]',
setTag = '[object Set]',
stringTag = '[object String]',
weakMapTag = '[object WeakMap]';
var arrayBufferTag = '[object ArrayBuffer]',
dataViewTag = '[object DataView]',
float32Tag = '[object Float32Array]',
float64Tag = '[object Float64Array]',
int8Tag = '[object Int8Array]',
int16Tag = '[object Int16Array]',
int32Tag = '[object Int32Array]',
uint8Tag = '[object Uint8Array]',
uint8ClampedTag = '[object Uint8ClampedArray]',
uint16Tag = '[object Uint16Array]',
uint32Tag = '[object Uint32Array]';
/** Used to identify `toStringTag` values of typed arrays. */
var typedArrayTags = {};
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
typedArrayTags[uint32Tag] = true;
typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
typedArrayTags[errorTag] = typedArrayTags[funcTag] =
typedArrayTags[mapTag] = typedArrayTags[numberTag] =
typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
typedArrayTags[setTag] = typedArrayTags[stringTag] =
typedArrayTags[weakMapTag] = false;
/**
* The base implementation of `_.isTypedArray` without Node.js optimizations.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
*/
function baseIsTypedArray(value) {
return isObjectLike(value) &&
isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
}
module.exports = baseIsTypedArray;
/***/ }),
/* 170 */
/***/ (function(module, exports) {
/**
* The base implementation of `_.unary` without support for storing metadata.
*
* @private
* @param {Function} func The function to cap arguments for.
* @returns {Function} Returns the new capped function.
*/
function baseUnary(func) {
return function(value) {
return func(value);
};
}
module.exports = baseUnary;
/***/ }),
/* 171 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(module) {var freeGlobal = __webpack_require__(67);
/** Detect free variable `exports`. */
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
/** Detect free variable `module`. */
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = freeModule && freeModule.exports === freeExports;
/** Detect free variable `process` from Node.js. */
var freeProcess = moduleExports && freeGlobal.process;
/** Used to access faster Node.js helpers. */
var nodeUtil = (function() {
try {
return freeProcess && freeProcess.binding && freeProcess.binding('util');
} catch (e) {}
}());
module.exports = nodeUtil;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(48)(module)))
/***/ }),
/* 172 */
/***/ (function(module, exports, __webpack_require__) {
var isPrototype = __webpack_require__(50),
nativeKeys = __webpack_require__(173);
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function baseKeys(object) {
if (!isPrototype(object)) {
return nativeKeys(object);
}
var result = [];
for (var key in Object(object)) {
if (hasOwnProperty.call(object, key) && key != 'constructor') {
result.push(key);
}
}
return result;
}
module.exports = baseKeys;
/***/ }),
/* 173 */
/***/ (function(module, exports, __webpack_require__) {
var overArg = __webpack_require__(83);
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeKeys = overArg(Object.keys, Object);
module.exports = nativeKeys;
/***/ }),
/* 174 */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(8),
root = __webpack_require__(3);
/* Built-in method references that are verified to be native. */
var DataView = getNative(root, 'DataView');
module.exports = DataView;
/***/ }),
/* 175 */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(8),
root = __webpack_require__(3);
/* Built-in method references that are verified to be native. */
var Promise = getNative(root, 'Promise');
module.exports = Promise;
/***/ }),
/* 176 */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(8),
root = __webpack_require__(3);
/* Built-in method references that are verified to be native. */
var Set = getNative(root, 'Set');
module.exports = Set;
/***/ }),
/* 177 */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(8),
root = __webpack_require__(3);
/* Built-in method references that are verified to be native. */
var WeakMap = getNative(root, 'WeakMap');
module.exports = WeakMap;
/***/ }),
/* 178 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
exports.RootCloseWrapper = exports.Position = exports.Portal = exports.Overlay = exports.Modal = exports.AutoAffix = exports.Affix = undefined;
var _Affix2 = __webpack_require__(85);
var _Affix3 = _interopRequireDefault(_Affix2);
var _AutoAffix2 = __webpack_require__(190);
var _AutoAffix3 = _interopRequireDefault(_AutoAffix2);
var _Modal2 = __webpack_require__(191);
var _Modal3 = _interopRequireDefault(_Modal2);
var _Overlay2 = __webpack_require__(201);
var _Overlay3 = _interopRequireDefault(_Overlay2);
var _Portal2 = __webpack_require__(55);
var _Portal3 = _interopRequireDefault(_Portal2);
var _Position2 = __webpack_require__(95);
var _Position3 = _interopRequireDefault(_Position2);
var _RootCloseWrapper2 = __webpack_require__(96);
var _RootCloseWrapper3 = _interopRequireDefault(_RootCloseWrapper2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.Affix = _Affix3.default;
exports.AutoAffix = _AutoAffix3.default;
exports.Modal = _Modal3.default;
exports.Overlay = _Overlay3.default;
exports.Portal = _Portal3.default;
exports.Position = _Position3.default;
exports.RootCloseWrapper = _RootCloseWrapper3.default;
/***/ }),
/* 179 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = height;
var _offset = __webpack_require__(21);
var _offset2 = _interopRequireDefault(_offset);
var _isWindow = __webpack_require__(22);
var _isWindow2 = _interopRequireDefault(_isWindow);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function height(node, client) {
var win = (0, _isWindow2.default)(node);
return win ? win.innerHeight : client ? node.clientHeight : (0, _offset2.default)(node).height;
}
module.exports = exports['default'];
/***/ }),
/* 180 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = camelize;
var rHyphen = /-(.)/g;
function camelize(string) {
return string.replace(rHyphen, function (_, chr) {
return chr.toUpperCase();
});
}
module.exports = exports["default"];
/***/ }),
/* 181 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = hyphenateStyleName;
var _hyphenate = __webpack_require__(182);
var _hyphenate2 = _interopRequireDefault(_hyphenate);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var msPattern = /^ms-/; /**
* Copyright 2013-2014, Facebook, Inc.
* All rights reserved.
* https://github.com/facebook/react/blob/2aeb8a2a6beb00617a4217f7f8284924fa2ad819/src/vendor/core/hyphenateStyleName.js
*/
function hyphenateStyleName(string) {
return (0, _hyphenate2.default)(string).replace(msPattern, '-ms-');
}
module.exports = exports['default'];
/***/ }),
/* 182 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = hyphenate;
var rUpper = /([A-Z])/g;
function hyphenate(string) {
return string.replace(rUpper, '-$1').toLowerCase();
}
module.exports = exports['default'];
/***/ }),
/* 183 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _getComputedStyle;
var _camelizeStyle = __webpack_require__(87);
var _camelizeStyle2 = _interopRequireDefault(_camelizeStyle);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var rposition = /^(top|right|bottom|left)$/;
var rnumnonpx = /^([+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|))(?!px)[a-z%]+$/i;
function _getComputedStyle(node) {
if (!node) throw new TypeError('No Element passed to `getComputedStyle()`');
var doc = node.ownerDocument;
return 'defaultView' in doc ? doc.defaultView.opener ? node.ownerDocument.defaultView.getComputedStyle(node, null) : window.getComputedStyle(node, null) : {
//ie 8 "magic" from: https://github.com/jquery/jquery/blob/1.11-stable/src/css/curCSS.js#L72
getPropertyValue: function getPropertyValue(prop) {
var style = node.style;
prop = (0, _camelizeStyle2.default)(prop);
if (prop == 'float') prop = 'styleFloat';
var current = node.currentStyle[prop] || null;
if (current == null && style && style[prop]) current = style[prop];
if (rnumnonpx.test(current) && !rposition.test(prop)) {
// Remember the original values
var left = style.left;
var runStyle = node.runtimeStyle;
var rsLeft = runStyle && runStyle.left;
// Put in the new values to get a computed value out
if (rsLeft) runStyle.left = node.currentStyle.left;
style.left = prop === 'fontSize' ? '1em' : current;
current = style.pixelLeft + 'px';
// Revert the changed values
style.left = left;
if (rsLeft) runStyle.left = rsLeft;
}
return current;
}
};
}
module.exports = exports['default'];
/***/ }),
/* 184 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = removeStyle;
function removeStyle(node, key) {
return 'removeProperty' in node.style ? node.style.removeProperty(key) : node.style.removeAttribute(key);
}
module.exports = exports['default'];
/***/ }),
/* 185 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.animationEnd = exports.animationDelay = exports.animationTiming = exports.animationDuration = exports.animationName = exports.transitionEnd = exports.transitionDuration = exports.transitionDelay = exports.transitionTiming = exports.transitionProperty = exports.transform = undefined;
var _inDOM = __webpack_require__(9);
var _inDOM2 = _interopRequireDefault(_inDOM);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var transform = 'transform';
var prefix = void 0,
transitionEnd = void 0,
animationEnd = void 0;
var transitionProperty = void 0,
transitionDuration = void 0,
transitionTiming = void 0,
transitionDelay = void 0;
var animationName = void 0,
animationDuration = void 0,
animationTiming = void 0,
animationDelay = void 0;
if (_inDOM2.default) {
var _getTransitionPropert = getTransitionProperties();
prefix = _getTransitionPropert.prefix;
exports.transitionEnd = transitionEnd = _getTransitionPropert.transitionEnd;
exports.animationEnd = animationEnd = _getTransitionPropert.animationEnd;
exports.transform = transform = prefix + '-' + transform;
exports.transitionProperty = transitionProperty = prefix + '-transition-property';
exports.transitionDuration = transitionDuration = prefix + '-transition-duration';
exports.transitionDelay = transitionDelay = prefix + '-transition-delay';
exports.transitionTiming = transitionTiming = prefix + '-transition-timing-function';
exports.animationName = animationName = prefix + '-animation-name';
exports.animationDuration = animationDuration = prefix + '-animation-duration';
exports.animationTiming = animationTiming = prefix + '-animation-delay';
exports.animationDelay = animationDelay = prefix + '-animation-timing-function';
}
exports.transform = transform;
exports.transitionProperty = transitionProperty;
exports.transitionTiming = transitionTiming;
exports.transitionDelay = transitionDelay;
exports.transitionDuration = transitionDuration;
exports.transitionEnd = transitionEnd;
exports.animationName = animationName;
exports.animationDuration = animationDuration;
exports.animationTiming = animationTiming;
exports.animationDelay = animationDelay;
exports.animationEnd = animationEnd;
exports.default = {
transform: transform,
end: transitionEnd,
property: transitionProperty,
timing: transitionTiming,
delay: transitionDelay,
duration: transitionDuration
};
function getTransitionProperties() {
var style = document.createElement('div').style;
var vendorMap = {
O: function O(e) {
return 'o' + e.toLowerCase();
},
Moz: function Moz(e) {
return e.toLowerCase();
},
Webkit: function Webkit(e) {
return 'webkit' + e;
},
ms: function ms(e) {
return 'MS' + e;
}
};
var vendors = Object.keys(vendorMap);
var transitionEnd = void 0,
animationEnd = void 0;
var prefix = '';
for (var i = 0; i < vendors.length; i++) {
var vendor = vendors[i];
if (vendor + 'TransitionProperty' in style) {
prefix = '-' + vendor.toLowerCase();
transitionEnd = vendorMap[vendor]('TransitionEnd');
animationEnd = vendorMap[vendor]('AnimationEnd');
break;
}
}
if (!transitionEnd && 'transitionProperty' in style) transitionEnd = 'transitionend';
if (!animationEnd && 'animationName' in style) animationEnd = 'animationend';
style = null;
return { animationEnd: animationEnd, transitionEnd: transitionEnd, prefix: prefix };
}
/***/ }),
/* 186 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = isTransform;
var supportedTransforms = /^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i;
function isTransform(property) {
return !!(property && supportedTransforms.test(property));
}
module.exports = exports["default"];
/***/ }),
/* 187 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _inDOM = __webpack_require__(9);
var _inDOM2 = _interopRequireDefault(_inDOM);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var on = function on() {};
if (_inDOM2.default) {
on = function () {
if (document.addEventListener) return function (node, eventName, handler, capture) {
return node.addEventListener(eventName, handler, capture || false);
};else if (document.attachEvent) return function (node, eventName, handler) {
return node.attachEvent('on' + eventName, function (e) {
e = e || window.event;
e.target = e.target || e.srcElement;
e.currentTarget = node;
handler.call(node, e);
});
};
}();
}
exports.default = on;
module.exports = exports['default'];
/***/ }),
/* 188 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _inDOM = __webpack_require__(9);
var _inDOM2 = _interopRequireDefault(_inDOM);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var off = function off() {};
if (_inDOM2.default) {
off = function () {
if (document.addEventListener) return function (node, eventName, handler, capture) {
return node.removeEventListener(eventName, handler, capture || false);
};else if (document.attachEvent) return function (node, eventName, handler) {
return node.detachEvent('on' + eventName, handler);
};
}();
}
exports.default = off;
module.exports = exports['default'];
/***/ }),
/* 189 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = ownerWindow;
var _ownerDocument = __webpack_require__(15);
var _ownerDocument2 = _interopRequireDefault(_ownerDocument);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function ownerWindow(node) {
var doc = (0, _ownerDocument2.default)(node);
return doc && doc.defaultView || doc.parentWindow;
}
module.exports = exports['default'];
/***/ }),
/* 190 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = 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 _offset = __webpack_require__(21);
var _offset2 = _interopRequireDefault(_offset);
var _requestAnimationFrame = __webpack_require__(88);
var _requestAnimationFrame2 = _interopRequireDefault(_requestAnimationFrame);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _componentOrElement = __webpack_require__(23);
var _componentOrElement2 = _interopRequireDefault(_componentOrElement);
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _Affix = __webpack_require__(85);
var _Affix2 = _interopRequireDefault(_Affix);
var _addEventListener = __webpack_require__(33);
var _addEventListener2 = _interopRequireDefault(_addEventListener);
var _getContainer = __webpack_require__(34);
var _getContainer2 = _interopRequireDefault(_getContainer);
var _getDocumentHeight = __webpack_require__(89);
var _getDocumentHeight2 = _interopRequireDefault(_getDocumentHeight);
var _ownerDocument = __webpack_require__(10);
var _ownerDocument2 = _interopRequireDefault(_ownerDocument);
var _ownerWindow = __webpack_require__(90);
var _ownerWindow2 = _interopRequireDefault(_ownerWindow);
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; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
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 displayName = 'AutoAffix';
var propTypes = _extends({}, _Affix2.default.propTypes, {
/**
* The logical container node or component for determining offset from bottom
* of viewport, or a function that returns it
*/
container: _propTypes2.default.oneOfType([_componentOrElement2.default, _propTypes2.default.func]),
/**
* Automatically set width when affixed
*/
autoWidth: _propTypes2.default.bool
});
// This intentionally doesn't inherit default props from ``, so that the
// auto-calculated offsets can apply.
var defaultProps = {
viewportOffsetTop: 0,
autoWidth: true
};
/**
* The `` component wraps `` to automatically calculate
* offsets in many common cases.
*/
var AutoAffix = function (_React$Component) {
_inherits(AutoAffix, _React$Component);
function AutoAffix(props, context) {
_classCallCheck(this, AutoAffix);
var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context));
_this.onWindowScroll = function () {
_this.onUpdate();
};
_this.onWindowResize = function () {
if (_this.props.autoWidth) {
(0, _requestAnimationFrame2.default)(function () {
return _this.onUpdate();
});
}
};
_this.onDocumentClick = function () {
(0, _requestAnimationFrame2.default)(function () {
return _this.onUpdate();
});
};
_this.onUpdate = function () {
if (!_this._isMounted) {
return;
}
var _getOffset = (0, _offset2.default)(_this.positioner),
offsetTop = _getOffset.top,
width = _getOffset.width;
var container = (0, _getContainer2.default)(_this.props.container);
var offsetBottom = void 0;
if (container) {
var documentHeight = (0, _getDocumentHeight2.default)((0, _ownerDocument2.default)(_this));
var _getOffset2 = (0, _offset2.default)(container),
top = _getOffset2.top,
height = _getOffset2.height;
offsetBottom = documentHeight - top - height;
} else {
offsetBottom = null;
}
_this.updateState(offsetTop, offsetBottom, width);
};
_this.updateState = function (offsetTop, offsetBottom, width) {
if (offsetTop === _this.state.offsetTop && offsetBottom === _this.state.offsetBottom && width === _this.state.width) {
return;
}
_this.setState({ offsetTop: offsetTop, offsetBottom: offsetBottom, width: width });
};
_this.state = {
offsetTop: null,
offsetBottom: null,
width: null
};
return _this;
}
AutoAffix.prototype.componentDidMount = function componentDidMount() {
var _this2 = this;
this._isMounted = true;
this._windowScrollListener = (0, _addEventListener2.default)((0, _ownerWindow2.default)(this), 'scroll', function () {
return _this2.onWindowScroll();
});
this._windowResizeListener = (0, _addEventListener2.default)((0, _ownerWindow2.default)(this), 'resize', function () {
return _this2.onWindowResize();
});
this._documentClickListener = (0, _addEventListener2.default)((0, _ownerDocument2.default)(this), 'click', function () {
return _this2.onDocumentClick();
});
this.onUpdate();
};
AutoAffix.prototype.componentWillReceiveProps = function componentWillReceiveProps() {
this._needPositionUpdate = true;
};
AutoAffix.prototype.componentDidUpdate = function componentDidUpdate() {
if (this._needPositionUpdate) {
this._needPositionUpdate = false;
this.onUpdate();
}
};
AutoAffix.prototype.componentWillUnmount = function componentWillUnmount() {
this._isMounted = false;
if (this._windowScrollListener) {
this._windowScrollListener.remove();
}
if (this._documentClickListener) {
this._documentClickListener.remove();
}
if (this._windowResizeListener) {
this._windowResizeListener.remove();
}
};
AutoAffix.prototype.render = function render() {
var _this3 = this;
var _props = this.props,
autoWidth = _props.autoWidth,
viewportOffsetTop = _props.viewportOffsetTop,
children = _props.children,
props = _objectWithoutProperties(_props, ['autoWidth', 'viewportOffsetTop', 'children']);
var _state = this.state,
offsetTop = _state.offsetTop,
offsetBottom = _state.offsetBottom,
width = _state.width;
delete props.container;
var effectiveOffsetTop = Math.max(offsetTop, viewportOffsetTop || 0);
var _props2 = this.props,
affixStyle = _props2.affixStyle,
bottomStyle = _props2.bottomStyle;
if (autoWidth) {
affixStyle = _extends({ width: width }, affixStyle);
bottomStyle = _extends({ width: width }, bottomStyle);
}
return _react2.default.createElement(
'div',
null,
_react2.default.createElement('div', { ref: function ref(c) {
_this3.positioner = c;
} }),
_react2.default.createElement(
_Affix2.default,
_extends({}, props, {
offsetTop: effectiveOffsetTop,
viewportOffsetTop: viewportOffsetTop,
offsetBottom: offsetBottom,
affixStyle: affixStyle,
bottomStyle: bottomStyle
}),
children
)
);
};
return AutoAffix;
}(_react2.default.Component);
AutoAffix.displayName = displayName;
AutoAffix.propTypes = propTypes;
AutoAffix.defaultProps = defaultProps;
exports.default = AutoAffix;
module.exports = exports['default'];
/***/ }),
/* 191 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = 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 _activeElement = __webpack_require__(192);
var _activeElement2 = _interopRequireDefault(_activeElement);
var _contains = __webpack_require__(51);
var _contains2 = _interopRequireDefault(_contains);
var _inDOM = __webpack_require__(9);
var _inDOM2 = _interopRequireDefault(_inDOM);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _componentOrElement = __webpack_require__(23);
var _componentOrElement2 = _interopRequireDefault(_componentOrElement);
var _deprecated = __webpack_require__(92);
var _deprecated2 = _interopRequireDefault(_deprecated);
var _elementType = __webpack_require__(93);
var _elementType2 = _interopRequireDefault(_elementType);
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _warning = __webpack_require__(54);
var _warning2 = _interopRequireDefault(_warning);
var _Portal = __webpack_require__(55);
var _Portal2 = _interopRequireDefault(_Portal);
var _ModalManager = __webpack_require__(193);
var _ModalManager2 = _interopRequireDefault(_ModalManager);
var _addEventListener = __webpack_require__(33);
var _addEventListener2 = _interopRequireDefault(_addEventListener);
var _addFocusListener = __webpack_require__(200);
var _addFocusListener2 = _interopRequireDefault(_addFocusListener);
var _getContainer = __webpack_require__(34);
var _getContainer2 = _interopRequireDefault(_getContainer);
var _ownerDocument = __webpack_require__(10);
var _ownerDocument2 = _interopRequireDefault(_ownerDocument);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
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; } /*eslint-disable react/prop-types */
var modalManager = new _ModalManager2.default();
/**
* Love them or hate them, `` provides a solid foundation for creating dialogs, lightboxes, or whatever else.
* The Modal component renders its `children` node in front of a backdrop component.
*
* The Modal offers a few helpful features over using just a `` component and some styles:
*
* - Manages dialog stacking when one-at-a-time just isn't enough.
* - Creates a backdrop, for disabling interaction below the modal.
* - It properly manages focus; moving to the modal content, and keeping it there until the modal is closed.
* - It disables scrolling of the page content while open.
* - Adds the appropriate ARIA roles are automatically.
* - Easily pluggable animations via a `` component.
*
* Note that, in the same way the backdrop element prevents users from clicking or interacting
* with the page content underneath the Modal, Screen readers also need to be signaled to not to
* interact with page content while the Modal is open. To do this, we use a common technique of applying
* the `aria-hidden='true'` attribute to the non-Modal elements in the Modal `container`. This means that for
* a Modal to be truly modal, it should have a `container` that is _outside_ your app's
* React hierarchy (such as the default: document.body).
*/
var Modal = function (_React$Component) {
_inherits(Modal, _React$Component);
function Modal() {
var _temp, _this, _ret;
_classCallCheck(this, Modal);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _initialiseProps.call(_this), _temp), _possibleConstructorReturn(_this, _ret);
}
Modal.prototype.omitProps = function omitProps(props, propTypes) {
var keys = Object.keys(props);
var newProps = {};
keys.map(function (prop) {
if (!Object.prototype.hasOwnProperty.call(propTypes, prop)) {
newProps[prop] = props[prop];
}
});
return newProps;
};
Modal.prototype.render = function render() {
var _props = this.props,
show = _props.show,
container = _props.container,
children = _props.children,
Transition = _props.transition,
backdrop = _props.backdrop,
className = _props.className,
style = _props.style,
onExit = _props.onExit,
onExiting = _props.onExiting,
onEnter = _props.onEnter,
onEntering = _props.onEntering,
onEntered = _props.onEntered;
var dialog = _react2.default.Children.only(children);
var filteredProps = this.omitProps(this.props, Modal.propTypes);
var mountModal = show || Transition && !this.state.exited;
if (!mountModal) {
return null;
}
var _dialog$props = dialog.props,
role = _dialog$props.role,
tabIndex = _dialog$props.tabIndex;
if (role === undefined || tabIndex === undefined) {
dialog = (0, _react.cloneElement)(dialog, {
role: role === undefined ? 'document' : role,
tabIndex: tabIndex == null ? '-1' : tabIndex
});
}
if (Transition) {
dialog = _react2.default.createElement(
Transition,
{
appear: true,
unmountOnExit: true,
'in': show,
onExit: onExit,
onExiting: onExiting,
onExited: this.handleHidden,
onEnter: onEnter,
onEntering: onEntering,
onEntered: onEntered
},
dialog
);
}
return _react2.default.createElement(
_Portal2.default,
{
ref: this.setMountNode,
container: container
},
_react2.default.createElement(
'div',
_extends({
ref: this.setModalNode,
role: role || 'dialog'
}, filteredProps, {
style: style,
className: className
}),
backdrop && this.renderBackdrop(),
dialog
)
);
};
Modal.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
if (nextProps.show) {
this.setState({ exited: false });
} else if (!nextProps.transition) {
// Otherwise let handleHidden take care of marking exited.
this.setState({ exited: true });
}
};
Modal.prototype.componentWillUpdate = function componentWillUpdate(nextProps) {
if (!this.props.show && nextProps.show) {
this.checkForFocus();
}
};
Modal.prototype.componentDidMount = function componentDidMount() {
this._isMounted = true;
if (this.props.show) {
this.onShow();
}
};
Modal.prototype.componentDidUpdate = function componentDidUpdate(prevProps) {
var transition = this.props.transition;
if (prevProps.show && !this.props.show && !transition) {
// Otherwise handleHidden will call this.
this.onHide();
} else if (!prevProps.show && this.props.show) {
this.onShow();
}
};
Modal.prototype.componentWillUnmount = function componentWillUnmount() {
var _props2 = this.props,
show = _props2.show,
transition = _props2.transition;
this._isMounted = false;
if (show || transition && !this.state.exited) {
this.onHide();
}
};
//instead of a ref, which might conflict with one the parent applied.
return Modal;
}(_react2.default.Component);
Modal.propTypes = _extends({}, _Portal2.default.propTypes, {
/**
* Set the visibility of the Modal
*/
show: _propTypes2.default.bool,
/**
* A Node, Component instance, or function that returns either. The Modal is appended to it's container element.
*
* For the sake of assistive technologies, the container should usually be the document body, so that the rest of the
* page content can be placed behind a virtual backdrop as well as a visual one.
*/
container: _propTypes2.default.oneOfType([_componentOrElement2.default, _propTypes2.default.func]),
/**
* A callback fired when the Modal is opening.
*/
onShow: _propTypes2.default.func,
/**
* A callback fired when either the backdrop is clicked, or the escape key is pressed.
*
* The `onHide` callback only signals intent from the Modal,
* you must actually set the `show` prop to `false` for the Modal to close.
*/
onHide: _propTypes2.default.func,
/**
* Include a backdrop component.
*/
backdrop: _propTypes2.default.oneOfType([_propTypes2.default.bool, _propTypes2.default.oneOf(['static'])]),
/**
* A function that returns a backdrop component. Useful for custom
* backdrop rendering.
*
* ```js
* renderBackdrop={props => }
* ```
*/
renderBackdrop: _propTypes2.default.func,
/**
* A callback fired when the escape key, if specified in `keyboard`, is pressed.
*/
onEscapeKeyDown: _propTypes2.default.func,
/**
* Support for this function will be deprecated. Please use `onEscapeKeyDown` instead
* A callback fired when the escape key, if specified in `keyboard`, is pressed.
* @deprecated
*/
onEscapeKeyUp: (0, _deprecated2.default)(_propTypes2.default.func, 'Please use onEscapeKeyDown instead for consistency'),
/**
* A callback fired when the backdrop, if specified, is clicked.
*/
onBackdropClick: _propTypes2.default.func,
/**
* A style object for the backdrop component.
*/
backdropStyle: _propTypes2.default.object,
/**
* A css class or classes for the backdrop component.
*/
backdropClassName: _propTypes2.default.string,
/**
* A css class or set of classes applied to the modal container when the modal is open,
* and removed when it is closed.
*/
containerClassName: _propTypes2.default.string,
/**
* Close the modal when escape key is pressed
*/
keyboard: _propTypes2.default.bool,
/**
* A `react-transition-group@2.0.0` `` component used
* to control animations for the dialog component.
*/
transition: _elementType2.default,
/**
* A `react-transition-group@2.0.0` `` component used
* to control animations for the backdrop components.
*/
backdropTransition: _elementType2.default,
/**
* When `true` The modal will automatically shift focus to itself when it opens, and
* replace it to the last focused element when it closes. This also
* works correctly with any Modal children that have the `autoFocus` prop.
*
* Generally this should never be set to `false` as it makes the Modal less
* accessible to assistive technologies, like screen readers.
*/
autoFocus: _propTypes2.default.bool,
/**
* When `true` The modal will prevent focus from leaving the Modal while open.
*
* Generally this should never be set to `false` as it makes the Modal less
* accessible to assistive technologies, like screen readers.
*/
enforceFocus: _propTypes2.default.bool,
/**
* When `true` The modal will restore focus to previously focused element once
* modal is hidden
*/
restoreFocus: _propTypes2.default.bool,
/**
* Callback fired before the Modal transitions in
*/
onEnter: _propTypes2.default.func,
/**
* Callback fired as the Modal begins to transition in
*/
onEntering: _propTypes2.default.func,
/**
* Callback fired after the Modal finishes transitioning in
*/
onEntered: _propTypes2.default.func,
/**
* Callback fired right before the Modal transitions out
*/
onExit: _propTypes2.default.func,
/**
* Callback fired as the Modal begins to transition out
*/
onExiting: _propTypes2.default.func,
/**
* Callback fired after the Modal finishes transitioning out
*/
onExited: _propTypes2.default.func,
/**
* A ModalManager instance used to track and manage the state of open
* Modals. Useful when customizing how modals interact within a container
*/
manager: _propTypes2.default.object.isRequired
});
Modal.defaultProps = {
show: false,
backdrop: true,
keyboard: true,
autoFocus: true,
enforceFocus: true,
restoreFocus: true,
onHide: function onHide() {},
manager: modalManager,
renderBackdrop: function renderBackdrop(props) {
return _react2.default.createElement('div', props);
}
};
var _initialiseProps = function _initialiseProps() {
var _this2 = this;
this.state = { exited: !this.props.show };
this.renderBackdrop = function () {
var _props3 = _this2.props,
backdropStyle = _props3.backdropStyle,
backdropClassName = _props3.backdropClassName,
renderBackdrop = _props3.renderBackdrop,
Transition = _props3.backdropTransition;
var backdropRef = function backdropRef(ref) {
return _this2.backdrop = ref;
};
var backdrop = renderBackdrop({
ref: backdropRef,
style: backdropStyle,
className: backdropClassName,
onClick: _this2.handleBackdropClick
});
if (Transition) {
backdrop = _react2.default.createElement(
Transition,
{
appear: true,
'in': _this2.props.show
},
backdrop
);
}
return backdrop;
};
this.onShow = function () {
var doc = (0, _ownerDocument2.default)(_this2);
var container = (0, _getContainer2.default)(_this2.props.container, doc.body);
_this2.props.manager.add(_this2, container, _this2.props.containerClassName);
_this2._onDocumentKeydownListener = (0, _addEventListener2.default)(doc, 'keydown', _this2.handleDocumentKeyDown);
_this2._onDocumentKeyupListener = (0, _addEventListener2.default)(doc, 'keyup', _this2.handleDocumentKeyUp);
_this2._onFocusinListener = (0, _addFocusListener2.default)(_this2.enforceFocus);
_this2.focus();
if (_this2.props.onShow) {
_this2.props.onShow();
}
};
this.onHide = function () {
_this2.props.manager.remove(_this2);
_this2._onDocumentKeydownListener.remove();
_this2._onDocumentKeyupListener.remove();
_this2._onFocusinListener.remove();
if (_this2.props.restoreFocus) {
_this2.restoreLastFocus();
}
};
this.setMountNode = function (ref) {
_this2.mountNode = ref ? ref.getMountNode() : ref;
};
this.setModalNode = function (ref) {
_this2.modalNode = ref;
};
this.handleHidden = function () {
_this2.setState({ exited: true });
_this2.onHide();
if (_this2.props.onExited) {
var _props4;
(_props4 = _this2.props).onExited.apply(_props4, arguments);
}
};
this.handleBackdropClick = function (e) {
if (e.target !== e.currentTarget) {
return;
}
if (_this2.props.onBackdropClick) {
_this2.props.onBackdropClick(e);
}
if (_this2.props.backdrop === true) {
_this2.props.onHide();
}
};
this.handleDocumentKeyDown = function (e) {
if (_this2.props.keyboard && e.keyCode === 27 && _this2.isTopModal()) {
if (_this2.props.onEscapeKeyDown) {
_this2.props.onEscapeKeyDown(e);
}
_this2.props.onHide();
}
};
this.handleDocumentKeyUp = function (e) {
if (_this2.props.keyboard && e.keyCode === 27 && _this2.isTopModal()) {
if (_this2.props.onEscapeKeyUp) {
_this2.props.onEscapeKeyUp(e);
}
}
};
this.checkForFocus = function () {
if (_inDOM2.default) {
_this2.lastFocus = (0, _activeElement2.default)();
}
};
this.focus = function () {
var autoFocus = _this2.props.autoFocus;
var modalContent = _this2.getDialogElement();
var current = (0, _activeElement2.default)((0, _ownerDocument2.default)(_this2));
var focusInModal = current && (0, _contains2.default)(modalContent, current);
if (modalContent && autoFocus && !focusInModal) {
_this2.lastFocus = current;
if (!modalContent.hasAttribute('tabIndex')) {
modalContent.setAttribute('tabIndex', -1);
(0, _warning2.default)(false, 'The modal content node does not accept focus. ' + 'For the benefit of assistive technologies, the tabIndex of the node is being set to "-1".');
}
modalContent.focus();
}
};
this.restoreLastFocus = function () {
// Support: <=IE11 doesn't support `focus()` on svg elements (RB: #917)
if (_this2.lastFocus && _this2.lastFocus.focus) {
_this2.lastFocus.focus();
_this2.lastFocus = null;
}
};
this.enforceFocus = function () {
var enforceFocus = _this2.props.enforceFocus;
if (!enforceFocus || !_this2._isMounted || !_this2.isTopModal()) {
return;
}
var active = (0, _activeElement2.default)((0, _ownerDocument2.default)(_this2));
var modal = _this2.getDialogElement();
if (modal && modal !== active && !(0, _contains2.default)(modal, active)) {
modal.focus();
}
};
this.getDialogElement = function () {
var node = _this2.modalNode;
return node && node.lastChild;
};
this.isTopModal = function () {
return _this2.props.manager.isTopModal(_this2);
};
};
Modal.Manager = _ModalManager2.default;
exports.default = Modal;
module.exports = exports['default'];
/***/ }),
/* 192 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = activeElement;
var _ownerDocument = __webpack_require__(15);
var _ownerDocument2 = _interopRequireDefault(_ownerDocument);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function activeElement() {
var doc = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : (0, _ownerDocument2.default)();
try {
return doc.activeElement;
} catch (e) {/* ie throws if no active element */}
}
module.exports = exports['default'];
/***/ }),
/* 193 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _class = __webpack_require__(194);
var _class2 = _interopRequireDefault(_class);
var _style = __webpack_require__(52);
var _style2 = _interopRequireDefault(_style);
var _scrollbarSize = __webpack_require__(197);
var _scrollbarSize2 = _interopRequireDefault(_scrollbarSize);
var _isOverflowing = __webpack_require__(198);
var _isOverflowing2 = _interopRequireDefault(_isOverflowing);
var _manageAriaHidden = __webpack_require__(199);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function findIndexOf(arr, cb) {
var idx = -1;
arr.some(function (d, i) {
if (cb(d, i)) {
idx = i;
return true;
}
});
return idx;
}
function findContainer(data, modal) {
return findIndexOf(data, function (d) {
return d.modals.indexOf(modal) !== -1;
});
}
function setContainerStyle(state, container) {
var style = { overflow: 'hidden' };
// we are only interested in the actual `style` here
// becasue we will override it
state.style = {
overflow: container.style.overflow,
paddingRight: container.style.paddingRight
};
if (state.overflowing) {
// use computed style, here to get the real padding
// to add our scrollbar width
style.paddingRight = parseInt((0, _style2.default)(container, 'paddingRight') || 0, 10) + (0, _scrollbarSize2.default)() + 'px';
}
(0, _style2.default)(container, style);
}
function removeContainerStyle(_ref, container) {
var style = _ref.style;
Object.keys(style).forEach(function (key) {
return container.style[key] = style[key];
});
}
/**
* Proper state managment for containers and the modals in those containers.
*
* @internal Used by the Modal to ensure proper styling of containers.
*/
var ModalManager = function ModalManager() {
var _this = this;
var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
_ref2$hideSiblingNode = _ref2.hideSiblingNodes,
hideSiblingNodes = _ref2$hideSiblingNode === undefined ? true : _ref2$hideSiblingNode,
_ref2$handleContainer = _ref2.handleContainerOverflow,
handleContainerOverflow = _ref2$handleContainer === undefined ? true : _ref2$handleContainer;
_classCallCheck(this, ModalManager);
this.add = function (modal, container, className) {
var modalIdx = _this.modals.indexOf(modal);
var containerIdx = _this.containers.indexOf(container);
if (modalIdx !== -1) {
return modalIdx;
}
modalIdx = _this.modals.length;
_this.modals.push(modal);
if (_this.hideSiblingNodes) {
(0, _manageAriaHidden.hideSiblings)(container, modal.mountNode);
}
if (containerIdx !== -1) {
_this.data[containerIdx].modals.push(modal);
return modalIdx;
}
var data = {
modals: [modal],
//right now only the first modal of a container will have its classes applied
classes: className ? className.split(/\s+/) : [],
overflowing: (0, _isOverflowing2.default)(container)
};
if (_this.handleContainerOverflow) {
setContainerStyle(data, container);
}
data.classes.forEach(_class2.default.addClass.bind(null, container));
_this.containers.push(container);
_this.data.push(data);
return modalIdx;
};
this.remove = function (modal) {
var modalIdx = _this.modals.indexOf(modal);
if (modalIdx === -1) {
return;
}
var containerIdx = findContainer(_this.data, modal);
var data = _this.data[containerIdx];
var container = _this.containers[containerIdx];
data.modals.splice(data.modals.indexOf(modal), 1);
_this.modals.splice(modalIdx, 1);
// if that was the last modal in a container,
// clean up the container
if (data.modals.length === 0) {
data.classes.forEach(_class2.default.removeClass.bind(null, container));
if (_this.handleContainerOverflow) {
removeContainerStyle(data, container);
}
if (_this.hideSiblingNodes) {
(0, _manageAriaHidden.showSiblings)(container, modal.mountNode);
}
_this.containers.splice(containerIdx, 1);
_this.data.splice(containerIdx, 1);
} else if (_this.hideSiblingNodes) {
//otherwise make sure the next top modal is visible to a SR
(0, _manageAriaHidden.ariaHidden)(false, data.modals[data.modals.length - 1].mountNode);
}
};
this.isTopModal = function (modal) {
return !!_this.modals.length && _this.modals[_this.modals.length - 1] === modal;
};
this.hideSiblingNodes = hideSiblingNodes;
this.handleContainerOverflow = handleContainerOverflow;
this.modals = [];
this.containers = [];
this.data = [];
};
exports.default = ModalManager;
module.exports = exports['default'];
/***/ }),
/* 194 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.hasClass = exports.removeClass = exports.addClass = undefined;
var _addClass = __webpack_require__(195);
var _addClass2 = _interopRequireDefault(_addClass);
var _removeClass = __webpack_require__(196);
var _removeClass2 = _interopRequireDefault(_removeClass);
var _hasClass = __webpack_require__(94);
var _hasClass2 = _interopRequireDefault(_hasClass);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.addClass = _addClass2.default;
exports.removeClass = _removeClass2.default;
exports.hasClass = _hasClass2.default;
exports.default = { addClass: _addClass2.default, removeClass: _removeClass2.default, hasClass: _hasClass2.default };
/***/ }),
/* 195 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = addClass;
var _hasClass = __webpack_require__(94);
var _hasClass2 = _interopRequireDefault(_hasClass);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function addClass(element, className) {
if (element.classList) element.classList.add(className);else if (!(0, _hasClass2.default)(element)) element.className = element.className + ' ' + className;
}
module.exports = exports['default'];
/***/ }),
/* 196 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
module.exports = function removeClass(element, className) {
if (element.classList) element.classList.remove(className);else element.className = element.className.replace(new RegExp('(^|\\s)' + className + '(?:\\s|$)', 'g'), '$1').replace(/\s+/g, ' ').replace(/^\s*|\s*$/g, '');
};
/***/ }),
/* 197 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = function (recalc) {
if (!size || recalc) {
if (_inDOM2.default) {
var scrollDiv = document.createElement('div');
scrollDiv.style.position = 'absolute';
scrollDiv.style.top = '-9999px';
scrollDiv.style.width = '50px';
scrollDiv.style.height = '50px';
scrollDiv.style.overflow = 'scroll';
document.body.appendChild(scrollDiv);
size = scrollDiv.offsetWidth - scrollDiv.clientWidth;
document.body.removeChild(scrollDiv);
}
}
return size;
};
var _inDOM = __webpack_require__(9);
var _inDOM2 = _interopRequireDefault(_inDOM);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var size = void 0;
module.exports = exports['default'];
/***/ }),
/* 198 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
exports.default = isOverflowing;
var _isWindow = __webpack_require__(22);
var _isWindow2 = _interopRequireDefault(_isWindow);
var _ownerDocument = __webpack_require__(15);
var _ownerDocument2 = _interopRequireDefault(_ownerDocument);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function isBody(node) {
return node && node.tagName.toLowerCase() === 'body';
}
function bodyIsOverflowing(node) {
var doc = (0, _ownerDocument2.default)(node);
var win = (0, _isWindow2.default)(doc);
var fullWidth = win.innerWidth;
// Support: ie8, no innerWidth
if (!fullWidth) {
var documentElementRect = doc.documentElement.getBoundingClientRect();
fullWidth = documentElementRect.right - Math.abs(documentElementRect.left);
}
return doc.body.clientWidth < fullWidth;
}
function isOverflowing(container) {
var win = (0, _isWindow2.default)(container);
return win || isBody(container) ? bodyIsOverflowing(container) : container.scrollHeight > container.clientHeight;
}
module.exports = exports['default'];
/***/ }),
/* 199 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
exports.ariaHidden = ariaHidden;
exports.hideSiblings = hideSiblings;
exports.showSiblings = showSiblings;
var BLACKLIST = ['template', 'script', 'style'];
var isHidable = function isHidable(_ref) {
var nodeType = _ref.nodeType,
tagName = _ref.tagName;
return nodeType === 1 && BLACKLIST.indexOf(tagName.toLowerCase()) === -1;
};
var siblings = function siblings(container, mount, cb) {
mount = [].concat(mount);
[].forEach.call(container.children, function (node) {
if (mount.indexOf(node) === -1 && isHidable(node)) {
cb(node);
}
});
};
function ariaHidden(show, node) {
if (!node) {
return;
}
if (show) {
node.setAttribute('aria-hidden', 'true');
} else {
node.removeAttribute('aria-hidden');
}
}
function hideSiblings(container, mountNode) {
siblings(container, mountNode, function (node) {
return ariaHidden(true, node);
});
}
function showSiblings(container, mountNode) {
siblings(container, mountNode, function (node) {
return ariaHidden(false, node);
});
}
/***/ }),
/* 200 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
exports.default = addFocusListener;
/**
* Firefox doesn't have a focusin event so using capture is easiest way to get bubbling
* IE8 can't do addEventListener, but does have onfocusin, so we use that in ie8
*
* We only allow one Listener at a time to avoid stack overflows
*/
function addFocusListener(handler) {
var useFocusin = !document.addEventListener;
var remove = void 0;
if (useFocusin) {
document.attachEvent('onfocusin', handler);
remove = function remove() {
return document.detachEvent('onfocusin', handler);
};
} else {
document.addEventListener('focus', handler, true);
remove = function remove() {
return document.removeEventListener('focus', handler, true);
};
}
return { remove: remove };
}
module.exports = exports['default'];
/***/ }),
/* 201 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = 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 _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _elementType = __webpack_require__(93);
var _elementType2 = _interopRequireDefault(_elementType);
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _Portal = __webpack_require__(55);
var _Portal2 = _interopRequireDefault(_Portal);
var _Position = __webpack_require__(95);
var _Position2 = _interopRequireDefault(_Position);
var _RootCloseWrapper = __webpack_require__(96);
var _RootCloseWrapper2 = _interopRequireDefault(_RootCloseWrapper);
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; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
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; }
/**
* Built on top of `` and ``, the overlay component is great for custom tooltip overlays.
*/
var Overlay = function (_React$Component) {
_inherits(Overlay, _React$Component);
function Overlay(props, context) {
_classCallCheck(this, Overlay);
var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context));
_this.handleHidden = function () {
_this.setState({ exited: true });
if (_this.props.onExited) {
var _this$props;
(_this$props = _this.props).onExited.apply(_this$props, arguments);
}
};
_this.state = { exited: !props.show };
_this.onHiddenListener = _this.handleHidden.bind(_this);
return _this;
}
Overlay.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
if (nextProps.show) {
this.setState({ exited: false });
} else if (!nextProps.transition) {
// Otherwise let handleHidden take care of marking exited.
this.setState({ exited: true });
}
};
Overlay.prototype.render = function render() {
var _props = this.props,
container = _props.container,
containerPadding = _props.containerPadding,
target = _props.target,
placement = _props.placement,
shouldUpdatePosition = _props.shouldUpdatePosition,
rootClose = _props.rootClose,
children = _props.children,
Transition = _props.transition,
props = _objectWithoutProperties(_props, ['container', 'containerPadding', 'target', 'placement', 'shouldUpdatePosition', 'rootClose', 'children', 'transition']);
// Don't un-render the overlay while it's transitioning out.
var mountOverlay = props.show || Transition && !this.state.exited;
if (!mountOverlay) {
// Don't bother showing anything if we don't have to.
return null;
}
var child = children;
// Position is be inner-most because it adds inline styles into the child,
// which the other wrappers don't forward correctly.
child = _react2.default.createElement(
_Position2.default,
{ container: container, containerPadding: containerPadding, target: target, placement: placement, shouldUpdatePosition: shouldUpdatePosition },
child
);
if (Transition) {
var onExit = props.onExit,
onExiting = props.onExiting,
onEnter = props.onEnter,
onEntering = props.onEntering,
onEntered = props.onEntered;
// This animates the child node by injecting props, so it must precede
// anything that adds a wrapping div.
child = _react2.default.createElement(
Transition,
{
'in': props.show,
appear: true,
onExit: onExit,
onExiting: onExiting,
onExited: this.onHiddenListener,
onEnter: onEnter,
onEntering: onEntering,
onEntered: onEntered
},
child
);
}
// This goes after everything else because it adds a wrapping div.
if (rootClose) {
child = _react2.default.createElement(
_RootCloseWrapper2.default,
{ onRootClose: props.onHide },
child
);
}
return _react2.default.createElement(
_Portal2.default,
{ container: container },
child
);
};
return Overlay;
}(_react2.default.Component);
Overlay.propTypes = _extends({}, _Portal2.default.propTypes, _Position2.default.propTypes, {
/**
* Set the visibility of the Overlay
*/
show: _propTypes2.default.bool,
/**
* Specify whether the overlay should trigger `onHide` when the user clicks outside the overlay
*/
rootClose: _propTypes2.default.bool,
/**
* A Callback fired by the Overlay when it wishes to be hidden.
*
* __required__ when `rootClose` is `true`.
*
* @type func
*/
onHide: function onHide(props) {
var propType = _propTypes2.default.func;
if (props.rootClose) {
propType = propType.isRequired;
}
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
return propType.apply(undefined, [props].concat(args));
},
/**
* A `react-transition-group@2.0.0` `` component
* used to animate the overlay as it changes visibility.
*/
transition: _elementType2.default,
/**
* Callback fired before the Overlay transitions in
*/
onEnter: _propTypes2.default.func,
/**
* Callback fired as the Overlay begins to transition in
*/
onEntering: _propTypes2.default.func,
/**
* Callback fired after the Overlay finishes transitioning in
*/
onEntered: _propTypes2.default.func,
/**
* Callback fired right before the Overlay transitions out
*/
onExit: _propTypes2.default.func,
/**
* Callback fired as the Overlay begins to transition out
*/
onExiting: _propTypes2.default.func,
/**
* Callback fired after the Overlay finishes transitioning out
*/
onExited: _propTypes2.default.func
});
exports.default = Overlay;
module.exports = exports['default'];
/***/ }),
/* 202 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
exports.default = calculatePosition;
var _offset = __webpack_require__(21);
var _offset2 = _interopRequireDefault(_offset);
var _position = __webpack_require__(203);
var _position2 = _interopRequireDefault(_position);
var _scrollTop = __webpack_require__(53);
var _scrollTop2 = _interopRequireDefault(_scrollTop);
var _ownerDocument = __webpack_require__(10);
var _ownerDocument2 = _interopRequireDefault(_ownerDocument);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function getContainerDimensions(containerNode) {
var width = void 0,
height = void 0,
scroll = void 0;
if (containerNode.tagName === 'BODY') {
width = window.innerWidth;
height = window.innerHeight;
scroll = (0, _scrollTop2.default)((0, _ownerDocument2.default)(containerNode).documentElement) || (0, _scrollTop2.default)(containerNode);
} else {
var _getOffset = (0, _offset2.default)(containerNode);
width = _getOffset.width;
height = _getOffset.height;
scroll = (0, _scrollTop2.default)(containerNode);
}
return { width: width, height: height, scroll: scroll };
}
function getTopDelta(top, overlayHeight, container, padding) {
var containerDimensions = getContainerDimensions(container);
var containerScroll = containerDimensions.scroll;
var containerHeight = containerDimensions.height;
var topEdgeOffset = top - padding - containerScroll;
var bottomEdgeOffset = top + padding - containerScroll + overlayHeight;
if (topEdgeOffset < 0) {
return -topEdgeOffset;
} else if (bottomEdgeOffset > containerHeight) {
return containerHeight - bottomEdgeOffset;
} else {
return 0;
}
}
function getLeftDelta(left, overlayWidth, container, padding) {
var containerDimensions = getContainerDimensions(container);
var containerWidth = containerDimensions.width;
var leftEdgeOffset = left - padding;
var rightEdgeOffset = left + padding + overlayWidth;
if (leftEdgeOffset < 0) {
return -leftEdgeOffset;
} else if (rightEdgeOffset > containerWidth) {
return containerWidth - rightEdgeOffset;
}
return 0;
}
function calculatePosition(placement, overlayNode, target, container, padding) {
var childOffset = container.tagName === 'BODY' ? (0, _offset2.default)(target) : (0, _position2.default)(target, container);
var _getOffset2 = (0, _offset2.default)(overlayNode),
overlayHeight = _getOffset2.height,
overlayWidth = _getOffset2.width;
var positionLeft = void 0,
positionTop = void 0,
arrowOffsetLeft = void 0,
arrowOffsetTop = void 0;
if (placement === 'left' || placement === 'right') {
positionTop = childOffset.top + (childOffset.height - overlayHeight) / 2;
if (placement === 'left') {
positionLeft = childOffset.left - overlayWidth;
} else {
positionLeft = childOffset.left + childOffset.width;
}
var topDelta = getTopDelta(positionTop, overlayHeight, container, padding);
positionTop += topDelta;
arrowOffsetTop = 50 * (1 - 2 * topDelta / overlayHeight) + '%';
arrowOffsetLeft = void 0;
} else if (placement === 'top' || placement === 'bottom') {
positionLeft = childOffset.left + (childOffset.width - overlayWidth) / 2;
if (placement === 'top') {
positionTop = childOffset.top - overlayHeight;
} else {
positionTop = childOffset.top + childOffset.height;
}
var leftDelta = getLeftDelta(positionLeft, overlayWidth, container, padding);
positionLeft += leftDelta;
arrowOffsetLeft = 50 * (1 - 2 * leftDelta / overlayWidth) + '%';
arrowOffsetTop = void 0;
} else {
throw new Error('calcOverlayPosition(): No such placement of "' + placement + '" found.');
}
return { positionLeft: positionLeft, positionTop: positionTop, arrowOffsetLeft: arrowOffsetLeft, arrowOffsetTop: arrowOffsetTop };
}
module.exports = exports['default'];
/***/ }),
/* 203 */
/***/ (function(module, exports, __webpack_require__) {
"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; };
exports.default = position;
var _offset = __webpack_require__(21);
var _offset2 = _interopRequireDefault(_offset);
var _offsetParent = __webpack_require__(86);
var _offsetParent2 = _interopRequireDefault(_offsetParent);
var _scrollTop = __webpack_require__(53);
var _scrollTop2 = _interopRequireDefault(_scrollTop);
var _scrollLeft = __webpack_require__(204);
var _scrollLeft2 = _interopRequireDefault(_scrollLeft);
var _style = __webpack_require__(52);
var _style2 = _interopRequireDefault(_style);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function nodeName(node) {
return node.nodeName && node.nodeName.toLowerCase();
}
function position(node, offsetParent) {
var parentOffset = { top: 0, left: 0 },
offset;
// Fixed elements are offset from window (parentOffset = {top:0, left: 0},
// because it is its only offset parent
if ((0, _style2.default)(node, 'position') === 'fixed') {
offset = node.getBoundingClientRect();
} else {
offsetParent = offsetParent || (0, _offsetParent2.default)(node);
offset = (0, _offset2.default)(node);
if (nodeName(offsetParent) !== 'html') parentOffset = (0, _offset2.default)(offsetParent);
parentOffset.top += parseInt((0, _style2.default)(offsetParent, 'borderTopWidth'), 10) - (0, _scrollTop2.default)(offsetParent) || 0;
parentOffset.left += parseInt((0, _style2.default)(offsetParent, 'borderLeftWidth'), 10) - (0, _scrollLeft2.default)(offsetParent) || 0;
}
// Subtract parent offsets and node margins
return _extends({}, offset, {
top: offset.top - parentOffset.top - (parseInt((0, _style2.default)(node, 'marginTop'), 10) || 0),
left: offset.left - parentOffset.left - (parseInt((0, _style2.default)(node, 'marginLeft'), 10) || 0)
});
}
module.exports = exports['default'];
/***/ }),
/* 204 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = scrollTop;
var _isWindow = __webpack_require__(22);
var _isWindow2 = _interopRequireDefault(_isWindow);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function scrollTop(node, val) {
var win = (0, _isWindow2.default)(node);
if (val === undefined) return win ? 'pageXOffset' in win ? win.pageXOffset : win.document.documentElement.scrollLeft : node.scrollLeft;
if (win) win.scrollTo(val, 'pageYOffset' in win ? win.pageYOffset : win.document.documentElement.scrollTop);else node.scrollLeft = val;
}
module.exports = exports['default'];
/***/ }),
/* 205 */
/***/ (function(module, exports, __webpack_require__) {
"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 _classnames = __webpack_require__(5);
var _classnames2 = _interopRequireDefault(_classnames);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _HintedInput = __webpack_require__(206);
var _HintedInput2 = _interopRequireDefault(_HintedInput);
var _Token = __webpack_require__(97);
var _Token2 = _interopRequireDefault(_Token);
var _getOptionLabel = __webpack_require__(18);
var _getOptionLabel2 = _interopRequireDefault(_getOptionLabel);
var _typeaheadInputContainer = __webpack_require__(251);
var _typeaheadInputContainer2 = _interopRequireDefault(_typeaheadInputContainer);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
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 TypeaheadInput = function (_React$Component) {
_inherits(TypeaheadInput, _React$Component);
function TypeaheadInput() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, TypeaheadInput);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = TypeaheadInput.__proto__ || Object.getPrototypeOf(TypeaheadInput)).call.apply(_ref, [this].concat(args))), _this), _this._renderToken = function (option, idx) {
var _this$props = _this.props,
disabled = _this$props.disabled,
inputProps = _this$props.inputProps,
labelKey = _this$props.labelKey,
onRemove = _this$props.onRemove,
renderToken = _this$props.renderToken;
var onRemoveWrapped = function onRemoveWrapped() {
return onRemove(option);
};
if (typeof renderToken === 'function') {
return renderToken(option, onRemoveWrapped, idx);
}
return _react2.default.createElement(
_Token2.default,
{
disabled: disabled,
key: idx,
onRemove: onRemoveWrapped,
tabIndex: inputProps.tabIndex },
(0, _getOptionLabel2.default)(option, labelKey)
);
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(TypeaheadInput, [{
key: 'render',
value: function render() {
var _props = this.props,
disabled = _props.disabled,
hintText = _props.hintText,
inputRef = _props.inputRef,
isFocused = _props.isFocused,
multiple = _props.multiple,
name = _props.name,
onBlur = _props.onBlur,
onChange = _props.onChange,
onFocus = _props.onFocus,
onKeyDown = _props.onKeyDown,
placeholder = _props.placeholder,
selected = _props.selected,
value = _props.value;
var inputProps = _extends({}, this.props.inputProps, {
disabled: disabled,
hintText: hintText,
inputRef: inputRef,
isFocused: isFocused,
multiple: multiple,
name: name || this.props.inputProps.name,
onBlur: onBlur,
onChange: onChange,
onFocus: onFocus,
onKeyDown: onKeyDown,
placeholder: placeholder,
value: value
});
return _react2.default.createElement(
'div',
{ className: (0, _classnames2.default)('rbt-input', { 'rbt-input-multi': multiple }) },
multiple && selected.map(this._renderToken),
_react2.default.createElement(_HintedInput2.default, inputProps)
);
}
}]);
return TypeaheadInput;
}(_react2.default.Component);
TypeaheadInput.propTypes = {
/**
* Provides a hook for customized rendering of tokens when multiple
* selections are enabled.
*/
renderToken: _propTypes2.default.func
};
exports.default = (0, _typeaheadInputContainer2.default)(TypeaheadInput);
/***/ }),
/* 206 */
/***/ (function(module, exports, __webpack_require__) {
"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 _classnames = __webpack_require__(5);
var _classnames2 = _interopRequireDefault(_classnames);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _reactInputAutosize = __webpack_require__(207);
var _reactInputAutosize2 = _interopRequireDefault(_reactInputAutosize);
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; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
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 STYLES = {
backgroundColor: 'transparent',
border: 0,
boxShadow: 'none',
cursor: 'inherit',
outline: 'none',
padding: 0
};
var HintedInput = function (_React$Component) {
_inherits(HintedInput, _React$Component);
function HintedInput() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, HintedInput);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = HintedInput.__proto__ || Object.getPrototypeOf(HintedInput)).call.apply(_ref, [this].concat(args))), _this), _this._renderHint = function () {
var _this$props = _this.props,
hintText = _this$props.hintText,
isFocused = _this$props.isFocused,
multiple = _this$props.multiple;
// TODO: Support hinting for multi-selection.
return multiple ? null : _react2.default.createElement(_reactInputAutosize2.default, {
inputClassName: 'rbt-input-hint',
inputStyle: _extends({}, STYLES, {
color: 'rgba(0, 0, 0, 0.35)'
}),
style: {
bottom: 0,
display: 'block',
position: 'absolute',
top: 0,
zIndex: 0
},
tabIndex: -1,
value: isFocused ? hintText : ''
});
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(HintedInput, [{
key: 'render',
value: function render() {
var _props = this.props,
className = _props.className,
hintText = _props.hintText,
inputRef = _props.inputRef,
isFocused = _props.isFocused,
multiple = _props.multiple,
props = _objectWithoutProperties(_props, ['className', 'hintText', 'inputRef', 'isFocused', 'multiple']);
return _react2.default.createElement(
'div',
{ style: { display: 'inline-block', position: 'relative' } },
_react2.default.createElement(_reactInputAutosize2.default, _extends({}, props, {
autoComplete: 'off',
inputClassName: (0, _classnames2.default)('rbt-input-main', className),
inputStyle: STYLES,
ref: inputRef,
style: {
position: 'relative',
zIndex: 1
}
})),
this._renderHint()
);
}
}]);
return HintedInput;
}(_react2.default.Component);
HintedInput.propTypes = {
type: _propTypes2.default.string
};
HintedInput.defaultProps = {
type: 'text'
};
exports.default = HintedInput;
/***/ }),
/* 207 */
/***/ (function(module, exports, __webpack_require__) {
"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 _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
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; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
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 sizerStyle = {
position: 'absolute',
top: 0,
left: 0,
visibility: 'hidden',
height: 0,
overflow: 'scroll',
whiteSpace: 'pre'
};
var AutosizeInput = function (_Component) {
_inherits(AutosizeInput, _Component);
function AutosizeInput(props) {
_classCallCheck(this, AutosizeInput);
var _this = _possibleConstructorReturn(this, (AutosizeInput.__proto__ || Object.getPrototypeOf(AutosizeInput)).call(this, props));
_this.inputRef = function (el) {
_this.input = el;
if (typeof _this.props.inputRef === 'function') {
_this.props.inputRef(el);
}
};
_this.placeHolderSizerRef = function (el) {
_this.placeHolderSizer = el;
};
_this.sizerRef = function (el) {
_this.sizer = el;
};
_this.state = {
inputWidth: props.minWidth,
inputId: '_' + Math.random().toString(36).substr(2, 12)
};
return _this;
}
_createClass(AutosizeInput, [{
key: 'componentDidMount',
value: function componentDidMount() {
this.mounted = true;
this.copyInputStyles();
this.updateInputWidth();
}
}, {
key: 'componentDidUpdate',
value: function componentDidUpdate(prevProps, prevState) {
if (prevState.inputWidth !== this.state.inputWidth) {
if (typeof this.props.onAutosize === 'function') {
this.props.onAutosize(this.state.inputWidth);
}
}
this.updateInputWidth();
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
this.mounted = false;
}
}, {
key: 'copyInputStyles',
value: 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;
}
}
}, {
key: 'updateInputWidth',
value: function updateInputWidth() {
if (!this.mounted || !this.sizer || typeof this.sizer.scrollWidth === 'undefined') {
return;
}
var newInputWidth = void 0;
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
});
}
}
}, {
key: 'getInput',
value: function getInput() {
return this.input;
}
}, {
key: 'focus',
value: function focus() {
this.input.focus();
}
}, {
key: 'blur',
value: function blur() {
this.input.blur();
}
}, {
key: 'select',
value: function select() {
this.input.select();
}
}, {
key: 'render',
value: 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 = _extends({}, 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 = _objectWithoutProperties(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;
delete inputProps.inputRef;
return _react2.default.createElement(
'div',
{ className: this.props.className, style: wrapperStyle },
_react2.default.createElement('style', { dangerouslySetInnerHTML: {
__html: ['input#' + this.state.id + '::-ms-clear {display: none;}'].join('\n')
} }),
_react2.default.createElement('input', _extends({ id: this.state.id }, inputProps, { ref: this.inputRef })),
_react2.default.createElement(
'div',
{ ref: this.sizerRef, style: sizerStyle },
sizerValue
),
this.props.placeholder ? _react2.default.createElement(
'div',
{ ref: this.placeHolderSizerRef, style: sizerStyle },
this.props.placeholder
) : null
);
}
}]);
return AutosizeInput;
}(_react.Component);
;
AutosizeInput.propTypes = {
className: _propTypes2.default.string, // className for the outer element
defaultValue: _propTypes2.default.any, // default field value
inputClassName: _propTypes2.default.string, // className for the input element
inputRef: _propTypes2.default.func, // ref callback for the input element
inputStyle: _propTypes2.default.object, // css styles for the input element
minWidth: _propTypes2.default.oneOfType([// minimum width for input element
_propTypes2.default.number, _propTypes2.default.string]),
onAutosize: _propTypes2.default.func, // onAutosize handler: function(newWidth) {}
onChange: _propTypes2.default.func, // onChange handler: function(newValue) {}
placeholder: _propTypes2.default.string, // placeholder text
placeholderIsMinWidth: _propTypes2.default.bool, // don't collapse size to less than the placeholder
style: _propTypes2.default.object, // css styles for the outer element
value: _propTypes2.default.any // field value
};
AutosizeInput.defaultProps = {
minWidth: 1
};
exports.default = AutosizeInput;
/***/ }),
/* 208 */
/***/ (function(module, exports, __webpack_require__) {
var arrayMap = __webpack_require__(99),
baseClone = __webpack_require__(209),
baseUnset = __webpack_require__(231),
castPath = __webpack_require__(16),
copyObject = __webpack_require__(24),
customOmitClone = __webpack_require__(239),
flatRest = __webpack_require__(107),
getAllKeysIn = __webpack_require__(104);
/** Used to compose bitmasks for cloning. */
var CLONE_DEEP_FLAG = 1,
CLONE_FLAT_FLAG = 2,
CLONE_SYMBOLS_FLAG = 4;
/**
* The opposite of `_.pick`; this method creates an object composed of the
* own and inherited enumerable property paths of `object` that are not omitted.
*
* **Note:** This method is considerably slower than `_.pick`.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The source object.
* @param {...(string|string[])} [paths] The property paths to omit.
* @returns {Object} Returns the new object.
* @example
*
* var object = { 'a': 1, 'b': '2', 'c': 3 };
*
* _.omit(object, ['a', 'c']);
* // => { 'b': '2' }
*/
var omit = flatRest(function(object, paths) {
var result = {};
if (object == null) {
return result;
}
var isDeep = false;
paths = arrayMap(paths, function(path) {
path = castPath(path, object);
isDeep || (isDeep = path.length > 1);
return path;
});
copyObject(object, getAllKeysIn(object), result);
if (isDeep) {
result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
}
var length = paths.length;
while (length--) {
baseUnset(result, paths[length]);
}
return result;
});
module.exports = omit;
/***/ }),
/* 209 */
/***/ (function(module, exports, __webpack_require__) {
var Stack = __webpack_require__(40),
arrayEach = __webpack_require__(210),
assignValue = __webpack_require__(57),
baseAssign = __webpack_require__(211),
baseAssignIn = __webpack_require__(212),
cloneBuffer = __webpack_require__(215),
copyArray = __webpack_require__(216),
copySymbols = __webpack_require__(217),
copySymbolsIn = __webpack_require__(218),
getAllKeys = __webpack_require__(78),
getAllKeysIn = __webpack_require__(104),
getTag = __webpack_require__(84),
initCloneArray = __webpack_require__(219),
initCloneByTag = __webpack_require__(220),
initCloneObject = __webpack_require__(229),
isArray = __webpack_require__(6),
isBuffer = __webpack_require__(47),
isObject = __webpack_require__(7),
keys = __webpack_require__(14);
/** Used to compose bitmasks for cloning. */
var CLONE_DEEP_FLAG = 1,
CLONE_FLAT_FLAG = 2,
CLONE_SYMBOLS_FLAG = 4;
/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
arrayTag = '[object Array]',
boolTag = '[object Boolean]',
dateTag = '[object Date]',
errorTag = '[object Error]',
funcTag = '[object Function]',
genTag = '[object GeneratorFunction]',
mapTag = '[object Map]',
numberTag = '[object Number]',
objectTag = '[object Object]',
regexpTag = '[object RegExp]',
setTag = '[object Set]',
stringTag = '[object String]',
symbolTag = '[object Symbol]',
weakMapTag = '[object WeakMap]';
var arrayBufferTag = '[object ArrayBuffer]',
dataViewTag = '[object DataView]',
float32Tag = '[object Float32Array]',
float64Tag = '[object Float64Array]',
int8Tag = '[object Int8Array]',
int16Tag = '[object Int16Array]',
int32Tag = '[object Int32Array]',
uint8Tag = '[object Uint8Array]',
uint8ClampedTag = '[object Uint8ClampedArray]',
uint16Tag = '[object Uint16Array]',
uint32Tag = '[object Uint32Array]';
/** Used to identify `toStringTag` values supported by `_.clone`. */
var cloneableTags = {};
cloneableTags[argsTag] = cloneableTags[arrayTag] =
cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
cloneableTags[boolTag] = cloneableTags[dateTag] =
cloneableTags[float32Tag] = cloneableTags[float64Tag] =
cloneableTags[int8Tag] = cloneableTags[int16Tag] =
cloneableTags[int32Tag] = cloneableTags[mapTag] =
cloneableTags[numberTag] = cloneableTags[objectTag] =
cloneableTags[regexpTag] = cloneableTags[setTag] =
cloneableTags[stringTag] = cloneableTags[symbolTag] =
cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
cloneableTags[errorTag] = cloneableTags[funcTag] =
cloneableTags[weakMapTag] = false;
/**
* The base implementation of `_.clone` and `_.cloneDeep` which tracks
* traversed objects.
*
* @private
* @param {*} value The value to clone.
* @param {boolean} bitmask The bitmask flags.
* 1 - Deep clone
* 2 - Flatten inherited properties
* 4 - Clone symbols
* @param {Function} [customizer] The function to customize cloning.
* @param {string} [key] The key of `value`.
* @param {Object} [object] The parent object of `value`.
* @param {Object} [stack] Tracks traversed objects and their clone counterparts.
* @returns {*} Returns the cloned value.
*/
function baseClone(value, bitmask, customizer, key, object, stack) {
var result,
isDeep = bitmask & CLONE_DEEP_FLAG,
isFlat = bitmask & CLONE_FLAT_FLAG,
isFull = bitmask & CLONE_SYMBOLS_FLAG;
if (customizer) {
result = object ? customizer(value, key, object, stack) : customizer(value);
}
if (result !== undefined) {
return result;
}
if (!isObject(value)) {
return value;
}
var isArr = isArray(value);
if (isArr) {
result = initCloneArray(value);
if (!isDeep) {
return copyArray(value, result);
}
} else {
var tag = getTag(value),
isFunc = tag == funcTag || tag == genTag;
if (isBuffer(value)) {
return cloneBuffer(value, isDeep);
}
if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
result = (isFlat || isFunc) ? {} : initCloneObject(value);
if (!isDeep) {
return isFlat
? copySymbolsIn(value, baseAssignIn(result, value))
: copySymbols(value, baseAssign(result, value));
}
} else {
if (!cloneableTags[tag]) {
return object ? value : {};
}
result = initCloneByTag(value, tag, baseClone, isDeep);
}
}
// Check for circular references and return its corresponding clone.
stack || (stack = new Stack);
var stacked = stack.get(value);
if (stacked) {
return stacked;
}
stack.set(value, result);
var keysFunc = isFull
? (isFlat ? getAllKeysIn : getAllKeys)
: (isFlat ? keysIn : keys);
var props = isArr ? undefined : keysFunc(value);
arrayEach(props || value, function(subValue, key) {
if (props) {
key = subValue;
subValue = value[key];
}
// Recursively populate clone (susceptible to call stack limits).
assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
});
return result;
}
module.exports = baseClone;
/***/ }),
/* 210 */
/***/ (function(module, exports) {
/**
* A specialized version of `_.forEach` for arrays without support for
* iteratee shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns `array`.
*/
function arrayEach(array, iteratee) {
var index = -1,
length = array == null ? 0 : array.length;
while (++index < length) {
if (iteratee(array[index], index, array) === false) {
break;
}
}
return array;
}
module.exports = arrayEach;
/***/ }),
/* 211 */
/***/ (function(module, exports, __webpack_require__) {
var copyObject = __webpack_require__(24),
keys = __webpack_require__(14);
/**
* The base implementation of `_.assign` without support for multiple sources
* or `customizer` functions.
*
* @private
* @param {Object} object The destination object.
* @param {Object} source The source object.
* @returns {Object} Returns `object`.
*/
function baseAssign(object, source) {
return object && copyObject(source, keys(source), object);
}
module.exports = baseAssign;
/***/ }),
/* 212 */
/***/ (function(module, exports, __webpack_require__) {
var copyObject = __webpack_require__(24),
keysIn = __webpack_require__(102);
/**
* The base implementation of `_.assignIn` without support for multiple sources
* or `customizer` functions.
*
* @private
* @param {Object} object The destination object.
* @param {Object} source The source object.
* @returns {Object} Returns `object`.
*/
function baseAssignIn(object, source) {
return object && copyObject(source, keysIn(source), object);
}
module.exports = baseAssignIn;
/***/ }),
/* 213 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(7),
isPrototype = __webpack_require__(50),
nativeKeysIn = __webpack_require__(214);
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function baseKeysIn(object) {
if (!isObject(object)) {
return nativeKeysIn(object);
}
var isProto = isPrototype(object),
result = [];
for (var key in object) {
if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
result.push(key);
}
}
return result;
}
module.exports = baseKeysIn;
/***/ }),
/* 214 */
/***/ (function(module, exports) {
/**
* This function is like
* [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* except that it includes inherited enumerable properties.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function nativeKeysIn(object) {
var result = [];
if (object != null) {
for (var key in Object(object)) {
result.push(key);
}
}
return result;
}
module.exports = nativeKeysIn;
/***/ }),
/* 215 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(3);
/** Detect free variable `exports`. */
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
/** Detect free variable `module`. */
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = freeModule && freeModule.exports === freeExports;
/** Built-in value references. */
var Buffer = moduleExports ? root.Buffer : undefined,
allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
/**
* Creates a clone of `buffer`.
*
* @private
* @param {Buffer} buffer The buffer to clone.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Buffer} Returns the cloned buffer.
*/
function cloneBuffer(buffer, isDeep) {
if (isDeep) {
return buffer.slice();
}
var length = buffer.length,
result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
buffer.copy(result);
return result;
}
module.exports = cloneBuffer;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(48)(module)))
/***/ }),
/* 216 */
/***/ (function(module, exports) {
/**
* Copies the values of `source` to `array`.
*
* @private
* @param {Array} source The array to copy values from.
* @param {Array} [array=[]] The array to copy values to.
* @returns {Array} Returns `array`.
*/
function copyArray(source, array) {
var index = -1,
length = source.length;
array || (array = Array(length));
while (++index < length) {
array[index] = source[index];
}
return array;
}
module.exports = copyArray;
/***/ }),
/* 217 */
/***/ (function(module, exports, __webpack_require__) {
var copyObject = __webpack_require__(24),
getSymbols = __webpack_require__(45);
/**
* Copies own symbols of `source` to `object`.
*
* @private
* @param {Object} source The object to copy symbols from.
* @param {Object} [object={}] The object to copy symbols to.
* @returns {Object} Returns `object`.
*/
function copySymbols(source, object) {
return copyObject(source, getSymbols(source), object);
}
module.exports = copySymbols;
/***/ }),
/* 218 */
/***/ (function(module, exports, __webpack_require__) {
var copyObject = __webpack_require__(24),
getSymbolsIn = __webpack_require__(103);
/**
* Copies own and inherited symbols of `source` to `object`.
*
* @private
* @param {Object} source The object to copy symbols from.
* @param {Object} [object={}] The object to copy symbols to.
* @returns {Object} Returns `object`.
*/
function copySymbolsIn(source, object) {
return copyObject(source, getSymbolsIn(source), object);
}
module.exports = copySymbolsIn;
/***/ }),
/* 219 */
/***/ (function(module, exports) {
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Initializes an array clone.
*
* @private
* @param {Array} array The array to clone.
* @returns {Array} Returns the initialized clone.
*/
function initCloneArray(array) {
var length = array.length,
result = array.constructor(length);
// Add properties assigned by `RegExp#exec`.
if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
result.index = array.index;
result.input = array.input;
}
return result;
}
module.exports = initCloneArray;
/***/ }),
/* 220 */
/***/ (function(module, exports, __webpack_require__) {
var cloneArrayBuffer = __webpack_require__(59),
cloneDataView = __webpack_require__(221),
cloneMap = __webpack_require__(222),
cloneRegExp = __webpack_require__(224),
cloneSet = __webpack_require__(225),
cloneSymbol = __webpack_require__(227),
cloneTypedArray = __webpack_require__(228);
/** `Object#toString` result references. */
var boolTag = '[object Boolean]',
dateTag = '[object Date]',
mapTag = '[object Map]',
numberTag = '[object Number]',
regexpTag = '[object RegExp]',
setTag = '[object Set]',
stringTag = '[object String]',
symbolTag = '[object Symbol]';
var arrayBufferTag = '[object ArrayBuffer]',
dataViewTag = '[object DataView]',
float32Tag = '[object Float32Array]',
float64Tag = '[object Float64Array]',
int8Tag = '[object Int8Array]',
int16Tag = '[object Int16Array]',
int32Tag = '[object Int32Array]',
uint8Tag = '[object Uint8Array]',
uint8ClampedTag = '[object Uint8ClampedArray]',
uint16Tag = '[object Uint16Array]',
uint32Tag = '[object Uint32Array]';
/**
* Initializes an object clone based on its `toStringTag`.
*
* **Note:** This function only supports cloning values with tags of
* `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
*
* @private
* @param {Object} object The object to clone.
* @param {string} tag The `toStringTag` of the object to clone.
* @param {Function} cloneFunc The function to clone values.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the initialized clone.
*/
function initCloneByTag(object, tag, cloneFunc, isDeep) {
var Ctor = object.constructor;
switch (tag) {
case arrayBufferTag:
return cloneArrayBuffer(object);
case boolTag:
case dateTag:
return new Ctor(+object);
case dataViewTag:
return cloneDataView(object, isDeep);
case float32Tag: case float64Tag:
case int8Tag: case int16Tag: case int32Tag:
case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
return cloneTypedArray(object, isDeep);
case mapTag:
return cloneMap(object, isDeep, cloneFunc);
case numberTag:
case stringTag:
return new Ctor(object);
case regexpTag:
return cloneRegExp(object);
case setTag:
return cloneSet(object, isDeep, cloneFunc);
case symbolTag:
return cloneSymbol(object);
}
}
module.exports = initCloneByTag;
/***/ }),
/* 221 */
/***/ (function(module, exports, __webpack_require__) {
var cloneArrayBuffer = __webpack_require__(59);
/**
* Creates a clone of `dataView`.
*
* @private
* @param {Object} dataView The data view to clone.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the cloned data view.
*/
function cloneDataView(dataView, isDeep) {
var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
}
module.exports = cloneDataView;
/***/ }),
/* 222 */
/***/ (function(module, exports, __webpack_require__) {
var addMapEntry = __webpack_require__(223),
arrayReduce = __webpack_require__(105),
mapToArray = __webpack_require__(76);
/** Used to compose bitmasks for cloning. */
var CLONE_DEEP_FLAG = 1;
/**
* Creates a clone of `map`.
*
* @private
* @param {Object} map The map to clone.
* @param {Function} cloneFunc The function to clone values.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the cloned map.
*/
function cloneMap(map, isDeep, cloneFunc) {
var array = isDeep ? cloneFunc(mapToArray(map), CLONE_DEEP_FLAG) : mapToArray(map);
return arrayReduce(array, addMapEntry, new map.constructor);
}
module.exports = cloneMap;
/***/ }),
/* 223 */
/***/ (function(module, exports) {
/**
* Adds the key-value `pair` to `map`.
*
* @private
* @param {Object} map The map to modify.
* @param {Array} pair The key-value pair to add.
* @returns {Object} Returns `map`.
*/
function addMapEntry(map, pair) {
// Don't return `map.set` because it's not chainable in IE 11.
map.set(pair[0], pair[1]);
return map;
}
module.exports = addMapEntry;
/***/ }),
/* 224 */
/***/ (function(module, exports) {
/** Used to match `RegExp` flags from their coerced string values. */
var reFlags = /\w*$/;
/**
* Creates a clone of `regexp`.
*
* @private
* @param {Object} regexp The regexp to clone.
* @returns {Object} Returns the cloned regexp.
*/
function cloneRegExp(regexp) {
var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
result.lastIndex = regexp.lastIndex;
return result;
}
module.exports = cloneRegExp;
/***/ }),
/* 225 */
/***/ (function(module, exports, __webpack_require__) {
var addSetEntry = __webpack_require__(226),
arrayReduce = __webpack_require__(105),
setToArray = __webpack_require__(77);
/** Used to compose bitmasks for cloning. */
var CLONE_DEEP_FLAG = 1;
/**
* Creates a clone of `set`.
*
* @private
* @param {Object} set The set to clone.
* @param {Function} cloneFunc The function to clone values.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the cloned set.
*/
function cloneSet(set, isDeep, cloneFunc) {
var array = isDeep ? cloneFunc(setToArray(set), CLONE_DEEP_FLAG) : setToArray(set);
return arrayReduce(array, addSetEntry, new set.constructor);
}
module.exports = cloneSet;
/***/ }),
/* 226 */
/***/ (function(module, exports) {
/**
* Adds `value` to `set`.
*
* @private
* @param {Object} set The set to modify.
* @param {*} value The value to add.
* @returns {Object} Returns `set`.
*/
function addSetEntry(set, value) {
// Don't return `set.add` because it's not chainable in IE 11.
set.add(value);
return set;
}
module.exports = addSetEntry;
/***/ }),
/* 227 */
/***/ (function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(12);
/** Used to convert symbols to primitives and strings. */
var symbolProto = Symbol ? Symbol.prototype : undefined,
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
/**
* Creates a clone of the `symbol` object.
*
* @private
* @param {Object} symbol The symbol object to clone.
* @returns {Object} Returns the cloned symbol object.
*/
function cloneSymbol(symbol) {
return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
}
module.exports = cloneSymbol;
/***/ }),
/* 228 */
/***/ (function(module, exports, __webpack_require__) {
var cloneArrayBuffer = __webpack_require__(59);
/**
* Creates a clone of `typedArray`.
*
* @private
* @param {Object} typedArray The typed array to clone.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the cloned typed array.
*/
function cloneTypedArray(typedArray, isDeep) {
var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
}
module.exports = cloneTypedArray;
/***/ }),
/* 229 */
/***/ (function(module, exports, __webpack_require__) {
var baseCreate = __webpack_require__(230),
getPrototype = __webpack_require__(58),
isPrototype = __webpack_require__(50);
/**
* Initializes an object clone.
*
* @private
* @param {Object} object The object to clone.
* @returns {Object} Returns the initialized clone.
*/
function initCloneObject(object) {
return (typeof object.constructor == 'function' && !isPrototype(object))
? baseCreate(getPrototype(object))
: {};
}
module.exports = initCloneObject;
/***/ }),
/* 230 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(7);
/** Built-in value references. */
var objectCreate = Object.create;
/**
* The base implementation of `_.create` without support for assigning
* properties to the created object.
*
* @private
* @param {Object} proto The object to inherit from.
* @returns {Object} Returns the new object.
*/
var baseCreate = (function() {
function object() {}
return function(proto) {
if (!isObject(proto)) {
return {};
}
if (objectCreate) {
return objectCreate(proto);
}
object.prototype = proto;
var result = new object;
object.prototype = undefined;
return result;
};
}());
module.exports = baseCreate;
/***/ }),
/* 231 */
/***/ (function(module, exports, __webpack_require__) {
var castPath = __webpack_require__(16),
last = __webpack_require__(236),
parent = __webpack_require__(237),
toKey = __webpack_require__(17);
/**
* The base implementation of `_.unset`.
*
* @private
* @param {Object} object The object to modify.
* @param {Array|string} path The property path to unset.
* @returns {boolean} Returns `true` if the property is deleted, else `false`.
*/
function baseUnset(object, path) {
path = castPath(path, object);
object = parent(object, path);
return object == null || delete object[toKey(last(path))];
}
module.exports = baseUnset;
/***/ }),
/* 232 */
/***/ (function(module, exports, __webpack_require__) {
var memoizeCapped = __webpack_require__(233);
/** Used to match property names within property paths. */
var reLeadingDot = /^\./,
rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
/** Used to match backslashes in property paths. */
var reEscapeChar = /\\(\\)?/g;
/**
* Converts `string` to a property path array.
*
* @private
* @param {string} string The string to convert.
* @returns {Array} Returns the property path array.
*/
var stringToPath = memoizeCapped(function(string) {
var result = [];
if (reLeadingDot.test(string)) {
result.push('');
}
string.replace(rePropName, function(match, number, quote, string) {
result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
});
return result;
});
module.exports = stringToPath;
/***/ }),
/* 233 */
/***/ (function(module, exports, __webpack_require__) {
var memoize = __webpack_require__(234);
/** Used as the maximum memoize cache size. */
var MAX_MEMOIZE_SIZE = 500;
/**
* A specialized version of `_.memoize` which clears the memoized function's
* cache when it exceeds `MAX_MEMOIZE_SIZE`.
*
* @private
* @param {Function} func The function to have its output memoized.
* @returns {Function} Returns the new memoized function.
*/
function memoizeCapped(func) {
var result = memoize(func, function(key) {
if (cache.size === MAX_MEMOIZE_SIZE) {
cache.clear();
}
return key;
});
var cache = result.cache;
return result;
}
module.exports = memoizeCapped;
/***/ }),
/* 234 */
/***/ (function(module, exports, __webpack_require__) {
var MapCache = __webpack_require__(43);
/** Error message constants. */
var FUNC_ERROR_TEXT = 'Expected a function';
/**
* Creates a function that memoizes the result of `func`. If `resolver` is
* provided, it determines the cache key for storing the result based on the
* arguments provided to the memoized function. By default, the first argument
* provided to the memoized function is used as the map cache key. The `func`
* is invoked with the `this` binding of the memoized function.
*
* **Note:** The cache is exposed as the `cache` property on the memoized
* function. Its creation may be customized by replacing the `_.memoize.Cache`
* constructor with one whose instances implement the
* [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
* method interface of `clear`, `delete`, `get`, `has`, and `set`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to have its output memoized.
* @param {Function} [resolver] The function to resolve the cache key.
* @returns {Function} Returns the new memoized function.
* @example
*
* var object = { 'a': 1, 'b': 2 };
* var other = { 'c': 3, 'd': 4 };
*
* var values = _.memoize(_.values);
* values(object);
* // => [1, 2]
*
* values(other);
* // => [3, 4]
*
* object.a = 2;
* values(object);
* // => [1, 2]
*
* // Modify the result cache.
* values.cache.set(object, ['a', 'b']);
* values(object);
* // => ['a', 'b']
*
* // Replace `_.memoize.Cache`.
* _.memoize.Cache = WeakMap;
*/
function memoize(func, resolver) {
if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
throw new TypeError(FUNC_ERROR_TEXT);
}
var memoized = function() {
var args = arguments,
key = resolver ? resolver.apply(this, args) : args[0],
cache = memoized.cache;
if (cache.has(key)) {
return cache.get(key);
}
var result = func.apply(this, args);
memoized.cache = cache.set(key, result) || cache;
return result;
};
memoized.cache = new (memoize.Cache || MapCache);
return memoized;
}
// Expose `MapCache`.
memoize.Cache = MapCache;
module.exports = memoize;
/***/ }),
/* 235 */
/***/ (function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(12),
arrayMap = __webpack_require__(99),
isArray = __webpack_require__(6),
isSymbol = __webpack_require__(25);
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0;
/** Used to convert symbols to primitives and strings. */
var symbolProto = Symbol ? Symbol.prototype : undefined,
symbolToString = symbolProto ? symbolProto.toString : undefined;
/**
* The base implementation of `_.toString` which doesn't convert nullish
* values to empty strings.
*
* @private
* @param {*} value The value to process.
* @returns {string} Returns the string.
*/
function baseToString(value) {
// Exit early for strings to avoid a performance hit in some environments.
if (typeof value == 'string') {
return value;
}
if (isArray(value)) {
// Recursively convert values (susceptible to call stack limits).
return arrayMap(value, baseToString) + '';
}
if (isSymbol(value)) {
return symbolToString ? symbolToString.call(value) : '';
}
var result = (value + '');
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
}
module.exports = baseToString;
/***/ }),
/* 236 */
/***/ (function(module, exports) {
/**
* Gets the last element of `array`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to query.
* @returns {*} Returns the last element of `array`.
* @example
*
* _.last([1, 2, 3]);
* // => 3
*/
function last(array) {
var length = array == null ? 0 : array.length;
return length ? array[length - 1] : undefined;
}
module.exports = last;
/***/ }),
/* 237 */
/***/ (function(module, exports, __webpack_require__) {
var baseGet = __webpack_require__(35),
baseSlice = __webpack_require__(238);
/**
* Gets the parent value at `path` of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {Array} path The path to get the parent value of.
* @returns {*} Returns the parent value.
*/
function parent(object, path) {
return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
}
module.exports = parent;
/***/ }),
/* 238 */
/***/ (function(module, exports) {
/**
* The base implementation of `_.slice` without an iteratee call guard.
*
* @private
* @param {Array} array The array to slice.
* @param {number} [start=0] The start position.
* @param {number} [end=array.length] The end position.
* @returns {Array} Returns the slice of `array`.
*/
function baseSlice(array, start, end) {
var index = -1,
length = array.length;
if (start < 0) {
start = -start > length ? 0 : (length + start);
}
end = end > length ? length : end;
if (end < 0) {
end += length;
}
length = start > end ? 0 : ((end - start) >>> 0);
start >>>= 0;
var result = Array(length);
while (++index < length) {
result[index] = array[index + start];
}
return result;
}
module.exports = baseSlice;
/***/ }),
/* 239 */
/***/ (function(module, exports, __webpack_require__) {
var isPlainObject = __webpack_require__(61);
/**
* Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
* objects.
*
* @private
* @param {*} value The value to inspect.
* @param {string} key The key of the property to inspect.
* @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
*/
function customOmitClone(value) {
return isPlainObject(value) ? undefined : value;
}
module.exports = customOmitClone;
/***/ }),
/* 240 */
/***/ (function(module, exports, __webpack_require__) {
var baseFlatten = __webpack_require__(241);
/**
* Flattens `array` a single level deep.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to flatten.
* @returns {Array} Returns the new flattened array.
* @example
*
* _.flatten([1, [2, [3, [4]], 5]]);
* // => [1, 2, [3, [4]], 5]
*/
function flatten(array) {
var length = array == null ? 0 : array.length;
return length ? baseFlatten(array, 1) : [];
}
module.exports = flatten;
/***/ }),
/* 241 */
/***/ (function(module, exports, __webpack_require__) {
var arrayPush = __webpack_require__(44),
isFlattenable = __webpack_require__(242);
/**
* The base implementation of `_.flatten` with support for restricting flattening.
*
* @private
* @param {Array} array The array to flatten.
* @param {number} depth The maximum recursion depth.
* @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
* @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
* @param {Array} [result=[]] The initial result value.
* @returns {Array} Returns the new flattened array.
*/
function baseFlatten(array, depth, predicate, isStrict, result) {
var index = -1,
length = array.length;
predicate || (predicate = isFlattenable);
result || (result = []);
while (++index < length) {
var value = array[index];
if (depth > 0 && predicate(value)) {
if (depth > 1) {
// Recursively flatten arrays (susceptible to call stack limits).
baseFlatten(value, depth - 1, predicate, isStrict, result);
} else {
arrayPush(result, value);
}
} else if (!isStrict) {
result[result.length] = value;
}
}
return result;
}
module.exports = baseFlatten;
/***/ }),
/* 242 */
/***/ (function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(12),
isArguments = __webpack_require__(46),
isArray = __webpack_require__(6);
/** Built-in value references. */
var spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;
/**
* Checks if `value` is a flattenable `arguments` object or array.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
*/
function isFlattenable(value) {
return isArray(value) || isArguments(value) ||
!!(spreadableSymbol && value && value[spreadableSymbol]);
}
module.exports = isFlattenable;
/***/ }),
/* 243 */
/***/ (function(module, exports, __webpack_require__) {
var apply = __webpack_require__(244);
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;
/**
* A specialized version of `baseRest` which transforms the rest array.
*
* @private
* @param {Function} func The function to apply a rest parameter to.
* @param {number} [start=func.length-1] The start position of the rest parameter.
* @param {Function} transform The rest array transform.
* @returns {Function} Returns the new function.
*/
function overRest(func, start, transform) {
start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
return function() {
var args = arguments,
index = -1,
length = nativeMax(args.length - start, 0),
array = Array(length);
while (++index < length) {
array[index] = args[start + index];
}
index = -1;
var otherArgs = Array(start + 1);
while (++index < start) {
otherArgs[index] = args[index];
}
otherArgs[start] = transform(array);
return apply(func, this, otherArgs);
};
}
module.exports = overRest;
/***/ }),
/* 244 */
/***/ (function(module, exports) {
/**
* A faster alternative to `Function#apply`, this function invokes `func`
* with the `this` binding of `thisArg` and the arguments of `args`.
*
* @private
* @param {Function} func The function to invoke.
* @param {*} thisArg The `this` binding of `func`.
* @param {Array} args The arguments to invoke `func` with.
* @returns {*} Returns the result of `func`.
*/
function apply(func, thisArg, args) {
switch (args.length) {
case 0: return func.call(thisArg);
case 1: return func.call(thisArg, args[0]);
case 2: return func.call(thisArg, args[0], args[1]);
case 3: return func.call(thisArg, args[0], args[1], args[2]);
}
return func.apply(thisArg, args);
}
module.exports = apply;
/***/ }),
/* 245 */
/***/ (function(module, exports, __webpack_require__) {
var baseSetToString = __webpack_require__(246),
shortOut = __webpack_require__(248);
/**
* Sets the `toString` method of `func` to return `string`.
*
* @private
* @param {Function} func The function to modify.
* @param {Function} string The `toString` result.
* @returns {Function} Returns `func`.
*/
var setToString = shortOut(baseSetToString);
module.exports = setToString;
/***/ }),
/* 246 */
/***/ (function(module, exports, __webpack_require__) {
var constant = __webpack_require__(247),
defineProperty = __webpack_require__(101),
identity = __webpack_require__(108);
/**
* The base implementation of `setToString` without support for hot loop shorting.
*
* @private
* @param {Function} func The function to modify.
* @param {Function} string The `toString` result.
* @returns {Function} Returns `func`.
*/
var baseSetToString = !defineProperty ? identity : function(func, string) {
return defineProperty(func, 'toString', {
'configurable': true,
'enumerable': false,
'value': constant(string),
'writable': true
});
};
module.exports = baseSetToString;
/***/ }),
/* 247 */
/***/ (function(module, exports) {
/**
* Creates a function that returns `value`.
*
* @static
* @memberOf _
* @since 2.4.0
* @category Util
* @param {*} value The value to return from the new function.
* @returns {Function} Returns the new constant function.
* @example
*
* var objects = _.times(2, _.constant({ 'a': 1 }));
*
* console.log(objects);
* // => [{ 'a': 1 }, { 'a': 1 }]
*
* console.log(objects[0] === objects[1]);
* // => true
*/
function constant(value) {
return function() {
return value;
};
}
module.exports = constant;
/***/ }),
/* 248 */
/***/ (function(module, exports) {
/** Used to detect hot functions by number of calls within a span of milliseconds. */
var HOT_COUNT = 800,
HOT_SPAN = 16;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeNow = Date.now;
/**
* Creates a function that'll short out and invoke `identity` instead
* of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
* milliseconds.
*
* @private
* @param {Function} func The function to restrict.
* @returns {Function} Returns the new shortable function.
*/
function shortOut(func) {
var count = 0,
lastCalled = 0;
return function() {
var stamp = nativeNow(),
remaining = HOT_SPAN - (stamp - lastCalled);
lastCalled = stamp;
if (remaining > 0) {
if (++count >= HOT_COUNT) {
return arguments[0];
}
} else {
count = 0;
}
return func.apply(undefined, arguments);
};
}
module.exports = shortOut;
/***/ }),
/* 249 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* unused harmony export isNodeFound */
/* harmony export (immutable) */ __webpack_exports__["b"] = findHighest;
/* harmony export (immutable) */ __webpack_exports__["a"] = clickedScrollbar;
/**
* Check whether some DOM node is our Component's node.
*/
function isNodeFound(current, componentNode, ignoreClass) {
if (current === componentNode) {
return true;
}
// SVG elements do not technically reside in the rendered DOM, so
// they do not have classList directly, but they offer a link to their
// corresponding element, which can have classList. This extra check is for
// that case.
// See: http://www.w3.org/TR/SVG11/struct.html#InterfaceSVGUseElement
// Discussion: https://github.com/Pomax/react-onclickoutside/pull/17
if (current.correspondingElement) {
return current.correspondingElement.classList.contains(ignoreClass);
}
return current.classList.contains(ignoreClass);
}
/**
* Try to find our node in a hierarchy of nodes, returning the document
* node as highest node if our node is not found in the path up.
*/
function findHighest(current, componentNode, ignoreClass) {
if (current === componentNode) {
return true;
}
// If source=local then this event came from 'somewhere'
// inside and should be ignored. We could handle this with
// a layered approach, too, but that requires going back to
// thinking in terms of Dom node nesting, running counter
// to React's 'you shouldn't care about the DOM' philosophy.
while (current.parentNode) {
if (isNodeFound(current, componentNode, ignoreClass)) {
return true;
}
current = current.parentNode;
}
return current;
}
/**
* Check if the browser scrollbar was clicked
*/
function clickedScrollbar(evt) {
return document.documentElement.clientWidth <= evt.clientX || document.documentElement.clientHeight <= evt.clientY;
}
/***/ }),
/* 250 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
function autoInc() {
var seed = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
return function () {
return ++seed;
};
}
/* harmony default export */ __webpack_exports__["a"] = (autoInc());
/***/ }),
/* 251 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _head2 = __webpack_require__(63);
var _head3 = _interopRequireDefault(_head2);
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 _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _reactDom = __webpack_require__(2);
var _getHintText = __webpack_require__(252);
var _getHintText2 = _interopRequireDefault(_getHintText);
var _getInputText = __webpack_require__(253);
var _getInputText2 = _interopRequireDefault(_getInputText);
var _keyCode = __webpack_require__(62);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
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; }
function typeaheadInputContainer(Input) {
var WrappedInput = function (_React$Component) {
_inherits(WrappedInput, _React$Component);
function WrappedInput() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, WrappedInput);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = WrappedInput.__proto__ || Object.getPrototypeOf(WrappedInput)).call.apply(_ref, [this].concat(args))), _this), _this._handleChange = function (e) {
var _this$props = _this.props,
multiple = _this$props.multiple,
onChange = _this$props.onChange,
onRemove = _this$props.onRemove,
selected = _this$props.selected;
if (!multiple) {
// Clear any selections when text is entered.
!!selected.length && onRemove((0, _head3.default)(selected));
}
onChange(e.target.value);
}, _this._handleKeyDown = function (e) {
var _this$props2 = _this.props,
activeItem = _this$props2.activeItem,
initialItem = _this$props2.initialItem,
isFocused = _this$props2.isFocused,
multiple = _this$props2.multiple,
onAdd = _this$props2.onAdd,
selected = _this$props2.selected,
selectHintOnEnter = _this$props2.selectHintOnEnter;
var inputNode = void 0;
var value = (0, _getInputText2.default)(_this.props);
switch (e.keyCode) {
case _keyCode.BACKSPACE:
if (!multiple) {
break;
}
inputNode = (0, _reactDom.findDOMNode)(_this._input);
if (inputNode && inputNode.contains(document.activeElement) && !value) {
// If the input is selected and there is no text, select the last
// token when the user hits backspace.
var sibling = inputNode.parentElement.previousSibling;
sibling && sibling.focus();
// Prevent browser "back" action.
e.preventDefault();
}
break;
case _keyCode.RETURN:
case _keyCode.RIGHT:
case _keyCode.TAB:
// TODO: Support hinting for multi-selection.
if (multiple) {
break;
}
inputNode = (0, _reactDom.findDOMNode)(_this._input.getInput());
var cursorPos = inputNode && inputNode.selectionStart;
var hintText = (0, _getHintText2.default)(_this.props);
// Autocomplete the selection if all of the following are true:
if (isFocused && (
// There's a hint or a menu item is highlighted.
hintText || activeItem) &&
// There's no current selection.
!selected.length &&
// The input cursor is at the end of the text string when the user
// hits the right arrow key.
!(e.keyCode === _keyCode.RIGHT && cursorPos !== value.length) && !(e.keyCode === _keyCode.RETURN && !selectHintOnEnter)) {
e.preventDefault();
var selectedOption = hintText ? initialItem : activeItem;
onAdd && onAdd(selectedOption);
}
break;
}
_this.props.onKeyDown(e);
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(WrappedInput, [{
key: 'render',
value: function render() {
var _this2 = this;
var _props = this.props,
placeholder = _props.placeholder,
selected = _props.selected;
return _react2.default.createElement(Input, _extends({}, this.props, this.state, {
hintText: (0, _getHintText2.default)(this.props),
inputRef: function inputRef(input) {
return _this2._input = input;
},
onChange: this._handleChange,
onKeyDown: this._handleKeyDown,
placeholder: selected.length ? null : placeholder,
value: (0, _getInputText2.default)(this.props)
}));
}
}, {
key: 'getInputNode',
value: function getInputNode() {
return this._input.getInput();
}
}]);
return WrappedInput;
}(_react2.default.Component);
return WrappedInput;
}
exports.default = typeaheadInputContainer;
/***/ }),
/* 252 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _getOptionLabel = __webpack_require__(18);
var _getOptionLabel2 = _interopRequireDefault(_getOptionLabel);
var _stripDiacritics = __webpack_require__(112);
var _stripDiacritics2 = _interopRequireDefault(_stripDiacritics);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function getHintText(_ref) {
var activeItem = _ref.activeItem,
initialItem = _ref.initialItem,
labelKey = _ref.labelKey,
minLength = _ref.minLength,
selected = _ref.selected,
text = _ref.text;
// Don't display a hint under the following conditions:
if (
// No text entered.
!text ||
// Text doesn't meet `minLength` threshold.
text.length < minLength ||
// No item in the menu.
!initialItem ||
// The initial item is a custom option.
initialItem.customOption ||
// One of the menu items is active.
activeItem ||
// There's already a selection.
!!selected.length) {
return '';
}
var initialItemStr = (0, _getOptionLabel2.default)(initialItem, labelKey);
if (
// The input text corresponds to the beginning of the first option.
// Always strip accents and convert to lower case, since the options are
// already filtered at this point.
(0, _stripDiacritics2.default)(initialItemStr.toLowerCase()).indexOf((0, _stripDiacritics2.default)(text.toLowerCase())) !== 0) {
return '';
}
// Text matching is case- and accent-insensitive, so to display the hint
// correctly, splice the input text with the rest of the actual string.
return text + initialItemStr.slice(text.length, initialItemStr.length);
}
exports.default = getHintText;
/***/ }),
/* 253 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _head2 = __webpack_require__(63);
var _head3 = _interopRequireDefault(_head2);
var _getOptionLabel = __webpack_require__(18);
var _getOptionLabel2 = _interopRequireDefault(_getOptionLabel);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function getInputText(_ref) {
var activeItem = _ref.activeItem,
labelKey = _ref.labelKey,
multiple = _ref.multiple,
selected = _ref.selected,
text = _ref.text;
if (multiple) {
return text;
}
if (activeItem) {
return (0, _getOptionLabel2.default)(activeItem, labelKey);
}
var selectedItem = !!selected.length && (0, _head3.default)(selected);
if (selectedItem) {
return (0, _getOptionLabel2.default)(selectedItem, labelKey);
}
return text;
}
exports.default = getInputText;
/***/ }),
/* 254 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _pick2 = __webpack_require__(255);
var _pick3 = _interopRequireDefault(_pick2);
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 _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 _reactHighlighter = __webpack_require__(261);
var _reactHighlighter2 = _interopRequireDefault(_reactHighlighter);
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _Menu = __webpack_require__(114);
var _Menu2 = _interopRequireDefault(_Menu);
var _MenuItem = __webpack_require__(64);
var _MenuItem2 = _interopRequireDefault(_MenuItem);
var _getOptionLabel = __webpack_require__(18);
var _getOptionLabel2 = _interopRequireDefault(_getOptionLabel);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
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 Highlighter = function Highlighter(props) {
return _react2.default.createElement(_reactHighlighter2.default, _extends({}, props, {
className: 'rbt-highlight',
matchClass: 'rbt-highlight-text'
}));
};
var TypeaheadMenu = function (_React$Component) {
_inherits(TypeaheadMenu, _React$Component);
function TypeaheadMenu(props) {
_classCallCheck(this, TypeaheadMenu);
var _this = _possibleConstructorReturn(this, (TypeaheadMenu.__proto__ || Object.getPrototypeOf(TypeaheadMenu)).call(this, props));
_this.displayName = 'TypeaheadMenu';
_this._renderMenuItem = _this._renderMenuItem.bind(_this);
return _this;
}
_createClass(TypeaheadMenu, [{
key: 'render',
value: function render() {
var menuProps = (0, _pick3.default)(this.props, ['align', 'className', 'dropup', 'emptyLabel', 'maxHeight', 'onPaginate', 'paginate', 'paginationText', 'style']);
return _react2.default.createElement(
_Menu2.default,
menuProps,
this.props.options.map(this._renderMenuItem)
);
}
}, {
key: '_renderMenuItem',
value: function _renderMenuItem(option, idx) {
var _props = this.props,
labelKey = _props.labelKey,
newSelectionPrefix = _props.newSelectionPrefix,
renderMenuItemChildren = _props.renderMenuItemChildren,
text = _props.text;
var menuItemProps = {
disabled: option.disabled,
key: idx,
option: option,
position: idx
};
if (option.customOption) {
return _react2.default.createElement(
_MenuItem2.default,
menuItemProps,
newSelectionPrefix,
_react2.default.createElement(
Highlighter,
{ search: text },
option[labelKey]
)
);
}
return renderMenuItemChildren ? _react2.default.createElement(
_MenuItem2.default,
menuItemProps,
renderMenuItemChildren(option, this.props, idx)
) : _react2.default.createElement(
_MenuItem2.default,
menuItemProps,
_react2.default.createElement(
Highlighter,
{ search: text },
(0, _getOptionLabel2.default)(option, labelKey)
)
);
}
}]);
return TypeaheadMenu;
}(_react2.default.Component);
/**
* In addition to the propTypes below, the following props are automatically
* passed down by `Typeahead`:
*
* - labelKey
* - onPaginate
* - options
* - paginate
* - text
*/
TypeaheadMenu.propTypes = {
/**
* Provides the ability to specify a prefix before the user-entered text to
* indicate that the selection will be new. No-op unless `allowNew={true}`.
*/
newSelectionPrefix: _propTypes2.default.string,
/**
* Provides a hook for customized rendering of menu item contents.
*/
renderMenuItemChildren: _propTypes2.default.func
};
TypeaheadMenu.defaultProps = {
newSelectionPrefix: 'New selection: '
};
exports.default = TypeaheadMenu;
/***/ }),
/* 255 */
/***/ (function(module, exports, __webpack_require__) {
var basePick = __webpack_require__(256),
flatRest = __webpack_require__(107);
/**
* Creates an object composed of the picked `object` properties.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The source object.
* @param {...(string|string[])} [paths] The property paths to pick.
* @returns {Object} Returns the new object.
* @example
*
* var object = { 'a': 1, 'b': '2', 'c': 3 };
*
* _.pick(object, ['a', 'c']);
* // => { 'a': 1, 'c': 3 }
*/
var pick = flatRest(function(object, paths) {
return object == null ? {} : basePick(object, paths);
});
module.exports = pick;
/***/ }),
/* 256 */
/***/ (function(module, exports, __webpack_require__) {
var basePickBy = __webpack_require__(257),
hasIn = __webpack_require__(113);
/**
* The base implementation of `_.pick` without support for individual
* property identifiers.
*
* @private
* @param {Object} object The source object.
* @param {string[]} paths The property paths to pick.
* @returns {Object} Returns the new object.
*/
function basePick(object, paths) {
return basePickBy(object, paths, function(value, path) {
return hasIn(object, path);
});
}
module.exports = basePick;
/***/ }),
/* 257 */
/***/ (function(module, exports, __webpack_require__) {
var baseGet = __webpack_require__(35),
baseSet = __webpack_require__(258),
castPath = __webpack_require__(16);
/**
* The base implementation of `_.pickBy` without support for iteratee shorthands.
*
* @private
* @param {Object} object The source object.
* @param {string[]} paths The property paths to pick.
* @param {Function} predicate The function invoked per property.
* @returns {Object} Returns the new object.
*/
function basePickBy(object, paths, predicate) {
var index = -1,
length = paths.length,
result = {};
while (++index < length) {
var path = paths[index],
value = baseGet(object, path);
if (predicate(value, path)) {
baseSet(result, castPath(path, object), value);
}
}
return result;
}
module.exports = basePickBy;
/***/ }),
/* 258 */
/***/ (function(module, exports, __webpack_require__) {
var assignValue = __webpack_require__(57),
castPath = __webpack_require__(16),
isIndex = __webpack_require__(32),
isObject = __webpack_require__(7),
toKey = __webpack_require__(17);
/**
* The base implementation of `_.set`.
*
* @private
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to set.
* @param {*} value The value to set.
* @param {Function} [customizer] The function to customize path creation.
* @returns {Object} Returns `object`.
*/
function baseSet(object, path, value, customizer) {
if (!isObject(object)) {
return object;
}
path = castPath(path, object);
var index = -1,
length = path.length,
lastIndex = length - 1,
nested = object;
while (nested != null && ++index < length) {
var key = toKey(path[index]),
newValue = value;
if (index != lastIndex) {
var objValue = nested[key];
newValue = customizer ? customizer(objValue, key, nested) : undefined;
if (newValue === undefined) {
newValue = isObject(objValue)
? objValue
: (isIndex(path[index + 1]) ? [] : {});
}
}
assignValue(nested, key, newValue);
nested = nested[key];
}
return object;
}
module.exports = baseSet;
/***/ }),
/* 259 */
/***/ (function(module, exports) {
/**
* The base implementation of `_.hasIn` without support for deep paths.
*
* @private
* @param {Object} [object] The object to query.
* @param {Array|string} key The key to check.
* @returns {boolean} Returns `true` if `key` exists, else `false`.
*/
function baseHasIn(object, key) {
return object != null && key in Object(object);
}
module.exports = baseHasIn;
/***/ }),
/* 260 */
/***/ (function(module, exports, __webpack_require__) {
var castPath = __webpack_require__(16),
isArguments = __webpack_require__(46),
isArray = __webpack_require__(6),
isIndex = __webpack_require__(32),
isLength = __webpack_require__(49),
toKey = __webpack_require__(17);
/**
* Checks if `path` exists on `object`.
*
* @private
* @param {Object} object The object to query.
* @param {Array|string} path The path to check.
* @param {Function} hasFunc The function to check properties.
* @returns {boolean} Returns `true` if `path` exists, else `false`.
*/
function hasPath(object, path, hasFunc) {
path = castPath(path, object);
var index = -1,
length = path.length,
result = false;
while (++index < length) {
var key = toKey(path[index]);
if (!(result = object != null && hasFunc(object, key))) {
break;
}
object = object[key];
}
if (result || ++index != length) {
return result;
}
length = object == null ? 0 : object.length;
return !!length && isLength(length) && isIndex(key, length) &&
(isArray(object) || isArguments(object));
}
module.exports = hasPath;
/***/ }),
/* 261 */
/***/ (function(module, exports, __webpack_require__) {
var React = __webpack_require__(0);
var RegExpPropType = __webpack_require__(262);
var escapeStringRegexp = __webpack_require__(263);
var blacklist = __webpack_require__(264);
var createReactClass = __webpack_require__(265);
var PropTypes = __webpack_require__(1);
var Highlighter = createReactClass({
displayName: 'Highlighter',
count: 0,
propTypes: {
search: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number,
PropTypes.bool,
RegExpPropType
]).isRequired,
caseSensitive: PropTypes.bool,
matchElement: PropTypes.string,
matchClass: PropTypes.string,
matchStyle: PropTypes.object
},
render: function() {
var props = blacklist(
this.props,
'search',
'caseSensitive',
'matchElement',
'matchClass',
'matchStyle'
);
return React.createElement('span', props, this.renderElement(this.props.children));
},
/**
* A wrapper to the highlight method to determine when the highlighting
* process should occur.
*
* @param {string} subject
* The body of text that will be searched for highlighted words.
*
* @return {Array}
* An array of ReactElements
*/
renderElement: function(subject) {
if (this.isScalar() && this.hasSearch()) {
var search = this.getSearch();
return this.highlightChildren(subject, search);
}
return this.props.children;
},
/**
* Determine if props are valid types for processing.
*
* @return {Boolean}
*/
isScalar: function() {
return (/string|number|boolean/).test(typeof this.props.children);
},
/**
* Determine if required search prop is defined and valid.
*
* @return {Boolean}
*/
hasSearch: function() {
return (typeof this.props.search !== 'undefined') && this.props.search;
},
/**
* Get the search prop, but always in the form of a regular expression. Use
* this as a proxy to this.props.search for consistency.
*
* @return {RegExp}
*/
getSearch: function() {
if (this.props.search instanceof RegExp) {
return this.props.search;
}
var flags = '';
if (!this.props.caseSensitive) {
flags +='i';
}
var search = this.props.search;
if (typeof this.props.search === 'string') {
search = escapeStringRegexp(search);
}
return new RegExp(search, flags);
},
/**
* Get the indexes of the first and last characters of the matched string.
*
* @param {string} subject
* The string to search against.
*
* @param {RegExp} search
* The regex search query.
*
* @return {Object}
* An object consisting of "first" and "last" properties representing the
* indexes of the first and last characters of a matching string.
*/
getMatchBoundaries: function(subject, search) {
var matches = search.exec(subject);
if (matches) {
return {
first: matches.index,
last: matches.index + matches[0].length
};
}
},
/**
* Determines which strings of text should be highlighted or not.
*
* @param {string} subject
* The body of text that will be searched for highlighted words.
* @param {string} search
* The search used to search for highlighted words.
*
* @return {Array}
* An array of ReactElements
*/
highlightChildren: function(subject, search) {
var children = [];
var matchElement = this.props.matchElement;
var remaining = subject;
while (remaining) {
if (!search.test(remaining)) {
children.push(this.renderPlain(remaining));
return children;
}
var boundaries = this.getMatchBoundaries(remaining, search);
// Capture the string that leads up to a match...
var nonMatch = remaining.slice(0, boundaries.first);
if (nonMatch) {
children.push(this.renderPlain(nonMatch));
}
// Now, capture the matching string...
var match = remaining.slice(boundaries.first, boundaries.last);
if (match) {
children.push(this.renderHighlight(match, matchElement));
}
// And if there's anything left over, recursively run this method again.
remaining = remaining.slice(boundaries.last);
}
return children;
},
/**
* Responsible for rending a non-highlighted element.
*
* @param {string} string
* A string value to wrap an element around.
*
* @return {ReactElement}
*/
renderPlain: function(string) {
this.count++;
return React.createElement('span', { key: this.count, children: string });
},
/**
* Responsible for rending a highlighted element.
*
* @param {string} string
* A string value to wrap an element around.
*
* @return {ReactElement}
*/
renderHighlight: function(string) {
this.count++;
return React.createElement(this.props.matchElement, {
key: this.count,
className: this.props.matchClass,
style: this.props.matchStyle,
children: string
});
}
});
Highlighter.defaultProps = {
caseSensitive: false,
matchElement: 'strong',
matchClass: 'highlight',
matchStyle: {}
};
module.exports = Highlighter;
/***/ }),
/* 262 */
/***/ (function(module, exports) {
var regExpPropType = function (props, propName, componentName, location) {
if (!(props[propName] instanceof RegExp)) {
var propType = typeof props[propName];
return new Error(
("Invalid " + location + " `" + propName + "` of type `" + propType + "` ") +
("supplied to `" + componentName + "`, expected `RegExp`.")
);
}
};
module.exports = regExpPropType;
/***/ }),
/* 263 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
module.exports = function (str) {
if (typeof str !== 'string') {
throw new TypeError('Expected a string');
}
return str.replace(matchOperatorsRe, '\\$&');
};
/***/ }),
/* 264 */
/***/ (function(module, exports) {
module.exports = function blacklist (src) {
var copy = {}
var filter = arguments[1]
if (typeof filter === 'string') {
filter = {}
for (var i = 1; i < arguments.length; i++) {
filter[arguments[i]] = true
}
}
for (var key in src) {
// blacklist?
if (filter[key]) continue
copy[key] = src[key]
}
return copy
}
/***/ }),
/* 265 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
var React = __webpack_require__(0);
var factory = __webpack_require__(266);
if (typeof React === 'undefined') {
throw Error(
'create-react-class could not find the React object. If you are using script tags, ' +
'make sure that React is being loaded before create-react-class.'
);
}
// Hack to grab NoopUpdateQueue from isomorphic React
var ReactNoopUpdateQueue = new React.Component().updater;
module.exports = factory(
React.Component,
React.isValidElement,
ReactNoopUpdateQueue
);
/***/ }),
/* 266 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
var _assign = __webpack_require__(69);
var emptyObject = __webpack_require__(267);
var _invariant = __webpack_require__(26);
if (process.env.NODE_ENV !== 'production') {
var warning = __webpack_require__(37);
}
var MIXINS_KEY = 'mixins';
// Helper function to allow the creation of anonymous functions which do not
// have .name set to the name of the variable being assigned to.
function identity(fn) {
return fn;
}
var ReactPropTypeLocationNames;
if (process.env.NODE_ENV !== 'production') {
ReactPropTypeLocationNames = {
prop: 'prop',
context: 'context',
childContext: 'child context'
};
} else {
ReactPropTypeLocationNames = {};
}
function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) {
/**
* Policies that describe methods in `ReactClassInterface`.
*/
var injectedMixins = [];
/**
* Composite components are higher-level components that compose other composite
* or host components.
*
* To create a new type of `ReactClass`, pass a specification of
* your new class to `React.createClass`. The only requirement of your class
* specification is that you implement a `render` method.
*
* var MyComponent = React.createClass({
* render: function() {
* return Hello World
;
* }
* });
*
* The class specification supports a specific protocol of methods that have
* special meaning (e.g. `render`). See `ReactClassInterface` for
* more the comprehensive protocol. Any other properties and methods in the
* class specification will be available on the prototype.
*
* @interface ReactClassInterface
* @internal
*/
var ReactClassInterface = {
/**
* An array of Mixin objects to include when defining your component.
*
* @type {array}
* @optional
*/
mixins: 'DEFINE_MANY',
/**
* An object containing properties and methods that should be defined on
* the component's constructor instead of its prototype (static methods).
*
* @type {object}
* @optional
*/
statics: 'DEFINE_MANY',
/**
* Definition of prop types for this component.
*
* @type {object}
* @optional
*/
propTypes: 'DEFINE_MANY',
/**
* Definition of context types for this component.
*
* @type {object}
* @optional
*/
contextTypes: 'DEFINE_MANY',
/**
* Definition of context types this component sets for its children.
*
* @type {object}
* @optional
*/
childContextTypes: 'DEFINE_MANY',
// ==== Definition methods ====
/**
* Invoked when the component is mounted. Values in the mapping will be set on
* `this.props` if that prop is not specified (i.e. using an `in` check).
*
* This method is invoked before `getInitialState` and therefore cannot rely
* on `this.state` or use `this.setState`.
*
* @return {object}
* @optional
*/
getDefaultProps: 'DEFINE_MANY_MERGED',
/**
* Invoked once before the component is mounted. The return value will be used
* as the initial value of `this.state`.
*
* getInitialState: function() {
* return {
* isOn: false,
* fooBaz: new BazFoo()
* }
* }
*
* @return {object}
* @optional
*/
getInitialState: 'DEFINE_MANY_MERGED',
/**
* @return {object}
* @optional
*/
getChildContext: 'DEFINE_MANY_MERGED',
/**
* Uses props from `this.props` and state from `this.state` to render the
* structure of the component.
*
* No guarantees are made about when or how often this method is invoked, so
* it must not have side effects.
*
* render: function() {
* var name = this.props.name;
* return Hello, {name}!
;
* }
*
* @return {ReactComponent}
* @required
*/
render: 'DEFINE_ONCE',
// ==== Delegate methods ====
/**
* Invoked when the component is initially created and about to be mounted.
* This may have side effects, but any external subscriptions or data created
* by this method must be cleaned up in `componentWillUnmount`.
*
* @optional
*/
componentWillMount: 'DEFINE_MANY',
/**
* Invoked when the component has been mounted and has a DOM representation.
* However, there is no guarantee that the DOM node is in the document.
*
* Use this as an opportunity to operate on the DOM when the component has
* been mounted (initialized and rendered) for the first time.
*
* @param {DOMElement} rootNode DOM element representing the component.
* @optional
*/
componentDidMount: 'DEFINE_MANY',
/**
* Invoked before the component receives new props.
*
* Use this as an opportunity to react to a prop transition by updating the
* state using `this.setState`. Current props are accessed via `this.props`.
*
* componentWillReceiveProps: function(nextProps, nextContext) {
* this.setState({
* likesIncreasing: nextProps.likeCount > this.props.likeCount
* });
* }
*
* NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop
* transition may cause a state change, but the opposite is not true. If you
* need it, you are probably looking for `componentWillUpdate`.
*
* @param {object} nextProps
* @optional
*/
componentWillReceiveProps: 'DEFINE_MANY',
/**
* Invoked while deciding if the component should be updated as a result of
* receiving new props, state and/or context.
*
* Use this as an opportunity to `return false` when you're certain that the
* transition to the new props/state/context will not require a component
* update.
*
* shouldComponentUpdate: function(nextProps, nextState, nextContext) {
* return !equal(nextProps, this.props) ||
* !equal(nextState, this.state) ||
* !equal(nextContext, this.context);
* }
*
* @param {object} nextProps
* @param {?object} nextState
* @param {?object} nextContext
* @return {boolean} True if the component should update.
* @optional
*/
shouldComponentUpdate: 'DEFINE_ONCE',
/**
* Invoked when the component is about to update due to a transition from
* `this.props`, `this.state` and `this.context` to `nextProps`, `nextState`
* and `nextContext`.
*
* Use this as an opportunity to perform preparation before an update occurs.
*
* NOTE: You **cannot** use `this.setState()` in this method.
*
* @param {object} nextProps
* @param {?object} nextState
* @param {?object} nextContext
* @param {ReactReconcileTransaction} transaction
* @optional
*/
componentWillUpdate: 'DEFINE_MANY',
/**
* Invoked when the component's DOM representation has been updated.
*
* Use this as an opportunity to operate on the DOM when the component has
* been updated.
*
* @param {object} prevProps
* @param {?object} prevState
* @param {?object} prevContext
* @param {DOMElement} rootNode DOM element representing the component.
* @optional
*/
componentDidUpdate: 'DEFINE_MANY',
/**
* Invoked when the component is about to be removed from its parent and have
* its DOM representation destroyed.
*
* Use this as an opportunity to deallocate any external resources.
*
* NOTE: There is no `componentDidUnmount` since your component will have been
* destroyed by that point.
*
* @optional
*/
componentWillUnmount: 'DEFINE_MANY',
// ==== Advanced methods ====
/**
* Updates the component's currently mounted DOM representation.
*
* By default, this implements React's rendering and reconciliation algorithm.
* Sophisticated clients may wish to override this.
*
* @param {ReactReconcileTransaction} transaction
* @internal
* @overridable
*/
updateComponent: 'OVERRIDE_BASE'
};
/**
* Mapping from class specification keys to special processing functions.
*
* Although these are declared like instance properties in the specification
* when defining classes using `React.createClass`, they are actually static
* and are accessible on the constructor instead of the prototype. Despite
* being static, they must be defined outside of the "statics" key under
* which all other static methods are defined.
*/
var RESERVED_SPEC_KEYS = {
displayName: function(Constructor, displayName) {
Constructor.displayName = displayName;
},
mixins: function(Constructor, mixins) {
if (mixins) {
for (var i = 0; i < mixins.length; i++) {
mixSpecIntoComponent(Constructor, mixins[i]);
}
}
},
childContextTypes: function(Constructor, childContextTypes) {
if (process.env.NODE_ENV !== 'production') {
validateTypeDef(Constructor, childContextTypes, 'childContext');
}
Constructor.childContextTypes = _assign(
{},
Constructor.childContextTypes,
childContextTypes
);
},
contextTypes: function(Constructor, contextTypes) {
if (process.env.NODE_ENV !== 'production') {
validateTypeDef(Constructor, contextTypes, 'context');
}
Constructor.contextTypes = _assign(
{},
Constructor.contextTypes,
contextTypes
);
},
/**
* Special case getDefaultProps which should move into statics but requires
* automatic merging.
*/
getDefaultProps: function(Constructor, getDefaultProps) {
if (Constructor.getDefaultProps) {
Constructor.getDefaultProps = createMergedResultFunction(
Constructor.getDefaultProps,
getDefaultProps
);
} else {
Constructor.getDefaultProps = getDefaultProps;
}
},
propTypes: function(Constructor, propTypes) {
if (process.env.NODE_ENV !== 'production') {
validateTypeDef(Constructor, propTypes, 'prop');
}
Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes);
},
statics: function(Constructor, statics) {
mixStaticSpecIntoComponent(Constructor, statics);
},
autobind: function() {}
};
function validateTypeDef(Constructor, typeDef, location) {
for (var propName in typeDef) {
if (typeDef.hasOwnProperty(propName)) {
// use a warning instead of an _invariant so components
// don't show up in prod but only in __DEV__
if (process.env.NODE_ENV !== 'production') {
warning(
typeof typeDef[propName] === 'function',
'%s: %s type `%s` is invalid; it must be a function, usually from ' +
'React.PropTypes.',
Constructor.displayName || 'ReactClass',
ReactPropTypeLocationNames[location],
propName
);
}
}
}
}
function validateMethodOverride(isAlreadyDefined, name) {
var specPolicy = ReactClassInterface.hasOwnProperty(name)
? ReactClassInterface[name]
: null;
// Disallow overriding of base class methods unless explicitly allowed.
if (ReactClassMixin.hasOwnProperty(name)) {
_invariant(
specPolicy === 'OVERRIDE_BASE',
'ReactClassInterface: You are attempting to override ' +
'`%s` from your class specification. Ensure that your method names ' +
'do not overlap with React methods.',
name
);
}
// Disallow defining methods more than once unless explicitly allowed.
if (isAlreadyDefined) {
_invariant(
specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED',
'ReactClassInterface: You are attempting to define ' +
'`%s` on your component more than once. This conflict may be due ' +
'to a mixin.',
name
);
}
}
/**
* Mixin helper which handles policy validation and reserved
* specification keys when building React classes.
*/
function mixSpecIntoComponent(Constructor, spec) {
if (!spec) {
if (process.env.NODE_ENV !== 'production') {
var typeofSpec = typeof spec;
var isMixinValid = typeofSpec === 'object' && spec !== null;
if (process.env.NODE_ENV !== 'production') {
warning(
isMixinValid,
"%s: You're attempting to include a mixin that is either null " +
'or not an object. Check the mixins included by the component, ' +
'as well as any mixins they include themselves. ' +
'Expected object but got %s.',
Constructor.displayName || 'ReactClass',
spec === null ? null : typeofSpec
);
}
}
return;
}
_invariant(
typeof spec !== 'function',
"ReactClass: You're attempting to " +
'use a component class or function as a mixin. Instead, just use a ' +
'regular object.'
);
_invariant(
!isValidElement(spec),
"ReactClass: You're attempting to " +
'use a component as a mixin. Instead, just use a regular object.'
);
var proto = Constructor.prototype;
var autoBindPairs = proto.__reactAutoBindPairs;
// By handling mixins before any other properties, we ensure the same
// chaining order is applied to methods with DEFINE_MANY policy, whether
// mixins are listed before or after these methods in the spec.
if (spec.hasOwnProperty(MIXINS_KEY)) {
RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);
}
for (var name in spec) {
if (!spec.hasOwnProperty(name)) {
continue;
}
if (name === MIXINS_KEY) {
// We have already handled mixins in a special case above.
continue;
}
var property = spec[name];
var isAlreadyDefined = proto.hasOwnProperty(name);
validateMethodOverride(isAlreadyDefined, name);
if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {
RESERVED_SPEC_KEYS[name](Constructor, property);
} else {
// Setup methods on prototype:
// The following member methods should not be automatically bound:
// 1. Expected ReactClass methods (in the "interface").
// 2. Overridden methods (that were mixed in).
var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);
var isFunction = typeof property === 'function';
var shouldAutoBind =
isFunction &&
!isReactClassMethod &&
!isAlreadyDefined &&
spec.autobind !== false;
if (shouldAutoBind) {
autoBindPairs.push(name, property);
proto[name] = property;
} else {
if (isAlreadyDefined) {
var specPolicy = ReactClassInterface[name];
// These cases should already be caught by validateMethodOverride.
_invariant(
isReactClassMethod &&
(specPolicy === 'DEFINE_MANY_MERGED' ||
specPolicy === 'DEFINE_MANY'),
'ReactClass: Unexpected spec policy %s for key %s ' +
'when mixing in component specs.',
specPolicy,
name
);
// For methods which are defined more than once, call the existing
// methods before calling the new property, merging if appropriate.
if (specPolicy === 'DEFINE_MANY_MERGED') {
proto[name] = createMergedResultFunction(proto[name], property);
} else if (specPolicy === 'DEFINE_MANY') {
proto[name] = createChainedFunction(proto[name], property);
}
} else {
proto[name] = property;
if (process.env.NODE_ENV !== 'production') {
// Add verbose displayName to the function, which helps when looking
// at profiling tools.
if (typeof property === 'function' && spec.displayName) {
proto[name].displayName = spec.displayName + '_' + name;
}
}
}
}
}
}
}
function mixStaticSpecIntoComponent(Constructor, statics) {
if (!statics) {
return;
}
for (var name in statics) {
var property = statics[name];
if (!statics.hasOwnProperty(name)) {
continue;
}
var isReserved = name in RESERVED_SPEC_KEYS;
_invariant(
!isReserved,
'ReactClass: You are attempting to define a reserved ' +
'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' +
'as an instance property instead; it will still be accessible on the ' +
'constructor.',
name
);
var isInherited = name in Constructor;
_invariant(
!isInherited,
'ReactClass: You are attempting to define ' +
'`%s` on your component more than once. This conflict may be ' +
'due to a mixin.',
name
);
Constructor[name] = property;
}
}
/**
* Merge two objects, but throw if both contain the same key.
*
* @param {object} one The first object, which is mutated.
* @param {object} two The second object
* @return {object} one after it has been mutated to contain everything in two.
*/
function mergeIntoWithNoDuplicateKeys(one, two) {
_invariant(
one && two && typeof one === 'object' && typeof two === 'object',
'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.'
);
for (var key in two) {
if (two.hasOwnProperty(key)) {
_invariant(
one[key] === undefined,
'mergeIntoWithNoDuplicateKeys(): ' +
'Tried to merge two objects with the same key: `%s`. This conflict ' +
'may be due to a mixin; in particular, this may be caused by two ' +
'getInitialState() or getDefaultProps() methods returning objects ' +
'with clashing keys.',
key
);
one[key] = two[key];
}
}
return one;
}
/**
* Creates a function that invokes two functions and merges their return values.
*
* @param {function} one Function to invoke first.
* @param {function} two Function to invoke second.
* @return {function} Function that invokes the two argument functions.
* @private
*/
function createMergedResultFunction(one, two) {
return function mergedResult() {
var a = one.apply(this, arguments);
var b = two.apply(this, arguments);
if (a == null) {
return b;
} else if (b == null) {
return a;
}
var c = {};
mergeIntoWithNoDuplicateKeys(c, a);
mergeIntoWithNoDuplicateKeys(c, b);
return c;
};
}
/**
* Creates a function that invokes two functions and ignores their return vales.
*
* @param {function} one Function to invoke first.
* @param {function} two Function to invoke second.
* @return {function} Function that invokes the two argument functions.
* @private
*/
function createChainedFunction(one, two) {
return function chainedFunction() {
one.apply(this, arguments);
two.apply(this, arguments);
};
}
/**
* Binds a method to the component.
*
* @param {object} component Component whose method is going to be bound.
* @param {function} method Method to be bound.
* @return {function} The bound method.
*/
function bindAutoBindMethod(component, method) {
var boundMethod = method.bind(component);
if (process.env.NODE_ENV !== 'production') {
boundMethod.__reactBoundContext = component;
boundMethod.__reactBoundMethod = method;
boundMethod.__reactBoundArguments = null;
var componentName = component.constructor.displayName;
var _bind = boundMethod.bind;
boundMethod.bind = function(newThis) {
for (
var _len = arguments.length,
args = Array(_len > 1 ? _len - 1 : 0),
_key = 1;
_key < _len;
_key++
) {
args[_key - 1] = arguments[_key];
}
// User is trying to bind() an autobound method; we effectively will
// ignore the value of "this" that the user is trying to use, so
// let's warn.
if (newThis !== component && newThis !== null) {
if (process.env.NODE_ENV !== 'production') {
warning(
false,
'bind(): React component methods may only be bound to the ' +
'component instance. See %s',
componentName
);
}
} else if (!args.length) {
if (process.env.NODE_ENV !== 'production') {
warning(
false,
'bind(): You are binding a component method to the component. ' +
'React does this for you automatically in a high-performance ' +
'way, so you can safely remove this call. See %s',
componentName
);
}
return boundMethod;
}
var reboundMethod = _bind.apply(boundMethod, arguments);
reboundMethod.__reactBoundContext = component;
reboundMethod.__reactBoundMethod = method;
reboundMethod.__reactBoundArguments = args;
return reboundMethod;
};
}
return boundMethod;
}
/**
* Binds all auto-bound methods in a component.
*
* @param {object} component Component whose method is going to be bound.
*/
function bindAutoBindMethods(component) {
var pairs = component.__reactAutoBindPairs;
for (var i = 0; i < pairs.length; i += 2) {
var autoBindKey = pairs[i];
var method = pairs[i + 1];
component[autoBindKey] = bindAutoBindMethod(component, method);
}
}
var IsMountedPreMixin = {
componentDidMount: function() {
this.__isMounted = true;
}
};
var IsMountedPostMixin = {
componentWillUnmount: function() {
this.__isMounted = false;
}
};
/**
* Add more to the ReactClass base class. These are all legacy features and
* therefore not already part of the modern ReactComponent.
*/
var ReactClassMixin = {
/**
* TODO: This will be deprecated because state should always keep a consistent
* type signature and the only use case for this, is to avoid that.
*/
replaceState: function(newState, callback) {
this.updater.enqueueReplaceState(this, newState, callback);
},
/**
* Checks whether or not this composite component is mounted.
* @return {boolean} True if mounted, false otherwise.
* @protected
* @final
*/
isMounted: function() {
if (process.env.NODE_ENV !== 'production') {
warning(
this.__didWarnIsMounted,
'%s: isMounted is deprecated. Instead, make sure to clean up ' +
'subscriptions and pending requests in componentWillUnmount to ' +
'prevent memory leaks.',
(this.constructor && this.constructor.displayName) ||
this.name ||
'Component'
);
this.__didWarnIsMounted = true;
}
return !!this.__isMounted;
}
};
var ReactClassComponent = function() {};
_assign(
ReactClassComponent.prototype,
ReactComponent.prototype,
ReactClassMixin
);
/**
* Creates a composite component class given a class specification.
* See https://facebook.github.io/react/docs/top-level-api.html#react.createclass
*
* @param {object} spec Class specification (which must define `render`).
* @return {function} Component constructor function.
* @public
*/
function createClass(spec) {
// To keep our warnings more understandable, we'll use a little hack here to
// ensure that Constructor.name !== 'Constructor'. This makes sure we don't
// unnecessarily identify a class without displayName as 'Constructor'.
var Constructor = identity(function(props, context, updater) {
// This constructor gets overridden by mocks. The argument is used
// by mocks to assert on what gets mounted.
if (process.env.NODE_ENV !== 'production') {
warning(
this instanceof Constructor,
'Something is calling a React component directly. Use a factory or ' +
'JSX instead. See: https://fb.me/react-legacyfactory'
);
}
// Wire up auto-binding
if (this.__reactAutoBindPairs.length) {
bindAutoBindMethods(this);
}
this.props = props;
this.context = context;
this.refs = emptyObject;
this.updater = updater || ReactNoopUpdateQueue;
this.state = null;
// ReactClasses doesn't have constructors. Instead, they use the
// getInitialState and componentWillMount methods for initialization.
var initialState = this.getInitialState ? this.getInitialState() : null;
if (process.env.NODE_ENV !== 'production') {
// We allow auto-mocks to proceed as if they're returning null.
if (
initialState === undefined &&
this.getInitialState._isMockFunction
) {
// This is probably bad practice. Consider warning here and
// deprecating this convenience.
initialState = null;
}
}
_invariant(
typeof initialState === 'object' && !Array.isArray(initialState),
'%s.getInitialState(): must return an object or null',
Constructor.displayName || 'ReactCompositeComponent'
);
this.state = initialState;
});
Constructor.prototype = new ReactClassComponent();
Constructor.prototype.constructor = Constructor;
Constructor.prototype.__reactAutoBindPairs = [];
injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor));
mixSpecIntoComponent(Constructor, IsMountedPreMixin);
mixSpecIntoComponent(Constructor, spec);
mixSpecIntoComponent(Constructor, IsMountedPostMixin);
// Initialize the defaultProps property after all mixins have been merged.
if (Constructor.getDefaultProps) {
Constructor.defaultProps = Constructor.getDefaultProps();
}
if (process.env.NODE_ENV !== 'production') {
// This is a tag to indicate that the use of these method names is ok,
// since it's used with createClass. If it's not, then it's likely a
// mistake so we'll warn you to use the static property, property
// initializer or constructor respectively.
if (Constructor.getDefaultProps) {
Constructor.getDefaultProps.isReactClassApproved = {};
}
if (Constructor.prototype.getInitialState) {
Constructor.prototype.getInitialState.isReactClassApproved = {};
}
}
_invariant(
Constructor.prototype.render,
'createClass(...): Class specification must implement a `render` method.'
);
if (process.env.NODE_ENV !== 'production') {
warning(
!Constructor.prototype.componentShouldUpdate,
'%s has a method called ' +
'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' +
'The name is phrased as a question because the function is ' +
'expected to return a value.',
spec.displayName || 'A component'
);
warning(
!Constructor.prototype.componentWillRecieveProps,
'%s has a method called ' +
'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?',
spec.displayName || 'A component'
);
}
// Reduce time spent doing lookups by setting these on the prototype.
for (var methodName in ReactClassInterface) {
if (!Constructor.prototype[methodName]) {
Constructor.prototype[methodName] = null;
}
}
return Constructor;
}
return createClass;
}
module.exports = factory;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 267 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
var emptyObject = {};
if (process.env.NODE_ENV !== 'production') {
Object.freeze(emptyObject);
}
module.exports = emptyObject;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 268 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
/**
* Partial polyfill for webkit `scrollIntoViewIfNeeded()` method. Addresses
* vertical scrolling only.
*
* Inspired by https://gist.github.com/hsablonniere/2581101, but uses
* `getBoundingClientRect`.
*/
function scrollIntoViewIfNeeded(node) {
// Webkit browsers
if (Element.prototype.scrollIntoViewIfNeeded) {
node.scrollIntoViewIfNeeded();
return;
}
// FF, IE, etc.
var rect = node.getBoundingClientRect();
var parent = node.parentNode;
var parentRect = parent.getBoundingClientRect();
var parentComputedStyle = window.getComputedStyle(parent, null);
var parentBorderTopWidth = parseInt(parentComputedStyle.getPropertyValue('border-top-width'));
if (rect.top < parentRect.top || rect.bottom > parentRect.bottom) {
parent.scrollTop = node.offsetTop - parent.offsetTop - parent.clientHeight / 2 - parentBorderTopWidth + node.clientHeight / 2;
}
}
exports.default = scrollIntoViewIfNeeded;
/***/ }),
/* 269 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(process) {
Object.defineProperty(exports, "__esModule", {
value: true
});
var _uniqueId2 = __webpack_require__(270);
var _uniqueId3 = _interopRequireDefault(_uniqueId2);
var _find2 = __webpack_require__(116);
var _find3 = _interopRequireDefault(_find2);
var _invariant = __webpack_require__(111);
var _invariant2 = _interopRequireDefault(_invariant);
var _getOptionLabel = __webpack_require__(18);
var _getOptionLabel2 = _interopRequireDefault(_getOptionLabel);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
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 addCustomOption(results, text, labelKey) {
var exactMatchFound = (0, _find3.default)(results, function (o) {
return (0, _getOptionLabel2.default)(o, labelKey) === text;
});
if (!text.trim() || exactMatchFound) {
return results;
}
!(typeof labelKey === 'string') ? process.env.NODE_ENV !== 'production' ? (0, _invariant2.default)(false, '`labelKey` must be a string when creating new options.') : (0, _invariant2.default)(false) : void 0;
var customOption = _defineProperty({
customOption: true,
id: (0, _uniqueId3.default)('new-id-')
}, labelKey, text);
return [].concat(_toConsumableArray(results), [customOption]);
}
exports.default = addCustomOption;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
/***/ }),
/* 270 */
/***/ (function(module, exports, __webpack_require__) {
var toString = __webpack_require__(106);
/** Used to generate unique IDs. */
var idCounter = 0;
/**
* Generates a unique ID. If `prefix` is given, the ID is appended to it.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Util
* @param {string} [prefix=''] The value to prefix the ID with.
* @returns {string} Returns the unique ID.
* @example
*
* _.uniqueId('contact_');
* // => 'contact_104'
*
* _.uniqueId();
* // => '105'
*/
function uniqueId(prefix) {
var id = ++idCounter;
return toString(prefix) + id;
}
module.exports = uniqueId;
/***/ }),
/* 271 */
/***/ (function(module, exports, __webpack_require__) {
var baseIteratee = __webpack_require__(65),
isArrayLike = __webpack_require__(20),
keys = __webpack_require__(14);
/**
* Creates a `_.find` or `_.findLast` function.
*
* @private
* @param {Function} findIndexFunc The function to find the collection index.
* @returns {Function} Returns the new find function.
*/
function createFind(findIndexFunc) {
return function(collection, predicate, fromIndex) {
var iterable = Object(collection);
if (!isArrayLike(collection)) {
var iteratee = baseIteratee(predicate, 3);
collection = keys(collection);
predicate = function(key) { return iteratee(iterable[key], key, iterable); };
}
var index = findIndexFunc(collection, predicate, fromIndex);
return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
};
}
module.exports = createFind;
/***/ }),
/* 272 */
/***/ (function(module, exports, __webpack_require__) {
var baseIsMatch = __webpack_require__(273),
getMatchData = __webpack_require__(274),
matchesStrictComparable = __webpack_require__(118);
/**
* The base implementation of `_.matches` which doesn't clone `source`.
*
* @private
* @param {Object} source The object of property values to match.
* @returns {Function} Returns the new spec function.
*/
function baseMatches(source) {
var matchData = getMatchData(source);
if (matchData.length == 1 && matchData[0][2]) {
return matchesStrictComparable(matchData[0][0], matchData[0][1]);
}
return function(object) {
return object === source || baseIsMatch(object, source, matchData);
};
}
module.exports = baseMatches;
/***/ }),
/* 273 */
/***/ (function(module, exports, __webpack_require__) {
var Stack = __webpack_require__(40),
baseIsEqual = __webpack_require__(39);
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1,
COMPARE_UNORDERED_FLAG = 2;
/**
* The base implementation of `_.isMatch` without support for iteratee shorthands.
*
* @private
* @param {Object} object The object to inspect.
* @param {Object} source The object of property values to match.
* @param {Array} matchData The property names, values, and compare flags to match.
* @param {Function} [customizer] The function to customize comparisons.
* @returns {boolean} Returns `true` if `object` is a match, else `false`.
*/
function baseIsMatch(object, source, matchData, customizer) {
var index = matchData.length,
length = index,
noCustomizer = !customizer;
if (object == null) {
return !length;
}
object = Object(object);
while (index--) {
var data = matchData[index];
if ((noCustomizer && data[2])
? data[1] !== object[data[0]]
: !(data[0] in object)
) {
return false;
}
}
while (++index < length) {
data = matchData[index];
var key = data[0],
objValue = object[key],
srcValue = data[1];
if (noCustomizer && data[2]) {
if (objValue === undefined && !(key in object)) {
return false;
}
} else {
var stack = new Stack;
if (customizer) {
var result = customizer(objValue, srcValue, key, object, source, stack);
}
if (!(result === undefined
? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
: result
)) {
return false;
}
}
}
return true;
}
module.exports = baseIsMatch;
/***/ }),
/* 274 */
/***/ (function(module, exports, __webpack_require__) {
var isStrictComparable = __webpack_require__(117),
keys = __webpack_require__(14);
/**
* Gets the property names, values, and compare flags of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the match data of `object`.
*/
function getMatchData(object) {
var result = keys(object),
length = result.length;
while (length--) {
var key = result[length],
value = object[key];
result[length] = [key, value, isStrictComparable(value)];
}
return result;
}
module.exports = getMatchData;
/***/ }),
/* 275 */
/***/ (function(module, exports, __webpack_require__) {
var baseIsEqual = __webpack_require__(39),
get = __webpack_require__(276),
hasIn = __webpack_require__(113),
isKey = __webpack_require__(60),
isStrictComparable = __webpack_require__(117),
matchesStrictComparable = __webpack_require__(118),
toKey = __webpack_require__(17);
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1,
COMPARE_UNORDERED_FLAG = 2;
/**
* The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
*
* @private
* @param {string} path The path of the property to get.
* @param {*} srcValue The value to match.
* @returns {Function} Returns the new spec function.
*/
function baseMatchesProperty(path, srcValue) {
if (isKey(path) && isStrictComparable(srcValue)) {
return matchesStrictComparable(toKey(path), srcValue);
}
return function(object) {
var objValue = get(object, path);
return (objValue === undefined && objValue === srcValue)
? hasIn(object, path)
: baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
};
}
module.exports = baseMatchesProperty;
/***/ }),
/* 276 */
/***/ (function(module, exports, __webpack_require__) {
var baseGet = __webpack_require__(35);
/**
* Gets the value at `path` of `object`. If the resolved value is
* `undefined`, the `defaultValue` is returned in its place.
*
* @static
* @memberOf _
* @since 3.7.0
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path of the property to get.
* @param {*} [defaultValue] The value returned for `undefined` resolved values.
* @returns {*} Returns the resolved value.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
*
* _.get(object, 'a[0].b.c');
* // => 3
*
* _.get(object, ['a', '0', 'b', 'c']);
* // => 3
*
* _.get(object, 'a.b.c', 'default');
* // => 'default'
*/
function get(object, path, defaultValue) {
var result = object == null ? undefined : baseGet(object, path);
return result === undefined ? defaultValue : result;
}
module.exports = get;
/***/ }),
/* 277 */
/***/ (function(module, exports, __webpack_require__) {
var baseProperty = __webpack_require__(278),
basePropertyDeep = __webpack_require__(279),
isKey = __webpack_require__(60),
toKey = __webpack_require__(17);
/**
* Creates a function that returns the value at `path` of a given object.
*
* @static
* @memberOf _
* @since 2.4.0
* @category Util
* @param {Array|string} path The path of the property to get.
* @returns {Function} Returns the new accessor function.
* @example
*
* var objects = [
* { 'a': { 'b': 2 } },
* { 'a': { 'b': 1 } }
* ];
*
* _.map(objects, _.property('a.b'));
* // => [2, 1]
*
* _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
* // => [1, 2]
*/
function property(path) {
return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
}
module.exports = property;
/***/ }),
/* 278 */
/***/ (function(module, exports) {
/**
* The base implementation of `_.property` without support for deep paths.
*
* @private
* @param {string} key The key of the property to get.
* @returns {Function} Returns the new accessor function.
*/
function baseProperty(key) {
return function(object) {
return object == null ? undefined : object[key];
};
}
module.exports = baseProperty;
/***/ }),
/* 279 */
/***/ (function(module, exports, __webpack_require__) {
var baseGet = __webpack_require__(35);
/**
* A specialized version of `baseProperty` which supports deep paths.
*
* @private
* @param {Array|string} path The path of the property to get.
* @returns {Function} Returns the new accessor function.
*/
function basePropertyDeep(path) {
return function(object) {
return baseGet(object, path);
};
}
module.exports = basePropertyDeep;
/***/ }),
/* 280 */
/***/ (function(module, exports, __webpack_require__) {
var baseFindIndex = __webpack_require__(281),
baseIteratee = __webpack_require__(65),
toInteger = __webpack_require__(282);
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;
/**
* This method is like `_.find` except that it returns the index of the first
* element `predicate` returns truthy for instead of the element itself.
*
* @static
* @memberOf _
* @since 1.1.0
* @category Array
* @param {Array} array The array to inspect.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @param {number} [fromIndex=0] The index to search from.
* @returns {number} Returns the index of the found element, else `-1`.
* @example
*
* var users = [
* { 'user': 'barney', 'active': false },
* { 'user': 'fred', 'active': false },
* { 'user': 'pebbles', 'active': true }
* ];
*
* _.findIndex(users, function(o) { return o.user == 'barney'; });
* // => 0
*
* // The `_.matches` iteratee shorthand.
* _.findIndex(users, { 'user': 'fred', 'active': false });
* // => 1
*
* // The `_.matchesProperty` iteratee shorthand.
* _.findIndex(users, ['active', false]);
* // => 0
*
* // The `_.property` iteratee shorthand.
* _.findIndex(users, 'active');
* // => 2
*/
function findIndex(array, predicate, fromIndex) {
var length = array == null ? 0 : array.length;
if (!length) {
return -1;
}
var index = fromIndex == null ? 0 : toInteger(fromIndex);
if (index < 0) {
index = nativeMax(length + index, 0);
}
return baseFindIndex(array, baseIteratee(predicate, 3), index);
}
module.exports = findIndex;
/***/ }),
/* 281 */
/***/ (function(module, exports) {
/**
* The base implementation of `_.findIndex` and `_.findLastIndex` without
* support for iteratee shorthands.
*
* @private
* @param {Array} array The array to inspect.
* @param {Function} predicate The function invoked per iteration.
* @param {number} fromIndex The index to search from.
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function baseFindIndex(array, predicate, fromIndex, fromRight) {
var length = array.length,
index = fromIndex + (fromRight ? 1 : -1);
while ((fromRight ? index-- : ++index < length)) {
if (predicate(array[index], index, array)) {
return index;
}
}
return -1;
}
module.exports = baseFindIndex;
/***/ }),
/* 282 */
/***/ (function(module, exports, __webpack_require__) {
var toFinite = __webpack_require__(283);
/**
* Converts `value` to an integer.
*
* **Note:** This method is loosely based on
* [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to convert.
* @returns {number} Returns the converted integer.
* @example
*
* _.toInteger(3.2);
* // => 3
*
* _.toInteger(Number.MIN_VALUE);
* // => 0
*
* _.toInteger(Infinity);
* // => 1.7976931348623157e+308
*
* _.toInteger('3.2');
* // => 3
*/
function toInteger(value) {
var result = toFinite(value),
remainder = result % 1;
return result === result ? (remainder ? result - remainder : result) : 0;
}
module.exports = toInteger;
/***/ }),
/* 283 */
/***/ (function(module, exports, __webpack_require__) {
var toNumber = __webpack_require__(68);
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0,
MAX_INTEGER = 1.7976931348623157e+308;
/**
* Converts `value` to a finite number.
*
* @static
* @memberOf _
* @since 4.12.0
* @category Lang
* @param {*} value The value to convert.
* @returns {number} Returns the converted number.
* @example
*
* _.toFinite(3.2);
* // => 3.2
*
* _.toFinite(Number.MIN_VALUE);
* // => 5e-324
*
* _.toFinite(Infinity);
* // => 1.7976931348623157e+308
*
* _.toFinite('3.2');
* // => 3.2
*/
function toFinite(value) {
if (!value) {
return value === 0 ? value : 0;
}
value = toNumber(value);
if (value === INFINITY || value === -INFINITY) {
var sign = (value < 0 ? -1 : 1);
return sign * MAX_INTEGER;
}
return value === value ? value : 0;
}
module.exports = toFinite;
/***/ }),
/* 284 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
/**
* Truncates the result set based on `maxResults` and returns the new set.
*/
function getTruncatedOptions(options, maxResults) {
if (!maxResults || maxResults >= options.length) {
return options;
}
return options.slice(0, maxResults);
}
exports.default = getTruncatedOptions;
/***/ }),
/* 285 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _noop2 = __webpack_require__(56);
var _noop3 = _interopRequireDefault(_noop2);
var _isEqual2 = __webpack_require__(71);
var _isEqual3 = _interopRequireDefault(_isEqual2);
var _head2 = __webpack_require__(63);
var _head3 = _interopRequireDefault(_head2);
var _find2 = __webpack_require__(116);
var _find3 = _interopRequireDefault(_find2);
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 _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _reactOnclickoutside = __webpack_require__(109);
var _reactOnclickoutside2 = _interopRequireDefault(_reactOnclickoutside);
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _deprecated = __webpack_require__(92);
var _deprecated2 = _interopRequireDefault(_deprecated);
var _caseSensitiveType = __webpack_require__(286);
var _caseSensitiveType2 = _interopRequireDefault(_caseSensitiveType);
var _checkPropType = __webpack_require__(287);
var _checkPropType2 = _interopRequireDefault(_checkPropType);
var _highlightOnlyResultType = __webpack_require__(288);
var _highlightOnlyResultType2 = _interopRequireDefault(_highlightOnlyResultType);
var _ignoreDiacriticsType = __webpack_require__(289);
var _ignoreDiacriticsType2 = _interopRequireDefault(_ignoreDiacriticsType);
var _inputPropsType = __webpack_require__(290);
var _inputPropsType2 = _interopRequireDefault(_inputPropsType);
var _labelKeyType = __webpack_require__(291);
var _labelKeyType2 = _interopRequireDefault(_labelKeyType);
var _defaultFilterBy = __webpack_require__(292);
var _defaultFilterBy2 = _interopRequireDefault(_defaultFilterBy);
var _getOptionLabel = __webpack_require__(18);
var _getOptionLabel2 = _interopRequireDefault(_getOptionLabel);
var _keyCode = __webpack_require__(62);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
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; }
function getInitialState(props) {
var defaultSelected = props.defaultSelected,
maxResults = props.maxResults,
multiple = props.multiple;
var selected = props.selected ? props.selected.slice() : defaultSelected.slice();
// Limit to 1 selection in single-select mode.
if (!multiple && selected.length > 1) {
selected = selected.slice(0, 1);
}
return {
activeIndex: -1,
activeItem: null,
initialItem: null,
isFocused: false,
isOnlyResult: false,
selected: selected,
showMenu: false,
shownResults: maxResults,
text: ''
};
}
function typeaheadContainer(Typeahead) {
var WrappedTypeahead = function (_React$Component) {
_inherits(WrappedTypeahead, _React$Component);
function WrappedTypeahead(props) {
_classCallCheck(this, WrappedTypeahead);
var _this = _possibleConstructorReturn(this, (WrappedTypeahead.__proto__ || Object.getPrototypeOf(WrappedTypeahead)).call(this, props));
_this._getFilteredResults = function () {
var _this$props = _this.props,
caseSensitive = _this$props.caseSensitive,
filterBy = _this$props.filterBy,
ignoreDiacritics = _this$props.ignoreDiacritics,
labelKey = _this$props.labelKey,
minLength = _this$props.minLength,
multiple = _this$props.multiple,
options = _this$props.options;
var _this$state = _this.state,
selected = _this$state.selected,
text = _this$state.text;
if (text.length < minLength) {
return [];
}
var callback = Array.isArray(filterBy) ? function (option) {
return (0, _defaultFilterBy2.default)(option, text, labelKey, multiple && !!(0, _find3.default)(selected, function (o) {
return (0, _isEqual3.default)(o, option);
}), { caseSensitive: caseSensitive, ignoreDiacritics: ignoreDiacritics, fields: filterBy });
} : function (option) {
return filterBy(option, text);
};
return options.filter(callback);
};
_this.blur = function () {
_this._getInputNode().blur();
_this._hideMenu();
};
_this.clear = function () {
_this.setState(getInitialState(_this.props));
_this._updateSelected([]);
_this._updateText('');
};
_this.focus = function () {
_this._getInputNode().focus();
};
_this._getInputNode = function () {
return _this._instance.getInputNode();
};
_this._handleActiveItemChange = function (activeItem) {
_this.setState({ activeItem: activeItem });
};
_this._handleBlur = function (e) {
// Note: Don't hide the menu here, since that interferes with other
// actions like making a selection by clicking on a menu item.
_this.props.onBlur(e);
_this.setState({ isFocused: false });
};
_this._handleFocus = function (e) {
_this.props.onFocus(e);
_this.setState({
isFocused: true,
showMenu: true
});
};
_this._handleInitialItemChange = function (initialItem) {
var labelKey = _this.props.labelKey;
var currentItem = _this.state.initialItem;
// Don't update the initial item if it hasn't changed. For custom items,
// compare the `labelKey` values since a unique id is generated each time,
// causing the comparison to always return false otherwise.
if ((0, _isEqual3.default)(initialItem, currentItem) || currentItem && initialItem && initialItem.customOption && initialItem[labelKey] === currentItem[labelKey]) {
return;
}
_this.setState({ initialItem: initialItem });
};
_this._handleInputChange = function (text) {
var _getInitialState = getInitialState(_this.props),
activeIndex = _getInitialState.activeIndex,
activeItem = _getInitialState.activeItem;
_this.setState({
activeIndex: activeIndex,
activeItem: activeItem,
showMenu: true
}, function () {
// State isn't set until after `componentWillReceiveProps` in the React
// lifecycle. For the typeahead to behave correctly as a controlled
// component, we therefore have to update user-input text after the rest
// of the component has updated.
_this._updateText(text);
});
};
_this._handleInputFocus = function (e) {
var isClearButton = e && e.target && e.target.className && e.target.className.indexOf('rbt-close') !== -1;
// Don't focus the input if it's disabled or the clear button was clicked.
if (_this.props.disabled || isClearButton) {
e.target.blur();
return;
}
// Move cursor to the end if the user clicks outside the actual input.
var inputNode = _this._getInputNode();
if (e.target !== inputNode) {
inputNode.selectionStart = inputNode.value.length;
}
_this.focus();
_this.setState({ isFocused: true });
};
_this._handleKeyDown = function (options, e) {
var _this$state2 = _this.state,
activeItem = _this$state2.activeItem,
showMenu = _this$state2.showMenu;
switch (e.keyCode) {
case _keyCode.UP:
case _keyCode.DOWN:
// Don't cycle through the options if the menu is hidden.
if (!showMenu) {
break;
}
var activeIndex = _this.state.activeIndex;
// Prevents input cursor from going to the beginning when pressing up.
e.preventDefault();
// Increment or decrement index based on user keystroke.
activeIndex += e.keyCode === _keyCode.UP ? -1 : 1;
// If we've reached the end, go back to the beginning or vice-versa.
if (activeIndex === options.length) {
activeIndex = -1;
} else if (activeIndex === -2) {
activeIndex = options.length - 1;
}
var newState = { activeIndex: activeIndex };
if (activeIndex === -1) {
// Reset the active item if there is no active index.
newState.activeItem = null;
}
_this.setState(newState);
break;
case _keyCode.ESC:
case _keyCode.TAB:
// Prevent closing dialogs.
e.keyCode === _keyCode.ESC && e.preventDefault();
_this._hideMenu();
break;
case _keyCode.RETURN:
if (!showMenu) {
break;
}
var _this$state3 = _this.state,
initialItem = _this$state3.initialItem,
isOnlyResult = _this$state3.isOnlyResult;
// if menu is shown and we have active item
// there is no any sense to submit form on
if (!_this.props.submitFormOnEnter || activeItem) {
// Prevent submitting forms.
e.preventDefault();
}
if (activeItem) {
_this._handleSelectionAdd(activeItem);
break;
}
if (isOnlyResult) {
_this._handleSelectionAdd(initialItem);
break;
}
break;
}
_this.props.onKeyDown(e);
};
_this._handlePaginate = function (e) {
var _this$props2 = _this.props,
maxResults = _this$props2.maxResults,
onPaginate = _this$props2.onPaginate;
onPaginate(e);
_this.setState({ shownResults: _this.state.shownResults + maxResults });
};
_this._handleResultsChange = function (results) {
var _this$props3 = _this.props,
allowNew = _this$props3.allowNew,
highlightOnlyResult = _this$props3.highlightOnlyResult;
if (!allowNew && highlightOnlyResult) {
_this.setState({ isOnlyResult: results.length === 1 });
}
};
_this._handleSelectionAdd = function (selection) {
var _this$props4 = _this.props,
multiple = _this$props4.multiple,
labelKey = _this$props4.labelKey;
var selected = void 0;
var text = void 0;
if (multiple) {
// If multiple selections are allowed, add the new selection to the
// existing selections.
selected = _this.state.selected.concat(selection);
text = '';
} else {
// If only a single selection is allowed, replace the existing selection
// with the new one.
selected = [selection];
text = (0, _getOptionLabel2.default)(selection, labelKey);
}
_this._hideMenu();
_this._updateSelected(selected);
_this._updateText(text);
_this.setState({ initialItem: selection });
};
_this._handleSelectionRemove = function (selection) {
var selected = _this.state.selected.filter(function (option) {
return !(0, _isEqual3.default)(option, selection);
});
// Make sure the input stays focused after the item is removed.
_this.focus();
_this._hideMenu();
_this._updateSelected(selected);
};
_this.handleClickOutside = function (e) {
_this.state.showMenu && _this._hideMenu();
};
_this._hideMenu = function () {
var _getInitialState2 = getInitialState(_this.props),
activeIndex = _getInitialState2.activeIndex,
activeItem = _getInitialState2.activeItem,
showMenu = _getInitialState2.showMenu,
shownResults = _getInitialState2.shownResults;
_this.setState({
activeIndex: activeIndex,
activeItem: activeItem,
showMenu: showMenu,
shownResults: shownResults
});
};
_this._updateSelected = function (selected) {
_this.setState({ selected: selected });
_this.props.onChange(selected);
};
_this._updateText = function (text) {
_this.setState({ text: text });
_this.props.onInputChange(text);
};
_this.state = getInitialState(props);
return _this;
}
_createClass(WrappedTypeahead, [{
key: 'getChildContext',
value: function getChildContext() {
return {
activeIndex: this.state.activeIndex,
isOnlyResult: this.state.isOnlyResult,
onActiveItemChange: this._handleActiveItemChange,
onInitialItemChange: this._handleInitialItemChange,
onMenuItemClick: this._handleSelectionAdd
};
}
}, {
key: 'componentDidMount',
value: function componentDidMount() {
this.props.autoFocus && this.focus();
}
}, {
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(nextProps) {
var labelKey = nextProps.labelKey,
multiple = nextProps.multiple,
selected = nextProps.selected;
// If new selections are passed via props, treat as a controlled input.
if (selected && !(0, _isEqual3.default)(selected, this.props.selected)) {
if (!multiple) {
this._updateText(selected.length ? (0, _getOptionLabel2.default)((0, _head3.default)(selected), labelKey) : '');
}
this._updateSelected(selected);
}
// Truncate selections when in single-select mode.
var newSelected = selected || this.state.selected;
if (!multiple && newSelected.length > 1) {
newSelected = newSelected.slice(0, 1);
this._updateSelected(newSelected);
this._updateText((0, _getOptionLabel2.default)((0, _head3.default)(newSelected), labelKey));
return;
}
if (multiple !== this.props.multiple) {
this._updateText('');
}
}
}, {
key: 'render',
value: function render() {
var _this2 = this;
return _react2.default.createElement(Typeahead, _extends({}, this.props, this.state, {
onBlur: this._handleBlur,
onClear: this.clear,
onFocus: this._handleFocus,
onInitialItemChange: this._handleInitialItemChange,
onInputChange: this._handleInputChange,
onInputFocus: this._handleInputFocus,
onKeyDown: this._handleKeyDown,
onPaginate: this._handlePaginate,
onResultsChange: this._handleResultsChange,
onSelectionAdd: this._handleSelectionAdd,
onSelectionRemove: this._handleSelectionRemove,
ref: function ref(instance) {
return _this2._instance = instance;
},
results: this._getFilteredResults()
}));
}
/**
* Public method to allow external clearing of the input. Clears both text
* and selection(s).
*/
/**
* From `onClickOutside` HOC.
*/
}]);
return WrappedTypeahead;
}(_react2.default.Component);
WrappedTypeahead.displayName = 'Typeahead';
WrappedTypeahead.propTypes = {
/**
* Allows the creation of new selections on the fly. Note that any new items
* will be added to the list of selections, but not the list of original
* options unless handled as such by `Typeahead`'s parent.
*/
allowNew: _propTypes2.default.bool,
/**
* Autofocus the input when the component initially mounts.
*/
autoFocus: _propTypes2.default.bool,
/**
* Whether to render the menu inline or attach to `document.body`.
*/
bodyContainer: _propTypes2.default.bool,
/**
* Whether or not filtering should be case-sensitive.
*/
caseSensitive: (0, _checkPropType2.default)(_propTypes2.default.bool, _caseSensitiveType2.default),
/**
* Displays a button to clear the input when there are selections.
*/
clearButton: _propTypes2.default.bool,
/**
* Specify any pre-selected options. Use only if you want the component to
* be uncontrolled.
*/
defaultSelected: _propTypes2.default.array,
/**
* Whether to disable the component.
*/
disabled: _propTypes2.default.bool,
/**
* Specify whether the menu should appear above the input.
*/
dropup: _propTypes2.default.bool,
/**
* Either an array of fields in `option` to search, or a custom filtering
* callback.
*/
filterBy: _propTypes2.default.oneOfType([_propTypes2.default.arrayOf(_propTypes2.default.string.isRequired), _propTypes2.default.func]),
/**
* Highlights the menu item if there is only one result and allows selecting
* that item by hitting enter. Does not work with `allowNew`.
*/
highlightOnlyResult: (0, _checkPropType2.default)(_propTypes2.default.bool, _highlightOnlyResultType2.default),
/**
* Whether the filter should ignore accents and other diacritical marks.
*/
ignoreDiacritics: (0, _checkPropType2.default)(_propTypes2.default.bool, _ignoreDiacriticsType2.default),
/**
* Props to be applied directly to the input. `onBlur`, `onChange`,
* `onFocus`, and `onKeyDown` are ignored.
*/
inputProps: (0, _checkPropType2.default)(_propTypes2.default.object, _inputPropsType2.default),
/**
* Indicate whether an asynchromous data fetch is happening.
*/
isLoading: _propTypes2.default.bool,
/**
* Specify the option key to use for display or a function returning the
* display string. By default, the selector will use the `label` key.
*/
labelKey: (0, _checkPropType2.default)(_propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]), _labelKeyType2.default),
/**
* Maximum number of results to display by default. Mostly done for
* performance reasons so as not to render too many DOM nodes in the case of
* large data sets.
*/
maxResults: _propTypes2.default.number,
/**
* Number of input characters that must be entered before showing results.
*/
minLength: _propTypes2.default.number,
/**
* Whether or not multiple selections are allowed.
*/
multiple: _propTypes2.default.bool,
/**
* DEPRECATED. Name attribute for the input.
*/
name: (0, _deprecated2.default)(_propTypes2.default.string, 'Use `inputProps` instead'),
/**
* Invoked when the input is blurred. Receives an event.
*/
onBlur: _propTypes2.default.func,
/**
* Invoked whenever items are added or removed. Receives an array of the
* selected options.
*/
onChange: _propTypes2.default.func,
/**
* Invoked when the input is focused. Receives an event.
*/
onFocus: _propTypes2.default.func,
/**
* Invoked when the input value changes. Receives the string value of the
* input.
*/
onInputChange: _propTypes2.default.func,
/**
* Invoked when a key is pressed. Receives an event.
*/
onKeyDown: _propTypes2.default.func,
/**
* Invoked when the menu is hidden.
*/
onMenuHide: _propTypes2.default.func,
/**
* Invoked when the menu is shown.
*/
onMenuShow: _propTypes2.default.func,
/**
* Invoked when the pagination menu item is clicked. Receives an event.
*/
onPaginate: _propTypes2.default.func,
/**
* Full set of options, including pre-selected options. Must either be an
* array of objects (recommended) or strings.
*/
options: _propTypes2.default.oneOfType([_propTypes2.default.arrayOf(_propTypes2.default.object.isRequired), _propTypes2.default.arrayOf(_propTypes2.default.string.isRequired)]).isRequired,
/**
* Give user the ability to display additional results if the number of
* results exceeds `maxResults`.
*/
paginate: _propTypes2.default.bool,
/**
* Placeholder text for the input.
*/
placeholder: _propTypes2.default.string,
/**
* Callback for custom menu rendering.
*/
renderMenu: _propTypes2.default.func,
/**
* The selected option(s) displayed in the input. Use this prop if you want
* to control the component via its parent.
*/
selected: _propTypes2.default.array,
/**
* Allows selecting the hinted result by pressing enter.
*/
selectHintOnEnter: _propTypes2.default.bool,
/**
* Propagate event to parent form.
*/
submitFormOnEnter: _propTypes2.default.bool
};
WrappedTypeahead.defaultProps = {
allowNew: false,
autoFocus: false,
bodyContainer: false,
caseSensitive: false,
clearButton: false,
defaultSelected: [],
disabled: false,
dropup: false,
filterBy: [],
highlightOnlyResult: false,
ignoreDiacritics: true,
inputProps: {},
isLoading: false,
labelKey: 'label',
maxResults: 100,
minLength: 0,
multiple: false,
onBlur: _noop3.default,
onChange: _noop3.default,
onFocus: _noop3.default,
onInputChange: _noop3.default,
onKeyDown: _noop3.default,
onMenuHide: _noop3.default,
onMenuShow: _noop3.default,
onPaginate: _noop3.default,
paginate: true,
placeholder: '',
selectHintOnEnter: false,
submitFormOnEnter: false
};
WrappedTypeahead.childContextTypes = {
activeIndex: _propTypes2.default.number.isRequired,
isOnlyResult: _propTypes2.default.bool.isRequired,
onActiveItemChange: _propTypes2.default.func.isRequired,
onInitialItemChange: _propTypes2.default.func.isRequired,
onMenuItemClick: _propTypes2.default.func.isRequired
};
return (0, _reactOnclickoutside2.default)(WrappedTypeahead);
}
exports.default = typeaheadContainer;
/***/ }),
/* 286 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = caseSensitiveType;
var _warn = __webpack_require__(19);
var _warn2 = _interopRequireDefault(_warn);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function caseSensitiveType(props, propName, componentName) {
var caseSensitive = props.caseSensitive,
filterBy = props.filterBy;
(0, _warn2.default)(!caseSensitive || typeof filterBy !== 'function', 'Your `filterBy` function will override the `caseSensitive` prop.');
}
/***/ }),
/* 287 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = checkPropType;
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
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; }
/**
* Allows additional warnings or messaging related to prop validation.
*/
function checkPropType(validator, callback) {
return function (props, propName, componentName) {
_propTypes2.default.checkPropTypes(_defineProperty({}, propName, validator), props, 'prop', componentName);
typeof callback === 'function' && callback(props, propName, componentName);
};
}
/***/ }),
/* 288 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = highlightOnlyResultType;
var _warn = __webpack_require__(19);
var _warn2 = _interopRequireDefault(_warn);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function highlightOnlyResultType(props, propName, componentName) {
var allowNew = props.allowNew,
highlightOnlyResult = props.highlightOnlyResult;
(0, _warn2.default)(!(highlightOnlyResult && allowNew), '`highlightOnlyResult` will not work with `allowNew`.');
}
/***/ }),
/* 289 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = ignoreDiacriticsType;
var _warn = __webpack_require__(19);
var _warn2 = _interopRequireDefault(_warn);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function ignoreDiacriticsType(props, propName, componentName) {
var filterBy = props.filterBy,
ignoreDiacritics = props.ignoreDiacritics;
(0, _warn2.default)(ignoreDiacritics || typeof filterBy !== 'function', 'Your `filterBy` function will override the `ignoreDiacritics` prop.');
}
/***/ }),
/* 290 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isPlainObject2 = __webpack_require__(61);
var _isPlainObject3 = _interopRequireDefault(_isPlainObject2);
exports.default = inputPropsType;
var _warn = __webpack_require__(19);
var _warn2 = _interopRequireDefault(_warn);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var BLACKLIST = [{ alt: 'onBlur', prop: 'onBlur' }, { alt: 'onInputChange', prop: 'onChange' }, { alt: 'onFocus', prop: 'onFocus' }, { alt: 'onKeyDown', prop: 'onKeyDown' }];
function inputPropsType(props, propName, componentName) {
var inputProps = props.inputProps;
if (!(inputProps && (0, _isPlainObject3.default)(inputProps))) {
return;
}
// Blacklisted properties.
BLACKLIST.forEach(function (_ref) {
var alt = _ref.alt,
prop = _ref.prop;
var msg = alt ? ' Use the top-level `' + alt + '` prop instead.' : null;
(0, _warn2.default)(!inputProps.hasOwnProperty(prop), 'The `' + prop + '` property of `inputProps` will be ignored.' + msg);
});
}
/***/ }),
/* 291 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = labelKeyType;
var _warn = __webpack_require__(19);
var _warn2 = _interopRequireDefault(_warn);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function labelKeyType(props, propName, componentName) {
var allowNew = props.allowNew,
labelKey = props.labelKey;
(0, _warn2.default)(!(typeof labelKey === 'function' && allowNew), '`labelKey` must be a string when `allowNew={true}`.');
}
/***/ }),
/* 292 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _some2 = __webpack_require__(293);
var _some3 = _interopRequireDefault(_some2);
var _isFunction2 = __webpack_require__(42);
var _isFunction3 = _interopRequireDefault(_isFunction2);
exports.default = defaultFilterBy;
var _stripDiacritics = __webpack_require__(112);
var _stripDiacritics2 = _interopRequireDefault(_stripDiacritics);
var _warn = __webpack_require__(19);
var _warn2 = _interopRequireDefault(_warn);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function isMatch(input, string, _ref) {
var caseSensitive = _ref.caseSensitive,
ignoreDiacritics = _ref.ignoreDiacritics;
if (!caseSensitive) {
input = input.toLowerCase();
string = string.toLowerCase();
}
if (ignoreDiacritics) {
input = (0, _stripDiacritics2.default)(input);
string = (0, _stripDiacritics2.default)(string);
}
return string.indexOf(input) !== -1;
}
/**
* Default algorithm for filtering results.
*/
function defaultFilterBy(option, text, labelKey, isTokenized, filterOptions) {
// Don't show selected options in the menu for the multi-select case.
if (isTokenized) {
return false;
}
var fields = filterOptions.fields.slice();
if ((0, _isFunction3.default)(labelKey) && isMatch(text, labelKey(option), filterOptions)) {
return true;
}
if (typeof labelKey === 'string') {
// Add the `labelKey` field to the list of fields if it isn't already there.
if (fields.indexOf(labelKey) === -1) {
fields.unshift(labelKey);
}
}
if (typeof option === 'string') {
(0, _warn2.default)(fields.length <= 1, 'You cannot filter by properties when `option` is a string.');
return isMatch(text, option, filterOptions);
}
return (0, _some3.default)(fields, function (field) {
var value = option[field];
if (typeof value !== 'string') {
(0, _warn2.default)(false, 'Fields passed to `filterBy` should have string values. Value will ' + 'be converted to a string; results may be unexpected.');
// Coerce to string since `toString` isn't null-safe.
value = value + '';
}
return isMatch(text, value, filterOptions);
});
}
/***/ }),
/* 293 */
/***/ (function(module, exports, __webpack_require__) {
var arraySome = __webpack_require__(74),
baseIteratee = __webpack_require__(65),
baseSome = __webpack_require__(294),
isArray = __webpack_require__(6),
isIterateeCall = __webpack_require__(300);
/**
* Checks if `predicate` returns truthy for **any** element of `collection`.
* Iteration is stopped once `predicate` returns truthy. The predicate is
* invoked with three arguments: (value, index|key, collection).
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {boolean} Returns `true` if any element passes the predicate check,
* else `false`.
* @example
*
* _.some([null, 0, 'yes', false], Boolean);
* // => true
*
* var users = [
* { 'user': 'barney', 'active': true },
* { 'user': 'fred', 'active': false }
* ];
*
* // The `_.matches` iteratee shorthand.
* _.some(users, { 'user': 'barney', 'active': false });
* // => false
*
* // The `_.matchesProperty` iteratee shorthand.
* _.some(users, ['active', false]);
* // => true
*
* // The `_.property` iteratee shorthand.
* _.some(users, 'active');
* // => true
*/
function some(collection, predicate, guard) {
var func = isArray(collection) ? arraySome : baseSome;
if (guard && isIterateeCall(collection, predicate, guard)) {
predicate = undefined;
}
return func(collection, baseIteratee(predicate, 3));
}
module.exports = some;
/***/ }),
/* 294 */
/***/ (function(module, exports, __webpack_require__) {
var baseEach = __webpack_require__(295);
/**
* The base implementation of `_.some` without support for iteratee shorthands.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {boolean} Returns `true` if any element passes the predicate check,
* else `false`.
*/
function baseSome(collection, predicate) {
var result;
baseEach(collection, function(value, index, collection) {
result = predicate(value, index, collection);
return !result;
});
return !!result;
}
module.exports = baseSome;
/***/ }),
/* 295 */
/***/ (function(module, exports, __webpack_require__) {
var baseForOwn = __webpack_require__(296),
createBaseEach = __webpack_require__(299);
/**
* The base implementation of `_.forEach` without support for iteratee shorthands.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array|Object} Returns `collection`.
*/
var baseEach = createBaseEach(baseForOwn);
module.exports = baseEach;
/***/ }),
/* 296 */
/***/ (function(module, exports, __webpack_require__) {
var baseFor = __webpack_require__(297),
keys = __webpack_require__(14);
/**
* The base implementation of `_.forOwn` without support for iteratee shorthands.
*
* @private
* @param {Object} object The object to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Object} Returns `object`.
*/
function baseForOwn(object, iteratee) {
return object && baseFor(object, iteratee, keys);
}
module.exports = baseForOwn;
/***/ }),
/* 297 */
/***/ (function(module, exports, __webpack_require__) {
var createBaseFor = __webpack_require__(298);
/**
* The base implementation of `baseForOwn` which iterates over `object`
* properties returned by `keysFunc` and invokes `iteratee` for each property.
* Iteratee functions may exit iteration early by explicitly returning `false`.
*
* @private
* @param {Object} object The object to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @param {Function} keysFunc The function to get the keys of `object`.
* @returns {Object} Returns `object`.
*/
var baseFor = createBaseFor();
module.exports = baseFor;
/***/ }),
/* 298 */
/***/ (function(module, exports) {
/**
* Creates a base function for methods like `_.forIn` and `_.forOwn`.
*
* @private
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {Function} Returns the new base function.
*/
function createBaseFor(fromRight) {
return function(object, iteratee, keysFunc) {
var index = -1,
iterable = Object(object),
props = keysFunc(object),
length = props.length;
while (length--) {
var key = props[fromRight ? length : ++index];
if (iteratee(iterable[key], key, iterable) === false) {
break;
}
}
return object;
};
}
module.exports = createBaseFor;
/***/ }),
/* 299 */
/***/ (function(module, exports, __webpack_require__) {
var isArrayLike = __webpack_require__(20);
/**
* Creates a `baseEach` or `baseEachRight` function.
*
* @private
* @param {Function} eachFunc The function to iterate over a collection.
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {Function} Returns the new base function.
*/
function createBaseEach(eachFunc, fromRight) {
return function(collection, iteratee) {
if (collection == null) {
return collection;
}
if (!isArrayLike(collection)) {
return eachFunc(collection, iteratee);
}
var length = collection.length,
index = fromRight ? length : -1,
iterable = Object(collection);
while ((fromRight ? index-- : ++index < length)) {
if (iteratee(iterable[index], index, iterable) === false) {
break;
}
}
return collection;
};
}
module.exports = createBaseEach;
/***/ }),
/* 300 */
/***/ (function(module, exports, __webpack_require__) {
var eq = __webpack_require__(29),
isArrayLike = __webpack_require__(20),
isIndex = __webpack_require__(32),
isObject = __webpack_require__(7);
/**
* Checks if the given arguments are from an iteratee call.
*
* @private
* @param {*} value The potential iteratee value argument.
* @param {*} index The potential iteratee index or key argument.
* @param {*} object The potential iteratee object argument.
* @returns {boolean} Returns `true` if the arguments are from an iteratee call,
* else `false`.
*/
function isIterateeCall(value, index, object) {
if (!isObject(object)) {
return false;
}
var type = typeof index;
if (type == 'number'
? (isArrayLike(object) && isIndex(index, object.length))
: (type == 'string' && index in object)
) {
return eq(object[index], value);
}
return false;
}
module.exports = isIterateeCall;
/***/ })
/******/ ]);
});