react 15.3.2 → 15.4.0-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/react-with-addons.js +3864 -21390
- package/dist/react-with-addons.min.js +3 -6
- package/dist/react.js +2639 -19486
- package/dist/react.min.js +2 -6
- package/lib/KeyEscapeUtils.js +0 -1
- package/lib/LinkedStateMixin.js +1 -3
- package/lib/PooledClass.js +3 -1
- package/lib/React.js +0 -1
- package/lib/ReactAddonsDOMDependencies.js +35 -0
- package/lib/ReactAddonsDOMDependenciesUMDShim.js +31 -0
- package/lib/ReactCSSTransitionGroup.js +60 -43
- package/lib/ReactCSSTransitionGroupChild.js +2 -3
- package/lib/ReactChildren.js +0 -1
- package/lib/ReactClass.js +38 -54
- package/lib/ReactComponent.js +0 -1
- package/lib/ReactComponentTreeDevtool.js +0 -1
- package/lib/ReactComponentTreeHook.js +84 -101
- package/lib/{DOMNamespaces.js → ReactComponentTreeHookUMDShim.js} +4 -7
- package/lib/ReactComponentWithPureRenderMixin.js +0 -1
- package/lib/ReactCurrentOwner.js +1 -2
- package/lib/{renderSubtreeIntoContainer.js → ReactCurrentOwnerUMDShim.js} +5 -4
- package/lib/ReactDOMFactories.js +0 -1
- package/lib/ReactElement.js +6 -14
- package/lib/ReactElementSymbol.js +19 -0
- package/lib/{ReactDOMComponentFlags.js → ReactElementType.js} +3 -9
- package/lib/ReactElementValidator.js +1 -3
- package/lib/ReactFragment.js +0 -1
- package/lib/ReactLink.js +0 -1
- package/lib/ReactNoopUpdateQueue.js +0 -1
- package/lib/ReactPropTypeLocationNames.js +1 -1
- package/lib/ReactPropTypeLocations.js +2 -12
- package/lib/ReactPropTypes.js +5 -3
- package/lib/ReactPropTypesSecret.js +1 -1
- package/lib/ReactPureComponent.js +0 -1
- package/lib/ReactStateSetters.js +0 -1
- package/lib/ReactTransitionChildMapping.js +0 -1
- package/lib/ReactTransitionEvents.js +1 -2
- package/lib/ReactTransitionGroup.js +145 -142
- package/lib/ReactUMDEntry.js +11 -6
- package/lib/{ReactDOMFeatureFlags.js → ReactUMDShim.js} +3 -6
- package/lib/ReactVersion.js +1 -2
- package/lib/ReactWithAddons.js +15 -3
- package/lib/ReactWithAddonsUMDEntry.js +11 -6
- package/lib/canDefineProperty.js +2 -1
- package/lib/checkReactTypeSpec.js +0 -1
- package/lib/deprecated.js +0 -1
- package/lib/flattenChildren.js +0 -1
- package/lib/getIteratorFn.js +0 -1
- package/lib/onlyChild.js +0 -1
- package/lib/reactProdInvariant.js +0 -1
- package/lib/shallowCompare.js +1 -2
- package/lib/sliceChildren.js +0 -1
- package/lib/traverseAllChildren.js +11 -3
- package/lib/update.js +6 -8
- package/package.json +1 -1
- package/lib/AutoFocusUtils.js +0 -24
- package/lib/BeforeInputEventPlugin.js +0 -390
- package/lib/CSSProperty.js +0 -148
- package/lib/CSSPropertyOperations.js +0 -205
- package/lib/CallbackQueue.js +0 -106
- package/lib/ChangeEventPlugin.js +0 -325
- package/lib/DOMChildrenOperations.js +0 -194
- package/lib/DOMLazyTree.js +0 -118
- package/lib/DOMProperty.js +0 -206
- package/lib/DOMPropertyOperations.js +0 -221
- package/lib/Danger.js +0 -48
- package/lib/DefaultEventPluginOrder.js +0 -27
- package/lib/DisabledInputUtils.js +0 -50
- package/lib/EnterLeaveEventPlugin.js +0 -105
- package/lib/EventConstants.js +0 -97
- package/lib/EventPluginHub.js +0 -251
- package/lib/EventPluginRegistry.js +0 -247
- package/lib/EventPluginUtils.js +0 -229
- package/lib/EventPropagators.js +0 -137
- package/lib/FallbackCompositionState.js +0 -95
- package/lib/HTMLDOMPropertyConfig.js +0 -212
- package/lib/LinkedValueUtils.js +0 -136
- package/lib/NativeMethodsMixin.js +0 -167
- package/lib/ReactBrowserEventEmitter.js +0 -330
- package/lib/ReactChildReconciler.js +0 -154
- package/lib/ReactChildrenMutationWarningHook.js +0 -54
- package/lib/ReactComponentBrowserEnvironment.js +0 -30
- package/lib/ReactComponentEnvironment.js +0 -45
- package/lib/ReactComponentTreeTestUtils.js +0 -87
- package/lib/ReactCompositeComponent.js +0 -904
- package/lib/ReactDOM.js +0 -110
- package/lib/ReactDOMButton.js +0 -24
- package/lib/ReactDOMComponent.js +0 -1006
- package/lib/ReactDOMComponentTree.js +0 -188
- package/lib/ReactDOMContainerInfo.js +0 -33
- package/lib/ReactDOMEmptyComponent.js +0 -60
- package/lib/ReactDOMFiber.js +0 -76
- package/lib/ReactDOMIDOperations.js +0 -34
- package/lib/ReactDOMInput.js +0 -269
- package/lib/ReactDOMNullInputValuePropHook.js +0 -43
- package/lib/ReactDOMOption.js +0 -123
- package/lib/ReactDOMSelect.js +0 -201
- package/lib/ReactDOMSelection.js +0 -212
- package/lib/ReactDOMServer.js +0 -26
- package/lib/ReactDOMTextComponent.js +0 -164
- package/lib/ReactDOMTextarea.js +0 -155
- package/lib/ReactDOMTreeTraversal.js +0 -136
- package/lib/ReactDOMUnknownPropertyHook.js +0 -112
- package/lib/ReactDebugTool.js +0 -301
- package/lib/ReactDefaultBatchingStrategy.js +0 -68
- package/lib/ReactDefaultInjection.js +0 -84
- package/lib/ReactEmptyComponent.js +0 -30
- package/lib/ReactErrorUtils.js +0 -76
- package/lib/ReactEventEmitterMixin.js +0 -33
- package/lib/ReactEventListener.js +0 -157
- package/lib/ReactFeatureFlags.js +0 -22
- package/lib/ReactHostComponent.js +0 -76
- package/lib/ReactHostOperationHistoryHook.js +0 -37
- package/lib/ReactInjection.js +0 -36
- package/lib/ReactInputSelection.js +0 -124
- package/lib/ReactInstanceHandles.js +0 -302
- package/lib/ReactInstanceMap.js +0 -48
- package/lib/ReactInstrumentation.js +0 -21
- package/lib/ReactInvalidSetStateWarningHook.js +0 -36
- package/lib/ReactMarkupChecksum.js +0 -50
- package/lib/ReactMount.js +0 -534
- package/lib/ReactMultiChild.js +0 -451
- package/lib/ReactMultiChildUpdateTypes.js +0 -32
- package/lib/ReactNative.js +0 -71
- package/lib/ReactNativeAttributePayload.js +0 -371
- package/lib/ReactNativeBaseComponent.js +0 -198
- package/lib/ReactNativeBridgeEventPlugin.js +0 -60
- package/lib/ReactNativeComponentEnvironment.js +0 -31
- package/lib/ReactNativeComponentTree.js +0 -68
- package/lib/ReactNativeContainerInfo.js +0 -21
- package/lib/ReactNativeDOMIDOperations.js +0 -79
- package/lib/ReactNativeDefaultInjection.js +0 -101
- package/lib/ReactNativeEventEmitter.js +0 -191
- package/lib/ReactNativeEventPluginOrder.js +0 -16
- package/lib/ReactNativeGlobalResponderHandler.js +0 -25
- package/lib/ReactNativeMount.js +0 -193
- package/lib/ReactNativePropRegistry.js +0 -52
- package/lib/ReactNativeReconcileTransaction.js +0 -129
- package/lib/ReactNativeTagHandles.js +0 -56
- package/lib/ReactNativeTextComponent.js +0 -71
- package/lib/ReactNativeTreeTraversal.js +0 -127
- package/lib/ReactNodeTypes.js +0 -40
- package/lib/ReactNoop.js +0 -173
- package/lib/ReactOwner.js +0 -94
- package/lib/ReactPerf.js +0 -494
- package/lib/ReactReconcileTransaction.js +0 -178
- package/lib/ReactReconciler.js +0 -168
- package/lib/ReactRef.js +0 -80
- package/lib/ReactServerBatchingStrategy.js +0 -22
- package/lib/ReactServerRendering.js +0 -90
- package/lib/ReactServerRenderingTransaction.js +0 -90
- package/lib/ReactServerUpdateQueue.js +0 -141
- package/lib/ReactSimpleEmptyComponent.js +0 -37
- package/lib/ReactTestMount.js +0 -126
- package/lib/ReactTestReconcileTransaction.js +0 -121
- package/lib/ReactTestRenderer.js +0 -144
- package/lib/ReactTestUtils.js +0 -518
- package/lib/ReactUpdateQueue.js +0 -226
- package/lib/ReactUpdates.js +0 -251
- package/lib/ResponderEventPlugin.js +0 -510
- package/lib/ResponderSyntheticEvent.js +0 -39
- package/lib/ResponderTouchHistoryStore.js +0 -184
- package/lib/SVGDOMPropertyConfig.js +0 -302
- package/lib/SelectEventPlugin.js +0 -196
- package/lib/SimpleEventPlugin.js +0 -635
- package/lib/SyntheticAnimationEvent.js +0 -39
- package/lib/SyntheticClipboardEvent.js +0 -38
- package/lib/SyntheticCompositionEvent.js +0 -36
- package/lib/SyntheticDragEvent.js +0 -36
- package/lib/SyntheticEvent.js +0 -268
- package/lib/SyntheticFocusEvent.js +0 -36
- package/lib/SyntheticInputEvent.js +0 -37
- package/lib/SyntheticKeyboardEvent.js +0 -84
- package/lib/SyntheticMouseEvent.js +0 -72
- package/lib/SyntheticTouchEvent.js +0 -45
- package/lib/SyntheticTransitionEvent.js +0 -39
- package/lib/SyntheticUIEvent.js +0 -59
- package/lib/SyntheticWheelEvent.js +0 -54
- package/lib/TapEventPlugin.js +0 -110
- package/lib/TouchHistoryMath.js +0 -99
- package/lib/Transaction.js +0 -233
- package/lib/ViewportMetrics.js +0 -27
- package/lib/accumulate.js +0 -46
- package/lib/accumulateInto.js +0 -58
- package/lib/adler32.js +0 -44
- package/lib/createMicrosoftUnsafeLocalFunction.js +0 -32
- package/lib/createReactNativeComponentClass.js +0 -42
- package/lib/dangerousStyleValue.js +0 -79
- package/lib/escapeTextContentForBrowser.js +0 -123
- package/lib/findDOMNode.js +0 -60
- package/lib/findNodeHandle.js +0 -91
- package/lib/forEachAccumulated.js +0 -31
- package/lib/getEventCharCode.js +0 -50
- package/lib/getEventKey.js +0 -102
- package/lib/getEventModifierState.js +0 -43
- package/lib/getEventTarget.js +0 -35
- package/lib/getHostComponentFromComposite.js +0 -30
- package/lib/getNodeForCharacterOffset.js +0 -74
- package/lib/getTestDocument.js +0 -21
- package/lib/getTextContentAccessor.js +0 -33
- package/lib/getVendorPrefixedEventName.js +0 -101
- package/lib/instantiateReactComponent.js +0 -119
- package/lib/isEventSupported.js +0 -60
- package/lib/isTextInputElement.js +0 -51
- package/lib/quoteAttributeValueForBrowser.js +0 -26
- package/lib/reactComponentExpect.js +0 -217
- package/lib/setInnerHTML.js +0 -98
- package/lib/setTextContent.js +0 -48
- package/lib/shouldUpdateReactComponent.js +0 -42
- package/lib/validateDOMNesting.js +0 -382
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2014-present, Facebook, Inc.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the BSD-style license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
'use strict';
|
|
13
|
+
|
|
14
|
+
// The Symbol used to tag the ReactElement type. If there is no native Symbol
|
|
15
|
+
// nor polyfill, then a plain number is used for performance.
|
|
16
|
+
|
|
17
|
+
var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;
|
|
18
|
+
|
|
19
|
+
module.exports = REACT_ELEMENT_TYPE;
|
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright
|
|
2
|
+
* Copyright 2016-present, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
7
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
9
|
+
*
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
'use strict';
|
|
13
|
-
|
|
14
|
-
var ReactDOMComponentFlags = {
|
|
15
|
-
hasCachedChildNodes: 1 << 0
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
module.exports = ReactDOMComponentFlags;
|
|
12
|
+
'use strict';
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
7
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
8
|
*
|
|
9
|
-
* @providesModule ReactElementValidator
|
|
10
9
|
*/
|
|
11
10
|
|
|
12
11
|
/**
|
|
@@ -21,7 +20,6 @@
|
|
|
21
20
|
var ReactCurrentOwner = require('./ReactCurrentOwner');
|
|
22
21
|
var ReactComponentTreeHook = require('./ReactComponentTreeHook');
|
|
23
22
|
var ReactElement = require('./ReactElement');
|
|
24
|
-
var ReactPropTypeLocations = require('./ReactPropTypeLocations');
|
|
25
23
|
|
|
26
24
|
var checkReactTypeSpec = require('./checkReactTypeSpec');
|
|
27
25
|
|
|
@@ -150,7 +148,7 @@ function validatePropTypes(element) {
|
|
|
150
148
|
}
|
|
151
149
|
var name = componentClass.displayName || componentClass.name;
|
|
152
150
|
if (componentClass.propTypes) {
|
|
153
|
-
checkReactTypeSpec(componentClass.propTypes, element.props,
|
|
151
|
+
checkReactTypeSpec(componentClass.propTypes, element.props, 'prop', name, element, null);
|
|
154
152
|
}
|
|
155
153
|
if (typeof componentClass.getDefaultProps === 'function') {
|
|
156
154
|
process.env.NODE_ENV !== 'production' ? warning(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0;
|
package/lib/ReactFragment.js
CHANGED
package/lib/ReactLink.js
CHANGED
|
@@ -6,17 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
7
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
9
|
+
*
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
'use strict';
|
|
13
|
-
|
|
14
|
-
var keyMirror = require('fbjs/lib/keyMirror');
|
|
15
|
-
|
|
16
|
-
var ReactPropTypeLocations = keyMirror({
|
|
17
|
-
prop: null,
|
|
18
|
-
context: null,
|
|
19
|
-
childContext: null
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
module.exports = ReactPropTypeLocations;
|
|
12
|
+
'use strict';
|
package/lib/ReactPropTypes.js
CHANGED
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
7
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
8
|
*
|
|
9
|
-
* @providesModule ReactPropTypes
|
|
10
9
|
*/
|
|
11
10
|
|
|
12
11
|
'use strict';
|
|
@@ -131,7 +130,7 @@ function createChainableTypeChecker(validate) {
|
|
|
131
130
|
if (secret !== ReactPropTypesSecret && typeof console !== 'undefined') {
|
|
132
131
|
var cacheKey = componentName + ':' + propName;
|
|
133
132
|
if (!manualPropTypeCallCache[cacheKey]) {
|
|
134
|
-
process.env.NODE_ENV !== 'production' ? warning(false, 'You are manually calling a React.PropTypes validation ' + 'function for the `%s` prop on `%s`. This is deprecated ' + 'and will not work in the next major version. You may be
|
|
133
|
+
process.env.NODE_ENV !== 'production' ? warning(false, 'You are manually calling a React.PropTypes validation ' + 'function for the `%s` prop on `%s`. This is deprecated ' + 'and will not work in production with the next major version. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.', propFullName, componentName) : void 0;
|
|
135
134
|
manualPropTypeCallCache[cacheKey] = true;
|
|
136
135
|
}
|
|
137
136
|
}
|
|
@@ -139,7 +138,10 @@ function createChainableTypeChecker(validate) {
|
|
|
139
138
|
if (props[propName] == null) {
|
|
140
139
|
var locationName = ReactPropTypeLocationNames[location];
|
|
141
140
|
if (isRequired) {
|
|
142
|
-
|
|
141
|
+
if (props[propName] === null) {
|
|
142
|
+
return new PropTypeError('The ' + locationName + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
|
|
143
|
+
}
|
|
144
|
+
return new PropTypeError('The ' + locationName + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
|
|
143
145
|
}
|
|
144
146
|
return null;
|
|
145
147
|
} else {
|
package/lib/ReactStateSetters.js
CHANGED
|
@@ -6,14 +6,13 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
7
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
8
|
*
|
|
9
|
-
* @providesModule ReactTransitionEvents
|
|
10
9
|
*/
|
|
11
10
|
|
|
12
11
|
'use strict';
|
|
13
12
|
|
|
14
13
|
var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');
|
|
15
14
|
|
|
16
|
-
var getVendorPrefixedEventName = require('
|
|
15
|
+
var getVendorPrefixedEventName = require('react-dom/lib/getVendorPrefixedEventName');
|
|
17
16
|
|
|
18
17
|
var endEvents = [];
|
|
19
18
|
|
|
@@ -6,15 +6,20 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
7
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
8
|
*
|
|
9
|
-
* @providesModule ReactTransitionGroup
|
|
10
9
|
*/
|
|
11
10
|
|
|
12
11
|
'use strict';
|
|
13
12
|
|
|
14
13
|
var _assign = require('object-assign');
|
|
15
14
|
|
|
15
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
16
|
+
|
|
17
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
18
|
+
|
|
19
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
20
|
+
|
|
16
21
|
var React = require('./React');
|
|
17
|
-
var
|
|
22
|
+
var ReactAddonsDOMDependencies = require('./ReactAddonsDOMDependencies');
|
|
18
23
|
var ReactTransitionChildMapping = require('./ReactTransitionChildMapping');
|
|
19
24
|
|
|
20
25
|
var emptyFunction = require('fbjs/lib/emptyFunction');
|
|
@@ -24,47 +29,140 @@ var emptyFunction = require('fbjs/lib/emptyFunction');
|
|
|
24
29
|
* special lifecycle hooks are called.
|
|
25
30
|
* See https://facebook.github.io/react/docs/animation.html#low-level-api-reacttransitiongroup
|
|
26
31
|
*/
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
getInitialState: function () {
|
|
43
|
-
return {
|
|
32
|
+
|
|
33
|
+
var ReactTransitionGroup = function (_React$Component) {
|
|
34
|
+
_inherits(ReactTransitionGroup, _React$Component);
|
|
35
|
+
|
|
36
|
+
function ReactTransitionGroup() {
|
|
37
|
+
var _temp, _this, _ret;
|
|
38
|
+
|
|
39
|
+
_classCallCheck(this, ReactTransitionGroup);
|
|
40
|
+
|
|
41
|
+
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
42
|
+
args[_key] = arguments[_key];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {
|
|
44
46
|
// TODO: can we get useful debug information to show at this point?
|
|
45
|
-
children: ReactTransitionChildMapping.getChildMapping(
|
|
46
|
-
}
|
|
47
|
-
|
|
47
|
+
children: ReactTransitionChildMapping.getChildMapping(_this.props.children)
|
|
48
|
+
}, _this.performAppear = function (key) {
|
|
49
|
+
_this.currentlyTransitioningKeys[key] = true;
|
|
50
|
+
|
|
51
|
+
var component = _this.refs[key];
|
|
52
|
+
|
|
53
|
+
if (component.componentWillAppear) {
|
|
54
|
+
component.componentWillAppear(_this._handleDoneAppearing.bind(_this, key));
|
|
55
|
+
} else {
|
|
56
|
+
_this._handleDoneAppearing(key);
|
|
57
|
+
}
|
|
58
|
+
}, _this._handleDoneAppearing = function (key) {
|
|
59
|
+
var component = _this.refs[key];
|
|
60
|
+
if (component.componentDidAppear) {
|
|
61
|
+
component.componentDidAppear();
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
delete _this.currentlyTransitioningKeys[key];
|
|
65
|
+
|
|
66
|
+
var currentChildMapping;
|
|
67
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
68
|
+
currentChildMapping = ReactTransitionChildMapping.getChildMapping(_this.props.children, ReactAddonsDOMDependencies.getReactInstanceMap().get(_this)._debugID);
|
|
69
|
+
} else {
|
|
70
|
+
currentChildMapping = ReactTransitionChildMapping.getChildMapping(_this.props.children);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (!currentChildMapping || !currentChildMapping.hasOwnProperty(key)) {
|
|
74
|
+
// This was removed before it had fully appeared. Remove it.
|
|
75
|
+
_this.performLeave(key);
|
|
76
|
+
}
|
|
77
|
+
}, _this.performEnter = function (key) {
|
|
78
|
+
_this.currentlyTransitioningKeys[key] = true;
|
|
79
|
+
|
|
80
|
+
var component = _this.refs[key];
|
|
81
|
+
|
|
82
|
+
if (component.componentWillEnter) {
|
|
83
|
+
component.componentWillEnter(_this._handleDoneEntering.bind(_this, key));
|
|
84
|
+
} else {
|
|
85
|
+
_this._handleDoneEntering(key);
|
|
86
|
+
}
|
|
87
|
+
}, _this._handleDoneEntering = function (key) {
|
|
88
|
+
var component = _this.refs[key];
|
|
89
|
+
if (component.componentDidEnter) {
|
|
90
|
+
component.componentDidEnter();
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
delete _this.currentlyTransitioningKeys[key];
|
|
94
|
+
|
|
95
|
+
var currentChildMapping;
|
|
96
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
97
|
+
currentChildMapping = ReactTransitionChildMapping.getChildMapping(_this.props.children, ReactAddonsDOMDependencies.getReactInstanceMap().get(_this)._debugID);
|
|
98
|
+
} else {
|
|
99
|
+
currentChildMapping = ReactTransitionChildMapping.getChildMapping(_this.props.children);
|
|
100
|
+
}
|
|
48
101
|
|
|
49
|
-
|
|
102
|
+
if (!currentChildMapping || !currentChildMapping.hasOwnProperty(key)) {
|
|
103
|
+
// This was removed before it had fully entered. Remove it.
|
|
104
|
+
_this.performLeave(key);
|
|
105
|
+
}
|
|
106
|
+
}, _this.performLeave = function (key) {
|
|
107
|
+
_this.currentlyTransitioningKeys[key] = true;
|
|
108
|
+
|
|
109
|
+
var component = _this.refs[key];
|
|
110
|
+
if (component.componentWillLeave) {
|
|
111
|
+
component.componentWillLeave(_this._handleDoneLeaving.bind(_this, key));
|
|
112
|
+
} else {
|
|
113
|
+
// Note that this is somewhat dangerous b/c it calls setState()
|
|
114
|
+
// again, effectively mutating the component before all the work
|
|
115
|
+
// is done.
|
|
116
|
+
_this._handleDoneLeaving(key);
|
|
117
|
+
}
|
|
118
|
+
}, _this._handleDoneLeaving = function (key) {
|
|
119
|
+
var component = _this.refs[key];
|
|
120
|
+
|
|
121
|
+
if (component.componentDidLeave) {
|
|
122
|
+
component.componentDidLeave();
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
delete _this.currentlyTransitioningKeys[key];
|
|
126
|
+
|
|
127
|
+
var currentChildMapping;
|
|
128
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
129
|
+
currentChildMapping = ReactTransitionChildMapping.getChildMapping(_this.props.children, ReactAddonsDOMDependencies.getReactInstanceMap().get(_this)._debugID);
|
|
130
|
+
} else {
|
|
131
|
+
currentChildMapping = ReactTransitionChildMapping.getChildMapping(_this.props.children);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
if (currentChildMapping && currentChildMapping.hasOwnProperty(key)) {
|
|
135
|
+
// This entered again before it fully left. Add it again.
|
|
136
|
+
_this.performEnter(key);
|
|
137
|
+
} else {
|
|
138
|
+
_this.setState(function (state) {
|
|
139
|
+
var newChildren = _assign({}, state.children);
|
|
140
|
+
delete newChildren[key];
|
|
141
|
+
return { children: newChildren };
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
}, _temp), _possibleConstructorReturn(_this, _ret);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
ReactTransitionGroup.prototype.componentWillMount = function componentWillMount() {
|
|
50
148
|
this.currentlyTransitioningKeys = {};
|
|
51
149
|
this.keysToEnter = [];
|
|
52
150
|
this.keysToLeave = [];
|
|
53
|
-
}
|
|
151
|
+
};
|
|
54
152
|
|
|
55
|
-
componentDidMount
|
|
153
|
+
ReactTransitionGroup.prototype.componentDidMount = function componentDidMount() {
|
|
56
154
|
var initialChildMapping = this.state.children;
|
|
57
155
|
for (var key in initialChildMapping) {
|
|
58
156
|
if (initialChildMapping[key]) {
|
|
59
157
|
this.performAppear(key);
|
|
60
158
|
}
|
|
61
159
|
}
|
|
62
|
-
}
|
|
160
|
+
};
|
|
63
161
|
|
|
64
|
-
componentWillReceiveProps
|
|
162
|
+
ReactTransitionGroup.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
|
65
163
|
var nextChildMapping;
|
|
66
164
|
if (process.env.NODE_ENV !== 'production') {
|
|
67
|
-
nextChildMapping = ReactTransitionChildMapping.getChildMapping(nextProps.children,
|
|
165
|
+
nextChildMapping = ReactTransitionChildMapping.getChildMapping(nextProps.children, ReactAddonsDOMDependencies.getReactInstanceMap().get(this)._debugID);
|
|
68
166
|
} else {
|
|
69
167
|
nextChildMapping = ReactTransitionChildMapping.getChildMapping(nextProps.children);
|
|
70
168
|
}
|
|
@@ -91,9 +189,9 @@ var ReactTransitionGroup = React.createClass({
|
|
|
91
189
|
}
|
|
92
190
|
|
|
93
191
|
// If we want to someday check for reordering, we could do it here.
|
|
94
|
-
}
|
|
192
|
+
};
|
|
95
193
|
|
|
96
|
-
componentDidUpdate
|
|
194
|
+
ReactTransitionGroup.prototype.componentDidUpdate = function componentDidUpdate() {
|
|
97
195
|
var keysToEnter = this.keysToEnter;
|
|
98
196
|
this.keysToEnter = [];
|
|
99
197
|
keysToEnter.forEach(this.performEnter);
|
|
@@ -101,117 +199,9 @@ var ReactTransitionGroup = React.createClass({
|
|
|
101
199
|
var keysToLeave = this.keysToLeave;
|
|
102
200
|
this.keysToLeave = [];
|
|
103
201
|
keysToLeave.forEach(this.performLeave);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
performAppear: function (key) {
|
|
107
|
-
this.currentlyTransitioningKeys[key] = true;
|
|
202
|
+
};
|
|
108
203
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
if (component.componentWillAppear) {
|
|
112
|
-
component.componentWillAppear(this._handleDoneAppearing.bind(this, key));
|
|
113
|
-
} else {
|
|
114
|
-
this._handleDoneAppearing(key);
|
|
115
|
-
}
|
|
116
|
-
},
|
|
117
|
-
|
|
118
|
-
_handleDoneAppearing: function (key) {
|
|
119
|
-
var component = this.refs[key];
|
|
120
|
-
if (component.componentDidAppear) {
|
|
121
|
-
component.componentDidAppear();
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
delete this.currentlyTransitioningKeys[key];
|
|
125
|
-
|
|
126
|
-
var currentChildMapping;
|
|
127
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
128
|
-
currentChildMapping = ReactTransitionChildMapping.getChildMapping(this.props.children, ReactInstanceMap.get(this)._debugID);
|
|
129
|
-
} else {
|
|
130
|
-
currentChildMapping = ReactTransitionChildMapping.getChildMapping(this.props.children);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
if (!currentChildMapping || !currentChildMapping.hasOwnProperty(key)) {
|
|
134
|
-
// This was removed before it had fully appeared. Remove it.
|
|
135
|
-
this.performLeave(key);
|
|
136
|
-
}
|
|
137
|
-
},
|
|
138
|
-
|
|
139
|
-
performEnter: function (key) {
|
|
140
|
-
this.currentlyTransitioningKeys[key] = true;
|
|
141
|
-
|
|
142
|
-
var component = this.refs[key];
|
|
143
|
-
|
|
144
|
-
if (component.componentWillEnter) {
|
|
145
|
-
component.componentWillEnter(this._handleDoneEntering.bind(this, key));
|
|
146
|
-
} else {
|
|
147
|
-
this._handleDoneEntering(key);
|
|
148
|
-
}
|
|
149
|
-
},
|
|
150
|
-
|
|
151
|
-
_handleDoneEntering: function (key) {
|
|
152
|
-
var component = this.refs[key];
|
|
153
|
-
if (component.componentDidEnter) {
|
|
154
|
-
component.componentDidEnter();
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
delete this.currentlyTransitioningKeys[key];
|
|
158
|
-
|
|
159
|
-
var currentChildMapping;
|
|
160
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
161
|
-
currentChildMapping = ReactTransitionChildMapping.getChildMapping(this.props.children, ReactInstanceMap.get(this)._debugID);
|
|
162
|
-
} else {
|
|
163
|
-
currentChildMapping = ReactTransitionChildMapping.getChildMapping(this.props.children);
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
if (!currentChildMapping || !currentChildMapping.hasOwnProperty(key)) {
|
|
167
|
-
// This was removed before it had fully entered. Remove it.
|
|
168
|
-
this.performLeave(key);
|
|
169
|
-
}
|
|
170
|
-
},
|
|
171
|
-
|
|
172
|
-
performLeave: function (key) {
|
|
173
|
-
this.currentlyTransitioningKeys[key] = true;
|
|
174
|
-
|
|
175
|
-
var component = this.refs[key];
|
|
176
|
-
if (component.componentWillLeave) {
|
|
177
|
-
component.componentWillLeave(this._handleDoneLeaving.bind(this, key));
|
|
178
|
-
} else {
|
|
179
|
-
// Note that this is somewhat dangerous b/c it calls setState()
|
|
180
|
-
// again, effectively mutating the component before all the work
|
|
181
|
-
// is done.
|
|
182
|
-
this._handleDoneLeaving(key);
|
|
183
|
-
}
|
|
184
|
-
},
|
|
185
|
-
|
|
186
|
-
_handleDoneLeaving: function (key) {
|
|
187
|
-
var component = this.refs[key];
|
|
188
|
-
|
|
189
|
-
if (component.componentDidLeave) {
|
|
190
|
-
component.componentDidLeave();
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
delete this.currentlyTransitioningKeys[key];
|
|
194
|
-
|
|
195
|
-
var currentChildMapping;
|
|
196
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
197
|
-
currentChildMapping = ReactTransitionChildMapping.getChildMapping(this.props.children, ReactInstanceMap.get(this)._debugID);
|
|
198
|
-
} else {
|
|
199
|
-
currentChildMapping = ReactTransitionChildMapping.getChildMapping(this.props.children);
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
if (currentChildMapping && currentChildMapping.hasOwnProperty(key)) {
|
|
203
|
-
// This entered again before it fully left. Add it again.
|
|
204
|
-
this.performEnter(key);
|
|
205
|
-
} else {
|
|
206
|
-
this.setState(function (state) {
|
|
207
|
-
var newChildren = _assign({}, state.children);
|
|
208
|
-
delete newChildren[key];
|
|
209
|
-
return { children: newChildren };
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
},
|
|
213
|
-
|
|
214
|
-
render: function () {
|
|
204
|
+
ReactTransitionGroup.prototype.render = function render() {
|
|
215
205
|
// TODO: we could get rid of the need for the wrapper node
|
|
216
206
|
// by cloning a single child
|
|
217
207
|
var childrenToRender = [];
|
|
@@ -240,7 +230,20 @@ var ReactTransitionGroup = React.createClass({
|
|
|
240
230
|
delete props.component;
|
|
241
231
|
|
|
242
232
|
return React.createElement(this.props.component, props, childrenToRender);
|
|
243
|
-
}
|
|
244
|
-
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
return ReactTransitionGroup;
|
|
236
|
+
}(React.Component);
|
|
237
|
+
|
|
238
|
+
ReactTransitionGroup.displayName = 'ReactTransitionGroup';
|
|
239
|
+
ReactTransitionGroup.propTypes = {
|
|
240
|
+
component: React.PropTypes.any,
|
|
241
|
+
childFactory: React.PropTypes.func
|
|
242
|
+
};
|
|
243
|
+
ReactTransitionGroup.defaultProps = {
|
|
244
|
+
component: 'span',
|
|
245
|
+
childFactory: emptyFunction.thatReturnsArgument
|
|
246
|
+
};
|
|
247
|
+
|
|
245
248
|
|
|
246
249
|
module.exports = ReactTransitionGroup;
|