react 0.13.0-rc1 → 0.13.2
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/JSXTransformer.js +955 -1017
- package/dist/react-with-addons.js +201 -73
- package/dist/react-with-addons.min.js +7 -6
- package/dist/react.js +190 -65
- package/dist/react.min.js +5 -5
- package/lib/CSSProperty.js +5 -1
- package/lib/HTMLDOMPropertyConfig.js +7 -1
- package/lib/React.js +4 -1
- package/lib/ReactComponent.js +2 -1
- package/lib/ReactCompositeComponent.js +29 -5
- package/lib/ReactDOMComponent.js +3 -0
- package/lib/ReactDOMSelect.js +3 -1
- package/lib/ReactDefaultPerf.js +8 -11
- package/lib/ReactElement.js +54 -0
- package/lib/ReactElementValidator.js +64 -38
- package/lib/ReactFragment.js +2 -1
- package/lib/ReactPropTypes.js +4 -1
- package/lib/ReactReconciler.js +0 -1
- package/lib/ReactRef.js +1 -1
- package/lib/ReactTestUtils.js +1 -1
- package/lib/cloneWithProps.js +1 -1
- package/lib/createFullPageComponent.js +1 -0
- package/lib/instantiateReactComponent.js +1 -0
- package/lib/update.js +9 -6
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* React (with addons) v0.13.
|
|
2
|
+
* React (with addons) v0.13.2
|
|
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
|
/**
|
|
@@ -710,7 +710,9 @@ var isUnitlessNumber = {
|
|
|
710
710
|
columnCount: true,
|
|
711
711
|
flex: true,
|
|
712
712
|
flexGrow: true,
|
|
713
|
+
flexPositive: true,
|
|
713
714
|
flexShrink: true,
|
|
715
|
+
flexNegative: true,
|
|
714
716
|
fontWeight: true,
|
|
715
717
|
lineClamp: true,
|
|
716
718
|
lineHeight: true,
|
|
@@ -723,7 +725,9 @@ var isUnitlessNumber = {
|
|
|
723
725
|
|
|
724
726
|
// SVG-related properties
|
|
725
727
|
fillOpacity: true,
|
|
726
|
-
|
|
728
|
+
strokeDashoffset: true,
|
|
729
|
+
strokeOpacity: true,
|
|
730
|
+
strokeWidth: true
|
|
727
731
|
};
|
|
728
732
|
|
|
729
733
|
/**
|
|
@@ -3788,6 +3792,7 @@ var HTMLDOMPropertyConfig = {
|
|
|
3788
3792
|
headers: null,
|
|
3789
3793
|
height: MUST_USE_ATTRIBUTE,
|
|
3790
3794
|
hidden: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
|
|
3795
|
+
high: null,
|
|
3791
3796
|
href: null,
|
|
3792
3797
|
hrefLang: null,
|
|
3793
3798
|
htmlFor: null,
|
|
@@ -3798,6 +3803,7 @@ var HTMLDOMPropertyConfig = {
|
|
|
3798
3803
|
lang: null,
|
|
3799
3804
|
list: MUST_USE_ATTRIBUTE,
|
|
3800
3805
|
loop: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
|
|
3806
|
+
low: null,
|
|
3801
3807
|
manifest: MUST_USE_ATTRIBUTE,
|
|
3802
3808
|
marginHeight: null,
|
|
3803
3809
|
marginWidth: null,
|
|
@@ -3812,6 +3818,7 @@ var HTMLDOMPropertyConfig = {
|
|
|
3812
3818
|
name: null,
|
|
3813
3819
|
noValidate: HAS_BOOLEAN_VALUE,
|
|
3814
3820
|
open: HAS_BOOLEAN_VALUE,
|
|
3821
|
+
optimum: null,
|
|
3815
3822
|
pattern: null,
|
|
3816
3823
|
placeholder: null,
|
|
3817
3824
|
poster: null,
|
|
@@ -3825,6 +3832,7 @@ var HTMLDOMPropertyConfig = {
|
|
|
3825
3832
|
rowSpan: null,
|
|
3826
3833
|
sandbox: null,
|
|
3827
3834
|
scope: null,
|
|
3835
|
+
scoped: HAS_BOOLEAN_VALUE,
|
|
3828
3836
|
scrolling: null,
|
|
3829
3837
|
seamless: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
|
|
3830
3838
|
selected: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
|
|
@@ -3866,7 +3874,9 @@ var HTMLDOMPropertyConfig = {
|
|
|
3866
3874
|
itemID: MUST_USE_ATTRIBUTE,
|
|
3867
3875
|
itemRef: MUST_USE_ATTRIBUTE,
|
|
3868
3876
|
// property is supported for OpenGraph in meta tags.
|
|
3869
|
-
property: null
|
|
3877
|
+
property: null,
|
|
3878
|
+
// IE-only attribute that controls focus behavior
|
|
3879
|
+
unselectable: MUST_USE_ATTRIBUTE
|
|
3870
3880
|
},
|
|
3871
3881
|
DOMAttributeNames: {
|
|
3872
3882
|
acceptCharset: 'accept-charset',
|
|
@@ -4406,10 +4416,12 @@ ReactDefaultInjection.inject();
|
|
|
4406
4416
|
|
|
4407
4417
|
var createElement = ReactElement.createElement;
|
|
4408
4418
|
var createFactory = ReactElement.createFactory;
|
|
4419
|
+
var cloneElement = ReactElement.cloneElement;
|
|
4409
4420
|
|
|
4410
4421
|
if ("production" !== "development") {
|
|
4411
4422
|
createElement = ReactElementValidator.createElement;
|
|
4412
4423
|
createFactory = ReactElementValidator.createFactory;
|
|
4424
|
+
cloneElement = ReactElementValidator.cloneElement;
|
|
4413
4425
|
}
|
|
4414
4426
|
|
|
4415
4427
|
var render = ReactPerf.measure('React', 'render', ReactMount.render);
|
|
@@ -4429,6 +4441,7 @@ var React = {
|
|
|
4429
4441
|
},
|
|
4430
4442
|
createClass: ReactClass.createClass,
|
|
4431
4443
|
createElement: createElement,
|
|
4444
|
+
cloneElement: cloneElement,
|
|
4432
4445
|
createFactory: createFactory,
|
|
4433
4446
|
createMixin: function(mixin) {
|
|
4434
4447
|
// Currently a noop. Will be used to validate and trace mixins.
|
|
@@ -4507,7 +4520,7 @@ if ("production" !== "development") {
|
|
|
4507
4520
|
}
|
|
4508
4521
|
}
|
|
4509
4522
|
|
|
4510
|
-
React.version = '0.13.
|
|
4523
|
+
React.version = '0.13.2';
|
|
4511
4524
|
|
|
4512
4525
|
module.exports = React;
|
|
4513
4526
|
|
|
@@ -6415,7 +6428,7 @@ ReactComponent.prototype.setState = function(partialState, callback) {
|
|
|
6415
6428
|
* You may want to call this when you know that some deeper aspect of the
|
|
6416
6429
|
* component's state has changed but `setState` was not called.
|
|
6417
6430
|
*
|
|
6418
|
-
* This will not invoke `
|
|
6431
|
+
* This will not invoke `shouldComponentUpdate`, but it will invoke
|
|
6419
6432
|
* `componentWillUpdate` and `componentDidUpdate`.
|
|
6420
6433
|
*
|
|
6421
6434
|
* @param {?function} callback Called after update is complete.
|
|
@@ -6438,6 +6451,7 @@ if ("production" !== "development") {
|
|
|
6438
6451
|
var deprecatedAPIs = {
|
|
6439
6452
|
getDOMNode: 'getDOMNode',
|
|
6440
6453
|
isMounted: 'isMounted',
|
|
6454
|
+
replaceProps: 'replaceProps',
|
|
6441
6455
|
replaceState: 'replaceState',
|
|
6442
6456
|
setProps: 'setProps'
|
|
6443
6457
|
};
|
|
@@ -6757,6 +6771,20 @@ var ReactCompositeComponentMixin = {
|
|
|
6757
6771
|
|
|
6758
6772
|
// Initialize the public class
|
|
6759
6773
|
var inst = new Component(publicProps, publicContext);
|
|
6774
|
+
|
|
6775
|
+
if ("production" !== "development") {
|
|
6776
|
+
// This will throw later in _renderValidatedComponent, but add an early
|
|
6777
|
+
// warning now to help debugging
|
|
6778
|
+
("production" !== "development" ? warning(
|
|
6779
|
+
inst.render != null,
|
|
6780
|
+
'%s(...): No `render` method found on the returned component ' +
|
|
6781
|
+
'instance: you may have forgotten to define `render` in your ' +
|
|
6782
|
+
'component or you may have accidentally tried to render an element ' +
|
|
6783
|
+
'whose type is a function that isn\'t a React component.',
|
|
6784
|
+
Component.displayName || Component.name || 'Component'
|
|
6785
|
+
) : null);
|
|
6786
|
+
}
|
|
6787
|
+
|
|
6760
6788
|
// These should be set up in the constructor, but as a convenience for
|
|
6761
6789
|
// simpler class abstractions, we set them up after the fact.
|
|
6762
6790
|
inst.props = publicProps;
|
|
@@ -6784,6 +6812,14 @@ var ReactCompositeComponentMixin = {
|
|
|
6784
6812
|
'Did you mean to define a state property instead?',
|
|
6785
6813
|
this.getName() || 'a component'
|
|
6786
6814
|
) : null);
|
|
6815
|
+
("production" !== "development" ? warning(
|
|
6816
|
+
!inst.getDefaultProps ||
|
|
6817
|
+
inst.getDefaultProps.isReactClassApproved,
|
|
6818
|
+
'getDefaultProps was defined on %s, a plain JavaScript class. ' +
|
|
6819
|
+
'This is only supported for classes created using React.createClass. ' +
|
|
6820
|
+
'Use a static property to define defaultProps instead.',
|
|
6821
|
+
this.getName() || 'a component'
|
|
6822
|
+
) : null);
|
|
6787
6823
|
("production" !== "development" ? warning(
|
|
6788
6824
|
!inst.propTypes,
|
|
6789
6825
|
'propTypes was defined as an instance property on %s. Use a static ' +
|
|
@@ -7073,14 +7109,16 @@ var ReactCompositeComponentMixin = {
|
|
|
7073
7109
|
// Preface gives us something to blacklist in warning module
|
|
7074
7110
|
("production" !== "development" ? warning(
|
|
7075
7111
|
false,
|
|
7076
|
-
'Failed Composite propType: %s',
|
|
7077
|
-
error.message
|
|
7112
|
+
'Failed Composite propType: %s%s',
|
|
7113
|
+
error.message,
|
|
7114
|
+
addendum
|
|
7078
7115
|
) : null);
|
|
7079
7116
|
} else {
|
|
7080
7117
|
("production" !== "development" ? warning(
|
|
7081
7118
|
false,
|
|
7082
|
-
'Failed Context Types: %s',
|
|
7083
|
-
error.message
|
|
7119
|
+
'Failed Context Types: %s%s',
|
|
7120
|
+
error.message,
|
|
7121
|
+
addendum
|
|
7084
7122
|
) : null);
|
|
7085
7123
|
}
|
|
7086
7124
|
}
|
|
@@ -7351,7 +7389,7 @@ var ReactCompositeComponentMixin = {
|
|
|
7351
7389
|
this._renderedComponent,
|
|
7352
7390
|
thisID,
|
|
7353
7391
|
transaction,
|
|
7354
|
-
context
|
|
7392
|
+
this._processChildContext(context)
|
|
7355
7393
|
);
|
|
7356
7394
|
this._replaceNodeWithMarkupByID(prevComponentID, nextMarkup);
|
|
7357
7395
|
}
|
|
@@ -8196,6 +8234,7 @@ ReactDOMComponent.Mixin = {
|
|
|
8196
8234
|
styleUpdates[styleName] = '';
|
|
8197
8235
|
}
|
|
8198
8236
|
}
|
|
8237
|
+
this._previousStyleCopy = null;
|
|
8199
8238
|
} else if (registrationNameModules.hasOwnProperty(propKey)) {
|
|
8200
8239
|
deleteListener(this._rootNodeID, propKey);
|
|
8201
8240
|
} else if (
|
|
@@ -8218,6 +8257,8 @@ ReactDOMComponent.Mixin = {
|
|
|
8218
8257
|
if (propKey === STYLE) {
|
|
8219
8258
|
if (nextProp) {
|
|
8220
8259
|
nextProp = this._previousStyleCopy = assign({}, nextProp);
|
|
8260
|
+
} else {
|
|
8261
|
+
this._previousStyleCopy = null;
|
|
8221
8262
|
}
|
|
8222
8263
|
if (lastProp) {
|
|
8223
8264
|
// Unset styles on `lastProp` but not on `nextProp`.
|
|
@@ -8968,7 +9009,9 @@ function updateOptions(component, propValue) {
|
|
|
8968
9009
|
return;
|
|
8969
9010
|
}
|
|
8970
9011
|
}
|
|
8971
|
-
options
|
|
9012
|
+
if (options.length) {
|
|
9013
|
+
options[0].selected = true;
|
|
9014
|
+
}
|
|
8972
9015
|
}
|
|
8973
9016
|
}
|
|
8974
9017
|
|
|
@@ -9917,8 +9960,8 @@ var ReactDefaultPerf = {
|
|
|
9917
9960
|
ReactDefaultPerf._allMeasurements.length - 1
|
|
9918
9961
|
].totalTime = performanceNow() - start;
|
|
9919
9962
|
return rv;
|
|
9920
|
-
} else if (
|
|
9921
|
-
|
|
9963
|
+
} else if (fnName === '_mountImageIntoNode' ||
|
|
9964
|
+
moduleName === 'ReactDOMIDOperations') {
|
|
9922
9965
|
start = performanceNow();
|
|
9923
9966
|
rv = func.apply(this, args);
|
|
9924
9967
|
totalTime = performanceNow() - start;
|
|
@@ -9964,6 +10007,10 @@ var ReactDefaultPerf = {
|
|
|
9964
10007
|
(fnName === 'mountComponent' ||
|
|
9965
10008
|
fnName === 'updateComponent' || fnName === '_renderValidatedComponent')))) {
|
|
9966
10009
|
|
|
10010
|
+
if (typeof this._currentElement.type === 'string') {
|
|
10011
|
+
return func.apply(this, args);
|
|
10012
|
+
}
|
|
10013
|
+
|
|
9967
10014
|
var rootNodeID = fnName === 'mountComponent' ?
|
|
9968
10015
|
args[0] :
|
|
9969
10016
|
this._rootNodeID;
|
|
@@ -9996,17 +10043,10 @@ var ReactDefaultPerf = {
|
|
|
9996
10043
|
addValue(entry.inclusive, rootNodeID, totalTime);
|
|
9997
10044
|
}
|
|
9998
10045
|
|
|
9999
|
-
var displayName = null;
|
|
10000
|
-
if (this._instance.constructor.displayName) {
|
|
10001
|
-
displayName = this._instance.constructor.displayName;
|
|
10002
|
-
} else if (this._currentElement.type) {
|
|
10003
|
-
displayName = this._currentElement.type;
|
|
10004
|
-
}
|
|
10005
|
-
|
|
10006
10046
|
entry.displayNames[rootNodeID] = {
|
|
10007
|
-
current:
|
|
10047
|
+
current: this.getName(),
|
|
10008
10048
|
owner: this._currentElement._owner ?
|
|
10009
|
-
this._currentElement._owner.
|
|
10049
|
+
this._currentElement._owner.getName() :
|
|
10010
10050
|
'<root>'
|
|
10011
10051
|
};
|
|
10012
10052
|
|
|
@@ -10457,6 +10497,60 @@ ReactElement.cloneAndReplaceProps = function(oldElement, newProps) {
|
|
|
10457
10497
|
return newElement;
|
|
10458
10498
|
};
|
|
10459
10499
|
|
|
10500
|
+
ReactElement.cloneElement = function(element, config, children) {
|
|
10501
|
+
var propName;
|
|
10502
|
+
|
|
10503
|
+
// Original props are copied
|
|
10504
|
+
var props = assign({}, element.props);
|
|
10505
|
+
|
|
10506
|
+
// Reserved names are extracted
|
|
10507
|
+
var key = element.key;
|
|
10508
|
+
var ref = element.ref;
|
|
10509
|
+
|
|
10510
|
+
// Owner will be preserved, unless ref is overridden
|
|
10511
|
+
var owner = element._owner;
|
|
10512
|
+
|
|
10513
|
+
if (config != null) {
|
|
10514
|
+
if (config.ref !== undefined) {
|
|
10515
|
+
// Silently steal the ref from the parent.
|
|
10516
|
+
ref = config.ref;
|
|
10517
|
+
owner = ReactCurrentOwner.current;
|
|
10518
|
+
}
|
|
10519
|
+
if (config.key !== undefined) {
|
|
10520
|
+
key = '' + config.key;
|
|
10521
|
+
}
|
|
10522
|
+
// Remaining properties override existing props
|
|
10523
|
+
for (propName in config) {
|
|
10524
|
+
if (config.hasOwnProperty(propName) &&
|
|
10525
|
+
!RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
10526
|
+
props[propName] = config[propName];
|
|
10527
|
+
}
|
|
10528
|
+
}
|
|
10529
|
+
}
|
|
10530
|
+
|
|
10531
|
+
// Children can be more than one argument, and those are transferred onto
|
|
10532
|
+
// the newly allocated props object.
|
|
10533
|
+
var childrenLength = arguments.length - 2;
|
|
10534
|
+
if (childrenLength === 1) {
|
|
10535
|
+
props.children = children;
|
|
10536
|
+
} else if (childrenLength > 1) {
|
|
10537
|
+
var childArray = Array(childrenLength);
|
|
10538
|
+
for (var i = 0; i < childrenLength; i++) {
|
|
10539
|
+
childArray[i] = arguments[i + 2];
|
|
10540
|
+
}
|
|
10541
|
+
props.children = childArray;
|
|
10542
|
+
}
|
|
10543
|
+
|
|
10544
|
+
return new ReactElement(
|
|
10545
|
+
element.type,
|
|
10546
|
+
key,
|
|
10547
|
+
ref,
|
|
10548
|
+
owner,
|
|
10549
|
+
element._context,
|
|
10550
|
+
props
|
|
10551
|
+
);
|
|
10552
|
+
};
|
|
10553
|
+
|
|
10460
10554
|
/**
|
|
10461
10555
|
* @param {?object} object
|
|
10462
10556
|
* @return {boolean} True if `object` is a valid component.
|
|
@@ -10615,7 +10709,8 @@ function validatePropertyKey(name, element, parentType) {
|
|
|
10615
10709
|
*/
|
|
10616
10710
|
function warnAndMonitorForKeyUse(message, element, parentType) {
|
|
10617
10711
|
var ownerName = getCurrentOwnerDisplayName();
|
|
10618
|
-
var parentName = parentType
|
|
10712
|
+
var parentName = typeof parentType === 'string' ?
|
|
10713
|
+
parentType : parentType.displayName || parentType.name;
|
|
10619
10714
|
|
|
10620
10715
|
var useName = ownerName || parentName;
|
|
10621
10716
|
var memoizer = ownerHasKeyUseWarning[message] || (
|
|
@@ -10626,24 +10721,30 @@ function warnAndMonitorForKeyUse(message, element, parentType) {
|
|
|
10626
10721
|
}
|
|
10627
10722
|
memoizer[useName] = true;
|
|
10628
10723
|
|
|
10629
|
-
|
|
10630
|
-
(" Check the render method of " + ownerName + ".") :
|
|
10631
|
-
(" Check the React.render call using <" + parentName + ">.")
|
|
10724
|
+
var parentOrOwnerAddendum =
|
|
10725
|
+
ownerName ? (" Check the render method of " + ownerName + ".") :
|
|
10726
|
+
parentName ? (" Check the React.render call using <" + parentName + ">.") :
|
|
10727
|
+
'';
|
|
10632
10728
|
|
|
10633
10729
|
// Usually the current owner is the offender, but if it accepts children as a
|
|
10634
10730
|
// property, it may be the creator of the child that's responsible for
|
|
10635
10731
|
// assigning it a key.
|
|
10732
|
+
var childOwnerAddendum = '';
|
|
10636
10733
|
if (element &&
|
|
10637
10734
|
element._owner &&
|
|
10638
10735
|
element._owner !== ReactCurrentOwner.current) {
|
|
10639
10736
|
// Name of the component that originally created this child.
|
|
10640
10737
|
var childOwnerName = getName(element._owner);
|
|
10641
10738
|
|
|
10642
|
-
|
|
10739
|
+
childOwnerAddendum = (" It was passed a child from " + childOwnerName + ".");
|
|
10643
10740
|
}
|
|
10644
10741
|
|
|
10645
|
-
|
|
10646
|
-
|
|
10742
|
+
("production" !== "development" ? warning(
|
|
10743
|
+
false,
|
|
10744
|
+
message + '%s%s See http://fb.me/react-warning-keys for more information.',
|
|
10745
|
+
parentOrOwnerAddendum,
|
|
10746
|
+
childOwnerAddendum
|
|
10747
|
+
) : null);
|
|
10647
10748
|
}
|
|
10648
10749
|
|
|
10649
10750
|
/**
|
|
@@ -10727,7 +10828,7 @@ function checkPropTypes(componentName, propTypes, props, location) {
|
|
|
10727
10828
|
loggedTypeFailures[error.message] = true;
|
|
10728
10829
|
|
|
10729
10830
|
var addendum = getDeclarationErrorAddendum(this);
|
|
10730
|
-
("production" !== "development" ? warning(false, 'Failed propType: '
|
|
10831
|
+
("production" !== "development" ? warning(false, 'Failed propType: %s%s', error.message, addendum) : null);
|
|
10731
10832
|
}
|
|
10732
10833
|
}
|
|
10733
10834
|
}
|
|
@@ -10764,9 +10865,9 @@ function warnForPropsMutation(propName, element) {
|
|
|
10764
10865
|
|
|
10765
10866
|
("production" !== "development" ? warning(
|
|
10766
10867
|
false,
|
|
10767
|
-
'Don\'t set .props.%s of the React component%s. ' +
|
|
10768
|
-
'
|
|
10769
|
-
'
|
|
10868
|
+
'Don\'t set .props.%s of the React component%s. Instead, specify the ' +
|
|
10869
|
+
'correct value when initially creating the element or use ' +
|
|
10870
|
+
'React.cloneElement to make a new element with updated props.%s',
|
|
10770
10871
|
propName,
|
|
10771
10872
|
elementInfo,
|
|
10772
10873
|
ownerInfo
|
|
@@ -10817,6 +10918,42 @@ function checkAndWarnForMutatedProps(element) {
|
|
|
10817
10918
|
}
|
|
10818
10919
|
}
|
|
10819
10920
|
|
|
10921
|
+
/**
|
|
10922
|
+
* Given an element, validate that its props follow the propTypes definition,
|
|
10923
|
+
* provided by the type.
|
|
10924
|
+
*
|
|
10925
|
+
* @param {ReactElement} element
|
|
10926
|
+
*/
|
|
10927
|
+
function validatePropTypes(element) {
|
|
10928
|
+
if (element.type == null) {
|
|
10929
|
+
// This has already warned. Don't throw.
|
|
10930
|
+
return;
|
|
10931
|
+
}
|
|
10932
|
+
// Extract the component class from the element. Converts string types
|
|
10933
|
+
// to a composite class which may have propTypes.
|
|
10934
|
+
// TODO: Validating a string's propTypes is not decoupled from the
|
|
10935
|
+
// rendering target which is problematic.
|
|
10936
|
+
var componentClass = ReactNativeComponent.getComponentClassForElement(
|
|
10937
|
+
element
|
|
10938
|
+
);
|
|
10939
|
+
var name = componentClass.displayName || componentClass.name;
|
|
10940
|
+
if (componentClass.propTypes) {
|
|
10941
|
+
checkPropTypes(
|
|
10942
|
+
name,
|
|
10943
|
+
componentClass.propTypes,
|
|
10944
|
+
element.props,
|
|
10945
|
+
ReactPropTypeLocations.prop
|
|
10946
|
+
);
|
|
10947
|
+
}
|
|
10948
|
+
if (typeof componentClass.getDefaultProps === 'function') {
|
|
10949
|
+
("production" !== "development" ? warning(
|
|
10950
|
+
componentClass.getDefaultProps.isReactClassApproved,
|
|
10951
|
+
'getDefaultProps is only used on classic React.createClass ' +
|
|
10952
|
+
'definitions. Use a static property named `defaultProps` instead.'
|
|
10953
|
+
) : null);
|
|
10954
|
+
}
|
|
10955
|
+
}
|
|
10956
|
+
|
|
10820
10957
|
var ReactElementValidator = {
|
|
10821
10958
|
|
|
10822
10959
|
checkAndWarnForMutatedProps: checkAndWarnForMutatedProps,
|
|
@@ -10843,33 +10980,7 @@ var ReactElementValidator = {
|
|
|
10843
10980
|
validateChildKeys(arguments[i], type);
|
|
10844
10981
|
}
|
|
10845
10982
|
|
|
10846
|
-
|
|
10847
|
-
// Extract the component class from the element. Converts string types
|
|
10848
|
-
// to a composite class which may have propTypes.
|
|
10849
|
-
// TODO: Validating a string's propTypes is not decoupled from the
|
|
10850
|
-
// rendering target which is problematic.
|
|
10851
|
-
var componentClass = ReactNativeComponent.getComponentClassForElement(
|
|
10852
|
-
element
|
|
10853
|
-
);
|
|
10854
|
-
var name = componentClass.displayName || componentClass.name;
|
|
10855
|
-
if ("production" !== "development") {
|
|
10856
|
-
if (componentClass.propTypes) {
|
|
10857
|
-
checkPropTypes(
|
|
10858
|
-
name,
|
|
10859
|
-
componentClass.propTypes,
|
|
10860
|
-
element.props,
|
|
10861
|
-
ReactPropTypeLocations.prop
|
|
10862
|
-
);
|
|
10863
|
-
}
|
|
10864
|
-
}
|
|
10865
|
-
if (typeof componentClass.getDefaultProps === 'function') {
|
|
10866
|
-
("production" !== "development" ? warning(
|
|
10867
|
-
componentClass.getDefaultProps.isReactClassApproved,
|
|
10868
|
-
'getDefaultProps is only used on classic React.createClass ' +
|
|
10869
|
-
'definitions. Use a static property named `defaultProps` instead.'
|
|
10870
|
-
) : null);
|
|
10871
|
-
}
|
|
10872
|
-
}
|
|
10983
|
+
validatePropTypes(element);
|
|
10873
10984
|
|
|
10874
10985
|
return element;
|
|
10875
10986
|
},
|
|
@@ -10909,6 +11020,15 @@ var ReactElementValidator = {
|
|
|
10909
11020
|
|
|
10910
11021
|
|
|
10911
11022
|
return validatedFactory;
|
|
11023
|
+
},
|
|
11024
|
+
|
|
11025
|
+
cloneElement: function(element, props, children) {
|
|
11026
|
+
var newElement = ReactElement.cloneElement.apply(this, arguments);
|
|
11027
|
+
for (var i = 2; i < arguments.length; i++) {
|
|
11028
|
+
validateChildKeys(arguments[i], newElement.type);
|
|
11029
|
+
}
|
|
11030
|
+
validatePropTypes(newElement);
|
|
11031
|
+
return newElement;
|
|
10912
11032
|
}
|
|
10913
11033
|
|
|
10914
11034
|
};
|
|
@@ -11417,7 +11537,8 @@ var ReactFragment = {
|
|
|
11417
11537
|
("production" !== "development" ? warning(
|
|
11418
11538
|
didWarnForFragment(fragment),
|
|
11419
11539
|
'Any use of a keyed object should be wrapped in ' +
|
|
11420
|
-
'React.addons.createFragment(object) before passed as a
|
|
11540
|
+
'React.addons.createFragment(object) before being passed as a ' +
|
|
11541
|
+
'child.'
|
|
11421
11542
|
) : null);
|
|
11422
11543
|
return fragment;
|
|
11423
11544
|
}
|
|
@@ -14017,6 +14138,7 @@ module.exports = ReactPropTypeLocations;
|
|
|
14017
14138
|
'use strict';
|
|
14018
14139
|
|
|
14019
14140
|
var ReactElement = _dereq_(63);
|
|
14141
|
+
var ReactFragment = _dereq_(69);
|
|
14020
14142
|
var ReactPropTypeLocationNames = _dereq_(84);
|
|
14021
14143
|
|
|
14022
14144
|
var emptyFunction = _dereq_(129);
|
|
@@ -14296,6 +14418,7 @@ function isNode(propValue) {
|
|
|
14296
14418
|
switch (typeof propValue) {
|
|
14297
14419
|
case 'number':
|
|
14298
14420
|
case 'string':
|
|
14421
|
+
case 'undefined':
|
|
14299
14422
|
return true;
|
|
14300
14423
|
case 'boolean':
|
|
14301
14424
|
return !propValue;
|
|
@@ -14303,9 +14426,10 @@ function isNode(propValue) {
|
|
|
14303
14426
|
if (Array.isArray(propValue)) {
|
|
14304
14427
|
return propValue.every(isNode);
|
|
14305
14428
|
}
|
|
14306
|
-
if (ReactElement.isValidElement(propValue)) {
|
|
14429
|
+
if (propValue === null || ReactElement.isValidElement(propValue)) {
|
|
14307
14430
|
return true;
|
|
14308
14431
|
}
|
|
14432
|
+
propValue = ReactFragment.extractIfFragment(propValue);
|
|
14309
14433
|
for (var k in propValue) {
|
|
14310
14434
|
if (!isNode(propValue[k])) {
|
|
14311
14435
|
return false;
|
|
@@ -14348,7 +14472,7 @@ function getPreciseType(propValue) {
|
|
|
14348
14472
|
|
|
14349
14473
|
module.exports = ReactPropTypes;
|
|
14350
14474
|
|
|
14351
|
-
},{"129":129,"63":63,"84":84}],87:[function(_dereq_,module,exports){
|
|
14475
|
+
},{"129":129,"63":63,"69":69,"84":84}],87:[function(_dereq_,module,exports){
|
|
14352
14476
|
/**
|
|
14353
14477
|
* Copyright 2013-2015, Facebook, Inc.
|
|
14354
14478
|
* All rights reserved.
|
|
@@ -14669,7 +14793,6 @@ var ReactReconciler = {
|
|
|
14669
14793
|
}
|
|
14670
14794
|
|
|
14671
14795
|
var refsChanged = ReactRef.shouldUpdateRefs(
|
|
14672
|
-
this,
|
|
14673
14796
|
prevElement,
|
|
14674
14797
|
nextElement
|
|
14675
14798
|
);
|
|
@@ -14746,7 +14869,7 @@ ReactRef.attachRefs = function(instance, element) {
|
|
|
14746
14869
|
}
|
|
14747
14870
|
};
|
|
14748
14871
|
|
|
14749
|
-
ReactRef.shouldUpdateRefs = function(
|
|
14872
|
+
ReactRef.shouldUpdateRefs = function(prevElement, nextElement) {
|
|
14750
14873
|
// If either the owner or a `ref` has changed, make sure the newest owner
|
|
14751
14874
|
// has stored a reference to `this`, and the previous owner (if different)
|
|
14752
14875
|
// has forgotten the reference to `this`. We use the element instead
|
|
@@ -15172,7 +15295,7 @@ var ReactTestUtils = {
|
|
|
15172
15295
|
isDOMComponent: function(inst) {
|
|
15173
15296
|
// TODO: Fix this heuristic. It's just here because composites can currently
|
|
15174
15297
|
// pretend to be DOM components.
|
|
15175
|
-
return !!(inst && inst.
|
|
15298
|
+
return !!(inst && inst.tagName && inst.getDOMNode);
|
|
15176
15299
|
},
|
|
15177
15300
|
|
|
15178
15301
|
isDOMComponentElement: function(inst) {
|
|
@@ -18549,7 +18672,7 @@ module.exports = camelizeStyleName;
|
|
|
18549
18672
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
18550
18673
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
18551
18674
|
*
|
|
18552
|
-
* @typechecks
|
|
18675
|
+
* @typechecks static-only
|
|
18553
18676
|
* @providesModule cloneWithProps
|
|
18554
18677
|
*/
|
|
18555
18678
|
|
|
@@ -18763,6 +18886,7 @@ function createFullPageComponent(tag) {
|
|
|
18763
18886
|
var elementFactory = ReactElement.createFactory(tag);
|
|
18764
18887
|
|
|
18765
18888
|
var FullPageComponent = ReactClass.createClass({
|
|
18889
|
+
tagName: tag.toUpperCase(),
|
|
18766
18890
|
displayName: 'ReactFullPageComponent' + tag,
|
|
18767
18891
|
|
|
18768
18892
|
componentWillUnmount: function() {
|
|
@@ -19996,6 +20120,7 @@ assign(
|
|
|
19996
20120
|
function isInternalComponentType(type) {
|
|
19997
20121
|
return (
|
|
19998
20122
|
typeof type === 'function' &&
|
|
20123
|
+
typeof type.prototype !== 'undefined' &&
|
|
19999
20124
|
typeof type.prototype.mountComponent === 'function' &&
|
|
20000
20125
|
typeof type.prototype.receiveComponent === 'function'
|
|
20001
20126
|
);
|
|
@@ -21251,11 +21376,14 @@ module.exports = traverseAllChildren;
|
|
|
21251
21376
|
* @providesModule update
|
|
21252
21377
|
*/
|
|
21253
21378
|
|
|
21379
|
+
/* global hasOwnProperty:true */
|
|
21380
|
+
|
|
21254
21381
|
'use strict';
|
|
21255
21382
|
|
|
21256
21383
|
var assign = _dereq_(29);
|
|
21257
21384
|
var keyOf = _dereq_(157);
|
|
21258
21385
|
var invariant = _dereq_(150);
|
|
21386
|
+
var hasOwnProperty = {}.hasOwnProperty;
|
|
21259
21387
|
|
|
21260
21388
|
function shallowCopy(x) {
|
|
21261
21389
|
if (Array.isArray(x)) {
|
|
@@ -21315,7 +21443,7 @@ function update(value, spec) {
|
|
|
21315
21443
|
COMMAND_SET
|
|
21316
21444
|
) : invariant(typeof spec === 'object'));
|
|
21317
21445
|
|
|
21318
|
-
if (
|
|
21446
|
+
if (hasOwnProperty.call(spec, COMMAND_SET)) {
|
|
21319
21447
|
("production" !== "development" ? invariant(
|
|
21320
21448
|
Object.keys(spec).length === 1,
|
|
21321
21449
|
'Cannot have more than one key in an object with %s',
|
|
@@ -21327,7 +21455,7 @@ function update(value, spec) {
|
|
|
21327
21455
|
|
|
21328
21456
|
var nextValue = shallowCopy(value);
|
|
21329
21457
|
|
|
21330
|
-
if (
|
|
21458
|
+
if (hasOwnProperty.call(spec, COMMAND_MERGE)) {
|
|
21331
21459
|
var mergeObj = spec[COMMAND_MERGE];
|
|
21332
21460
|
("production" !== "development" ? invariant(
|
|
21333
21461
|
mergeObj && typeof mergeObj === 'object',
|
|
@@ -21344,21 +21472,21 @@ function update(value, spec) {
|
|
|
21344
21472
|
assign(nextValue, spec[COMMAND_MERGE]);
|
|
21345
21473
|
}
|
|
21346
21474
|
|
|
21347
|
-
if (
|
|
21475
|
+
if (hasOwnProperty.call(spec, COMMAND_PUSH)) {
|
|
21348
21476
|
invariantArrayCase(value, spec, COMMAND_PUSH);
|
|
21349
21477
|
spec[COMMAND_PUSH].forEach(function(item) {
|
|
21350
21478
|
nextValue.push(item);
|
|
21351
21479
|
});
|
|
21352
21480
|
}
|
|
21353
21481
|
|
|
21354
|
-
if (
|
|
21482
|
+
if (hasOwnProperty.call(spec, COMMAND_UNSHIFT)) {
|
|
21355
21483
|
invariantArrayCase(value, spec, COMMAND_UNSHIFT);
|
|
21356
21484
|
spec[COMMAND_UNSHIFT].forEach(function(item) {
|
|
21357
21485
|
nextValue.unshift(item);
|
|
21358
21486
|
});
|
|
21359
21487
|
}
|
|
21360
21488
|
|
|
21361
|
-
if (
|
|
21489
|
+
if (hasOwnProperty.call(spec, COMMAND_SPLICE)) {
|
|
21362
21490
|
("production" !== "development" ? invariant(
|
|
21363
21491
|
Array.isArray(value),
|
|
21364
21492
|
'Expected %s target to be an array; got %s',
|
|
@@ -21384,7 +21512,7 @@ function update(value, spec) {
|
|
|
21384
21512
|
});
|
|
21385
21513
|
}
|
|
21386
21514
|
|
|
21387
|
-
if (
|
|
21515
|
+
if (hasOwnProperty.call(spec, COMMAND_APPLY)) {
|
|
21388
21516
|
("production" !== "development" ? invariant(
|
|
21389
21517
|
typeof spec[COMMAND_APPLY] === 'function',
|
|
21390
21518
|
'update(): expected spec of %s to be a function; got %s.',
|