react 15.3.1 → 15.3.2-rc.1
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 +171 -176
- package/dist/react-with-addons.min.js +6 -6
- package/dist/react.js +171 -176
- package/dist/react.min.js +6 -6
- package/lib/BeforeInputEventPlugin.js +3 -1
- package/lib/ChangeEventPlugin.js +2 -2
- package/lib/HTMLDOMPropertyConfig.js +3 -0
- package/lib/ReactBrowserEventEmitter.js +14 -1
- package/lib/ReactCompositeComponent.js +113 -129
- package/lib/ReactDOMComponent.js +10 -9
- package/lib/ReactDOMInput.js +1 -1
- package/lib/ReactDOMTextComponent.js +1 -1
- package/lib/ReactDebugTool.js +0 -6
- package/lib/ReactElement.js +0 -16
- package/lib/ReactNativeReconcileTransaction.js +13 -0
- package/lib/ReactTestReconcileTransaction.js +13 -0
- package/lib/ReactVersion.js +1 -1
- package/lib/SelectEventPlugin.js +1 -1
- package/lib/SyntheticEvent.js +2 -1
- package/lib/setInnerHTML.js +3 -3
- package/lib/validateDOMNesting.js +16 -3
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* React (with addons) v15.3.1
|
|
2
|
+
* React (with addons) v15.3.2-rc.1
|
|
3
3
|
*/
|
|
4
4
|
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.React = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
|
|
5
5
|
/**
|
|
@@ -316,8 +316,10 @@ function getNativeBeforeInputChars(topLevelType, nativeEvent) {
|
|
|
316
316
|
function getFallbackBeforeInputChars(topLevelType, nativeEvent) {
|
|
317
317
|
// If we are currently composing (IME) and using a fallback to do so,
|
|
318
318
|
// try to extract the composed characters from the fallback object.
|
|
319
|
+
// If composition event is available, we extract a string only at
|
|
320
|
+
// compositionevent, otherwise extract it at fallback events.
|
|
319
321
|
if (currentComposition) {
|
|
320
|
-
if (topLevelType === topLevelTypes.topCompositionEnd || isFallbackCompositionEnd(topLevelType, nativeEvent)) {
|
|
322
|
+
if (topLevelType === topLevelTypes.topCompositionEnd || !canUseCompositionEvent && isFallbackCompositionEnd(topLevelType, nativeEvent)) {
|
|
321
323
|
var chars = currentComposition.getData();
|
|
322
324
|
FallbackCompositionState.release(currentComposition);
|
|
323
325
|
currentComposition = null;
|
|
@@ -935,7 +937,7 @@ function shouldUseChangeEvent(elem) {
|
|
|
935
937
|
var doesChangeEventBubble = false;
|
|
936
938
|
if (ExecutionEnvironment.canUseDOM) {
|
|
937
939
|
// See `handleChange` comment below
|
|
938
|
-
doesChangeEventBubble = isEventSupported('change') && (!
|
|
940
|
+
doesChangeEventBubble = isEventSupported('change') && (!document.documentMode || document.documentMode > 8);
|
|
939
941
|
}
|
|
940
942
|
|
|
941
943
|
function manualDispatchChangeEvent(nativeEvent) {
|
|
@@ -1001,7 +1003,7 @@ if (ExecutionEnvironment.canUseDOM) {
|
|
|
1001
1003
|
// deleting text, so we ignore its input events.
|
|
1002
1004
|
// IE10+ fire input events to often, such when a placeholder
|
|
1003
1005
|
// changes or when an input with a placeholder is focused.
|
|
1004
|
-
isInputEventSupported = isEventSupported('input') && (!
|
|
1006
|
+
isInputEventSupported = isEventSupported('input') && (!document.documentMode || document.documentMode > 11);
|
|
1005
1007
|
}
|
|
1006
1008
|
|
|
1007
1009
|
/**
|
|
@@ -3298,6 +3300,8 @@ var HTMLDOMPropertyConfig = {
|
|
|
3298
3300
|
allowFullScreen: HAS_BOOLEAN_VALUE,
|
|
3299
3301
|
allowTransparency: 0,
|
|
3300
3302
|
alt: 0,
|
|
3303
|
+
// specifies target context for links with `preload` type
|
|
3304
|
+
as: 0,
|
|
3301
3305
|
async: HAS_BOOLEAN_VALUE,
|
|
3302
3306
|
autoComplete: 0,
|
|
3303
3307
|
// autoFocus is polyfilled/normalized by AutoFocusUtils
|
|
@@ -3378,6 +3382,7 @@ var HTMLDOMPropertyConfig = {
|
|
|
3378
3382
|
optimum: 0,
|
|
3379
3383
|
pattern: 0,
|
|
3380
3384
|
placeholder: 0,
|
|
3385
|
+
playsInline: HAS_BOOLEAN_VALUE,
|
|
3381
3386
|
poster: 0,
|
|
3382
3387
|
preload: 0,
|
|
3383
3388
|
profile: 0,
|
|
@@ -4212,6 +4217,19 @@ var ReactBrowserEventEmitter = _assign({}, ReactEventEmitterMixin, {
|
|
|
4212
4217
|
return ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelType, handlerBaseName, handle);
|
|
4213
4218
|
},
|
|
4214
4219
|
|
|
4220
|
+
/**
|
|
4221
|
+
* Protect against document.createEvent() returning null
|
|
4222
|
+
* Some popup blocker extensions appear to do this:
|
|
4223
|
+
* https://github.com/facebook/react/issues/6887
|
|
4224
|
+
*/
|
|
4225
|
+
supportsEventPageXY: function () {
|
|
4226
|
+
if (!document.createEvent) {
|
|
4227
|
+
return false;
|
|
4228
|
+
}
|
|
4229
|
+
var ev = document.createEvent('MouseEvent');
|
|
4230
|
+
return ev != null && 'pageX' in ev;
|
|
4231
|
+
},
|
|
4232
|
+
|
|
4215
4233
|
/**
|
|
4216
4234
|
* Listens to window scroll and resize events. We cache scroll values so that
|
|
4217
4235
|
* application code can access them without triggering reflows.
|
|
@@ -4225,7 +4243,7 @@ var ReactBrowserEventEmitter = _assign({}, ReactEventEmitterMixin, {
|
|
|
4225
4243
|
*/
|
|
4226
4244
|
ensureScrollValueMonitoring: function () {
|
|
4227
4245
|
if (hasEventPageXY === undefined) {
|
|
4228
|
-
hasEventPageXY =
|
|
4246
|
+
hasEventPageXY = ReactBrowserEventEmitter.supportsEventPageXY();
|
|
4229
4247
|
}
|
|
4230
4248
|
if (!hasEventPageXY && !isMonitoringScrollValue) {
|
|
4231
4249
|
var refresh = ViewportMetrics.refreshScrollValues;
|
|
@@ -6273,28 +6291,6 @@ function warnIfInvalidElement(Component, element) {
|
|
|
6273
6291
|
}
|
|
6274
6292
|
}
|
|
6275
6293
|
|
|
6276
|
-
function invokeComponentDidMountWithTimer() {
|
|
6277
|
-
var publicInstance = this._instance;
|
|
6278
|
-
if (this._debugID !== 0) {
|
|
6279
|
-
ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentDidMount');
|
|
6280
|
-
}
|
|
6281
|
-
publicInstance.componentDidMount();
|
|
6282
|
-
if (this._debugID !== 0) {
|
|
6283
|
-
ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentDidMount');
|
|
6284
|
-
}
|
|
6285
|
-
}
|
|
6286
|
-
|
|
6287
|
-
function invokeComponentDidUpdateWithTimer(prevProps, prevState, prevContext) {
|
|
6288
|
-
var publicInstance = this._instance;
|
|
6289
|
-
if (this._debugID !== 0) {
|
|
6290
|
-
ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentDidUpdate');
|
|
6291
|
-
}
|
|
6292
|
-
publicInstance.componentDidUpdate(prevProps, prevState, prevContext);
|
|
6293
|
-
if (this._debugID !== 0) {
|
|
6294
|
-
ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentDidUpdate');
|
|
6295
|
-
}
|
|
6296
|
-
}
|
|
6297
|
-
|
|
6298
6294
|
function shouldConstruct(Component) {
|
|
6299
6295
|
return !!(Component.prototype && Component.prototype.isReactComponent);
|
|
6300
6296
|
}
|
|
@@ -6303,6 +6299,23 @@ function isPureComponent(Component) {
|
|
|
6303
6299
|
return !!(Component.prototype && Component.prototype.isPureReactComponent);
|
|
6304
6300
|
}
|
|
6305
6301
|
|
|
6302
|
+
// Separated into a function to contain deoptimizations caused by try/finally.
|
|
6303
|
+
function measureLifeCyclePerf(fn, debugID, timerType) {
|
|
6304
|
+
if (debugID === 0) {
|
|
6305
|
+
// Top-level wrappers (see ReactMount) and empty components (see
|
|
6306
|
+
// ReactDOMEmptyComponent) are invisible to hooks and devtools.
|
|
6307
|
+
// Both are implementation details that should go away in the future.
|
|
6308
|
+
return fn();
|
|
6309
|
+
}
|
|
6310
|
+
|
|
6311
|
+
ReactInstrumentation.debugTool.onBeginLifeCycleTimer(debugID, timerType);
|
|
6312
|
+
try {
|
|
6313
|
+
return fn();
|
|
6314
|
+
} finally {
|
|
6315
|
+
ReactInstrumentation.debugTool.onEndLifeCycleTimer(debugID, timerType);
|
|
6316
|
+
}
|
|
6317
|
+
}
|
|
6318
|
+
|
|
6306
6319
|
/**
|
|
6307
6320
|
* ------------------ The Life-Cycle of a Composite Component ------------------
|
|
6308
6321
|
*
|
|
@@ -6394,6 +6407,8 @@ var ReactCompositeComponentMixin = {
|
|
|
6394
6407
|
* @internal
|
|
6395
6408
|
*/
|
|
6396
6409
|
mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
|
|
6410
|
+
var _this = this;
|
|
6411
|
+
|
|
6397
6412
|
this._context = context;
|
|
6398
6413
|
this._mountOrder = nextMountID++;
|
|
6399
6414
|
this._hostParent = hostParent;
|
|
@@ -6483,7 +6498,11 @@ var ReactCompositeComponentMixin = {
|
|
|
6483
6498
|
|
|
6484
6499
|
if (inst.componentDidMount) {
|
|
6485
6500
|
if ("development" !== 'production') {
|
|
6486
|
-
transaction.getReactMountReady().enqueue(
|
|
6501
|
+
transaction.getReactMountReady().enqueue(function () {
|
|
6502
|
+
measureLifeCyclePerf(function () {
|
|
6503
|
+
return inst.componentDidMount();
|
|
6504
|
+
}, _this._debugID, 'componentDidMount');
|
|
6505
|
+
});
|
|
6487
6506
|
} else {
|
|
6488
6507
|
transaction.getReactMountReady().enqueue(inst.componentDidMount, inst);
|
|
6489
6508
|
}
|
|
@@ -6507,35 +6526,26 @@ var ReactCompositeComponentMixin = {
|
|
|
6507
6526
|
|
|
6508
6527
|
_constructComponentWithoutOwner: function (doConstruct, publicProps, publicContext, updateQueue) {
|
|
6509
6528
|
var Component = this._currentElement.type;
|
|
6510
|
-
|
|
6529
|
+
|
|
6511
6530
|
if (doConstruct) {
|
|
6512
6531
|
if ("development" !== 'production') {
|
|
6513
|
-
|
|
6514
|
-
|
|
6515
|
-
}
|
|
6516
|
-
}
|
|
6517
|
-
|
|
6518
|
-
if ("development" !== 'production') {
|
|
6519
|
-
if (this._debugID !== 0) {
|
|
6520
|
-
ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'ctor');
|
|
6521
|
-
}
|
|
6532
|
+
return measureLifeCyclePerf(function () {
|
|
6533
|
+
return new Component(publicProps, publicContext, updateQueue);
|
|
6534
|
+
}, this._debugID, 'ctor');
|
|
6535
|
+
} else {
|
|
6536
|
+
return new Component(publicProps, publicContext, updateQueue);
|
|
6522
6537
|
}
|
|
6538
|
+
}
|
|
6539
|
+
|
|
6540
|
+
// This can still be an instance in case of factory components
|
|
6541
|
+
// but we'll count this as time spent rendering as the more common case.
|
|
6542
|
+
if ("development" !== 'production') {
|
|
6543
|
+
return measureLifeCyclePerf(function () {
|
|
6544
|
+
return Component(publicProps, publicContext, updateQueue);
|
|
6545
|
+
}, this._debugID, 'render');
|
|
6523
6546
|
} else {
|
|
6524
|
-
|
|
6525
|
-
// but we'll count this as time spent rendering as the more common case.
|
|
6526
|
-
if ("development" !== 'production') {
|
|
6527
|
-
if (this._debugID !== 0) {
|
|
6528
|
-
ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'render');
|
|
6529
|
-
}
|
|
6530
|
-
}
|
|
6531
|
-
instanceOrElement = Component(publicProps, publicContext, updateQueue);
|
|
6532
|
-
if ("development" !== 'production') {
|
|
6533
|
-
if (this._debugID !== 0) {
|
|
6534
|
-
ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'render');
|
|
6535
|
-
}
|
|
6536
|
-
}
|
|
6547
|
+
return Component(publicProps, publicContext, updateQueue);
|
|
6537
6548
|
}
|
|
6538
|
-
return instanceOrElement;
|
|
6539
6549
|
},
|
|
6540
6550
|
|
|
6541
6551
|
performInitialMountWithErrorHandling: function (renderedElement, hostParent, hostContainerInfo, transaction, context) {
|
|
@@ -6544,11 +6554,6 @@ var ReactCompositeComponentMixin = {
|
|
|
6544
6554
|
try {
|
|
6545
6555
|
markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context);
|
|
6546
6556
|
} catch (e) {
|
|
6547
|
-
if ("development" !== 'production') {
|
|
6548
|
-
if (this._debugID !== 0) {
|
|
6549
|
-
ReactInstrumentation.debugTool.onError();
|
|
6550
|
-
}
|
|
6551
|
-
}
|
|
6552
6557
|
// Roll back to checkpoint, handle error (which may add items to the transaction), and take a new checkpoint
|
|
6553
6558
|
transaction.rollback(checkpoint);
|
|
6554
6559
|
this._instance.unstable_handleError(e);
|
|
@@ -6569,17 +6574,19 @@ var ReactCompositeComponentMixin = {
|
|
|
6569
6574
|
|
|
6570
6575
|
performInitialMount: function (renderedElement, hostParent, hostContainerInfo, transaction, context) {
|
|
6571
6576
|
var inst = this._instance;
|
|
6577
|
+
|
|
6578
|
+
var debugID = 0;
|
|
6579
|
+
if ("development" !== 'production') {
|
|
6580
|
+
debugID = this._debugID;
|
|
6581
|
+
}
|
|
6582
|
+
|
|
6572
6583
|
if (inst.componentWillMount) {
|
|
6573
6584
|
if ("development" !== 'production') {
|
|
6574
|
-
|
|
6575
|
-
|
|
6576
|
-
}
|
|
6577
|
-
}
|
|
6578
|
-
|
|
6579
|
-
if ("development" !== 'production') {
|
|
6580
|
-
if (this._debugID !== 0) {
|
|
6581
|
-
ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentWillMount');
|
|
6582
|
-
}
|
|
6585
|
+
measureLifeCyclePerf(function () {
|
|
6586
|
+
return inst.componentWillMount();
|
|
6587
|
+
}, debugID, 'componentWillMount');
|
|
6588
|
+
} else {
|
|
6589
|
+
inst.componentWillMount();
|
|
6583
6590
|
}
|
|
6584
6591
|
// When mounting, calls to `setState` by `componentWillMount` will set
|
|
6585
6592
|
// `this._pendingStateQueue` without triggering a re-render.
|
|
@@ -6599,15 +6606,12 @@ var ReactCompositeComponentMixin = {
|
|
|
6599
6606
|
);
|
|
6600
6607
|
this._renderedComponent = child;
|
|
6601
6608
|
|
|
6602
|
-
var
|
|
6603
|
-
if ("development" !== 'production') {
|
|
6604
|
-
selfDebugID = this._debugID;
|
|
6605
|
-
}
|
|
6606
|
-
var markup = ReactReconciler.mountComponent(child, transaction, hostParent, hostContainerInfo, this._processChildContext(context), selfDebugID);
|
|
6609
|
+
var markup = ReactReconciler.mountComponent(child, transaction, hostParent, hostContainerInfo, this._processChildContext(context), debugID);
|
|
6607
6610
|
|
|
6608
6611
|
if ("development" !== 'production') {
|
|
6609
|
-
if (
|
|
6610
|
-
|
|
6612
|
+
if (debugID !== 0) {
|
|
6613
|
+
var childDebugIDs = child._debugID !== 0 ? [child._debugID] : [];
|
|
6614
|
+
ReactInstrumentation.debugTool.onSetChildren(debugID, childDebugIDs);
|
|
6611
6615
|
}
|
|
6612
6616
|
}
|
|
6613
6617
|
|
|
@@ -6628,24 +6632,22 @@ var ReactCompositeComponentMixin = {
|
|
|
6628
6632
|
if (!this._renderedComponent) {
|
|
6629
6633
|
return;
|
|
6630
6634
|
}
|
|
6635
|
+
|
|
6631
6636
|
var inst = this._instance;
|
|
6632
6637
|
|
|
6633
6638
|
if (inst.componentWillUnmount && !inst._calledComponentWillUnmount) {
|
|
6634
6639
|
inst._calledComponentWillUnmount = true;
|
|
6635
|
-
|
|
6636
|
-
if (this._debugID !== 0) {
|
|
6637
|
-
ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentWillUnmount');
|
|
6638
|
-
}
|
|
6639
|
-
}
|
|
6640
|
+
|
|
6640
6641
|
if (safely) {
|
|
6641
6642
|
var name = this.getName() + '.componentWillUnmount()';
|
|
6642
6643
|
ReactErrorUtils.invokeGuardedCallback(name, inst.componentWillUnmount.bind(inst));
|
|
6643
6644
|
} else {
|
|
6644
|
-
|
|
6645
|
-
|
|
6646
|
-
|
|
6647
|
-
|
|
6648
|
-
|
|
6645
|
+
if ("development" !== 'production') {
|
|
6646
|
+
measureLifeCyclePerf(function () {
|
|
6647
|
+
return inst.componentWillUnmount();
|
|
6648
|
+
}, this._debugID, 'componentWillUnmount');
|
|
6649
|
+
} else {
|
|
6650
|
+
inst.componentWillUnmount();
|
|
6649
6651
|
}
|
|
6650
6652
|
}
|
|
6651
6653
|
}
|
|
@@ -6732,13 +6734,21 @@ var ReactCompositeComponentMixin = {
|
|
|
6732
6734
|
_processChildContext: function (currentContext) {
|
|
6733
6735
|
var Component = this._currentElement.type;
|
|
6734
6736
|
var inst = this._instance;
|
|
6735
|
-
|
|
6736
|
-
|
|
6737
|
-
|
|
6738
|
-
|
|
6739
|
-
|
|
6740
|
-
|
|
6737
|
+
var childContext;
|
|
6738
|
+
|
|
6739
|
+
if (inst.getChildContext) {
|
|
6740
|
+
if ("development" !== 'production') {
|
|
6741
|
+
ReactInstrumentation.debugTool.onBeginProcessingChildContext();
|
|
6742
|
+
try {
|
|
6743
|
+
childContext = inst.getChildContext();
|
|
6744
|
+
} finally {
|
|
6745
|
+
ReactInstrumentation.debugTool.onEndProcessingChildContext();
|
|
6746
|
+
}
|
|
6747
|
+
} else {
|
|
6748
|
+
childContext = inst.getChildContext();
|
|
6749
|
+
}
|
|
6741
6750
|
}
|
|
6751
|
+
|
|
6742
6752
|
if (childContext) {
|
|
6743
6753
|
!(typeof Component.childContextTypes === 'object') ? "development" !== 'production' ? invariant(false, '%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().', this.getName() || 'ReactCompositeComponent') : _prodInvariant('107', this.getName() || 'ReactCompositeComponent') : void 0;
|
|
6744
6754
|
if ("development" !== 'production') {
|
|
@@ -6833,15 +6843,11 @@ var ReactCompositeComponentMixin = {
|
|
|
6833
6843
|
// immediately reconciled instead of waiting for the next batch.
|
|
6834
6844
|
if (willReceive && inst.componentWillReceiveProps) {
|
|
6835
6845
|
if ("development" !== 'production') {
|
|
6836
|
-
|
|
6837
|
-
|
|
6838
|
-
}
|
|
6839
|
-
}
|
|
6840
|
-
|
|
6841
|
-
if ("development" !== 'production') {
|
|
6842
|
-
if (this._debugID !== 0) {
|
|
6843
|
-
ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentWillReceiveProps');
|
|
6844
|
-
}
|
|
6846
|
+
measureLifeCyclePerf(function () {
|
|
6847
|
+
return inst.componentWillReceiveProps(nextProps, nextContext);
|
|
6848
|
+
}, this._debugID, 'componentWillReceiveProps');
|
|
6849
|
+
} else {
|
|
6850
|
+
inst.componentWillReceiveProps(nextProps, nextContext);
|
|
6845
6851
|
}
|
|
6846
6852
|
}
|
|
6847
6853
|
|
|
@@ -6851,15 +6857,11 @@ var ReactCompositeComponentMixin = {
|
|
|
6851
6857
|
if (!this._pendingForceUpdate) {
|
|
6852
6858
|
if (inst.shouldComponentUpdate) {
|
|
6853
6859
|
if ("development" !== 'production') {
|
|
6854
|
-
|
|
6855
|
-
|
|
6856
|
-
}
|
|
6857
|
-
}
|
|
6858
|
-
|
|
6859
|
-
if ("development" !== 'production') {
|
|
6860
|
-
if (this._debugID !== 0) {
|
|
6861
|
-
ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'shouldComponentUpdate');
|
|
6862
|
-
}
|
|
6860
|
+
shouldUpdate = measureLifeCyclePerf(function () {
|
|
6861
|
+
return inst.shouldComponentUpdate(nextProps, nextState, nextContext);
|
|
6862
|
+
}, this._debugID, 'shouldComponentUpdate');
|
|
6863
|
+
} else {
|
|
6864
|
+
shouldUpdate = inst.shouldComponentUpdate(nextProps, nextState, nextContext);
|
|
6863
6865
|
}
|
|
6864
6866
|
} else {
|
|
6865
6867
|
if (this._compositeType === CompositeTypes.PureClass) {
|
|
@@ -6925,6 +6927,8 @@ var ReactCompositeComponentMixin = {
|
|
|
6925
6927
|
* @private
|
|
6926
6928
|
*/
|
|
6927
6929
|
_performComponentUpdate: function (nextElement, nextProps, nextState, nextContext, transaction, unmaskedContext) {
|
|
6930
|
+
var _this2 = this;
|
|
6931
|
+
|
|
6928
6932
|
var inst = this._instance;
|
|
6929
6933
|
|
|
6930
6934
|
var hasComponentDidUpdate = Boolean(inst.componentDidUpdate);
|
|
@@ -6939,15 +6943,11 @@ var ReactCompositeComponentMixin = {
|
|
|
6939
6943
|
|
|
6940
6944
|
if (inst.componentWillUpdate) {
|
|
6941
6945
|
if ("development" !== 'production') {
|
|
6942
|
-
|
|
6943
|
-
|
|
6944
|
-
}
|
|
6945
|
-
}
|
|
6946
|
-
|
|
6947
|
-
if ("development" !== 'production') {
|
|
6948
|
-
if (this._debugID !== 0) {
|
|
6949
|
-
ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentWillUpdate');
|
|
6950
|
-
}
|
|
6946
|
+
measureLifeCyclePerf(function () {
|
|
6947
|
+
return inst.componentWillUpdate(nextProps, nextState, nextContext);
|
|
6948
|
+
}, this._debugID, 'componentWillUpdate');
|
|
6949
|
+
} else {
|
|
6950
|
+
inst.componentWillUpdate(nextProps, nextState, nextContext);
|
|
6951
6951
|
}
|
|
6952
6952
|
}
|
|
6953
6953
|
|
|
@@ -6961,7 +6961,9 @@ var ReactCompositeComponentMixin = {
|
|
|
6961
6961
|
|
|
6962
6962
|
if (hasComponentDidUpdate) {
|
|
6963
6963
|
if ("development" !== 'production') {
|
|
6964
|
-
transaction.getReactMountReady().enqueue(
|
|
6964
|
+
transaction.getReactMountReady().enqueue(function () {
|
|
6965
|
+
measureLifeCyclePerf(inst.componentDidUpdate.bind(inst, prevProps, prevState, prevContext), _this2._debugID, 'componentDidUpdate');
|
|
6966
|
+
});
|
|
6965
6967
|
} else {
|
|
6966
6968
|
transaction.getReactMountReady().enqueue(inst.componentDidUpdate.bind(inst, prevProps, prevState, prevContext), inst);
|
|
6967
6969
|
}
|
|
@@ -6978,6 +6980,12 @@ var ReactCompositeComponentMixin = {
|
|
|
6978
6980
|
var prevComponentInstance = this._renderedComponent;
|
|
6979
6981
|
var prevRenderedElement = prevComponentInstance._currentElement;
|
|
6980
6982
|
var nextRenderedElement = this._renderValidatedComponent();
|
|
6983
|
+
|
|
6984
|
+
var debugID = 0;
|
|
6985
|
+
if ("development" !== 'production') {
|
|
6986
|
+
debugID = this._debugID;
|
|
6987
|
+
}
|
|
6988
|
+
|
|
6981
6989
|
if (shouldUpdateReactComponent(prevRenderedElement, nextRenderedElement)) {
|
|
6982
6990
|
ReactReconciler.receiveComponent(prevComponentInstance, nextRenderedElement, transaction, this._processChildContext(context));
|
|
6983
6991
|
} else {
|
|
@@ -6990,15 +6998,12 @@ var ReactCompositeComponentMixin = {
|
|
|
6990
6998
|
);
|
|
6991
6999
|
this._renderedComponent = child;
|
|
6992
7000
|
|
|
6993
|
-
var
|
|
6994
|
-
if ("development" !== 'production') {
|
|
6995
|
-
selfDebugID = this._debugID;
|
|
6996
|
-
}
|
|
6997
|
-
var nextMarkup = ReactReconciler.mountComponent(child, transaction, this._hostParent, this._hostContainerInfo, this._processChildContext(context), selfDebugID);
|
|
7001
|
+
var nextMarkup = ReactReconciler.mountComponent(child, transaction, this._hostParent, this._hostContainerInfo, this._processChildContext(context), debugID);
|
|
6998
7002
|
|
|
6999
7003
|
if ("development" !== 'production') {
|
|
7000
|
-
if (
|
|
7001
|
-
|
|
7004
|
+
if (debugID !== 0) {
|
|
7005
|
+
var childDebugIDs = child._debugID !== 0 ? [child._debugID] : [];
|
|
7006
|
+
ReactInstrumentation.debugTool.onSetChildren(debugID, childDebugIDs);
|
|
7002
7007
|
}
|
|
7003
7008
|
}
|
|
7004
7009
|
|
|
@@ -7020,17 +7025,14 @@ var ReactCompositeComponentMixin = {
|
|
|
7020
7025
|
*/
|
|
7021
7026
|
_renderValidatedComponentWithoutOwnerOrContext: function () {
|
|
7022
7027
|
var inst = this._instance;
|
|
7028
|
+
var renderedComponent;
|
|
7023
7029
|
|
|
7024
7030
|
if ("development" !== 'production') {
|
|
7025
|
-
|
|
7026
|
-
|
|
7027
|
-
}
|
|
7028
|
-
}
|
|
7029
|
-
|
|
7030
|
-
if ("development" !== 'production') {
|
|
7031
|
-
if (this._debugID !== 0) {
|
|
7032
|
-
ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'render');
|
|
7033
|
-
}
|
|
7031
|
+
renderedComponent = measureLifeCyclePerf(function () {
|
|
7032
|
+
return inst.render();
|
|
7033
|
+
}, this._debugID, 'render');
|
|
7034
|
+
} else {
|
|
7035
|
+
renderedComponent = inst.render();
|
|
7034
7036
|
}
|
|
7035
7037
|
|
|
7036
7038
|
if ("development" !== 'production') {
|
|
@@ -7081,7 +7083,7 @@ var ReactCompositeComponentMixin = {
|
|
|
7081
7083
|
var publicComponentInstance = component.getPublicInstance();
|
|
7082
7084
|
if ("development" !== 'production') {
|
|
7083
7085
|
var componentName = component && component.getName ? component.getName() : 'a component';
|
|
7084
|
-
"development" !== 'production' ? warning(publicComponentInstance != null, 'Stateless function components cannot be given refs ' + '(See ref "%s" in %s created by %s). ' + 'Attempts to access this ref will fail.', ref, componentName, this.getName()) : void 0;
|
|
7086
|
+
"development" !== 'production' ? warning(publicComponentInstance != null || component._compositeType !== CompositeTypes.StatelessFunctional, 'Stateless function components cannot be given refs ' + '(See ref "%s" in %s created by %s). ' + 'Attempts to access this ref will fail.', ref, componentName, this.getName()) : void 0;
|
|
7085
7087
|
}
|
|
7086
7088
|
var refs = inst.refs === emptyObject ? inst.refs = {} : inst.refs;
|
|
7087
7089
|
refs[ref] = publicComponentInstance;
|
|
@@ -7505,9 +7507,9 @@ function optionPostMount() {
|
|
|
7505
7507
|
ReactDOMOption.postMountWrapper(inst);
|
|
7506
7508
|
}
|
|
7507
7509
|
|
|
7508
|
-
var
|
|
7510
|
+
var setAndValidateContentChildDev = emptyFunction;
|
|
7509
7511
|
if ("development" !== 'production') {
|
|
7510
|
-
|
|
7512
|
+
setAndValidateContentChildDev = function (content) {
|
|
7511
7513
|
var hasExistingContent = this._contentDebugID != null;
|
|
7512
7514
|
var debugID = this._debugID;
|
|
7513
7515
|
// This ID represents the inlined child that has no backing instance:
|
|
@@ -7521,6 +7523,7 @@ if ("development" !== 'production') {
|
|
|
7521
7523
|
return;
|
|
7522
7524
|
}
|
|
7523
7525
|
|
|
7526
|
+
validateDOMNesting(null, String(content), this, this._ancestorInfo);
|
|
7524
7527
|
this._contentDebugID = contentDebugID;
|
|
7525
7528
|
if (hasExistingContent) {
|
|
7526
7529
|
ReactInstrumentation.debugTool.onBeforeUpdateComponent(contentDebugID, content);
|
|
@@ -7695,7 +7698,7 @@ function ReactDOMComponent(element) {
|
|
|
7695
7698
|
this._flags = 0;
|
|
7696
7699
|
if ("development" !== 'production') {
|
|
7697
7700
|
this._ancestorInfo = null;
|
|
7698
|
-
|
|
7701
|
+
setAndValidateContentChildDev.call(this, null);
|
|
7699
7702
|
}
|
|
7700
7703
|
}
|
|
7701
7704
|
|
|
@@ -7795,7 +7798,7 @@ ReactDOMComponent.Mixin = {
|
|
|
7795
7798
|
if (parentInfo) {
|
|
7796
7799
|
// parentInfo should always be present except for the top-level
|
|
7797
7800
|
// component when server rendering
|
|
7798
|
-
validateDOMNesting(this._tag, this, parentInfo);
|
|
7801
|
+
validateDOMNesting(this._tag, null, this, parentInfo);
|
|
7799
7802
|
}
|
|
7800
7803
|
this._ancestorInfo = validateDOMNesting.updatedAncestorInfo(parentInfo, this._tag, this);
|
|
7801
7804
|
}
|
|
@@ -7964,7 +7967,7 @@ ReactDOMComponent.Mixin = {
|
|
|
7964
7967
|
// TODO: Validate that text is allowed as a child of this node
|
|
7965
7968
|
ret = escapeTextContentForBrowser(contentToUse);
|
|
7966
7969
|
if ("development" !== 'production') {
|
|
7967
|
-
|
|
7970
|
+
setAndValidateContentChildDev.call(this, contentToUse);
|
|
7968
7971
|
}
|
|
7969
7972
|
} else if (childrenToUse != null) {
|
|
7970
7973
|
var mountImages = this.mountChildren(childrenToUse, transaction, context);
|
|
@@ -8001,7 +8004,7 @@ ReactDOMComponent.Mixin = {
|
|
|
8001
8004
|
if (contentToUse != null) {
|
|
8002
8005
|
// TODO: Validate that text is allowed as a child of this node
|
|
8003
8006
|
if ("development" !== 'production') {
|
|
8004
|
-
|
|
8007
|
+
setAndValidateContentChildDev.call(this, contentToUse);
|
|
8005
8008
|
}
|
|
8006
8009
|
DOMLazyTree.queueText(lazyTree, contentToUse);
|
|
8007
8010
|
} else if (childrenToUse != null) {
|
|
@@ -8233,7 +8236,7 @@ ReactDOMComponent.Mixin = {
|
|
|
8233
8236
|
if (lastContent !== nextContent) {
|
|
8234
8237
|
this.updateTextContent('' + nextContent);
|
|
8235
8238
|
if ("development" !== 'production') {
|
|
8236
|
-
|
|
8239
|
+
setAndValidateContentChildDev.call(this, nextContent);
|
|
8237
8240
|
}
|
|
8238
8241
|
}
|
|
8239
8242
|
} else if (nextHtml != null) {
|
|
@@ -8245,7 +8248,7 @@ ReactDOMComponent.Mixin = {
|
|
|
8245
8248
|
}
|
|
8246
8249
|
} else if (nextChildren != null) {
|
|
8247
8250
|
if ("development" !== 'production') {
|
|
8248
|
-
|
|
8251
|
+
setAndValidateContentChildDev.call(this, null);
|
|
8249
8252
|
}
|
|
8250
8253
|
|
|
8251
8254
|
this.updateChildren(nextChildren, transaction, context);
|
|
@@ -8300,7 +8303,7 @@ ReactDOMComponent.Mixin = {
|
|
|
8300
8303
|
this._wrapperState = null;
|
|
8301
8304
|
|
|
8302
8305
|
if ("development" !== 'production') {
|
|
8303
|
-
|
|
8306
|
+
setAndValidateContentChildDev.call(this, null);
|
|
8304
8307
|
}
|
|
8305
8308
|
},
|
|
8306
8309
|
|
|
@@ -8883,7 +8886,7 @@ function forceUpdateIfMounted() {
|
|
|
8883
8886
|
|
|
8884
8887
|
function isControlled(props) {
|
|
8885
8888
|
var usesChecked = props.type === 'checkbox' || props.type === 'radio';
|
|
8886
|
-
return usesChecked ? props.checked
|
|
8889
|
+
return usesChecked ? props.checked != null : props.value != null;
|
|
8887
8890
|
}
|
|
8888
8891
|
|
|
8889
8892
|
/**
|
|
@@ -9797,7 +9800,7 @@ _assign(ReactDOMTextComponent.prototype, {
|
|
|
9797
9800
|
if (parentInfo) {
|
|
9798
9801
|
// parentInfo should always be present except for the top-level
|
|
9799
9802
|
// component when server rendering
|
|
9800
|
-
validateDOMNesting(
|
|
9803
|
+
validateDOMNesting(null, this._stringText, this, parentInfo);
|
|
9801
9804
|
}
|
|
9802
9805
|
}
|
|
9803
9806
|
|
|
@@ -10533,12 +10536,6 @@ var ReactDebugTool = {
|
|
|
10533
10536
|
endLifeCycleTimer(debugID, timerType);
|
|
10534
10537
|
emitEvent('onEndLifeCycleTimer', debugID, timerType);
|
|
10535
10538
|
},
|
|
10536
|
-
onError: function (debugID) {
|
|
10537
|
-
if (currentTimerDebugID != null) {
|
|
10538
|
-
endLifeCycleTimer(currentTimerDebugID, currentTimerType);
|
|
10539
|
-
}
|
|
10540
|
-
emitEvent('onError', debugID);
|
|
10541
|
-
},
|
|
10542
10539
|
onBeginProcessingChildContext: function () {
|
|
10543
10540
|
emitEvent('onBeginProcessingChildContext');
|
|
10544
10541
|
},
|
|
@@ -10947,14 +10944,6 @@ ReactElement.createElement = function (type, config, children) {
|
|
|
10947
10944
|
var source = null;
|
|
10948
10945
|
|
|
10949
10946
|
if (config != null) {
|
|
10950
|
-
if ("development" !== 'production') {
|
|
10951
|
-
"development" !== 'production' ? warning(
|
|
10952
|
-
/* eslint-disable no-proto */
|
|
10953
|
-
config.__proto__ == null || config.__proto__ === Object.prototype,
|
|
10954
|
-
/* eslint-enable no-proto */
|
|
10955
|
-
'React.createElement(...): Expected props argument to be a plain object. ' + 'Properties defined in its prototype chain will be ignored.') : void 0;
|
|
10956
|
-
}
|
|
10957
|
-
|
|
10958
10947
|
if (hasValidRef(config)) {
|
|
10959
10948
|
ref = config.ref;
|
|
10960
10949
|
}
|
|
@@ -11055,14 +11044,6 @@ ReactElement.cloneElement = function (element, config, children) {
|
|
|
11055
11044
|
var owner = element._owner;
|
|
11056
11045
|
|
|
11057
11046
|
if (config != null) {
|
|
11058
|
-
if ("development" !== 'production') {
|
|
11059
|
-
"development" !== 'production' ? warning(
|
|
11060
|
-
/* eslint-disable no-proto */
|
|
11061
|
-
config.__proto__ == null || config.__proto__ === Object.prototype,
|
|
11062
|
-
/* eslint-enable no-proto */
|
|
11063
|
-
'React.cloneElement(...): Expected props argument to be a plain object. ' + 'Properties defined in its prototype chain will be ignored.') : void 0;
|
|
11064
|
-
}
|
|
11065
|
-
|
|
11066
11047
|
if (hasValidRef(config)) {
|
|
11067
11048
|
// Silently steal the ref from the parent.
|
|
11068
11049
|
ref = config.ref;
|
|
@@ -16855,7 +16836,7 @@ module.exports = ReactUpdates;
|
|
|
16855
16836
|
|
|
16856
16837
|
'use strict';
|
|
16857
16838
|
|
|
16858
|
-
module.exports = '15.3.1';
|
|
16839
|
+
module.exports = '15.3.2-rc.1';
|
|
16859
16840
|
},{}],109:[function(_dereq_,module,exports){
|
|
16860
16841
|
/**
|
|
16861
16842
|
* Copyright 2013-present, Facebook, Inc.
|
|
@@ -17263,7 +17244,7 @@ var eventTypes = {
|
|
|
17263
17244
|
bubbled: keyOf({ onSelect: null }),
|
|
17264
17245
|
captured: keyOf({ onSelectCapture: null })
|
|
17265
17246
|
},
|
|
17266
|
-
dependencies: [topLevelTypes.topBlur, topLevelTypes.topContextMenu, topLevelTypes.topFocus, topLevelTypes.topKeyDown, topLevelTypes.topMouseDown, topLevelTypes.topMouseUp, topLevelTypes.topSelectionChange]
|
|
17247
|
+
dependencies: [topLevelTypes.topBlur, topLevelTypes.topContextMenu, topLevelTypes.topFocus, topLevelTypes.topKeyDown, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown, topLevelTypes.topMouseUp, topLevelTypes.topSelectionChange]
|
|
17267
17248
|
}
|
|
17268
17249
|
};
|
|
17269
17250
|
|
|
@@ -18329,7 +18310,8 @@ _assign(SyntheticEvent.prototype, {
|
|
|
18329
18310
|
|
|
18330
18311
|
if (event.preventDefault) {
|
|
18331
18312
|
event.preventDefault();
|
|
18332
|
-
} else {
|
|
18313
|
+
} else if (typeof event.returnValue !== 'unknown') {
|
|
18314
|
+
// eslint-disable-line valid-typeof
|
|
18333
18315
|
event.returnValue = false;
|
|
18334
18316
|
}
|
|
18335
18317
|
this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
|
|
@@ -20719,9 +20701,9 @@ var setInnerHTML = createMicrosoftUnsafeLocalFunction(function (node, html) {
|
|
|
20719
20701
|
if (node.namespaceURI === DOMNamespaces.svg && !('innerHTML' in node)) {
|
|
20720
20702
|
reusableSVGContainer = reusableSVGContainer || document.createElement('div');
|
|
20721
20703
|
reusableSVGContainer.innerHTML = '<svg>' + html + '</svg>';
|
|
20722
|
-
var
|
|
20723
|
-
|
|
20724
|
-
node.appendChild(
|
|
20704
|
+
var svgNode = reusableSVGContainer.firstChild;
|
|
20705
|
+
while (svgNode.firstChild) {
|
|
20706
|
+
node.appendChild(svgNode.firstChild);
|
|
20725
20707
|
}
|
|
20726
20708
|
} else {
|
|
20727
20709
|
node.innerHTML = html;
|
|
@@ -21468,11 +21450,16 @@ if ("development" !== 'production') {
|
|
|
21468
21450
|
|
|
21469
21451
|
var didWarn = {};
|
|
21470
21452
|
|
|
21471
|
-
validateDOMNesting = function (childTag, childInstance, ancestorInfo) {
|
|
21453
|
+
validateDOMNesting = function (childTag, childText, childInstance, ancestorInfo) {
|
|
21472
21454
|
ancestorInfo = ancestorInfo || emptyAncestorInfo;
|
|
21473
21455
|
var parentInfo = ancestorInfo.current;
|
|
21474
21456
|
var parentTag = parentInfo && parentInfo.tag;
|
|
21475
21457
|
|
|
21458
|
+
if (childText != null) {
|
|
21459
|
+
"development" !== 'production' ? warning(childTag == null, 'validateDOMNesting: when childText is passed, childTag should be null') : void 0;
|
|
21460
|
+
childTag = '#text';
|
|
21461
|
+
}
|
|
21462
|
+
|
|
21476
21463
|
var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;
|
|
21477
21464
|
var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);
|
|
21478
21465
|
var problematic = invalidParent || invalidAncestor;
|
|
@@ -21520,7 +21507,15 @@ if ("development" !== 'production') {
|
|
|
21520
21507
|
didWarn[warnKey] = true;
|
|
21521
21508
|
|
|
21522
21509
|
var tagDisplayName = childTag;
|
|
21523
|
-
|
|
21510
|
+
var whitespaceInfo = '';
|
|
21511
|
+
if (childTag === '#text') {
|
|
21512
|
+
if (/\S/.test(childText)) {
|
|
21513
|
+
tagDisplayName = 'Text nodes';
|
|
21514
|
+
} else {
|
|
21515
|
+
tagDisplayName = 'Whitespace text nodes';
|
|
21516
|
+
whitespaceInfo = ' Make sure you don\'t have any extra whitespace between tags on ' + 'each line of your source code.';
|
|
21517
|
+
}
|
|
21518
|
+
} else {
|
|
21524
21519
|
tagDisplayName = '<' + childTag + '>';
|
|
21525
21520
|
}
|
|
21526
21521
|
|
|
@@ -21529,7 +21524,7 @@ if ("development" !== 'production') {
|
|
|
21529
21524
|
if (ancestorTag === 'table' && childTag === 'tr') {
|
|
21530
21525
|
info += ' Add a <tbody> to your code to match the DOM tree generated by ' + 'the browser.';
|
|
21531
21526
|
}
|
|
21532
|
-
"development" !== 'production' ? warning(false, 'validateDOMNesting(...): %s cannot appear as a child of <%s
|
|
21527
|
+
"development" !== 'production' ? warning(false, 'validateDOMNesting(...): %s cannot appear as a child of <%s>.%s ' + 'See %s.%s', tagDisplayName, ancestorTag, whitespaceInfo, ownerInfo, info) : void 0;
|
|
21533
21528
|
} else {
|
|
21534
21529
|
"development" !== 'production' ? warning(false, 'validateDOMNesting(...): %s cannot appear as a descendant of ' + '<%s>. See %s.', tagDisplayName, ancestorTag, ownerInfo) : void 0;
|
|
21535
21530
|
}
|