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