diff --git a/dist/index.js b/dist/index.js index e85b0493..f61309e2 100644 --- a/dist/index.js +++ b/dist/index.js @@ -70,7 +70,7 @@ return /******/ (function(modules) { // webpackBootstrap /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 8); +/******/ return __webpack_require__(__webpack_require__.s = 17); /******/ }) /************************************************************************/ /******/ ([ @@ -267,6 +267,48 @@ process.umask = function() { return 0; }; /* 1 */ /***/ (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; + +/***/ }), +/* 2 */ +/***/ (function(module, exports, __webpack_require__) { + "use strict"; /* object-assign @@ -361,7 +403,137 @@ module.exports = shouldUseNative() ? Object.assign : function (target, source) { /***/ }), -/* 2 */ +/* 3 */ +/***/ (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__(0))) + +/***/ }), +/* 4 */, +/* 5 */ +/***/ (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__(1); + +/** + * 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__(0))) + +/***/ }), +/* 6 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -371,6 +543,9 @@ Object.defineProperty(exports, "__esModule", { value: true }); var _arguments = arguments; + +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 oneEvent = function oneEvent(target, eventType, callback) { var wrappedCallback = function wrappedCallback(eventObject) { target.removeEventListener(eventType, wrappedCallback); @@ -410,9 +585,22 @@ var setHalfPointsOnOrigin = function setHalfPointsOnOrigin(origin) { }); }; +var getWindow = function getWindow() { + if (typeof window === 'undefined' ? 'undefined' : _typeof(window)) { + return window; + } + + return { + innerHeight: 0, + innerWidth: 0, + addEventListener: function addEventListener() {}, + removeEventListener: function removeEventListener() {} + }; +}; + var getWindowOrigin = function getWindowOrigin() { - var height = window.innerHeight; - var width = window.innerWidth; + var height = getWindow().innerHeight; + var width = getWindow().innerWidth; var origin = { bottom: height, @@ -538,24 +726,25 @@ exports.whichTransitionEvent = whichTransitionEvent; exports.getScrollParent = getScrollParent; exports.toggleClassesOnElement = toggleClassesOnElement; exports.generateOptionClassnames = generateOptionClassnames; +exports.getWindow = getWindow; /***/ }), -/* 3 */ +/* 7 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(process) { if (process.env.NODE_ENV === 'production') { - module.exports = __webpack_require__(24); + module.exports = __webpack_require__(33); } else { - module.exports = __webpack_require__(25); + module.exports = __webpack_require__(34); } /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), -/* 4 */ +/* 8 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -568,24 +757,11 @@ if (process.env.NODE_ENV === 'production') { -var printWarning = function() {}; - if (process.env.NODE_ENV !== 'production') { - var ReactPropTypesSecret = __webpack_require__(5); + var invariant = __webpack_require__(3); + var warning = __webpack_require__(5); + var ReactPropTypesSecret = __webpack_require__(9); var loggedTypeFailures = {}; - - printWarning = function(text) { - var message = 'Warning: ' + text; - 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) {} - }; } /** @@ -610,29 +786,12 @@ function checkPropTypes(typeSpecs, values, location, componentName, getStack) { try { // This is intentionally an invariant that gets caught. It's the same // behavior as without this statement except with a better message. - if (typeof typeSpecs[typeSpecName] !== 'function') { - var err = Error( - (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + - 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' - ); - err.name = 'Invariant Violation'; - throw err; - } + 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; } - if (error && !(error instanceof Error)) { - printWarning( - (componentName || 'React class') + ': type specification of ' + - location + ' `' + typeSpecName + '` is invalid; the type checker ' + - 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' + - 'You may have forgotten to pass an argument to the type checker ' + - 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + - 'shape all require an argument).' - ) - - } + 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. @@ -640,9 +799,7 @@ function checkPropTypes(typeSpecs, values, location, componentName, getStack) { var stack = getStack ? getStack() : ''; - printWarning( - 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '') - ); + warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : ''); } } } @@ -654,7 +811,7 @@ module.exports = checkPropTypes; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), -/* 5 */ +/* 9 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -673,7 +830,7 @@ module.exports = ReactPropTypesSecret; /***/ }), -/* 6 */ +/* 10 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -685,19 +842,19 @@ Object.defineProperty(exports, "__esModule", { 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; }; }(); -__webpack_require__(9); +__webpack_require__(18); -var _renderer = __webpack_require__(10); +var _renderer = __webpack_require__(19); var _renderer2 = _interopRequireDefault(_renderer); -var _positioner = __webpack_require__(12); +var _positioner = __webpack_require__(21); var _positioner2 = _interopRequireDefault(_positioner); -var _utils = __webpack_require__(2); +var _utils = __webpack_require__(6); -__webpack_require__(18); +__webpack_require__(27); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -866,27 +1023,18 @@ var Popoverjs = function () { return Popoverjs; }(); -window.Popoverjs = Popoverjs; +(0, _utils.getWindow)().Popoverjs = Popoverjs; exports.default = Popoverjs; /***/ }), -/* 7 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) { - -if (process.env.NODE_ENV === 'production') { - module.exports = __webpack_require__(29); -} else { - module.exports = __webpack_require__(30); -} - -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) - -/***/ }), -/* 8 */ +/* 11 */, +/* 12 */, +/* 13 */, +/* 14 */, +/* 15 */, +/* 16 */, +/* 17 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -897,11 +1045,11 @@ Object.defineProperty(exports, "__esModule", { }); exports.PopoverjsReact = undefined; -var _popover = __webpack_require__(6); +var _popover = __webpack_require__(10); var _popover2 = _interopRequireDefault(_popover); -var _react = __webpack_require__(23); +var _react = __webpack_require__(32); var _react2 = _interopRequireDefault(_react); @@ -911,7 +1059,7 @@ exports.default = _popover2.default; exports.PopoverjsReact = _react2.default; /***/ }), -/* 9 */ +/* 18 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1260,7 +1408,7 @@ if ("document" in self) { } /***/ }), -/* 10 */ +/* 19 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1272,11 +1420,11 @@ Object.defineProperty(exports, "__esModule", { 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 _pointInPolygon = __webpack_require__(11); +var _pointInPolygon = __webpack_require__(20); var _pointInPolygon2 = _interopRequireDefault(_pointInPolygon); -var _utils = __webpack_require__(2); +var _utils = __webpack_require__(6); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -1748,7 +1896,7 @@ var Renderer = function () { exports.default = Renderer; /***/ }), -/* 11 */ +/* 20 */ /***/ (function(module, exports) { module.exports = function (point, vs) { @@ -1772,7 +1920,7 @@ module.exports = function (point, vs) { /***/ }), -/* 12 */ +/* 21 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1784,11 +1932,11 @@ Object.defineProperty(exports, "__esModule", { 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 _documentOffset = __webpack_require__(13); +var _documentOffset = __webpack_require__(22); var _documentOffset2 = _interopRequireDefault(_documentOffset); -var _utils = __webpack_require__(2); +var _utils = __webpack_require__(6); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -1963,7 +2111,7 @@ var Positioner = function () { }, { key: 'cacheCssOffsets', value: function cacheCssOffsets() { - var bodyStyle = window.getComputedStyle(document.body); + var bodyStyle = (0, _utils.getWindow)().getComputedStyle(document.body); this.toggleSizerClasses(true); @@ -2121,7 +2269,7 @@ var Positioner = function () { if (!this.options.resizePositioning) { return; } - window.addEventListener('resize', this.onDomEvent); + (0, _utils.getWindow)().addEventListener('resize', this.onDomEvent); } }, { key: 'listenForScroll', @@ -2129,7 +2277,7 @@ var Positioner = function () { if (!this.options.scrollPositioning) { return; } - window.addEventListener('scroll', this.onDomEvent); + (0, _utils.getWindow)().addEventListener('scroll', this.onDomEvent); this.scrollParent = this.getScrollParent(); if (this.scrollParent) { @@ -2139,8 +2287,8 @@ var Positioner = function () { }, { key: 'destroyListeners', value: function destroyListeners() { - window.removeEventListener('resize', this.onDomEvent); - window.removeEventListener('scroll', this.onDomEvent); + (0, _utils.getWindow)().removeEventListener('resize', this.onDomEvent); + (0, _utils.getWindow)().removeEventListener('scroll', this.onDomEvent); if (this.scrollParent) { this.scrollParent.removeEventListener('scroll', this.onDomEvent); @@ -2449,12 +2597,12 @@ var Positioner = function () { exports.default = Positioner; /***/ }), -/* 13 */ +/* 22 */ /***/ (function(module, exports, __webpack_require__) { -var support = __webpack_require__(14) -var getDocument = __webpack_require__(16) -var withinElement = __webpack_require__(17) +var support = __webpack_require__(23) +var getDocument = __webpack_require__(25) +var withinElement = __webpack_require__(26) /** * Get offset of a DOM Element or Range within the document. @@ -2529,10 +2677,10 @@ function bodyOffset(body) { /***/ }), -/* 14 */ +/* 23 */ /***/ (function(module, exports, __webpack_require__) { -var domready = __webpack_require__(15) +var domready = __webpack_require__(24) module.exports = (function() { @@ -2803,7 +2951,7 @@ module.exports = (function() { /***/ }), -/* 15 */ +/* 24 */ /***/ (function(module, exports, __webpack_require__) { /*! @@ -2839,7 +2987,7 @@ module.exports = (function() { /***/ }), -/* 16 */ +/* 25 */ /***/ (function(module, exports) { @@ -2902,7 +3050,7 @@ function getDocument(node) { /***/ }), -/* 17 */ +/* 26 */ /***/ (function(module, exports) { @@ -2934,13 +3082,13 @@ module.exports = function within (child, parent) { /***/ }), -/* 18 */ +/* 27 */ /***/ (function(module, exports, __webpack_require__) { // style-loader: Adds some css to the DOM by adding a