@highlight-ui/utils-portal-manager
Advanced tools
Comparing version 3.1.7 to 3.1.8
@@ -6,7 +6,4 @@ 'use strict'; | ||
}); | ||
var React = require('react'); | ||
var ReactDOM = require('react-dom'); | ||
function _interopDefaultLegacy(e) { | ||
@@ -17,7 +14,4 @@ return e && typeof e === 'object' && 'default' in e ? e : { | ||
} | ||
var React__default = /*#__PURE__*/_interopDefaultLegacy(React); | ||
var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM); | ||
var portalsContainerId = 'ui-components-portals-container'; | ||
@@ -27,3 +21,2 @@ var PortalManager = { | ||
var portalsContainerElement = document.getElementById(portalsContainerId); | ||
if (!portalsContainerElement) { | ||
@@ -35,3 +28,2 @@ var container = document.createElement('div'); | ||
} | ||
portalsContainerElement.style.zIndex = '1000000'; | ||
@@ -48,2 +40,3 @@ return portalsContainerElement; | ||
var reactIs_production_min = {}; | ||
/** @license React v16.13.1 | ||
@@ -57,27 +50,24 @@ * react-is.production.min.js | ||
*/ | ||
var b = "function" === typeof Symbol && Symbol.for, | ||
c = b ? Symbol.for("react.element") : 60103, | ||
d = b ? Symbol.for("react.portal") : 60106, | ||
e = b ? Symbol.for("react.fragment") : 60107, | ||
f = b ? Symbol.for("react.strict_mode") : 60108, | ||
g = b ? Symbol.for("react.profiler") : 60114, | ||
h = b ? Symbol.for("react.provider") : 60109, | ||
k = b ? Symbol.for("react.context") : 60110, | ||
l = b ? Symbol.for("react.async_mode") : 60111, | ||
m = b ? Symbol.for("react.concurrent_mode") : 60111, | ||
n = b ? Symbol.for("react.forward_ref") : 60112, | ||
p = b ? Symbol.for("react.suspense") : 60113, | ||
q = b ? Symbol.for("react.suspense_list") : 60120, | ||
r = b ? Symbol.for("react.memo") : 60115, | ||
t = b ? Symbol.for("react.lazy") : 60116, | ||
v = b ? Symbol.for("react.block") : 60121, | ||
w = b ? Symbol.for("react.fundamental") : 60117, | ||
x = b ? Symbol.for("react.responder") : 60118, | ||
y = b ? Symbol.for("react.scope") : 60119; | ||
c = b ? Symbol.for("react.element") : 60103, | ||
d = b ? Symbol.for("react.portal") : 60106, | ||
e = b ? Symbol.for("react.fragment") : 60107, | ||
f = b ? Symbol.for("react.strict_mode") : 60108, | ||
g = b ? Symbol.for("react.profiler") : 60114, | ||
h = b ? Symbol.for("react.provider") : 60109, | ||
k = b ? Symbol.for("react.context") : 60110, | ||
l = b ? Symbol.for("react.async_mode") : 60111, | ||
m = b ? Symbol.for("react.concurrent_mode") : 60111, | ||
n = b ? Symbol.for("react.forward_ref") : 60112, | ||
p = b ? Symbol.for("react.suspense") : 60113, | ||
q = b ? Symbol.for("react.suspense_list") : 60120, | ||
r = b ? Symbol.for("react.memo") : 60115, | ||
t = b ? Symbol.for("react.lazy") : 60116, | ||
v = b ? Symbol.for("react.block") : 60121, | ||
w = b ? Symbol.for("react.fundamental") : 60117, | ||
x = b ? Symbol.for("react.responder") : 60118, | ||
y = b ? Symbol.for("react.scope") : 60119; | ||
function z(a) { | ||
if ("object" === typeof a && null !== a) { | ||
var u = a.$$typeof; | ||
switch (u) { | ||
@@ -93,3 +83,2 @@ case c: | ||
return a; | ||
default: | ||
@@ -103,9 +92,6 @@ switch (a = a && a.$$typeof, a) { | ||
return a; | ||
default: | ||
return u; | ||
} | ||
} | ||
case d: | ||
@@ -116,7 +102,5 @@ return u; | ||
} | ||
function A(a) { | ||
return z(a) === m; | ||
} | ||
reactIs_production_min.AsyncMode = l; | ||
@@ -135,59 +119,45 @@ reactIs_production_min.ConcurrentMode = m; | ||
reactIs_production_min.Suspense = p; | ||
reactIs_production_min.isAsyncMode = function (a) { | ||
return A(a) || z(a) === l; | ||
}; | ||
reactIs_production_min.isConcurrentMode = A; | ||
reactIs_production_min.isContextConsumer = function (a) { | ||
return z(a) === k; | ||
}; | ||
reactIs_production_min.isContextProvider = function (a) { | ||
return z(a) === h; | ||
}; | ||
reactIs_production_min.isElement = function (a) { | ||
return "object" === typeof a && null !== a && a.$$typeof === c; | ||
}; | ||
reactIs_production_min.isForwardRef = function (a) { | ||
return z(a) === n; | ||
}; | ||
reactIs_production_min.isFragment = function (a) { | ||
return z(a) === e; | ||
}; | ||
reactIs_production_min.isLazy = function (a) { | ||
return z(a) === t; | ||
}; | ||
reactIs_production_min.isMemo = function (a) { | ||
return z(a) === r; | ||
}; | ||
reactIs_production_min.isPortal = function (a) { | ||
return z(a) === d; | ||
}; | ||
reactIs_production_min.isProfiler = function (a) { | ||
return z(a) === g; | ||
}; | ||
reactIs_production_min.isStrictMode = function (a) { | ||
return z(a) === f; | ||
}; | ||
reactIs_production_min.isSuspense = function (a) { | ||
return z(a) === p; | ||
}; | ||
reactIs_production_min.isValidElementType = function (a) { | ||
return "string" === typeof a || "function" === typeof a || a === e || a === m || a === g || a === f || a === p || a === q || "object" === typeof a && null !== a && (a.$$typeof === t || a.$$typeof === r || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v); | ||
}; | ||
reactIs_production_min.typeOf = z; | ||
var reactIs_development = {}; | ||
/** @license React v16.13.1 | ||
@@ -227,16 +197,13 @@ * react-is.development.js | ||
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7; | ||
function isValidElementType(type) { | ||
return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. | ||
return typeof type === 'string' || typeof type === 'function' || | ||
// Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. | ||
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE); | ||
} | ||
function typeOf(object) { | ||
if (typeof object === 'object' && object !== null) { | ||
var $$typeof = object.$$typeof; | ||
switch ($$typeof) { | ||
case REACT_ELEMENT_TYPE: | ||
var type = object.type; | ||
switch (type) { | ||
@@ -250,6 +217,4 @@ case REACT_ASYNC_MODE_TYPE: | ||
return type; | ||
default: | ||
var $$typeofType = type && type.$$typeof; | ||
switch ($$typeofType) { | ||
@@ -262,9 +227,6 @@ case REACT_CONTEXT_TYPE: | ||
return $$typeofType; | ||
default: | ||
return $$typeof; | ||
} | ||
} | ||
case REACT_PORTAL_TYPE: | ||
@@ -274,7 +236,5 @@ return $$typeof; | ||
} | ||
return undefined; | ||
} // AsyncMode is deprecated along with isAsyncMode | ||
var AsyncMode = REACT_ASYNC_MODE_TYPE; | ||
@@ -305,51 +265,38 @@ var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; | ||
} | ||
function isConcurrentMode(object) { | ||
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE; | ||
} | ||
function isContextConsumer(object) { | ||
return typeOf(object) === REACT_CONTEXT_TYPE; | ||
} | ||
function isContextProvider(object) { | ||
return typeOf(object) === REACT_PROVIDER_TYPE; | ||
} | ||
function isElement(object) { | ||
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; | ||
} | ||
function isForwardRef(object) { | ||
return typeOf(object) === REACT_FORWARD_REF_TYPE; | ||
} | ||
function isFragment(object) { | ||
return typeOf(object) === REACT_FRAGMENT_TYPE; | ||
} | ||
function isLazy(object) { | ||
return typeOf(object) === REACT_LAZY_TYPE; | ||
} | ||
function isMemo(object) { | ||
return typeOf(object) === REACT_MEMO_TYPE; | ||
} | ||
function isPortal(object) { | ||
return typeOf(object) === REACT_PORTAL_TYPE; | ||
} | ||
function isProfiler(object) { | ||
return typeOf(object) === REACT_PROFILER_TYPE; | ||
} | ||
function isStrictMode(object) { | ||
return typeOf(object) === REACT_STRICT_MODE_TYPE; | ||
} | ||
function isSuspense(object) { | ||
return typeOf(object) === REACT_SUSPENSE_TYPE; | ||
} | ||
reactIs_development.AsyncMode = AsyncMode; | ||
@@ -385,3 +332,2 @@ reactIs_development.ConcurrentMode = ConcurrentMode; | ||
} | ||
if (process.env.NODE_ENV === 'production') { | ||
@@ -392,2 +338,3 @@ reactIs.exports = reactIs_production_min; | ||
} | ||
/* | ||
@@ -398,10 +345,6 @@ object-assign | ||
*/ | ||
/* eslint-disable no-unused-vars */ | ||
var getOwnPropertySymbols = Object.getOwnPropertySymbols; | ||
var hasOwnProperty = Object.prototype.hasOwnProperty; | ||
var propIsEnumerable = Object.prototype.propertyIsEnumerable; | ||
function toObject(val) { | ||
@@ -411,6 +354,4 @@ if (val === null || val === undefined) { | ||
} | ||
return Object(val); | ||
} | ||
function shouldUseNative() { | ||
@@ -420,30 +361,26 @@ try { | ||
return false; | ||
} // Detect buggy property enumeration order in older V8 versions. | ||
// https://bugs.chromium.org/p/v8/issues/detail?id=4118 | ||
} | ||
// 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 | ||
} | ||
// 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 | ||
} | ||
// https://bugs.chromium.org/p/v8/issues/detail?id=3056 | ||
var test3 = {}; | ||
@@ -453,7 +390,5 @@ 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { | ||
}); | ||
if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') { | ||
return false; | ||
} | ||
return true; | ||
@@ -465,3 +400,2 @@ } catch (err) { | ||
} | ||
var objectAssign = shouldUseNative() ? Object.assign : function (target, source) { | ||
@@ -471,6 +405,4 @@ var from; | ||
var symbols; | ||
for (var s = 1; s < arguments.length; s++) { | ||
from = Object(arguments[s]); | ||
for (var key in from) { | ||
@@ -481,6 +413,4 @@ if (hasOwnProperty.call(from, key)) { | ||
} | ||
if (getOwnPropertySymbols) { | ||
symbols = getOwnPropertySymbols(from); | ||
for (var i = 0; i < symbols.length; i++) { | ||
@@ -493,5 +423,5 @@ if (propIsEnumerable.call(from, symbols[i])) { | ||
} | ||
return to; | ||
}; | ||
/** | ||
@@ -506,2 +436,4 @@ * Copyright (c) 2013-present, Facebook, Inc. | ||
var ReactPropTypesSecret_1 = ReactPropTypesSecret$3; | ||
var has$2 = Function.call.bind(Object.prototype.hasOwnProperty); | ||
/** | ||
@@ -515,15 +447,11 @@ * Copyright (c) 2013-present, Facebook, Inc. | ||
var printWarning$1 = function () {}; | ||
if (process.env.NODE_ENV !== 'production') { | ||
var ReactPropTypesSecret$2 = ReactPropTypesSecret_1; | ||
var loggedTypeFailures = {}; | ||
var has$1 = Function.call.bind(Object.prototype.hasOwnProperty); | ||
var has$1 = has$2; | ||
printWarning$1 = function (text) { | ||
var message = 'Warning: ' + text; | ||
if (typeof console !== 'undefined') { | ||
console.error(message); | ||
} | ||
try { | ||
@@ -534,5 +462,6 @@ // --- Welcome to debugging React --- | ||
throw new Error(message); | ||
} catch (x) {} | ||
} catch (x) {/**/} | ||
}; | ||
} | ||
/** | ||
@@ -549,4 +478,2 @@ * Assert that the values match with the type specs. | ||
*/ | ||
function checkPropTypes$1(typeSpecs, values, location, componentName, getStack) { | ||
@@ -556,6 +483,6 @@ if (process.env.NODE_ENV !== 'production') { | ||
if (has$1(typeSpecs, typeSpecName)) { | ||
var error; // Prop type validation may throw. In case they do, we don't want to | ||
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 { | ||
@@ -565,7 +492,6 @@ // This is intentionally an invariant that gets caught. It's the same | ||
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] + '`.'); | ||
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] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'); | ||
err.name = 'Invariant Violation'; | ||
throw err; | ||
} | ||
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret$2); | ||
@@ -575,7 +501,5 @@ } catch (ex) { | ||
} | ||
if (error && !(error instanceof Error)) { | ||
printWarning$1((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)) { | ||
@@ -592,2 +516,3 @@ // Only monitor this failure once because there tends to be a lot of the | ||
} | ||
/** | ||
@@ -598,4 +523,2 @@ * Resets warning cache when testing. | ||
*/ | ||
checkPropTypes$1.resetWarningCache = function () { | ||
@@ -606,4 +529,4 @@ if (process.env.NODE_ENV !== 'production') { | ||
}; | ||
var checkPropTypes_1 = checkPropTypes$1; | ||
var checkPropTypes_1 = checkPropTypes$1; | ||
/** | ||
@@ -619,15 +542,11 @@ * Copyright (c) 2013-present, Facebook, Inc. | ||
var ReactPropTypesSecret$1 = ReactPropTypesSecret_1; | ||
var has = has$2; | ||
var checkPropTypes = checkPropTypes_1; | ||
var has = Function.call.bind(Object.prototype.hasOwnProperty); | ||
var printWarning = function () {}; | ||
if (process.env.NODE_ENV !== 'production') { | ||
printWarning = function (text) { | ||
var message = 'Warning: ' + text; | ||
if (typeof console !== 'undefined') { | ||
console.error(message); | ||
} | ||
try { | ||
@@ -641,7 +560,5 @@ // --- Welcome to debugging React --- | ||
} | ||
function emptyFunctionThatReturnsNull() { | ||
return null; | ||
} | ||
var factoryWithTypeCheckers = function (isValidElement, throwOnDirectAccess) { | ||
@@ -666,6 +583,4 @@ /* global Symbol */ | ||
*/ | ||
function getIteratorFn(maybeIterable) { | ||
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); | ||
if (typeof iteratorFn === 'function') { | ||
@@ -675,2 +590,3 @@ return iteratorFn; | ||
} | ||
/** | ||
@@ -723,8 +639,9 @@ * Collection of methods that allow declaration and validation of props that are | ||
var ANONYMOUS = '<<anonymous>>'; | ||
var ANONYMOUS = '<<anonymous>>'; // Important! | ||
// Important! | ||
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`. | ||
var ReactPropTypes = { | ||
array: createPrimitiveTypeChecker('array'), | ||
bigint: createPrimitiveTypeChecker('bigint'), | ||
bool: createPrimitiveTypeChecker('boolean'), | ||
@@ -748,2 +665,3 @@ func: createPrimitiveTypeChecker('function'), | ||
}; | ||
/** | ||
@@ -753,5 +671,3 @@ * inlined Object.is polyfill to avoid requiring consumers ship their own | ||
*/ | ||
/*eslint-disable no-self-compare*/ | ||
function is(x, y) { | ||
@@ -777,12 +693,9 @@ // SameValue algorithm | ||
*/ | ||
function PropTypeError(message) { | ||
function PropTypeError(message, data) { | ||
this.message = message; | ||
this.data = data && typeof data === 'object' ? data : {}; | ||
this.stack = ''; | ||
} // Make `instanceof Error` still work for returned errors. | ||
} | ||
// Make `instanceof Error` still work for returned errors. | ||
PropTypeError.prototype = Error.prototype; | ||
function createChainableTypeChecker(validate) { | ||
@@ -793,7 +706,5 @@ if (process.env.NODE_ENV !== 'production') { | ||
} | ||
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { | ||
componentName = componentName || ANONYMOUS; | ||
propFullName = propFullName || propName; | ||
if (secret !== ReactPropTypesSecret$1) { | ||
@@ -808,4 +719,4 @@ if (throwOnDirectAccess) { | ||
var cacheKey = componentName + ':' + propName; | ||
if (!manualPropTypeCallCache[cacheKey] && // Avoid spamming the console because they are often not actionable except for lib authors | ||
if (!manualPropTypeCallCache[cacheKey] && | ||
// Avoid spamming the console because they are often not actionable except for lib authors | ||
manualPropTypeWarningCount < 3) { | ||
@@ -818,3 +729,2 @@ printWarning('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.'); | ||
} | ||
if (props[propName] == null) { | ||
@@ -825,6 +735,4 @@ if (isRequired) { | ||
} | ||
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); | ||
} | ||
return null; | ||
@@ -835,3 +743,2 @@ } else { | ||
} | ||
var chainedCheckType = checkType.bind(null, false); | ||
@@ -841,3 +748,2 @@ chainedCheckType.isRequired = checkType.bind(null, true); | ||
} | ||
function createPrimitiveTypeChecker(expectedType) { | ||
@@ -847,3 +753,2 @@ function validate(props, propName, componentName, location, propFullName, secret) { | ||
var propType = getPropType(propValue); | ||
if (propType !== expectedType) { | ||
@@ -854,15 +759,13 @@ // `propValue` being instance of, say, date/regexp, pass the 'object' | ||
var preciseType = getPreciseType(propValue); | ||
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.')); | ||
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'), { | ||
expectedType: expectedType | ||
}); | ||
} | ||
return null; | ||
} | ||
return createChainableTypeChecker(validate); | ||
} | ||
function createAnyTypeChecker() { | ||
return createChainableTypeChecker(emptyFunctionThatReturnsNull); | ||
} | ||
function createArrayOfTypeChecker(typeChecker) { | ||
@@ -873,5 +776,3 @@ function validate(props, propName, componentName, location, propFullName) { | ||
} | ||
var propValue = props[propName]; | ||
if (!Array.isArray(propValue)) { | ||
@@ -881,6 +782,4 @@ var propType = getPropType(propValue); | ||
} | ||
for (var i = 0; i < propValue.length; i++) { | ||
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret$1); | ||
if (error instanceof Error) { | ||
@@ -890,13 +789,9 @@ return error; | ||
} | ||
return null; | ||
} | ||
return createChainableTypeChecker(validate); | ||
} | ||
function createElementTypeChecker() { | ||
function validate(props, propName, componentName, location, propFullName) { | ||
var propValue = props[propName]; | ||
if (!isValidElement(propValue)) { | ||
@@ -906,13 +801,9 @@ var propType = getPropType(propValue); | ||
} | ||
return null; | ||
} | ||
return createChainableTypeChecker(validate); | ||
} | ||
function createElementTypeTypeChecker() { | ||
function validate(props, propName, componentName, location, propFullName) { | ||
var propValue = props[propName]; | ||
if (!ReactIs$1.isValidElementType(propValue)) { | ||
@@ -922,9 +813,6 @@ var propType = getPropType(propValue); | ||
} | ||
return null; | ||
} | ||
return createChainableTypeChecker(validate); | ||
} | ||
function createInstanceTypeChecker(expectedClass) { | ||
@@ -937,9 +825,6 @@ function validate(props, propName, componentName, location, propFullName) { | ||
} | ||
return null; | ||
} | ||
return createChainableTypeChecker(validate); | ||
} | ||
function createEnumTypeChecker(expectedValues) { | ||
@@ -954,9 +839,6 @@ if (!Array.isArray(expectedValues)) { | ||
} | ||
return emptyFunctionThatReturnsNull; | ||
} | ||
function validate(props, propName, componentName, location, propFullName) { | ||
var propValue = props[propName]; | ||
for (var i = 0; i < expectedValues.length; i++) { | ||
@@ -967,10 +849,7 @@ if (is(propValue, expectedValues[i])) { | ||
} | ||
var valuesString = JSON.stringify(expectedValues, function replacer(key, value) { | ||
var type = getPreciseType(value); | ||
if (type === 'symbol') { | ||
return String(value); | ||
} | ||
return value; | ||
@@ -980,6 +859,4 @@ }); | ||
} | ||
return createChainableTypeChecker(validate); | ||
} | ||
function createObjectOfTypeChecker(typeChecker) { | ||
@@ -990,14 +867,10 @@ 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 an object.')); | ||
} | ||
for (var key in propValue) { | ||
if (has(propValue, key)) { | ||
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1); | ||
if (error instanceof Error) { | ||
@@ -1008,9 +881,6 @@ return error; | ||
} | ||
return null; | ||
} | ||
return createChainableTypeChecker(validate); | ||
} | ||
function createUnionTypeChecker(arrayOfTypeCheckers) { | ||
@@ -1021,6 +891,4 @@ if (!Array.isArray(arrayOfTypeCheckers)) { | ||
} | ||
for (var i = 0; i < arrayOfTypeCheckers.length; i++) { | ||
var checker = arrayOfTypeCheckers[i]; | ||
if (typeof checker !== 'function') { | ||
@@ -1031,18 +899,19 @@ printWarning('Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'); | ||
} | ||
function validate(props, propName, componentName, location, propFullName) { | ||
var expectedTypes = []; | ||
for (var i = 0; i < arrayOfTypeCheckers.length; i++) { | ||
var checker = arrayOfTypeCheckers[i]; | ||
if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret$1) == null) { | ||
var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret$1); | ||
if (checkerResult == null) { | ||
return null; | ||
} | ||
if (checkerResult.data && has(checkerResult.data, 'expectedType')) { | ||
expectedTypes.push(checkerResult.data.expectedType); | ||
} | ||
} | ||
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.')); | ||
var expectedTypesMessage = expectedTypes.length > 0 ? ', expected one of type [' + expectedTypes.join(', ') + ']' : ''; | ||
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.')); | ||
} | ||
return createChainableTypeChecker(validate); | ||
} | ||
function createNodeChecker() { | ||
@@ -1053,9 +922,9 @@ function validate(props, propName, componentName, location, propFullName) { | ||
} | ||
return null; | ||
} | ||
return createChainableTypeChecker(validate); | ||
} | ||
function invalidValidatorError(componentName, location, propFullName, key, type) { | ||
return new PropTypeError((componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'); | ||
} | ||
function createShapeTypeChecker(shapeTypes) { | ||
@@ -1065,16 +934,11 @@ function validate(props, propName, componentName, location, propFullName) { | ||
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; | ||
if (typeof checker !== 'function') { | ||
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); | ||
} | ||
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1); | ||
if (error) { | ||
@@ -1084,9 +948,6 @@ return error; | ||
} | ||
return null; | ||
} | ||
return createChainableTypeChecker(validate); | ||
} | ||
function createStrictShapeTypeChecker(shapeTypes) { | ||
@@ -1096,20 +957,16 @@ function validate(props, propName, componentName, location, propFullName) { | ||
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. | ||
} | ||
// We need to check all keys in case some are required but missing from props. | ||
var allKeys = assign({}, props[propName], shapeTypes); | ||
for (var key in allKeys) { | ||
var checker = shapeTypes[key]; | ||
if (has(shapeTypes, key) && typeof checker !== 'function') { | ||
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); | ||
} | ||
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) { | ||
@@ -1119,9 +976,6 @@ return error; | ||
} | ||
return null; | ||
} | ||
return createChainableTypeChecker(validate); | ||
} | ||
function isNode(propValue) { | ||
@@ -1133,6 +987,4 @@ switch (typeof propValue) { | ||
return true; | ||
case 'boolean': | ||
return !propValue; | ||
case 'object': | ||
@@ -1142,13 +994,9 @@ if (Array.isArray(propValue)) { | ||
} | ||
if (propValue === null || isValidElement(propValue)) { | ||
return true; | ||
} | ||
var iteratorFn = getIteratorFn(propValue); | ||
if (iteratorFn) { | ||
var iterator = iteratorFn.call(propValue); | ||
var step; | ||
if (iteratorFn !== propValue.entries) { | ||
@@ -1164,3 +1012,2 @@ while (!(step = iterator.next()).done) { | ||
var entry = step.value; | ||
if (entry) { | ||
@@ -1176,5 +1023,3 @@ if (!isNode(entry[1])) { | ||
} | ||
return true; | ||
default: | ||
@@ -1184,3 +1029,2 @@ return false; | ||
} | ||
function isSymbol(propType, propValue) { | ||
@@ -1190,30 +1034,27 @@ // Native Symbol. | ||
return true; | ||
} // falsy value can't be a Symbol | ||
} | ||
// falsy value can't be a Symbol | ||
if (!propValue) { | ||
return false; | ||
} // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' | ||
} | ||
// 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' | ||
if (propValue['@@toStringTag'] === 'Symbol') { | ||
return true; | ||
} // Fallback for non-spec compliant Symbols which are polyfilled. | ||
} | ||
// 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. | ||
} | ||
// 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) { | ||
@@ -1225,12 +1066,10 @@ // Old webkits (at least until Android 4.0) return 'function' rather than | ||
} | ||
if (isSymbol(propType, propValue)) { | ||
return 'symbol'; | ||
} | ||
return propType; | ||
} | ||
return propType; | ||
} // This handles more types than `getPropType`. Only used for error messages. | ||
// This handles more types than `getPropType`. Only used for error messages. | ||
// See `createPrimitiveTypeChecker`. | ||
function getPreciseType(propValue) { | ||
@@ -1240,5 +1079,3 @@ if (typeof propValue === 'undefined' || propValue === null) { | ||
} | ||
var propType = getPropType(propValue); | ||
if (propType === 'object') { | ||
@@ -1251,11 +1088,9 @@ if (propValue instanceof Date) { | ||
} | ||
return propType; | ||
} | ||
return propType; | ||
} // Returns a string that is postfixed to a warning about an invalid type. | ||
// 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) { | ||
@@ -1265,3 +1100,2 @@ case 'array': | ||
return 'an ' + type; | ||
case 'boolean': | ||
@@ -1271,9 +1105,8 @@ case 'date': | ||
return 'a ' + type; | ||
default: | ||
return type; | ||
} | ||
} // Returns class name of the object, if any. | ||
} | ||
// Returns class name of the object, if any. | ||
function getClassName(propValue) { | ||
@@ -1283,6 +1116,4 @@ if (!propValue.constructor || !propValue.constructor.name) { | ||
} | ||
return propValue.constructor.name; | ||
} | ||
ReactPropTypes.checkPropTypes = checkPropTypes; | ||
@@ -1293,2 +1124,3 @@ ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache; | ||
}; | ||
/** | ||
@@ -1301,11 +1133,6 @@ * Copyright (c) 2013-present, Facebook, Inc. | ||
var ReactPropTypesSecret = ReactPropTypesSecret_1; | ||
function emptyFunction() {} | ||
function emptyFunctionWithReset() {} | ||
emptyFunctionWithReset.resetWarningCache = emptyFunction; | ||
var factoryWithThrowingShims = function () { | ||
@@ -1317,3 +1144,2 @@ function shim(props, propName, componentName, location, propFullName, secret) { | ||
} | ||
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'); | ||
@@ -1323,5 +1149,3 @@ err.name = 'Invariant Violation'; | ||
} | ||
shim.isRequired = shim; | ||
function getShim() { | ||
@@ -1331,6 +1155,5 @@ return shim; | ||
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. | ||
var ReactPropTypes = { | ||
array: shim, | ||
bigint: shim, | ||
bool: shim, | ||
@@ -1359,2 +1182,3 @@ func: shim, | ||
}; | ||
/** | ||
@@ -1367,7 +1191,7 @@ * Copyright (c) 2013-present, Facebook, Inc. | ||
if (process.env.NODE_ENV !== 'production') { | ||
var ReactIs = reactIs.exports; | ||
if (process.env.NODE_ENV !== 'production') { | ||
var ReactIs = reactIs.exports; // By explicitly using `prop-types` you are opting into new development behavior. | ||
// By explicitly using `prop-types` you are opting into new development behavior. | ||
// http://fb.me/prop-types-in-prod | ||
var throwOnDirectAccess = true; | ||
@@ -1380,6 +1204,4 @@ propTypes.exports = factoryWithTypeCheckers(ReactIs.isElement, throwOnDirectAccess); | ||
} | ||
var PropTypes = propTypes.exports; | ||
var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); | ||
var _createClass$1 = function () { | ||
@@ -1395,3 +1217,2 @@ function defineProperties(target, props) { | ||
} | ||
return function (Constructor, protoProps, staticProps) { | ||
@@ -1403,3 +1224,2 @@ if (protoProps) defineProperties(Constructor.prototype, protoProps); | ||
}(); | ||
function _classCallCheck$1(instance, Constructor) { | ||
@@ -1410,3 +1230,2 @@ if (!(instance instanceof Constructor)) { | ||
} | ||
function _possibleConstructorReturn$1(self, call) { | ||
@@ -1416,6 +1235,4 @@ if (!self) { | ||
} | ||
return call && (typeof call === "object" || typeof call === "function") ? call : self; | ||
} | ||
function _inherits$1(subClass, superClass) { | ||
@@ -1425,3 +1242,2 @@ if (typeof superClass !== "function" && superClass !== null) { | ||
} | ||
subClass.prototype = Object.create(superClass && superClass.prototype, { | ||
@@ -1437,12 +1253,8 @@ constructor: { | ||
} | ||
var Portal$3 = function (_React$Component) { | ||
_inherits$1(Portal, _React$Component); | ||
function Portal() { | ||
_classCallCheck$1(this, Portal); | ||
return _possibleConstructorReturn$1(this, (Portal.__proto__ || Object.getPrototypeOf(Portal)).apply(this, arguments)); | ||
} | ||
_createClass$1(Portal, [{ | ||
@@ -1454,3 +1266,2 @@ key: 'componentWillUnmount', | ||
} | ||
this.defaultNode = null; | ||
@@ -1464,3 +1275,2 @@ } | ||
} | ||
if (!this.props.node && !this.defaultNode) { | ||
@@ -1470,10 +1280,7 @@ this.defaultNode = document.createElement('div'); | ||
} | ||
return ReactDOM__default["default"].createPortal(this.props.children, this.props.node || this.defaultNode); | ||
} | ||
}]); | ||
return Portal; | ||
}(React__default["default"].Component); | ||
Portal$3.propTypes = { | ||
@@ -1484,3 +1291,2 @@ children: PropTypes.node.isRequired, | ||
var Portalv4 = Portal$3; | ||
var _createClass = function () { | ||
@@ -1496,3 +1302,2 @@ function defineProperties(target, props) { | ||
} | ||
return function (Constructor, protoProps, staticProps) { | ||
@@ -1504,3 +1309,2 @@ if (protoProps) defineProperties(Constructor.prototype, protoProps); | ||
}(); | ||
function _classCallCheck(instance, Constructor) { | ||
@@ -1511,3 +1315,2 @@ if (!(instance instanceof Constructor)) { | ||
} | ||
function _possibleConstructorReturn(self, call) { | ||
@@ -1517,6 +1320,4 @@ if (!self) { | ||
} | ||
return call && (typeof call === "object" || typeof call === "function") ? call : self; | ||
} | ||
function _inherits(subClass, superClass) { | ||
@@ -1526,3 +1327,2 @@ if (typeof superClass !== "function" && superClass !== null) { | ||
} | ||
subClass.prototype = Object.create(superClass && superClass.prototype, { | ||
@@ -1538,12 +1338,8 @@ constructor: { | ||
} | ||
var Portal$2 = function (_React$Component) { | ||
_inherits(Portal, _React$Component); | ||
function Portal() { | ||
_classCallCheck(this, Portal); | ||
return _possibleConstructorReturn(this, (Portal.__proto__ || Object.getPrototypeOf(Portal)).apply(this, arguments)); | ||
} | ||
_createClass(Portal, [{ | ||
@@ -1563,7 +1359,5 @@ key: 'componentDidMount', | ||
ReactDOM__default["default"].unmountComponentAtNode(this.defaultNode || this.props.node); | ||
if (this.defaultNode) { | ||
document.body.removeChild(this.defaultNode); | ||
} | ||
this.defaultNode = null; | ||
@@ -1579,9 +1373,7 @@ this.portal = null; | ||
} | ||
var children = this.props.children; // https://gist.github.com/jimfb/d99e0678e9da715ccf6454961ef04d1b | ||
var children = this.props.children; | ||
// https://gist.github.com/jimfb/d99e0678e9da715ccf6454961ef04d1b | ||
if (typeof this.props.children.type === 'function') { | ||
children = React__default["default"].cloneElement(this.props.children); | ||
} | ||
this.portal = ReactDOM__default["default"].unstable_renderSubtreeIntoContainer(this, children, this.props.node || this.defaultNode); | ||
@@ -1595,6 +1387,4 @@ } | ||
}]); | ||
return Portal; | ||
}(React__default["default"].Component); | ||
var LegacyPortal = Portal$2; | ||
@@ -1606,3 +1396,2 @@ Portal$2.propTypes = { | ||
var Portal = void 0; | ||
if (ReactDOM__default["default"].createPortal) { | ||
@@ -1613,5 +1402,3 @@ Portal = Portalv4; | ||
} | ||
var Portal$1 = Portal; | ||
var GroupedPortal = function (_a) { | ||
@@ -1623,5 +1410,4 @@ var children = _a.children; | ||
}; | ||
exports.GroupedPortal = GroupedPortal; | ||
exports.PortalManager = PortalManager; | ||
//# sourceMappingURL=index.js.map |
@@ -7,3 +7,2 @@ import React from 'react'; | ||
var portalsContainerElement = document.getElementById(portalsContainerId); | ||
if (!portalsContainerElement) { | ||
@@ -15,3 +14,2 @@ var container = document.createElement('div'); | ||
} | ||
portalsContainerElement.style.zIndex = '1000000'; | ||
@@ -28,2 +26,3 @@ return portalsContainerElement; | ||
var reactIs_production_min = {}; | ||
/** @license React v16.13.1 | ||
@@ -37,27 +36,24 @@ * react-is.production.min.js | ||
*/ | ||
var b = "function" === typeof Symbol && Symbol.for, | ||
c = b ? Symbol.for("react.element") : 60103, | ||
d = b ? Symbol.for("react.portal") : 60106, | ||
e = b ? Symbol.for("react.fragment") : 60107, | ||
f = b ? Symbol.for("react.strict_mode") : 60108, | ||
g = b ? Symbol.for("react.profiler") : 60114, | ||
h = b ? Symbol.for("react.provider") : 60109, | ||
k = b ? Symbol.for("react.context") : 60110, | ||
l = b ? Symbol.for("react.async_mode") : 60111, | ||
m = b ? Symbol.for("react.concurrent_mode") : 60111, | ||
n = b ? Symbol.for("react.forward_ref") : 60112, | ||
p = b ? Symbol.for("react.suspense") : 60113, | ||
q = b ? Symbol.for("react.suspense_list") : 60120, | ||
r = b ? Symbol.for("react.memo") : 60115, | ||
t = b ? Symbol.for("react.lazy") : 60116, | ||
v = b ? Symbol.for("react.block") : 60121, | ||
w = b ? Symbol.for("react.fundamental") : 60117, | ||
x = b ? Symbol.for("react.responder") : 60118, | ||
y = b ? Symbol.for("react.scope") : 60119; | ||
c = b ? Symbol.for("react.element") : 60103, | ||
d = b ? Symbol.for("react.portal") : 60106, | ||
e = b ? Symbol.for("react.fragment") : 60107, | ||
f = b ? Symbol.for("react.strict_mode") : 60108, | ||
g = b ? Symbol.for("react.profiler") : 60114, | ||
h = b ? Symbol.for("react.provider") : 60109, | ||
k = b ? Symbol.for("react.context") : 60110, | ||
l = b ? Symbol.for("react.async_mode") : 60111, | ||
m = b ? Symbol.for("react.concurrent_mode") : 60111, | ||
n = b ? Symbol.for("react.forward_ref") : 60112, | ||
p = b ? Symbol.for("react.suspense") : 60113, | ||
q = b ? Symbol.for("react.suspense_list") : 60120, | ||
r = b ? Symbol.for("react.memo") : 60115, | ||
t = b ? Symbol.for("react.lazy") : 60116, | ||
v = b ? Symbol.for("react.block") : 60121, | ||
w = b ? Symbol.for("react.fundamental") : 60117, | ||
x = b ? Symbol.for("react.responder") : 60118, | ||
y = b ? Symbol.for("react.scope") : 60119; | ||
function z(a) { | ||
if ("object" === typeof a && null !== a) { | ||
var u = a.$$typeof; | ||
switch (u) { | ||
@@ -73,3 +69,2 @@ case c: | ||
return a; | ||
default: | ||
@@ -83,9 +78,6 @@ switch (a = a && a.$$typeof, a) { | ||
return a; | ||
default: | ||
return u; | ||
} | ||
} | ||
case d: | ||
@@ -96,7 +88,5 @@ return u; | ||
} | ||
function A(a) { | ||
return z(a) === m; | ||
} | ||
reactIs_production_min.AsyncMode = l; | ||
@@ -115,59 +105,45 @@ reactIs_production_min.ConcurrentMode = m; | ||
reactIs_production_min.Suspense = p; | ||
reactIs_production_min.isAsyncMode = function (a) { | ||
return A(a) || z(a) === l; | ||
}; | ||
reactIs_production_min.isConcurrentMode = A; | ||
reactIs_production_min.isContextConsumer = function (a) { | ||
return z(a) === k; | ||
}; | ||
reactIs_production_min.isContextProvider = function (a) { | ||
return z(a) === h; | ||
}; | ||
reactIs_production_min.isElement = function (a) { | ||
return "object" === typeof a && null !== a && a.$$typeof === c; | ||
}; | ||
reactIs_production_min.isForwardRef = function (a) { | ||
return z(a) === n; | ||
}; | ||
reactIs_production_min.isFragment = function (a) { | ||
return z(a) === e; | ||
}; | ||
reactIs_production_min.isLazy = function (a) { | ||
return z(a) === t; | ||
}; | ||
reactIs_production_min.isMemo = function (a) { | ||
return z(a) === r; | ||
}; | ||
reactIs_production_min.isPortal = function (a) { | ||
return z(a) === d; | ||
}; | ||
reactIs_production_min.isProfiler = function (a) { | ||
return z(a) === g; | ||
}; | ||
reactIs_production_min.isStrictMode = function (a) { | ||
return z(a) === f; | ||
}; | ||
reactIs_production_min.isSuspense = function (a) { | ||
return z(a) === p; | ||
}; | ||
reactIs_production_min.isValidElementType = function (a) { | ||
return "string" === typeof a || "function" === typeof a || a === e || a === m || a === g || a === f || a === p || a === q || "object" === typeof a && null !== a && (a.$$typeof === t || a.$$typeof === r || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v); | ||
}; | ||
reactIs_production_min.typeOf = z; | ||
var reactIs_development = {}; | ||
/** @license React v16.13.1 | ||
@@ -207,16 +183,13 @@ * react-is.development.js | ||
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7; | ||
function isValidElementType(type) { | ||
return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. | ||
return typeof type === 'string' || typeof type === 'function' || | ||
// Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. | ||
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE); | ||
} | ||
function typeOf(object) { | ||
if (typeof object === 'object' && object !== null) { | ||
var $$typeof = object.$$typeof; | ||
switch ($$typeof) { | ||
case REACT_ELEMENT_TYPE: | ||
var type = object.type; | ||
switch (type) { | ||
@@ -230,6 +203,4 @@ case REACT_ASYNC_MODE_TYPE: | ||
return type; | ||
default: | ||
var $$typeofType = type && type.$$typeof; | ||
switch ($$typeofType) { | ||
@@ -242,9 +213,6 @@ case REACT_CONTEXT_TYPE: | ||
return $$typeofType; | ||
default: | ||
return $$typeof; | ||
} | ||
} | ||
case REACT_PORTAL_TYPE: | ||
@@ -254,7 +222,5 @@ return $$typeof; | ||
} | ||
return undefined; | ||
} // AsyncMode is deprecated along with isAsyncMode | ||
var AsyncMode = REACT_ASYNC_MODE_TYPE; | ||
@@ -285,51 +251,38 @@ var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; | ||
} | ||
function isConcurrentMode(object) { | ||
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE; | ||
} | ||
function isContextConsumer(object) { | ||
return typeOf(object) === REACT_CONTEXT_TYPE; | ||
} | ||
function isContextProvider(object) { | ||
return typeOf(object) === REACT_PROVIDER_TYPE; | ||
} | ||
function isElement(object) { | ||
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; | ||
} | ||
function isForwardRef(object) { | ||
return typeOf(object) === REACT_FORWARD_REF_TYPE; | ||
} | ||
function isFragment(object) { | ||
return typeOf(object) === REACT_FRAGMENT_TYPE; | ||
} | ||
function isLazy(object) { | ||
return typeOf(object) === REACT_LAZY_TYPE; | ||
} | ||
function isMemo(object) { | ||
return typeOf(object) === REACT_MEMO_TYPE; | ||
} | ||
function isPortal(object) { | ||
return typeOf(object) === REACT_PORTAL_TYPE; | ||
} | ||
function isProfiler(object) { | ||
return typeOf(object) === REACT_PROFILER_TYPE; | ||
} | ||
function isStrictMode(object) { | ||
return typeOf(object) === REACT_STRICT_MODE_TYPE; | ||
} | ||
function isSuspense(object) { | ||
return typeOf(object) === REACT_SUSPENSE_TYPE; | ||
} | ||
reactIs_development.AsyncMode = AsyncMode; | ||
@@ -365,3 +318,2 @@ reactIs_development.ConcurrentMode = ConcurrentMode; | ||
} | ||
if (process.env.NODE_ENV === 'production') { | ||
@@ -372,2 +324,3 @@ reactIs.exports = reactIs_production_min; | ||
} | ||
/* | ||
@@ -378,10 +331,6 @@ object-assign | ||
*/ | ||
/* eslint-disable no-unused-vars */ | ||
var getOwnPropertySymbols = Object.getOwnPropertySymbols; | ||
var hasOwnProperty = Object.prototype.hasOwnProperty; | ||
var propIsEnumerable = Object.prototype.propertyIsEnumerable; | ||
function toObject(val) { | ||
@@ -391,6 +340,4 @@ if (val === null || val === undefined) { | ||
} | ||
return Object(val); | ||
} | ||
function shouldUseNative() { | ||
@@ -400,30 +347,26 @@ try { | ||
return false; | ||
} // Detect buggy property enumeration order in older V8 versions. | ||
// https://bugs.chromium.org/p/v8/issues/detail?id=4118 | ||
} | ||
// 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 | ||
} | ||
// 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 | ||
} | ||
// https://bugs.chromium.org/p/v8/issues/detail?id=3056 | ||
var test3 = {}; | ||
@@ -433,7 +376,5 @@ 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { | ||
}); | ||
if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') { | ||
return false; | ||
} | ||
return true; | ||
@@ -445,3 +386,2 @@ } catch (err) { | ||
} | ||
var objectAssign = shouldUseNative() ? Object.assign : function (target, source) { | ||
@@ -451,6 +391,4 @@ var from; | ||
var symbols; | ||
for (var s = 1; s < arguments.length; s++) { | ||
from = Object(arguments[s]); | ||
for (var key in from) { | ||
@@ -461,6 +399,4 @@ if (hasOwnProperty.call(from, key)) { | ||
} | ||
if (getOwnPropertySymbols) { | ||
symbols = getOwnPropertySymbols(from); | ||
for (var i = 0; i < symbols.length; i++) { | ||
@@ -473,5 +409,5 @@ if (propIsEnumerable.call(from, symbols[i])) { | ||
} | ||
return to; | ||
}; | ||
/** | ||
@@ -486,2 +422,4 @@ * Copyright (c) 2013-present, Facebook, Inc. | ||
var ReactPropTypesSecret_1 = ReactPropTypesSecret$3; | ||
var has$2 = Function.call.bind(Object.prototype.hasOwnProperty); | ||
/** | ||
@@ -495,15 +433,11 @@ * Copyright (c) 2013-present, Facebook, Inc. | ||
var printWarning$1 = function () {}; | ||
if (process.env.NODE_ENV !== 'production') { | ||
var ReactPropTypesSecret$2 = ReactPropTypesSecret_1; | ||
var loggedTypeFailures = {}; | ||
var has$1 = Function.call.bind(Object.prototype.hasOwnProperty); | ||
var has$1 = has$2; | ||
printWarning$1 = function (text) { | ||
var message = 'Warning: ' + text; | ||
if (typeof console !== 'undefined') { | ||
console.error(message); | ||
} | ||
try { | ||
@@ -514,5 +448,6 @@ // --- Welcome to debugging React --- | ||
throw new Error(message); | ||
} catch (x) {} | ||
} catch (x) {/**/} | ||
}; | ||
} | ||
/** | ||
@@ -529,4 +464,2 @@ * Assert that the values match with the type specs. | ||
*/ | ||
function checkPropTypes$1(typeSpecs, values, location, componentName, getStack) { | ||
@@ -536,6 +469,6 @@ if (process.env.NODE_ENV !== 'production') { | ||
if (has$1(typeSpecs, typeSpecName)) { | ||
var error; // Prop type validation may throw. In case they do, we don't want to | ||
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 { | ||
@@ -545,7 +478,6 @@ // This is intentionally an invariant that gets caught. It's the same | ||
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] + '`.'); | ||
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] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'); | ||
err.name = 'Invariant Violation'; | ||
throw err; | ||
} | ||
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret$2); | ||
@@ -555,7 +487,5 @@ } catch (ex) { | ||
} | ||
if (error && !(error instanceof Error)) { | ||
printWarning$1((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)) { | ||
@@ -572,2 +502,3 @@ // Only monitor this failure once because there tends to be a lot of the | ||
} | ||
/** | ||
@@ -578,4 +509,2 @@ * Resets warning cache when testing. | ||
*/ | ||
checkPropTypes$1.resetWarningCache = function () { | ||
@@ -586,4 +515,4 @@ if (process.env.NODE_ENV !== 'production') { | ||
}; | ||
var checkPropTypes_1 = checkPropTypes$1; | ||
var checkPropTypes_1 = checkPropTypes$1; | ||
/** | ||
@@ -599,15 +528,11 @@ * Copyright (c) 2013-present, Facebook, Inc. | ||
var ReactPropTypesSecret$1 = ReactPropTypesSecret_1; | ||
var has = has$2; | ||
var checkPropTypes = checkPropTypes_1; | ||
var has = Function.call.bind(Object.prototype.hasOwnProperty); | ||
var printWarning = function () {}; | ||
if (process.env.NODE_ENV !== 'production') { | ||
printWarning = function (text) { | ||
var message = 'Warning: ' + text; | ||
if (typeof console !== 'undefined') { | ||
console.error(message); | ||
} | ||
try { | ||
@@ -621,7 +546,5 @@ // --- Welcome to debugging React --- | ||
} | ||
function emptyFunctionThatReturnsNull() { | ||
return null; | ||
} | ||
var factoryWithTypeCheckers = function (isValidElement, throwOnDirectAccess) { | ||
@@ -646,6 +569,4 @@ /* global Symbol */ | ||
*/ | ||
function getIteratorFn(maybeIterable) { | ||
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); | ||
if (typeof iteratorFn === 'function') { | ||
@@ -655,2 +576,3 @@ return iteratorFn; | ||
} | ||
/** | ||
@@ -703,8 +625,9 @@ * Collection of methods that allow declaration and validation of props that are | ||
var ANONYMOUS = '<<anonymous>>'; | ||
var ANONYMOUS = '<<anonymous>>'; // Important! | ||
// Important! | ||
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`. | ||
var ReactPropTypes = { | ||
array: createPrimitiveTypeChecker('array'), | ||
bigint: createPrimitiveTypeChecker('bigint'), | ||
bool: createPrimitiveTypeChecker('boolean'), | ||
@@ -728,2 +651,3 @@ func: createPrimitiveTypeChecker('function'), | ||
}; | ||
/** | ||
@@ -733,5 +657,3 @@ * inlined Object.is polyfill to avoid requiring consumers ship their own | ||
*/ | ||
/*eslint-disable no-self-compare*/ | ||
function is(x, y) { | ||
@@ -757,12 +679,9 @@ // SameValue algorithm | ||
*/ | ||
function PropTypeError(message) { | ||
function PropTypeError(message, data) { | ||
this.message = message; | ||
this.data = data && typeof data === 'object' ? data : {}; | ||
this.stack = ''; | ||
} // Make `instanceof Error` still work for returned errors. | ||
} | ||
// Make `instanceof Error` still work for returned errors. | ||
PropTypeError.prototype = Error.prototype; | ||
function createChainableTypeChecker(validate) { | ||
@@ -773,7 +692,5 @@ if (process.env.NODE_ENV !== 'production') { | ||
} | ||
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { | ||
componentName = componentName || ANONYMOUS; | ||
propFullName = propFullName || propName; | ||
if (secret !== ReactPropTypesSecret$1) { | ||
@@ -788,4 +705,4 @@ if (throwOnDirectAccess) { | ||
var cacheKey = componentName + ':' + propName; | ||
if (!manualPropTypeCallCache[cacheKey] && // Avoid spamming the console because they are often not actionable except for lib authors | ||
if (!manualPropTypeCallCache[cacheKey] && | ||
// Avoid spamming the console because they are often not actionable except for lib authors | ||
manualPropTypeWarningCount < 3) { | ||
@@ -798,3 +715,2 @@ printWarning('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.'); | ||
} | ||
if (props[propName] == null) { | ||
@@ -805,6 +721,4 @@ if (isRequired) { | ||
} | ||
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); | ||
} | ||
return null; | ||
@@ -815,3 +729,2 @@ } else { | ||
} | ||
var chainedCheckType = checkType.bind(null, false); | ||
@@ -821,3 +734,2 @@ chainedCheckType.isRequired = checkType.bind(null, true); | ||
} | ||
function createPrimitiveTypeChecker(expectedType) { | ||
@@ -827,3 +739,2 @@ function validate(props, propName, componentName, location, propFullName, secret) { | ||
var propType = getPropType(propValue); | ||
if (propType !== expectedType) { | ||
@@ -834,15 +745,13 @@ // `propValue` being instance of, say, date/regexp, pass the 'object' | ||
var preciseType = getPreciseType(propValue); | ||
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.')); | ||
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'), { | ||
expectedType: expectedType | ||
}); | ||
} | ||
return null; | ||
} | ||
return createChainableTypeChecker(validate); | ||
} | ||
function createAnyTypeChecker() { | ||
return createChainableTypeChecker(emptyFunctionThatReturnsNull); | ||
} | ||
function createArrayOfTypeChecker(typeChecker) { | ||
@@ -853,5 +762,3 @@ function validate(props, propName, componentName, location, propFullName) { | ||
} | ||
var propValue = props[propName]; | ||
if (!Array.isArray(propValue)) { | ||
@@ -861,6 +768,4 @@ var propType = getPropType(propValue); | ||
} | ||
for (var i = 0; i < propValue.length; i++) { | ||
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret$1); | ||
if (error instanceof Error) { | ||
@@ -870,13 +775,9 @@ return error; | ||
} | ||
return null; | ||
} | ||
return createChainableTypeChecker(validate); | ||
} | ||
function createElementTypeChecker() { | ||
function validate(props, propName, componentName, location, propFullName) { | ||
var propValue = props[propName]; | ||
if (!isValidElement(propValue)) { | ||
@@ -886,13 +787,9 @@ var propType = getPropType(propValue); | ||
} | ||
return null; | ||
} | ||
return createChainableTypeChecker(validate); | ||
} | ||
function createElementTypeTypeChecker() { | ||
function validate(props, propName, componentName, location, propFullName) { | ||
var propValue = props[propName]; | ||
if (!ReactIs$1.isValidElementType(propValue)) { | ||
@@ -902,9 +799,6 @@ var propType = getPropType(propValue); | ||
} | ||
return null; | ||
} | ||
return createChainableTypeChecker(validate); | ||
} | ||
function createInstanceTypeChecker(expectedClass) { | ||
@@ -917,9 +811,6 @@ function validate(props, propName, componentName, location, propFullName) { | ||
} | ||
return null; | ||
} | ||
return createChainableTypeChecker(validate); | ||
} | ||
function createEnumTypeChecker(expectedValues) { | ||
@@ -934,9 +825,6 @@ if (!Array.isArray(expectedValues)) { | ||
} | ||
return emptyFunctionThatReturnsNull; | ||
} | ||
function validate(props, propName, componentName, location, propFullName) { | ||
var propValue = props[propName]; | ||
for (var i = 0; i < expectedValues.length; i++) { | ||
@@ -947,10 +835,7 @@ if (is(propValue, expectedValues[i])) { | ||
} | ||
var valuesString = JSON.stringify(expectedValues, function replacer(key, value) { | ||
var type = getPreciseType(value); | ||
if (type === 'symbol') { | ||
return String(value); | ||
} | ||
return value; | ||
@@ -960,6 +845,4 @@ }); | ||
} | ||
return createChainableTypeChecker(validate); | ||
} | ||
function createObjectOfTypeChecker(typeChecker) { | ||
@@ -970,14 +853,10 @@ 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 an object.')); | ||
} | ||
for (var key in propValue) { | ||
if (has(propValue, key)) { | ||
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1); | ||
if (error instanceof Error) { | ||
@@ -988,9 +867,6 @@ return error; | ||
} | ||
return null; | ||
} | ||
return createChainableTypeChecker(validate); | ||
} | ||
function createUnionTypeChecker(arrayOfTypeCheckers) { | ||
@@ -1001,6 +877,4 @@ if (!Array.isArray(arrayOfTypeCheckers)) { | ||
} | ||
for (var i = 0; i < arrayOfTypeCheckers.length; i++) { | ||
var checker = arrayOfTypeCheckers[i]; | ||
if (typeof checker !== 'function') { | ||
@@ -1011,18 +885,19 @@ printWarning('Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'); | ||
} | ||
function validate(props, propName, componentName, location, propFullName) { | ||
var expectedTypes = []; | ||
for (var i = 0; i < arrayOfTypeCheckers.length; i++) { | ||
var checker = arrayOfTypeCheckers[i]; | ||
if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret$1) == null) { | ||
var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret$1); | ||
if (checkerResult == null) { | ||
return null; | ||
} | ||
if (checkerResult.data && has(checkerResult.data, 'expectedType')) { | ||
expectedTypes.push(checkerResult.data.expectedType); | ||
} | ||
} | ||
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.')); | ||
var expectedTypesMessage = expectedTypes.length > 0 ? ', expected one of type [' + expectedTypes.join(', ') + ']' : ''; | ||
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.')); | ||
} | ||
return createChainableTypeChecker(validate); | ||
} | ||
function createNodeChecker() { | ||
@@ -1033,9 +908,9 @@ function validate(props, propName, componentName, location, propFullName) { | ||
} | ||
return null; | ||
} | ||
return createChainableTypeChecker(validate); | ||
} | ||
function invalidValidatorError(componentName, location, propFullName, key, type) { | ||
return new PropTypeError((componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'); | ||
} | ||
function createShapeTypeChecker(shapeTypes) { | ||
@@ -1045,16 +920,11 @@ function validate(props, propName, componentName, location, propFullName) { | ||
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; | ||
if (typeof checker !== 'function') { | ||
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); | ||
} | ||
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1); | ||
if (error) { | ||
@@ -1064,9 +934,6 @@ return error; | ||
} | ||
return null; | ||
} | ||
return createChainableTypeChecker(validate); | ||
} | ||
function createStrictShapeTypeChecker(shapeTypes) { | ||
@@ -1076,20 +943,16 @@ function validate(props, propName, componentName, location, propFullName) { | ||
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. | ||
} | ||
// We need to check all keys in case some are required but missing from props. | ||
var allKeys = assign({}, props[propName], shapeTypes); | ||
for (var key in allKeys) { | ||
var checker = shapeTypes[key]; | ||
if (has(shapeTypes, key) && typeof checker !== 'function') { | ||
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); | ||
} | ||
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) { | ||
@@ -1099,9 +962,6 @@ return error; | ||
} | ||
return null; | ||
} | ||
return createChainableTypeChecker(validate); | ||
} | ||
function isNode(propValue) { | ||
@@ -1113,6 +973,4 @@ switch (typeof propValue) { | ||
return true; | ||
case 'boolean': | ||
return !propValue; | ||
case 'object': | ||
@@ -1122,13 +980,9 @@ if (Array.isArray(propValue)) { | ||
} | ||
if (propValue === null || isValidElement(propValue)) { | ||
return true; | ||
} | ||
var iteratorFn = getIteratorFn(propValue); | ||
if (iteratorFn) { | ||
var iterator = iteratorFn.call(propValue); | ||
var step; | ||
if (iteratorFn !== propValue.entries) { | ||
@@ -1144,3 +998,2 @@ while (!(step = iterator.next()).done) { | ||
var entry = step.value; | ||
if (entry) { | ||
@@ -1156,5 +1009,3 @@ if (!isNode(entry[1])) { | ||
} | ||
return true; | ||
default: | ||
@@ -1164,3 +1015,2 @@ return false; | ||
} | ||
function isSymbol(propType, propValue) { | ||
@@ -1170,30 +1020,27 @@ // Native Symbol. | ||
return true; | ||
} // falsy value can't be a Symbol | ||
} | ||
// falsy value can't be a Symbol | ||
if (!propValue) { | ||
return false; | ||
} // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' | ||
} | ||
// 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' | ||
if (propValue['@@toStringTag'] === 'Symbol') { | ||
return true; | ||
} // Fallback for non-spec compliant Symbols which are polyfilled. | ||
} | ||
// 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. | ||
} | ||
// 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) { | ||
@@ -1205,12 +1052,10 @@ // Old webkits (at least until Android 4.0) return 'function' rather than | ||
} | ||
if (isSymbol(propType, propValue)) { | ||
return 'symbol'; | ||
} | ||
return propType; | ||
} | ||
return propType; | ||
} // This handles more types than `getPropType`. Only used for error messages. | ||
// This handles more types than `getPropType`. Only used for error messages. | ||
// See `createPrimitiveTypeChecker`. | ||
function getPreciseType(propValue) { | ||
@@ -1220,5 +1065,3 @@ if (typeof propValue === 'undefined' || propValue === null) { | ||
} | ||
var propType = getPropType(propValue); | ||
if (propType === 'object') { | ||
@@ -1231,11 +1074,9 @@ if (propValue instanceof Date) { | ||
} | ||
return propType; | ||
} | ||
return propType; | ||
} // Returns a string that is postfixed to a warning about an invalid type. | ||
// 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) { | ||
@@ -1245,3 +1086,2 @@ case 'array': | ||
return 'an ' + type; | ||
case 'boolean': | ||
@@ -1251,9 +1091,8 @@ case 'date': | ||
return 'a ' + type; | ||
default: | ||
return type; | ||
} | ||
} // Returns class name of the object, if any. | ||
} | ||
// Returns class name of the object, if any. | ||
function getClassName(propValue) { | ||
@@ -1263,6 +1102,4 @@ if (!propValue.constructor || !propValue.constructor.name) { | ||
} | ||
return propValue.constructor.name; | ||
} | ||
ReactPropTypes.checkPropTypes = checkPropTypes; | ||
@@ -1273,2 +1110,3 @@ ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache; | ||
}; | ||
/** | ||
@@ -1281,11 +1119,6 @@ * Copyright (c) 2013-present, Facebook, Inc. | ||
var ReactPropTypesSecret = ReactPropTypesSecret_1; | ||
function emptyFunction() {} | ||
function emptyFunctionWithReset() {} | ||
emptyFunctionWithReset.resetWarningCache = emptyFunction; | ||
var factoryWithThrowingShims = function () { | ||
@@ -1297,3 +1130,2 @@ function shim(props, propName, componentName, location, propFullName, secret) { | ||
} | ||
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'); | ||
@@ -1303,5 +1135,3 @@ err.name = 'Invariant Violation'; | ||
} | ||
shim.isRequired = shim; | ||
function getShim() { | ||
@@ -1311,6 +1141,5 @@ return shim; | ||
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. | ||
var ReactPropTypes = { | ||
array: shim, | ||
bigint: shim, | ||
bool: shim, | ||
@@ -1339,2 +1168,3 @@ func: shim, | ||
}; | ||
/** | ||
@@ -1347,7 +1177,7 @@ * Copyright (c) 2013-present, Facebook, Inc. | ||
if (process.env.NODE_ENV !== 'production') { | ||
var ReactIs = reactIs.exports; | ||
if (process.env.NODE_ENV !== 'production') { | ||
var ReactIs = reactIs.exports; // By explicitly using `prop-types` you are opting into new development behavior. | ||
// By explicitly using `prop-types` you are opting into new development behavior. | ||
// http://fb.me/prop-types-in-prod | ||
var throwOnDirectAccess = true; | ||
@@ -1360,6 +1190,4 @@ propTypes.exports = factoryWithTypeCheckers(ReactIs.isElement, throwOnDirectAccess); | ||
} | ||
var PropTypes = propTypes.exports; | ||
var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); | ||
var _createClass$1 = function () { | ||
@@ -1375,3 +1203,2 @@ function defineProperties(target, props) { | ||
} | ||
return function (Constructor, protoProps, staticProps) { | ||
@@ -1383,3 +1210,2 @@ if (protoProps) defineProperties(Constructor.prototype, protoProps); | ||
}(); | ||
function _classCallCheck$1(instance, Constructor) { | ||
@@ -1390,3 +1216,2 @@ if (!(instance instanceof Constructor)) { | ||
} | ||
function _possibleConstructorReturn$1(self, call) { | ||
@@ -1396,6 +1221,4 @@ if (!self) { | ||
} | ||
return call && (typeof call === "object" || typeof call === "function") ? call : self; | ||
} | ||
function _inherits$1(subClass, superClass) { | ||
@@ -1405,3 +1228,2 @@ if (typeof superClass !== "function" && superClass !== null) { | ||
} | ||
subClass.prototype = Object.create(superClass && superClass.prototype, { | ||
@@ -1417,12 +1239,8 @@ constructor: { | ||
} | ||
var Portal$3 = function (_React$Component) { | ||
_inherits$1(Portal, _React$Component); | ||
function Portal() { | ||
_classCallCheck$1(this, Portal); | ||
return _possibleConstructorReturn$1(this, (Portal.__proto__ || Object.getPrototypeOf(Portal)).apply(this, arguments)); | ||
} | ||
_createClass$1(Portal, [{ | ||
@@ -1434,3 +1252,2 @@ key: 'componentWillUnmount', | ||
} | ||
this.defaultNode = null; | ||
@@ -1444,3 +1261,2 @@ } | ||
} | ||
if (!this.props.node && !this.defaultNode) { | ||
@@ -1450,10 +1266,7 @@ this.defaultNode = document.createElement('div'); | ||
} | ||
return /*#__PURE__*/ReactDOM.createPortal(this.props.children, this.props.node || this.defaultNode); | ||
} | ||
}]); | ||
return Portal; | ||
}(React.Component); | ||
Portal$3.propTypes = { | ||
@@ -1464,3 +1277,2 @@ children: PropTypes.node.isRequired, | ||
var Portalv4 = Portal$3; | ||
var _createClass = function () { | ||
@@ -1476,3 +1288,2 @@ function defineProperties(target, props) { | ||
} | ||
return function (Constructor, protoProps, staticProps) { | ||
@@ -1484,3 +1295,2 @@ if (protoProps) defineProperties(Constructor.prototype, protoProps); | ||
}(); | ||
function _classCallCheck(instance, Constructor) { | ||
@@ -1491,3 +1301,2 @@ if (!(instance instanceof Constructor)) { | ||
} | ||
function _possibleConstructorReturn(self, call) { | ||
@@ -1497,6 +1306,4 @@ if (!self) { | ||
} | ||
return call && (typeof call === "object" || typeof call === "function") ? call : self; | ||
} | ||
function _inherits(subClass, superClass) { | ||
@@ -1506,3 +1313,2 @@ if (typeof superClass !== "function" && superClass !== null) { | ||
} | ||
subClass.prototype = Object.create(superClass && superClass.prototype, { | ||
@@ -1518,12 +1324,8 @@ constructor: { | ||
} | ||
var Portal$2 = function (_React$Component) { | ||
_inherits(Portal, _React$Component); | ||
function Portal() { | ||
_classCallCheck(this, Portal); | ||
return _possibleConstructorReturn(this, (Portal.__proto__ || Object.getPrototypeOf(Portal)).apply(this, arguments)); | ||
} | ||
_createClass(Portal, [{ | ||
@@ -1543,7 +1345,5 @@ key: 'componentDidMount', | ||
ReactDOM.unmountComponentAtNode(this.defaultNode || this.props.node); | ||
if (this.defaultNode) { | ||
document.body.removeChild(this.defaultNode); | ||
} | ||
this.defaultNode = null; | ||
@@ -1559,9 +1359,7 @@ this.portal = null; | ||
} | ||
var children = this.props.children; // https://gist.github.com/jimfb/d99e0678e9da715ccf6454961ef04d1b | ||
var children = this.props.children; | ||
// https://gist.github.com/jimfb/d99e0678e9da715ccf6454961ef04d1b | ||
if (typeof this.props.children.type === 'function') { | ||
children = /*#__PURE__*/React.cloneElement(this.props.children); | ||
} | ||
this.portal = ReactDOM.unstable_renderSubtreeIntoContainer(this, children, this.props.node || this.defaultNode); | ||
@@ -1575,6 +1373,4 @@ } | ||
}]); | ||
return Portal; | ||
}(React.Component); | ||
var LegacyPortal = Portal$2; | ||
@@ -1586,3 +1382,2 @@ Portal$2.propTypes = { | ||
var Portal = void 0; | ||
if (ReactDOM.createPortal) { | ||
@@ -1593,5 +1388,3 @@ Portal = Portalv4; | ||
} | ||
var Portal$1 = Portal; | ||
var GroupedPortal = function (_a) { | ||
@@ -1603,4 +1396,3 @@ var children = _a.children; | ||
}; | ||
export { GroupedPortal, PortalManager }; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@highlight-ui/utils-portal-manager", | ||
"version": "3.1.7", | ||
"version": "3.1.8", | ||
"author": "Personio GmbH & Co. KG", | ||
@@ -23,5 +23,5 @@ "main": "dist/cjs/index.js", | ||
"devDependencies": { | ||
"@highlight-ui/configs-base-jest": "^3.1.1", | ||
"@highlight-ui/configs-base-tsconfig": "^3.2.0", | ||
"@highlight-ui/configs-scripts": "^3.2.2", | ||
"@highlight-ui/configs-base-jest": "^3.1.2", | ||
"@highlight-ui/configs-base-tsconfig": "^3.2.1", | ||
"@highlight-ui/configs-scripts": "^3.2.3", | ||
"@testing-library/dom": "8.19.0", | ||
@@ -32,10 +32,10 @@ "@testing-library/react": "12.1.5", | ||
"@types/react-portal": "4.0.4", | ||
"jest": "^27.2.3", | ||
"react": "^17.0.2", | ||
"react-dom": "^17.0.2", | ||
"rimraf": "^3.0.2" | ||
"jest": "~27.2.3", | ||
"react": "17.0.2", | ||
"react-dom": "17.0.2", | ||
"rimraf": "~3.0.2" | ||
}, | ||
"peerDependencies": { | ||
"classnames": "^2.3.1", | ||
"react": "^17.0.2" | ||
"classnames": "~2.3.1", | ||
"react": "17.0.2" | ||
}, | ||
@@ -45,3 +45,3 @@ "dependencies": { | ||
}, | ||
"gitHead": "936ba15aea7fc0f54f5646572bcb128c7390a09b" | ||
"gitHead": "3758f5f987510edb100f5a22ebe829b7cee4573f" | ||
} |
Sorry, the diff of this file is not supported yet
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
294723
2548