|
344 | 344 | /* 4 */ |
345 | 345 | /***/ function(module, exports) { |
346 | 346 |
|
| 347 | + /* |
| 348 | + object-assign |
| 349 | + (c) Sindre Sorhus |
| 350 | + @license MIT |
| 351 | + */ |
| 352 | + |
347 | 353 | 'use strict'; |
348 | 354 | /* eslint-disable no-unused-vars */ |
| 355 | + var getOwnPropertySymbols = Object.getOwnPropertySymbols; |
349 | 356 | var hasOwnProperty = Object.prototype.hasOwnProperty; |
350 | 357 | var propIsEnumerable = Object.prototype.propertyIsEnumerable; |
351 | 358 |
|
|
366 | 373 | // Detect buggy property enumeration order in older V8 versions. |
367 | 374 |
|
368 | 375 | // https://bugs.chromium.org/p/v8/issues/detail?id=4118 |
369 | | - var test1 = new String('abc'); // eslint-disable-line |
| 376 | + var test1 = new String('abc'); // eslint-disable-line no-new-wrappers |
370 | 377 | test1[5] = 'de'; |
371 | 378 | if (Object.getOwnPropertyNames(test1)[0] === '5') { |
372 | 379 | return false; |
|
395 | 402 | } |
396 | 403 |
|
397 | 404 | return true; |
398 | | - } catch (e) { |
| 405 | + } catch (err) { |
399 | 406 | // We don't expect any of the above to throw, but better to be safe. |
400 | 407 | return false; |
401 | 408 | } |
|
415 | 422 | } |
416 | 423 | } |
417 | 424 |
|
418 | | - if (Object.getOwnPropertySymbols) { |
419 | | - symbols = Object.getOwnPropertySymbols(from); |
| 425 | + if (getOwnPropertySymbols) { |
| 426 | + symbols = getOwnPropertySymbols(from); |
420 | 427 | for (var i = 0; i < symbols.length; i++) { |
421 | 428 | if (propIsEnumerable.call(from, symbols[i])) { |
422 | 429 | to[symbols[i]] = from[symbols[i]]; |
|
696 | 703 | } |
697 | 704 | }; |
698 | 705 |
|
699 | | - var fiveArgumentPooler = function (a1, a2, a3, a4, a5) { |
700 | | - var Klass = this; |
701 | | - if (Klass.instancePool.length) { |
702 | | - var instance = Klass.instancePool.pop(); |
703 | | - Klass.call(instance, a1, a2, a3, a4, a5); |
704 | | - return instance; |
705 | | - } else { |
706 | | - return new Klass(a1, a2, a3, a4, a5); |
707 | | - } |
708 | | - }; |
709 | | - |
710 | 706 | var standardReleaser = function (instance) { |
711 | 707 | var Klass = this; |
712 | 708 | !(instance instanceof Klass) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : _prodInvariant('25') : void 0; |
|
746 | 742 | oneArgumentPooler: oneArgumentPooler, |
747 | 743 | twoArgumentPooler: twoArgumentPooler, |
748 | 744 | threeArgumentPooler: threeArgumentPooler, |
749 | | - fourArgumentPooler: fourArgumentPooler, |
750 | | - fiveArgumentPooler: fiveArgumentPooler |
| 745 | + fourArgumentPooler: fourArgumentPooler |
751 | 746 | }; |
752 | 747 |
|
753 | 748 | module.exports = PooledClass; |
|
823 | 818 | * will remain to ensure logic does not differ in production. |
824 | 819 | */ |
825 | 820 |
|
826 | | - function invariant(condition, format, a, b, c, d, e, f) { |
827 | | - if (process.env.NODE_ENV !== 'production') { |
| 821 | + var validateFormat = function validateFormat(format) {}; |
| 822 | + |
| 823 | + if (process.env.NODE_ENV !== 'production') { |
| 824 | + validateFormat = function validateFormat(format) { |
828 | 825 | if (format === undefined) { |
829 | 826 | throw new Error('invariant requires an error message argument'); |
830 | 827 | } |
831 | | - } |
| 828 | + }; |
| 829 | + } |
| 830 | + |
| 831 | + function invariant(condition, format, a, b, c, d, e, f) { |
| 832 | + validateFormat(format); |
832 | 833 |
|
833 | 834 | if (!condition) { |
834 | 835 | var error; |
|
3081 | 3082 | // We warn in this case but don't throw. We expect the element creation to |
3082 | 3083 | // succeed and there will likely be errors in render. |
3083 | 3084 | if (!validType) { |
3084 | | - process.env.NODE_ENV !== 'production' ? warning(false, 'React.createElement: type should not be null, undefined, boolean, or ' + 'number. It should be a string (for DOM elements) or a ReactClass ' + '(for composite components).%s', getDeclarationErrorAddendum()) : void 0; |
| 3085 | + if (typeof type !== 'function' && typeof type !== 'string') { |
| 3086 | + var info = ''; |
| 3087 | + if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) { |
| 3088 | + info += ' You likely forgot to export your component from the file ' + 'it\'s defined in.'; |
| 3089 | + } |
| 3090 | + info += getDeclarationErrorAddendum(); |
| 3091 | + process.env.NODE_ENV !== 'production' ? warning(false, 'React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', type == null ? type : typeof type, info) : void 0; |
| 3092 | + } |
3085 | 3093 | } |
3086 | 3094 |
|
3087 | 3095 | var element = ReactElement.createElement.apply(this, arguments); |
|
4052 | 4060 |
|
4053 | 4061 | 'use strict'; |
4054 | 4062 |
|
4055 | | - module.exports = '15.4.1'; |
| 4063 | + module.exports = '15.4.2'; |
4056 | 4064 |
|
4057 | 4065 | /***/ }, |
4058 | 4066 | /* 31 */ |
|
4250 | 4258 |
|
4251 | 4259 | var internalInstanceKey = '__reactInternalInstance$' + Math.random().toString(36).slice(2); |
4252 | 4260 |
|
| 4261 | + /** |
| 4262 | + * Check if a given node should be cached. |
| 4263 | + */ |
| 4264 | + function shouldPrecacheNode(node, nodeID) { |
| 4265 | + return node.nodeType === 1 && node.getAttribute(ATTR_NAME) === String(nodeID) || node.nodeType === 8 && node.nodeValue === ' react-text: ' + nodeID + ' ' || node.nodeType === 8 && node.nodeValue === ' react-empty: ' + nodeID + ' '; |
| 4266 | + } |
| 4267 | + |
4253 | 4268 | /** |
4254 | 4269 | * Drill down (through composites and empty components) until we get a host or |
4255 | 4270 | * host text component. |
|
4315 | 4330 | } |
4316 | 4331 | // We assume the child nodes are in the same order as the child instances. |
4317 | 4332 | for (; childNode !== null; childNode = childNode.nextSibling) { |
4318 | | - if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') { |
| 4333 | + if (shouldPrecacheNode(childNode, childID)) { |
4319 | 4334 | precacheNode(childInst, childNode); |
4320 | 4335 | continue outer; |
4321 | 4336 | } |
|
6556 | 6571 | } |
6557 | 6572 | }; |
6558 | 6573 |
|
6559 | | - var fiveArgumentPooler = function (a1, a2, a3, a4, a5) { |
6560 | | - var Klass = this; |
6561 | | - if (Klass.instancePool.length) { |
6562 | | - var instance = Klass.instancePool.pop(); |
6563 | | - Klass.call(instance, a1, a2, a3, a4, a5); |
6564 | | - return instance; |
6565 | | - } else { |
6566 | | - return new Klass(a1, a2, a3, a4, a5); |
6567 | | - } |
6568 | | - }; |
6569 | | - |
6570 | 6574 | var standardReleaser = function (instance) { |
6571 | 6575 | var Klass = this; |
6572 | 6576 | !(instance instanceof Klass) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : _prodInvariant('25') : void 0; |
|
6606 | 6610 | oneArgumentPooler: oneArgumentPooler, |
6607 | 6611 | twoArgumentPooler: twoArgumentPooler, |
6608 | 6612 | threeArgumentPooler: threeArgumentPooler, |
6609 | | - fourArgumentPooler: fourArgumentPooler, |
6610 | | - fiveArgumentPooler: fiveArgumentPooler |
| 6613 | + fourArgumentPooler: fourArgumentPooler |
6611 | 6614 | }; |
6612 | 6615 |
|
6613 | 6616 | module.exports = PooledClass; |
@@ -11425,12 +11428,18 @@ |
11425 | 11428 | } else { |
11426 | 11429 | var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null; |
11427 | 11430 | var childrenToUse = contentToUse != null ? null : props.children; |
| 11431 | + // TODO: Validate that text is allowed as a child of this node |
11428 | 11432 | if (contentToUse != null) { |
11429 | | - // TODO: Validate that text is allowed as a child of this node |
11430 | | - if (process.env.NODE_ENV !== 'production') { |
11431 | | - setAndValidateContentChildDev.call(this, contentToUse); |
| 11433 | + // Avoid setting textContent when the text is empty. In IE11 setting |
| 11434 | + // textContent on a text area will cause the placeholder to not |
| 11435 | + // show within the textarea until it has been focused and blurred again. |
| 11436 | + // https://github.com/facebook/react/issues/6731#issuecomment-254874553 |
| 11437 | + if (contentToUse !== '') { |
| 11438 | + if (process.env.NODE_ENV !== 'production') { |
| 11439 | + setAndValidateContentChildDev.call(this, contentToUse); |
| 11440 | + } |
| 11441 | + DOMLazyTree.queueText(lazyTree, contentToUse); |
11432 | 11442 | } |
11433 | | - DOMLazyTree.queueText(lazyTree, contentToUse); |
11434 | 11443 | } else if (childrenToUse != null) { |
11435 | 11444 | var mountImages = this.mountChildren(childrenToUse, transaction, context); |
11436 | 11445 | for (var i = 0; i < mountImages.length; i++) { |
|
13350 | 13359 | } |
13351 | 13360 | } else { |
13352 | 13361 | if (props.value == null && props.defaultValue != null) { |
13353 | | - node.defaultValue = '' + props.defaultValue; |
| 13362 | + // In Chrome, assigning defaultValue to certain input types triggers input validation. |
| 13363 | + // For number inputs, the display value loses trailing decimal points. For email inputs, |
| 13364 | + // Chrome raises "The specified value <x> is not a valid email address". |
| 13365 | + // |
| 13366 | + // Here we check to see if the defaultValue has actually changed, avoiding these problems |
| 13367 | + // when the user is inputting text |
| 13368 | + // |
| 13369 | + // https://github.com/facebook/react/issues/7253 |
| 13370 | + if (node.defaultValue !== '' + props.defaultValue) { |
| 13371 | + node.defaultValue = '' + props.defaultValue; |
| 13372 | + } |
13354 | 13373 | } |
13355 | 13374 | if (props.checked == null && props.defaultChecked != null) { |
13356 | 13375 | node.defaultChecked = !!props.defaultChecked; |
|
14097 | 14116 | // This is in postMount because we need access to the DOM node, which is not |
14098 | 14117 | // available until after the component has mounted. |
14099 | 14118 | var node = ReactDOMComponentTree.getNodeFromInstance(inst); |
| 14119 | + var textContent = node.textContent; |
14100 | 14120 |
|
14101 | | - // Warning: node.value may be the empty string at this point (IE11) if placeholder is set. |
14102 | | - node.value = node.textContent; // Detach value from defaultValue |
| 14121 | + // Only set node.value if textContent is equal to the expected |
| 14122 | + // initial value. In IE10/IE11 there is a bug where the placeholder attribute |
| 14123 | + // will populate textContent as well. |
| 14124 | + // https://developer.microsoft.com/microsoft-edge/platform/issues/101525/ |
| 14125 | + if (textContent === inst._wrapperState.initialValue) { |
| 14126 | + node.value = textContent; |
| 14127 | + } |
14103 | 14128 | } |
14104 | 14129 | }; |
14105 | 14130 |
|
|
14901 | 14926 | instance = ReactEmptyComponent.create(instantiateReactComponent); |
14902 | 14927 | } else if (typeof node === 'object') { |
14903 | 14928 | var element = node; |
14904 | | - !(element && (typeof element.type === 'function' || typeof element.type === 'string')) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s', element.type == null ? element.type : typeof element.type, getDeclarationErrorAddendum(element._owner)) : _prodInvariant('130', element.type == null ? element.type : typeof element.type, getDeclarationErrorAddendum(element._owner)) : void 0; |
| 14929 | + var type = element.type; |
| 14930 | + if (typeof type !== 'function' && typeof type !== 'string') { |
| 14931 | + var info = ''; |
| 14932 | + if (process.env.NODE_ENV !== 'production') { |
| 14933 | + if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) { |
| 14934 | + info += ' You likely forgot to export your component from the file ' + 'it\'s defined in.'; |
| 14935 | + } |
| 14936 | + } |
| 14937 | + info += getDeclarationErrorAddendum(element._owner); |
| 14938 | + true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s', type == null ? type : typeof type, info) : _prodInvariant('130', type == null ? type : typeof type, info) : void 0; |
| 14939 | + } |
14905 | 14940 |
|
14906 | 14941 | // Special case string values |
14907 | 14942 | if (typeof element.type === 'string') { |
|
15191 | 15226 | // Since plain JS classes are defined without any special initialization |
15192 | 15227 | // logic, we can not catch common errors early. Therefore, we have to |
15193 | 15228 | // catch them here, at initialization time, instead. |
15194 | | - process.env.NODE_ENV !== 'production' ? warning(!inst.getInitialState || inst.getInitialState.isReactClassApproved, 'getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', this.getName() || 'a component') : void 0; |
| 15229 | + process.env.NODE_ENV !== 'production' ? warning(!inst.getInitialState || inst.getInitialState.isReactClassApproved || inst.state, 'getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', this.getName() || 'a component') : void 0; |
15195 | 15230 | process.env.NODE_ENV !== 'production' ? warning(!inst.getDefaultProps || inst.getDefaultProps.isReactClassApproved, 'getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', this.getName() || 'a component') : void 0; |
15196 | 15231 | process.env.NODE_ENV !== 'production' ? warning(!inst.propTypes, 'propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', this.getName() || 'a component') : void 0; |
15197 | 15232 | process.env.NODE_ENV !== 'production' ? warning(!inst.contextTypes, 'contextTypes was defined as an instance property on %s. Use a ' + 'static property to define contextTypes instead.', this.getName() || 'a component') : void 0; |
@@ -16195,14 +16230,11 @@ |
16195 | 16230 |
|
16196 | 16231 | 'use strict'; |
16197 | 16232 |
|
16198 | | - var _prodInvariant = __webpack_require__(35), |
16199 | | - _assign = __webpack_require__(4); |
| 16233 | + var _prodInvariant = __webpack_require__(35); |
16200 | 16234 |
|
16201 | 16235 | var invariant = __webpack_require__(8); |
16202 | 16236 |
|
16203 | 16237 | var genericComponentClass = null; |
16204 | | - // This registry keeps track of wrapper classes around host tags. |
16205 | | - var tagToComponentClass = {}; |
16206 | 16238 | var textComponentClass = null; |
16207 | 16239 |
|
16208 | 16240 | var ReactHostComponentInjection = { |
|
16215 | 16247 | // rendered as props. |
16216 | 16248 | injectTextComponentClass: function (componentClass) { |
16217 | 16249 | textComponentClass = componentClass; |
16218 | | - }, |
16219 | | - // This accepts a keyed object with classes as values. Each key represents a |
16220 | | - // tag. That particular tag will use this class instead of the generic one. |
16221 | | - injectComponentClasses: function (componentClasses) { |
16222 | | - _assign(tagToComponentClass, componentClasses); |
16223 | 16250 | } |
16224 | 16251 | }; |
16225 | 16252 |
|
@@ -18259,10 +18286,10 @@ |
18259 | 18286 | */ |
18260 | 18287 |
|
18261 | 18288 | function getUnboundedScrollPosition(scrollable) { |
18262 | | - if (scrollable === window) { |
| 18289 | + if (scrollable.Window && scrollable instanceof scrollable.Window) { |
18263 | 18290 | return { |
18264 | | - x: window.pageXOffset || document.documentElement.scrollLeft, |
18265 | | - y: window.pageYOffset || document.documentElement.scrollTop |
| 18291 | + x: scrollable.pageXOffset || scrollable.document.documentElement.scrollLeft, |
| 18292 | + y: scrollable.pageYOffset || scrollable.document.documentElement.scrollTop |
18266 | 18293 | }; |
18267 | 18294 | } |
18268 | 18295 | return { |
|
19011 | 19038 | * @return {boolean} Whether or not the object is a DOM node. |
19012 | 19039 | */ |
19013 | 19040 | function isNode(object) { |
19014 | | - return !!(object && (typeof Node === 'function' ? object instanceof Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string')); |
| 19041 | + var doc = object ? object.ownerDocument || object : document; |
| 19042 | + var defaultView = doc.defaultView || window; |
| 19043 | + return !!(object && (typeof defaultView.Node === 'function' ? object instanceof defaultView.Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string')); |
19015 | 19044 | } |
19016 | 19045 |
|
19017 | 19046 | module.exports = isNode; |
@@ -19041,15 +19070,19 @@ |
19041 | 19070 | * |
19042 | 19071 | * The activeElement will be null only if the document or document body is not |
19043 | 19072 | * yet defined. |
| 19073 | + * |
| 19074 | + * @param {?DOMDocument} doc Defaults to current document. |
| 19075 | + * @return {?DOMElement} |
19044 | 19076 | */ |
19045 | | - function getActiveElement() /*?DOMElement*/{ |
19046 | | - if (typeof document === 'undefined') { |
| 19077 | + function getActiveElement(doc) /*?DOMElement*/{ |
| 19078 | + doc = doc || (typeof document !== 'undefined' ? document : undefined); |
| 19079 | + if (typeof doc === 'undefined') { |
19047 | 19080 | return null; |
19048 | 19081 | } |
19049 | 19082 | try { |
19050 | | - return document.activeElement || document.body; |
| 19083 | + return doc.activeElement || doc.body; |
19051 | 19084 | } catch (e) { |
19052 | | - return document.body; |
| 19085 | + return doc.body; |
19053 | 19086 | } |
19054 | 19087 | } |
19055 | 19088 |
|
|
21074 | 21107 |
|
21075 | 21108 | 'use strict'; |
21076 | 21109 |
|
21077 | | - module.exports = '15.4.1'; |
| 21110 | + module.exports = '15.4.2'; |
21078 | 21111 |
|
21079 | 21112 | /***/ }, |
21080 | 21113 | /* 172 */ |
|
0 commit comments