graphiql-rails 1.4.5 → 1.4.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/graphiql/rails/application.js +3 -3
- data/app/assets/javascripts/graphiql/rails/{graphiql-0.11.5.js → graphiql-0.11.9.js} +240 -190
- data/app/assets/javascripts/graphiql/rails/react-16.0.0.js +1698 -0
- data/app/assets/javascripts/graphiql/rails/react-dom-16.0.0.js +17221 -0
- data/app/assets/stylesheets/graphiql/rails/application.css +1 -1
- data/app/assets/stylesheets/graphiql/rails/{graphiql-0.11.5.css → graphiql-0.11.9.css} +2 -2
- data/lib/graphiql/rails/version.rb +1 -1
- metadata +6 -6
- data/app/assets/javascripts/graphiql/rails/react-15.6.2.js +0 -4268
- data/app/assets/javascripts/graphiql/rails/react-dom-15.6.2.js +0 -18853
@@ -63,7 +63,6 @@
|
|
63
63
|
-webkit-box-direction: normal;
|
64
64
|
-ms-flex-direction: row;
|
65
65
|
flex-direction: row;
|
66
|
-
overflow-x: hidden;
|
67
66
|
}
|
68
67
|
|
69
68
|
.graphiql-container .topBar {
|
@@ -85,6 +84,7 @@
|
|
85
84
|
-ms-flex: 1;
|
86
85
|
flex: 1;
|
87
86
|
height: 34px;
|
87
|
+
overflow-y: visible;
|
88
88
|
padding: 7px 14px 6px;
|
89
89
|
-webkit-user-select: none;
|
90
90
|
-moz-user-select: none;
|
@@ -1259,7 +1259,7 @@ span.CodeMirror-selectedtext { background: none; }
|
|
1259
1259
|
}
|
1260
1260
|
|
1261
1261
|
.graphiql-container .arg-default-value {
|
1262
|
-
color: #
|
1262
|
+
color: #43A047;
|
1263
1263
|
}
|
1264
1264
|
|
1265
1265
|
.graphiql-container .doc-deprecation {
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphiql-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Mosolgo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -118,11 +118,11 @@ extra_rdoc_files: []
|
|
118
118
|
files:
|
119
119
|
- app/assets/javascripts/graphiql/rails/application.js
|
120
120
|
- app/assets/javascripts/graphiql/rails/fetch-0.10.1.js
|
121
|
-
- app/assets/javascripts/graphiql/rails/graphiql-0.11.
|
122
|
-
- app/assets/javascripts/graphiql/rails/react-
|
123
|
-
- app/assets/javascripts/graphiql/rails/react-dom-
|
121
|
+
- app/assets/javascripts/graphiql/rails/graphiql-0.11.9.js
|
122
|
+
- app/assets/javascripts/graphiql/rails/react-16.0.0.js
|
123
|
+
- app/assets/javascripts/graphiql/rails/react-dom-16.0.0.js
|
124
124
|
- app/assets/stylesheets/graphiql/rails/application.css
|
125
|
-
- app/assets/stylesheets/graphiql/rails/graphiql-0.11.
|
125
|
+
- app/assets/stylesheets/graphiql/rails/graphiql-0.11.9.css
|
126
126
|
- app/controllers/graphiql/rails/editors_controller.rb
|
127
127
|
- app/views/graphiql/rails/editors/show.html.erb
|
128
128
|
- config/routes.rb
|
@@ -1,4268 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* React v15.6.2
|
3
|
-
*/
|
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
|
-
/**
|
6
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
7
|
-
*
|
8
|
-
* This source code is licensed under the MIT license found in the
|
9
|
-
* LICENSE file in the root directory of this source tree.
|
10
|
-
*
|
11
|
-
*
|
12
|
-
*/
|
13
|
-
|
14
|
-
'use strict';
|
15
|
-
|
16
|
-
/**
|
17
|
-
* Escape and wrap key so it is safe to use as a reactid
|
18
|
-
*
|
19
|
-
* @param {string} key to be escaped.
|
20
|
-
* @return {string} the escaped key.
|
21
|
-
*/
|
22
|
-
|
23
|
-
function escape(key) {
|
24
|
-
var escapeRegex = /[=:]/g;
|
25
|
-
var escaperLookup = {
|
26
|
-
'=': '=0',
|
27
|
-
':': '=2'
|
28
|
-
};
|
29
|
-
var escapedString = ('' + key).replace(escapeRegex, function (match) {
|
30
|
-
return escaperLookup[match];
|
31
|
-
});
|
32
|
-
|
33
|
-
return '$' + escapedString;
|
34
|
-
}
|
35
|
-
|
36
|
-
/**
|
37
|
-
* Unescape and unwrap key for human-readable display
|
38
|
-
*
|
39
|
-
* @param {string} key to unescape.
|
40
|
-
* @return {string} the unescaped key.
|
41
|
-
*/
|
42
|
-
function unescape(key) {
|
43
|
-
var unescapeRegex = /(=0|=2)/g;
|
44
|
-
var unescaperLookup = {
|
45
|
-
'=0': '=',
|
46
|
-
'=2': ':'
|
47
|
-
};
|
48
|
-
var keySubstring = key[0] === '.' && key[1] === '$' ? key.substring(2) : key.substring(1);
|
49
|
-
|
50
|
-
return ('' + keySubstring).replace(unescapeRegex, function (match) {
|
51
|
-
return unescaperLookup[match];
|
52
|
-
});
|
53
|
-
}
|
54
|
-
|
55
|
-
var KeyEscapeUtils = {
|
56
|
-
escape: escape,
|
57
|
-
unescape: unescape
|
58
|
-
};
|
59
|
-
|
60
|
-
module.exports = KeyEscapeUtils;
|
61
|
-
},{}],2:[function(_dereq_,module,exports){
|
62
|
-
/**
|
63
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
64
|
-
*
|
65
|
-
* This source code is licensed under the MIT license found in the
|
66
|
-
* LICENSE file in the root directory of this source tree.
|
67
|
-
*
|
68
|
-
*
|
69
|
-
*/
|
70
|
-
|
71
|
-
'use strict';
|
72
|
-
|
73
|
-
var _prodInvariant = _dereq_(25);
|
74
|
-
|
75
|
-
var invariant = _dereq_(30);
|
76
|
-
|
77
|
-
/**
|
78
|
-
* Static poolers. Several custom versions for each potential number of
|
79
|
-
* arguments. A completely generic pooler is easy to implement, but would
|
80
|
-
* require accessing the `arguments` object. In each of these, `this` refers to
|
81
|
-
* the Class itself, not an instance. If any others are needed, simply add them
|
82
|
-
* here, or in their own files.
|
83
|
-
*/
|
84
|
-
var oneArgumentPooler = function (copyFieldsFrom) {
|
85
|
-
var Klass = this;
|
86
|
-
if (Klass.instancePool.length) {
|
87
|
-
var instance = Klass.instancePool.pop();
|
88
|
-
Klass.call(instance, copyFieldsFrom);
|
89
|
-
return instance;
|
90
|
-
} else {
|
91
|
-
return new Klass(copyFieldsFrom);
|
92
|
-
}
|
93
|
-
};
|
94
|
-
|
95
|
-
var twoArgumentPooler = function (a1, a2) {
|
96
|
-
var Klass = this;
|
97
|
-
if (Klass.instancePool.length) {
|
98
|
-
var instance = Klass.instancePool.pop();
|
99
|
-
Klass.call(instance, a1, a2);
|
100
|
-
return instance;
|
101
|
-
} else {
|
102
|
-
return new Klass(a1, a2);
|
103
|
-
}
|
104
|
-
};
|
105
|
-
|
106
|
-
var threeArgumentPooler = function (a1, a2, a3) {
|
107
|
-
var Klass = this;
|
108
|
-
if (Klass.instancePool.length) {
|
109
|
-
var instance = Klass.instancePool.pop();
|
110
|
-
Klass.call(instance, a1, a2, a3);
|
111
|
-
return instance;
|
112
|
-
} else {
|
113
|
-
return new Klass(a1, a2, a3);
|
114
|
-
}
|
115
|
-
};
|
116
|
-
|
117
|
-
var fourArgumentPooler = function (a1, a2, a3, a4) {
|
118
|
-
var Klass = this;
|
119
|
-
if (Klass.instancePool.length) {
|
120
|
-
var instance = Klass.instancePool.pop();
|
121
|
-
Klass.call(instance, a1, a2, a3, a4);
|
122
|
-
return instance;
|
123
|
-
} else {
|
124
|
-
return new Klass(a1, a2, a3, a4);
|
125
|
-
}
|
126
|
-
};
|
127
|
-
|
128
|
-
var standardReleaser = function (instance) {
|
129
|
-
var Klass = this;
|
130
|
-
!(instance instanceof Klass) ? "development" !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : _prodInvariant('25') : void 0;
|
131
|
-
instance.destructor();
|
132
|
-
if (Klass.instancePool.length < Klass.poolSize) {
|
133
|
-
Klass.instancePool.push(instance);
|
134
|
-
}
|
135
|
-
};
|
136
|
-
|
137
|
-
var DEFAULT_POOL_SIZE = 10;
|
138
|
-
var DEFAULT_POOLER = oneArgumentPooler;
|
139
|
-
|
140
|
-
/**
|
141
|
-
* Augments `CopyConstructor` to be a poolable class, augmenting only the class
|
142
|
-
* itself (statically) not adding any prototypical fields. Any CopyConstructor
|
143
|
-
* you give this may have a `poolSize` property, and will look for a
|
144
|
-
* prototypical `destructor` on instances.
|
145
|
-
*
|
146
|
-
* @param {Function} CopyConstructor Constructor that can be used to reset.
|
147
|
-
* @param {Function} pooler Customizable pooler.
|
148
|
-
*/
|
149
|
-
var addPoolingTo = function (CopyConstructor, pooler) {
|
150
|
-
// Casting as any so that flow ignores the actual implementation and trusts
|
151
|
-
// it to match the type we declared
|
152
|
-
var NewKlass = CopyConstructor;
|
153
|
-
NewKlass.instancePool = [];
|
154
|
-
NewKlass.getPooled = pooler || DEFAULT_POOLER;
|
155
|
-
if (!NewKlass.poolSize) {
|
156
|
-
NewKlass.poolSize = DEFAULT_POOL_SIZE;
|
157
|
-
}
|
158
|
-
NewKlass.release = standardReleaser;
|
159
|
-
return NewKlass;
|
160
|
-
};
|
161
|
-
|
162
|
-
var PooledClass = {
|
163
|
-
addPoolingTo: addPoolingTo,
|
164
|
-
oneArgumentPooler: oneArgumentPooler,
|
165
|
-
twoArgumentPooler: twoArgumentPooler,
|
166
|
-
threeArgumentPooler: threeArgumentPooler,
|
167
|
-
fourArgumentPooler: fourArgumentPooler
|
168
|
-
};
|
169
|
-
|
170
|
-
module.exports = PooledClass;
|
171
|
-
},{"25":25,"30":30}],3:[function(_dereq_,module,exports){
|
172
|
-
/**
|
173
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
174
|
-
*
|
175
|
-
* This source code is licensed under the MIT license found in the
|
176
|
-
* LICENSE file in the root directory of this source tree.
|
177
|
-
*
|
178
|
-
*/
|
179
|
-
|
180
|
-
'use strict';
|
181
|
-
|
182
|
-
var _assign = _dereq_(32);
|
183
|
-
|
184
|
-
var ReactBaseClasses = _dereq_(4);
|
185
|
-
var ReactChildren = _dereq_(5);
|
186
|
-
var ReactDOMFactories = _dereq_(8);
|
187
|
-
var ReactElement = _dereq_(9);
|
188
|
-
var ReactPropTypes = _dereq_(14);
|
189
|
-
var ReactVersion = _dereq_(17);
|
190
|
-
|
191
|
-
var createReactClass = _dereq_(20);
|
192
|
-
var onlyChild = _dereq_(24);
|
193
|
-
|
194
|
-
var createElement = ReactElement.createElement;
|
195
|
-
var createFactory = ReactElement.createFactory;
|
196
|
-
var cloneElement = ReactElement.cloneElement;
|
197
|
-
|
198
|
-
if ("development" !== 'production') {
|
199
|
-
var lowPriorityWarning = _dereq_(23);
|
200
|
-
var canDefineProperty = _dereq_(18);
|
201
|
-
var ReactElementValidator = _dereq_(11);
|
202
|
-
var didWarnPropTypesDeprecated = false;
|
203
|
-
createElement = ReactElementValidator.createElement;
|
204
|
-
createFactory = ReactElementValidator.createFactory;
|
205
|
-
cloneElement = ReactElementValidator.cloneElement;
|
206
|
-
}
|
207
|
-
|
208
|
-
var __spread = _assign;
|
209
|
-
var createMixin = function (mixin) {
|
210
|
-
return mixin;
|
211
|
-
};
|
212
|
-
|
213
|
-
if ("development" !== 'production') {
|
214
|
-
var warnedForSpread = false;
|
215
|
-
var warnedForCreateMixin = false;
|
216
|
-
__spread = function () {
|
217
|
-
lowPriorityWarning(warnedForSpread, 'React.__spread is deprecated and should not be used. Use ' + 'Object.assign directly or another helper function with similar ' + 'semantics. You may be seeing this warning due to your compiler. ' + 'See https://fb.me/react-spread-deprecation for more details.');
|
218
|
-
warnedForSpread = true;
|
219
|
-
return _assign.apply(null, arguments);
|
220
|
-
};
|
221
|
-
|
222
|
-
createMixin = function (mixin) {
|
223
|
-
lowPriorityWarning(warnedForCreateMixin, 'React.createMixin is deprecated and should not be used. ' + 'In React v16.0, it will be removed. ' + 'You can use this mixin directly instead. ' + 'See https://fb.me/createmixin-was-never-implemented for more info.');
|
224
|
-
warnedForCreateMixin = true;
|
225
|
-
return mixin;
|
226
|
-
};
|
227
|
-
}
|
228
|
-
|
229
|
-
var React = {
|
230
|
-
// Modern
|
231
|
-
|
232
|
-
Children: {
|
233
|
-
map: ReactChildren.map,
|
234
|
-
forEach: ReactChildren.forEach,
|
235
|
-
count: ReactChildren.count,
|
236
|
-
toArray: ReactChildren.toArray,
|
237
|
-
only: onlyChild
|
238
|
-
},
|
239
|
-
|
240
|
-
Component: ReactBaseClasses.Component,
|
241
|
-
PureComponent: ReactBaseClasses.PureComponent,
|
242
|
-
|
243
|
-
createElement: createElement,
|
244
|
-
cloneElement: cloneElement,
|
245
|
-
isValidElement: ReactElement.isValidElement,
|
246
|
-
|
247
|
-
// Classic
|
248
|
-
|
249
|
-
PropTypes: ReactPropTypes,
|
250
|
-
createClass: createReactClass,
|
251
|
-
createFactory: createFactory,
|
252
|
-
createMixin: createMixin,
|
253
|
-
|
254
|
-
// This looks DOM specific but these are actually isomorphic helpers
|
255
|
-
// since they are just generating DOM strings.
|
256
|
-
DOM: ReactDOMFactories,
|
257
|
-
|
258
|
-
version: ReactVersion,
|
259
|
-
|
260
|
-
// Deprecated hook for JSX spread, don't use this for anything.
|
261
|
-
__spread: __spread
|
262
|
-
};
|
263
|
-
|
264
|
-
if ("development" !== 'production') {
|
265
|
-
var warnedForCreateClass = false;
|
266
|
-
if (canDefineProperty) {
|
267
|
-
Object.defineProperty(React, 'PropTypes', {
|
268
|
-
get: function () {
|
269
|
-
lowPriorityWarning(didWarnPropTypesDeprecated, 'Accessing PropTypes via the main React package is deprecated,' + ' and will be removed in React v16.0.' + ' Use the latest available v15.* prop-types package from npm instead.' + ' For info on usage, compatibility, migration and more, see ' + 'https://fb.me/prop-types-docs');
|
270
|
-
didWarnPropTypesDeprecated = true;
|
271
|
-
return ReactPropTypes;
|
272
|
-
}
|
273
|
-
});
|
274
|
-
|
275
|
-
Object.defineProperty(React, 'createClass', {
|
276
|
-
get: function () {
|
277
|
-
lowPriorityWarning(warnedForCreateClass, 'Accessing createClass via the main React package is deprecated,' + ' and will be removed in React v16.0.' + " Use a plain JavaScript class instead. If you're not yet " + 'ready to migrate, create-react-class v15.* is available ' + 'on npm as a temporary, drop-in replacement. ' + 'For more info see https://fb.me/react-create-class');
|
278
|
-
warnedForCreateClass = true;
|
279
|
-
return createReactClass;
|
280
|
-
}
|
281
|
-
});
|
282
|
-
}
|
283
|
-
|
284
|
-
// React.DOM factories are deprecated. Wrap these methods so that
|
285
|
-
// invocations of the React.DOM namespace and alert users to switch
|
286
|
-
// to the `react-dom-factories` package.
|
287
|
-
React.DOM = {};
|
288
|
-
var warnedForFactories = false;
|
289
|
-
Object.keys(ReactDOMFactories).forEach(function (factory) {
|
290
|
-
React.DOM[factory] = function () {
|
291
|
-
if (!warnedForFactories) {
|
292
|
-
lowPriorityWarning(false, 'Accessing factories like React.DOM.%s has been deprecated ' + 'and will be removed in v16.0+. Use the ' + 'react-dom-factories package instead. ' + ' Version 1.0 provides a drop-in replacement.' + ' For more info, see https://fb.me/react-dom-factories', factory);
|
293
|
-
warnedForFactories = true;
|
294
|
-
}
|
295
|
-
return ReactDOMFactories[factory].apply(ReactDOMFactories, arguments);
|
296
|
-
};
|
297
|
-
});
|
298
|
-
}
|
299
|
-
|
300
|
-
module.exports = React;
|
301
|
-
},{"11":11,"14":14,"17":17,"18":18,"20":20,"23":23,"24":24,"32":32,"4":4,"5":5,"8":8,"9":9}],4:[function(_dereq_,module,exports){
|
302
|
-
/**
|
303
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
304
|
-
*
|
305
|
-
* This source code is licensed under the MIT license found in the
|
306
|
-
* LICENSE file in the root directory of this source tree.
|
307
|
-
*
|
308
|
-
*/
|
309
|
-
|
310
|
-
'use strict';
|
311
|
-
|
312
|
-
var _prodInvariant = _dereq_(25),
|
313
|
-
_assign = _dereq_(32);
|
314
|
-
|
315
|
-
var ReactNoopUpdateQueue = _dereq_(12);
|
316
|
-
|
317
|
-
var canDefineProperty = _dereq_(18);
|
318
|
-
var emptyObject = _dereq_(29);
|
319
|
-
var invariant = _dereq_(30);
|
320
|
-
var lowPriorityWarning = _dereq_(23);
|
321
|
-
|
322
|
-
/**
|
323
|
-
* Base class helpers for the updating state of a component.
|
324
|
-
*/
|
325
|
-
function ReactComponent(props, context, updater) {
|
326
|
-
this.props = props;
|
327
|
-
this.context = context;
|
328
|
-
this.refs = emptyObject;
|
329
|
-
// We initialize the default updater but the real one gets injected by the
|
330
|
-
// renderer.
|
331
|
-
this.updater = updater || ReactNoopUpdateQueue;
|
332
|
-
}
|
333
|
-
|
334
|
-
ReactComponent.prototype.isReactComponent = {};
|
335
|
-
|
336
|
-
/**
|
337
|
-
* Sets a subset of the state. Always use this to mutate
|
338
|
-
* state. You should treat `this.state` as immutable.
|
339
|
-
*
|
340
|
-
* There is no guarantee that `this.state` will be immediately updated, so
|
341
|
-
* accessing `this.state` after calling this method may return the old value.
|
342
|
-
*
|
343
|
-
* There is no guarantee that calls to `setState` will run synchronously,
|
344
|
-
* as they may eventually be batched together. You can provide an optional
|
345
|
-
* callback that will be executed when the call to setState is actually
|
346
|
-
* completed.
|
347
|
-
*
|
348
|
-
* When a function is provided to setState, it will be called at some point in
|
349
|
-
* the future (not synchronously). It will be called with the up to date
|
350
|
-
* component arguments (state, props, context). These values can be different
|
351
|
-
* from this.* because your function may be called after receiveProps but before
|
352
|
-
* shouldComponentUpdate, and this new state, props, and context will not yet be
|
353
|
-
* assigned to this.
|
354
|
-
*
|
355
|
-
* @param {object|function} partialState Next partial state or function to
|
356
|
-
* produce next partial state to be merged with current state.
|
357
|
-
* @param {?function} callback Called after state is updated.
|
358
|
-
* @final
|
359
|
-
* @protected
|
360
|
-
*/
|
361
|
-
ReactComponent.prototype.setState = function (partialState, callback) {
|
362
|
-
!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? "development" !== 'production' ? invariant(false, 'setState(...): takes an object of state variables to update or a function which returns an object of state variables.') : _prodInvariant('85') : void 0;
|
363
|
-
this.updater.enqueueSetState(this, partialState);
|
364
|
-
if (callback) {
|
365
|
-
this.updater.enqueueCallback(this, callback, 'setState');
|
366
|
-
}
|
367
|
-
};
|
368
|
-
|
369
|
-
/**
|
370
|
-
* Forces an update. This should only be invoked when it is known with
|
371
|
-
* certainty that we are **not** in a DOM transaction.
|
372
|
-
*
|
373
|
-
* You may want to call this when you know that some deeper aspect of the
|
374
|
-
* component's state has changed but `setState` was not called.
|
375
|
-
*
|
376
|
-
* This will not invoke `shouldComponentUpdate`, but it will invoke
|
377
|
-
* `componentWillUpdate` and `componentDidUpdate`.
|
378
|
-
*
|
379
|
-
* @param {?function} callback Called after update is complete.
|
380
|
-
* @final
|
381
|
-
* @protected
|
382
|
-
*/
|
383
|
-
ReactComponent.prototype.forceUpdate = function (callback) {
|
384
|
-
this.updater.enqueueForceUpdate(this);
|
385
|
-
if (callback) {
|
386
|
-
this.updater.enqueueCallback(this, callback, 'forceUpdate');
|
387
|
-
}
|
388
|
-
};
|
389
|
-
|
390
|
-
/**
|
391
|
-
* Deprecated APIs. These APIs used to exist on classic React classes but since
|
392
|
-
* we would like to deprecate them, we're not going to move them over to this
|
393
|
-
* modern base class. Instead, we define a getter that warns if it's accessed.
|
394
|
-
*/
|
395
|
-
if ("development" !== 'production') {
|
396
|
-
var deprecatedAPIs = {
|
397
|
-
isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
|
398
|
-
replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
|
399
|
-
};
|
400
|
-
var defineDeprecationWarning = function (methodName, info) {
|
401
|
-
if (canDefineProperty) {
|
402
|
-
Object.defineProperty(ReactComponent.prototype, methodName, {
|
403
|
-
get: function () {
|
404
|
-
lowPriorityWarning(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
|
405
|
-
return undefined;
|
406
|
-
}
|
407
|
-
});
|
408
|
-
}
|
409
|
-
};
|
410
|
-
for (var fnName in deprecatedAPIs) {
|
411
|
-
if (deprecatedAPIs.hasOwnProperty(fnName)) {
|
412
|
-
defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
|
413
|
-
}
|
414
|
-
}
|
415
|
-
}
|
416
|
-
|
417
|
-
/**
|
418
|
-
* Base class helpers for the updating state of a component.
|
419
|
-
*/
|
420
|
-
function ReactPureComponent(props, context, updater) {
|
421
|
-
// Duplicated from ReactComponent.
|
422
|
-
this.props = props;
|
423
|
-
this.context = context;
|
424
|
-
this.refs = emptyObject;
|
425
|
-
// We initialize the default updater but the real one gets injected by the
|
426
|
-
// renderer.
|
427
|
-
this.updater = updater || ReactNoopUpdateQueue;
|
428
|
-
}
|
429
|
-
|
430
|
-
function ComponentDummy() {}
|
431
|
-
ComponentDummy.prototype = ReactComponent.prototype;
|
432
|
-
ReactPureComponent.prototype = new ComponentDummy();
|
433
|
-
ReactPureComponent.prototype.constructor = ReactPureComponent;
|
434
|
-
// Avoid an extra prototype jump for these methods.
|
435
|
-
_assign(ReactPureComponent.prototype, ReactComponent.prototype);
|
436
|
-
ReactPureComponent.prototype.isPureReactComponent = true;
|
437
|
-
|
438
|
-
module.exports = {
|
439
|
-
Component: ReactComponent,
|
440
|
-
PureComponent: ReactPureComponent
|
441
|
-
};
|
442
|
-
},{"12":12,"18":18,"23":23,"25":25,"29":29,"30":30,"32":32}],5:[function(_dereq_,module,exports){
|
443
|
-
/**
|
444
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
445
|
-
*
|
446
|
-
* This source code is licensed under the MIT license found in the
|
447
|
-
* LICENSE file in the root directory of this source tree.
|
448
|
-
*
|
449
|
-
*/
|
450
|
-
|
451
|
-
'use strict';
|
452
|
-
|
453
|
-
var PooledClass = _dereq_(2);
|
454
|
-
var ReactElement = _dereq_(9);
|
455
|
-
|
456
|
-
var emptyFunction = _dereq_(28);
|
457
|
-
var traverseAllChildren = _dereq_(26);
|
458
|
-
|
459
|
-
var twoArgumentPooler = PooledClass.twoArgumentPooler;
|
460
|
-
var fourArgumentPooler = PooledClass.fourArgumentPooler;
|
461
|
-
|
462
|
-
var userProvidedKeyEscapeRegex = /\/+/g;
|
463
|
-
function escapeUserProvidedKey(text) {
|
464
|
-
return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
|
465
|
-
}
|
466
|
-
|
467
|
-
/**
|
468
|
-
* PooledClass representing the bookkeeping associated with performing a child
|
469
|
-
* traversal. Allows avoiding binding callbacks.
|
470
|
-
*
|
471
|
-
* @constructor ForEachBookKeeping
|
472
|
-
* @param {!function} forEachFunction Function to perform traversal with.
|
473
|
-
* @param {?*} forEachContext Context to perform context with.
|
474
|
-
*/
|
475
|
-
function ForEachBookKeeping(forEachFunction, forEachContext) {
|
476
|
-
this.func = forEachFunction;
|
477
|
-
this.context = forEachContext;
|
478
|
-
this.count = 0;
|
479
|
-
}
|
480
|
-
ForEachBookKeeping.prototype.destructor = function () {
|
481
|
-
this.func = null;
|
482
|
-
this.context = null;
|
483
|
-
this.count = 0;
|
484
|
-
};
|
485
|
-
PooledClass.addPoolingTo(ForEachBookKeeping, twoArgumentPooler);
|
486
|
-
|
487
|
-
function forEachSingleChild(bookKeeping, child, name) {
|
488
|
-
var func = bookKeeping.func,
|
489
|
-
context = bookKeeping.context;
|
490
|
-
|
491
|
-
func.call(context, child, bookKeeping.count++);
|
492
|
-
}
|
493
|
-
|
494
|
-
/**
|
495
|
-
* Iterates through children that are typically specified as `props.children`.
|
496
|
-
*
|
497
|
-
* See https://facebook.github.io/react/docs/top-level-api.html#react.children.foreach
|
498
|
-
*
|
499
|
-
* The provided forEachFunc(child, index) will be called for each
|
500
|
-
* leaf child.
|
501
|
-
*
|
502
|
-
* @param {?*} children Children tree container.
|
503
|
-
* @param {function(*, int)} forEachFunc
|
504
|
-
* @param {*} forEachContext Context for forEachContext.
|
505
|
-
*/
|
506
|
-
function forEachChildren(children, forEachFunc, forEachContext) {
|
507
|
-
if (children == null) {
|
508
|
-
return children;
|
509
|
-
}
|
510
|
-
var traverseContext = ForEachBookKeeping.getPooled(forEachFunc, forEachContext);
|
511
|
-
traverseAllChildren(children, forEachSingleChild, traverseContext);
|
512
|
-
ForEachBookKeeping.release(traverseContext);
|
513
|
-
}
|
514
|
-
|
515
|
-
/**
|
516
|
-
* PooledClass representing the bookkeeping associated with performing a child
|
517
|
-
* mapping. Allows avoiding binding callbacks.
|
518
|
-
*
|
519
|
-
* @constructor MapBookKeeping
|
520
|
-
* @param {!*} mapResult Object containing the ordered map of results.
|
521
|
-
* @param {!function} mapFunction Function to perform mapping with.
|
522
|
-
* @param {?*} mapContext Context to perform mapping with.
|
523
|
-
*/
|
524
|
-
function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) {
|
525
|
-
this.result = mapResult;
|
526
|
-
this.keyPrefix = keyPrefix;
|
527
|
-
this.func = mapFunction;
|
528
|
-
this.context = mapContext;
|
529
|
-
this.count = 0;
|
530
|
-
}
|
531
|
-
MapBookKeeping.prototype.destructor = function () {
|
532
|
-
this.result = null;
|
533
|
-
this.keyPrefix = null;
|
534
|
-
this.func = null;
|
535
|
-
this.context = null;
|
536
|
-
this.count = 0;
|
537
|
-
};
|
538
|
-
PooledClass.addPoolingTo(MapBookKeeping, fourArgumentPooler);
|
539
|
-
|
540
|
-
function mapSingleChildIntoContext(bookKeeping, child, childKey) {
|
541
|
-
var result = bookKeeping.result,
|
542
|
-
keyPrefix = bookKeeping.keyPrefix,
|
543
|
-
func = bookKeeping.func,
|
544
|
-
context = bookKeeping.context;
|
545
|
-
|
546
|
-
|
547
|
-
var mappedChild = func.call(context, child, bookKeeping.count++);
|
548
|
-
if (Array.isArray(mappedChild)) {
|
549
|
-
mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument);
|
550
|
-
} else if (mappedChild != null) {
|
551
|
-
if (ReactElement.isValidElement(mappedChild)) {
|
552
|
-
mappedChild = ReactElement.cloneAndReplaceKey(mappedChild,
|
553
|
-
// Keep both the (mapped) and old keys if they differ, just as
|
554
|
-
// traverseAllChildren used to do for objects as children
|
555
|
-
keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);
|
556
|
-
}
|
557
|
-
result.push(mappedChild);
|
558
|
-
}
|
559
|
-
}
|
560
|
-
|
561
|
-
function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
|
562
|
-
var escapedPrefix = '';
|
563
|
-
if (prefix != null) {
|
564
|
-
escapedPrefix = escapeUserProvidedKey(prefix) + '/';
|
565
|
-
}
|
566
|
-
var traverseContext = MapBookKeeping.getPooled(array, escapedPrefix, func, context);
|
567
|
-
traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
|
568
|
-
MapBookKeeping.release(traverseContext);
|
569
|
-
}
|
570
|
-
|
571
|
-
/**
|
572
|
-
* Maps children that are typically specified as `props.children`.
|
573
|
-
*
|
574
|
-
* See https://facebook.github.io/react/docs/top-level-api.html#react.children.map
|
575
|
-
*
|
576
|
-
* The provided mapFunction(child, key, index) will be called for each
|
577
|
-
* leaf child.
|
578
|
-
*
|
579
|
-
* @param {?*} children Children tree container.
|
580
|
-
* @param {function(*, int)} func The map function.
|
581
|
-
* @param {*} context Context for mapFunction.
|
582
|
-
* @return {object} Object containing the ordered map of results.
|
583
|
-
*/
|
584
|
-
function mapChildren(children, func, context) {
|
585
|
-
if (children == null) {
|
586
|
-
return children;
|
587
|
-
}
|
588
|
-
var result = [];
|
589
|
-
mapIntoWithKeyPrefixInternal(children, result, null, func, context);
|
590
|
-
return result;
|
591
|
-
}
|
592
|
-
|
593
|
-
function forEachSingleChildDummy(traverseContext, child, name) {
|
594
|
-
return null;
|
595
|
-
}
|
596
|
-
|
597
|
-
/**
|
598
|
-
* Count the number of children that are typically specified as
|
599
|
-
* `props.children`.
|
600
|
-
*
|
601
|
-
* See https://facebook.github.io/react/docs/top-level-api.html#react.children.count
|
602
|
-
*
|
603
|
-
* @param {?*} children Children tree container.
|
604
|
-
* @return {number} The number of children.
|
605
|
-
*/
|
606
|
-
function countChildren(children, context) {
|
607
|
-
return traverseAllChildren(children, forEachSingleChildDummy, null);
|
608
|
-
}
|
609
|
-
|
610
|
-
/**
|
611
|
-
* Flatten a children object (typically specified as `props.children`) and
|
612
|
-
* return an array with appropriately re-keyed children.
|
613
|
-
*
|
614
|
-
* See https://facebook.github.io/react/docs/top-level-api.html#react.children.toarray
|
615
|
-
*/
|
616
|
-
function toArray(children) {
|
617
|
-
var result = [];
|
618
|
-
mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);
|
619
|
-
return result;
|
620
|
-
}
|
621
|
-
|
622
|
-
var ReactChildren = {
|
623
|
-
forEach: forEachChildren,
|
624
|
-
map: mapChildren,
|
625
|
-
mapIntoWithKeyPrefixInternal: mapIntoWithKeyPrefixInternal,
|
626
|
-
count: countChildren,
|
627
|
-
toArray: toArray
|
628
|
-
};
|
629
|
-
|
630
|
-
module.exports = ReactChildren;
|
631
|
-
},{"2":2,"26":26,"28":28,"9":9}],6:[function(_dereq_,module,exports){
|
632
|
-
/**
|
633
|
-
* Copyright (c) 2016-present, Facebook, Inc.
|
634
|
-
*
|
635
|
-
* This source code is licensed under the MIT license found in the
|
636
|
-
* LICENSE file in the root directory of this source tree.
|
637
|
-
*
|
638
|
-
*
|
639
|
-
*/
|
640
|
-
|
641
|
-
'use strict';
|
642
|
-
|
643
|
-
var _prodInvariant = _dereq_(25);
|
644
|
-
|
645
|
-
var ReactCurrentOwner = _dereq_(7);
|
646
|
-
|
647
|
-
var invariant = _dereq_(30);
|
648
|
-
var warning = _dereq_(31);
|
649
|
-
|
650
|
-
function isNative(fn) {
|
651
|
-
// Based on isNative() from Lodash
|
652
|
-
var funcToString = Function.prototype.toString;
|
653
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
654
|
-
var reIsNative = RegExp('^' + funcToString
|
655
|
-
// Take an example native function source for comparison
|
656
|
-
.call(hasOwnProperty
|
657
|
-
// Strip regex characters so we can use it for regex
|
658
|
-
).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&'
|
659
|
-
// Remove hasOwnProperty from the template to make it generic
|
660
|
-
).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
|
661
|
-
try {
|
662
|
-
var source = funcToString.call(fn);
|
663
|
-
return reIsNative.test(source);
|
664
|
-
} catch (err) {
|
665
|
-
return false;
|
666
|
-
}
|
667
|
-
}
|
668
|
-
|
669
|
-
var canUseCollections =
|
670
|
-
// Array.from
|
671
|
-
typeof Array.from === 'function' &&
|
672
|
-
// Map
|
673
|
-
typeof Map === 'function' && isNative(Map) &&
|
674
|
-
// Map.prototype.keys
|
675
|
-
Map.prototype != null && typeof Map.prototype.keys === 'function' && isNative(Map.prototype.keys) &&
|
676
|
-
// Set
|
677
|
-
typeof Set === 'function' && isNative(Set) &&
|
678
|
-
// Set.prototype.keys
|
679
|
-
Set.prototype != null && typeof Set.prototype.keys === 'function' && isNative(Set.prototype.keys);
|
680
|
-
|
681
|
-
var setItem;
|
682
|
-
var getItem;
|
683
|
-
var removeItem;
|
684
|
-
var getItemIDs;
|
685
|
-
var addRoot;
|
686
|
-
var removeRoot;
|
687
|
-
var getRootIDs;
|
688
|
-
|
689
|
-
if (canUseCollections) {
|
690
|
-
var itemMap = new Map();
|
691
|
-
var rootIDSet = new Set();
|
692
|
-
|
693
|
-
setItem = function (id, item) {
|
694
|
-
itemMap.set(id, item);
|
695
|
-
};
|
696
|
-
getItem = function (id) {
|
697
|
-
return itemMap.get(id);
|
698
|
-
};
|
699
|
-
removeItem = function (id) {
|
700
|
-
itemMap['delete'](id);
|
701
|
-
};
|
702
|
-
getItemIDs = function () {
|
703
|
-
return Array.from(itemMap.keys());
|
704
|
-
};
|
705
|
-
|
706
|
-
addRoot = function (id) {
|
707
|
-
rootIDSet.add(id);
|
708
|
-
};
|
709
|
-
removeRoot = function (id) {
|
710
|
-
rootIDSet['delete'](id);
|
711
|
-
};
|
712
|
-
getRootIDs = function () {
|
713
|
-
return Array.from(rootIDSet.keys());
|
714
|
-
};
|
715
|
-
} else {
|
716
|
-
var itemByKey = {};
|
717
|
-
var rootByKey = {};
|
718
|
-
|
719
|
-
// Use non-numeric keys to prevent V8 performance issues:
|
720
|
-
// https://github.com/facebook/react/pull/7232
|
721
|
-
var getKeyFromID = function (id) {
|
722
|
-
return '.' + id;
|
723
|
-
};
|
724
|
-
var getIDFromKey = function (key) {
|
725
|
-
return parseInt(key.substr(1), 10);
|
726
|
-
};
|
727
|
-
|
728
|
-
setItem = function (id, item) {
|
729
|
-
var key = getKeyFromID(id);
|
730
|
-
itemByKey[key] = item;
|
731
|
-
};
|
732
|
-
getItem = function (id) {
|
733
|
-
var key = getKeyFromID(id);
|
734
|
-
return itemByKey[key];
|
735
|
-
};
|
736
|
-
removeItem = function (id) {
|
737
|
-
var key = getKeyFromID(id);
|
738
|
-
delete itemByKey[key];
|
739
|
-
};
|
740
|
-
getItemIDs = function () {
|
741
|
-
return Object.keys(itemByKey).map(getIDFromKey);
|
742
|
-
};
|
743
|
-
|
744
|
-
addRoot = function (id) {
|
745
|
-
var key = getKeyFromID(id);
|
746
|
-
rootByKey[key] = true;
|
747
|
-
};
|
748
|
-
removeRoot = function (id) {
|
749
|
-
var key = getKeyFromID(id);
|
750
|
-
delete rootByKey[key];
|
751
|
-
};
|
752
|
-
getRootIDs = function () {
|
753
|
-
return Object.keys(rootByKey).map(getIDFromKey);
|
754
|
-
};
|
755
|
-
}
|
756
|
-
|
757
|
-
var unmountedIDs = [];
|
758
|
-
|
759
|
-
function purgeDeep(id) {
|
760
|
-
var item = getItem(id);
|
761
|
-
if (item) {
|
762
|
-
var childIDs = item.childIDs;
|
763
|
-
|
764
|
-
removeItem(id);
|
765
|
-
childIDs.forEach(purgeDeep);
|
766
|
-
}
|
767
|
-
}
|
768
|
-
|
769
|
-
function describeComponentFrame(name, source, ownerName) {
|
770
|
-
return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');
|
771
|
-
}
|
772
|
-
|
773
|
-
function getDisplayName(element) {
|
774
|
-
if (element == null) {
|
775
|
-
return '#empty';
|
776
|
-
} else if (typeof element === 'string' || typeof element === 'number') {
|
777
|
-
return '#text';
|
778
|
-
} else if (typeof element.type === 'string') {
|
779
|
-
return element.type;
|
780
|
-
} else {
|
781
|
-
return element.type.displayName || element.type.name || 'Unknown';
|
782
|
-
}
|
783
|
-
}
|
784
|
-
|
785
|
-
function describeID(id) {
|
786
|
-
var name = ReactComponentTreeHook.getDisplayName(id);
|
787
|
-
var element = ReactComponentTreeHook.getElement(id);
|
788
|
-
var ownerID = ReactComponentTreeHook.getOwnerID(id);
|
789
|
-
var ownerName;
|
790
|
-
if (ownerID) {
|
791
|
-
ownerName = ReactComponentTreeHook.getDisplayName(ownerID);
|
792
|
-
}
|
793
|
-
"development" !== 'production' ? warning(element, 'ReactComponentTreeHook: Missing React element for debugID %s when ' + 'building stack', id) : void 0;
|
794
|
-
return describeComponentFrame(name, element && element._source, ownerName);
|
795
|
-
}
|
796
|
-
|
797
|
-
var ReactComponentTreeHook = {
|
798
|
-
onSetChildren: function (id, nextChildIDs) {
|
799
|
-
var item = getItem(id);
|
800
|
-
!item ? "development" !== 'production' ? invariant(false, 'Item must have been set') : _prodInvariant('144') : void 0;
|
801
|
-
item.childIDs = nextChildIDs;
|
802
|
-
|
803
|
-
for (var i = 0; i < nextChildIDs.length; i++) {
|
804
|
-
var nextChildID = nextChildIDs[i];
|
805
|
-
var nextChild = getItem(nextChildID);
|
806
|
-
!nextChild ? "development" !== 'production' ? invariant(false, 'Expected hook events to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('140') : void 0;
|
807
|
-
!(nextChild.childIDs != null || typeof nextChild.element !== 'object' || nextChild.element == null) ? "development" !== 'production' ? invariant(false, 'Expected onSetChildren() to fire for a container child before its parent includes it in onSetChildren().') : _prodInvariant('141') : void 0;
|
808
|
-
!nextChild.isMounted ? "development" !== 'production' ? invariant(false, 'Expected onMountComponent() to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('71') : void 0;
|
809
|
-
if (nextChild.parentID == null) {
|
810
|
-
nextChild.parentID = id;
|
811
|
-
// TODO: This shouldn't be necessary but mounting a new root during in
|
812
|
-
// componentWillMount currently causes not-yet-mounted components to
|
813
|
-
// be purged from our tree data so their parent id is missing.
|
814
|
-
}
|
815
|
-
!(nextChild.parentID === id) ? "development" !== 'production' ? invariant(false, 'Expected onBeforeMountComponent() parent and onSetChildren() to be consistent (%s has parents %s and %s).', nextChildID, nextChild.parentID, id) : _prodInvariant('142', nextChildID, nextChild.parentID, id) : void 0;
|
816
|
-
}
|
817
|
-
},
|
818
|
-
onBeforeMountComponent: function (id, element, parentID) {
|
819
|
-
var item = {
|
820
|
-
element: element,
|
821
|
-
parentID: parentID,
|
822
|
-
text: null,
|
823
|
-
childIDs: [],
|
824
|
-
isMounted: false,
|
825
|
-
updateCount: 0
|
826
|
-
};
|
827
|
-
setItem(id, item);
|
828
|
-
},
|
829
|
-
onBeforeUpdateComponent: function (id, element) {
|
830
|
-
var item = getItem(id);
|
831
|
-
if (!item || !item.isMounted) {
|
832
|
-
// We may end up here as a result of setState() in componentWillUnmount().
|
833
|
-
// In this case, ignore the element.
|
834
|
-
return;
|
835
|
-
}
|
836
|
-
item.element = element;
|
837
|
-
},
|
838
|
-
onMountComponent: function (id) {
|
839
|
-
var item = getItem(id);
|
840
|
-
!item ? "development" !== 'production' ? invariant(false, 'Item must have been set') : _prodInvariant('144') : void 0;
|
841
|
-
item.isMounted = true;
|
842
|
-
var isRoot = item.parentID === 0;
|
843
|
-
if (isRoot) {
|
844
|
-
addRoot(id);
|
845
|
-
}
|
846
|
-
},
|
847
|
-
onUpdateComponent: function (id) {
|
848
|
-
var item = getItem(id);
|
849
|
-
if (!item || !item.isMounted) {
|
850
|
-
// We may end up here as a result of setState() in componentWillUnmount().
|
851
|
-
// In this case, ignore the element.
|
852
|
-
return;
|
853
|
-
}
|
854
|
-
item.updateCount++;
|
855
|
-
},
|
856
|
-
onUnmountComponent: function (id) {
|
857
|
-
var item = getItem(id);
|
858
|
-
if (item) {
|
859
|
-
// We need to check if it exists.
|
860
|
-
// `item` might not exist if it is inside an error boundary, and a sibling
|
861
|
-
// error boundary child threw while mounting. Then this instance never
|
862
|
-
// got a chance to mount, but it still gets an unmounting event during
|
863
|
-
// the error boundary cleanup.
|
864
|
-
item.isMounted = false;
|
865
|
-
var isRoot = item.parentID === 0;
|
866
|
-
if (isRoot) {
|
867
|
-
removeRoot(id);
|
868
|
-
}
|
869
|
-
}
|
870
|
-
unmountedIDs.push(id);
|
871
|
-
},
|
872
|
-
purgeUnmountedComponents: function () {
|
873
|
-
if (ReactComponentTreeHook._preventPurging) {
|
874
|
-
// Should only be used for testing.
|
875
|
-
return;
|
876
|
-
}
|
877
|
-
|
878
|
-
for (var i = 0; i < unmountedIDs.length; i++) {
|
879
|
-
var id = unmountedIDs[i];
|
880
|
-
purgeDeep(id);
|
881
|
-
}
|
882
|
-
unmountedIDs.length = 0;
|
883
|
-
},
|
884
|
-
isMounted: function (id) {
|
885
|
-
var item = getItem(id);
|
886
|
-
return item ? item.isMounted : false;
|
887
|
-
},
|
888
|
-
getCurrentStackAddendum: function (topElement) {
|
889
|
-
var info = '';
|
890
|
-
if (topElement) {
|
891
|
-
var name = getDisplayName(topElement);
|
892
|
-
var owner = topElement._owner;
|
893
|
-
info += describeComponentFrame(name, topElement._source, owner && owner.getName());
|
894
|
-
}
|
895
|
-
|
896
|
-
var currentOwner = ReactCurrentOwner.current;
|
897
|
-
var id = currentOwner && currentOwner._debugID;
|
898
|
-
|
899
|
-
info += ReactComponentTreeHook.getStackAddendumByID(id);
|
900
|
-
return info;
|
901
|
-
},
|
902
|
-
getStackAddendumByID: function (id) {
|
903
|
-
var info = '';
|
904
|
-
while (id) {
|
905
|
-
info += describeID(id);
|
906
|
-
id = ReactComponentTreeHook.getParentID(id);
|
907
|
-
}
|
908
|
-
return info;
|
909
|
-
},
|
910
|
-
getChildIDs: function (id) {
|
911
|
-
var item = getItem(id);
|
912
|
-
return item ? item.childIDs : [];
|
913
|
-
},
|
914
|
-
getDisplayName: function (id) {
|
915
|
-
var element = ReactComponentTreeHook.getElement(id);
|
916
|
-
if (!element) {
|
917
|
-
return null;
|
918
|
-
}
|
919
|
-
return getDisplayName(element);
|
920
|
-
},
|
921
|
-
getElement: function (id) {
|
922
|
-
var item = getItem(id);
|
923
|
-
return item ? item.element : null;
|
924
|
-
},
|
925
|
-
getOwnerID: function (id) {
|
926
|
-
var element = ReactComponentTreeHook.getElement(id);
|
927
|
-
if (!element || !element._owner) {
|
928
|
-
return null;
|
929
|
-
}
|
930
|
-
return element._owner._debugID;
|
931
|
-
},
|
932
|
-
getParentID: function (id) {
|
933
|
-
var item = getItem(id);
|
934
|
-
return item ? item.parentID : null;
|
935
|
-
},
|
936
|
-
getSource: function (id) {
|
937
|
-
var item = getItem(id);
|
938
|
-
var element = item ? item.element : null;
|
939
|
-
var source = element != null ? element._source : null;
|
940
|
-
return source;
|
941
|
-
},
|
942
|
-
getText: function (id) {
|
943
|
-
var element = ReactComponentTreeHook.getElement(id);
|
944
|
-
if (typeof element === 'string') {
|
945
|
-
return element;
|
946
|
-
} else if (typeof element === 'number') {
|
947
|
-
return '' + element;
|
948
|
-
} else {
|
949
|
-
return null;
|
950
|
-
}
|
951
|
-
},
|
952
|
-
getUpdateCount: function (id) {
|
953
|
-
var item = getItem(id);
|
954
|
-
return item ? item.updateCount : 0;
|
955
|
-
},
|
956
|
-
|
957
|
-
|
958
|
-
getRootIDs: getRootIDs,
|
959
|
-
getRegisteredIDs: getItemIDs,
|
960
|
-
|
961
|
-
pushNonStandardWarningStack: function (isCreatingElement, currentSource) {
|
962
|
-
if (typeof console.reactStack !== 'function') {
|
963
|
-
return;
|
964
|
-
}
|
965
|
-
|
966
|
-
var stack = [];
|
967
|
-
var currentOwner = ReactCurrentOwner.current;
|
968
|
-
var id = currentOwner && currentOwner._debugID;
|
969
|
-
|
970
|
-
try {
|
971
|
-
if (isCreatingElement) {
|
972
|
-
stack.push({
|
973
|
-
name: id ? ReactComponentTreeHook.getDisplayName(id) : null,
|
974
|
-
fileName: currentSource ? currentSource.fileName : null,
|
975
|
-
lineNumber: currentSource ? currentSource.lineNumber : null
|
976
|
-
});
|
977
|
-
}
|
978
|
-
|
979
|
-
while (id) {
|
980
|
-
var element = ReactComponentTreeHook.getElement(id);
|
981
|
-
var parentID = ReactComponentTreeHook.getParentID(id);
|
982
|
-
var ownerID = ReactComponentTreeHook.getOwnerID(id);
|
983
|
-
var ownerName = ownerID ? ReactComponentTreeHook.getDisplayName(ownerID) : null;
|
984
|
-
var source = element && element._source;
|
985
|
-
stack.push({
|
986
|
-
name: ownerName,
|
987
|
-
fileName: source ? source.fileName : null,
|
988
|
-
lineNumber: source ? source.lineNumber : null
|
989
|
-
});
|
990
|
-
id = parentID;
|
991
|
-
}
|
992
|
-
} catch (err) {
|
993
|
-
// Internal state is messed up.
|
994
|
-
// Stop building the stack (it's just a nice to have).
|
995
|
-
}
|
996
|
-
|
997
|
-
console.reactStack(stack);
|
998
|
-
},
|
999
|
-
popNonStandardWarningStack: function () {
|
1000
|
-
if (typeof console.reactStackEnd !== 'function') {
|
1001
|
-
return;
|
1002
|
-
}
|
1003
|
-
console.reactStackEnd();
|
1004
|
-
}
|
1005
|
-
};
|
1006
|
-
|
1007
|
-
module.exports = ReactComponentTreeHook;
|
1008
|
-
},{"25":25,"30":30,"31":31,"7":7}],7:[function(_dereq_,module,exports){
|
1009
|
-
/**
|
1010
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
1011
|
-
*
|
1012
|
-
* This source code is licensed under the MIT license found in the
|
1013
|
-
* LICENSE file in the root directory of this source tree.
|
1014
|
-
*
|
1015
|
-
*
|
1016
|
-
*/
|
1017
|
-
|
1018
|
-
'use strict';
|
1019
|
-
|
1020
|
-
/**
|
1021
|
-
* Keeps track of the current owner.
|
1022
|
-
*
|
1023
|
-
* The current owner is the component who should own any components that are
|
1024
|
-
* currently being constructed.
|
1025
|
-
*/
|
1026
|
-
var ReactCurrentOwner = {
|
1027
|
-
/**
|
1028
|
-
* @internal
|
1029
|
-
* @type {ReactComponent}
|
1030
|
-
*/
|
1031
|
-
current: null
|
1032
|
-
};
|
1033
|
-
|
1034
|
-
module.exports = ReactCurrentOwner;
|
1035
|
-
},{}],8:[function(_dereq_,module,exports){
|
1036
|
-
/**
|
1037
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
1038
|
-
*
|
1039
|
-
* This source code is licensed under the MIT license found in the
|
1040
|
-
* LICENSE file in the root directory of this source tree.
|
1041
|
-
*
|
1042
|
-
*/
|
1043
|
-
|
1044
|
-
'use strict';
|
1045
|
-
|
1046
|
-
var ReactElement = _dereq_(9);
|
1047
|
-
|
1048
|
-
/**
|
1049
|
-
* Create a factory that creates HTML tag elements.
|
1050
|
-
*
|
1051
|
-
* @private
|
1052
|
-
*/
|
1053
|
-
var createDOMFactory = ReactElement.createFactory;
|
1054
|
-
if ("development" !== 'production') {
|
1055
|
-
var ReactElementValidator = _dereq_(11);
|
1056
|
-
createDOMFactory = ReactElementValidator.createFactory;
|
1057
|
-
}
|
1058
|
-
|
1059
|
-
/**
|
1060
|
-
* Creates a mapping from supported HTML tags to `ReactDOMComponent` classes.
|
1061
|
-
*
|
1062
|
-
* @public
|
1063
|
-
*/
|
1064
|
-
var ReactDOMFactories = {
|
1065
|
-
a: createDOMFactory('a'),
|
1066
|
-
abbr: createDOMFactory('abbr'),
|
1067
|
-
address: createDOMFactory('address'),
|
1068
|
-
area: createDOMFactory('area'),
|
1069
|
-
article: createDOMFactory('article'),
|
1070
|
-
aside: createDOMFactory('aside'),
|
1071
|
-
audio: createDOMFactory('audio'),
|
1072
|
-
b: createDOMFactory('b'),
|
1073
|
-
base: createDOMFactory('base'),
|
1074
|
-
bdi: createDOMFactory('bdi'),
|
1075
|
-
bdo: createDOMFactory('bdo'),
|
1076
|
-
big: createDOMFactory('big'),
|
1077
|
-
blockquote: createDOMFactory('blockquote'),
|
1078
|
-
body: createDOMFactory('body'),
|
1079
|
-
br: createDOMFactory('br'),
|
1080
|
-
button: createDOMFactory('button'),
|
1081
|
-
canvas: createDOMFactory('canvas'),
|
1082
|
-
caption: createDOMFactory('caption'),
|
1083
|
-
cite: createDOMFactory('cite'),
|
1084
|
-
code: createDOMFactory('code'),
|
1085
|
-
col: createDOMFactory('col'),
|
1086
|
-
colgroup: createDOMFactory('colgroup'),
|
1087
|
-
data: createDOMFactory('data'),
|
1088
|
-
datalist: createDOMFactory('datalist'),
|
1089
|
-
dd: createDOMFactory('dd'),
|
1090
|
-
del: createDOMFactory('del'),
|
1091
|
-
details: createDOMFactory('details'),
|
1092
|
-
dfn: createDOMFactory('dfn'),
|
1093
|
-
dialog: createDOMFactory('dialog'),
|
1094
|
-
div: createDOMFactory('div'),
|
1095
|
-
dl: createDOMFactory('dl'),
|
1096
|
-
dt: createDOMFactory('dt'),
|
1097
|
-
em: createDOMFactory('em'),
|
1098
|
-
embed: createDOMFactory('embed'),
|
1099
|
-
fieldset: createDOMFactory('fieldset'),
|
1100
|
-
figcaption: createDOMFactory('figcaption'),
|
1101
|
-
figure: createDOMFactory('figure'),
|
1102
|
-
footer: createDOMFactory('footer'),
|
1103
|
-
form: createDOMFactory('form'),
|
1104
|
-
h1: createDOMFactory('h1'),
|
1105
|
-
h2: createDOMFactory('h2'),
|
1106
|
-
h3: createDOMFactory('h3'),
|
1107
|
-
h4: createDOMFactory('h4'),
|
1108
|
-
h5: createDOMFactory('h5'),
|
1109
|
-
h6: createDOMFactory('h6'),
|
1110
|
-
head: createDOMFactory('head'),
|
1111
|
-
header: createDOMFactory('header'),
|
1112
|
-
hgroup: createDOMFactory('hgroup'),
|
1113
|
-
hr: createDOMFactory('hr'),
|
1114
|
-
html: createDOMFactory('html'),
|
1115
|
-
i: createDOMFactory('i'),
|
1116
|
-
iframe: createDOMFactory('iframe'),
|
1117
|
-
img: createDOMFactory('img'),
|
1118
|
-
input: createDOMFactory('input'),
|
1119
|
-
ins: createDOMFactory('ins'),
|
1120
|
-
kbd: createDOMFactory('kbd'),
|
1121
|
-
keygen: createDOMFactory('keygen'),
|
1122
|
-
label: createDOMFactory('label'),
|
1123
|
-
legend: createDOMFactory('legend'),
|
1124
|
-
li: createDOMFactory('li'),
|
1125
|
-
link: createDOMFactory('link'),
|
1126
|
-
main: createDOMFactory('main'),
|
1127
|
-
map: createDOMFactory('map'),
|
1128
|
-
mark: createDOMFactory('mark'),
|
1129
|
-
menu: createDOMFactory('menu'),
|
1130
|
-
menuitem: createDOMFactory('menuitem'),
|
1131
|
-
meta: createDOMFactory('meta'),
|
1132
|
-
meter: createDOMFactory('meter'),
|
1133
|
-
nav: createDOMFactory('nav'),
|
1134
|
-
noscript: createDOMFactory('noscript'),
|
1135
|
-
object: createDOMFactory('object'),
|
1136
|
-
ol: createDOMFactory('ol'),
|
1137
|
-
optgroup: createDOMFactory('optgroup'),
|
1138
|
-
option: createDOMFactory('option'),
|
1139
|
-
output: createDOMFactory('output'),
|
1140
|
-
p: createDOMFactory('p'),
|
1141
|
-
param: createDOMFactory('param'),
|
1142
|
-
picture: createDOMFactory('picture'),
|
1143
|
-
pre: createDOMFactory('pre'),
|
1144
|
-
progress: createDOMFactory('progress'),
|
1145
|
-
q: createDOMFactory('q'),
|
1146
|
-
rp: createDOMFactory('rp'),
|
1147
|
-
rt: createDOMFactory('rt'),
|
1148
|
-
ruby: createDOMFactory('ruby'),
|
1149
|
-
s: createDOMFactory('s'),
|
1150
|
-
samp: createDOMFactory('samp'),
|
1151
|
-
script: createDOMFactory('script'),
|
1152
|
-
section: createDOMFactory('section'),
|
1153
|
-
select: createDOMFactory('select'),
|
1154
|
-
small: createDOMFactory('small'),
|
1155
|
-
source: createDOMFactory('source'),
|
1156
|
-
span: createDOMFactory('span'),
|
1157
|
-
strong: createDOMFactory('strong'),
|
1158
|
-
style: createDOMFactory('style'),
|
1159
|
-
sub: createDOMFactory('sub'),
|
1160
|
-
summary: createDOMFactory('summary'),
|
1161
|
-
sup: createDOMFactory('sup'),
|
1162
|
-
table: createDOMFactory('table'),
|
1163
|
-
tbody: createDOMFactory('tbody'),
|
1164
|
-
td: createDOMFactory('td'),
|
1165
|
-
textarea: createDOMFactory('textarea'),
|
1166
|
-
tfoot: createDOMFactory('tfoot'),
|
1167
|
-
th: createDOMFactory('th'),
|
1168
|
-
thead: createDOMFactory('thead'),
|
1169
|
-
time: createDOMFactory('time'),
|
1170
|
-
title: createDOMFactory('title'),
|
1171
|
-
tr: createDOMFactory('tr'),
|
1172
|
-
track: createDOMFactory('track'),
|
1173
|
-
u: createDOMFactory('u'),
|
1174
|
-
ul: createDOMFactory('ul'),
|
1175
|
-
'var': createDOMFactory('var'),
|
1176
|
-
video: createDOMFactory('video'),
|
1177
|
-
wbr: createDOMFactory('wbr'),
|
1178
|
-
|
1179
|
-
// SVG
|
1180
|
-
circle: createDOMFactory('circle'),
|
1181
|
-
clipPath: createDOMFactory('clipPath'),
|
1182
|
-
defs: createDOMFactory('defs'),
|
1183
|
-
ellipse: createDOMFactory('ellipse'),
|
1184
|
-
g: createDOMFactory('g'),
|
1185
|
-
image: createDOMFactory('image'),
|
1186
|
-
line: createDOMFactory('line'),
|
1187
|
-
linearGradient: createDOMFactory('linearGradient'),
|
1188
|
-
mask: createDOMFactory('mask'),
|
1189
|
-
path: createDOMFactory('path'),
|
1190
|
-
pattern: createDOMFactory('pattern'),
|
1191
|
-
polygon: createDOMFactory('polygon'),
|
1192
|
-
polyline: createDOMFactory('polyline'),
|
1193
|
-
radialGradient: createDOMFactory('radialGradient'),
|
1194
|
-
rect: createDOMFactory('rect'),
|
1195
|
-
stop: createDOMFactory('stop'),
|
1196
|
-
svg: createDOMFactory('svg'),
|
1197
|
-
text: createDOMFactory('text'),
|
1198
|
-
tspan: createDOMFactory('tspan')
|
1199
|
-
};
|
1200
|
-
|
1201
|
-
module.exports = ReactDOMFactories;
|
1202
|
-
},{"11":11,"9":9}],9:[function(_dereq_,module,exports){
|
1203
|
-
/**
|
1204
|
-
* Copyright (c) 2014-present, Facebook, Inc.
|
1205
|
-
*
|
1206
|
-
* This source code is licensed under the MIT license found in the
|
1207
|
-
* LICENSE file in the root directory of this source tree.
|
1208
|
-
*
|
1209
|
-
*/
|
1210
|
-
|
1211
|
-
'use strict';
|
1212
|
-
|
1213
|
-
var _assign = _dereq_(32);
|
1214
|
-
|
1215
|
-
var ReactCurrentOwner = _dereq_(7);
|
1216
|
-
|
1217
|
-
var warning = _dereq_(31);
|
1218
|
-
var canDefineProperty = _dereq_(18);
|
1219
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
1220
|
-
|
1221
|
-
var REACT_ELEMENT_TYPE = _dereq_(10);
|
1222
|
-
|
1223
|
-
var RESERVED_PROPS = {
|
1224
|
-
key: true,
|
1225
|
-
ref: true,
|
1226
|
-
__self: true,
|
1227
|
-
__source: true
|
1228
|
-
};
|
1229
|
-
|
1230
|
-
var specialPropKeyWarningShown, specialPropRefWarningShown;
|
1231
|
-
|
1232
|
-
function hasValidRef(config) {
|
1233
|
-
if ("development" !== 'production') {
|
1234
|
-
if (hasOwnProperty.call(config, 'ref')) {
|
1235
|
-
var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
|
1236
|
-
if (getter && getter.isReactWarning) {
|
1237
|
-
return false;
|
1238
|
-
}
|
1239
|
-
}
|
1240
|
-
}
|
1241
|
-
return config.ref !== undefined;
|
1242
|
-
}
|
1243
|
-
|
1244
|
-
function hasValidKey(config) {
|
1245
|
-
if ("development" !== 'production') {
|
1246
|
-
if (hasOwnProperty.call(config, 'key')) {
|
1247
|
-
var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
|
1248
|
-
if (getter && getter.isReactWarning) {
|
1249
|
-
return false;
|
1250
|
-
}
|
1251
|
-
}
|
1252
|
-
}
|
1253
|
-
return config.key !== undefined;
|
1254
|
-
}
|
1255
|
-
|
1256
|
-
function defineKeyPropWarningGetter(props, displayName) {
|
1257
|
-
var warnAboutAccessingKey = function () {
|
1258
|
-
if (!specialPropKeyWarningShown) {
|
1259
|
-
specialPropKeyWarningShown = true;
|
1260
|
-
"development" !== 'production' ? warning(false, '%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName) : void 0;
|
1261
|
-
}
|
1262
|
-
};
|
1263
|
-
warnAboutAccessingKey.isReactWarning = true;
|
1264
|
-
Object.defineProperty(props, 'key', {
|
1265
|
-
get: warnAboutAccessingKey,
|
1266
|
-
configurable: true
|
1267
|
-
});
|
1268
|
-
}
|
1269
|
-
|
1270
|
-
function defineRefPropWarningGetter(props, displayName) {
|
1271
|
-
var warnAboutAccessingRef = function () {
|
1272
|
-
if (!specialPropRefWarningShown) {
|
1273
|
-
specialPropRefWarningShown = true;
|
1274
|
-
"development" !== 'production' ? warning(false, '%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName) : void 0;
|
1275
|
-
}
|
1276
|
-
};
|
1277
|
-
warnAboutAccessingRef.isReactWarning = true;
|
1278
|
-
Object.defineProperty(props, 'ref', {
|
1279
|
-
get: warnAboutAccessingRef,
|
1280
|
-
configurable: true
|
1281
|
-
});
|
1282
|
-
}
|
1283
|
-
|
1284
|
-
/**
|
1285
|
-
* Factory method to create a new React element. This no longer adheres to
|
1286
|
-
* the class pattern, so do not use new to call it. Also, no instanceof check
|
1287
|
-
* will work. Instead test $$typeof field against Symbol.for('react.element') to check
|
1288
|
-
* if something is a React Element.
|
1289
|
-
*
|
1290
|
-
* @param {*} type
|
1291
|
-
* @param {*} key
|
1292
|
-
* @param {string|object} ref
|
1293
|
-
* @param {*} self A *temporary* helper to detect places where `this` is
|
1294
|
-
* different from the `owner` when React.createElement is called, so that we
|
1295
|
-
* can warn. We want to get rid of owner and replace string `ref`s with arrow
|
1296
|
-
* functions, and as long as `this` and owner are the same, there will be no
|
1297
|
-
* change in behavior.
|
1298
|
-
* @param {*} source An annotation object (added by a transpiler or otherwise)
|
1299
|
-
* indicating filename, line number, and/or other information.
|
1300
|
-
* @param {*} owner
|
1301
|
-
* @param {*} props
|
1302
|
-
* @internal
|
1303
|
-
*/
|
1304
|
-
var ReactElement = function (type, key, ref, self, source, owner, props) {
|
1305
|
-
var element = {
|
1306
|
-
// This tag allow us to uniquely identify this as a React Element
|
1307
|
-
$$typeof: REACT_ELEMENT_TYPE,
|
1308
|
-
|
1309
|
-
// Built-in properties that belong on the element
|
1310
|
-
type: type,
|
1311
|
-
key: key,
|
1312
|
-
ref: ref,
|
1313
|
-
props: props,
|
1314
|
-
|
1315
|
-
// Record the component responsible for creating this element.
|
1316
|
-
_owner: owner
|
1317
|
-
};
|
1318
|
-
|
1319
|
-
if ("development" !== 'production') {
|
1320
|
-
// The validation flag is currently mutative. We put it on
|
1321
|
-
// an external backing store so that we can freeze the whole object.
|
1322
|
-
// This can be replaced with a WeakMap once they are implemented in
|
1323
|
-
// commonly used development environments.
|
1324
|
-
element._store = {};
|
1325
|
-
|
1326
|
-
// To make comparing ReactElements easier for testing purposes, we make
|
1327
|
-
// the validation flag non-enumerable (where possible, which should
|
1328
|
-
// include every environment we run tests in), so the test framework
|
1329
|
-
// ignores it.
|
1330
|
-
if (canDefineProperty) {
|
1331
|
-
Object.defineProperty(element._store, 'validated', {
|
1332
|
-
configurable: false,
|
1333
|
-
enumerable: false,
|
1334
|
-
writable: true,
|
1335
|
-
value: false
|
1336
|
-
});
|
1337
|
-
// self and source are DEV only properties.
|
1338
|
-
Object.defineProperty(element, '_self', {
|
1339
|
-
configurable: false,
|
1340
|
-
enumerable: false,
|
1341
|
-
writable: false,
|
1342
|
-
value: self
|
1343
|
-
});
|
1344
|
-
// Two elements created in two different places should be considered
|
1345
|
-
// equal for testing purposes and therefore we hide it from enumeration.
|
1346
|
-
Object.defineProperty(element, '_source', {
|
1347
|
-
configurable: false,
|
1348
|
-
enumerable: false,
|
1349
|
-
writable: false,
|
1350
|
-
value: source
|
1351
|
-
});
|
1352
|
-
} else {
|
1353
|
-
element._store.validated = false;
|
1354
|
-
element._self = self;
|
1355
|
-
element._source = source;
|
1356
|
-
}
|
1357
|
-
if (Object.freeze) {
|
1358
|
-
Object.freeze(element.props);
|
1359
|
-
Object.freeze(element);
|
1360
|
-
}
|
1361
|
-
}
|
1362
|
-
|
1363
|
-
return element;
|
1364
|
-
};
|
1365
|
-
|
1366
|
-
/**
|
1367
|
-
* Create and return a new ReactElement of the given type.
|
1368
|
-
* See https://facebook.github.io/react/docs/top-level-api.html#react.createelement
|
1369
|
-
*/
|
1370
|
-
ReactElement.createElement = function (type, config, children) {
|
1371
|
-
var propName;
|
1372
|
-
|
1373
|
-
// Reserved names are extracted
|
1374
|
-
var props = {};
|
1375
|
-
|
1376
|
-
var key = null;
|
1377
|
-
var ref = null;
|
1378
|
-
var self = null;
|
1379
|
-
var source = null;
|
1380
|
-
|
1381
|
-
if (config != null) {
|
1382
|
-
if (hasValidRef(config)) {
|
1383
|
-
ref = config.ref;
|
1384
|
-
}
|
1385
|
-
if (hasValidKey(config)) {
|
1386
|
-
key = '' + config.key;
|
1387
|
-
}
|
1388
|
-
|
1389
|
-
self = config.__self === undefined ? null : config.__self;
|
1390
|
-
source = config.__source === undefined ? null : config.__source;
|
1391
|
-
// Remaining properties are added to a new props object
|
1392
|
-
for (propName in config) {
|
1393
|
-
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
1394
|
-
props[propName] = config[propName];
|
1395
|
-
}
|
1396
|
-
}
|
1397
|
-
}
|
1398
|
-
|
1399
|
-
// Children can be more than one argument, and those are transferred onto
|
1400
|
-
// the newly allocated props object.
|
1401
|
-
var childrenLength = arguments.length - 2;
|
1402
|
-
if (childrenLength === 1) {
|
1403
|
-
props.children = children;
|
1404
|
-
} else if (childrenLength > 1) {
|
1405
|
-
var childArray = Array(childrenLength);
|
1406
|
-
for (var i = 0; i < childrenLength; i++) {
|
1407
|
-
childArray[i] = arguments[i + 2];
|
1408
|
-
}
|
1409
|
-
if ("development" !== 'production') {
|
1410
|
-
if (Object.freeze) {
|
1411
|
-
Object.freeze(childArray);
|
1412
|
-
}
|
1413
|
-
}
|
1414
|
-
props.children = childArray;
|
1415
|
-
}
|
1416
|
-
|
1417
|
-
// Resolve default props
|
1418
|
-
if (type && type.defaultProps) {
|
1419
|
-
var defaultProps = type.defaultProps;
|
1420
|
-
for (propName in defaultProps) {
|
1421
|
-
if (props[propName] === undefined) {
|
1422
|
-
props[propName] = defaultProps[propName];
|
1423
|
-
}
|
1424
|
-
}
|
1425
|
-
}
|
1426
|
-
if ("development" !== 'production') {
|
1427
|
-
if (key || ref) {
|
1428
|
-
if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {
|
1429
|
-
var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
|
1430
|
-
if (key) {
|
1431
|
-
defineKeyPropWarningGetter(props, displayName);
|
1432
|
-
}
|
1433
|
-
if (ref) {
|
1434
|
-
defineRefPropWarningGetter(props, displayName);
|
1435
|
-
}
|
1436
|
-
}
|
1437
|
-
}
|
1438
|
-
}
|
1439
|
-
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
1440
|
-
};
|
1441
|
-
|
1442
|
-
/**
|
1443
|
-
* Return a function that produces ReactElements of a given type.
|
1444
|
-
* See https://facebook.github.io/react/docs/top-level-api.html#react.createfactory
|
1445
|
-
*/
|
1446
|
-
ReactElement.createFactory = function (type) {
|
1447
|
-
var factory = ReactElement.createElement.bind(null, type);
|
1448
|
-
// Expose the type on the factory and the prototype so that it can be
|
1449
|
-
// easily accessed on elements. E.g. `<Foo />.type === Foo`.
|
1450
|
-
// This should not be named `constructor` since this may not be the function
|
1451
|
-
// that created the element, and it may not even be a constructor.
|
1452
|
-
// Legacy hook TODO: Warn if this is accessed
|
1453
|
-
factory.type = type;
|
1454
|
-
return factory;
|
1455
|
-
};
|
1456
|
-
|
1457
|
-
ReactElement.cloneAndReplaceKey = function (oldElement, newKey) {
|
1458
|
-
var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
|
1459
|
-
|
1460
|
-
return newElement;
|
1461
|
-
};
|
1462
|
-
|
1463
|
-
/**
|
1464
|
-
* Clone and return a new ReactElement using element as the starting point.
|
1465
|
-
* See https://facebook.github.io/react/docs/top-level-api.html#react.cloneelement
|
1466
|
-
*/
|
1467
|
-
ReactElement.cloneElement = function (element, config, children) {
|
1468
|
-
var propName;
|
1469
|
-
|
1470
|
-
// Original props are copied
|
1471
|
-
var props = _assign({}, element.props);
|
1472
|
-
|
1473
|
-
// Reserved names are extracted
|
1474
|
-
var key = element.key;
|
1475
|
-
var ref = element.ref;
|
1476
|
-
// Self is preserved since the owner is preserved.
|
1477
|
-
var self = element._self;
|
1478
|
-
// Source is preserved since cloneElement is unlikely to be targeted by a
|
1479
|
-
// transpiler, and the original source is probably a better indicator of the
|
1480
|
-
// true owner.
|
1481
|
-
var source = element._source;
|
1482
|
-
|
1483
|
-
// Owner will be preserved, unless ref is overridden
|
1484
|
-
var owner = element._owner;
|
1485
|
-
|
1486
|
-
if (config != null) {
|
1487
|
-
if (hasValidRef(config)) {
|
1488
|
-
// Silently steal the ref from the parent.
|
1489
|
-
ref = config.ref;
|
1490
|
-
owner = ReactCurrentOwner.current;
|
1491
|
-
}
|
1492
|
-
if (hasValidKey(config)) {
|
1493
|
-
key = '' + config.key;
|
1494
|
-
}
|
1495
|
-
|
1496
|
-
// Remaining properties override existing props
|
1497
|
-
var defaultProps;
|
1498
|
-
if (element.type && element.type.defaultProps) {
|
1499
|
-
defaultProps = element.type.defaultProps;
|
1500
|
-
}
|
1501
|
-
for (propName in config) {
|
1502
|
-
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
1503
|
-
if (config[propName] === undefined && defaultProps !== undefined) {
|
1504
|
-
// Resolve default props
|
1505
|
-
props[propName] = defaultProps[propName];
|
1506
|
-
} else {
|
1507
|
-
props[propName] = config[propName];
|
1508
|
-
}
|
1509
|
-
}
|
1510
|
-
}
|
1511
|
-
}
|
1512
|
-
|
1513
|
-
// Children can be more than one argument, and those are transferred onto
|
1514
|
-
// the newly allocated props object.
|
1515
|
-
var childrenLength = arguments.length - 2;
|
1516
|
-
if (childrenLength === 1) {
|
1517
|
-
props.children = children;
|
1518
|
-
} else if (childrenLength > 1) {
|
1519
|
-
var childArray = Array(childrenLength);
|
1520
|
-
for (var i = 0; i < childrenLength; i++) {
|
1521
|
-
childArray[i] = arguments[i + 2];
|
1522
|
-
}
|
1523
|
-
props.children = childArray;
|
1524
|
-
}
|
1525
|
-
|
1526
|
-
return ReactElement(element.type, key, ref, self, source, owner, props);
|
1527
|
-
};
|
1528
|
-
|
1529
|
-
/**
|
1530
|
-
* Verifies the object is a ReactElement.
|
1531
|
-
* See https://facebook.github.io/react/docs/top-level-api.html#react.isvalidelement
|
1532
|
-
* @param {?object} object
|
1533
|
-
* @return {boolean} True if `object` is a valid component.
|
1534
|
-
* @final
|
1535
|
-
*/
|
1536
|
-
ReactElement.isValidElement = function (object) {
|
1537
|
-
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
1538
|
-
};
|
1539
|
-
|
1540
|
-
module.exports = ReactElement;
|
1541
|
-
},{"10":10,"18":18,"31":31,"32":32,"7":7}],10:[function(_dereq_,module,exports){
|
1542
|
-
/**
|
1543
|
-
* Copyright (c) 2014-present, Facebook, Inc.
|
1544
|
-
*
|
1545
|
-
* This source code is licensed under the MIT license found in the
|
1546
|
-
* LICENSE file in the root directory of this source tree.
|
1547
|
-
*
|
1548
|
-
*
|
1549
|
-
*/
|
1550
|
-
|
1551
|
-
'use strict';
|
1552
|
-
|
1553
|
-
// The Symbol used to tag the ReactElement type. If there is no native Symbol
|
1554
|
-
// nor polyfill, then a plain number is used for performance.
|
1555
|
-
|
1556
|
-
var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;
|
1557
|
-
|
1558
|
-
module.exports = REACT_ELEMENT_TYPE;
|
1559
|
-
},{}],11:[function(_dereq_,module,exports){
|
1560
|
-
/**
|
1561
|
-
* Copyright (c) 2014-present, Facebook, Inc.
|
1562
|
-
*
|
1563
|
-
* This source code is licensed under the MIT license found in the
|
1564
|
-
* LICENSE file in the root directory of this source tree.
|
1565
|
-
*
|
1566
|
-
*/
|
1567
|
-
|
1568
|
-
/**
|
1569
|
-
* ReactElementValidator provides a wrapper around a element factory
|
1570
|
-
* which validates the props passed to the element. This is intended to be
|
1571
|
-
* used only in DEV and could be replaced by a static type checker for languages
|
1572
|
-
* that support it.
|
1573
|
-
*/
|
1574
|
-
|
1575
|
-
'use strict';
|
1576
|
-
|
1577
|
-
var ReactCurrentOwner = _dereq_(7);
|
1578
|
-
var ReactComponentTreeHook = _dereq_(6);
|
1579
|
-
var ReactElement = _dereq_(9);
|
1580
|
-
|
1581
|
-
var checkReactTypeSpec = _dereq_(19);
|
1582
|
-
|
1583
|
-
var canDefineProperty = _dereq_(18);
|
1584
|
-
var getIteratorFn = _dereq_(21);
|
1585
|
-
var warning = _dereq_(31);
|
1586
|
-
var lowPriorityWarning = _dereq_(23);
|
1587
|
-
|
1588
|
-
function getDeclarationErrorAddendum() {
|
1589
|
-
if (ReactCurrentOwner.current) {
|
1590
|
-
var name = ReactCurrentOwner.current.getName();
|
1591
|
-
if (name) {
|
1592
|
-
return ' Check the render method of `' + name + '`.';
|
1593
|
-
}
|
1594
|
-
}
|
1595
|
-
return '';
|
1596
|
-
}
|
1597
|
-
|
1598
|
-
function getSourceInfoErrorAddendum(elementProps) {
|
1599
|
-
if (elementProps !== null && elementProps !== undefined && elementProps.__source !== undefined) {
|
1600
|
-
var source = elementProps.__source;
|
1601
|
-
var fileName = source.fileName.replace(/^.*[\\\/]/, '');
|
1602
|
-
var lineNumber = source.lineNumber;
|
1603
|
-
return ' Check your code at ' + fileName + ':' + lineNumber + '.';
|
1604
|
-
}
|
1605
|
-
return '';
|
1606
|
-
}
|
1607
|
-
|
1608
|
-
/**
|
1609
|
-
* Warn if there's no key explicitly set on dynamic arrays of children or
|
1610
|
-
* object keys are not valid. This allows us to keep track of children between
|
1611
|
-
* updates.
|
1612
|
-
*/
|
1613
|
-
var ownerHasKeyUseWarning = {};
|
1614
|
-
|
1615
|
-
function getCurrentComponentErrorInfo(parentType) {
|
1616
|
-
var info = getDeclarationErrorAddendum();
|
1617
|
-
|
1618
|
-
if (!info) {
|
1619
|
-
var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
|
1620
|
-
if (parentName) {
|
1621
|
-
info = ' Check the top-level render call using <' + parentName + '>.';
|
1622
|
-
}
|
1623
|
-
}
|
1624
|
-
return info;
|
1625
|
-
}
|
1626
|
-
|
1627
|
-
/**
|
1628
|
-
* Warn if the element doesn't have an explicit key assigned to it.
|
1629
|
-
* This element is in an array. The array could grow and shrink or be
|
1630
|
-
* reordered. All children that haven't already been validated are required to
|
1631
|
-
* have a "key" property assigned to it. Error statuses are cached so a warning
|
1632
|
-
* will only be shown once.
|
1633
|
-
*
|
1634
|
-
* @internal
|
1635
|
-
* @param {ReactElement} element Element that requires a key.
|
1636
|
-
* @param {*} parentType element's parent's type.
|
1637
|
-
*/
|
1638
|
-
function validateExplicitKey(element, parentType) {
|
1639
|
-
if (!element._store || element._store.validated || element.key != null) {
|
1640
|
-
return;
|
1641
|
-
}
|
1642
|
-
element._store.validated = true;
|
1643
|
-
|
1644
|
-
var memoizer = ownerHasKeyUseWarning.uniqueKey || (ownerHasKeyUseWarning.uniqueKey = {});
|
1645
|
-
|
1646
|
-
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
1647
|
-
if (memoizer[currentComponentErrorInfo]) {
|
1648
|
-
return;
|
1649
|
-
}
|
1650
|
-
memoizer[currentComponentErrorInfo] = true;
|
1651
|
-
|
1652
|
-
// Usually the current owner is the offender, but if it accepts children as a
|
1653
|
-
// property, it may be the creator of the child that's responsible for
|
1654
|
-
// assigning it a key.
|
1655
|
-
var childOwner = '';
|
1656
|
-
if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
|
1657
|
-
// Give the component that originally created this child.
|
1658
|
-
childOwner = ' It was passed a child from ' + element._owner.getName() + '.';
|
1659
|
-
}
|
1660
|
-
|
1661
|
-
"development" !== 'production' ? warning(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.%s', currentComponentErrorInfo, childOwner, ReactComponentTreeHook.getCurrentStackAddendum(element)) : void 0;
|
1662
|
-
}
|
1663
|
-
|
1664
|
-
/**
|
1665
|
-
* Ensure that every element either is passed in a static location, in an
|
1666
|
-
* array with an explicit keys property defined, or in an object literal
|
1667
|
-
* with valid key property.
|
1668
|
-
*
|
1669
|
-
* @internal
|
1670
|
-
* @param {ReactNode} node Statically passed child of any type.
|
1671
|
-
* @param {*} parentType node's parent's type.
|
1672
|
-
*/
|
1673
|
-
function validateChildKeys(node, parentType) {
|
1674
|
-
if (typeof node !== 'object') {
|
1675
|
-
return;
|
1676
|
-
}
|
1677
|
-
if (Array.isArray(node)) {
|
1678
|
-
for (var i = 0; i < node.length; i++) {
|
1679
|
-
var child = node[i];
|
1680
|
-
if (ReactElement.isValidElement(child)) {
|
1681
|
-
validateExplicitKey(child, parentType);
|
1682
|
-
}
|
1683
|
-
}
|
1684
|
-
} else if (ReactElement.isValidElement(node)) {
|
1685
|
-
// This element was passed in a valid location.
|
1686
|
-
if (node._store) {
|
1687
|
-
node._store.validated = true;
|
1688
|
-
}
|
1689
|
-
} else if (node) {
|
1690
|
-
var iteratorFn = getIteratorFn(node);
|
1691
|
-
// Entry iterators provide implicit keys.
|
1692
|
-
if (iteratorFn) {
|
1693
|
-
if (iteratorFn !== node.entries) {
|
1694
|
-
var iterator = iteratorFn.call(node);
|
1695
|
-
var step;
|
1696
|
-
while (!(step = iterator.next()).done) {
|
1697
|
-
if (ReactElement.isValidElement(step.value)) {
|
1698
|
-
validateExplicitKey(step.value, parentType);
|
1699
|
-
}
|
1700
|
-
}
|
1701
|
-
}
|
1702
|
-
}
|
1703
|
-
}
|
1704
|
-
}
|
1705
|
-
|
1706
|
-
/**
|
1707
|
-
* Given an element, validate that its props follow the propTypes definition,
|
1708
|
-
* provided by the type.
|
1709
|
-
*
|
1710
|
-
* @param {ReactElement} element
|
1711
|
-
*/
|
1712
|
-
function validatePropTypes(element) {
|
1713
|
-
var componentClass = element.type;
|
1714
|
-
if (typeof componentClass !== 'function') {
|
1715
|
-
return;
|
1716
|
-
}
|
1717
|
-
var name = componentClass.displayName || componentClass.name;
|
1718
|
-
if (componentClass.propTypes) {
|
1719
|
-
checkReactTypeSpec(componentClass.propTypes, element.props, 'prop', name, element, null);
|
1720
|
-
}
|
1721
|
-
if (typeof componentClass.getDefaultProps === 'function') {
|
1722
|
-
"development" !== 'production' ? warning(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0;
|
1723
|
-
}
|
1724
|
-
}
|
1725
|
-
|
1726
|
-
var ReactElementValidator = {
|
1727
|
-
createElement: function (type, props, children) {
|
1728
|
-
var validType = typeof type === 'string' || typeof type === 'function';
|
1729
|
-
// We warn in this case but don't throw. We expect the element creation to
|
1730
|
-
// succeed and there will likely be errors in render.
|
1731
|
-
if (!validType) {
|
1732
|
-
if (typeof type !== 'function' && typeof type !== 'string') {
|
1733
|
-
var info = '';
|
1734
|
-
if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
|
1735
|
-
info += ' You likely forgot to export your component from the file ' + "it's defined in.";
|
1736
|
-
}
|
1737
|
-
|
1738
|
-
var sourceInfo = getSourceInfoErrorAddendum(props);
|
1739
|
-
if (sourceInfo) {
|
1740
|
-
info += sourceInfo;
|
1741
|
-
} else {
|
1742
|
-
info += getDeclarationErrorAddendum();
|
1743
|
-
}
|
1744
|
-
|
1745
|
-
info += ReactComponentTreeHook.getCurrentStackAddendum();
|
1746
|
-
|
1747
|
-
var currentSource = props !== null && props !== undefined && props.__source !== undefined ? props.__source : null;
|
1748
|
-
ReactComponentTreeHook.pushNonStandardWarningStack(true, currentSource);
|
1749
|
-
"development" !== 'production' ? warning(false, 'React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', type == null ? type : typeof type, info) : void 0;
|
1750
|
-
ReactComponentTreeHook.popNonStandardWarningStack();
|
1751
|
-
}
|
1752
|
-
}
|
1753
|
-
|
1754
|
-
var element = ReactElement.createElement.apply(this, arguments);
|
1755
|
-
|
1756
|
-
// The result can be nullish if a mock or a custom function is used.
|
1757
|
-
// TODO: Drop this when these are no longer allowed as the type argument.
|
1758
|
-
if (element == null) {
|
1759
|
-
return element;
|
1760
|
-
}
|
1761
|
-
|
1762
|
-
// Skip key warning if the type isn't valid since our key validation logic
|
1763
|
-
// doesn't expect a non-string/function type and can throw confusing errors.
|
1764
|
-
// We don't want exception behavior to differ between dev and prod.
|
1765
|
-
// (Rendering will throw with a helpful message and as soon as the type is
|
1766
|
-
// fixed, the key warnings will appear.)
|
1767
|
-
if (validType) {
|
1768
|
-
for (var i = 2; i < arguments.length; i++) {
|
1769
|
-
validateChildKeys(arguments[i], type);
|
1770
|
-
}
|
1771
|
-
}
|
1772
|
-
|
1773
|
-
validatePropTypes(element);
|
1774
|
-
|
1775
|
-
return element;
|
1776
|
-
},
|
1777
|
-
|
1778
|
-
createFactory: function (type) {
|
1779
|
-
var validatedFactory = ReactElementValidator.createElement.bind(null, type);
|
1780
|
-
// Legacy hook TODO: Warn if this is accessed
|
1781
|
-
validatedFactory.type = type;
|
1782
|
-
|
1783
|
-
if ("development" !== 'production') {
|
1784
|
-
if (canDefineProperty) {
|
1785
|
-
Object.defineProperty(validatedFactory, 'type', {
|
1786
|
-
enumerable: false,
|
1787
|
-
get: function () {
|
1788
|
-
lowPriorityWarning(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
|
1789
|
-
Object.defineProperty(this, 'type', {
|
1790
|
-
value: type
|
1791
|
-
});
|
1792
|
-
return type;
|
1793
|
-
}
|
1794
|
-
});
|
1795
|
-
}
|
1796
|
-
}
|
1797
|
-
|
1798
|
-
return validatedFactory;
|
1799
|
-
},
|
1800
|
-
|
1801
|
-
cloneElement: function (element, props, children) {
|
1802
|
-
var newElement = ReactElement.cloneElement.apply(this, arguments);
|
1803
|
-
for (var i = 2; i < arguments.length; i++) {
|
1804
|
-
validateChildKeys(arguments[i], newElement.type);
|
1805
|
-
}
|
1806
|
-
validatePropTypes(newElement);
|
1807
|
-
return newElement;
|
1808
|
-
}
|
1809
|
-
};
|
1810
|
-
|
1811
|
-
module.exports = ReactElementValidator;
|
1812
|
-
},{"18":18,"19":19,"21":21,"23":23,"31":31,"6":6,"7":7,"9":9}],12:[function(_dereq_,module,exports){
|
1813
|
-
/**
|
1814
|
-
* Copyright (c) 2015-present, Facebook, Inc.
|
1815
|
-
*
|
1816
|
-
* This source code is licensed under the MIT license found in the
|
1817
|
-
* LICENSE file in the root directory of this source tree.
|
1818
|
-
*
|
1819
|
-
*/
|
1820
|
-
|
1821
|
-
'use strict';
|
1822
|
-
|
1823
|
-
var warning = _dereq_(31);
|
1824
|
-
|
1825
|
-
function warnNoop(publicInstance, callerName) {
|
1826
|
-
if ("development" !== 'production') {
|
1827
|
-
var constructor = publicInstance.constructor;
|
1828
|
-
"development" !== 'production' ? warning(false, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, constructor && (constructor.displayName || constructor.name) || 'ReactClass') : void 0;
|
1829
|
-
}
|
1830
|
-
}
|
1831
|
-
|
1832
|
-
/**
|
1833
|
-
* This is the abstract API for an update queue.
|
1834
|
-
*/
|
1835
|
-
var ReactNoopUpdateQueue = {
|
1836
|
-
/**
|
1837
|
-
* Checks whether or not this composite component is mounted.
|
1838
|
-
* @param {ReactClass} publicInstance The instance we want to test.
|
1839
|
-
* @return {boolean} True if mounted, false otherwise.
|
1840
|
-
* @protected
|
1841
|
-
* @final
|
1842
|
-
*/
|
1843
|
-
isMounted: function (publicInstance) {
|
1844
|
-
return false;
|
1845
|
-
},
|
1846
|
-
|
1847
|
-
/**
|
1848
|
-
* Enqueue a callback that will be executed after all the pending updates
|
1849
|
-
* have processed.
|
1850
|
-
*
|
1851
|
-
* @param {ReactClass} publicInstance The instance to use as `this` context.
|
1852
|
-
* @param {?function} callback Called after state is updated.
|
1853
|
-
* @internal
|
1854
|
-
*/
|
1855
|
-
enqueueCallback: function (publicInstance, callback) {},
|
1856
|
-
|
1857
|
-
/**
|
1858
|
-
* Forces an update. This should only be invoked when it is known with
|
1859
|
-
* certainty that we are **not** in a DOM transaction.
|
1860
|
-
*
|
1861
|
-
* You may want to call this when you know that some deeper aspect of the
|
1862
|
-
* component's state has changed but `setState` was not called.
|
1863
|
-
*
|
1864
|
-
* This will not invoke `shouldComponentUpdate`, but it will invoke
|
1865
|
-
* `componentWillUpdate` and `componentDidUpdate`.
|
1866
|
-
*
|
1867
|
-
* @param {ReactClass} publicInstance The instance that should rerender.
|
1868
|
-
* @internal
|
1869
|
-
*/
|
1870
|
-
enqueueForceUpdate: function (publicInstance) {
|
1871
|
-
warnNoop(publicInstance, 'forceUpdate');
|
1872
|
-
},
|
1873
|
-
|
1874
|
-
/**
|
1875
|
-
* Replaces all of the state. Always use this or `setState` to mutate state.
|
1876
|
-
* You should treat `this.state` as immutable.
|
1877
|
-
*
|
1878
|
-
* There is no guarantee that `this.state` will be immediately updated, so
|
1879
|
-
* accessing `this.state` after calling this method may return the old value.
|
1880
|
-
*
|
1881
|
-
* @param {ReactClass} publicInstance The instance that should rerender.
|
1882
|
-
* @param {object} completeState Next state.
|
1883
|
-
* @internal
|
1884
|
-
*/
|
1885
|
-
enqueueReplaceState: function (publicInstance, completeState) {
|
1886
|
-
warnNoop(publicInstance, 'replaceState');
|
1887
|
-
},
|
1888
|
-
|
1889
|
-
/**
|
1890
|
-
* Sets a subset of the state. This only exists because _pendingState is
|
1891
|
-
* internal. This provides a merging strategy that is not available to deep
|
1892
|
-
* properties which is confusing. TODO: Expose pendingState or don't use it
|
1893
|
-
* during the merge.
|
1894
|
-
*
|
1895
|
-
* @param {ReactClass} publicInstance The instance that should rerender.
|
1896
|
-
* @param {object} partialState Next partial state to be merged with state.
|
1897
|
-
* @internal
|
1898
|
-
*/
|
1899
|
-
enqueueSetState: function (publicInstance, partialState) {
|
1900
|
-
warnNoop(publicInstance, 'setState');
|
1901
|
-
}
|
1902
|
-
};
|
1903
|
-
|
1904
|
-
module.exports = ReactNoopUpdateQueue;
|
1905
|
-
},{"31":31}],13:[function(_dereq_,module,exports){
|
1906
|
-
/**
|
1907
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
1908
|
-
*
|
1909
|
-
* This source code is licensed under the MIT license found in the
|
1910
|
-
* LICENSE file in the root directory of this source tree.
|
1911
|
-
*
|
1912
|
-
*
|
1913
|
-
*/
|
1914
|
-
|
1915
|
-
'use strict';
|
1916
|
-
|
1917
|
-
var ReactPropTypeLocationNames = {};
|
1918
|
-
|
1919
|
-
if ("development" !== 'production') {
|
1920
|
-
ReactPropTypeLocationNames = {
|
1921
|
-
prop: 'prop',
|
1922
|
-
context: 'context',
|
1923
|
-
childContext: 'child context'
|
1924
|
-
};
|
1925
|
-
}
|
1926
|
-
|
1927
|
-
module.exports = ReactPropTypeLocationNames;
|
1928
|
-
},{}],14:[function(_dereq_,module,exports){
|
1929
|
-
/**
|
1930
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
1931
|
-
*
|
1932
|
-
* This source code is licensed under the MIT license found in the
|
1933
|
-
* LICENSE file in the root directory of this source tree.
|
1934
|
-
*
|
1935
|
-
*/
|
1936
|
-
|
1937
|
-
'use strict';
|
1938
|
-
|
1939
|
-
var _require = _dereq_(9),
|
1940
|
-
isValidElement = _require.isValidElement;
|
1941
|
-
|
1942
|
-
var factory = _dereq_(34);
|
1943
|
-
|
1944
|
-
module.exports = factory(isValidElement);
|
1945
|
-
},{"34":34,"9":9}],15:[function(_dereq_,module,exports){
|
1946
|
-
/**
|
1947
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
1948
|
-
*
|
1949
|
-
* This source code is licensed under the MIT license found in the
|
1950
|
-
* LICENSE file in the root directory of this source tree.
|
1951
|
-
*
|
1952
|
-
*
|
1953
|
-
*/
|
1954
|
-
|
1955
|
-
'use strict';
|
1956
|
-
|
1957
|
-
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
1958
|
-
|
1959
|
-
module.exports = ReactPropTypesSecret;
|
1960
|
-
},{}],16:[function(_dereq_,module,exports){
|
1961
|
-
/**
|
1962
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
1963
|
-
*
|
1964
|
-
* This source code is licensed under the MIT license found in the
|
1965
|
-
* LICENSE file in the root directory of this source tree.
|
1966
|
-
*
|
1967
|
-
*/
|
1968
|
-
|
1969
|
-
'use strict';
|
1970
|
-
|
1971
|
-
var _assign = _dereq_(32);
|
1972
|
-
|
1973
|
-
var React = _dereq_(3);
|
1974
|
-
|
1975
|
-
// `version` will be added here by the React module.
|
1976
|
-
var ReactUMDEntry = _assign(React, {
|
1977
|
-
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {
|
1978
|
-
ReactCurrentOwner: _dereq_(7)
|
1979
|
-
}
|
1980
|
-
});
|
1981
|
-
|
1982
|
-
if ("development" !== 'production') {
|
1983
|
-
_assign(ReactUMDEntry.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, {
|
1984
|
-
// ReactComponentTreeHook should not be included in production.
|
1985
|
-
ReactComponentTreeHook: _dereq_(6),
|
1986
|
-
getNextDebugID: _dereq_(22)
|
1987
|
-
});
|
1988
|
-
}
|
1989
|
-
|
1990
|
-
module.exports = ReactUMDEntry;
|
1991
|
-
},{"22":22,"3":3,"32":32,"6":6,"7":7}],17:[function(_dereq_,module,exports){
|
1992
|
-
/**
|
1993
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
1994
|
-
*
|
1995
|
-
* This source code is licensed under the MIT license found in the
|
1996
|
-
* LICENSE file in the root directory of this source tree.
|
1997
|
-
*
|
1998
|
-
*/
|
1999
|
-
|
2000
|
-
'use strict';
|
2001
|
-
|
2002
|
-
module.exports = '15.6.2';
|
2003
|
-
},{}],18:[function(_dereq_,module,exports){
|
2004
|
-
/**
|
2005
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
2006
|
-
*
|
2007
|
-
* This source code is licensed under the MIT license found in the
|
2008
|
-
* LICENSE file in the root directory of this source tree.
|
2009
|
-
*
|
2010
|
-
*
|
2011
|
-
*/
|
2012
|
-
|
2013
|
-
'use strict';
|
2014
|
-
|
2015
|
-
var canDefineProperty = false;
|
2016
|
-
if ("development" !== 'production') {
|
2017
|
-
try {
|
2018
|
-
// $FlowFixMe https://github.com/facebook/flow/issues/285
|
2019
|
-
Object.defineProperty({}, 'x', { get: function () {} });
|
2020
|
-
canDefineProperty = true;
|
2021
|
-
} catch (x) {
|
2022
|
-
// IE will fail on defineProperty
|
2023
|
-
}
|
2024
|
-
}
|
2025
|
-
|
2026
|
-
module.exports = canDefineProperty;
|
2027
|
-
},{}],19:[function(_dereq_,module,exports){
|
2028
|
-
(function (process){
|
2029
|
-
/**
|
2030
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
2031
|
-
*
|
2032
|
-
* This source code is licensed under the MIT license found in the
|
2033
|
-
* LICENSE file in the root directory of this source tree.
|
2034
|
-
*
|
2035
|
-
*/
|
2036
|
-
|
2037
|
-
'use strict';
|
2038
|
-
|
2039
|
-
var _prodInvariant = _dereq_(25);
|
2040
|
-
|
2041
|
-
var ReactPropTypeLocationNames = _dereq_(13);
|
2042
|
-
var ReactPropTypesSecret = _dereq_(15);
|
2043
|
-
|
2044
|
-
var invariant = _dereq_(30);
|
2045
|
-
var warning = _dereq_(31);
|
2046
|
-
|
2047
|
-
var ReactComponentTreeHook;
|
2048
|
-
|
2049
|
-
if (typeof process !== 'undefined' && process.env && "development" === 'test') {
|
2050
|
-
// Temporary hack.
|
2051
|
-
// Inline requires don't work well with Jest:
|
2052
|
-
// https://github.com/facebook/react/issues/7240
|
2053
|
-
// Remove the inline requires when we don't need them anymore:
|
2054
|
-
// https://github.com/facebook/react/pull/7178
|
2055
|
-
ReactComponentTreeHook = _dereq_(6);
|
2056
|
-
}
|
2057
|
-
|
2058
|
-
var loggedTypeFailures = {};
|
2059
|
-
|
2060
|
-
/**
|
2061
|
-
* Assert that the values match with the type specs.
|
2062
|
-
* Error messages are memorized and will only be shown once.
|
2063
|
-
*
|
2064
|
-
* @param {object} typeSpecs Map of name to a ReactPropType
|
2065
|
-
* @param {object} values Runtime values that need to be type-checked
|
2066
|
-
* @param {string} location e.g. "prop", "context", "child context"
|
2067
|
-
* @param {string} componentName Name of the component for error messages.
|
2068
|
-
* @param {?object} element The React element that is being type-checked
|
2069
|
-
* @param {?number} debugID The React component instance that is being type-checked
|
2070
|
-
* @private
|
2071
|
-
*/
|
2072
|
-
function checkReactTypeSpec(typeSpecs, values, location, componentName, element, debugID) {
|
2073
|
-
for (var typeSpecName in typeSpecs) {
|
2074
|
-
if (typeSpecs.hasOwnProperty(typeSpecName)) {
|
2075
|
-
var error;
|
2076
|
-
// Prop type validation may throw. In case they do, we don't want to
|
2077
|
-
// fail the render phase where it didn't fail before. So we log it.
|
2078
|
-
// After these have been cleaned up, we'll let them throw.
|
2079
|
-
try {
|
2080
|
-
// This is intentionally an invariant that gets caught. It's the same
|
2081
|
-
// behavior as without this statement except with a better message.
|
2082
|
-
!(typeof typeSpecs[typeSpecName] === 'function') ? "development" !== 'production' ? invariant(false, '%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName) : _prodInvariant('84', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName) : void 0;
|
2083
|
-
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
|
2084
|
-
} catch (ex) {
|
2085
|
-
error = ex;
|
2086
|
-
}
|
2087
|
-
"development" !== 'production' ? warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName, typeof error) : void 0;
|
2088
|
-
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
2089
|
-
// Only monitor this failure once because there tends to be a lot of the
|
2090
|
-
// same error.
|
2091
|
-
loggedTypeFailures[error.message] = true;
|
2092
|
-
|
2093
|
-
var componentStackInfo = '';
|
2094
|
-
|
2095
|
-
if ("development" !== 'production') {
|
2096
|
-
if (!ReactComponentTreeHook) {
|
2097
|
-
ReactComponentTreeHook = _dereq_(6);
|
2098
|
-
}
|
2099
|
-
if (debugID !== null) {
|
2100
|
-
componentStackInfo = ReactComponentTreeHook.getStackAddendumByID(debugID);
|
2101
|
-
} else if (element !== null) {
|
2102
|
-
componentStackInfo = ReactComponentTreeHook.getCurrentStackAddendum(element);
|
2103
|
-
}
|
2104
|
-
}
|
2105
|
-
|
2106
|
-
"development" !== 'production' ? warning(false, 'Failed %s type: %s%s', location, error.message, componentStackInfo) : void 0;
|
2107
|
-
}
|
2108
|
-
}
|
2109
|
-
}
|
2110
|
-
}
|
2111
|
-
|
2112
|
-
module.exports = checkReactTypeSpec;
|
2113
|
-
}).call(this,undefined)
|
2114
|
-
},{"13":13,"15":15,"25":25,"30":30,"31":31,"6":6}],20:[function(_dereq_,module,exports){
|
2115
|
-
/**
|
2116
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
2117
|
-
*
|
2118
|
-
* This source code is licensed under the MIT license found in the
|
2119
|
-
* LICENSE file in the root directory of this source tree.
|
2120
|
-
*
|
2121
|
-
*/
|
2122
|
-
|
2123
|
-
'use strict';
|
2124
|
-
|
2125
|
-
var _require = _dereq_(4),
|
2126
|
-
Component = _require.Component;
|
2127
|
-
|
2128
|
-
var _require2 = _dereq_(9),
|
2129
|
-
isValidElement = _require2.isValidElement;
|
2130
|
-
|
2131
|
-
var ReactNoopUpdateQueue = _dereq_(12);
|
2132
|
-
var factory = _dereq_(27);
|
2133
|
-
|
2134
|
-
module.exports = factory(Component, isValidElement, ReactNoopUpdateQueue);
|
2135
|
-
},{"12":12,"27":27,"4":4,"9":9}],21:[function(_dereq_,module,exports){
|
2136
|
-
/**
|
2137
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
2138
|
-
*
|
2139
|
-
* This source code is licensed under the MIT license found in the
|
2140
|
-
* LICENSE file in the root directory of this source tree.
|
2141
|
-
*
|
2142
|
-
*
|
2143
|
-
*/
|
2144
|
-
|
2145
|
-
'use strict';
|
2146
|
-
|
2147
|
-
/* global Symbol */
|
2148
|
-
|
2149
|
-
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
2150
|
-
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
|
2151
|
-
|
2152
|
-
/**
|
2153
|
-
* Returns the iterator method function contained on the iterable object.
|
2154
|
-
*
|
2155
|
-
* Be sure to invoke the function with the iterable as context:
|
2156
|
-
*
|
2157
|
-
* var iteratorFn = getIteratorFn(myIterable);
|
2158
|
-
* if (iteratorFn) {
|
2159
|
-
* var iterator = iteratorFn.call(myIterable);
|
2160
|
-
* ...
|
2161
|
-
* }
|
2162
|
-
*
|
2163
|
-
* @param {?object} maybeIterable
|
2164
|
-
* @return {?function}
|
2165
|
-
*/
|
2166
|
-
function getIteratorFn(maybeIterable) {
|
2167
|
-
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
2168
|
-
if (typeof iteratorFn === 'function') {
|
2169
|
-
return iteratorFn;
|
2170
|
-
}
|
2171
|
-
}
|
2172
|
-
|
2173
|
-
module.exports = getIteratorFn;
|
2174
|
-
},{}],22:[function(_dereq_,module,exports){
|
2175
|
-
/**
|
2176
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
2177
|
-
*
|
2178
|
-
* This source code is licensed under the MIT license found in the
|
2179
|
-
* LICENSE file in the root directory of this source tree.
|
2180
|
-
*
|
2181
|
-
*
|
2182
|
-
*/
|
2183
|
-
|
2184
|
-
'use strict';
|
2185
|
-
|
2186
|
-
var nextDebugID = 1;
|
2187
|
-
|
2188
|
-
function getNextDebugID() {
|
2189
|
-
return nextDebugID++;
|
2190
|
-
}
|
2191
|
-
|
2192
|
-
module.exports = getNextDebugID;
|
2193
|
-
},{}],23:[function(_dereq_,module,exports){
|
2194
|
-
/**
|
2195
|
-
* Copyright (c) 2014-present, Facebook, Inc.
|
2196
|
-
*
|
2197
|
-
* This source code is licensed under the MIT license found in the
|
2198
|
-
* LICENSE file in the root directory of this source tree.
|
2199
|
-
*
|
2200
|
-
*/
|
2201
|
-
|
2202
|
-
'use strict';
|
2203
|
-
|
2204
|
-
/**
|
2205
|
-
* Forked from fbjs/warning:
|
2206
|
-
* https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
|
2207
|
-
*
|
2208
|
-
* Only change is we use console.warn instead of console.error,
|
2209
|
-
* and do nothing when 'console' is not supported.
|
2210
|
-
* This really simplifies the code.
|
2211
|
-
* ---
|
2212
|
-
* Similar to invariant but only logs a warning if the condition is not met.
|
2213
|
-
* This can be used to log issues in development environments in critical
|
2214
|
-
* paths. Removing the logging code for production environments will keep the
|
2215
|
-
* same logic and follow the same code paths.
|
2216
|
-
*/
|
2217
|
-
|
2218
|
-
var lowPriorityWarning = function () {};
|
2219
|
-
|
2220
|
-
if ("development" !== 'production') {
|
2221
|
-
var printWarning = function (format) {
|
2222
|
-
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
2223
|
-
args[_key - 1] = arguments[_key];
|
2224
|
-
}
|
2225
|
-
|
2226
|
-
var argIndex = 0;
|
2227
|
-
var message = 'Warning: ' + format.replace(/%s/g, function () {
|
2228
|
-
return args[argIndex++];
|
2229
|
-
});
|
2230
|
-
if (typeof console !== 'undefined') {
|
2231
|
-
console.warn(message);
|
2232
|
-
}
|
2233
|
-
try {
|
2234
|
-
// --- Welcome to debugging React ---
|
2235
|
-
// This error was thrown as a convenience so that you can use this stack
|
2236
|
-
// to find the callsite that caused this warning to fire.
|
2237
|
-
throw new Error(message);
|
2238
|
-
} catch (x) {}
|
2239
|
-
};
|
2240
|
-
|
2241
|
-
lowPriorityWarning = function (condition, format) {
|
2242
|
-
if (format === undefined) {
|
2243
|
-
throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
|
2244
|
-
}
|
2245
|
-
if (!condition) {
|
2246
|
-
for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
2247
|
-
args[_key2 - 2] = arguments[_key2];
|
2248
|
-
}
|
2249
|
-
|
2250
|
-
printWarning.apply(undefined, [format].concat(args));
|
2251
|
-
}
|
2252
|
-
};
|
2253
|
-
}
|
2254
|
-
|
2255
|
-
module.exports = lowPriorityWarning;
|
2256
|
-
},{}],24:[function(_dereq_,module,exports){
|
2257
|
-
/**
|
2258
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
2259
|
-
*
|
2260
|
-
* This source code is licensed under the MIT license found in the
|
2261
|
-
* LICENSE file in the root directory of this source tree.
|
2262
|
-
*
|
2263
|
-
*/
|
2264
|
-
'use strict';
|
2265
|
-
|
2266
|
-
var _prodInvariant = _dereq_(25);
|
2267
|
-
|
2268
|
-
var ReactElement = _dereq_(9);
|
2269
|
-
|
2270
|
-
var invariant = _dereq_(30);
|
2271
|
-
|
2272
|
-
/**
|
2273
|
-
* Returns the first child in a collection of children and verifies that there
|
2274
|
-
* is only one child in the collection.
|
2275
|
-
*
|
2276
|
-
* See https://facebook.github.io/react/docs/top-level-api.html#react.children.only
|
2277
|
-
*
|
2278
|
-
* The current implementation of this function assumes that a single child gets
|
2279
|
-
* passed without a wrapper, but the purpose of this helper function is to
|
2280
|
-
* abstract away the particular structure of children.
|
2281
|
-
*
|
2282
|
-
* @param {?object} children Child collection structure.
|
2283
|
-
* @return {ReactElement} The first and only `ReactElement` contained in the
|
2284
|
-
* structure.
|
2285
|
-
*/
|
2286
|
-
function onlyChild(children) {
|
2287
|
-
!ReactElement.isValidElement(children) ? "development" !== 'production' ? invariant(false, 'React.Children.only expected to receive a single React element child.') : _prodInvariant('143') : void 0;
|
2288
|
-
return children;
|
2289
|
-
}
|
2290
|
-
|
2291
|
-
module.exports = onlyChild;
|
2292
|
-
},{"25":25,"30":30,"9":9}],25:[function(_dereq_,module,exports){
|
2293
|
-
/**
|
2294
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
2295
|
-
*
|
2296
|
-
* This source code is licensed under the MIT license found in the
|
2297
|
-
* LICENSE file in the root directory of this source tree.
|
2298
|
-
*
|
2299
|
-
*
|
2300
|
-
*/
|
2301
|
-
'use strict';
|
2302
|
-
|
2303
|
-
/**
|
2304
|
-
* WARNING: DO NOT manually require this module.
|
2305
|
-
* This is a replacement for `invariant(...)` used by the error code system
|
2306
|
-
* and will _only_ be required by the corresponding babel pass.
|
2307
|
-
* It always throws.
|
2308
|
-
*/
|
2309
|
-
|
2310
|
-
function reactProdInvariant(code) {
|
2311
|
-
var argCount = arguments.length - 1;
|
2312
|
-
|
2313
|
-
var message = 'Minified React error #' + code + '; visit ' + 'http://facebook.github.io/react/docs/error-decoder.html?invariant=' + code;
|
2314
|
-
|
2315
|
-
for (var argIdx = 0; argIdx < argCount; argIdx++) {
|
2316
|
-
message += '&args[]=' + encodeURIComponent(arguments[argIdx + 1]);
|
2317
|
-
}
|
2318
|
-
|
2319
|
-
message += ' for the full message or use the non-minified dev environment' + ' for full errors and additional helpful warnings.';
|
2320
|
-
|
2321
|
-
var error = new Error(message);
|
2322
|
-
error.name = 'Invariant Violation';
|
2323
|
-
error.framesToPop = 1; // we don't care about reactProdInvariant's own frame
|
2324
|
-
|
2325
|
-
throw error;
|
2326
|
-
}
|
2327
|
-
|
2328
|
-
module.exports = reactProdInvariant;
|
2329
|
-
},{}],26:[function(_dereq_,module,exports){
|
2330
|
-
/**
|
2331
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
2332
|
-
*
|
2333
|
-
* This source code is licensed under the MIT license found in the
|
2334
|
-
* LICENSE file in the root directory of this source tree.
|
2335
|
-
*
|
2336
|
-
*/
|
2337
|
-
|
2338
|
-
'use strict';
|
2339
|
-
|
2340
|
-
var _prodInvariant = _dereq_(25);
|
2341
|
-
|
2342
|
-
var ReactCurrentOwner = _dereq_(7);
|
2343
|
-
var REACT_ELEMENT_TYPE = _dereq_(10);
|
2344
|
-
|
2345
|
-
var getIteratorFn = _dereq_(21);
|
2346
|
-
var invariant = _dereq_(30);
|
2347
|
-
var KeyEscapeUtils = _dereq_(1);
|
2348
|
-
var warning = _dereq_(31);
|
2349
|
-
|
2350
|
-
var SEPARATOR = '.';
|
2351
|
-
var SUBSEPARATOR = ':';
|
2352
|
-
|
2353
|
-
/**
|
2354
|
-
* This is inlined from ReactElement since this file is shared between
|
2355
|
-
* isomorphic and renderers. We could extract this to a
|
2356
|
-
*
|
2357
|
-
*/
|
2358
|
-
|
2359
|
-
/**
|
2360
|
-
* TODO: Test that a single child and an array with one item have the same key
|
2361
|
-
* pattern.
|
2362
|
-
*/
|
2363
|
-
|
2364
|
-
var didWarnAboutMaps = false;
|
2365
|
-
|
2366
|
-
/**
|
2367
|
-
* Generate a key string that identifies a component within a set.
|
2368
|
-
*
|
2369
|
-
* @param {*} component A component that could contain a manual key.
|
2370
|
-
* @param {number} index Index that is used if a manual key is not provided.
|
2371
|
-
* @return {string}
|
2372
|
-
*/
|
2373
|
-
function getComponentKey(component, index) {
|
2374
|
-
// Do some typechecking here since we call this blindly. We want to ensure
|
2375
|
-
// that we don't block potential future ES APIs.
|
2376
|
-
if (component && typeof component === 'object' && component.key != null) {
|
2377
|
-
// Explicit key
|
2378
|
-
return KeyEscapeUtils.escape(component.key);
|
2379
|
-
}
|
2380
|
-
// Implicit key determined by the index in the set
|
2381
|
-
return index.toString(36);
|
2382
|
-
}
|
2383
|
-
|
2384
|
-
/**
|
2385
|
-
* @param {?*} children Children tree container.
|
2386
|
-
* @param {!string} nameSoFar Name of the key path so far.
|
2387
|
-
* @param {!function} callback Callback to invoke with each child found.
|
2388
|
-
* @param {?*} traverseContext Used to pass information throughout the traversal
|
2389
|
-
* process.
|
2390
|
-
* @return {!number} The number of children in this subtree.
|
2391
|
-
*/
|
2392
|
-
function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
|
2393
|
-
var type = typeof children;
|
2394
|
-
|
2395
|
-
if (type === 'undefined' || type === 'boolean') {
|
2396
|
-
// All of the above are perceived as null.
|
2397
|
-
children = null;
|
2398
|
-
}
|
2399
|
-
|
2400
|
-
if (children === null || type === 'string' || type === 'number' ||
|
2401
|
-
// The following is inlined from ReactElement. This means we can optimize
|
2402
|
-
// some checks. React Fiber also inlines this logic for similar purposes.
|
2403
|
-
type === 'object' && children.$$typeof === REACT_ELEMENT_TYPE) {
|
2404
|
-
callback(traverseContext, children,
|
2405
|
-
// If it's the only child, treat the name as if it was wrapped in an array
|
2406
|
-
// so that it's consistent if the number of children grows.
|
2407
|
-
nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
|
2408
|
-
return 1;
|
2409
|
-
}
|
2410
|
-
|
2411
|
-
var child;
|
2412
|
-
var nextName;
|
2413
|
-
var subtreeCount = 0; // Count of children found in the current subtree.
|
2414
|
-
var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
|
2415
|
-
|
2416
|
-
if (Array.isArray(children)) {
|
2417
|
-
for (var i = 0; i < children.length; i++) {
|
2418
|
-
child = children[i];
|
2419
|
-
nextName = nextNamePrefix + getComponentKey(child, i);
|
2420
|
-
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
|
2421
|
-
}
|
2422
|
-
} else {
|
2423
|
-
var iteratorFn = getIteratorFn(children);
|
2424
|
-
if (iteratorFn) {
|
2425
|
-
var iterator = iteratorFn.call(children);
|
2426
|
-
var step;
|
2427
|
-
if (iteratorFn !== children.entries) {
|
2428
|
-
var ii = 0;
|
2429
|
-
while (!(step = iterator.next()).done) {
|
2430
|
-
child = step.value;
|
2431
|
-
nextName = nextNamePrefix + getComponentKey(child, ii++);
|
2432
|
-
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
|
2433
|
-
}
|
2434
|
-
} else {
|
2435
|
-
if ("development" !== 'production') {
|
2436
|
-
var mapsAsChildrenAddendum = '';
|
2437
|
-
if (ReactCurrentOwner.current) {
|
2438
|
-
var mapsAsChildrenOwnerName = ReactCurrentOwner.current.getName();
|
2439
|
-
if (mapsAsChildrenOwnerName) {
|
2440
|
-
mapsAsChildrenAddendum = ' Check the render method of `' + mapsAsChildrenOwnerName + '`.';
|
2441
|
-
}
|
2442
|
-
}
|
2443
|
-
"development" !== 'production' ? warning(didWarnAboutMaps, 'Using Maps as children is not yet fully supported. It is an ' + 'experimental feature that might be removed. Convert it to a ' + 'sequence / iterable of keyed ReactElements instead.%s', mapsAsChildrenAddendum) : void 0;
|
2444
|
-
didWarnAboutMaps = true;
|
2445
|
-
}
|
2446
|
-
// Iterator will provide entry [k,v] tuples rather than values.
|
2447
|
-
while (!(step = iterator.next()).done) {
|
2448
|
-
var entry = step.value;
|
2449
|
-
if (entry) {
|
2450
|
-
child = entry[1];
|
2451
|
-
nextName = nextNamePrefix + KeyEscapeUtils.escape(entry[0]) + SUBSEPARATOR + getComponentKey(child, 0);
|
2452
|
-
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
|
2453
|
-
}
|
2454
|
-
}
|
2455
|
-
}
|
2456
|
-
} else if (type === 'object') {
|
2457
|
-
var addendum = '';
|
2458
|
-
if ("development" !== 'production') {
|
2459
|
-
addendum = ' If you meant to render a collection of children, use an array ' + 'instead or wrap the object using createFragment(object) from the ' + 'React add-ons.';
|
2460
|
-
if (children._isReactElement) {
|
2461
|
-
addendum = " It looks like you're using an element created by a different " + 'version of React. Make sure to use only one copy of React.';
|
2462
|
-
}
|
2463
|
-
if (ReactCurrentOwner.current) {
|
2464
|
-
var name = ReactCurrentOwner.current.getName();
|
2465
|
-
if (name) {
|
2466
|
-
addendum += ' Check the render method of `' + name + '`.';
|
2467
|
-
}
|
2468
|
-
}
|
2469
|
-
}
|
2470
|
-
var childrenString = String(children);
|
2471
|
-
!false ? "development" !== 'production' ? invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : _prodInvariant('31', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : void 0;
|
2472
|
-
}
|
2473
|
-
}
|
2474
|
-
|
2475
|
-
return subtreeCount;
|
2476
|
-
}
|
2477
|
-
|
2478
|
-
/**
|
2479
|
-
* Traverses children that are typically specified as `props.children`, but
|
2480
|
-
* might also be specified through attributes:
|
2481
|
-
*
|
2482
|
-
* - `traverseAllChildren(this.props.children, ...)`
|
2483
|
-
* - `traverseAllChildren(this.props.leftPanelChildren, ...)`
|
2484
|
-
*
|
2485
|
-
* The `traverseContext` is an optional argument that is passed through the
|
2486
|
-
* entire traversal. It can be used to store accumulations or anything else that
|
2487
|
-
* the callback might find relevant.
|
2488
|
-
*
|
2489
|
-
* @param {?*} children Children tree object.
|
2490
|
-
* @param {!function} callback To invoke upon traversing each child.
|
2491
|
-
* @param {?*} traverseContext Context for traversal.
|
2492
|
-
* @return {!number} The number of children in this subtree.
|
2493
|
-
*/
|
2494
|
-
function traverseAllChildren(children, callback, traverseContext) {
|
2495
|
-
if (children == null) {
|
2496
|
-
return 0;
|
2497
|
-
}
|
2498
|
-
|
2499
|
-
return traverseAllChildrenImpl(children, '', callback, traverseContext);
|
2500
|
-
}
|
2501
|
-
|
2502
|
-
module.exports = traverseAllChildren;
|
2503
|
-
},{"1":1,"10":10,"21":21,"25":25,"30":30,"31":31,"7":7}],27:[function(_dereq_,module,exports){
|
2504
|
-
/**
|
2505
|
-
* Copyright 2013-present, Facebook, Inc.
|
2506
|
-
* All rights reserved.
|
2507
|
-
*
|
2508
|
-
* This source code is licensed under the BSD-style license found in the
|
2509
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
2510
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
2511
|
-
*
|
2512
|
-
*/
|
2513
|
-
|
2514
|
-
'use strict';
|
2515
|
-
|
2516
|
-
var _assign = _dereq_(32);
|
2517
|
-
|
2518
|
-
var emptyObject = _dereq_(29);
|
2519
|
-
var _invariant = _dereq_(30);
|
2520
|
-
|
2521
|
-
if ("development" !== 'production') {
|
2522
|
-
var warning = _dereq_(31);
|
2523
|
-
}
|
2524
|
-
|
2525
|
-
var MIXINS_KEY = 'mixins';
|
2526
|
-
|
2527
|
-
// Helper function to allow the creation of anonymous functions which do not
|
2528
|
-
// have .name set to the name of the variable being assigned to.
|
2529
|
-
function identity(fn) {
|
2530
|
-
return fn;
|
2531
|
-
}
|
2532
|
-
|
2533
|
-
var ReactPropTypeLocationNames;
|
2534
|
-
if ("development" !== 'production') {
|
2535
|
-
ReactPropTypeLocationNames = {
|
2536
|
-
prop: 'prop',
|
2537
|
-
context: 'context',
|
2538
|
-
childContext: 'child context'
|
2539
|
-
};
|
2540
|
-
} else {
|
2541
|
-
ReactPropTypeLocationNames = {};
|
2542
|
-
}
|
2543
|
-
|
2544
|
-
function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) {
|
2545
|
-
/**
|
2546
|
-
* Policies that describe methods in `ReactClassInterface`.
|
2547
|
-
*/
|
2548
|
-
|
2549
|
-
var injectedMixins = [];
|
2550
|
-
|
2551
|
-
/**
|
2552
|
-
* Composite components are higher-level components that compose other composite
|
2553
|
-
* or host components.
|
2554
|
-
*
|
2555
|
-
* To create a new type of `ReactClass`, pass a specification of
|
2556
|
-
* your new class to `React.createClass`. The only requirement of your class
|
2557
|
-
* specification is that you implement a `render` method.
|
2558
|
-
*
|
2559
|
-
* var MyComponent = React.createClass({
|
2560
|
-
* render: function() {
|
2561
|
-
* return <div>Hello World</div>;
|
2562
|
-
* }
|
2563
|
-
* });
|
2564
|
-
*
|
2565
|
-
* The class specification supports a specific protocol of methods that have
|
2566
|
-
* special meaning (e.g. `render`). See `ReactClassInterface` for
|
2567
|
-
* more the comprehensive protocol. Any other properties and methods in the
|
2568
|
-
* class specification will be available on the prototype.
|
2569
|
-
*
|
2570
|
-
* @interface ReactClassInterface
|
2571
|
-
* @internal
|
2572
|
-
*/
|
2573
|
-
var ReactClassInterface = {
|
2574
|
-
/**
|
2575
|
-
* An array of Mixin objects to include when defining your component.
|
2576
|
-
*
|
2577
|
-
* @type {array}
|
2578
|
-
* @optional
|
2579
|
-
*/
|
2580
|
-
mixins: 'DEFINE_MANY',
|
2581
|
-
|
2582
|
-
/**
|
2583
|
-
* An object containing properties and methods that should be defined on
|
2584
|
-
* the component's constructor instead of its prototype (static methods).
|
2585
|
-
*
|
2586
|
-
* @type {object}
|
2587
|
-
* @optional
|
2588
|
-
*/
|
2589
|
-
statics: 'DEFINE_MANY',
|
2590
|
-
|
2591
|
-
/**
|
2592
|
-
* Definition of prop types for this component.
|
2593
|
-
*
|
2594
|
-
* @type {object}
|
2595
|
-
* @optional
|
2596
|
-
*/
|
2597
|
-
propTypes: 'DEFINE_MANY',
|
2598
|
-
|
2599
|
-
/**
|
2600
|
-
* Definition of context types for this component.
|
2601
|
-
*
|
2602
|
-
* @type {object}
|
2603
|
-
* @optional
|
2604
|
-
*/
|
2605
|
-
contextTypes: 'DEFINE_MANY',
|
2606
|
-
|
2607
|
-
/**
|
2608
|
-
* Definition of context types this component sets for its children.
|
2609
|
-
*
|
2610
|
-
* @type {object}
|
2611
|
-
* @optional
|
2612
|
-
*/
|
2613
|
-
childContextTypes: 'DEFINE_MANY',
|
2614
|
-
|
2615
|
-
// ==== Definition methods ====
|
2616
|
-
|
2617
|
-
/**
|
2618
|
-
* Invoked when the component is mounted. Values in the mapping will be set on
|
2619
|
-
* `this.props` if that prop is not specified (i.e. using an `in` check).
|
2620
|
-
*
|
2621
|
-
* This method is invoked before `getInitialState` and therefore cannot rely
|
2622
|
-
* on `this.state` or use `this.setState`.
|
2623
|
-
*
|
2624
|
-
* @return {object}
|
2625
|
-
* @optional
|
2626
|
-
*/
|
2627
|
-
getDefaultProps: 'DEFINE_MANY_MERGED',
|
2628
|
-
|
2629
|
-
/**
|
2630
|
-
* Invoked once before the component is mounted. The return value will be used
|
2631
|
-
* as the initial value of `this.state`.
|
2632
|
-
*
|
2633
|
-
* getInitialState: function() {
|
2634
|
-
* return {
|
2635
|
-
* isOn: false,
|
2636
|
-
* fooBaz: new BazFoo()
|
2637
|
-
* }
|
2638
|
-
* }
|
2639
|
-
*
|
2640
|
-
* @return {object}
|
2641
|
-
* @optional
|
2642
|
-
*/
|
2643
|
-
getInitialState: 'DEFINE_MANY_MERGED',
|
2644
|
-
|
2645
|
-
/**
|
2646
|
-
* @return {object}
|
2647
|
-
* @optional
|
2648
|
-
*/
|
2649
|
-
getChildContext: 'DEFINE_MANY_MERGED',
|
2650
|
-
|
2651
|
-
/**
|
2652
|
-
* Uses props from `this.props` and state from `this.state` to render the
|
2653
|
-
* structure of the component.
|
2654
|
-
*
|
2655
|
-
* No guarantees are made about when or how often this method is invoked, so
|
2656
|
-
* it must not have side effects.
|
2657
|
-
*
|
2658
|
-
* render: function() {
|
2659
|
-
* var name = this.props.name;
|
2660
|
-
* return <div>Hello, {name}!</div>;
|
2661
|
-
* }
|
2662
|
-
*
|
2663
|
-
* @return {ReactComponent}
|
2664
|
-
* @required
|
2665
|
-
*/
|
2666
|
-
render: 'DEFINE_ONCE',
|
2667
|
-
|
2668
|
-
// ==== Delegate methods ====
|
2669
|
-
|
2670
|
-
/**
|
2671
|
-
* Invoked when the component is initially created and about to be mounted.
|
2672
|
-
* This may have side effects, but any external subscriptions or data created
|
2673
|
-
* by this method must be cleaned up in `componentWillUnmount`.
|
2674
|
-
*
|
2675
|
-
* @optional
|
2676
|
-
*/
|
2677
|
-
componentWillMount: 'DEFINE_MANY',
|
2678
|
-
|
2679
|
-
/**
|
2680
|
-
* Invoked when the component has been mounted and has a DOM representation.
|
2681
|
-
* However, there is no guarantee that the DOM node is in the document.
|
2682
|
-
*
|
2683
|
-
* Use this as an opportunity to operate on the DOM when the component has
|
2684
|
-
* been mounted (initialized and rendered) for the first time.
|
2685
|
-
*
|
2686
|
-
* @param {DOMElement} rootNode DOM element representing the component.
|
2687
|
-
* @optional
|
2688
|
-
*/
|
2689
|
-
componentDidMount: 'DEFINE_MANY',
|
2690
|
-
|
2691
|
-
/**
|
2692
|
-
* Invoked before the component receives new props.
|
2693
|
-
*
|
2694
|
-
* Use this as an opportunity to react to a prop transition by updating the
|
2695
|
-
* state using `this.setState`. Current props are accessed via `this.props`.
|
2696
|
-
*
|
2697
|
-
* componentWillReceiveProps: function(nextProps, nextContext) {
|
2698
|
-
* this.setState({
|
2699
|
-
* likesIncreasing: nextProps.likeCount > this.props.likeCount
|
2700
|
-
* });
|
2701
|
-
* }
|
2702
|
-
*
|
2703
|
-
* NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop
|
2704
|
-
* transition may cause a state change, but the opposite is not true. If you
|
2705
|
-
* need it, you are probably looking for `componentWillUpdate`.
|
2706
|
-
*
|
2707
|
-
* @param {object} nextProps
|
2708
|
-
* @optional
|
2709
|
-
*/
|
2710
|
-
componentWillReceiveProps: 'DEFINE_MANY',
|
2711
|
-
|
2712
|
-
/**
|
2713
|
-
* Invoked while deciding if the component should be updated as a result of
|
2714
|
-
* receiving new props, state and/or context.
|
2715
|
-
*
|
2716
|
-
* Use this as an opportunity to `return false` when you're certain that the
|
2717
|
-
* transition to the new props/state/context will not require a component
|
2718
|
-
* update.
|
2719
|
-
*
|
2720
|
-
* shouldComponentUpdate: function(nextProps, nextState, nextContext) {
|
2721
|
-
* return !equal(nextProps, this.props) ||
|
2722
|
-
* !equal(nextState, this.state) ||
|
2723
|
-
* !equal(nextContext, this.context);
|
2724
|
-
* }
|
2725
|
-
*
|
2726
|
-
* @param {object} nextProps
|
2727
|
-
* @param {?object} nextState
|
2728
|
-
* @param {?object} nextContext
|
2729
|
-
* @return {boolean} True if the component should update.
|
2730
|
-
* @optional
|
2731
|
-
*/
|
2732
|
-
shouldComponentUpdate: 'DEFINE_ONCE',
|
2733
|
-
|
2734
|
-
/**
|
2735
|
-
* Invoked when the component is about to update due to a transition from
|
2736
|
-
* `this.props`, `this.state` and `this.context` to `nextProps`, `nextState`
|
2737
|
-
* and `nextContext`.
|
2738
|
-
*
|
2739
|
-
* Use this as an opportunity to perform preparation before an update occurs.
|
2740
|
-
*
|
2741
|
-
* NOTE: You **cannot** use `this.setState()` in this method.
|
2742
|
-
*
|
2743
|
-
* @param {object} nextProps
|
2744
|
-
* @param {?object} nextState
|
2745
|
-
* @param {?object} nextContext
|
2746
|
-
* @param {ReactReconcileTransaction} transaction
|
2747
|
-
* @optional
|
2748
|
-
*/
|
2749
|
-
componentWillUpdate: 'DEFINE_MANY',
|
2750
|
-
|
2751
|
-
/**
|
2752
|
-
* Invoked when the component's DOM representation has been updated.
|
2753
|
-
*
|
2754
|
-
* Use this as an opportunity to operate on the DOM when the component has
|
2755
|
-
* been updated.
|
2756
|
-
*
|
2757
|
-
* @param {object} prevProps
|
2758
|
-
* @param {?object} prevState
|
2759
|
-
* @param {?object} prevContext
|
2760
|
-
* @param {DOMElement} rootNode DOM element representing the component.
|
2761
|
-
* @optional
|
2762
|
-
*/
|
2763
|
-
componentDidUpdate: 'DEFINE_MANY',
|
2764
|
-
|
2765
|
-
/**
|
2766
|
-
* Invoked when the component is about to be removed from its parent and have
|
2767
|
-
* its DOM representation destroyed.
|
2768
|
-
*
|
2769
|
-
* Use this as an opportunity to deallocate any external resources.
|
2770
|
-
*
|
2771
|
-
* NOTE: There is no `componentDidUnmount` since your component will have been
|
2772
|
-
* destroyed by that point.
|
2773
|
-
*
|
2774
|
-
* @optional
|
2775
|
-
*/
|
2776
|
-
componentWillUnmount: 'DEFINE_MANY',
|
2777
|
-
|
2778
|
-
// ==== Advanced methods ====
|
2779
|
-
|
2780
|
-
/**
|
2781
|
-
* Updates the component's currently mounted DOM representation.
|
2782
|
-
*
|
2783
|
-
* By default, this implements React's rendering and reconciliation algorithm.
|
2784
|
-
* Sophisticated clients may wish to override this.
|
2785
|
-
*
|
2786
|
-
* @param {ReactReconcileTransaction} transaction
|
2787
|
-
* @internal
|
2788
|
-
* @overridable
|
2789
|
-
*/
|
2790
|
-
updateComponent: 'OVERRIDE_BASE'
|
2791
|
-
};
|
2792
|
-
|
2793
|
-
/**
|
2794
|
-
* Mapping from class specification keys to special processing functions.
|
2795
|
-
*
|
2796
|
-
* Although these are declared like instance properties in the specification
|
2797
|
-
* when defining classes using `React.createClass`, they are actually static
|
2798
|
-
* and are accessible on the constructor instead of the prototype. Despite
|
2799
|
-
* being static, they must be defined outside of the "statics" key under
|
2800
|
-
* which all other static methods are defined.
|
2801
|
-
*/
|
2802
|
-
var RESERVED_SPEC_KEYS = {
|
2803
|
-
displayName: function(Constructor, displayName) {
|
2804
|
-
Constructor.displayName = displayName;
|
2805
|
-
},
|
2806
|
-
mixins: function(Constructor, mixins) {
|
2807
|
-
if (mixins) {
|
2808
|
-
for (var i = 0; i < mixins.length; i++) {
|
2809
|
-
mixSpecIntoComponent(Constructor, mixins[i]);
|
2810
|
-
}
|
2811
|
-
}
|
2812
|
-
},
|
2813
|
-
childContextTypes: function(Constructor, childContextTypes) {
|
2814
|
-
if ("development" !== 'production') {
|
2815
|
-
validateTypeDef(Constructor, childContextTypes, 'childContext');
|
2816
|
-
}
|
2817
|
-
Constructor.childContextTypes = _assign(
|
2818
|
-
{},
|
2819
|
-
Constructor.childContextTypes,
|
2820
|
-
childContextTypes
|
2821
|
-
);
|
2822
|
-
},
|
2823
|
-
contextTypes: function(Constructor, contextTypes) {
|
2824
|
-
if ("development" !== 'production') {
|
2825
|
-
validateTypeDef(Constructor, contextTypes, 'context');
|
2826
|
-
}
|
2827
|
-
Constructor.contextTypes = _assign(
|
2828
|
-
{},
|
2829
|
-
Constructor.contextTypes,
|
2830
|
-
contextTypes
|
2831
|
-
);
|
2832
|
-
},
|
2833
|
-
/**
|
2834
|
-
* Special case getDefaultProps which should move into statics but requires
|
2835
|
-
* automatic merging.
|
2836
|
-
*/
|
2837
|
-
getDefaultProps: function(Constructor, getDefaultProps) {
|
2838
|
-
if (Constructor.getDefaultProps) {
|
2839
|
-
Constructor.getDefaultProps = createMergedResultFunction(
|
2840
|
-
Constructor.getDefaultProps,
|
2841
|
-
getDefaultProps
|
2842
|
-
);
|
2843
|
-
} else {
|
2844
|
-
Constructor.getDefaultProps = getDefaultProps;
|
2845
|
-
}
|
2846
|
-
},
|
2847
|
-
propTypes: function(Constructor, propTypes) {
|
2848
|
-
if ("development" !== 'production') {
|
2849
|
-
validateTypeDef(Constructor, propTypes, 'prop');
|
2850
|
-
}
|
2851
|
-
Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes);
|
2852
|
-
},
|
2853
|
-
statics: function(Constructor, statics) {
|
2854
|
-
mixStaticSpecIntoComponent(Constructor, statics);
|
2855
|
-
},
|
2856
|
-
autobind: function() {}
|
2857
|
-
};
|
2858
|
-
|
2859
|
-
function validateTypeDef(Constructor, typeDef, location) {
|
2860
|
-
for (var propName in typeDef) {
|
2861
|
-
if (typeDef.hasOwnProperty(propName)) {
|
2862
|
-
// use a warning instead of an _invariant so components
|
2863
|
-
// don't show up in prod but only in __DEV__
|
2864
|
-
if ("development" !== 'production') {
|
2865
|
-
warning(
|
2866
|
-
typeof typeDef[propName] === 'function',
|
2867
|
-
'%s: %s type `%s` is invalid; it must be a function, usually from ' +
|
2868
|
-
'React.PropTypes.',
|
2869
|
-
Constructor.displayName || 'ReactClass',
|
2870
|
-
ReactPropTypeLocationNames[location],
|
2871
|
-
propName
|
2872
|
-
);
|
2873
|
-
}
|
2874
|
-
}
|
2875
|
-
}
|
2876
|
-
}
|
2877
|
-
|
2878
|
-
function validateMethodOverride(isAlreadyDefined, name) {
|
2879
|
-
var specPolicy = ReactClassInterface.hasOwnProperty(name)
|
2880
|
-
? ReactClassInterface[name]
|
2881
|
-
: null;
|
2882
|
-
|
2883
|
-
// Disallow overriding of base class methods unless explicitly allowed.
|
2884
|
-
if (ReactClassMixin.hasOwnProperty(name)) {
|
2885
|
-
_invariant(
|
2886
|
-
specPolicy === 'OVERRIDE_BASE',
|
2887
|
-
'ReactClassInterface: You are attempting to override ' +
|
2888
|
-
'`%s` from your class specification. Ensure that your method names ' +
|
2889
|
-
'do not overlap with React methods.',
|
2890
|
-
name
|
2891
|
-
);
|
2892
|
-
}
|
2893
|
-
|
2894
|
-
// Disallow defining methods more than once unless explicitly allowed.
|
2895
|
-
if (isAlreadyDefined) {
|
2896
|
-
_invariant(
|
2897
|
-
specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED',
|
2898
|
-
'ReactClassInterface: You are attempting to define ' +
|
2899
|
-
'`%s` on your component more than once. This conflict may be due ' +
|
2900
|
-
'to a mixin.',
|
2901
|
-
name
|
2902
|
-
);
|
2903
|
-
}
|
2904
|
-
}
|
2905
|
-
|
2906
|
-
/**
|
2907
|
-
* Mixin helper which handles policy validation and reserved
|
2908
|
-
* specification keys when building React classes.
|
2909
|
-
*/
|
2910
|
-
function mixSpecIntoComponent(Constructor, spec) {
|
2911
|
-
if (!spec) {
|
2912
|
-
if ("development" !== 'production') {
|
2913
|
-
var typeofSpec = typeof spec;
|
2914
|
-
var isMixinValid = typeofSpec === 'object' && spec !== null;
|
2915
|
-
|
2916
|
-
if ("development" !== 'production') {
|
2917
|
-
warning(
|
2918
|
-
isMixinValid,
|
2919
|
-
"%s: You're attempting to include a mixin that is either null " +
|
2920
|
-
'or not an object. Check the mixins included by the component, ' +
|
2921
|
-
'as well as any mixins they include themselves. ' +
|
2922
|
-
'Expected object but got %s.',
|
2923
|
-
Constructor.displayName || 'ReactClass',
|
2924
|
-
spec === null ? null : typeofSpec
|
2925
|
-
);
|
2926
|
-
}
|
2927
|
-
}
|
2928
|
-
|
2929
|
-
return;
|
2930
|
-
}
|
2931
|
-
|
2932
|
-
_invariant(
|
2933
|
-
typeof spec !== 'function',
|
2934
|
-
"ReactClass: You're attempting to " +
|
2935
|
-
'use a component class or function as a mixin. Instead, just use a ' +
|
2936
|
-
'regular object.'
|
2937
|
-
);
|
2938
|
-
_invariant(
|
2939
|
-
!isValidElement(spec),
|
2940
|
-
"ReactClass: You're attempting to " +
|
2941
|
-
'use a component as a mixin. Instead, just use a regular object.'
|
2942
|
-
);
|
2943
|
-
|
2944
|
-
var proto = Constructor.prototype;
|
2945
|
-
var autoBindPairs = proto.__reactAutoBindPairs;
|
2946
|
-
|
2947
|
-
// By handling mixins before any other properties, we ensure the same
|
2948
|
-
// chaining order is applied to methods with DEFINE_MANY policy, whether
|
2949
|
-
// mixins are listed before or after these methods in the spec.
|
2950
|
-
if (spec.hasOwnProperty(MIXINS_KEY)) {
|
2951
|
-
RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);
|
2952
|
-
}
|
2953
|
-
|
2954
|
-
for (var name in spec) {
|
2955
|
-
if (!spec.hasOwnProperty(name)) {
|
2956
|
-
continue;
|
2957
|
-
}
|
2958
|
-
|
2959
|
-
if (name === MIXINS_KEY) {
|
2960
|
-
// We have already handled mixins in a special case above.
|
2961
|
-
continue;
|
2962
|
-
}
|
2963
|
-
|
2964
|
-
var property = spec[name];
|
2965
|
-
var isAlreadyDefined = proto.hasOwnProperty(name);
|
2966
|
-
validateMethodOverride(isAlreadyDefined, name);
|
2967
|
-
|
2968
|
-
if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {
|
2969
|
-
RESERVED_SPEC_KEYS[name](Constructor, property);
|
2970
|
-
} else {
|
2971
|
-
// Setup methods on prototype:
|
2972
|
-
// The following member methods should not be automatically bound:
|
2973
|
-
// 1. Expected ReactClass methods (in the "interface").
|
2974
|
-
// 2. Overridden methods (that were mixed in).
|
2975
|
-
var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);
|
2976
|
-
var isFunction = typeof property === 'function';
|
2977
|
-
var shouldAutoBind =
|
2978
|
-
isFunction &&
|
2979
|
-
!isReactClassMethod &&
|
2980
|
-
!isAlreadyDefined &&
|
2981
|
-
spec.autobind !== false;
|
2982
|
-
|
2983
|
-
if (shouldAutoBind) {
|
2984
|
-
autoBindPairs.push(name, property);
|
2985
|
-
proto[name] = property;
|
2986
|
-
} else {
|
2987
|
-
if (isAlreadyDefined) {
|
2988
|
-
var specPolicy = ReactClassInterface[name];
|
2989
|
-
|
2990
|
-
// These cases should already be caught by validateMethodOverride.
|
2991
|
-
_invariant(
|
2992
|
-
isReactClassMethod &&
|
2993
|
-
(specPolicy === 'DEFINE_MANY_MERGED' ||
|
2994
|
-
specPolicy === 'DEFINE_MANY'),
|
2995
|
-
'ReactClass: Unexpected spec policy %s for key %s ' +
|
2996
|
-
'when mixing in component specs.',
|
2997
|
-
specPolicy,
|
2998
|
-
name
|
2999
|
-
);
|
3000
|
-
|
3001
|
-
// For methods which are defined more than once, call the existing
|
3002
|
-
// methods before calling the new property, merging if appropriate.
|
3003
|
-
if (specPolicy === 'DEFINE_MANY_MERGED') {
|
3004
|
-
proto[name] = createMergedResultFunction(proto[name], property);
|
3005
|
-
} else if (specPolicy === 'DEFINE_MANY') {
|
3006
|
-
proto[name] = createChainedFunction(proto[name], property);
|
3007
|
-
}
|
3008
|
-
} else {
|
3009
|
-
proto[name] = property;
|
3010
|
-
if ("development" !== 'production') {
|
3011
|
-
// Add verbose displayName to the function, which helps when looking
|
3012
|
-
// at profiling tools.
|
3013
|
-
if (typeof property === 'function' && spec.displayName) {
|
3014
|
-
proto[name].displayName = spec.displayName + '_' + name;
|
3015
|
-
}
|
3016
|
-
}
|
3017
|
-
}
|
3018
|
-
}
|
3019
|
-
}
|
3020
|
-
}
|
3021
|
-
}
|
3022
|
-
|
3023
|
-
function mixStaticSpecIntoComponent(Constructor, statics) {
|
3024
|
-
if (!statics) {
|
3025
|
-
return;
|
3026
|
-
}
|
3027
|
-
for (var name in statics) {
|
3028
|
-
var property = statics[name];
|
3029
|
-
if (!statics.hasOwnProperty(name)) {
|
3030
|
-
continue;
|
3031
|
-
}
|
3032
|
-
|
3033
|
-
var isReserved = name in RESERVED_SPEC_KEYS;
|
3034
|
-
_invariant(
|
3035
|
-
!isReserved,
|
3036
|
-
'ReactClass: You are attempting to define a reserved ' +
|
3037
|
-
'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' +
|
3038
|
-
'as an instance property instead; it will still be accessible on the ' +
|
3039
|
-
'constructor.',
|
3040
|
-
name
|
3041
|
-
);
|
3042
|
-
|
3043
|
-
var isInherited = name in Constructor;
|
3044
|
-
_invariant(
|
3045
|
-
!isInherited,
|
3046
|
-
'ReactClass: You are attempting to define ' +
|
3047
|
-
'`%s` on your component more than once. This conflict may be ' +
|
3048
|
-
'due to a mixin.',
|
3049
|
-
name
|
3050
|
-
);
|
3051
|
-
Constructor[name] = property;
|
3052
|
-
}
|
3053
|
-
}
|
3054
|
-
|
3055
|
-
/**
|
3056
|
-
* Merge two objects, but throw if both contain the same key.
|
3057
|
-
*
|
3058
|
-
* @param {object} one The first object, which is mutated.
|
3059
|
-
* @param {object} two The second object
|
3060
|
-
* @return {object} one after it has been mutated to contain everything in two.
|
3061
|
-
*/
|
3062
|
-
function mergeIntoWithNoDuplicateKeys(one, two) {
|
3063
|
-
_invariant(
|
3064
|
-
one && two && typeof one === 'object' && typeof two === 'object',
|
3065
|
-
'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.'
|
3066
|
-
);
|
3067
|
-
|
3068
|
-
for (var key in two) {
|
3069
|
-
if (two.hasOwnProperty(key)) {
|
3070
|
-
_invariant(
|
3071
|
-
one[key] === undefined,
|
3072
|
-
'mergeIntoWithNoDuplicateKeys(): ' +
|
3073
|
-
'Tried to merge two objects with the same key: `%s`. This conflict ' +
|
3074
|
-
'may be due to a mixin; in particular, this may be caused by two ' +
|
3075
|
-
'getInitialState() or getDefaultProps() methods returning objects ' +
|
3076
|
-
'with clashing keys.',
|
3077
|
-
key
|
3078
|
-
);
|
3079
|
-
one[key] = two[key];
|
3080
|
-
}
|
3081
|
-
}
|
3082
|
-
return one;
|
3083
|
-
}
|
3084
|
-
|
3085
|
-
/**
|
3086
|
-
* Creates a function that invokes two functions and merges their return values.
|
3087
|
-
*
|
3088
|
-
* @param {function} one Function to invoke first.
|
3089
|
-
* @param {function} two Function to invoke second.
|
3090
|
-
* @return {function} Function that invokes the two argument functions.
|
3091
|
-
* @private
|
3092
|
-
*/
|
3093
|
-
function createMergedResultFunction(one, two) {
|
3094
|
-
return function mergedResult() {
|
3095
|
-
var a = one.apply(this, arguments);
|
3096
|
-
var b = two.apply(this, arguments);
|
3097
|
-
if (a == null) {
|
3098
|
-
return b;
|
3099
|
-
} else if (b == null) {
|
3100
|
-
return a;
|
3101
|
-
}
|
3102
|
-
var c = {};
|
3103
|
-
mergeIntoWithNoDuplicateKeys(c, a);
|
3104
|
-
mergeIntoWithNoDuplicateKeys(c, b);
|
3105
|
-
return c;
|
3106
|
-
};
|
3107
|
-
}
|
3108
|
-
|
3109
|
-
/**
|
3110
|
-
* Creates a function that invokes two functions and ignores their return vales.
|
3111
|
-
*
|
3112
|
-
* @param {function} one Function to invoke first.
|
3113
|
-
* @param {function} two Function to invoke second.
|
3114
|
-
* @return {function} Function that invokes the two argument functions.
|
3115
|
-
* @private
|
3116
|
-
*/
|
3117
|
-
function createChainedFunction(one, two) {
|
3118
|
-
return function chainedFunction() {
|
3119
|
-
one.apply(this, arguments);
|
3120
|
-
two.apply(this, arguments);
|
3121
|
-
};
|
3122
|
-
}
|
3123
|
-
|
3124
|
-
/**
|
3125
|
-
* Binds a method to the component.
|
3126
|
-
*
|
3127
|
-
* @param {object} component Component whose method is going to be bound.
|
3128
|
-
* @param {function} method Method to be bound.
|
3129
|
-
* @return {function} The bound method.
|
3130
|
-
*/
|
3131
|
-
function bindAutoBindMethod(component, method) {
|
3132
|
-
var boundMethod = method.bind(component);
|
3133
|
-
if ("development" !== 'production') {
|
3134
|
-
boundMethod.__reactBoundContext = component;
|
3135
|
-
boundMethod.__reactBoundMethod = method;
|
3136
|
-
boundMethod.__reactBoundArguments = null;
|
3137
|
-
var componentName = component.constructor.displayName;
|
3138
|
-
var _bind = boundMethod.bind;
|
3139
|
-
boundMethod.bind = function(newThis) {
|
3140
|
-
for (
|
3141
|
-
var _len = arguments.length,
|
3142
|
-
args = Array(_len > 1 ? _len - 1 : 0),
|
3143
|
-
_key = 1;
|
3144
|
-
_key < _len;
|
3145
|
-
_key++
|
3146
|
-
) {
|
3147
|
-
args[_key - 1] = arguments[_key];
|
3148
|
-
}
|
3149
|
-
|
3150
|
-
// User is trying to bind() an autobound method; we effectively will
|
3151
|
-
// ignore the value of "this" that the user is trying to use, so
|
3152
|
-
// let's warn.
|
3153
|
-
if (newThis !== component && newThis !== null) {
|
3154
|
-
if ("development" !== 'production') {
|
3155
|
-
warning(
|
3156
|
-
false,
|
3157
|
-
'bind(): React component methods may only be bound to the ' +
|
3158
|
-
'component instance. See %s',
|
3159
|
-
componentName
|
3160
|
-
);
|
3161
|
-
}
|
3162
|
-
} else if (!args.length) {
|
3163
|
-
if ("development" !== 'production') {
|
3164
|
-
warning(
|
3165
|
-
false,
|
3166
|
-
'bind(): You are binding a component method to the component. ' +
|
3167
|
-
'React does this for you automatically in a high-performance ' +
|
3168
|
-
'way, so you can safely remove this call. See %s',
|
3169
|
-
componentName
|
3170
|
-
);
|
3171
|
-
}
|
3172
|
-
return boundMethod;
|
3173
|
-
}
|
3174
|
-
var reboundMethod = _bind.apply(boundMethod, arguments);
|
3175
|
-
reboundMethod.__reactBoundContext = component;
|
3176
|
-
reboundMethod.__reactBoundMethod = method;
|
3177
|
-
reboundMethod.__reactBoundArguments = args;
|
3178
|
-
return reboundMethod;
|
3179
|
-
};
|
3180
|
-
}
|
3181
|
-
return boundMethod;
|
3182
|
-
}
|
3183
|
-
|
3184
|
-
/**
|
3185
|
-
* Binds all auto-bound methods in a component.
|
3186
|
-
*
|
3187
|
-
* @param {object} component Component whose method is going to be bound.
|
3188
|
-
*/
|
3189
|
-
function bindAutoBindMethods(component) {
|
3190
|
-
var pairs = component.__reactAutoBindPairs;
|
3191
|
-
for (var i = 0; i < pairs.length; i += 2) {
|
3192
|
-
var autoBindKey = pairs[i];
|
3193
|
-
var method = pairs[i + 1];
|
3194
|
-
component[autoBindKey] = bindAutoBindMethod(component, method);
|
3195
|
-
}
|
3196
|
-
}
|
3197
|
-
|
3198
|
-
var IsMountedPreMixin = {
|
3199
|
-
componentDidMount: function() {
|
3200
|
-
this.__isMounted = true;
|
3201
|
-
}
|
3202
|
-
};
|
3203
|
-
|
3204
|
-
var IsMountedPostMixin = {
|
3205
|
-
componentWillUnmount: function() {
|
3206
|
-
this.__isMounted = false;
|
3207
|
-
}
|
3208
|
-
};
|
3209
|
-
|
3210
|
-
/**
|
3211
|
-
* Add more to the ReactClass base class. These are all legacy features and
|
3212
|
-
* therefore not already part of the modern ReactComponent.
|
3213
|
-
*/
|
3214
|
-
var ReactClassMixin = {
|
3215
|
-
/**
|
3216
|
-
* TODO: This will be deprecated because state should always keep a consistent
|
3217
|
-
* type signature and the only use case for this, is to avoid that.
|
3218
|
-
*/
|
3219
|
-
replaceState: function(newState, callback) {
|
3220
|
-
this.updater.enqueueReplaceState(this, newState, callback);
|
3221
|
-
},
|
3222
|
-
|
3223
|
-
/**
|
3224
|
-
* Checks whether or not this composite component is mounted.
|
3225
|
-
* @return {boolean} True if mounted, false otherwise.
|
3226
|
-
* @protected
|
3227
|
-
* @final
|
3228
|
-
*/
|
3229
|
-
isMounted: function() {
|
3230
|
-
if ("development" !== 'production') {
|
3231
|
-
warning(
|
3232
|
-
this.__didWarnIsMounted,
|
3233
|
-
'%s: isMounted is deprecated. Instead, make sure to clean up ' +
|
3234
|
-
'subscriptions and pending requests in componentWillUnmount to ' +
|
3235
|
-
'prevent memory leaks.',
|
3236
|
-
(this.constructor && this.constructor.displayName) ||
|
3237
|
-
this.name ||
|
3238
|
-
'Component'
|
3239
|
-
);
|
3240
|
-
this.__didWarnIsMounted = true;
|
3241
|
-
}
|
3242
|
-
return !!this.__isMounted;
|
3243
|
-
}
|
3244
|
-
};
|
3245
|
-
|
3246
|
-
var ReactClassComponent = function() {};
|
3247
|
-
_assign(
|
3248
|
-
ReactClassComponent.prototype,
|
3249
|
-
ReactComponent.prototype,
|
3250
|
-
ReactClassMixin
|
3251
|
-
);
|
3252
|
-
|
3253
|
-
/**
|
3254
|
-
* Creates a composite component class given a class specification.
|
3255
|
-
* See https://facebook.github.io/react/docs/top-level-api.html#react.createclass
|
3256
|
-
*
|
3257
|
-
* @param {object} spec Class specification (which must define `render`).
|
3258
|
-
* @return {function} Component constructor function.
|
3259
|
-
* @public
|
3260
|
-
*/
|
3261
|
-
function createClass(spec) {
|
3262
|
-
// To keep our warnings more understandable, we'll use a little hack here to
|
3263
|
-
// ensure that Constructor.name !== 'Constructor'. This makes sure we don't
|
3264
|
-
// unnecessarily identify a class without displayName as 'Constructor'.
|
3265
|
-
var Constructor = identity(function(props, context, updater) {
|
3266
|
-
// This constructor gets overridden by mocks. The argument is used
|
3267
|
-
// by mocks to assert on what gets mounted.
|
3268
|
-
|
3269
|
-
if ("development" !== 'production') {
|
3270
|
-
warning(
|
3271
|
-
this instanceof Constructor,
|
3272
|
-
'Something is calling a React component directly. Use a factory or ' +
|
3273
|
-
'JSX instead. See: https://fb.me/react-legacyfactory'
|
3274
|
-
);
|
3275
|
-
}
|
3276
|
-
|
3277
|
-
// Wire up auto-binding
|
3278
|
-
if (this.__reactAutoBindPairs.length) {
|
3279
|
-
bindAutoBindMethods(this);
|
3280
|
-
}
|
3281
|
-
|
3282
|
-
this.props = props;
|
3283
|
-
this.context = context;
|
3284
|
-
this.refs = emptyObject;
|
3285
|
-
this.updater = updater || ReactNoopUpdateQueue;
|
3286
|
-
|
3287
|
-
this.state = null;
|
3288
|
-
|
3289
|
-
// ReactClasses doesn't have constructors. Instead, they use the
|
3290
|
-
// getInitialState and componentWillMount methods for initialization.
|
3291
|
-
|
3292
|
-
var initialState = this.getInitialState ? this.getInitialState() : null;
|
3293
|
-
if ("development" !== 'production') {
|
3294
|
-
// We allow auto-mocks to proceed as if they're returning null.
|
3295
|
-
if (
|
3296
|
-
initialState === undefined &&
|
3297
|
-
this.getInitialState._isMockFunction
|
3298
|
-
) {
|
3299
|
-
// This is probably bad practice. Consider warning here and
|
3300
|
-
// deprecating this convenience.
|
3301
|
-
initialState = null;
|
3302
|
-
}
|
3303
|
-
}
|
3304
|
-
_invariant(
|
3305
|
-
typeof initialState === 'object' && !Array.isArray(initialState),
|
3306
|
-
'%s.getInitialState(): must return an object or null',
|
3307
|
-
Constructor.displayName || 'ReactCompositeComponent'
|
3308
|
-
);
|
3309
|
-
|
3310
|
-
this.state = initialState;
|
3311
|
-
});
|
3312
|
-
Constructor.prototype = new ReactClassComponent();
|
3313
|
-
Constructor.prototype.constructor = Constructor;
|
3314
|
-
Constructor.prototype.__reactAutoBindPairs = [];
|
3315
|
-
|
3316
|
-
injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor));
|
3317
|
-
|
3318
|
-
mixSpecIntoComponent(Constructor, IsMountedPreMixin);
|
3319
|
-
mixSpecIntoComponent(Constructor, spec);
|
3320
|
-
mixSpecIntoComponent(Constructor, IsMountedPostMixin);
|
3321
|
-
|
3322
|
-
// Initialize the defaultProps property after all mixins have been merged.
|
3323
|
-
if (Constructor.getDefaultProps) {
|
3324
|
-
Constructor.defaultProps = Constructor.getDefaultProps();
|
3325
|
-
}
|
3326
|
-
|
3327
|
-
if ("development" !== 'production') {
|
3328
|
-
// This is a tag to indicate that the use of these method names is ok,
|
3329
|
-
// since it's used with createClass. If it's not, then it's likely a
|
3330
|
-
// mistake so we'll warn you to use the static property, property
|
3331
|
-
// initializer or constructor respectively.
|
3332
|
-
if (Constructor.getDefaultProps) {
|
3333
|
-
Constructor.getDefaultProps.isReactClassApproved = {};
|
3334
|
-
}
|
3335
|
-
if (Constructor.prototype.getInitialState) {
|
3336
|
-
Constructor.prototype.getInitialState.isReactClassApproved = {};
|
3337
|
-
}
|
3338
|
-
}
|
3339
|
-
|
3340
|
-
_invariant(
|
3341
|
-
Constructor.prototype.render,
|
3342
|
-
'createClass(...): Class specification must implement a `render` method.'
|
3343
|
-
);
|
3344
|
-
|
3345
|
-
if ("development" !== 'production') {
|
3346
|
-
warning(
|
3347
|
-
!Constructor.prototype.componentShouldUpdate,
|
3348
|
-
'%s has a method called ' +
|
3349
|
-
'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' +
|
3350
|
-
'The name is phrased as a question because the function is ' +
|
3351
|
-
'expected to return a value.',
|
3352
|
-
spec.displayName || 'A component'
|
3353
|
-
);
|
3354
|
-
warning(
|
3355
|
-
!Constructor.prototype.componentWillRecieveProps,
|
3356
|
-
'%s has a method called ' +
|
3357
|
-
'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?',
|
3358
|
-
spec.displayName || 'A component'
|
3359
|
-
);
|
3360
|
-
}
|
3361
|
-
|
3362
|
-
// Reduce time spent doing lookups by setting these on the prototype.
|
3363
|
-
for (var methodName in ReactClassInterface) {
|
3364
|
-
if (!Constructor.prototype[methodName]) {
|
3365
|
-
Constructor.prototype[methodName] = null;
|
3366
|
-
}
|
3367
|
-
}
|
3368
|
-
|
3369
|
-
return Constructor;
|
3370
|
-
}
|
3371
|
-
|
3372
|
-
return createClass;
|
3373
|
-
}
|
3374
|
-
|
3375
|
-
module.exports = factory;
|
3376
|
-
|
3377
|
-
},{"29":29,"30":30,"31":31,"32":32}],28:[function(_dereq_,module,exports){
|
3378
|
-
"use strict";
|
3379
|
-
|
3380
|
-
/**
|
3381
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
3382
|
-
* All rights reserved.
|
3383
|
-
*
|
3384
|
-
* This source code is licensed under the BSD-style license found in the
|
3385
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
3386
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
3387
|
-
*
|
3388
|
-
*
|
3389
|
-
*/
|
3390
|
-
|
3391
|
-
function makeEmptyFunction(arg) {
|
3392
|
-
return function () {
|
3393
|
-
return arg;
|
3394
|
-
};
|
3395
|
-
}
|
3396
|
-
|
3397
|
-
/**
|
3398
|
-
* This function accepts and discards inputs; it has no side effects. This is
|
3399
|
-
* primarily useful idiomatically for overridable function endpoints which
|
3400
|
-
* always need to be callable, since JS lacks a null-call idiom ala Cocoa.
|
3401
|
-
*/
|
3402
|
-
var emptyFunction = function emptyFunction() {};
|
3403
|
-
|
3404
|
-
emptyFunction.thatReturns = makeEmptyFunction;
|
3405
|
-
emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
|
3406
|
-
emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
|
3407
|
-
emptyFunction.thatReturnsNull = makeEmptyFunction(null);
|
3408
|
-
emptyFunction.thatReturnsThis = function () {
|
3409
|
-
return this;
|
3410
|
-
};
|
3411
|
-
emptyFunction.thatReturnsArgument = function (arg) {
|
3412
|
-
return arg;
|
3413
|
-
};
|
3414
|
-
|
3415
|
-
module.exports = emptyFunction;
|
3416
|
-
},{}],29:[function(_dereq_,module,exports){
|
3417
|
-
/**
|
3418
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
3419
|
-
* All rights reserved.
|
3420
|
-
*
|
3421
|
-
* This source code is licensed under the BSD-style license found in the
|
3422
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
3423
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
3424
|
-
*
|
3425
|
-
*/
|
3426
|
-
|
3427
|
-
'use strict';
|
3428
|
-
|
3429
|
-
var emptyObject = {};
|
3430
|
-
|
3431
|
-
if ("development" !== 'production') {
|
3432
|
-
Object.freeze(emptyObject);
|
3433
|
-
}
|
3434
|
-
|
3435
|
-
module.exports = emptyObject;
|
3436
|
-
},{}],30:[function(_dereq_,module,exports){
|
3437
|
-
/**
|
3438
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
3439
|
-
* All rights reserved.
|
3440
|
-
*
|
3441
|
-
* This source code is licensed under the BSD-style license found in the
|
3442
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
3443
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
3444
|
-
*
|
3445
|
-
*/
|
3446
|
-
|
3447
|
-
'use strict';
|
3448
|
-
|
3449
|
-
/**
|
3450
|
-
* Use invariant() to assert state which your program assumes to be true.
|
3451
|
-
*
|
3452
|
-
* Provide sprintf-style format (only %s is supported) and arguments
|
3453
|
-
* to provide information about what broke and what you were
|
3454
|
-
* expecting.
|
3455
|
-
*
|
3456
|
-
* The invariant message will be stripped in production, but the invariant
|
3457
|
-
* will remain to ensure logic does not differ in production.
|
3458
|
-
*/
|
3459
|
-
|
3460
|
-
var validateFormat = function validateFormat(format) {};
|
3461
|
-
|
3462
|
-
if ("development" !== 'production') {
|
3463
|
-
validateFormat = function validateFormat(format) {
|
3464
|
-
if (format === undefined) {
|
3465
|
-
throw new Error('invariant requires an error message argument');
|
3466
|
-
}
|
3467
|
-
};
|
3468
|
-
}
|
3469
|
-
|
3470
|
-
function invariant(condition, format, a, b, c, d, e, f) {
|
3471
|
-
validateFormat(format);
|
3472
|
-
|
3473
|
-
if (!condition) {
|
3474
|
-
var error;
|
3475
|
-
if (format === undefined) {
|
3476
|
-
error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
|
3477
|
-
} else {
|
3478
|
-
var args = [a, b, c, d, e, f];
|
3479
|
-
var argIndex = 0;
|
3480
|
-
error = new Error(format.replace(/%s/g, function () {
|
3481
|
-
return args[argIndex++];
|
3482
|
-
}));
|
3483
|
-
error.name = 'Invariant Violation';
|
3484
|
-
}
|
3485
|
-
|
3486
|
-
error.framesToPop = 1; // we don't care about invariant's own frame
|
3487
|
-
throw error;
|
3488
|
-
}
|
3489
|
-
}
|
3490
|
-
|
3491
|
-
module.exports = invariant;
|
3492
|
-
},{}],31:[function(_dereq_,module,exports){
|
3493
|
-
/**
|
3494
|
-
* Copyright 2014-2015, Facebook, Inc.
|
3495
|
-
* All rights reserved.
|
3496
|
-
*
|
3497
|
-
* This source code is licensed under the BSD-style license found in the
|
3498
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
3499
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
3500
|
-
*
|
3501
|
-
*/
|
3502
|
-
|
3503
|
-
'use strict';
|
3504
|
-
|
3505
|
-
var emptyFunction = _dereq_(28);
|
3506
|
-
|
3507
|
-
/**
|
3508
|
-
* Similar to invariant but only logs a warning if the condition is not met.
|
3509
|
-
* This can be used to log issues in development environments in critical
|
3510
|
-
* paths. Removing the logging code for production environments will keep the
|
3511
|
-
* same logic and follow the same code paths.
|
3512
|
-
*/
|
3513
|
-
|
3514
|
-
var warning = emptyFunction;
|
3515
|
-
|
3516
|
-
if ("development" !== 'production') {
|
3517
|
-
(function () {
|
3518
|
-
var printWarning = function printWarning(format) {
|
3519
|
-
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
3520
|
-
args[_key - 1] = arguments[_key];
|
3521
|
-
}
|
3522
|
-
|
3523
|
-
var argIndex = 0;
|
3524
|
-
var message = 'Warning: ' + format.replace(/%s/g, function () {
|
3525
|
-
return args[argIndex++];
|
3526
|
-
});
|
3527
|
-
if (typeof console !== 'undefined') {
|
3528
|
-
console.error(message);
|
3529
|
-
}
|
3530
|
-
try {
|
3531
|
-
// --- Welcome to debugging React ---
|
3532
|
-
// This error was thrown as a convenience so that you can use this stack
|
3533
|
-
// to find the callsite that caused this warning to fire.
|
3534
|
-
throw new Error(message);
|
3535
|
-
} catch (x) {}
|
3536
|
-
};
|
3537
|
-
|
3538
|
-
warning = function warning(condition, format) {
|
3539
|
-
if (format === undefined) {
|
3540
|
-
throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
|
3541
|
-
}
|
3542
|
-
|
3543
|
-
if (format.indexOf('Failed Composite propType: ') === 0) {
|
3544
|
-
return; // Ignore CompositeComponent proptype check.
|
3545
|
-
}
|
3546
|
-
|
3547
|
-
if (!condition) {
|
3548
|
-
for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
3549
|
-
args[_key2 - 2] = arguments[_key2];
|
3550
|
-
}
|
3551
|
-
|
3552
|
-
printWarning.apply(undefined, [format].concat(args));
|
3553
|
-
}
|
3554
|
-
};
|
3555
|
-
})();
|
3556
|
-
}
|
3557
|
-
|
3558
|
-
module.exports = warning;
|
3559
|
-
},{"28":28}],32:[function(_dereq_,module,exports){
|
3560
|
-
/*
|
3561
|
-
object-assign
|
3562
|
-
(c) Sindre Sorhus
|
3563
|
-
@license MIT
|
3564
|
-
*/
|
3565
|
-
|
3566
|
-
'use strict';
|
3567
|
-
/* eslint-disable no-unused-vars */
|
3568
|
-
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
3569
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
3570
|
-
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
3571
|
-
|
3572
|
-
function toObject(val) {
|
3573
|
-
if (val === null || val === undefined) {
|
3574
|
-
throw new TypeError('Object.assign cannot be called with null or undefined');
|
3575
|
-
}
|
3576
|
-
|
3577
|
-
return Object(val);
|
3578
|
-
}
|
3579
|
-
|
3580
|
-
function shouldUseNative() {
|
3581
|
-
try {
|
3582
|
-
if (!Object.assign) {
|
3583
|
-
return false;
|
3584
|
-
}
|
3585
|
-
|
3586
|
-
// Detect buggy property enumeration order in older V8 versions.
|
3587
|
-
|
3588
|
-
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
|
3589
|
-
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
|
3590
|
-
test1[5] = 'de';
|
3591
|
-
if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
3592
|
-
return false;
|
3593
|
-
}
|
3594
|
-
|
3595
|
-
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
3596
|
-
var test2 = {};
|
3597
|
-
for (var i = 0; i < 10; i++) {
|
3598
|
-
test2['_' + String.fromCharCode(i)] = i;
|
3599
|
-
}
|
3600
|
-
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
|
3601
|
-
return test2[n];
|
3602
|
-
});
|
3603
|
-
if (order2.join('') !== '0123456789') {
|
3604
|
-
return false;
|
3605
|
-
}
|
3606
|
-
|
3607
|
-
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
3608
|
-
var test3 = {};
|
3609
|
-
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
|
3610
|
-
test3[letter] = letter;
|
3611
|
-
});
|
3612
|
-
if (Object.keys(Object.assign({}, test3)).join('') !==
|
3613
|
-
'abcdefghijklmnopqrst') {
|
3614
|
-
return false;
|
3615
|
-
}
|
3616
|
-
|
3617
|
-
return true;
|
3618
|
-
} catch (err) {
|
3619
|
-
// We don't expect any of the above to throw, but better to be safe.
|
3620
|
-
return false;
|
3621
|
-
}
|
3622
|
-
}
|
3623
|
-
|
3624
|
-
module.exports = shouldUseNative() ? Object.assign : function (target, source) {
|
3625
|
-
var from;
|
3626
|
-
var to = toObject(target);
|
3627
|
-
var symbols;
|
3628
|
-
|
3629
|
-
for (var s = 1; s < arguments.length; s++) {
|
3630
|
-
from = Object(arguments[s]);
|
3631
|
-
|
3632
|
-
for (var key in from) {
|
3633
|
-
if (hasOwnProperty.call(from, key)) {
|
3634
|
-
to[key] = from[key];
|
3635
|
-
}
|
3636
|
-
}
|
3637
|
-
|
3638
|
-
if (getOwnPropertySymbols) {
|
3639
|
-
symbols = getOwnPropertySymbols(from);
|
3640
|
-
for (var i = 0; i < symbols.length; i++) {
|
3641
|
-
if (propIsEnumerable.call(from, symbols[i])) {
|
3642
|
-
to[symbols[i]] = from[symbols[i]];
|
3643
|
-
}
|
3644
|
-
}
|
3645
|
-
}
|
3646
|
-
}
|
3647
|
-
|
3648
|
-
return to;
|
3649
|
-
};
|
3650
|
-
|
3651
|
-
},{}],33:[function(_dereq_,module,exports){
|
3652
|
-
/**
|
3653
|
-
* Copyright 2013-present, Facebook, Inc.
|
3654
|
-
* All rights reserved.
|
3655
|
-
*
|
3656
|
-
* This source code is licensed under the BSD-style license found in the
|
3657
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
3658
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
3659
|
-
*/
|
3660
|
-
|
3661
|
-
'use strict';
|
3662
|
-
|
3663
|
-
if ("development" !== 'production') {
|
3664
|
-
var invariant = _dereq_(30);
|
3665
|
-
var warning = _dereq_(31);
|
3666
|
-
var ReactPropTypesSecret = _dereq_(36);
|
3667
|
-
var loggedTypeFailures = {};
|
3668
|
-
}
|
3669
|
-
|
3670
|
-
/**
|
3671
|
-
* Assert that the values match with the type specs.
|
3672
|
-
* Error messages are memorized and will only be shown once.
|
3673
|
-
*
|
3674
|
-
* @param {object} typeSpecs Map of name to a ReactPropType
|
3675
|
-
* @param {object} values Runtime values that need to be type-checked
|
3676
|
-
* @param {string} location e.g. "prop", "context", "child context"
|
3677
|
-
* @param {string} componentName Name of the component for error messages.
|
3678
|
-
* @param {?Function} getStack Returns the component stack.
|
3679
|
-
* @private
|
3680
|
-
*/
|
3681
|
-
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
3682
|
-
if ("development" !== 'production') {
|
3683
|
-
for (var typeSpecName in typeSpecs) {
|
3684
|
-
if (typeSpecs.hasOwnProperty(typeSpecName)) {
|
3685
|
-
var error;
|
3686
|
-
// Prop type validation may throw. In case they do, we don't want to
|
3687
|
-
// fail the render phase where it didn't fail before. So we log it.
|
3688
|
-
// After these have been cleaned up, we'll let them throw.
|
3689
|
-
try {
|
3690
|
-
// This is intentionally an invariant that gets caught. It's the same
|
3691
|
-
// behavior as without this statement except with a better message.
|
3692
|
-
invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', location, typeSpecName);
|
3693
|
-
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
|
3694
|
-
} catch (ex) {
|
3695
|
-
error = ex;
|
3696
|
-
}
|
3697
|
-
warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error);
|
3698
|
-
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
3699
|
-
// Only monitor this failure once because there tends to be a lot of the
|
3700
|
-
// same error.
|
3701
|
-
loggedTypeFailures[error.message] = true;
|
3702
|
-
|
3703
|
-
var stack = getStack ? getStack() : '';
|
3704
|
-
|
3705
|
-
warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');
|
3706
|
-
}
|
3707
|
-
}
|
3708
|
-
}
|
3709
|
-
}
|
3710
|
-
}
|
3711
|
-
|
3712
|
-
module.exports = checkPropTypes;
|
3713
|
-
|
3714
|
-
},{"30":30,"31":31,"36":36}],34:[function(_dereq_,module,exports){
|
3715
|
-
/**
|
3716
|
-
* Copyright 2013-present, Facebook, Inc.
|
3717
|
-
* All rights reserved.
|
3718
|
-
*
|
3719
|
-
* This source code is licensed under the BSD-style license found in the
|
3720
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
3721
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
3722
|
-
*/
|
3723
|
-
|
3724
|
-
'use strict';
|
3725
|
-
|
3726
|
-
// React 15.5 references this module, and assumes PropTypes are still callable in production.
|
3727
|
-
// Therefore we re-export development-only version with all the PropTypes checks here.
|
3728
|
-
// However if one is migrating to the `prop-types` npm library, they will go through the
|
3729
|
-
// `index.js` entry point, and it will branch depending on the environment.
|
3730
|
-
var factory = _dereq_(35);
|
3731
|
-
module.exports = function(isValidElement) {
|
3732
|
-
// It is still allowed in 15.5.
|
3733
|
-
var throwOnDirectAccess = false;
|
3734
|
-
return factory(isValidElement, throwOnDirectAccess);
|
3735
|
-
};
|
3736
|
-
|
3737
|
-
},{"35":35}],35:[function(_dereq_,module,exports){
|
3738
|
-
/**
|
3739
|
-
* Copyright 2013-present, Facebook, Inc.
|
3740
|
-
* All rights reserved.
|
3741
|
-
*
|
3742
|
-
* This source code is licensed under the BSD-style license found in the
|
3743
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
3744
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
3745
|
-
*/
|
3746
|
-
|
3747
|
-
'use strict';
|
3748
|
-
|
3749
|
-
var emptyFunction = _dereq_(28);
|
3750
|
-
var invariant = _dereq_(30);
|
3751
|
-
var warning = _dereq_(31);
|
3752
|
-
|
3753
|
-
var ReactPropTypesSecret = _dereq_(36);
|
3754
|
-
var checkPropTypes = _dereq_(33);
|
3755
|
-
|
3756
|
-
module.exports = function(isValidElement, throwOnDirectAccess) {
|
3757
|
-
/* global Symbol */
|
3758
|
-
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
3759
|
-
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
|
3760
|
-
|
3761
|
-
/**
|
3762
|
-
* Returns the iterator method function contained on the iterable object.
|
3763
|
-
*
|
3764
|
-
* Be sure to invoke the function with the iterable as context:
|
3765
|
-
*
|
3766
|
-
* var iteratorFn = getIteratorFn(myIterable);
|
3767
|
-
* if (iteratorFn) {
|
3768
|
-
* var iterator = iteratorFn.call(myIterable);
|
3769
|
-
* ...
|
3770
|
-
* }
|
3771
|
-
*
|
3772
|
-
* @param {?object} maybeIterable
|
3773
|
-
* @return {?function}
|
3774
|
-
*/
|
3775
|
-
function getIteratorFn(maybeIterable) {
|
3776
|
-
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
3777
|
-
if (typeof iteratorFn === 'function') {
|
3778
|
-
return iteratorFn;
|
3779
|
-
}
|
3780
|
-
}
|
3781
|
-
|
3782
|
-
/**
|
3783
|
-
* Collection of methods that allow declaration and validation of props that are
|
3784
|
-
* supplied to React components. Example usage:
|
3785
|
-
*
|
3786
|
-
* var Props = require('ReactPropTypes');
|
3787
|
-
* var MyArticle = React.createClass({
|
3788
|
-
* propTypes: {
|
3789
|
-
* // An optional string prop named "description".
|
3790
|
-
* description: Props.string,
|
3791
|
-
*
|
3792
|
-
* // A required enum prop named "category".
|
3793
|
-
* category: Props.oneOf(['News','Photos']).isRequired,
|
3794
|
-
*
|
3795
|
-
* // A prop named "dialog" that requires an instance of Dialog.
|
3796
|
-
* dialog: Props.instanceOf(Dialog).isRequired
|
3797
|
-
* },
|
3798
|
-
* render: function() { ... }
|
3799
|
-
* });
|
3800
|
-
*
|
3801
|
-
* A more formal specification of how these methods are used:
|
3802
|
-
*
|
3803
|
-
* type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
|
3804
|
-
* decl := ReactPropTypes.{type}(.isRequired)?
|
3805
|
-
*
|
3806
|
-
* Each and every declaration produces a function with the same signature. This
|
3807
|
-
* allows the creation of custom validation functions. For example:
|
3808
|
-
*
|
3809
|
-
* var MyLink = React.createClass({
|
3810
|
-
* propTypes: {
|
3811
|
-
* // An optional string or URI prop named "href".
|
3812
|
-
* href: function(props, propName, componentName) {
|
3813
|
-
* var propValue = props[propName];
|
3814
|
-
* if (propValue != null && typeof propValue !== 'string' &&
|
3815
|
-
* !(propValue instanceof URI)) {
|
3816
|
-
* return new Error(
|
3817
|
-
* 'Expected a string or an URI for ' + propName + ' in ' +
|
3818
|
-
* componentName
|
3819
|
-
* );
|
3820
|
-
* }
|
3821
|
-
* }
|
3822
|
-
* },
|
3823
|
-
* render: function() {...}
|
3824
|
-
* });
|
3825
|
-
*
|
3826
|
-
* @internal
|
3827
|
-
*/
|
3828
|
-
|
3829
|
-
var ANONYMOUS = '<<anonymous>>';
|
3830
|
-
|
3831
|
-
// Important!
|
3832
|
-
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
|
3833
|
-
var ReactPropTypes = {
|
3834
|
-
array: createPrimitiveTypeChecker('array'),
|
3835
|
-
bool: createPrimitiveTypeChecker('boolean'),
|
3836
|
-
func: createPrimitiveTypeChecker('function'),
|
3837
|
-
number: createPrimitiveTypeChecker('number'),
|
3838
|
-
object: createPrimitiveTypeChecker('object'),
|
3839
|
-
string: createPrimitiveTypeChecker('string'),
|
3840
|
-
symbol: createPrimitiveTypeChecker('symbol'),
|
3841
|
-
|
3842
|
-
any: createAnyTypeChecker(),
|
3843
|
-
arrayOf: createArrayOfTypeChecker,
|
3844
|
-
element: createElementTypeChecker(),
|
3845
|
-
instanceOf: createInstanceTypeChecker,
|
3846
|
-
node: createNodeChecker(),
|
3847
|
-
objectOf: createObjectOfTypeChecker,
|
3848
|
-
oneOf: createEnumTypeChecker,
|
3849
|
-
oneOfType: createUnionTypeChecker,
|
3850
|
-
shape: createShapeTypeChecker
|
3851
|
-
};
|
3852
|
-
|
3853
|
-
/**
|
3854
|
-
* inlined Object.is polyfill to avoid requiring consumers ship their own
|
3855
|
-
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
3856
|
-
*/
|
3857
|
-
/*eslint-disable no-self-compare*/
|
3858
|
-
function is(x, y) {
|
3859
|
-
// SameValue algorithm
|
3860
|
-
if (x === y) {
|
3861
|
-
// Steps 1-5, 7-10
|
3862
|
-
// Steps 6.b-6.e: +0 != -0
|
3863
|
-
return x !== 0 || 1 / x === 1 / y;
|
3864
|
-
} else {
|
3865
|
-
// Step 6.a: NaN == NaN
|
3866
|
-
return x !== x && y !== y;
|
3867
|
-
}
|
3868
|
-
}
|
3869
|
-
/*eslint-enable no-self-compare*/
|
3870
|
-
|
3871
|
-
/**
|
3872
|
-
* We use an Error-like object for backward compatibility as people may call
|
3873
|
-
* PropTypes directly and inspect their output. However, we don't use real
|
3874
|
-
* Errors anymore. We don't inspect their stack anyway, and creating them
|
3875
|
-
* is prohibitively expensive if they are created too often, such as what
|
3876
|
-
* happens in oneOfType() for any type before the one that matched.
|
3877
|
-
*/
|
3878
|
-
function PropTypeError(message) {
|
3879
|
-
this.message = message;
|
3880
|
-
this.stack = '';
|
3881
|
-
}
|
3882
|
-
// Make `instanceof Error` still work for returned errors.
|
3883
|
-
PropTypeError.prototype = Error.prototype;
|
3884
|
-
|
3885
|
-
function createChainableTypeChecker(validate) {
|
3886
|
-
if ("development" !== 'production') {
|
3887
|
-
var manualPropTypeCallCache = {};
|
3888
|
-
var manualPropTypeWarningCount = 0;
|
3889
|
-
}
|
3890
|
-
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
3891
|
-
componentName = componentName || ANONYMOUS;
|
3892
|
-
propFullName = propFullName || propName;
|
3893
|
-
|
3894
|
-
if (secret !== ReactPropTypesSecret) {
|
3895
|
-
if (throwOnDirectAccess) {
|
3896
|
-
// New behavior only for users of `prop-types` package
|
3897
|
-
invariant(
|
3898
|
-
false,
|
3899
|
-
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
3900
|
-
'Use `PropTypes.checkPropTypes()` to call them. ' +
|
3901
|
-
'Read more at http://fb.me/use-check-prop-types'
|
3902
|
-
);
|
3903
|
-
} else if ("development" !== 'production' && typeof console !== 'undefined') {
|
3904
|
-
// Old behavior for people using React.PropTypes
|
3905
|
-
var cacheKey = componentName + ':' + propName;
|
3906
|
-
if (
|
3907
|
-
!manualPropTypeCallCache[cacheKey] &&
|
3908
|
-
// Avoid spamming the console because they are often not actionable except for lib authors
|
3909
|
-
manualPropTypeWarningCount < 3
|
3910
|
-
) {
|
3911
|
-
warning(
|
3912
|
-
false,
|
3913
|
-
'You are manually calling a React.PropTypes validation ' +
|
3914
|
-
'function for the `%s` prop on `%s`. This is deprecated ' +
|
3915
|
-
'and will throw in the standalone `prop-types` package. ' +
|
3916
|
-
'You may be seeing this warning due to a third-party PropTypes ' +
|
3917
|
-
'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.',
|
3918
|
-
propFullName,
|
3919
|
-
componentName
|
3920
|
-
);
|
3921
|
-
manualPropTypeCallCache[cacheKey] = true;
|
3922
|
-
manualPropTypeWarningCount++;
|
3923
|
-
}
|
3924
|
-
}
|
3925
|
-
}
|
3926
|
-
if (props[propName] == null) {
|
3927
|
-
if (isRequired) {
|
3928
|
-
if (props[propName] === null) {
|
3929
|
-
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
|
3930
|
-
}
|
3931
|
-
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
|
3932
|
-
}
|
3933
|
-
return null;
|
3934
|
-
} else {
|
3935
|
-
return validate(props, propName, componentName, location, propFullName);
|
3936
|
-
}
|
3937
|
-
}
|
3938
|
-
|
3939
|
-
var chainedCheckType = checkType.bind(null, false);
|
3940
|
-
chainedCheckType.isRequired = checkType.bind(null, true);
|
3941
|
-
|
3942
|
-
return chainedCheckType;
|
3943
|
-
}
|
3944
|
-
|
3945
|
-
function createPrimitiveTypeChecker(expectedType) {
|
3946
|
-
function validate(props, propName, componentName, location, propFullName, secret) {
|
3947
|
-
var propValue = props[propName];
|
3948
|
-
var propType = getPropType(propValue);
|
3949
|
-
if (propType !== expectedType) {
|
3950
|
-
// `propValue` being instance of, say, date/regexp, pass the 'object'
|
3951
|
-
// check, but we can offer a more precise error message here rather than
|
3952
|
-
// 'of type `object`'.
|
3953
|
-
var preciseType = getPreciseType(propValue);
|
3954
|
-
|
3955
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
|
3956
|
-
}
|
3957
|
-
return null;
|
3958
|
-
}
|
3959
|
-
return createChainableTypeChecker(validate);
|
3960
|
-
}
|
3961
|
-
|
3962
|
-
function createAnyTypeChecker() {
|
3963
|
-
return createChainableTypeChecker(emptyFunction.thatReturnsNull);
|
3964
|
-
}
|
3965
|
-
|
3966
|
-
function createArrayOfTypeChecker(typeChecker) {
|
3967
|
-
function validate(props, propName, componentName, location, propFullName) {
|
3968
|
-
if (typeof typeChecker !== 'function') {
|
3969
|
-
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
|
3970
|
-
}
|
3971
|
-
var propValue = props[propName];
|
3972
|
-
if (!Array.isArray(propValue)) {
|
3973
|
-
var propType = getPropType(propValue);
|
3974
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
|
3975
|
-
}
|
3976
|
-
for (var i = 0; i < propValue.length; i++) {
|
3977
|
-
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
|
3978
|
-
if (error instanceof Error) {
|
3979
|
-
return error;
|
3980
|
-
}
|
3981
|
-
}
|
3982
|
-
return null;
|
3983
|
-
}
|
3984
|
-
return createChainableTypeChecker(validate);
|
3985
|
-
}
|
3986
|
-
|
3987
|
-
function createElementTypeChecker() {
|
3988
|
-
function validate(props, propName, componentName, location, propFullName) {
|
3989
|
-
var propValue = props[propName];
|
3990
|
-
if (!isValidElement(propValue)) {
|
3991
|
-
var propType = getPropType(propValue);
|
3992
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
|
3993
|
-
}
|
3994
|
-
return null;
|
3995
|
-
}
|
3996
|
-
return createChainableTypeChecker(validate);
|
3997
|
-
}
|
3998
|
-
|
3999
|
-
function createInstanceTypeChecker(expectedClass) {
|
4000
|
-
function validate(props, propName, componentName, location, propFullName) {
|
4001
|
-
if (!(props[propName] instanceof expectedClass)) {
|
4002
|
-
var expectedClassName = expectedClass.name || ANONYMOUS;
|
4003
|
-
var actualClassName = getClassName(props[propName]);
|
4004
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
|
4005
|
-
}
|
4006
|
-
return null;
|
4007
|
-
}
|
4008
|
-
return createChainableTypeChecker(validate);
|
4009
|
-
}
|
4010
|
-
|
4011
|
-
function createEnumTypeChecker(expectedValues) {
|
4012
|
-
if (!Array.isArray(expectedValues)) {
|
4013
|
-
"development" !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0;
|
4014
|
-
return emptyFunction.thatReturnsNull;
|
4015
|
-
}
|
4016
|
-
|
4017
|
-
function validate(props, propName, componentName, location, propFullName) {
|
4018
|
-
var propValue = props[propName];
|
4019
|
-
for (var i = 0; i < expectedValues.length; i++) {
|
4020
|
-
if (is(propValue, expectedValues[i])) {
|
4021
|
-
return null;
|
4022
|
-
}
|
4023
|
-
}
|
4024
|
-
|
4025
|
-
var valuesString = JSON.stringify(expectedValues);
|
4026
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
|
4027
|
-
}
|
4028
|
-
return createChainableTypeChecker(validate);
|
4029
|
-
}
|
4030
|
-
|
4031
|
-
function createObjectOfTypeChecker(typeChecker) {
|
4032
|
-
function validate(props, propName, componentName, location, propFullName) {
|
4033
|
-
if (typeof typeChecker !== 'function') {
|
4034
|
-
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
|
4035
|
-
}
|
4036
|
-
var propValue = props[propName];
|
4037
|
-
var propType = getPropType(propValue);
|
4038
|
-
if (propType !== 'object') {
|
4039
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
|
4040
|
-
}
|
4041
|
-
for (var key in propValue) {
|
4042
|
-
if (propValue.hasOwnProperty(key)) {
|
4043
|
-
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
4044
|
-
if (error instanceof Error) {
|
4045
|
-
return error;
|
4046
|
-
}
|
4047
|
-
}
|
4048
|
-
}
|
4049
|
-
return null;
|
4050
|
-
}
|
4051
|
-
return createChainableTypeChecker(validate);
|
4052
|
-
}
|
4053
|
-
|
4054
|
-
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
4055
|
-
if (!Array.isArray(arrayOfTypeCheckers)) {
|
4056
|
-
"development" !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
|
4057
|
-
return emptyFunction.thatReturnsNull;
|
4058
|
-
}
|
4059
|
-
|
4060
|
-
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
4061
|
-
var checker = arrayOfTypeCheckers[i];
|
4062
|
-
if (typeof checker !== 'function') {
|
4063
|
-
warning(
|
4064
|
-
false,
|
4065
|
-
'Invalid argument supplid to oneOfType. Expected an array of check functions, but ' +
|
4066
|
-
'received %s at index %s.',
|
4067
|
-
getPostfixForTypeWarning(checker),
|
4068
|
-
i
|
4069
|
-
);
|
4070
|
-
return emptyFunction.thatReturnsNull;
|
4071
|
-
}
|
4072
|
-
}
|
4073
|
-
|
4074
|
-
function validate(props, propName, componentName, location, propFullName) {
|
4075
|
-
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
4076
|
-
var checker = arrayOfTypeCheckers[i];
|
4077
|
-
if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {
|
4078
|
-
return null;
|
4079
|
-
}
|
4080
|
-
}
|
4081
|
-
|
4082
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
|
4083
|
-
}
|
4084
|
-
return createChainableTypeChecker(validate);
|
4085
|
-
}
|
4086
|
-
|
4087
|
-
function createNodeChecker() {
|
4088
|
-
function validate(props, propName, componentName, location, propFullName) {
|
4089
|
-
if (!isNode(props[propName])) {
|
4090
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
|
4091
|
-
}
|
4092
|
-
return null;
|
4093
|
-
}
|
4094
|
-
return createChainableTypeChecker(validate);
|
4095
|
-
}
|
4096
|
-
|
4097
|
-
function createShapeTypeChecker(shapeTypes) {
|
4098
|
-
function validate(props, propName, componentName, location, propFullName) {
|
4099
|
-
var propValue = props[propName];
|
4100
|
-
var propType = getPropType(propValue);
|
4101
|
-
if (propType !== 'object') {
|
4102
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
4103
|
-
}
|
4104
|
-
for (var key in shapeTypes) {
|
4105
|
-
var checker = shapeTypes[key];
|
4106
|
-
if (!checker) {
|
4107
|
-
continue;
|
4108
|
-
}
|
4109
|
-
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
4110
|
-
if (error) {
|
4111
|
-
return error;
|
4112
|
-
}
|
4113
|
-
}
|
4114
|
-
return null;
|
4115
|
-
}
|
4116
|
-
return createChainableTypeChecker(validate);
|
4117
|
-
}
|
4118
|
-
|
4119
|
-
function isNode(propValue) {
|
4120
|
-
switch (typeof propValue) {
|
4121
|
-
case 'number':
|
4122
|
-
case 'string':
|
4123
|
-
case 'undefined':
|
4124
|
-
return true;
|
4125
|
-
case 'boolean':
|
4126
|
-
return !propValue;
|
4127
|
-
case 'object':
|
4128
|
-
if (Array.isArray(propValue)) {
|
4129
|
-
return propValue.every(isNode);
|
4130
|
-
}
|
4131
|
-
if (propValue === null || isValidElement(propValue)) {
|
4132
|
-
return true;
|
4133
|
-
}
|
4134
|
-
|
4135
|
-
var iteratorFn = getIteratorFn(propValue);
|
4136
|
-
if (iteratorFn) {
|
4137
|
-
var iterator = iteratorFn.call(propValue);
|
4138
|
-
var step;
|
4139
|
-
if (iteratorFn !== propValue.entries) {
|
4140
|
-
while (!(step = iterator.next()).done) {
|
4141
|
-
if (!isNode(step.value)) {
|
4142
|
-
return false;
|
4143
|
-
}
|
4144
|
-
}
|
4145
|
-
} else {
|
4146
|
-
// Iterator will provide entry [k,v] tuples rather than values.
|
4147
|
-
while (!(step = iterator.next()).done) {
|
4148
|
-
var entry = step.value;
|
4149
|
-
if (entry) {
|
4150
|
-
if (!isNode(entry[1])) {
|
4151
|
-
return false;
|
4152
|
-
}
|
4153
|
-
}
|
4154
|
-
}
|
4155
|
-
}
|
4156
|
-
} else {
|
4157
|
-
return false;
|
4158
|
-
}
|
4159
|
-
|
4160
|
-
return true;
|
4161
|
-
default:
|
4162
|
-
return false;
|
4163
|
-
}
|
4164
|
-
}
|
4165
|
-
|
4166
|
-
function isSymbol(propType, propValue) {
|
4167
|
-
// Native Symbol.
|
4168
|
-
if (propType === 'symbol') {
|
4169
|
-
return true;
|
4170
|
-
}
|
4171
|
-
|
4172
|
-
// 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
|
4173
|
-
if (propValue['@@toStringTag'] === 'Symbol') {
|
4174
|
-
return true;
|
4175
|
-
}
|
4176
|
-
|
4177
|
-
// Fallback for non-spec compliant Symbols which are polyfilled.
|
4178
|
-
if (typeof Symbol === 'function' && propValue instanceof Symbol) {
|
4179
|
-
return true;
|
4180
|
-
}
|
4181
|
-
|
4182
|
-
return false;
|
4183
|
-
}
|
4184
|
-
|
4185
|
-
// Equivalent of `typeof` but with special handling for array and regexp.
|
4186
|
-
function getPropType(propValue) {
|
4187
|
-
var propType = typeof propValue;
|
4188
|
-
if (Array.isArray(propValue)) {
|
4189
|
-
return 'array';
|
4190
|
-
}
|
4191
|
-
if (propValue instanceof RegExp) {
|
4192
|
-
// Old webkits (at least until Android 4.0) return 'function' rather than
|
4193
|
-
// 'object' for typeof a RegExp. We'll normalize this here so that /bla/
|
4194
|
-
// passes PropTypes.object.
|
4195
|
-
return 'object';
|
4196
|
-
}
|
4197
|
-
if (isSymbol(propType, propValue)) {
|
4198
|
-
return 'symbol';
|
4199
|
-
}
|
4200
|
-
return propType;
|
4201
|
-
}
|
4202
|
-
|
4203
|
-
// This handles more types than `getPropType`. Only used for error messages.
|
4204
|
-
// See `createPrimitiveTypeChecker`.
|
4205
|
-
function getPreciseType(propValue) {
|
4206
|
-
if (typeof propValue === 'undefined' || propValue === null) {
|
4207
|
-
return '' + propValue;
|
4208
|
-
}
|
4209
|
-
var propType = getPropType(propValue);
|
4210
|
-
if (propType === 'object') {
|
4211
|
-
if (propValue instanceof Date) {
|
4212
|
-
return 'date';
|
4213
|
-
} else if (propValue instanceof RegExp) {
|
4214
|
-
return 'regexp';
|
4215
|
-
}
|
4216
|
-
}
|
4217
|
-
return propType;
|
4218
|
-
}
|
4219
|
-
|
4220
|
-
// Returns a string that is postfixed to a warning about an invalid type.
|
4221
|
-
// For example, "undefined" or "of type array"
|
4222
|
-
function getPostfixForTypeWarning(value) {
|
4223
|
-
var type = getPreciseType(value);
|
4224
|
-
switch (type) {
|
4225
|
-
case 'array':
|
4226
|
-
case 'object':
|
4227
|
-
return 'an ' + type;
|
4228
|
-
case 'boolean':
|
4229
|
-
case 'date':
|
4230
|
-
case 'regexp':
|
4231
|
-
return 'a ' + type;
|
4232
|
-
default:
|
4233
|
-
return type;
|
4234
|
-
}
|
4235
|
-
}
|
4236
|
-
|
4237
|
-
// Returns class name of the object, if any.
|
4238
|
-
function getClassName(propValue) {
|
4239
|
-
if (!propValue.constructor || !propValue.constructor.name) {
|
4240
|
-
return ANONYMOUS;
|
4241
|
-
}
|
4242
|
-
return propValue.constructor.name;
|
4243
|
-
}
|
4244
|
-
|
4245
|
-
ReactPropTypes.checkPropTypes = checkPropTypes;
|
4246
|
-
ReactPropTypes.PropTypes = ReactPropTypes;
|
4247
|
-
|
4248
|
-
return ReactPropTypes;
|
4249
|
-
};
|
4250
|
-
|
4251
|
-
},{"28":28,"30":30,"31":31,"33":33,"36":36}],36:[function(_dereq_,module,exports){
|
4252
|
-
/**
|
4253
|
-
* Copyright 2013-present, Facebook, Inc.
|
4254
|
-
* All rights reserved.
|
4255
|
-
*
|
4256
|
-
* This source code is licensed under the BSD-style license found in the
|
4257
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
4258
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
4259
|
-
*/
|
4260
|
-
|
4261
|
-
'use strict';
|
4262
|
-
|
4263
|
-
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
4264
|
-
|
4265
|
-
module.exports = ReactPropTypesSecret;
|
4266
|
-
|
4267
|
-
},{}]},{},[16])(16)
|
4268
|
-
});
|