react-popper
Advanced tools
Comparing version 1.3.3 to 1.3.4
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('popper.js')) : | ||
typeof define === 'function' && define.amd ? define(['exports', 'react', 'popper.js'], factory) : | ||
(factory((global.ReactPopper = {}),global.React,global.Popper)); | ||
}(this, (function (exports,React,PopperJS) { 'use strict'; | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('create-react-context'), require('popper.js'), require('warning')) : | ||
typeof define === 'function' && define.amd ? define(['exports', 'react', 'create-react-context', 'popper.js', 'warning'], factory) : | ||
(factory((global.ReactPopper = {}),global.React,null,global.Popper,null)); | ||
}(this, (function (exports,React,createContext,PopperJS,warning) { 'use strict'; | ||
var React__default = 'default' in React ? React['default'] : React; | ||
createContext = createContext && createContext.hasOwnProperty('default') ? createContext['default'] : createContext; | ||
PopperJS = PopperJS && PopperJS.hasOwnProperty('default') ? PopperJS['default'] : PopperJS; | ||
warning = warning && warning.hasOwnProperty('default') ? warning['default'] : warning; | ||
@@ -72,1076 +73,2 @@ function _defineProperty(obj, key, value) { | ||
var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; | ||
function unwrapExports (x) { | ||
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; | ||
} | ||
function createCommonjsModule(fn, module) { | ||
return module = { exports: {} }, fn(module, module.exports), module.exports; | ||
} | ||
/* | ||
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; | ||
} | ||
} | ||
var objectAssign = 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; | ||
}; | ||
/** | ||
* 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'; | ||
var ReactPropTypesSecret_1 = ReactPropTypesSecret; | ||
var printWarning = function() {}; | ||
{ | ||
var ReactPropTypesSecret$1 = ReactPropTypesSecret_1; | ||
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) {} | ||
}; | ||
} | ||
/** | ||
* 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) { | ||
{ | ||
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. | ||
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; | ||
} | ||
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret$1); | ||
} 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).' | ||
); | ||
} | ||
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() : ''; | ||
printWarning( | ||
'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '') | ||
); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
var checkPropTypes_1 = checkPropTypes; | ||
var printWarning$1 = function() {}; | ||
{ | ||
printWarning$1 = 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) {} | ||
}; | ||
} | ||
function emptyFunctionThatReturnsNull() { | ||
return null; | ||
} | ||
var factoryWithTypeCheckers = 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 = '<<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) { | ||
{ | ||
var manualPropTypeCallCache = {}; | ||
var manualPropTypeWarningCount = 0; | ||
} | ||
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { | ||
componentName = componentName || ANONYMOUS; | ||
propFullName = propFullName || propName; | ||
if (secret !== ReactPropTypesSecret_1) { | ||
if (throwOnDirectAccess) { | ||
// New behavior only for users of `prop-types` package | ||
var err = new Error( | ||
'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' | ||
); | ||
err.name = 'Invariant Violation'; | ||
throw err; | ||
} else if (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 | ||
) { | ||
printWarning$1( | ||
'You are manually calling a React.PropTypes validation ' + | ||
'function for the `' + propFullName + '` prop on `' + componentName + '`. 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.' | ||
); | ||
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(emptyFunctionThatReturnsNull); | ||
} | ||
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_1); | ||
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)) { | ||
printWarning$1('Invalid argument supplied to oneOf, expected an instance of array.'); | ||
return emptyFunctionThatReturnsNull; | ||
} | ||
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_1); | ||
if (error instanceof Error) { | ||
return error; | ||
} | ||
} | ||
} | ||
return null; | ||
} | ||
return createChainableTypeChecker(validate); | ||
} | ||
function createUnionTypeChecker(arrayOfTypeCheckers) { | ||
if (!Array.isArray(arrayOfTypeCheckers)) { | ||
printWarning$1('Invalid argument supplied to oneOfType, expected an instance of array.'); | ||
return emptyFunctionThatReturnsNull; | ||
} | ||
for (var i = 0; i < arrayOfTypeCheckers.length; i++) { | ||
var checker = arrayOfTypeCheckers[i]; | ||
if (typeof checker !== 'function') { | ||
printWarning$1( | ||
'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + | ||
'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.' | ||
); | ||
return emptyFunctionThatReturnsNull; | ||
} | ||
} | ||
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_1) == 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_1); | ||
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 = objectAssign({}, 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_1); | ||
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_1; | ||
ReactPropTypes.PropTypes = ReactPropTypes; | ||
return ReactPropTypes; | ||
}; | ||
var propTypes = createCommonjsModule(function (module) { | ||
/** | ||
* 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_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 = factoryWithTypeCheckers(isValidElement, throwOnDirectAccess); | ||
} | ||
}); | ||
var key = '__global_unique_id__'; | ||
var gud = function() { | ||
return commonjsGlobal[key] = (commonjsGlobal[key] || 0) + 1; | ||
}; | ||
/** | ||
* 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$1 = function emptyFunction() {}; | ||
emptyFunction$1.thatReturns = makeEmptyFunction; | ||
emptyFunction$1.thatReturnsFalse = makeEmptyFunction(false); | ||
emptyFunction$1.thatReturnsTrue = makeEmptyFunction(true); | ||
emptyFunction$1.thatReturnsNull = makeEmptyFunction(null); | ||
emptyFunction$1.thatReturnsThis = function () { | ||
return this; | ||
}; | ||
emptyFunction$1.thatReturnsArgument = function (arg) { | ||
return arg; | ||
}; | ||
var emptyFunction_1 = emptyFunction$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_1; | ||
{ | ||
var printWarning$2 = 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$2.apply(undefined, [format].concat(args)); | ||
} | ||
}; | ||
} | ||
var warning_1 = warning; | ||
var implementation = createCommonjsModule(function (module, exports) { | ||
exports.__esModule = true; | ||
var _react2 = _interopRequireDefault(React__default); | ||
var _propTypes2 = _interopRequireDefault(propTypes); | ||
var _gud2 = _interopRequireDefault(gud); | ||
var _warning2 = _interopRequireDefault(warning_1); | ||
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 MAX_SIGNED_31_BIT_INT = 1073741823; | ||
// Inlined Object.is polyfill. | ||
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is | ||
function objectIs(x, y) { | ||
if (x === y) { | ||
return x !== 0 || 1 / x === 1 / y; | ||
} else { | ||
return x !== x && y !== y; | ||
} | ||
} | ||
function createEventEmitter(value) { | ||
var handlers = []; | ||
return { | ||
on: function on(handler) { | ||
handlers.push(handler); | ||
}, | ||
off: function off(handler) { | ||
handlers = handlers.filter(function (h) { | ||
return h !== handler; | ||
}); | ||
}, | ||
get: function get() { | ||
return value; | ||
}, | ||
set: function set(newValue, changedBits) { | ||
value = newValue; | ||
handlers.forEach(function (handler) { | ||
return handler(value, changedBits); | ||
}); | ||
} | ||
}; | ||
} | ||
function onlyChild(children) { | ||
return Array.isArray(children) ? children[0] : children; | ||
} | ||
function createReactContext(defaultValue, calculateChangedBits) { | ||
var _Provider$childContex, _Consumer$contextType; | ||
var contextProp = '__create-react-context-' + (0, _gud2.default)() + '__'; | ||
var Provider = function (_Component) { | ||
_inherits(Provider, _Component); | ||
function Provider() { | ||
var _temp, _this, _ret; | ||
_classCallCheck(this, Provider); | ||
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.emitter = createEventEmitter(_this.props.value), _temp), _possibleConstructorReturn(_this, _ret); | ||
} | ||
Provider.prototype.getChildContext = function getChildContext() { | ||
var _ref; | ||
return _ref = {}, _ref[contextProp] = this.emitter, _ref; | ||
}; | ||
Provider.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { | ||
if (this.props.value !== nextProps.value) { | ||
var oldValue = this.props.value; | ||
var newValue = nextProps.value; | ||
var changedBits = void 0; | ||
if (objectIs(oldValue, newValue)) { | ||
changedBits = 0; // No change | ||
} else { | ||
changedBits = typeof calculateChangedBits === 'function' ? calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT; | ||
{ | ||
(0, _warning2.default)((changedBits & MAX_SIGNED_31_BIT_INT) === changedBits, 'calculateChangedBits: Expected the return value to be a ' + '31-bit integer. Instead received: %s', changedBits); | ||
} | ||
changedBits |= 0; | ||
if (changedBits !== 0) { | ||
this.emitter.set(nextProps.value, changedBits); | ||
} | ||
} | ||
} | ||
}; | ||
Provider.prototype.render = function render() { | ||
return this.props.children; | ||
}; | ||
return Provider; | ||
}(React__default.Component); | ||
Provider.childContextTypes = (_Provider$childContex = {}, _Provider$childContex[contextProp] = _propTypes2.default.object.isRequired, _Provider$childContex); | ||
var Consumer = function (_Component2) { | ||
_inherits(Consumer, _Component2); | ||
function Consumer() { | ||
var _temp2, _this2, _ret2; | ||
_classCallCheck(this, Consumer); | ||
for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { | ||
args[_key2] = arguments[_key2]; | ||
} | ||
return _ret2 = (_temp2 = (_this2 = _possibleConstructorReturn(this, _Component2.call.apply(_Component2, [this].concat(args))), _this2), _this2.state = { | ||
value: _this2.getValue() | ||
}, _this2.onUpdate = function (newValue, changedBits) { | ||
var observedBits = _this2.observedBits | 0; | ||
if ((observedBits & changedBits) !== 0) { | ||
_this2.setState({ value: _this2.getValue() }); | ||
} | ||
}, _temp2), _possibleConstructorReturn(_this2, _ret2); | ||
} | ||
Consumer.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { | ||
var observedBits = nextProps.observedBits; | ||
this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT // Subscribe to all changes by default | ||
: observedBits; | ||
}; | ||
Consumer.prototype.componentDidMount = function componentDidMount() { | ||
if (this.context[contextProp]) { | ||
this.context[contextProp].on(this.onUpdate); | ||
} | ||
var observedBits = this.props.observedBits; | ||
this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT // Subscribe to all changes by default | ||
: observedBits; | ||
}; | ||
Consumer.prototype.componentWillUnmount = function componentWillUnmount() { | ||
if (this.context[contextProp]) { | ||
this.context[contextProp].off(this.onUpdate); | ||
} | ||
}; | ||
Consumer.prototype.getValue = function getValue() { | ||
if (this.context[contextProp]) { | ||
return this.context[contextProp].get(); | ||
} else { | ||
return defaultValue; | ||
} | ||
}; | ||
Consumer.prototype.render = function render() { | ||
return onlyChild(this.props.children)(this.state.value); | ||
}; | ||
return Consumer; | ||
}(React__default.Component); | ||
Consumer.contextTypes = (_Consumer$contextType = {}, _Consumer$contextType[contextProp] = _propTypes2.default.object, _Consumer$contextType); | ||
return { | ||
Provider: Provider, | ||
Consumer: Consumer | ||
}; | ||
} | ||
exports.default = createReactContext; | ||
module.exports = exports['default']; | ||
}); | ||
unwrapExports(implementation); | ||
var lib = createCommonjsModule(function (module, exports) { | ||
exports.__esModule = true; | ||
var _react2 = _interopRequireDefault(React__default); | ||
var _implementation2 = _interopRequireDefault(implementation); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
exports.default = _react2.default.createContext || _implementation2.default; | ||
module.exports = exports['default']; | ||
}); | ||
var createContext = unwrapExports(lib); | ||
var ManagerContext = createContext({ | ||
@@ -1162,3 +89,3 @@ setReferenceNode: undefined, | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "setReferenceNode", function (referenceNode) { | ||
_defineProperty(_assertThisInitialized(_this), "setReferenceNode", function (referenceNode) { | ||
if (!referenceNode || _this.state.context.referenceNode === referenceNode) { | ||
@@ -1242,3 +169,3 @@ return; | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "state", { | ||
_defineProperty(_assertThisInitialized(_this), "state", { | ||
data: undefined, | ||
@@ -1248,9 +175,9 @@ placement: undefined | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "popperInstance", void 0); | ||
_defineProperty(_assertThisInitialized(_this), "popperInstance", void 0); | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "popperNode", null); | ||
_defineProperty(_assertThisInitialized(_this), "popperNode", null); | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "arrowNode", null); | ||
_defineProperty(_assertThisInitialized(_this), "arrowNode", null); | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "setPopperNode", function (popperNode) { | ||
_defineProperty(_assertThisInitialized(_this), "setPopperNode", function (popperNode) { | ||
if (!popperNode || _this.popperNode === popperNode) return; | ||
@@ -1263,7 +190,7 @@ safeInvoke(_this.props.innerRef, popperNode); | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "setArrowNode", function (arrowNode) { | ||
_defineProperty(_assertThisInitialized(_this), "setArrowNode", function (arrowNode) { | ||
_this.arrowNode = arrowNode; | ||
}); | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "updateStateModifier", { | ||
_defineProperty(_assertThisInitialized(_this), "updateStateModifier", { | ||
enabled: true, | ||
@@ -1283,3 +210,3 @@ order: 900, | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "getOptions", function () { | ||
_defineProperty(_assertThisInitialized(_this), "getOptions", function () { | ||
return { | ||
@@ -1302,3 +229,3 @@ placement: _this.props.placement, | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "getPopperStyle", function () { | ||
_defineProperty(_assertThisInitialized(_this), "getPopperStyle", function () { | ||
return !_this.popperNode || !_this.state.data ? initialStyle : _extends({ | ||
@@ -1309,15 +236,15 @@ position: _this.state.data.offsets.popper.position | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "getPopperPlacement", function () { | ||
_defineProperty(_assertThisInitialized(_this), "getPopperPlacement", function () { | ||
return !_this.state.data ? undefined : _this.state.placement; | ||
}); | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "getArrowStyle", function () { | ||
_defineProperty(_assertThisInitialized(_this), "getArrowStyle", function () { | ||
return !_this.arrowNode || !_this.state.data ? initialArrowStyle : _this.state.data.arrowStyles; | ||
}); | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "getOutOfBoundariesState", function () { | ||
_defineProperty(_assertThisInitialized(_this), "getOutOfBoundariesState", function () { | ||
return _this.state.data ? _this.state.data.hide : undefined; | ||
}); | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "destroyPopperInstance", function () { | ||
_defineProperty(_assertThisInitialized(_this), "destroyPopperInstance", function () { | ||
if (!_this.popperInstance) return; | ||
@@ -1330,6 +257,6 @@ | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "updatePopperInstance", function () { | ||
_defineProperty(_assertThisInitialized(_this), "updatePopperInstance", function () { | ||
_this.destroyPopperInstance(); | ||
var _assertThisInitialize = _assertThisInitialized(_assertThisInitialized(_this)), | ||
var _assertThisInitialize = _assertThisInitialized(_this), | ||
popperNode = _assertThisInitialize.popperNode; | ||
@@ -1342,3 +269,3 @@ | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "scheduleUpdate", function () { | ||
_defineProperty(_assertThisInitialized(_this), "scheduleUpdate", function () { | ||
if (_this.popperInstance) { | ||
@@ -1413,54 +340,2 @@ _this.popperInstance.scheduleUpdate(); | ||
/** | ||
* 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 warning$1 = function() {}; | ||
{ | ||
var printWarning$3 = function printWarning(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]; | ||
} | ||
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$1 = 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 (!condition) { | ||
printWarning$3.apply(null, [format].concat(args)); | ||
} | ||
}; | ||
} | ||
var warning_1$1 = warning$1; | ||
var InnerReference = | ||
@@ -1480,3 +355,3 @@ /*#__PURE__*/ | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "refHandler", function (node) { | ||
_defineProperty(_assertThisInitialized(_this), "refHandler", function (node) { | ||
safeInvoke(_this.props.innerRef, node); | ||
@@ -1491,4 +366,8 @@ safeInvoke(_this.props.setReferenceNode, node); | ||
_proto.componentWillUnmount = function componentWillUnmount() { | ||
safeInvoke(this.props.innerRef, null); | ||
}; | ||
_proto.render = function render() { | ||
warning_1$1(Boolean(this.props.setReferenceNode), '`Reference` should not be used outside of a `Manager` component.'); | ||
warning(Boolean(this.props.setReferenceNode), '`Reference` should not be used outside of a `Manager` component.'); | ||
return unwrapArray(this.props.children)({ | ||
@@ -1495,0 +374,0 @@ ref: this.refHandler |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("popper.js")):"function"==typeof define&&define.amd?define(["exports","react","popper.js"],t):t(e.ReactPopper={},e.React,e.Popper)}(this,function(e,o,p){"use strict";var d="default"in o?o.default:o;function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function n(e,t){e.prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}p=p&&p.hasOwnProperty("default")?p.default:p;var t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function c(e,t){return e(t={exports:{}},t.exports),t.exports}var u=Object.getOwnPropertySymbols,f=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable;(function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}})()&&Object.assign;function h(){}var y=c(function(e){e.exports=function(){function e(e,t,n,r,o,p){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==p){var a=new Error("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");throw a.name="Invariant Violation",a}}function t(){return e}var n={array:e.isRequired=e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=h,n.PropTypes=n}()}),v="__global_unique_id__",m=function(){return t[v]=(t[v]||0)+1};function b(e){return function(){return e}}var g=function(){};g.thatReturns=b,g.thatReturnsFalse=b(!1),g.thatReturnsTrue=b(!0),g.thatReturnsNull=b(null),g.thatReturnsThis=function(){return this},g.thatReturnsArgument=function(e){return e};var O=g,w=c(function(e,t){t.__esModule=!0;n(d);var i=n(y),s=n(m);n(O);function n(e){return e&&e.__esModule?e:{default:e}}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function f(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l=1073741823;t.default=function(e,a){var t,n,r="__create-react-context-"+(0,s.default)()+"__",o=function(i){function s(){var e,t,n,r;c(this,s);for(var o=arguments.length,p=Array(o),a=0;a<o;a++)p[a]=arguments[a];return(e=t=u(this,i.call.apply(i,[this].concat(p)))).emitter=(n=t.props.value,r=[],{on:function(e){r.push(e)},off:function(t){r=r.filter(function(e){return e!==t})},get:function(){return n},set:function(e,t){n=e,r.forEach(function(e){return e(n,t)})}}),u(t,e)}return f(s,i),s.prototype.getChildContext=function(){var e;return(e={})[r]=this.emitter,e},s.prototype.componentWillReceiveProps=function(e){if(this.props.value!==e.value){var t=this.props.value,n=e.value,r=void 0;((o=t)===(p=n)?0!==o||1/o==1/p:o!=o&&p!=p)?r=0:(r="function"==typeof a?a(t,n):l,0!=(r|=0)&&this.emitter.set(e.value,r))}var o,p},s.prototype.render=function(){return this.props.children},s}(d.Component);o.childContextTypes=((t={})[r]=i.default.object.isRequired,t);var p=function(p){function a(){var e,n;c(this,a);for(var t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];return(e=n=u(this,p.call.apply(p,[this].concat(r)))).state={value:n.getValue()},n.onUpdate=function(e,t){0!=((0|n.observedBits)&t)&&n.setState({value:n.getValue()})},u(n,e)}return f(a,p),a.prototype.componentWillReceiveProps=function(e){var t=e.observedBits;this.observedBits=null==t?l:t},a.prototype.componentDidMount=function(){this.context[r]&&this.context[r].on(this.onUpdate);var e=this.props.observedBits;this.observedBits=null==e?l:e},a.prototype.componentWillUnmount=function(){this.context[r]&&this.context[r].off(this.onUpdate)},a.prototype.getValue=function(){return this.context[r]?this.context[r].get():e},a.prototype.render=function(){return e=this.props.children,(Array.isArray(e)?e[0]:e)(this.state.value);var e},a}(d.Component);return p.contextTypes=((n={})[r]=i.default.object,n),{Provider:o,Consumer:p}},e.exports=t.default});r(w);var P=r(c(function(e,t){t.__esModule=!0;var n=o(d),r=o(w);function o(e){return e&&e.__esModule?e:{default:e}}t.default=n.default.createContext||r.default,e.exports=t.default}))({setReferenceNode:void 0,referenceNode:void 0}),_=function(t){function e(){var e;return a(s(s(e=t.call(this)||this)),"setReferenceNode",function(t){t&&e.state.context.referenceNode!==t&&e.setState(function(e){return{context:i({},e.context,{referenceNode:t})}})}),e.state={context:{setReferenceNode:e.setReferenceNode,referenceNode:void 0}},e}return n(e,t),e.prototype.render=function(){return o.createElement(P.Provider,{value:this.state.context},this.props.children)},e}(o.Component),x=function(e){return Array.isArray(e)?e[0]:e},E=function(e){if("function"==typeof e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.apply(void 0,n)}},j={position:"absolute",top:0,left:0,opacity:0,pointerEvents:"none"},N={},R=function(o){function e(){for(var n,e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return a(s(s(n=o.call.apply(o,[this].concat(t))||this)),"state",{data:void 0,placement:void 0}),a(s(s(n)),"popperInstance",void 0),a(s(s(n)),"popperNode",null),a(s(s(n)),"arrowNode",null),a(s(s(n)),"setPopperNode",function(e){e&&n.popperNode!==e&&(E(n.props.innerRef,e),n.popperNode=e,n.updatePopperInstance())}),a(s(s(n)),"setArrowNode",function(e){n.arrowNode=e}),a(s(s(n)),"updateStateModifier",{enabled:!0,order:900,fn:function(e){var t=e.placement;return n.setState({data:e,placement:t}),e}}),a(s(s(n)),"getOptions",function(){return{placement:n.props.placement,eventsEnabled:n.props.eventsEnabled,positionFixed:n.props.positionFixed,modifiers:i({},n.props.modifiers,{arrow:i({},n.props.modifiers&&n.props.modifiers.arrow,{enabled:!!n.arrowNode,element:n.arrowNode}),applyStyle:{enabled:!1},updateStateModifier:n.updateStateModifier})}}),a(s(s(n)),"getPopperStyle",function(){return n.popperNode&&n.state.data?i({position:n.state.data.offsets.popper.position},n.state.data.styles):j}),a(s(s(n)),"getPopperPlacement",function(){return n.state.data?n.state.placement:void 0}),a(s(s(n)),"getArrowStyle",function(){return n.arrowNode&&n.state.data?n.state.data.arrowStyles:N}),a(s(s(n)),"getOutOfBoundariesState",function(){return n.state.data?n.state.data.hide:void 0}),a(s(s(n)),"destroyPopperInstance",function(){n.popperInstance&&(n.popperInstance.destroy(),n.popperInstance=null)}),a(s(s(n)),"updatePopperInstance",function(){n.destroyPopperInstance();var e=s(s(n)).popperNode,t=n.props.referenceElement;t&&e&&(n.popperInstance=new p(t,e,n.getOptions()))}),a(s(s(n)),"scheduleUpdate",function(){n.popperInstance&&n.popperInstance.scheduleUpdate()}),n}n(e,o);var t=e.prototype;return t.componentDidUpdate=function(e,t){this.props.placement!==e.placement||this.props.referenceElement!==e.referenceElement||this.props.positionFixed!==e.positionFixed?this.updatePopperInstance():this.props.eventsEnabled!==e.eventsEnabled&&this.popperInstance&&(this.props.eventsEnabled?this.popperInstance.enableEventListeners():this.popperInstance.disableEventListeners()),t.placement!==this.state.placement&&this.scheduleUpdate()},t.componentWillUnmount=function(){E(this.props.innerRef,null),this.destroyPopperInstance()},t.render=function(){return x(this.props.children)({ref:this.setPopperNode,style:this.getPopperStyle(),placement:this.getPopperPlacement(),outOfBoundaries:this.getOutOfBoundariesState(),scheduleUpdate:this.scheduleUpdate,arrowProps:{ref:this.setArrowNode,style:this.getArrowStyle()}})},e}(o.Component);a(R,"defaultProps",{placement:"bottom",eventsEnabled:!0,referenceElement:void 0,positionFixed:!1});var S=p.placements;var I=function(){},C=function(o){function e(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return a(s(s(t=o.call.apply(o,[this].concat(n))||this)),"refHandler",function(e){E(t.props.innerRef,e),E(t.props.setReferenceNode,e)}),t}return n(e,o),e.prototype.render=function(){return I(Boolean(this.props.setReferenceNode),"`Reference` should not be used outside of a `Manager` component."),x(this.props.children)({ref:this.refHandler})},e}(o.Component);e.Popper=function(e){var n=e.referenceElement,r=function(e,t){if(null==e)return{};var n,r,o={},p=Object.keys(e);for(r=0;r<p.length;r++)n=p[r],0<=t.indexOf(n)||(o[n]=e[n]);return o}(e,["referenceElement"]);return o.createElement(P.Consumer,null,function(e){var t=e.referenceNode;return o.createElement(R,i({referenceElement:void 0!==n?n:t},r))})},e.placements=S,e.Manager=_,e.Reference=function(n){return o.createElement(P.Consumer,null,function(e){var t=e.setReferenceNode;return o.createElement(C,i({setReferenceNode:t},n))})},Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("create-react-context"),require("popper.js"),require("warning")):"function"==typeof define&&define.amd?define(["exports","react","create-react-context","popper.js","warning"],t):t(e.ReactPopper={},e.React,null,e.Popper,null)}(this,function(e,o,t,p,n){"use strict";function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(){return(s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function r(e,t){e.prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t}function i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}t=t&&t.hasOwnProperty("default")?t.default:t,p=p&&p.hasOwnProperty("default")?p.default:p,n=n&&n.hasOwnProperty("default")?n.default:n;var c=t({setReferenceNode:void 0,referenceNode:void 0}),d=function(t){function e(){var e;return a(i(e=t.call(this)||this),"setReferenceNode",function(t){t&&e.state.context.referenceNode!==t&&e.setState(function(e){return{context:s({},e.context,{referenceNode:t})}})}),e.state={context:{setReferenceNode:e.setReferenceNode,referenceNode:void 0}},e}return r(e,t),e.prototype.render=function(){return o.createElement(c.Provider,{value:this.state.context},this.props.children)},e}(o.Component),u=function(e){return Array.isArray(e)?e[0]:e},l=function(e){if("function"==typeof e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.apply(void 0,n)}},f={position:"absolute",top:0,left:0,opacity:0,pointerEvents:"none"},h={},m=function(o){function e(){for(var n,e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return a(i(n=o.call.apply(o,[this].concat(t))||this),"state",{data:void 0,placement:void 0}),a(i(n),"popperInstance",void 0),a(i(n),"popperNode",null),a(i(n),"arrowNode",null),a(i(n),"setPopperNode",function(e){e&&n.popperNode!==e&&(l(n.props.innerRef,e),n.popperNode=e,n.updatePopperInstance())}),a(i(n),"setArrowNode",function(e){n.arrowNode=e}),a(i(n),"updateStateModifier",{enabled:!0,order:900,fn:function(e){var t=e.placement;return n.setState({data:e,placement:t}),e}}),a(i(n),"getOptions",function(){return{placement:n.props.placement,eventsEnabled:n.props.eventsEnabled,positionFixed:n.props.positionFixed,modifiers:s({},n.props.modifiers,{arrow:s({},n.props.modifiers&&n.props.modifiers.arrow,{enabled:!!n.arrowNode,element:n.arrowNode}),applyStyle:{enabled:!1},updateStateModifier:n.updateStateModifier})}}),a(i(n),"getPopperStyle",function(){return n.popperNode&&n.state.data?s({position:n.state.data.offsets.popper.position},n.state.data.styles):f}),a(i(n),"getPopperPlacement",function(){return n.state.data?n.state.placement:void 0}),a(i(n),"getArrowStyle",function(){return n.arrowNode&&n.state.data?n.state.data.arrowStyles:h}),a(i(n),"getOutOfBoundariesState",function(){return n.state.data?n.state.data.hide:void 0}),a(i(n),"destroyPopperInstance",function(){n.popperInstance&&(n.popperInstance.destroy(),n.popperInstance=null)}),a(i(n),"updatePopperInstance",function(){n.destroyPopperInstance();var e=i(n).popperNode,t=n.props.referenceElement;t&&e&&(n.popperInstance=new p(t,e,n.getOptions()))}),a(i(n),"scheduleUpdate",function(){n.popperInstance&&n.popperInstance.scheduleUpdate()}),n}r(e,o);var t=e.prototype;return t.componentDidUpdate=function(e,t){this.props.placement!==e.placement||this.props.referenceElement!==e.referenceElement||this.props.positionFixed!==e.positionFixed?this.updatePopperInstance():this.props.eventsEnabled!==e.eventsEnabled&&this.popperInstance&&(this.props.eventsEnabled?this.popperInstance.enableEventListeners():this.popperInstance.disableEventListeners()),t.placement!==this.state.placement&&this.scheduleUpdate()},t.componentWillUnmount=function(){l(this.props.innerRef,null),this.destroyPopperInstance()},t.render=function(){return u(this.props.children)({ref:this.setPopperNode,style:this.getPopperStyle(),placement:this.getPopperPlacement(),outOfBoundaries:this.getOutOfBoundariesState(),scheduleUpdate:this.scheduleUpdate,arrowProps:{ref:this.setArrowNode,style:this.getArrowStyle()}})},e}(o.Component);a(m,"defaultProps",{placement:"bottom",eventsEnabled:!0,referenceElement:void 0,positionFixed:!1});var v=p.placements;var y=function(o){function e(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return a(i(t=o.call.apply(o,[this].concat(n))||this),"refHandler",function(e){l(t.props.innerRef,e),l(t.props.setReferenceNode,e)}),t}r(e,o);var t=e.prototype;return t.componentWillUnmount=function(){l(this.props.innerRef,null)},t.render=function(){return n(Boolean(this.props.setReferenceNode),"`Reference` should not be used outside of a `Manager` component."),u(this.props.children)({ref:this.refHandler})},e}(o.Component);e.Popper=function(e){var n=e.referenceElement,r=function(e,t){if(null==e)return{};var n,r,o={},p=Object.keys(e);for(r=0;r<p.length;r++)n=p[r],0<=t.indexOf(n)||(o[n]=e[n]);return o}(e,["referenceElement"]);return o.createElement(c.Consumer,null,function(e){var t=e.referenceNode;return o.createElement(m,s({referenceElement:void 0!==n?n:t},r))})},e.placements=v,e.Manager=d,e.Reference=function(n){return o.createElement(c.Consumer,null,function(e){var t=e.setReferenceNode;return o.createElement(y,s({setReferenceNode:t},n))})},Object.defineProperty(e,"__esModule",{value:!0})}); |
@@ -14,6 +14,6 @@ "use strict"; | ||
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized")); | ||
var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose")); | ||
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized")); | ||
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); | ||
@@ -40,3 +40,3 @@ | ||
_this = _React$Component.call(this) || this; | ||
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)), "setReferenceNode", function (referenceNode) { | ||
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "setReferenceNode", function (referenceNode) { | ||
if (!referenceNode || _this.state.context.referenceNode === referenceNode) { | ||
@@ -43,0 +43,0 @@ return; |
@@ -17,6 +17,6 @@ "use strict"; | ||
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized")); | ||
var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose")); | ||
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized")); | ||
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); | ||
@@ -54,10 +54,10 @@ | ||
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this; | ||
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)), "state", { | ||
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", { | ||
data: undefined, | ||
placement: undefined | ||
}); | ||
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)), "popperInstance", void 0); | ||
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)), "popperNode", null); | ||
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)), "arrowNode", null); | ||
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)), "setPopperNode", function (popperNode) { | ||
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "popperInstance", void 0); | ||
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "popperNode", null); | ||
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "arrowNode", null); | ||
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "setPopperNode", function (popperNode) { | ||
if (!popperNode || _this.popperNode === popperNode) return; | ||
@@ -69,6 +69,6 @@ (0, _utils.safeInvoke)(_this.props.innerRef, popperNode); | ||
}); | ||
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)), "setArrowNode", function (arrowNode) { | ||
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "setArrowNode", function (arrowNode) { | ||
_this.arrowNode = arrowNode; | ||
}); | ||
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)), "updateStateModifier", { | ||
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "updateStateModifier", { | ||
enabled: true, | ||
@@ -87,3 +87,3 @@ order: 900, | ||
}); | ||
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)), "getOptions", function () { | ||
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getOptions", function () { | ||
return { | ||
@@ -105,3 +105,3 @@ placement: _this.props.placement, | ||
}); | ||
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)), "getPopperStyle", function () { | ||
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getPopperStyle", function () { | ||
return !_this.popperNode || !_this.state.data ? initialStyle : (0, _extends2.default)({ | ||
@@ -111,12 +111,12 @@ position: _this.state.data.offsets.popper.position | ||
}); | ||
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)), "getPopperPlacement", function () { | ||
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getPopperPlacement", function () { | ||
return !_this.state.data ? undefined : _this.state.placement; | ||
}); | ||
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)), "getArrowStyle", function () { | ||
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getArrowStyle", function () { | ||
return !_this.arrowNode || !_this.state.data ? initialArrowStyle : _this.state.data.arrowStyles; | ||
}); | ||
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)), "getOutOfBoundariesState", function () { | ||
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getOutOfBoundariesState", function () { | ||
return _this.state.data ? _this.state.data.hide : undefined; | ||
}); | ||
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)), "destroyPopperInstance", function () { | ||
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "destroyPopperInstance", function () { | ||
if (!_this.popperInstance) return; | ||
@@ -128,6 +128,6 @@ | ||
}); | ||
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)), "updatePopperInstance", function () { | ||
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "updatePopperInstance", function () { | ||
_this.destroyPopperInstance(); | ||
var _assertThisInitialize = (0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)), | ||
var _assertThisInitialize = (0, _assertThisInitialized2.default)(_this), | ||
popperNode = _assertThisInitialize.popperNode; | ||
@@ -139,3 +139,3 @@ | ||
}); | ||
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)), "scheduleUpdate", function () { | ||
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "scheduleUpdate", function () { | ||
if (_this.popperInstance) { | ||
@@ -142,0 +142,0 @@ _this.popperInstance.scheduleUpdate(); |
@@ -14,6 +14,6 @@ "use strict"; | ||
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized")); | ||
var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose")); | ||
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized")); | ||
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); | ||
@@ -42,3 +42,3 @@ | ||
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this; | ||
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)), "refHandler", function (node) { | ||
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "refHandler", function (node) { | ||
(0, _utils.safeInvoke)(_this.props.innerRef, node); | ||
@@ -52,2 +52,6 @@ (0, _utils.safeInvoke)(_this.props.setReferenceNode, node); | ||
_proto.componentWillUnmount = function componentWillUnmount() { | ||
(0, _utils.safeInvoke)(this.props.innerRef, null); | ||
}; | ||
_proto.render = function render() { | ||
@@ -54,0 +58,0 @@ (0, _warning.default)(Boolean(this.props.setReferenceNode), '`Reference` should not be used outside of a `Manager` component.'); |
import _extends from "@babel/runtime/helpers/extends"; | ||
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized"; | ||
import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose"; | ||
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized"; | ||
import _defineProperty from "@babel/runtime/helpers/defineProperty"; | ||
@@ -22,3 +22,3 @@ import * as React from 'react'; | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "setReferenceNode", function (referenceNode) { | ||
_defineProperty(_assertThisInitialized(_this), "setReferenceNode", function (referenceNode) { | ||
if (!referenceNode || _this.state.context.referenceNode === referenceNode) { | ||
@@ -25,0 +25,0 @@ return; |
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose"; | ||
import _extends from "@babel/runtime/helpers/extends"; | ||
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized"; | ||
import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose"; | ||
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized"; | ||
import _defineProperty from "@babel/runtime/helpers/defineProperty"; | ||
@@ -32,3 +32,3 @@ import * as React from 'react'; | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "state", { | ||
_defineProperty(_assertThisInitialized(_this), "state", { | ||
data: undefined, | ||
@@ -38,9 +38,9 @@ placement: undefined | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "popperInstance", void 0); | ||
_defineProperty(_assertThisInitialized(_this), "popperInstance", void 0); | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "popperNode", null); | ||
_defineProperty(_assertThisInitialized(_this), "popperNode", null); | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "arrowNode", null); | ||
_defineProperty(_assertThisInitialized(_this), "arrowNode", null); | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "setPopperNode", function (popperNode) { | ||
_defineProperty(_assertThisInitialized(_this), "setPopperNode", function (popperNode) { | ||
if (!popperNode || _this.popperNode === popperNode) return; | ||
@@ -53,7 +53,7 @@ safeInvoke(_this.props.innerRef, popperNode); | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "setArrowNode", function (arrowNode) { | ||
_defineProperty(_assertThisInitialized(_this), "setArrowNode", function (arrowNode) { | ||
_this.arrowNode = arrowNode; | ||
}); | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "updateStateModifier", { | ||
_defineProperty(_assertThisInitialized(_this), "updateStateModifier", { | ||
enabled: true, | ||
@@ -73,3 +73,3 @@ order: 900, | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "getOptions", function () { | ||
_defineProperty(_assertThisInitialized(_this), "getOptions", function () { | ||
return { | ||
@@ -92,3 +92,3 @@ placement: _this.props.placement, | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "getPopperStyle", function () { | ||
_defineProperty(_assertThisInitialized(_this), "getPopperStyle", function () { | ||
return !_this.popperNode || !_this.state.data ? initialStyle : _extends({ | ||
@@ -99,15 +99,15 @@ position: _this.state.data.offsets.popper.position | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "getPopperPlacement", function () { | ||
_defineProperty(_assertThisInitialized(_this), "getPopperPlacement", function () { | ||
return !_this.state.data ? undefined : _this.state.placement; | ||
}); | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "getArrowStyle", function () { | ||
_defineProperty(_assertThisInitialized(_this), "getArrowStyle", function () { | ||
return !_this.arrowNode || !_this.state.data ? initialArrowStyle : _this.state.data.arrowStyles; | ||
}); | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "getOutOfBoundariesState", function () { | ||
_defineProperty(_assertThisInitialized(_this), "getOutOfBoundariesState", function () { | ||
return _this.state.data ? _this.state.data.hide : undefined; | ||
}); | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "destroyPopperInstance", function () { | ||
_defineProperty(_assertThisInitialized(_this), "destroyPopperInstance", function () { | ||
if (!_this.popperInstance) return; | ||
@@ -120,6 +120,6 @@ | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "updatePopperInstance", function () { | ||
_defineProperty(_assertThisInitialized(_this), "updatePopperInstance", function () { | ||
_this.destroyPopperInstance(); | ||
var _assertThisInitialize = _assertThisInitialized(_assertThisInitialized(_this)), | ||
var _assertThisInitialize = _assertThisInitialized(_this), | ||
popperNode = _assertThisInitialize.popperNode; | ||
@@ -132,3 +132,3 @@ | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "scheduleUpdate", function () { | ||
_defineProperty(_assertThisInitialized(_this), "scheduleUpdate", function () { | ||
if (_this.popperInstance) { | ||
@@ -135,0 +135,0 @@ _this.popperInstance.scheduleUpdate(); |
import _extends from "@babel/runtime/helpers/extends"; | ||
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized"; | ||
import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose"; | ||
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized"; | ||
import _defineProperty from "@babel/runtime/helpers/defineProperty"; | ||
@@ -24,3 +24,3 @@ import * as React from 'react'; | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "refHandler", function (node) { | ||
_defineProperty(_assertThisInitialized(_this), "refHandler", function (node) { | ||
safeInvoke(_this.props.innerRef, node); | ||
@@ -35,2 +35,6 @@ safeInvoke(_this.props.setReferenceNode, node); | ||
_proto.componentWillUnmount = function componentWillUnmount() { | ||
safeInvoke(this.props.innerRef, null); | ||
}; | ||
_proto.render = function render() { | ||
@@ -37,0 +41,0 @@ warning(Boolean(this.props.setReferenceNode), '`Reference` should not be used outside of a `Manager` component.'); |
{ | ||
"name": "react-popper", | ||
"version": "1.3.3", | ||
"version": "1.3.4", | ||
"description": "React wrapper around Popper.js", | ||
@@ -36,3 +36,5 @@ "license": "MIT", | ||
"jest": { | ||
"setupTestFrameworkScriptFile": "<rootDir>jest.setup.js", | ||
"setupFilesAfterEnv": [ | ||
"<rootDir>jest.setup.js" | ||
], | ||
"snapshotSerializers": [ | ||
@@ -63,3 +65,3 @@ "enzyme-to-json/serializer" | ||
"@babel/runtime": "^7.1.2", | ||
"create-react-context": "<=0.2.2", | ||
"create-react-context": "^0.3.0", | ||
"popper.js": "^1.14.4", | ||
@@ -82,5 +84,4 @@ "prop-types": "^15.6.1", | ||
"@types/react": "^16.1.0", | ||
"babel-core": "^7.0.0-bridge.0", | ||
"babel-eslint": "^10.0.1", | ||
"babel-jest": "^23.6.0", | ||
"babel-jest": "^24.0.0", | ||
"cross-env": "^5.1.4", | ||
@@ -101,3 +102,3 @@ "emotion": "^9.1.1", | ||
"git-branch-is": "^0.1.0", | ||
"jest": "^22.4.3", | ||
"jest": "^24.0.0", | ||
"parcel-bundler": "^1.10.1", | ||
@@ -104,0 +105,0 @@ "prettier": "^1.11.1", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
46
78287
1078
+ Addedcreate-react-context@0.3.0(transitive)
- Removedasap@2.0.6(transitive)
- Removedcore-js@1.2.7(transitive)
- Removedcreate-react-context@0.2.2(transitive)
- Removedencoding@0.1.13(transitive)
- Removedfbjs@0.8.18(transitive)
- Removediconv-lite@0.6.3(transitive)
- Removedis-stream@1.1.0(transitive)
- Removedisomorphic-fetch@2.2.1(transitive)
- Removednode-fetch@1.7.3(transitive)
- Removedpromise@7.3.1(transitive)
- Removedsafer-buffer@2.1.2(transitive)
- Removedsetimmediate@1.0.5(transitive)
- Removedua-parser-js@0.7.39(transitive)
- Removedwhatwg-fetch@3.6.20(transitive)
Updatedcreate-react-context@^0.3.0