1 | |
2 |
|
3 |
|
4 | (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.React = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | 'use strict';
|
17 |
|
18 | var ReactDOMComponentTree = _dereq_(46);
|
19 |
|
20 | var focusNode = _dereq_(172);
|
21 |
|
22 | var AutoFocusUtils = {
|
23 | focusDOMComponent: function () {
|
24 | focusNode(ReactDOMComponentTree.getNodeFromInstance(this));
|
25 | }
|
26 | };
|
27 |
|
28 | module.exports = AutoFocusUtils;
|
29 | },{"172":172,"46":46}],2:[function(_dereq_,module,exports){
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 | 'use strict';
|
42 |
|
43 | var EventConstants = _dereq_(16);
|
44 | var EventPropagators = _dereq_(20);
|
45 | var ExecutionEnvironment = _dereq_(164);
|
46 | var FallbackCompositionState = _dereq_(21);
|
47 | var SyntheticCompositionEvent = _dereq_(116);
|
48 | var SyntheticInputEvent = _dereq_(120);
|
49 |
|
50 | var keyOf = _dereq_(182);
|
51 |
|
52 | var END_KEYCODES = [9, 13, 27, 32];
|
53 | var START_KEYCODE = 229;
|
54 |
|
55 | var canUseCompositionEvent = ExecutionEnvironment.canUseDOM && 'CompositionEvent' in window;
|
56 |
|
57 | var documentMode = null;
|
58 | if (ExecutionEnvironment.canUseDOM && 'documentMode' in document) {
|
59 | documentMode = document.documentMode;
|
60 | }
|
61 |
|
62 |
|
63 |
|
64 |
|
65 | var canUseTextInputEvent = ExecutionEnvironment.canUseDOM && 'TextEvent' in window && !documentMode && !isPresto();
|
66 |
|
67 |
|
68 |
|
69 |
|
70 | var useFallbackCompositionData = ExecutionEnvironment.canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);
|
71 |
|
72 |
|
73 |
|
74 |
|
75 |
|
76 | function isPresto() {
|
77 | var opera = window.opera;
|
78 | return typeof opera === 'object' && typeof opera.version === 'function' && parseInt(opera.version(), 10) <= 12;
|
79 | }
|
80 |
|
81 | var SPACEBAR_CODE = 32;
|
82 | var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);
|
83 |
|
84 | var topLevelTypes = EventConstants.topLevelTypes;
|
85 |
|
86 |
|
87 | var eventTypes = {
|
88 | beforeInput: {
|
89 | phasedRegistrationNames: {
|
90 | bubbled: keyOf({ onBeforeInput: null }),
|
91 | captured: keyOf({ onBeforeInputCapture: null })
|
92 | },
|
93 | dependencies: [topLevelTypes.topCompositionEnd, topLevelTypes.topKeyPress, topLevelTypes.topTextInput, topLevelTypes.topPaste]
|
94 | },
|
95 | compositionEnd: {
|
96 | phasedRegistrationNames: {
|
97 | bubbled: keyOf({ onCompositionEnd: null }),
|
98 | captured: keyOf({ onCompositionEndCapture: null })
|
99 | },
|
100 | dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionEnd, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown]
|
101 | },
|
102 | compositionStart: {
|
103 | phasedRegistrationNames: {
|
104 | bubbled: keyOf({ onCompositionStart: null }),
|
105 | captured: keyOf({ onCompositionStartCapture: null })
|
106 | },
|
107 | dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionStart, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown]
|
108 | },
|
109 | compositionUpdate: {
|
110 | phasedRegistrationNames: {
|
111 | bubbled: keyOf({ onCompositionUpdate: null }),
|
112 | captured: keyOf({ onCompositionUpdateCapture: null })
|
113 | },
|
114 | dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionUpdate, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown]
|
115 | }
|
116 | };
|
117 |
|
118 |
|
119 | var hasSpaceKeypress = false;
|
120 |
|
121 |
|
122 |
|
123 |
|
124 |
|
125 |
|
126 | function isKeypressCommand(nativeEvent) {
|
127 | return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&
|
128 |
|
129 | !(nativeEvent.ctrlKey && nativeEvent.altKey);
|
130 | }
|
131 |
|
132 |
|
133 |
|
134 |
|
135 |
|
136 |
|
137 |
|
138 | function getCompositionEventType(topLevelType) {
|
139 | switch (topLevelType) {
|
140 | case topLevelTypes.topCompositionStart:
|
141 | return eventTypes.compositionStart;
|
142 | case topLevelTypes.topCompositionEnd:
|
143 | return eventTypes.compositionEnd;
|
144 | case topLevelTypes.topCompositionUpdate:
|
145 | return eventTypes.compositionUpdate;
|
146 | }
|
147 | }
|
148 |
|
149 |
|
150 |
|
151 |
|
152 |
|
153 |
|
154 |
|
155 |
|
156 |
|
157 | function isFallbackCompositionStart(topLevelType, nativeEvent) {
|
158 | return topLevelType === topLevelTypes.topKeyDown && nativeEvent.keyCode === START_KEYCODE;
|
159 | }
|
160 |
|
161 |
|
162 |
|
163 |
|
164 |
|
165 |
|
166 |
|
167 |
|
168 | function isFallbackCompositionEnd(topLevelType, nativeEvent) {
|
169 | switch (topLevelType) {
|
170 | case topLevelTypes.topKeyUp:
|
171 |
|
172 | return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
|
173 | case topLevelTypes.topKeyDown:
|
174 |
|
175 |
|
176 | return nativeEvent.keyCode !== START_KEYCODE;
|
177 | case topLevelTypes.topKeyPress:
|
178 | case topLevelTypes.topMouseDown:
|
179 | case topLevelTypes.topBlur:
|
180 |
|
181 | return true;
|
182 | default:
|
183 | return false;
|
184 | }
|
185 | }
|
186 |
|
187 |
|
188 |
|
189 |
|
190 |
|
191 |
|
192 |
|
193 |
|
194 |
|
195 |
|
196 | function getDataFromCustomEvent(nativeEvent) {
|
197 | var detail = nativeEvent.detail;
|
198 | if (typeof detail === 'object' && 'data' in detail) {
|
199 | return detail.data;
|
200 | }
|
201 | return null;
|
202 | }
|
203 |
|
204 |
|
205 | var currentComposition = null;
|
206 |
|
207 |
|
208 |
|
209 |
|
210 | function extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
|
211 | var eventType;
|
212 | var fallbackData;
|
213 |
|
214 | if (canUseCompositionEvent) {
|
215 | eventType = getCompositionEventType(topLevelType);
|
216 | } else if (!currentComposition) {
|
217 | if (isFallbackCompositionStart(topLevelType, nativeEvent)) {
|
218 | eventType = eventTypes.compositionStart;
|
219 | }
|
220 | } else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) {
|
221 | eventType = eventTypes.compositionEnd;
|
222 | }
|
223 |
|
224 | if (!eventType) {
|
225 | return null;
|
226 | }
|
227 |
|
228 | if (useFallbackCompositionData) {
|
229 |
|
230 |
|
231 | if (!currentComposition && eventType === eventTypes.compositionStart) {
|
232 | currentComposition = FallbackCompositionState.getPooled(nativeEventTarget);
|
233 | } else if (eventType === eventTypes.compositionEnd) {
|
234 | if (currentComposition) {
|
235 | fallbackData = currentComposition.getData();
|
236 | }
|
237 | }
|
238 | }
|
239 |
|
240 | var event = SyntheticCompositionEvent.getPooled(eventType, targetInst, nativeEvent, nativeEventTarget);
|
241 |
|
242 | if (fallbackData) {
|
243 |
|
244 |
|
245 | event.data = fallbackData;
|
246 | } else {
|
247 | var customData = getDataFromCustomEvent(nativeEvent);
|
248 | if (customData !== null) {
|
249 | event.data = customData;
|
250 | }
|
251 | }
|
252 |
|
253 | EventPropagators.accumulateTwoPhaseDispatches(event);
|
254 | return event;
|
255 | }
|
256 |
|
257 |
|
258 |
|
259 |
|
260 |
|
261 |
|
262 | function getNativeBeforeInputChars(topLevelType, nativeEvent) {
|
263 | switch (topLevelType) {
|
264 | case topLevelTypes.topCompositionEnd:
|
265 | return getDataFromCustomEvent(nativeEvent);
|
266 | case topLevelTypes.topKeyPress:
|
267 | |
268 |
|
269 |
|
270 |
|
271 |
|
272 |
|
273 |
|
274 |
|
275 |
|
276 |
|
277 |
|
278 |
|
279 |
|
280 |
|
281 | var which = nativeEvent.which;
|
282 | if (which !== SPACEBAR_CODE) {
|
283 | return null;
|
284 | }
|
285 |
|
286 | hasSpaceKeypress = true;
|
287 | return SPACEBAR_CHAR;
|
288 |
|
289 | case topLevelTypes.topTextInput:
|
290 |
|
291 | var chars = nativeEvent.data;
|
292 |
|
293 |
|
294 |
|
295 |
|
296 | if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {
|
297 | return null;
|
298 | }
|
299 |
|
300 | return chars;
|
301 |
|
302 | default:
|
303 |
|
304 | return null;
|
305 | }
|
306 | }
|
307 |
|
308 |
|
309 |
|
310 |
|
311 |
|
312 |
|
313 |
|
314 |
|
315 |
|
316 | function getFallbackBeforeInputChars(topLevelType, nativeEvent) {
|
317 |
|
318 |
|
319 |
|
320 |
|
321 | if (currentComposition) {
|
322 | if (topLevelType === topLevelTypes.topCompositionEnd || !canUseCompositionEvent && isFallbackCompositionEnd(topLevelType, nativeEvent)) {
|
323 | var chars = currentComposition.getData();
|
324 | FallbackCompositionState.release(currentComposition);
|
325 | currentComposition = null;
|
326 | return chars;
|
327 | }
|
328 | return null;
|
329 | }
|
330 |
|
331 | switch (topLevelType) {
|
332 | case topLevelTypes.topPaste:
|
333 |
|
334 |
|
335 | return null;
|
336 | case topLevelTypes.topKeyPress:
|
337 | |
338 |
|
339 |
|
340 |
|
341 |
|
342 |
|
343 |
|
344 |
|
345 |
|
346 |
|
347 |
|
348 |
|
349 |
|
350 |
|
351 |
|
352 |
|
353 | if (nativeEvent.which && !isKeypressCommand(nativeEvent)) {
|
354 | return String.fromCharCode(nativeEvent.which);
|
355 | }
|
356 | return null;
|
357 | case topLevelTypes.topCompositionEnd:
|
358 | return useFallbackCompositionData ? null : nativeEvent.data;
|
359 | default:
|
360 | return null;
|
361 | }
|
362 | }
|
363 |
|
364 |
|
365 |
|
366 |
|
367 |
|
368 |
|
369 |
|
370 | function extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
|
371 | var chars;
|
372 |
|
373 | if (canUseTextInputEvent) {
|
374 | chars = getNativeBeforeInputChars(topLevelType, nativeEvent);
|
375 | } else {
|
376 | chars = getFallbackBeforeInputChars(topLevelType, nativeEvent);
|
377 | }
|
378 |
|
379 |
|
380 |
|
381 | if (!chars) {
|
382 | return null;
|
383 | }
|
384 |
|
385 | var event = SyntheticInputEvent.getPooled(eventTypes.beforeInput, targetInst, nativeEvent, nativeEventTarget);
|
386 |
|
387 | event.data = chars;
|
388 | EventPropagators.accumulateTwoPhaseDispatches(event);
|
389 | return event;
|
390 | }
|
391 |
|
392 |
|
393 |
|
394 |
|
395 |
|
396 |
|
397 |
|
398 |
|
399 |
|
400 |
|
401 |
|
402 |
|
403 |
|
404 |
|
405 |
|
406 |
|
407 |
|
408 |
|
409 |
|
410 | var BeforeInputEventPlugin = {
|
411 |
|
412 | eventTypes: eventTypes,
|
413 |
|
414 | extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
|
415 | return [extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget), extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget)];
|
416 | }
|
417 | };
|
418 |
|
419 | module.exports = BeforeInputEventPlugin;
|
420 | },{"116":116,"120":120,"16":16,"164":164,"182":182,"20":20,"21":21}],3:[function(_dereq_,module,exports){
|
421 |
|
422 |
|
423 |
|
424 |
|
425 |
|
426 |
|
427 |
|
428 |
|
429 |
|
430 |
|
431 |
|
432 | 'use strict';
|
433 |
|
434 |
|
435 |
|
436 |
|
437 |
|
438 | var isUnitlessNumber = {
|
439 | animationIterationCount: true,
|
440 | borderImageOutset: true,
|
441 | borderImageSlice: true,
|
442 | borderImageWidth: true,
|
443 | boxFlex: true,
|
444 | boxFlexGroup: true,
|
445 | boxOrdinalGroup: true,
|
446 | columnCount: true,
|
447 | flex: true,
|
448 | flexGrow: true,
|
449 | flexPositive: true,
|
450 | flexShrink: true,
|
451 | flexNegative: true,
|
452 | flexOrder: true,
|
453 | gridRow: true,
|
454 | gridColumn: true,
|
455 | fontWeight: true,
|
456 | lineClamp: true,
|
457 | lineHeight: true,
|
458 | opacity: true,
|
459 | order: true,
|
460 | orphans: true,
|
461 | tabSize: true,
|
462 | widows: true,
|
463 | zIndex: true,
|
464 | zoom: true,
|
465 |
|
466 |
|
467 | fillOpacity: true,
|
468 | floodOpacity: true,
|
469 | stopOpacity: true,
|
470 | strokeDasharray: true,
|
471 | strokeDashoffset: true,
|
472 | strokeMiterlimit: true,
|
473 | strokeOpacity: true,
|
474 | strokeWidth: true
|
475 | };
|
476 |
|
477 |
|
478 |
|
479 |
|
480 |
|
481 |
|
482 |
|
483 | function prefixKey(prefix, key) {
|
484 | return prefix + key.charAt(0).toUpperCase() + key.substring(1);
|
485 | }
|
486 |
|
487 |
|
488 |
|
489 |
|
490 |
|
491 | var prefixes = ['Webkit', 'ms', 'Moz', 'O'];
|
492 |
|
493 |
|
494 |
|
495 | Object.keys(isUnitlessNumber).forEach(function (prop) {
|
496 | prefixes.forEach(function (prefix) {
|
497 | isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
|
498 | });
|
499 | });
|
500 |
|
501 |
|
502 |
|
503 |
|
504 |
|
505 |
|
506 |
|
507 |
|
508 |
|
509 |
|
510 | var shorthandPropertyExpansions = {
|
511 | background: {
|
512 | backgroundAttachment: true,
|
513 | backgroundColor: true,
|
514 | backgroundImage: true,
|
515 | backgroundPositionX: true,
|
516 | backgroundPositionY: true,
|
517 | backgroundRepeat: true
|
518 | },
|
519 | backgroundPosition: {
|
520 | backgroundPositionX: true,
|
521 | backgroundPositionY: true
|
522 | },
|
523 | border: {
|
524 | borderWidth: true,
|
525 | borderStyle: true,
|
526 | borderColor: true
|
527 | },
|
528 | borderBottom: {
|
529 | borderBottomWidth: true,
|
530 | borderBottomStyle: true,
|
531 | borderBottomColor: true
|
532 | },
|
533 | borderLeft: {
|
534 | borderLeftWidth: true,
|
535 | borderLeftStyle: true,
|
536 | borderLeftColor: true
|
537 | },
|
538 | borderRight: {
|
539 | borderRightWidth: true,
|
540 | borderRightStyle: true,
|
541 | borderRightColor: true
|
542 | },
|
543 | borderTop: {
|
544 | borderTopWidth: true,
|
545 | borderTopStyle: true,
|
546 | borderTopColor: true
|
547 | },
|
548 | font: {
|
549 | fontStyle: true,
|
550 | fontVariant: true,
|
551 | fontWeight: true,
|
552 | fontSize: true,
|
553 | lineHeight: true,
|
554 | fontFamily: true
|
555 | },
|
556 | outline: {
|
557 | outlineWidth: true,
|
558 | outlineStyle: true,
|
559 | outlineColor: true
|
560 | }
|
561 | };
|
562 |
|
563 | var CSSProperty = {
|
564 | isUnitlessNumber: isUnitlessNumber,
|
565 | shorthandPropertyExpansions: shorthandPropertyExpansions
|
566 | };
|
567 |
|
568 | module.exports = CSSProperty;
|
569 | },{}],4:[function(_dereq_,module,exports){
|
570 |
|
571 |
|
572 |
|
573 |
|
574 |
|
575 |
|
576 |
|
577 |
|
578 |
|
579 |
|
580 |
|
581 | 'use strict';
|
582 |
|
583 | var CSSProperty = _dereq_(3);
|
584 | var ExecutionEnvironment = _dereq_(164);
|
585 | var ReactInstrumentation = _dereq_(78);
|
586 |
|
587 | var camelizeStyleName = _dereq_(166);
|
588 | var dangerousStyleValue = _dereq_(134);
|
589 | var hyphenateStyleName = _dereq_(177);
|
590 | var memoizeStringOnly = _dereq_(183);
|
591 | var warning = _dereq_(187);
|
592 |
|
593 | var processStyleName = memoizeStringOnly(function (styleName) {
|
594 | return hyphenateStyleName(styleName);
|
595 | });
|
596 |
|
597 | var hasShorthandPropertyBug = false;
|
598 | var styleFloatAccessor = 'cssFloat';
|
599 | if (ExecutionEnvironment.canUseDOM) {
|
600 | var tempStyle = document.createElement('div').style;
|
601 | try {
|
602 |
|
603 | tempStyle.font = '';
|
604 | } catch (e) {
|
605 | hasShorthandPropertyBug = true;
|
606 | }
|
607 |
|
608 | if (document.documentElement.style.cssFloat === undefined) {
|
609 | styleFloatAccessor = 'styleFloat';
|
610 | }
|
611 | }
|
612 |
|
613 | if ("development" !== 'production') {
|
614 |
|
615 | var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
|
616 |
|
617 |
|
618 | var badStyleValueWithSemicolonPattern = /;\s*$/;
|
619 |
|
620 | var warnedStyleNames = {};
|
621 | var warnedStyleValues = {};
|
622 | var warnedForNaNValue = false;
|
623 |
|
624 | var warnHyphenatedStyleName = function (name, owner) {
|
625 | if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
|
626 | return;
|
627 | }
|
628 |
|
629 | warnedStyleNames[name] = true;
|
630 | "development" !== 'production' ? warning(false, 'Unsupported style property %s. Did you mean %s?%s', name, camelizeStyleName(name), checkRenderMessage(owner)) : void 0;
|
631 | };
|
632 |
|
633 | var warnBadVendoredStyleName = function (name, owner) {
|
634 | if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
|
635 | return;
|
636 | }
|
637 |
|
638 | warnedStyleNames[name] = true;
|
639 | "development" !== 'production' ? warning(false, 'Unsupported vendor-prefixed style property %s. Did you mean %s?%s', name, name.charAt(0).toUpperCase() + name.slice(1), checkRenderMessage(owner)) : void 0;
|
640 | };
|
641 |
|
642 | var warnStyleValueWithSemicolon = function (name, value, owner) {
|
643 | if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
|
644 | return;
|
645 | }
|
646 |
|
647 | warnedStyleValues[value] = true;
|
648 | "development" !== 'production' ? warning(false, 'Style property values shouldn\'t contain a semicolon.%s ' + 'Try "%s: %s" instead.', checkRenderMessage(owner), name, value.replace(badStyleValueWithSemicolonPattern, '')) : void 0;
|
649 | };
|
650 |
|
651 | var warnStyleValueIsNaN = function (name, value, owner) {
|
652 | if (warnedForNaNValue) {
|
653 | return;
|
654 | }
|
655 |
|
656 | warnedForNaNValue = true;
|
657 | "development" !== 'production' ? warning(false, '`NaN` is an invalid value for the `%s` css style property.%s', name, checkRenderMessage(owner)) : void 0;
|
658 | };
|
659 |
|
660 | var checkRenderMessage = function (owner) {
|
661 | if (owner) {
|
662 | var name = owner.getName();
|
663 | if (name) {
|
664 | return ' Check the render method of `' + name + '`.';
|
665 | }
|
666 | }
|
667 | return '';
|
668 | };
|
669 |
|
670 | |
671 |
|
672 |
|
673 |
|
674 |
|
675 | var warnValidStyle = function (name, value, component) {
|
676 | var owner;
|
677 | if (component) {
|
678 | owner = component._currentElement._owner;
|
679 | }
|
680 | if (name.indexOf('-') > -1) {
|
681 | warnHyphenatedStyleName(name, owner);
|
682 | } else if (badVendoredStyleNamePattern.test(name)) {
|
683 | warnBadVendoredStyleName(name, owner);
|
684 | } else if (badStyleValueWithSemicolonPattern.test(value)) {
|
685 | warnStyleValueWithSemicolon(name, value, owner);
|
686 | }
|
687 |
|
688 | if (typeof value === 'number' && isNaN(value)) {
|
689 | warnStyleValueIsNaN(name, value, owner);
|
690 | }
|
691 | };
|
692 | }
|
693 |
|
694 |
|
695 |
|
696 |
|
697 | var CSSPropertyOperations = {
|
698 |
|
699 | |
700 |
|
701 |
|
702 |
|
703 |
|
704 |
|
705 |
|
706 |
|
707 |
|
708 |
|
709 |
|
710 |
|
711 |
|
712 | createMarkupForStyles: function (styles, component) {
|
713 | var serialized = '';
|
714 | for (var styleName in styles) {
|
715 | if (!styles.hasOwnProperty(styleName)) {
|
716 | continue;
|
717 | }
|
718 | var styleValue = styles[styleName];
|
719 | if ("development" !== 'production') {
|
720 | warnValidStyle(styleName, styleValue, component);
|
721 | }
|
722 | if (styleValue != null) {
|
723 | serialized += processStyleName(styleName) + ':';
|
724 | serialized += dangerousStyleValue(styleName, styleValue, component) + ';';
|
725 | }
|
726 | }
|
727 | return serialized || null;
|
728 | },
|
729 |
|
730 | |
731 |
|
732 |
|
733 |
|
734 |
|
735 |
|
736 |
|
737 |
|
738 | setValueForStyles: function (node, styles, component) {
|
739 | if ("development" !== 'production') {
|
740 | ReactInstrumentation.debugTool.onHostOperation(component._debugID, 'update styles', styles);
|
741 | }
|
742 |
|
743 | var style = node.style;
|
744 | for (var styleName in styles) {
|
745 | if (!styles.hasOwnProperty(styleName)) {
|
746 | continue;
|
747 | }
|
748 | if ("development" !== 'production') {
|
749 | warnValidStyle(styleName, styles[styleName], component);
|
750 | }
|
751 | var styleValue = dangerousStyleValue(styleName, styles[styleName], component);
|
752 | if (styleName === 'float' || styleName === 'cssFloat') {
|
753 | styleName = styleFloatAccessor;
|
754 | }
|
755 | if (styleValue) {
|
756 | style[styleName] = styleValue;
|
757 | } else {
|
758 | var expansion = hasShorthandPropertyBug && CSSProperty.shorthandPropertyExpansions[styleName];
|
759 | if (expansion) {
|
760 |
|
761 |
|
762 | for (var individualStyleName in expansion) {
|
763 | style[individualStyleName] = '';
|
764 | }
|
765 | } else {
|
766 | style[styleName] = '';
|
767 | }
|
768 | }
|
769 | }
|
770 | }
|
771 |
|
772 | };
|
773 |
|
774 | module.exports = CSSPropertyOperations;
|
775 | },{"134":134,"164":164,"166":166,"177":177,"183":183,"187":187,"3":3,"78":78}],5:[function(_dereq_,module,exports){
|
776 |
|
777 |
|
778 |
|
779 |
|
780 |
|
781 |
|
782 |
|
783 |
|
784 |
|
785 |
|
786 |
|
787 | 'use strict';
|
788 |
|
789 | var _prodInvariant = _dereq_(153),
|
790 | _assign = _dereq_(188);
|
791 |
|
792 | var PooledClass = _dereq_(26);
|
793 |
|
794 | var invariant = _dereq_(178);
|
795 |
|
796 |
|
797 |
|
798 |
|
799 |
|
800 |
|
801 |
|
802 |
|
803 |
|
804 |
|
805 |
|
806 |
|
807 | function CallbackQueue() {
|
808 | this._callbacks = null;
|
809 | this._contexts = null;
|
810 | }
|
811 |
|
812 | _assign(CallbackQueue.prototype, {
|
813 |
|
814 | |
815 |
|
816 |
|
817 |
|
818 |
|
819 |
|
820 |
|
821 | enqueue: function (callback, context) {
|
822 | this._callbacks = this._callbacks || [];
|
823 | this._contexts = this._contexts || [];
|
824 | this._callbacks.push(callback);
|
825 | this._contexts.push(context);
|
826 | },
|
827 |
|
828 | |
829 |
|
830 |
|
831 |
|
832 |
|
833 |
|
834 | notifyAll: function () {
|
835 | var callbacks = this._callbacks;
|
836 | var contexts = this._contexts;
|
837 | if (callbacks) {
|
838 | !(callbacks.length === contexts.length) ? "development" !== 'production' ? invariant(false, 'Mismatched list of contexts in callback queue') : _prodInvariant('24') : void 0;
|
839 | this._callbacks = null;
|
840 | this._contexts = null;
|
841 | for (var i = 0; i < callbacks.length; i++) {
|
842 | callbacks[i].call(contexts[i]);
|
843 | }
|
844 | callbacks.length = 0;
|
845 | contexts.length = 0;
|
846 | }
|
847 | },
|
848 |
|
849 | checkpoint: function () {
|
850 | return this._callbacks ? this._callbacks.length : 0;
|
851 | },
|
852 |
|
853 | rollback: function (len) {
|
854 | if (this._callbacks) {
|
855 | this._callbacks.length = len;
|
856 | this._contexts.length = len;
|
857 | }
|
858 | },
|
859 |
|
860 | |
861 |
|
862 |
|
863 |
|
864 |
|
865 | reset: function () {
|
866 | this._callbacks = null;
|
867 | this._contexts = null;
|
868 | },
|
869 |
|
870 | |
871 |
|
872 |
|
873 | destructor: function () {
|
874 | this.reset();
|
875 | }
|
876 |
|
877 | });
|
878 |
|
879 | PooledClass.addPoolingTo(CallbackQueue);
|
880 |
|
881 | module.exports = CallbackQueue;
|
882 | },{"153":153,"178":178,"188":188,"26":26}],6:[function(_dereq_,module,exports){
|
883 |
|
884 |
|
885 |
|
886 |
|
887 |
|
888 |
|
889 |
|
890 |
|
891 |
|
892 |
|
893 |
|
894 | 'use strict';
|
895 |
|
896 | var EventConstants = _dereq_(16);
|
897 | var EventPluginHub = _dereq_(17);
|
898 | var EventPropagators = _dereq_(20);
|
899 | var ExecutionEnvironment = _dereq_(164);
|
900 | var ReactDOMComponentTree = _dereq_(46);
|
901 | var ReactUpdates = _dereq_(107);
|
902 | var SyntheticEvent = _dereq_(118);
|
903 |
|
904 | var getEventTarget = _dereq_(142);
|
905 | var isEventSupported = _dereq_(149);
|
906 | var isTextInputElement = _dereq_(150);
|
907 | var keyOf = _dereq_(182);
|
908 |
|
909 | var topLevelTypes = EventConstants.topLevelTypes;
|
910 |
|
911 | var eventTypes = {
|
912 | change: {
|
913 | phasedRegistrationNames: {
|
914 | bubbled: keyOf({ onChange: null }),
|
915 | captured: keyOf({ onChangeCapture: null })
|
916 | },
|
917 | dependencies: [topLevelTypes.topBlur, topLevelTypes.topChange, topLevelTypes.topClick, topLevelTypes.topFocus, topLevelTypes.topInput, topLevelTypes.topKeyDown, topLevelTypes.topKeyUp, topLevelTypes.topSelectionChange]
|
918 | }
|
919 | };
|
920 |
|
921 |
|
922 |
|
923 |
|
924 | var activeElement = null;
|
925 | var activeElementInst = null;
|
926 | var activeElementValue = null;
|
927 | var activeElementValueProp = null;
|
928 |
|
929 |
|
930 |
|
931 |
|
932 | function shouldUseChangeEvent(elem) {
|
933 | var nodeName = elem.nodeName && elem.nodeName.toLowerCase();
|
934 | return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';
|
935 | }
|
936 |
|
937 | var doesChangeEventBubble = false;
|
938 | if (ExecutionEnvironment.canUseDOM) {
|
939 |
|
940 | doesChangeEventBubble = isEventSupported('change') && (!document.documentMode || document.documentMode > 8);
|
941 | }
|
942 |
|
943 | function manualDispatchChangeEvent(nativeEvent) {
|
944 | var event = SyntheticEvent.getPooled(eventTypes.change, activeElementInst, nativeEvent, getEventTarget(nativeEvent));
|
945 | EventPropagators.accumulateTwoPhaseDispatches(event);
|
946 |
|
947 |
|
948 |
|
949 |
|
950 |
|
951 |
|
952 |
|
953 |
|
954 |
|
955 |
|
956 |
|
957 |
|
958 | ReactUpdates.batchedUpdates(runEventInBatch, event);
|
959 | }
|
960 |
|
961 | function runEventInBatch(event) {
|
962 | EventPluginHub.enqueueEvents(event);
|
963 | EventPluginHub.processEventQueue(false);
|
964 | }
|
965 |
|
966 | function startWatchingForChangeEventIE8(target, targetInst) {
|
967 | activeElement = target;
|
968 | activeElementInst = targetInst;
|
969 | activeElement.attachEvent('onchange', manualDispatchChangeEvent);
|
970 | }
|
971 |
|
972 | function stopWatchingForChangeEventIE8() {
|
973 | if (!activeElement) {
|
974 | return;
|
975 | }
|
976 | activeElement.detachEvent('onchange', manualDispatchChangeEvent);
|
977 | activeElement = null;
|
978 | activeElementInst = null;
|
979 | }
|
980 |
|
981 | function getTargetInstForChangeEvent(topLevelType, targetInst) {
|
982 | if (topLevelType === topLevelTypes.topChange) {
|
983 | return targetInst;
|
984 | }
|
985 | }
|
986 | function handleEventsForChangeEventIE8(topLevelType, target, targetInst) {
|
987 | if (topLevelType === topLevelTypes.topFocus) {
|
988 |
|
989 |
|
990 | stopWatchingForChangeEventIE8();
|
991 | startWatchingForChangeEventIE8(target, targetInst);
|
992 | } else if (topLevelType === topLevelTypes.topBlur) {
|
993 | stopWatchingForChangeEventIE8();
|
994 | }
|
995 | }
|
996 |
|
997 |
|
998 |
|
999 |
|
1000 | var isInputEventSupported = false;
|
1001 | if (ExecutionEnvironment.canUseDOM) {
|
1002 |
|
1003 |
|
1004 |
|
1005 |
|
1006 | isInputEventSupported = isEventSupported('input') && (!document.documentMode || document.documentMode > 11);
|
1007 | }
|
1008 |
|
1009 |
|
1010 |
|
1011 |
|
1012 |
|
1013 | var newValueProp = {
|
1014 | get: function () {
|
1015 | return activeElementValueProp.get.call(this);
|
1016 | },
|
1017 | set: function (val) {
|
1018 |
|
1019 | activeElementValue = '' + val;
|
1020 | activeElementValueProp.set.call(this, val);
|
1021 | }
|
1022 | };
|
1023 |
|
1024 |
|
1025 |
|
1026 |
|
1027 |
|
1028 |
|
1029 | function startWatchingForValueChange(target, targetInst) {
|
1030 | activeElement = target;
|
1031 | activeElementInst = targetInst;
|
1032 | activeElementValue = target.value;
|
1033 | activeElementValueProp = Object.getOwnPropertyDescriptor(target.constructor.prototype, 'value');
|
1034 |
|
1035 |
|
1036 |
|
1037 | Object.defineProperty(activeElement, 'value', newValueProp);
|
1038 | if (activeElement.attachEvent) {
|
1039 | activeElement.attachEvent('onpropertychange', handlePropertyChange);
|
1040 | } else {
|
1041 | activeElement.addEventListener('propertychange', handlePropertyChange, false);
|
1042 | }
|
1043 | }
|
1044 |
|
1045 |
|
1046 |
|
1047 |
|
1048 |
|
1049 | function stopWatchingForValueChange() {
|
1050 | if (!activeElement) {
|
1051 | return;
|
1052 | }
|
1053 |
|
1054 |
|
1055 | delete activeElement.value;
|
1056 |
|
1057 | if (activeElement.detachEvent) {
|
1058 | activeElement.detachEvent('onpropertychange', handlePropertyChange);
|
1059 | } else {
|
1060 | activeElement.removeEventListener('propertychange', handlePropertyChange, false);
|
1061 | }
|
1062 |
|
1063 | activeElement = null;
|
1064 | activeElementInst = null;
|
1065 | activeElementValue = null;
|
1066 | activeElementValueProp = null;
|
1067 | }
|
1068 |
|
1069 |
|
1070 |
|
1071 |
|
1072 |
|
1073 | function handlePropertyChange(nativeEvent) {
|
1074 | if (nativeEvent.propertyName !== 'value') {
|
1075 | return;
|
1076 | }
|
1077 | var value = nativeEvent.srcElement.value;
|
1078 | if (value === activeElementValue) {
|
1079 | return;
|
1080 | }
|
1081 | activeElementValue = value;
|
1082 |
|
1083 | manualDispatchChangeEvent(nativeEvent);
|
1084 | }
|
1085 |
|
1086 |
|
1087 |
|
1088 |
|
1089 | function getTargetInstForInputEvent(topLevelType, targetInst) {
|
1090 | if (topLevelType === topLevelTypes.topInput) {
|
1091 |
|
1092 |
|
1093 | return targetInst;
|
1094 | }
|
1095 | }
|
1096 |
|
1097 | function handleEventsForInputEventIE(topLevelType, target, targetInst) {
|
1098 | if (topLevelType === topLevelTypes.topFocus) {
|
1099 |
|
1100 |
|
1101 |
|
1102 |
|
1103 |
|
1104 |
|
1105 |
|
1106 |
|
1107 |
|
1108 |
|
1109 |
|
1110 |
|
1111 |
|
1112 | stopWatchingForValueChange();
|
1113 | startWatchingForValueChange(target, targetInst);
|
1114 | } else if (topLevelType === topLevelTypes.topBlur) {
|
1115 | stopWatchingForValueChange();
|
1116 | }
|
1117 | }
|
1118 |
|
1119 |
|
1120 | function getTargetInstForInputEventIE(topLevelType, targetInst) {
|
1121 | if (topLevelType === topLevelTypes.topSelectionChange || topLevelType === topLevelTypes.topKeyUp || topLevelType === topLevelTypes.topKeyDown) {
|
1122 |
|
1123 |
|
1124 |
|
1125 |
|
1126 |
|
1127 |
|
1128 |
|
1129 |
|
1130 |
|
1131 |
|
1132 | if (activeElement && activeElement.value !== activeElementValue) {
|
1133 | activeElementValue = activeElement.value;
|
1134 | return activeElementInst;
|
1135 | }
|
1136 | }
|
1137 | }
|
1138 |
|
1139 |
|
1140 |
|
1141 |
|
1142 | function shouldUseClickEvent(elem) {
|
1143 |
|
1144 |
|
1145 |
|
1146 | return elem.nodeName && elem.nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio');
|
1147 | }
|
1148 |
|
1149 | function getTargetInstForClickEvent(topLevelType, targetInst) {
|
1150 | if (topLevelType === topLevelTypes.topClick) {
|
1151 | return targetInst;
|
1152 | }
|
1153 | }
|
1154 |
|
1155 |
|
1156 |
|
1157 |
|
1158 |
|
1159 |
|
1160 |
|
1161 |
|
1162 |
|
1163 |
|
1164 |
|
1165 | var ChangeEventPlugin = {
|
1166 |
|
1167 | eventTypes: eventTypes,
|
1168 |
|
1169 | extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
|
1170 | var targetNode = targetInst ? ReactDOMComponentTree.getNodeFromInstance(targetInst) : window;
|
1171 |
|
1172 | var getTargetInstFunc, handleEventFunc;
|
1173 | if (shouldUseChangeEvent(targetNode)) {
|
1174 | if (doesChangeEventBubble) {
|
1175 | getTargetInstFunc = getTargetInstForChangeEvent;
|
1176 | } else {
|
1177 | handleEventFunc = handleEventsForChangeEventIE8;
|
1178 | }
|
1179 | } else if (isTextInputElement(targetNode)) {
|
1180 | if (isInputEventSupported) {
|
1181 | getTargetInstFunc = getTargetInstForInputEvent;
|
1182 | } else {
|
1183 | getTargetInstFunc = getTargetInstForInputEventIE;
|
1184 | handleEventFunc = handleEventsForInputEventIE;
|
1185 | }
|
1186 | } else if (shouldUseClickEvent(targetNode)) {
|
1187 | getTargetInstFunc = getTargetInstForClickEvent;
|
1188 | }
|
1189 |
|
1190 | if (getTargetInstFunc) {
|
1191 | var inst = getTargetInstFunc(topLevelType, targetInst);
|
1192 | if (inst) {
|
1193 | var event = SyntheticEvent.getPooled(eventTypes.change, inst, nativeEvent, nativeEventTarget);
|
1194 | event.type = 'change';
|
1195 | EventPropagators.accumulateTwoPhaseDispatches(event);
|
1196 | return event;
|
1197 | }
|
1198 | }
|
1199 |
|
1200 | if (handleEventFunc) {
|
1201 | handleEventFunc(topLevelType, targetNode, targetInst);
|
1202 | }
|
1203 | }
|
1204 |
|
1205 | };
|
1206 |
|
1207 | module.exports = ChangeEventPlugin;
|
1208 | },{"107":107,"118":118,"142":142,"149":149,"150":150,"16":16,"164":164,"17":17,"182":182,"20":20,"46":46}],7:[function(_dereq_,module,exports){
|
1209 |
|
1210 |
|
1211 |
|
1212 |
|
1213 |
|
1214 |
|
1215 |
|
1216 |
|
1217 |
|
1218 |
|
1219 |
|
1220 | 'use strict';
|
1221 |
|
1222 | var DOMLazyTree = _dereq_(8);
|
1223 | var Danger = _dereq_(12);
|
1224 | var ReactMultiChildUpdateTypes = _dereq_(84);
|
1225 | var ReactDOMComponentTree = _dereq_(46);
|
1226 | var ReactInstrumentation = _dereq_(78);
|
1227 |
|
1228 | var createMicrosoftUnsafeLocalFunction = _dereq_(133);
|
1229 | var setInnerHTML = _dereq_(155);
|
1230 | var setTextContent = _dereq_(156);
|
1231 |
|
1232 | function getNodeAfter(parentNode, node) {
|
1233 |
|
1234 |
|
1235 | if (Array.isArray(node)) {
|
1236 | node = node[1];
|
1237 | }
|
1238 | return node ? node.nextSibling : parentNode.firstChild;
|
1239 | }
|
1240 |
|
1241 |
|
1242 |
|
1243 |
|
1244 |
|
1245 |
|
1246 |
|
1247 |
|
1248 |
|
1249 | var insertChildAt = createMicrosoftUnsafeLocalFunction(function (parentNode, childNode, referenceNode) {
|
1250 |
|
1251 |
|
1252 |
|
1253 | parentNode.insertBefore(childNode, referenceNode);
|
1254 | });
|
1255 |
|
1256 | function insertLazyTreeChildAt(parentNode, childTree, referenceNode) {
|
1257 | DOMLazyTree.insertTreeBefore(parentNode, childTree, referenceNode);
|
1258 | }
|
1259 |
|
1260 | function moveChild(parentNode, childNode, referenceNode) {
|
1261 | if (Array.isArray(childNode)) {
|
1262 | moveDelimitedText(parentNode, childNode[0], childNode[1], referenceNode);
|
1263 | } else {
|
1264 | insertChildAt(parentNode, childNode, referenceNode);
|
1265 | }
|
1266 | }
|
1267 |
|
1268 | function removeChild(parentNode, childNode) {
|
1269 | if (Array.isArray(childNode)) {
|
1270 | var closingComment = childNode[1];
|
1271 | childNode = childNode[0];
|
1272 | removeDelimitedText(parentNode, childNode, closingComment);
|
1273 | parentNode.removeChild(closingComment);
|
1274 | }
|
1275 | parentNode.removeChild(childNode);
|
1276 | }
|
1277 |
|
1278 | function moveDelimitedText(parentNode, openingComment, closingComment, referenceNode) {
|
1279 | var node = openingComment;
|
1280 | while (true) {
|
1281 | var nextNode = node.nextSibling;
|
1282 | insertChildAt(parentNode, node, referenceNode);
|
1283 | if (node === closingComment) {
|
1284 | break;
|
1285 | }
|
1286 | node = nextNode;
|
1287 | }
|
1288 | }
|
1289 |
|
1290 | function removeDelimitedText(parentNode, startNode, closingComment) {
|
1291 | while (true) {
|
1292 | var node = startNode.nextSibling;
|
1293 | if (node === closingComment) {
|
1294 |
|
1295 | break;
|
1296 | } else {
|
1297 | parentNode.removeChild(node);
|
1298 | }
|
1299 | }
|
1300 | }
|
1301 |
|
1302 | function replaceDelimitedText(openingComment, closingComment, stringText) {
|
1303 | var parentNode = openingComment.parentNode;
|
1304 | var nodeAfterComment = openingComment.nextSibling;
|
1305 | if (nodeAfterComment === closingComment) {
|
1306 |
|
1307 |
|
1308 | if (stringText) {
|
1309 | insertChildAt(parentNode, document.createTextNode(stringText), nodeAfterComment);
|
1310 | }
|
1311 | } else {
|
1312 | if (stringText) {
|
1313 |
|
1314 |
|
1315 | setTextContent(nodeAfterComment, stringText);
|
1316 | removeDelimitedText(parentNode, nodeAfterComment, closingComment);
|
1317 | } else {
|
1318 | removeDelimitedText(parentNode, openingComment, closingComment);
|
1319 | }
|
1320 | }
|
1321 |
|
1322 | if ("development" !== 'production') {
|
1323 | ReactInstrumentation.debugTool.onHostOperation(ReactDOMComponentTree.getInstanceFromNode(openingComment)._debugID, 'replace text', stringText);
|
1324 | }
|
1325 | }
|
1326 |
|
1327 | var dangerouslyReplaceNodeWithMarkup = Danger.dangerouslyReplaceNodeWithMarkup;
|
1328 | if ("development" !== 'production') {
|
1329 | dangerouslyReplaceNodeWithMarkup = function (oldChild, markup, prevInstance) {
|
1330 | Danger.dangerouslyReplaceNodeWithMarkup(oldChild, markup);
|
1331 | if (prevInstance._debugID !== 0) {
|
1332 | ReactInstrumentation.debugTool.onHostOperation(prevInstance._debugID, 'replace with', markup.toString());
|
1333 | } else {
|
1334 | var nextInstance = ReactDOMComponentTree.getInstanceFromNode(markup.node);
|
1335 | if (nextInstance._debugID !== 0) {
|
1336 | ReactInstrumentation.debugTool.onHostOperation(nextInstance._debugID, 'mount', markup.toString());
|
1337 | }
|
1338 | }
|
1339 | };
|
1340 | }
|
1341 |
|
1342 |
|
1343 |
|
1344 |
|
1345 | var DOMChildrenOperations = {
|
1346 |
|
1347 | dangerouslyReplaceNodeWithMarkup: dangerouslyReplaceNodeWithMarkup,
|
1348 |
|
1349 | replaceDelimitedText: replaceDelimitedText,
|
1350 |
|
1351 | |
1352 |
|
1353 |
|
1354 |
|
1355 |
|
1356 |
|
1357 |
|
1358 | processUpdates: function (parentNode, updates) {
|
1359 | if ("development" !== 'production') {
|
1360 | var parentNodeDebugID = ReactDOMComponentTree.getInstanceFromNode(parentNode)._debugID;
|
1361 | }
|
1362 |
|
1363 | for (var k = 0; k < updates.length; k++) {
|
1364 | var update = updates[k];
|
1365 | switch (update.type) {
|
1366 | case ReactMultiChildUpdateTypes.INSERT_MARKUP:
|
1367 | insertLazyTreeChildAt(parentNode, update.content, getNodeAfter(parentNode, update.afterNode));
|
1368 | if ("development" !== 'production') {
|
1369 | ReactInstrumentation.debugTool.onHostOperation(parentNodeDebugID, 'insert child', { toIndex: update.toIndex, content: update.content.toString() });
|
1370 | }
|
1371 | break;
|
1372 | case ReactMultiChildUpdateTypes.MOVE_EXISTING:
|
1373 | moveChild(parentNode, update.fromNode, getNodeAfter(parentNode, update.afterNode));
|
1374 | if ("development" !== 'production') {
|
1375 | ReactInstrumentation.debugTool.onHostOperation(parentNodeDebugID, 'move child', { fromIndex: update.fromIndex, toIndex: update.toIndex });
|
1376 | }
|
1377 | break;
|
1378 | case ReactMultiChildUpdateTypes.SET_MARKUP:
|
1379 | setInnerHTML(parentNode, update.content);
|
1380 | if ("development" !== 'production') {
|
1381 | ReactInstrumentation.debugTool.onHostOperation(parentNodeDebugID, 'replace children', update.content.toString());
|
1382 | }
|
1383 | break;
|
1384 | case ReactMultiChildUpdateTypes.TEXT_CONTENT:
|
1385 | setTextContent(parentNode, update.content);
|
1386 | if ("development" !== 'production') {
|
1387 | ReactInstrumentation.debugTool.onHostOperation(parentNodeDebugID, 'replace text', update.content.toString());
|
1388 | }
|
1389 | break;
|
1390 | case ReactMultiChildUpdateTypes.REMOVE_NODE:
|
1391 | removeChild(parentNode, update.fromNode);
|
1392 | if ("development" !== 'production') {
|
1393 | ReactInstrumentation.debugTool.onHostOperation(parentNodeDebugID, 'remove child', { fromIndex: update.fromIndex });
|
1394 | }
|
1395 | break;
|
1396 | }
|
1397 | }
|
1398 | }
|
1399 |
|
1400 | };
|
1401 |
|
1402 | module.exports = DOMChildrenOperations;
|
1403 | },{"12":12,"133":133,"155":155,"156":156,"46":46,"78":78,"8":8,"84":84}],8:[function(_dereq_,module,exports){
|
1404 |
|
1405 |
|
1406 |
|
1407 |
|
1408 |
|
1409 |
|
1410 |
|
1411 |
|
1412 |
|
1413 |
|
1414 |
|
1415 | 'use strict';
|
1416 |
|
1417 | var DOMNamespaces = _dereq_(9);
|
1418 | var setInnerHTML = _dereq_(155);
|
1419 |
|
1420 | var createMicrosoftUnsafeLocalFunction = _dereq_(133);
|
1421 | var setTextContent = _dereq_(156);
|
1422 |
|
1423 | var ELEMENT_NODE_TYPE = 1;
|
1424 | var DOCUMENT_FRAGMENT_NODE_TYPE = 11;
|
1425 |
|
1426 |
|
1427 |
|
1428 |
|
1429 |
|
1430 |
|
1431 |
|
1432 |
|
1433 |
|
1434 |
|
1435 |
|
1436 |
|
1437 | var enableLazy = typeof document !== 'undefined' && typeof document.documentMode === 'number' || typeof navigator !== 'undefined' && typeof navigator.userAgent === 'string' && /\bEdge\/\d/.test(navigator.userAgent);
|
1438 |
|
1439 | function insertTreeChildren(tree) {
|
1440 | if (!enableLazy) {
|
1441 | return;
|
1442 | }
|
1443 | var node = tree.node;
|
1444 | var children = tree.children;
|
1445 | if (children.length) {
|
1446 | for (var i = 0; i < children.length; i++) {
|
1447 | insertTreeBefore(node, children[i], null);
|
1448 | }
|
1449 | } else if (tree.html != null) {
|
1450 | setInnerHTML(node, tree.html);
|
1451 | } else if (tree.text != null) {
|
1452 | setTextContent(node, tree.text);
|
1453 | }
|
1454 | }
|
1455 |
|
1456 | var insertTreeBefore = createMicrosoftUnsafeLocalFunction(function (parentNode, tree, referenceNode) {
|
1457 |
|
1458 |
|
1459 |
|
1460 |
|
1461 |
|
1462 |
|
1463 | if (tree.node.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE || tree.node.nodeType === ELEMENT_NODE_TYPE && tree.node.nodeName.toLowerCase() === 'object' && (tree.node.namespaceURI == null || tree.node.namespaceURI === DOMNamespaces.html)) {
|
1464 | insertTreeChildren(tree);
|
1465 | parentNode.insertBefore(tree.node, referenceNode);
|
1466 | } else {
|
1467 | parentNode.insertBefore(tree.node, referenceNode);
|
1468 | insertTreeChildren(tree);
|
1469 | }
|
1470 | });
|
1471 |
|
1472 | function replaceChildWithTree(oldNode, newTree) {
|
1473 | oldNode.parentNode.replaceChild(newTree.node, oldNode);
|
1474 | insertTreeChildren(newTree);
|
1475 | }
|
1476 |
|
1477 | function queueChild(parentTree, childTree) {
|
1478 | if (enableLazy) {
|
1479 | parentTree.children.push(childTree);
|
1480 | } else {
|
1481 | parentTree.node.appendChild(childTree.node);
|
1482 | }
|
1483 | }
|
1484 |
|
1485 | function queueHTML(tree, html) {
|
1486 | if (enableLazy) {
|
1487 | tree.html = html;
|
1488 | } else {
|
1489 | setInnerHTML(tree.node, html);
|
1490 | }
|
1491 | }
|
1492 |
|
1493 | function queueText(tree, text) {
|
1494 | if (enableLazy) {
|
1495 | tree.text = text;
|
1496 | } else {
|
1497 | setTextContent(tree.node, text);
|
1498 | }
|
1499 | }
|
1500 |
|
1501 | function toString() {
|
1502 | return this.node.nodeName;
|
1503 | }
|
1504 |
|
1505 | function DOMLazyTree(node) {
|
1506 | return {
|
1507 | node: node,
|
1508 | children: [],
|
1509 | html: null,
|
1510 | text: null,
|
1511 | toString: toString
|
1512 | };
|
1513 | }
|
1514 |
|
1515 | DOMLazyTree.insertTreeBefore = insertTreeBefore;
|
1516 | DOMLazyTree.replaceChildWithTree = replaceChildWithTree;
|
1517 | DOMLazyTree.queueChild = queueChild;
|
1518 | DOMLazyTree.queueHTML = queueHTML;
|
1519 | DOMLazyTree.queueText = queueText;
|
1520 |
|
1521 | module.exports = DOMLazyTree;
|
1522 | },{"133":133,"155":155,"156":156,"9":9}],9:[function(_dereq_,module,exports){
|
1523 |
|
1524 |
|
1525 |
|
1526 |
|
1527 |
|
1528 |
|
1529 |
|
1530 |
|
1531 |
|
1532 |
|
1533 |
|
1534 | 'use strict';
|
1535 |
|
1536 | var DOMNamespaces = {
|
1537 | html: 'http://www.w3.org/1999/xhtml',
|
1538 | mathml: 'http://www.w3.org/1998/Math/MathML',
|
1539 | svg: 'http://www.w3.org/2000/svg'
|
1540 | };
|
1541 |
|
1542 | module.exports = DOMNamespaces;
|
1543 | },{}],10:[function(_dereq_,module,exports){
|
1544 |
|
1545 |
|
1546 |
|
1547 |
|
1548 |
|
1549 |
|
1550 |
|
1551 |
|
1552 |
|
1553 |
|
1554 |
|
1555 | 'use strict';
|
1556 |
|
1557 | var _prodInvariant = _dereq_(153);
|
1558 |
|
1559 | var invariant = _dereq_(178);
|
1560 |
|
1561 | function checkMask(value, bitmask) {
|
1562 | return (value & bitmask) === bitmask;
|
1563 | }
|
1564 |
|
1565 | var DOMPropertyInjection = {
|
1566 | |
1567 |
|
1568 |
|
1569 |
|
1570 | MUST_USE_PROPERTY: 0x1,
|
1571 | HAS_BOOLEAN_VALUE: 0x4,
|
1572 | HAS_NUMERIC_VALUE: 0x8,
|
1573 | HAS_POSITIVE_NUMERIC_VALUE: 0x10 | 0x8,
|
1574 | HAS_OVERLOADED_BOOLEAN_VALUE: 0x20,
|
1575 |
|
1576 | |
1577 |
|
1578 |
|
1579 |
|
1580 |
|
1581 |
|
1582 |
|
1583 |
|
1584 |
|
1585 |
|
1586 |
|
1587 |
|
1588 |
|
1589 |
|
1590 |
|
1591 |
|
1592 |
|
1593 |
|
1594 |
|
1595 |
|
1596 |
|
1597 |
|
1598 |
|
1599 |
|
1600 |
|
1601 |
|
1602 |
|
1603 |
|
1604 | injectDOMPropertyConfig: function (domPropertyConfig) {
|
1605 | var Injection = DOMPropertyInjection;
|
1606 | var Properties = domPropertyConfig.Properties || {};
|
1607 | var DOMAttributeNamespaces = domPropertyConfig.DOMAttributeNamespaces || {};
|
1608 | var DOMAttributeNames = domPropertyConfig.DOMAttributeNames || {};
|
1609 | var DOMPropertyNames = domPropertyConfig.DOMPropertyNames || {};
|
1610 | var DOMMutationMethods = domPropertyConfig.DOMMutationMethods || {};
|
1611 |
|
1612 | if (domPropertyConfig.isCustomAttribute) {
|
1613 | DOMProperty._isCustomAttributeFunctions.push(domPropertyConfig.isCustomAttribute);
|
1614 | }
|
1615 |
|
1616 | for (var propName in Properties) {
|
1617 | !!DOMProperty.properties.hasOwnProperty(propName) ? "development" !== 'production' ? invariant(false, 'injectDOMPropertyConfig(...): You\'re trying to inject DOM property \'%s\' which has already been injected. You may be accidentally injecting the same DOM property config twice, or you may be injecting two configs that have conflicting property names.', propName) : _prodInvariant('48', propName) : void 0;
|
1618 |
|
1619 | var lowerCased = propName.toLowerCase();
|
1620 | var propConfig = Properties[propName];
|
1621 |
|
1622 | var propertyInfo = {
|
1623 | attributeName: lowerCased,
|
1624 | attributeNamespace: null,
|
1625 | propertyName: propName,
|
1626 | mutationMethod: null,
|
1627 |
|
1628 | mustUseProperty: checkMask(propConfig, Injection.MUST_USE_PROPERTY),
|
1629 | hasBooleanValue: checkMask(propConfig, Injection.HAS_BOOLEAN_VALUE),
|
1630 | hasNumericValue: checkMask(propConfig, Injection.HAS_NUMERIC_VALUE),
|
1631 | hasPositiveNumericValue: checkMask(propConfig, Injection.HAS_POSITIVE_NUMERIC_VALUE),
|
1632 | hasOverloadedBooleanValue: checkMask(propConfig, Injection.HAS_OVERLOADED_BOOLEAN_VALUE)
|
1633 | };
|
1634 | !(propertyInfo.hasBooleanValue + propertyInfo.hasNumericValue + propertyInfo.hasOverloadedBooleanValue <= 1) ? "development" !== 'production' ? invariant(false, 'DOMProperty: Value can be one of boolean, overloaded boolean, or numeric value, but not a combination: %s', propName) : _prodInvariant('50', propName) : void 0;
|
1635 |
|
1636 | if ("development" !== 'production') {
|
1637 | DOMProperty.getPossibleStandardName[lowerCased] = propName;
|
1638 | }
|
1639 |
|
1640 | if (DOMAttributeNames.hasOwnProperty(propName)) {
|
1641 | var attributeName = DOMAttributeNames[propName];
|
1642 | propertyInfo.attributeName = attributeName;
|
1643 | if ("development" !== 'production') {
|
1644 | DOMProperty.getPossibleStandardName[attributeName] = propName;
|
1645 | }
|
1646 | }
|
1647 |
|
1648 | if (DOMAttributeNamespaces.hasOwnProperty(propName)) {
|
1649 | propertyInfo.attributeNamespace = DOMAttributeNamespaces[propName];
|
1650 | }
|
1651 |
|
1652 | if (DOMPropertyNames.hasOwnProperty(propName)) {
|
1653 | propertyInfo.propertyName = DOMPropertyNames[propName];
|
1654 | }
|
1655 |
|
1656 | if (DOMMutationMethods.hasOwnProperty(propName)) {
|
1657 | propertyInfo.mutationMethod = DOMMutationMethods[propName];
|
1658 | }
|
1659 |
|
1660 | DOMProperty.properties[propName] = propertyInfo;
|
1661 | }
|
1662 | }
|
1663 | };
|
1664 |
|
1665 |
|
1666 | var ATTRIBUTE_NAME_START_CHAR = ':A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD';
|
1667 |
|
1668 |
|
1669 |
|
1670 |
|
1671 |
|
1672 |
|
1673 |
|
1674 |
|
1675 |
|
1676 |
|
1677 |
|
1678 |
|
1679 |
|
1680 |
|
1681 |
|
1682 | var DOMProperty = {
|
1683 |
|
1684 | ID_ATTRIBUTE_NAME: 'data-reactid',
|
1685 | ROOT_ATTRIBUTE_NAME: 'data-reactroot',
|
1686 |
|
1687 | ATTRIBUTE_NAME_START_CHAR: ATTRIBUTE_NAME_START_CHAR,
|
1688 | ATTRIBUTE_NAME_CHAR: ATTRIBUTE_NAME_START_CHAR + '\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040',
|
1689 |
|
1690 | |
1691 |
|
1692 |
|
1693 |
|
1694 |
|
1695 |
|
1696 |
|
1697 |
|
1698 |
|
1699 |
|
1700 |
|
1701 |
|
1702 |
|
1703 |
|
1704 |
|
1705 |
|
1706 |
|
1707 |
|
1708 |
|
1709 |
|
1710 |
|
1711 |
|
1712 |
|
1713 |
|
1714 |
|
1715 |
|
1716 |
|
1717 |
|
1718 | properties: {},
|
1719 |
|
1720 | |
1721 |
|
1722 |
|
1723 |
|
1724 |
|
1725 | getPossibleStandardName: "development" !== 'production' ? {} : null,
|
1726 |
|
1727 | |
1728 |
|
1729 |
|
1730 | _isCustomAttributeFunctions: [],
|
1731 |
|
1732 | |
1733 |
|
1734 |
|
1735 |
|
1736 | isCustomAttribute: function (attributeName) {
|
1737 | for (var i = 0; i < DOMProperty._isCustomAttributeFunctions.length; i++) {
|
1738 | var isCustomAttributeFn = DOMProperty._isCustomAttributeFunctions[i];
|
1739 | if (isCustomAttributeFn(attributeName)) {
|
1740 | return true;
|
1741 | }
|
1742 | }
|
1743 | return false;
|
1744 | },
|
1745 |
|
1746 | injection: DOMPropertyInjection
|
1747 | };
|
1748 |
|
1749 | module.exports = DOMProperty;
|
1750 | },{"153":153,"178":178}],11:[function(_dereq_,module,exports){
|
1751 |
|
1752 |
|
1753 |
|
1754 |
|
1755 |
|
1756 |
|
1757 |
|
1758 |
|
1759 |
|
1760 |
|
1761 |
|
1762 | 'use strict';
|
1763 |
|
1764 | var DOMProperty = _dereq_(10);
|
1765 | var ReactDOMComponentTree = _dereq_(46);
|
1766 | var ReactInstrumentation = _dereq_(78);
|
1767 |
|
1768 | var quoteAttributeValueForBrowser = _dereq_(152);
|
1769 | var warning = _dereq_(187);
|
1770 |
|
1771 | var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + DOMProperty.ATTRIBUTE_NAME_START_CHAR + '][' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$');
|
1772 | var illegalAttributeNameCache = {};
|
1773 | var validatedAttributeNameCache = {};
|
1774 |
|
1775 | function isAttributeNameSafe(attributeName) {
|
1776 | if (validatedAttributeNameCache.hasOwnProperty(attributeName)) {
|
1777 | return true;
|
1778 | }
|
1779 | if (illegalAttributeNameCache.hasOwnProperty(attributeName)) {
|
1780 | return false;
|
1781 | }
|
1782 | if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
|
1783 | validatedAttributeNameCache[attributeName] = true;
|
1784 | return true;
|
1785 | }
|
1786 | illegalAttributeNameCache[attributeName] = true;
|
1787 | "development" !== 'production' ? warning(false, 'Invalid attribute name: `%s`', attributeName) : void 0;
|
1788 | return false;
|
1789 | }
|
1790 |
|
1791 | function shouldIgnoreValue(propertyInfo, value) {
|
1792 | return value == null || propertyInfo.hasBooleanValue && !value || propertyInfo.hasNumericValue && isNaN(value) || propertyInfo.hasPositiveNumericValue && value < 1 || propertyInfo.hasOverloadedBooleanValue && value === false;
|
1793 | }
|
1794 |
|
1795 |
|
1796 |
|
1797 |
|
1798 | var DOMPropertyOperations = {
|
1799 |
|
1800 | |
1801 |
|
1802 |
|
1803 |
|
1804 |
|
1805 |
|
1806 | createMarkupForID: function (id) {
|
1807 | return DOMProperty.ID_ATTRIBUTE_NAME + '=' + quoteAttributeValueForBrowser(id);
|
1808 | },
|
1809 |
|
1810 | setAttributeForID: function (node, id) {
|
1811 | node.setAttribute(DOMProperty.ID_ATTRIBUTE_NAME, id);
|
1812 | },
|
1813 |
|
1814 | createMarkupForRoot: function () {
|
1815 | return DOMProperty.ROOT_ATTRIBUTE_NAME + '=""';
|
1816 | },
|
1817 |
|
1818 | setAttributeForRoot: function (node) {
|
1819 | node.setAttribute(DOMProperty.ROOT_ATTRIBUTE_NAME, '');
|
1820 | },
|
1821 |
|
1822 | |
1823 |
|
1824 |
|
1825 |
|
1826 |
|
1827 |
|
1828 |
|
1829 | createMarkupForProperty: function (name, value) {
|
1830 | var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
|
1831 | if (propertyInfo) {
|
1832 | if (shouldIgnoreValue(propertyInfo, value)) {
|
1833 | return '';
|
1834 | }
|
1835 | var attributeName = propertyInfo.attributeName;
|
1836 | if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) {
|
1837 | return attributeName + '=""';
|
1838 | }
|
1839 | return attributeName + '=' + quoteAttributeValueForBrowser(value);
|
1840 | } else if (DOMProperty.isCustomAttribute(name)) {
|
1841 | if (value == null) {
|
1842 | return '';
|
1843 | }
|
1844 | return name + '=' + quoteAttributeValueForBrowser(value);
|
1845 | }
|
1846 | return null;
|
1847 | },
|
1848 |
|
1849 | |
1850 |
|
1851 |
|
1852 |
|
1853 |
|
1854 |
|
1855 |
|
1856 | createMarkupForCustomAttribute: function (name, value) {
|
1857 | if (!isAttributeNameSafe(name) || value == null) {
|
1858 | return '';
|
1859 | }
|
1860 | return name + '=' + quoteAttributeValueForBrowser(value);
|
1861 | },
|
1862 |
|
1863 | |
1864 |
|
1865 |
|
1866 |
|
1867 |
|
1868 |
|
1869 |
|
1870 | setValueForProperty: function (node, name, value) {
|
1871 | var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
|
1872 | if (propertyInfo) {
|
1873 | var mutationMethod = propertyInfo.mutationMethod;
|
1874 | if (mutationMethod) {
|
1875 | mutationMethod(node, value);
|
1876 | } else if (shouldIgnoreValue(propertyInfo, value)) {
|
1877 | this.deleteValueForProperty(node, name);
|
1878 | return;
|
1879 | } else if (propertyInfo.mustUseProperty) {
|
1880 |
|
1881 |
|
1882 | node[propertyInfo.propertyName] = value;
|
1883 | } else {
|
1884 | var attributeName = propertyInfo.attributeName;
|
1885 | var namespace = propertyInfo.attributeNamespace;
|
1886 |
|
1887 |
|
1888 | if (namespace) {
|
1889 | node.setAttributeNS(namespace, attributeName, '' + value);
|
1890 | } else if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) {
|
1891 | node.setAttribute(attributeName, '');
|
1892 | } else {
|
1893 | node.setAttribute(attributeName, '' + value);
|
1894 | }
|
1895 | }
|
1896 | } else if (DOMProperty.isCustomAttribute(name)) {
|
1897 | DOMPropertyOperations.setValueForAttribute(node, name, value);
|
1898 | return;
|
1899 | }
|
1900 |
|
1901 | if ("development" !== 'production') {
|
1902 | var payload = {};
|
1903 | payload[name] = value;
|
1904 | ReactInstrumentation.debugTool.onHostOperation(ReactDOMComponentTree.getInstanceFromNode(node)._debugID, 'update attribute', payload);
|
1905 | }
|
1906 | },
|
1907 |
|
1908 | setValueForAttribute: function (node, name, value) {
|
1909 | if (!isAttributeNameSafe(name)) {
|
1910 | return;
|
1911 | }
|
1912 | if (value == null) {
|
1913 | node.removeAttribute(name);
|
1914 | } else {
|
1915 | node.setAttribute(name, '' + value);
|
1916 | }
|
1917 |
|
1918 | if ("development" !== 'production') {
|
1919 | var payload = {};
|
1920 | payload[name] = value;
|
1921 | ReactInstrumentation.debugTool.onHostOperation(ReactDOMComponentTree.getInstanceFromNode(node)._debugID, 'update attribute', payload);
|
1922 | }
|
1923 | },
|
1924 |
|
1925 | |
1926 |
|
1927 |
|
1928 |
|
1929 |
|
1930 |
|
1931 | deleteValueForAttribute: function (node, name) {
|
1932 | node.removeAttribute(name);
|
1933 | if ("development" !== 'production') {
|
1934 | ReactInstrumentation.debugTool.onHostOperation(ReactDOMComponentTree.getInstanceFromNode(node)._debugID, 'remove attribute', name);
|
1935 | }
|
1936 | },
|
1937 |
|
1938 | |
1939 |
|
1940 |
|
1941 |
|
1942 |
|
1943 |
|
1944 | deleteValueForProperty: function (node, name) {
|
1945 | var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
|
1946 | if (propertyInfo) {
|
1947 | var mutationMethod = propertyInfo.mutationMethod;
|
1948 | if (mutationMethod) {
|
1949 | mutationMethod(node, undefined);
|
1950 | } else if (propertyInfo.mustUseProperty) {
|
1951 | var propName = propertyInfo.propertyName;
|
1952 | if (propertyInfo.hasBooleanValue) {
|
1953 | node[propName] = false;
|
1954 | } else {
|
1955 | node[propName] = '';
|
1956 | }
|
1957 | } else {
|
1958 | node.removeAttribute(propertyInfo.attributeName);
|
1959 | }
|
1960 | } else if (DOMProperty.isCustomAttribute(name)) {
|
1961 | node.removeAttribute(name);
|
1962 | }
|
1963 |
|
1964 | if ("development" !== 'production') {
|
1965 | ReactInstrumentation.debugTool.onHostOperation(ReactDOMComponentTree.getInstanceFromNode(node)._debugID, 'remove attribute', name);
|
1966 | }
|
1967 | }
|
1968 |
|
1969 | };
|
1970 |
|
1971 | module.exports = DOMPropertyOperations;
|
1972 | },{"10":10,"152":152,"187":187,"46":46,"78":78}],12:[function(_dereq_,module,exports){
|
1973 |
|
1974 |
|
1975 |
|
1976 |
|
1977 |
|
1978 |
|
1979 |
|
1980 |
|
1981 |
|
1982 |
|
1983 |
|
1984 | 'use strict';
|
1985 |
|
1986 | var _prodInvariant = _dereq_(153);
|
1987 |
|
1988 | var DOMLazyTree = _dereq_(8);
|
1989 | var ExecutionEnvironment = _dereq_(164);
|
1990 |
|
1991 | var createNodesFromMarkup = _dereq_(169);
|
1992 | var emptyFunction = _dereq_(170);
|
1993 | var invariant = _dereq_(178);
|
1994 |
|
1995 | var Danger = {
|
1996 |
|
1997 | |
1998 |
|
1999 |
|
2000 |
|
2001 |
|
2002 |
|
2003 |
|
2004 |
|
2005 | dangerouslyReplaceNodeWithMarkup: function (oldChild, markup) {
|
2006 | !ExecutionEnvironment.canUseDOM ? "development" !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Cannot render markup in a worker thread. Make sure `window` and `document` are available globally before requiring React when unit testing or use ReactDOMServer.renderToString() for server rendering.') : _prodInvariant('56') : void 0;
|
2007 | !markup ? "development" !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Missing markup.') : _prodInvariant('57') : void 0;
|
2008 | !(oldChild.nodeName !== 'HTML') ? "development" !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Cannot replace markup of the <html> node. This is because browser quirks make this unreliable and/or slow. If you want to render to the root you must use server rendering. See ReactDOMServer.renderToString().') : _prodInvariant('58') : void 0;
|
2009 |
|
2010 | if (typeof markup === 'string') {
|
2011 | var newChild = createNodesFromMarkup(markup, emptyFunction)[0];
|
2012 | oldChild.parentNode.replaceChild(newChild, oldChild);
|
2013 | } else {
|
2014 | DOMLazyTree.replaceChildWithTree(oldChild, markup);
|
2015 | }
|
2016 | }
|
2017 |
|
2018 | };
|
2019 |
|
2020 | module.exports = Danger;
|
2021 | },{"153":153,"164":164,"169":169,"170":170,"178":178,"8":8}],13:[function(_dereq_,module,exports){
|
2022 |
|
2023 |
|
2024 |
|
2025 |
|
2026 |
|
2027 |
|
2028 |
|
2029 |
|
2030 |
|
2031 |
|
2032 |
|
2033 | 'use strict';
|
2034 |
|
2035 | var keyOf = _dereq_(182);
|
2036 |
|
2037 |
|
2038 |
|
2039 |
|
2040 |
|
2041 |
|
2042 |
|
2043 |
|
2044 |
|
2045 |
|
2046 | var DefaultEventPluginOrder = [keyOf({ ResponderEventPlugin: null }), keyOf({ SimpleEventPlugin: null }), keyOf({ TapEventPlugin: null }), keyOf({ EnterLeaveEventPlugin: null }), keyOf({ ChangeEventPlugin: null }), keyOf({ SelectEventPlugin: null }), keyOf({ BeforeInputEventPlugin: null })];
|
2047 |
|
2048 | module.exports = DefaultEventPluginOrder;
|
2049 | },{"182":182}],14:[function(_dereq_,module,exports){
|
2050 |
|
2051 |
|
2052 |
|
2053 |
|
2054 |
|
2055 |
|
2056 |
|
2057 |
|
2058 |
|
2059 |
|
2060 |
|
2061 | 'use strict';
|
2062 |
|
2063 | var disableableMouseListenerNames = {
|
2064 | onClick: true,
|
2065 | onDoubleClick: true,
|
2066 | onMouseDown: true,
|
2067 | onMouseMove: true,
|
2068 | onMouseUp: true,
|
2069 |
|
2070 | onClickCapture: true,
|
2071 | onDoubleClickCapture: true,
|
2072 | onMouseDownCapture: true,
|
2073 | onMouseMoveCapture: true,
|
2074 | onMouseUpCapture: true
|
2075 | };
|
2076 |
|
2077 |
|
2078 |
|
2079 |
|
2080 |
|
2081 | var DisabledInputUtils = {
|
2082 | getHostProps: function (inst, props) {
|
2083 | if (!props.disabled) {
|
2084 | return props;
|
2085 | }
|
2086 |
|
2087 |
|
2088 | var hostProps = {};
|
2089 | for (var key in props) {
|
2090 | if (!disableableMouseListenerNames[key] && props.hasOwnProperty(key)) {
|
2091 | hostProps[key] = props[key];
|
2092 | }
|
2093 | }
|
2094 |
|
2095 | return hostProps;
|
2096 | }
|
2097 | };
|
2098 |
|
2099 | module.exports = DisabledInputUtils;
|
2100 | },{}],15:[function(_dereq_,module,exports){
|
2101 |
|
2102 |
|
2103 |
|
2104 |
|
2105 |
|
2106 |
|
2107 |
|
2108 |
|
2109 |
|
2110 |
|
2111 |
|
2112 | 'use strict';
|
2113 |
|
2114 | var EventConstants = _dereq_(16);
|
2115 | var EventPropagators = _dereq_(20);
|
2116 | var ReactDOMComponentTree = _dereq_(46);
|
2117 | var SyntheticMouseEvent = _dereq_(122);
|
2118 |
|
2119 | var keyOf = _dereq_(182);
|
2120 |
|
2121 | var topLevelTypes = EventConstants.topLevelTypes;
|
2122 |
|
2123 | var eventTypes = {
|
2124 | mouseEnter: {
|
2125 | registrationName: keyOf({ onMouseEnter: null }),
|
2126 | dependencies: [topLevelTypes.topMouseOut, topLevelTypes.topMouseOver]
|
2127 | },
|
2128 | mouseLeave: {
|
2129 | registrationName: keyOf({ onMouseLeave: null }),
|
2130 | dependencies: [topLevelTypes.topMouseOut, topLevelTypes.topMouseOver]
|
2131 | }
|
2132 | };
|
2133 |
|
2134 | var EnterLeaveEventPlugin = {
|
2135 |
|
2136 | eventTypes: eventTypes,
|
2137 |
|
2138 | |
2139 |
|
2140 |
|
2141 |
|
2142 |
|
2143 |
|
2144 |
|
2145 | extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
|
2146 | if (topLevelType === topLevelTypes.topMouseOver && (nativeEvent.relatedTarget || nativeEvent.fromElement)) {
|
2147 | return null;
|
2148 | }
|
2149 | if (topLevelType !== topLevelTypes.topMouseOut && topLevelType !== topLevelTypes.topMouseOver) {
|
2150 |
|
2151 | return null;
|
2152 | }
|
2153 |
|
2154 | var win;
|
2155 | if (nativeEventTarget.window === nativeEventTarget) {
|
2156 |
|
2157 | win = nativeEventTarget;
|
2158 | } else {
|
2159 |
|
2160 | var doc = nativeEventTarget.ownerDocument;
|
2161 | if (doc) {
|
2162 | win = doc.defaultView || doc.parentWindow;
|
2163 | } else {
|
2164 | win = window;
|
2165 | }
|
2166 | }
|
2167 |
|
2168 | var from;
|
2169 | var to;
|
2170 | if (topLevelType === topLevelTypes.topMouseOut) {
|
2171 | from = targetInst;
|
2172 | var related = nativeEvent.relatedTarget || nativeEvent.toElement;
|
2173 | to = related ? ReactDOMComponentTree.getClosestInstanceFromNode(related) : null;
|
2174 | } else {
|
2175 |
|
2176 | from = null;
|
2177 | to = targetInst;
|
2178 | }
|
2179 |
|
2180 | if (from === to) {
|
2181 |
|
2182 | return null;
|
2183 | }
|
2184 |
|
2185 | var fromNode = from == null ? win : ReactDOMComponentTree.getNodeFromInstance(from);
|
2186 | var toNode = to == null ? win : ReactDOMComponentTree.getNodeFromInstance(to);
|
2187 |
|
2188 | var leave = SyntheticMouseEvent.getPooled(eventTypes.mouseLeave, from, nativeEvent, nativeEventTarget);
|
2189 | leave.type = 'mouseleave';
|
2190 | leave.target = fromNode;
|
2191 | leave.relatedTarget = toNode;
|
2192 |
|
2193 | var enter = SyntheticMouseEvent.getPooled(eventTypes.mouseEnter, to, nativeEvent, nativeEventTarget);
|
2194 | enter.type = 'mouseenter';
|
2195 | enter.target = toNode;
|
2196 | enter.relatedTarget = fromNode;
|
2197 |
|
2198 | EventPropagators.accumulateEnterLeaveDispatches(leave, enter, from, to);
|
2199 |
|
2200 | return [leave, enter];
|
2201 | }
|
2202 |
|
2203 | };
|
2204 |
|
2205 | module.exports = EnterLeaveEventPlugin;
|
2206 | },{"122":122,"16":16,"182":182,"20":20,"46":46}],16:[function(_dereq_,module,exports){
|
2207 |
|
2208 |
|
2209 |
|
2210 |
|
2211 |
|
2212 |
|
2213 |
|
2214 |
|
2215 |
|
2216 |
|
2217 |
|
2218 | 'use strict';
|
2219 |
|
2220 | var keyMirror = _dereq_(181);
|
2221 |
|
2222 | var PropagationPhases = keyMirror({ bubbled: null, captured: null });
|
2223 |
|
2224 |
|
2225 |
|
2226 |
|
2227 | var topLevelTypes = keyMirror({
|
2228 | topAbort: null,
|
2229 | topAnimationEnd: null,
|
2230 | topAnimationIteration: null,
|
2231 | topAnimationStart: null,
|
2232 | topBlur: null,
|
2233 | topCanPlay: null,
|
2234 | topCanPlayThrough: null,
|
2235 | topChange: null,
|
2236 | topClick: null,
|
2237 | topCompositionEnd: null,
|
2238 | topCompositionStart: null,
|
2239 | topCompositionUpdate: null,
|
2240 | topContextMenu: null,
|
2241 | topCopy: null,
|
2242 | topCut: null,
|
2243 | topDoubleClick: null,
|
2244 | topDrag: null,
|
2245 | topDragEnd: null,
|
2246 | topDragEnter: null,
|
2247 | topDragExit: null,
|
2248 | topDragLeave: null,
|
2249 | topDragOver: null,
|
2250 | topDragStart: null,
|
2251 | topDrop: null,
|
2252 | topDurationChange: null,
|
2253 | topEmptied: null,
|
2254 | topEncrypted: null,
|
2255 | topEnded: null,
|
2256 | topError: null,
|
2257 | topFocus: null,
|
2258 | topInput: null,
|
2259 | topInvalid: null,
|
2260 | topKeyDown: null,
|
2261 | topKeyPress: null,
|
2262 | topKeyUp: null,
|
2263 | topLoad: null,
|
2264 | topLoadedData: null,
|
2265 | topLoadedMetadata: null,
|
2266 | topLoadStart: null,
|
2267 | topMouseDown: null,
|
2268 | topMouseMove: null,
|
2269 | topMouseOut: null,
|
2270 | topMouseOver: null,
|
2271 | topMouseUp: null,
|
2272 | topPaste: null,
|
2273 | topPause: null,
|
2274 | topPlay: null,
|
2275 | topPlaying: null,
|
2276 | topProgress: null,
|
2277 | topRateChange: null,
|
2278 | topReset: null,
|
2279 | topScroll: null,
|
2280 | topSeeked: null,
|
2281 | topSeeking: null,
|
2282 | topSelectionChange: null,
|
2283 | topStalled: null,
|
2284 | topSubmit: null,
|
2285 | topSuspend: null,
|
2286 | topTextInput: null,
|
2287 | topTimeUpdate: null,
|
2288 | topTouchCancel: null,
|
2289 | topTouchEnd: null,
|
2290 | topTouchMove: null,
|
2291 | topTouchStart: null,
|
2292 | topTransitionEnd: null,
|
2293 | topVolumeChange: null,
|
2294 | topWaiting: null,
|
2295 | topWheel: null
|
2296 | });
|
2297 |
|
2298 | var EventConstants = {
|
2299 | topLevelTypes: topLevelTypes,
|
2300 | PropagationPhases: PropagationPhases
|
2301 | };
|
2302 |
|
2303 | module.exports = EventConstants;
|
2304 | },{"181":181}],17:[function(_dereq_,module,exports){
|
2305 |
|
2306 |
|
2307 |
|
2308 |
|
2309 |
|
2310 |
|
2311 |
|
2312 |
|
2313 |
|
2314 |
|
2315 |
|
2316 | 'use strict';
|
2317 |
|
2318 | var _prodInvariant = _dereq_(153);
|
2319 |
|
2320 | var EventPluginRegistry = _dereq_(18);
|
2321 | var EventPluginUtils = _dereq_(19);
|
2322 | var ReactErrorUtils = _dereq_(68);
|
2323 |
|
2324 | var accumulateInto = _dereq_(129);
|
2325 | var forEachAccumulated = _dereq_(138);
|
2326 | var invariant = _dereq_(178);
|
2327 |
|
2328 |
|
2329 |
|
2330 |
|
2331 | var listenerBank = {};
|
2332 |
|
2333 |
|
2334 |
|
2335 |
|
2336 |
|
2337 | var eventQueue = null;
|
2338 |
|
2339 |
|
2340 |
|
2341 |
|
2342 |
|
2343 |
|
2344 |
|
2345 |
|
2346 | var executeDispatchesAndRelease = function (event, simulated) {
|
2347 | if (event) {
|
2348 | EventPluginUtils.executeDispatchesInOrder(event, simulated);
|
2349 |
|
2350 | if (!event.isPersistent()) {
|
2351 | event.constructor.release(event);
|
2352 | }
|
2353 | }
|
2354 | };
|
2355 | var executeDispatchesAndReleaseSimulated = function (e) {
|
2356 | return executeDispatchesAndRelease(e, true);
|
2357 | };
|
2358 | var executeDispatchesAndReleaseTopLevel = function (e) {
|
2359 | return executeDispatchesAndRelease(e, false);
|
2360 | };
|
2361 |
|
2362 | var getDictionaryKey = function (inst) {
|
2363 |
|
2364 |
|
2365 | return '.' + inst._rootNodeID;
|
2366 | };
|
2367 |
|
2368 |
|
2369 |
|
2370 |
|
2371 |
|
2372 |
|
2373 |
|
2374 |
|
2375 |
|
2376 |
|
2377 |
|
2378 |
|
2379 |
|
2380 |
|
2381 |
|
2382 |
|
2383 |
|
2384 |
|
2385 |
|
2386 |
|
2387 |
|
2388 |
|
2389 |
|
2390 | var EventPluginHub = {
|
2391 |
|
2392 | |
2393 |
|
2394 |
|
2395 | injection: {
|
2396 |
|
2397 | |
2398 |
|
2399 |
|
2400 |
|
2401 | injectEventPluginOrder: EventPluginRegistry.injectEventPluginOrder,
|
2402 |
|
2403 | |
2404 |
|
2405 |
|
2406 | injectEventPluginsByName: EventPluginRegistry.injectEventPluginsByName
|
2407 |
|
2408 | },
|
2409 |
|
2410 | |
2411 |
|
2412 |
|
2413 |
|
2414 |
|
2415 |
|
2416 |
|
2417 | putListener: function (inst, registrationName, listener) {
|
2418 | !(typeof listener === 'function') ? "development" !== 'production' ? invariant(false, 'Expected %s listener to be a function, instead got type %s', registrationName, typeof listener) : _prodInvariant('94', registrationName, typeof listener) : void 0;
|
2419 |
|
2420 | var key = getDictionaryKey(inst);
|
2421 | var bankForRegistrationName = listenerBank[registrationName] || (listenerBank[registrationName] = {});
|
2422 | bankForRegistrationName[key] = listener;
|
2423 |
|
2424 | var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
|
2425 | if (PluginModule && PluginModule.didPutListener) {
|
2426 | PluginModule.didPutListener(inst, registrationName, listener);
|
2427 | }
|
2428 | },
|
2429 |
|
2430 | |
2431 |
|
2432 |
|
2433 |
|
2434 |
|
2435 | getListener: function (inst, registrationName) {
|
2436 | var bankForRegistrationName = listenerBank[registrationName];
|
2437 | var key = getDictionaryKey(inst);
|
2438 | return bankForRegistrationName && bankForRegistrationName[key];
|
2439 | },
|
2440 |
|
2441 | |
2442 |
|
2443 |
|
2444 |
|
2445 |
|
2446 |
|
2447 | deleteListener: function (inst, registrationName) {
|
2448 | var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
|
2449 | if (PluginModule && PluginModule.willDeleteListener) {
|
2450 | PluginModule.willDeleteListener(inst, registrationName);
|
2451 | }
|
2452 |
|
2453 | var bankForRegistrationName = listenerBank[registrationName];
|
2454 |
|
2455 | if (bankForRegistrationName) {
|
2456 | var key = getDictionaryKey(inst);
|
2457 | delete bankForRegistrationName[key];
|
2458 | }
|
2459 | },
|
2460 |
|
2461 | |
2462 |
|
2463 |
|
2464 |
|
2465 |
|
2466 | deleteAllListeners: function (inst) {
|
2467 | var key = getDictionaryKey(inst);
|
2468 | for (var registrationName in listenerBank) {
|
2469 | if (!listenerBank.hasOwnProperty(registrationName)) {
|
2470 | continue;
|
2471 | }
|
2472 |
|
2473 | if (!listenerBank[registrationName][key]) {
|
2474 | continue;
|
2475 | }
|
2476 |
|
2477 | var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
|
2478 | if (PluginModule && PluginModule.willDeleteListener) {
|
2479 | PluginModule.willDeleteListener(inst, registrationName);
|
2480 | }
|
2481 |
|
2482 | delete listenerBank[registrationName][key];
|
2483 | }
|
2484 | },
|
2485 |
|
2486 | |
2487 |
|
2488 |
|
2489 |
|
2490 |
|
2491 |
|
2492 |
|
2493 | extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
|
2494 | var events;
|
2495 | var plugins = EventPluginRegistry.plugins;
|
2496 | for (var i = 0; i < plugins.length; i++) {
|
2497 |
|
2498 | var possiblePlugin = plugins[i];
|
2499 | if (possiblePlugin) {
|
2500 | var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
|
2501 | if (extractedEvents) {
|
2502 | events = accumulateInto(events, extractedEvents);
|
2503 | }
|
2504 | }
|
2505 | }
|
2506 | return events;
|
2507 | },
|
2508 |
|
2509 | |
2510 |
|
2511 |
|
2512 |
|
2513 |
|
2514 |
|
2515 |
|
2516 | enqueueEvents: function (events) {
|
2517 | if (events) {
|
2518 | eventQueue = accumulateInto(eventQueue, events);
|
2519 | }
|
2520 | },
|
2521 |
|
2522 | |
2523 |
|
2524 |
|
2525 |
|
2526 |
|
2527 | processEventQueue: function (simulated) {
|
2528 |
|
2529 |
|
2530 | var processingEventQueue = eventQueue;
|
2531 | eventQueue = null;
|
2532 | if (simulated) {
|
2533 | forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated);
|
2534 | } else {
|
2535 | forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);
|
2536 | }
|
2537 | !!eventQueue ? "development" !== 'production' ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.') : _prodInvariant('95') : void 0;
|
2538 |
|
2539 | ReactErrorUtils.rethrowCaughtError();
|
2540 | },
|
2541 |
|
2542 | |
2543 |
|
2544 |
|
2545 | __purge: function () {
|
2546 | listenerBank = {};
|
2547 | },
|
2548 |
|
2549 | __getListenerBank: function () {
|
2550 | return listenerBank;
|
2551 | }
|
2552 |
|
2553 | };
|
2554 |
|
2555 | module.exports = EventPluginHub;
|
2556 | },{"129":129,"138":138,"153":153,"178":178,"18":18,"19":19,"68":68}],18:[function(_dereq_,module,exports){
|
2557 |
|
2558 |
|
2559 |
|
2560 |
|
2561 |
|
2562 |
|
2563 |
|
2564 |
|
2565 |
|
2566 |
|
2567 |
|
2568 | 'use strict';
|
2569 |
|
2570 | var _prodInvariant = _dereq_(153);
|
2571 |
|
2572 | var invariant = _dereq_(178);
|
2573 |
|
2574 |
|
2575 |
|
2576 |
|
2577 | var EventPluginOrder = null;
|
2578 |
|
2579 |
|
2580 |
|
2581 |
|
2582 | var namesToPlugins = {};
|
2583 |
|
2584 |
|
2585 |
|
2586 |
|
2587 |
|
2588 |
|
2589 | function recomputePluginOrdering() {
|
2590 | if (!EventPluginOrder) {
|
2591 |
|
2592 | return;
|
2593 | }
|
2594 | for (var pluginName in namesToPlugins) {
|
2595 | var PluginModule = namesToPlugins[pluginName];
|
2596 | var pluginIndex = EventPluginOrder.indexOf(pluginName);
|
2597 | !(pluginIndex > -1) ? "development" !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : _prodInvariant('96', pluginName) : void 0;
|
2598 | if (EventPluginRegistry.plugins[pluginIndex]) {
|
2599 | continue;
|
2600 | }
|
2601 | !PluginModule.extractEvents ? "development" !== 'production' ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : _prodInvariant('97', pluginName) : void 0;
|
2602 | EventPluginRegistry.plugins[pluginIndex] = PluginModule;
|
2603 | var publishedEvents = PluginModule.eventTypes;
|
2604 | for (var eventName in publishedEvents) {
|
2605 | !publishEventForPlugin(publishedEvents[eventName], PluginModule, eventName) ? "development" !== 'production' ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : _prodInvariant('98', eventName, pluginName) : void 0;
|
2606 | }
|
2607 | }
|
2608 | }
|
2609 |
|
2610 |
|
2611 |
|
2612 |
|
2613 |
|
2614 |
|
2615 |
|
2616 |
|
2617 |
|
2618 | function publishEventForPlugin(dispatchConfig, PluginModule, eventName) {
|
2619 | !!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName) ? "development" !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same event name, `%s`.', eventName) : _prodInvariant('99', eventName) : void 0;
|
2620 | EventPluginRegistry.eventNameDispatchConfigs[eventName] = dispatchConfig;
|
2621 |
|
2622 | var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
|
2623 | if (phasedRegistrationNames) {
|
2624 | for (var phaseName in phasedRegistrationNames) {
|
2625 | if (phasedRegistrationNames.hasOwnProperty(phaseName)) {
|
2626 | var phasedRegistrationName = phasedRegistrationNames[phaseName];
|
2627 | publishRegistrationName(phasedRegistrationName, PluginModule, eventName);
|
2628 | }
|
2629 | }
|
2630 | return true;
|
2631 | } else if (dispatchConfig.registrationName) {
|
2632 | publishRegistrationName(dispatchConfig.registrationName, PluginModule, eventName);
|
2633 | return true;
|
2634 | }
|
2635 | return false;
|
2636 | }
|
2637 |
|
2638 |
|
2639 |
|
2640 |
|
2641 |
|
2642 |
|
2643 |
|
2644 |
|
2645 |
|
2646 | function publishRegistrationName(registrationName, PluginModule, eventName) {
|
2647 | !!EventPluginRegistry.registrationNameModules[registrationName] ? "development" !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same registration name, `%s`.', registrationName) : _prodInvariant('100', registrationName) : void 0;
|
2648 | EventPluginRegistry.registrationNameModules[registrationName] = PluginModule;
|
2649 | EventPluginRegistry.registrationNameDependencies[registrationName] = PluginModule.eventTypes[eventName].dependencies;
|
2650 |
|
2651 | if ("development" !== 'production') {
|
2652 | var lowerCasedName = registrationName.toLowerCase();
|
2653 | EventPluginRegistry.possibleRegistrationNames[lowerCasedName] = registrationName;
|
2654 |
|
2655 | if (registrationName === 'onDoubleClick') {
|
2656 | EventPluginRegistry.possibleRegistrationNames.ondblclick = registrationName;
|
2657 | }
|
2658 | }
|
2659 | }
|
2660 |
|
2661 |
|
2662 |
|
2663 |
|
2664 |
|
2665 |
|
2666 | var EventPluginRegistry = {
|
2667 |
|
2668 | |
2669 |
|
2670 |
|
2671 | plugins: [],
|
2672 |
|
2673 | |
2674 |
|
2675 |
|
2676 | eventNameDispatchConfigs: {},
|
2677 |
|
2678 | |
2679 |
|
2680 |
|
2681 | registrationNameModules: {},
|
2682 |
|
2683 | |
2684 |
|
2685 |
|
2686 | registrationNameDependencies: {},
|
2687 |
|
2688 | |
2689 |
|
2690 |
|
2691 |
|
2692 |
|
2693 |
|
2694 | possibleRegistrationNames: "development" !== 'production' ? {} : null,
|
2695 |
|
2696 | |
2697 |
|
2698 |
|
2699 |
|
2700 |
|
2701 |
|
2702 |
|
2703 |
|
2704 |
|
2705 | injectEventPluginOrder: function (InjectedEventPluginOrder) {
|
2706 | !!EventPluginOrder ? "development" !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React.') : _prodInvariant('101') : void 0;
|
2707 |
|
2708 | EventPluginOrder = Array.prototype.slice.call(InjectedEventPluginOrder);
|
2709 | recomputePluginOrdering();
|
2710 | },
|
2711 |
|
2712 | |
2713 |
|
2714 |
|
2715 |
|
2716 |
|
2717 |
|
2718 |
|
2719 |
|
2720 |
|
2721 |
|
2722 | injectEventPluginsByName: function (injectedNamesToPlugins) {
|
2723 | var isOrderingDirty = false;
|
2724 | for (var pluginName in injectedNamesToPlugins) {
|
2725 | if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) {
|
2726 | continue;
|
2727 | }
|
2728 | var PluginModule = injectedNamesToPlugins[pluginName];
|
2729 | if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== PluginModule) {
|
2730 | !!namesToPlugins[pluginName] ? "development" !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject two different event plugins using the same name, `%s`.', pluginName) : _prodInvariant('102', pluginName) : void 0;
|
2731 | namesToPlugins[pluginName] = PluginModule;
|
2732 | isOrderingDirty = true;
|
2733 | }
|
2734 | }
|
2735 | if (isOrderingDirty) {
|
2736 | recomputePluginOrdering();
|
2737 | }
|
2738 | },
|
2739 |
|
2740 | |
2741 |
|
2742 |
|
2743 |
|
2744 |
|
2745 |
|
2746 |
|
2747 | getPluginModuleForEvent: function (event) {
|
2748 | var dispatchConfig = event.dispatchConfig;
|
2749 | if (dispatchConfig.registrationName) {
|
2750 | return EventPluginRegistry.registrationNameModules[dispatchConfig.registrationName] || null;
|
2751 | }
|
2752 | for (var phase in dispatchConfig.phasedRegistrationNames) {
|
2753 | if (!dispatchConfig.phasedRegistrationNames.hasOwnProperty(phase)) {
|
2754 | continue;
|
2755 | }
|
2756 | var PluginModule = EventPluginRegistry.registrationNameModules[dispatchConfig.phasedRegistrationNames[phase]];
|
2757 | if (PluginModule) {
|
2758 | return PluginModule;
|
2759 | }
|
2760 | }
|
2761 | return null;
|
2762 | },
|
2763 |
|
2764 | |
2765 |
|
2766 |
|
2767 |
|
2768 | _resetEventPlugins: function () {
|
2769 | EventPluginOrder = null;
|
2770 | for (var pluginName in namesToPlugins) {
|
2771 | if (namesToPlugins.hasOwnProperty(pluginName)) {
|
2772 | delete namesToPlugins[pluginName];
|
2773 | }
|
2774 | }
|
2775 | EventPluginRegistry.plugins.length = 0;
|
2776 |
|
2777 | var eventNameDispatchConfigs = EventPluginRegistry.eventNameDispatchConfigs;
|
2778 | for (var eventName in eventNameDispatchConfigs) {
|
2779 | if (eventNameDispatchConfigs.hasOwnProperty(eventName)) {
|
2780 | delete eventNameDispatchConfigs[eventName];
|
2781 | }
|
2782 | }
|
2783 |
|
2784 | var registrationNameModules = EventPluginRegistry.registrationNameModules;
|
2785 | for (var registrationName in registrationNameModules) {
|
2786 | if (registrationNameModules.hasOwnProperty(registrationName)) {
|
2787 | delete registrationNameModules[registrationName];
|
2788 | }
|
2789 | }
|
2790 |
|
2791 | if ("development" !== 'production') {
|
2792 | var possibleRegistrationNames = EventPluginRegistry.possibleRegistrationNames;
|
2793 | for (var lowerCasedName in possibleRegistrationNames) {
|
2794 | if (possibleRegistrationNames.hasOwnProperty(lowerCasedName)) {
|
2795 | delete possibleRegistrationNames[lowerCasedName];
|
2796 | }
|
2797 | }
|
2798 | }
|
2799 | }
|
2800 |
|
2801 | };
|
2802 |
|
2803 | module.exports = EventPluginRegistry;
|
2804 | },{"153":153,"178":178}],19:[function(_dereq_,module,exports){
|
2805 |
|
2806 |
|
2807 |
|
2808 |
|
2809 |
|
2810 |
|
2811 |
|
2812 |
|
2813 |
|
2814 |
|
2815 |
|
2816 | 'use strict';
|
2817 |
|
2818 | var _prodInvariant = _dereq_(153);
|
2819 |
|
2820 | var EventConstants = _dereq_(16);
|
2821 | var ReactErrorUtils = _dereq_(68);
|
2822 |
|
2823 | var invariant = _dereq_(178);
|
2824 | var warning = _dereq_(187);
|
2825 |
|
2826 |
|
2827 |
|
2828 |
|
2829 |
|
2830 |
|
2831 |
|
2832 |
|
2833 |
|
2834 | var ComponentTree;
|
2835 | var TreeTraversal;
|
2836 | var injection = {
|
2837 | injectComponentTree: function (Injected) {
|
2838 | ComponentTree = Injected;
|
2839 | if ("development" !== 'production') {
|
2840 | "development" !== 'production' ? warning(Injected && Injected.getNodeFromInstance && Injected.getInstanceFromNode, 'EventPluginUtils.injection.injectComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.') : void 0;
|
2841 | }
|
2842 | },
|
2843 | injectTreeTraversal: function (Injected) {
|
2844 | TreeTraversal = Injected;
|
2845 | if ("development" !== 'production') {
|
2846 | "development" !== 'production' ? warning(Injected && Injected.isAncestor && Injected.getLowestCommonAncestor, 'EventPluginUtils.injection.injectTreeTraversal(...): Injected ' + 'module is missing isAncestor or getLowestCommonAncestor.') : void 0;
|
2847 | }
|
2848 | }
|
2849 | };
|
2850 |
|
2851 | var topLevelTypes = EventConstants.topLevelTypes;
|
2852 |
|
2853 | function isEndish(topLevelType) {
|
2854 | return topLevelType === topLevelTypes.topMouseUp || topLevelType === topLevelTypes.topTouchEnd || topLevelType === topLevelTypes.topTouchCancel;
|
2855 | }
|
2856 |
|
2857 | function isMoveish(topLevelType) {
|
2858 | return topLevelType === topLevelTypes.topMouseMove || topLevelType === topLevelTypes.topTouchMove;
|
2859 | }
|
2860 | function isStartish(topLevelType) {
|
2861 | return topLevelType === topLevelTypes.topMouseDown || topLevelType === topLevelTypes.topTouchStart;
|
2862 | }
|
2863 |
|
2864 | var validateEventDispatches;
|
2865 | if ("development" !== 'production') {
|
2866 | validateEventDispatches = function (event) {
|
2867 | var dispatchListeners = event._dispatchListeners;
|
2868 | var dispatchInstances = event._dispatchInstances;
|
2869 |
|
2870 | var listenersIsArr = Array.isArray(dispatchListeners);
|
2871 | var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0;
|
2872 |
|
2873 | var instancesIsArr = Array.isArray(dispatchInstances);
|
2874 | var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0;
|
2875 |
|
2876 | "development" !== 'production' ? warning(instancesIsArr === listenersIsArr && instancesLen === listenersLen, 'EventPluginUtils: Invalid `event`.') : void 0;
|
2877 | };
|
2878 | }
|
2879 |
|
2880 |
|
2881 |
|
2882 |
|
2883 |
|
2884 |
|
2885 |
|
2886 |
|
2887 | function executeDispatch(event, simulated, listener, inst) {
|
2888 | var type = event.type || 'unknown-event';
|
2889 | event.currentTarget = EventPluginUtils.getNodeFromInstance(inst);
|
2890 | if (simulated) {
|
2891 | ReactErrorUtils.invokeGuardedCallbackWithCatch(type, listener, event);
|
2892 | } else {
|
2893 | ReactErrorUtils.invokeGuardedCallback(type, listener, event);
|
2894 | }
|
2895 | event.currentTarget = null;
|
2896 | }
|
2897 |
|
2898 |
|
2899 |
|
2900 |
|
2901 | function executeDispatchesInOrder(event, simulated) {
|
2902 | var dispatchListeners = event._dispatchListeners;
|
2903 | var dispatchInstances = event._dispatchInstances;
|
2904 | if ("development" !== 'production') {
|
2905 | validateEventDispatches(event);
|
2906 | }
|
2907 | if (Array.isArray(dispatchListeners)) {
|
2908 | for (var i = 0; i < dispatchListeners.length; i++) {
|
2909 | if (event.isPropagationStopped()) {
|
2910 | break;
|
2911 | }
|
2912 |
|
2913 | executeDispatch(event, simulated, dispatchListeners[i], dispatchInstances[i]);
|
2914 | }
|
2915 | } else if (dispatchListeners) {
|
2916 | executeDispatch(event, simulated, dispatchListeners, dispatchInstances);
|
2917 | }
|
2918 | event._dispatchListeners = null;
|
2919 | event._dispatchInstances = null;
|
2920 | }
|
2921 |
|
2922 |
|
2923 |
|
2924 |
|
2925 |
|
2926 |
|
2927 |
|
2928 |
|
2929 | function executeDispatchesInOrderStopAtTrueImpl(event) {
|
2930 | var dispatchListeners = event._dispatchListeners;
|
2931 | var dispatchInstances = event._dispatchInstances;
|
2932 | if ("development" !== 'production') {
|
2933 | validateEventDispatches(event);
|
2934 | }
|
2935 | if (Array.isArray(dispatchListeners)) {
|
2936 | for (var i = 0; i < dispatchListeners.length; i++) {
|
2937 | if (event.isPropagationStopped()) {
|
2938 | break;
|
2939 | }
|
2940 |
|
2941 | if (dispatchListeners[i](event, dispatchInstances[i])) {
|
2942 | return dispatchInstances[i];
|
2943 | }
|
2944 | }
|
2945 | } else if (dispatchListeners) {
|
2946 | if (dispatchListeners(event, dispatchInstances)) {
|
2947 | return dispatchInstances;
|
2948 | }
|
2949 | }
|
2950 | return null;
|
2951 | }
|
2952 |
|
2953 |
|
2954 |
|
2955 |
|
2956 | function executeDispatchesInOrderStopAtTrue(event) {
|
2957 | var ret = executeDispatchesInOrderStopAtTrueImpl(event);
|
2958 | event._dispatchInstances = null;
|
2959 | event._dispatchListeners = null;
|
2960 | return ret;
|
2961 | }
|
2962 |
|
2963 |
|
2964 |
|
2965 |
|
2966 |
|
2967 |
|
2968 |
|
2969 |
|
2970 |
|
2971 |
|
2972 | function executeDirectDispatch(event) {
|
2973 | if ("development" !== 'production') {
|
2974 | validateEventDispatches(event);
|
2975 | }
|
2976 | var dispatchListener = event._dispatchListeners;
|
2977 | var dispatchInstance = event._dispatchInstances;
|
2978 | !!Array.isArray(dispatchListener) ? "development" !== 'production' ? invariant(false, 'executeDirectDispatch(...): Invalid `event`.') : _prodInvariant('103') : void 0;
|
2979 | event.currentTarget = dispatchListener ? EventPluginUtils.getNodeFromInstance(dispatchInstance) : null;
|
2980 | var res = dispatchListener ? dispatchListener(event) : null;
|
2981 | event.currentTarget = null;
|
2982 | event._dispatchListeners = null;
|
2983 | event._dispatchInstances = null;
|
2984 | return res;
|
2985 | }
|
2986 |
|
2987 |
|
2988 |
|
2989 |
|
2990 |
|
2991 | function hasDispatches(event) {
|
2992 | return !!event._dispatchListeners;
|
2993 | }
|
2994 |
|
2995 |
|
2996 |
|
2997 |
|
2998 | var EventPluginUtils = {
|
2999 | isEndish: isEndish,
|
3000 | isMoveish: isMoveish,
|
3001 | isStartish: isStartish,
|
3002 |
|
3003 | executeDirectDispatch: executeDirectDispatch,
|
3004 | executeDispatchesInOrder: executeDispatchesInOrder,
|
3005 | executeDispatchesInOrderStopAtTrue: executeDispatchesInOrderStopAtTrue,
|
3006 | hasDispatches: hasDispatches,
|
3007 |
|
3008 | getInstanceFromNode: function (node) {
|
3009 | return ComponentTree.getInstanceFromNode(node);
|
3010 | },
|
3011 | getNodeFromInstance: function (node) {
|
3012 | return ComponentTree.getNodeFromInstance(node);
|
3013 | },
|
3014 | isAncestor: function (a, b) {
|
3015 | return TreeTraversal.isAncestor(a, b);
|
3016 | },
|
3017 | getLowestCommonAncestor: function (a, b) {
|
3018 | return TreeTraversal.getLowestCommonAncestor(a, b);
|
3019 | },
|
3020 | getParentInstance: function (inst) {
|
3021 | return TreeTraversal.getParentInstance(inst);
|
3022 | },
|
3023 | traverseTwoPhase: function (target, fn, arg) {
|
3024 | return TreeTraversal.traverseTwoPhase(target, fn, arg);
|
3025 | },
|
3026 | traverseEnterLeave: function (from, to, fn, argFrom, argTo) {
|
3027 | return TreeTraversal.traverseEnterLeave(from, to, fn, argFrom, argTo);
|
3028 | },
|
3029 |
|
3030 | injection: injection
|
3031 | };
|
3032 |
|
3033 | module.exports = EventPluginUtils;
|
3034 | },{"153":153,"16":16,"178":178,"187":187,"68":68}],20:[function(_dereq_,module,exports){
|
3035 |
|
3036 |
|
3037 |
|
3038 |
|
3039 |
|
3040 |
|
3041 |
|
3042 |
|
3043 |
|
3044 |
|
3045 |
|
3046 | 'use strict';
|
3047 |
|
3048 | var EventConstants = _dereq_(16);
|
3049 | var EventPluginHub = _dereq_(17);
|
3050 | var EventPluginUtils = _dereq_(19);
|
3051 |
|
3052 | var accumulateInto = _dereq_(129);
|
3053 | var forEachAccumulated = _dereq_(138);
|
3054 | var warning = _dereq_(187);
|
3055 |
|
3056 | var PropagationPhases = EventConstants.PropagationPhases;
|
3057 | var getListener = EventPluginHub.getListener;
|
3058 |
|
3059 |
|
3060 |
|
3061 |
|
3062 |
|
3063 | function listenerAtPhase(inst, event, propagationPhase) {
|
3064 | var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];
|
3065 | return getListener(inst, registrationName);
|
3066 | }
|
3067 |
|
3068 |
|
3069 |
|
3070 |
|
3071 |
|
3072 |
|
3073 |
|
3074 | function accumulateDirectionalDispatches(inst, upwards, event) {
|
3075 | if ("development" !== 'production') {
|
3076 | "development" !== 'production' ? warning(inst, 'Dispatching inst must not be null') : void 0;
|
3077 | }
|
3078 | var phase = upwards ? PropagationPhases.bubbled : PropagationPhases.captured;
|
3079 | var listener = listenerAtPhase(inst, event, phase);
|
3080 | if (listener) {
|
3081 | event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
|
3082 | event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
|
3083 | }
|
3084 | }
|
3085 |
|
3086 |
|
3087 |
|
3088 |
|
3089 |
|
3090 |
|
3091 |
|
3092 |
|
3093 | function accumulateTwoPhaseDispatchesSingle(event) {
|
3094 | if (event && event.dispatchConfig.phasedRegistrationNames) {
|
3095 | EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);
|
3096 | }
|
3097 | }
|
3098 |
|
3099 |
|
3100 |
|
3101 |
|
3102 | function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {
|
3103 | if (event && event.dispatchConfig.phasedRegistrationNames) {
|
3104 | var targetInst = event._targetInst;
|
3105 | var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;
|
3106 | EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);
|
3107 | }
|
3108 | }
|
3109 |
|
3110 |
|
3111 |
|
3112 |
|
3113 |
|
3114 |
|
3115 | function accumulateDispatches(inst, ignoredDirection, event) {
|
3116 | if (event && event.dispatchConfig.registrationName) {
|
3117 | var registrationName = event.dispatchConfig.registrationName;
|
3118 | var listener = getListener(inst, registrationName);
|
3119 | if (listener) {
|
3120 | event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
|
3121 | event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
|
3122 | }
|
3123 | }
|
3124 | }
|
3125 |
|
3126 |
|
3127 |
|
3128 |
|
3129 |
|
3130 |
|
3131 | function accumulateDirectDispatchesSingle(event) {
|
3132 | if (event && event.dispatchConfig.registrationName) {
|
3133 | accumulateDispatches(event._targetInst, null, event);
|
3134 | }
|
3135 | }
|
3136 |
|
3137 | function accumulateTwoPhaseDispatches(events) {
|
3138 | forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle);
|
3139 | }
|
3140 |
|
3141 | function accumulateTwoPhaseDispatchesSkipTarget(events) {
|
3142 | forEachAccumulated(events, accumulateTwoPhaseDispatchesSingleSkipTarget);
|
3143 | }
|
3144 |
|
3145 | function accumulateEnterLeaveDispatches(leave, enter, from, to) {
|
3146 | EventPluginUtils.traverseEnterLeave(from, to, accumulateDispatches, leave, enter);
|
3147 | }
|
3148 |
|
3149 | function accumulateDirectDispatches(events) {
|
3150 | forEachAccumulated(events, accumulateDirectDispatchesSingle);
|
3151 | }
|
3152 |
|
3153 |
|
3154 |
|
3155 |
|
3156 |
|
3157 |
|
3158 |
|
3159 |
|
3160 |
|
3161 |
|
3162 |
|
3163 |
|
3164 | var EventPropagators = {
|
3165 | accumulateTwoPhaseDispatches: accumulateTwoPhaseDispatches,
|
3166 | accumulateTwoPhaseDispatchesSkipTarget: accumulateTwoPhaseDispatchesSkipTarget,
|
3167 | accumulateDirectDispatches: accumulateDirectDispatches,
|
3168 | accumulateEnterLeaveDispatches: accumulateEnterLeaveDispatches
|
3169 | };
|
3170 |
|
3171 | module.exports = EventPropagators;
|
3172 | },{"129":129,"138":138,"16":16,"17":17,"187":187,"19":19}],21:[function(_dereq_,module,exports){
|
3173 |
|
3174 |
|
3175 |
|
3176 |
|
3177 |
|
3178 |
|
3179 |
|
3180 |
|
3181 |
|
3182 |
|
3183 |
|
3184 | 'use strict';
|
3185 |
|
3186 | var _assign = _dereq_(188);
|
3187 |
|
3188 | var PooledClass = _dereq_(26);
|
3189 |
|
3190 | var getTextContentAccessor = _dereq_(146);
|
3191 |
|
3192 |
|
3193 |
|
3194 |
|
3195 |
|
3196 |
|
3197 |
|
3198 |
|
3199 |
|
3200 |
|
3201 |
|
3202 |
|
3203 | function FallbackCompositionState(root) {
|
3204 | this._root = root;
|
3205 | this._startText = this.getText();
|
3206 | this._fallbackText = null;
|
3207 | }
|
3208 |
|
3209 | _assign(FallbackCompositionState.prototype, {
|
3210 | destructor: function () {
|
3211 | this._root = null;
|
3212 | this._startText = null;
|
3213 | this._fallbackText = null;
|
3214 | },
|
3215 |
|
3216 | |
3217 |
|
3218 |
|
3219 |
|
3220 |
|
3221 | getText: function () {
|
3222 | if ('value' in this._root) {
|
3223 | return this._root.value;
|
3224 | }
|
3225 | return this._root[getTextContentAccessor()];
|
3226 | },
|
3227 |
|
3228 | |
3229 |
|
3230 |
|
3231 |
|
3232 |
|
3233 |
|
3234 | getData: function () {
|
3235 | if (this._fallbackText) {
|
3236 | return this._fallbackText;
|
3237 | }
|
3238 |
|
3239 | var start;
|
3240 | var startValue = this._startText;
|
3241 | var startLength = startValue.length;
|
3242 | var end;
|
3243 | var endValue = this.getText();
|
3244 | var endLength = endValue.length;
|
3245 |
|
3246 | for (start = 0; start < startLength; start++) {
|
3247 | if (startValue[start] !== endValue[start]) {
|
3248 | break;
|
3249 | }
|
3250 | }
|
3251 |
|
3252 | var minEnd = startLength - start;
|
3253 | for (end = 1; end <= minEnd; end++) {
|
3254 | if (startValue[startLength - end] !== endValue[endLength - end]) {
|
3255 | break;
|
3256 | }
|
3257 | }
|
3258 |
|
3259 | var sliceTail = end > 1 ? 1 - end : undefined;
|
3260 | this._fallbackText = endValue.slice(start, sliceTail);
|
3261 | return this._fallbackText;
|
3262 | }
|
3263 | });
|
3264 |
|
3265 | PooledClass.addPoolingTo(FallbackCompositionState);
|
3266 |
|
3267 | module.exports = FallbackCompositionState;
|
3268 | },{"146":146,"188":188,"26":26}],22:[function(_dereq_,module,exports){
|
3269 |
|
3270 |
|
3271 |
|
3272 |
|
3273 |
|
3274 |
|
3275 |
|
3276 |
|
3277 |
|
3278 |
|
3279 |
|
3280 | 'use strict';
|
3281 |
|
3282 | var DOMProperty = _dereq_(10);
|
3283 |
|
3284 | var MUST_USE_PROPERTY = DOMProperty.injection.MUST_USE_PROPERTY;
|
3285 | var HAS_BOOLEAN_VALUE = DOMProperty.injection.HAS_BOOLEAN_VALUE;
|
3286 | var HAS_NUMERIC_VALUE = DOMProperty.injection.HAS_NUMERIC_VALUE;
|
3287 | var HAS_POSITIVE_NUMERIC_VALUE = DOMProperty.injection.HAS_POSITIVE_NUMERIC_VALUE;
|
3288 | var HAS_OVERLOADED_BOOLEAN_VALUE = DOMProperty.injection.HAS_OVERLOADED_BOOLEAN_VALUE;
|
3289 |
|
3290 | var HTMLDOMPropertyConfig = {
|
3291 | isCustomAttribute: RegExp.prototype.test.bind(new RegExp('^(data|aria)-[' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$')),
|
3292 | Properties: {
|
3293 | |
3294 |
|
3295 |
|
3296 | accept: 0,
|
3297 | acceptCharset: 0,
|
3298 | accessKey: 0,
|
3299 | action: 0,
|
3300 | allowFullScreen: HAS_BOOLEAN_VALUE,
|
3301 | allowTransparency: 0,
|
3302 | alt: 0,
|
3303 |
|
3304 | as: 0,
|
3305 | async: HAS_BOOLEAN_VALUE,
|
3306 | autoComplete: 0,
|
3307 |
|
3308 |
|
3309 | autoPlay: HAS_BOOLEAN_VALUE,
|
3310 | capture: HAS_BOOLEAN_VALUE,
|
3311 | cellPadding: 0,
|
3312 | cellSpacing: 0,
|
3313 | charSet: 0,
|
3314 | challenge: 0,
|
3315 | checked: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
|
3316 | cite: 0,
|
3317 | classID: 0,
|
3318 | className: 0,
|
3319 | cols: HAS_POSITIVE_NUMERIC_VALUE,
|
3320 | colSpan: 0,
|
3321 | content: 0,
|
3322 | contentEditable: 0,
|
3323 | contextMenu: 0,
|
3324 | controls: HAS_BOOLEAN_VALUE,
|
3325 | coords: 0,
|
3326 | crossOrigin: 0,
|
3327 | data: 0,
|
3328 | dateTime: 0,
|
3329 | 'default': HAS_BOOLEAN_VALUE,
|
3330 | defer: HAS_BOOLEAN_VALUE,
|
3331 | dir: 0,
|
3332 | disabled: HAS_BOOLEAN_VALUE,
|
3333 | download: HAS_OVERLOADED_BOOLEAN_VALUE,
|
3334 | draggable: 0,
|
3335 | encType: 0,
|
3336 | form: 0,
|
3337 | formAction: 0,
|
3338 | formEncType: 0,
|
3339 | formMethod: 0,
|
3340 | formNoValidate: HAS_BOOLEAN_VALUE,
|
3341 | formTarget: 0,
|
3342 | frameBorder: 0,
|
3343 | headers: 0,
|
3344 | height: 0,
|
3345 | hidden: HAS_BOOLEAN_VALUE,
|
3346 | high: 0,
|
3347 | href: 0,
|
3348 | hrefLang: 0,
|
3349 | htmlFor: 0,
|
3350 | httpEquiv: 0,
|
3351 | icon: 0,
|
3352 | id: 0,
|
3353 | inputMode: 0,
|
3354 | integrity: 0,
|
3355 | is: 0,
|
3356 | keyParams: 0,
|
3357 | keyType: 0,
|
3358 | kind: 0,
|
3359 | label: 0,
|
3360 | lang: 0,
|
3361 | list: 0,
|
3362 | loop: HAS_BOOLEAN_VALUE,
|
3363 | low: 0,
|
3364 | manifest: 0,
|
3365 | marginHeight: 0,
|
3366 | marginWidth: 0,
|
3367 | max: 0,
|
3368 | maxLength: 0,
|
3369 | media: 0,
|
3370 | mediaGroup: 0,
|
3371 | method: 0,
|
3372 | min: 0,
|
3373 | minLength: 0,
|
3374 |
|
3375 |
|
3376 | multiple: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
|
3377 | muted: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
|
3378 | name: 0,
|
3379 | nonce: 0,
|
3380 | noValidate: HAS_BOOLEAN_VALUE,
|
3381 | open: HAS_BOOLEAN_VALUE,
|
3382 | optimum: 0,
|
3383 | pattern: 0,
|
3384 | placeholder: 0,
|
3385 | playsInline: HAS_BOOLEAN_VALUE,
|
3386 | poster: 0,
|
3387 | preload: 0,
|
3388 | profile: 0,
|
3389 | radioGroup: 0,
|
3390 | readOnly: HAS_BOOLEAN_VALUE,
|
3391 | referrerPolicy: 0,
|
3392 | rel: 0,
|
3393 | required: HAS_BOOLEAN_VALUE,
|
3394 | reversed: HAS_BOOLEAN_VALUE,
|
3395 | role: 0,
|
3396 | rows: HAS_POSITIVE_NUMERIC_VALUE,
|
3397 | rowSpan: HAS_NUMERIC_VALUE,
|
3398 | sandbox: 0,
|
3399 | scope: 0,
|
3400 | scoped: HAS_BOOLEAN_VALUE,
|
3401 | scrolling: 0,
|
3402 | seamless: HAS_BOOLEAN_VALUE,
|
3403 | selected: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
|
3404 | shape: 0,
|
3405 | size: HAS_POSITIVE_NUMERIC_VALUE,
|
3406 | sizes: 0,
|
3407 | span: HAS_POSITIVE_NUMERIC_VALUE,
|
3408 | spellCheck: 0,
|
3409 | src: 0,
|
3410 | srcDoc: 0,
|
3411 | srcLang: 0,
|
3412 | srcSet: 0,
|
3413 | start: HAS_NUMERIC_VALUE,
|
3414 | step: 0,
|
3415 | style: 0,
|
3416 | summary: 0,
|
3417 | tabIndex: 0,
|
3418 | target: 0,
|
3419 | title: 0,
|
3420 |
|
3421 | type: 0,
|
3422 | useMap: 0,
|
3423 | value: 0,
|
3424 | width: 0,
|
3425 | wmode: 0,
|
3426 | wrap: 0,
|
3427 |
|
3428 | |
3429 |
|
3430 |
|
3431 | about: 0,
|
3432 | datatype: 0,
|
3433 | inlist: 0,
|
3434 | prefix: 0,
|
3435 |
|
3436 | property: 0,
|
3437 | resource: 0,
|
3438 | 'typeof': 0,
|
3439 | vocab: 0,
|
3440 |
|
3441 | |
3442 |
|
3443 |
|
3444 |
|
3445 |
|
3446 | autoCapitalize: 0,
|
3447 | autoCorrect: 0,
|
3448 |
|
3449 | autoSave: 0,
|
3450 |
|
3451 | color: 0,
|
3452 |
|
3453 |
|
3454 | itemProp: 0,
|
3455 | itemScope: HAS_BOOLEAN_VALUE,
|
3456 | itemType: 0,
|
3457 |
|
3458 |
|
3459 |
|
3460 | itemID: 0,
|
3461 | itemRef: 0,
|
3462 |
|
3463 |
|
3464 | results: 0,
|
3465 |
|
3466 |
|
3467 | security: 0,
|
3468 |
|
3469 | unselectable: 0
|
3470 | },
|
3471 | DOMAttributeNames: {
|
3472 | acceptCharset: 'accept-charset',
|
3473 | className: 'class',
|
3474 | htmlFor: 'for',
|
3475 | httpEquiv: 'http-equiv'
|
3476 | },
|
3477 | DOMPropertyNames: {}
|
3478 | };
|
3479 |
|
3480 | module.exports = HTMLDOMPropertyConfig;
|
3481 | },{"10":10}],23:[function(_dereq_,module,exports){
|
3482 |
|
3483 |
|
3484 |
|
3485 |
|
3486 |
|
3487 |
|
3488 |
|
3489 |
|
3490 |
|
3491 |
|
3492 |
|
3493 |
|
3494 | 'use strict';
|
3495 |
|
3496 |
|
3497 |
|
3498 |
|
3499 |
|
3500 |
|
3501 |
|
3502 |
|
3503 | function escape(key) {
|
3504 | var escapeRegex = /[=:]/g;
|
3505 | var escaperLookup = {
|
3506 | '=': '=0',
|
3507 | ':': '=2'
|
3508 | };
|
3509 | var escapedString = ('' + key).replace(escapeRegex, function (match) {
|
3510 | return escaperLookup[match];
|
3511 | });
|
3512 |
|
3513 | return '$' + escapedString;
|
3514 | }
|
3515 |
|
3516 |
|
3517 |
|
3518 |
|
3519 |
|
3520 |
|
3521 |
|
3522 | function unescape(key) {
|
3523 | var unescapeRegex = /(=0|=2)/g;
|
3524 | var unescaperLookup = {
|
3525 | '=0': '=',
|
3526 | '=2': ':'
|
3527 | };
|
3528 | var keySubstring = key[0] === '.' && key[1] === '$' ? key.substring(2) : key.substring(1);
|
3529 |
|
3530 | return ('' + keySubstring).replace(unescapeRegex, function (match) {
|
3531 | return unescaperLookup[match];
|
3532 | });
|
3533 | }
|
3534 |
|
3535 | var KeyEscapeUtils = {
|
3536 | escape: escape,
|
3537 | unescape: unescape
|
3538 | };
|
3539 |
|
3540 | module.exports = KeyEscapeUtils;
|
3541 | },{}],24:[function(_dereq_,module,exports){
|
3542 |
|
3543 |
|
3544 |
|
3545 |
|
3546 |
|
3547 |
|
3548 |
|
3549 |
|
3550 |
|
3551 |
|
3552 |
|
3553 | 'use strict';
|
3554 |
|
3555 | var ReactLink = _dereq_(80);
|
3556 | var ReactStateSetters = _dereq_(101);
|
3557 |
|
3558 |
|
3559 |
|
3560 |
|
3561 |
|
3562 | var LinkedStateMixin = {
|
3563 | |
3564 |
|
3565 |
|
3566 |
|
3567 |
|
3568 |
|
3569 |
|
3570 |
|
3571 |
|
3572 | linkState: function (key) {
|
3573 | return new ReactLink(this.state[key], ReactStateSetters.createStateKeySetter(this, key));
|
3574 | }
|
3575 | };
|
3576 |
|
3577 | module.exports = LinkedStateMixin;
|
3578 | },{"101":101,"80":80}],25:[function(_dereq_,module,exports){
|
3579 |
|
3580 |
|
3581 |
|
3582 |
|
3583 |
|
3584 |
|
3585 |
|
3586 |
|
3587 |
|
3588 |
|
3589 |
|
3590 | 'use strict';
|
3591 |
|
3592 | var _prodInvariant = _dereq_(153);
|
3593 |
|
3594 | var ReactPropTypes = _dereq_(91);
|
3595 | var ReactPropTypeLocations = _dereq_(90);
|
3596 | var ReactPropTypesSecret = _dereq_(92);
|
3597 |
|
3598 | var invariant = _dereq_(178);
|
3599 | var warning = _dereq_(187);
|
3600 |
|
3601 | var hasReadOnlyValue = {
|
3602 | 'button': true,
|
3603 | 'checkbox': true,
|
3604 | 'image': true,
|
3605 | 'hidden': true,
|
3606 | 'radio': true,
|
3607 | 'reset': true,
|
3608 | 'submit': true
|
3609 | };
|
3610 |
|
3611 | function _assertSingleLink(inputProps) {
|
3612 | !(inputProps.checkedLink == null || inputProps.valueLink == null) ? "development" !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a valueLink. If you want to use checkedLink, you probably don\'t want to use valueLink and vice versa.') : _prodInvariant('87') : void 0;
|
3613 | }
|
3614 | function _assertValueLink(inputProps) {
|
3615 | _assertSingleLink(inputProps);
|
3616 | !(inputProps.value == null && inputProps.onChange == null) ? "development" !== 'production' ? invariant(false, 'Cannot provide a valueLink and a value or onChange event. If you want to use value or onChange, you probably don\'t want to use valueLink.') : _prodInvariant('88') : void 0;
|
3617 | }
|
3618 |
|
3619 | function _assertCheckedLink(inputProps) {
|
3620 | _assertSingleLink(inputProps);
|
3621 | !(inputProps.checked == null && inputProps.onChange == null) ? "development" !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a checked property or onChange event. If you want to use checked or onChange, you probably don\'t want to use checkedLink') : _prodInvariant('89') : void 0;
|
3622 | }
|
3623 |
|
3624 | var propTypes = {
|
3625 | value: function (props, propName, componentName) {
|
3626 | if (!props[propName] || hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled) {
|
3627 | return null;
|
3628 | }
|
3629 | return new Error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
|
3630 | },
|
3631 | checked: function (props, propName, componentName) {
|
3632 | if (!props[propName] || props.onChange || props.readOnly || props.disabled) {
|
3633 | return null;
|
3634 | }
|
3635 | return new Error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
|
3636 | },
|
3637 | onChange: ReactPropTypes.func
|
3638 | };
|
3639 |
|
3640 | var loggedTypeFailures = {};
|
3641 | function getDeclarationErrorAddendum(owner) {
|
3642 | if (owner) {
|
3643 | var name = owner.getName();
|
3644 | if (name) {
|
3645 | return ' Check the render method of `' + name + '`.';
|
3646 | }
|
3647 | }
|
3648 | return '';
|
3649 | }
|
3650 |
|
3651 |
|
3652 |
|
3653 |
|
3654 |
|
3655 | var LinkedValueUtils = {
|
3656 | checkPropTypes: function (tagName, props, owner) {
|
3657 | for (var propName in propTypes) {
|
3658 | if (propTypes.hasOwnProperty(propName)) {
|
3659 | var error = propTypes[propName](props, propName, tagName, ReactPropTypeLocations.prop, null, ReactPropTypesSecret);
|
3660 | }
|
3661 | if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
3662 |
|
3663 |
|
3664 | loggedTypeFailures[error.message] = true;
|
3665 |
|
3666 | var addendum = getDeclarationErrorAddendum(owner);
|
3667 | "development" !== 'production' ? warning(false, 'Failed form propType: %s%s', error.message, addendum) : void 0;
|
3668 | }
|
3669 | }
|
3670 | },
|
3671 |
|
3672 | |
3673 |
|
3674 |
|
3675 |
|
3676 | getValue: function (inputProps) {
|
3677 | if (inputProps.valueLink) {
|
3678 | _assertValueLink(inputProps);
|
3679 | return inputProps.valueLink.value;
|
3680 | }
|
3681 | return inputProps.value;
|
3682 | },
|
3683 |
|
3684 | |
3685 |
|
3686 |
|
3687 |
|
3688 |
|
3689 | getChecked: function (inputProps) {
|
3690 | if (inputProps.checkedLink) {
|
3691 | _assertCheckedLink(inputProps);
|
3692 | return inputProps.checkedLink.value;
|
3693 | }
|
3694 | return inputProps.checked;
|
3695 | },
|
3696 |
|
3697 | |
3698 |
|
3699 |
|
3700 |
|
3701 | executeOnChange: function (inputProps, event) {
|
3702 | if (inputProps.valueLink) {
|
3703 | _assertValueLink(inputProps);
|
3704 | return inputProps.valueLink.requestChange(event.target.value);
|
3705 | } else if (inputProps.checkedLink) {
|
3706 | _assertCheckedLink(inputProps);
|
3707 | return inputProps.checkedLink.requestChange(event.target.checked);
|
3708 | } else if (inputProps.onChange) {
|
3709 | return inputProps.onChange.call(undefined, event);
|
3710 | }
|
3711 | }
|
3712 | };
|
3713 |
|
3714 | module.exports = LinkedValueUtils;
|
3715 | },{"153":153,"178":178,"187":187,"90":90,"91":91,"92":92}],26:[function(_dereq_,module,exports){
|
3716 |
|
3717 |
|
3718 |
|
3719 |
|
3720 |
|
3721 |
|
3722 |
|
3723 |
|
3724 |
|
3725 |
|
3726 |
|
3727 | 'use strict';
|
3728 |
|
3729 | var _prodInvariant = _dereq_(153);
|
3730 |
|
3731 | var invariant = _dereq_(178);
|
3732 |
|
3733 |
|
3734 |
|
3735 |
|
3736 |
|
3737 |
|
3738 |
|
3739 |
|
3740 | var oneArgumentPooler = function (copyFieldsFrom) {
|
3741 | var Klass = this;
|
3742 | if (Klass.instancePool.length) {
|
3743 | var instance = Klass.instancePool.pop();
|
3744 | Klass.call(instance, copyFieldsFrom);
|
3745 | return instance;
|
3746 | } else {
|
3747 | return new Klass(copyFieldsFrom);
|
3748 | }
|
3749 | };
|
3750 |
|
3751 | var twoArgumentPooler = function (a1, a2) {
|
3752 | var Klass = this;
|
3753 | if (Klass.instancePool.length) {
|
3754 | var instance = Klass.instancePool.pop();
|
3755 | Klass.call(instance, a1, a2);
|
3756 | return instance;
|
3757 | } else {
|
3758 | return new Klass(a1, a2);
|
3759 | }
|
3760 | };
|
3761 |
|
3762 | var threeArgumentPooler = function (a1, a2, a3) {
|
3763 | var Klass = this;
|
3764 | if (Klass.instancePool.length) {
|
3765 | var instance = Klass.instancePool.pop();
|
3766 | Klass.call(instance, a1, a2, a3);
|
3767 | return instance;
|
3768 | } else {
|
3769 | return new Klass(a1, a2, a3);
|
3770 | }
|
3771 | };
|
3772 |
|
3773 | var fourArgumentPooler = function (a1, a2, a3, a4) {
|
3774 | var Klass = this;
|
3775 | if (Klass.instancePool.length) {
|
3776 | var instance = Klass.instancePool.pop();
|
3777 | Klass.call(instance, a1, a2, a3, a4);
|
3778 | return instance;
|
3779 | } else {
|
3780 | return new Klass(a1, a2, a3, a4);
|
3781 | }
|
3782 | };
|
3783 |
|
3784 | var fiveArgumentPooler = function (a1, a2, a3, a4, a5) {
|
3785 | var Klass = this;
|
3786 | if (Klass.instancePool.length) {
|
3787 | var instance = Klass.instancePool.pop();
|
3788 | Klass.call(instance, a1, a2, a3, a4, a5);
|
3789 | return instance;
|
3790 | } else {
|
3791 | return new Klass(a1, a2, a3, a4, a5);
|
3792 | }
|
3793 | };
|
3794 |
|
3795 | var standardReleaser = function (instance) {
|
3796 | var Klass = this;
|
3797 | !(instance instanceof Klass) ? "development" !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : _prodInvariant('25') : void 0;
|
3798 | instance.destructor();
|
3799 | if (Klass.instancePool.length < Klass.poolSize) {
|
3800 | Klass.instancePool.push(instance);
|
3801 | }
|
3802 | };
|
3803 |
|
3804 | var DEFAULT_POOL_SIZE = 10;
|
3805 | var DEFAULT_POOLER = oneArgumentPooler;
|
3806 |
|
3807 |
|
3808 |
|
3809 |
|
3810 |
|
3811 |
|
3812 |
|
3813 |
|
3814 |
|
3815 |
|
3816 | var addPoolingTo = function (CopyConstructor, pooler) {
|
3817 | var NewKlass = CopyConstructor;
|
3818 | NewKlass.instancePool = [];
|
3819 | NewKlass.getPooled = pooler || DEFAULT_POOLER;
|
3820 | if (!NewKlass.poolSize) {
|
3821 | NewKlass.poolSize = DEFAULT_POOL_SIZE;
|
3822 | }
|
3823 | NewKlass.release = standardReleaser;
|
3824 | return NewKlass;
|
3825 | };
|
3826 |
|
3827 | var PooledClass = {
|
3828 | addPoolingTo: addPoolingTo,
|
3829 | oneArgumentPooler: oneArgumentPooler,
|
3830 | twoArgumentPooler: twoArgumentPooler,
|
3831 | threeArgumentPooler: threeArgumentPooler,
|
3832 | fourArgumentPooler: fourArgumentPooler,
|
3833 | fiveArgumentPooler: fiveArgumentPooler
|
3834 | };
|
3835 |
|
3836 | module.exports = PooledClass;
|
3837 | },{"153":153,"178":178}],27:[function(_dereq_,module,exports){
|
3838 |
|
3839 |
|
3840 |
|
3841 |
|
3842 |
|
3843 |
|
3844 |
|
3845 |
|
3846 |
|
3847 |
|
3848 |
|
3849 | 'use strict';
|
3850 |
|
3851 | var _assign = _dereq_(188);
|
3852 |
|
3853 | var ReactChildren = _dereq_(32);
|
3854 | var ReactComponent = _dereq_(35);
|
3855 | var ReactPureComponent = _dereq_(93);
|
3856 | var ReactClass = _dereq_(34);
|
3857 | var ReactDOMFactories = _dereq_(49);
|
3858 | var ReactElement = _dereq_(65);
|
3859 | var ReactPropTypes = _dereq_(91);
|
3860 | var ReactVersion = _dereq_(108);
|
3861 |
|
3862 | var onlyChild = _dereq_(151);
|
3863 | var warning = _dereq_(187);
|
3864 |
|
3865 | var createElement = ReactElement.createElement;
|
3866 | var createFactory = ReactElement.createFactory;
|
3867 | var cloneElement = ReactElement.cloneElement;
|
3868 |
|
3869 | if ("development" !== 'production') {
|
3870 | var ReactElementValidator = _dereq_(66);
|
3871 | createElement = ReactElementValidator.createElement;
|
3872 | createFactory = ReactElementValidator.createFactory;
|
3873 | cloneElement = ReactElementValidator.cloneElement;
|
3874 | }
|
3875 |
|
3876 | var __spread = _assign;
|
3877 |
|
3878 | if ("development" !== 'production') {
|
3879 | var warned = false;
|
3880 | __spread = function () {
|
3881 | "development" !== '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;
|
3882 | warned = true;
|
3883 | return _assign.apply(null, arguments);
|
3884 | };
|
3885 | }
|
3886 |
|
3887 | var React = {
|
3888 |
|
3889 |
|
3890 |
|
3891 | Children: {
|
3892 | map: ReactChildren.map,
|
3893 | forEach: ReactChildren.forEach,
|
3894 | count: ReactChildren.count,
|
3895 | toArray: ReactChildren.toArray,
|
3896 | only: onlyChild
|
3897 | },
|
3898 |
|
3899 | Component: ReactComponent,
|
3900 | PureComponent: ReactPureComponent,
|
3901 |
|
3902 | createElement: createElement,
|
3903 | cloneElement: cloneElement,
|
3904 | isValidElement: ReactElement.isValidElement,
|
3905 |
|
3906 |
|
3907 |
|
3908 | PropTypes: ReactPropTypes,
|
3909 | createClass: ReactClass.createClass,
|
3910 | createFactory: createFactory,
|
3911 | createMixin: function (mixin) {
|
3912 |
|
3913 | return mixin;
|
3914 | },
|
3915 |
|
3916 |
|
3917 |
|
3918 | DOM: ReactDOMFactories,
|
3919 |
|
3920 | version: ReactVersion,
|
3921 |
|
3922 |
|
3923 | __spread: __spread
|
3924 | };
|
3925 |
|
3926 | module.exports = React;
|
3927 | },{"108":108,"151":151,"187":187,"188":188,"32":32,"34":34,"35":35,"49":49,"65":65,"66":66,"91":91,"93":93}],28:[function(_dereq_,module,exports){
|
3928 |
|
3929 |
|
3930 |
|
3931 |
|
3932 |
|
3933 |
|
3934 |
|
3935 |
|
3936 |
|
3937 |
|
3938 |
|
3939 | 'use strict';
|
3940 |
|
3941 | var _assign = _dereq_(188);
|
3942 |
|
3943 | var EventConstants = _dereq_(16);
|
3944 | var EventPluginRegistry = _dereq_(18);
|
3945 | var ReactEventEmitterMixin = _dereq_(69);
|
3946 | var ViewportMetrics = _dereq_(128);
|
3947 |
|
3948 | var getVendorPrefixedEventName = _dereq_(147);
|
3949 | var isEventSupported = _dereq_(149);
|
3950 |
|
3951 |
|
3952 |
|
3953 |
|
3954 |
|
3955 |
|
3956 |
|
3957 |
|
3958 |
|
3959 |
|
3960 |
|
3961 |
|
3962 |
|
3963 |
|
3964 |
|
3965 |
|
3966 |
|
3967 |
|
3968 |
|
3969 |
|
3970 |
|
3971 |
|
3972 |
|
3973 |
|
3974 |
|
3975 |
|
3976 |
|
3977 |
|
3978 |
|
3979 |
|
3980 |
|
3981 |
|
3982 |
|
3983 |
|
3984 |
|
3985 |
|
3986 |
|
3987 |
|
3988 |
|
3989 |
|
3990 |
|
3991 |
|
3992 |
|
3993 |
|
3994 |
|
3995 |
|
3996 |
|
3997 |
|
3998 |
|
3999 |
|
4000 |
|
4001 |
|
4002 |
|
4003 |
|
4004 |
|
4005 |
|
4006 | var hasEventPageXY;
|
4007 | var alreadyListeningTo = {};
|
4008 | var isMonitoringScrollValue = false;
|
4009 | var reactTopListenersCounter = 0;
|
4010 |
|
4011 |
|
4012 |
|
4013 |
|
4014 | var topEventMapping = {
|
4015 | topAbort: 'abort',
|
4016 | topAnimationEnd: getVendorPrefixedEventName('animationend') || 'animationend',
|
4017 | topAnimationIteration: getVendorPrefixedEventName('animationiteration') || 'animationiteration',
|
4018 | topAnimationStart: getVendorPrefixedEventName('animationstart') || 'animationstart',
|
4019 | topBlur: 'blur',
|
4020 | topCanPlay: 'canplay',
|
4021 | topCanPlayThrough: 'canplaythrough',
|
4022 | topChange: 'change',
|
4023 | topClick: 'click',
|
4024 | topCompositionEnd: 'compositionend',
|
4025 | topCompositionStart: 'compositionstart',
|
4026 | topCompositionUpdate: 'compositionupdate',
|
4027 | topContextMenu: 'contextmenu',
|
4028 | topCopy: 'copy',
|
4029 | topCut: 'cut',
|
4030 | topDoubleClick: 'dblclick',
|
4031 | topDrag: 'drag',
|
4032 | topDragEnd: 'dragend',
|
4033 | topDragEnter: 'dragenter',
|
4034 | topDragExit: 'dragexit',
|
4035 | topDragLeave: 'dragleave',
|
4036 | topDragOver: 'dragover',
|
4037 | topDragStart: 'dragstart',
|
4038 | topDrop: 'drop',
|
4039 | topDurationChange: 'durationchange',
|
4040 | topEmptied: 'emptied',
|
4041 | topEncrypted: 'encrypted',
|
4042 | topEnded: 'ended',
|
4043 | topError: 'error',
|
4044 | topFocus: 'focus',
|
4045 | topInput: 'input',
|
4046 | topKeyDown: 'keydown',
|
4047 | topKeyPress: 'keypress',
|
4048 | topKeyUp: 'keyup',
|
4049 | topLoadedData: 'loadeddata',
|
4050 | topLoadedMetadata: 'loadedmetadata',
|
4051 | topLoadStart: 'loadstart',
|
4052 | topMouseDown: 'mousedown',
|
4053 | topMouseMove: 'mousemove',
|
4054 | topMouseOut: 'mouseout',
|
4055 | topMouseOver: 'mouseover',
|
4056 | topMouseUp: 'mouseup',
|
4057 | topPaste: 'paste',
|
4058 | topPause: 'pause',
|
4059 | topPlay: 'play',
|
4060 | topPlaying: 'playing',
|
4061 | topProgress: 'progress',
|
4062 | topRateChange: 'ratechange',
|
4063 | topScroll: 'scroll',
|
4064 | topSeeked: 'seeked',
|
4065 | topSeeking: 'seeking',
|
4066 | topSelectionChange: 'selectionchange',
|
4067 | topStalled: 'stalled',
|
4068 | topSuspend: 'suspend',
|
4069 | topTextInput: 'textInput',
|
4070 | topTimeUpdate: 'timeupdate',
|
4071 | topTouchCancel: 'touchcancel',
|
4072 | topTouchEnd: 'touchend',
|
4073 | topTouchMove: 'touchmove',
|
4074 | topTouchStart: 'touchstart',
|
4075 | topTransitionEnd: getVendorPrefixedEventName('transitionend') || 'transitionend',
|
4076 | topVolumeChange: 'volumechange',
|
4077 | topWaiting: 'waiting',
|
4078 | topWheel: 'wheel'
|
4079 | };
|
4080 |
|
4081 |
|
4082 |
|
4083 |
|
4084 | var topListenersIDKey = '_reactListenersID' + String(Math.random()).slice(2);
|
4085 |
|
4086 | function getListeningForDocument(mountAt) {
|
4087 |
|
4088 |
|
4089 | if (!Object.prototype.hasOwnProperty.call(mountAt, topListenersIDKey)) {
|
4090 | mountAt[topListenersIDKey] = reactTopListenersCounter++;
|
4091 | alreadyListeningTo[mountAt[topListenersIDKey]] = {};
|
4092 | }
|
4093 | return alreadyListeningTo[mountAt[topListenersIDKey]];
|
4094 | }
|
4095 |
|
4096 |
|
4097 |
|
4098 |
|
4099 |
|
4100 |
|
4101 |
|
4102 |
|
4103 |
|
4104 |
|
4105 |
|
4106 | var ReactBrowserEventEmitter = _assign({}, ReactEventEmitterMixin, {
|
4107 |
|
4108 | |
4109 |
|
4110 |
|
4111 | ReactEventListener: null,
|
4112 |
|
4113 | injection: {
|
4114 | |
4115 |
|
4116 |
|
4117 | injectReactEventListener: function (ReactEventListener) {
|
4118 | ReactEventListener.setHandleTopLevel(ReactBrowserEventEmitter.handleTopLevel);
|
4119 | ReactBrowserEventEmitter.ReactEventListener = ReactEventListener;
|
4120 | }
|
4121 | },
|
4122 |
|
4123 | |
4124 |
|
4125 |
|
4126 |
|
4127 |
|
4128 | setEnabled: function (enabled) {
|
4129 | if (ReactBrowserEventEmitter.ReactEventListener) {
|
4130 | ReactBrowserEventEmitter.ReactEventListener.setEnabled(enabled);
|
4131 | }
|
4132 | },
|
4133 |
|
4134 | |
4135 |
|
4136 |
|
4137 | isEnabled: function () {
|
4138 | return !!(ReactBrowserEventEmitter.ReactEventListener && ReactBrowserEventEmitter.ReactEventListener.isEnabled());
|
4139 | },
|
4140 |
|
4141 | |
4142 |
|
4143 |
|
4144 |
|
4145 |
|
4146 |
|
4147 |
|
4148 |
|
4149 |
|
4150 |
|
4151 |
|
4152 |
|
4153 |
|
4154 |
|
4155 |
|
4156 |
|
4157 |
|
4158 |
|
4159 |
|
4160 |
|
4161 |
|
4162 | listenTo: function (registrationName, contentDocumentHandle) {
|
4163 | var mountAt = contentDocumentHandle;
|
4164 | var isListening = getListeningForDocument(mountAt);
|
4165 | var dependencies = EventPluginRegistry.registrationNameDependencies[registrationName];
|
4166 |
|
4167 | var topLevelTypes = EventConstants.topLevelTypes;
|
4168 | for (var i = 0; i < dependencies.length; i++) {
|
4169 | var dependency = dependencies[i];
|
4170 | if (!(isListening.hasOwnProperty(dependency) && isListening[dependency])) {
|
4171 | if (dependency === topLevelTypes.topWheel) {
|
4172 | if (isEventSupported('wheel')) {
|
4173 | ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'wheel', mountAt);
|
4174 | } else if (isEventSupported('mousewheel')) {
|
4175 | ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'mousewheel', mountAt);
|
4176 | } else {
|
4177 |
|
4178 |
|
4179 | ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'DOMMouseScroll', mountAt);
|
4180 | }
|
4181 | } else if (dependency === topLevelTypes.topScroll) {
|
4182 |
|
4183 | if (isEventSupported('scroll', true)) {
|
4184 | ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topScroll, 'scroll', mountAt);
|
4185 | } else {
|
4186 | ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topScroll, 'scroll', ReactBrowserEventEmitter.ReactEventListener.WINDOW_HANDLE);
|
4187 | }
|
4188 | } else if (dependency === topLevelTypes.topFocus || dependency === topLevelTypes.topBlur) {
|
4189 |
|
4190 | if (isEventSupported('focus', true)) {
|
4191 | ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topFocus, 'focus', mountAt);
|
4192 | ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topBlur, 'blur', mountAt);
|
4193 | } else if (isEventSupported('focusin')) {
|
4194 |
|
4195 |
|
4196 | ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topFocus, 'focusin', mountAt);
|
4197 | ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topBlur, 'focusout', mountAt);
|
4198 | }
|
4199 |
|
4200 |
|
4201 | isListening[topLevelTypes.topBlur] = true;
|
4202 | isListening[topLevelTypes.topFocus] = true;
|
4203 | } else if (topEventMapping.hasOwnProperty(dependency)) {
|
4204 | ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(dependency, topEventMapping[dependency], mountAt);
|
4205 | }
|
4206 |
|
4207 | isListening[dependency] = true;
|
4208 | }
|
4209 | }
|
4210 | },
|
4211 |
|
4212 | trapBubbledEvent: function (topLevelType, handlerBaseName, handle) {
|
4213 | return ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelType, handlerBaseName, handle);
|
4214 | },
|
4215 |
|
4216 | trapCapturedEvent: function (topLevelType, handlerBaseName, handle) {
|
4217 | return ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelType, handlerBaseName, handle);
|
4218 | },
|
4219 |
|
4220 | |
4221 |
|
4222 |
|
4223 |
|
4224 |
|
4225 | supportsEventPageXY: function () {
|
4226 | if (!document.createEvent) {
|
4227 | return false;
|
4228 | }
|
4229 | var ev = document.createEvent('MouseEvent');
|
4230 | return ev != null && 'pageX' in ev;
|
4231 | },
|
4232 |
|
4233 | |
4234 |
|
4235 |
|
4236 |
|
4237 |
|
4238 |
|
4239 |
|
4240 |
|
4241 |
|
4242 |
|
4243 |
|
4244 | ensureScrollValueMonitoring: function () {
|
4245 | if (hasEventPageXY === undefined) {
|
4246 | hasEventPageXY = ReactBrowserEventEmitter.supportsEventPageXY();
|
4247 | }
|
4248 | if (!hasEventPageXY && !isMonitoringScrollValue) {
|
4249 | var refresh = ViewportMetrics.refreshScrollValues;
|
4250 | ReactBrowserEventEmitter.ReactEventListener.monitorScrollValue(refresh);
|
4251 | isMonitoringScrollValue = true;
|
4252 | }
|
4253 | }
|
4254 |
|
4255 | });
|
4256 |
|
4257 | module.exports = ReactBrowserEventEmitter;
|
4258 | },{"128":128,"147":147,"149":149,"16":16,"18":18,"188":188,"69":69}],29:[function(_dereq_,module,exports){
|
4259 |
|
4260 |
|
4261 |
|
4262 |
|
4263 |
|
4264 |
|
4265 |
|
4266 |
|
4267 |
|
4268 |
|
4269 |
|
4270 | 'use strict';
|
4271 |
|
4272 | var _assign = _dereq_(188);
|
4273 |
|
4274 | var React = _dereq_(27);
|
4275 |
|
4276 | var ReactTransitionGroup = _dereq_(105);
|
4277 | var ReactCSSTransitionGroupChild = _dereq_(30);
|
4278 |
|
4279 | function createTransitionTimeoutPropValidator(transitionType) {
|
4280 | var timeoutPropName = 'transition' + transitionType + 'Timeout';
|
4281 | var enabledPropName = 'transition' + transitionType;
|
4282 |
|
4283 | return function (props) {
|
4284 |
|
4285 | if (props[enabledPropName]) {
|
4286 |
|
4287 | if (props[timeoutPropName] == null) {
|
4288 | return new Error(timeoutPropName + ' wasn\'t supplied to ReactCSSTransitionGroup: ' + 'this can cause unreliable animations and won\'t be supported in ' + 'a future version of React. See ' + 'https://fb.me/react-animation-transition-group-timeout for more ' + 'information.');
|
4289 |
|
4290 |
|
4291 | } else if (typeof props[timeoutPropName] !== 'number') {
|
4292 | return new Error(timeoutPropName + ' must be a number (in milliseconds)');
|
4293 | }
|
4294 | }
|
4295 | };
|
4296 | }
|
4297 |
|
4298 |
|
4299 |
|
4300 |
|
4301 |
|
4302 |
|
4303 | var ReactCSSTransitionGroup = React.createClass({
|
4304 | displayName: 'ReactCSSTransitionGroup',
|
4305 |
|
4306 | propTypes: {
|
4307 | transitionName: ReactCSSTransitionGroupChild.propTypes.name,
|
4308 |
|
4309 | transitionAppear: React.PropTypes.bool,
|
4310 | transitionEnter: React.PropTypes.bool,
|
4311 | transitionLeave: React.PropTypes.bool,
|
4312 | transitionAppearTimeout: createTransitionTimeoutPropValidator('Appear'),
|
4313 | transitionEnterTimeout: createTransitionTimeoutPropValidator('Enter'),
|
4314 | transitionLeaveTimeout: createTransitionTimeoutPropValidator('Leave')
|
4315 | },
|
4316 |
|
4317 | getDefaultProps: function () {
|
4318 | return {
|
4319 | transitionAppear: false,
|
4320 | transitionEnter: true,
|
4321 | transitionLeave: true
|
4322 | };
|
4323 | },
|
4324 |
|
4325 | _wrapChild: function (child) {
|
4326 |
|
4327 |
|
4328 |
|
4329 | return React.createElement(ReactCSSTransitionGroupChild, {
|
4330 | name: this.props.transitionName,
|
4331 | appear: this.props.transitionAppear,
|
4332 | enter: this.props.transitionEnter,
|
4333 | leave: this.props.transitionLeave,
|
4334 | appearTimeout: this.props.transitionAppearTimeout,
|
4335 | enterTimeout: this.props.transitionEnterTimeout,
|
4336 | leaveTimeout: this.props.transitionLeaveTimeout
|
4337 | }, child);
|
4338 | },
|
4339 |
|
4340 | render: function () {
|
4341 | return React.createElement(ReactTransitionGroup, _assign({}, this.props, { childFactory: this._wrapChild }));
|
4342 | }
|
4343 | });
|
4344 |
|
4345 | module.exports = ReactCSSTransitionGroup;
|
4346 | },{"105":105,"188":188,"27":27,"30":30}],30:[function(_dereq_,module,exports){
|
4347 |
|
4348 |
|
4349 |
|
4350 |
|
4351 |
|
4352 |
|
4353 |
|
4354 |
|
4355 |
|
4356 |
|
4357 |
|
4358 | 'use strict';
|
4359 |
|
4360 | var React = _dereq_(27);
|
4361 | var ReactDOM = _dereq_(42);
|
4362 |
|
4363 | var CSSCore = _dereq_(162);
|
4364 | var ReactTransitionEvents = _dereq_(104);
|
4365 |
|
4366 | var onlyChild = _dereq_(151);
|
4367 |
|
4368 | var TICK = 17;
|
4369 |
|
4370 | var ReactCSSTransitionGroupChild = React.createClass({
|
4371 | displayName: 'ReactCSSTransitionGroupChild',
|
4372 |
|
4373 | propTypes: {
|
4374 | name: React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.shape({
|
4375 | enter: React.PropTypes.string,
|
4376 | leave: React.PropTypes.string,
|
4377 | active: React.PropTypes.string
|
4378 | }), React.PropTypes.shape({
|
4379 | enter: React.PropTypes.string,
|
4380 | enterActive: React.PropTypes.string,
|
4381 | leave: React.PropTypes.string,
|
4382 | leaveActive: React.PropTypes.string,
|
4383 | appear: React.PropTypes.string,
|
4384 | appearActive: React.PropTypes.string
|
4385 | })]).isRequired,
|
4386 |
|
4387 |
|
4388 |
|
4389 |
|
4390 | appear: React.PropTypes.bool,
|
4391 | enter: React.PropTypes.bool,
|
4392 | leave: React.PropTypes.bool,
|
4393 | appearTimeout: React.PropTypes.number,
|
4394 | enterTimeout: React.PropTypes.number,
|
4395 | leaveTimeout: React.PropTypes.number
|
4396 | },
|
4397 |
|
4398 | transition: function (animationType, finishCallback, userSpecifiedDelay) {
|
4399 | var node = ReactDOM.findDOMNode(this);
|
4400 |
|
4401 | if (!node) {
|
4402 | if (finishCallback) {
|
4403 | finishCallback();
|
4404 | }
|
4405 | return;
|
4406 | }
|
4407 |
|
4408 | var className = this.props.name[animationType] || this.props.name + '-' + animationType;
|
4409 | var activeClassName = this.props.name[animationType + 'Active'] || className + '-active';
|
4410 | var timeout = null;
|
4411 |
|
4412 | var endListener = function (e) {
|
4413 | if (e && e.target !== node) {
|
4414 | return;
|
4415 | }
|
4416 |
|
4417 | clearTimeout(timeout);
|
4418 |
|
4419 | CSSCore.removeClass(node, className);
|
4420 | CSSCore.removeClass(node, activeClassName);
|
4421 |
|
4422 | ReactTransitionEvents.removeEndEventListener(node, endListener);
|
4423 |
|
4424 |
|
4425 |
|
4426 | if (finishCallback) {
|
4427 | finishCallback();
|
4428 | }
|
4429 | };
|
4430 |
|
4431 | CSSCore.addClass(node, className);
|
4432 |
|
4433 |
|
4434 | this.queueClassAndNode(activeClassName, node);
|
4435 |
|
4436 |
|
4437 | if (userSpecifiedDelay) {
|
4438 |
|
4439 | timeout = setTimeout(endListener, userSpecifiedDelay);
|
4440 | this.transitionTimeouts.push(timeout);
|
4441 | } else {
|
4442 |
|
4443 | ReactTransitionEvents.addEndEventListener(node, endListener);
|
4444 | }
|
4445 | },
|
4446 |
|
4447 | queueClassAndNode: function (className, node) {
|
4448 | this.classNameAndNodeQueue.push({
|
4449 | className: className,
|
4450 | node: node
|
4451 | });
|
4452 |
|
4453 | if (!this.timeout) {
|
4454 | this.timeout = setTimeout(this.flushClassNameAndNodeQueue, TICK);
|
4455 | }
|
4456 | },
|
4457 |
|
4458 | flushClassNameAndNodeQueue: function () {
|
4459 | if (this.isMounted()) {
|
4460 | this.classNameAndNodeQueue.forEach(function (obj) {
|
4461 | CSSCore.addClass(obj.node, obj.className);
|
4462 | });
|
4463 | }
|
4464 | this.classNameAndNodeQueue.length = 0;
|
4465 | this.timeout = null;
|
4466 | },
|
4467 |
|
4468 | componentWillMount: function () {
|
4469 | this.classNameAndNodeQueue = [];
|
4470 | this.transitionTimeouts = [];
|
4471 | },
|
4472 |
|
4473 | componentWillUnmount: function () {
|
4474 | if (this.timeout) {
|
4475 | clearTimeout(this.timeout);
|
4476 | }
|
4477 | this.transitionTimeouts.forEach(function (timeout) {
|
4478 | clearTimeout(timeout);
|
4479 | });
|
4480 |
|
4481 | this.classNameAndNodeQueue.length = 0;
|
4482 | },
|
4483 |
|
4484 | componentWillAppear: function (done) {
|
4485 | if (this.props.appear) {
|
4486 | this.transition('appear', done, this.props.appearTimeout);
|
4487 | } else {
|
4488 | done();
|
4489 | }
|
4490 | },
|
4491 |
|
4492 | componentWillEnter: function (done) {
|
4493 | if (this.props.enter) {
|
4494 | this.transition('enter', done, this.props.enterTimeout);
|
4495 | } else {
|
4496 | done();
|
4497 | }
|
4498 | },
|
4499 |
|
4500 | componentWillLeave: function (done) {
|
4501 | if (this.props.leave) {
|
4502 | this.transition('leave', done, this.props.leaveTimeout);
|
4503 | } else {
|
4504 | done();
|
4505 | }
|
4506 | },
|
4507 |
|
4508 | render: function () {
|
4509 | return onlyChild(this.props.children);
|
4510 | }
|
4511 | });
|
4512 |
|
4513 | module.exports = ReactCSSTransitionGroupChild;
|
4514 | },{"104":104,"151":151,"162":162,"27":27,"42":42}],31:[function(_dereq_,module,exports){
|
4515 | (function (process){
|
4516 |
|
4517 |
|
4518 |
|
4519 |
|
4520 |
|
4521 |
|
4522 |
|
4523 |
|
4524 |
|
4525 |
|
4526 |
|
4527 | 'use strict';
|
4528 |
|
4529 | var ReactReconciler = _dereq_(95);
|
4530 |
|
4531 | var instantiateReactComponent = _dereq_(148);
|
4532 | var KeyEscapeUtils = _dereq_(23);
|
4533 | var shouldUpdateReactComponent = _dereq_(158);
|
4534 | var traverseAllChildren = _dereq_(159);
|
4535 | var warning = _dereq_(187);
|
4536 |
|
4537 | var ReactComponentTreeHook;
|
4538 |
|
4539 | if (typeof process !== 'undefined' && process.env && "development" === 'test') {
|
4540 |
|
4541 |
|
4542 |
|
4543 |
|
4544 |
|
4545 | ReactComponentTreeHook = _dereq_(38);
|
4546 | }
|
4547 |
|
4548 | function instantiateChild(childInstances, child, name, selfDebugID) {
|
4549 |
|
4550 | var keyUnique = childInstances[name] === undefined;
|
4551 | if ("development" !== 'production') {
|
4552 | if (!ReactComponentTreeHook) {
|
4553 | ReactComponentTreeHook = _dereq_(38);
|
4554 | }
|
4555 | if (!keyUnique) {
|
4556 | "development" !== 'production' ? warning(false, '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.%s', KeyEscapeUtils.unescape(name), ReactComponentTreeHook.getStackAddendumByID(selfDebugID)) : void 0;
|
4557 | }
|
4558 | }
|
4559 | if (child != null && keyUnique) {
|
4560 | childInstances[name] = instantiateReactComponent(child, true);
|
4561 | }
|
4562 | }
|
4563 |
|
4564 |
|
4565 |
|
4566 |
|
4567 |
|
4568 |
|
4569 | var ReactChildReconciler = {
|
4570 | |
4571 |
|
4572 |
|
4573 |
|
4574 |
|
4575 |
|
4576 |
|
4577 |
|
4578 | instantiateChildren: function (nestedChildNodes, transaction, context, selfDebugID // 0 in production and for roots
|
4579 | ) {
|
4580 | if (nestedChildNodes == null) {
|
4581 | return null;
|
4582 | }
|
4583 | var childInstances = {};
|
4584 |
|
4585 | if ("development" !== 'production') {
|
4586 | traverseAllChildren(nestedChildNodes, function (childInsts, child, name) {
|
4587 | return instantiateChild(childInsts, child, name, selfDebugID);
|
4588 | }, childInstances);
|
4589 | } else {
|
4590 | traverseAllChildren(nestedChildNodes, instantiateChild, childInstances);
|
4591 | }
|
4592 | return childInstances;
|
4593 | },
|
4594 |
|
4595 | |
4596 |
|
4597 |
|
4598 |
|
4599 |
|
4600 |
|
4601 |
|
4602 |
|
4603 |
|
4604 |
|
4605 | updateChildren: function (prevChildren, nextChildren, mountImages, removedNodes, transaction, hostParent, hostContainerInfo, context, selfDebugID // 0 in production and for roots
|
4606 | ) {
|
4607 |
|
4608 |
|
4609 |
|
4610 |
|
4611 |
|
4612 | if (!nextChildren && !prevChildren) {
|
4613 | return;
|
4614 | }
|
4615 | var name;
|
4616 | var prevChild;
|
4617 | for (name in nextChildren) {
|
4618 | if (!nextChildren.hasOwnProperty(name)) {
|
4619 | continue;
|
4620 | }
|
4621 | prevChild = prevChildren && prevChildren[name];
|
4622 | var prevElement = prevChild && prevChild._currentElement;
|
4623 | var nextElement = nextChildren[name];
|
4624 | if (prevChild != null && shouldUpdateReactComponent(prevElement, nextElement)) {
|
4625 | ReactReconciler.receiveComponent(prevChild, nextElement, transaction, context);
|
4626 | nextChildren[name] = prevChild;
|
4627 | } else {
|
4628 | if (prevChild) {
|
4629 | removedNodes[name] = ReactReconciler.getHostNode(prevChild);
|
4630 | ReactReconciler.unmountComponent(prevChild, false);
|
4631 | }
|
4632 |
|
4633 | var nextChildInstance = instantiateReactComponent(nextElement, true);
|
4634 | nextChildren[name] = nextChildInstance;
|
4635 |
|
4636 |
|
4637 | var nextChildMountImage = ReactReconciler.mountComponent(nextChildInstance, transaction, hostParent, hostContainerInfo, context, selfDebugID);
|
4638 | mountImages.push(nextChildMountImage);
|
4639 | }
|
4640 | }
|
4641 |
|
4642 | for (name in prevChildren) {
|
4643 | if (prevChildren.hasOwnProperty(name) && !(nextChildren && nextChildren.hasOwnProperty(name))) {
|
4644 | prevChild = prevChildren[name];
|
4645 | removedNodes[name] = ReactReconciler.getHostNode(prevChild);
|
4646 | ReactReconciler.unmountComponent(prevChild, false);
|
4647 | }
|
4648 | }
|
4649 | },
|
4650 |
|
4651 | |
4652 |
|
4653 |
|
4654 |
|
4655 |
|
4656 |
|
4657 |
|
4658 | unmountChildren: function (renderedChildren, safely) {
|
4659 | for (var name in renderedChildren) {
|
4660 | if (renderedChildren.hasOwnProperty(name)) {
|
4661 | var renderedChild = renderedChildren[name];
|
4662 | ReactReconciler.unmountComponent(renderedChild, safely);
|
4663 | }
|
4664 | }
|
4665 | }
|
4666 |
|
4667 | };
|
4668 |
|
4669 | module.exports = ReactChildReconciler;
|
4670 | }).call(this,undefined)
|
4671 | },{"148":148,"158":158,"159":159,"187":187,"23":23,"38":38,"95":95}],32:[function(_dereq_,module,exports){
|
4672 |
|
4673 |
|
4674 |
|
4675 |
|
4676 |
|
4677 |
|
4678 |
|
4679 |
|
4680 |
|
4681 |
|
4682 |
|
4683 | 'use strict';
|
4684 |
|
4685 | var PooledClass = _dereq_(26);
|
4686 | var ReactElement = _dereq_(65);
|
4687 |
|
4688 | var emptyFunction = _dereq_(170);
|
4689 | var traverseAllChildren = _dereq_(159);
|
4690 |
|
4691 | var twoArgumentPooler = PooledClass.twoArgumentPooler;
|
4692 | var fourArgumentPooler = PooledClass.fourArgumentPooler;
|
4693 |
|
4694 | var userProvidedKeyEscapeRegex = /\/+/g;
|
4695 | function escapeUserProvidedKey(text) {
|
4696 | return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
|
4697 | }
|
4698 |
|
4699 |
|
4700 |
|
4701 |
|
4702 |
|
4703 |
|
4704 |
|
4705 |
|
4706 |
|
4707 | function ForEachBookKeeping(forEachFunction, forEachContext) {
|
4708 | this.func = forEachFunction;
|
4709 | this.context = forEachContext;
|
4710 | this.count = 0;
|
4711 | }
|
4712 | ForEachBookKeeping.prototype.destructor = function () {
|
4713 | this.func = null;
|
4714 | this.context = null;
|
4715 | this.count = 0;
|
4716 | };
|
4717 | PooledClass.addPoolingTo(ForEachBookKeeping, twoArgumentPooler);
|
4718 |
|
4719 | function forEachSingleChild(bookKeeping, child, name) {
|
4720 | var func = bookKeeping.func;
|
4721 | var context = bookKeeping.context;
|
4722 |
|
4723 | func.call(context, child, bookKeeping.count++);
|
4724 | }
|
4725 |
|
4726 |
|
4727 |
|
4728 |
|
4729 |
|
4730 |
|
4731 |
|
4732 |
|
4733 |
|
4734 |
|
4735 |
|
4736 |
|
4737 |
|
4738 | function forEachChildren(children, forEachFunc, forEachContext) {
|
4739 | if (children == null) {
|
4740 | return children;
|
4741 | }
|
4742 | var traverseContext = ForEachBookKeeping.getPooled(forEachFunc, forEachContext);
|
4743 | traverseAllChildren(children, forEachSingleChild, traverseContext);
|
4744 | ForEachBookKeeping.release(traverseContext);
|
4745 | }
|
4746 |
|
4747 |
|
4748 |
|
4749 |
|
4750 |
|
4751 |
|
4752 |
|
4753 |
|
4754 |
|
4755 |
|
4756 | function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) {
|
4757 | this.result = mapResult;
|
4758 | this.keyPrefix = keyPrefix;
|
4759 | this.func = mapFunction;
|
4760 | this.context = mapContext;
|
4761 | this.count = 0;
|
4762 | }
|
4763 | MapBookKeeping.prototype.destructor = function () {
|
4764 | this.result = null;
|
4765 | this.keyPrefix = null;
|
4766 | this.func = null;
|
4767 | this.context = null;
|
4768 | this.count = 0;
|
4769 | };
|
4770 | PooledClass.addPoolingTo(MapBookKeeping, fourArgumentPooler);
|
4771 |
|
4772 | function mapSingleChildIntoContext(bookKeeping, child, childKey) {
|
4773 | var result = bookKeeping.result;
|
4774 | var keyPrefix = bookKeeping.keyPrefix;
|
4775 | var func = bookKeeping.func;
|
4776 | var context = bookKeeping.context;
|
4777 |
|
4778 |
|
4779 | var mappedChild = func.call(context, child, bookKeeping.count++);
|
4780 | if (Array.isArray(mappedChild)) {
|
4781 | mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument);
|
4782 | } else if (mappedChild != null) {
|
4783 | if (ReactElement.isValidElement(mappedChild)) {
|
4784 | mappedChild = ReactElement.cloneAndReplaceKey(mappedChild,
|
4785 |
|
4786 |
|
4787 | keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);
|
4788 | }
|
4789 | result.push(mappedChild);
|
4790 | }
|
4791 | }
|
4792 |
|
4793 | function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
|
4794 | var escapedPrefix = '';
|
4795 | if (prefix != null) {
|
4796 | escapedPrefix = escapeUserProvidedKey(prefix) + '/';
|
4797 | }
|
4798 | var traverseContext = MapBookKeeping.getPooled(array, escapedPrefix, func, context);
|
4799 | traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
|
4800 | MapBookKeeping.release(traverseContext);
|
4801 | }
|
4802 |
|
4803 |
|
4804 |
|
4805 |
|
4806 |
|
4807 |
|
4808 |
|
4809 |
|
4810 |
|
4811 |
|
4812 |
|
4813 |
|
4814 |
|
4815 |
|
4816 | function mapChildren(children, func, context) {
|
4817 | if (children == null) {
|
4818 | return children;
|
4819 | }
|
4820 | var result = [];
|
4821 | mapIntoWithKeyPrefixInternal(children, result, null, func, context);
|
4822 | return result;
|
4823 | }
|
4824 |
|
4825 | function forEachSingleChildDummy(traverseContext, child, name) {
|
4826 | return null;
|
4827 | }
|
4828 |
|
4829 |
|
4830 |
|
4831 |
|
4832 |
|
4833 |
|
4834 |
|
4835 |
|
4836 |
|
4837 |
|
4838 | function countChildren(children, context) {
|
4839 | return traverseAllChildren(children, forEachSingleChildDummy, null);
|
4840 | }
|
4841 |
|
4842 |
|
4843 |
|
4844 |
|
4845 |
|
4846 |
|
4847 |
|
4848 | function toArray(children) {
|
4849 | var result = [];
|
4850 | mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);
|
4851 | return result;
|
4852 | }
|
4853 |
|
4854 | var ReactChildren = {
|
4855 | forEach: forEachChildren,
|
4856 | map: mapChildren,
|
4857 | mapIntoWithKeyPrefixInternal: mapIntoWithKeyPrefixInternal,
|
4858 | count: countChildren,
|
4859 | toArray: toArray
|
4860 | };
|
4861 |
|
4862 | module.exports = ReactChildren;
|
4863 | },{"159":159,"170":170,"26":26,"65":65}],33:[function(_dereq_,module,exports){
|
4864 |
|
4865 |
|
4866 |
|
4867 |
|
4868 |
|
4869 |
|
4870 |
|
4871 |
|
4872 |
|
4873 |
|
4874 |
|
4875 | 'use strict';
|
4876 |
|
4877 | var ReactComponentTreeHook = _dereq_(38);
|
4878 |
|
4879 | var warning = _dereq_(187);
|
4880 |
|
4881 | function handleElement(debugID, element) {
|
4882 | if (element == null) {
|
4883 | return;
|
4884 | }
|
4885 | if (element._shadowChildren === undefined) {
|
4886 | return;
|
4887 | }
|
4888 | if (element._shadowChildren === element.props.children) {
|
4889 | return;
|
4890 | }
|
4891 | var isMutated = false;
|
4892 | if (Array.isArray(element._shadowChildren)) {
|
4893 | if (element._shadowChildren.length === element.props.children.length) {
|
4894 | for (var i = 0; i < element._shadowChildren.length; i++) {
|
4895 | if (element._shadowChildren[i] !== element.props.children[i]) {
|
4896 | isMutated = true;
|
4897 | }
|
4898 | }
|
4899 | } else {
|
4900 | isMutated = true;
|
4901 | }
|
4902 | }
|
4903 | if (!Array.isArray(element._shadowChildren) || isMutated) {
|
4904 | "development" !== 'production' ? warning(false, 'Component\'s children should not be mutated.%s', ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
|
4905 | }
|
4906 | }
|
4907 |
|
4908 | var ReactChildrenMutationWarningHook = {
|
4909 | onMountComponent: function (debugID) {
|
4910 | handleElement(debugID, ReactComponentTreeHook.getElement(debugID));
|
4911 | },
|
4912 | onUpdateComponent: function (debugID) {
|
4913 | handleElement(debugID, ReactComponentTreeHook.getElement(debugID));
|
4914 | }
|
4915 | };
|
4916 |
|
4917 | module.exports = ReactChildrenMutationWarningHook;
|
4918 | },{"187":187,"38":38}],34:[function(_dereq_,module,exports){
|
4919 |
|
4920 |
|
4921 |
|
4922 |
|
4923 |
|
4924 |
|
4925 |
|
4926 |
|
4927 |
|
4928 |
|
4929 |
|
4930 | 'use strict';
|
4931 |
|
4932 | var _prodInvariant = _dereq_(153),
|
4933 | _assign = _dereq_(188);
|
4934 |
|
4935 | var ReactComponent = _dereq_(35);
|
4936 | var ReactElement = _dereq_(65);
|
4937 | var ReactPropTypeLocations = _dereq_(90);
|
4938 | var ReactPropTypeLocationNames = _dereq_(89);
|
4939 | var ReactNoopUpdateQueue = _dereq_(86);
|
4940 |
|
4941 | var emptyObject = _dereq_(171);
|
4942 | var invariant = _dereq_(178);
|
4943 | var keyMirror = _dereq_(181);
|
4944 | var keyOf = _dereq_(182);
|
4945 | var warning = _dereq_(187);
|
4946 |
|
4947 | var MIXINS_KEY = keyOf({ mixins: null });
|
4948 |
|
4949 |
|
4950 |
|
4951 |
|
4952 | var SpecPolicy = keyMirror({
|
4953 | |
4954 |
|
4955 |
|
4956 | DEFINE_ONCE: null,
|
4957 | |
4958 |
|
4959 |
|
4960 |
|
4961 | DEFINE_MANY: null,
|
4962 | |
4963 |
|
4964 |
|
4965 | OVERRIDE_BASE: null,
|
4966 | |
4967 |
|
4968 |
|
4969 |
|
4970 |
|
4971 | DEFINE_MANY_MERGED: null
|
4972 | });
|
4973 |
|
4974 | var injectedMixins = [];
|
4975 |
|
4976 |
|
4977 |
|
4978 |
|
4979 |
|
4980 |
|
4981 |
|
4982 |
|
4983 |
|
4984 |
|
4985 |
|
4986 |
|
4987 |
|
4988 |
|
4989 |
|
4990 |
|
4991 |
|
4992 |
|
4993 |
|
4994 |
|
4995 |
|
4996 |
|
4997 |
|
4998 | var ReactClassInterface = {
|
4999 |
|
5000 | |
5001 |
|
5002 |
|
5003 |
|
5004 |
|
5005 |
|
5006 | mixins: SpecPolicy.DEFINE_MANY,
|
5007 |
|
5008 | |
5009 |
|
5010 |
|
5011 |
|
5012 |
|
5013 |
|
5014 |
|
5015 | statics: SpecPolicy.DEFINE_MANY,
|
5016 |
|
5017 | |
5018 |
|
5019 |
|
5020 |
|
5021 |
|
5022 |
|
5023 | propTypes: SpecPolicy.DEFINE_MANY,
|
5024 |
|
5025 | |
5026 |
|
5027 |
|
5028 |
|
5029 |
|
5030 |
|
5031 | contextTypes: SpecPolicy.DEFINE_MANY,
|
5032 |
|
5033 | |
5034 |
|
5035 |
|
5036 |
|
5037 |
|
5038 |
|
5039 | childContextTypes: SpecPolicy.DEFINE_MANY,
|
5040 |
|
5041 |
|
5042 |
|
5043 | |
5044 |
|
5045 |
|
5046 |
|
5047 |
|
5048 |
|
5049 |
|
5050 |
|
5051 |
|
5052 |
|
5053 | getDefaultProps: SpecPolicy.DEFINE_MANY_MERGED,
|
5054 |
|
5055 | |
5056 |
|
5057 |
|
5058 |
|
5059 |
|
5060 |
|
5061 |
|
5062 |
|
5063 |
|
5064 |
|
5065 |
|
5066 |
|
5067 |
|
5068 |
|
5069 | getInitialState: SpecPolicy.DEFINE_MANY_MERGED,
|
5070 |
|
5071 | |
5072 |
|
5073 |
|
5074 |
|
5075 | getChildContext: SpecPolicy.DEFINE_MANY_MERGED,
|
5076 |
|
5077 | |
5078 |
|
5079 |
|
5080 |
|
5081 |
|
5082 |
|
5083 |
|
5084 |
|
5085 |
|
5086 |
|
5087 |
|
5088 |
|
5089 |
|
5090 |
|
5091 |
|
5092 |
|
5093 | render: SpecPolicy.DEFINE_ONCE,
|
5094 |
|
5095 |
|
5096 |
|
5097 | |
5098 |
|
5099 |
|
5100 |
|
5101 |
|
5102 |
|
5103 |
|
5104 | componentWillMount: SpecPolicy.DEFINE_MANY,
|
5105 |
|
5106 | |
5107 |
|
5108 |
|
5109 |
|
5110 |
|
5111 |
|
5112 |
|
5113 |
|
5114 |
|
5115 |
|
5116 | componentDidMount: SpecPolicy.DEFINE_MANY,
|
5117 |
|
5118 | |
5119 |
|
5120 |
|
5121 |
|
5122 |
|
5123 |
|
5124 |
|
5125 |
|
5126 |
|
5127 |
|
5128 |
|
5129 |
|
5130 |
|
5131 |
|
5132 |
|
5133 |
|
5134 |
|
5135 |
|
5136 |
|
5137 | componentWillReceiveProps: SpecPolicy.DEFINE_MANY,
|
5138 |
|
5139 | |
5140 |
|
5141 |
|
5142 |
|
5143 |
|
5144 |
|
5145 |
|
5146 |
|
5147 |
|
5148 |
|
5149 |
|
5150 |
|
5151 |
|
5152 |
|
5153 |
|
5154 |
|
5155 |
|
5156 |
|
5157 |
|
5158 |
|
5159 | shouldComponentUpdate: SpecPolicy.DEFINE_ONCE,
|
5160 |
|
5161 | |
5162 |
|
5163 |
|
5164 |
|
5165 |
|
5166 |
|
5167 |
|
5168 |
|
5169 |
|
5170 |
|
5171 |
|
5172 |
|
5173 |
|
5174 |
|
5175 |
|
5176 | componentWillUpdate: SpecPolicy.DEFINE_MANY,
|
5177 |
|
5178 | |
5179 |
|
5180 |
|
5181 |
|
5182 |
|
5183 |
|
5184 |
|
5185 |
|
5186 |
|
5187 |
|
5188 |
|
5189 |
|
5190 | componentDidUpdate: SpecPolicy.DEFINE_MANY,
|
5191 |
|
5192 | |
5193 |
|
5194 |
|
5195 |
|
5196 |
|
5197 |
|
5198 |
|
5199 |
|
5200 |
|
5201 |
|
5202 |
|
5203 | componentWillUnmount: SpecPolicy.DEFINE_MANY,
|
5204 |
|
5205 |
|
5206 |
|
5207 | |
5208 |
|
5209 |
|
5210 |
|
5211 |
|
5212 |
|
5213 |
|
5214 |
|
5215 |
|
5216 |
|
5217 | updateComponent: SpecPolicy.OVERRIDE_BASE
|
5218 |
|
5219 | };
|
5220 |
|
5221 |
|
5222 |
|
5223 |
|
5224 |
|
5225 |
|
5226 |
|
5227 |
|
5228 |
|
5229 |
|
5230 | var RESERVED_SPEC_KEYS = {
|
5231 | displayName: function (Constructor, displayName) {
|
5232 | Constructor.displayName = displayName;
|
5233 | },
|
5234 | mixins: function (Constructor, mixins) {
|
5235 | if (mixins) {
|
5236 | for (var i = 0; i < mixins.length; i++) {
|
5237 | mixSpecIntoComponent(Constructor, mixins[i]);
|
5238 | }
|
5239 | }
|
5240 | },
|
5241 | childContextTypes: function (Constructor, childContextTypes) {
|
5242 | if ("development" !== 'production') {
|
5243 | validateTypeDef(Constructor, childContextTypes, ReactPropTypeLocations.childContext);
|
5244 | }
|
5245 | Constructor.childContextTypes = _assign({}, Constructor.childContextTypes, childContextTypes);
|
5246 | },
|
5247 | contextTypes: function (Constructor, contextTypes) {
|
5248 | if ("development" !== 'production') {
|
5249 | validateTypeDef(Constructor, contextTypes, ReactPropTypeLocations.context);
|
5250 | }
|
5251 | Constructor.contextTypes = _assign({}, Constructor.contextTypes, contextTypes);
|
5252 | },
|
5253 | |
5254 |
|
5255 |
|
5256 |
|
5257 | getDefaultProps: function (Constructor, getDefaultProps) {
|
5258 | if (Constructor.getDefaultProps) {
|
5259 | Constructor.getDefaultProps = createMergedResultFunction(Constructor.getDefaultProps, getDefaultProps);
|
5260 | } else {
|
5261 | Constructor.getDefaultProps = getDefaultProps;
|
5262 | }
|
5263 | },
|
5264 | propTypes: function (Constructor, propTypes) {
|
5265 | if ("development" !== 'production') {
|
5266 | validateTypeDef(Constructor, propTypes, ReactPropTypeLocations.prop);
|
5267 | }
|
5268 | Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes);
|
5269 | },
|
5270 | statics: function (Constructor, statics) {
|
5271 | mixStaticSpecIntoComponent(Constructor, statics);
|
5272 | },
|
5273 | autobind: function () {} };
|
5274 |
|
5275 |
|
5276 | function validateTypeDef(Constructor, typeDef, location) {
|
5277 | for (var propName in typeDef) {
|
5278 | if (typeDef.hasOwnProperty(propName)) {
|
5279 |
|
5280 |
|
5281 | "development" !== '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;
|
5282 | }
|
5283 | }
|
5284 | }
|
5285 |
|
5286 | function validateMethodOverride(isAlreadyDefined, name) {
|
5287 | var specPolicy = ReactClassInterface.hasOwnProperty(name) ? ReactClassInterface[name] : null;
|
5288 |
|
5289 |
|
5290 | if (ReactClassMixin.hasOwnProperty(name)) {
|
5291 | !(specPolicy === SpecPolicy.OVERRIDE_BASE) ? "development" !== '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) : _prodInvariant('73', name) : void 0;
|
5292 | }
|
5293 |
|
5294 |
|
5295 | if (isAlreadyDefined) {
|
5296 | !(specPolicy === SpecPolicy.DEFINE_MANY || specPolicy === SpecPolicy.DEFINE_MANY_MERGED) ? "development" !== '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) : _prodInvariant('74', name) : void 0;
|
5297 | }
|
5298 | }
|
5299 |
|
5300 |
|
5301 |
|
5302 |
|
5303 |
|
5304 | function mixSpecIntoComponent(Constructor, spec) {
|
5305 | if (!spec) {
|
5306 | if ("development" !== 'production') {
|
5307 | var typeofSpec = typeof spec;
|
5308 | var isMixinValid = typeofSpec === 'object' && spec !== null;
|
5309 |
|
5310 | "development" !== 'production' ? warning(isMixinValid, '%s: You\'re attempting to include a mixin that is either null ' + 'or not an object. Check the mixins included by the component, ' + 'as well as any mixins they include themselves. ' + 'Expected object but got %s.', Constructor.displayName || 'ReactClass', spec === null ? null : typeofSpec) : void 0;
|
5311 | }
|
5312 |
|
5313 | return;
|
5314 | }
|
5315 |
|
5316 | !(typeof spec !== 'function') ? "development" !== 'production' ? invariant(false, 'ReactClass: You\'re attempting to use a component class or function as a mixin. Instead, just use a regular object.') : _prodInvariant('75') : void 0;
|
5317 | !!ReactElement.isValidElement(spec) ? "development" !== 'production' ? invariant(false, 'ReactClass: You\'re attempting to use a component as a mixin. Instead, just use a regular object.') : _prodInvariant('76') : void 0;
|
5318 |
|
5319 | var proto = Constructor.prototype;
|
5320 | var autoBindPairs = proto.__reactAutoBindPairs;
|
5321 |
|
5322 |
|
5323 |
|
5324 |
|
5325 | if (spec.hasOwnProperty(MIXINS_KEY)) {
|
5326 | RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);
|
5327 | }
|
5328 |
|
5329 | for (var name in spec) {
|
5330 | if (!spec.hasOwnProperty(name)) {
|
5331 | continue;
|
5332 | }
|
5333 |
|
5334 | if (name === MIXINS_KEY) {
|
5335 |
|
5336 | continue;
|
5337 | }
|
5338 |
|
5339 | var property = spec[name];
|
5340 | var isAlreadyDefined = proto.hasOwnProperty(name);
|
5341 | validateMethodOverride(isAlreadyDefined, name);
|
5342 |
|
5343 | if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {
|
5344 | RESERVED_SPEC_KEYS[name](Constructor, property);
|
5345 | } else {
|
5346 |
|
5347 |
|
5348 |
|
5349 |
|
5350 | var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);
|
5351 | var isFunction = typeof property === 'function';
|
5352 | var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && spec.autobind !== false;
|
5353 |
|
5354 | if (shouldAutoBind) {
|
5355 | autoBindPairs.push(name, property);
|
5356 | proto[name] = property;
|
5357 | } else {
|
5358 | if (isAlreadyDefined) {
|
5359 | var specPolicy = ReactClassInterface[name];
|
5360 |
|
5361 |
|
5362 | !(isReactClassMethod && (specPolicy === SpecPolicy.DEFINE_MANY_MERGED || specPolicy === SpecPolicy.DEFINE_MANY)) ? "development" !== 'production' ? invariant(false, 'ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.', specPolicy, name) : _prodInvariant('77', specPolicy, name) : void 0;
|
5363 |
|
5364 |
|
5365 |
|
5366 | if (specPolicy === SpecPolicy.DEFINE_MANY_MERGED) {
|
5367 | proto[name] = createMergedResultFunction(proto[name], property);
|
5368 | } else if (specPolicy === SpecPolicy.DEFINE_MANY) {
|
5369 | proto[name] = createChainedFunction(proto[name], property);
|
5370 | }
|
5371 | } else {
|
5372 | proto[name] = property;
|
5373 | if ("development" !== 'production') {
|
5374 |
|
5375 |
|
5376 | if (typeof property === 'function' && spec.displayName) {
|
5377 | proto[name].displayName = spec.displayName + '_' + name;
|
5378 | }
|
5379 | }
|
5380 | }
|
5381 | }
|
5382 | }
|
5383 | }
|
5384 | }
|
5385 |
|
5386 | function mixStaticSpecIntoComponent(Constructor, statics) {
|
5387 | if (!statics) {
|
5388 | return;
|
5389 | }
|
5390 | for (var name in statics) {
|
5391 | var property = statics[name];
|
5392 | if (!statics.hasOwnProperty(name)) {
|
5393 | continue;
|
5394 | }
|
5395 |
|
5396 | var isReserved = name in RESERVED_SPEC_KEYS;
|
5397 | !!isReserved ? "development" !== '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) : _prodInvariant('78', name) : void 0;
|
5398 |
|
5399 | var isInherited = name in Constructor;
|
5400 | !!isInherited ? "development" !== '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) : _prodInvariant('79', name) : void 0;
|
5401 | Constructor[name] = property;
|
5402 | }
|
5403 | }
|
5404 |
|
5405 |
|
5406 |
|
5407 |
|
5408 |
|
5409 |
|
5410 |
|
5411 |
|
5412 | function mergeIntoWithNoDuplicateKeys(one, two) {
|
5413 | !(one && two && typeof one === 'object' && typeof two === 'object') ? "development" !== 'production' ? invariant(false, 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.') : _prodInvariant('80') : void 0;
|
5414 |
|
5415 | for (var key in two) {
|
5416 | if (two.hasOwnProperty(key)) {
|
5417 | !(one[key] === undefined) ? "development" !== '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) : _prodInvariant('81', key) : void 0;
|
5418 | one[key] = two[key];
|
5419 | }
|
5420 | }
|
5421 | return one;
|
5422 | }
|
5423 |
|
5424 |
|
5425 |
|
5426 |
|
5427 |
|
5428 |
|
5429 |
|
5430 |
|
5431 |
|
5432 | function createMergedResultFunction(one, two) {
|
5433 | return function mergedResult() {
|
5434 | var a = one.apply(this, arguments);
|
5435 | var b = two.apply(this, arguments);
|
5436 | if (a == null) {
|
5437 | return b;
|
5438 | } else if (b == null) {
|
5439 | return a;
|
5440 | }
|
5441 | var c = {};
|
5442 | mergeIntoWithNoDuplicateKeys(c, a);
|
5443 | mergeIntoWithNoDuplicateKeys(c, b);
|
5444 | return c;
|
5445 | };
|
5446 | }
|
5447 |
|
5448 |
|
5449 |
|
5450 |
|
5451 |
|
5452 |
|
5453 |
|
5454 |
|
5455 |
|
5456 | function createChainedFunction(one, two) {
|
5457 | return function chainedFunction() {
|
5458 | one.apply(this, arguments);
|
5459 | two.apply(this, arguments);
|
5460 | };
|
5461 | }
|
5462 |
|
5463 |
|
5464 |
|
5465 |
|
5466 |
|
5467 |
|
5468 |
|
5469 |
|
5470 | function bindAutoBindMethod(component, method) {
|
5471 | var boundMethod = method.bind(component);
|
5472 | if ("development" !== 'production') {
|
5473 | boundMethod.__reactBoundContext = component;
|
5474 | boundMethod.__reactBoundMethod = method;
|
5475 | boundMethod.__reactBoundArguments = null;
|
5476 | var componentName = component.constructor.displayName;
|
5477 | var _bind = boundMethod.bind;
|
5478 | boundMethod.bind = function (newThis) {
|
5479 | for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
5480 | args[_key - 1] = arguments[_key];
|
5481 | }
|
5482 |
|
5483 |
|
5484 |
|
5485 |
|
5486 | if (newThis !== component && newThis !== null) {
|
5487 | "development" !== 'production' ? warning(false, 'bind(): React component methods may only be bound to the ' + 'component instance. See %s', componentName) : void 0;
|
5488 | } else if (!args.length) {
|
5489 | "development" !== '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;
|
5490 | return boundMethod;
|
5491 | }
|
5492 | var reboundMethod = _bind.apply(boundMethod, arguments);
|
5493 | reboundMethod.__reactBoundContext = component;
|
5494 | reboundMethod.__reactBoundMethod = method;
|
5495 | reboundMethod.__reactBoundArguments = args;
|
5496 | return reboundMethod;
|
5497 | };
|
5498 | }
|
5499 | return boundMethod;
|
5500 | }
|
5501 |
|
5502 |
|
5503 |
|
5504 |
|
5505 |
|
5506 |
|
5507 | function bindAutoBindMethods(component) {
|
5508 | var pairs = component.__reactAutoBindPairs;
|
5509 | for (var i = 0; i < pairs.length; i += 2) {
|
5510 | var autoBindKey = pairs[i];
|
5511 | var method = pairs[i + 1];
|
5512 | component[autoBindKey] = bindAutoBindMethod(component, method);
|
5513 | }
|
5514 | }
|
5515 |
|
5516 |
|
5517 |
|
5518 |
|
5519 |
|
5520 | var ReactClassMixin = {
|
5521 |
|
5522 | |
5523 |
|
5524 |
|
5525 |
|
5526 | replaceState: function (newState, callback) {
|
5527 | this.updater.enqueueReplaceState(this, newState);
|
5528 | if (callback) {
|
5529 | this.updater.enqueueCallback(this, callback, 'replaceState');
|
5530 | }
|
5531 | },
|
5532 |
|
5533 | |
5534 |
|
5535 |
|
5536 |
|
5537 |
|
5538 |
|
5539 | isMounted: function () {
|
5540 | return this.updater.isMounted(this);
|
5541 | }
|
5542 | };
|
5543 |
|
5544 | var ReactClassComponent = function () {};
|
5545 | _assign(ReactClassComponent.prototype, ReactComponent.prototype, ReactClassMixin);
|
5546 |
|
5547 |
|
5548 |
|
5549 |
|
5550 |
|
5551 |
|
5552 | var ReactClass = {
|
5553 |
|
5554 | |
5555 |
|
5556 |
|
5557 |
|
5558 |
|
5559 |
|
5560 |
|
5561 |
|
5562 | createClass: function (spec) {
|
5563 | var Constructor = function (props, context, updater) {
|
5564 |
|
5565 |
|
5566 |
|
5567 | if ("development" !== 'production') {
|
5568 | "development" !== '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;
|
5569 | }
|
5570 |
|
5571 |
|
5572 | if (this.__reactAutoBindPairs.length) {
|
5573 | bindAutoBindMethods(this);
|
5574 | }
|
5575 |
|
5576 | this.props = props;
|
5577 | this.context = context;
|
5578 | this.refs = emptyObject;
|
5579 | this.updater = updater || ReactNoopUpdateQueue;
|
5580 |
|
5581 | this.state = null;
|
5582 |
|
5583 |
|
5584 |
|
5585 |
|
5586 | var initialState = this.getInitialState ? this.getInitialState() : null;
|
5587 | if ("development" !== 'production') {
|
5588 |
|
5589 | if (initialState === undefined && this.getInitialState._isMockFunction) {
|
5590 |
|
5591 |
|
5592 | initialState = null;
|
5593 | }
|
5594 | }
|
5595 | !(typeof initialState === 'object' && !Array.isArray(initialState)) ? "development" !== 'production' ? invariant(false, '%s.getInitialState(): must return an object or null', Constructor.displayName || 'ReactCompositeComponent') : _prodInvariant('82', Constructor.displayName || 'ReactCompositeComponent') : void 0;
|
5596 |
|
5597 | this.state = initialState;
|
5598 | };
|
5599 | Constructor.prototype = new ReactClassComponent();
|
5600 | Constructor.prototype.constructor = Constructor;
|
5601 | Constructor.prototype.__reactAutoBindPairs = [];
|
5602 |
|
5603 | injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor));
|
5604 |
|
5605 | mixSpecIntoComponent(Constructor, spec);
|
5606 |
|
5607 |
|
5608 | if (Constructor.getDefaultProps) {
|
5609 | Constructor.defaultProps = Constructor.getDefaultProps();
|
5610 | }
|
5611 |
|
5612 | if ("development" !== 'production') {
|
5613 |
|
5614 |
|
5615 |
|
5616 |
|
5617 | if (Constructor.getDefaultProps) {
|
5618 | Constructor.getDefaultProps.isReactClassApproved = {};
|
5619 | }
|
5620 | if (Constructor.prototype.getInitialState) {
|
5621 | Constructor.prototype.getInitialState.isReactClassApproved = {};
|
5622 | }
|
5623 | }
|
5624 |
|
5625 | !Constructor.prototype.render ? "development" !== 'production' ? invariant(false, 'createClass(...): Class specification must implement a `render` method.') : _prodInvariant('83') : void 0;
|
5626 |
|
5627 | if ("development" !== 'production') {
|
5628 | "development" !== '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;
|
5629 | "development" !== 'production' ? warning(!Constructor.prototype.componentWillRecieveProps, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', spec.displayName || 'A component') : void 0;
|
5630 | }
|
5631 |
|
5632 |
|
5633 | for (var methodName in ReactClassInterface) {
|
5634 | if (!Constructor.prototype[methodName]) {
|
5635 | Constructor.prototype[methodName] = null;
|
5636 | }
|
5637 | }
|
5638 |
|
5639 | return Constructor;
|
5640 | },
|
5641 |
|
5642 | injection: {
|
5643 | injectMixin: function (mixin) {
|
5644 | injectedMixins.push(mixin);
|
5645 | }
|
5646 | }
|
5647 |
|
5648 | };
|
5649 |
|
5650 | module.exports = ReactClass;
|
5651 | },{"153":153,"171":171,"178":178,"181":181,"182":182,"187":187,"188":188,"35":35,"65":65,"86":86,"89":89,"90":90}],35:[function(_dereq_,module,exports){
|
5652 |
|
5653 |
|
5654 |
|
5655 |
|
5656 |
|
5657 |
|
5658 |
|
5659 |
|
5660 |
|
5661 |
|
5662 |
|
5663 | 'use strict';
|
5664 |
|
5665 | var _prodInvariant = _dereq_(153);
|
5666 |
|
5667 | var ReactNoopUpdateQueue = _dereq_(86);
|
5668 |
|
5669 | var canDefineProperty = _dereq_(131);
|
5670 | var emptyObject = _dereq_(171);
|
5671 | var invariant = _dereq_(178);
|
5672 | var warning = _dereq_(187);
|
5673 |
|
5674 |
|
5675 |
|
5676 |
|
5677 | function ReactComponent(props, context, updater) {
|
5678 | this.props = props;
|
5679 | this.context = context;
|
5680 | this.refs = emptyObject;
|
5681 |
|
5682 |
|
5683 | this.updater = updater || ReactNoopUpdateQueue;
|
5684 | }
|
5685 |
|
5686 | ReactComponent.prototype.isReactComponent = {};
|
5687 |
|
5688 |
|
5689 |
|
5690 |
|
5691 |
|
5692 |
|
5693 |
|
5694 |
|
5695 |
|
5696 |
|
5697 |
|
5698 |
|
5699 |
|
5700 |
|
5701 |
|
5702 |
|
5703 |
|
5704 |
|
5705 |
|
5706 |
|
5707 |
|
5708 |
|
5709 |
|
5710 |
|
5711 |
|
5712 |
|
5713 | ReactComponent.prototype.setState = function (partialState, callback) {
|
5714 | !(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? "development" !== 'production' ? invariant(false, 'setState(...): takes an object of state variables to update or a function which returns an object of state variables.') : _prodInvariant('85') : void 0;
|
5715 | this.updater.enqueueSetState(this, partialState);
|
5716 | if (callback) {
|
5717 | this.updater.enqueueCallback(this, callback, 'setState');
|
5718 | }
|
5719 | };
|
5720 |
|
5721 |
|
5722 |
|
5723 |
|
5724 |
|
5725 |
|
5726 |
|
5727 |
|
5728 |
|
5729 |
|
5730 |
|
5731 |
|
5732 |
|
5733 |
|
5734 |
|
5735 | ReactComponent.prototype.forceUpdate = function (callback) {
|
5736 | this.updater.enqueueForceUpdate(this);
|
5737 | if (callback) {
|
5738 | this.updater.enqueueCallback(this, callback, 'forceUpdate');
|
5739 | }
|
5740 | };
|
5741 |
|
5742 |
|
5743 |
|
5744 |
|
5745 |
|
5746 |
|
5747 | if ("development" !== 'production') {
|
5748 | var deprecatedAPIs = {
|
5749 | isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
|
5750 | replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
|
5751 | };
|
5752 | var defineDeprecationWarning = function (methodName, info) {
|
5753 | if (canDefineProperty) {
|
5754 | Object.defineProperty(ReactComponent.prototype, methodName, {
|
5755 | get: function () {
|
5756 | "development" !== 'production' ? warning(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]) : void 0;
|
5757 | return undefined;
|
5758 | }
|
5759 | });
|
5760 | }
|
5761 | };
|
5762 | for (var fnName in deprecatedAPIs) {
|
5763 | if (deprecatedAPIs.hasOwnProperty(fnName)) {
|
5764 | defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
|
5765 | }
|
5766 | }
|
5767 | }
|
5768 |
|
5769 | module.exports = ReactComponent;
|
5770 | },{"131":131,"153":153,"171":171,"178":178,"187":187,"86":86}],36:[function(_dereq_,module,exports){
|
5771 |
|
5772 |
|
5773 |
|
5774 |
|
5775 |
|
5776 |
|
5777 |
|
5778 |
|
5779 |
|
5780 |
|
5781 |
|
5782 | 'use strict';
|
5783 |
|
5784 | var DOMChildrenOperations = _dereq_(7);
|
5785 | var ReactDOMIDOperations = _dereq_(51);
|
5786 |
|
5787 |
|
5788 |
|
5789 |
|
5790 |
|
5791 |
|
5792 | var ReactComponentBrowserEnvironment = {
|
5793 |
|
5794 | processChildrenUpdates: ReactDOMIDOperations.dangerouslyProcessChildrenUpdates,
|
5795 |
|
5796 | replaceNodeWithMarkup: DOMChildrenOperations.dangerouslyReplaceNodeWithMarkup
|
5797 |
|
5798 | };
|
5799 |
|
5800 | module.exports = ReactComponentBrowserEnvironment;
|
5801 | },{"51":51,"7":7}],37:[function(_dereq_,module,exports){
|
5802 |
|
5803 |
|
5804 |
|
5805 |
|
5806 |
|
5807 |
|
5808 |
|
5809 |
|
5810 |
|
5811 |
|
5812 |
|
5813 | 'use strict';
|
5814 |
|
5815 | var _prodInvariant = _dereq_(153);
|
5816 |
|
5817 | var invariant = _dereq_(178);
|
5818 |
|
5819 | var injected = false;
|
5820 |
|
5821 | var ReactComponentEnvironment = {
|
5822 |
|
5823 | |
5824 |
|
5825 |
|
5826 |
|
5827 | replaceNodeWithMarkup: null,
|
5828 |
|
5829 | |
5830 |
|
5831 |
|
5832 |
|
5833 | processChildrenUpdates: null,
|
5834 |
|
5835 | injection: {
|
5836 | injectEnvironment: function (environment) {
|
5837 | !!injected ? "development" !== 'production' ? invariant(false, 'ReactCompositeComponent: injectEnvironment() can only be called once.') : _prodInvariant('104') : void 0;
|
5838 | ReactComponentEnvironment.replaceNodeWithMarkup = environment.replaceNodeWithMarkup;
|
5839 | ReactComponentEnvironment.processChildrenUpdates = environment.processChildrenUpdates;
|
5840 | injected = true;
|
5841 | }
|
5842 | }
|
5843 |
|
5844 | };
|
5845 |
|
5846 | module.exports = ReactComponentEnvironment;
|
5847 | },{"153":153,"178":178}],38:[function(_dereq_,module,exports){
|
5848 |
|
5849 |
|
5850 |
|
5851 |
|
5852 |
|
5853 |
|
5854 |
|
5855 |
|
5856 |
|
5857 |
|
5858 |
|
5859 | 'use strict';
|
5860 |
|
5861 | var _prodInvariant = _dereq_(153);
|
5862 |
|
5863 | var ReactCurrentOwner = _dereq_(41);
|
5864 |
|
5865 | var invariant = _dereq_(178);
|
5866 | var warning = _dereq_(187);
|
5867 |
|
5868 | function isNative(fn) {
|
5869 |
|
5870 | var funcToString = Function.prototype.toString;
|
5871 | var hasOwnProperty = Object.prototype.hasOwnProperty;
|
5872 | var reIsNative = RegExp('^' + funcToString
|
5873 |
|
5874 | .call(hasOwnProperty)
|
5875 |
|
5876 | .replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
|
5877 |
|
5878 | .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
|
5879 | try {
|
5880 | var source = funcToString.call(fn);
|
5881 | return reIsNative.test(source);
|
5882 | } catch (err) {
|
5883 | return false;
|
5884 | }
|
5885 | }
|
5886 |
|
5887 | var canUseCollections =
|
5888 |
|
5889 | typeof Array.from === 'function' &&
|
5890 |
|
5891 | typeof Map === 'function' && isNative(Map) &&
|
5892 |
|
5893 | Map.prototype != null && typeof Map.prototype.keys === 'function' && isNative(Map.prototype.keys) &&
|
5894 |
|
5895 | typeof Set === 'function' && isNative(Set) &&
|
5896 |
|
5897 | Set.prototype != null && typeof Set.prototype.keys === 'function' && isNative(Set.prototype.keys);
|
5898 |
|
5899 | var itemMap;
|
5900 | var rootIDSet;
|
5901 |
|
5902 | var itemByKey;
|
5903 | var rootByKey;
|
5904 |
|
5905 | if (canUseCollections) {
|
5906 | itemMap = new Map();
|
5907 | rootIDSet = new Set();
|
5908 | } else {
|
5909 | itemByKey = {};
|
5910 | rootByKey = {};
|
5911 | }
|
5912 |
|
5913 | var unmountedIDs = [];
|
5914 |
|
5915 |
|
5916 |
|
5917 | function getKeyFromID(id) {
|
5918 | return '.' + id;
|
5919 | }
|
5920 | function getIDFromKey(key) {
|
5921 | return parseInt(key.substr(1), 10);
|
5922 | }
|
5923 |
|
5924 | function get(id) {
|
5925 | if (canUseCollections) {
|
5926 | return itemMap.get(id);
|
5927 | } else {
|
5928 | var key = getKeyFromID(id);
|
5929 | return itemByKey[key];
|
5930 | }
|
5931 | }
|
5932 |
|
5933 | function remove(id) {
|
5934 | if (canUseCollections) {
|
5935 | itemMap['delete'](id);
|
5936 | } else {
|
5937 | var key = getKeyFromID(id);
|
5938 | delete itemByKey[key];
|
5939 | }
|
5940 | }
|
5941 |
|
5942 | function create(id, element, parentID) {
|
5943 | var item = {
|
5944 | element: element,
|
5945 | parentID: parentID,
|
5946 | text: null,
|
5947 | childIDs: [],
|
5948 | isMounted: false,
|
5949 | updateCount: 0
|
5950 | };
|
5951 |
|
5952 | if (canUseCollections) {
|
5953 | itemMap.set(id, item);
|
5954 | } else {
|
5955 | var key = getKeyFromID(id);
|
5956 | itemByKey[key] = item;
|
5957 | }
|
5958 | }
|
5959 |
|
5960 | function addRoot(id) {
|
5961 | if (canUseCollections) {
|
5962 | rootIDSet.add(id);
|
5963 | } else {
|
5964 | var key = getKeyFromID(id);
|
5965 | rootByKey[key] = true;
|
5966 | }
|
5967 | }
|
5968 |
|
5969 | function removeRoot(id) {
|
5970 | if (canUseCollections) {
|
5971 | rootIDSet['delete'](id);
|
5972 | } else {
|
5973 | var key = getKeyFromID(id);
|
5974 | delete rootByKey[key];
|
5975 | }
|
5976 | }
|
5977 |
|
5978 | function getRegisteredIDs() {
|
5979 | if (canUseCollections) {
|
5980 | return Array.from(itemMap.keys());
|
5981 | } else {
|
5982 | return Object.keys(itemByKey).map(getIDFromKey);
|
5983 | }
|
5984 | }
|
5985 |
|
5986 | function getRootIDs() {
|
5987 | if (canUseCollections) {
|
5988 | return Array.from(rootIDSet.keys());
|
5989 | } else {
|
5990 | return Object.keys(rootByKey).map(getIDFromKey);
|
5991 | }
|
5992 | }
|
5993 |
|
5994 | function purgeDeep(id) {
|
5995 | var item = get(id);
|
5996 | if (item) {
|
5997 | var childIDs = item.childIDs;
|
5998 |
|
5999 | remove(id);
|
6000 | childIDs.forEach(purgeDeep);
|
6001 | }
|
6002 | }
|
6003 |
|
6004 | function describeComponentFrame(name, source, ownerName) {
|
6005 | return '\n in ' + name + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');
|
6006 | }
|
6007 |
|
6008 | function getDisplayName(element) {
|
6009 | if (element == null) {
|
6010 | return '#empty';
|
6011 | } else if (typeof element === 'string' || typeof element === 'number') {
|
6012 | return '#text';
|
6013 | } else if (typeof element.type === 'string') {
|
6014 | return element.type;
|
6015 | } else {
|
6016 | return element.type.displayName || element.type.name || 'Unknown';
|
6017 | }
|
6018 | }
|
6019 |
|
6020 | function describeID(id) {
|
6021 | var name = ReactComponentTreeHook.getDisplayName(id);
|
6022 | var element = ReactComponentTreeHook.getElement(id);
|
6023 | var ownerID = ReactComponentTreeHook.getOwnerID(id);
|
6024 | var ownerName;
|
6025 | if (ownerID) {
|
6026 | ownerName = ReactComponentTreeHook.getDisplayName(ownerID);
|
6027 | }
|
6028 | "development" !== 'production' ? warning(element, 'ReactComponentTreeHook: Missing React element for debugID %s when ' + 'building stack', id) : void 0;
|
6029 | return describeComponentFrame(name, element && element._source, ownerName);
|
6030 | }
|
6031 |
|
6032 | var ReactComponentTreeHook = {
|
6033 | onSetChildren: function (id, nextChildIDs) {
|
6034 | var item = get(id);
|
6035 | item.childIDs = nextChildIDs;
|
6036 |
|
6037 | for (var i = 0; i < nextChildIDs.length; i++) {
|
6038 | var nextChildID = nextChildIDs[i];
|
6039 | var nextChild = get(nextChildID);
|
6040 | !nextChild ? "development" !== 'production' ? invariant(false, 'Expected hook events to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('140') : void 0;
|
6041 | !(nextChild.childIDs != null || typeof nextChild.element !== 'object' || nextChild.element == null) ? "development" !== 'production' ? invariant(false, 'Expected onSetChildren() to fire for a container child before its parent includes it in onSetChildren().') : _prodInvariant('141') : void 0;
|
6042 | !nextChild.isMounted ? "development" !== 'production' ? invariant(false, 'Expected onMountComponent() to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('71') : void 0;
|
6043 | if (nextChild.parentID == null) {
|
6044 | nextChild.parentID = id;
|
6045 |
|
6046 |
|
6047 |
|
6048 | }
|
6049 | !(nextChild.parentID === id) ? "development" !== 'production' ? invariant(false, 'Expected onBeforeMountComponent() parent and onSetChildren() to be consistent (%s has parents %s and %s).', nextChildID, nextChild.parentID, id) : _prodInvariant('142', nextChildID, nextChild.parentID, id) : void 0;
|
6050 | }
|
6051 | },
|
6052 | onBeforeMountComponent: function (id, element, parentID) {
|
6053 | create(id, element, parentID);
|
6054 | },
|
6055 | onBeforeUpdateComponent: function (id, element) {
|
6056 | var item = get(id);
|
6057 | if (!item || !item.isMounted) {
|
6058 |
|
6059 |
|
6060 | return;
|
6061 | }
|
6062 | item.element = element;
|
6063 | },
|
6064 | onMountComponent: function (id) {
|
6065 | var item = get(id);
|
6066 | item.isMounted = true;
|
6067 | var isRoot = item.parentID === 0;
|
6068 | if (isRoot) {
|
6069 | addRoot(id);
|
6070 | }
|
6071 | },
|
6072 | onUpdateComponent: function (id) {
|
6073 | var item = get(id);
|
6074 | if (!item || !item.isMounted) {
|
6075 |
|
6076 |
|
6077 | return;
|
6078 | }
|
6079 | item.updateCount++;
|
6080 | },
|
6081 | onUnmountComponent: function (id) {
|
6082 | var item = get(id);
|
6083 | if (item) {
|
6084 |
|
6085 |
|
6086 |
|
6087 |
|
6088 |
|
6089 | item.isMounted = false;
|
6090 | var isRoot = item.parentID === 0;
|
6091 | if (isRoot) {
|
6092 | removeRoot(id);
|
6093 | }
|
6094 | }
|
6095 | unmountedIDs.push(id);
|
6096 | },
|
6097 | purgeUnmountedComponents: function () {
|
6098 | if (ReactComponentTreeHook._preventPurging) {
|
6099 |
|
6100 | return;
|
6101 | }
|
6102 |
|
6103 | for (var i = 0; i < unmountedIDs.length; i++) {
|
6104 | var id = unmountedIDs[i];
|
6105 | purgeDeep(id);
|
6106 | }
|
6107 | unmountedIDs.length = 0;
|
6108 | },
|
6109 | isMounted: function (id) {
|
6110 | var item = get(id);
|
6111 | return item ? item.isMounted : false;
|
6112 | },
|
6113 | getCurrentStackAddendum: function (topElement) {
|
6114 | var info = '';
|
6115 | if (topElement) {
|
6116 | var type = topElement.type;
|
6117 | var name = typeof type === 'function' ? type.displayName || type.name : type;
|
6118 | var owner = topElement._owner;
|
6119 | info += describeComponentFrame(name || 'Unknown', topElement._source, owner && owner.getName());
|
6120 | }
|
6121 |
|
6122 | var currentOwner = ReactCurrentOwner.current;
|
6123 | var id = currentOwner && currentOwner._debugID;
|
6124 |
|
6125 | info += ReactComponentTreeHook.getStackAddendumByID(id);
|
6126 | return info;
|
6127 | },
|
6128 | getStackAddendumByID: function (id) {
|
6129 | var info = '';
|
6130 | while (id) {
|
6131 | info += describeID(id);
|
6132 | id = ReactComponentTreeHook.getParentID(id);
|
6133 | }
|
6134 | return info;
|
6135 | },
|
6136 | getChildIDs: function (id) {
|
6137 | var item = get(id);
|
6138 | return item ? item.childIDs : [];
|
6139 | },
|
6140 | getDisplayName: function (id) {
|
6141 | var element = ReactComponentTreeHook.getElement(id);
|
6142 | if (!element) {
|
6143 | return null;
|
6144 | }
|
6145 | return getDisplayName(element);
|
6146 | },
|
6147 | getElement: function (id) {
|
6148 | var item = get(id);
|
6149 | return item ? item.element : null;
|
6150 | },
|
6151 | getOwnerID: function (id) {
|
6152 | var element = ReactComponentTreeHook.getElement(id);
|
6153 | if (!element || !element._owner) {
|
6154 | return null;
|
6155 | }
|
6156 | return element._owner._debugID;
|
6157 | },
|
6158 | getParentID: function (id) {
|
6159 | var item = get(id);
|
6160 | return item ? item.parentID : null;
|
6161 | },
|
6162 | getSource: function (id) {
|
6163 | var item = get(id);
|
6164 | var element = item ? item.element : null;
|
6165 | var source = element != null ? element._source : null;
|
6166 | return source;
|
6167 | },
|
6168 | getText: function (id) {
|
6169 | var element = ReactComponentTreeHook.getElement(id);
|
6170 | if (typeof element === 'string') {
|
6171 | return element;
|
6172 | } else if (typeof element === 'number') {
|
6173 | return '' + element;
|
6174 | } else {
|
6175 | return null;
|
6176 | }
|
6177 | },
|
6178 | getUpdateCount: function (id) {
|
6179 | var item = get(id);
|
6180 | return item ? item.updateCount : 0;
|
6181 | },
|
6182 |
|
6183 |
|
6184 | getRegisteredIDs: getRegisteredIDs,
|
6185 |
|
6186 | getRootIDs: getRootIDs
|
6187 | };
|
6188 |
|
6189 | module.exports = ReactComponentTreeHook;
|
6190 | },{"153":153,"178":178,"187":187,"41":41}],39:[function(_dereq_,module,exports){
|
6191 |
|
6192 |
|
6193 |
|
6194 |
|
6195 |
|
6196 |
|
6197 |
|
6198 |
|
6199 |
|
6200 |
|
6201 |
|
6202 | 'use strict';
|
6203 |
|
6204 | var shallowCompare = _dereq_(157);
|
6205 |
|
6206 |
|
6207 |
|
6208 |
|
6209 |
|
6210 |
|
6211 |
|
6212 |
|
6213 |
|
6214 |
|
6215 |
|
6216 |
|
6217 |
|
6218 |
|
6219 |
|
6220 |
|
6221 |
|
6222 |
|
6223 |
|
6224 |
|
6225 |
|
6226 |
|
6227 |
|
6228 |
|
6229 |
|
6230 |
|
6231 |
|
6232 | var ReactComponentWithPureRenderMixin = {
|
6233 | shouldComponentUpdate: function (nextProps, nextState) {
|
6234 | return shallowCompare(this, nextProps, nextState);
|
6235 | }
|
6236 | };
|
6237 |
|
6238 | module.exports = ReactComponentWithPureRenderMixin;
|
6239 | },{"157":157}],40:[function(_dereq_,module,exports){
|
6240 |
|
6241 |
|
6242 |
|
6243 |
|
6244 |
|
6245 |
|
6246 |
|
6247 |
|
6248 |
|
6249 |
|
6250 |
|
6251 | 'use strict';
|
6252 |
|
6253 | var _prodInvariant = _dereq_(153),
|
6254 | _assign = _dereq_(188);
|
6255 |
|
6256 | var ReactComponentEnvironment = _dereq_(37);
|
6257 | var ReactCurrentOwner = _dereq_(41);
|
6258 | var ReactElement = _dereq_(65);
|
6259 | var ReactErrorUtils = _dereq_(68);
|
6260 | var ReactInstanceMap = _dereq_(77);
|
6261 | var ReactInstrumentation = _dereq_(78);
|
6262 | var ReactNodeTypes = _dereq_(85);
|
6263 | var ReactPropTypeLocations = _dereq_(90);
|
6264 | var ReactReconciler = _dereq_(95);
|
6265 |
|
6266 | var checkReactTypeSpec = _dereq_(132);
|
6267 | var emptyObject = _dereq_(171);
|
6268 | var invariant = _dereq_(178);
|
6269 | var shallowEqual = _dereq_(186);
|
6270 | var shouldUpdateReactComponent = _dereq_(158);
|
6271 | var warning = _dereq_(187);
|
6272 |
|
6273 | var CompositeTypes = {
|
6274 | ImpureClass: 0,
|
6275 | PureClass: 1,
|
6276 | StatelessFunctional: 2
|
6277 | };
|
6278 |
|
6279 | function StatelessComponent(Component) {}
|
6280 | StatelessComponent.prototype.render = function () {
|
6281 | var Component = ReactInstanceMap.get(this)._currentElement.type;
|
6282 | var element = Component(this.props, this.context, this.updater);
|
6283 | warnIfInvalidElement(Component, element);
|
6284 | return element;
|
6285 | };
|
6286 |
|
6287 | function warnIfInvalidElement(Component, element) {
|
6288 | if ("development" !== 'production') {
|
6289 | "development" !== 'production' ? warning(element === null || element === false || ReactElement.isValidElement(element), '%s(...): A valid React element (or null) must be returned. You may have ' + 'returned undefined, an array or some other invalid object.', Component.displayName || Component.name || 'Component') : void 0;
|
6290 | "development" !== 'production' ? warning(!Component.childContextTypes, '%s(...): childContextTypes cannot be defined on a functional component.', Component.displayName || Component.name || 'Component') : void 0;
|
6291 | }
|
6292 | }
|
6293 |
|
6294 | function shouldConstruct(Component) {
|
6295 | return !!(Component.prototype && Component.prototype.isReactComponent);
|
6296 | }
|
6297 |
|
6298 | function isPureComponent(Component) {
|
6299 | return !!(Component.prototype && Component.prototype.isPureReactComponent);
|
6300 | }
|
6301 |
|
6302 |
|
6303 | function measureLifeCyclePerf(fn, debugID, timerType) {
|
6304 | if (debugID === 0) {
|
6305 |
|
6306 |
|
6307 |
|
6308 | return fn();
|
6309 | }
|
6310 |
|
6311 | ReactInstrumentation.debugTool.onBeginLifeCycleTimer(debugID, timerType);
|
6312 | try {
|
6313 | return fn();
|
6314 | } finally {
|
6315 | ReactInstrumentation.debugTool.onEndLifeCycleTimer(debugID, timerType);
|
6316 | }
|
6317 | }
|
6318 |
|
6319 |
|
6320 |
|
6321 |
|
6322 |
|
6323 |
|
6324 |
|
6325 |
|
6326 |
|
6327 |
|
6328 |
|
6329 |
|
6330 |
|
6331 |
|
6332 |
|
6333 |
|
6334 |
|
6335 |
|
6336 |
|
6337 |
|
6338 |
|
6339 |
|
6340 |
|
6341 |
|
6342 |
|
6343 |
|
6344 |
|
6345 |
|
6346 |
|
6347 |
|
6348 |
|
6349 |
|
6350 |
|
6351 |
|
6352 | var nextMountID = 1;
|
6353 |
|
6354 |
|
6355 |
|
6356 |
|
6357 | var ReactCompositeComponentMixin = {
|
6358 |
|
6359 | |
6360 |
|
6361 |
|
6362 |
|
6363 |
|
6364 |
|
6365 |
|
6366 | construct: function (element) {
|
6367 | this._currentElement = element;
|
6368 | this._rootNodeID = 0;
|
6369 | this._compositeType = null;
|
6370 | this._instance = null;
|
6371 | this._hostParent = null;
|
6372 | this._hostContainerInfo = null;
|
6373 |
|
6374 |
|
6375 | this._updateBatchNumber = null;
|
6376 | this._pendingElement = null;
|
6377 | this._pendingStateQueue = null;
|
6378 | this._pendingReplaceState = false;
|
6379 | this._pendingForceUpdate = false;
|
6380 |
|
6381 | this._renderedNodeType = null;
|
6382 | this._renderedComponent = null;
|
6383 | this._context = null;
|
6384 | this._mountOrder = 0;
|
6385 | this._topLevelWrapper = null;
|
6386 |
|
6387 |
|
6388 | this._pendingCallbacks = null;
|
6389 |
|
6390 |
|
6391 | this._calledComponentWillUnmount = false;
|
6392 |
|
6393 | if ("development" !== 'production') {
|
6394 | this._warnedAboutRefsInRender = false;
|
6395 | }
|
6396 | },
|
6397 |
|
6398 | |
6399 |
|
6400 |
|
6401 |
|
6402 |
|
6403 |
|
6404 |
|
6405 |
|
6406 |
|
6407 |
|
6408 |
|
6409 | mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
|
6410 | var _this = this;
|
6411 |
|
6412 | this._context = context;
|
6413 | this._mountOrder = nextMountID++;
|
6414 | this._hostParent = hostParent;
|
6415 | this._hostContainerInfo = hostContainerInfo;
|
6416 |
|
6417 | var publicProps = this._currentElement.props;
|
6418 | var publicContext = this._processContext(context);
|
6419 |
|
6420 | var Component = this._currentElement.type;
|
6421 |
|
6422 | var updateQueue = transaction.getUpdateQueue();
|
6423 |
|
6424 |
|
6425 | var doConstruct = shouldConstruct(Component);
|
6426 | var inst = this._constructComponent(doConstruct, publicProps, publicContext, updateQueue);
|
6427 | var renderedElement;
|
6428 |
|
6429 |
|
6430 | if (!doConstruct && (inst == null || inst.render == null)) {
|
6431 | renderedElement = inst;
|
6432 | warnIfInvalidElement(Component, renderedElement);
|
6433 | !(inst === null || inst === false || ReactElement.isValidElement(inst)) ? "development" !== 'production' ? invariant(false, '%s(...): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object.', Component.displayName || Component.name || 'Component') : _prodInvariant('105', Component.displayName || Component.name || 'Component') : void 0;
|
6434 | inst = new StatelessComponent(Component);
|
6435 | this._compositeType = CompositeTypes.StatelessFunctional;
|
6436 | } else {
|
6437 | if (isPureComponent(Component)) {
|
6438 | this._compositeType = CompositeTypes.PureClass;
|
6439 | } else {
|
6440 | this._compositeType = CompositeTypes.ImpureClass;
|
6441 | }
|
6442 | }
|
6443 |
|
6444 | if ("development" !== 'production') {
|
6445 |
|
6446 |
|
6447 | if (inst.render == null) {
|
6448 | "development" !== 'production' ? warning(false, '%s(...): No `render` method found on the returned component ' + 'instance: you may have forgotten to define `render`.', Component.displayName || Component.name || 'Component') : void 0;
|
6449 | }
|
6450 |
|
6451 | var propsMutated = inst.props !== publicProps;
|
6452 | var componentName = Component.displayName || Component.name || 'Component';
|
6453 |
|
6454 | "development" !== 'production' ? warning(inst.props === undefined || !propsMutated, '%s(...): When calling super() in `%s`, make sure to pass ' + 'up the same props that your component\'s constructor was passed.', componentName, componentName) : void 0;
|
6455 | }
|
6456 |
|
6457 |
|
6458 |
|
6459 | inst.props = publicProps;
|
6460 | inst.context = publicContext;
|
6461 | inst.refs = emptyObject;
|
6462 | inst.updater = updateQueue;
|
6463 |
|
6464 | this._instance = inst;
|
6465 |
|
6466 |
|
6467 | ReactInstanceMap.set(inst, this);
|
6468 |
|
6469 | if ("development" !== 'production') {
|
6470 |
|
6471 |
|
6472 |
|
6473 | "development" !== 'production' ? warning(!inst.getInitialState || inst.getInitialState.isReactClassApproved, 'getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', this.getName() || 'a component') : void 0;
|
6474 | "development" !== 'production' ? warning(!inst.getDefaultProps || inst.getDefaultProps.isReactClassApproved, 'getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', this.getName() || 'a component') : void 0;
|
6475 | "development" !== 'production' ? warning(!inst.propTypes, 'propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', this.getName() || 'a component') : void 0;
|
6476 | "development" !== 'production' ? warning(!inst.contextTypes, 'contextTypes was defined as an instance property on %s. Use a ' + 'static property to define contextTypes instead.', this.getName() || 'a component') : void 0;
|
6477 | "development" !== 'production' ? warning(typeof inst.componentShouldUpdate !== 'function', '%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.', this.getName() || 'A component') : void 0;
|
6478 | "development" !== 'production' ? warning(typeof inst.componentDidUnmount !== 'function', '%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', this.getName() || 'A component') : void 0;
|
6479 | "development" !== 'production' ? warning(typeof inst.componentWillRecieveProps !== 'function', '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', this.getName() || 'A component') : void 0;
|
6480 | }
|
6481 |
|
6482 | var initialState = inst.state;
|
6483 | if (initialState === undefined) {
|
6484 | inst.state = initialState = null;
|
6485 | }
|
6486 | !(typeof initialState === 'object' && !Array.isArray(initialState)) ? "development" !== 'production' ? invariant(false, '%s.state: must be set to an object or null', this.getName() || 'ReactCompositeComponent') : _prodInvariant('106', this.getName() || 'ReactCompositeComponent') : void 0;
|
6487 |
|
6488 | this._pendingStateQueue = null;
|
6489 | this._pendingReplaceState = false;
|
6490 | this._pendingForceUpdate = false;
|
6491 |
|
6492 | var markup;
|
6493 | if (inst.unstable_handleError) {
|
6494 | markup = this.performInitialMountWithErrorHandling(renderedElement, hostParent, hostContainerInfo, transaction, context);
|
6495 | } else {
|
6496 | markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context);
|
6497 | }
|
6498 |
|
6499 | if (inst.componentDidMount) {
|
6500 | if ("development" !== 'production') {
|
6501 | transaction.getReactMountReady().enqueue(function () {
|
6502 | measureLifeCyclePerf(function () {
|
6503 | return inst.componentDidMount();
|
6504 | }, _this._debugID, 'componentDidMount');
|
6505 | });
|
6506 | } else {
|
6507 | transaction.getReactMountReady().enqueue(inst.componentDidMount, inst);
|
6508 | }
|
6509 | }
|
6510 |
|
6511 | return markup;
|
6512 | },
|
6513 |
|
6514 | _constructComponent: function (doConstruct, publicProps, publicContext, updateQueue) {
|
6515 | if ("development" !== 'production') {
|
6516 | ReactCurrentOwner.current = this;
|
6517 | try {
|
6518 | return this._constructComponentWithoutOwner(doConstruct, publicProps, publicContext, updateQueue);
|
6519 | } finally {
|
6520 | ReactCurrentOwner.current = null;
|
6521 | }
|
6522 | } else {
|
6523 | return this._constructComponentWithoutOwner(doConstruct, publicProps, publicContext, updateQueue);
|
6524 | }
|
6525 | },
|
6526 |
|
6527 | _constructComponentWithoutOwner: function (doConstruct, publicProps, publicContext, updateQueue) {
|
6528 | var Component = this._currentElement.type;
|
6529 |
|
6530 | if (doConstruct) {
|
6531 | if ("development" !== 'production') {
|
6532 | return measureLifeCyclePerf(function () {
|
6533 | return new Component(publicProps, publicContext, updateQueue);
|
6534 | }, this._debugID, 'ctor');
|
6535 | } else {
|
6536 | return new Component(publicProps, publicContext, updateQueue);
|
6537 | }
|
6538 | }
|
6539 |
|
6540 |
|
6541 |
|
6542 | if ("development" !== 'production') {
|
6543 | return measureLifeCyclePerf(function () {
|
6544 | return Component(publicProps, publicContext, updateQueue);
|
6545 | }, this._debugID, 'render');
|
6546 | } else {
|
6547 | return Component(publicProps, publicContext, updateQueue);
|
6548 | }
|
6549 | },
|
6550 |
|
6551 | performInitialMountWithErrorHandling: function (renderedElement, hostParent, hostContainerInfo, transaction, context) {
|
6552 | var markup;
|
6553 | var checkpoint = transaction.checkpoint();
|
6554 | try {
|
6555 | markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context);
|
6556 | } catch (e) {
|
6557 |
|
6558 | transaction.rollback(checkpoint);
|
6559 | this._instance.unstable_handleError(e);
|
6560 | if (this._pendingStateQueue) {
|
6561 | this._instance.state = this._processPendingState(this._instance.props, this._instance.context);
|
6562 | }
|
6563 | checkpoint = transaction.checkpoint();
|
6564 |
|
6565 | this._renderedComponent.unmountComponent(true);
|
6566 | transaction.rollback(checkpoint);
|
6567 |
|
6568 |
|
6569 |
|
6570 | markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context);
|
6571 | }
|
6572 | return markup;
|
6573 | },
|
6574 |
|
6575 | performInitialMount: function (renderedElement, hostParent, hostContainerInfo, transaction, context) {
|
6576 | var inst = this._instance;
|
6577 |
|
6578 | var debugID = 0;
|
6579 | if ("development" !== 'production') {
|
6580 | debugID = this._debugID;
|
6581 | }
|
6582 |
|
6583 | if (inst.componentWillMount) {
|
6584 | if ("development" !== 'production') {
|
6585 | measureLifeCyclePerf(function () {
|
6586 | return inst.componentWillMount();
|
6587 | }, debugID, 'componentWillMount');
|
6588 | } else {
|
6589 | inst.componentWillMount();
|
6590 | }
|
6591 |
|
6592 |
|
6593 | if (this._pendingStateQueue) {
|
6594 | inst.state = this._processPendingState(inst.props, inst.context);
|
6595 | }
|
6596 | }
|
6597 |
|
6598 |
|
6599 | if (renderedElement === undefined) {
|
6600 | renderedElement = this._renderValidatedComponent();
|
6601 | }
|
6602 |
|
6603 | var nodeType = ReactNodeTypes.getType(renderedElement);
|
6604 | this._renderedNodeType = nodeType;
|
6605 | var child = this._instantiateReactComponent(renderedElement, nodeType !== ReactNodeTypes.EMPTY
|
6606 | );
|
6607 | this._renderedComponent = child;
|
6608 |
|
6609 | var markup = ReactReconciler.mountComponent(child, transaction, hostParent, hostContainerInfo, this._processChildContext(context), debugID);
|
6610 |
|
6611 | if ("development" !== 'production') {
|
6612 | if (debugID !== 0) {
|
6613 | var childDebugIDs = child._debugID !== 0 ? [child._debugID] : [];
|
6614 | ReactInstrumentation.debugTool.onSetChildren(debugID, childDebugIDs);
|
6615 | }
|
6616 | }
|
6617 |
|
6618 | return markup;
|
6619 | },
|
6620 |
|
6621 | getHostNode: function () {
|
6622 | return ReactReconciler.getHostNode(this._renderedComponent);
|
6623 | },
|
6624 |
|
6625 | |
6626 |
|
6627 |
|
6628 |
|
6629 |
|
6630 |
|
6631 | unmountComponent: function (safely) {
|
6632 | if (!this._renderedComponent) {
|
6633 | return;
|
6634 | }
|
6635 |
|
6636 | var inst = this._instance;
|
6637 |
|
6638 | if (inst.componentWillUnmount && !inst._calledComponentWillUnmount) {
|
6639 | inst._calledComponentWillUnmount = true;
|
6640 |
|
6641 | if (safely) {
|
6642 | var name = this.getName() + '.componentWillUnmount()';
|
6643 | ReactErrorUtils.invokeGuardedCallback(name, inst.componentWillUnmount.bind(inst));
|
6644 | } else {
|
6645 | if ("development" !== 'production') {
|
6646 | measureLifeCyclePerf(function () {
|
6647 | return inst.componentWillUnmount();
|
6648 | }, this._debugID, 'componentWillUnmount');
|
6649 | } else {
|
6650 | inst.componentWillUnmount();
|
6651 | }
|
6652 | }
|
6653 | }
|
6654 |
|
6655 | if (this._renderedComponent) {
|
6656 | ReactReconciler.unmountComponent(this._renderedComponent, safely);
|
6657 | this._renderedNodeType = null;
|
6658 | this._renderedComponent = null;
|
6659 | this._instance = null;
|
6660 | }
|
6661 |
|
6662 |
|
6663 |
|
6664 |
|
6665 | this._pendingStateQueue = null;
|
6666 | this._pendingReplaceState = false;
|
6667 | this._pendingForceUpdate = false;
|
6668 | this._pendingCallbacks = null;
|
6669 | this._pendingElement = null;
|
6670 |
|
6671 |
|
6672 |
|
6673 | this._context = null;
|
6674 | this._rootNodeID = 0;
|
6675 | this._topLevelWrapper = null;
|
6676 |
|
6677 |
|
6678 |
|
6679 |
|
6680 | ReactInstanceMap.remove(inst);
|
6681 |
|
6682 |
|
6683 |
|
6684 |
|
6685 |
|
6686 |
|
6687 | },
|
6688 |
|
6689 | |
6690 |
|
6691 |
|
6692 |
|
6693 |
|
6694 |
|
6695 |
|
6696 |
|
6697 | _maskContext: function (context) {
|
6698 | var Component = this._currentElement.type;
|
6699 | var contextTypes = Component.contextTypes;
|
6700 | if (!contextTypes) {
|
6701 | return emptyObject;
|
6702 | }
|
6703 | var maskedContext = {};
|
6704 | for (var contextName in contextTypes) {
|
6705 | maskedContext[contextName] = context[contextName];
|
6706 | }
|
6707 | return maskedContext;
|
6708 | },
|
6709 |
|
6710 | |
6711 |
|
6712 |
|
6713 |
|
6714 |
|
6715 |
|
6716 |
|
6717 |
|
6718 | _processContext: function (context) {
|
6719 | var maskedContext = this._maskContext(context);
|
6720 | if ("development" !== 'production') {
|
6721 | var Component = this._currentElement.type;
|
6722 | if (Component.contextTypes) {
|
6723 | this._checkContextTypes(Component.contextTypes, maskedContext, ReactPropTypeLocations.context);
|
6724 | }
|
6725 | }
|
6726 | return maskedContext;
|
6727 | },
|
6728 |
|
6729 | |
6730 |
|
6731 |
|
6732 |
|
6733 |
|
6734 | _processChildContext: function (currentContext) {
|
6735 | var Component = this._currentElement.type;
|
6736 | var inst = this._instance;
|
6737 | var childContext;
|
6738 |
|
6739 | if (inst.getChildContext) {
|
6740 | if ("development" !== 'production') {
|
6741 | ReactInstrumentation.debugTool.onBeginProcessingChildContext();
|
6742 | try {
|
6743 | childContext = inst.getChildContext();
|
6744 | } finally {
|
6745 | ReactInstrumentation.debugTool.onEndProcessingChildContext();
|
6746 | }
|
6747 | } else {
|
6748 | childContext = inst.getChildContext();
|
6749 | }
|
6750 | }
|
6751 |
|
6752 | if (childContext) {
|
6753 | !(typeof Component.childContextTypes === 'object') ? "development" !== 'production' ? invariant(false, '%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().', this.getName() || 'ReactCompositeComponent') : _prodInvariant('107', this.getName() || 'ReactCompositeComponent') : void 0;
|
6754 | if ("development" !== 'production') {
|
6755 | this._checkContextTypes(Component.childContextTypes, childContext, ReactPropTypeLocations.childContext);
|
6756 | }
|
6757 | for (var name in childContext) {
|
6758 | !(name in Component.childContextTypes) ? "development" !== 'production' ? invariant(false, '%s.getChildContext(): key "%s" is not defined in childContextTypes.', this.getName() || 'ReactCompositeComponent', name) : _prodInvariant('108', this.getName() || 'ReactCompositeComponent', name) : void 0;
|
6759 | }
|
6760 | return _assign({}, currentContext, childContext);
|
6761 | }
|
6762 | return currentContext;
|
6763 | },
|
6764 |
|
6765 | |
6766 |
|
6767 |
|
6768 |
|
6769 |
|
6770 |
|
6771 |
|
6772 |
|
6773 | _checkContextTypes: function (typeSpecs, values, location) {
|
6774 | checkReactTypeSpec(typeSpecs, values, location, this.getName(), null, this._debugID);
|
6775 | },
|
6776 |
|
6777 | receiveComponent: function (nextElement, transaction, nextContext) {
|
6778 | var prevElement = this._currentElement;
|
6779 | var prevContext = this._context;
|
6780 |
|
6781 | this._pendingElement = null;
|
6782 |
|
6783 | this.updateComponent(transaction, prevElement, nextElement, prevContext, nextContext);
|
6784 | },
|
6785 |
|
6786 | |
6787 |
|
6788 |
|
6789 |
|
6790 |
|
6791 |
|
6792 |
|
6793 | performUpdateIfNecessary: function (transaction) {
|
6794 | if (this._pendingElement != null) {
|
6795 | ReactReconciler.receiveComponent(this, this._pendingElement, transaction, this._context);
|
6796 | } else if (this._pendingStateQueue !== null || this._pendingForceUpdate) {
|
6797 | this.updateComponent(transaction, this._currentElement, this._currentElement, this._context, this._context);
|
6798 | } else {
|
6799 | this._updateBatchNumber = null;
|
6800 | }
|
6801 | },
|
6802 |
|
6803 | |
6804 |
|
6805 |
|
6806 |
|
6807 |
|
6808 |
|
6809 |
|
6810 |
|
6811 |
|
6812 |
|
6813 |
|
6814 |
|
6815 |
|
6816 |
|
6817 |
|
6818 | updateComponent: function (transaction, prevParentElement, nextParentElement, prevUnmaskedContext, nextUnmaskedContext) {
|
6819 | var inst = this._instance;
|
6820 | !(inst != null) ? "development" !== 'production' ? invariant(false, 'Attempted to update component `%s` that has already been unmounted (or failed to mount).', this.getName() || 'ReactCompositeComponent') : _prodInvariant('136', this.getName() || 'ReactCompositeComponent') : void 0;
|
6821 |
|
6822 | var willReceive = false;
|
6823 | var nextContext;
|
6824 |
|
6825 |
|
6826 | if (this._context === nextUnmaskedContext) {
|
6827 | nextContext = inst.context;
|
6828 | } else {
|
6829 | nextContext = this._processContext(nextUnmaskedContext);
|
6830 | willReceive = true;
|
6831 | }
|
6832 |
|
6833 | var prevProps = prevParentElement.props;
|
6834 | var nextProps = nextParentElement.props;
|
6835 |
|
6836 |
|
6837 | if (prevParentElement !== nextParentElement) {
|
6838 | willReceive = true;
|
6839 | }
|
6840 |
|
6841 |
|
6842 |
|
6843 |
|
6844 | if (willReceive && inst.componentWillReceiveProps) {
|
6845 | if ("development" !== 'production') {
|
6846 | measureLifeCyclePerf(function () {
|
6847 | return inst.componentWillReceiveProps(nextProps, nextContext);
|
6848 | }, this._debugID, 'componentWillReceiveProps');
|
6849 | } else {
|
6850 | inst.componentWillReceiveProps(nextProps, nextContext);
|
6851 | }
|
6852 | }
|
6853 |
|
6854 | var nextState = this._processPendingState(nextProps, nextContext);
|
6855 | var shouldUpdate = true;
|
6856 |
|
6857 | if (!this._pendingForceUpdate) {
|
6858 | if (inst.shouldComponentUpdate) {
|
6859 | if ("development" !== 'production') {
|
6860 | shouldUpdate = measureLifeCyclePerf(function () {
|
6861 | return inst.shouldComponentUpdate(nextProps, nextState, nextContext);
|
6862 | }, this._debugID, 'shouldComponentUpdate');
|
6863 | } else {
|
6864 | shouldUpdate = inst.shouldComponentUpdate(nextProps, nextState, nextContext);
|
6865 | }
|
6866 | } else {
|
6867 | if (this._compositeType === CompositeTypes.PureClass) {
|
6868 | shouldUpdate = !shallowEqual(prevProps, nextProps) || !shallowEqual(inst.state, nextState);
|
6869 | }
|
6870 | }
|
6871 | }
|
6872 |
|
6873 | if ("development" !== 'production') {
|
6874 | "development" !== 'production' ? warning(shouldUpdate !== undefined, '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', this.getName() || 'ReactCompositeComponent') : void 0;
|
6875 | }
|
6876 |
|
6877 | this._updateBatchNumber = null;
|
6878 | if (shouldUpdate) {
|
6879 | this._pendingForceUpdate = false;
|
6880 |
|
6881 | this._performComponentUpdate(nextParentElement, nextProps, nextState, nextContext, transaction, nextUnmaskedContext);
|
6882 | } else {
|
6883 |
|
6884 |
|
6885 | this._currentElement = nextParentElement;
|
6886 | this._context = nextUnmaskedContext;
|
6887 | inst.props = nextProps;
|
6888 | inst.state = nextState;
|
6889 | inst.context = nextContext;
|
6890 | }
|
6891 | },
|
6892 |
|
6893 | _processPendingState: function (props, context) {
|
6894 | var inst = this._instance;
|
6895 | var queue = this._pendingStateQueue;
|
6896 | var replace = this._pendingReplaceState;
|
6897 | this._pendingReplaceState = false;
|
6898 | this._pendingStateQueue = null;
|
6899 |
|
6900 | if (!queue) {
|
6901 | return inst.state;
|
6902 | }
|
6903 |
|
6904 | if (replace && queue.length === 1) {
|
6905 | return queue[0];
|
6906 | }
|
6907 |
|
6908 | var nextState = _assign({}, replace ? queue[0] : inst.state);
|
6909 | for (var i = replace ? 1 : 0; i < queue.length; i++) {
|
6910 | var partial = queue[i];
|
6911 | _assign(nextState, typeof partial === 'function' ? partial.call(inst, nextState, props, context) : partial);
|
6912 | }
|
6913 |
|
6914 | return nextState;
|
6915 | },
|
6916 |
|
6917 | |
6918 |
|
6919 |
|
6920 |
|
6921 |
|
6922 |
|
6923 |
|
6924 |
|
6925 |
|
6926 |
|
6927 |
|
6928 |
|
6929 | _performComponentUpdate: function (nextElement, nextProps, nextState, nextContext, transaction, unmaskedContext) {
|
6930 | var _this2 = this;
|
6931 |
|
6932 | var inst = this._instance;
|
6933 |
|
6934 | var hasComponentDidUpdate = Boolean(inst.componentDidUpdate);
|
6935 | var prevProps;
|
6936 | var prevState;
|
6937 | var prevContext;
|
6938 | if (hasComponentDidUpdate) {
|
6939 | prevProps = inst.props;
|
6940 | prevState = inst.state;
|
6941 | prevContext = inst.context;
|
6942 | }
|
6943 |
|
6944 | if (inst.componentWillUpdate) {
|
6945 | if ("development" !== 'production') {
|
6946 | measureLifeCyclePerf(function () {
|
6947 | return inst.componentWillUpdate(nextProps, nextState, nextContext);
|
6948 | }, this._debugID, 'componentWillUpdate');
|
6949 | } else {
|
6950 | inst.componentWillUpdate(nextProps, nextState, nextContext);
|
6951 | }
|
6952 | }
|
6953 |
|
6954 | this._currentElement = nextElement;
|
6955 | this._context = unmaskedContext;
|
6956 | inst.props = nextProps;
|
6957 | inst.state = nextState;
|
6958 | inst.context = nextContext;
|
6959 |
|
6960 | this._updateRenderedComponent(transaction, unmaskedContext);
|
6961 |
|
6962 | if (hasComponentDidUpdate) {
|
6963 | if ("development" !== 'production') {
|
6964 | transaction.getReactMountReady().enqueue(function () {
|
6965 | measureLifeCyclePerf(inst.componentDidUpdate.bind(inst, prevProps, prevState, prevContext), _this2._debugID, 'componentDidUpdate');
|
6966 | });
|
6967 | } else {
|
6968 | transaction.getReactMountReady().enqueue(inst.componentDidUpdate.bind(inst, prevProps, prevState, prevContext), inst);
|
6969 | }
|
6970 | }
|
6971 | },
|
6972 |
|
6973 | |
6974 |
|
6975 |
|
6976 |
|
6977 |
|
6978 |
|
6979 | _updateRenderedComponent: function (transaction, context) {
|
6980 | var prevComponentInstance = this._renderedComponent;
|
6981 | var prevRenderedElement = prevComponentInstance._currentElement;
|
6982 | var nextRenderedElement = this._renderValidatedComponent();
|
6983 |
|
6984 | var debugID = 0;
|
6985 | if ("development" !== 'production') {
|
6986 | debugID = this._debugID;
|
6987 | }
|
6988 |
|
6989 | if (shouldUpdateReactComponent(prevRenderedElement, nextRenderedElement)) {
|
6990 | ReactReconciler.receiveComponent(prevComponentInstance, nextRenderedElement, transaction, this._processChildContext(context));
|
6991 | } else {
|
6992 | var oldHostNode = ReactReconciler.getHostNode(prevComponentInstance);
|
6993 | ReactReconciler.unmountComponent(prevComponentInstance, false);
|
6994 |
|
6995 | var nodeType = ReactNodeTypes.getType(nextRenderedElement);
|
6996 | this._renderedNodeType = nodeType;
|
6997 | var child = this._instantiateReactComponent(nextRenderedElement, nodeType !== ReactNodeTypes.EMPTY
|
6998 | );
|
6999 | this._renderedComponent = child;
|
7000 |
|
7001 | var nextMarkup = ReactReconciler.mountComponent(child, transaction, this._hostParent, this._hostContainerInfo, this._processChildContext(context), debugID);
|
7002 |
|
7003 | if ("development" !== 'production') {
|
7004 | if (debugID !== 0) {
|
7005 | var childDebugIDs = child._debugID !== 0 ? [child._debugID] : [];
|
7006 | ReactInstrumentation.debugTool.onSetChildren(debugID, childDebugIDs);
|
7007 | }
|
7008 | }
|
7009 |
|
7010 | this._replaceNodeWithMarkup(oldHostNode, nextMarkup, prevComponentInstance);
|
7011 | }
|
7012 | },
|
7013 |
|
7014 | |
7015 |
|
7016 |
|
7017 |
|
7018 |
|
7019 | _replaceNodeWithMarkup: function (oldHostNode, nextMarkup, prevInstance) {
|
7020 | ReactComponentEnvironment.replaceNodeWithMarkup(oldHostNode, nextMarkup, prevInstance);
|
7021 | },
|
7022 |
|
7023 | |
7024 |
|
7025 |
|
7026 | _renderValidatedComponentWithoutOwnerOrContext: function () {
|
7027 | var inst = this._instance;
|
7028 | var renderedComponent;
|
7029 |
|
7030 | if ("development" !== 'production') {
|
7031 | renderedComponent = measureLifeCyclePerf(function () {
|
7032 | return inst.render();
|
7033 | }, this._debugID, 'render');
|
7034 | } else {
|
7035 | renderedComponent = inst.render();
|
7036 | }
|
7037 |
|
7038 | if ("development" !== 'production') {
|
7039 |
|
7040 | if (renderedComponent === undefined && inst.render._isMockFunction) {
|
7041 |
|
7042 |
|
7043 | renderedComponent = null;
|
7044 | }
|
7045 | }
|
7046 |
|
7047 | return renderedComponent;
|
7048 | },
|
7049 |
|
7050 | |
7051 |
|
7052 |
|
7053 | _renderValidatedComponent: function () {
|
7054 | var renderedComponent;
|
7055 | if ("development" !== 'production' || this._compositeType !== CompositeTypes.StatelessFunctional) {
|
7056 | ReactCurrentOwner.current = this;
|
7057 | try {
|
7058 | renderedComponent = this._renderValidatedComponentWithoutOwnerOrContext();
|
7059 | } finally {
|
7060 | ReactCurrentOwner.current = null;
|
7061 | }
|
7062 | } else {
|
7063 | renderedComponent = this._renderValidatedComponentWithoutOwnerOrContext();
|
7064 | }
|
7065 | !(
|
7066 |
|
7067 | renderedComponent === null || renderedComponent === false || ReactElement.isValidElement(renderedComponent)) ? "development" !== 'production' ? invariant(false, '%s.render(): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object.', this.getName() || 'ReactCompositeComponent') : _prodInvariant('109', this.getName() || 'ReactCompositeComponent') : void 0;
|
7068 |
|
7069 | return renderedComponent;
|
7070 | },
|
7071 |
|
7072 | |
7073 |
|
7074 |
|
7075 |
|
7076 |
|
7077 |
|
7078 |
|
7079 |
|
7080 | attachRef: function (ref, component) {
|
7081 | var inst = this.getPublicInstance();
|
7082 | !(inst != null) ? "development" !== 'production' ? invariant(false, 'Stateless function components cannot have refs.') : _prodInvariant('110') : void 0;
|
7083 | var publicComponentInstance = component.getPublicInstance();
|
7084 | if ("development" !== 'production') {
|
7085 | var componentName = component && component.getName ? component.getName() : 'a component';
|
7086 | "development" !== 'production' ? warning(publicComponentInstance != null || component._compositeType !== CompositeTypes.StatelessFunctional, 'Stateless function components cannot be given refs ' + '(See ref "%s" in %s created by %s). ' + 'Attempts to access this ref will fail.', ref, componentName, this.getName()) : void 0;
|
7087 | }
|
7088 | var refs = inst.refs === emptyObject ? inst.refs = {} : inst.refs;
|
7089 | refs[ref] = publicComponentInstance;
|
7090 | },
|
7091 |
|
7092 | |
7093 |
|
7094 |
|
7095 |
|
7096 |
|
7097 |
|
7098 |
|
7099 | detachRef: function (ref) {
|
7100 | var refs = this.getPublicInstance().refs;
|
7101 | delete refs[ref];
|
7102 | },
|
7103 |
|
7104 | |
7105 |
|
7106 |
|
7107 |
|
7108 |
|
7109 |
|
7110 | getName: function () {
|
7111 | var type = this._currentElement.type;
|
7112 | var constructor = this._instance && this._instance.constructor;
|
7113 | return type.displayName || constructor && constructor.displayName || type.name || constructor && constructor.name || null;
|
7114 | },
|
7115 |
|
7116 | /**
|
7117 | * Get the publicly accessible representation of this component - i.e. what
|
7118 | * is exposed by refs and returned by render. Can be null for stateless
|
7119 | * components.
|
7120 | *
|
7121 | * @return {ReactComponent} the public component instance.
|
7122 | * @internal
|
7123 | */
|
7124 | getPublicInstance: function () {
|
7125 | var inst = this._instance;
|
7126 | if (this._compositeType === CompositeTypes.StatelessFunctional) {
|
7127 | return null;
|
7128 | }
|
7129 | return inst;
|
7130 | },
|
7131 |
|
7132 |
|
7133 | _instantiateReactComponent: null
|
7134 |
|
7135 | };
|
7136 |
|
7137 | var ReactCompositeComponent = {
|
7138 |
|
7139 | Mixin: ReactCompositeComponentMixin
|
7140 |
|
7141 | };
|
7142 |
|
7143 | module.exports = ReactCompositeComponent;
|
7144 | },{"132":132,"153":153,"158":158,"171":171,"178":178,"186":186,"187":187,"188":188,"37":37,"41":41,"65":65,"68":68,"77":77,"78":78,"85":85,"90":90,"95":95}],41:[function(_dereq_,module,exports){
|
7145 |
|
7146 |
|
7147 |
|
7148 |
|
7149 |
|
7150 |
|
7151 |
|
7152 |
|
7153 |
|
7154 |
|
7155 |
|
7156 | 'use strict';
|
7157 |
|
7158 |
|
7159 |
|
7160 |
|
7161 |
|
7162 |
|
7163 |
|
7164 |
|
7165 | var ReactCurrentOwner = {
|
7166 |
|
7167 | |
7168 |
|
7169 |
|
7170 |
|
7171 | current: null
|
7172 |
|
7173 | };
|
7174 |
|
7175 | module.exports = ReactCurrentOwner;
|
7176 | },{}],42:[function(_dereq_,module,exports){
|
7177 |
|
7178 |
|
7179 |
|
7180 |
|
7181 |
|
7182 |
|
7183 |
|
7184 |
|
7185 |
|
7186 |
|
7187 |
|
7188 |
|
7189 |
|
7190 | 'use strict';
|
7191 |
|
7192 | var ReactDOMComponentTree = _dereq_(46);
|
7193 | var ReactDefaultInjection = _dereq_(64);
|
7194 | var ReactMount = _dereq_(82);
|
7195 | var ReactReconciler = _dereq_(95);
|
7196 | var ReactUpdates = _dereq_(107);
|
7197 | var ReactVersion = _dereq_(108);
|
7198 |
|
7199 | var findDOMNode = _dereq_(136);
|
7200 | var getHostComponentFromComposite = _dereq_(143);
|
7201 | var renderSubtreeIntoContainer = _dereq_(154);
|
7202 | var warning = _dereq_(187);
|
7203 |
|
7204 | ReactDefaultInjection.inject();
|
7205 |
|
7206 | var ReactDOM = {
|
7207 | findDOMNode: findDOMNode,
|
7208 | render: ReactMount.render,
|
7209 | unmountComponentAtNode: ReactMount.unmountComponentAtNode,
|
7210 | version: ReactVersion,
|
7211 |
|
7212 |
|
7213 | unstable_batchedUpdates: ReactUpdates.batchedUpdates,
|
7214 | unstable_renderSubtreeIntoContainer: renderSubtreeIntoContainer
|
7215 | };
|
7216 |
|
7217 |
|
7218 |
|
7219 |
|
7220 | if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject === 'function') {
|
7221 | __REACT_DEVTOOLS_GLOBAL_HOOK__.inject({
|
7222 | ComponentTree: {
|
7223 | getClosestInstanceFromNode: ReactDOMComponentTree.getClosestInstanceFromNode,
|
7224 | getNodeFromInstance: function (inst) {
|
7225 |
|
7226 | if (inst._renderedComponent) {
|
7227 | inst = getHostComponentFromComposite(inst);
|
7228 | }
|
7229 | if (inst) {
|
7230 | return ReactDOMComponentTree.getNodeFromInstance(inst);
|
7231 | } else {
|
7232 | return null;
|
7233 | }
|
7234 | }
|
7235 | },
|
7236 | Mount: ReactMount,
|
7237 | Reconciler: ReactReconciler
|
7238 | });
|
7239 | }
|
7240 |
|
7241 | if ("development" !== 'production') {
|
7242 | var ExecutionEnvironment = _dereq_(164);
|
7243 | if (ExecutionEnvironment.canUseDOM && window.top === window.self) {
|
7244 |
|
7245 |
|
7246 | if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {
|
7247 |
|
7248 | if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) {
|
7249 |
|
7250 | var showFileUrlMessage = window.location.protocol.indexOf('http') === -1 && navigator.userAgent.indexOf('Firefox') === -1;
|
7251 | console.debug('Download the React DevTools ' + (showFileUrlMessage ? 'and use an HTTP server (instead of a file: URL) ' : '') + 'for a better development experience: ' + 'https://fb.me/react-devtools');
|
7252 | }
|
7253 | }
|
7254 |
|
7255 | var testFunc = function testFn() {};
|
7256 | "development" !== 'production' ? warning((testFunc.name || testFunc.toString()).indexOf('testFn') !== -1, 'It looks like you\'re using a minified copy of the development build ' + 'of React. When deploying React apps to production, make sure to use ' + 'the production build which skips development warnings and is faster. ' + 'See https://fb.me/react-minification for more details.') : void 0;
|
7257 |
|
7258 |
|
7259 |
|
7260 | var ieCompatibilityMode = document.documentMode && document.documentMode < 8;
|
7261 |
|
7262 | "development" !== 'production' ? warning(!ieCompatibilityMode, 'Internet Explorer is running in compatibility mode; please add the ' + 'following tag to your HTML to prevent this from happening: ' + '<meta http-equiv="X-UA-Compatible" content="IE=edge" />') : void 0;
|
7263 |
|
7264 | var expectedFeatures = [
|
7265 |
|
7266 | Array.isArray, Array.prototype.every, Array.prototype.forEach, Array.prototype.indexOf, Array.prototype.map, Date.now, Function.prototype.bind, Object.keys, String.prototype.split, String.prototype.trim];
|
7267 |
|
7268 | for (var i = 0; i < expectedFeatures.length; i++) {
|
7269 | if (!expectedFeatures[i]) {
|
7270 | "development" !== 'production' ? warning(false, 'One or more ES5 shims expected by React are not available: ' + 'https://fb.me/react-warning-polyfills') : void 0;
|
7271 | break;
|
7272 | }
|
7273 | }
|
7274 | }
|
7275 | }
|
7276 |
|
7277 | if ("development" !== 'production') {
|
7278 | var ReactInstrumentation = _dereq_(78);
|
7279 | var ReactDOMUnknownPropertyHook = _dereq_(61);
|
7280 | var ReactDOMNullInputValuePropHook = _dereq_(53);
|
7281 |
|
7282 | ReactInstrumentation.debugTool.addHook(ReactDOMUnknownPropertyHook);
|
7283 | ReactInstrumentation.debugTool.addHook(ReactDOMNullInputValuePropHook);
|
7284 | }
|
7285 |
|
7286 | module.exports = ReactDOM;
|
7287 | },{"107":107,"108":108,"136":136,"143":143,"154":154,"164":164,"187":187,"46":46,"53":53,"61":61,"64":64,"78":78,"82":82,"95":95}],43:[function(_dereq_,module,exports){
|
7288 |
|
7289 |
|
7290 |
|
7291 |
|
7292 |
|
7293 |
|
7294 |
|
7295 |
|
7296 |
|
7297 |
|
7298 |
|
7299 | 'use strict';
|
7300 |
|
7301 | var DisabledInputUtils = _dereq_(14);
|
7302 |
|
7303 |
|
7304 |
|
7305 |
|
7306 |
|
7307 | var ReactDOMButton = {
|
7308 | getHostProps: DisabledInputUtils.getHostProps
|
7309 | };
|
7310 |
|
7311 | module.exports = ReactDOMButton;
|
7312 | },{"14":14}],44:[function(_dereq_,module,exports){
|
7313 |
|
7314 |
|
7315 |
|
7316 |
|
7317 |
|
7318 |
|
7319 |
|
7320 |
|
7321 |
|
7322 |
|
7323 |
|
7324 |
|
7325 |
|
7326 | 'use strict';
|
7327 |
|
7328 | var _prodInvariant = _dereq_(153),
|
7329 | _assign = _dereq_(188);
|
7330 |
|
7331 | var AutoFocusUtils = _dereq_(1);
|
7332 | var CSSPropertyOperations = _dereq_(4);
|
7333 | var DOMLazyTree = _dereq_(8);
|
7334 | var DOMNamespaces = _dereq_(9);
|
7335 | var DOMProperty = _dereq_(10);
|
7336 | var DOMPropertyOperations = _dereq_(11);
|
7337 | var EventConstants = _dereq_(16);
|
7338 | var EventPluginHub = _dereq_(17);
|
7339 | var EventPluginRegistry = _dereq_(18);
|
7340 | var ReactBrowserEventEmitter = _dereq_(28);
|
7341 | var ReactDOMButton = _dereq_(43);
|
7342 | var ReactDOMComponentFlags = _dereq_(45);
|
7343 | var ReactDOMComponentTree = _dereq_(46);
|
7344 | var ReactDOMInput = _dereq_(52);
|
7345 | var ReactDOMOption = _dereq_(54);
|
7346 | var ReactDOMSelect = _dereq_(55);
|
7347 | var ReactDOMTextarea = _dereq_(59);
|
7348 | var ReactInstrumentation = _dereq_(78);
|
7349 | var ReactMultiChild = _dereq_(83);
|
7350 | var ReactServerRenderingTransaction = _dereq_(99);
|
7351 |
|
7352 | var emptyFunction = _dereq_(170);
|
7353 | var escapeTextContentForBrowser = _dereq_(135);
|
7354 | var invariant = _dereq_(178);
|
7355 | var isEventSupported = _dereq_(149);
|
7356 | var keyOf = _dereq_(182);
|
7357 | var shallowEqual = _dereq_(186);
|
7358 | var validateDOMNesting = _dereq_(161);
|
7359 | var warning = _dereq_(187);
|
7360 |
|
7361 | var Flags = ReactDOMComponentFlags;
|
7362 | var deleteListener = EventPluginHub.deleteListener;
|
7363 | var getNode = ReactDOMComponentTree.getNodeFromInstance;
|
7364 | var listenTo = ReactBrowserEventEmitter.listenTo;
|
7365 | var registrationNameModules = EventPluginRegistry.registrationNameModules;
|
7366 |
|
7367 |
|
7368 | var CONTENT_TYPES = { 'string': true, 'number': true };
|
7369 |
|
7370 | var STYLE = keyOf({ style: null });
|
7371 | var HTML = keyOf({ __html: null });
|
7372 | var RESERVED_PROPS = {
|
7373 | children: null,
|
7374 | dangerouslySetInnerHTML: null,
|
7375 | suppressContentEditableWarning: null
|
7376 | };
|
7377 |
|
7378 |
|
7379 | var DOC_FRAGMENT_TYPE = 11;
|
7380 |
|
7381 | function getDeclarationErrorAddendum(internalInstance) {
|
7382 | if (internalInstance) {
|
7383 | var owner = internalInstance._currentElement._owner || null;
|
7384 | if (owner) {
|
7385 | var name = owner.getName();
|
7386 | if (name) {
|
7387 | return ' This DOM node was rendered by `' + name + '`.';
|
7388 | }
|
7389 | }
|
7390 | }
|
7391 | return '';
|
7392 | }
|
7393 |
|
7394 | function friendlyStringify(obj) {
|
7395 | if (typeof obj === 'object') {
|
7396 | if (Array.isArray(obj)) {
|
7397 | return '[' + obj.map(friendlyStringify).join(', ') + ']';
|
7398 | } else {
|
7399 | var pairs = [];
|
7400 | for (var key in obj) {
|
7401 | if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
7402 | var keyEscaped = /^[a-z$_][\w$_]*$/i.test(key) ? key : JSON.stringify(key);
|
7403 | pairs.push(keyEscaped + ': ' + friendlyStringify(obj[key]));
|
7404 | }
|
7405 | }
|
7406 | return '{' + pairs.join(', ') + '}';
|
7407 | }
|
7408 | } else if (typeof obj === 'string') {
|
7409 | return JSON.stringify(obj);
|
7410 | } else if (typeof obj === 'function') {
|
7411 | return '[function object]';
|
7412 | }
|
7413 |
|
7414 |
|
7415 | return String(obj);
|
7416 | }
|
7417 |
|
7418 | var styleMutationWarning = {};
|
7419 |
|
7420 | function checkAndWarnForMutatedStyle(style1, style2, component) {
|
7421 | if (style1 == null || style2 == null) {
|
7422 | return;
|
7423 | }
|
7424 | if (shallowEqual(style1, style2)) {
|
7425 | return;
|
7426 | }
|
7427 |
|
7428 | var componentName = component._tag;
|
7429 | var owner = component._currentElement._owner;
|
7430 | var ownerName;
|
7431 | if (owner) {
|
7432 | ownerName = owner.getName();
|
7433 | }
|
7434 |
|
7435 | var hash = ownerName + '|' + componentName;
|
7436 |
|
7437 | if (styleMutationWarning.hasOwnProperty(hash)) {
|
7438 | return;
|
7439 | }
|
7440 |
|
7441 | styleMutationWarning[hash] = true;
|
7442 |
|
7443 | "development" !== 'production' ? warning(false, '`%s` was passed a style object that has previously been mutated. ' + 'Mutating `style` is deprecated. Consider cloning it beforehand. Check ' + 'the `render` %s. Previous style: %s. Mutated style: %s.', componentName, owner ? 'of `' + ownerName + '`' : 'using <' + componentName + '>', friendlyStringify(style1), friendlyStringify(style2)) : void 0;
|
7444 | }
|
7445 |
|
7446 |
|
7447 |
|
7448 |
|
7449 |
|
7450 | function assertValidProps(component, props) {
|
7451 | if (!props) {
|
7452 | return;
|
7453 | }
|
7454 |
|
7455 | if (voidElementTags[component._tag]) {
|
7456 | !(props.children == null && props.dangerouslySetInnerHTML == null) ? "development" !== 'production' ? invariant(false, '%s is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.%s', component._tag, component._currentElement._owner ? ' Check the render method of ' + component._currentElement._owner.getName() + '.' : '') : _prodInvariant('137', component._tag, component._currentElement._owner ? ' Check the render method of ' + component._currentElement._owner.getName() + '.' : '') : void 0;
|
7457 | }
|
7458 | if (props.dangerouslySetInnerHTML != null) {
|
7459 | !(props.children == null) ? "development" !== 'production' ? invariant(false, 'Can only set one of `children` or `props.dangerouslySetInnerHTML`.') : _prodInvariant('60') : void 0;
|
7460 | !(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML) ? "development" !== 'production' ? invariant(false, '`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://fb.me/react-invariant-dangerously-set-inner-html for more information.') : _prodInvariant('61') : void 0;
|
7461 | }
|
7462 | if ("development" !== 'production') {
|
7463 | "development" !== 'production' ? warning(props.innerHTML == null, 'Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.') : void 0;
|
7464 | "development" !== 'production' ? warning(props.suppressContentEditableWarning || !props.contentEditable || props.children == null, 'A component is `contentEditable` and contains `children` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.') : void 0;
|
7465 | "development" !== 'production' ? warning(props.onFocusIn == null && props.onFocusOut == null, 'React uses onFocus and onBlur instead of onFocusIn and onFocusOut. ' + 'All React events are normalized to bubble, so onFocusIn and onFocusOut ' + 'are not needed/supported by React.') : void 0;
|
7466 | }
|
7467 | !(props.style == null || typeof props.style === 'object') ? "development" !== 'production' ? invariant(false, 'The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + \'em\'}} when using JSX.%s', getDeclarationErrorAddendum(component)) : _prodInvariant('62', getDeclarationErrorAddendum(component)) : void 0;
|
7468 | }
|
7469 |
|
7470 | function enqueuePutListener(inst, registrationName, listener, transaction) {
|
7471 | if (transaction instanceof ReactServerRenderingTransaction) {
|
7472 | return;
|
7473 | }
|
7474 | if ("development" !== 'production') {
|
7475 |
|
7476 |
|
7477 | "development" !== 'production' ? warning(registrationName !== 'onScroll' || isEventSupported('scroll', true), 'This browser doesn\'t support the `onScroll` event') : void 0;
|
7478 | }
|
7479 | var containerInfo = inst._hostContainerInfo;
|
7480 | var isDocumentFragment = containerInfo._node && containerInfo._node.nodeType === DOC_FRAGMENT_TYPE;
|
7481 | var doc = isDocumentFragment ? containerInfo._node : containerInfo._ownerDocument;
|
7482 | listenTo(registrationName, doc);
|
7483 | transaction.getReactMountReady().enqueue(putListener, {
|
7484 | inst: inst,
|
7485 | registrationName: registrationName,
|
7486 | listener: listener
|
7487 | });
|
7488 | }
|
7489 |
|
7490 | function putListener() {
|
7491 | var listenerToPut = this;
|
7492 | EventPluginHub.putListener(listenerToPut.inst, listenerToPut.registrationName, listenerToPut.listener);
|
7493 | }
|
7494 |
|
7495 | function inputPostMount() {
|
7496 | var inst = this;
|
7497 | ReactDOMInput.postMountWrapper(inst);
|
7498 | }
|
7499 |
|
7500 | function textareaPostMount() {
|
7501 | var inst = this;
|
7502 | ReactDOMTextarea.postMountWrapper(inst);
|
7503 | }
|
7504 |
|
7505 | function optionPostMount() {
|
7506 | var inst = this;
|
7507 | ReactDOMOption.postMountWrapper(inst);
|
7508 | }
|
7509 |
|
7510 | var setAndValidateContentChildDev = emptyFunction;
|
7511 | if ("development" !== 'production') {
|
7512 | setAndValidateContentChildDev = function (content) {
|
7513 | var hasExistingContent = this._contentDebugID != null;
|
7514 | var debugID = this._debugID;
|
7515 |
|
7516 | var contentDebugID = -debugID;
|
7517 |
|
7518 | if (content == null) {
|
7519 | if (hasExistingContent) {
|
7520 | ReactInstrumentation.debugTool.onUnmountComponent(this._contentDebugID);
|
7521 | }
|
7522 | this._contentDebugID = null;
|
7523 | return;
|
7524 | }
|
7525 |
|
7526 | validateDOMNesting(null, String(content), this, this._ancestorInfo);
|
7527 | this._contentDebugID = contentDebugID;
|
7528 | if (hasExistingContent) {
|
7529 | ReactInstrumentation.debugTool.onBeforeUpdateComponent(contentDebugID, content);
|
7530 | ReactInstrumentation.debugTool.onUpdateComponent(contentDebugID);
|
7531 | } else {
|
7532 | ReactInstrumentation.debugTool.onBeforeMountComponent(contentDebugID, content, debugID);
|
7533 | ReactInstrumentation.debugTool.onMountComponent(contentDebugID);
|
7534 | ReactInstrumentation.debugTool.onSetChildren(debugID, [contentDebugID]);
|
7535 | }
|
7536 | };
|
7537 | }
|
7538 |
|
7539 |
|
7540 |
|
7541 | var mediaEvents = {
|
7542 | topAbort: 'abort',
|
7543 | topCanPlay: 'canplay',
|
7544 | topCanPlayThrough: 'canplaythrough',
|
7545 | topDurationChange: 'durationchange',
|
7546 | topEmptied: 'emptied',
|
7547 | topEncrypted: 'encrypted',
|
7548 | topEnded: 'ended',
|
7549 | topError: 'error',
|
7550 | topLoadedData: 'loadeddata',
|
7551 | topLoadedMetadata: 'loadedmetadata',
|
7552 | topLoadStart: 'loadstart',
|
7553 | topPause: 'pause',
|
7554 | topPlay: 'play',
|
7555 | topPlaying: 'playing',
|
7556 | topProgress: 'progress',
|
7557 | topRateChange: 'ratechange',
|
7558 | topSeeked: 'seeked',
|
7559 | topSeeking: 'seeking',
|
7560 | topStalled: 'stalled',
|
7561 | topSuspend: 'suspend',
|
7562 | topTimeUpdate: 'timeupdate',
|
7563 | topVolumeChange: 'volumechange',
|
7564 | topWaiting: 'waiting'
|
7565 | };
|
7566 |
|
7567 | function trapBubbledEventsLocal() {
|
7568 | var inst = this;
|
7569 |
|
7570 |
|
7571 | !inst._rootNodeID ? "development" !== 'production' ? invariant(false, 'Must be mounted to trap events') : _prodInvariant('63') : void 0;
|
7572 | var node = getNode(inst);
|
7573 | !node ? "development" !== 'production' ? invariant(false, 'trapBubbledEvent(...): Requires node to be rendered.') : _prodInvariant('64') : void 0;
|
7574 |
|
7575 | switch (inst._tag) {
|
7576 | case 'iframe':
|
7577 | case 'object':
|
7578 | inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topLoad, 'load', node)];
|
7579 | break;
|
7580 | case 'video':
|
7581 | case 'audio':
|
7582 |
|
7583 | inst._wrapperState.listeners = [];
|
7584 |
|
7585 | for (var event in mediaEvents) {
|
7586 | if (mediaEvents.hasOwnProperty(event)) {
|
7587 | inst._wrapperState.listeners.push(ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes[event], mediaEvents[event], node));
|
7588 | }
|
7589 | }
|
7590 | break;
|
7591 | case 'source':
|
7592 | inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topError, 'error', node)];
|
7593 | break;
|
7594 | case 'img':
|
7595 | inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topError, 'error', node), ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topLoad, 'load', node)];
|
7596 | break;
|
7597 | case 'form':
|
7598 | inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topReset, 'reset', node), ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topSubmit, 'submit', node)];
|
7599 | break;
|
7600 | case 'input':
|
7601 | case 'select':
|
7602 | case 'textarea':
|
7603 | inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topInvalid, 'invalid', node)];
|
7604 | break;
|
7605 | }
|
7606 | }
|
7607 |
|
7608 | function postUpdateSelectWrapper() {
|
7609 | ReactDOMSelect.postUpdateWrapper(this);
|
7610 | }
|
7611 |
|
7612 |
|
7613 |
|
7614 |
|
7615 | var omittedCloseTags = {
|
7616 | 'area': true,
|
7617 | 'base': true,
|
7618 | 'br': true,
|
7619 | 'col': true,
|
7620 | 'embed': true,
|
7621 | 'hr': true,
|
7622 | 'img': true,
|
7623 | 'input': true,
|
7624 | 'keygen': true,
|
7625 | 'link': true,
|
7626 | 'meta': true,
|
7627 | 'param': true,
|
7628 | 'source': true,
|
7629 | 'track': true,
|
7630 | 'wbr': true
|
7631 | };
|
7632 |
|
7633 |
|
7634 | var newlineEatingTags = {
|
7635 | 'listing': true,
|
7636 | 'pre': true,
|
7637 | 'textarea': true
|
7638 | };
|
7639 |
|
7640 |
|
7641 |
|
7642 |
|
7643 | var voidElementTags = _assign({
|
7644 | 'menuitem': true
|
7645 | }, omittedCloseTags);
|
7646 |
|
7647 |
|
7648 |
|
7649 |
|
7650 |
|
7651 | var VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/;
|
7652 | var validatedTagCache = {};
|
7653 | var hasOwnProperty = {}.hasOwnProperty;
|
7654 |
|
7655 | function validateDangerousTag(tag) {
|
7656 | if (!hasOwnProperty.call(validatedTagCache, tag)) {
|
7657 | !VALID_TAG_REGEX.test(tag) ? "development" !== 'production' ? invariant(false, 'Invalid tag: %s', tag) : _prodInvariant('65', tag) : void 0;
|
7658 | validatedTagCache[tag] = true;
|
7659 | }
|
7660 | }
|
7661 |
|
7662 | function isCustomComponent(tagName, props) {
|
7663 | return tagName.indexOf('-') >= 0 || props.is != null;
|
7664 | }
|
7665 |
|
7666 | var globalIdCounter = 1;
|
7667 |
|
7668 |
|
7669 |
|
7670 |
|
7671 |
|
7672 |
|
7673 |
|
7674 |
|
7675 |
|
7676 |
|
7677 |
|
7678 |
|
7679 |
|
7680 |
|
7681 |
|
7682 | function ReactDOMComponent(element) {
|
7683 | var tag = element.type;
|
7684 | validateDangerousTag(tag);
|
7685 | this._currentElement = element;
|
7686 | this._tag = tag.toLowerCase();
|
7687 | this._namespaceURI = null;
|
7688 | this._renderedChildren = null;
|
7689 | this._previousStyle = null;
|
7690 | this._previousStyleCopy = null;
|
7691 | this._hostNode = null;
|
7692 | this._hostParent = null;
|
7693 | this._rootNodeID = 0;
|
7694 | this._domID = 0;
|
7695 | this._hostContainerInfo = null;
|
7696 | this._wrapperState = null;
|
7697 | this._topLevelWrapper = null;
|
7698 | this._flags = 0;
|
7699 | if ("development" !== 'production') {
|
7700 | this._ancestorInfo = null;
|
7701 | setAndValidateContentChildDev.call(this, null);
|
7702 | }
|
7703 | }
|
7704 |
|
7705 | ReactDOMComponent.displayName = 'ReactDOMComponent';
|
7706 |
|
7707 | ReactDOMComponent.Mixin = {
|
7708 |
|
7709 | |
7710 |
|
7711 |
|
7712 |
|
7713 |
|
7714 |
|
7715 |
|
7716 |
|
7717 |
|
7718 |
|
7719 |
|
7720 | mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
|
7721 | this._rootNodeID = globalIdCounter++;
|
7722 | this._domID = hostContainerInfo._idCounter++;
|
7723 | this._hostParent = hostParent;
|
7724 | this._hostContainerInfo = hostContainerInfo;
|
7725 |
|
7726 | var props = this._currentElement.props;
|
7727 |
|
7728 | switch (this._tag) {
|
7729 | case 'audio':
|
7730 | case 'form':
|
7731 | case 'iframe':
|
7732 | case 'img':
|
7733 | case 'link':
|
7734 | case 'object':
|
7735 | case 'source':
|
7736 | case 'video':
|
7737 | this._wrapperState = {
|
7738 | listeners: null
|
7739 | };
|
7740 | transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
|
7741 | break;
|
7742 | case 'button':
|
7743 | props = ReactDOMButton.getHostProps(this, props, hostParent);
|
7744 | break;
|
7745 | case 'input':
|
7746 | ReactDOMInput.mountWrapper(this, props, hostParent);
|
7747 | props = ReactDOMInput.getHostProps(this, props);
|
7748 | transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
|
7749 | break;
|
7750 | case 'option':
|
7751 | ReactDOMOption.mountWrapper(this, props, hostParent);
|
7752 | props = ReactDOMOption.getHostProps(this, props);
|
7753 | break;
|
7754 | case 'select':
|
7755 | ReactDOMSelect.mountWrapper(this, props, hostParent);
|
7756 | props = ReactDOMSelect.getHostProps(this, props);
|
7757 | transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
|
7758 | break;
|
7759 | case 'textarea':
|
7760 | ReactDOMTextarea.mountWrapper(this, props, hostParent);
|
7761 | props = ReactDOMTextarea.getHostProps(this, props);
|
7762 | transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
|
7763 | break;
|
7764 | }
|
7765 |
|
7766 | assertValidProps(this, props);
|
7767 |
|
7768 |
|
7769 |
|
7770 | var namespaceURI;
|
7771 | var parentTag;
|
7772 | if (hostParent != null) {
|
7773 | namespaceURI = hostParent._namespaceURI;
|
7774 | parentTag = hostParent._tag;
|
7775 | } else if (hostContainerInfo._tag) {
|
7776 | namespaceURI = hostContainerInfo._namespaceURI;
|
7777 | parentTag = hostContainerInfo._tag;
|
7778 | }
|
7779 | if (namespaceURI == null || namespaceURI === DOMNamespaces.svg && parentTag === 'foreignobject') {
|
7780 | namespaceURI = DOMNamespaces.html;
|
7781 | }
|
7782 | if (namespaceURI === DOMNamespaces.html) {
|
7783 | if (this._tag === 'svg') {
|
7784 | namespaceURI = DOMNamespaces.svg;
|
7785 | } else if (this._tag === 'math') {
|
7786 | namespaceURI = DOMNamespaces.mathml;
|
7787 | }
|
7788 | }
|
7789 | this._namespaceURI = namespaceURI;
|
7790 |
|
7791 | if ("development" !== 'production') {
|
7792 | var parentInfo;
|
7793 | if (hostParent != null) {
|
7794 | parentInfo = hostParent._ancestorInfo;
|
7795 | } else if (hostContainerInfo._tag) {
|
7796 | parentInfo = hostContainerInfo._ancestorInfo;
|
7797 | }
|
7798 | if (parentInfo) {
|
7799 |
|
7800 |
|
7801 | validateDOMNesting(this._tag, null, this, parentInfo);
|
7802 | }
|
7803 | this._ancestorInfo = validateDOMNesting.updatedAncestorInfo(parentInfo, this._tag, this);
|
7804 | }
|
7805 |
|
7806 | var mountImage;
|
7807 | if (transaction.useCreateElement) {
|
7808 | var ownerDocument = hostContainerInfo._ownerDocument;
|
7809 | var el;
|
7810 | if (namespaceURI === DOMNamespaces.html) {
|
7811 | if (this._tag === 'script') {
|
7812 |
|
7813 |
|
7814 | var div = ownerDocument.createElement('div');
|
7815 | var type = this._currentElement.type;
|
7816 | div.innerHTML = '<' + type + '></' + type + '>';
|
7817 | el = div.removeChild(div.firstChild);
|
7818 | } else if (props.is) {
|
7819 | el = ownerDocument.createElement(this._currentElement.type, props.is);
|
7820 | } else {
|
7821 |
|
7822 |
|
7823 |
|
7824 | el = ownerDocument.createElement(this._currentElement.type);
|
7825 | }
|
7826 | } else {
|
7827 | el = ownerDocument.createElementNS(namespaceURI, this._currentElement.type);
|
7828 | }
|
7829 | ReactDOMComponentTree.precacheNode(this, el);
|
7830 | this._flags |= Flags.hasCachedChildNodes;
|
7831 | if (!this._hostParent) {
|
7832 | DOMPropertyOperations.setAttributeForRoot(el);
|
7833 | }
|
7834 | this._updateDOMProperties(null, props, transaction);
|
7835 | var lazyTree = DOMLazyTree(el);
|
7836 | this._createInitialChildren(transaction, props, context, lazyTree);
|
7837 | mountImage = lazyTree;
|
7838 | } else {
|
7839 | var tagOpen = this._createOpenTagMarkupAndPutListeners(transaction, props);
|
7840 | var tagContent = this._createContentMarkup(transaction, props, context);
|
7841 | if (!tagContent && omittedCloseTags[this._tag]) {
|
7842 | mountImage = tagOpen + '/>';
|
7843 | } else {
|
7844 | mountImage = tagOpen + '>' + tagContent + '</' + this._currentElement.type + '>';
|
7845 | }
|
7846 | }
|
7847 |
|
7848 | switch (this._tag) {
|
7849 | case 'input':
|
7850 | transaction.getReactMountReady().enqueue(inputPostMount, this);
|
7851 | if (props.autoFocus) {
|
7852 | transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);
|
7853 | }
|
7854 | break;
|
7855 | case 'textarea':
|
7856 | transaction.getReactMountReady().enqueue(textareaPostMount, this);
|
7857 | if (props.autoFocus) {
|
7858 | transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);
|
7859 | }
|
7860 | break;
|
7861 | case 'select':
|
7862 | if (props.autoFocus) {
|
7863 | transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);
|
7864 | }
|
7865 | break;
|
7866 | case 'button':
|
7867 | if (props.autoFocus) {
|
7868 | transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);
|
7869 | }
|
7870 | break;
|
7871 | case 'option':
|
7872 | transaction.getReactMountReady().enqueue(optionPostMount, this);
|
7873 | break;
|
7874 | }
|
7875 |
|
7876 | return mountImage;
|
7877 | },
|
7878 |
|
7879 | |
7880 |
|
7881 |
|
7882 |
|
7883 |
|
7884 |
|
7885 |
|
7886 |
|
7887 |
|
7888 |
|
7889 |
|
7890 |
|
7891 |
|
7892 | _createOpenTagMarkupAndPutListeners: function (transaction, props) {
|
7893 | var ret = '<' + this._currentElement.type;
|
7894 |
|
7895 | for (var propKey in props) {
|
7896 | if (!props.hasOwnProperty(propKey)) {
|
7897 | continue;
|
7898 | }
|
7899 | var propValue = props[propKey];
|
7900 | if (propValue == null) {
|
7901 | continue;
|
7902 | }
|
7903 | if (registrationNameModules.hasOwnProperty(propKey)) {
|
7904 | if (propValue) {
|
7905 | enqueuePutListener(this, propKey, propValue, transaction);
|
7906 | }
|
7907 | } else {
|
7908 | if (propKey === STYLE) {
|
7909 | if (propValue) {
|
7910 | if ("development" !== 'production') {
|
7911 |
|
7912 | this._previousStyle = propValue;
|
7913 | }
|
7914 | propValue = this._previousStyleCopy = _assign({}, props.style);
|
7915 | }
|
7916 | propValue = CSSPropertyOperations.createMarkupForStyles(propValue, this);
|
7917 | }
|
7918 | var markup = null;
|
7919 | if (this._tag != null && isCustomComponent(this._tag, props)) {
|
7920 | if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
|
7921 | markup = DOMPropertyOperations.createMarkupForCustomAttribute(propKey, propValue);
|
7922 | }
|
7923 | } else {
|
7924 | markup = DOMPropertyOperations.createMarkupForProperty(propKey, propValue);
|
7925 | }
|
7926 | if (markup) {
|
7927 | ret += ' ' + markup;
|
7928 | }
|
7929 | }
|
7930 | }
|
7931 |
|
7932 |
|
7933 |
|
7934 | if (transaction.renderToStaticMarkup) {
|
7935 | return ret;
|
7936 | }
|
7937 |
|
7938 | if (!this._hostParent) {
|
7939 | ret += ' ' + DOMPropertyOperations.createMarkupForRoot();
|
7940 | }
|
7941 | ret += ' ' + DOMPropertyOperations.createMarkupForID(this._domID);
|
7942 | return ret;
|
7943 | },
|
7944 |
|
7945 | |
7946 |
|
7947 |
|
7948 |
|
7949 |
|
7950 |
|
7951 |
|
7952 |
|
7953 |
|
7954 | _createContentMarkup: function (transaction, props, context) {
|
7955 | var ret = '';
|
7956 |
|
7957 |
|
7958 | var innerHTML = props.dangerouslySetInnerHTML;
|
7959 | if (innerHTML != null) {
|
7960 | if (innerHTML.__html != null) {
|
7961 | ret = innerHTML.__html;
|
7962 | }
|
7963 | } else {
|
7964 | var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null;
|
7965 | var childrenToUse = contentToUse != null ? null : props.children;
|
7966 | if (contentToUse != null) {
|
7967 |
|
7968 | ret = escapeTextContentForBrowser(contentToUse);
|
7969 | if ("development" !== 'production') {
|
7970 | setAndValidateContentChildDev.call(this, contentToUse);
|
7971 | }
|
7972 | } else if (childrenToUse != null) {
|
7973 | var mountImages = this.mountChildren(childrenToUse, transaction, context);
|
7974 | ret = mountImages.join('');
|
7975 | }
|
7976 | }
|
7977 | if (newlineEatingTags[this._tag] && ret.charAt(0) === '\n') {
|
7978 |
|
7979 |
|
7980 |
|
7981 |
|
7982 |
|
7983 |
|
7984 |
|
7985 |
|
7986 |
|
7987 |
|
7988 | return '\n' + ret;
|
7989 | } else {
|
7990 | return ret;
|
7991 | }
|
7992 | },
|
7993 |
|
7994 | _createInitialChildren: function (transaction, props, context, lazyTree) {
|
7995 |
|
7996 | var innerHTML = props.dangerouslySetInnerHTML;
|
7997 | if (innerHTML != null) {
|
7998 | if (innerHTML.__html != null) {
|
7999 | DOMLazyTree.queueHTML(lazyTree, innerHTML.__html);
|
8000 | }
|
8001 | } else {
|
8002 | var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null;
|
8003 | var childrenToUse = contentToUse != null ? null : props.children;
|
8004 | if (contentToUse != null) {
|
8005 |
|
8006 | if ("development" !== 'production') {
|
8007 | setAndValidateContentChildDev.call(this, contentToUse);
|
8008 | }
|
8009 | DOMLazyTree.queueText(lazyTree, contentToUse);
|
8010 | } else if (childrenToUse != null) {
|
8011 | var mountImages = this.mountChildren(childrenToUse, transaction, context);
|
8012 | for (var i = 0; i < mountImages.length; i++) {
|
8013 | DOMLazyTree.queueChild(lazyTree, mountImages[i]);
|
8014 | }
|
8015 | }
|
8016 | }
|
8017 | },
|
8018 |
|
8019 | |
8020 |
|
8021 |
|
8022 |
|
8023 |
|
8024 |
|
8025 |
|
8026 |
|
8027 | receiveComponent: function (nextElement, transaction, context) {
|
8028 | var prevElement = this._currentElement;
|
8029 | this._currentElement = nextElement;
|
8030 | this.updateComponent(transaction, prevElement, nextElement, context);
|
8031 | },
|
8032 |
|
8033 | |
8034 |
|
8035 |
|
8036 |
|
8037 |
|
8038 |
|
8039 |
|
8040 |
|
8041 |
|
8042 |
|
8043 | updateComponent: function (transaction, prevElement, nextElement, context) {
|
8044 | var lastProps = prevElement.props;
|
8045 | var nextProps = this._currentElement.props;
|
8046 |
|
8047 | switch (this._tag) {
|
8048 | case 'button':
|
8049 | lastProps = ReactDOMButton.getHostProps(this, lastProps);
|
8050 | nextProps = ReactDOMButton.getHostProps(this, nextProps);
|
8051 | break;
|
8052 | case 'input':
|
8053 | lastProps = ReactDOMInput.getHostProps(this, lastProps);
|
8054 | nextProps = ReactDOMInput.getHostProps(this, nextProps);
|
8055 | break;
|
8056 | case 'option':
|
8057 | lastProps = ReactDOMOption.getHostProps(this, lastProps);
|
8058 | nextProps = ReactDOMOption.getHostProps(this, nextProps);
|
8059 | break;
|
8060 | case 'select':
|
8061 | lastProps = ReactDOMSelect.getHostProps(this, lastProps);
|
8062 | nextProps = ReactDOMSelect.getHostProps(this, nextProps);
|
8063 | break;
|
8064 | case 'textarea':
|
8065 | lastProps = ReactDOMTextarea.getHostProps(this, lastProps);
|
8066 | nextProps = ReactDOMTextarea.getHostProps(this, nextProps);
|
8067 | break;
|
8068 | }
|
8069 |
|
8070 | assertValidProps(this, nextProps);
|
8071 | this._updateDOMProperties(lastProps, nextProps, transaction);
|
8072 | this._updateDOMChildren(lastProps, nextProps, transaction, context);
|
8073 |
|
8074 | switch (this._tag) {
|
8075 | case 'input':
|
8076 |
|
8077 |
|
8078 |
|
8079 | ReactDOMInput.updateWrapper(this);
|
8080 | break;
|
8081 | case 'textarea':
|
8082 | ReactDOMTextarea.updateWrapper(this);
|
8083 | break;
|
8084 | case 'select':
|
8085 |
|
8086 |
|
8087 | transaction.getReactMountReady().enqueue(postUpdateSelectWrapper, this);
|
8088 | break;
|
8089 | }
|
8090 | },
|
8091 |
|
8092 | |
8093 |
|
8094 |
|
8095 |
|
8096 |
|
8097 |
|
8098 |
|
8099 |
|
8100 |
|
8101 |
|
8102 |
|
8103 |
|
8104 |
|
8105 |
|
8106 |
|
8107 |
|
8108 | _updateDOMProperties: function (lastProps, nextProps, transaction) {
|
8109 | var propKey;
|
8110 | var styleName;
|
8111 | var styleUpdates;
|
8112 | for (propKey in lastProps) {
|
8113 | if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) {
|
8114 | continue;
|
8115 | }
|
8116 | if (propKey === STYLE) {
|
8117 | var lastStyle = this._previousStyleCopy;
|
8118 | for (styleName in lastStyle) {
|
8119 | if (lastStyle.hasOwnProperty(styleName)) {
|
8120 | styleUpdates = styleUpdates || {};
|
8121 | styleUpdates[styleName] = '';
|
8122 | }
|
8123 | }
|
8124 | this._previousStyleCopy = null;
|
8125 | } else if (registrationNameModules.hasOwnProperty(propKey)) {
|
8126 | if (lastProps[propKey]) {
|
8127 |
|
8128 |
|
8129 |
|
8130 | deleteListener(this, propKey);
|
8131 | }
|
8132 | } else if (isCustomComponent(this._tag, lastProps)) {
|
8133 | if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
|
8134 | DOMPropertyOperations.deleteValueForAttribute(getNode(this), propKey);
|
8135 | }
|
8136 | } else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) {
|
8137 | DOMPropertyOperations.deleteValueForProperty(getNode(this), propKey);
|
8138 | }
|
8139 | }
|
8140 | for (propKey in nextProps) {
|
8141 | var nextProp = nextProps[propKey];
|
8142 | var lastProp = propKey === STYLE ? this._previousStyleCopy : lastProps != null ? lastProps[propKey] : undefined;
|
8143 | if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) {
|
8144 | continue;
|
8145 | }
|
8146 | if (propKey === STYLE) {
|
8147 | if (nextProp) {
|
8148 | if ("development" !== 'production') {
|
8149 | checkAndWarnForMutatedStyle(this._previousStyleCopy, this._previousStyle, this);
|
8150 | this._previousStyle = nextProp;
|
8151 | }
|
8152 | nextProp = this._previousStyleCopy = _assign({}, nextProp);
|
8153 | } else {
|
8154 | this._previousStyleCopy = null;
|
8155 | }
|
8156 | if (lastProp) {
|
8157 |
|
8158 | for (styleName in lastProp) {
|
8159 | if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) {
|
8160 | styleUpdates = styleUpdates || {};
|
8161 | styleUpdates[styleName] = '';
|
8162 | }
|
8163 | }
|
8164 |
|
8165 | for (styleName in nextProp) {
|
8166 | if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {
|
8167 | styleUpdates = styleUpdates || {};
|
8168 | styleUpdates[styleName] = nextProp[styleName];
|
8169 | }
|
8170 | }
|
8171 | } else {
|
8172 |
|
8173 | styleUpdates = nextProp;
|
8174 | }
|
8175 | } else if (registrationNameModules.hasOwnProperty(propKey)) {
|
8176 | if (nextProp) {
|
8177 | enqueuePutListener(this, propKey, nextProp, transaction);
|
8178 | } else if (lastProp) {
|
8179 | deleteListener(this, propKey);
|
8180 | }
|
8181 | } else if (isCustomComponent(this._tag, nextProps)) {
|
8182 | if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
|
8183 | DOMPropertyOperations.setValueForAttribute(getNode(this), propKey, nextProp);
|
8184 | }
|
8185 | } else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) {
|
8186 | var node = getNode(this);
|
8187 |
|
8188 |
|
8189 |
|
8190 | if (nextProp != null) {
|
8191 | DOMPropertyOperations.setValueForProperty(node, propKey, nextProp);
|
8192 | } else {
|
8193 | DOMPropertyOperations.deleteValueForProperty(node, propKey);
|
8194 | }
|
8195 | }
|
8196 | }
|
8197 | if (styleUpdates) {
|
8198 | CSSPropertyOperations.setValueForStyles(getNode(this), styleUpdates, this);
|
8199 | }
|
8200 | },
|
8201 |
|
8202 | |
8203 |
|
8204 |
|
8205 |
|
8206 |
|
8207 |
|
8208 |
|
8209 |
|
8210 |
|
8211 | _updateDOMChildren: function (lastProps, nextProps, transaction, context) {
|
8212 | var lastContent = CONTENT_TYPES[typeof lastProps.children] ? lastProps.children : null;
|
8213 | var nextContent = CONTENT_TYPES[typeof nextProps.children] ? nextProps.children : null;
|
8214 |
|
8215 | var lastHtml = lastProps.dangerouslySetInnerHTML && lastProps.dangerouslySetInnerHTML.__html;
|
8216 | var nextHtml = nextProps.dangerouslySetInnerHTML && nextProps.dangerouslySetInnerHTML.__html;
|
8217 |
|
8218 |
|
8219 | var lastChildren = lastContent != null ? null : lastProps.children;
|
8220 | var nextChildren = nextContent != null ? null : nextProps.children;
|
8221 |
|
8222 |
|
8223 |
|
8224 | var lastHasContentOrHtml = lastContent != null || lastHtml != null;
|
8225 | var nextHasContentOrHtml = nextContent != null || nextHtml != null;
|
8226 | if (lastChildren != null && nextChildren == null) {
|
8227 | this.updateChildren(null, transaction, context);
|
8228 | } else if (lastHasContentOrHtml && !nextHasContentOrHtml) {
|
8229 | this.updateTextContent('');
|
8230 | if ("development" !== 'production') {
|
8231 | ReactInstrumentation.debugTool.onSetChildren(this._debugID, []);
|
8232 | }
|
8233 | }
|
8234 |
|
8235 | if (nextContent != null) {
|
8236 | if (lastContent !== nextContent) {
|
8237 | this.updateTextContent('' + nextContent);
|
8238 | if ("development" !== 'production') {
|
8239 | setAndValidateContentChildDev.call(this, nextContent);
|
8240 | }
|
8241 | }
|
8242 | } else if (nextHtml != null) {
|
8243 | if (lastHtml !== nextHtml) {
|
8244 | this.updateMarkup('' + nextHtml);
|
8245 | }
|
8246 | if ("development" !== 'production') {
|
8247 | ReactInstrumentation.debugTool.onSetChildren(this._debugID, []);
|
8248 | }
|
8249 | } else if (nextChildren != null) {
|
8250 | if ("development" !== 'production') {
|
8251 | setAndValidateContentChildDev.call(this, null);
|
8252 | }
|
8253 |
|
8254 | this.updateChildren(nextChildren, transaction, context);
|
8255 | }
|
8256 | },
|
8257 |
|
8258 | getHostNode: function () {
|
8259 | return getNode(this);
|
8260 | },
|
8261 |
|
8262 | |
8263 |
|
8264 |
|
8265 |
|
8266 |
|
8267 |
|
8268 | unmountComponent: function (safely) {
|
8269 | switch (this._tag) {
|
8270 | case 'audio':
|
8271 | case 'form':
|
8272 | case 'iframe':
|
8273 | case 'img':
|
8274 | case 'link':
|
8275 | case 'object':
|
8276 | case 'source':
|
8277 | case 'video':
|
8278 | var listeners = this._wrapperState.listeners;
|
8279 | if (listeners) {
|
8280 | for (var i = 0; i < listeners.length; i++) {
|
8281 | listeners[i].remove();
|
8282 | }
|
8283 | }
|
8284 | break;
|
8285 | case 'html':
|
8286 | case 'head':
|
8287 | case 'body':
|
8288 | |
8289 |
|
8290 |
|
8291 |
|
8292 |
|
8293 |
|
8294 | !false ? "development" !== 'production' ? invariant(false, '<%s> tried to unmount. Because of cross-browser quirks it is impossible to unmount some top-level components (eg <html>, <head>, and <body>) reliably and efficiently. To fix this, have a single top-level component that never unmounts render these elements.', this._tag) : _prodInvariant('66', this._tag) : void 0;
|
8295 | break;
|
8296 | }
|
8297 |
|
8298 | this.unmountChildren(safely);
|
8299 | ReactDOMComponentTree.uncacheNode(this);
|
8300 | EventPluginHub.deleteAllListeners(this);
|
8301 | this._rootNodeID = 0;
|
8302 | this._domID = 0;
|
8303 | this._wrapperState = null;
|
8304 |
|
8305 | if ("development" !== 'production') {
|
8306 | setAndValidateContentChildDev.call(this, null);
|
8307 | }
|
8308 | },
|
8309 |
|
8310 | getPublicInstance: function () {
|
8311 | return getNode(this);
|
8312 | }
|
8313 |
|
8314 | };
|
8315 |
|
8316 | _assign(ReactDOMComponent.prototype, ReactDOMComponent.Mixin, ReactMultiChild.Mixin);
|
8317 |
|
8318 | module.exports = ReactDOMComponent;
|
8319 | },{"1":1,"10":10,"11":11,"135":135,"149":149,"153":153,"16":16,"161":161,"17":17,"170":170,"178":178,"18":18,"182":182,"186":186,"187":187,"188":188,"28":28,"4":4,"43":43,"45":45,"46":46,"52":52,"54":54,"55":55,"59":59,"78":78,"8":8,"83":83,"9":9,"99":99}],45:[function(_dereq_,module,exports){
|
8320 |
|
8321 |
|
8322 |
|
8323 |
|
8324 |
|
8325 |
|
8326 |
|
8327 |
|
8328 |
|
8329 |
|
8330 |
|
8331 | 'use strict';
|
8332 |
|
8333 | var ReactDOMComponentFlags = {
|
8334 | hasCachedChildNodes: 1 << 0
|
8335 | };
|
8336 |
|
8337 | module.exports = ReactDOMComponentFlags;
|
8338 | },{}],46:[function(_dereq_,module,exports){
|
8339 |
|
8340 |
|
8341 |
|
8342 |
|
8343 |
|
8344 |
|
8345 |
|
8346 |
|
8347 |
|
8348 |
|
8349 |
|
8350 | 'use strict';
|
8351 |
|
8352 | var _prodInvariant = _dereq_(153);
|
8353 |
|
8354 | var DOMProperty = _dereq_(10);
|
8355 | var ReactDOMComponentFlags = _dereq_(45);
|
8356 |
|
8357 | var invariant = _dereq_(178);
|
8358 |
|
8359 | var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME;
|
8360 | var Flags = ReactDOMComponentFlags;
|
8361 |
|
8362 | var internalInstanceKey = '__reactInternalInstance$' + Math.random().toString(36).slice(2);
|
8363 |
|
8364 |
|
8365 |
|
8366 |
|
8367 |
|
8368 |
|
8369 |
|
8370 |
|
8371 | function getRenderedHostOrTextFromComponent(component) {
|
8372 | var rendered;
|
8373 | while (rendered = component._renderedComponent) {
|
8374 | component = rendered;
|
8375 | }
|
8376 | return component;
|
8377 | }
|
8378 |
|
8379 |
|
8380 |
|
8381 |
|
8382 |
|
8383 | function precacheNode(inst, node) {
|
8384 | var hostInst = getRenderedHostOrTextFromComponent(inst);
|
8385 | hostInst._hostNode = node;
|
8386 | node[internalInstanceKey] = hostInst;
|
8387 | }
|
8388 |
|
8389 | function uncacheNode(inst) {
|
8390 | var node = inst._hostNode;
|
8391 | if (node) {
|
8392 | delete node[internalInstanceKey];
|
8393 | inst._hostNode = null;
|
8394 | }
|
8395 | }
|
8396 |
|
8397 |
|
8398 |
|
8399 |
|
8400 |
|
8401 |
|
8402 |
|
8403 |
|
8404 |
|
8405 |
|
8406 |
|
8407 |
|
8408 |
|
8409 |
|
8410 |
|
8411 | function precacheChildNodes(inst, node) {
|
8412 | if (inst._flags & Flags.hasCachedChildNodes) {
|
8413 | return;
|
8414 | }
|
8415 | var children = inst._renderedChildren;
|
8416 | var childNode = node.firstChild;
|
8417 | outer: for (var name in children) {
|
8418 | if (!children.hasOwnProperty(name)) {
|
8419 | continue;
|
8420 | }
|
8421 | var childInst = children[name];
|
8422 | var childID = getRenderedHostOrTextFromComponent(childInst)._domID;
|
8423 | if (childID === 0) {
|
8424 |
|
8425 | continue;
|
8426 | }
|
8427 |
|
8428 | for (; childNode !== null; childNode = childNode.nextSibling) {
|
8429 | if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {
|
8430 | precacheNode(childInst, childNode);
|
8431 | continue outer;
|
8432 | }
|
8433 | }
|
8434 |
|
8435 | !false ? "development" !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;
|
8436 | }
|
8437 | inst._flags |= Flags.hasCachedChildNodes;
|
8438 | }
|
8439 |
|
8440 |
|
8441 |
|
8442 |
|
8443 |
|
8444 | function getClosestInstanceFromNode(node) {
|
8445 | if (node[internalInstanceKey]) {
|
8446 | return node[internalInstanceKey];
|
8447 | }
|
8448 |
|
8449 |
|
8450 | var parents = [];
|
8451 | while (!node[internalInstanceKey]) {
|
8452 | parents.push(node);
|
8453 | if (node.parentNode) {
|
8454 | node = node.parentNode;
|
8455 | } else {
|
8456 |
|
8457 |
|
8458 | return null;
|
8459 | }
|
8460 | }
|
8461 |
|
8462 | var closest;
|
8463 | var inst;
|
8464 | for (; node && (inst = node[internalInstanceKey]); node = parents.pop()) {
|
8465 | closest = inst;
|
8466 | if (parents.length) {
|
8467 | precacheChildNodes(inst, node);
|
8468 | }
|
8469 | }
|
8470 |
|
8471 | return closest;
|
8472 | }
|
8473 |
|
8474 |
|
8475 |
|
8476 |
|
8477 |
|
8478 | function getInstanceFromNode(node) {
|
8479 | var inst = getClosestInstanceFromNode(node);
|
8480 | if (inst != null && inst._hostNode === node) {
|
8481 | return inst;
|
8482 | } else {
|
8483 | return null;
|
8484 | }
|
8485 | }
|
8486 |
|
8487 |
|
8488 |
|
8489 |
|
8490 |
|
8491 | function getNodeFromInstance(inst) {
|
8492 |
|
8493 |
|
8494 | !(inst._hostNode !== undefined) ? "development" !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : _prodInvariant('33') : void 0;
|
8495 |
|
8496 | if (inst._hostNode) {
|
8497 | return inst._hostNode;
|
8498 | }
|
8499 |
|
8500 |
|
8501 | var parents = [];
|
8502 | while (!inst._hostNode) {
|
8503 | parents.push(inst);
|
8504 | !inst._hostParent ? "development" !== 'production' ? invariant(false, 'React DOM tree root should always have a node reference.') : _prodInvariant('34') : void 0;
|
8505 | inst = inst._hostParent;
|
8506 | }
|
8507 |
|
8508 |
|
8509 |
|
8510 | for (; parents.length; inst = parents.pop()) {
|
8511 | precacheChildNodes(inst, inst._hostNode);
|
8512 | }
|
8513 |
|
8514 | return inst._hostNode;
|
8515 | }
|
8516 |
|
8517 | var ReactDOMComponentTree = {
|
8518 | getClosestInstanceFromNode: getClosestInstanceFromNode,
|
8519 | getInstanceFromNode: getInstanceFromNode,
|
8520 | getNodeFromInstance: getNodeFromInstance,
|
8521 | precacheChildNodes: precacheChildNodes,
|
8522 | precacheNode: precacheNode,
|
8523 | uncacheNode: uncacheNode
|
8524 | };
|
8525 |
|
8526 | module.exports = ReactDOMComponentTree;
|
8527 | },{"10":10,"153":153,"178":178,"45":45}],47:[function(_dereq_,module,exports){
|
8528 |
|
8529 |
|
8530 |
|
8531 |
|
8532 |
|
8533 |
|
8534 |
|
8535 |
|
8536 |
|
8537 |
|
8538 |
|
8539 | 'use strict';
|
8540 |
|
8541 | var validateDOMNesting = _dereq_(161);
|
8542 |
|
8543 | var DOC_NODE_TYPE = 9;
|
8544 |
|
8545 | function ReactDOMContainerInfo(topLevelWrapper, node) {
|
8546 | var info = {
|
8547 | _topLevelWrapper: topLevelWrapper,
|
8548 | _idCounter: 1,
|
8549 | _ownerDocument: node ? node.nodeType === DOC_NODE_TYPE ? node : node.ownerDocument : null,
|
8550 | _node: node,
|
8551 | _tag: node ? node.nodeName.toLowerCase() : null,
|
8552 | _namespaceURI: node ? node.namespaceURI : null
|
8553 | };
|
8554 | if ("development" !== 'production') {
|
8555 | info._ancestorInfo = node ? validateDOMNesting.updatedAncestorInfo(null, info._tag, null) : null;
|
8556 | }
|
8557 | return info;
|
8558 | }
|
8559 |
|
8560 | module.exports = ReactDOMContainerInfo;
|
8561 | },{"161":161}],48:[function(_dereq_,module,exports){
|
8562 |
|
8563 |
|
8564 |
|
8565 |
|
8566 |
|
8567 |
|
8568 |
|
8569 |
|
8570 |
|
8571 |
|
8572 |
|
8573 | 'use strict';
|
8574 |
|
8575 | var _assign = _dereq_(188);
|
8576 |
|
8577 | var DOMLazyTree = _dereq_(8);
|
8578 | var ReactDOMComponentTree = _dereq_(46);
|
8579 |
|
8580 | var ReactDOMEmptyComponent = function (instantiate) {
|
8581 |
|
8582 | this._currentElement = null;
|
8583 |
|
8584 | this._hostNode = null;
|
8585 | this._hostParent = null;
|
8586 | this._hostContainerInfo = null;
|
8587 | this._domID = 0;
|
8588 | };
|
8589 | _assign(ReactDOMEmptyComponent.prototype, {
|
8590 | mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
|
8591 | var domID = hostContainerInfo._idCounter++;
|
8592 | this._domID = domID;
|
8593 | this._hostParent = hostParent;
|
8594 | this._hostContainerInfo = hostContainerInfo;
|
8595 |
|
8596 | var nodeValue = ' react-empty: ' + this._domID + ' ';
|
8597 | if (transaction.useCreateElement) {
|
8598 | var ownerDocument = hostContainerInfo._ownerDocument;
|
8599 | var node = ownerDocument.createComment(nodeValue);
|
8600 | ReactDOMComponentTree.precacheNode(this, node);
|
8601 | return DOMLazyTree(node);
|
8602 | } else {
|
8603 | if (transaction.renderToStaticMarkup) {
|
8604 |
|
8605 |
|
8606 |
|
8607 | return '';
|
8608 | }
|
8609 | return '<!--' + nodeValue + '-->';
|
8610 | }
|
8611 | },
|
8612 | receiveComponent: function () {},
|
8613 | getHostNode: function () {
|
8614 | return ReactDOMComponentTree.getNodeFromInstance(this);
|
8615 | },
|
8616 | unmountComponent: function () {
|
8617 | ReactDOMComponentTree.uncacheNode(this);
|
8618 | }
|
8619 | });
|
8620 |
|
8621 | module.exports = ReactDOMEmptyComponent;
|
8622 | },{"188":188,"46":46,"8":8}],49:[function(_dereq_,module,exports){
|
8623 |
|
8624 |
|
8625 |
|
8626 |
|
8627 |
|
8628 |
|
8629 |
|
8630 |
|
8631 |
|
8632 |
|
8633 |
|
8634 | 'use strict';
|
8635 |
|
8636 | var ReactElement = _dereq_(65);
|
8637 |
|
8638 |
|
8639 |
|
8640 |
|
8641 |
|
8642 |
|
8643 | var createDOMFactory = ReactElement.createFactory;
|
8644 | if ("development" !== 'production') {
|
8645 | var ReactElementValidator = _dereq_(66);
|
8646 | createDOMFactory = ReactElementValidator.createFactory;
|
8647 | }
|
8648 |
|
8649 |
|
8650 |
|
8651 |
|
8652 |
|
8653 |
|
8654 |
|
8655 | var ReactDOMFactories = {
|
8656 | a: createDOMFactory('a'),
|
8657 | abbr: createDOMFactory('abbr'),
|
8658 | address: createDOMFactory('address'),
|
8659 | area: createDOMFactory('area'),
|
8660 | article: createDOMFactory('article'),
|
8661 | aside: createDOMFactory('aside'),
|
8662 | audio: createDOMFactory('audio'),
|
8663 | b: createDOMFactory('b'),
|
8664 | base: createDOMFactory('base'),
|
8665 | bdi: createDOMFactory('bdi'),
|
8666 | bdo: createDOMFactory('bdo'),
|
8667 | big: createDOMFactory('big'),
|
8668 | blockquote: createDOMFactory('blockquote'),
|
8669 | body: createDOMFactory('body'),
|
8670 | br: createDOMFactory('br'),
|
8671 | button: createDOMFactory('button'),
|
8672 | canvas: createDOMFactory('canvas'),
|
8673 | caption: createDOMFactory('caption'),
|
8674 | cite: createDOMFactory('cite'),
|
8675 | code: createDOMFactory('code'),
|
8676 | col: createDOMFactory('col'),
|
8677 | colgroup: createDOMFactory('colgroup'),
|
8678 | data: createDOMFactory('data'),
|
8679 | datalist: createDOMFactory('datalist'),
|
8680 | dd: createDOMFactory('dd'),
|
8681 | del: createDOMFactory('del'),
|
8682 | details: createDOMFactory('details'),
|
8683 | dfn: createDOMFactory('dfn'),
|
8684 | dialog: createDOMFactory('dialog'),
|
8685 | div: createDOMFactory('div'),
|
8686 | dl: createDOMFactory('dl'),
|
8687 | dt: createDOMFactory('dt'),
|
8688 | em: createDOMFactory('em'),
|
8689 | embed: createDOMFactory('embed'),
|
8690 | fieldset: createDOMFactory('fieldset'),
|
8691 | figcaption: createDOMFactory('figcaption'),
|
8692 | figure: createDOMFactory('figure'),
|
8693 | footer: createDOMFactory('footer'),
|
8694 | form: createDOMFactory('form'),
|
8695 | h1: createDOMFactory('h1'),
|
8696 | h2: createDOMFactory('h2'),
|
8697 | h3: createDOMFactory('h3'),
|
8698 | h4: createDOMFactory('h4'),
|
8699 | h5: createDOMFactory('h5'),
|
8700 | h6: createDOMFactory('h6'),
|
8701 | head: createDOMFactory('head'),
|
8702 | header: createDOMFactory('header'),
|
8703 | hgroup: createDOMFactory('hgroup'),
|
8704 | hr: createDOMFactory('hr'),
|
8705 | html: createDOMFactory('html'),
|
8706 | i: createDOMFactory('i'),
|
8707 | iframe: createDOMFactory('iframe'),
|
8708 | img: createDOMFactory('img'),
|
8709 | input: createDOMFactory('input'),
|
8710 | ins: createDOMFactory('ins'),
|
8711 | kbd: createDOMFactory('kbd'),
|
8712 | keygen: createDOMFactory('keygen'),
|
8713 | label: createDOMFactory('label'),
|
8714 | legend: createDOMFactory('legend'),
|
8715 | li: createDOMFactory('li'),
|
8716 | link: createDOMFactory('link'),
|
8717 | main: createDOMFactory('main'),
|
8718 | map: createDOMFactory('map'),
|
8719 | mark: createDOMFactory('mark'),
|
8720 | menu: createDOMFactory('menu'),
|
8721 | menuitem: createDOMFactory('menuitem'),
|
8722 | meta: createDOMFactory('meta'),
|
8723 | meter: createDOMFactory('meter'),
|
8724 | nav: createDOMFactory('nav'),
|
8725 | noscript: createDOMFactory('noscript'),
|
8726 | object: createDOMFactory('object'),
|
8727 | ol: createDOMFactory('ol'),
|
8728 | optgroup: createDOMFactory('optgroup'),
|
8729 | option: createDOMFactory('option'),
|
8730 | output: createDOMFactory('output'),
|
8731 | p: createDOMFactory('p'),
|
8732 | param: createDOMFactory('param'),
|
8733 | picture: createDOMFactory('picture'),
|
8734 | pre: createDOMFactory('pre'),
|
8735 | progress: createDOMFactory('progress'),
|
8736 | q: createDOMFactory('q'),
|
8737 | rp: createDOMFactory('rp'),
|
8738 | rt: createDOMFactory('rt'),
|
8739 | ruby: createDOMFactory('ruby'),
|
8740 | s: createDOMFactory('s'),
|
8741 | samp: createDOMFactory('samp'),
|
8742 | script: createDOMFactory('script'),
|
8743 | section: createDOMFactory('section'),
|
8744 | select: createDOMFactory('select'),
|
8745 | small: createDOMFactory('small'),
|
8746 | source: createDOMFactory('source'),
|
8747 | span: createDOMFactory('span'),
|
8748 | strong: createDOMFactory('strong'),
|
8749 | style: createDOMFactory('style'),
|
8750 | sub: createDOMFactory('sub'),
|
8751 | summary: createDOMFactory('summary'),
|
8752 | sup: createDOMFactory('sup'),
|
8753 | table: createDOMFactory('table'),
|
8754 | tbody: createDOMFactory('tbody'),
|
8755 | td: createDOMFactory('td'),
|
8756 | textarea: createDOMFactory('textarea'),
|
8757 | tfoot: createDOMFactory('tfoot'),
|
8758 | th: createDOMFactory('th'),
|
8759 | thead: createDOMFactory('thead'),
|
8760 | time: createDOMFactory('time'),
|
8761 | title: createDOMFactory('title'),
|
8762 | tr: createDOMFactory('tr'),
|
8763 | track: createDOMFactory('track'),
|
8764 | u: createDOMFactory('u'),
|
8765 | ul: createDOMFactory('ul'),
|
8766 | 'var': createDOMFactory('var'),
|
8767 | video: createDOMFactory('video'),
|
8768 | wbr: createDOMFactory('wbr'),
|
8769 |
|
8770 |
|
8771 | circle: createDOMFactory('circle'),
|
8772 | clipPath: createDOMFactory('clipPath'),
|
8773 | defs: createDOMFactory('defs'),
|
8774 | ellipse: createDOMFactory('ellipse'),
|
8775 | g: createDOMFactory('g'),
|
8776 | image: createDOMFactory('image'),
|
8777 | line: createDOMFactory('line'),
|
8778 | linearGradient: createDOMFactory('linearGradient'),
|
8779 | mask: createDOMFactory('mask'),
|
8780 | path: createDOMFactory('path'),
|
8781 | pattern: createDOMFactory('pattern'),
|
8782 | polygon: createDOMFactory('polygon'),
|
8783 | polyline: createDOMFactory('polyline'),
|
8784 | radialGradient: createDOMFactory('radialGradient'),
|
8785 | rect: createDOMFactory('rect'),
|
8786 | stop: createDOMFactory('stop'),
|
8787 | svg: createDOMFactory('svg'),
|
8788 | text: createDOMFactory('text'),
|
8789 | tspan: createDOMFactory('tspan')
|
8790 | };
|
8791 |
|
8792 | module.exports = ReactDOMFactories;
|
8793 | },{"65":65,"66":66}],50:[function(_dereq_,module,exports){
|
8794 |
|
8795 |
|
8796 |
|
8797 |
|
8798 |
|
8799 |
|
8800 |
|
8801 |
|
8802 |
|
8803 |
|
8804 |
|
8805 | 'use strict';
|
8806 |
|
8807 | var ReactDOMFeatureFlags = {
|
8808 | useCreateElement: true
|
8809 | };
|
8810 |
|
8811 | module.exports = ReactDOMFeatureFlags;
|
8812 | },{}],51:[function(_dereq_,module,exports){
|
8813 |
|
8814 |
|
8815 |
|
8816 |
|
8817 |
|
8818 |
|
8819 |
|
8820 |
|
8821 |
|
8822 |
|
8823 |
|
8824 | 'use strict';
|
8825 |
|
8826 | var DOMChildrenOperations = _dereq_(7);
|
8827 | var ReactDOMComponentTree = _dereq_(46);
|
8828 |
|
8829 |
|
8830 |
|
8831 |
|
8832 | var ReactDOMIDOperations = {
|
8833 |
|
8834 | |
8835 |
|
8836 |
|
8837 |
|
8838 |
|
8839 |
|
8840 | dangerouslyProcessChildrenUpdates: function (parentInst, updates) {
|
8841 | var node = ReactDOMComponentTree.getNodeFromInstance(parentInst);
|
8842 | DOMChildrenOperations.processUpdates(node, updates);
|
8843 | }
|
8844 | };
|
8845 |
|
8846 | module.exports = ReactDOMIDOperations;
|
8847 | },{"46":46,"7":7}],52:[function(_dereq_,module,exports){
|
8848 |
|
8849 |
|
8850 |
|
8851 |
|
8852 |
|
8853 |
|
8854 |
|
8855 |
|
8856 |
|
8857 |
|
8858 |
|
8859 | 'use strict';
|
8860 |
|
8861 | var _prodInvariant = _dereq_(153),
|
8862 | _assign = _dereq_(188);
|
8863 |
|
8864 | var DisabledInputUtils = _dereq_(14);
|
8865 | var DOMPropertyOperations = _dereq_(11);
|
8866 | var LinkedValueUtils = _dereq_(25);
|
8867 | var ReactDOMComponentTree = _dereq_(46);
|
8868 | var ReactUpdates = _dereq_(107);
|
8869 |
|
8870 | var invariant = _dereq_(178);
|
8871 | var warning = _dereq_(187);
|
8872 |
|
8873 | var didWarnValueLink = false;
|
8874 | var didWarnCheckedLink = false;
|
8875 | var didWarnValueDefaultValue = false;
|
8876 | var didWarnCheckedDefaultChecked = false;
|
8877 | var didWarnControlledToUncontrolled = false;
|
8878 | var didWarnUncontrolledToControlled = false;
|
8879 |
|
8880 | function forceUpdateIfMounted() {
|
8881 | if (this._rootNodeID) {
|
8882 |
|
8883 | ReactDOMInput.updateWrapper(this);
|
8884 | }
|
8885 | }
|
8886 |
|
8887 | function isControlled(props) {
|
8888 | var usesChecked = props.type === 'checkbox' || props.type === 'radio';
|
8889 | return usesChecked ? props.checked != null : props.value != null;
|
8890 | }
|
8891 |
|
8892 |
|
8893 |
|
8894 |
|
8895 |
|
8896 |
|
8897 |
|
8898 |
|
8899 |
|
8900 |
|
8901 |
|
8902 |
|
8903 |
|
8904 |
|
8905 |
|
8906 |
|
8907 |
|
8908 | var ReactDOMInput = {
|
8909 | getHostProps: function (inst, props) {
|
8910 | var value = LinkedValueUtils.getValue(props);
|
8911 | var checked = LinkedValueUtils.getChecked(props);
|
8912 |
|
8913 | var hostProps = _assign({
|
8914 |
|
8915 |
|
8916 | type: undefined,
|
8917 |
|
8918 |
|
8919 | step: undefined,
|
8920 |
|
8921 |
|
8922 | min: undefined,
|
8923 | max: undefined
|
8924 | }, DisabledInputUtils.getHostProps(inst, props), {
|
8925 | defaultChecked: undefined,
|
8926 | defaultValue: undefined,
|
8927 | value: value != null ? value : inst._wrapperState.initialValue,
|
8928 | checked: checked != null ? checked : inst._wrapperState.initialChecked,
|
8929 | onChange: inst._wrapperState.onChange
|
8930 | });
|
8931 |
|
8932 | return hostProps;
|
8933 | },
|
8934 |
|
8935 | mountWrapper: function (inst, props) {
|
8936 | if ("development" !== 'production') {
|
8937 | LinkedValueUtils.checkPropTypes('input', props, inst._currentElement._owner);
|
8938 |
|
8939 | var owner = inst._currentElement._owner;
|
8940 |
|
8941 | if (props.valueLink !== undefined && !didWarnValueLink) {
|
8942 | "development" !== 'production' ? warning(false, '`valueLink` prop on `input` is deprecated; set `value` and `onChange` instead.') : void 0;
|
8943 | didWarnValueLink = true;
|
8944 | }
|
8945 | if (props.checkedLink !== undefined && !didWarnCheckedLink) {
|
8946 | "development" !== 'production' ? warning(false, '`checkedLink` prop on `input` is deprecated; set `value` and `onChange` instead.') : void 0;
|
8947 | didWarnCheckedLink = true;
|
8948 | }
|
8949 | if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) {
|
8950 | "development" !== 'production' ? warning(false, '%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
|
8951 | didWarnCheckedDefaultChecked = true;
|
8952 | }
|
8953 | if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
|
8954 | "development" !== 'production' ? warning(false, '%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
|
8955 | didWarnValueDefaultValue = true;
|
8956 | }
|
8957 | }
|
8958 |
|
8959 | var defaultValue = props.defaultValue;
|
8960 | inst._wrapperState = {
|
8961 | initialChecked: props.checked != null ? props.checked : props.defaultChecked,
|
8962 | initialValue: props.value != null ? props.value : defaultValue,
|
8963 | listeners: null,
|
8964 | onChange: _handleChange.bind(inst)
|
8965 | };
|
8966 |
|
8967 | if ("development" !== 'production') {
|
8968 | inst._wrapperState.controlled = isControlled(props);
|
8969 | }
|
8970 | },
|
8971 |
|
8972 | updateWrapper: function (inst) {
|
8973 | var props = inst._currentElement.props;
|
8974 |
|
8975 | if ("development" !== 'production') {
|
8976 | var controlled = isControlled(props);
|
8977 | var owner = inst._currentElement._owner;
|
8978 |
|
8979 | if (!inst._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) {
|
8980 | "development" !== 'production' ? warning(false, '%s is changing an uncontrolled input of type %s to be controlled. ' + 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
|
8981 | didWarnUncontrolledToControlled = true;
|
8982 | }
|
8983 | if (inst._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) {
|
8984 | "development" !== 'production' ? warning(false, '%s is changing a controlled input of type %s to be uncontrolled. ' + 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
|
8985 | didWarnControlledToUncontrolled = true;
|
8986 | }
|
8987 | }
|
8988 |
|
8989 |
|
8990 | var checked = props.checked;
|
8991 | if (checked != null) {
|
8992 | DOMPropertyOperations.setValueForProperty(ReactDOMComponentTree.getNodeFromInstance(inst), 'checked', checked || false);
|
8993 | }
|
8994 |
|
8995 | var node = ReactDOMComponentTree.getNodeFromInstance(inst);
|
8996 | var value = LinkedValueUtils.getValue(props);
|
8997 | if (value != null) {
|
8998 |
|
8999 |
|
9000 |
|
9001 | var newValue = '' + value;
|
9002 |
|
9003 |
|
9004 | if (newValue !== node.value) {
|
9005 | node.value = newValue;
|
9006 | }
|
9007 | } else {
|
9008 | if (props.value == null && props.defaultValue != null) {
|
9009 | node.defaultValue = '' + props.defaultValue;
|
9010 | }
|
9011 | if (props.checked == null && props.defaultChecked != null) {
|
9012 | node.defaultChecked = !!props.defaultChecked;
|
9013 | }
|
9014 | }
|
9015 | },
|
9016 |
|
9017 | postMountWrapper: function (inst) {
|
9018 | var props = inst._currentElement.props;
|
9019 |
|
9020 |
|
9021 |
|
9022 | var node = ReactDOMComponentTree.getNodeFromInstance(inst);
|
9023 |
|
9024 |
|
9025 |
|
9026 |
|
9027 |
|
9028 |
|
9029 |
|
9030 | switch (props.type) {
|
9031 | case 'submit':
|
9032 | case 'reset':
|
9033 | break;
|
9034 | case 'color':
|
9035 | case 'date':
|
9036 | case 'datetime':
|
9037 | case 'datetime-local':
|
9038 | case 'month':
|
9039 | case 'time':
|
9040 | case 'week':
|
9041 |
|
9042 |
|
9043 | node.value = '';
|
9044 | node.value = node.defaultValue;
|
9045 | break;
|
9046 | default:
|
9047 | node.value = node.value;
|
9048 | break;
|
9049 | }
|
9050 |
|
9051 |
|
9052 |
|
9053 |
|
9054 |
|
9055 |
|
9056 | var name = node.name;
|
9057 | if (name !== '') {
|
9058 | node.name = '';
|
9059 | }
|
9060 | node.defaultChecked = !node.defaultChecked;
|
9061 | node.defaultChecked = !node.defaultChecked;
|
9062 | if (name !== '') {
|
9063 | node.name = name;
|
9064 | }
|
9065 | }
|
9066 | };
|
9067 |
|
9068 | function _handleChange(event) {
|
9069 | var props = this._currentElement.props;
|
9070 |
|
9071 | var returnValue = LinkedValueUtils.executeOnChange(props, event);
|
9072 |
|
9073 |
|
9074 |
|
9075 |
|
9076 | ReactUpdates.asap(forceUpdateIfMounted, this);
|
9077 |
|
9078 | var name = props.name;
|
9079 | if (props.type === 'radio' && name != null) {
|
9080 | var rootNode = ReactDOMComponentTree.getNodeFromInstance(this);
|
9081 | var queryRoot = rootNode;
|
9082 |
|
9083 | while (queryRoot.parentNode) {
|
9084 | queryRoot = queryRoot.parentNode;
|
9085 | }
|
9086 |
|
9087 |
|
9088 |
|
9089 |
|
9090 |
|
9091 |
|
9092 |
|
9093 | var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type="radio"]');
|
9094 |
|
9095 | for (var i = 0; i < group.length; i++) {
|
9096 | var otherNode = group[i];
|
9097 | if (otherNode === rootNode || otherNode.form !== rootNode.form) {
|
9098 | continue;
|
9099 | }
|
9100 |
|
9101 |
|
9102 |
|
9103 |
|
9104 | var otherInstance = ReactDOMComponentTree.getInstanceFromNode(otherNode);
|
9105 | !otherInstance ? "development" !== 'production' ? invariant(false, 'ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.') : _prodInvariant('90') : void 0;
|
9106 |
|
9107 |
|
9108 |
|
9109 | ReactUpdates.asap(forceUpdateIfMounted, otherInstance);
|
9110 | }
|
9111 | }
|
9112 |
|
9113 | return returnValue;
|
9114 | }
|
9115 |
|
9116 | module.exports = ReactDOMInput;
|
9117 | },{"107":107,"11":11,"14":14,"153":153,"178":178,"187":187,"188":188,"25":25,"46":46}],53:[function(_dereq_,module,exports){
|
9118 |
|
9119 |
|
9120 |
|
9121 |
|
9122 |
|
9123 |
|
9124 |
|
9125 |
|
9126 |
|
9127 |
|
9128 |
|
9129 | 'use strict';
|
9130 |
|
9131 | var ReactComponentTreeHook = _dereq_(38);
|
9132 |
|
9133 | var warning = _dereq_(187);
|
9134 |
|
9135 | var didWarnValueNull = false;
|
9136 |
|
9137 | function handleElement(debugID, element) {
|
9138 | if (element == null) {
|
9139 | return;
|
9140 | }
|
9141 | if (element.type !== 'input' && element.type !== 'textarea' && element.type !== 'select') {
|
9142 | return;
|
9143 | }
|
9144 | if (element.props != null && element.props.value === null && !didWarnValueNull) {
|
9145 | "development" !== 'production' ? warning(false, '`value` prop on `%s` should not be null. ' + 'Consider using the empty string to clear the component or `undefined` ' + 'for uncontrolled components.%s', element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
|
9146 |
|
9147 | didWarnValueNull = true;
|
9148 | }
|
9149 | }
|
9150 |
|
9151 | var ReactDOMNullInputValuePropHook = {
|
9152 | onBeforeMountComponent: function (debugID, element) {
|
9153 | handleElement(debugID, element);
|
9154 | },
|
9155 | onBeforeUpdateComponent: function (debugID, element) {
|
9156 | handleElement(debugID, element);
|
9157 | }
|
9158 | };
|
9159 |
|
9160 | module.exports = ReactDOMNullInputValuePropHook;
|
9161 | },{"187":187,"38":38}],54:[function(_dereq_,module,exports){
|
9162 |
|
9163 |
|
9164 |
|
9165 |
|
9166 |
|
9167 |
|
9168 |
|
9169 |
|
9170 |
|
9171 |
|
9172 |
|
9173 | 'use strict';
|
9174 |
|
9175 | var _assign = _dereq_(188);
|
9176 |
|
9177 | var ReactChildren = _dereq_(32);
|
9178 | var ReactDOMComponentTree = _dereq_(46);
|
9179 | var ReactDOMSelect = _dereq_(55);
|
9180 |
|
9181 | var warning = _dereq_(187);
|
9182 | var didWarnInvalidOptionChildren = false;
|
9183 |
|
9184 | function flattenChildren(children) {
|
9185 | var content = '';
|
9186 |
|
9187 |
|
9188 |
|
9189 | ReactChildren.forEach(children, function (child) {
|
9190 | if (child == null) {
|
9191 | return;
|
9192 | }
|
9193 | if (typeof child === 'string' || typeof child === 'number') {
|
9194 | content += child;
|
9195 | } else if (!didWarnInvalidOptionChildren) {
|
9196 | didWarnInvalidOptionChildren = true;
|
9197 | "development" !== 'production' ? warning(false, 'Only strings and numbers are supported as <option> children.') : void 0;
|
9198 | }
|
9199 | });
|
9200 |
|
9201 | return content;
|
9202 | }
|
9203 |
|
9204 |
|
9205 |
|
9206 |
|
9207 | var ReactDOMOption = {
|
9208 | mountWrapper: function (inst, props, hostParent) {
|
9209 |
|
9210 | if ("development" !== 'production') {
|
9211 | "development" !== 'production' ? warning(props.selected == null, 'Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.') : void 0;
|
9212 | }
|
9213 |
|
9214 |
|
9215 | var selectValue = null;
|
9216 | if (hostParent != null) {
|
9217 | var selectParent = hostParent;
|
9218 |
|
9219 | if (selectParent._tag === 'optgroup') {
|
9220 | selectParent = selectParent._hostParent;
|
9221 | }
|
9222 |
|
9223 | if (selectParent != null && selectParent._tag === 'select') {
|
9224 | selectValue = ReactDOMSelect.getSelectValueContext(selectParent);
|
9225 | }
|
9226 | }
|
9227 |
|
9228 |
|
9229 |
|
9230 | var selected = null;
|
9231 | if (selectValue != null) {
|
9232 | var value;
|
9233 | if (props.value != null) {
|
9234 | value = props.value + '';
|
9235 | } else {
|
9236 | value = flattenChildren(props.children);
|
9237 | }
|
9238 | selected = false;
|
9239 | if (Array.isArray(selectValue)) {
|
9240 |
|
9241 | for (var i = 0; i < selectValue.length; i++) {
|
9242 | if ('' + selectValue[i] === value) {
|
9243 | selected = true;
|
9244 | break;
|
9245 | }
|
9246 | }
|
9247 | } else {
|
9248 | selected = '' + selectValue === value;
|
9249 | }
|
9250 | }
|
9251 |
|
9252 | inst._wrapperState = { selected: selected };
|
9253 | },
|
9254 |
|
9255 | postMountWrapper: function (inst) {
|
9256 |
|
9257 | var props = inst._currentElement.props;
|
9258 | if (props.value != null) {
|
9259 | var node = ReactDOMComponentTree.getNodeFromInstance(inst);
|
9260 | node.setAttribute('value', props.value);
|
9261 | }
|
9262 | },
|
9263 |
|
9264 | getHostProps: function (inst, props) {
|
9265 | var hostProps = _assign({ selected: undefined, children: undefined }, props);
|
9266 |
|
9267 |
|
9268 |
|
9269 | if (inst._wrapperState.selected != null) {
|
9270 | hostProps.selected = inst._wrapperState.selected;
|
9271 | }
|
9272 |
|
9273 | var content = flattenChildren(props.children);
|
9274 |
|
9275 | if (content) {
|
9276 | hostProps.children = content;
|
9277 | }
|
9278 |
|
9279 | return hostProps;
|
9280 | }
|
9281 |
|
9282 | };
|
9283 |
|
9284 | module.exports = ReactDOMOption;
|
9285 | },{"187":187,"188":188,"32":32,"46":46,"55":55}],55:[function(_dereq_,module,exports){
|
9286 |
|
9287 |
|
9288 |
|
9289 |
|
9290 |
|
9291 |
|
9292 |
|
9293 |
|
9294 |
|
9295 |
|
9296 |
|
9297 | 'use strict';
|
9298 |
|
9299 | var _assign = _dereq_(188);
|
9300 |
|
9301 | var DisabledInputUtils = _dereq_(14);
|
9302 | var LinkedValueUtils = _dereq_(25);
|
9303 | var ReactDOMComponentTree = _dereq_(46);
|
9304 | var ReactUpdates = _dereq_(107);
|
9305 |
|
9306 | var warning = _dereq_(187);
|
9307 |
|
9308 | var didWarnValueLink = false;
|
9309 | var didWarnValueDefaultValue = false;
|
9310 |
|
9311 | function updateOptionsIfPendingUpdateAndMounted() {
|
9312 | if (this._rootNodeID && this._wrapperState.pendingUpdate) {
|
9313 | this._wrapperState.pendingUpdate = false;
|
9314 |
|
9315 | var props = this._currentElement.props;
|
9316 | var value = LinkedValueUtils.getValue(props);
|
9317 |
|
9318 | if (value != null) {
|
9319 | updateOptions(this, Boolean(props.multiple), value);
|
9320 | }
|
9321 | }
|
9322 | }
|
9323 |
|
9324 | function getDeclarationErrorAddendum(owner) {
|
9325 | if (owner) {
|
9326 | var name = owner.getName();
|
9327 | if (name) {
|
9328 | return ' Check the render method of `' + name + '`.';
|
9329 | }
|
9330 | }
|
9331 | return '';
|
9332 | }
|
9333 |
|
9334 | var valuePropNames = ['value', 'defaultValue'];
|
9335 |
|
9336 |
|
9337 |
|
9338 |
|
9339 |
|
9340 | function checkSelectPropTypes(inst, props) {
|
9341 | var owner = inst._currentElement._owner;
|
9342 | LinkedValueUtils.checkPropTypes('select', props, owner);
|
9343 |
|
9344 | if (props.valueLink !== undefined && !didWarnValueLink) {
|
9345 | "development" !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;
|
9346 | didWarnValueLink = true;
|
9347 | }
|
9348 |
|
9349 | for (var i = 0; i < valuePropNames.length; i++) {
|
9350 | var propName = valuePropNames[i];
|
9351 | if (props[propName] == null) {
|
9352 | continue;
|
9353 | }
|
9354 | var isArray = Array.isArray(props[propName]);
|
9355 | if (props.multiple && !isArray) {
|
9356 | "development" !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;
|
9357 | } else if (!props.multiple && isArray) {
|
9358 | "development" !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;
|
9359 | }
|
9360 | }
|
9361 | }
|
9362 |
|
9363 |
|
9364 |
|
9365 |
|
9366 |
|
9367 |
|
9368 |
|
9369 | function updateOptions(inst, multiple, propValue) {
|
9370 | var selectedValue, i;
|
9371 | var options = ReactDOMComponentTree.getNodeFromInstance(inst).options;
|
9372 |
|
9373 | if (multiple) {
|
9374 | selectedValue = {};
|
9375 | for (i = 0; i < propValue.length; i++) {
|
9376 | selectedValue['' + propValue[i]] = true;
|
9377 | }
|
9378 | for (i = 0; i < options.length; i++) {
|
9379 | var selected = selectedValue.hasOwnProperty(options[i].value);
|
9380 | if (options[i].selected !== selected) {
|
9381 | options[i].selected = selected;
|
9382 | }
|
9383 | }
|
9384 | } else {
|
9385 |
|
9386 |
|
9387 | selectedValue = '' + propValue;
|
9388 | for (i = 0; i < options.length; i++) {
|
9389 | if (options[i].value === selectedValue) {
|
9390 | options[i].selected = true;
|
9391 | return;
|
9392 | }
|
9393 | }
|
9394 | if (options.length) {
|
9395 | options[0].selected = true;
|
9396 | }
|
9397 | }
|
9398 | }
|
9399 |
|
9400 |
|
9401 |
|
9402 |
|
9403 |
|
9404 |
|
9405 |
|
9406 |
|
9407 |
|
9408 |
|
9409 |
|
9410 |
|
9411 |
|
9412 |
|
9413 |
|
9414 |
|
9415 | var ReactDOMSelect = {
|
9416 | getHostProps: function (inst, props) {
|
9417 | return _assign({}, DisabledInputUtils.getHostProps(inst, props), {
|
9418 | onChange: inst._wrapperState.onChange,
|
9419 | value: undefined
|
9420 | });
|
9421 | },
|
9422 |
|
9423 | mountWrapper: function (inst, props) {
|
9424 | if ("development" !== 'production') {
|
9425 | checkSelectPropTypes(inst, props);
|
9426 | }
|
9427 |
|
9428 | var value = LinkedValueUtils.getValue(props);
|
9429 | inst._wrapperState = {
|
9430 | pendingUpdate: false,
|
9431 | initialValue: value != null ? value : props.defaultValue,
|
9432 | listeners: null,
|
9433 | onChange: _handleChange.bind(inst),
|
9434 | wasMultiple: Boolean(props.multiple)
|
9435 | };
|
9436 |
|
9437 | if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
|
9438 | "development" !== 'production' ? warning(false, 'Select elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled select ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components') : void 0;
|
9439 | didWarnValueDefaultValue = true;
|
9440 | }
|
9441 | },
|
9442 |
|
9443 | getSelectValueContext: function (inst) {
|
9444 |
|
9445 |
|
9446 | return inst._wrapperState.initialValue;
|
9447 | },
|
9448 |
|
9449 | postUpdateWrapper: function (inst) {
|
9450 | var props = inst._currentElement.props;
|
9451 |
|
9452 |
|
9453 |
|
9454 | inst._wrapperState.initialValue = undefined;
|
9455 |
|
9456 | var wasMultiple = inst._wrapperState.wasMultiple;
|
9457 | inst._wrapperState.wasMultiple = Boolean(props.multiple);
|
9458 |
|
9459 | var value = LinkedValueUtils.getValue(props);
|
9460 | if (value != null) {
|
9461 | inst._wrapperState.pendingUpdate = false;
|
9462 | updateOptions(inst, Boolean(props.multiple), value);
|
9463 | } else if (wasMultiple !== Boolean(props.multiple)) {
|
9464 |
|
9465 | if (props.defaultValue != null) {
|
9466 | updateOptions(inst, Boolean(props.multiple), props.defaultValue);
|
9467 | } else {
|
9468 |
|
9469 | updateOptions(inst, Boolean(props.multiple), props.multiple ? [] : '');
|
9470 | }
|
9471 | }
|
9472 | }
|
9473 | };
|
9474 |
|
9475 | function _handleChange(event) {
|
9476 | var props = this._currentElement.props;
|
9477 | var returnValue = LinkedValueUtils.executeOnChange(props, event);
|
9478 |
|
9479 | if (this._rootNodeID) {
|
9480 | this._wrapperState.pendingUpdate = true;
|
9481 | }
|
9482 | ReactUpdates.asap(updateOptionsIfPendingUpdateAndMounted, this);
|
9483 | return returnValue;
|
9484 | }
|
9485 |
|
9486 | module.exports = ReactDOMSelect;
|
9487 | },{"107":107,"14":14,"187":187,"188":188,"25":25,"46":46}],56:[function(_dereq_,module,exports){
|
9488 |
|
9489 |
|
9490 |
|
9491 |
|
9492 |
|
9493 |
|
9494 |
|
9495 |
|
9496 |
|
9497 |
|
9498 |
|
9499 | 'use strict';
|
9500 |
|
9501 | var ExecutionEnvironment = _dereq_(164);
|
9502 |
|
9503 | var getNodeForCharacterOffset = _dereq_(145);
|
9504 | var getTextContentAccessor = _dereq_(146);
|
9505 |
|
9506 |
|
9507 |
|
9508 |
|
9509 |
|
9510 |
|
9511 | function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {
|
9512 | return anchorNode === focusNode && anchorOffset === focusOffset;
|
9513 | }
|
9514 |
|
9515 |
|
9516 |
|
9517 |
|
9518 |
|
9519 |
|
9520 |
|
9521 |
|
9522 |
|
9523 |
|
9524 |
|
9525 |
|
9526 |
|
9527 |
|
9528 |
|
9529 | function getIEOffsets(node) {
|
9530 | var selection = document.selection;
|
9531 | var selectedRange = selection.createRange();
|
9532 | var selectedLength = selectedRange.text.length;
|
9533 |
|
9534 |
|
9535 | var fromStart = selectedRange.duplicate();
|
9536 | fromStart.moveToElementText(node);
|
9537 | fromStart.setEndPoint('EndToStart', selectedRange);
|
9538 |
|
9539 | var startOffset = fromStart.text.length;
|
9540 | var endOffset = startOffset + selectedLength;
|
9541 |
|
9542 | return {
|
9543 | start: startOffset,
|
9544 | end: endOffset
|
9545 | };
|
9546 | }
|
9547 |
|
9548 |
|
9549 |
|
9550 |
|
9551 |
|
9552 | function getModernOffsets(node) {
|
9553 | var selection = window.getSelection && window.getSelection();
|
9554 |
|
9555 | if (!selection || selection.rangeCount === 0) {
|
9556 | return null;
|
9557 | }
|
9558 |
|
9559 | var anchorNode = selection.anchorNode;
|
9560 | var anchorOffset = selection.anchorOffset;
|
9561 | var focusNode = selection.focusNode;
|
9562 | var focusOffset = selection.focusOffset;
|
9563 |
|
9564 | var currentRange = selection.getRangeAt(0);
|
9565 |
|
9566 |
|
9567 |
|
9568 |
|
9569 |
|
9570 |
|
9571 |
|
9572 |
|
9573 | try {
|
9574 |
|
9575 | currentRange.startContainer.nodeType;
|
9576 | currentRange.endContainer.nodeType;
|
9577 |
|
9578 | } catch (e) {
|
9579 | return null;
|
9580 | }
|
9581 |
|
9582 |
|
9583 |
|
9584 |
|
9585 | var isSelectionCollapsed = isCollapsed(selection.anchorNode, selection.anchorOffset, selection.focusNode, selection.focusOffset);
|
9586 |
|
9587 | var rangeLength = isSelectionCollapsed ? 0 : currentRange.toString().length;
|
9588 |
|
9589 | var tempRange = currentRange.cloneRange();
|
9590 | tempRange.selectNodeContents(node);
|
9591 | tempRange.setEnd(currentRange.startContainer, currentRange.startOffset);
|
9592 |
|
9593 | var isTempRangeCollapsed = isCollapsed(tempRange.startContainer, tempRange.startOffset, tempRange.endContainer, tempRange.endOffset);
|
9594 |
|
9595 | var start = isTempRangeCollapsed ? 0 : tempRange.toString().length;
|
9596 | var end = start + rangeLength;
|
9597 |
|
9598 |
|
9599 | var detectionRange = document.createRange();
|
9600 | detectionRange.setStart(anchorNode, anchorOffset);
|
9601 | detectionRange.setEnd(focusNode, focusOffset);
|
9602 | var isBackward = detectionRange.collapsed;
|
9603 |
|
9604 | return {
|
9605 | start: isBackward ? end : start,
|
9606 | end: isBackward ? start : end
|
9607 | };
|
9608 | }
|
9609 |
|
9610 |
|
9611 |
|
9612 |
|
9613 |
|
9614 | function setIEOffsets(node, offsets) {
|
9615 | var range = document.selection.createRange().duplicate();
|
9616 | var start, end;
|
9617 |
|
9618 | if (offsets.end === undefined) {
|
9619 | start = offsets.start;
|
9620 | end = start;
|
9621 | } else if (offsets.start > offsets.end) {
|
9622 | start = offsets.end;
|
9623 | end = offsets.start;
|
9624 | } else {
|
9625 | start = offsets.start;
|
9626 | end = offsets.end;
|
9627 | }
|
9628 |
|
9629 | range.moveToElementText(node);
|
9630 | range.moveStart('character', start);
|
9631 | range.setEndPoint('EndToStart', range);
|
9632 | range.moveEnd('character', end - start);
|
9633 | range.select();
|
9634 | }
|
9635 |
|
9636 |
|
9637 |
|
9638 |
|
9639 |
|
9640 |
|
9641 |
|
9642 |
|
9643 |
|
9644 |
|
9645 |
|
9646 |
|
9647 |
|
9648 | function setModernOffsets(node, offsets) {
|
9649 | if (!window.getSelection) {
|
9650 | return;
|
9651 | }
|
9652 |
|
9653 | var selection = window.getSelection();
|
9654 | var length = node[getTextContentAccessor()].length;
|
9655 | var start = Math.min(offsets.start, length);
|
9656 | var end = offsets.end === undefined ? start : Math.min(offsets.end, length);
|
9657 |
|
9658 |
|
9659 |
|
9660 | if (!selection.extend && start > end) {
|
9661 | var temp = end;
|
9662 | end = start;
|
9663 | start = temp;
|
9664 | }
|
9665 |
|
9666 | var startMarker = getNodeForCharacterOffset(node, start);
|
9667 | var endMarker = getNodeForCharacterOffset(node, end);
|
9668 |
|
9669 | if (startMarker && endMarker) {
|
9670 | var range = document.createRange();
|
9671 | range.setStart(startMarker.node, startMarker.offset);
|
9672 | selection.removeAllRanges();
|
9673 |
|
9674 | if (start > end) {
|
9675 | selection.addRange(range);
|
9676 | selection.extend(endMarker.node, endMarker.offset);
|
9677 | } else {
|
9678 | range.setEnd(endMarker.node, endMarker.offset);
|
9679 | selection.addRange(range);
|
9680 | }
|
9681 | }
|
9682 | }
|
9683 |
|
9684 | var useIEOffsets = ExecutionEnvironment.canUseDOM && 'selection' in document && !('getSelection' in window);
|
9685 |
|
9686 | var ReactDOMSelection = {
|
9687 | |
9688 |
|
9689 |
|
9690 | getOffsets: useIEOffsets ? getIEOffsets : getModernOffsets,
|
9691 |
|
9692 | |
9693 |
|
9694 |
|
9695 |
|
9696 | setOffsets: useIEOffsets ? setIEOffsets : setModernOffsets
|
9697 | };
|
9698 |
|
9699 | module.exports = ReactDOMSelection;
|
9700 | },{"145":145,"146":146,"164":164}],57:[function(_dereq_,module,exports){
|
9701 |
|
9702 |
|
9703 |
|
9704 |
|
9705 |
|
9706 |
|
9707 |
|
9708 |
|
9709 |
|
9710 |
|
9711 |
|
9712 | 'use strict';
|
9713 |
|
9714 | var ReactDefaultInjection = _dereq_(64);
|
9715 | var ReactServerRendering = _dereq_(98);
|
9716 | var ReactVersion = _dereq_(108);
|
9717 |
|
9718 | ReactDefaultInjection.inject();
|
9719 |
|
9720 | var ReactDOMServer = {
|
9721 | renderToString: ReactServerRendering.renderToString,
|
9722 | renderToStaticMarkup: ReactServerRendering.renderToStaticMarkup,
|
9723 | version: ReactVersion
|
9724 | };
|
9725 |
|
9726 | module.exports = ReactDOMServer;
|
9727 | },{"108":108,"64":64,"98":98}],58:[function(_dereq_,module,exports){
|
9728 |
|
9729 |
|
9730 |
|
9731 |
|
9732 |
|
9733 |
|
9734 |
|
9735 |
|
9736 |
|
9737 |
|
9738 |
|
9739 | 'use strict';
|
9740 |
|
9741 | var _prodInvariant = _dereq_(153),
|
9742 | _assign = _dereq_(188);
|
9743 |
|
9744 | var DOMChildrenOperations = _dereq_(7);
|
9745 | var DOMLazyTree = _dereq_(8);
|
9746 | var ReactDOMComponentTree = _dereq_(46);
|
9747 |
|
9748 | var escapeTextContentForBrowser = _dereq_(135);
|
9749 | var invariant = _dereq_(178);
|
9750 | var validateDOMNesting = _dereq_(161);
|
9751 |
|
9752 |
|
9753 |
|
9754 |
|
9755 |
|
9756 |
|
9757 |
|
9758 |
|
9759 |
|
9760 |
|
9761 |
|
9762 |
|
9763 |
|
9764 |
|
9765 |
|
9766 |
|
9767 | var ReactDOMTextComponent = function (text) {
|
9768 |
|
9769 | this._currentElement = text;
|
9770 | this._stringText = '' + text;
|
9771 |
|
9772 | this._hostNode = null;
|
9773 | this._hostParent = null;
|
9774 |
|
9775 |
|
9776 | this._domID = 0;
|
9777 | this._mountIndex = 0;
|
9778 | this._closingComment = null;
|
9779 | this._commentNodes = null;
|
9780 | };
|
9781 |
|
9782 | _assign(ReactDOMTextComponent.prototype, {
|
9783 |
|
9784 | |
9785 |
|
9786 |
|
9787 |
|
9788 |
|
9789 |
|
9790 |
|
9791 |
|
9792 | mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
|
9793 | if ("development" !== 'production') {
|
9794 | var parentInfo;
|
9795 | if (hostParent != null) {
|
9796 | parentInfo = hostParent._ancestorInfo;
|
9797 | } else if (hostContainerInfo != null) {
|
9798 | parentInfo = hostContainerInfo._ancestorInfo;
|
9799 | }
|
9800 | if (parentInfo) {
|
9801 |
|
9802 |
|
9803 | validateDOMNesting(null, this._stringText, this, parentInfo);
|
9804 | }
|
9805 | }
|
9806 |
|
9807 | var domID = hostContainerInfo._idCounter++;
|
9808 | var openingValue = ' react-text: ' + domID + ' ';
|
9809 | var closingValue = ' /react-text ';
|
9810 | this._domID = domID;
|
9811 | this._hostParent = hostParent;
|
9812 | if (transaction.useCreateElement) {
|
9813 | var ownerDocument = hostContainerInfo._ownerDocument;
|
9814 | var openingComment = ownerDocument.createComment(openingValue);
|
9815 | var closingComment = ownerDocument.createComment(closingValue);
|
9816 | var lazyTree = DOMLazyTree(ownerDocument.createDocumentFragment());
|
9817 | DOMLazyTree.queueChild(lazyTree, DOMLazyTree(openingComment));
|
9818 | if (this._stringText) {
|
9819 | DOMLazyTree.queueChild(lazyTree, DOMLazyTree(ownerDocument.createTextNode(this._stringText)));
|
9820 | }
|
9821 | DOMLazyTree.queueChild(lazyTree, DOMLazyTree(closingComment));
|
9822 | ReactDOMComponentTree.precacheNode(this, openingComment);
|
9823 | this._closingComment = closingComment;
|
9824 | return lazyTree;
|
9825 | } else {
|
9826 | var escapedText = escapeTextContentForBrowser(this._stringText);
|
9827 |
|
9828 | if (transaction.renderToStaticMarkup) {
|
9829 |
|
9830 |
|
9831 |
|
9832 | return escapedText;
|
9833 | }
|
9834 |
|
9835 | return '<!--' + openingValue + '-->' + escapedText + '<!--' + closingValue + '-->';
|
9836 | }
|
9837 | },
|
9838 |
|
9839 | |
9840 |
|
9841 |
|
9842 |
|
9843 |
|
9844 |
|
9845 |
|
9846 | receiveComponent: function (nextText, transaction) {
|
9847 | if (nextText !== this._currentElement) {
|
9848 | this._currentElement = nextText;
|
9849 | var nextStringText = '' + nextText;
|
9850 | if (nextStringText !== this._stringText) {
|
9851 |
|
9852 |
|
9853 |
|
9854 | this._stringText = nextStringText;
|
9855 | var commentNodes = this.getHostNode();
|
9856 | DOMChildrenOperations.replaceDelimitedText(commentNodes[0], commentNodes[1], nextStringText);
|
9857 | }
|
9858 | }
|
9859 | },
|
9860 |
|
9861 | getHostNode: function () {
|
9862 | var hostNode = this._commentNodes;
|
9863 | if (hostNode) {
|
9864 | return hostNode;
|
9865 | }
|
9866 | if (!this._closingComment) {
|
9867 | var openingComment = ReactDOMComponentTree.getNodeFromInstance(this);
|
9868 | var node = openingComment.nextSibling;
|
9869 | while (true) {
|
9870 | !(node != null) ? "development" !== 'production' ? invariant(false, 'Missing closing comment for text component %s', this._domID) : _prodInvariant('67', this._domID) : void 0;
|
9871 | if (node.nodeType === 8 && node.nodeValue === ' /react-text ') {
|
9872 | this._closingComment = node;
|
9873 | break;
|
9874 | }
|
9875 | node = node.nextSibling;
|
9876 | }
|
9877 | }
|
9878 | hostNode = [this._hostNode, this._closingComment];
|
9879 | this._commentNodes = hostNode;
|
9880 | return hostNode;
|
9881 | },
|
9882 |
|
9883 | unmountComponent: function () {
|
9884 | this._closingComment = null;
|
9885 | this._commentNodes = null;
|
9886 | ReactDOMComponentTree.uncacheNode(this);
|
9887 | }
|
9888 |
|
9889 | });
|
9890 |
|
9891 | module.exports = ReactDOMTextComponent;
|
9892 | },{"135":135,"153":153,"161":161,"178":178,"188":188,"46":46,"7":7,"8":8}],59:[function(_dereq_,module,exports){
|
9893 |
|
9894 |
|
9895 |
|
9896 |
|
9897 |
|
9898 |
|
9899 |
|
9900 |
|
9901 |
|
9902 |
|
9903 |
|
9904 | 'use strict';
|
9905 |
|
9906 | var _prodInvariant = _dereq_(153),
|
9907 | _assign = _dereq_(188);
|
9908 |
|
9909 | var DisabledInputUtils = _dereq_(14);
|
9910 | var LinkedValueUtils = _dereq_(25);
|
9911 | var ReactDOMComponentTree = _dereq_(46);
|
9912 | var ReactUpdates = _dereq_(107);
|
9913 |
|
9914 | var invariant = _dereq_(178);
|
9915 | var warning = _dereq_(187);
|
9916 |
|
9917 | var didWarnValueLink = false;
|
9918 | var didWarnValDefaultVal = false;
|
9919 |
|
9920 | function forceUpdateIfMounted() {
|
9921 | if (this._rootNodeID) {
|
9922 |
|
9923 | ReactDOMTextarea.updateWrapper(this);
|
9924 | }
|
9925 | }
|
9926 |
|
9927 |
|
9928 |
|
9929 |
|
9930 |
|
9931 |
|
9932 |
|
9933 |
|
9934 |
|
9935 |
|
9936 |
|
9937 |
|
9938 |
|
9939 |
|
9940 |
|
9941 |
|
9942 | var ReactDOMTextarea = {
|
9943 | getHostProps: function (inst, props) {
|
9944 | !(props.dangerouslySetInnerHTML == null) ? "development" !== 'production' ? invariant(false, '`dangerouslySetInnerHTML` does not make sense on <textarea>.') : _prodInvariant('91') : void 0;
|
9945 |
|
9946 |
|
9947 |
|
9948 |
|
9949 |
|
9950 |
|
9951 | var hostProps = _assign({}, DisabledInputUtils.getHostProps(inst, props), {
|
9952 | value: undefined,
|
9953 | defaultValue: undefined,
|
9954 | children: '' + inst._wrapperState.initialValue,
|
9955 | onChange: inst._wrapperState.onChange
|
9956 | });
|
9957 |
|
9958 | return hostProps;
|
9959 | },
|
9960 |
|
9961 | mountWrapper: function (inst, props) {
|
9962 | if ("development" !== 'production') {
|
9963 | LinkedValueUtils.checkPropTypes('textarea', props, inst._currentElement._owner);
|
9964 | if (props.valueLink !== undefined && !didWarnValueLink) {
|
9965 | "development" !== 'production' ? warning(false, '`valueLink` prop on `textarea` is deprecated; set `value` and `onChange` instead.') : void 0;
|
9966 | didWarnValueLink = true;
|
9967 | }
|
9968 | if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValDefaultVal) {
|
9969 | "development" !== 'production' ? warning(false, 'Textarea elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled textarea ' + 'and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components') : void 0;
|
9970 | didWarnValDefaultVal = true;
|
9971 | }
|
9972 | }
|
9973 |
|
9974 | var value = LinkedValueUtils.getValue(props);
|
9975 | var initialValue = value;
|
9976 |
|
9977 |
|
9978 | if (value == null) {
|
9979 | var defaultValue = props.defaultValue;
|
9980 |
|
9981 | var children = props.children;
|
9982 | if (children != null) {
|
9983 | if ("development" !== 'production') {
|
9984 | "development" !== 'production' ? warning(false, 'Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.') : void 0;
|
9985 | }
|
9986 | !(defaultValue == null) ? "development" !== 'production' ? invariant(false, 'If you supply `defaultValue` on a <textarea>, do not pass children.') : _prodInvariant('92') : void 0;
|
9987 | if (Array.isArray(children)) {
|
9988 | !(children.length <= 1) ? "development" !== 'production' ? invariant(false, '<textarea> can only have at most one child.') : _prodInvariant('93') : void 0;
|
9989 | children = children[0];
|
9990 | }
|
9991 |
|
9992 | defaultValue = '' + children;
|
9993 | }
|
9994 | if (defaultValue == null) {
|
9995 | defaultValue = '';
|
9996 | }
|
9997 | initialValue = defaultValue;
|
9998 | }
|
9999 |
|
10000 | inst._wrapperState = {
|
10001 | initialValue: '' + initialValue,
|
10002 | listeners: null,
|
10003 | onChange: _handleChange.bind(inst)
|
10004 | };
|
10005 | },
|
10006 |
|
10007 | updateWrapper: function (inst) {
|
10008 | var props = inst._currentElement.props;
|
10009 |
|
10010 | var node = ReactDOMComponentTree.getNodeFromInstance(inst);
|
10011 | var value = LinkedValueUtils.getValue(props);
|
10012 | if (value != null) {
|
10013 |
|
10014 |
|
10015 | var newValue = '' + value;
|
10016 |
|
10017 |
|
10018 | if (newValue !== node.value) {
|
10019 | node.value = newValue;
|
10020 | }
|
10021 | if (props.defaultValue == null) {
|
10022 | node.defaultValue = newValue;
|
10023 | }
|
10024 | }
|
10025 | if (props.defaultValue != null) {
|
10026 | node.defaultValue = props.defaultValue;
|
10027 | }
|
10028 | },
|
10029 |
|
10030 | postMountWrapper: function (inst) {
|
10031 |
|
10032 |
|
10033 | var node = ReactDOMComponentTree.getNodeFromInstance(inst);
|
10034 |
|
10035 |
|
10036 | node.value = node.textContent;
|
10037 | }
|
10038 | };
|
10039 |
|
10040 | function _handleChange(event) {
|
10041 | var props = this._currentElement.props;
|
10042 | var returnValue = LinkedValueUtils.executeOnChange(props, event);
|
10043 | ReactUpdates.asap(forceUpdateIfMounted, this);
|
10044 | return returnValue;
|
10045 | }
|
10046 |
|
10047 | module.exports = ReactDOMTextarea;
|
10048 | },{"107":107,"14":14,"153":153,"178":178,"187":187,"188":188,"25":25,"46":46}],60:[function(_dereq_,module,exports){
|
10049 |
|
10050 |
|
10051 |
|
10052 |
|
10053 |
|
10054 |
|
10055 |
|
10056 |
|
10057 |
|
10058 |
|
10059 |
|
10060 | 'use strict';
|
10061 |
|
10062 | var _prodInvariant = _dereq_(153);
|
10063 |
|
10064 | var invariant = _dereq_(178);
|
10065 |
|
10066 |
|
10067 |
|
10068 |
|
10069 |
|
10070 | function getLowestCommonAncestor(instA, instB) {
|
10071 | !('_hostNode' in instA) ? "development" !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : _prodInvariant('33') : void 0;
|
10072 | !('_hostNode' in instB) ? "development" !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : _prodInvariant('33') : void 0;
|
10073 |
|
10074 | var depthA = 0;
|
10075 | for (var tempA = instA; tempA; tempA = tempA._hostParent) {
|
10076 | depthA++;
|
10077 | }
|
10078 | var depthB = 0;
|
10079 | for (var tempB = instB; tempB; tempB = tempB._hostParent) {
|
10080 | depthB++;
|
10081 | }
|
10082 |
|
10083 |
|
10084 | while (depthA - depthB > 0) {
|
10085 | instA = instA._hostParent;
|
10086 | depthA--;
|
10087 | }
|
10088 |
|
10089 |
|
10090 | while (depthB - depthA > 0) {
|
10091 | instB = instB._hostParent;
|
10092 | depthB--;
|
10093 | }
|
10094 |
|
10095 |
|
10096 | var depth = depthA;
|
10097 | while (depth--) {
|
10098 | if (instA === instB) {
|
10099 | return instA;
|
10100 | }
|
10101 | instA = instA._hostParent;
|
10102 | instB = instB._hostParent;
|
10103 | }
|
10104 | return null;
|
10105 | }
|
10106 |
|
10107 |
|
10108 |
|
10109 |
|
10110 | function isAncestor(instA, instB) {
|
10111 | !('_hostNode' in instA) ? "development" !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : _prodInvariant('35') : void 0;
|
10112 | !('_hostNode' in instB) ? "development" !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : _prodInvariant('35') : void 0;
|
10113 |
|
10114 | while (instB) {
|
10115 | if (instB === instA) {
|
10116 | return true;
|
10117 | }
|
10118 | instB = instB._hostParent;
|
10119 | }
|
10120 | return false;
|
10121 | }
|
10122 |
|
10123 |
|
10124 |
|
10125 |
|
10126 | function getParentInstance(inst) {
|
10127 | !('_hostNode' in inst) ? "development" !== 'production' ? invariant(false, 'getParentInstance: Invalid argument.') : _prodInvariant('36') : void 0;
|
10128 |
|
10129 | return inst._hostParent;
|
10130 | }
|
10131 |
|
10132 |
|
10133 |
|
10134 |
|
10135 | function traverseTwoPhase(inst, fn, arg) {
|
10136 | var path = [];
|
10137 | while (inst) {
|
10138 | path.push(inst);
|
10139 | inst = inst._hostParent;
|
10140 | }
|
10141 | var i;
|
10142 | for (i = path.length; i-- > 0;) {
|
10143 | fn(path[i], false, arg);
|
10144 | }
|
10145 | for (i = 0; i < path.length; i++) {
|
10146 | fn(path[i], true, arg);
|
10147 | }
|
10148 | }
|
10149 |
|
10150 |
|
10151 |
|
10152 |
|
10153 |
|
10154 |
|
10155 |
|
10156 |
|
10157 | function traverseEnterLeave(from, to, fn, argFrom, argTo) {
|
10158 | var common = from && to ? getLowestCommonAncestor(from, to) : null;
|
10159 | var pathFrom = [];
|
10160 | while (from && from !== common) {
|
10161 | pathFrom.push(from);
|
10162 | from = from._hostParent;
|
10163 | }
|
10164 | var pathTo = [];
|
10165 | while (to && to !== common) {
|
10166 | pathTo.push(to);
|
10167 | to = to._hostParent;
|
10168 | }
|
10169 | var i;
|
10170 | for (i = 0; i < pathFrom.length; i++) {
|
10171 | fn(pathFrom[i], true, argFrom);
|
10172 | }
|
10173 | for (i = pathTo.length; i-- > 0;) {
|
10174 | fn(pathTo[i], false, argTo);
|
10175 | }
|
10176 | }
|
10177 |
|
10178 | module.exports = {
|
10179 | isAncestor: isAncestor,
|
10180 | getLowestCommonAncestor: getLowestCommonAncestor,
|
10181 | getParentInstance: getParentInstance,
|
10182 | traverseTwoPhase: traverseTwoPhase,
|
10183 | traverseEnterLeave: traverseEnterLeave
|
10184 | };
|
10185 | },{"153":153,"178":178}],61:[function(_dereq_,module,exports){
|
10186 |
|
10187 |
|
10188 |
|
10189 |
|
10190 |
|
10191 |
|
10192 |
|
10193 |
|
10194 |
|
10195 |
|
10196 |
|
10197 | 'use strict';
|
10198 |
|
10199 | var DOMProperty = _dereq_(10);
|
10200 | var EventPluginRegistry = _dereq_(18);
|
10201 | var ReactComponentTreeHook = _dereq_(38);
|
10202 |
|
10203 | var warning = _dereq_(187);
|
10204 |
|
10205 | if ("development" !== 'production') {
|
10206 | var reactProps = {
|
10207 | children: true,
|
10208 | dangerouslySetInnerHTML: true,
|
10209 | key: true,
|
10210 | ref: true,
|
10211 |
|
10212 | autoFocus: true,
|
10213 | defaultValue: true,
|
10214 | valueLink: true,
|
10215 | defaultChecked: true,
|
10216 | checkedLink: true,
|
10217 | innerHTML: true,
|
10218 | suppressContentEditableWarning: true,
|
10219 | onFocusIn: true,
|
10220 | onFocusOut: true
|
10221 | };
|
10222 | var warnedProperties = {};
|
10223 |
|
10224 | var validateProperty = function (tagName, name, debugID) {
|
10225 | if (DOMProperty.properties.hasOwnProperty(name) || DOMProperty.isCustomAttribute(name)) {
|
10226 | return true;
|
10227 | }
|
10228 | if (reactProps.hasOwnProperty(name) && reactProps[name] || warnedProperties.hasOwnProperty(name) && warnedProperties[name]) {
|
10229 | return true;
|
10230 | }
|
10231 | if (EventPluginRegistry.registrationNameModules.hasOwnProperty(name)) {
|
10232 | return true;
|
10233 | }
|
10234 | warnedProperties[name] = true;
|
10235 | var lowerCasedName = name.toLowerCase();
|
10236 |
|
10237 |
|
10238 | var standardName = DOMProperty.isCustomAttribute(lowerCasedName) ? lowerCasedName : DOMProperty.getPossibleStandardName.hasOwnProperty(lowerCasedName) ? DOMProperty.getPossibleStandardName[lowerCasedName] : null;
|
10239 |
|
10240 | var registrationName = EventPluginRegistry.possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? EventPluginRegistry.possibleRegistrationNames[lowerCasedName] : null;
|
10241 |
|
10242 | if (standardName != null) {
|
10243 | "development" !== 'production' ? warning(false, 'Unknown DOM property %s. Did you mean %s?%s', name, standardName, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
|
10244 | return true;
|
10245 | } else if (registrationName != null) {
|
10246 | "development" !== 'production' ? warning(false, 'Unknown event handler property %s. Did you mean `%s`?%s', name, registrationName, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
|
10247 | return true;
|
10248 | } else {
|
10249 |
|
10250 |
|
10251 |
|
10252 |
|
10253 | return false;
|
10254 | }
|
10255 | };
|
10256 | }
|
10257 |
|
10258 | var warnUnknownProperties = function (debugID, element) {
|
10259 | var unknownProps = [];
|
10260 | for (var key in element.props) {
|
10261 | var isValid = validateProperty(element.type, key, debugID);
|
10262 | if (!isValid) {
|
10263 | unknownProps.push(key);
|
10264 | }
|
10265 | }
|
10266 |
|
10267 | var unknownPropString = unknownProps.map(function (prop) {
|
10268 | return '`' + prop + '`';
|
10269 | }).join(', ');
|
10270 |
|
10271 | if (unknownProps.length === 1) {
|
10272 | "development" !== 'production' ? warning(false, 'Unknown prop %s on <%s> tag. Remove this prop from the element. ' + 'For details, see https://fb.me/react-unknown-prop%s', unknownPropString, element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
|
10273 | } else if (unknownProps.length > 1) {
|
10274 | "development" !== 'production' ? warning(false, 'Unknown props %s on <%s> tag. Remove these props from the element. ' + 'For details, see https://fb.me/react-unknown-prop%s', unknownPropString, element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
|
10275 | }
|
10276 | };
|
10277 |
|
10278 | function handleElement(debugID, element) {
|
10279 | if (element == null || typeof element.type !== 'string') {
|
10280 | return;
|
10281 | }
|
10282 | if (element.type.indexOf('-') >= 0 || element.props.is) {
|
10283 | return;
|
10284 | }
|
10285 | warnUnknownProperties(debugID, element);
|
10286 | }
|
10287 |
|
10288 | var ReactDOMUnknownPropertyHook = {
|
10289 | onBeforeMountComponent: function (debugID, element) {
|
10290 | handleElement(debugID, element);
|
10291 | },
|
10292 | onBeforeUpdateComponent: function (debugID, element) {
|
10293 | handleElement(debugID, element);
|
10294 | }
|
10295 | };
|
10296 |
|
10297 | module.exports = ReactDOMUnknownPropertyHook;
|
10298 | },{"10":10,"18":18,"187":187,"38":38}],62:[function(_dereq_,module,exports){
|
10299 |
|
10300 |
|
10301 |
|
10302 |
|
10303 |
|
10304 |
|
10305 |
|
10306 |
|
10307 |
|
10308 |
|
10309 |
|
10310 | 'use strict';
|
10311 |
|
10312 | var ReactInvalidSetStateWarningHook = _dereq_(79);
|
10313 | var ReactHostOperationHistoryHook = _dereq_(74);
|
10314 | var ReactComponentTreeHook = _dereq_(38);
|
10315 | var ReactChildrenMutationWarningHook = _dereq_(33);
|
10316 | var ExecutionEnvironment = _dereq_(164);
|
10317 |
|
10318 | var performanceNow = _dereq_(185);
|
10319 | var warning = _dereq_(187);
|
10320 |
|
10321 | var hooks = [];
|
10322 | var didHookThrowForEvent = {};
|
10323 |
|
10324 | function callHook(event, fn, context, arg1, arg2, arg3, arg4, arg5) {
|
10325 | try {
|
10326 | fn.call(context, arg1, arg2, arg3, arg4, arg5);
|
10327 | } catch (e) {
|
10328 | "development" !== 'production' ? warning(didHookThrowForEvent[event], 'Exception thrown by hook while handling %s: %s', event, e + '\n' + e.stack) : void 0;
|
10329 | didHookThrowForEvent[event] = true;
|
10330 | }
|
10331 | }
|
10332 |
|
10333 | function emitEvent(event, arg1, arg2, arg3, arg4, arg5) {
|
10334 | for (var i = 0; i < hooks.length; i++) {
|
10335 | var hook = hooks[i];
|
10336 | var fn = hook[event];
|
10337 | if (fn) {
|
10338 | callHook(event, fn, hook, arg1, arg2, arg3, arg4, arg5);
|
10339 | }
|
10340 | }
|
10341 | }
|
10342 |
|
10343 | var isProfiling = false;
|
10344 | var flushHistory = [];
|
10345 | var lifeCycleTimerStack = [];
|
10346 | var currentFlushNesting = 0;
|
10347 | var currentFlushMeasurements = null;
|
10348 | var currentFlushStartTime = null;
|
10349 | var currentTimerDebugID = null;
|
10350 | var currentTimerStartTime = null;
|
10351 | var currentTimerNestedFlushDuration = null;
|
10352 | var currentTimerType = null;
|
10353 |
|
10354 | var lifeCycleTimerHasWarned = false;
|
10355 |
|
10356 | function clearHistory() {
|
10357 | ReactComponentTreeHook.purgeUnmountedComponents();
|
10358 | ReactHostOperationHistoryHook.clearHistory();
|
10359 | }
|
10360 |
|
10361 | function getTreeSnapshot(registeredIDs) {
|
10362 | return registeredIDs.reduce(function (tree, id) {
|
10363 | var ownerID = ReactComponentTreeHook.getOwnerID(id);
|
10364 | var parentID = ReactComponentTreeHook.getParentID(id);
|
10365 | tree[id] = {
|
10366 | displayName: ReactComponentTreeHook.getDisplayName(id),
|
10367 | text: ReactComponentTreeHook.getText(id),
|
10368 | updateCount: ReactComponentTreeHook.getUpdateCount(id),
|
10369 | childIDs: ReactComponentTreeHook.getChildIDs(id),
|
10370 |
|
10371 | ownerID: ownerID || ReactComponentTreeHook.getOwnerID(parentID),
|
10372 | parentID: parentID
|
10373 | };
|
10374 | return tree;
|
10375 | }, {});
|
10376 | }
|
10377 |
|
10378 | function resetMeasurements() {
|
10379 | var previousStartTime = currentFlushStartTime;
|
10380 | var previousMeasurements = currentFlushMeasurements || [];
|
10381 | var previousOperations = ReactHostOperationHistoryHook.getHistory();
|
10382 |
|
10383 | if (currentFlushNesting === 0) {
|
10384 | currentFlushStartTime = null;
|
10385 | currentFlushMeasurements = null;
|
10386 | clearHistory();
|
10387 | return;
|
10388 | }
|
10389 |
|
10390 | if (previousMeasurements.length || previousOperations.length) {
|
10391 | var registeredIDs = ReactComponentTreeHook.getRegisteredIDs();
|
10392 | flushHistory.push({
|
10393 | duration: performanceNow() - previousStartTime,
|
10394 | measurements: previousMeasurements || [],
|
10395 | operations: previousOperations || [],
|
10396 | treeSnapshot: getTreeSnapshot(registeredIDs)
|
10397 | });
|
10398 | }
|
10399 |
|
10400 | clearHistory();
|
10401 | currentFlushStartTime = performanceNow();
|
10402 | currentFlushMeasurements = [];
|
10403 | }
|
10404 |
|
10405 | function checkDebugID(debugID) {
|
10406 | var allowRoot = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1];
|
10407 |
|
10408 | if (allowRoot && debugID === 0) {
|
10409 | return;
|
10410 | }
|
10411 | if (!debugID) {
|
10412 | "development" !== 'production' ? warning(false, 'ReactDebugTool: debugID may not be empty.') : void 0;
|
10413 | }
|
10414 | }
|
10415 |
|
10416 | function beginLifeCycleTimer(debugID, timerType) {
|
10417 | if (currentFlushNesting === 0) {
|
10418 | return;
|
10419 | }
|
10420 | if (currentTimerType && !lifeCycleTimerHasWarned) {
|
10421 | "development" !== 'production' ? warning(false, 'There is an internal error in the React performance measurement code. ' + 'Did not expect %s timer to start while %s timer is still in ' + 'progress for %s instance.', timerType, currentTimerType || 'no', debugID === currentTimerDebugID ? 'the same' : 'another') : void 0;
|
10422 | lifeCycleTimerHasWarned = true;
|
10423 | }
|
10424 | currentTimerStartTime = performanceNow();
|
10425 | currentTimerNestedFlushDuration = 0;
|
10426 | currentTimerDebugID = debugID;
|
10427 | currentTimerType = timerType;
|
10428 | }
|
10429 |
|
10430 | function endLifeCycleTimer(debugID, timerType) {
|
10431 | if (currentFlushNesting === 0) {
|
10432 | return;
|
10433 | }
|
10434 | if (currentTimerType !== timerType && !lifeCycleTimerHasWarned) {
|
10435 | "development" !== 'production' ? warning(false, 'There is an internal error in the React performance measurement code. ' + 'We did not expect %s timer to stop while %s timer is still in ' + 'progress for %s instance. Please report this as a bug in React.', timerType, currentTimerType || 'no', debugID === currentTimerDebugID ? 'the same' : 'another') : void 0;
|
10436 | lifeCycleTimerHasWarned = true;
|
10437 | }
|
10438 | if (isProfiling) {
|
10439 | currentFlushMeasurements.push({
|
10440 | timerType: timerType,
|
10441 | instanceID: debugID,
|
10442 | duration: performanceNow() - currentTimerStartTime - currentTimerNestedFlushDuration
|
10443 | });
|
10444 | }
|
10445 | currentTimerStartTime = null;
|
10446 | currentTimerNestedFlushDuration = null;
|
10447 | currentTimerDebugID = null;
|
10448 | currentTimerType = null;
|
10449 | }
|
10450 |
|
10451 | function pauseCurrentLifeCycleTimer() {
|
10452 | var currentTimer = {
|
10453 | startTime: currentTimerStartTime,
|
10454 | nestedFlushStartTime: performanceNow(),
|
10455 | debugID: currentTimerDebugID,
|
10456 | timerType: currentTimerType
|
10457 | };
|
10458 | lifeCycleTimerStack.push(currentTimer);
|
10459 | currentTimerStartTime = null;
|
10460 | currentTimerNestedFlushDuration = null;
|
10461 | currentTimerDebugID = null;
|
10462 | currentTimerType = null;
|
10463 | }
|
10464 |
|
10465 | function resumeCurrentLifeCycleTimer() {
|
10466 | var _lifeCycleTimerStack$ = lifeCycleTimerStack.pop();
|
10467 |
|
10468 | var startTime = _lifeCycleTimerStack$.startTime;
|
10469 | var nestedFlushStartTime = _lifeCycleTimerStack$.nestedFlushStartTime;
|
10470 | var debugID = _lifeCycleTimerStack$.debugID;
|
10471 | var timerType = _lifeCycleTimerStack$.timerType;
|
10472 |
|
10473 | var nestedFlushDuration = performanceNow() - nestedFlushStartTime;
|
10474 | currentTimerStartTime = startTime;
|
10475 | currentTimerNestedFlushDuration += nestedFlushDuration;
|
10476 | currentTimerDebugID = debugID;
|
10477 | currentTimerType = timerType;
|
10478 | }
|
10479 |
|
10480 | var ReactDebugTool = {
|
10481 | addHook: function (hook) {
|
10482 | hooks.push(hook);
|
10483 | },
|
10484 | removeHook: function (hook) {
|
10485 | for (var i = 0; i < hooks.length; i++) {
|
10486 | if (hooks[i] === hook) {
|
10487 | hooks.splice(i, 1);
|
10488 | i--;
|
10489 | }
|
10490 | }
|
10491 | },
|
10492 | isProfiling: function () {
|
10493 | return isProfiling;
|
10494 | },
|
10495 | beginProfiling: function () {
|
10496 | if (isProfiling) {
|
10497 | return;
|
10498 | }
|
10499 |
|
10500 | isProfiling = true;
|
10501 | flushHistory.length = 0;
|
10502 | resetMeasurements();
|
10503 | ReactDebugTool.addHook(ReactHostOperationHistoryHook);
|
10504 | },
|
10505 | endProfiling: function () {
|
10506 | if (!isProfiling) {
|
10507 | return;
|
10508 | }
|
10509 |
|
10510 | isProfiling = false;
|
10511 | resetMeasurements();
|
10512 | ReactDebugTool.removeHook(ReactHostOperationHistoryHook);
|
10513 | },
|
10514 | getFlushHistory: function () {
|
10515 | return flushHistory;
|
10516 | },
|
10517 | onBeginFlush: function () {
|
10518 | currentFlushNesting++;
|
10519 | resetMeasurements();
|
10520 | pauseCurrentLifeCycleTimer();
|
10521 | emitEvent('onBeginFlush');
|
10522 | },
|
10523 | onEndFlush: function () {
|
10524 | resetMeasurements();
|
10525 | currentFlushNesting--;
|
10526 | resumeCurrentLifeCycleTimer();
|
10527 | emitEvent('onEndFlush');
|
10528 | },
|
10529 | onBeginLifeCycleTimer: function (debugID, timerType) {
|
10530 | checkDebugID(debugID);
|
10531 | emitEvent('onBeginLifeCycleTimer', debugID, timerType);
|
10532 | beginLifeCycleTimer(debugID, timerType);
|
10533 | },
|
10534 | onEndLifeCycleTimer: function (debugID, timerType) {
|
10535 | checkDebugID(debugID);
|
10536 | endLifeCycleTimer(debugID, timerType);
|
10537 | emitEvent('onEndLifeCycleTimer', debugID, timerType);
|
10538 | },
|
10539 | onBeginProcessingChildContext: function () {
|
10540 | emitEvent('onBeginProcessingChildContext');
|
10541 | },
|
10542 | onEndProcessingChildContext: function () {
|
10543 | emitEvent('onEndProcessingChildContext');
|
10544 | },
|
10545 | onHostOperation: function (debugID, type, payload) {
|
10546 | checkDebugID(debugID);
|
10547 | emitEvent('onHostOperation', debugID, type, payload);
|
10548 | },
|
10549 | onSetState: function () {
|
10550 | emitEvent('onSetState');
|
10551 | },
|
10552 | onSetChildren: function (debugID, childDebugIDs) {
|
10553 | checkDebugID(debugID);
|
10554 | childDebugIDs.forEach(checkDebugID);
|
10555 | emitEvent('onSetChildren', debugID, childDebugIDs);
|
10556 | },
|
10557 | onBeforeMountComponent: function (debugID, element, parentDebugID) {
|
10558 | checkDebugID(debugID);
|
10559 | checkDebugID(parentDebugID, true);
|
10560 | emitEvent('onBeforeMountComponent', debugID, element, parentDebugID);
|
10561 | },
|
10562 | onMountComponent: function (debugID) {
|
10563 | checkDebugID(debugID);
|
10564 | emitEvent('onMountComponent', debugID);
|
10565 | },
|
10566 | onBeforeUpdateComponent: function (debugID, element) {
|
10567 | checkDebugID(debugID);
|
10568 | emitEvent('onBeforeUpdateComponent', debugID, element);
|
10569 | },
|
10570 | onUpdateComponent: function (debugID) {
|
10571 | checkDebugID(debugID);
|
10572 | emitEvent('onUpdateComponent', debugID);
|
10573 | },
|
10574 | onBeforeUnmountComponent: function (debugID) {
|
10575 | checkDebugID(debugID);
|
10576 | emitEvent('onBeforeUnmountComponent', debugID);
|
10577 | },
|
10578 | onUnmountComponent: function (debugID) {
|
10579 | checkDebugID(debugID);
|
10580 | emitEvent('onUnmountComponent', debugID);
|
10581 | },
|
10582 | onTestEvent: function () {
|
10583 | emitEvent('onTestEvent');
|
10584 | }
|
10585 | };
|
10586 |
|
10587 |
|
10588 | ReactDebugTool.addDevtool = ReactDebugTool.addHook;
|
10589 | ReactDebugTool.removeDevtool = ReactDebugTool.removeHook;
|
10590 |
|
10591 | ReactDebugTool.addHook(ReactInvalidSetStateWarningHook);
|
10592 | ReactDebugTool.addHook(ReactComponentTreeHook);
|
10593 | ReactDebugTool.addHook(ReactChildrenMutationWarningHook);
|
10594 | var url = ExecutionEnvironment.canUseDOM && window.location.href || '';
|
10595 | if (/[?&]react_perf\b/.test(url)) {
|
10596 | ReactDebugTool.beginProfiling();
|
10597 | }
|
10598 |
|
10599 | module.exports = ReactDebugTool;
|
10600 | },{"164":164,"185":185,"187":187,"33":33,"38":38,"74":74,"79":79}],63:[function(_dereq_,module,exports){
|
10601 |
|
10602 |
|
10603 |
|
10604 |
|
10605 |
|
10606 |
|
10607 |
|
10608 |
|
10609 |
|
10610 |
|
10611 |
|
10612 | 'use strict';
|
10613 |
|
10614 | var _assign = _dereq_(188);
|
10615 |
|
10616 | var ReactUpdates = _dereq_(107);
|
10617 | var Transaction = _dereq_(127);
|
10618 |
|
10619 | var emptyFunction = _dereq_(170);
|
10620 |
|
10621 | var RESET_BATCHED_UPDATES = {
|
10622 | initialize: emptyFunction,
|
10623 | close: function () {
|
10624 | ReactDefaultBatchingStrategy.isBatchingUpdates = false;
|
10625 | }
|
10626 | };
|
10627 |
|
10628 | var FLUSH_BATCHED_UPDATES = {
|
10629 | initialize: emptyFunction,
|
10630 | close: ReactUpdates.flushBatchedUpdates.bind(ReactUpdates)
|
10631 | };
|
10632 |
|
10633 | var TRANSACTION_WRAPPERS = [FLUSH_BATCHED_UPDATES, RESET_BATCHED_UPDATES];
|
10634 |
|
10635 | function ReactDefaultBatchingStrategyTransaction() {
|
10636 | this.reinitializeTransaction();
|
10637 | }
|
10638 |
|
10639 | _assign(ReactDefaultBatchingStrategyTransaction.prototype, Transaction.Mixin, {
|
10640 | getTransactionWrappers: function () {
|
10641 | return TRANSACTION_WRAPPERS;
|
10642 | }
|
10643 | });
|
10644 |
|
10645 | var transaction = new ReactDefaultBatchingStrategyTransaction();
|
10646 |
|
10647 | var ReactDefaultBatchingStrategy = {
|
10648 | isBatchingUpdates: false,
|
10649 |
|
10650 | |
10651 |
|
10652 |
|
10653 |
|
10654 | batchedUpdates: function (callback, a, b, c, d, e) {
|
10655 | var alreadyBatchingUpdates = ReactDefaultBatchingStrategy.isBatchingUpdates;
|
10656 |
|
10657 | ReactDefaultBatchingStrategy.isBatchingUpdates = true;
|
10658 |
|
10659 |
|
10660 | if (alreadyBatchingUpdates) {
|
10661 | callback(a, b, c, d, e);
|
10662 | } else {
|
10663 | transaction.perform(callback, null, a, b, c, d, e);
|
10664 | }
|
10665 | }
|
10666 | };
|
10667 |
|
10668 | module.exports = ReactDefaultBatchingStrategy;
|
10669 | },{"107":107,"127":127,"170":170,"188":188}],64:[function(_dereq_,module,exports){
|
10670 |
|
10671 |
|
10672 |
|
10673 |
|
10674 |
|
10675 |
|
10676 |
|
10677 |
|
10678 |
|
10679 |
|
10680 |
|
10681 | 'use strict';
|
10682 |
|
10683 | var BeforeInputEventPlugin = _dereq_(2);
|
10684 | var ChangeEventPlugin = _dereq_(6);
|
10685 | var DefaultEventPluginOrder = _dereq_(13);
|
10686 | var EnterLeaveEventPlugin = _dereq_(15);
|
10687 | var HTMLDOMPropertyConfig = _dereq_(22);
|
10688 | var ReactComponentBrowserEnvironment = _dereq_(36);
|
10689 | var ReactDOMComponent = _dereq_(44);
|
10690 | var ReactDOMComponentTree = _dereq_(46);
|
10691 | var ReactDOMEmptyComponent = _dereq_(48);
|
10692 | var ReactDOMTreeTraversal = _dereq_(60);
|
10693 | var ReactDOMTextComponent = _dereq_(58);
|
10694 | var ReactDefaultBatchingStrategy = _dereq_(63);
|
10695 | var ReactEventListener = _dereq_(70);
|
10696 | var ReactInjection = _dereq_(75);
|
10697 | var ReactReconcileTransaction = _dereq_(94);
|
10698 | var SVGDOMPropertyConfig = _dereq_(111);
|
10699 | var SelectEventPlugin = _dereq_(112);
|
10700 | var SimpleEventPlugin = _dereq_(113);
|
10701 |
|
10702 | var alreadyInjected = false;
|
10703 |
|
10704 | function inject() {
|
10705 | if (alreadyInjected) {
|
10706 |
|
10707 |
|
10708 |
|
10709 | return;
|
10710 | }
|
10711 | alreadyInjected = true;
|
10712 |
|
10713 | ReactInjection.EventEmitter.injectReactEventListener(ReactEventListener);
|
10714 |
|
10715 | |
10716 |
|
10717 |
|
10718 | ReactInjection.EventPluginHub.injectEventPluginOrder(DefaultEventPluginOrder);
|
10719 | ReactInjection.EventPluginUtils.injectComponentTree(ReactDOMComponentTree);
|
10720 | ReactInjection.EventPluginUtils.injectTreeTraversal(ReactDOMTreeTraversal);
|
10721 |
|
10722 | |
10723 |
|
10724 |
|
10725 |
|
10726 | ReactInjection.EventPluginHub.injectEventPluginsByName({
|
10727 | SimpleEventPlugin: SimpleEventPlugin,
|
10728 | EnterLeaveEventPlugin: EnterLeaveEventPlugin,
|
10729 | ChangeEventPlugin: ChangeEventPlugin,
|
10730 | SelectEventPlugin: SelectEventPlugin,
|
10731 | BeforeInputEventPlugin: BeforeInputEventPlugin
|
10732 | });
|
10733 |
|
10734 | ReactInjection.HostComponent.injectGenericComponentClass(ReactDOMComponent);
|
10735 |
|
10736 | ReactInjection.HostComponent.injectTextComponentClass(ReactDOMTextComponent);
|
10737 |
|
10738 | ReactInjection.DOMProperty.injectDOMPropertyConfig(HTMLDOMPropertyConfig);
|
10739 | ReactInjection.DOMProperty.injectDOMPropertyConfig(SVGDOMPropertyConfig);
|
10740 |
|
10741 | ReactInjection.EmptyComponent.injectEmptyComponentFactory(function (instantiate) {
|
10742 | return new ReactDOMEmptyComponent(instantiate);
|
10743 | });
|
10744 |
|
10745 | ReactInjection.Updates.injectReconcileTransaction(ReactReconcileTransaction);
|
10746 | ReactInjection.Updates.injectBatchingStrategy(ReactDefaultBatchingStrategy);
|
10747 |
|
10748 | ReactInjection.Component.injectEnvironment(ReactComponentBrowserEnvironment);
|
10749 | }
|
10750 |
|
10751 | module.exports = {
|
10752 | inject: inject
|
10753 | };
|
10754 | },{"111":111,"112":112,"113":113,"13":13,"15":15,"2":2,"22":22,"36":36,"44":44,"46":46,"48":48,"58":58,"6":6,"60":60,"63":63,"70":70,"75":75,"94":94}],65:[function(_dereq_,module,exports){
|
10755 |
|
10756 |
|
10757 |
|
10758 |
|
10759 |
|
10760 |
|
10761 |
|
10762 |
|
10763 |
|
10764 |
|
10765 |
|
10766 | 'use strict';
|
10767 |
|
10768 | var _assign = _dereq_(188);
|
10769 |
|
10770 | var ReactCurrentOwner = _dereq_(41);
|
10771 |
|
10772 | var warning = _dereq_(187);
|
10773 | var canDefineProperty = _dereq_(131);
|
10774 | var hasOwnProperty = Object.prototype.hasOwnProperty;
|
10775 |
|
10776 |
|
10777 |
|
10778 | var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;
|
10779 |
|
10780 | var RESERVED_PROPS = {
|
10781 | key: true,
|
10782 | ref: true,
|
10783 | __self: true,
|
10784 | __source: true
|
10785 | };
|
10786 |
|
10787 | var specialPropKeyWarningShown, specialPropRefWarningShown;
|
10788 |
|
10789 | function hasValidRef(config) {
|
10790 | if ("development" !== 'production') {
|
10791 | if (hasOwnProperty.call(config, 'ref')) {
|
10792 | var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
|
10793 | if (getter && getter.isReactWarning) {
|
10794 | return false;
|
10795 | }
|
10796 | }
|
10797 | }
|
10798 | return config.ref !== undefined;
|
10799 | }
|
10800 |
|
10801 | function hasValidKey(config) {
|
10802 | if ("development" !== 'production') {
|
10803 | if (hasOwnProperty.call(config, 'key')) {
|
10804 | var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
|
10805 | if (getter && getter.isReactWarning) {
|
10806 | return false;
|
10807 | }
|
10808 | }
|
10809 | }
|
10810 | return config.key !== undefined;
|
10811 | }
|
10812 |
|
10813 | function defineKeyPropWarningGetter(props, displayName) {
|
10814 | var warnAboutAccessingKey = function () {
|
10815 | if (!specialPropKeyWarningShown) {
|
10816 | specialPropKeyWarningShown = true;
|
10817 | "development" !== 'production' ? warning(false, '%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName) : void 0;
|
10818 | }
|
10819 | };
|
10820 | warnAboutAccessingKey.isReactWarning = true;
|
10821 | Object.defineProperty(props, 'key', {
|
10822 | get: warnAboutAccessingKey,
|
10823 | configurable: true
|
10824 | });
|
10825 | }
|
10826 |
|
10827 | function defineRefPropWarningGetter(props, displayName) {
|
10828 | var warnAboutAccessingRef = function () {
|
10829 | if (!specialPropRefWarningShown) {
|
10830 | specialPropRefWarningShown = true;
|
10831 | "development" !== 'production' ? warning(false, '%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName) : void 0;
|
10832 | }
|
10833 | };
|
10834 | warnAboutAccessingRef.isReactWarning = true;
|
10835 | Object.defineProperty(props, 'ref', {
|
10836 | get: warnAboutAccessingRef,
|
10837 | configurable: true
|
10838 | });
|
10839 | }
|
10840 |
|
10841 | /**
|
10842 | * Factory method to create a new React element. This no longer adheres to
|
10843 | * the class pattern, so do not use new to call it. Also, no instanceof check
|
10844 | * will work. Instead test $$typeof field against Symbol.for('react.element') to check
|
10845 | * if something is a React Element.
|
10846 | *
|
10847 | * @param {*} type
|
10848 | * @param {*} key
|
10849 | * @param {string|object} ref
|
10850 | * @param {*} self A *temporary* helper to detect places where `this` is
|
10851 | * different from the `owner` when React.createElement is called, so that we
|
10852 | * can warn. We want to get rid of owner and replace string `ref`s with arrow
|
10853 | * functions, and as long as `this` and owner are the same, there will be no
|
10854 | * change in behavior.
|
10855 | * @param {*} source An annotation object (added by a transpiler or otherwise)
|
10856 | * indicating filename, line number, and/or other information.
|
10857 | * @param {*} owner
|
10858 | * @param {*} props
|
10859 | * @internal
|
10860 | */
|
10861 | var ReactElement = function (type, key, ref, self, source, owner, props) {
|
10862 | var element = {
|
10863 |
|
10864 | $$typeof: REACT_ELEMENT_TYPE,
|
10865 |
|
10866 |
|
10867 | type: type,
|
10868 | key: key,
|
10869 | ref: ref,
|
10870 | props: props,
|
10871 |
|
10872 |
|
10873 | _owner: owner
|
10874 | };
|
10875 |
|
10876 | if ("development" !== 'production') {
|
10877 |
|
10878 |
|
10879 |
|
10880 |
|
10881 | element._store = {};
|
10882 | var shadowChildren = Array.isArray(props.children) ? props.children.slice(0) : props.children;
|
10883 |
|
10884 |
|
10885 |
|
10886 |
|
10887 |
|
10888 | if (canDefineProperty) {
|
10889 | Object.defineProperty(element._store, 'validated', {
|
10890 | configurable: false,
|
10891 | enumerable: false,
|
10892 | writable: true,
|
10893 | value: false
|
10894 | });
|
10895 |
|
10896 | Object.defineProperty(element, '_self', {
|
10897 | configurable: false,
|
10898 | enumerable: false,
|
10899 | writable: false,
|
10900 | value: self
|
10901 | });
|
10902 | Object.defineProperty(element, '_shadowChildren', {
|
10903 | configurable: false,
|
10904 | enumerable: false,
|
10905 | writable: false,
|
10906 | value: shadowChildren
|
10907 | });
|
10908 |
|
10909 |
|
10910 | Object.defineProperty(element, '_source', {
|
10911 | configurable: false,
|
10912 | enumerable: false,
|
10913 | writable: false,
|
10914 | value: source
|
10915 | });
|
10916 | } else {
|
10917 | element._store.validated = false;
|
10918 | element._self = self;
|
10919 | element._shadowChildren = shadowChildren;
|
10920 | element._source = source;
|
10921 | }
|
10922 | if (Object.freeze) {
|
10923 | Object.freeze(element.props);
|
10924 | Object.freeze(element);
|
10925 | }
|
10926 | }
|
10927 |
|
10928 | return element;
|
10929 | };
|
10930 |
|
10931 |
|
10932 |
|
10933 |
|
10934 |
|
10935 | ReactElement.createElement = function (type, config, children) {
|
10936 | var propName;
|
10937 |
|
10938 |
|
10939 | var props = {};
|
10940 |
|
10941 | var key = null;
|
10942 | var ref = null;
|
10943 | var self = null;
|
10944 | var source = null;
|
10945 |
|
10946 | if (config != null) {
|
10947 | if (hasValidRef(config)) {
|
10948 | ref = config.ref;
|
10949 | }
|
10950 | if (hasValidKey(config)) {
|
10951 | key = '' + config.key;
|
10952 | }
|
10953 |
|
10954 | self = config.__self === undefined ? null : config.__self;
|
10955 | source = config.__source === undefined ? null : config.__source;
|
10956 |
|
10957 | for (propName in config) {
|
10958 | if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
10959 | props[propName] = config[propName];
|
10960 | }
|
10961 | }
|
10962 | }
|
10963 |
|
10964 |
|
10965 |
|
10966 | var childrenLength = arguments.length - 2;
|
10967 | if (childrenLength === 1) {
|
10968 | props.children = children;
|
10969 | } else if (childrenLength > 1) {
|
10970 | var childArray = Array(childrenLength);
|
10971 | for (var i = 0; i < childrenLength; i++) {
|
10972 | childArray[i] = arguments[i + 2];
|
10973 | }
|
10974 | props.children = childArray;
|
10975 | }
|
10976 |
|
10977 |
|
10978 | if (type && type.defaultProps) {
|
10979 | var defaultProps = type.defaultProps;
|
10980 | for (propName in defaultProps) {
|
10981 | if (props[propName] === undefined) {
|
10982 | props[propName] = defaultProps[propName];
|
10983 | }
|
10984 | }
|
10985 | }
|
10986 | if ("development" !== 'production') {
|
10987 | if (key || ref) {
|
10988 | if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {
|
10989 | var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
|
10990 | if (key) {
|
10991 | defineKeyPropWarningGetter(props, displayName);
|
10992 | }
|
10993 | if (ref) {
|
10994 | defineRefPropWarningGetter(props, displayName);
|
10995 | }
|
10996 | }
|
10997 | }
|
10998 | }
|
10999 | return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
11000 | };
|
11001 |
|
11002 |
|
11003 |
|
11004 |
|
11005 |
|
11006 | ReactElement.createFactory = function (type) {
|
11007 | var factory = ReactElement.createElement.bind(null, type);
|
11008 |
|
11009 |
|
11010 |
|
11011 |
|
11012 |
|
11013 | factory.type = type;
|
11014 | return factory;
|
11015 | };
|
11016 |
|
11017 | ReactElement.cloneAndReplaceKey = function (oldElement, newKey) {
|
11018 | var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
|
11019 |
|
11020 | return newElement;
|
11021 | };
|
11022 |
|
11023 |
|
11024 |
|
11025 |
|
11026 |
|
11027 | ReactElement.cloneElement = function (element, config, children) {
|
11028 | var propName;
|
11029 |
|
11030 |
|
11031 | var props = _assign({}, element.props);
|
11032 |
|
11033 |
|
11034 | var key = element.key;
|
11035 | var ref = element.ref;
|
11036 |
|
11037 | var self = element._self;
|
11038 |
|
11039 |
|
11040 |
|
11041 | var source = element._source;
|
11042 |
|
11043 |
|
11044 | var owner = element._owner;
|
11045 |
|
11046 | if (config != null) {
|
11047 | if (hasValidRef(config)) {
|
11048 |
|
11049 | ref = config.ref;
|
11050 | owner = ReactCurrentOwner.current;
|
11051 | }
|
11052 | if (hasValidKey(config)) {
|
11053 | key = '' + config.key;
|
11054 | }
|
11055 |
|
11056 |
|
11057 | var defaultProps;
|
11058 | if (element.type && element.type.defaultProps) {
|
11059 | defaultProps = element.type.defaultProps;
|
11060 | }
|
11061 | for (propName in config) {
|
11062 | if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
11063 | if (config[propName] === undefined && defaultProps !== undefined) {
|
11064 |
|
11065 | props[propName] = defaultProps[propName];
|
11066 | } else {
|
11067 | props[propName] = config[propName];
|
11068 | }
|
11069 | }
|
11070 | }
|
11071 | }
|
11072 |
|
11073 |
|
11074 |
|
11075 | var childrenLength = arguments.length - 2;
|
11076 | if (childrenLength === 1) {
|
11077 | props.children = children;
|
11078 | } else if (childrenLength > 1) {
|
11079 | var childArray = Array(childrenLength);
|
11080 | for (var i = 0; i < childrenLength; i++) {
|
11081 | childArray[i] = arguments[i + 2];
|
11082 | }
|
11083 | props.children = childArray;
|
11084 | }
|
11085 |
|
11086 | return ReactElement(element.type, key, ref, self, source, owner, props);
|
11087 | };
|
11088 |
|
11089 |
|
11090 |
|
11091 |
|
11092 |
|
11093 |
|
11094 |
|
11095 |
|
11096 | ReactElement.isValidElement = function (object) {
|
11097 | return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
11098 | };
|
11099 |
|
11100 | ReactElement.REACT_ELEMENT_TYPE = REACT_ELEMENT_TYPE;
|
11101 |
|
11102 | module.exports = ReactElement;
|
11103 | },{"131":131,"187":187,"188":188,"41":41}],66:[function(_dereq_,module,exports){
|
11104 |
|
11105 |
|
11106 |
|
11107 |
|
11108 |
|
11109 |
|
11110 |
|
11111 |
|
11112 |
|
11113 |
|
11114 |
|
11115 |
|
11116 |
|
11117 |
|
11118 |
|
11119 |
|
11120 |
|
11121 |
|
11122 | 'use strict';
|
11123 |
|
11124 | var ReactCurrentOwner = _dereq_(41);
|
11125 | var ReactComponentTreeHook = _dereq_(38);
|
11126 | var ReactElement = _dereq_(65);
|
11127 | var ReactPropTypeLocations = _dereq_(90);
|
11128 |
|
11129 | var checkReactTypeSpec = _dereq_(132);
|
11130 |
|
11131 | var canDefineProperty = _dereq_(131);
|
11132 | var getIteratorFn = _dereq_(144);
|
11133 | var warning = _dereq_(187);
|
11134 |
|
11135 | function getDeclarationErrorAddendum() {
|
11136 | if (ReactCurrentOwner.current) {
|
11137 | var name = ReactCurrentOwner.current.getName();
|
11138 | if (name) {
|
11139 | return ' Check the render method of `' + name + '`.';
|
11140 | }
|
11141 | }
|
11142 | return '';
|
11143 | }
|
11144 |
|
11145 |
|
11146 |
|
11147 |
|
11148 |
|
11149 |
|
11150 | var ownerHasKeyUseWarning = {};
|
11151 |
|
11152 | function getCurrentComponentErrorInfo(parentType) {
|
11153 | var info = getDeclarationErrorAddendum();
|
11154 |
|
11155 | if (!info) {
|
11156 | var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
|
11157 | if (parentName) {
|
11158 | info = ' Check the top-level render call using <' + parentName + '>.';
|
11159 | }
|
11160 | }
|
11161 | return info;
|
11162 | }
|
11163 |
|
11164 |
|
11165 |
|
11166 |
|
11167 |
|
11168 |
|
11169 |
|
11170 |
|
11171 |
|
11172 |
|
11173 |
|
11174 |
|
11175 | function validateExplicitKey(element, parentType) {
|
11176 | if (!element._store || element._store.validated || element.key != null) {
|
11177 | return;
|
11178 | }
|
11179 | element._store.validated = true;
|
11180 |
|
11181 | var memoizer = ownerHasKeyUseWarning.uniqueKey || (ownerHasKeyUseWarning.uniqueKey = {});
|
11182 |
|
11183 | var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
11184 | if (memoizer[currentComponentErrorInfo]) {
|
11185 | return;
|
11186 | }
|
11187 | memoizer[currentComponentErrorInfo] = true;
|
11188 |
|
11189 |
|
11190 |
|
11191 |
|
11192 | var childOwner = '';
|
11193 | if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
|
11194 |
|
11195 | childOwner = ' It was passed a child from ' + element._owner.getName() + '.';
|
11196 | }
|
11197 |
|
11198 | "development" !== 'production' ? warning(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.%s', currentComponentErrorInfo, childOwner, ReactComponentTreeHook.getCurrentStackAddendum(element)) : void 0;
|
11199 | }
|
11200 |
|
11201 |
|
11202 |
|
11203 |
|
11204 |
|
11205 |
|
11206 |
|
11207 |
|
11208 |
|
11209 |
|
11210 | function validateChildKeys(node, parentType) {
|
11211 | if (typeof node !== 'object') {
|
11212 | return;
|
11213 | }
|
11214 | if (Array.isArray(node)) {
|
11215 | for (var i = 0; i < node.length; i++) {
|
11216 | var child = node[i];
|
11217 | if (ReactElement.isValidElement(child)) {
|
11218 | validateExplicitKey(child, parentType);
|
11219 | }
|
11220 | }
|
11221 | } else if (ReactElement.isValidElement(node)) {
|
11222 |
|
11223 | if (node._store) {
|
11224 | node._store.validated = true;
|
11225 | }
|
11226 | } else if (node) {
|
11227 | var iteratorFn = getIteratorFn(node);
|
11228 |
|
11229 | if (iteratorFn) {
|
11230 | if (iteratorFn !== node.entries) {
|
11231 | var iterator = iteratorFn.call(node);
|
11232 | var step;
|
11233 | while (!(step = iterator.next()).done) {
|
11234 | if (ReactElement.isValidElement(step.value)) {
|
11235 | validateExplicitKey(step.value, parentType);
|
11236 | }
|
11237 | }
|
11238 | }
|
11239 | }
|
11240 | }
|
11241 | }
|
11242 |
|
11243 |
|
11244 |
|
11245 |
|
11246 |
|
11247 |
|
11248 |
|
11249 | function validatePropTypes(element) {
|
11250 | var componentClass = element.type;
|
11251 | if (typeof componentClass !== 'function') {
|
11252 | return;
|
11253 | }
|
11254 | var name = componentClass.displayName || componentClass.name;
|
11255 | if (componentClass.propTypes) {
|
11256 | checkReactTypeSpec(componentClass.propTypes, element.props, ReactPropTypeLocations.prop, name, element, null);
|
11257 | }
|
11258 | if (typeof componentClass.getDefaultProps === 'function') {
|
11259 | "development" !== 'production' ? warning(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0;
|
11260 | }
|
11261 | }
|
11262 |
|
11263 | var ReactElementValidator = {
|
11264 |
|
11265 | createElement: function (type, props, children) {
|
11266 | var validType = typeof type === 'string' || typeof type === 'function';
|
11267 |
|
11268 |
|
11269 | if (!validType) {
|
11270 | "development" !== 'production' ? warning(false, '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;
|
11271 | }
|
11272 |
|
11273 | var element = ReactElement.createElement.apply(this, arguments);
|
11274 |
|
11275 |
|
11276 |
|
11277 | if (element == null) {
|
11278 | return element;
|
11279 | }
|
11280 |
|
11281 |
|
11282 |
|
11283 |
|
11284 |
|
11285 |
|
11286 | if (validType) {
|
11287 | for (var i = 2; i < arguments.length; i++) {
|
11288 | validateChildKeys(arguments[i], type);
|
11289 | }
|
11290 | }
|
11291 |
|
11292 | validatePropTypes(element);
|
11293 |
|
11294 | return element;
|
11295 | },
|
11296 |
|
11297 | createFactory: function (type) {
|
11298 | var validatedFactory = ReactElementValidator.createElement.bind(null, type);
|
11299 |
|
11300 | validatedFactory.type = type;
|
11301 |
|
11302 | if ("development" !== 'production') {
|
11303 | if (canDefineProperty) {
|
11304 | Object.defineProperty(validatedFactory, 'type', {
|
11305 | enumerable: false,
|
11306 | get: function () {
|
11307 | "development" !== 'production' ? warning(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.') : void 0;
|
11308 | Object.defineProperty(this, 'type', {
|
11309 | value: type
|
11310 | });
|
11311 | return type;
|
11312 | }
|
11313 | });
|
11314 | }
|
11315 | }
|
11316 |
|
11317 | return validatedFactory;
|
11318 | },
|
11319 |
|
11320 | cloneElement: function (element, props, children) {
|
11321 | var newElement = ReactElement.cloneElement.apply(this, arguments);
|
11322 | for (var i = 2; i < arguments.length; i++) {
|
11323 | validateChildKeys(arguments[i], newElement.type);
|
11324 | }
|
11325 | validatePropTypes(newElement);
|
11326 | return newElement;
|
11327 | }
|
11328 |
|
11329 | };
|
11330 |
|
11331 | module.exports = ReactElementValidator;
|
11332 | },{"131":131,"132":132,"144":144,"187":187,"38":38,"41":41,"65":65,"90":90}],67:[function(_dereq_,module,exports){
|
11333 |
|
11334 |
|
11335 |
|
11336 |
|
11337 |
|
11338 |
|
11339 |
|
11340 |
|
11341 |
|
11342 |
|
11343 |
|
11344 | 'use strict';
|
11345 |
|
11346 | var emptyComponentFactory;
|
11347 |
|
11348 | var ReactEmptyComponentInjection = {
|
11349 | injectEmptyComponentFactory: function (factory) {
|
11350 | emptyComponentFactory = factory;
|
11351 | }
|
11352 | };
|
11353 |
|
11354 | var ReactEmptyComponent = {
|
11355 | create: function (instantiate) {
|
11356 | return emptyComponentFactory(instantiate);
|
11357 | }
|
11358 | };
|
11359 |
|
11360 | ReactEmptyComponent.injection = ReactEmptyComponentInjection;
|
11361 |
|
11362 | module.exports = ReactEmptyComponent;
|
11363 | },{}],68:[function(_dereq_,module,exports){
|
11364 |
|
11365 |
|
11366 |
|
11367 |
|
11368 |
|
11369 |
|
11370 |
|
11371 |
|
11372 |
|
11373 |
|
11374 |
|
11375 | 'use strict';
|
11376 |
|
11377 | var caughtError = null;
|
11378 |
|
11379 |
|
11380 |
|
11381 |
|
11382 |
|
11383 |
|
11384 |
|
11385 |
|
11386 |
|
11387 | function invokeGuardedCallback(name, func, a, b) {
|
11388 | try {
|
11389 | return func(a, b);
|
11390 | } catch (x) {
|
11391 | if (caughtError === null) {
|
11392 | caughtError = x;
|
11393 | }
|
11394 | return undefined;
|
11395 | }
|
11396 | }
|
11397 |
|
11398 | var ReactErrorUtils = {
|
11399 | invokeGuardedCallback: invokeGuardedCallback,
|
11400 |
|
11401 | |
11402 |
|
11403 |
|
11404 |
|
11405 | invokeGuardedCallbackWithCatch: invokeGuardedCallback,
|
11406 |
|
11407 | |
11408 |
|
11409 |
|
11410 |
|
11411 | rethrowCaughtError: function () {
|
11412 | if (caughtError) {
|
11413 | var error = caughtError;
|
11414 | caughtError = null;
|
11415 | throw error;
|
11416 | }
|
11417 | }
|
11418 | };
|
11419 |
|
11420 | if ("development" !== 'production') {
|
11421 | |
11422 |
|
11423 |
|
11424 |
|
11425 | if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {
|
11426 | var fakeNode = document.createElement('react');
|
11427 | ReactErrorUtils.invokeGuardedCallback = function (name, func, a, b) {
|
11428 | var boundFunc = func.bind(null, a, b);
|
11429 | var evtType = 'react-' + name;
|
11430 | fakeNode.addEventListener(evtType, boundFunc, false);
|
11431 | var evt = document.createEvent('Event');
|
11432 | evt.initEvent(evtType, false, false);
|
11433 | fakeNode.dispatchEvent(evt);
|
11434 | fakeNode.removeEventListener(evtType, boundFunc, false);
|
11435 | };
|
11436 | }
|
11437 | }
|
11438 |
|
11439 | module.exports = ReactErrorUtils;
|
11440 | },{}],69:[function(_dereq_,module,exports){
|
11441 |
|
11442 |
|
11443 |
|
11444 |
|
11445 |
|
11446 |
|
11447 |
|
11448 |
|
11449 |
|
11450 |
|
11451 |
|
11452 | 'use strict';
|
11453 |
|
11454 | var EventPluginHub = _dereq_(17);
|
11455 |
|
11456 | function runEventQueueInBatch(events) {
|
11457 | EventPluginHub.enqueueEvents(events);
|
11458 | EventPluginHub.processEventQueue(false);
|
11459 | }
|
11460 |
|
11461 | var ReactEventEmitterMixin = {
|
11462 |
|
11463 | |
11464 |
|
11465 |
|
11466 |
|
11467 | handleTopLevel: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
|
11468 | var events = EventPluginHub.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
|
11469 | runEventQueueInBatch(events);
|
11470 | }
|
11471 | };
|
11472 |
|
11473 | module.exports = ReactEventEmitterMixin;
|
11474 | },{"17":17}],70:[function(_dereq_,module,exports){
|
11475 |
|
11476 |
|
11477 |
|
11478 |
|
11479 |
|
11480 |
|
11481 |
|
11482 |
|
11483 |
|
11484 |
|
11485 |
|
11486 | 'use strict';
|
11487 |
|
11488 | var _assign = _dereq_(188);
|
11489 |
|
11490 | var EventListener = _dereq_(163);
|
11491 | var ExecutionEnvironment = _dereq_(164);
|
11492 | var PooledClass = _dereq_(26);
|
11493 | var ReactDOMComponentTree = _dereq_(46);
|
11494 | var ReactUpdates = _dereq_(107);
|
11495 |
|
11496 | var getEventTarget = _dereq_(142);
|
11497 | var getUnboundedScrollPosition = _dereq_(175);
|
11498 |
|
11499 |
|
11500 |
|
11501 |
|
11502 |
|
11503 |
|
11504 | function findParent(inst) {
|
11505 |
|
11506 |
|
11507 |
|
11508 | while (inst._hostParent) {
|
11509 | inst = inst._hostParent;
|
11510 | }
|
11511 | var rootNode = ReactDOMComponentTree.getNodeFromInstance(inst);
|
11512 | var container = rootNode.parentNode;
|
11513 | return ReactDOMComponentTree.getClosestInstanceFromNode(container);
|
11514 | }
|
11515 |
|
11516 |
|
11517 | function TopLevelCallbackBookKeeping(topLevelType, nativeEvent) {
|
11518 | this.topLevelType = topLevelType;
|
11519 | this.nativeEvent = nativeEvent;
|
11520 | this.ancestors = [];
|
11521 | }
|
11522 | _assign(TopLevelCallbackBookKeeping.prototype, {
|
11523 | destructor: function () {
|
11524 | this.topLevelType = null;
|
11525 | this.nativeEvent = null;
|
11526 | this.ancestors.length = 0;
|
11527 | }
|
11528 | });
|
11529 | PooledClass.addPoolingTo(TopLevelCallbackBookKeeping, PooledClass.twoArgumentPooler);
|
11530 |
|
11531 | function handleTopLevelImpl(bookKeeping) {
|
11532 | var nativeEventTarget = getEventTarget(bookKeeping.nativeEvent);
|
11533 | var targetInst = ReactDOMComponentTree.getClosestInstanceFromNode(nativeEventTarget);
|
11534 |
|
11535 |
|
11536 |
|
11537 |
|
11538 |
|
11539 | var ancestor = targetInst;
|
11540 | do {
|
11541 | bookKeeping.ancestors.push(ancestor);
|
11542 | ancestor = ancestor && findParent(ancestor);
|
11543 | } while (ancestor);
|
11544 |
|
11545 | for (var i = 0; i < bookKeeping.ancestors.length; i++) {
|
11546 | targetInst = bookKeeping.ancestors[i];
|
11547 | ReactEventListener._handleTopLevel(bookKeeping.topLevelType, targetInst, bookKeeping.nativeEvent, getEventTarget(bookKeeping.nativeEvent));
|
11548 | }
|
11549 | }
|
11550 |
|
11551 | function scrollValueMonitor(cb) {
|
11552 | var scrollPosition = getUnboundedScrollPosition(window);
|
11553 | cb(scrollPosition);
|
11554 | }
|
11555 |
|
11556 | var ReactEventListener = {
|
11557 | _enabled: true,
|
11558 | _handleTopLevel: null,
|
11559 |
|
11560 | WINDOW_HANDLE: ExecutionEnvironment.canUseDOM ? window : null,
|
11561 |
|
11562 | setHandleTopLevel: function (handleTopLevel) {
|
11563 | ReactEventListener._handleTopLevel = handleTopLevel;
|
11564 | },
|
11565 |
|
11566 | setEnabled: function (enabled) {
|
11567 | ReactEventListener._enabled = !!enabled;
|
11568 | },
|
11569 |
|
11570 | isEnabled: function () {
|
11571 | return ReactEventListener._enabled;
|
11572 | },
|
11573 |
|
11574 | |
11575 |
|
11576 |
|
11577 |
|
11578 |
|
11579 |
|
11580 |
|
11581 |
|
11582 |
|
11583 |
|
11584 | trapBubbledEvent: function (topLevelType, handlerBaseName, handle) {
|
11585 | var element = handle;
|
11586 | if (!element) {
|
11587 | return null;
|
11588 | }
|
11589 | return EventListener.listen(element, handlerBaseName, ReactEventListener.dispatchEvent.bind(null, topLevelType));
|
11590 | },
|
11591 |
|
11592 | |
11593 |
|
11594 |
|
11595 |
|
11596 |
|
11597 |
|
11598 |
|
11599 |
|
11600 |
|
11601 |
|
11602 | trapCapturedEvent: function (topLevelType, handlerBaseName, handle) {
|
11603 | var element = handle;
|
11604 | if (!element) {
|
11605 | return null;
|
11606 | }
|
11607 | return EventListener.capture(element, handlerBaseName, ReactEventListener.dispatchEvent.bind(null, topLevelType));
|
11608 | },
|
11609 |
|
11610 | monitorScrollValue: function (refresh) {
|
11611 | var callback = scrollValueMonitor.bind(null, refresh);
|
11612 | EventListener.listen(window, 'scroll', callback);
|
11613 | },
|
11614 |
|
11615 | dispatchEvent: function (topLevelType, nativeEvent) {
|
11616 | if (!ReactEventListener._enabled) {
|
11617 | return;
|
11618 | }
|
11619 |
|
11620 | var bookKeeping = TopLevelCallbackBookKeeping.getPooled(topLevelType, nativeEvent);
|
11621 | try {
|
11622 |
|
11623 |
|
11624 | ReactUpdates.batchedUpdates(handleTopLevelImpl, bookKeeping);
|
11625 | } finally {
|
11626 | TopLevelCallbackBookKeeping.release(bookKeeping);
|
11627 | }
|
11628 | }
|
11629 | };
|
11630 |
|
11631 | module.exports = ReactEventListener;
|
11632 | },{"107":107,"142":142,"163":163,"164":164,"175":175,"188":188,"26":26,"46":46}],71:[function(_dereq_,module,exports){
|
11633 |
|
11634 |
|
11635 |
|
11636 |
|
11637 |
|
11638 |
|
11639 |
|
11640 |
|
11641 |
|
11642 |
|
11643 |
|
11644 |
|
11645 | 'use strict';
|
11646 |
|
11647 | var ReactFeatureFlags = {
|
11648 |
|
11649 |
|
11650 |
|
11651 | logTopLevelRenders: false
|
11652 | };
|
11653 |
|
11654 | module.exports = ReactFeatureFlags;
|
11655 | },{}],72:[function(_dereq_,module,exports){
|
11656 |
|
11657 |
|
11658 |
|
11659 |
|
11660 |
|
11661 |
|
11662 |
|
11663 |
|
11664 |
|
11665 |
|
11666 |
|
11667 | 'use strict';
|
11668 |
|
11669 | var _prodInvariant = _dereq_(153);
|
11670 |
|
11671 | var ReactChildren = _dereq_(32);
|
11672 | var ReactElement = _dereq_(65);
|
11673 |
|
11674 | var emptyFunction = _dereq_(170);
|
11675 | var invariant = _dereq_(178);
|
11676 | var warning = _dereq_(187);
|
11677 |
|
11678 |
|
11679 |
|
11680 |
|
11681 |
|
11682 |
|
11683 |
|
11684 |
|
11685 |
|
11686 | var numericPropertyRegex = /^\d+$/;
|
11687 |
|
11688 | var warnedAboutNumeric = false;
|
11689 |
|
11690 | var ReactFragment = {
|
11691 | |
11692 |
|
11693 |
|
11694 |
|
11695 |
|
11696 | create: function (object) {
|
11697 | if (typeof object !== 'object' || !object || Array.isArray(object)) {
|
11698 | "development" !== 'production' ? warning(false, 'React.addons.createFragment only accepts a single object. Got: %s', object) : void 0;
|
11699 | return object;
|
11700 | }
|
11701 | if (ReactElement.isValidElement(object)) {
|
11702 | "development" !== 'production' ? warning(false, 'React.addons.createFragment does not accept a ReactElement ' + 'without a wrapper object.') : void 0;
|
11703 | return object;
|
11704 | }
|
11705 |
|
11706 | !(object.nodeType !== 1) ? "development" !== 'production' ? invariant(false, 'React.addons.createFragment(...): Encountered an invalid child; DOM elements are not valid children of React components.') : _prodInvariant('0') : void 0;
|
11707 |
|
11708 | var result = [];
|
11709 |
|
11710 | for (var key in object) {
|
11711 | if ("development" !== 'production') {
|
11712 | if (!warnedAboutNumeric && numericPropertyRegex.test(key)) {
|
11713 | "development" !== 'production' ? warning(false, 'React.addons.createFragment(...): Child objects should have ' + 'non-numeric keys so ordering is preserved.') : void 0;
|
11714 | warnedAboutNumeric = true;
|
11715 | }
|
11716 | }
|
11717 | ReactChildren.mapIntoWithKeyPrefixInternal(object[key], result, key, emptyFunction.thatReturnsArgument);
|
11718 | }
|
11719 |
|
11720 | return result;
|
11721 | }
|
11722 | };
|
11723 |
|
11724 | module.exports = ReactFragment;
|
11725 | },{"153":153,"170":170,"178":178,"187":187,"32":32,"65":65}],73:[function(_dereq_,module,exports){
|
11726 |
|
11727 |
|
11728 |
|
11729 |
|
11730 |
|
11731 |
|
11732 |
|
11733 |
|
11734 |
|
11735 |
|
11736 |
|
11737 | 'use strict';
|
11738 |
|
11739 | var _prodInvariant = _dereq_(153),
|
11740 | _assign = _dereq_(188);
|
11741 |
|
11742 | var invariant = _dereq_(178);
|
11743 |
|
11744 | var genericComponentClass = null;
|
11745 |
|
11746 | var tagToComponentClass = {};
|
11747 | var textComponentClass = null;
|
11748 |
|
11749 | var ReactHostComponentInjection = {
|
11750 |
|
11751 |
|
11752 | injectGenericComponentClass: function (componentClass) {
|
11753 | genericComponentClass = componentClass;
|
11754 | },
|
11755 |
|
11756 |
|
11757 | injectTextComponentClass: function (componentClass) {
|
11758 | textComponentClass = componentClass;
|
11759 | },
|
11760 |
|
11761 |
|
11762 | injectComponentClasses: function (componentClasses) {
|
11763 | _assign(tagToComponentClass, componentClasses);
|
11764 | }
|
11765 | };
|
11766 |
|
11767 |
|
11768 |
|
11769 |
|
11770 |
|
11771 |
|
11772 |
|
11773 | function createInternalComponent(element) {
|
11774 | !genericComponentClass ? "development" !== 'production' ? invariant(false, 'There is no registered component for the tag %s', element.type) : _prodInvariant('111', element.type) : void 0;
|
11775 | return new genericComponentClass(element);
|
11776 | }
|
11777 |
|
11778 |
|
11779 |
|
11780 |
|
11781 |
|
11782 | function createInstanceForText(text) {
|
11783 | return new textComponentClass(text);
|
11784 | }
|
11785 |
|
11786 |
|
11787 |
|
11788 |
|
11789 |
|
11790 | function isTextComponent(component) {
|
11791 | return component instanceof textComponentClass;
|
11792 | }
|
11793 |
|
11794 | var ReactHostComponent = {
|
11795 | createInternalComponent: createInternalComponent,
|
11796 | createInstanceForText: createInstanceForText,
|
11797 | isTextComponent: isTextComponent,
|
11798 | injection: ReactHostComponentInjection
|
11799 | };
|
11800 |
|
11801 | module.exports = ReactHostComponent;
|
11802 | },{"153":153,"178":178,"188":188}],74:[function(_dereq_,module,exports){
|
11803 |
|
11804 |
|
11805 |
|
11806 |
|
11807 |
|
11808 |
|
11809 |
|
11810 |
|
11811 |
|
11812 |
|
11813 |
|
11814 | 'use strict';
|
11815 |
|
11816 | var history = [];
|
11817 |
|
11818 | var ReactHostOperationHistoryHook = {
|
11819 | onHostOperation: function (debugID, type, payload) {
|
11820 | history.push({
|
11821 | instanceID: debugID,
|
11822 | type: type,
|
11823 | payload: payload
|
11824 | });
|
11825 | },
|
11826 | clearHistory: function () {
|
11827 | if (ReactHostOperationHistoryHook._preventClearing) {
|
11828 |
|
11829 | return;
|
11830 | }
|
11831 |
|
11832 | history = [];
|
11833 | },
|
11834 | getHistory: function () {
|
11835 | return history;
|
11836 | }
|
11837 | };
|
11838 |
|
11839 | module.exports = ReactHostOperationHistoryHook;
|
11840 | },{}],75:[function(_dereq_,module,exports){
|
11841 |
|
11842 |
|
11843 |
|
11844 |
|
11845 |
|
11846 |
|
11847 |
|
11848 |
|
11849 |
|
11850 |
|
11851 |
|
11852 | 'use strict';
|
11853 |
|
11854 | var DOMProperty = _dereq_(10);
|
11855 | var EventPluginHub = _dereq_(17);
|
11856 | var EventPluginUtils = _dereq_(19);
|
11857 | var ReactComponentEnvironment = _dereq_(37);
|
11858 | var ReactClass = _dereq_(34);
|
11859 | var ReactEmptyComponent = _dereq_(67);
|
11860 | var ReactBrowserEventEmitter = _dereq_(28);
|
11861 | var ReactHostComponent = _dereq_(73);
|
11862 | var ReactUpdates = _dereq_(107);
|
11863 |
|
11864 | var ReactInjection = {
|
11865 | Component: ReactComponentEnvironment.injection,
|
11866 | Class: ReactClass.injection,
|
11867 | DOMProperty: DOMProperty.injection,
|
11868 | EmptyComponent: ReactEmptyComponent.injection,
|
11869 | EventPluginHub: EventPluginHub.injection,
|
11870 | EventPluginUtils: EventPluginUtils.injection,
|
11871 | EventEmitter: ReactBrowserEventEmitter.injection,
|
11872 | HostComponent: ReactHostComponent.injection,
|
11873 | Updates: ReactUpdates.injection
|
11874 | };
|
11875 |
|
11876 | module.exports = ReactInjection;
|
11877 | },{"10":10,"107":107,"17":17,"19":19,"28":28,"34":34,"37":37,"67":67,"73":73}],76:[function(_dereq_,module,exports){
|
11878 |
|
11879 |
|
11880 |
|
11881 |
|
11882 |
|
11883 |
|
11884 |
|
11885 |
|
11886 |
|
11887 |
|
11888 |
|
11889 | 'use strict';
|
11890 |
|
11891 | var ReactDOMSelection = _dereq_(56);
|
11892 |
|
11893 | var containsNode = _dereq_(167);
|
11894 | var focusNode = _dereq_(172);
|
11895 | var getActiveElement = _dereq_(173);
|
11896 |
|
11897 | function isInDocument(node) {
|
11898 | return containsNode(document.documentElement, node);
|
11899 | }
|
11900 |
|
11901 |
|
11902 |
|
11903 |
|
11904 |
|
11905 |
|
11906 |
|
11907 | var ReactInputSelection = {
|
11908 |
|
11909 | hasSelectionCapabilities: function (elem) {
|
11910 | var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
|
11911 | return nodeName && (nodeName === 'input' && elem.type === 'text' || nodeName === 'textarea' || elem.contentEditable === 'true');
|
11912 | },
|
11913 |
|
11914 | getSelectionInformation: function () {
|
11915 | var focusedElem = getActiveElement();
|
11916 | return {
|
11917 | focusedElem: focusedElem,
|
11918 | selectionRange: ReactInputSelection.hasSelectionCapabilities(focusedElem) ? ReactInputSelection.getSelection(focusedElem) : null
|
11919 | };
|
11920 | },
|
11921 |
|
11922 | |
11923 |
|
11924 |
|
11925 |
|
11926 |
|
11927 | restoreSelection: function (priorSelectionInformation) {
|
11928 | var curFocusedElem = getActiveElement();
|
11929 | var priorFocusedElem = priorSelectionInformation.focusedElem;
|
11930 | var priorSelectionRange = priorSelectionInformation.selectionRange;
|
11931 | if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) {
|
11932 | if (ReactInputSelection.hasSelectionCapabilities(priorFocusedElem)) {
|
11933 | ReactInputSelection.setSelection(priorFocusedElem, priorSelectionRange);
|
11934 | }
|
11935 | focusNode(priorFocusedElem);
|
11936 | }
|
11937 | },
|
11938 |
|
11939 | |
11940 |
|
11941 |
|
11942 |
|
11943 |
|
11944 |
|
11945 | getSelection: function (input) {
|
11946 | var selection;
|
11947 |
|
11948 | if ('selectionStart' in input) {
|
11949 |
|
11950 | selection = {
|
11951 | start: input.selectionStart,
|
11952 | end: input.selectionEnd
|
11953 | };
|
11954 | } else if (document.selection && input.nodeName && input.nodeName.toLowerCase() === 'input') {
|
11955 |
|
11956 | var range = document.selection.createRange();
|
11957 |
|
11958 |
|
11959 | if (range.parentElement() === input) {
|
11960 | selection = {
|
11961 | start: -range.moveStart('character', -input.value.length),
|
11962 | end: -range.moveEnd('character', -input.value.length)
|
11963 | };
|
11964 | }
|
11965 | } else {
|
11966 |
|
11967 | selection = ReactDOMSelection.getOffsets(input);
|
11968 | }
|
11969 |
|
11970 | return selection || { start: 0, end: 0 };
|
11971 | },
|
11972 |
|
11973 | |
11974 |
|
11975 |
|
11976 |
|
11977 |
|
11978 |
|
11979 | setSelection: function (input, offsets) {
|
11980 | var start = offsets.start;
|
11981 | var end = offsets.end;
|
11982 | if (end === undefined) {
|
11983 | end = start;
|
11984 | }
|
11985 |
|
11986 | if ('selectionStart' in input) {
|
11987 | input.selectionStart = start;
|
11988 | input.selectionEnd = Math.min(end, input.value.length);
|
11989 | } else if (document.selection && input.nodeName && input.nodeName.toLowerCase() === 'input') {
|
11990 | var range = input.createTextRange();
|
11991 | range.collapse(true);
|
11992 | range.moveStart('character', start);
|
11993 | range.moveEnd('character', end - start);
|
11994 | range.select();
|
11995 | } else {
|
11996 | ReactDOMSelection.setOffsets(input, offsets);
|
11997 | }
|
11998 | }
|
11999 | };
|
12000 |
|
12001 | module.exports = ReactInputSelection;
|
12002 | },{"167":167,"172":172,"173":173,"56":56}],77:[function(_dereq_,module,exports){
|
12003 |
|
12004 |
|
12005 |
|
12006 |
|
12007 |
|
12008 |
|
12009 |
|
12010 |
|
12011 |
|
12012 |
|
12013 |
|
12014 | 'use strict';
|
12015 |
|
12016 |
|
12017 |
|
12018 |
|
12019 |
|
12020 |
|
12021 |
|
12022 |
|
12023 |
|
12024 |
|
12025 | var ReactInstanceMap = {
|
12026 |
|
12027 | |
12028 |
|
12029 |
|
12030 |
|
12031 |
|
12032 | remove: function (key) {
|
12033 | key._reactInternalInstance = undefined;
|
12034 | },
|
12035 |
|
12036 | get: function (key) {
|
12037 | return key._reactInternalInstance;
|
12038 | },
|
12039 |
|
12040 | has: function (key) {
|
12041 | return key._reactInternalInstance !== undefined;
|
12042 | },
|
12043 |
|
12044 | set: function (key, value) {
|
12045 | key._reactInternalInstance = value;
|
12046 | }
|
12047 |
|
12048 | };
|
12049 |
|
12050 | module.exports = ReactInstanceMap;
|
12051 | },{}],78:[function(_dereq_,module,exports){
|
12052 |
|
12053 |
|
12054 |
|
12055 |
|
12056 |
|
12057 |
|
12058 |
|
12059 |
|
12060 |
|
12061 |
|
12062 |
|
12063 | 'use strict';
|
12064 |
|
12065 | var debugTool = null;
|
12066 |
|
12067 | if ("development" !== 'production') {
|
12068 | var ReactDebugTool = _dereq_(62);
|
12069 | debugTool = ReactDebugTool;
|
12070 | }
|
12071 |
|
12072 | module.exports = { debugTool: debugTool };
|
12073 | },{"62":62}],79:[function(_dereq_,module,exports){
|
12074 |
|
12075 |
|
12076 |
|
12077 |
|
12078 |
|
12079 |
|
12080 |
|
12081 |
|
12082 |
|
12083 |
|
12084 |
|
12085 | 'use strict';
|
12086 |
|
12087 | var warning = _dereq_(187);
|
12088 |
|
12089 | if ("development" !== 'production') {
|
12090 | var processingChildContext = false;
|
12091 |
|
12092 | var warnInvalidSetState = function () {
|
12093 | "development" !== 'production' ? warning(!processingChildContext, 'setState(...): Cannot call setState() inside getChildContext()') : void 0;
|
12094 | };
|
12095 | }
|
12096 |
|
12097 | var ReactInvalidSetStateWarningHook = {
|
12098 | onBeginProcessingChildContext: function () {
|
12099 | processingChildContext = true;
|
12100 | },
|
12101 | onEndProcessingChildContext: function () {
|
12102 | processingChildContext = false;
|
12103 | },
|
12104 | onSetState: function () {
|
12105 | warnInvalidSetState();
|
12106 | }
|
12107 | };
|
12108 |
|
12109 | module.exports = ReactInvalidSetStateWarningHook;
|
12110 | },{"187":187}],80:[function(_dereq_,module,exports){
|
12111 |
|
12112 |
|
12113 |
|
12114 |
|
12115 |
|
12116 |
|
12117 |
|
12118 |
|
12119 |
|
12120 |
|
12121 |
|
12122 | 'use strict';
|
12123 |
|
12124 |
|
12125 |
|
12126 |
|
12127 |
|
12128 |
|
12129 |
|
12130 |
|
12131 |
|
12132 |
|
12133 |
|
12134 |
|
12135 |
|
12136 |
|
12137 |
|
12138 |
|
12139 |
|
12140 |
|
12141 |
|
12142 |
|
12143 |
|
12144 |
|
12145 |
|
12146 |
|
12147 | var React = _dereq_(27);
|
12148 |
|
12149 |
|
12150 |
|
12151 |
|
12152 |
|
12153 |
|
12154 |
|
12155 |
|
12156 | function ReactLink(value, requestChange) {
|
12157 | this.value = value;
|
12158 | this.requestChange = requestChange;
|
12159 | }
|
12160 |
|
12161 |
|
12162 |
|
12163 |
|
12164 |
|
12165 |
|
12166 |
|
12167 |
|
12168 |
|
12169 | function createLinkTypeChecker(linkType) {
|
12170 | var shapes = {
|
12171 | value: linkType === undefined ? React.PropTypes.any.isRequired : linkType.isRequired,
|
12172 | requestChange: React.PropTypes.func.isRequired
|
12173 | };
|
12174 | return React.PropTypes.shape(shapes);
|
12175 | }
|
12176 |
|
12177 | ReactLink.PropTypes = {
|
12178 | link: createLinkTypeChecker
|
12179 | };
|
12180 |
|
12181 | module.exports = ReactLink;
|
12182 | },{"27":27}],81:[function(_dereq_,module,exports){
|
12183 |
|
12184 |
|
12185 |
|
12186 |
|
12187 |
|
12188 |
|
12189 |
|
12190 |
|
12191 |
|
12192 |
|
12193 |
|
12194 | 'use strict';
|
12195 |
|
12196 | var adler32 = _dereq_(130);
|
12197 |
|
12198 | var TAG_END = /\/?>/;
|
12199 | var COMMENT_START = /^<\!\-\-/;
|
12200 |
|
12201 | var ReactMarkupChecksum = {
|
12202 | CHECKSUM_ATTR_NAME: 'data-react-checksum',
|
12203 |
|
12204 | |
12205 |
|
12206 |
|
12207 |
|
12208 | addChecksumToMarkup: function (markup) {
|
12209 | var checksum = adler32(markup);
|
12210 |
|
12211 |
|
12212 | if (COMMENT_START.test(markup)) {
|
12213 | return markup;
|
12214 | } else {
|
12215 | return markup.replace(TAG_END, ' ' + ReactMarkupChecksum.CHECKSUM_ATTR_NAME + '="' + checksum + '"$&');
|
12216 | }
|
12217 | },
|
12218 |
|
12219 | |
12220 |
|
12221 |
|
12222 |
|
12223 |
|
12224 | canReuseMarkup: function (markup, element) {
|
12225 | var existingChecksum = element.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
|
12226 | existingChecksum = existingChecksum && parseInt(existingChecksum, 10);
|
12227 | var markupChecksum = adler32(markup);
|
12228 | return markupChecksum === existingChecksum;
|
12229 | }
|
12230 | };
|
12231 |
|
12232 | module.exports = ReactMarkupChecksum;
|
12233 | },{"130":130}],82:[function(_dereq_,module,exports){
|
12234 |
|
12235 |
|
12236 |
|
12237 |
|
12238 |
|
12239 |
|
12240 |
|
12241 |
|
12242 |
|
12243 |
|
12244 |
|
12245 | 'use strict';
|
12246 |
|
12247 | var _prodInvariant = _dereq_(153);
|
12248 |
|
12249 | var DOMLazyTree = _dereq_(8);
|
12250 | var DOMProperty = _dereq_(10);
|
12251 | var ReactBrowserEventEmitter = _dereq_(28);
|
12252 | var ReactCurrentOwner = _dereq_(41);
|
12253 | var ReactDOMComponentTree = _dereq_(46);
|
12254 | var ReactDOMContainerInfo = _dereq_(47);
|
12255 | var ReactDOMFeatureFlags = _dereq_(50);
|
12256 | var ReactElement = _dereq_(65);
|
12257 | var ReactFeatureFlags = _dereq_(71);
|
12258 | var ReactInstanceMap = _dereq_(77);
|
12259 | var ReactInstrumentation = _dereq_(78);
|
12260 | var ReactMarkupChecksum = _dereq_(81);
|
12261 | var ReactReconciler = _dereq_(95);
|
12262 | var ReactUpdateQueue = _dereq_(106);
|
12263 | var ReactUpdates = _dereq_(107);
|
12264 |
|
12265 | var emptyObject = _dereq_(171);
|
12266 | var instantiateReactComponent = _dereq_(148);
|
12267 | var invariant = _dereq_(178);
|
12268 | var setInnerHTML = _dereq_(155);
|
12269 | var shouldUpdateReactComponent = _dereq_(158);
|
12270 | var warning = _dereq_(187);
|
12271 |
|
12272 | var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME;
|
12273 | var ROOT_ATTR_NAME = DOMProperty.ROOT_ATTRIBUTE_NAME;
|
12274 |
|
12275 | var ELEMENT_NODE_TYPE = 1;
|
12276 | var DOC_NODE_TYPE = 9;
|
12277 | var DOCUMENT_FRAGMENT_NODE_TYPE = 11;
|
12278 |
|
12279 | var instancesByReactRootID = {};
|
12280 |
|
12281 |
|
12282 |
|
12283 |
|
12284 |
|
12285 |
|
12286 |
|
12287 | function firstDifferenceIndex(string1, string2) {
|
12288 | var minLen = Math.min(string1.length, string2.length);
|
12289 | for (var i = 0; i < minLen; i++) {
|
12290 | if (string1.charAt(i) !== string2.charAt(i)) {
|
12291 | return i;
|
12292 | }
|
12293 | }
|
12294 | return string1.length === string2.length ? -1 : minLen;
|
12295 | }
|
12296 |
|
12297 |
|
12298 |
|
12299 |
|
12300 |
|
12301 |
|
12302 | function getReactRootElementInContainer(container) {
|
12303 | if (!container) {
|
12304 | return null;
|
12305 | }
|
12306 |
|
12307 | if (container.nodeType === DOC_NODE_TYPE) {
|
12308 | return container.documentElement;
|
12309 | } else {
|
12310 | return container.firstChild;
|
12311 | }
|
12312 | }
|
12313 |
|
12314 | function internalGetID(node) {
|
12315 |
|
12316 |
|
12317 |
|
12318 | return node.getAttribute && node.getAttribute(ATTR_NAME) || '';
|
12319 | }
|
12320 |
|
12321 |
|
12322 |
|
12323 |
|
12324 |
|
12325 |
|
12326 |
|
12327 |
|
12328 |
|
12329 | function mountComponentIntoNode(wrapperInstance, container, transaction, shouldReuseMarkup, context) {
|
12330 | var markerName;
|
12331 | if (ReactFeatureFlags.logTopLevelRenders) {
|
12332 | var wrappedElement = wrapperInstance._currentElement.props;
|
12333 | var type = wrappedElement.type;
|
12334 | markerName = 'React mount: ' + (typeof type === 'string' ? type : type.displayName || type.name);
|
12335 | console.time(markerName);
|
12336 | }
|
12337 |
|
12338 | var markup = ReactReconciler.mountComponent(wrapperInstance, transaction, null, ReactDOMContainerInfo(wrapperInstance, container), context, 0
|
12339 | );
|
12340 |
|
12341 | if (markerName) {
|
12342 | console.timeEnd(markerName);
|
12343 | }
|
12344 |
|
12345 | wrapperInstance._renderedComponent._topLevelWrapper = wrapperInstance;
|
12346 | ReactMount._mountImageIntoNode(markup, container, wrapperInstance, shouldReuseMarkup, transaction);
|
12347 | }
|
12348 |
|
12349 |
|
12350 |
|
12351 |
|
12352 |
|
12353 |
|
12354 |
|
12355 |
|
12356 | function batchedMountComponentIntoNode(componentInstance, container, shouldReuseMarkup, context) {
|
12357 | var transaction = ReactUpdates.ReactReconcileTransaction.getPooled(
|
12358 |
|
12359 | !shouldReuseMarkup && ReactDOMFeatureFlags.useCreateElement);
|
12360 | transaction.perform(mountComponentIntoNode, null, componentInstance, container, transaction, shouldReuseMarkup, context);
|
12361 | ReactUpdates.ReactReconcileTransaction.release(transaction);
|
12362 | }
|
12363 |
|
12364 |
|
12365 |
|
12366 |
|
12367 |
|
12368 |
|
12369 |
|
12370 |
|
12371 |
|
12372 |
|
12373 | function unmountComponentFromNode(instance, container, safely) {
|
12374 | if ("development" !== 'production') {
|
12375 | ReactInstrumentation.debugTool.onBeginFlush();
|
12376 | }
|
12377 | ReactReconciler.unmountComponent(instance, safely);
|
12378 | if ("development" !== 'production') {
|
12379 | ReactInstrumentation.debugTool.onEndFlush();
|
12380 | }
|
12381 |
|
12382 | if (container.nodeType === DOC_NODE_TYPE) {
|
12383 | container = container.documentElement;
|
12384 | }
|
12385 |
|
12386 |
|
12387 | while (container.lastChild) {
|
12388 | container.removeChild(container.lastChild);
|
12389 | }
|
12390 | }
|
12391 |
|
12392 |
|
12393 |
|
12394 |
|
12395 |
|
12396 |
|
12397 |
|
12398 |
|
12399 |
|
12400 |
|
12401 |
|
12402 | function hasNonRootReactChild(container) {
|
12403 | var rootEl = getReactRootElementInContainer(container);
|
12404 | if (rootEl) {
|
12405 | var inst = ReactDOMComponentTree.getInstanceFromNode(rootEl);
|
12406 | return !!(inst && inst._hostParent);
|
12407 | }
|
12408 | }
|
12409 |
|
12410 |
|
12411 |
|
12412 |
|
12413 |
|
12414 |
|
12415 |
|
12416 |
|
12417 |
|
12418 | function nodeIsRenderedByOtherInstance(container) {
|
12419 | var rootEl = getReactRootElementInContainer(container);
|
12420 | return !!(rootEl && isReactNode(rootEl) && !ReactDOMComponentTree.getInstanceFromNode(rootEl));
|
12421 | }
|
12422 |
|
12423 |
|
12424 |
|
12425 |
|
12426 |
|
12427 |
|
12428 |
|
12429 |
|
12430 | function isValidContainer(node) {
|
12431 | return !!(node && (node.nodeType === ELEMENT_NODE_TYPE || node.nodeType === DOC_NODE_TYPE || node.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE));
|
12432 | }
|
12433 |
|
12434 |
|
12435 |
|
12436 |
|
12437 |
|
12438 |
|
12439 |
|
12440 |
|
12441 | function isReactNode(node) {
|
12442 | return isValidContainer(node) && (node.hasAttribute(ROOT_ATTR_NAME) || node.hasAttribute(ATTR_NAME));
|
12443 | }
|
12444 |
|
12445 | function getHostRootInstanceInContainer(container) {
|
12446 | var rootEl = getReactRootElementInContainer(container);
|
12447 | var prevHostInstance = rootEl && ReactDOMComponentTree.getInstanceFromNode(rootEl);
|
12448 | return prevHostInstance && !prevHostInstance._hostParent ? prevHostInstance : null;
|
12449 | }
|
12450 |
|
12451 | function getTopLevelWrapperInContainer(container) {
|
12452 | var root = getHostRootInstanceInContainer(container);
|
12453 | return root ? root._hostContainerInfo._topLevelWrapper : null;
|
12454 | }
|
12455 |
|
12456 |
|
12457 |
|
12458 |
|
12459 |
|
12460 |
|
12461 | var topLevelRootCounter = 1;
|
12462 | var TopLevelWrapper = function () {
|
12463 | this.rootID = topLevelRootCounter++;
|
12464 | };
|
12465 | TopLevelWrapper.prototype.isReactComponent = {};
|
12466 | if ("development" !== 'production') {
|
12467 | TopLevelWrapper.displayName = 'TopLevelWrapper';
|
12468 | }
|
12469 | TopLevelWrapper.prototype.render = function () {
|
12470 |
|
12471 | return this.props;
|
12472 | };
|
12473 |
|
12474 |
|
12475 |
|
12476 |
|
12477 |
|
12478 |
|
12479 |
|
12480 |
|
12481 |
|
12482 |
|
12483 |
|
12484 |
|
12485 |
|
12486 |
|
12487 |
|
12488 |
|
12489 |
|
12490 |
|
12491 |
|
12492 | var ReactMount = {
|
12493 |
|
12494 | TopLevelWrapper: TopLevelWrapper,
|
12495 |
|
12496 | |
12497 |
|
12498 |
|
12499 | _instancesByReactRootID: instancesByReactRootID,
|
12500 |
|
12501 | |
12502 |
|
12503 |
|
12504 |
|
12505 |
|
12506 |
|
12507 |
|
12508 |
|
12509 | scrollMonitor: function (container, renderCallback) {
|
12510 | renderCallback();
|
12511 | },
|
12512 |
|
12513 | |
12514 |
|
12515 |
|
12516 |
|
12517 |
|
12518 |
|
12519 |
|
12520 | _updateRootComponent: function (prevComponent, nextElement, nextContext, container, callback) {
|
12521 | ReactMount.scrollMonitor(container, function () {
|
12522 | ReactUpdateQueue.enqueueElementInternal(prevComponent, nextElement, nextContext);
|
12523 | if (callback) {
|
12524 | ReactUpdateQueue.enqueueCallbackInternal(prevComponent, callback);
|
12525 | }
|
12526 | });
|
12527 |
|
12528 | return prevComponent;
|
12529 | },
|
12530 |
|
12531 | |
12532 |
|
12533 |
|
12534 |
|
12535 |
|
12536 |
|
12537 |
|
12538 |
|
12539 | _renderNewRootComponent: function (nextElement, container, shouldReuseMarkup, context) {
|
12540 |
|
12541 |
|
12542 |
|
12543 | "development" !== 'production' ? warning(ReactCurrentOwner.current == null, '_renderNewRootComponent(): Render methods should be a pure function ' + 'of props and state; triggering nested component updates from ' + 'render is not allowed. If necessary, trigger nested updates in ' + 'componentDidUpdate. Check the render method of %s.', ReactCurrentOwner.current && ReactCurrentOwner.current.getName() || 'ReactCompositeComponent') : void 0;
|
12544 |
|
12545 | !isValidContainer(container) ? "development" !== 'production' ? invariant(false, '_registerComponent(...): Target container is not a DOM element.') : _prodInvariant('37') : void 0;
|
12546 |
|
12547 | ReactBrowserEventEmitter.ensureScrollValueMonitoring();
|
12548 | var componentInstance = instantiateReactComponent(nextElement, false);
|
12549 |
|
12550 |
|
12551 |
|
12552 |
|
12553 |
|
12554 | ReactUpdates.batchedUpdates(batchedMountComponentIntoNode, componentInstance, container, shouldReuseMarkup, context);
|
12555 |
|
12556 | var wrapperID = componentInstance._instance.rootID;
|
12557 | instancesByReactRootID[wrapperID] = componentInstance;
|
12558 |
|
12559 | return componentInstance;
|
12560 | },
|
12561 |
|
12562 | |
12563 |
|
12564 |
|
12565 |
|
12566 |
|
12567 |
|
12568 |
|
12569 |
|
12570 |
|
12571 |
|
12572 |
|
12573 |
|
12574 |
|
12575 | renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) {
|
12576 | !(parentComponent != null && ReactInstanceMap.has(parentComponent)) ? "development" !== 'production' ? invariant(false, 'parentComponent must be a valid React Component') : _prodInvariant('38') : void 0;
|
12577 | return ReactMount._renderSubtreeIntoContainer(parentComponent, nextElement, container, callback);
|
12578 | },
|
12579 |
|
12580 | _renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) {
|
12581 | ReactUpdateQueue.validateCallback(callback, 'ReactDOM.render');
|
12582 | !ReactElement.isValidElement(nextElement) ? "development" !== 'production' ? invariant(false, 'ReactDOM.render(): Invalid component element.%s', typeof nextElement === 'string' ? ' Instead of passing a string like \'div\', pass ' + 'React.createElement(\'div\') or <div />.' : typeof nextElement === 'function' ? ' Instead of passing a class like Foo, pass ' + 'React.createElement(Foo) or <Foo />.' :
|
12583 |
|
12584 | nextElement != null && nextElement.props !== undefined ? ' This may be caused by unintentionally loading two independent ' + 'copies of React.' : '') : _prodInvariant('39', typeof nextElement === 'string' ? ' Instead of passing a string like \'div\', pass ' + 'React.createElement(\'div\') or <div />.' : typeof nextElement === 'function' ? ' Instead of passing a class like Foo, pass ' + 'React.createElement(Foo) or <Foo />.' : nextElement != null && nextElement.props !== undefined ? ' This may be caused by unintentionally loading two independent ' + 'copies of React.' : '') : void 0;
|
12585 |
|
12586 | "development" !== 'production' ? warning(!container || !container.tagName || container.tagName.toUpperCase() !== 'BODY', 'render(): Rendering components directly into document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try rendering into a container element created ' + 'for your app.') : void 0;
|
12587 |
|
12588 | var nextWrappedElement = ReactElement(TopLevelWrapper, null, null, null, null, null, nextElement);
|
12589 |
|
12590 | var nextContext;
|
12591 | if (parentComponent) {
|
12592 | var parentInst = ReactInstanceMap.get(parentComponent);
|
12593 | nextContext = parentInst._processChildContext(parentInst._context);
|
12594 | } else {
|
12595 | nextContext = emptyObject;
|
12596 | }
|
12597 |
|
12598 | var prevComponent = getTopLevelWrapperInContainer(container);
|
12599 |
|
12600 | if (prevComponent) {
|
12601 | var prevWrappedElement = prevComponent._currentElement;
|
12602 | var prevElement = prevWrappedElement.props;
|
12603 | if (shouldUpdateReactComponent(prevElement, nextElement)) {
|
12604 | var publicInst = prevComponent._renderedComponent.getPublicInstance();
|
12605 | var updatedCallback = callback && function () {
|
12606 | callback.call(publicInst);
|
12607 | };
|
12608 | ReactMount._updateRootComponent(prevComponent, nextWrappedElement, nextContext, container, updatedCallback);
|
12609 | return publicInst;
|
12610 | } else {
|
12611 | ReactMount.unmountComponentAtNode(container);
|
12612 | }
|
12613 | }
|
12614 |
|
12615 | var reactRootElement = getReactRootElementInContainer(container);
|
12616 | var containerHasReactMarkup = reactRootElement && !!internalGetID(reactRootElement);
|
12617 | var containerHasNonRootReactChild = hasNonRootReactChild(container);
|
12618 |
|
12619 | if ("development" !== 'production') {
|
12620 | "development" !== 'production' ? warning(!containerHasNonRootReactChild, 'render(...): Replacing React-rendered children with a new root ' + 'component. If you intended to update the children of this node, ' + 'you should instead have the existing children update their state ' + 'and render the new components instead of calling ReactDOM.render.') : void 0;
|
12621 |
|
12622 | if (!containerHasReactMarkup || reactRootElement.nextSibling) {
|
12623 | var rootElementSibling = reactRootElement;
|
12624 | while (rootElementSibling) {
|
12625 | if (internalGetID(rootElementSibling)) {
|
12626 | "development" !== 'production' ? warning(false, 'render(): Target node has markup rendered by React, but there ' + 'are unrelated nodes as well. This is most commonly caused by ' + 'white-space inserted around server-rendered markup.') : void 0;
|
12627 | break;
|
12628 | }
|
12629 | rootElementSibling = rootElementSibling.nextSibling;
|
12630 | }
|
12631 | }
|
12632 | }
|
12633 |
|
12634 | var shouldReuseMarkup = containerHasReactMarkup && !prevComponent && !containerHasNonRootReactChild;
|
12635 | var component = ReactMount._renderNewRootComponent(nextWrappedElement, container, shouldReuseMarkup, nextContext)._renderedComponent.getPublicInstance();
|
12636 | if (callback) {
|
12637 | callback.call(component);
|
12638 | }
|
12639 | return component;
|
12640 | },
|
12641 |
|
12642 | |
12643 |
|
12644 |
|
12645 |
|
12646 |
|
12647 |
|
12648 |
|
12649 |
|
12650 |
|
12651 |
|
12652 |
|
12653 |
|
12654 |
|
12655 | render: function (nextElement, container, callback) {
|
12656 | return ReactMount._renderSubtreeIntoContainer(null, nextElement, container, callback);
|
12657 | },
|
12658 |
|
12659 | |
12660 |
|
12661 |
|
12662 |
|
12663 |
|
12664 |
|
12665 |
|
12666 |
|
12667 | unmountComponentAtNode: function (container) {
|
12668 |
|
12669 |
|
12670 |
|
12671 |
|
12672 | "development" !== 'production' ? warning(ReactCurrentOwner.current == null, 'unmountComponentAtNode(): Render methods should be a pure function ' + 'of props and state; triggering nested component updates from render ' + 'is not allowed. If necessary, trigger nested updates in ' + 'componentDidUpdate. Check the render method of %s.', ReactCurrentOwner.current && ReactCurrentOwner.current.getName() || 'ReactCompositeComponent') : void 0;
|
12673 |
|
12674 | !isValidContainer(container) ? "development" !== 'production' ? invariant(false, 'unmountComponentAtNode(...): Target container is not a DOM element.') : _prodInvariant('40') : void 0;
|
12675 |
|
12676 | if ("development" !== 'production') {
|
12677 | "development" !== 'production' ? warning(!nodeIsRenderedByOtherInstance(container), 'unmountComponentAtNode(): The node you\'re attempting to unmount ' + 'was rendered by another copy of React.') : void 0;
|
12678 | }
|
12679 |
|
12680 | var prevComponent = getTopLevelWrapperInContainer(container);
|
12681 | if (!prevComponent) {
|
12682 |
|
12683 |
|
12684 | var containerHasNonRootReactChild = hasNonRootReactChild(container);
|
12685 |
|
12686 |
|
12687 | var isContainerReactRoot = container.nodeType === 1 && container.hasAttribute(ROOT_ATTR_NAME);
|
12688 |
|
12689 | if ("development" !== 'production') {
|
12690 | "development" !== 'production' ? warning(!containerHasNonRootReactChild, 'unmountComponentAtNode(): The node you\'re attempting to unmount ' + 'was rendered by React and is not a top-level container. %s', isContainerReactRoot ? 'You may have accidentally passed in a React root node instead ' + 'of its container.' : 'Instead, have the parent component update its state and ' + 'rerender in order to remove this component.') : void 0;
|
12691 | }
|
12692 |
|
12693 | return false;
|
12694 | }
|
12695 | delete instancesByReactRootID[prevComponent._instance.rootID];
|
12696 | ReactUpdates.batchedUpdates(unmountComponentFromNode, prevComponent, container, false);
|
12697 | return true;
|
12698 | },
|
12699 |
|
12700 | _mountImageIntoNode: function (markup, container, instance, shouldReuseMarkup, transaction) {
|
12701 | !isValidContainer(container) ? "development" !== 'production' ? invariant(false, 'mountComponentIntoNode(...): Target container is not valid.') : _prodInvariant('41') : void 0;
|
12702 |
|
12703 | if (shouldReuseMarkup) {
|
12704 | var rootElement = getReactRootElementInContainer(container);
|
12705 | if (ReactMarkupChecksum.canReuseMarkup(markup, rootElement)) {
|
12706 | ReactDOMComponentTree.precacheNode(instance, rootElement);
|
12707 | return;
|
12708 | } else {
|
12709 | var checksum = rootElement.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
|
12710 | rootElement.removeAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
|
12711 |
|
12712 | var rootMarkup = rootElement.outerHTML;
|
12713 | rootElement.setAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME, checksum);
|
12714 |
|
12715 | var normalizedMarkup = markup;
|
12716 | if ("development" !== 'production') {
|
12717 |
|
12718 |
|
12719 |
|
12720 |
|
12721 | var normalizer;
|
12722 | if (container.nodeType === ELEMENT_NODE_TYPE) {
|
12723 | normalizer = document.createElement('div');
|
12724 | normalizer.innerHTML = markup;
|
12725 | normalizedMarkup = normalizer.innerHTML;
|
12726 | } else {
|
12727 | normalizer = document.createElement('iframe');
|
12728 | document.body.appendChild(normalizer);
|
12729 | normalizer.contentDocument.write(markup);
|
12730 | normalizedMarkup = normalizer.contentDocument.documentElement.outerHTML;
|
12731 | document.body.removeChild(normalizer);
|
12732 | }
|
12733 | }
|
12734 |
|
12735 | var diffIndex = firstDifferenceIndex(normalizedMarkup, rootMarkup);
|
12736 | var difference = ' (client) ' + normalizedMarkup.substring(diffIndex - 20, diffIndex + 20) + '\n (server) ' + rootMarkup.substring(diffIndex - 20, diffIndex + 20);
|
12737 |
|
12738 | !(container.nodeType !== DOC_NODE_TYPE) ? "development" !== 'production' ? invariant(false, 'You\'re trying to render a component to the document using server rendering but the checksum was invalid. This usually means you rendered a different component type or props on the client from the one on the server, or your render() methods are impure. React cannot handle this case due to cross-browser quirks by rendering at the document root. You should look for environment dependent code in your components and ensure the props are the same client and server side:\n%s', difference) : _prodInvariant('42', difference) : void 0;
|
12739 |
|
12740 | if ("development" !== 'production') {
|
12741 | "development" !== 'production' ? warning(false, 'React attempted to reuse markup in a container but the ' + 'checksum was invalid. This generally means that you are ' + 'using server rendering and the markup generated on the ' + 'server was not what the client was expecting. React injected ' + 'new markup to compensate which works but you have lost many ' + 'of the benefits of server rendering. Instead, figure out ' + 'why the markup being generated is different on the client ' + 'or server:\n%s', difference) : void 0;
|
12742 | }
|
12743 | }
|
12744 | }
|
12745 |
|
12746 | !(container.nodeType !== DOC_NODE_TYPE) ? "development" !== 'production' ? invariant(false, 'You\'re trying to render a component to the document but you didn\'t use server rendering. We can\'t do this without using server rendering due to cross-browser quirks. See ReactDOMServer.renderToString() for server rendering.') : _prodInvariant('43') : void 0;
|
12747 |
|
12748 | if (transaction.useCreateElement) {
|
12749 | while (container.lastChild) {
|
12750 | container.removeChild(container.lastChild);
|
12751 | }
|
12752 | DOMLazyTree.insertTreeBefore(container, markup, null);
|
12753 | } else {
|
12754 | setInnerHTML(container, markup);
|
12755 | ReactDOMComponentTree.precacheNode(instance, container.firstChild);
|
12756 | }
|
12757 |
|
12758 | if ("development" !== 'production') {
|
12759 | var hostNode = ReactDOMComponentTree.getInstanceFromNode(container.firstChild);
|
12760 | if (hostNode._debugID !== 0) {
|
12761 | ReactInstrumentation.debugTool.onHostOperation(hostNode._debugID, 'mount', markup.toString());
|
12762 | }
|
12763 | }
|
12764 | }
|
12765 | };
|
12766 |
|
12767 | module.exports = ReactMount;
|
12768 | },{"10":10,"106":106,"107":107,"148":148,"153":153,"155":155,"158":158,"171":171,"178":178,"187":187,"28":28,"41":41,"46":46,"47":47,"50":50,"65":65,"71":71,"77":77,"78":78,"8":8,"81":81,"95":95}],83:[function(_dereq_,module,exports){
|
12769 |
|
12770 |
|
12771 |
|
12772 |
|
12773 |
|
12774 |
|
12775 |
|
12776 |
|
12777 |
|
12778 |
|
12779 |
|
12780 | 'use strict';
|
12781 |
|
12782 | var _prodInvariant = _dereq_(153);
|
12783 |
|
12784 | var ReactComponentEnvironment = _dereq_(37);
|
12785 | var ReactInstanceMap = _dereq_(77);
|
12786 | var ReactInstrumentation = _dereq_(78);
|
12787 | var ReactMultiChildUpdateTypes = _dereq_(84);
|
12788 |
|
12789 | var ReactCurrentOwner = _dereq_(41);
|
12790 | var ReactReconciler = _dereq_(95);
|
12791 | var ReactChildReconciler = _dereq_(31);
|
12792 |
|
12793 | var emptyFunction = _dereq_(170);
|
12794 | var flattenChildren = _dereq_(137);
|
12795 | var invariant = _dereq_(178);
|
12796 |
|
12797 |
|
12798 |
|
12799 |
|
12800 |
|
12801 |
|
12802 |
|
12803 |
|
12804 | function makeInsertMarkup(markup, afterNode, toIndex) {
|
12805 |
|
12806 | return {
|
12807 | type: ReactMultiChildUpdateTypes.INSERT_MARKUP,
|
12808 | content: markup,
|
12809 | fromIndex: null,
|
12810 | fromNode: null,
|
12811 | toIndex: toIndex,
|
12812 | afterNode: afterNode
|
12813 | };
|
12814 | }
|
12815 |
|
12816 |
|
12817 |
|
12818 |
|
12819 |
|
12820 |
|
12821 |
|
12822 |
|
12823 | function makeMove(child, afterNode, toIndex) {
|
12824 |
|
12825 | return {
|
12826 | type: ReactMultiChildUpdateTypes.MOVE_EXISTING,
|
12827 | content: null,
|
12828 | fromIndex: child._mountIndex,
|
12829 | fromNode: ReactReconciler.getHostNode(child),
|
12830 | toIndex: toIndex,
|
12831 | afterNode: afterNode
|
12832 | };
|
12833 | }
|
12834 |
|
12835 |
|
12836 |
|
12837 |
|
12838 |
|
12839 |
|
12840 |
|
12841 | function makeRemove(child, node) {
|
12842 |
|
12843 | return {
|
12844 | type: ReactMultiChildUpdateTypes.REMOVE_NODE,
|
12845 | content: null,
|
12846 | fromIndex: child._mountIndex,
|
12847 | fromNode: node,
|
12848 | toIndex: null,
|
12849 | afterNode: null
|
12850 | };
|
12851 | }
|
12852 |
|
12853 |
|
12854 |
|
12855 |
|
12856 |
|
12857 |
|
12858 |
|
12859 | function makeSetMarkup(markup) {
|
12860 |
|
12861 | return {
|
12862 | type: ReactMultiChildUpdateTypes.SET_MARKUP,
|
12863 | content: markup,
|
12864 | fromIndex: null,
|
12865 | fromNode: null,
|
12866 | toIndex: null,
|
12867 | afterNode: null
|
12868 | };
|
12869 | }
|
12870 |
|
12871 |
|
12872 |
|
12873 |
|
12874 |
|
12875 |
|
12876 |
|
12877 | function makeTextContent(textContent) {
|
12878 |
|
12879 | return {
|
12880 | type: ReactMultiChildUpdateTypes.TEXT_CONTENT,
|
12881 | content: textContent,
|
12882 | fromIndex: null,
|
12883 | fromNode: null,
|
12884 | toIndex: null,
|
12885 | afterNode: null
|
12886 | };
|
12887 | }
|
12888 |
|
12889 |
|
12890 |
|
12891 |
|
12892 |
|
12893 | function enqueue(queue, update) {
|
12894 | if (update) {
|
12895 | queue = queue || [];
|
12896 | queue.push(update);
|
12897 | }
|
12898 | return queue;
|
12899 | }
|
12900 |
|
12901 |
|
12902 |
|
12903 |
|
12904 |
|
12905 |
|
12906 | function processQueue(inst, updateQueue) {
|
12907 | ReactComponentEnvironment.processChildrenUpdates(inst, updateQueue);
|
12908 | }
|
12909 |
|
12910 | var setChildrenForInstrumentation = emptyFunction;
|
12911 | if ("development" !== 'production') {
|
12912 | var getDebugID = function (inst) {
|
12913 | if (!inst._debugID) {
|
12914 |
|
12915 | var internal;
|
12916 | if (internal = ReactInstanceMap.get(inst)) {
|
12917 | inst = internal;
|
12918 | }
|
12919 | }
|
12920 | return inst._debugID;
|
12921 | };
|
12922 | setChildrenForInstrumentation = function (children) {
|
12923 | var debugID = getDebugID(this);
|
12924 |
|
12925 |
|
12926 | if (debugID !== 0) {
|
12927 | ReactInstrumentation.debugTool.onSetChildren(debugID, children ? Object.keys(children).map(function (key) {
|
12928 | return children[key]._debugID;
|
12929 | }) : []);
|
12930 | }
|
12931 | };
|
12932 | }
|
12933 |
|
12934 |
|
12935 |
|
12936 |
|
12937 |
|
12938 |
|
12939 |
|
12940 | var ReactMultiChild = {
|
12941 |
|
12942 | |
12943 |
|
12944 |
|
12945 |
|
12946 |
|
12947 |
|
12948 |
|
12949 | Mixin: {
|
12950 |
|
12951 | _reconcilerInstantiateChildren: function (nestedChildren, transaction, context) {
|
12952 | if ("development" !== 'production') {
|
12953 | var selfDebugID = getDebugID(this);
|
12954 | if (this._currentElement) {
|
12955 | try {
|
12956 | ReactCurrentOwner.current = this._currentElement._owner;
|
12957 | return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context, selfDebugID);
|
12958 | } finally {
|
12959 | ReactCurrentOwner.current = null;
|
12960 | }
|
12961 | }
|
12962 | }
|
12963 | return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context);
|
12964 | },
|
12965 |
|
12966 | _reconcilerUpdateChildren: function (prevChildren, nextNestedChildrenElements, mountImages, removedNodes, transaction, context) {
|
12967 | var nextChildren;
|
12968 | var selfDebugID = 0;
|
12969 | if ("development" !== 'production') {
|
12970 | selfDebugID = getDebugID(this);
|
12971 | if (this._currentElement) {
|
12972 | try {
|
12973 | ReactCurrentOwner.current = this._currentElement._owner;
|
12974 | nextChildren = flattenChildren(nextNestedChildrenElements, selfDebugID);
|
12975 | } finally {
|
12976 | ReactCurrentOwner.current = null;
|
12977 | }
|
12978 | ReactChildReconciler.updateChildren(prevChildren, nextChildren, mountImages, removedNodes, transaction, this, this._hostContainerInfo, context, selfDebugID);
|
12979 | return nextChildren;
|
12980 | }
|
12981 | }
|
12982 | nextChildren = flattenChildren(nextNestedChildrenElements, selfDebugID);
|
12983 | ReactChildReconciler.updateChildren(prevChildren, nextChildren, mountImages, removedNodes, transaction, this, this._hostContainerInfo, context, selfDebugID);
|
12984 | return nextChildren;
|
12985 | },
|
12986 |
|
12987 | |
12988 |
|
12989 |
|
12990 |
|
12991 |
|
12992 |
|
12993 |
|
12994 |
|
12995 | mountChildren: function (nestedChildren, transaction, context) {
|
12996 | var children = this._reconcilerInstantiateChildren(nestedChildren, transaction, context);
|
12997 | this._renderedChildren = children;
|
12998 |
|
12999 | var mountImages = [];
|
13000 | var index = 0;
|
13001 | for (var name in children) {
|
13002 | if (children.hasOwnProperty(name)) {
|
13003 | var child = children[name];
|
13004 | var selfDebugID = 0;
|
13005 | if ("development" !== 'production') {
|
13006 | selfDebugID = getDebugID(this);
|
13007 | }
|
13008 | var mountImage = ReactReconciler.mountComponent(child, transaction, this, this._hostContainerInfo, context, selfDebugID);
|
13009 | child._mountIndex = index++;
|
13010 | mountImages.push(mountImage);
|
13011 | }
|
13012 | }
|
13013 |
|
13014 | if ("development" !== 'production') {
|
13015 | setChildrenForInstrumentation.call(this, children);
|
13016 | }
|
13017 |
|
13018 | return mountImages;
|
13019 | },
|
13020 |
|
13021 | |
13022 |
|
13023 |
|
13024 |
|
13025 |
|
13026 |
|
13027 | updateTextContent: function (nextContent) {
|
13028 | var prevChildren = this._renderedChildren;
|
13029 |
|
13030 | ReactChildReconciler.unmountChildren(prevChildren, false);
|
13031 | for (var name in prevChildren) {
|
13032 | if (prevChildren.hasOwnProperty(name)) {
|
13033 | !false ? "development" !== 'production' ? invariant(false, 'updateTextContent called on non-empty component.') : _prodInvariant('118') : void 0;
|
13034 | }
|
13035 | }
|
13036 |
|
13037 | var updates = [makeTextContent(nextContent)];
|
13038 | processQueue(this, updates);
|
13039 | },
|
13040 |
|
13041 | |
13042 |
|
13043 |
|
13044 |
|
13045 |
|
13046 |
|
13047 | updateMarkup: function (nextMarkup) {
|
13048 | var prevChildren = this._renderedChildren;
|
13049 |
|
13050 | ReactChildReconciler.unmountChildren(prevChildren, false);
|
13051 | for (var name in prevChildren) {
|
13052 | if (prevChildren.hasOwnProperty(name)) {
|
13053 | !false ? "development" !== 'production' ? invariant(false, 'updateTextContent called on non-empty component.') : _prodInvariant('118') : void 0;
|
13054 | }
|
13055 | }
|
13056 | var updates = [makeSetMarkup(nextMarkup)];
|
13057 | processQueue(this, updates);
|
13058 | },
|
13059 |
|
13060 | |
13061 |
|
13062 |
|
13063 |
|
13064 |
|
13065 |
|
13066 |
|
13067 | updateChildren: function (nextNestedChildrenElements, transaction, context) {
|
13068 |
|
13069 | this._updateChildren(nextNestedChildrenElements, transaction, context);
|
13070 | },
|
13071 |
|
13072 | |
13073 |
|
13074 |
|
13075 |
|
13076 |
|
13077 |
|
13078 | _updateChildren: function (nextNestedChildrenElements, transaction, context) {
|
13079 | var prevChildren = this._renderedChildren;
|
13080 | var removedNodes = {};
|
13081 | var mountImages = [];
|
13082 | var nextChildren = this._reconcilerUpdateChildren(prevChildren, nextNestedChildrenElements, mountImages, removedNodes, transaction, context);
|
13083 | if (!nextChildren && !prevChildren) {
|
13084 | return;
|
13085 | }
|
13086 | var updates = null;
|
13087 | var name;
|
13088 |
|
13089 |
|
13090 | var nextIndex = 0;
|
13091 | var lastIndex = 0;
|
13092 |
|
13093 | var nextMountIndex = 0;
|
13094 | var lastPlacedNode = null;
|
13095 | for (name in nextChildren) {
|
13096 | if (!nextChildren.hasOwnProperty(name)) {
|
13097 | continue;
|
13098 | }
|
13099 | var prevChild = prevChildren && prevChildren[name];
|
13100 | var nextChild = nextChildren[name];
|
13101 | if (prevChild === nextChild) {
|
13102 | updates = enqueue(updates, this.moveChild(prevChild, lastPlacedNode, nextIndex, lastIndex));
|
13103 | lastIndex = Math.max(prevChild._mountIndex, lastIndex);
|
13104 | prevChild._mountIndex = nextIndex;
|
13105 | } else {
|
13106 | if (prevChild) {
|
13107 |
|
13108 | lastIndex = Math.max(prevChild._mountIndex, lastIndex);
|
13109 |
|
13110 | }
|
13111 |
|
13112 | updates = enqueue(updates, this._mountChildAtIndex(nextChild, mountImages[nextMountIndex], lastPlacedNode, nextIndex, transaction, context));
|
13113 | nextMountIndex++;
|
13114 | }
|
13115 | nextIndex++;
|
13116 | lastPlacedNode = ReactReconciler.getHostNode(nextChild);
|
13117 | }
|
13118 |
|
13119 | for (name in removedNodes) {
|
13120 | if (removedNodes.hasOwnProperty(name)) {
|
13121 | updates = enqueue(updates, this._unmountChild(prevChildren[name], removedNodes[name]));
|
13122 | }
|
13123 | }
|
13124 | if (updates) {
|
13125 | processQueue(this, updates);
|
13126 | }
|
13127 | this._renderedChildren = nextChildren;
|
13128 |
|
13129 | if ("development" !== 'production') {
|
13130 | setChildrenForInstrumentation.call(this, nextChildren);
|
13131 | }
|
13132 | },
|
13133 |
|
13134 | |
13135 |
|
13136 |
|
13137 |
|
13138 |
|
13139 |
|
13140 |
|
13141 | unmountChildren: function (safely) {
|
13142 | var renderedChildren = this._renderedChildren;
|
13143 | ReactChildReconciler.unmountChildren(renderedChildren, safely);
|
13144 | this._renderedChildren = null;
|
13145 | },
|
13146 |
|
13147 | |
13148 |
|
13149 |
|
13150 |
|
13151 |
|
13152 |
|
13153 |
|
13154 |
|
13155 | moveChild: function (child, afterNode, toIndex, lastIndex) {
|
13156 |
|
13157 |
|
13158 |
|
13159 | if (child._mountIndex < lastIndex) {
|
13160 | return makeMove(child, afterNode, toIndex);
|
13161 | }
|
13162 | },
|
13163 |
|
13164 | |
13165 |
|
13166 |
|
13167 |
|
13168 |
|
13169 |
|
13170 |
|
13171 | createChild: function (child, afterNode, mountImage) {
|
13172 | return makeInsertMarkup(mountImage, afterNode, child._mountIndex);
|
13173 | },
|
13174 |
|
13175 | |
13176 |
|
13177 |
|
13178 |
|
13179 |
|
13180 |
|
13181 | removeChild: function (child, node) {
|
13182 | return makeRemove(child, node);
|
13183 | },
|
13184 |
|
13185 | |
13186 |
|
13187 |
|
13188 |
|
13189 |
|
13190 |
|
13191 |
|
13192 |
|
13193 |
|
13194 |
|
13195 |
|
13196 | _mountChildAtIndex: function (child, mountImage, afterNode, index, transaction, context) {
|
13197 | child._mountIndex = index;
|
13198 | return this.createChild(child, afterNode, mountImage);
|
13199 | },
|
13200 |
|
13201 | |
13202 |
|
13203 |
|
13204 |
|
13205 |
|
13206 |
|
13207 |
|
13208 |
|
13209 | _unmountChild: function (child, node) {
|
13210 | var update = this.removeChild(child, node);
|
13211 | child._mountIndex = null;
|
13212 | return update;
|
13213 | }
|
13214 |
|
13215 | }
|
13216 |
|
13217 | };
|
13218 |
|
13219 | module.exports = ReactMultiChild;
|
13220 | },{"137":137,"153":153,"170":170,"178":178,"31":31,"37":37,"41":41,"77":77,"78":78,"84":84,"95":95}],84:[function(_dereq_,module,exports){
|
13221 |
|
13222 |
|
13223 |
|
13224 |
|
13225 |
|
13226 |
|
13227 |
|
13228 |
|
13229 |
|
13230 |
|
13231 |
|
13232 | 'use strict';
|
13233 |
|
13234 | var keyMirror = _dereq_(181);
|
13235 |
|
13236 |
|
13237 |
|
13238 |
|
13239 |
|
13240 |
|
13241 |
|
13242 |
|
13243 |
|
13244 | var ReactMultiChildUpdateTypes = keyMirror({
|
13245 | INSERT_MARKUP: null,
|
13246 | MOVE_EXISTING: null,
|
13247 | REMOVE_NODE: null,
|
13248 | SET_MARKUP: null,
|
13249 | TEXT_CONTENT: null
|
13250 | });
|
13251 |
|
13252 | module.exports = ReactMultiChildUpdateTypes;
|
13253 | },{"181":181}],85:[function(_dereq_,module,exports){
|
13254 |
|
13255 |
|
13256 |
|
13257 |
|
13258 |
|
13259 |
|
13260 |
|
13261 |
|
13262 |
|
13263 |
|
13264 |
|
13265 |
|
13266 | 'use strict';
|
13267 |
|
13268 | var _prodInvariant = _dereq_(153);
|
13269 |
|
13270 | var ReactElement = _dereq_(65);
|
13271 |
|
13272 | var invariant = _dereq_(178);
|
13273 |
|
13274 | var ReactNodeTypes = {
|
13275 | HOST: 0,
|
13276 | COMPOSITE: 1,
|
13277 | EMPTY: 2,
|
13278 |
|
13279 | getType: function (node) {
|
13280 | if (node === null || node === false) {
|
13281 | return ReactNodeTypes.EMPTY;
|
13282 | } else if (ReactElement.isValidElement(node)) {
|
13283 | if (typeof node.type === 'function') {
|
13284 | return ReactNodeTypes.COMPOSITE;
|
13285 | } else {
|
13286 | return ReactNodeTypes.HOST;
|
13287 | }
|
13288 | }
|
13289 | !false ? "development" !== 'production' ? invariant(false, 'Unexpected node: %s', node) : _prodInvariant('26', node) : void 0;
|
13290 | }
|
13291 | };
|
13292 |
|
13293 | module.exports = ReactNodeTypes;
|
13294 | },{"153":153,"178":178,"65":65}],86:[function(_dereq_,module,exports){
|
13295 |
|
13296 |
|
13297 |
|
13298 |
|
13299 |
|
13300 |
|
13301 |
|
13302 |
|
13303 |
|
13304 |
|
13305 |
|
13306 | 'use strict';
|
13307 |
|
13308 | var warning = _dereq_(187);
|
13309 |
|
13310 | function warnNoop(publicInstance, callerName) {
|
13311 | if ("development" !== 'production') {
|
13312 | var constructor = publicInstance.constructor;
|
13313 | "development" !== 'production' ? warning(false, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, constructor && (constructor.displayName || constructor.name) || 'ReactClass') : void 0;
|
13314 | }
|
13315 | }
|
13316 |
|
13317 | /**
|
13318 | * This is the abstract API for an update queue.
|
13319 | */
|
13320 | var ReactNoopUpdateQueue = {
|
13321 |
|
13322 | |
13323 |
|
13324 |
|
13325 |
|
13326 |
|
13327 |
|
13328 |
|
13329 | isMounted: function (publicInstance) {
|
13330 | return false;
|
13331 | },
|
13332 |
|
13333 | |
13334 |
|
13335 |
|
13336 |
|
13337 |
|
13338 |
|
13339 |
|
13340 |
|
13341 | enqueueCallback: function (publicInstance, callback) {},
|
13342 |
|
13343 | |
13344 |
|
13345 |
|
13346 |
|
13347 |
|
13348 |
|
13349 |
|
13350 |
|
13351 |
|
13352 |
|
13353 |
|
13354 |
|
13355 |
|
13356 | enqueueForceUpdate: function (publicInstance) {
|
13357 | warnNoop(publicInstance, 'forceUpdate');
|
13358 | },
|
13359 |
|
13360 | |
13361 |
|
13362 |
|
13363 |
|
13364 |
|
13365 |
|
13366 |
|
13367 |
|
13368 |
|
13369 |
|
13370 |
|
13371 | enqueueReplaceState: function (publicInstance, completeState) {
|
13372 | warnNoop(publicInstance, 'replaceState');
|
13373 | },
|
13374 |
|
13375 | |
13376 |
|
13377 |
|
13378 |
|
13379 |
|
13380 |
|
13381 |
|
13382 |
|
13383 |
|
13384 |
|
13385 | enqueueSetState: function (publicInstance, partialState) {
|
13386 | warnNoop(publicInstance, 'setState');
|
13387 | }
|
13388 | };
|
13389 |
|
13390 | module.exports = ReactNoopUpdateQueue;
|
13391 | },{"187":187}],87:[function(_dereq_,module,exports){
|
13392 |
|
13393 |
|
13394 |
|
13395 |
|
13396 |
|
13397 |
|
13398 |
|
13399 |
|
13400 |
|
13401 |
|
13402 |
|
13403 | 'use strict';
|
13404 |
|
13405 | var _prodInvariant = _dereq_(153);
|
13406 |
|
13407 | var invariant = _dereq_(178);
|
13408 |
|
13409 |
|
13410 |
|
13411 |
|
13412 |
|
13413 |
|
13414 |
|
13415 |
|
13416 |
|
13417 |
|
13418 |
|
13419 |
|
13420 |
|
13421 |
|
13422 |
|
13423 |
|
13424 |
|
13425 |
|
13426 |
|
13427 |
|
13428 |
|
13429 |
|
13430 |
|
13431 |
|
13432 |
|
13433 |
|
13434 |
|
13435 |
|
13436 |
|
13437 |
|
13438 |
|
13439 | var ReactOwner = {
|
13440 |
|
13441 | |
13442 |
|
13443 |
|
13444 |
|
13445 |
|
13446 | isValidOwner: function (object) {
|
13447 | return !!(object && typeof object.attachRef === 'function' && typeof object.detachRef === 'function');
|
13448 | },
|
13449 |
|
13450 | |
13451 |
|
13452 |
|
13453 |
|
13454 |
|
13455 |
|
13456 |
|
13457 |
|
13458 |
|
13459 | addComponentAsRefTo: function (component, ref, owner) {
|
13460 | !ReactOwner.isValidOwner(owner) ? "development" !== 'production' ? invariant(false, 'addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component\'s `render` method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).') : _prodInvariant('119') : void 0;
|
13461 | owner.attachRef(ref, component);
|
13462 | },
|
13463 |
|
13464 | |
13465 |
|
13466 |
|
13467 |
|
13468 |
|
13469 |
|
13470 |
|
13471 |
|
13472 |
|
13473 | removeComponentAsRefFrom: function (component, ref, owner) {
|
13474 | !ReactOwner.isValidOwner(owner) ? "development" !== 'production' ? invariant(false, 'removeComponentAsRefFrom(...): Only a ReactOwner can have refs. You might be removing a ref to a component that was not created inside a component\'s `render` method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).') : _prodInvariant('120') : void 0;
|
13475 | var ownerPublicInstance = owner.getPublicInstance();
|
13476 |
|
13477 |
|
13478 | if (ownerPublicInstance && ownerPublicInstance.refs[ref] === component.getPublicInstance()) {
|
13479 | owner.detachRef(ref);
|
13480 | }
|
13481 | }
|
13482 |
|
13483 | };
|
13484 |
|
13485 | module.exports = ReactOwner;
|
13486 | },{"153":153,"178":178}],88:[function(_dereq_,module,exports){
|
13487 |
|
13488 |
|
13489 |
|
13490 |
|
13491 |
|
13492 |
|
13493 |
|
13494 |
|
13495 |
|
13496 |
|
13497 |
|
13498 | 'use strict';
|
13499 |
|
13500 | var _assign = _dereq_(188);
|
13501 |
|
13502 | var _extends = _assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
13503 |
|
13504 | var ReactDebugTool = _dereq_(62);
|
13505 | var warning = _dereq_(187);
|
13506 | var alreadyWarned = false;
|
13507 |
|
13508 | function roundFloat(val) {
|
13509 | var base = arguments.length <= 1 || arguments[1] === undefined ? 2 : arguments[1];
|
13510 |
|
13511 | var n = Math.pow(10, base);
|
13512 | return Math.floor(val * n) / n;
|
13513 | }
|
13514 |
|
13515 | function warnInProduction() {
|
13516 | if (alreadyWarned) {
|
13517 | return;
|
13518 | }
|
13519 | alreadyWarned = true;
|
13520 | if (typeof console !== 'undefined') {
|
13521 | console.error('ReactPerf is not supported in the production builds of React. ' + 'To collect measurements, please use the development build of React instead.');
|
13522 | }
|
13523 | }
|
13524 |
|
13525 | function getLastMeasurements() {
|
13526 | if (!("development" !== 'production')) {
|
13527 | warnInProduction();
|
13528 | return [];
|
13529 | }
|
13530 |
|
13531 | return ReactDebugTool.getFlushHistory();
|
13532 | }
|
13533 |
|
13534 | function getExclusive() {
|
13535 | var flushHistory = arguments.length <= 0 || arguments[0] === undefined ? getLastMeasurements() : arguments[0];
|
13536 |
|
13537 | if (!("development" !== 'production')) {
|
13538 | warnInProduction();
|
13539 | return [];
|
13540 | }
|
13541 |
|
13542 | var aggregatedStats = {};
|
13543 | var affectedIDs = {};
|
13544 |
|
13545 | function updateAggregatedStats(treeSnapshot, instanceID, timerType, applyUpdate) {
|
13546 | var displayName = treeSnapshot[instanceID].displayName;
|
13547 |
|
13548 | var key = displayName;
|
13549 | var stats = aggregatedStats[key];
|
13550 | if (!stats) {
|
13551 | affectedIDs[key] = {};
|
13552 | stats = aggregatedStats[key] = {
|
13553 | key: key,
|
13554 | instanceCount: 0,
|
13555 | counts: {},
|
13556 | durations: {},
|
13557 | totalDuration: 0
|
13558 | };
|
13559 | }
|
13560 | if (!stats.durations[timerType]) {
|
13561 | stats.durations[timerType] = 0;
|
13562 | }
|
13563 | if (!stats.counts[timerType]) {
|
13564 | stats.counts[timerType] = 0;
|
13565 | }
|
13566 | affectedIDs[key][instanceID] = true;
|
13567 | applyUpdate(stats);
|
13568 | }
|
13569 |
|
13570 | flushHistory.forEach(function (flush) {
|
13571 | var measurements = flush.measurements;
|
13572 | var treeSnapshot = flush.treeSnapshot;
|
13573 |
|
13574 | measurements.forEach(function (measurement) {
|
13575 | var duration = measurement.duration;
|
13576 | var instanceID = measurement.instanceID;
|
13577 | var timerType = measurement.timerType;
|
13578 |
|
13579 | updateAggregatedStats(treeSnapshot, instanceID, timerType, function (stats) {
|
13580 | stats.totalDuration += duration;
|
13581 | stats.durations[timerType] += duration;
|
13582 | stats.counts[timerType]++;
|
13583 | });
|
13584 | });
|
13585 | });
|
13586 |
|
13587 | return Object.keys(aggregatedStats).map(function (key) {
|
13588 | return _extends({}, aggregatedStats[key], {
|
13589 | instanceCount: Object.keys(affectedIDs[key]).length
|
13590 | });
|
13591 | }).sort(function (a, b) {
|
13592 | return b.totalDuration - a.totalDuration;
|
13593 | });
|
13594 | }
|
13595 |
|
13596 | function getInclusive() {
|
13597 | var flushHistory = arguments.length <= 0 || arguments[0] === undefined ? getLastMeasurements() : arguments[0];
|
13598 |
|
13599 | if (!("development" !== 'production')) {
|
13600 | warnInProduction();
|
13601 | return [];
|
13602 | }
|
13603 |
|
13604 | var aggregatedStats = {};
|
13605 | var affectedIDs = {};
|
13606 |
|
13607 | function updateAggregatedStats(treeSnapshot, instanceID, applyUpdate) {
|
13608 | var _treeSnapshot$instanc = treeSnapshot[instanceID];
|
13609 | var displayName = _treeSnapshot$instanc.displayName;
|
13610 | var ownerID = _treeSnapshot$instanc.ownerID;
|
13611 |
|
13612 | var owner = treeSnapshot[ownerID];
|
13613 | var key = (owner ? owner.displayName + ' > ' : '') + displayName;
|
13614 | var stats = aggregatedStats[key];
|
13615 | if (!stats) {
|
13616 | affectedIDs[key] = {};
|
13617 | stats = aggregatedStats[key] = {
|
13618 | key: key,
|
13619 | instanceCount: 0,
|
13620 | inclusiveRenderDuration: 0,
|
13621 | renderCount: 0
|
13622 | };
|
13623 | }
|
13624 | affectedIDs[key][instanceID] = true;
|
13625 | applyUpdate(stats);
|
13626 | }
|
13627 |
|
13628 | var isCompositeByID = {};
|
13629 | flushHistory.forEach(function (flush) {
|
13630 | var measurements = flush.measurements;
|
13631 |
|
13632 | measurements.forEach(function (measurement) {
|
13633 | var instanceID = measurement.instanceID;
|
13634 | var timerType = measurement.timerType;
|
13635 |
|
13636 | if (timerType !== 'render') {
|
13637 | return;
|
13638 | }
|
13639 | isCompositeByID[instanceID] = true;
|
13640 | });
|
13641 | });
|
13642 |
|
13643 | flushHistory.forEach(function (flush) {
|
13644 | var measurements = flush.measurements;
|
13645 | var treeSnapshot = flush.treeSnapshot;
|
13646 |
|
13647 | measurements.forEach(function (measurement) {
|
13648 | var duration = measurement.duration;
|
13649 | var instanceID = measurement.instanceID;
|
13650 | var timerType = measurement.timerType;
|
13651 |
|
13652 | if (timerType !== 'render') {
|
13653 | return;
|
13654 | }
|
13655 | updateAggregatedStats(treeSnapshot, instanceID, function (stats) {
|
13656 | stats.renderCount++;
|
13657 | });
|
13658 | var nextParentID = instanceID;
|
13659 | while (nextParentID) {
|
13660 |
|
13661 |
|
13662 | if (isCompositeByID[nextParentID]) {
|
13663 | updateAggregatedStats(treeSnapshot, nextParentID, function (stats) {
|
13664 | stats.inclusiveRenderDuration += duration;
|
13665 | });
|
13666 | }
|
13667 | nextParentID = treeSnapshot[nextParentID].parentID;
|
13668 | }
|
13669 | });
|
13670 | });
|
13671 |
|
13672 | return Object.keys(aggregatedStats).map(function (key) {
|
13673 | return _extends({}, aggregatedStats[key], {
|
13674 | instanceCount: Object.keys(affectedIDs[key]).length
|
13675 | });
|
13676 | }).sort(function (a, b) {
|
13677 | return b.inclusiveRenderDuration - a.inclusiveRenderDuration;
|
13678 | });
|
13679 | }
|
13680 |
|
13681 | function getWasted() {
|
13682 | var flushHistory = arguments.length <= 0 || arguments[0] === undefined ? getLastMeasurements() : arguments[0];
|
13683 |
|
13684 | if (!("development" !== 'production')) {
|
13685 | warnInProduction();
|
13686 | return [];
|
13687 | }
|
13688 |
|
13689 | var aggregatedStats = {};
|
13690 | var affectedIDs = {};
|
13691 |
|
13692 | function updateAggregatedStats(treeSnapshot, instanceID, applyUpdate) {
|
13693 | var _treeSnapshot$instanc2 = treeSnapshot[instanceID];
|
13694 | var displayName = _treeSnapshot$instanc2.displayName;
|
13695 | var ownerID = _treeSnapshot$instanc2.ownerID;
|
13696 |
|
13697 | var owner = treeSnapshot[ownerID];
|
13698 | var key = (owner ? owner.displayName + ' > ' : '') + displayName;
|
13699 | var stats = aggregatedStats[key];
|
13700 | if (!stats) {
|
13701 | affectedIDs[key] = {};
|
13702 | stats = aggregatedStats[key] = {
|
13703 | key: key,
|
13704 | instanceCount: 0,
|
13705 | inclusiveRenderDuration: 0,
|
13706 | renderCount: 0
|
13707 | };
|
13708 | }
|
13709 | affectedIDs[key][instanceID] = true;
|
13710 | applyUpdate(stats);
|
13711 | }
|
13712 |
|
13713 | flushHistory.forEach(function (flush) {
|
13714 | var measurements = flush.measurements;
|
13715 | var treeSnapshot = flush.treeSnapshot;
|
13716 | var operations = flush.operations;
|
13717 |
|
13718 | var isDefinitelyNotWastedByID = {};
|
13719 |
|
13720 |
|
13721 |
|
13722 | operations.forEach(function (operation) {
|
13723 | var instanceID = operation.instanceID;
|
13724 |
|
13725 | var nextParentID = instanceID;
|
13726 | while (nextParentID) {
|
13727 | isDefinitelyNotWastedByID[nextParentID] = true;
|
13728 | nextParentID = treeSnapshot[nextParentID].parentID;
|
13729 | }
|
13730 | });
|
13731 |
|
13732 |
|
13733 |
|
13734 | var renderedCompositeIDs = {};
|
13735 | measurements.forEach(function (measurement) {
|
13736 | var instanceID = measurement.instanceID;
|
13737 | var timerType = measurement.timerType;
|
13738 |
|
13739 | if (timerType !== 'render') {
|
13740 | return;
|
13741 | }
|
13742 | renderedCompositeIDs[instanceID] = true;
|
13743 | });
|
13744 |
|
13745 | measurements.forEach(function (measurement) {
|
13746 | var duration = measurement.duration;
|
13747 | var instanceID = measurement.instanceID;
|
13748 | var timerType = measurement.timerType;
|
13749 |
|
13750 | if (timerType !== 'render') {
|
13751 | return;
|
13752 | }
|
13753 |
|
13754 |
|
13755 |
|
13756 | var updateCount = treeSnapshot[instanceID].updateCount;
|
13757 |
|
13758 | if (isDefinitelyNotWastedByID[instanceID] || updateCount === 0) {
|
13759 | return;
|
13760 | }
|
13761 |
|
13762 |
|
13763 | updateAggregatedStats(treeSnapshot, instanceID, function (stats) {
|
13764 | stats.renderCount++;
|
13765 | });
|
13766 |
|
13767 | var nextParentID = instanceID;
|
13768 | while (nextParentID) {
|
13769 |
|
13770 |
|
13771 | var isWasted = renderedCompositeIDs[nextParentID] && !isDefinitelyNotWastedByID[nextParentID];
|
13772 | if (isWasted) {
|
13773 | updateAggregatedStats(treeSnapshot, nextParentID, function (stats) {
|
13774 | stats.inclusiveRenderDuration += duration;
|
13775 | });
|
13776 | }
|
13777 | nextParentID = treeSnapshot[nextParentID].parentID;
|
13778 | }
|
13779 | });
|
13780 | });
|
13781 |
|
13782 | return Object.keys(aggregatedStats).map(function (key) {
|
13783 | return _extends({}, aggregatedStats[key], {
|
13784 | instanceCount: Object.keys(affectedIDs[key]).length
|
13785 | });
|
13786 | }).sort(function (a, b) {
|
13787 | return b.inclusiveRenderDuration - a.inclusiveRenderDuration;
|
13788 | });
|
13789 | }
|
13790 |
|
13791 | function getOperations() {
|
13792 | var flushHistory = arguments.length <= 0 || arguments[0] === undefined ? getLastMeasurements() : arguments[0];
|
13793 |
|
13794 | if (!("development" !== 'production')) {
|
13795 | warnInProduction();
|
13796 | return [];
|
13797 | }
|
13798 |
|
13799 | var stats = [];
|
13800 | flushHistory.forEach(function (flush, flushIndex) {
|
13801 | var operations = flush.operations;
|
13802 | var treeSnapshot = flush.treeSnapshot;
|
13803 |
|
13804 | operations.forEach(function (operation) {
|
13805 | var instanceID = operation.instanceID;
|
13806 | var type = operation.type;
|
13807 | var payload = operation.payload;
|
13808 | var _treeSnapshot$instanc3 = treeSnapshot[instanceID];
|
13809 | var displayName = _treeSnapshot$instanc3.displayName;
|
13810 | var ownerID = _treeSnapshot$instanc3.ownerID;
|
13811 |
|
13812 | var owner = treeSnapshot[ownerID];
|
13813 | var key = (owner ? owner.displayName + ' > ' : '') + displayName;
|
13814 |
|
13815 | stats.push({
|
13816 | flushIndex: flushIndex,
|
13817 | instanceID: instanceID,
|
13818 | key: key,
|
13819 | type: type,
|
13820 | ownerID: ownerID,
|
13821 | payload: payload
|
13822 | });
|
13823 | });
|
13824 | });
|
13825 | return stats;
|
13826 | }
|
13827 |
|
13828 | function printExclusive(flushHistory) {
|
13829 | if (!("development" !== 'production')) {
|
13830 | warnInProduction();
|
13831 | return;
|
13832 | }
|
13833 |
|
13834 | var stats = getExclusive(flushHistory);
|
13835 | var table = stats.map(function (item) {
|
13836 | var key = item.key;
|
13837 | var instanceCount = item.instanceCount;
|
13838 | var totalDuration = item.totalDuration;
|
13839 |
|
13840 | var renderCount = item.counts.render || 0;
|
13841 | var renderDuration = item.durations.render || 0;
|
13842 | return {
|
13843 | 'Component': key,
|
13844 | 'Total time (ms)': roundFloat(totalDuration),
|
13845 | 'Instance count': instanceCount,
|
13846 | 'Total render time (ms)': roundFloat(renderDuration),
|
13847 | 'Average render time (ms)': renderCount ? roundFloat(renderDuration / renderCount) : undefined,
|
13848 | 'Render count': renderCount,
|
13849 | 'Total lifecycle time (ms)': roundFloat(totalDuration - renderDuration)
|
13850 | };
|
13851 | });
|
13852 | console.table(table);
|
13853 | }
|
13854 |
|
13855 | function printInclusive(flushHistory) {
|
13856 | if (!("development" !== 'production')) {
|
13857 | warnInProduction();
|
13858 | return;
|
13859 | }
|
13860 |
|
13861 | var stats = getInclusive(flushHistory);
|
13862 | var table = stats.map(function (item) {
|
13863 | var key = item.key;
|
13864 | var instanceCount = item.instanceCount;
|
13865 | var inclusiveRenderDuration = item.inclusiveRenderDuration;
|
13866 | var renderCount = item.renderCount;
|
13867 |
|
13868 | return {
|
13869 | 'Owner > Component': key,
|
13870 | 'Inclusive render time (ms)': roundFloat(inclusiveRenderDuration),
|
13871 | 'Instance count': instanceCount,
|
13872 | 'Render count': renderCount
|
13873 | };
|
13874 | });
|
13875 | console.table(table);
|
13876 | }
|
13877 |
|
13878 | function printWasted(flushHistory) {
|
13879 | if (!("development" !== 'production')) {
|
13880 | warnInProduction();
|
13881 | return;
|
13882 | }
|
13883 |
|
13884 | var stats = getWasted(flushHistory);
|
13885 | var table = stats.map(function (item) {
|
13886 | var key = item.key;
|
13887 | var instanceCount = item.instanceCount;
|
13888 | var inclusiveRenderDuration = item.inclusiveRenderDuration;
|
13889 | var renderCount = item.renderCount;
|
13890 |
|
13891 | return {
|
13892 | 'Owner > Component': key,
|
13893 | 'Inclusive wasted time (ms)': roundFloat(inclusiveRenderDuration),
|
13894 | 'Instance count': instanceCount,
|
13895 | 'Render count': renderCount
|
13896 | };
|
13897 | });
|
13898 | console.table(table);
|
13899 | }
|
13900 |
|
13901 | function printOperations(flushHistory) {
|
13902 | if (!("development" !== 'production')) {
|
13903 | warnInProduction();
|
13904 | return;
|
13905 | }
|
13906 |
|
13907 | var stats = getOperations(flushHistory);
|
13908 | var table = stats.map(function (stat) {
|
13909 | return {
|
13910 | 'Owner > Node': stat.key,
|
13911 | 'Operation': stat.type,
|
13912 | 'Payload': typeof stat.payload === 'object' ? JSON.stringify(stat.payload) : stat.payload,
|
13913 | 'Flush index': stat.flushIndex,
|
13914 | 'Owner Component ID': stat.ownerID,
|
13915 | 'DOM Component ID': stat.instanceID
|
13916 | };
|
13917 | });
|
13918 | console.table(table);
|
13919 | }
|
13920 |
|
13921 | var warnedAboutPrintDOM = false;
|
13922 | function printDOM(measurements) {
|
13923 | "development" !== 'production' ? warning(warnedAboutPrintDOM, '`ReactPerf.printDOM(...)` is deprecated. Use ' + '`ReactPerf.printOperations(...)` instead.') : void 0;
|
13924 | warnedAboutPrintDOM = true;
|
13925 | return printOperations(measurements);
|
13926 | }
|
13927 |
|
13928 | var warnedAboutGetMeasurementsSummaryMap = false;
|
13929 | function getMeasurementsSummaryMap(measurements) {
|
13930 | "development" !== 'production' ? warning(warnedAboutGetMeasurementsSummaryMap, '`ReactPerf.getMeasurementsSummaryMap(...)` is deprecated. Use ' + '`ReactPerf.getWasted(...)` instead.') : void 0;
|
13931 | warnedAboutGetMeasurementsSummaryMap = true;
|
13932 | return getWasted(measurements);
|
13933 | }
|
13934 |
|
13935 | function start() {
|
13936 | if (!("development" !== 'production')) {
|
13937 | warnInProduction();
|
13938 | return;
|
13939 | }
|
13940 |
|
13941 | ReactDebugTool.beginProfiling();
|
13942 | }
|
13943 |
|
13944 | function stop() {
|
13945 | if (!("development" !== 'production')) {
|
13946 | warnInProduction();
|
13947 | return;
|
13948 | }
|
13949 |
|
13950 | ReactDebugTool.endProfiling();
|
13951 | }
|
13952 |
|
13953 | function isRunning() {
|
13954 | if (!("development" !== 'production')) {
|
13955 | warnInProduction();
|
13956 | return false;
|
13957 | }
|
13958 |
|
13959 | return ReactDebugTool.isProfiling();
|
13960 | }
|
13961 |
|
13962 | var ReactPerfAnalysis = {
|
13963 | getLastMeasurements: getLastMeasurements,
|
13964 | getExclusive: getExclusive,
|
13965 | getInclusive: getInclusive,
|
13966 | getWasted: getWasted,
|
13967 | getOperations: getOperations,
|
13968 | printExclusive: printExclusive,
|
13969 | printInclusive: printInclusive,
|
13970 | printWasted: printWasted,
|
13971 | printOperations: printOperations,
|
13972 | start: start,
|
13973 | stop: stop,
|
13974 | isRunning: isRunning,
|
13975 |
|
13976 | printDOM: printDOM,
|
13977 | getMeasurementsSummaryMap: getMeasurementsSummaryMap
|
13978 | };
|
13979 |
|
13980 | module.exports = ReactPerfAnalysis;
|
13981 | },{"187":187,"188":188,"62":62}],89:[function(_dereq_,module,exports){
|
13982 |
|
13983 |
|
13984 |
|
13985 |
|
13986 |
|
13987 |
|
13988 |
|
13989 |
|
13990 |
|
13991 |
|
13992 |
|
13993 | 'use strict';
|
13994 |
|
13995 | var ReactPropTypeLocationNames = {};
|
13996 |
|
13997 | if ("development" !== 'production') {
|
13998 | ReactPropTypeLocationNames = {
|
13999 | prop: 'prop',
|
14000 | context: 'context',
|
14001 | childContext: 'child context'
|
14002 | };
|
14003 | }
|
14004 |
|
14005 | module.exports = ReactPropTypeLocationNames;
|
14006 | },{}],90:[function(_dereq_,module,exports){
|
14007 |
|
14008 |
|
14009 |
|
14010 |
|
14011 |
|
14012 |
|
14013 |
|
14014 |
|
14015 |
|
14016 |
|
14017 |
|
14018 | 'use strict';
|
14019 |
|
14020 | var keyMirror = _dereq_(181);
|
14021 |
|
14022 | var ReactPropTypeLocations = keyMirror({
|
14023 | prop: null,
|
14024 | context: null,
|
14025 | childContext: null
|
14026 | });
|
14027 |
|
14028 | module.exports = ReactPropTypeLocations;
|
14029 | },{"181":181}],91:[function(_dereq_,module,exports){
|
14030 |
|
14031 |
|
14032 |
|
14033 |
|
14034 |
|
14035 |
|
14036 |
|
14037 |
|
14038 |
|
14039 |
|
14040 |
|
14041 | 'use strict';
|
14042 |
|
14043 | var ReactElement = _dereq_(65);
|
14044 | var ReactPropTypeLocationNames = _dereq_(89);
|
14045 | var ReactPropTypesSecret = _dereq_(92);
|
14046 |
|
14047 | var emptyFunction = _dereq_(170);
|
14048 | var getIteratorFn = _dereq_(144);
|
14049 | var warning = _dereq_(187);
|
14050 |
|
14051 |
|
14052 |
|
14053 |
|
14054 |
|
14055 |
|
14056 |
|
14057 |
|
14058 |
|
14059 |
|
14060 |
|
14061 |
|
14062 |
|
14063 |
|
14064 |
|
14065 |
|
14066 |
|
14067 |
|
14068 |
|
14069 |
|
14070 |
|
14071 |
|
14072 |
|
14073 |
|
14074 |
|
14075 |
|
14076 |
|
14077 |
|
14078 |
|
14079 |
|
14080 |
|
14081 |
|
14082 |
|
14083 |
|
14084 |
|
14085 |
|
14086 |
|
14087 |
|
14088 |
|
14089 |
|
14090 |
|
14091 |
|
14092 |
|
14093 |
|
14094 |
|
14095 |
|
14096 |
|
14097 |
|
14098 | var ANONYMOUS = '<<anonymous>>';
|
14099 |
|
14100 | var ReactPropTypes = {
|
14101 | array: createPrimitiveTypeChecker('array'),
|
14102 | bool: createPrimitiveTypeChecker('boolean'),
|
14103 | func: createPrimitiveTypeChecker('function'),
|
14104 | number: createPrimitiveTypeChecker('number'),
|
14105 | object: createPrimitiveTypeChecker('object'),
|
14106 | string: createPrimitiveTypeChecker('string'),
|
14107 | symbol: createPrimitiveTypeChecker('symbol'),
|
14108 |
|
14109 | any: createAnyTypeChecker(),
|
14110 | arrayOf: createArrayOfTypeChecker,
|
14111 | element: createElementTypeChecker(),
|
14112 | instanceOf: createInstanceTypeChecker,
|
14113 | node: createNodeChecker(),
|
14114 | objectOf: createObjectOfTypeChecker,
|
14115 | oneOf: createEnumTypeChecker,
|
14116 | oneOfType: createUnionTypeChecker,
|
14117 | shape: createShapeTypeChecker
|
14118 | };
|
14119 |
|
14120 |
|
14121 |
|
14122 |
|
14123 |
|
14124 |
|
14125 | function is(x, y) {
|
14126 |
|
14127 | if (x === y) {
|
14128 |
|
14129 |
|
14130 | return x !== 0 || 1 / x === 1 / y;
|
14131 | } else {
|
14132 |
|
14133 | return x !== x && y !== y;
|
14134 | }
|
14135 | }
|
14136 |
|
14137 |
|
14138 |
|
14139 |
|
14140 |
|
14141 |
|
14142 |
|
14143 |
|
14144 |
|
14145 | function PropTypeError(message) {
|
14146 | this.message = message;
|
14147 | this.stack = '';
|
14148 | }
|
14149 |
|
14150 | PropTypeError.prototype = Error.prototype;
|
14151 |
|
14152 | function createChainableTypeChecker(validate) {
|
14153 | if ("development" !== 'production') {
|
14154 | var manualPropTypeCallCache = {};
|
14155 | }
|
14156 | function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
14157 | componentName = componentName || ANONYMOUS;
|
14158 | propFullName = propFullName || propName;
|
14159 | if ("development" !== 'production') {
|
14160 | if (secret !== ReactPropTypesSecret && typeof console !== 'undefined') {
|
14161 | var cacheKey = componentName + ':' + propName;
|
14162 | if (!manualPropTypeCallCache[cacheKey]) {
|
14163 | "development" !== 'production' ? warning(false, 'You are manually calling a React.PropTypes validation ' + 'function for the `%s` prop on `%s`. This is deprecated ' + 'and will not work in the next major version. You may be ' + 'seeing this warning due to a third-party PropTypes library. ' + 'See https://fb.me/react-warning-dont-call-proptypes for details.', propFullName, componentName) : void 0;
|
14164 | manualPropTypeCallCache[cacheKey] = true;
|
14165 | }
|
14166 | }
|
14167 | }
|
14168 | if (props[propName] == null) {
|
14169 | var locationName = ReactPropTypeLocationNames[location];
|
14170 | if (isRequired) {
|
14171 | return new PropTypeError('Required ' + locationName + ' `' + propFullName + '` was not specified in ' + ('`' + componentName + '`.'));
|
14172 | }
|
14173 | return null;
|
14174 | } else {
|
14175 | return validate(props, propName, componentName, location, propFullName);
|
14176 | }
|
14177 | }
|
14178 |
|
14179 | var chainedCheckType = checkType.bind(null, false);
|
14180 | chainedCheckType.isRequired = checkType.bind(null, true);
|
14181 |
|
14182 | return chainedCheckType;
|
14183 | }
|
14184 |
|
14185 | function createPrimitiveTypeChecker(expectedType) {
|
14186 | function validate(props, propName, componentName, location, propFullName, secret) {
|
14187 | var propValue = props[propName];
|
14188 | var propType = getPropType(propValue);
|
14189 | if (propType !== expectedType) {
|
14190 | var locationName = ReactPropTypeLocationNames[location];
|
14191 |
|
14192 |
|
14193 |
|
14194 | var preciseType = getPreciseType(propValue);
|
14195 |
|
14196 | return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
|
14197 | }
|
14198 | return null;
|
14199 | }
|
14200 | return createChainableTypeChecker(validate);
|
14201 | }
|
14202 |
|
14203 | function createAnyTypeChecker() {
|
14204 | return createChainableTypeChecker(emptyFunction.thatReturns(null));
|
14205 | }
|
14206 |
|
14207 | function createArrayOfTypeChecker(typeChecker) {
|
14208 | function validate(props, propName, componentName, location, propFullName) {
|
14209 | if (typeof typeChecker !== 'function') {
|
14210 | return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
|
14211 | }
|
14212 | var propValue = props[propName];
|
14213 | if (!Array.isArray(propValue)) {
|
14214 | var locationName = ReactPropTypeLocationNames[location];
|
14215 | var propType = getPropType(propValue);
|
14216 | return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
|
14217 | }
|
14218 | for (var i = 0; i < propValue.length; i++) {
|
14219 | var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
|
14220 | if (error instanceof Error) {
|
14221 | return error;
|
14222 | }
|
14223 | }
|
14224 | return null;
|
14225 | }
|
14226 | return createChainableTypeChecker(validate);
|
14227 | }
|
14228 |
|
14229 | function createElementTypeChecker() {
|
14230 | function validate(props, propName, componentName, location, propFullName) {
|
14231 | var propValue = props[propName];
|
14232 | if (!ReactElement.isValidElement(propValue)) {
|
14233 | var locationName = ReactPropTypeLocationNames[location];
|
14234 | var propType = getPropType(propValue);
|
14235 | return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
|
14236 | }
|
14237 | return null;
|
14238 | }
|
14239 | return createChainableTypeChecker(validate);
|
14240 | }
|
14241 |
|
14242 | function createInstanceTypeChecker(expectedClass) {
|
14243 | function validate(props, propName, componentName, location, propFullName) {
|
14244 | if (!(props[propName] instanceof expectedClass)) {
|
14245 | var locationName = ReactPropTypeLocationNames[location];
|
14246 | var expectedClassName = expectedClass.name || ANONYMOUS;
|
14247 | var actualClassName = getClassName(props[propName]);
|
14248 | return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
|
14249 | }
|
14250 | return null;
|
14251 | }
|
14252 | return createChainableTypeChecker(validate);
|
14253 | }
|
14254 |
|
14255 | function createEnumTypeChecker(expectedValues) {
|
14256 | if (!Array.isArray(expectedValues)) {
|
14257 | "development" !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0;
|
14258 | return emptyFunction.thatReturnsNull;
|
14259 | }
|
14260 |
|
14261 | function validate(props, propName, componentName, location, propFullName) {
|
14262 | var propValue = props[propName];
|
14263 | for (var i = 0; i < expectedValues.length; i++) {
|
14264 | if (is(propValue, expectedValues[i])) {
|
14265 | return null;
|
14266 | }
|
14267 | }
|
14268 |
|
14269 | var locationName = ReactPropTypeLocationNames[location];
|
14270 | var valuesString = JSON.stringify(expectedValues);
|
14271 | return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
|
14272 | }
|
14273 | return createChainableTypeChecker(validate);
|
14274 | }
|
14275 |
|
14276 | function createObjectOfTypeChecker(typeChecker) {
|
14277 | function validate(props, propName, componentName, location, propFullName) {
|
14278 | if (typeof typeChecker !== 'function') {
|
14279 | return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
|
14280 | }
|
14281 | var propValue = props[propName];
|
14282 | var propType = getPropType(propValue);
|
14283 | if (propType !== 'object') {
|
14284 | var locationName = ReactPropTypeLocationNames[location];
|
14285 | return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
|
14286 | }
|
14287 | for (var key in propValue) {
|
14288 | if (propValue.hasOwnProperty(key)) {
|
14289 | var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
14290 | if (error instanceof Error) {
|
14291 | return error;
|
14292 | }
|
14293 | }
|
14294 | }
|
14295 | return null;
|
14296 | }
|
14297 | return createChainableTypeChecker(validate);
|
14298 | }
|
14299 |
|
14300 | function createUnionTypeChecker(arrayOfTypeCheckers) {
|
14301 | if (!Array.isArray(arrayOfTypeCheckers)) {
|
14302 | "development" !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
|
14303 | return emptyFunction.thatReturnsNull;
|
14304 | }
|
14305 |
|
14306 | function validate(props, propName, componentName, location, propFullName) {
|
14307 | for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
14308 | var checker = arrayOfTypeCheckers[i];
|
14309 | if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {
|
14310 | return null;
|
14311 | }
|
14312 | }
|
14313 |
|
14314 | var locationName = ReactPropTypeLocationNames[location];
|
14315 | return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
|
14316 | }
|
14317 | return createChainableTypeChecker(validate);
|
14318 | }
|
14319 |
|
14320 | function createNodeChecker() {
|
14321 | function validate(props, propName, componentName, location, propFullName) {
|
14322 | if (!isNode(props[propName])) {
|
14323 | var locationName = ReactPropTypeLocationNames[location];
|
14324 | return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
|
14325 | }
|
14326 | return null;
|
14327 | }
|
14328 | return createChainableTypeChecker(validate);
|
14329 | }
|
14330 |
|
14331 | function createShapeTypeChecker(shapeTypes) {
|
14332 | function validate(props, propName, componentName, location, propFullName) {
|
14333 | var propValue = props[propName];
|
14334 | var propType = getPropType(propValue);
|
14335 | if (propType !== 'object') {
|
14336 | var locationName = ReactPropTypeLocationNames[location];
|
14337 | return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
14338 | }
|
14339 | for (var key in shapeTypes) {
|
14340 | var checker = shapeTypes[key];
|
14341 | if (!checker) {
|
14342 | continue;
|
14343 | }
|
14344 | var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
14345 | if (error) {
|
14346 | return error;
|
14347 | }
|
14348 | }
|
14349 | return null;
|
14350 | }
|
14351 | return createChainableTypeChecker(validate);
|
14352 | }
|
14353 |
|
14354 | function isNode(propValue) {
|
14355 | switch (typeof propValue) {
|
14356 | case 'number':
|
14357 | case 'string':
|
14358 | case 'undefined':
|
14359 | return true;
|
14360 | case 'boolean':
|
14361 | return !propValue;
|
14362 | case 'object':
|
14363 | if (Array.isArray(propValue)) {
|
14364 | return propValue.every(isNode);
|
14365 | }
|
14366 | if (propValue === null || ReactElement.isValidElement(propValue)) {
|
14367 | return true;
|
14368 | }
|
14369 |
|
14370 | var iteratorFn = getIteratorFn(propValue);
|
14371 | if (iteratorFn) {
|
14372 | var iterator = iteratorFn.call(propValue);
|
14373 | var step;
|
14374 | if (iteratorFn !== propValue.entries) {
|
14375 | while (!(step = iterator.next()).done) {
|
14376 | if (!isNode(step.value)) {
|
14377 | return false;
|
14378 | }
|
14379 | }
|
14380 | } else {
|
14381 |
|
14382 | while (!(step = iterator.next()).done) {
|
14383 | var entry = step.value;
|
14384 | if (entry) {
|
14385 | if (!isNode(entry[1])) {
|
14386 | return false;
|
14387 | }
|
14388 | }
|
14389 | }
|
14390 | }
|
14391 | } else {
|
14392 | return false;
|
14393 | }
|
14394 |
|
14395 | return true;
|
14396 | default:
|
14397 | return false;
|
14398 | }
|
14399 | }
|
14400 |
|
14401 | function isSymbol(propType, propValue) {
|
14402 |
|
14403 | if (propType === 'symbol') {
|
14404 | return true;
|
14405 | }
|
14406 |
|
14407 |
|
14408 | if (propValue['@@toStringTag'] === 'Symbol') {
|
14409 | return true;
|
14410 | }
|
14411 |
|
14412 |
|
14413 | if (typeof Symbol === 'function' && propValue instanceof Symbol) {
|
14414 | return true;
|
14415 | }
|
14416 |
|
14417 | return false;
|
14418 | }
|
14419 |
|
14420 |
|
14421 | function getPropType(propValue) {
|
14422 | var propType = typeof propValue;
|
14423 | if (Array.isArray(propValue)) {
|
14424 | return 'array';
|
14425 | }
|
14426 | if (propValue instanceof RegExp) {
|
14427 |
|
14428 |
|
14429 |
|
14430 | return 'object';
|
14431 | }
|
14432 | if (isSymbol(propType, propValue)) {
|
14433 | return 'symbol';
|
14434 | }
|
14435 | return propType;
|
14436 | }
|
14437 |
|
14438 |
|
14439 |
|
14440 | function getPreciseType(propValue) {
|
14441 | var propType = getPropType(propValue);
|
14442 | if (propType === 'object') {
|
14443 | if (propValue instanceof Date) {
|
14444 | return 'date';
|
14445 | } else if (propValue instanceof RegExp) {
|
14446 | return 'regexp';
|
14447 | }
|
14448 | }
|
14449 | return propType;
|
14450 | }
|
14451 |
|
14452 |
|
14453 | function getClassName(propValue) {
|
14454 | if (!propValue.constructor || !propValue.constructor.name) {
|
14455 | return ANONYMOUS;
|
14456 | }
|
14457 | return propValue.constructor.name;
|
14458 | }
|
14459 |
|
14460 | module.exports = ReactPropTypes;
|
14461 | },{"144":144,"170":170,"187":187,"65":65,"89":89,"92":92}],92:[function(_dereq_,module,exports){
|
14462 |
|
14463 |
|
14464 |
|
14465 |
|
14466 |
|
14467 |
|
14468 |
|
14469 |
|
14470 |
|
14471 |
|
14472 |
|
14473 | 'use strict';
|
14474 |
|
14475 | var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
14476 |
|
14477 | module.exports = ReactPropTypesSecret;
|
14478 | },{}],93:[function(_dereq_,module,exports){
|
14479 |
|
14480 |
|
14481 |
|
14482 |
|
14483 |
|
14484 |
|
14485 |
|
14486 |
|
14487 |
|
14488 |
|
14489 |
|
14490 | 'use strict';
|
14491 |
|
14492 | var _assign = _dereq_(188);
|
14493 |
|
14494 | var ReactComponent = _dereq_(35);
|
14495 | var ReactNoopUpdateQueue = _dereq_(86);
|
14496 |
|
14497 | var emptyObject = _dereq_(171);
|
14498 |
|
14499 |
|
14500 |
|
14501 |
|
14502 | function ReactPureComponent(props, context, updater) {
|
14503 |
|
14504 | this.props = props;
|
14505 | this.context = context;
|
14506 | this.refs = emptyObject;
|
14507 |
|
14508 |
|
14509 | this.updater = updater || ReactNoopUpdateQueue;
|
14510 | }
|
14511 |
|
14512 | function ComponentDummy() {}
|
14513 | ComponentDummy.prototype = ReactComponent.prototype;
|
14514 | ReactPureComponent.prototype = new ComponentDummy();
|
14515 | ReactPureComponent.prototype.constructor = ReactPureComponent;
|
14516 |
|
14517 | _assign(ReactPureComponent.prototype, ReactComponent.prototype);
|
14518 | ReactPureComponent.prototype.isPureReactComponent = true;
|
14519 |
|
14520 | module.exports = ReactPureComponent;
|
14521 | },{"171":171,"188":188,"35":35,"86":86}],94:[function(_dereq_,module,exports){
|
14522 |
|
14523 |
|
14524 |
|
14525 |
|
14526 |
|
14527 |
|
14528 |
|
14529 |
|
14530 |
|
14531 |
|
14532 |
|
14533 | 'use strict';
|
14534 |
|
14535 | var _assign = _dereq_(188);
|
14536 |
|
14537 | var CallbackQueue = _dereq_(5);
|
14538 | var PooledClass = _dereq_(26);
|
14539 | var ReactBrowserEventEmitter = _dereq_(28);
|
14540 | var ReactInputSelection = _dereq_(76);
|
14541 | var ReactInstrumentation = _dereq_(78);
|
14542 | var Transaction = _dereq_(127);
|
14543 | var ReactUpdateQueue = _dereq_(106);
|
14544 |
|
14545 |
|
14546 |
|
14547 |
|
14548 |
|
14549 | var SELECTION_RESTORATION = {
|
14550 | |
14551 |
|
14552 |
|
14553 | initialize: ReactInputSelection.getSelectionInformation,
|
14554 | |
14555 |
|
14556 |
|
14557 | close: ReactInputSelection.restoreSelection
|
14558 | };
|
14559 |
|
14560 |
|
14561 |
|
14562 |
|
14563 |
|
14564 |
|
14565 | var EVENT_SUPPRESSION = {
|
14566 | |
14567 |
|
14568 |
|
14569 |
|
14570 | initialize: function () {
|
14571 | var currentlyEnabled = ReactBrowserEventEmitter.isEnabled();
|
14572 | ReactBrowserEventEmitter.setEnabled(false);
|
14573 | return currentlyEnabled;
|
14574 | },
|
14575 |
|
14576 | |
14577 |
|
14578 |
|
14579 |
|
14580 |
|
14581 | close: function (previouslyEnabled) {
|
14582 | ReactBrowserEventEmitter.setEnabled(previouslyEnabled);
|
14583 | }
|
14584 | };
|
14585 |
|
14586 |
|
14587 |
|
14588 |
|
14589 |
|
14590 | var ON_DOM_READY_QUEUEING = {
|
14591 | |
14592 |
|
14593 |
|
14594 | initialize: function () {
|
14595 | this.reactMountReady.reset();
|
14596 | },
|
14597 |
|
14598 | |
14599 |
|
14600 |
|
14601 | close: function () {
|
14602 | this.reactMountReady.notifyAll();
|
14603 | }
|
14604 | };
|
14605 |
|
14606 |
|
14607 |
|
14608 |
|
14609 |
|
14610 |
|
14611 | var TRANSACTION_WRAPPERS = [SELECTION_RESTORATION, EVENT_SUPPRESSION, ON_DOM_READY_QUEUEING];
|
14612 |
|
14613 | if ("development" !== 'production') {
|
14614 | TRANSACTION_WRAPPERS.push({
|
14615 | initialize: ReactInstrumentation.debugTool.onBeginFlush,
|
14616 | close: ReactInstrumentation.debugTool.onEndFlush
|
14617 | });
|
14618 | }
|
14619 |
|
14620 |
|
14621 |
|
14622 |
|
14623 |
|
14624 |
|
14625 |
|
14626 |
|
14627 |
|
14628 |
|
14629 |
|
14630 |
|
14631 |
|
14632 |
|
14633 |
|
14634 | function ReactReconcileTransaction(useCreateElement) {
|
14635 | this.reinitializeTransaction();
|
14636 |
|
14637 |
|
14638 |
|
14639 |
|
14640 |
|
14641 | this.renderToStaticMarkup = false;
|
14642 | this.reactMountReady = CallbackQueue.getPooled(null);
|
14643 | this.useCreateElement = useCreateElement;
|
14644 | }
|
14645 |
|
14646 | var Mixin = {
|
14647 | |
14648 |
|
14649 |
|
14650 |
|
14651 |
|
14652 |
|
14653 |
|
14654 | getTransactionWrappers: function () {
|
14655 | return TRANSACTION_WRAPPERS;
|
14656 | },
|
14657 |
|
14658 | |
14659 |
|
14660 |
|
14661 | getReactMountReady: function () {
|
14662 | return this.reactMountReady;
|
14663 | },
|
14664 |
|
14665 | |
14666 |
|
14667 |
|
14668 | getUpdateQueue: function () {
|
14669 | return ReactUpdateQueue;
|
14670 | },
|
14671 |
|
14672 | |
14673 |
|
14674 |
|
14675 |
|
14676 | checkpoint: function () {
|
14677 |
|
14678 | return this.reactMountReady.checkpoint();
|
14679 | },
|
14680 |
|
14681 | rollback: function (checkpoint) {
|
14682 | this.reactMountReady.rollback(checkpoint);
|
14683 | },
|
14684 |
|
14685 | |
14686 |
|
14687 |
|
14688 |
|
14689 | destructor: function () {
|
14690 | CallbackQueue.release(this.reactMountReady);
|
14691 | this.reactMountReady = null;
|
14692 | }
|
14693 | };
|
14694 |
|
14695 | _assign(ReactReconcileTransaction.prototype, Transaction.Mixin, Mixin);
|
14696 |
|
14697 | PooledClass.addPoolingTo(ReactReconcileTransaction);
|
14698 |
|
14699 | module.exports = ReactReconcileTransaction;
|
14700 | },{"106":106,"127":127,"188":188,"26":26,"28":28,"5":5,"76":76,"78":78}],95:[function(_dereq_,module,exports){
|
14701 |
|
14702 |
|
14703 |
|
14704 |
|
14705 |
|
14706 |
|
14707 |
|
14708 |
|
14709 |
|
14710 |
|
14711 |
|
14712 | 'use strict';
|
14713 |
|
14714 | var ReactRef = _dereq_(96);
|
14715 | var ReactInstrumentation = _dereq_(78);
|
14716 |
|
14717 | var warning = _dereq_(187);
|
14718 |
|
14719 |
|
14720 |
|
14721 |
|
14722 |
|
14723 | function attachRefs() {
|
14724 | ReactRef.attachRefs(this, this._currentElement);
|
14725 | }
|
14726 |
|
14727 | var ReactReconciler = {
|
14728 |
|
14729 | |
14730 |
|
14731 |
|
14732 |
|
14733 |
|
14734 |
|
14735 |
|
14736 |
|
14737 |
|
14738 |
|
14739 |
|
14740 | mountComponent: function (internalInstance, transaction, hostParent, hostContainerInfo, context, parentDebugID // 0 in production and for roots
|
14741 | ) {
|
14742 | if ("development" !== 'production') {
|
14743 | if (internalInstance._debugID !== 0) {
|
14744 | ReactInstrumentation.debugTool.onBeforeMountComponent(internalInstance._debugID, internalInstance._currentElement, parentDebugID);
|
14745 | }
|
14746 | }
|
14747 | var markup = internalInstance.mountComponent(transaction, hostParent, hostContainerInfo, context, parentDebugID);
|
14748 | if (internalInstance._currentElement && internalInstance._currentElement.ref != null) {
|
14749 | transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
|
14750 | }
|
14751 | if ("development" !== 'production') {
|
14752 | if (internalInstance._debugID !== 0) {
|
14753 | ReactInstrumentation.debugTool.onMountComponent(internalInstance._debugID);
|
14754 | }
|
14755 | }
|
14756 | return markup;
|
14757 | },
|
14758 |
|
14759 | |
14760 |
|
14761 |
|
14762 |
|
14763 | getHostNode: function (internalInstance) {
|
14764 | return internalInstance.getHostNode();
|
14765 | },
|
14766 |
|
14767 | |
14768 |
|
14769 |
|
14770 |
|
14771 |
|
14772 |
|
14773 | unmountComponent: function (internalInstance, safely) {
|
14774 | if ("development" !== 'production') {
|
14775 | if (internalInstance._debugID !== 0) {
|
14776 | ReactInstrumentation.debugTool.onBeforeUnmountComponent(internalInstance._debugID);
|
14777 | }
|
14778 | }
|
14779 | ReactRef.detachRefs(internalInstance, internalInstance._currentElement);
|
14780 | internalInstance.unmountComponent(safely);
|
14781 | if ("development" !== 'production') {
|
14782 | if (internalInstance._debugID !== 0) {
|
14783 | ReactInstrumentation.debugTool.onUnmountComponent(internalInstance._debugID);
|
14784 | }
|
14785 | }
|
14786 | },
|
14787 |
|
14788 | |
14789 |
|
14790 |
|
14791 |
|
14792 |
|
14793 |
|
14794 |
|
14795 |
|
14796 |
|
14797 | receiveComponent: function (internalInstance, nextElement, transaction, context) {
|
14798 | var prevElement = internalInstance._currentElement;
|
14799 |
|
14800 | if (nextElement === prevElement && context === internalInstance._context) {
|
14801 |
|
14802 |
|
14803 |
|
14804 |
|
14805 |
|
14806 |
|
14807 |
|
14808 |
|
14809 |
|
14810 |
|
14811 | return;
|
14812 | }
|
14813 |
|
14814 | if ("development" !== 'production') {
|
14815 | if (internalInstance._debugID !== 0) {
|
14816 | ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, nextElement);
|
14817 | }
|
14818 | }
|
14819 |
|
14820 | var refsChanged = ReactRef.shouldUpdateRefs(prevElement, nextElement);
|
14821 |
|
14822 | if (refsChanged) {
|
14823 | ReactRef.detachRefs(internalInstance, prevElement);
|
14824 | }
|
14825 |
|
14826 | internalInstance.receiveComponent(nextElement, transaction, context);
|
14827 |
|
14828 | if (refsChanged && internalInstance._currentElement && internalInstance._currentElement.ref != null) {
|
14829 | transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
|
14830 | }
|
14831 |
|
14832 | if ("development" !== 'production') {
|
14833 | if (internalInstance._debugID !== 0) {
|
14834 | ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID);
|
14835 | }
|
14836 | }
|
14837 | },
|
14838 |
|
14839 | |
14840 |
|
14841 |
|
14842 |
|
14843 |
|
14844 |
|
14845 |
|
14846 | performUpdateIfNecessary: function (internalInstance, transaction, updateBatchNumber) {
|
14847 | if (internalInstance._updateBatchNumber !== updateBatchNumber) {
|
14848 |
|
14849 |
|
14850 | "development" !== 'production' ? warning(internalInstance._updateBatchNumber == null || internalInstance._updateBatchNumber === updateBatchNumber + 1, 'performUpdateIfNecessary: Unexpected batch number (current %s, ' + 'pending %s)', updateBatchNumber, internalInstance._updateBatchNumber) : void 0;
|
14851 | return;
|
14852 | }
|
14853 | if ("development" !== 'production') {
|
14854 | if (internalInstance._debugID !== 0) {
|
14855 | ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, internalInstance._currentElement);
|
14856 | }
|
14857 | }
|
14858 | internalInstance.performUpdateIfNecessary(transaction);
|
14859 | if ("development" !== 'production') {
|
14860 | if (internalInstance._debugID !== 0) {
|
14861 | ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID);
|
14862 | }
|
14863 | }
|
14864 | }
|
14865 |
|
14866 | };
|
14867 |
|
14868 | module.exports = ReactReconciler;
|
14869 | },{"187":187,"78":78,"96":96}],96:[function(_dereq_,module,exports){
|
14870 |
|
14871 |
|
14872 |
|
14873 |
|
14874 |
|
14875 |
|
14876 |
|
14877 |
|
14878 |
|
14879 |
|
14880 |
|
14881 | 'use strict';
|
14882 |
|
14883 | var ReactOwner = _dereq_(87);
|
14884 |
|
14885 | var ReactRef = {};
|
14886 |
|
14887 | function attachRef(ref, component, owner) {
|
14888 | if (typeof ref === 'function') {
|
14889 | ref(component.getPublicInstance());
|
14890 | } else {
|
14891 |
|
14892 | ReactOwner.addComponentAsRefTo(component, ref, owner);
|
14893 | }
|
14894 | }
|
14895 |
|
14896 | function detachRef(ref, component, owner) {
|
14897 | if (typeof ref === 'function') {
|
14898 | ref(null);
|
14899 | } else {
|
14900 |
|
14901 | ReactOwner.removeComponentAsRefFrom(component, ref, owner);
|
14902 | }
|
14903 | }
|
14904 |
|
14905 | ReactRef.attachRefs = function (instance, element) {
|
14906 | if (element === null || element === false) {
|
14907 | return;
|
14908 | }
|
14909 | var ref = element.ref;
|
14910 | if (ref != null) {
|
14911 | attachRef(ref, instance, element._owner);
|
14912 | }
|
14913 | };
|
14914 |
|
14915 | ReactRef.shouldUpdateRefs = function (prevElement, nextElement) {
|
14916 |
|
14917 |
|
14918 |
|
14919 |
|
14920 |
|
14921 |
|
14922 |
|
14923 |
|
14924 |
|
14925 |
|
14926 |
|
14927 |
|
14928 | var prevEmpty = prevElement === null || prevElement === false;
|
14929 | var nextEmpty = nextElement === null || nextElement === false;
|
14930 |
|
14931 | return (
|
14932 |
|
14933 | prevEmpty || nextEmpty || nextElement.ref !== prevElement.ref ||
|
14934 |
|
14935 | typeof nextElement.ref === 'string' && nextElement._owner !== prevElement._owner
|
14936 | );
|
14937 | };
|
14938 |
|
14939 | ReactRef.detachRefs = function (instance, element) {
|
14940 | if (element === null || element === false) {
|
14941 | return;
|
14942 | }
|
14943 | var ref = element.ref;
|
14944 | if (ref != null) {
|
14945 | detachRef(ref, instance, element._owner);
|
14946 | }
|
14947 | };
|
14948 |
|
14949 | module.exports = ReactRef;
|
14950 | },{"87":87}],97:[function(_dereq_,module,exports){
|
14951 |
|
14952 |
|
14953 |
|
14954 |
|
14955 |
|
14956 |
|
14957 |
|
14958 |
|
14959 |
|
14960 |
|
14961 |
|
14962 | 'use strict';
|
14963 |
|
14964 | var ReactServerBatchingStrategy = {
|
14965 | isBatchingUpdates: false,
|
14966 | batchedUpdates: function (callback) {
|
14967 |
|
14968 |
|
14969 | }
|
14970 | };
|
14971 |
|
14972 | module.exports = ReactServerBatchingStrategy;
|
14973 | },{}],98:[function(_dereq_,module,exports){
|
14974 |
|
14975 |
|
14976 |
|
14977 |
|
14978 |
|
14979 |
|
14980 |
|
14981 |
|
14982 |
|
14983 |
|
14984 | 'use strict';
|
14985 |
|
14986 | var _prodInvariant = _dereq_(153);
|
14987 |
|
14988 | var ReactDOMContainerInfo = _dereq_(47);
|
14989 | var ReactDefaultBatchingStrategy = _dereq_(63);
|
14990 | var ReactElement = _dereq_(65);
|
14991 | var ReactInstrumentation = _dereq_(78);
|
14992 | var ReactMarkupChecksum = _dereq_(81);
|
14993 | var ReactReconciler = _dereq_(95);
|
14994 | var ReactServerBatchingStrategy = _dereq_(97);
|
14995 | var ReactServerRenderingTransaction = _dereq_(99);
|
14996 | var ReactUpdates = _dereq_(107);
|
14997 |
|
14998 | var emptyObject = _dereq_(171);
|
14999 | var instantiateReactComponent = _dereq_(148);
|
15000 | var invariant = _dereq_(178);
|
15001 |
|
15002 | var pendingTransactions = 0;
|
15003 |
|
15004 |
|
15005 |
|
15006 |
|
15007 |
|
15008 | function renderToStringImpl(element, makeStaticMarkup) {
|
15009 | var transaction;
|
15010 | try {
|
15011 | ReactUpdates.injection.injectBatchingStrategy(ReactServerBatchingStrategy);
|
15012 |
|
15013 | transaction = ReactServerRenderingTransaction.getPooled(makeStaticMarkup);
|
15014 |
|
15015 | pendingTransactions++;
|
15016 |
|
15017 | return transaction.perform(function () {
|
15018 | var componentInstance = instantiateReactComponent(element, true);
|
15019 | var markup = ReactReconciler.mountComponent(componentInstance, transaction, null, ReactDOMContainerInfo(), emptyObject, 0
|
15020 | );
|
15021 | if ("development" !== 'production') {
|
15022 | ReactInstrumentation.debugTool.onUnmountComponent(componentInstance._debugID);
|
15023 | }
|
15024 | if (!makeStaticMarkup) {
|
15025 | markup = ReactMarkupChecksum.addChecksumToMarkup(markup);
|
15026 | }
|
15027 | return markup;
|
15028 | }, null);
|
15029 | } finally {
|
15030 | pendingTransactions--;
|
15031 | ReactServerRenderingTransaction.release(transaction);
|
15032 |
|
15033 |
|
15034 | if (!pendingTransactions) {
|
15035 | ReactUpdates.injection.injectBatchingStrategy(ReactDefaultBatchingStrategy);
|
15036 | }
|
15037 | }
|
15038 | }
|
15039 |
|
15040 |
|
15041 |
|
15042 |
|
15043 |
|
15044 |
|
15045 | function renderToString(element) {
|
15046 | !ReactElement.isValidElement(element) ? "development" !== 'production' ? invariant(false, 'renderToString(): You must pass a valid ReactElement.') : _prodInvariant('46') : void 0;
|
15047 | return renderToStringImpl(element, false);
|
15048 | }
|
15049 |
|
15050 |
|
15051 |
|
15052 |
|
15053 |
|
15054 |
|
15055 | function renderToStaticMarkup(element) {
|
15056 | !ReactElement.isValidElement(element) ? "development" !== 'production' ? invariant(false, 'renderToStaticMarkup(): You must pass a valid ReactElement.') : _prodInvariant('47') : void 0;
|
15057 | return renderToStringImpl(element, true);
|
15058 | }
|
15059 |
|
15060 | module.exports = {
|
15061 | renderToString: renderToString,
|
15062 | renderToStaticMarkup: renderToStaticMarkup
|
15063 | };
|
15064 | },{"107":107,"148":148,"153":153,"171":171,"178":178,"47":47,"63":63,"65":65,"78":78,"81":81,"95":95,"97":97,"99":99}],99:[function(_dereq_,module,exports){
|
15065 |
|
15066 |
|
15067 |
|
15068 |
|
15069 |
|
15070 |
|
15071 |
|
15072 |
|
15073 |
|
15074 |
|
15075 |
|
15076 | 'use strict';
|
15077 |
|
15078 | var _assign = _dereq_(188);
|
15079 |
|
15080 | var PooledClass = _dereq_(26);
|
15081 | var Transaction = _dereq_(127);
|
15082 | var ReactInstrumentation = _dereq_(78);
|
15083 | var ReactServerUpdateQueue = _dereq_(100);
|
15084 |
|
15085 |
|
15086 |
|
15087 |
|
15088 |
|
15089 |
|
15090 | var TRANSACTION_WRAPPERS = [];
|
15091 |
|
15092 | if ("development" !== 'production') {
|
15093 | TRANSACTION_WRAPPERS.push({
|
15094 | initialize: ReactInstrumentation.debugTool.onBeginFlush,
|
15095 | close: ReactInstrumentation.debugTool.onEndFlush
|
15096 | });
|
15097 | }
|
15098 |
|
15099 | var noopCallbackQueue = {
|
15100 | enqueue: function () {}
|
15101 | };
|
15102 |
|
15103 |
|
15104 |
|
15105 |
|
15106 |
|
15107 | function ReactServerRenderingTransaction(renderToStaticMarkup) {
|
15108 | this.reinitializeTransaction();
|
15109 | this.renderToStaticMarkup = renderToStaticMarkup;
|
15110 | this.useCreateElement = false;
|
15111 | this.updateQueue = new ReactServerUpdateQueue(this);
|
15112 | }
|
15113 |
|
15114 | var Mixin = {
|
15115 | |
15116 |
|
15117 |
|
15118 |
|
15119 |
|
15120 |
|
15121 | getTransactionWrappers: function () {
|
15122 | return TRANSACTION_WRAPPERS;
|
15123 | },
|
15124 |
|
15125 | |
15126 |
|
15127 |
|
15128 | getReactMountReady: function () {
|
15129 | return noopCallbackQueue;
|
15130 | },
|
15131 |
|
15132 | |
15133 |
|
15134 |
|
15135 | getUpdateQueue: function () {
|
15136 | return this.updateQueue;
|
15137 | },
|
15138 |
|
15139 | |
15140 |
|
15141 |
|
15142 |
|
15143 | destructor: function () {},
|
15144 |
|
15145 | checkpoint: function () {},
|
15146 |
|
15147 | rollback: function () {}
|
15148 | };
|
15149 |
|
15150 | _assign(ReactServerRenderingTransaction.prototype, Transaction.Mixin, Mixin);
|
15151 |
|
15152 | PooledClass.addPoolingTo(ReactServerRenderingTransaction);
|
15153 |
|
15154 | module.exports = ReactServerRenderingTransaction;
|
15155 | },{"100":100,"127":127,"188":188,"26":26,"78":78}],100:[function(_dereq_,module,exports){
|
15156 |
|
15157 |
|
15158 |
|
15159 |
|
15160 |
|
15161 |
|
15162 |
|
15163 |
|
15164 |
|
15165 |
|
15166 |
|
15167 |
|
15168 | 'use strict';
|
15169 |
|
15170 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
15171 |
|
15172 | var ReactUpdateQueue = _dereq_(106);
|
15173 | var Transaction = _dereq_(127);
|
15174 | var warning = _dereq_(187);
|
15175 |
|
15176 | function warnNoop(publicInstance, callerName) {
|
15177 | if ("development" !== 'production') {
|
15178 | var constructor = publicInstance.constructor;
|
15179 | "development" !== 'production' ? warning(false, '%s(...): Can only update a mounting component. ' + 'This usually means you called %s() outside componentWillMount() on the server. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, constructor && (constructor.displayName || constructor.name) || 'ReactClass') : void 0;
|
15180 | }
|
15181 | }
|
15182 |
|
15183 | /**
|
15184 | * This is the update queue used for server rendering.
|
15185 | * It delegates to ReactUpdateQueue while server rendering is in progress and
|
15186 | * switches to ReactNoopUpdateQueue after the transaction has completed.
|
15187 | * @class ReactServerUpdateQueue
|
15188 | * @param {Transaction} transaction
|
15189 | */
|
15190 |
|
15191 | var ReactServerUpdateQueue = function () {
|
15192 |
|
15193 |
|
15194 | function ReactServerUpdateQueue(transaction) {
|
15195 | _classCallCheck(this, ReactServerUpdateQueue);
|
15196 |
|
15197 | this.transaction = transaction;
|
15198 | }
|
15199 |
|
15200 | |
15201 |
|
15202 |
|
15203 |
|
15204 |
|
15205 |
|
15206 |
|
15207 |
|
15208 |
|
15209 | ReactServerUpdateQueue.prototype.isMounted = function isMounted(publicInstance) {
|
15210 | return false;
|
15211 | };
|
15212 |
|
15213 | |
15214 |
|
15215 |
|
15216 |
|
15217 |
|
15218 |
|
15219 |
|
15220 |
|
15221 |
|
15222 |
|
15223 | ReactServerUpdateQueue.prototype.enqueueCallback = function enqueueCallback(publicInstance, callback, callerName) {
|
15224 | if (this.transaction.isInTransaction()) {
|
15225 | ReactUpdateQueue.enqueueCallback(publicInstance, callback, callerName);
|
15226 | }
|
15227 | };
|
15228 |
|
15229 | |
15230 |
|
15231 |
|
15232 |
|
15233 |
|
15234 |
|
15235 |
|
15236 |
|
15237 |
|
15238 |
|
15239 |
|
15240 |
|
15241 |
|
15242 |
|
15243 |
|
15244 | ReactServerUpdateQueue.prototype.enqueueForceUpdate = function enqueueForceUpdate(publicInstance) {
|
15245 | if (this.transaction.isInTransaction()) {
|
15246 | ReactUpdateQueue.enqueueForceUpdate(publicInstance);
|
15247 | } else {
|
15248 | warnNoop(publicInstance, 'forceUpdate');
|
15249 | }
|
15250 | };
|
15251 |
|
15252 | |
15253 |
|
15254 |
|
15255 |
|
15256 |
|
15257 |
|
15258 |
|
15259 |
|
15260 |
|
15261 |
|
15262 |
|
15263 |
|
15264 |
|
15265 | ReactServerUpdateQueue.prototype.enqueueReplaceState = function enqueueReplaceState(publicInstance, completeState) {
|
15266 | if (this.transaction.isInTransaction()) {
|
15267 | ReactUpdateQueue.enqueueReplaceState(publicInstance, completeState);
|
15268 | } else {
|
15269 | warnNoop(publicInstance, 'replaceState');
|
15270 | }
|
15271 | };
|
15272 |
|
15273 | |
15274 |
|
15275 |
|
15276 |
|
15277 |
|
15278 |
|
15279 |
|
15280 |
|
15281 |
|
15282 |
|
15283 |
|
15284 |
|
15285 | ReactServerUpdateQueue.prototype.enqueueSetState = function enqueueSetState(publicInstance, partialState) {
|
15286 | if (this.transaction.isInTransaction()) {
|
15287 | ReactUpdateQueue.enqueueSetState(publicInstance, partialState);
|
15288 | } else {
|
15289 | warnNoop(publicInstance, 'setState');
|
15290 | }
|
15291 | };
|
15292 |
|
15293 | return ReactServerUpdateQueue;
|
15294 | }();
|
15295 |
|
15296 | module.exports = ReactServerUpdateQueue;
|
15297 | },{"106":106,"127":127,"187":187}],101:[function(_dereq_,module,exports){
|
15298 |
|
15299 |
|
15300 |
|
15301 |
|
15302 |
|
15303 |
|
15304 |
|
15305 |
|
15306 |
|
15307 |
|
15308 |
|
15309 | 'use strict';
|
15310 |
|
15311 | var ReactStateSetters = {
|
15312 | |
15313 |
|
15314 |
|
15315 |
|
15316 |
|
15317 |
|
15318 |
|
15319 |
|
15320 |
|
15321 |
|
15322 | createStateSetter: function (component, funcReturningState) {
|
15323 | return function (a, b, c, d, e, f) {
|
15324 | var partialState = funcReturningState.call(component, a, b, c, d, e, f);
|
15325 | if (partialState) {
|
15326 | component.setState(partialState);
|
15327 | }
|
15328 | };
|
15329 | },
|
15330 |
|
15331 | |
15332 |
|
15333 |
|
15334 |
|
15335 |
|
15336 |
|
15337 |
|
15338 |
|
15339 |
|
15340 |
|
15341 |
|
15342 | createStateKeySetter: function (component, key) {
|
15343 |
|
15344 | var cache = component.__keySetters || (component.__keySetters = {});
|
15345 | return cache[key] || (cache[key] = createStateKeySetter(component, key));
|
15346 | }
|
15347 | };
|
15348 |
|
15349 | function createStateKeySetter(component, key) {
|
15350 |
|
15351 |
|
15352 |
|
15353 | var partialState = {};
|
15354 | return function stateKeySetter(value) {
|
15355 | partialState[key] = value;
|
15356 | component.setState(partialState);
|
15357 | };
|
15358 | }
|
15359 |
|
15360 | ReactStateSetters.Mixin = {
|
15361 | |
15362 |
|
15363 |
|
15364 |
|
15365 |
|
15366 |
|
15367 |
|
15368 |
|
15369 |
|
15370 |
|
15371 |
|
15372 |
|
15373 |
|
15374 |
|
15375 |
|
15376 |
|
15377 | createStateSetter: function (funcReturningState) {
|
15378 | return ReactStateSetters.createStateSetter(this, funcReturningState);
|
15379 | },
|
15380 |
|
15381 | |
15382 |
|
15383 |
|
15384 |
|
15385 |
|
15386 |
|
15387 |
|
15388 |
|
15389 |
|
15390 |
|
15391 |
|
15392 |
|
15393 |
|
15394 |
|
15395 |
|
15396 | createStateKeySetter: function (key) {
|
15397 | return ReactStateSetters.createStateKeySetter(this, key);
|
15398 | }
|
15399 | };
|
15400 |
|
15401 | module.exports = ReactStateSetters;
|
15402 | },{}],102:[function(_dereq_,module,exports){
|
15403 |
|
15404 |
|
15405 |
|
15406 |
|
15407 |
|
15408 |
|
15409 |
|
15410 |
|
15411 |
|
15412 |
|
15413 |
|
15414 | 'use strict';
|
15415 |
|
15416 | var _prodInvariant = _dereq_(153),
|
15417 | _assign = _dereq_(188);
|
15418 |
|
15419 | var EventConstants = _dereq_(16);
|
15420 | var EventPluginHub = _dereq_(17);
|
15421 | var EventPluginRegistry = _dereq_(18);
|
15422 | var EventPropagators = _dereq_(20);
|
15423 | var React = _dereq_(27);
|
15424 | var ReactDefaultInjection = _dereq_(64);
|
15425 | var ReactDOM = _dereq_(42);
|
15426 | var ReactDOMComponentTree = _dereq_(46);
|
15427 | var ReactElement = _dereq_(65);
|
15428 | var ReactBrowserEventEmitter = _dereq_(28);
|
15429 | var ReactCompositeComponent = _dereq_(40);
|
15430 | var ReactInstanceMap = _dereq_(77);
|
15431 | var ReactReconciler = _dereq_(95);
|
15432 | var ReactUpdates = _dereq_(107);
|
15433 | var SyntheticEvent = _dereq_(118);
|
15434 |
|
15435 | var emptyObject = _dereq_(171);
|
15436 | var findDOMNode = _dereq_(136);
|
15437 | var invariant = _dereq_(178);
|
15438 |
|
15439 | var topLevelTypes = EventConstants.topLevelTypes;
|
15440 |
|
15441 | function Event(suffix) {}
|
15442 |
|
15443 |
|
15444 |
|
15445 |
|
15446 |
|
15447 | function findAllInRenderedTreeInternal(inst, test) {
|
15448 | if (!inst || !inst.getPublicInstance) {
|
15449 | return [];
|
15450 | }
|
15451 | var publicInst = inst.getPublicInstance();
|
15452 | var ret = test(publicInst) ? [publicInst] : [];
|
15453 | var currentElement = inst._currentElement;
|
15454 | if (ReactTestUtils.isDOMComponent(publicInst)) {
|
15455 | var renderedChildren = inst._renderedChildren;
|
15456 | var key;
|
15457 | for (key in renderedChildren) {
|
15458 | if (!renderedChildren.hasOwnProperty(key)) {
|
15459 | continue;
|
15460 | }
|
15461 | ret = ret.concat(findAllInRenderedTreeInternal(renderedChildren[key], test));
|
15462 | }
|
15463 | } else if (ReactElement.isValidElement(currentElement) && typeof currentElement.type === 'function') {
|
15464 | ret = ret.concat(findAllInRenderedTreeInternal(inst._renderedComponent, test));
|
15465 | }
|
15466 | return ret;
|
15467 | }
|
15468 |
|
15469 |
|
15470 |
|
15471 |
|
15472 |
|
15473 |
|
15474 |
|
15475 |
|
15476 |
|
15477 |
|
15478 | var ReactTestUtils = {
|
15479 | renderIntoDocument: function (instance) {
|
15480 | var div = document.createElement('div');
|
15481 |
|
15482 |
|
15483 |
|
15484 |
|
15485 |
|
15486 | return ReactDOM.render(instance, div);
|
15487 | },
|
15488 |
|
15489 | isElement: function (element) {
|
15490 | return ReactElement.isValidElement(element);
|
15491 | },
|
15492 |
|
15493 | isElementOfType: function (inst, convenienceConstructor) {
|
15494 | return ReactElement.isValidElement(inst) && inst.type === convenienceConstructor;
|
15495 | },
|
15496 |
|
15497 | isDOMComponent: function (inst) {
|
15498 | return !!(inst && inst.nodeType === 1 && inst.tagName);
|
15499 | },
|
15500 |
|
15501 | isDOMComponentElement: function (inst) {
|
15502 | return !!(inst && ReactElement.isValidElement(inst) && !!inst.tagName);
|
15503 | },
|
15504 |
|
15505 | isCompositeComponent: function (inst) {
|
15506 | if (ReactTestUtils.isDOMComponent(inst)) {
|
15507 |
|
15508 |
|
15509 | return false;
|
15510 | }
|
15511 | return inst != null && typeof inst.render === 'function' && typeof inst.setState === 'function';
|
15512 | },
|
15513 |
|
15514 | isCompositeComponentWithType: function (inst, type) {
|
15515 | if (!ReactTestUtils.isCompositeComponent(inst)) {
|
15516 | return false;
|
15517 | }
|
15518 | var internalInstance = ReactInstanceMap.get(inst);
|
15519 | var constructor = internalInstance._currentElement.type;
|
15520 |
|
15521 | return constructor === type;
|
15522 | },
|
15523 |
|
15524 | isCompositeComponentElement: function (inst) {
|
15525 | if (!ReactElement.isValidElement(inst)) {
|
15526 | return false;
|
15527 | }
|
15528 |
|
15529 |
|
15530 | var prototype = inst.type.prototype;
|
15531 | return typeof prototype.render === 'function' && typeof prototype.setState === 'function';
|
15532 | },
|
15533 |
|
15534 | isCompositeComponentElementWithType: function (inst, type) {
|
15535 | var internalInstance = ReactInstanceMap.get(inst);
|
15536 | var constructor = internalInstance._currentElement.type;
|
15537 |
|
15538 | return !!(ReactTestUtils.isCompositeComponentElement(inst) && constructor === type);
|
15539 | },
|
15540 |
|
15541 | getRenderedChildOfCompositeComponent: function (inst) {
|
15542 | if (!ReactTestUtils.isCompositeComponent(inst)) {
|
15543 | return null;
|
15544 | }
|
15545 | var internalInstance = ReactInstanceMap.get(inst);
|
15546 | return internalInstance._renderedComponent.getPublicInstance();
|
15547 | },
|
15548 |
|
15549 | findAllInRenderedTree: function (inst, test) {
|
15550 | if (!inst) {
|
15551 | return [];
|
15552 | }
|
15553 | !ReactTestUtils.isCompositeComponent(inst) ? "development" !== 'production' ? invariant(false, 'findAllInRenderedTree(...): instance must be a composite component') : _prodInvariant('10') : void 0;
|
15554 | return findAllInRenderedTreeInternal(ReactInstanceMap.get(inst), test);
|
15555 | },
|
15556 |
|
15557 | |
15558 |
|
15559 |
|
15560 |
|
15561 |
|
15562 | scryRenderedDOMComponentsWithClass: function (root, classNames) {
|
15563 | return ReactTestUtils.findAllInRenderedTree(root, function (inst) {
|
15564 | if (ReactTestUtils.isDOMComponent(inst)) {
|
15565 | var className = inst.className;
|
15566 | if (typeof className !== 'string') {
|
15567 |
|
15568 | className = inst.getAttribute('class') || '';
|
15569 | }
|
15570 | var classList = className.split(/\s+/);
|
15571 |
|
15572 | if (!Array.isArray(classNames)) {
|
15573 | !(classNames !== undefined) ? "development" !== 'production' ? invariant(false, 'TestUtils.scryRenderedDOMComponentsWithClass expects a className as a second argument.') : _prodInvariant('11') : void 0;
|
15574 | classNames = classNames.split(/\s+/);
|
15575 | }
|
15576 | return classNames.every(function (name) {
|
15577 | return classList.indexOf(name) !== -1;
|
15578 | });
|
15579 | }
|
15580 | return false;
|
15581 | });
|
15582 | },
|
15583 |
|
15584 | |
15585 |
|
15586 |
|
15587 |
|
15588 |
|
15589 |
|
15590 | findRenderedDOMComponentWithClass: function (root, className) {
|
15591 | var all = ReactTestUtils.scryRenderedDOMComponentsWithClass(root, className);
|
15592 | if (all.length !== 1) {
|
15593 | throw new Error('Did not find exactly one match (found: ' + all.length + ') ' + 'for class:' + className);
|
15594 | }
|
15595 | return all[0];
|
15596 | },
|
15597 |
|
15598 | |
15599 |
|
15600 |
|
15601 |
|
15602 |
|
15603 | scryRenderedDOMComponentsWithTag: function (root, tagName) {
|
15604 | return ReactTestUtils.findAllInRenderedTree(root, function (inst) {
|
15605 | return ReactTestUtils.isDOMComponent(inst) && inst.tagName.toUpperCase() === tagName.toUpperCase();
|
15606 | });
|
15607 | },
|
15608 |
|
15609 | |
15610 |
|
15611 |
|
15612 |
|
15613 |
|
15614 |
|
15615 | findRenderedDOMComponentWithTag: function (root, tagName) {
|
15616 | var all = ReactTestUtils.scryRenderedDOMComponentsWithTag(root, tagName);
|
15617 | if (all.length !== 1) {
|
15618 | throw new Error('Did not find exactly one match (found: ' + all.length + ') ' + 'for tag:' + tagName);
|
15619 | }
|
15620 | return all[0];
|
15621 | },
|
15622 |
|
15623 | |
15624 |
|
15625 |
|
15626 |
|
15627 | scryRenderedComponentsWithType: function (root, componentType) {
|
15628 | return ReactTestUtils.findAllInRenderedTree(root, function (inst) {
|
15629 | return ReactTestUtils.isCompositeComponentWithType(inst, componentType);
|
15630 | });
|
15631 | },
|
15632 |
|
15633 | |
15634 |
|
15635 |
|
15636 |
|
15637 |
|
15638 |
|
15639 | findRenderedComponentWithType: function (root, componentType) {
|
15640 | var all = ReactTestUtils.scryRenderedComponentsWithType(root, componentType);
|
15641 | if (all.length !== 1) {
|
15642 | throw new Error('Did not find exactly one match (found: ' + all.length + ') ' + 'for componentType:' + componentType);
|
15643 | }
|
15644 | return all[0];
|
15645 | },
|
15646 |
|
15647 | |
15648 |
|
15649 |
|
15650 |
|
15651 |
|
15652 |
|
15653 |
|
15654 |
|
15655 |
|
15656 |
|
15657 |
|
15658 |
|
15659 |
|
15660 | mockComponent: function (module, mockTagName) {
|
15661 | mockTagName = mockTagName || module.mockTagName || 'div';
|
15662 |
|
15663 | module.prototype.render.mockImplementation(function () {
|
15664 | return React.createElement(mockTagName, null, this.props.children);
|
15665 | });
|
15666 |
|
15667 | return this;
|
15668 | },
|
15669 |
|
15670 | |
15671 |
|
15672 |
|
15673 |
|
15674 |
|
15675 |
|
15676 |
|
15677 | simulateNativeEventOnNode: function (topLevelType, node, fakeNativeEvent) {
|
15678 | fakeNativeEvent.target = node;
|
15679 | ReactBrowserEventEmitter.ReactEventListener.dispatchEvent(topLevelType, fakeNativeEvent);
|
15680 | },
|
15681 |
|
15682 | |
15683 |
|
15684 |
|
15685 |
|
15686 |
|
15687 |
|
15688 |
|
15689 | simulateNativeEventOnDOMComponent: function (topLevelType, comp, fakeNativeEvent) {
|
15690 | ReactTestUtils.simulateNativeEventOnNode(topLevelType, findDOMNode(comp), fakeNativeEvent);
|
15691 | },
|
15692 |
|
15693 | nativeTouchData: function (x, y) {
|
15694 | return {
|
15695 | touches: [{ pageX: x, pageY: y }]
|
15696 | };
|
15697 | },
|
15698 |
|
15699 | createRenderer: function () {
|
15700 | return new ReactShallowRenderer();
|
15701 | },
|
15702 |
|
15703 | Simulate: null,
|
15704 | SimulateNative: {}
|
15705 | };
|
15706 |
|
15707 |
|
15708 |
|
15709 |
|
15710 | var ReactShallowRenderer = function () {
|
15711 | this._instance = null;
|
15712 | };
|
15713 |
|
15714 | ReactShallowRenderer.prototype.getMountedInstance = function () {
|
15715 | return this._instance ? this._instance._instance : null;
|
15716 | };
|
15717 |
|
15718 | var nextDebugID = 1;
|
15719 |
|
15720 | var NoopInternalComponent = function (element) {
|
15721 | this._renderedOutput = element;
|
15722 | this._currentElement = element;
|
15723 |
|
15724 | if ("development" !== 'production') {
|
15725 | this._debugID = nextDebugID++;
|
15726 | }
|
15727 | };
|
15728 |
|
15729 | NoopInternalComponent.prototype = {
|
15730 |
|
15731 | mountComponent: function () {},
|
15732 |
|
15733 | receiveComponent: function (element) {
|
15734 | this._renderedOutput = element;
|
15735 | this._currentElement = element;
|
15736 | },
|
15737 |
|
15738 | getHostNode: function () {
|
15739 | return undefined;
|
15740 | },
|
15741 |
|
15742 | unmountComponent: function () {},
|
15743 |
|
15744 | getPublicInstance: function () {
|
15745 | return null;
|
15746 | }
|
15747 | };
|
15748 |
|
15749 | var ShallowComponentWrapper = function (element) {
|
15750 |
|
15751 | if ("development" !== 'production') {
|
15752 | this._debugID = nextDebugID++;
|
15753 | }
|
15754 |
|
15755 | this.construct(element);
|
15756 | };
|
15757 | _assign(ShallowComponentWrapper.prototype, ReactCompositeComponent.Mixin, {
|
15758 | _constructComponent: ReactCompositeComponent.Mixin._constructComponentWithoutOwner,
|
15759 | _instantiateReactComponent: function (element) {
|
15760 | return new NoopInternalComponent(element);
|
15761 | },
|
15762 | _replaceNodeWithMarkup: function () {},
|
15763 | _renderValidatedComponent: ReactCompositeComponent.Mixin._renderValidatedComponentWithoutOwnerOrContext
|
15764 | });
|
15765 |
|
15766 | ReactShallowRenderer.prototype.render = function (element, context) {
|
15767 |
|
15768 |
|
15769 |
|
15770 | ReactDefaultInjection.inject();
|
15771 |
|
15772 | !ReactElement.isValidElement(element) ? "development" !== 'production' ? invariant(false, 'ReactShallowRenderer render(): Invalid component element.%s', typeof element === 'function' ? ' Instead of passing a component class, make sure to instantiate ' + 'it by passing it to React.createElement.' : '') : _prodInvariant('12', typeof element === 'function' ? ' Instead of passing a component class, make sure to instantiate ' + 'it by passing it to React.createElement.' : '') : void 0;
|
15773 | !(typeof element.type !== 'string') ? "development" !== 'production' ? invariant(false, 'ReactShallowRenderer render(): Shallow rendering works only with custom components, not primitives (%s). Instead of calling `.render(el)` and inspecting the rendered output, look at `el.props` directly instead.', element.type) : _prodInvariant('13', element.type) : void 0;
|
15774 |
|
15775 | if (!context) {
|
15776 | context = emptyObject;
|
15777 | }
|
15778 | ReactUpdates.batchedUpdates(_batchedRender, this, element, context);
|
15779 |
|
15780 | return this.getRenderOutput();
|
15781 | };
|
15782 |
|
15783 | function _batchedRender(renderer, element, context) {
|
15784 | var transaction = ReactUpdates.ReactReconcileTransaction.getPooled(true);
|
15785 | renderer._render(element, transaction, context);
|
15786 | ReactUpdates.ReactReconcileTransaction.release(transaction);
|
15787 | }
|
15788 |
|
15789 | ReactShallowRenderer.prototype.getRenderOutput = function () {
|
15790 | return this._instance && this._instance._renderedComponent && this._instance._renderedComponent._renderedOutput || null;
|
15791 | };
|
15792 |
|
15793 | ReactShallowRenderer.prototype.unmount = function () {
|
15794 | if (this._instance) {
|
15795 | ReactReconciler.unmountComponent(this._instance, false);
|
15796 | }
|
15797 | };
|
15798 |
|
15799 | ReactShallowRenderer.prototype._render = function (element, transaction, context) {
|
15800 | if (this._instance) {
|
15801 | ReactReconciler.receiveComponent(this._instance, element, transaction, context);
|
15802 | } else {
|
15803 | var instance = new ShallowComponentWrapper(element);
|
15804 | ReactReconciler.mountComponent(instance, transaction, null, null, context, 0);
|
15805 | this._instance = instance;
|
15806 | }
|
15807 | };
|
15808 |
|
15809 |
|
15810 |
|
15811 |
|
15812 |
|
15813 |
|
15814 |
|
15815 |
|
15816 |
|
15817 | function makeSimulator(eventType) {
|
15818 | return function (domComponentOrNode, eventData) {
|
15819 | var node;
|
15820 | !!React.isValidElement(domComponentOrNode) ? "development" !== 'production' ? invariant(false, 'TestUtils.Simulate expects a component instance and not a ReactElement.TestUtils.Simulate will not work if you are using shallow rendering.') : _prodInvariant('14') : void 0;
|
15821 | if (ReactTestUtils.isDOMComponent(domComponentOrNode)) {
|
15822 | node = findDOMNode(domComponentOrNode);
|
15823 | } else if (domComponentOrNode.tagName) {
|
15824 | node = domComponentOrNode;
|
15825 | }
|
15826 |
|
15827 | var dispatchConfig = EventPluginRegistry.eventNameDispatchConfigs[eventType];
|
15828 |
|
15829 | var fakeNativeEvent = new Event();
|
15830 | fakeNativeEvent.target = node;
|
15831 | fakeNativeEvent.type = eventType.toLowerCase();
|
15832 |
|
15833 |
|
15834 |
|
15835 | var event = new SyntheticEvent(dispatchConfig, ReactDOMComponentTree.getInstanceFromNode(node), fakeNativeEvent, node);
|
15836 |
|
15837 |
|
15838 | event.persist();
|
15839 | _assign(event, eventData);
|
15840 |
|
15841 | if (dispatchConfig.phasedRegistrationNames) {
|
15842 | EventPropagators.accumulateTwoPhaseDispatches(event);
|
15843 | } else {
|
15844 | EventPropagators.accumulateDirectDispatches(event);
|
15845 | }
|
15846 |
|
15847 | ReactUpdates.batchedUpdates(function () {
|
15848 | EventPluginHub.enqueueEvents(event);
|
15849 | EventPluginHub.processEventQueue(true);
|
15850 | });
|
15851 | };
|
15852 | }
|
15853 |
|
15854 | function buildSimulators() {
|
15855 | ReactTestUtils.Simulate = {};
|
15856 |
|
15857 | var eventType;
|
15858 | for (eventType in EventPluginRegistry.eventNameDispatchConfigs) {
|
15859 | |
15860 |
|
15861 |
|
15862 |
|
15863 | ReactTestUtils.Simulate[eventType] = makeSimulator(eventType);
|
15864 | }
|
15865 | }
|
15866 |
|
15867 |
|
15868 | var oldInjectEventPluginOrder = EventPluginHub.injection.injectEventPluginOrder;
|
15869 | EventPluginHub.injection.injectEventPluginOrder = function () {
|
15870 | oldInjectEventPluginOrder.apply(this, arguments);
|
15871 | buildSimulators();
|
15872 | };
|
15873 | var oldInjectEventPlugins = EventPluginHub.injection.injectEventPluginsByName;
|
15874 | EventPluginHub.injection.injectEventPluginsByName = function () {
|
15875 | oldInjectEventPlugins.apply(this, arguments);
|
15876 | buildSimulators();
|
15877 | };
|
15878 |
|
15879 | buildSimulators();
|
15880 |
|
15881 |
|
15882 |
|
15883 |
|
15884 |
|
15885 |
|
15886 |
|
15887 |
|
15888 |
|
15889 |
|
15890 |
|
15891 |
|
15892 |
|
15893 |
|
15894 |
|
15895 |
|
15896 |
|
15897 | function makeNativeSimulator(eventType) {
|
15898 | return function (domComponentOrNode, nativeEventData) {
|
15899 | var fakeNativeEvent = new Event(eventType);
|
15900 | _assign(fakeNativeEvent, nativeEventData);
|
15901 | if (ReactTestUtils.isDOMComponent(domComponentOrNode)) {
|
15902 | ReactTestUtils.simulateNativeEventOnDOMComponent(eventType, domComponentOrNode, fakeNativeEvent);
|
15903 | } else if (domComponentOrNode.tagName) {
|
15904 |
|
15905 | ReactTestUtils.simulateNativeEventOnNode(eventType, domComponentOrNode, fakeNativeEvent);
|
15906 | }
|
15907 | };
|
15908 | }
|
15909 |
|
15910 | Object.keys(topLevelTypes).forEach(function (eventType) {
|
15911 |
|
15912 | var convenienceName = eventType.indexOf('top') === 0 ? eventType.charAt(3).toLowerCase() + eventType.substr(4) : eventType;
|
15913 | |
15914 |
|
15915 |
|
15916 |
|
15917 | ReactTestUtils.SimulateNative[convenienceName] = makeNativeSimulator(eventType);
|
15918 | });
|
15919 |
|
15920 | module.exports = ReactTestUtils;
|
15921 | },{"107":107,"118":118,"136":136,"153":153,"16":16,"17":17,"171":171,"178":178,"18":18,"188":188,"20":20,"27":27,"28":28,"40":40,"42":42,"46":46,"64":64,"65":65,"77":77,"95":95}],103:[function(_dereq_,module,exports){
|
15922 |
|
15923 |
|
15924 |
|
15925 |
|
15926 |
|
15927 |
|
15928 |
|
15929 |
|
15930 |
|
15931 |
|
15932 |
|
15933 | 'use strict';
|
15934 |
|
15935 | var flattenChildren = _dereq_(137);
|
15936 |
|
15937 | var ReactTransitionChildMapping = {
|
15938 | |
15939 |
|
15940 |
|
15941 |
|
15942 |
|
15943 |
|
15944 |
|
15945 |
|
15946 | getChildMapping: function (children, selfDebugID) {
|
15947 | if (!children) {
|
15948 | return children;
|
15949 | }
|
15950 |
|
15951 | if ("development" !== 'production') {
|
15952 | return flattenChildren(children, selfDebugID);
|
15953 | }
|
15954 |
|
15955 | return flattenChildren(children);
|
15956 | },
|
15957 |
|
15958 | |
15959 |
|
15960 |
|
15961 |
|
15962 |
|
15963 |
|
15964 |
|
15965 |
|
15966 |
|
15967 |
|
15968 |
|
15969 |
|
15970 |
|
15971 |
|
15972 |
|
15973 |
|
15974 |
|
15975 | mergeChildMappings: function (prev, next) {
|
15976 | prev = prev || {};
|
15977 | next = next || {};
|
15978 |
|
15979 | function getValueForKey(key) {
|
15980 | if (next.hasOwnProperty(key)) {
|
15981 | return next[key];
|
15982 | } else {
|
15983 | return prev[key];
|
15984 | }
|
15985 | }
|
15986 |
|
15987 |
|
15988 |
|
15989 | var nextKeysPending = {};
|
15990 |
|
15991 | var pendingKeys = [];
|
15992 | for (var prevKey in prev) {
|
15993 | if (next.hasOwnProperty(prevKey)) {
|
15994 | if (pendingKeys.length) {
|
15995 | nextKeysPending[prevKey] = pendingKeys;
|
15996 | pendingKeys = [];
|
15997 | }
|
15998 | } else {
|
15999 | pendingKeys.push(prevKey);
|
16000 | }
|
16001 | }
|
16002 |
|
16003 | var i;
|
16004 | var childMapping = {};
|
16005 | for (var nextKey in next) {
|
16006 | if (nextKeysPending.hasOwnProperty(nextKey)) {
|
16007 | for (i = 0; i < nextKeysPending[nextKey].length; i++) {
|
16008 | var pendingNextKey = nextKeysPending[nextKey][i];
|
16009 | childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);
|
16010 | }
|
16011 | }
|
16012 | childMapping[nextKey] = getValueForKey(nextKey);
|
16013 | }
|
16014 |
|
16015 |
|
16016 | for (i = 0; i < pendingKeys.length; i++) {
|
16017 | childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);
|
16018 | }
|
16019 |
|
16020 | return childMapping;
|
16021 | }
|
16022 | };
|
16023 |
|
16024 | module.exports = ReactTransitionChildMapping;
|
16025 | },{"137":137}],104:[function(_dereq_,module,exports){
|
16026 |
|
16027 |
|
16028 |
|
16029 |
|
16030 |
|
16031 |
|
16032 |
|
16033 |
|
16034 |
|
16035 |
|
16036 |
|
16037 | 'use strict';
|
16038 |
|
16039 | var ExecutionEnvironment = _dereq_(164);
|
16040 |
|
16041 | var getVendorPrefixedEventName = _dereq_(147);
|
16042 |
|
16043 | var endEvents = [];
|
16044 |
|
16045 | function detectEvents() {
|
16046 | var animEnd = getVendorPrefixedEventName('animationend');
|
16047 | var transEnd = getVendorPrefixedEventName('transitionend');
|
16048 |
|
16049 | if (animEnd) {
|
16050 | endEvents.push(animEnd);
|
16051 | }
|
16052 |
|
16053 | if (transEnd) {
|
16054 | endEvents.push(transEnd);
|
16055 | }
|
16056 | }
|
16057 |
|
16058 | if (ExecutionEnvironment.canUseDOM) {
|
16059 | detectEvents();
|
16060 | }
|
16061 |
|
16062 |
|
16063 |
|
16064 |
|
16065 |
|
16066 |
|
16067 | function addEventListener(node, eventName, eventListener) {
|
16068 | node.addEventListener(eventName, eventListener, false);
|
16069 | }
|
16070 |
|
16071 | function removeEventListener(node, eventName, eventListener) {
|
16072 | node.removeEventListener(eventName, eventListener, false);
|
16073 | }
|
16074 |
|
16075 | var ReactTransitionEvents = {
|
16076 | addEndEventListener: function (node, eventListener) {
|
16077 | if (endEvents.length === 0) {
|
16078 |
|
16079 |
|
16080 | window.setTimeout(eventListener, 0);
|
16081 | return;
|
16082 | }
|
16083 | endEvents.forEach(function (endEvent) {
|
16084 | addEventListener(node, endEvent, eventListener);
|
16085 | });
|
16086 | },
|
16087 |
|
16088 | removeEndEventListener: function (node, eventListener) {
|
16089 | if (endEvents.length === 0) {
|
16090 | return;
|
16091 | }
|
16092 | endEvents.forEach(function (endEvent) {
|
16093 | removeEventListener(node, endEvent, eventListener);
|
16094 | });
|
16095 | }
|
16096 | };
|
16097 |
|
16098 | module.exports = ReactTransitionEvents;
|
16099 | },{"147":147,"164":164}],105:[function(_dereq_,module,exports){
|
16100 |
|
16101 |
|
16102 |
|
16103 |
|
16104 |
|
16105 |
|
16106 |
|
16107 |
|
16108 |
|
16109 |
|
16110 |
|
16111 | 'use strict';
|
16112 |
|
16113 | var _assign = _dereq_(188);
|
16114 |
|
16115 | var React = _dereq_(27);
|
16116 | var ReactInstanceMap = _dereq_(77);
|
16117 | var ReactTransitionChildMapping = _dereq_(103);
|
16118 |
|
16119 | var emptyFunction = _dereq_(170);
|
16120 |
|
16121 |
|
16122 |
|
16123 |
|
16124 |
|
16125 |
|
16126 | var ReactTransitionGroup = React.createClass({
|
16127 | displayName: 'ReactTransitionGroup',
|
16128 |
|
16129 | propTypes: {
|
16130 | component: React.PropTypes.any,
|
16131 | childFactory: React.PropTypes.func
|
16132 | },
|
16133 |
|
16134 | getDefaultProps: function () {
|
16135 | return {
|
16136 | component: 'span',
|
16137 | childFactory: emptyFunction.thatReturnsArgument
|
16138 | };
|
16139 | },
|
16140 |
|
16141 | getInitialState: function () {
|
16142 | return {
|
16143 |
|
16144 | children: ReactTransitionChildMapping.getChildMapping(this.props.children)
|
16145 | };
|
16146 | },
|
16147 |
|
16148 | componentWillMount: function () {
|
16149 | this.currentlyTransitioningKeys = {};
|
16150 | this.keysToEnter = [];
|
16151 | this.keysToLeave = [];
|
16152 | },
|
16153 |
|
16154 | componentDidMount: function () {
|
16155 | var initialChildMapping = this.state.children;
|
16156 | for (var key in initialChildMapping) {
|
16157 | if (initialChildMapping[key]) {
|
16158 | this.performAppear(key);
|
16159 | }
|
16160 | }
|
16161 | },
|
16162 |
|
16163 | componentWillReceiveProps: function (nextProps) {
|
16164 | var nextChildMapping;
|
16165 | if ("development" !== 'production') {
|
16166 | nextChildMapping = ReactTransitionChildMapping.getChildMapping(nextProps.children, ReactInstanceMap.get(this)._debugID);
|
16167 | } else {
|
16168 | nextChildMapping = ReactTransitionChildMapping.getChildMapping(nextProps.children);
|
16169 | }
|
16170 | var prevChildMapping = this.state.children;
|
16171 |
|
16172 | this.setState({
|
16173 | children: ReactTransitionChildMapping.mergeChildMappings(prevChildMapping, nextChildMapping)
|
16174 | });
|
16175 |
|
16176 | var key;
|
16177 |
|
16178 | for (key in nextChildMapping) {
|
16179 | var hasPrev = prevChildMapping && prevChildMapping.hasOwnProperty(key);
|
16180 | if (nextChildMapping[key] && !hasPrev && !this.currentlyTransitioningKeys[key]) {
|
16181 | this.keysToEnter.push(key);
|
16182 | }
|
16183 | }
|
16184 |
|
16185 | for (key in prevChildMapping) {
|
16186 | var hasNext = nextChildMapping && nextChildMapping.hasOwnProperty(key);
|
16187 | if (prevChildMapping[key] && !hasNext && !this.currentlyTransitioningKeys[key]) {
|
16188 | this.keysToLeave.push(key);
|
16189 | }
|
16190 | }
|
16191 |
|
16192 |
|
16193 | },
|
16194 |
|
16195 | componentDidUpdate: function () {
|
16196 | var keysToEnter = this.keysToEnter;
|
16197 | this.keysToEnter = [];
|
16198 | keysToEnter.forEach(this.performEnter);
|
16199 |
|
16200 | var keysToLeave = this.keysToLeave;
|
16201 | this.keysToLeave = [];
|
16202 | keysToLeave.forEach(this.performLeave);
|
16203 | },
|
16204 |
|
16205 | performAppear: function (key) {
|
16206 | this.currentlyTransitioningKeys[key] = true;
|
16207 |
|
16208 | var component = this.refs[key];
|
16209 |
|
16210 | if (component.componentWillAppear) {
|
16211 | component.componentWillAppear(this._handleDoneAppearing.bind(this, key));
|
16212 | } else {
|
16213 | this._handleDoneAppearing(key);
|
16214 | }
|
16215 | },
|
16216 |
|
16217 | _handleDoneAppearing: function (key) {
|
16218 | var component = this.refs[key];
|
16219 | if (component.componentDidAppear) {
|
16220 | component.componentDidAppear();
|
16221 | }
|
16222 |
|
16223 | delete this.currentlyTransitioningKeys[key];
|
16224 |
|
16225 | var currentChildMapping;
|
16226 | if ("development" !== 'production') {
|
16227 | currentChildMapping = ReactTransitionChildMapping.getChildMapping(this.props.children, ReactInstanceMap.get(this)._debugID);
|
16228 | } else {
|
16229 | currentChildMapping = ReactTransitionChildMapping.getChildMapping(this.props.children);
|
16230 | }
|
16231 |
|
16232 | if (!currentChildMapping || !currentChildMapping.hasOwnProperty(key)) {
|
16233 |
|
16234 | this.performLeave(key);
|
16235 | }
|
16236 | },
|
16237 |
|
16238 | performEnter: function (key) {
|
16239 | this.currentlyTransitioningKeys[key] = true;
|
16240 |
|
16241 | var component = this.refs[key];
|
16242 |
|
16243 | if (component.componentWillEnter) {
|
16244 | component.componentWillEnter(this._handleDoneEntering.bind(this, key));
|
16245 | } else {
|
16246 | this._handleDoneEntering(key);
|
16247 | }
|
16248 | },
|
16249 |
|
16250 | _handleDoneEntering: function (key) {
|
16251 | var component = this.refs[key];
|
16252 | if (component.componentDidEnter) {
|
16253 | component.componentDidEnter();
|
16254 | }
|
16255 |
|
16256 | delete this.currentlyTransitioningKeys[key];
|
16257 |
|
16258 | var currentChildMapping;
|
16259 | if ("development" !== 'production') {
|
16260 | currentChildMapping = ReactTransitionChildMapping.getChildMapping(this.props.children, ReactInstanceMap.get(this)._debugID);
|
16261 | } else {
|
16262 | currentChildMapping = ReactTransitionChildMapping.getChildMapping(this.props.children);
|
16263 | }
|
16264 |
|
16265 | if (!currentChildMapping || !currentChildMapping.hasOwnProperty(key)) {
|
16266 |
|
16267 | this.performLeave(key);
|
16268 | }
|
16269 | },
|
16270 |
|
16271 | performLeave: function (key) {
|
16272 | this.currentlyTransitioningKeys[key] = true;
|
16273 |
|
16274 | var component = this.refs[key];
|
16275 | if (component.componentWillLeave) {
|
16276 | component.componentWillLeave(this._handleDoneLeaving.bind(this, key));
|
16277 | } else {
|
16278 |
|
16279 |
|
16280 |
|
16281 | this._handleDoneLeaving(key);
|
16282 | }
|
16283 | },
|
16284 |
|
16285 | _handleDoneLeaving: function (key) {
|
16286 | var component = this.refs[key];
|
16287 |
|
16288 | if (component.componentDidLeave) {
|
16289 | component.componentDidLeave();
|
16290 | }
|
16291 |
|
16292 | delete this.currentlyTransitioningKeys[key];
|
16293 |
|
16294 | var currentChildMapping;
|
16295 | if ("development" !== 'production') {
|
16296 | currentChildMapping = ReactTransitionChildMapping.getChildMapping(this.props.children, ReactInstanceMap.get(this)._debugID);
|
16297 | } else {
|
16298 | currentChildMapping = ReactTransitionChildMapping.getChildMapping(this.props.children);
|
16299 | }
|
16300 |
|
16301 | if (currentChildMapping && currentChildMapping.hasOwnProperty(key)) {
|
16302 |
|
16303 | this.performEnter(key);
|
16304 | } else {
|
16305 | this.setState(function (state) {
|
16306 | var newChildren = _assign({}, state.children);
|
16307 | delete newChildren[key];
|
16308 | return { children: newChildren };
|
16309 | });
|
16310 | }
|
16311 | },
|
16312 |
|
16313 | render: function () {
|
16314 |
|
16315 |
|
16316 | var childrenToRender = [];
|
16317 | for (var key in this.state.children) {
|
16318 | var child = this.state.children[key];
|
16319 | if (child) {
|
16320 |
|
16321 |
|
16322 |
|
16323 |
|
16324 |
|
16325 | childrenToRender.push(React.cloneElement(this.props.childFactory(child), { ref: key, key: key }));
|
16326 | }
|
16327 | }
|
16328 |
|
16329 |
|
16330 | var props = _assign({}, this.props);
|
16331 | delete props.transitionLeave;
|
16332 | delete props.transitionName;
|
16333 | delete props.transitionAppear;
|
16334 | delete props.transitionEnter;
|
16335 | delete props.childFactory;
|
16336 | delete props.transitionLeaveTimeout;
|
16337 | delete props.transitionEnterTimeout;
|
16338 | delete props.transitionAppearTimeout;
|
16339 | delete props.component;
|
16340 |
|
16341 | return React.createElement(this.props.component, props, childrenToRender);
|
16342 | }
|
16343 | });
|
16344 |
|
16345 | module.exports = ReactTransitionGroup;
|
16346 | },{"103":103,"170":170,"188":188,"27":27,"77":77}],106:[function(_dereq_,module,exports){
|
16347 |
|
16348 |
|
16349 |
|
16350 |
|
16351 |
|
16352 |
|
16353 |
|
16354 |
|
16355 |
|
16356 |
|
16357 |
|
16358 | 'use strict';
|
16359 |
|
16360 | var _prodInvariant = _dereq_(153);
|
16361 |
|
16362 | var ReactCurrentOwner = _dereq_(41);
|
16363 | var ReactInstanceMap = _dereq_(77);
|
16364 | var ReactInstrumentation = _dereq_(78);
|
16365 | var ReactUpdates = _dereq_(107);
|
16366 |
|
16367 | var invariant = _dereq_(178);
|
16368 | var warning = _dereq_(187);
|
16369 |
|
16370 | function enqueueUpdate(internalInstance) {
|
16371 | ReactUpdates.enqueueUpdate(internalInstance);
|
16372 | }
|
16373 |
|
16374 | function formatUnexpectedArgument(arg) {
|
16375 | var type = typeof arg;
|
16376 | if (type !== 'object') {
|
16377 | return type;
|
16378 | }
|
16379 | var displayName = arg.constructor && arg.constructor.name || type;
|
16380 | var keys = Object.keys(arg);
|
16381 | if (keys.length > 0 && keys.length < 20) {
|
16382 | return displayName + ' (keys: ' + keys.join(', ') + ')';
|
16383 | }
|
16384 | return displayName;
|
16385 | }
|
16386 |
|
16387 | function getInternalInstanceReadyForUpdate(publicInstance, callerName) {
|
16388 | var internalInstance = ReactInstanceMap.get(publicInstance);
|
16389 | if (!internalInstance) {
|
16390 | if ("development" !== 'production') {
|
16391 | var ctor = publicInstance.constructor;
|
16392 |
|
16393 |
|
16394 |
|
16395 | "development" !== 'production' ? warning(!callerName, '%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, ctor && (ctor.displayName || ctor.name) || 'ReactClass') : void 0;
|
16396 | }
|
16397 | return null;
|
16398 | }
|
16399 |
|
16400 | if ("development" !== 'production') {
|
16401 | "development" !== 'production' ? warning(ReactCurrentOwner.current == null, '%s(...): Cannot update during an existing state transition (such as ' + 'within `render` or another component\'s constructor). Render methods ' + 'should be a pure function of props and state; constructor ' + 'side-effects are an anti-pattern, but can be moved to ' + '`componentWillMount`.', callerName) : void 0;
|
16402 | }
|
16403 |
|
16404 | return internalInstance;
|
16405 | }
|
16406 |
|
16407 |
|
16408 |
|
16409 |
|
16410 |
|
16411 | var ReactUpdateQueue = {
|
16412 |
|
16413 | |
16414 |
|
16415 |
|
16416 |
|
16417 |
|
16418 |
|
16419 |
|
16420 | isMounted: function (publicInstance) {
|
16421 | if ("development" !== 'production') {
|
16422 | var owner = ReactCurrentOwner.current;
|
16423 | if (owner !== null) {
|
16424 | "development" !== 'production' ? warning(owner._warnedAboutRefsInRender, '%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', owner.getName() || 'A component') : void 0;
|
16425 | owner._warnedAboutRefsInRender = true;
|
16426 | }
|
16427 | }
|
16428 | var internalInstance = ReactInstanceMap.get(publicInstance);
|
16429 | if (internalInstance) {
|
16430 |
|
16431 |
|
16432 |
|
16433 | return !!internalInstance._renderedComponent;
|
16434 | } else {
|
16435 | return false;
|
16436 | }
|
16437 | },
|
16438 |
|
16439 | |
16440 |
|
16441 |
|
16442 |
|
16443 |
|
16444 |
|
16445 |
|
16446 |
|
16447 |
|
16448 | enqueueCallback: function (publicInstance, callback, callerName) {
|
16449 | ReactUpdateQueue.validateCallback(callback, callerName);
|
16450 | var internalInstance = getInternalInstanceReadyForUpdate(publicInstance);
|
16451 |
|
16452 |
|
16453 |
|
16454 |
|
16455 |
|
16456 |
|
16457 | if (!internalInstance) {
|
16458 | return null;
|
16459 | }
|
16460 |
|
16461 | if (internalInstance._pendingCallbacks) {
|
16462 | internalInstance._pendingCallbacks.push(callback);
|
16463 | } else {
|
16464 | internalInstance._pendingCallbacks = [callback];
|
16465 | }
|
16466 |
|
16467 |
|
16468 |
|
16469 |
|
16470 | enqueueUpdate(internalInstance);
|
16471 | },
|
16472 |
|
16473 | enqueueCallbackInternal: function (internalInstance, callback) {
|
16474 | if (internalInstance._pendingCallbacks) {
|
16475 | internalInstance._pendingCallbacks.push(callback);
|
16476 | } else {
|
16477 | internalInstance._pendingCallbacks = [callback];
|
16478 | }
|
16479 | enqueueUpdate(internalInstance);
|
16480 | },
|
16481 |
|
16482 | |
16483 |
|
16484 |
|
16485 |
|
16486 |
|
16487 |
|
16488 |
|
16489 |
|
16490 |
|
16491 |
|
16492 |
|
16493 |
|
16494 |
|
16495 | enqueueForceUpdate: function (publicInstance) {
|
16496 | var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'forceUpdate');
|
16497 |
|
16498 | if (!internalInstance) {
|
16499 | return;
|
16500 | }
|
16501 |
|
16502 | internalInstance._pendingForceUpdate = true;
|
16503 |
|
16504 | enqueueUpdate(internalInstance);
|
16505 | },
|
16506 |
|
16507 | |
16508 |
|
16509 |
|
16510 |
|
16511 |
|
16512 |
|
16513 |
|
16514 |
|
16515 |
|
16516 |
|
16517 |
|
16518 | enqueueReplaceState: function (publicInstance, completeState) {
|
16519 | var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'replaceState');
|
16520 |
|
16521 | if (!internalInstance) {
|
16522 | return;
|
16523 | }
|
16524 |
|
16525 | internalInstance._pendingStateQueue = [completeState];
|
16526 | internalInstance._pendingReplaceState = true;
|
16527 |
|
16528 | enqueueUpdate(internalInstance);
|
16529 | },
|
16530 |
|
16531 | |
16532 |
|
16533 |
|
16534 |
|
16535 |
|
16536 |
|
16537 |
|
16538 |
|
16539 |
|
16540 |
|
16541 | enqueueSetState: function (publicInstance, partialState) {
|
16542 | if ("development" !== 'production') {
|
16543 | ReactInstrumentation.debugTool.onSetState();
|
16544 | "development" !== 'production' ? warning(partialState != null, 'setState(...): You passed an undefined or null state object; ' + 'instead, use forceUpdate().') : void 0;
|
16545 | }
|
16546 |
|
16547 | var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'setState');
|
16548 |
|
16549 | if (!internalInstance) {
|
16550 | return;
|
16551 | }
|
16552 |
|
16553 | var queue = internalInstance._pendingStateQueue || (internalInstance._pendingStateQueue = []);
|
16554 | queue.push(partialState);
|
16555 |
|
16556 | enqueueUpdate(internalInstance);
|
16557 | },
|
16558 |
|
16559 | enqueueElementInternal: function (internalInstance, nextElement, nextContext) {
|
16560 | internalInstance._pendingElement = nextElement;
|
16561 |
|
16562 | internalInstance._context = nextContext;
|
16563 | enqueueUpdate(internalInstance);
|
16564 | },
|
16565 |
|
16566 | validateCallback: function (callback, callerName) {
|
16567 | !(!callback || typeof callback === 'function') ? "development" !== 'production' ? invariant(false, '%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.', callerName, formatUnexpectedArgument(callback)) : _prodInvariant('122', callerName, formatUnexpectedArgument(callback)) : void 0;
|
16568 | }
|
16569 |
|
16570 | };
|
16571 |
|
16572 | module.exports = ReactUpdateQueue;
|
16573 | },{"107":107,"153":153,"178":178,"187":187,"41":41,"77":77,"78":78}],107:[function(_dereq_,module,exports){
|
16574 |
|
16575 |
|
16576 |
|
16577 |
|
16578 |
|
16579 |
|
16580 |
|
16581 |
|
16582 |
|
16583 |
|
16584 |
|
16585 | 'use strict';
|
16586 |
|
16587 | var _prodInvariant = _dereq_(153),
|
16588 | _assign = _dereq_(188);
|
16589 |
|
16590 | var CallbackQueue = _dereq_(5);
|
16591 | var PooledClass = _dereq_(26);
|
16592 | var ReactFeatureFlags = _dereq_(71);
|
16593 | var ReactReconciler = _dereq_(95);
|
16594 | var Transaction = _dereq_(127);
|
16595 |
|
16596 | var invariant = _dereq_(178);
|
16597 |
|
16598 | var dirtyComponents = [];
|
16599 | var updateBatchNumber = 0;
|
16600 | var asapCallbackQueue = CallbackQueue.getPooled();
|
16601 | var asapEnqueued = false;
|
16602 |
|
16603 | var batchingStrategy = null;
|
16604 |
|
16605 | function ensureInjected() {
|
16606 | !(ReactUpdates.ReactReconcileTransaction && batchingStrategy) ? "development" !== 'production' ? invariant(false, 'ReactUpdates: must inject a reconcile transaction class and batching strategy') : _prodInvariant('123') : void 0;
|
16607 | }
|
16608 |
|
16609 | var NESTED_UPDATES = {
|
16610 | initialize: function () {
|
16611 | this.dirtyComponentsLength = dirtyComponents.length;
|
16612 | },
|
16613 | close: function () {
|
16614 | if (this.dirtyComponentsLength !== dirtyComponents.length) {
|
16615 |
|
16616 |
|
16617 |
|
16618 |
|
16619 |
|
16620 | dirtyComponents.splice(0, this.dirtyComponentsLength);
|
16621 | flushBatchedUpdates();
|
16622 | } else {
|
16623 | dirtyComponents.length = 0;
|
16624 | }
|
16625 | }
|
16626 | };
|
16627 |
|
16628 | var UPDATE_QUEUEING = {
|
16629 | initialize: function () {
|
16630 | this.callbackQueue.reset();
|
16631 | },
|
16632 | close: function () {
|
16633 | this.callbackQueue.notifyAll();
|
16634 | }
|
16635 | };
|
16636 |
|
16637 | var TRANSACTION_WRAPPERS = [NESTED_UPDATES, UPDATE_QUEUEING];
|
16638 |
|
16639 | function ReactUpdatesFlushTransaction() {
|
16640 | this.reinitializeTransaction();
|
16641 | this.dirtyComponentsLength = null;
|
16642 | this.callbackQueue = CallbackQueue.getPooled();
|
16643 | this.reconcileTransaction = ReactUpdates.ReactReconcileTransaction.getPooled(
|
16644 | true);
|
16645 | }
|
16646 |
|
16647 | _assign(ReactUpdatesFlushTransaction.prototype, Transaction.Mixin, {
|
16648 | getTransactionWrappers: function () {
|
16649 | return TRANSACTION_WRAPPERS;
|
16650 | },
|
16651 |
|
16652 | destructor: function () {
|
16653 | this.dirtyComponentsLength = null;
|
16654 | CallbackQueue.release(this.callbackQueue);
|
16655 | this.callbackQueue = null;
|
16656 | ReactUpdates.ReactReconcileTransaction.release(this.reconcileTransaction);
|
16657 | this.reconcileTransaction = null;
|
16658 | },
|
16659 |
|
16660 | perform: function (method, scope, a) {
|
16661 |
|
16662 |
|
16663 | return Transaction.Mixin.perform.call(this, this.reconcileTransaction.perform, this.reconcileTransaction, method, scope, a);
|
16664 | }
|
16665 | });
|
16666 |
|
16667 | PooledClass.addPoolingTo(ReactUpdatesFlushTransaction);
|
16668 |
|
16669 | function batchedUpdates(callback, a, b, c, d, e) {
|
16670 | ensureInjected();
|
16671 | batchingStrategy.batchedUpdates(callback, a, b, c, d, e);
|
16672 | }
|
16673 |
|
16674 |
|
16675 |
|
16676 |
|
16677 |
|
16678 |
|
16679 |
|
16680 |
|
16681 | function mountOrderComparator(c1, c2) {
|
16682 | return c1._mountOrder - c2._mountOrder;
|
16683 | }
|
16684 |
|
16685 | function runBatchedUpdates(transaction) {
|
16686 | var len = transaction.dirtyComponentsLength;
|
16687 | !(len === dirtyComponents.length) ? "development" !== 'production' ? invariant(false, 'Expected flush transaction\'s stored dirty-components length (%s) to match dirty-components array length (%s).', len, dirtyComponents.length) : _prodInvariant('124', len, dirtyComponents.length) : void 0;
|
16688 |
|
16689 |
|
16690 |
|
16691 |
|
16692 | dirtyComponents.sort(mountOrderComparator);
|
16693 |
|
16694 |
|
16695 |
|
16696 |
|
16697 |
|
16698 |
|
16699 | updateBatchNumber++;
|
16700 |
|
16701 | for (var i = 0; i < len; i++) {
|
16702 |
|
16703 |
|
16704 |
|
16705 | var component = dirtyComponents[i];
|
16706 |
|
16707 |
|
16708 |
|
16709 |
|
16710 | var callbacks = component._pendingCallbacks;
|
16711 | component._pendingCallbacks = null;
|
16712 |
|
16713 | var markerName;
|
16714 | if (ReactFeatureFlags.logTopLevelRenders) {
|
16715 | var namedComponent = component;
|
16716 |
|
16717 | if (component._currentElement.props === component._renderedComponent._currentElement) {
|
16718 | namedComponent = component._renderedComponent;
|
16719 | }
|
16720 | markerName = 'React update: ' + namedComponent.getName();
|
16721 | console.time(markerName);
|
16722 | }
|
16723 |
|
16724 | ReactReconciler.performUpdateIfNecessary(component, transaction.reconcileTransaction, updateBatchNumber);
|
16725 |
|
16726 | if (markerName) {
|
16727 | console.timeEnd(markerName);
|
16728 | }
|
16729 |
|
16730 | if (callbacks) {
|
16731 | for (var j = 0; j < callbacks.length; j++) {
|
16732 | transaction.callbackQueue.enqueue(callbacks[j], component.getPublicInstance());
|
16733 | }
|
16734 | }
|
16735 | }
|
16736 | }
|
16737 |
|
16738 | var flushBatchedUpdates = function () {
|
16739 |
|
16740 |
|
16741 |
|
16742 |
|
16743 | while (dirtyComponents.length || asapEnqueued) {
|
16744 | if (dirtyComponents.length) {
|
16745 | var transaction = ReactUpdatesFlushTransaction.getPooled();
|
16746 | transaction.perform(runBatchedUpdates, null, transaction);
|
16747 | ReactUpdatesFlushTransaction.release(transaction);
|
16748 | }
|
16749 |
|
16750 | if (asapEnqueued) {
|
16751 | asapEnqueued = false;
|
16752 | var queue = asapCallbackQueue;
|
16753 | asapCallbackQueue = CallbackQueue.getPooled();
|
16754 | queue.notifyAll();
|
16755 | CallbackQueue.release(queue);
|
16756 | }
|
16757 | }
|
16758 | };
|
16759 |
|
16760 |
|
16761 |
|
16762 |
|
16763 |
|
16764 | function enqueueUpdate(component) {
|
16765 | ensureInjected();
|
16766 |
|
16767 |
|
16768 |
|
16769 |
|
16770 |
|
16771 |
|
16772 |
|
16773 | if (!batchingStrategy.isBatchingUpdates) {
|
16774 | batchingStrategy.batchedUpdates(enqueueUpdate, component);
|
16775 | return;
|
16776 | }
|
16777 |
|
16778 | dirtyComponents.push(component);
|
16779 | if (component._updateBatchNumber == null) {
|
16780 | component._updateBatchNumber = updateBatchNumber + 1;
|
16781 | }
|
16782 | }
|
16783 |
|
16784 |
|
16785 |
|
16786 |
|
16787 |
|
16788 | function asap(callback, context) {
|
16789 | !batchingStrategy.isBatchingUpdates ? "development" !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\'t enqueue an asap callback in a context whereupdates are not being batched.') : _prodInvariant('125') : void 0;
|
16790 | asapCallbackQueue.enqueue(callback, context);
|
16791 | asapEnqueued = true;
|
16792 | }
|
16793 |
|
16794 | var ReactUpdatesInjection = {
|
16795 | injectReconcileTransaction: function (ReconcileTransaction) {
|
16796 | !ReconcileTransaction ? "development" !== 'production' ? invariant(false, 'ReactUpdates: must provide a reconcile transaction class') : _prodInvariant('126') : void 0;
|
16797 | ReactUpdates.ReactReconcileTransaction = ReconcileTransaction;
|
16798 | },
|
16799 |
|
16800 | injectBatchingStrategy: function (_batchingStrategy) {
|
16801 | !_batchingStrategy ? "development" !== 'production' ? invariant(false, 'ReactUpdates: must provide a batching strategy') : _prodInvariant('127') : void 0;
|
16802 | !(typeof _batchingStrategy.batchedUpdates === 'function') ? "development" !== 'production' ? invariant(false, 'ReactUpdates: must provide a batchedUpdates() function') : _prodInvariant('128') : void 0;
|
16803 | !(typeof _batchingStrategy.isBatchingUpdates === 'boolean') ? "development" !== 'production' ? invariant(false, 'ReactUpdates: must provide an isBatchingUpdates boolean attribute') : _prodInvariant('129') : void 0;
|
16804 | batchingStrategy = _batchingStrategy;
|
16805 | }
|
16806 | };
|
16807 |
|
16808 | var ReactUpdates = {
|
16809 | |
16810 |
|
16811 |
|
16812 |
|
16813 |
|
16814 |
|
16815 | ReactReconcileTransaction: null,
|
16816 |
|
16817 | batchedUpdates: batchedUpdates,
|
16818 | enqueueUpdate: enqueueUpdate,
|
16819 | flushBatchedUpdates: flushBatchedUpdates,
|
16820 | injection: ReactUpdatesInjection,
|
16821 | asap: asap
|
16822 | };
|
16823 |
|
16824 | module.exports = ReactUpdates;
|
16825 | },{"127":127,"153":153,"178":178,"188":188,"26":26,"5":5,"71":71,"95":95}],108:[function(_dereq_,module,exports){
|
16826 |
|
16827 |
|
16828 |
|
16829 |
|
16830 |
|
16831 |
|
16832 |
|
16833 |
|
16834 |
|
16835 |
|
16836 |
|
16837 | 'use strict';
|
16838 |
|
16839 | module.exports = '15.3.2';
|
16840 | },{}],109:[function(_dereq_,module,exports){
|
16841 |
|
16842 |
|
16843 |
|
16844 |
|
16845 |
|
16846 |
|
16847 |
|
16848 |
|
16849 |
|
16850 |
|
16851 |
|
16852 | 'use strict';
|
16853 |
|
16854 | var LinkedStateMixin = _dereq_(24);
|
16855 | var React = _dereq_(27);
|
16856 | var ReactComponentWithPureRenderMixin = _dereq_(39);
|
16857 | var ReactCSSTransitionGroup = _dereq_(29);
|
16858 | var ReactFragment = _dereq_(72);
|
16859 | var ReactTransitionGroup = _dereq_(105);
|
16860 |
|
16861 | var shallowCompare = _dereq_(157);
|
16862 | var update = _dereq_(160);
|
16863 |
|
16864 | React.addons = {
|
16865 | CSSTransitionGroup: ReactCSSTransitionGroup,
|
16866 | LinkedStateMixin: LinkedStateMixin,
|
16867 | PureRenderMixin: ReactComponentWithPureRenderMixin,
|
16868 | TransitionGroup: ReactTransitionGroup,
|
16869 |
|
16870 | createFragment: ReactFragment.create,
|
16871 | shallowCompare: shallowCompare,
|
16872 | update: update
|
16873 | };
|
16874 |
|
16875 | if ("development" !== 'production') {
|
16876 | React.addons.Perf = _dereq_(88);
|
16877 | React.addons.TestUtils = _dereq_(102);
|
16878 | }
|
16879 |
|
16880 | module.exports = React;
|
16881 | },{"102":102,"105":105,"157":157,"160":160,"24":24,"27":27,"29":29,"39":39,"72":72,"88":88}],110:[function(_dereq_,module,exports){
|
16882 |
|
16883 |
|
16884 |
|
16885 |
|
16886 |
|
16887 |
|
16888 |
|
16889 |
|
16890 |
|
16891 |
|
16892 |
|
16893 | 'use strict';
|
16894 |
|
16895 | var _assign = _dereq_(188);
|
16896 |
|
16897 | var ReactDOM = _dereq_(42);
|
16898 | var ReactDOMServer = _dereq_(57);
|
16899 | var ReactWithAddons = _dereq_(109);
|
16900 |
|
16901 |
|
16902 | var ReactWithAddonsUMDEntry = _assign({
|
16903 | __SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactDOM,
|
16904 | __SECRET_DOM_SERVER_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactDOMServer
|
16905 | }, ReactWithAddons);
|
16906 |
|
16907 | module.exports = ReactWithAddonsUMDEntry;
|
16908 | },{"109":109,"188":188,"42":42,"57":57}],111:[function(_dereq_,module,exports){
|
16909 |
|
16910 |
|
16911 |
|
16912 |
|
16913 |
|
16914 |
|
16915 |
|
16916 |
|
16917 |
|
16918 |
|
16919 |
|
16920 | 'use strict';
|
16921 |
|
16922 | var NS = {
|
16923 | xlink: 'http://www.w3.org/1999/xlink',
|
16924 | xml: 'http://www.w3.org/XML/1998/namespace'
|
16925 | };
|
16926 |
|
16927 |
|
16928 |
|
16929 |
|
16930 |
|
16931 |
|
16932 |
|
16933 |
|
16934 |
|
16935 |
|
16936 |
|
16937 |
|
16938 |
|
16939 |
|
16940 |
|
16941 |
|
16942 |
|
16943 |
|
16944 | var ATTRS = {
|
16945 | accentHeight: 'accent-height',
|
16946 | accumulate: 0,
|
16947 | additive: 0,
|
16948 | alignmentBaseline: 'alignment-baseline',
|
16949 | allowReorder: 'allowReorder',
|
16950 | alphabetic: 0,
|
16951 | amplitude: 0,
|
16952 | arabicForm: 'arabic-form',
|
16953 | ascent: 0,
|
16954 | attributeName: 'attributeName',
|
16955 | attributeType: 'attributeType',
|
16956 | autoReverse: 'autoReverse',
|
16957 | azimuth: 0,
|
16958 | baseFrequency: 'baseFrequency',
|
16959 | baseProfile: 'baseProfile',
|
16960 | baselineShift: 'baseline-shift',
|
16961 | bbox: 0,
|
16962 | begin: 0,
|
16963 | bias: 0,
|
16964 | by: 0,
|
16965 | calcMode: 'calcMode',
|
16966 | capHeight: 'cap-height',
|
16967 | clip: 0,
|
16968 | clipPath: 'clip-path',
|
16969 | clipRule: 'clip-rule',
|
16970 | clipPathUnits: 'clipPathUnits',
|
16971 | colorInterpolation: 'color-interpolation',
|
16972 | colorInterpolationFilters: 'color-interpolation-filters',
|
16973 | colorProfile: 'color-profile',
|
16974 | colorRendering: 'color-rendering',
|
16975 | contentScriptType: 'contentScriptType',
|
16976 | contentStyleType: 'contentStyleType',
|
16977 | cursor: 0,
|
16978 | cx: 0,
|
16979 | cy: 0,
|
16980 | d: 0,
|
16981 | decelerate: 0,
|
16982 | descent: 0,
|
16983 | diffuseConstant: 'diffuseConstant',
|
16984 | direction: 0,
|
16985 | display: 0,
|
16986 | divisor: 0,
|
16987 | dominantBaseline: 'dominant-baseline',
|
16988 | dur: 0,
|
16989 | dx: 0,
|
16990 | dy: 0,
|
16991 | edgeMode: 'edgeMode',
|
16992 | elevation: 0,
|
16993 | enableBackground: 'enable-background',
|
16994 | end: 0,
|
16995 | exponent: 0,
|
16996 | externalResourcesRequired: 'externalResourcesRequired',
|
16997 | fill: 0,
|
16998 | fillOpacity: 'fill-opacity',
|
16999 | fillRule: 'fill-rule',
|
17000 | filter: 0,
|
17001 | filterRes: 'filterRes',
|
17002 | filterUnits: 'filterUnits',
|
17003 | floodColor: 'flood-color',
|
17004 | floodOpacity: 'flood-opacity',
|
17005 | focusable: 0,
|
17006 | fontFamily: 'font-family',
|
17007 | fontSize: 'font-size',
|
17008 | fontSizeAdjust: 'font-size-adjust',
|
17009 | fontStretch: 'font-stretch',
|
17010 | fontStyle: 'font-style',
|
17011 | fontVariant: 'font-variant',
|
17012 | fontWeight: 'font-weight',
|
17013 | format: 0,
|
17014 | from: 0,
|
17015 | fx: 0,
|
17016 | fy: 0,
|
17017 | g1: 0,
|
17018 | g2: 0,
|
17019 | glyphName: 'glyph-name',
|
17020 | glyphOrientationHorizontal: 'glyph-orientation-horizontal',
|
17021 | glyphOrientationVertical: 'glyph-orientation-vertical',
|
17022 | glyphRef: 'glyphRef',
|
17023 | gradientTransform: 'gradientTransform',
|
17024 | gradientUnits: 'gradientUnits',
|
17025 | hanging: 0,
|
17026 | horizAdvX: 'horiz-adv-x',
|
17027 | horizOriginX: 'horiz-origin-x',
|
17028 | ideographic: 0,
|
17029 | imageRendering: 'image-rendering',
|
17030 | 'in': 0,
|
17031 | in2: 0,
|
17032 | intercept: 0,
|
17033 | k: 0,
|
17034 | k1: 0,
|
17035 | k2: 0,
|
17036 | k3: 0,
|
17037 | k4: 0,
|
17038 | kernelMatrix: 'kernelMatrix',
|
17039 | kernelUnitLength: 'kernelUnitLength',
|
17040 | kerning: 0,
|
17041 | keyPoints: 'keyPoints',
|
17042 | keySplines: 'keySplines',
|
17043 | keyTimes: 'keyTimes',
|
17044 | lengthAdjust: 'lengthAdjust',
|
17045 | letterSpacing: 'letter-spacing',
|
17046 | lightingColor: 'lighting-color',
|
17047 | limitingConeAngle: 'limitingConeAngle',
|
17048 | local: 0,
|
17049 | markerEnd: 'marker-end',
|
17050 | markerMid: 'marker-mid',
|
17051 | markerStart: 'marker-start',
|
17052 | markerHeight: 'markerHeight',
|
17053 | markerUnits: 'markerUnits',
|
17054 | markerWidth: 'markerWidth',
|
17055 | mask: 0,
|
17056 | maskContentUnits: 'maskContentUnits',
|
17057 | maskUnits: 'maskUnits',
|
17058 | mathematical: 0,
|
17059 | mode: 0,
|
17060 | numOctaves: 'numOctaves',
|
17061 | offset: 0,
|
17062 | opacity: 0,
|
17063 | operator: 0,
|
17064 | order: 0,
|
17065 | orient: 0,
|
17066 | orientation: 0,
|
17067 | origin: 0,
|
17068 | overflow: 0,
|
17069 | overlinePosition: 'overline-position',
|
17070 | overlineThickness: 'overline-thickness',
|
17071 | paintOrder: 'paint-order',
|
17072 | panose1: 'panose-1',
|
17073 | pathLength: 'pathLength',
|
17074 | patternContentUnits: 'patternContentUnits',
|
17075 | patternTransform: 'patternTransform',
|
17076 | patternUnits: 'patternUnits',
|
17077 | pointerEvents: 'pointer-events',
|
17078 | points: 0,
|
17079 | pointsAtX: 'pointsAtX',
|
17080 | pointsAtY: 'pointsAtY',
|
17081 | pointsAtZ: 'pointsAtZ',
|
17082 | preserveAlpha: 'preserveAlpha',
|
17083 | preserveAspectRatio: 'preserveAspectRatio',
|
17084 | primitiveUnits: 'primitiveUnits',
|
17085 | r: 0,
|
17086 | radius: 0,
|
17087 | refX: 'refX',
|
17088 | refY: 'refY',
|
17089 | renderingIntent: 'rendering-intent',
|
17090 | repeatCount: 'repeatCount',
|
17091 | repeatDur: 'repeatDur',
|
17092 | requiredExtensions: 'requiredExtensions',
|
17093 | requiredFeatures: 'requiredFeatures',
|
17094 | restart: 0,
|
17095 | result: 0,
|
17096 | rotate: 0,
|
17097 | rx: 0,
|
17098 | ry: 0,
|
17099 | scale: 0,
|
17100 | seed: 0,
|
17101 | shapeRendering: 'shape-rendering',
|
17102 | slope: 0,
|
17103 | spacing: 0,
|
17104 | specularConstant: 'specularConstant',
|
17105 | specularExponent: 'specularExponent',
|
17106 | speed: 0,
|
17107 | spreadMethod: 'spreadMethod',
|
17108 | startOffset: 'startOffset',
|
17109 | stdDeviation: 'stdDeviation',
|
17110 | stemh: 0,
|
17111 | stemv: 0,
|
17112 | stitchTiles: 'stitchTiles',
|
17113 | stopColor: 'stop-color',
|
17114 | stopOpacity: 'stop-opacity',
|
17115 | strikethroughPosition: 'strikethrough-position',
|
17116 | strikethroughThickness: 'strikethrough-thickness',
|
17117 | string: 0,
|
17118 | stroke: 0,
|
17119 | strokeDasharray: 'stroke-dasharray',
|
17120 | strokeDashoffset: 'stroke-dashoffset',
|
17121 | strokeLinecap: 'stroke-linecap',
|
17122 | strokeLinejoin: 'stroke-linejoin',
|
17123 | strokeMiterlimit: 'stroke-miterlimit',
|
17124 | strokeOpacity: 'stroke-opacity',
|
17125 | strokeWidth: 'stroke-width',
|
17126 | surfaceScale: 'surfaceScale',
|
17127 | systemLanguage: 'systemLanguage',
|
17128 | tableValues: 'tableValues',
|
17129 | targetX: 'targetX',
|
17130 | targetY: 'targetY',
|
17131 | textAnchor: 'text-anchor',
|
17132 | textDecoration: 'text-decoration',
|
17133 | textRendering: 'text-rendering',
|
17134 | textLength: 'textLength',
|
17135 | to: 0,
|
17136 | transform: 0,
|
17137 | u1: 0,
|
17138 | u2: 0,
|
17139 | underlinePosition: 'underline-position',
|
17140 | underlineThickness: 'underline-thickness',
|
17141 | unicode: 0,
|
17142 | unicodeBidi: 'unicode-bidi',
|
17143 | unicodeRange: 'unicode-range',
|
17144 | unitsPerEm: 'units-per-em',
|
17145 | vAlphabetic: 'v-alphabetic',
|
17146 | vHanging: 'v-hanging',
|
17147 | vIdeographic: 'v-ideographic',
|
17148 | vMathematical: 'v-mathematical',
|
17149 | values: 0,
|
17150 | vectorEffect: 'vector-effect',
|
17151 | version: 0,
|
17152 | vertAdvY: 'vert-adv-y',
|
17153 | vertOriginX: 'vert-origin-x',
|
17154 | vertOriginY: 'vert-origin-y',
|
17155 | viewBox: 'viewBox',
|
17156 | viewTarget: 'viewTarget',
|
17157 | visibility: 0,
|
17158 | widths: 0,
|
17159 | wordSpacing: 'word-spacing',
|
17160 | writingMode: 'writing-mode',
|
17161 | x: 0,
|
17162 | xHeight: 'x-height',
|
17163 | x1: 0,
|
17164 | x2: 0,
|
17165 | xChannelSelector: 'xChannelSelector',
|
17166 | xlinkActuate: 'xlink:actuate',
|
17167 | xlinkArcrole: 'xlink:arcrole',
|
17168 | xlinkHref: 'xlink:href',
|
17169 | xlinkRole: 'xlink:role',
|
17170 | xlinkShow: 'xlink:show',
|
17171 | xlinkTitle: 'xlink:title',
|
17172 | xlinkType: 'xlink:type',
|
17173 | xmlBase: 'xml:base',
|
17174 | xmlns: 0,
|
17175 | xmlnsXlink: 'xmlns:xlink',
|
17176 | xmlLang: 'xml:lang',
|
17177 | xmlSpace: 'xml:space',
|
17178 | y: 0,
|
17179 | y1: 0,
|
17180 | y2: 0,
|
17181 | yChannelSelector: 'yChannelSelector',
|
17182 | z: 0,
|
17183 | zoomAndPan: 'zoomAndPan'
|
17184 | };
|
17185 |
|
17186 | var SVGDOMPropertyConfig = {
|
17187 | Properties: {},
|
17188 | DOMAttributeNamespaces: {
|
17189 | xlinkActuate: NS.xlink,
|
17190 | xlinkArcrole: NS.xlink,
|
17191 | xlinkHref: NS.xlink,
|
17192 | xlinkRole: NS.xlink,
|
17193 | xlinkShow: NS.xlink,
|
17194 | xlinkTitle: NS.xlink,
|
17195 | xlinkType: NS.xlink,
|
17196 | xmlBase: NS.xml,
|
17197 | xmlLang: NS.xml,
|
17198 | xmlSpace: NS.xml
|
17199 | },
|
17200 | DOMAttributeNames: {}
|
17201 | };
|
17202 |
|
17203 | Object.keys(ATTRS).forEach(function (key) {
|
17204 | SVGDOMPropertyConfig.Properties[key] = 0;
|
17205 | if (ATTRS[key]) {
|
17206 | SVGDOMPropertyConfig.DOMAttributeNames[key] = ATTRS[key];
|
17207 | }
|
17208 | });
|
17209 |
|
17210 | module.exports = SVGDOMPropertyConfig;
|
17211 | },{}],112:[function(_dereq_,module,exports){
|
17212 |
|
17213 |
|
17214 |
|
17215 |
|
17216 |
|
17217 |
|
17218 |
|
17219 |
|
17220 |
|
17221 |
|
17222 |
|
17223 | 'use strict';
|
17224 |
|
17225 | var EventConstants = _dereq_(16);
|
17226 | var EventPropagators = _dereq_(20);
|
17227 | var ExecutionEnvironment = _dereq_(164);
|
17228 | var ReactDOMComponentTree = _dereq_(46);
|
17229 | var ReactInputSelection = _dereq_(76);
|
17230 | var SyntheticEvent = _dereq_(118);
|
17231 |
|
17232 | var getActiveElement = _dereq_(173);
|
17233 | var isTextInputElement = _dereq_(150);
|
17234 | var keyOf = _dereq_(182);
|
17235 | var shallowEqual = _dereq_(186);
|
17236 |
|
17237 | var topLevelTypes = EventConstants.topLevelTypes;
|
17238 |
|
17239 | var skipSelectionChangeEvent = ExecutionEnvironment.canUseDOM && 'documentMode' in document && document.documentMode <= 11;
|
17240 |
|
17241 | var eventTypes = {
|
17242 | select: {
|
17243 | phasedRegistrationNames: {
|
17244 | bubbled: keyOf({ onSelect: null }),
|
17245 | captured: keyOf({ onSelectCapture: null })
|
17246 | },
|
17247 | dependencies: [topLevelTypes.topBlur, topLevelTypes.topContextMenu, topLevelTypes.topFocus, topLevelTypes.topKeyDown, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown, topLevelTypes.topMouseUp, topLevelTypes.topSelectionChange]
|
17248 | }
|
17249 | };
|
17250 |
|
17251 | var activeElement = null;
|
17252 | var activeElementInst = null;
|
17253 | var lastSelection = null;
|
17254 | var mouseDown = false;
|
17255 |
|
17256 |
|
17257 |
|
17258 | var hasListener = false;
|
17259 | var ON_SELECT_KEY = keyOf({ onSelect: null });
|
17260 |
|
17261 |
|
17262 |
|
17263 |
|
17264 |
|
17265 |
|
17266 |
|
17267 |
|
17268 |
|
17269 |
|
17270 | function getSelection(node) {
|
17271 | if ('selectionStart' in node && ReactInputSelection.hasSelectionCapabilities(node)) {
|
17272 | return {
|
17273 | start: node.selectionStart,
|
17274 | end: node.selectionEnd
|
17275 | };
|
17276 | } else if (window.getSelection) {
|
17277 | var selection = window.getSelection();
|
17278 | return {
|
17279 | anchorNode: selection.anchorNode,
|
17280 | anchorOffset: selection.anchorOffset,
|
17281 | focusNode: selection.focusNode,
|
17282 | focusOffset: selection.focusOffset
|
17283 | };
|
17284 | } else if (document.selection) {
|
17285 | var range = document.selection.createRange();
|
17286 | return {
|
17287 | parentElement: range.parentElement(),
|
17288 | text: range.text,
|
17289 | top: range.boundingTop,
|
17290 | left: range.boundingLeft
|
17291 | };
|
17292 | }
|
17293 | }
|
17294 |
|
17295 |
|
17296 |
|
17297 |
|
17298 |
|
17299 |
|
17300 |
|
17301 | function constructSelectEvent(nativeEvent, nativeEventTarget) {
|
17302 |
|
17303 |
|
17304 |
|
17305 |
|
17306 | if (mouseDown || activeElement == null || activeElement !== getActiveElement()) {
|
17307 | return null;
|
17308 | }
|
17309 |
|
17310 |
|
17311 | var currentSelection = getSelection(activeElement);
|
17312 | if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {
|
17313 | lastSelection = currentSelection;
|
17314 |
|
17315 | var syntheticEvent = SyntheticEvent.getPooled(eventTypes.select, activeElementInst, nativeEvent, nativeEventTarget);
|
17316 |
|
17317 | syntheticEvent.type = 'select';
|
17318 | syntheticEvent.target = activeElement;
|
17319 |
|
17320 | EventPropagators.accumulateTwoPhaseDispatches(syntheticEvent);
|
17321 |
|
17322 | return syntheticEvent;
|
17323 | }
|
17324 |
|
17325 | return null;
|
17326 | }
|
17327 |
|
17328 |
|
17329 |
|
17330 |
|
17331 |
|
17332 |
|
17333 |
|
17334 |
|
17335 |
|
17336 |
|
17337 |
|
17338 |
|
17339 |
|
17340 |
|
17341 |
|
17342 | var SelectEventPlugin = {
|
17343 |
|
17344 | eventTypes: eventTypes,
|
17345 |
|
17346 | extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
|
17347 | if (!hasListener) {
|
17348 | return null;
|
17349 | }
|
17350 |
|
17351 | var targetNode = targetInst ? ReactDOMComponentTree.getNodeFromInstance(targetInst) : window;
|
17352 |
|
17353 | switch (topLevelType) {
|
17354 |
|
17355 | case topLevelTypes.topFocus:
|
17356 | if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {
|
17357 | activeElement = targetNode;
|
17358 | activeElementInst = targetInst;
|
17359 | lastSelection = null;
|
17360 | }
|
17361 | break;
|
17362 | case topLevelTypes.topBlur:
|
17363 | activeElement = null;
|
17364 | activeElementInst = null;
|
17365 | lastSelection = null;
|
17366 | break;
|
17367 |
|
17368 |
|
17369 |
|
17370 | case topLevelTypes.topMouseDown:
|
17371 | mouseDown = true;
|
17372 | break;
|
17373 | case topLevelTypes.topContextMenu:
|
17374 | case topLevelTypes.topMouseUp:
|
17375 | mouseDown = false;
|
17376 | return constructSelectEvent(nativeEvent, nativeEventTarget);
|
17377 |
|
17378 |
|
17379 |
|
17380 |
|
17381 |
|
17382 |
|
17383 |
|
17384 |
|
17385 |
|
17386 |
|
17387 | case topLevelTypes.topSelectionChange:
|
17388 | if (skipSelectionChangeEvent) {
|
17389 | break;
|
17390 | }
|
17391 |
|
17392 | case topLevelTypes.topKeyDown:
|
17393 | case topLevelTypes.topKeyUp:
|
17394 | return constructSelectEvent(nativeEvent, nativeEventTarget);
|
17395 | }
|
17396 |
|
17397 | return null;
|
17398 | },
|
17399 |
|
17400 | didPutListener: function (inst, registrationName, listener) {
|
17401 | if (registrationName === ON_SELECT_KEY) {
|
17402 | hasListener = true;
|
17403 | }
|
17404 | }
|
17405 | };
|
17406 |
|
17407 | module.exports = SelectEventPlugin;
|
17408 | },{"118":118,"150":150,"16":16,"164":164,"173":173,"182":182,"186":186,"20":20,"46":46,"76":76}],113:[function(_dereq_,module,exports){
|
17409 |
|
17410 |
|
17411 |
|
17412 |
|
17413 |
|
17414 |
|
17415 |
|
17416 |
|
17417 |
|
17418 |
|
17419 |
|
17420 | 'use strict';
|
17421 |
|
17422 | var _prodInvariant = _dereq_(153);
|
17423 |
|
17424 | var EventConstants = _dereq_(16);
|
17425 | var EventListener = _dereq_(163);
|
17426 | var EventPropagators = _dereq_(20);
|
17427 | var ReactDOMComponentTree = _dereq_(46);
|
17428 | var SyntheticAnimationEvent = _dereq_(114);
|
17429 | var SyntheticClipboardEvent = _dereq_(115);
|
17430 | var SyntheticEvent = _dereq_(118);
|
17431 | var SyntheticFocusEvent = _dereq_(119);
|
17432 | var SyntheticKeyboardEvent = _dereq_(121);
|
17433 | var SyntheticMouseEvent = _dereq_(122);
|
17434 | var SyntheticDragEvent = _dereq_(117);
|
17435 | var SyntheticTouchEvent = _dereq_(123);
|
17436 | var SyntheticTransitionEvent = _dereq_(124);
|
17437 | var SyntheticUIEvent = _dereq_(125);
|
17438 | var SyntheticWheelEvent = _dereq_(126);
|
17439 |
|
17440 | var emptyFunction = _dereq_(170);
|
17441 | var getEventCharCode = _dereq_(139);
|
17442 | var invariant = _dereq_(178);
|
17443 | var keyOf = _dereq_(182);
|
17444 |
|
17445 | var topLevelTypes = EventConstants.topLevelTypes;
|
17446 |
|
17447 | var eventTypes = {
|
17448 | abort: {
|
17449 | phasedRegistrationNames: {
|
17450 | bubbled: keyOf({ onAbort: true }),
|
17451 | captured: keyOf({ onAbortCapture: true })
|
17452 | }
|
17453 | },
|
17454 | animationEnd: {
|
17455 | phasedRegistrationNames: {
|
17456 | bubbled: keyOf({ onAnimationEnd: true }),
|
17457 | captured: keyOf({ onAnimationEndCapture: true })
|
17458 | }
|
17459 | },
|
17460 | animationIteration: {
|
17461 | phasedRegistrationNames: {
|
17462 | bubbled: keyOf({ onAnimationIteration: true }),
|
17463 | captured: keyOf({ onAnimationIterationCapture: true })
|
17464 | }
|
17465 | },
|
17466 | animationStart: {
|
17467 | phasedRegistrationNames: {
|
17468 | bubbled: keyOf({ onAnimationStart: true }),
|
17469 | captured: keyOf({ onAnimationStartCapture: true })
|
17470 | }
|
17471 | },
|
17472 | blur: {
|
17473 | phasedRegistrationNames: {
|
17474 | bubbled: keyOf({ onBlur: true }),
|
17475 | captured: keyOf({ onBlurCapture: true })
|
17476 | }
|
17477 | },
|
17478 | canPlay: {
|
17479 | phasedRegistrationNames: {
|
17480 | bubbled: keyOf({ onCanPlay: true }),
|
17481 | captured: keyOf({ onCanPlayCapture: true })
|
17482 | }
|
17483 | },
|
17484 | canPlayThrough: {
|
17485 | phasedRegistrationNames: {
|
17486 | bubbled: keyOf({ onCanPlayThrough: true }),
|
17487 | captured: keyOf({ onCanPlayThroughCapture: true })
|
17488 | }
|
17489 | },
|
17490 | click: {
|
17491 | phasedRegistrationNames: {
|
17492 | bubbled: keyOf({ onClick: true }),
|
17493 | captured: keyOf({ onClickCapture: true })
|
17494 | }
|
17495 | },
|
17496 | contextMenu: {
|
17497 | phasedRegistrationNames: {
|
17498 | bubbled: keyOf({ onContextMenu: true }),
|
17499 | captured: keyOf({ onContextMenuCapture: true })
|
17500 | }
|
17501 | },
|
17502 | copy: {
|
17503 | phasedRegistrationNames: {
|
17504 | bubbled: keyOf({ onCopy: true }),
|
17505 | captured: keyOf({ onCopyCapture: true })
|
17506 | }
|
17507 | },
|
17508 | cut: {
|
17509 | phasedRegistrationNames: {
|
17510 | bubbled: keyOf({ onCut: true }),
|
17511 | captured: keyOf({ onCutCapture: true })
|
17512 | }
|
17513 | },
|
17514 | doubleClick: {
|
17515 | phasedRegistrationNames: {
|
17516 | bubbled: keyOf({ onDoubleClick: true }),
|
17517 | captured: keyOf({ onDoubleClickCapture: true })
|
17518 | }
|
17519 | },
|
17520 | drag: {
|
17521 | phasedRegistrationNames: {
|
17522 | bubbled: keyOf({ onDrag: true }),
|
17523 | captured: keyOf({ onDragCapture: true })
|
17524 | }
|
17525 | },
|
17526 | dragEnd: {
|
17527 | phasedRegistrationNames: {
|
17528 | bubbled: keyOf({ onDragEnd: true }),
|
17529 | captured: keyOf({ onDragEndCapture: true })
|
17530 | }
|
17531 | },
|
17532 | dragEnter: {
|
17533 | phasedRegistrationNames: {
|
17534 | bubbled: keyOf({ onDragEnter: true }),
|
17535 | captured: keyOf({ onDragEnterCapture: true })
|
17536 | }
|
17537 | },
|
17538 | dragExit: {
|
17539 | phasedRegistrationNames: {
|
17540 | bubbled: keyOf({ onDragExit: true }),
|
17541 | captured: keyOf({ onDragExitCapture: true })
|
17542 | }
|
17543 | },
|
17544 | dragLeave: {
|
17545 | phasedRegistrationNames: {
|
17546 | bubbled: keyOf({ onDragLeave: true }),
|
17547 | captured: keyOf({ onDragLeaveCapture: true })
|
17548 | }
|
17549 | },
|
17550 | dragOver: {
|
17551 | phasedRegistrationNames: {
|
17552 | bubbled: keyOf({ onDragOver: true }),
|
17553 | captured: keyOf({ onDragOverCapture: true })
|
17554 | }
|
17555 | },
|
17556 | dragStart: {
|
17557 | phasedRegistrationNames: {
|
17558 | bubbled: keyOf({ onDragStart: true }),
|
17559 | captured: keyOf({ onDragStartCapture: true })
|
17560 | }
|
17561 | },
|
17562 | drop: {
|
17563 | phasedRegistrationNames: {
|
17564 | bubbled: keyOf({ onDrop: true }),
|
17565 | captured: keyOf({ onDropCapture: true })
|
17566 | }
|
17567 | },
|
17568 | durationChange: {
|
17569 | phasedRegistrationNames: {
|
17570 | bubbled: keyOf({ onDurationChange: true }),
|
17571 | captured: keyOf({ onDurationChangeCapture: true })
|
17572 | }
|
17573 | },
|
17574 | emptied: {
|
17575 | phasedRegistrationNames: {
|
17576 | bubbled: keyOf({ onEmptied: true }),
|
17577 | captured: keyOf({ onEmptiedCapture: true })
|
17578 | }
|
17579 | },
|
17580 | encrypted: {
|
17581 | phasedRegistrationNames: {
|
17582 | bubbled: keyOf({ onEncrypted: true }),
|
17583 | captured: keyOf({ onEncryptedCapture: true })
|
17584 | }
|
17585 | },
|
17586 | ended: {
|
17587 | phasedRegistrationNames: {
|
17588 | bubbled: keyOf({ onEnded: true }),
|
17589 | captured: keyOf({ onEndedCapture: true })
|
17590 | }
|
17591 | },
|
17592 | error: {
|
17593 | phasedRegistrationNames: {
|
17594 | bubbled: keyOf({ onError: true }),
|
17595 | captured: keyOf({ onErrorCapture: true })
|
17596 | }
|
17597 | },
|
17598 | focus: {
|
17599 | phasedRegistrationNames: {
|
17600 | bubbled: keyOf({ onFocus: true }),
|
17601 | captured: keyOf({ onFocusCapture: true })
|
17602 | }
|
17603 | },
|
17604 | input: {
|
17605 | phasedRegistrationNames: {
|
17606 | bubbled: keyOf({ onInput: true }),
|
17607 | captured: keyOf({ onInputCapture: true })
|
17608 | }
|
17609 | },
|
17610 | invalid: {
|
17611 | phasedRegistrationNames: {
|
17612 | bubbled: keyOf({ onInvalid: true }),
|
17613 | captured: keyOf({ onInvalidCapture: true })
|
17614 | }
|
17615 | },
|
17616 | keyDown: {
|
17617 | phasedRegistrationNames: {
|
17618 | bubbled: keyOf({ onKeyDown: true }),
|
17619 | captured: keyOf({ onKeyDownCapture: true })
|
17620 | }
|
17621 | },
|
17622 | keyPress: {
|
17623 | phasedRegistrationNames: {
|
17624 | bubbled: keyOf({ onKeyPress: true }),
|
17625 | captured: keyOf({ onKeyPressCapture: true })
|
17626 | }
|
17627 | },
|
17628 | keyUp: {
|
17629 | phasedRegistrationNames: {
|
17630 | bubbled: keyOf({ onKeyUp: true }),
|
17631 | captured: keyOf({ onKeyUpCapture: true })
|
17632 | }
|
17633 | },
|
17634 | load: {
|
17635 | phasedRegistrationNames: {
|
17636 | bubbled: keyOf({ onLoad: true }),
|
17637 | captured: keyOf({ onLoadCapture: true })
|
17638 | }
|
17639 | },
|
17640 | loadedData: {
|
17641 | phasedRegistrationNames: {
|
17642 | bubbled: keyOf({ onLoadedData: true }),
|
17643 | captured: keyOf({ onLoadedDataCapture: true })
|
17644 | }
|
17645 | },
|
17646 | loadedMetadata: {
|
17647 | phasedRegistrationNames: {
|
17648 | bubbled: keyOf({ onLoadedMetadata: true }),
|
17649 | captured: keyOf({ onLoadedMetadataCapture: true })
|
17650 | }
|
17651 | },
|
17652 | loadStart: {
|
17653 | phasedRegistrationNames: {
|
17654 | bubbled: keyOf({ onLoadStart: true }),
|
17655 | captured: keyOf({ onLoadStartCapture: true })
|
17656 | }
|
17657 | },
|
17658 |
|
17659 |
|
17660 | mouseDown: {
|
17661 | phasedRegistrationNames: {
|
17662 | bubbled: keyOf({ onMouseDown: true }),
|
17663 | captured: keyOf({ onMouseDownCapture: true })
|
17664 | }
|
17665 | },
|
17666 | mouseMove: {
|
17667 | phasedRegistrationNames: {
|
17668 | bubbled: keyOf({ onMouseMove: true }),
|
17669 | captured: keyOf({ onMouseMoveCapture: true })
|
17670 | }
|
17671 | },
|
17672 | mouseOut: {
|
17673 | phasedRegistrationNames: {
|
17674 | bubbled: keyOf({ onMouseOut: true }),
|
17675 | captured: keyOf({ onMouseOutCapture: true })
|
17676 | }
|
17677 | },
|
17678 | mouseOver: {
|
17679 | phasedRegistrationNames: {
|
17680 | bubbled: keyOf({ onMouseOver: true }),
|
17681 | captured: keyOf({ onMouseOverCapture: true })
|
17682 | }
|
17683 | },
|
17684 | mouseUp: {
|
17685 | phasedRegistrationNames: {
|
17686 | bubbled: keyOf({ onMouseUp: true }),
|
17687 | captured: keyOf({ onMouseUpCapture: true })
|
17688 | }
|
17689 | },
|
17690 | paste: {
|
17691 | phasedRegistrationNames: {
|
17692 | bubbled: keyOf({ onPaste: true }),
|
17693 | captured: keyOf({ onPasteCapture: true })
|
17694 | }
|
17695 | },
|
17696 | pause: {
|
17697 | phasedRegistrationNames: {
|
17698 | bubbled: keyOf({ onPause: true }),
|
17699 | captured: keyOf({ onPauseCapture: true })
|
17700 | }
|
17701 | },
|
17702 | play: {
|
17703 | phasedRegistrationNames: {
|
17704 | bubbled: keyOf({ onPlay: true }),
|
17705 | captured: keyOf({ onPlayCapture: true })
|
17706 | }
|
17707 | },
|
17708 | playing: {
|
17709 | phasedRegistrationNames: {
|
17710 | bubbled: keyOf({ onPlaying: true }),
|
17711 | captured: keyOf({ onPlayingCapture: true })
|
17712 | }
|
17713 | },
|
17714 | progress: {
|
17715 | phasedRegistrationNames: {
|
17716 | bubbled: keyOf({ onProgress: true }),
|
17717 | captured: keyOf({ onProgressCapture: true })
|
17718 | }
|
17719 | },
|
17720 | rateChange: {
|
17721 | phasedRegistrationNames: {
|
17722 | bubbled: keyOf({ onRateChange: true }),
|
17723 | captured: keyOf({ onRateChangeCapture: true })
|
17724 | }
|
17725 | },
|
17726 | reset: {
|
17727 | phasedRegistrationNames: {
|
17728 | bubbled: keyOf({ onReset: true }),
|
17729 | captured: keyOf({ onResetCapture: true })
|
17730 | }
|
17731 | },
|
17732 | scroll: {
|
17733 | phasedRegistrationNames: {
|
17734 | bubbled: keyOf({ onScroll: true }),
|
17735 | captured: keyOf({ onScrollCapture: true })
|
17736 | }
|
17737 | },
|
17738 | seeked: {
|
17739 | phasedRegistrationNames: {
|
17740 | bubbled: keyOf({ onSeeked: true }),
|
17741 | captured: keyOf({ onSeekedCapture: true })
|
17742 | }
|
17743 | },
|
17744 | seeking: {
|
17745 | phasedRegistrationNames: {
|
17746 | bubbled: keyOf({ onSeeking: true }),
|
17747 | captured: keyOf({ onSeekingCapture: true })
|
17748 | }
|
17749 | },
|
17750 | stalled: {
|
17751 | phasedRegistrationNames: {
|
17752 | bubbled: keyOf({ onStalled: true }),
|
17753 | captured: keyOf({ onStalledCapture: true })
|
17754 | }
|
17755 | },
|
17756 | submit: {
|
17757 | phasedRegistrationNames: {
|
17758 | bubbled: keyOf({ onSubmit: true }),
|
17759 | captured: keyOf({ onSubmitCapture: true })
|
17760 | }
|
17761 | },
|
17762 | suspend: {
|
17763 | phasedRegistrationNames: {
|
17764 | bubbled: keyOf({ onSuspend: true }),
|
17765 | captured: keyOf({ onSuspendCapture: true })
|
17766 | }
|
17767 | },
|
17768 | timeUpdate: {
|
17769 | phasedRegistrationNames: {
|
17770 | bubbled: keyOf({ onTimeUpdate: true }),
|
17771 | captured: keyOf({ onTimeUpdateCapture: true })
|
17772 | }
|
17773 | },
|
17774 | touchCancel: {
|
17775 | phasedRegistrationNames: {
|
17776 | bubbled: keyOf({ onTouchCancel: true }),
|
17777 | captured: keyOf({ onTouchCancelCapture: true })
|
17778 | }
|
17779 | },
|
17780 | touchEnd: {
|
17781 | phasedRegistrationNames: {
|
17782 | bubbled: keyOf({ onTouchEnd: true }),
|
17783 | captured: keyOf({ onTouchEndCapture: true })
|
17784 | }
|
17785 | },
|
17786 | touchMove: {
|
17787 | phasedRegistrationNames: {
|
17788 | bubbled: keyOf({ onTouchMove: true }),
|
17789 | captured: keyOf({ onTouchMoveCapture: true })
|
17790 | }
|
17791 | },
|
17792 | touchStart: {
|
17793 | phasedRegistrationNames: {
|
17794 | bubbled: keyOf({ onTouchStart: true }),
|
17795 | captured: keyOf({ onTouchStartCapture: true })
|
17796 | }
|
17797 | },
|
17798 | transitionEnd: {
|
17799 | phasedRegistrationNames: {
|
17800 | bubbled: keyOf({ onTransitionEnd: true }),
|
17801 | captured: keyOf({ onTransitionEndCapture: true })
|
17802 | }
|
17803 | },
|
17804 | volumeChange: {
|
17805 | phasedRegistrationNames: {
|
17806 | bubbled: keyOf({ onVolumeChange: true }),
|
17807 | captured: keyOf({ onVolumeChangeCapture: true })
|
17808 | }
|
17809 | },
|
17810 | waiting: {
|
17811 | phasedRegistrationNames: {
|
17812 | bubbled: keyOf({ onWaiting: true }),
|
17813 | captured: keyOf({ onWaitingCapture: true })
|
17814 | }
|
17815 | },
|
17816 | wheel: {
|
17817 | phasedRegistrationNames: {
|
17818 | bubbled: keyOf({ onWheel: true }),
|
17819 | captured: keyOf({ onWheelCapture: true })
|
17820 | }
|
17821 | }
|
17822 | };
|
17823 |
|
17824 | var topLevelEventsToDispatchConfig = {
|
17825 | topAbort: eventTypes.abort,
|
17826 | topAnimationEnd: eventTypes.animationEnd,
|
17827 | topAnimationIteration: eventTypes.animationIteration,
|
17828 | topAnimationStart: eventTypes.animationStart,
|
17829 | topBlur: eventTypes.blur,
|
17830 | topCanPlay: eventTypes.canPlay,
|
17831 | topCanPlayThrough: eventTypes.canPlayThrough,
|
17832 | topClick: eventTypes.click,
|
17833 | topContextMenu: eventTypes.contextMenu,
|
17834 | topCopy: eventTypes.copy,
|
17835 | topCut: eventTypes.cut,
|
17836 | topDoubleClick: eventTypes.doubleClick,
|
17837 | topDrag: eventTypes.drag,
|
17838 | topDragEnd: eventTypes.dragEnd,
|
17839 | topDragEnter: eventTypes.dragEnter,
|
17840 | topDragExit: eventTypes.dragExit,
|
17841 | topDragLeave: eventTypes.dragLeave,
|
17842 | topDragOver: eventTypes.dragOver,
|
17843 | topDragStart: eventTypes.dragStart,
|
17844 | topDrop: eventTypes.drop,
|
17845 | topDurationChange: eventTypes.durationChange,
|
17846 | topEmptied: eventTypes.emptied,
|
17847 | topEncrypted: eventTypes.encrypted,
|
17848 | topEnded: eventTypes.ended,
|
17849 | topError: eventTypes.error,
|
17850 | topFocus: eventTypes.focus,
|
17851 | topInput: eventTypes.input,
|
17852 | topInvalid: eventTypes.invalid,
|
17853 | topKeyDown: eventTypes.keyDown,
|
17854 | topKeyPress: eventTypes.keyPress,
|
17855 | topKeyUp: eventTypes.keyUp,
|
17856 | topLoad: eventTypes.load,
|
17857 | topLoadedData: eventTypes.loadedData,
|
17858 | topLoadedMetadata: eventTypes.loadedMetadata,
|
17859 | topLoadStart: eventTypes.loadStart,
|
17860 | topMouseDown: eventTypes.mouseDown,
|
17861 | topMouseMove: eventTypes.mouseMove,
|
17862 | topMouseOut: eventTypes.mouseOut,
|
17863 | topMouseOver: eventTypes.mouseOver,
|
17864 | topMouseUp: eventTypes.mouseUp,
|
17865 | topPaste: eventTypes.paste,
|
17866 | topPause: eventTypes.pause,
|
17867 | topPlay: eventTypes.play,
|
17868 | topPlaying: eventTypes.playing,
|
17869 | topProgress: eventTypes.progress,
|
17870 | topRateChange: eventTypes.rateChange,
|
17871 | topReset: eventTypes.reset,
|
17872 | topScroll: eventTypes.scroll,
|
17873 | topSeeked: eventTypes.seeked,
|
17874 | topSeeking: eventTypes.seeking,
|
17875 | topStalled: eventTypes.stalled,
|
17876 | topSubmit: eventTypes.submit,
|
17877 | topSuspend: eventTypes.suspend,
|
17878 | topTimeUpdate: eventTypes.timeUpdate,
|
17879 | topTouchCancel: eventTypes.touchCancel,
|
17880 | topTouchEnd: eventTypes.touchEnd,
|
17881 | topTouchMove: eventTypes.touchMove,
|
17882 | topTouchStart: eventTypes.touchStart,
|
17883 | topTransitionEnd: eventTypes.transitionEnd,
|
17884 | topVolumeChange: eventTypes.volumeChange,
|
17885 | topWaiting: eventTypes.waiting,
|
17886 | topWheel: eventTypes.wheel
|
17887 | };
|
17888 |
|
17889 | for (var type in topLevelEventsToDispatchConfig) {
|
17890 | topLevelEventsToDispatchConfig[type].dependencies = [type];
|
17891 | }
|
17892 |
|
17893 | var ON_CLICK_KEY = keyOf({ onClick: null });
|
17894 | var onClickListeners = {};
|
17895 |
|
17896 | function getDictionaryKey(inst) {
|
17897 |
|
17898 |
|
17899 | return '.' + inst._rootNodeID;
|
17900 | }
|
17901 |
|
17902 | var SimpleEventPlugin = {
|
17903 |
|
17904 | eventTypes: eventTypes,
|
17905 |
|
17906 | extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
|
17907 | var dispatchConfig = topLevelEventsToDispatchConfig[topLevelType];
|
17908 | if (!dispatchConfig) {
|
17909 | return null;
|
17910 | }
|
17911 | var EventConstructor;
|
17912 | switch (topLevelType) {
|
17913 | case topLevelTypes.topAbort:
|
17914 | case topLevelTypes.topCanPlay:
|
17915 | case topLevelTypes.topCanPlayThrough:
|
17916 | case topLevelTypes.topDurationChange:
|
17917 | case topLevelTypes.topEmptied:
|
17918 | case topLevelTypes.topEncrypted:
|
17919 | case topLevelTypes.topEnded:
|
17920 | case topLevelTypes.topError:
|
17921 | case topLevelTypes.topInput:
|
17922 | case topLevelTypes.topInvalid:
|
17923 | case topLevelTypes.topLoad:
|
17924 | case topLevelTypes.topLoadedData:
|
17925 | case topLevelTypes.topLoadedMetadata:
|
17926 | case topLevelTypes.topLoadStart:
|
17927 | case topLevelTypes.topPause:
|
17928 | case topLevelTypes.topPlay:
|
17929 | case topLevelTypes.topPlaying:
|
17930 | case topLevelTypes.topProgress:
|
17931 | case topLevelTypes.topRateChange:
|
17932 | case topLevelTypes.topReset:
|
17933 | case topLevelTypes.topSeeked:
|
17934 | case topLevelTypes.topSeeking:
|
17935 | case topLevelTypes.topStalled:
|
17936 | case topLevelTypes.topSubmit:
|
17937 | case topLevelTypes.topSuspend:
|
17938 | case topLevelTypes.topTimeUpdate:
|
17939 | case topLevelTypes.topVolumeChange:
|
17940 | case topLevelTypes.topWaiting:
|
17941 |
|
17942 |
|
17943 | EventConstructor = SyntheticEvent;
|
17944 | break;
|
17945 | case topLevelTypes.topKeyPress:
|
17946 |
|
17947 |
|
17948 |
|
17949 | if (getEventCharCode(nativeEvent) === 0) {
|
17950 | return null;
|
17951 | }
|
17952 |
|
17953 | case topLevelTypes.topKeyDown:
|
17954 | case topLevelTypes.topKeyUp:
|
17955 | EventConstructor = SyntheticKeyboardEvent;
|
17956 | break;
|
17957 | case topLevelTypes.topBlur:
|
17958 | case topLevelTypes.topFocus:
|
17959 | EventConstructor = SyntheticFocusEvent;
|
17960 | break;
|
17961 | case topLevelTypes.topClick:
|
17962 |
|
17963 |
|
17964 | if (nativeEvent.button === 2) {
|
17965 | return null;
|
17966 | }
|
17967 |
|
17968 | case topLevelTypes.topContextMenu:
|
17969 | case topLevelTypes.topDoubleClick:
|
17970 | case topLevelTypes.topMouseDown:
|
17971 | case topLevelTypes.topMouseMove:
|
17972 | case topLevelTypes.topMouseOut:
|
17973 | case topLevelTypes.topMouseOver:
|
17974 | case topLevelTypes.topMouseUp:
|
17975 | EventConstructor = SyntheticMouseEvent;
|
17976 | break;
|
17977 | case topLevelTypes.topDrag:
|
17978 | case topLevelTypes.topDragEnd:
|
17979 | case topLevelTypes.topDragEnter:
|
17980 | case topLevelTypes.topDragExit:
|
17981 | case topLevelTypes.topDragLeave:
|
17982 | case topLevelTypes.topDragOver:
|
17983 | case topLevelTypes.topDragStart:
|
17984 | case topLevelTypes.topDrop:
|
17985 | EventConstructor = SyntheticDragEvent;
|
17986 | break;
|
17987 | case topLevelTypes.topTouchCancel:
|
17988 | case topLevelTypes.topTouchEnd:
|
17989 | case topLevelTypes.topTouchMove:
|
17990 | case topLevelTypes.topTouchStart:
|
17991 | EventConstructor = SyntheticTouchEvent;
|
17992 | break;
|
17993 | case topLevelTypes.topAnimationEnd:
|
17994 | case topLevelTypes.topAnimationIteration:
|
17995 | case topLevelTypes.topAnimationStart:
|
17996 | EventConstructor = SyntheticAnimationEvent;
|
17997 | break;
|
17998 | case topLevelTypes.topTransitionEnd:
|
17999 | EventConstructor = SyntheticTransitionEvent;
|
18000 | break;
|
18001 | case topLevelTypes.topScroll:
|
18002 | EventConstructor = SyntheticUIEvent;
|
18003 | break;
|
18004 | case topLevelTypes.topWheel:
|
18005 | EventConstructor = SyntheticWheelEvent;
|
18006 | break;
|
18007 | case topLevelTypes.topCopy:
|
18008 | case topLevelTypes.topCut:
|
18009 | case topLevelTypes.topPaste:
|
18010 | EventConstructor = SyntheticClipboardEvent;
|
18011 | break;
|
18012 | }
|
18013 | !EventConstructor ? "development" !== 'production' ? invariant(false, 'SimpleEventPlugin: Unhandled event type, `%s`.', topLevelType) : _prodInvariant('86', topLevelType) : void 0;
|
18014 | var event = EventConstructor.getPooled(dispatchConfig, targetInst, nativeEvent, nativeEventTarget);
|
18015 | EventPropagators.accumulateTwoPhaseDispatches(event);
|
18016 | return event;
|
18017 | },
|
18018 |
|
18019 | didPutListener: function (inst, registrationName, listener) {
|
18020 |
|
18021 |
|
18022 |
|
18023 |
|
18024 | if (registrationName === ON_CLICK_KEY) {
|
18025 | var key = getDictionaryKey(inst);
|
18026 | var node = ReactDOMComponentTree.getNodeFromInstance(inst);
|
18027 | if (!onClickListeners[key]) {
|
18028 | onClickListeners[key] = EventListener.listen(node, 'click', emptyFunction);
|
18029 | }
|
18030 | }
|
18031 | },
|
18032 |
|
18033 | willDeleteListener: function (inst, registrationName) {
|
18034 | if (registrationName === ON_CLICK_KEY) {
|
18035 | var key = getDictionaryKey(inst);
|
18036 | onClickListeners[key].remove();
|
18037 | delete onClickListeners[key];
|
18038 | }
|
18039 | }
|
18040 |
|
18041 | };
|
18042 |
|
18043 | module.exports = SimpleEventPlugin;
|
18044 | },{"114":114,"115":115,"117":117,"118":118,"119":119,"121":121,"122":122,"123":123,"124":124,"125":125,"126":126,"139":139,"153":153,"16":16,"163":163,"170":170,"178":178,"182":182,"20":20,"46":46}],114:[function(_dereq_,module,exports){
|
18045 |
|
18046 |
|
18047 |
|
18048 |
|
18049 |
|
18050 |
|
18051 |
|
18052 |
|
18053 |
|
18054 |
|
18055 |
|
18056 | 'use strict';
|
18057 |
|
18058 | var SyntheticEvent = _dereq_(118);
|
18059 |
|
18060 |
|
18061 |
|
18062 |
|
18063 |
|
18064 |
|
18065 | var AnimationEventInterface = {
|
18066 | animationName: null,
|
18067 | elapsedTime: null,
|
18068 | pseudoElement: null
|
18069 | };
|
18070 |
|
18071 |
|
18072 |
|
18073 |
|
18074 |
|
18075 |
|
18076 |
|
18077 | function SyntheticAnimationEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
18078 | return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
18079 | }
|
18080 |
|
18081 | SyntheticEvent.augmentClass(SyntheticAnimationEvent, AnimationEventInterface);
|
18082 |
|
18083 | module.exports = SyntheticAnimationEvent;
|
18084 | },{"118":118}],115:[function(_dereq_,module,exports){
|
18085 |
|
18086 |
|
18087 |
|
18088 |
|
18089 |
|
18090 |
|
18091 |
|
18092 |
|
18093 |
|
18094 |
|
18095 |
|
18096 | 'use strict';
|
18097 |
|
18098 | var SyntheticEvent = _dereq_(118);
|
18099 |
|
18100 |
|
18101 |
|
18102 |
|
18103 |
|
18104 | var ClipboardEventInterface = {
|
18105 | clipboardData: function (event) {
|
18106 | return 'clipboardData' in event ? event.clipboardData : window.clipboardData;
|
18107 | }
|
18108 | };
|
18109 |
|
18110 |
|
18111 |
|
18112 |
|
18113 |
|
18114 |
|
18115 |
|
18116 | function SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
18117 | return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
18118 | }
|
18119 |
|
18120 | SyntheticEvent.augmentClass(SyntheticClipboardEvent, ClipboardEventInterface);
|
18121 |
|
18122 | module.exports = SyntheticClipboardEvent;
|
18123 | },{"118":118}],116:[function(_dereq_,module,exports){
|
18124 |
|
18125 |
|
18126 |
|
18127 |
|
18128 |
|
18129 |
|
18130 |
|
18131 |
|
18132 |
|
18133 |
|
18134 |
|
18135 | 'use strict';
|
18136 |
|
18137 | var SyntheticEvent = _dereq_(118);
|
18138 |
|
18139 |
|
18140 |
|
18141 |
|
18142 |
|
18143 | var CompositionEventInterface = {
|
18144 | data: null
|
18145 | };
|
18146 |
|
18147 |
|
18148 |
|
18149 |
|
18150 |
|
18151 |
|
18152 |
|
18153 | function SyntheticCompositionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
18154 | return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
18155 | }
|
18156 |
|
18157 | SyntheticEvent.augmentClass(SyntheticCompositionEvent, CompositionEventInterface);
|
18158 |
|
18159 | module.exports = SyntheticCompositionEvent;
|
18160 | },{"118":118}],117:[function(_dereq_,module,exports){
|
18161 |
|
18162 |
|
18163 |
|
18164 |
|
18165 |
|
18166 |
|
18167 |
|
18168 |
|
18169 |
|
18170 |
|
18171 |
|
18172 | 'use strict';
|
18173 |
|
18174 | var SyntheticMouseEvent = _dereq_(122);
|
18175 |
|
18176 |
|
18177 |
|
18178 |
|
18179 |
|
18180 | var DragEventInterface = {
|
18181 | dataTransfer: null
|
18182 | };
|
18183 |
|
18184 |
|
18185 |
|
18186 |
|
18187 |
|
18188 |
|
18189 |
|
18190 | function SyntheticDragEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
18191 | return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
18192 | }
|
18193 |
|
18194 | SyntheticMouseEvent.augmentClass(SyntheticDragEvent, DragEventInterface);
|
18195 |
|
18196 | module.exports = SyntheticDragEvent;
|
18197 | },{"122":122}],118:[function(_dereq_,module,exports){
|
18198 |
|
18199 |
|
18200 |
|
18201 |
|
18202 |
|
18203 |
|
18204 |
|
18205 |
|
18206 |
|
18207 |
|
18208 |
|
18209 | 'use strict';
|
18210 |
|
18211 | var _assign = _dereq_(188);
|
18212 |
|
18213 | var PooledClass = _dereq_(26);
|
18214 |
|
18215 | var emptyFunction = _dereq_(170);
|
18216 | var warning = _dereq_(187);
|
18217 |
|
18218 | var didWarnForAddedNewProperty = false;
|
18219 | var isProxySupported = typeof Proxy === 'function';
|
18220 |
|
18221 | var shouldBeReleasedProperties = ['dispatchConfig', '_targetInst', 'nativeEvent', 'isDefaultPrevented', 'isPropagationStopped', '_dispatchListeners', '_dispatchInstances'];
|
18222 |
|
18223 |
|
18224 |
|
18225 |
|
18226 |
|
18227 | var EventInterface = {
|
18228 | type: null,
|
18229 | target: null,
|
18230 |
|
18231 | currentTarget: emptyFunction.thatReturnsNull,
|
18232 | eventPhase: null,
|
18233 | bubbles: null,
|
18234 | cancelable: null,
|
18235 | timeStamp: function (event) {
|
18236 | return event.timeStamp || Date.now();
|
18237 | },
|
18238 | defaultPrevented: null,
|
18239 | isTrusted: null
|
18240 | };
|
18241 |
|
18242 |
|
18243 |
|
18244 |
|
18245 |
|
18246 |
|
18247 |
|
18248 |
|
18249 |
|
18250 |
|
18251 |
|
18252 |
|
18253 |
|
18254 |
|
18255 |
|
18256 |
|
18257 |
|
18258 |
|
18259 |
|
18260 | function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) {
|
18261 | if ("development" !== 'production') {
|
18262 |
|
18263 | delete this.nativeEvent;
|
18264 | delete this.preventDefault;
|
18265 | delete this.stopPropagation;
|
18266 | }
|
18267 |
|
18268 | this.dispatchConfig = dispatchConfig;
|
18269 | this._targetInst = targetInst;
|
18270 | this.nativeEvent = nativeEvent;
|
18271 |
|
18272 | var Interface = this.constructor.Interface;
|
18273 | for (var propName in Interface) {
|
18274 | if (!Interface.hasOwnProperty(propName)) {
|
18275 | continue;
|
18276 | }
|
18277 | if ("development" !== 'production') {
|
18278 | delete this[propName];
|
18279 | }
|
18280 | var normalize = Interface[propName];
|
18281 | if (normalize) {
|
18282 | this[propName] = normalize(nativeEvent);
|
18283 | } else {
|
18284 | if (propName === 'target') {
|
18285 | this.target = nativeEventTarget;
|
18286 | } else {
|
18287 | this[propName] = nativeEvent[propName];
|
18288 | }
|
18289 | }
|
18290 | }
|
18291 |
|
18292 | var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;
|
18293 | if (defaultPrevented) {
|
18294 | this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
|
18295 | } else {
|
18296 | this.isDefaultPrevented = emptyFunction.thatReturnsFalse;
|
18297 | }
|
18298 | this.isPropagationStopped = emptyFunction.thatReturnsFalse;
|
18299 | return this;
|
18300 | }
|
18301 |
|
18302 | _assign(SyntheticEvent.prototype, {
|
18303 |
|
18304 | preventDefault: function () {
|
18305 | this.defaultPrevented = true;
|
18306 | var event = this.nativeEvent;
|
18307 | if (!event) {
|
18308 | return;
|
18309 | }
|
18310 |
|
18311 | if (event.preventDefault) {
|
18312 | event.preventDefault();
|
18313 | } else if (typeof event.returnValue !== 'unknown') {
|
18314 |
|
18315 | event.returnValue = false;
|
18316 | }
|
18317 | this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
|
18318 | },
|
18319 |
|
18320 | stopPropagation: function () {
|
18321 | var event = this.nativeEvent;
|
18322 | if (!event) {
|
18323 | return;
|
18324 | }
|
18325 |
|
18326 | if (event.stopPropagation) {
|
18327 | event.stopPropagation();
|
18328 | } else if (typeof event.cancelBubble !== 'unknown') {
|
18329 |
|
18330 |
|
18331 |
|
18332 |
|
18333 |
|
18334 |
|
18335 | event.cancelBubble = true;
|
18336 | }
|
18337 |
|
18338 | this.isPropagationStopped = emptyFunction.thatReturnsTrue;
|
18339 | },
|
18340 |
|
18341 | |
18342 |
|
18343 |
|
18344 |
|
18345 |
|
18346 | persist: function () {
|
18347 | this.isPersistent = emptyFunction.thatReturnsTrue;
|
18348 | },
|
18349 |
|
18350 | |
18351 |
|
18352 |
|
18353 |
|
18354 |
|
18355 | isPersistent: emptyFunction.thatReturnsFalse,
|
18356 |
|
18357 | |
18358 |
|
18359 |
|
18360 | destructor: function () {
|
18361 | var Interface = this.constructor.Interface;
|
18362 | for (var propName in Interface) {
|
18363 | if ("development" !== 'production') {
|
18364 | Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName]));
|
18365 | } else {
|
18366 | this[propName] = null;
|
18367 | }
|
18368 | }
|
18369 | for (var i = 0; i < shouldBeReleasedProperties.length; i++) {
|
18370 | this[shouldBeReleasedProperties[i]] = null;
|
18371 | }
|
18372 | if ("development" !== 'production') {
|
18373 | Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null));
|
18374 | Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', emptyFunction));
|
18375 | Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', emptyFunction));
|
18376 | }
|
18377 | }
|
18378 |
|
18379 | });
|
18380 |
|
18381 | SyntheticEvent.Interface = EventInterface;
|
18382 |
|
18383 | if ("development" !== 'production') {
|
18384 | if (isProxySupported) {
|
18385 |
|
18386 | SyntheticEvent = new Proxy(SyntheticEvent, {
|
18387 | construct: function (target, args) {
|
18388 | return this.apply(target, Object.create(target.prototype), args);
|
18389 | },
|
18390 | apply: function (constructor, that, args) {
|
18391 | return new Proxy(constructor.apply(that, args), {
|
18392 | set: function (target, prop, value) {
|
18393 | if (prop !== 'isPersistent' && !target.constructor.Interface.hasOwnProperty(prop) && shouldBeReleasedProperties.indexOf(prop) === -1) {
|
18394 | "development" !== 'production' ? warning(didWarnForAddedNewProperty || target.isPersistent(), 'This synthetic event is reused for performance reasons. If you\'re ' + 'seeing this, you\'re adding a new property in the synthetic event object. ' + 'The property is never released. See ' + 'https://fb.me/react-event-pooling for more information.') : void 0;
|
18395 | didWarnForAddedNewProperty = true;
|
18396 | }
|
18397 | target[prop] = value;
|
18398 | return true;
|
18399 | }
|
18400 | });
|
18401 | }
|
18402 | });
|
18403 |
|
18404 | }
|
18405 | }
|
18406 |
|
18407 |
|
18408 |
|
18409 |
|
18410 |
|
18411 |
|
18412 | SyntheticEvent.augmentClass = function (Class, Interface) {
|
18413 | var Super = this;
|
18414 |
|
18415 | var E = function () {};
|
18416 | E.prototype = Super.prototype;
|
18417 | var prototype = new E();
|
18418 |
|
18419 | _assign(prototype, Class.prototype);
|
18420 | Class.prototype = prototype;
|
18421 | Class.prototype.constructor = Class;
|
18422 |
|
18423 | Class.Interface = _assign({}, Super.Interface, Interface);
|
18424 | Class.augmentClass = Super.augmentClass;
|
18425 |
|
18426 | PooledClass.addPoolingTo(Class, PooledClass.fourArgumentPooler);
|
18427 | };
|
18428 |
|
18429 | PooledClass.addPoolingTo(SyntheticEvent, PooledClass.fourArgumentPooler);
|
18430 |
|
18431 | module.exports = SyntheticEvent;
|
18432 |
|
18433 |
|
18434 |
|
18435 |
|
18436 |
|
18437 |
|
18438 |
|
18439 |
|
18440 | function getPooledWarningPropertyDefinition(propName, getVal) {
|
18441 | var isFunction = typeof getVal === 'function';
|
18442 | return {
|
18443 | configurable: true,
|
18444 | set: set,
|
18445 | get: get
|
18446 | };
|
18447 |
|
18448 | function set(val) {
|
18449 | var action = isFunction ? 'setting the method' : 'setting the property';
|
18450 | warn(action, 'This is effectively a no-op');
|
18451 | return val;
|
18452 | }
|
18453 |
|
18454 | function get() {
|
18455 | var action = isFunction ? 'accessing the method' : 'accessing the property';
|
18456 | var result = isFunction ? 'This is a no-op function' : 'This is set to null';
|
18457 | warn(action, result);
|
18458 | return getVal;
|
18459 | }
|
18460 |
|
18461 | function warn(action, result) {
|
18462 | var warningCondition = false;
|
18463 | "development" !== 'production' ? warning(warningCondition, 'This synthetic event is reused for performance reasons. If you\'re seeing this, ' + 'you\'re %s `%s` on a released/nullified synthetic event. %s. ' + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result) : void 0;
|
18464 | }
|
18465 | }
|
18466 | },{"170":170,"187":187,"188":188,"26":26}],119:[function(_dereq_,module,exports){
|
18467 |
|
18468 |
|
18469 |
|
18470 |
|
18471 |
|
18472 |
|
18473 |
|
18474 |
|
18475 |
|
18476 |
|
18477 |
|
18478 | 'use strict';
|
18479 |
|
18480 | var SyntheticUIEvent = _dereq_(125);
|
18481 |
|
18482 |
|
18483 |
|
18484 |
|
18485 |
|
18486 | var FocusEventInterface = {
|
18487 | relatedTarget: null
|
18488 | };
|
18489 |
|
18490 |
|
18491 |
|
18492 |
|
18493 |
|
18494 |
|
18495 |
|
18496 | function SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
18497 | return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
18498 | }
|
18499 |
|
18500 | SyntheticUIEvent.augmentClass(SyntheticFocusEvent, FocusEventInterface);
|
18501 |
|
18502 | module.exports = SyntheticFocusEvent;
|
18503 | },{"125":125}],120:[function(_dereq_,module,exports){
|
18504 |
|
18505 |
|
18506 |
|
18507 |
|
18508 |
|
18509 |
|
18510 |
|
18511 |
|
18512 |
|
18513 |
|
18514 |
|
18515 | 'use strict';
|
18516 |
|
18517 | var SyntheticEvent = _dereq_(118);
|
18518 |
|
18519 |
|
18520 |
|
18521 |
|
18522 |
|
18523 |
|
18524 | var InputEventInterface = {
|
18525 | data: null
|
18526 | };
|
18527 |
|
18528 |
|
18529 |
|
18530 |
|
18531 |
|
18532 |
|
18533 |
|
18534 | function SyntheticInputEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
18535 | return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
18536 | }
|
18537 |
|
18538 | SyntheticEvent.augmentClass(SyntheticInputEvent, InputEventInterface);
|
18539 |
|
18540 | module.exports = SyntheticInputEvent;
|
18541 | },{"118":118}],121:[function(_dereq_,module,exports){
|
18542 |
|
18543 |
|
18544 |
|
18545 |
|
18546 |
|
18547 |
|
18548 |
|
18549 |
|
18550 |
|
18551 |
|
18552 |
|
18553 | 'use strict';
|
18554 |
|
18555 | var SyntheticUIEvent = _dereq_(125);
|
18556 |
|
18557 | var getEventCharCode = _dereq_(139);
|
18558 | var getEventKey = _dereq_(140);
|
18559 | var getEventModifierState = _dereq_(141);
|
18560 |
|
18561 |
|
18562 |
|
18563 |
|
18564 |
|
18565 | var KeyboardEventInterface = {
|
18566 | key: getEventKey,
|
18567 | location: null,
|
18568 | ctrlKey: null,
|
18569 | shiftKey: null,
|
18570 | altKey: null,
|
18571 | metaKey: null,
|
18572 | repeat: null,
|
18573 | locale: null,
|
18574 | getModifierState: getEventModifierState,
|
18575 |
|
18576 | charCode: function (event) {
|
18577 |
|
18578 |
|
18579 |
|
18580 |
|
18581 |
|
18582 | if (event.type === 'keypress') {
|
18583 | return getEventCharCode(event);
|
18584 | }
|
18585 | return 0;
|
18586 | },
|
18587 | keyCode: function (event) {
|
18588 |
|
18589 |
|
18590 |
|
18591 |
|
18592 |
|
18593 |
|
18594 |
|
18595 | if (event.type === 'keydown' || event.type === 'keyup') {
|
18596 | return event.keyCode;
|
18597 | }
|
18598 | return 0;
|
18599 | },
|
18600 | which: function (event) {
|
18601 |
|
18602 |
|
18603 | if (event.type === 'keypress') {
|
18604 | return getEventCharCode(event);
|
18605 | }
|
18606 | if (event.type === 'keydown' || event.type === 'keyup') {
|
18607 | return event.keyCode;
|
18608 | }
|
18609 | return 0;
|
18610 | }
|
18611 | };
|
18612 |
|
18613 |
|
18614 |
|
18615 |
|
18616 |
|
18617 |
|
18618 |
|
18619 | function SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
18620 | return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
18621 | }
|
18622 |
|
18623 | SyntheticUIEvent.augmentClass(SyntheticKeyboardEvent, KeyboardEventInterface);
|
18624 |
|
18625 | module.exports = SyntheticKeyboardEvent;
|
18626 | },{"125":125,"139":139,"140":140,"141":141}],122:[function(_dereq_,module,exports){
|
18627 |
|
18628 |
|
18629 |
|
18630 |
|
18631 |
|
18632 |
|
18633 |
|
18634 |
|
18635 |
|
18636 |
|
18637 |
|
18638 | 'use strict';
|
18639 |
|
18640 | var SyntheticUIEvent = _dereq_(125);
|
18641 | var ViewportMetrics = _dereq_(128);
|
18642 |
|
18643 | var getEventModifierState = _dereq_(141);
|
18644 |
|
18645 |
|
18646 |
|
18647 |
|
18648 |
|
18649 | var MouseEventInterface = {
|
18650 | screenX: null,
|
18651 | screenY: null,
|
18652 | clientX: null,
|
18653 | clientY: null,
|
18654 | ctrlKey: null,
|
18655 | shiftKey: null,
|
18656 | altKey: null,
|
18657 | metaKey: null,
|
18658 | getModifierState: getEventModifierState,
|
18659 | button: function (event) {
|
18660 |
|
18661 |
|
18662 |
|
18663 | var button = event.button;
|
18664 | if ('which' in event) {
|
18665 | return button;
|
18666 | }
|
18667 |
|
18668 |
|
18669 |
|
18670 |
|
18671 | return button === 2 ? 2 : button === 4 ? 1 : 0;
|
18672 | },
|
18673 | buttons: null,
|
18674 | relatedTarget: function (event) {
|
18675 | return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement);
|
18676 | },
|
18677 |
|
18678 | pageX: function (event) {
|
18679 | return 'pageX' in event ? event.pageX : event.clientX + ViewportMetrics.currentScrollLeft;
|
18680 | },
|
18681 | pageY: function (event) {
|
18682 | return 'pageY' in event ? event.pageY : event.clientY + ViewportMetrics.currentScrollTop;
|
18683 | }
|
18684 | };
|
18685 |
|
18686 |
|
18687 |
|
18688 |
|
18689 |
|
18690 |
|
18691 |
|
18692 | function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
18693 | return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
18694 | }
|
18695 |
|
18696 | SyntheticUIEvent.augmentClass(SyntheticMouseEvent, MouseEventInterface);
|
18697 |
|
18698 | module.exports = SyntheticMouseEvent;
|
18699 | },{"125":125,"128":128,"141":141}],123:[function(_dereq_,module,exports){
|
18700 |
|
18701 |
|
18702 |
|
18703 |
|
18704 |
|
18705 |
|
18706 |
|
18707 |
|
18708 |
|
18709 |
|
18710 |
|
18711 | 'use strict';
|
18712 |
|
18713 | var SyntheticUIEvent = _dereq_(125);
|
18714 |
|
18715 | var getEventModifierState = _dereq_(141);
|
18716 |
|
18717 |
|
18718 |
|
18719 |
|
18720 |
|
18721 | var TouchEventInterface = {
|
18722 | touches: null,
|
18723 | targetTouches: null,
|
18724 | changedTouches: null,
|
18725 | altKey: null,
|
18726 | metaKey: null,
|
18727 | ctrlKey: null,
|
18728 | shiftKey: null,
|
18729 | getModifierState: getEventModifierState
|
18730 | };
|
18731 |
|
18732 |
|
18733 |
|
18734 |
|
18735 |
|
18736 |
|
18737 |
|
18738 | function SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
18739 | return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
18740 | }
|
18741 |
|
18742 | SyntheticUIEvent.augmentClass(SyntheticTouchEvent, TouchEventInterface);
|
18743 |
|
18744 | module.exports = SyntheticTouchEvent;
|
18745 | },{"125":125,"141":141}],124:[function(_dereq_,module,exports){
|
18746 |
|
18747 |
|
18748 |
|
18749 |
|
18750 |
|
18751 |
|
18752 |
|
18753 |
|
18754 |
|
18755 |
|
18756 |
|
18757 | 'use strict';
|
18758 |
|
18759 | var SyntheticEvent = _dereq_(118);
|
18760 |
|
18761 |
|
18762 |
|
18763 |
|
18764 |
|
18765 |
|
18766 | var TransitionEventInterface = {
|
18767 | propertyName: null,
|
18768 | elapsedTime: null,
|
18769 | pseudoElement: null
|
18770 | };
|
18771 |
|
18772 |
|
18773 |
|
18774 |
|
18775 |
|
18776 |
|
18777 |
|
18778 | function SyntheticTransitionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
18779 | return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
18780 | }
|
18781 |
|
18782 | SyntheticEvent.augmentClass(SyntheticTransitionEvent, TransitionEventInterface);
|
18783 |
|
18784 | module.exports = SyntheticTransitionEvent;
|
18785 | },{"118":118}],125:[function(_dereq_,module,exports){
|
18786 |
|
18787 |
|
18788 |
|
18789 |
|
18790 |
|
18791 |
|
18792 |
|
18793 |
|
18794 |
|
18795 |
|
18796 |
|
18797 | 'use strict';
|
18798 |
|
18799 | var SyntheticEvent = _dereq_(118);
|
18800 |
|
18801 | var getEventTarget = _dereq_(142);
|
18802 |
|
18803 |
|
18804 |
|
18805 |
|
18806 |
|
18807 | var UIEventInterface = {
|
18808 | view: function (event) {
|
18809 | if (event.view) {
|
18810 | return event.view;
|
18811 | }
|
18812 |
|
18813 | var target = getEventTarget(event);
|
18814 | if (target.window === target) {
|
18815 |
|
18816 | return target;
|
18817 | }
|
18818 |
|
18819 | var doc = target.ownerDocument;
|
18820 |
|
18821 | if (doc) {
|
18822 | return doc.defaultView || doc.parentWindow;
|
18823 | } else {
|
18824 | return window;
|
18825 | }
|
18826 | },
|
18827 | detail: function (event) {
|
18828 | return event.detail || 0;
|
18829 | }
|
18830 | };
|
18831 |
|
18832 |
|
18833 |
|
18834 |
|
18835 |
|
18836 |
|
18837 |
|
18838 | function SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
18839 | return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
18840 | }
|
18841 |
|
18842 | SyntheticEvent.augmentClass(SyntheticUIEvent, UIEventInterface);
|
18843 |
|
18844 | module.exports = SyntheticUIEvent;
|
18845 | },{"118":118,"142":142}],126:[function(_dereq_,module,exports){
|
18846 |
|
18847 |
|
18848 |
|
18849 |
|
18850 |
|
18851 |
|
18852 |
|
18853 |
|
18854 |
|
18855 |
|
18856 |
|
18857 | 'use strict';
|
18858 |
|
18859 | var SyntheticMouseEvent = _dereq_(122);
|
18860 |
|
18861 |
|
18862 |
|
18863 |
|
18864 |
|
18865 | var WheelEventInterface = {
|
18866 | deltaX: function (event) {
|
18867 | return 'deltaX' in event ? event.deltaX :
|
18868 |
|
18869 | 'wheelDeltaX' in event ? -event.wheelDeltaX : 0;
|
18870 | },
|
18871 | deltaY: function (event) {
|
18872 | return 'deltaY' in event ? event.deltaY :
|
18873 |
|
18874 | 'wheelDeltaY' in event ? -event.wheelDeltaY :
|
18875 |
|
18876 | 'wheelDelta' in event ? -event.wheelDelta : 0;
|
18877 | },
|
18878 | deltaZ: null,
|
18879 |
|
18880 |
|
18881 |
|
18882 |
|
18883 |
|
18884 | deltaMode: null
|
18885 | };
|
18886 |
|
18887 |
|
18888 |
|
18889 |
|
18890 |
|
18891 |
|
18892 |
|
18893 | function SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
18894 | return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
18895 | }
|
18896 |
|
18897 | SyntheticMouseEvent.augmentClass(SyntheticWheelEvent, WheelEventInterface);
|
18898 |
|
18899 | module.exports = SyntheticWheelEvent;
|
18900 | },{"122":122}],127:[function(_dereq_,module,exports){
|
18901 |
|
18902 |
|
18903 |
|
18904 |
|
18905 |
|
18906 |
|
18907 |
|
18908 |
|
18909 |
|
18910 |
|
18911 |
|
18912 | 'use strict';
|
18913 |
|
18914 | var _prodInvariant = _dereq_(153);
|
18915 |
|
18916 | var invariant = _dereq_(178);
|
18917 |
|
18918 |
|
18919 |
|
18920 |
|
18921 |
|
18922 |
|
18923 |
|
18924 |
|
18925 |
|
18926 |
|
18927 |
|
18928 |
|
18929 |
|
18930 |
|
18931 |
|
18932 |
|
18933 |
|
18934 |
|
18935 |
|
18936 |
|
18937 |
|
18938 |
|
18939 |
|
18940 |
|
18941 |
|
18942 |
|
18943 |
|
18944 |
|
18945 |
|
18946 |
|
18947 |
|
18948 |
|
18949 |
|
18950 |
|
18951 |
|
18952 |
|
18953 |
|
18954 |
|
18955 |
|
18956 |
|
18957 |
|
18958 |
|
18959 |
|
18960 |
|
18961 |
|
18962 |
|
18963 |
|
18964 |
|
18965 |
|
18966 |
|
18967 |
|
18968 |
|
18969 |
|
18970 |
|
18971 |
|
18972 |
|
18973 |
|
18974 |
|
18975 |
|
18976 |
|
18977 |
|
18978 |
|
18979 | var Mixin = {
|
18980 | |
18981 |
|
18982 |
|
18983 |
|
18984 |
|
18985 |
|
18986 |
|
18987 | reinitializeTransaction: function () {
|
18988 | this.transactionWrappers = this.getTransactionWrappers();
|
18989 | if (this.wrapperInitData) {
|
18990 | this.wrapperInitData.length = 0;
|
18991 | } else {
|
18992 | this.wrapperInitData = [];
|
18993 | }
|
18994 | this._isInTransaction = false;
|
18995 | },
|
18996 |
|
18997 | _isInTransaction: false,
|
18998 |
|
18999 | |
19000 |
|
19001 |
|
19002 |
|
19003 | getTransactionWrappers: null,
|
19004 |
|
19005 | isInTransaction: function () {
|
19006 | return !!this._isInTransaction;
|
19007 | },
|
19008 |
|
19009 | |
19010 |
|
19011 |
|
19012 |
|
19013 |
|
19014 |
|
19015 |
|
19016 |
|
19017 |
|
19018 |
|
19019 |
|
19020 |
|
19021 |
|
19022 |
|
19023 |
|
19024 |
|
19025 |
|
19026 | perform: function (method, scope, a, b, c, d, e, f) {
|
19027 | !!this.isInTransaction() ? "development" !== 'production' ? invariant(false, 'Transaction.perform(...): Cannot initialize a transaction when there is already an outstanding transaction.') : _prodInvariant('27') : void 0;
|
19028 | var errorThrown;
|
19029 | var ret;
|
19030 | try {
|
19031 | this._isInTransaction = true;
|
19032 |
|
19033 |
|
19034 |
|
19035 |
|
19036 | errorThrown = true;
|
19037 | this.initializeAll(0);
|
19038 | ret = method.call(scope, a, b, c, d, e, f);
|
19039 | errorThrown = false;
|
19040 | } finally {
|
19041 | try {
|
19042 | if (errorThrown) {
|
19043 |
|
19044 |
|
19045 | try {
|
19046 | this.closeAll(0);
|
19047 | } catch (err) {}
|
19048 | } else {
|
19049 |
|
19050 |
|
19051 | this.closeAll(0);
|
19052 | }
|
19053 | } finally {
|
19054 | this._isInTransaction = false;
|
19055 | }
|
19056 | }
|
19057 | return ret;
|
19058 | },
|
19059 |
|
19060 | initializeAll: function (startIndex) {
|
19061 | var transactionWrappers = this.transactionWrappers;
|
19062 | for (var i = startIndex; i < transactionWrappers.length; i++) {
|
19063 | var wrapper = transactionWrappers[i];
|
19064 | try {
|
19065 |
|
19066 |
|
19067 |
|
19068 |
|
19069 | this.wrapperInitData[i] = Transaction.OBSERVED_ERROR;
|
19070 | this.wrapperInitData[i] = wrapper.initialize ? wrapper.initialize.call(this) : null;
|
19071 | } finally {
|
19072 | if (this.wrapperInitData[i] === Transaction.OBSERVED_ERROR) {
|
19073 |
|
19074 |
|
19075 |
|
19076 | try {
|
19077 | this.initializeAll(i + 1);
|
19078 | } catch (err) {}
|
19079 | }
|
19080 | }
|
19081 | }
|
19082 | },
|
19083 |
|
19084 | |
19085 |
|
19086 |
|
19087 |
|
19088 |
|
19089 |
|
19090 | closeAll: function (startIndex) {
|
19091 | !this.isInTransaction() ? "development" !== 'production' ? invariant(false, 'Transaction.closeAll(): Cannot close transaction when none are open.') : _prodInvariant('28') : void 0;
|
19092 | var transactionWrappers = this.transactionWrappers;
|
19093 | for (var i = startIndex; i < transactionWrappers.length; i++) {
|
19094 | var wrapper = transactionWrappers[i];
|
19095 | var initData = this.wrapperInitData[i];
|
19096 | var errorThrown;
|
19097 | try {
|
19098 |
|
19099 |
|
19100 |
|
19101 |
|
19102 | errorThrown = true;
|
19103 | if (initData !== Transaction.OBSERVED_ERROR && wrapper.close) {
|
19104 | wrapper.close.call(this, initData);
|
19105 | }
|
19106 | errorThrown = false;
|
19107 | } finally {
|
19108 | if (errorThrown) {
|
19109 |
|
19110 |
|
19111 |
|
19112 | try {
|
19113 | this.closeAll(i + 1);
|
19114 | } catch (e) {}
|
19115 | }
|
19116 | }
|
19117 | }
|
19118 | this.wrapperInitData.length = 0;
|
19119 | }
|
19120 | };
|
19121 |
|
19122 | var Transaction = {
|
19123 |
|
19124 | Mixin: Mixin,
|
19125 |
|
19126 | |
19127 |
|
19128 |
|
19129 | OBSERVED_ERROR: {}
|
19130 |
|
19131 | };
|
19132 |
|
19133 | module.exports = Transaction;
|
19134 | },{"153":153,"178":178}],128:[function(_dereq_,module,exports){
|
19135 |
|
19136 |
|
19137 |
|
19138 |
|
19139 |
|
19140 |
|
19141 |
|
19142 |
|
19143 |
|
19144 |
|
19145 |
|
19146 | 'use strict';
|
19147 |
|
19148 | var ViewportMetrics = {
|
19149 |
|
19150 | currentScrollLeft: 0,
|
19151 |
|
19152 | currentScrollTop: 0,
|
19153 |
|
19154 | refreshScrollValues: function (scrollPosition) {
|
19155 | ViewportMetrics.currentScrollLeft = scrollPosition.x;
|
19156 | ViewportMetrics.currentScrollTop = scrollPosition.y;
|
19157 | }
|
19158 |
|
19159 | };
|
19160 |
|
19161 | module.exports = ViewportMetrics;
|
19162 | },{}],129:[function(_dereq_,module,exports){
|
19163 |
|
19164 |
|
19165 |
|
19166 |
|
19167 |
|
19168 |
|
19169 |
|
19170 |
|
19171 |
|
19172 |
|
19173 |
|
19174 |
|
19175 | 'use strict';
|
19176 |
|
19177 | var _prodInvariant = _dereq_(153);
|
19178 |
|
19179 | var invariant = _dereq_(178);
|
19180 |
|
19181 |
|
19182 |
|
19183 |
|
19184 |
|
19185 |
|
19186 |
|
19187 |
|
19188 |
|
19189 |
|
19190 |
|
19191 |
|
19192 |
|
19193 |
|
19194 | function accumulateInto(current, next) {
|
19195 | !(next != null) ? "development" !== 'production' ? invariant(false, 'accumulateInto(...): Accumulated items must not be null or undefined.') : _prodInvariant('30') : void 0;
|
19196 |
|
19197 | if (current == null) {
|
19198 | return next;
|
19199 | }
|
19200 |
|
19201 |
|
19202 |
|
19203 | if (Array.isArray(current)) {
|
19204 | if (Array.isArray(next)) {
|
19205 | current.push.apply(current, next);
|
19206 | return current;
|
19207 | }
|
19208 | current.push(next);
|
19209 | return current;
|
19210 | }
|
19211 |
|
19212 | if (Array.isArray(next)) {
|
19213 |
|
19214 | return [current].concat(next);
|
19215 | }
|
19216 |
|
19217 | return [current, next];
|
19218 | }
|
19219 |
|
19220 | module.exports = accumulateInto;
|
19221 | },{"153":153,"178":178}],130:[function(_dereq_,module,exports){
|
19222 |
|
19223 |
|
19224 |
|
19225 |
|
19226 |
|
19227 |
|
19228 |
|
19229 |
|
19230 |
|
19231 |
|
19232 |
|
19233 |
|
19234 | 'use strict';
|
19235 |
|
19236 | var MOD = 65521;
|
19237 |
|
19238 |
|
19239 |
|
19240 |
|
19241 |
|
19242 |
|
19243 | function adler32(data) {
|
19244 | var a = 1;
|
19245 | var b = 0;
|
19246 | var i = 0;
|
19247 | var l = data.length;
|
19248 | var m = l & ~0x3;
|
19249 | while (i < m) {
|
19250 | var n = Math.min(i + 4096, m);
|
19251 | for (; i < n; i += 4) {
|
19252 | b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));
|
19253 | }
|
19254 | a %= MOD;
|
19255 | b %= MOD;
|
19256 | }
|
19257 | for (; i < l; i++) {
|
19258 | b += a += data.charCodeAt(i);
|
19259 | }
|
19260 | a %= MOD;
|
19261 | b %= MOD;
|
19262 | return a | b << 16;
|
19263 | }
|
19264 |
|
19265 | module.exports = adler32;
|
19266 | },{}],131:[function(_dereq_,module,exports){
|
19267 |
|
19268 |
|
19269 |
|
19270 |
|
19271 |
|
19272 |
|
19273 |
|
19274 |
|
19275 |
|
19276 |
|
19277 |
|
19278 | 'use strict';
|
19279 |
|
19280 | var canDefineProperty = false;
|
19281 | if ("development" !== 'production') {
|
19282 | try {
|
19283 | Object.defineProperty({}, 'x', { get: function () {} });
|
19284 | canDefineProperty = true;
|
19285 | } catch (x) {
|
19286 |
|
19287 | }
|
19288 | }
|
19289 |
|
19290 | module.exports = canDefineProperty;
|
19291 | },{}],132:[function(_dereq_,module,exports){
|
19292 | (function (process){
|
19293 |
|
19294 |
|
19295 |
|
19296 |
|
19297 |
|
19298 |
|
19299 |
|
19300 |
|
19301 |
|
19302 |
|
19303 |
|
19304 | 'use strict';
|
19305 |
|
19306 | var _prodInvariant = _dereq_(153);
|
19307 |
|
19308 | var ReactPropTypeLocationNames = _dereq_(89);
|
19309 | var ReactPropTypesSecret = _dereq_(92);
|
19310 |
|
19311 | var invariant = _dereq_(178);
|
19312 | var warning = _dereq_(187);
|
19313 |
|
19314 | var ReactComponentTreeHook;
|
19315 |
|
19316 | if (typeof process !== 'undefined' && process.env && "development" === 'test') {
|
19317 |
|
19318 |
|
19319 |
|
19320 |
|
19321 |
|
19322 | ReactComponentTreeHook = _dereq_(38);
|
19323 | }
|
19324 |
|
19325 | var loggedTypeFailures = {};
|
19326 |
|
19327 |
|
19328 |
|
19329 |
|
19330 |
|
19331 |
|
19332 |
|
19333 |
|
19334 |
|
19335 |
|
19336 |
|
19337 |
|
19338 |
|
19339 | function checkReactTypeSpec(typeSpecs, values, location, componentName, element, debugID) {
|
19340 | for (var typeSpecName in typeSpecs) {
|
19341 | if (typeSpecs.hasOwnProperty(typeSpecName)) {
|
19342 | var error;
|
19343 |
|
19344 |
|
19345 |
|
19346 | try {
|
19347 |
|
19348 |
|
19349 | !(typeof typeSpecs[typeSpecName] === 'function') ? "development" !== 'production' ? invariant(false, '%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName) : _prodInvariant('84', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName) : void 0;
|
19350 | error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
|
19351 | } catch (ex) {
|
19352 | error = ex;
|
19353 | }
|
19354 | "development" !== 'production' ? warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName, typeof error) : void 0;
|
19355 | if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
19356 |
|
19357 |
|
19358 | loggedTypeFailures[error.message] = true;
|
19359 |
|
19360 | var componentStackInfo = '';
|
19361 |
|
19362 | if ("development" !== 'production') {
|
19363 | if (!ReactComponentTreeHook) {
|
19364 | ReactComponentTreeHook = _dereq_(38);
|
19365 | }
|
19366 | if (debugID !== null) {
|
19367 | componentStackInfo = ReactComponentTreeHook.getStackAddendumByID(debugID);
|
19368 | } else if (element !== null) {
|
19369 | componentStackInfo = ReactComponentTreeHook.getCurrentStackAddendum(element);
|
19370 | }
|
19371 | }
|
19372 |
|
19373 | "development" !== 'production' ? warning(false, 'Failed %s type: %s%s', location, error.message, componentStackInfo) : void 0;
|
19374 | }
|
19375 | }
|
19376 | }
|
19377 | }
|
19378 |
|
19379 | module.exports = checkReactTypeSpec;
|
19380 | }).call(this,undefined)
|
19381 | },{"153":153,"178":178,"187":187,"38":38,"89":89,"92":92}],133:[function(_dereq_,module,exports){
|
19382 |
|
19383 |
|
19384 |
|
19385 |
|
19386 |
|
19387 |
|
19388 |
|
19389 |
|
19390 |
|
19391 |
|
19392 |
|
19393 |
|
19394 |
|
19395 | 'use strict';
|
19396 |
|
19397 |
|
19398 |
|
19399 |
|
19400 |
|
19401 | var createMicrosoftUnsafeLocalFunction = function (func) {
|
19402 | if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) {
|
19403 | return function (arg0, arg1, arg2, arg3) {
|
19404 | MSApp.execUnsafeLocalFunction(function () {
|
19405 | return func(arg0, arg1, arg2, arg3);
|
19406 | });
|
19407 | };
|
19408 | } else {
|
19409 | return func;
|
19410 | }
|
19411 | };
|
19412 |
|
19413 | module.exports = createMicrosoftUnsafeLocalFunction;
|
19414 | },{}],134:[function(_dereq_,module,exports){
|
19415 |
|
19416 |
|
19417 |
|
19418 |
|
19419 |
|
19420 |
|
19421 |
|
19422 |
|
19423 |
|
19424 |
|
19425 |
|
19426 | 'use strict';
|
19427 |
|
19428 | var CSSProperty = _dereq_(3);
|
19429 | var warning = _dereq_(187);
|
19430 |
|
19431 | var isUnitlessNumber = CSSProperty.isUnitlessNumber;
|
19432 | var styleWarnings = {};
|
19433 |
|
19434 |
|
19435 |
|
19436 |
|
19437 |
|
19438 |
|
19439 |
|
19440 |
|
19441 |
|
19442 |
|
19443 |
|
19444 | function dangerousStyleValue(name, value, component) {
|
19445 |
|
19446 |
|
19447 |
|
19448 |
|
19449 |
|
19450 |
|
19451 |
|
19452 |
|
19453 |
|
19454 |
|
19455 | var isEmpty = value == null || typeof value === 'boolean' || value === '';
|
19456 | if (isEmpty) {
|
19457 | return '';
|
19458 | }
|
19459 |
|
19460 | var isNonNumeric = isNaN(value);
|
19461 | if (isNonNumeric || value === 0 || isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name]) {
|
19462 | return '' + value;
|
19463 | }
|
19464 |
|
19465 | if (typeof value === 'string') {
|
19466 | if ("development" !== 'production') {
|
19467 |
|
19468 |
|
19469 | if (component && value !== '0') {
|
19470 | var owner = component._currentElement._owner;
|
19471 | var ownerName = owner ? owner.getName() : null;
|
19472 | if (ownerName && !styleWarnings[ownerName]) {
|
19473 | styleWarnings[ownerName] = {};
|
19474 | }
|
19475 | var warned = false;
|
19476 | if (ownerName) {
|
19477 | var warnings = styleWarnings[ownerName];
|
19478 | warned = warnings[name];
|
19479 | if (!warned) {
|
19480 | warnings[name] = true;
|
19481 | }
|
19482 | }
|
19483 | if (!warned) {
|
19484 | "development" !== 'production' ? warning(false, 'a `%s` tag (owner: `%s`) was passed a numeric string value ' + 'for CSS property `%s` (value: `%s`) which will be treated ' + 'as a unitless number in a future version of React.', component._currentElement.type, ownerName || 'unknown', name, value) : void 0;
|
19485 | }
|
19486 | }
|
19487 | }
|
19488 | value = value.trim();
|
19489 | }
|
19490 | return value + 'px';
|
19491 | }
|
19492 |
|
19493 | module.exports = dangerousStyleValue;
|
19494 | },{"187":187,"3":3}],135:[function(_dereq_,module,exports){
|
19495 |
|
19496 |
|
19497 |
|
19498 |
|
19499 |
|
19500 |
|
19501 |
|
19502 |
|
19503 |
|
19504 |
|
19505 |
|
19506 |
|
19507 |
|
19508 |
|
19509 |
|
19510 |
|
19511 |
|
19512 |
|
19513 |
|
19514 |
|
19515 |
|
19516 |
|
19517 |
|
19518 |
|
19519 |
|
19520 |
|
19521 |
|
19522 |
|
19523 |
|
19524 |
|
19525 |
|
19526 |
|
19527 |
|
19528 |
|
19529 |
|
19530 |
|
19531 | 'use strict';
|
19532 |
|
19533 |
|
19534 |
|
19535 |
|
19536 |
|
19537 |
|
19538 |
|
19539 | var matchHtmlRegExp = /["'&<>]/;
|
19540 |
|
19541 |
|
19542 |
|
19543 |
|
19544 |
|
19545 |
|
19546 |
|
19547 |
|
19548 |
|
19549 | function escapeHtml(string) {
|
19550 | var str = '' + string;
|
19551 | var match = matchHtmlRegExp.exec(str);
|
19552 |
|
19553 | if (!match) {
|
19554 | return str;
|
19555 | }
|
19556 |
|
19557 | var escape;
|
19558 | var html = '';
|
19559 | var index = 0;
|
19560 | var lastIndex = 0;
|
19561 |
|
19562 | for (index = match.index; index < str.length; index++) {
|
19563 | switch (str.charCodeAt(index)) {
|
19564 | case 34:
|
19565 |
|
19566 | escape = '"';
|
19567 | break;
|
19568 | case 38:
|
19569 |
|
19570 | escape = '&';
|
19571 | break;
|
19572 | case 39:
|
19573 |
|
19574 | escape = ''';
|
19575 | break;
|
19576 | case 60:
|
19577 |
|
19578 | escape = '<';
|
19579 | break;
|
19580 | case 62:
|
19581 |
|
19582 | escape = '>';
|
19583 | break;
|
19584 | default:
|
19585 | continue;
|
19586 | }
|
19587 |
|
19588 | if (lastIndex !== index) {
|
19589 | html += str.substring(lastIndex, index);
|
19590 | }
|
19591 |
|
19592 | lastIndex = index + 1;
|
19593 | html += escape;
|
19594 | }
|
19595 |
|
19596 | return lastIndex !== index ? html + str.substring(lastIndex, index) : html;
|
19597 | }
|
19598 |
|
19599 |
|
19600 |
|
19601 |
|
19602 |
|
19603 |
|
19604 |
|
19605 |
|
19606 |
|
19607 | function escapeTextContentForBrowser(text) {
|
19608 | if (typeof text === 'boolean' || typeof text === 'number') {
|
19609 |
|
19610 |
|
19611 |
|
19612 | return '' + text;
|
19613 | }
|
19614 | return escapeHtml(text);
|
19615 | }
|
19616 |
|
19617 | module.exports = escapeTextContentForBrowser;
|
19618 | },{}],136:[function(_dereq_,module,exports){
|
19619 |
|
19620 |
|
19621 |
|
19622 |
|
19623 |
|
19624 |
|
19625 |
|
19626 |
|
19627 |
|
19628 |
|
19629 |
|
19630 | 'use strict';
|
19631 |
|
19632 | var _prodInvariant = _dereq_(153);
|
19633 |
|
19634 | var ReactCurrentOwner = _dereq_(41);
|
19635 | var ReactDOMComponentTree = _dereq_(46);
|
19636 | var ReactInstanceMap = _dereq_(77);
|
19637 |
|
19638 | var getHostComponentFromComposite = _dereq_(143);
|
19639 | var invariant = _dereq_(178);
|
19640 | var warning = _dereq_(187);
|
19641 |
|
19642 |
|
19643 |
|
19644 |
|
19645 |
|
19646 |
|
19647 |
|
19648 |
|
19649 |
|
19650 | function findDOMNode(componentOrElement) {
|
19651 | if ("development" !== 'production') {
|
19652 | var owner = ReactCurrentOwner.current;
|
19653 | if (owner !== null) {
|
19654 | "development" !== 'production' ? warning(owner._warnedAboutRefsInRender, '%s is accessing findDOMNode inside its render(). ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', owner.getName() || 'A component') : void 0;
|
19655 | owner._warnedAboutRefsInRender = true;
|
19656 | }
|
19657 | }
|
19658 | if (componentOrElement == null) {
|
19659 | return null;
|
19660 | }
|
19661 | if (componentOrElement.nodeType === 1) {
|
19662 | return componentOrElement;
|
19663 | }
|
19664 |
|
19665 | var inst = ReactInstanceMap.get(componentOrElement);
|
19666 | if (inst) {
|
19667 | inst = getHostComponentFromComposite(inst);
|
19668 | return inst ? ReactDOMComponentTree.getNodeFromInstance(inst) : null;
|
19669 | }
|
19670 |
|
19671 | if (typeof componentOrElement.render === 'function') {
|
19672 | !false ? "development" !== 'production' ? invariant(false, 'findDOMNode was called on an unmounted component.') : _prodInvariant('44') : void 0;
|
19673 | } else {
|
19674 | !false ? "development" !== 'production' ? invariant(false, 'Element appears to be neither ReactComponent nor DOMNode (keys: %s)', Object.keys(componentOrElement)) : _prodInvariant('45', Object.keys(componentOrElement)) : void 0;
|
19675 | }
|
19676 | }
|
19677 |
|
19678 | module.exports = findDOMNode;
|
19679 | },{"143":143,"153":153,"178":178,"187":187,"41":41,"46":46,"77":77}],137:[function(_dereq_,module,exports){
|
19680 | (function (process){
|
19681 |
|
19682 |
|
19683 |
|
19684 |
|
19685 |
|
19686 |
|
19687 |
|
19688 |
|
19689 |
|
19690 |
|
19691 |
|
19692 |
|
19693 | 'use strict';
|
19694 |
|
19695 | var KeyEscapeUtils = _dereq_(23);
|
19696 | var traverseAllChildren = _dereq_(159);
|
19697 | var warning = _dereq_(187);
|
19698 |
|
19699 | var ReactComponentTreeHook;
|
19700 |
|
19701 | if (typeof process !== 'undefined' && process.env && "development" === 'test') {
|
19702 |
|
19703 |
|
19704 |
|
19705 |
|
19706 |
|
19707 | ReactComponentTreeHook = _dereq_(38);
|
19708 | }
|
19709 |
|
19710 |
|
19711 |
|
19712 |
|
19713 |
|
19714 |
|
19715 |
|
19716 | function flattenSingleChildIntoContext(traverseContext, child, name, selfDebugID) {
|
19717 |
|
19718 | if (traverseContext && typeof traverseContext === 'object') {
|
19719 | var result = traverseContext;
|
19720 | var keyUnique = result[name] === undefined;
|
19721 | if ("development" !== 'production') {
|
19722 | if (!ReactComponentTreeHook) {
|
19723 | ReactComponentTreeHook = _dereq_(38);
|
19724 | }
|
19725 | if (!keyUnique) {
|
19726 | "development" !== 'production' ? warning(false, '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.%s', KeyEscapeUtils.unescape(name), ReactComponentTreeHook.getStackAddendumByID(selfDebugID)) : void 0;
|
19727 | }
|
19728 | }
|
19729 | if (keyUnique && child != null) {
|
19730 | result[name] = child;
|
19731 | }
|
19732 | }
|
19733 | }
|
19734 |
|
19735 |
|
19736 |
|
19737 |
|
19738 |
|
19739 |
|
19740 | function flattenChildren(children, selfDebugID) {
|
19741 | if (children == null) {
|
19742 | return children;
|
19743 | }
|
19744 | var result = {};
|
19745 |
|
19746 | if ("development" !== 'production') {
|
19747 | traverseAllChildren(children, function (traverseContext, child, name) {
|
19748 | return flattenSingleChildIntoContext(traverseContext, child, name, selfDebugID);
|
19749 | }, result);
|
19750 | } else {
|
19751 | traverseAllChildren(children, flattenSingleChildIntoContext, result);
|
19752 | }
|
19753 | return result;
|
19754 | }
|
19755 |
|
19756 | module.exports = flattenChildren;
|
19757 | }).call(this,undefined)
|
19758 | },{"159":159,"187":187,"23":23,"38":38}],138:[function(_dereq_,module,exports){
|
19759 |
|
19760 |
|
19761 |
|
19762 |
|
19763 |
|
19764 |
|
19765 |
|
19766 |
|
19767 |
|
19768 |
|
19769 |
|
19770 |
|
19771 | 'use strict';
|
19772 |
|
19773 |
|
19774 |
|
19775 |
|
19776 |
|
19777 |
|
19778 |
|
19779 |
|
19780 |
|
19781 | function forEachAccumulated(arr, cb, scope) {
|
19782 | if (Array.isArray(arr)) {
|
19783 | arr.forEach(cb, scope);
|
19784 | } else if (arr) {
|
19785 | cb.call(scope, arr);
|
19786 | }
|
19787 | }
|
19788 |
|
19789 | module.exports = forEachAccumulated;
|
19790 | },{}],139:[function(_dereq_,module,exports){
|
19791 |
|
19792 |
|
19793 |
|
19794 |
|
19795 |
|
19796 |
|
19797 |
|
19798 |
|
19799 |
|
19800 |
|
19801 |
|
19802 | 'use strict';
|
19803 |
|
19804 |
|
19805 |
|
19806 |
|
19807 |
|
19808 |
|
19809 |
|
19810 |
|
19811 |
|
19812 |
|
19813 |
|
19814 |
|
19815 | function getEventCharCode(nativeEvent) {
|
19816 | var charCode;
|
19817 | var keyCode = nativeEvent.keyCode;
|
19818 |
|
19819 | if ('charCode' in nativeEvent) {
|
19820 | charCode = nativeEvent.charCode;
|
19821 |
|
19822 |
|
19823 | if (charCode === 0 && keyCode === 13) {
|
19824 | charCode = 13;
|
19825 | }
|
19826 | } else {
|
19827 |
|
19828 | charCode = keyCode;
|
19829 | }
|
19830 |
|
19831 |
|
19832 |
|
19833 | if (charCode >= 32 || charCode === 13) {
|
19834 | return charCode;
|
19835 | }
|
19836 |
|
19837 | return 0;
|
19838 | }
|
19839 |
|
19840 | module.exports = getEventCharCode;
|
19841 | },{}],140:[function(_dereq_,module,exports){
|
19842 |
|
19843 |
|
19844 |
|
19845 |
|
19846 |
|
19847 |
|
19848 |
|
19849 |
|
19850 |
|
19851 |
|
19852 |
|
19853 | 'use strict';
|
19854 |
|
19855 | var getEventCharCode = _dereq_(139);
|
19856 |
|
19857 |
|
19858 |
|
19859 |
|
19860 |
|
19861 | var normalizeKey = {
|
19862 | 'Esc': 'Escape',
|
19863 | 'Spacebar': ' ',
|
19864 | 'Left': 'ArrowLeft',
|
19865 | 'Up': 'ArrowUp',
|
19866 | 'Right': 'ArrowRight',
|
19867 | 'Down': 'ArrowDown',
|
19868 | 'Del': 'Delete',
|
19869 | 'Win': 'OS',
|
19870 | 'Menu': 'ContextMenu',
|
19871 | 'Apps': 'ContextMenu',
|
19872 | 'Scroll': 'ScrollLock',
|
19873 | 'MozPrintableKey': 'Unidentified'
|
19874 | };
|
19875 |
|
19876 |
|
19877 |
|
19878 |
|
19879 |
|
19880 |
|
19881 | var translateToKey = {
|
19882 | 8: 'Backspace',
|
19883 | 9: 'Tab',
|
19884 | 12: 'Clear',
|
19885 | 13: 'Enter',
|
19886 | 16: 'Shift',
|
19887 | 17: 'Control',
|
19888 | 18: 'Alt',
|
19889 | 19: 'Pause',
|
19890 | 20: 'CapsLock',
|
19891 | 27: 'Escape',
|
19892 | 32: ' ',
|
19893 | 33: 'PageUp',
|
19894 | 34: 'PageDown',
|
19895 | 35: 'End',
|
19896 | 36: 'Home',
|
19897 | 37: 'ArrowLeft',
|
19898 | 38: 'ArrowUp',
|
19899 | 39: 'ArrowRight',
|
19900 | 40: 'ArrowDown',
|
19901 | 45: 'Insert',
|
19902 | 46: 'Delete',
|
19903 | 112: 'F1', 113: 'F2', 114: 'F3', 115: 'F4', 116: 'F5', 117: 'F6',
|
19904 | 118: 'F7', 119: 'F8', 120: 'F9', 121: 'F10', 122: 'F11', 123: 'F12',
|
19905 | 144: 'NumLock',
|
19906 | 145: 'ScrollLock',
|
19907 | 224: 'Meta'
|
19908 | };
|
19909 |
|
19910 |
|
19911 |
|
19912 |
|
19913 |
|
19914 | function getEventKey(nativeEvent) {
|
19915 | if (nativeEvent.key) {
|
19916 |
|
19917 |
|
19918 |
|
19919 |
|
19920 |
|
19921 | var key = normalizeKey[nativeEvent.key] || nativeEvent.key;
|
19922 | if (key !== 'Unidentified') {
|
19923 | return key;
|
19924 | }
|
19925 | }
|
19926 |
|
19927 |
|
19928 | if (nativeEvent.type === 'keypress') {
|
19929 | var charCode = getEventCharCode(nativeEvent);
|
19930 |
|
19931 |
|
19932 |
|
19933 | return charCode === 13 ? 'Enter' : String.fromCharCode(charCode);
|
19934 | }
|
19935 | if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') {
|
19936 |
|
19937 |
|
19938 | return translateToKey[nativeEvent.keyCode] || 'Unidentified';
|
19939 | }
|
19940 | return '';
|
19941 | }
|
19942 |
|
19943 | module.exports = getEventKey;
|
19944 | },{"139":139}],141:[function(_dereq_,module,exports){
|
19945 |
|
19946 |
|
19947 |
|
19948 |
|
19949 |
|
19950 |
|
19951 |
|
19952 |
|
19953 |
|
19954 |
|
19955 |
|
19956 | 'use strict';
|
19957 |
|
19958 |
|
19959 |
|
19960 |
|
19961 |
|
19962 |
|
19963 | var modifierKeyToProp = {
|
19964 | 'Alt': 'altKey',
|
19965 | 'Control': 'ctrlKey',
|
19966 | 'Meta': 'metaKey',
|
19967 | 'Shift': 'shiftKey'
|
19968 | };
|
19969 |
|
19970 |
|
19971 |
|
19972 |
|
19973 | function modifierStateGetter(keyArg) {
|
19974 | var syntheticEvent = this;
|
19975 | var nativeEvent = syntheticEvent.nativeEvent;
|
19976 | if (nativeEvent.getModifierState) {
|
19977 | return nativeEvent.getModifierState(keyArg);
|
19978 | }
|
19979 | var keyProp = modifierKeyToProp[keyArg];
|
19980 | return keyProp ? !!nativeEvent[keyProp] : false;
|
19981 | }
|
19982 |
|
19983 | function getEventModifierState(nativeEvent) {
|
19984 | return modifierStateGetter;
|
19985 | }
|
19986 |
|
19987 | module.exports = getEventModifierState;
|
19988 | },{}],142:[function(_dereq_,module,exports){
|
19989 |
|
19990 |
|
19991 |
|
19992 |
|
19993 |
|
19994 |
|
19995 |
|
19996 |
|
19997 |
|
19998 |
|
19999 |
|
20000 | 'use strict';
|
20001 |
|
20002 |
|
20003 |
|
20004 |
|
20005 |
|
20006 |
|
20007 |
|
20008 |
|
20009 |
|
20010 | function getEventTarget(nativeEvent) {
|
20011 | var target = nativeEvent.target || nativeEvent.srcElement || window;
|
20012 |
|
20013 |
|
20014 | if (target.correspondingUseElement) {
|
20015 | target = target.correspondingUseElement;
|
20016 | }
|
20017 |
|
20018 |
|
20019 |
|
20020 | return target.nodeType === 3 ? target.parentNode : target;
|
20021 | }
|
20022 |
|
20023 | module.exports = getEventTarget;
|
20024 | },{}],143:[function(_dereq_,module,exports){
|
20025 |
|
20026 |
|
20027 |
|
20028 |
|
20029 |
|
20030 |
|
20031 |
|
20032 |
|
20033 |
|
20034 |
|
20035 |
|
20036 | 'use strict';
|
20037 |
|
20038 | var ReactNodeTypes = _dereq_(85);
|
20039 |
|
20040 | function getHostComponentFromComposite(inst) {
|
20041 | var type;
|
20042 |
|
20043 | while ((type = inst._renderedNodeType) === ReactNodeTypes.COMPOSITE) {
|
20044 | inst = inst._renderedComponent;
|
20045 | }
|
20046 |
|
20047 | if (type === ReactNodeTypes.HOST) {
|
20048 | return inst._renderedComponent;
|
20049 | } else if (type === ReactNodeTypes.EMPTY) {
|
20050 | return null;
|
20051 | }
|
20052 | }
|
20053 |
|
20054 | module.exports = getHostComponentFromComposite;
|
20055 | },{"85":85}],144:[function(_dereq_,module,exports){
|
20056 |
|
20057 |
|
20058 |
|
20059 |
|
20060 |
|
20061 |
|
20062 |
|
20063 |
|
20064 |
|
20065 |
|
20066 |
|
20067 |
|
20068 | 'use strict';
|
20069 |
|
20070 |
|
20071 |
|
20072 | var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
20073 | var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
20074 |
|
20075 |
|
20076 |
|
20077 |
|
20078 |
|
20079 |
|
20080 |
|
20081 |
|
20082 |
|
20083 |
|
20084 |
|
20085 |
|
20086 |
|
20087 |
|
20088 |
|
20089 | function getIteratorFn(maybeIterable) {
|
20090 | var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
20091 | if (typeof iteratorFn === 'function') {
|
20092 | return iteratorFn;
|
20093 | }
|
20094 | }
|
20095 |
|
20096 | module.exports = getIteratorFn;
|
20097 | },{}],145:[function(_dereq_,module,exports){
|
20098 |
|
20099 |
|
20100 |
|
20101 |
|
20102 |
|
20103 |
|
20104 |
|
20105 |
|
20106 |
|
20107 |
|
20108 |
|
20109 | 'use strict';
|
20110 |
|
20111 |
|
20112 |
|
20113 |
|
20114 |
|
20115 |
|
20116 |
|
20117 |
|
20118 | function getLeafNode(node) {
|
20119 | while (node && node.firstChild) {
|
20120 | node = node.firstChild;
|
20121 | }
|
20122 | return node;
|
20123 | }
|
20124 |
|
20125 |
|
20126 |
|
20127 |
|
20128 |
|
20129 |
|
20130 |
|
20131 |
|
20132 | function getSiblingNode(node) {
|
20133 | while (node) {
|
20134 | if (node.nextSibling) {
|
20135 | return node.nextSibling;
|
20136 | }
|
20137 | node = node.parentNode;
|
20138 | }
|
20139 | }
|
20140 |
|
20141 |
|
20142 |
|
20143 |
|
20144 |
|
20145 |
|
20146 |
|
20147 |
|
20148 | function getNodeForCharacterOffset(root, offset) {
|
20149 | var node = getLeafNode(root);
|
20150 | var nodeStart = 0;
|
20151 | var nodeEnd = 0;
|
20152 |
|
20153 | while (node) {
|
20154 | if (node.nodeType === 3) {
|
20155 | nodeEnd = nodeStart + node.textContent.length;
|
20156 |
|
20157 | if (nodeStart <= offset && nodeEnd >= offset) {
|
20158 | return {
|
20159 | node: node,
|
20160 | offset: offset - nodeStart
|
20161 | };
|
20162 | }
|
20163 |
|
20164 | nodeStart = nodeEnd;
|
20165 | }
|
20166 |
|
20167 | node = getLeafNode(getSiblingNode(node));
|
20168 | }
|
20169 | }
|
20170 |
|
20171 | module.exports = getNodeForCharacterOffset;
|
20172 | },{}],146:[function(_dereq_,module,exports){
|
20173 |
|
20174 |
|
20175 |
|
20176 |
|
20177 |
|
20178 |
|
20179 |
|
20180 |
|
20181 |
|
20182 |
|
20183 |
|
20184 | 'use strict';
|
20185 |
|
20186 | var ExecutionEnvironment = _dereq_(164);
|
20187 |
|
20188 | var contentKey = null;
|
20189 |
|
20190 |
|
20191 |
|
20192 |
|
20193 |
|
20194 |
|
20195 |
|
20196 | function getTextContentAccessor() {
|
20197 | if (!contentKey && ExecutionEnvironment.canUseDOM) {
|
20198 |
|
20199 |
|
20200 | contentKey = 'textContent' in document.documentElement ? 'textContent' : 'innerText';
|
20201 | }
|
20202 | return contentKey;
|
20203 | }
|
20204 |
|
20205 | module.exports = getTextContentAccessor;
|
20206 | },{"164":164}],147:[function(_dereq_,module,exports){
|
20207 |
|
20208 |
|
20209 |
|
20210 |
|
20211 |
|
20212 |
|
20213 |
|
20214 |
|
20215 |
|
20216 |
|
20217 |
|
20218 | 'use strict';
|
20219 |
|
20220 | var ExecutionEnvironment = _dereq_(164);
|
20221 |
|
20222 |
|
20223 |
|
20224 |
|
20225 |
|
20226 |
|
20227 |
|
20228 |
|
20229 | function makePrefixMap(styleProp, eventName) {
|
20230 | var prefixes = {};
|
20231 |
|
20232 | prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();
|
20233 | prefixes['Webkit' + styleProp] = 'webkit' + eventName;
|
20234 | prefixes['Moz' + styleProp] = 'moz' + eventName;
|
20235 | prefixes['ms' + styleProp] = 'MS' + eventName;
|
20236 | prefixes['O' + styleProp] = 'o' + eventName.toLowerCase();
|
20237 |
|
20238 | return prefixes;
|
20239 | }
|
20240 |
|
20241 |
|
20242 |
|
20243 |
|
20244 | var vendorPrefixes = {
|
20245 | animationend: makePrefixMap('Animation', 'AnimationEnd'),
|
20246 | animationiteration: makePrefixMap('Animation', 'AnimationIteration'),
|
20247 | animationstart: makePrefixMap('Animation', 'AnimationStart'),
|
20248 | transitionend: makePrefixMap('Transition', 'TransitionEnd')
|
20249 | };
|
20250 |
|
20251 |
|
20252 |
|
20253 |
|
20254 | var prefixedEventNames = {};
|
20255 |
|
20256 |
|
20257 |
|
20258 |
|
20259 | var style = {};
|
20260 |
|
20261 |
|
20262 |
|
20263 |
|
20264 | if (ExecutionEnvironment.canUseDOM) {
|
20265 | style = document.createElement('div').style;
|
20266 |
|
20267 |
|
20268 |
|
20269 |
|
20270 |
|
20271 | if (!('AnimationEvent' in window)) {
|
20272 | delete vendorPrefixes.animationend.animation;
|
20273 | delete vendorPrefixes.animationiteration.animation;
|
20274 | delete vendorPrefixes.animationstart.animation;
|
20275 | }
|
20276 |
|
20277 |
|
20278 | if (!('TransitionEvent' in window)) {
|
20279 | delete vendorPrefixes.transitionend.transition;
|
20280 | }
|
20281 | }
|
20282 |
|
20283 |
|
20284 |
|
20285 |
|
20286 |
|
20287 |
|
20288 |
|
20289 | function getVendorPrefixedEventName(eventName) {
|
20290 | if (prefixedEventNames[eventName]) {
|
20291 | return prefixedEventNames[eventName];
|
20292 | } else if (!vendorPrefixes[eventName]) {
|
20293 | return eventName;
|
20294 | }
|
20295 |
|
20296 | var prefixMap = vendorPrefixes[eventName];
|
20297 |
|
20298 | for (var styleProp in prefixMap) {
|
20299 | if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) {
|
20300 | return prefixedEventNames[eventName] = prefixMap[styleProp];
|
20301 | }
|
20302 | }
|
20303 |
|
20304 | return '';
|
20305 | }
|
20306 |
|
20307 | module.exports = getVendorPrefixedEventName;
|
20308 | },{"164":164}],148:[function(_dereq_,module,exports){
|
20309 |
|
20310 |
|
20311 |
|
20312 |
|
20313 |
|
20314 |
|
20315 |
|
20316 |
|
20317 |
|
20318 |
|
20319 |
|
20320 | 'use strict';
|
20321 |
|
20322 | var _prodInvariant = _dereq_(153),
|
20323 | _assign = _dereq_(188);
|
20324 |
|
20325 | var ReactCompositeComponent = _dereq_(40);
|
20326 | var ReactEmptyComponent = _dereq_(67);
|
20327 | var ReactHostComponent = _dereq_(73);
|
20328 |
|
20329 | var invariant = _dereq_(178);
|
20330 | var warning = _dereq_(187);
|
20331 |
|
20332 |
|
20333 | var ReactCompositeComponentWrapper = function (element) {
|
20334 | this.construct(element);
|
20335 | };
|
20336 | _assign(ReactCompositeComponentWrapper.prototype, ReactCompositeComponent.Mixin, {
|
20337 | _instantiateReactComponent: instantiateReactComponent
|
20338 | });
|
20339 |
|
20340 | function getDeclarationErrorAddendum(owner) {
|
20341 | if (owner) {
|
20342 | var name = owner.getName();
|
20343 | if (name) {
|
20344 | return ' Check the render method of `' + name + '`.';
|
20345 | }
|
20346 | }
|
20347 | return '';
|
20348 | }
|
20349 |
|
20350 |
|
20351 |
|
20352 |
|
20353 |
|
20354 |
|
20355 |
|
20356 |
|
20357 | function isInternalComponentType(type) {
|
20358 | return typeof type === 'function' && typeof type.prototype !== 'undefined' && typeof type.prototype.mountComponent === 'function' && typeof type.prototype.receiveComponent === 'function';
|
20359 | }
|
20360 |
|
20361 | var nextDebugID = 1;
|
20362 |
|
20363 |
|
20364 |
|
20365 |
|
20366 |
|
20367 |
|
20368 |
|
20369 |
|
20370 |
|
20371 | function instantiateReactComponent(node, shouldHaveDebugID) {
|
20372 | var instance;
|
20373 |
|
20374 | if (node === null || node === false) {
|
20375 | instance = ReactEmptyComponent.create(instantiateReactComponent);
|
20376 | } else if (typeof node === 'object') {
|
20377 | var element = node;
|
20378 | !(element && (typeof element.type === 'function' || typeof element.type === 'string')) ? "development" !== 'production' ? invariant(false, 'Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s', element.type == null ? element.type : typeof element.type, getDeclarationErrorAddendum(element._owner)) : _prodInvariant('130', element.type == null ? element.type : typeof element.type, getDeclarationErrorAddendum(element._owner)) : void 0;
|
20379 |
|
20380 |
|
20381 | if (typeof element.type === 'string') {
|
20382 | instance = ReactHostComponent.createInternalComponent(element);
|
20383 | } else if (isInternalComponentType(element.type)) {
|
20384 |
|
20385 |
|
20386 |
|
20387 | instance = new element.type(element);
|
20388 |
|
20389 |
|
20390 | if (!instance.getHostNode) {
|
20391 | instance.getHostNode = instance.getNativeNode;
|
20392 | }
|
20393 | } else {
|
20394 | instance = new ReactCompositeComponentWrapper(element);
|
20395 | }
|
20396 | } else if (typeof node === 'string' || typeof node === 'number') {
|
20397 | instance = ReactHostComponent.createInstanceForText(node);
|
20398 | } else {
|
20399 | !false ? "development" !== 'production' ? invariant(false, 'Encountered invalid React node of type %s', typeof node) : _prodInvariant('131', typeof node) : void 0;
|
20400 | }
|
20401 |
|
20402 | if ("development" !== 'production') {
|
20403 | "development" !== 'production' ? warning(typeof instance.mountComponent === 'function' && typeof instance.receiveComponent === 'function' && typeof instance.getHostNode === 'function' && typeof instance.unmountComponent === 'function', 'Only React Components can be mounted.') : void 0;
|
20404 | }
|
20405 |
|
20406 |
|
20407 |
|
20408 |
|
20409 | instance._mountIndex = 0;
|
20410 | instance._mountImage = null;
|
20411 |
|
20412 | if ("development" !== 'production') {
|
20413 | instance._debugID = shouldHaveDebugID ? nextDebugID++ : 0;
|
20414 | }
|
20415 |
|
20416 |
|
20417 |
|
20418 | if ("development" !== 'production') {
|
20419 | if (Object.preventExtensions) {
|
20420 | Object.preventExtensions(instance);
|
20421 | }
|
20422 | }
|
20423 |
|
20424 | return instance;
|
20425 | }
|
20426 |
|
20427 | module.exports = instantiateReactComponent;
|
20428 | },{"153":153,"178":178,"187":187,"188":188,"40":40,"67":67,"73":73}],149:[function(_dereq_,module,exports){
|
20429 |
|
20430 |
|
20431 |
|
20432 |
|
20433 |
|
20434 |
|
20435 |
|
20436 |
|
20437 |
|
20438 |
|
20439 |
|
20440 | 'use strict';
|
20441 |
|
20442 | var ExecutionEnvironment = _dereq_(164);
|
20443 |
|
20444 | var useHasFeature;
|
20445 | if (ExecutionEnvironment.canUseDOM) {
|
20446 | useHasFeature = document.implementation && document.implementation.hasFeature &&
|
20447 |
|
20448 |
|
20449 | document.implementation.hasFeature('', '') !== true;
|
20450 | }
|
20451 |
|
20452 |
|
20453 |
|
20454 |
|
20455 |
|
20456 |
|
20457 |
|
20458 |
|
20459 |
|
20460 |
|
20461 |
|
20462 |
|
20463 |
|
20464 |
|
20465 |
|
20466 | function isEventSupported(eventNameSuffix, capture) {
|
20467 | if (!ExecutionEnvironment.canUseDOM || capture && !('addEventListener' in document)) {
|
20468 | return false;
|
20469 | }
|
20470 |
|
20471 | var eventName = 'on' + eventNameSuffix;
|
20472 | var isSupported = eventName in document;
|
20473 |
|
20474 | if (!isSupported) {
|
20475 | var element = document.createElement('div');
|
20476 | element.setAttribute(eventName, 'return;');
|
20477 | isSupported = typeof element[eventName] === 'function';
|
20478 | }
|
20479 |
|
20480 | if (!isSupported && useHasFeature && eventNameSuffix === 'wheel') {
|
20481 |
|
20482 | isSupported = document.implementation.hasFeature('Events.wheel', '3.0');
|
20483 | }
|
20484 |
|
20485 | return isSupported;
|
20486 | }
|
20487 |
|
20488 | module.exports = isEventSupported;
|
20489 | },{"164":164}],150:[function(_dereq_,module,exports){
|
20490 |
|
20491 |
|
20492 |
|
20493 |
|
20494 |
|
20495 |
|
20496 |
|
20497 |
|
20498 |
|
20499 |
|
20500 |
|
20501 |
|
20502 | 'use strict';
|
20503 |
|
20504 |
|
20505 |
|
20506 |
|
20507 |
|
20508 | var supportedInputTypes = {
|
20509 | 'color': true,
|
20510 | 'date': true,
|
20511 | 'datetime': true,
|
20512 | 'datetime-local': true,
|
20513 | 'email': true,
|
20514 | 'month': true,
|
20515 | 'number': true,
|
20516 | 'password': true,
|
20517 | 'range': true,
|
20518 | 'search': true,
|
20519 | 'tel': true,
|
20520 | 'text': true,
|
20521 | 'time': true,
|
20522 | 'url': true,
|
20523 | 'week': true
|
20524 | };
|
20525 |
|
20526 | function isTextInputElement(elem) {
|
20527 | var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
|
20528 |
|
20529 | if (nodeName === 'input') {
|
20530 | return !!supportedInputTypes[elem.type];
|
20531 | }
|
20532 |
|
20533 | if (nodeName === 'textarea') {
|
20534 | return true;
|
20535 | }
|
20536 |
|
20537 | return false;
|
20538 | }
|
20539 |
|
20540 | module.exports = isTextInputElement;
|
20541 | },{}],151:[function(_dereq_,module,exports){
|
20542 |
|
20543 |
|
20544 |
|
20545 |
|
20546 |
|
20547 |
|
20548 |
|
20549 |
|
20550 |
|
20551 |
|
20552 | 'use strict';
|
20553 |
|
20554 | var _prodInvariant = _dereq_(153);
|
20555 |
|
20556 | var ReactElement = _dereq_(65);
|
20557 |
|
20558 | var invariant = _dereq_(178);
|
20559 |
|
20560 |
|
20561 |
|
20562 |
|
20563 |
|
20564 |
|
20565 |
|
20566 |
|
20567 |
|
20568 |
|
20569 |
|
20570 |
|
20571 |
|
20572 |
|
20573 |
|
20574 | function onlyChild(children) {
|
20575 | !ReactElement.isValidElement(children) ? "development" !== 'production' ? invariant(false, 'React.Children.only expected to receive a single React element child.') : _prodInvariant('143') : void 0;
|
20576 | return children;
|
20577 | }
|
20578 |
|
20579 | module.exports = onlyChild;
|
20580 | },{"153":153,"178":178,"65":65}],152:[function(_dereq_,module,exports){
|
20581 |
|
20582 |
|
20583 |
|
20584 |
|
20585 |
|
20586 |
|
20587 |
|
20588 |
|
20589 |
|
20590 |
|
20591 |
|
20592 | 'use strict';
|
20593 |
|
20594 | var escapeTextContentForBrowser = _dereq_(135);
|
20595 |
|
20596 |
|
20597 |
|
20598 |
|
20599 |
|
20600 |
|
20601 |
|
20602 | function quoteAttributeValueForBrowser(value) {
|
20603 | return '"' + escapeTextContentForBrowser(value) + '"';
|
20604 | }
|
20605 |
|
20606 | module.exports = quoteAttributeValueForBrowser;
|
20607 | },{"135":135}],153:[function(_dereq_,module,exports){
|
20608 |
|
20609 |
|
20610 |
|
20611 |
|
20612 |
|
20613 |
|
20614 |
|
20615 |
|
20616 |
|
20617 |
|
20618 |
|
20619 | 'use strict';
|
20620 |
|
20621 |
|
20622 |
|
20623 |
|
20624 |
|
20625 |
|
20626 |
|
20627 |
|
20628 | function reactProdInvariant(code) {
|
20629 | var argCount = arguments.length - 1;
|
20630 |
|
20631 | var message = 'Minified React error #' + code + '; visit ' + 'http://facebook.github.io/react/docs/error-decoder.html?invariant=' + code;
|
20632 |
|
20633 | for (var argIdx = 0; argIdx < argCount; argIdx++) {
|
20634 | message += '&args[]=' + encodeURIComponent(arguments[argIdx + 1]);
|
20635 | }
|
20636 |
|
20637 | message += ' for the full message or use the non-minified dev environment' + ' for full errors and additional helpful warnings.';
|
20638 |
|
20639 | var error = new Error(message);
|
20640 | error.name = 'Invariant Violation';
|
20641 | error.framesToPop = 1;
|
20642 |
|
20643 | throw error;
|
20644 | }
|
20645 |
|
20646 | module.exports = reactProdInvariant;
|
20647 | },{}],154:[function(_dereq_,module,exports){
|
20648 |
|
20649 |
|
20650 |
|
20651 |
|
20652 |
|
20653 |
|
20654 |
|
20655 |
|
20656 |
|
20657 |
|
20658 |
|
20659 | 'use strict';
|
20660 |
|
20661 | var ReactMount = _dereq_(82);
|
20662 |
|
20663 | module.exports = ReactMount.renderSubtreeIntoContainer;
|
20664 | },{"82":82}],155:[function(_dereq_,module,exports){
|
20665 |
|
20666 |
|
20667 |
|
20668 |
|
20669 |
|
20670 |
|
20671 |
|
20672 |
|
20673 |
|
20674 |
|
20675 |
|
20676 | 'use strict';
|
20677 |
|
20678 | var ExecutionEnvironment = _dereq_(164);
|
20679 | var DOMNamespaces = _dereq_(9);
|
20680 |
|
20681 | var WHITESPACE_TEST = /^[ \r\n\t\f]/;
|
20682 | var NONVISIBLE_TEST = /<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/;
|
20683 |
|
20684 | var createMicrosoftUnsafeLocalFunction = _dereq_(133);
|
20685 |
|
20686 |
|
20687 | var reusableSVGContainer;
|
20688 |
|
20689 |
|
20690 |
|
20691 |
|
20692 |
|
20693 |
|
20694 |
|
20695 |
|
20696 |
|
20697 | var setInnerHTML = createMicrosoftUnsafeLocalFunction(function (node, html) {
|
20698 |
|
20699 |
|
20700 |
|
20701 | if (node.namespaceURI === DOMNamespaces.svg && !('innerHTML' in node)) {
|
20702 | reusableSVGContainer = reusableSVGContainer || document.createElement('div');
|
20703 | reusableSVGContainer.innerHTML = '<svg>' + html + '</svg>';
|
20704 | var svgNode = reusableSVGContainer.firstChild;
|
20705 | while (svgNode.firstChild) {
|
20706 | node.appendChild(svgNode.firstChild);
|
20707 | }
|
20708 | } else {
|
20709 | node.innerHTML = html;
|
20710 | }
|
20711 | });
|
20712 |
|
20713 | if (ExecutionEnvironment.canUseDOM) {
|
20714 |
|
20715 |
|
20716 |
|
20717 |
|
20718 |
|
20719 |
|
20720 | var testElement = document.createElement('div');
|
20721 | testElement.innerHTML = ' ';
|
20722 | if (testElement.innerHTML === '') {
|
20723 | setInnerHTML = function (node, html) {
|
20724 |
|
20725 |
|
20726 |
|
20727 |
|
20728 |
|
20729 | if (node.parentNode) {
|
20730 | node.parentNode.replaceChild(node, node);
|
20731 | }
|
20732 |
|
20733 |
|
20734 |
|
20735 |
|
20736 |
|
20737 | if (WHITESPACE_TEST.test(html) || html[0] === '<' && NONVISIBLE_TEST.test(html)) {
|
20738 |
|
20739 |
|
20740 |
|
20741 |
|
20742 |
|
20743 |
|
20744 | node.innerHTML = String.fromCharCode(0xFEFF) + html;
|
20745 |
|
20746 |
|
20747 |
|
20748 | var textNode = node.firstChild;
|
20749 | if (textNode.data.length === 1) {
|
20750 | node.removeChild(textNode);
|
20751 | } else {
|
20752 | textNode.deleteData(0, 1);
|
20753 | }
|
20754 | } else {
|
20755 | node.innerHTML = html;
|
20756 | }
|
20757 | };
|
20758 | }
|
20759 | testElement = null;
|
20760 | }
|
20761 |
|
20762 | module.exports = setInnerHTML;
|
20763 | },{"133":133,"164":164,"9":9}],156:[function(_dereq_,module,exports){
|
20764 |
|
20765 |
|
20766 |
|
20767 |
|
20768 |
|
20769 |
|
20770 |
|
20771 |
|
20772 |
|
20773 |
|
20774 |
|
20775 | 'use strict';
|
20776 |
|
20777 | var ExecutionEnvironment = _dereq_(164);
|
20778 | var escapeTextContentForBrowser = _dereq_(135);
|
20779 | var setInnerHTML = _dereq_(155);
|
20780 |
|
20781 |
|
20782 |
|
20783 |
|
20784 |
|
20785 |
|
20786 |
|
20787 |
|
20788 |
|
20789 |
|
20790 |
|
20791 | var setTextContent = function (node, text) {
|
20792 | if (text) {
|
20793 | var firstChild = node.firstChild;
|
20794 |
|
20795 | if (firstChild && firstChild === node.lastChild && firstChild.nodeType === 3) {
|
20796 | firstChild.nodeValue = text;
|
20797 | return;
|
20798 | }
|
20799 | }
|
20800 | node.textContent = text;
|
20801 | };
|
20802 |
|
20803 | if (ExecutionEnvironment.canUseDOM) {
|
20804 | if (!('textContent' in document.documentElement)) {
|
20805 | setTextContent = function (node, text) {
|
20806 | setInnerHTML(node, escapeTextContentForBrowser(text));
|
20807 | };
|
20808 | }
|
20809 | }
|
20810 |
|
20811 | module.exports = setTextContent;
|
20812 | },{"135":135,"155":155,"164":164}],157:[function(_dereq_,module,exports){
|
20813 |
|
20814 |
|
20815 |
|
20816 |
|
20817 |
|
20818 |
|
20819 |
|
20820 |
|
20821 |
|
20822 |
|
20823 |
|
20824 | 'use strict';
|
20825 |
|
20826 | var shallowEqual = _dereq_(186);
|
20827 |
|
20828 |
|
20829 |
|
20830 |
|
20831 |
|
20832 |
|
20833 | function shallowCompare(instance, nextProps, nextState) {
|
20834 | return !shallowEqual(instance.props, nextProps) || !shallowEqual(instance.state, nextState);
|
20835 | }
|
20836 |
|
20837 | module.exports = shallowCompare;
|
20838 | },{"186":186}],158:[function(_dereq_,module,exports){
|
20839 |
|
20840 |
|
20841 |
|
20842 |
|
20843 |
|
20844 |
|
20845 |
|
20846 |
|
20847 |
|
20848 |
|
20849 |
|
20850 | 'use strict';
|
20851 |
|
20852 |
|
20853 |
|
20854 |
|
20855 |
|
20856 |
|
20857 |
|
20858 |
|
20859 |
|
20860 |
|
20861 |
|
20862 |
|
20863 |
|
20864 | function shouldUpdateReactComponent(prevElement, nextElement) {
|
20865 | var prevEmpty = prevElement === null || prevElement === false;
|
20866 | var nextEmpty = nextElement === null || nextElement === false;
|
20867 | if (prevEmpty || nextEmpty) {
|
20868 | return prevEmpty === nextEmpty;
|
20869 | }
|
20870 |
|
20871 | var prevType = typeof prevElement;
|
20872 | var nextType = typeof nextElement;
|
20873 | if (prevType === 'string' || prevType === 'number') {
|
20874 | return nextType === 'string' || nextType === 'number';
|
20875 | } else {
|
20876 | return nextType === 'object' && prevElement.type === nextElement.type && prevElement.key === nextElement.key;
|
20877 | }
|
20878 | }
|
20879 |
|
20880 | module.exports = shouldUpdateReactComponent;
|
20881 | },{}],159:[function(_dereq_,module,exports){
|
20882 |
|
20883 |
|
20884 |
|
20885 |
|
20886 |
|
20887 |
|
20888 |
|
20889 |
|
20890 |
|
20891 |
|
20892 |
|
20893 | 'use strict';
|
20894 |
|
20895 | var _prodInvariant = _dereq_(153);
|
20896 |
|
20897 | var ReactCurrentOwner = _dereq_(41);
|
20898 | var ReactElement = _dereq_(65);
|
20899 |
|
20900 | var getIteratorFn = _dereq_(144);
|
20901 | var invariant = _dereq_(178);
|
20902 | var KeyEscapeUtils = _dereq_(23);
|
20903 | var warning = _dereq_(187);
|
20904 |
|
20905 | var SEPARATOR = '.';
|
20906 | var SUBSEPARATOR = ':';
|
20907 |
|
20908 |
|
20909 |
|
20910 |
|
20911 |
|
20912 |
|
20913 | var didWarnAboutMaps = false;
|
20914 |
|
20915 |
|
20916 |
|
20917 |
|
20918 |
|
20919 |
|
20920 |
|
20921 |
|
20922 | function getComponentKey(component, index) {
|
20923 |
|
20924 |
|
20925 | if (component && typeof component === 'object' && component.key != null) {
|
20926 |
|
20927 | return KeyEscapeUtils.escape(component.key);
|
20928 | }
|
20929 |
|
20930 | return index.toString(36);
|
20931 | }
|
20932 |
|
20933 |
|
20934 |
|
20935 |
|
20936 |
|
20937 |
|
20938 |
|
20939 |
|
20940 |
|
20941 | function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
|
20942 | var type = typeof children;
|
20943 |
|
20944 | if (type === 'undefined' || type === 'boolean') {
|
20945 |
|
20946 | children = null;
|
20947 | }
|
20948 |
|
20949 | if (children === null || type === 'string' || type === 'number' || ReactElement.isValidElement(children)) {
|
20950 | callback(traverseContext, children,
|
20951 |
|
20952 |
|
20953 | nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
|
20954 | return 1;
|
20955 | }
|
20956 |
|
20957 | var child;
|
20958 | var nextName;
|
20959 | var subtreeCount = 0;
|
20960 | var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
|
20961 |
|
20962 | if (Array.isArray(children)) {
|
20963 | for (var i = 0; i < children.length; i++) {
|
20964 | child = children[i];
|
20965 | nextName = nextNamePrefix + getComponentKey(child, i);
|
20966 | subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
|
20967 | }
|
20968 | } else {
|
20969 | var iteratorFn = getIteratorFn(children);
|
20970 | if (iteratorFn) {
|
20971 | var iterator = iteratorFn.call(children);
|
20972 | var step;
|
20973 | if (iteratorFn !== children.entries) {
|
20974 | var ii = 0;
|
20975 | while (!(step = iterator.next()).done) {
|
20976 | child = step.value;
|
20977 | nextName = nextNamePrefix + getComponentKey(child, ii++);
|
20978 | subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
|
20979 | }
|
20980 | } else {
|
20981 | if ("development" !== 'production') {
|
20982 | var mapsAsChildrenAddendum = '';
|
20983 | if (ReactCurrentOwner.current) {
|
20984 | var mapsAsChildrenOwnerName = ReactCurrentOwner.current.getName();
|
20985 | if (mapsAsChildrenOwnerName) {
|
20986 | mapsAsChildrenAddendum = ' Check the render method of `' + mapsAsChildrenOwnerName + '`.';
|
20987 | }
|
20988 | }
|
20989 | "development" !== 'production' ? warning(didWarnAboutMaps, 'Using Maps as children is not yet fully supported. It is an ' + 'experimental feature that might be removed. Convert it to a ' + 'sequence / iterable of keyed ReactElements instead.%s', mapsAsChildrenAddendum) : void 0;
|
20990 | didWarnAboutMaps = true;
|
20991 | }
|
20992 |
|
20993 | while (!(step = iterator.next()).done) {
|
20994 | var entry = step.value;
|
20995 | if (entry) {
|
20996 | child = entry[1];
|
20997 | nextName = nextNamePrefix + KeyEscapeUtils.escape(entry[0]) + SUBSEPARATOR + getComponentKey(child, 0);
|
20998 | subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
|
20999 | }
|
21000 | }
|
21001 | }
|
21002 | } else if (type === 'object') {
|
21003 | var addendum = '';
|
21004 | if ("development" !== 'production') {
|
21005 | 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.';
|
21006 | if (children._isReactElement) {
|
21007 | 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.';
|
21008 | }
|
21009 | if (ReactCurrentOwner.current) {
|
21010 | var name = ReactCurrentOwner.current.getName();
|
21011 | if (name) {
|
21012 | addendum += ' Check the render method of `' + name + '`.';
|
21013 | }
|
21014 | }
|
21015 | }
|
21016 | var childrenString = String(children);
|
21017 | !false ? "development" !== 'production' ? invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : _prodInvariant('31', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : void 0;
|
21018 | }
|
21019 | }
|
21020 |
|
21021 | return subtreeCount;
|
21022 | }
|
21023 |
|
21024 |
|
21025 |
|
21026 |
|
21027 |
|
21028 |
|
21029 |
|
21030 |
|
21031 |
|
21032 |
|
21033 |
|
21034 |
|
21035 |
|
21036 |
|
21037 |
|
21038 |
|
21039 |
|
21040 | function traverseAllChildren(children, callback, traverseContext) {
|
21041 | if (children == null) {
|
21042 | return 0;
|
21043 | }
|
21044 |
|
21045 | return traverseAllChildrenImpl(children, '', callback, traverseContext);
|
21046 | }
|
21047 |
|
21048 | module.exports = traverseAllChildren;
|
21049 | },{"144":144,"153":153,"178":178,"187":187,"23":23,"41":41,"65":65}],160:[function(_dereq_,module,exports){
|
21050 |
|
21051 |
|
21052 |
|
21053 |
|
21054 |
|
21055 |
|
21056 |
|
21057 |
|
21058 |
|
21059 |
|
21060 |
|
21061 |
|
21062 |
|
21063 | 'use strict';
|
21064 |
|
21065 | var _prodInvariant = _dereq_(153),
|
21066 | _assign = _dereq_(188);
|
21067 |
|
21068 | var keyOf = _dereq_(182);
|
21069 | var invariant = _dereq_(178);
|
21070 | var hasOwnProperty = {}.hasOwnProperty;
|
21071 |
|
21072 | function shallowCopy(x) {
|
21073 | if (Array.isArray(x)) {
|
21074 | return x.concat();
|
21075 | } else if (x && typeof x === 'object') {
|
21076 | return _assign(new x.constructor(), x);
|
21077 | } else {
|
21078 | return x;
|
21079 | }
|
21080 | }
|
21081 |
|
21082 | var COMMAND_PUSH = keyOf({ $push: null });
|
21083 | var COMMAND_UNSHIFT = keyOf({ $unshift: null });
|
21084 | var COMMAND_SPLICE = keyOf({ $splice: null });
|
21085 | var COMMAND_SET = keyOf({ $set: null });
|
21086 | var COMMAND_MERGE = keyOf({ $merge: null });
|
21087 | var COMMAND_APPLY = keyOf({ $apply: null });
|
21088 |
|
21089 | var ALL_COMMANDS_LIST = [COMMAND_PUSH, COMMAND_UNSHIFT, COMMAND_SPLICE, COMMAND_SET, COMMAND_MERGE, COMMAND_APPLY];
|
21090 |
|
21091 | var ALL_COMMANDS_SET = {};
|
21092 |
|
21093 | ALL_COMMANDS_LIST.forEach(function (command) {
|
21094 | ALL_COMMANDS_SET[command] = true;
|
21095 | });
|
21096 |
|
21097 | function invariantArrayCase(value, spec, command) {
|
21098 | !Array.isArray(value) ? "development" !== 'production' ? invariant(false, 'update(): expected target of %s to be an array; got %s.', command, value) : _prodInvariant('1', command, value) : void 0;
|
21099 | var specValue = spec[command];
|
21100 | !Array.isArray(specValue) ? "development" !== 'production' ? invariant(false, 'update(): expected spec of %s to be an array; got %s. Did you forget to wrap your parameter in an array?', command, specValue) : _prodInvariant('2', command, specValue) : void 0;
|
21101 | }
|
21102 |
|
21103 |
|
21104 |
|
21105 |
|
21106 |
|
21107 | function update(value, spec) {
|
21108 | !(typeof spec === 'object') ? "development" !== 'production' ? invariant(false, 'update(): You provided a key path to update() that did not contain one of %s. Did you forget to include {%s: ...}?', ALL_COMMANDS_LIST.join(', '), COMMAND_SET) : _prodInvariant('3', ALL_COMMANDS_LIST.join(', '), COMMAND_SET) : void 0;
|
21109 |
|
21110 | if (hasOwnProperty.call(spec, COMMAND_SET)) {
|
21111 | !(Object.keys(spec).length === 1) ? "development" !== 'production' ? invariant(false, 'Cannot have more than one key in an object with %s', COMMAND_SET) : _prodInvariant('4', COMMAND_SET) : void 0;
|
21112 |
|
21113 | return spec[COMMAND_SET];
|
21114 | }
|
21115 |
|
21116 | var nextValue = shallowCopy(value);
|
21117 |
|
21118 | if (hasOwnProperty.call(spec, COMMAND_MERGE)) {
|
21119 | var mergeObj = spec[COMMAND_MERGE];
|
21120 | !(mergeObj && typeof mergeObj === 'object') ? "development" !== 'production' ? invariant(false, 'update(): %s expects a spec of type \'object\'; got %s', COMMAND_MERGE, mergeObj) : _prodInvariant('5', COMMAND_MERGE, mergeObj) : void 0;
|
21121 | !(nextValue && typeof nextValue === 'object') ? "development" !== 'production' ? invariant(false, 'update(): %s expects a target of type \'object\'; got %s', COMMAND_MERGE, nextValue) : _prodInvariant('6', COMMAND_MERGE, nextValue) : void 0;
|
21122 | _assign(nextValue, spec[COMMAND_MERGE]);
|
21123 | }
|
21124 |
|
21125 | if (hasOwnProperty.call(spec, COMMAND_PUSH)) {
|
21126 | invariantArrayCase(value, spec, COMMAND_PUSH);
|
21127 | spec[COMMAND_PUSH].forEach(function (item) {
|
21128 | nextValue.push(item);
|
21129 | });
|
21130 | }
|
21131 |
|
21132 | if (hasOwnProperty.call(spec, COMMAND_UNSHIFT)) {
|
21133 | invariantArrayCase(value, spec, COMMAND_UNSHIFT);
|
21134 | spec[COMMAND_UNSHIFT].forEach(function (item) {
|
21135 | nextValue.unshift(item);
|
21136 | });
|
21137 | }
|
21138 |
|
21139 | if (hasOwnProperty.call(spec, COMMAND_SPLICE)) {
|
21140 | !Array.isArray(value) ? "development" !== 'production' ? invariant(false, 'Expected %s target to be an array; got %s', COMMAND_SPLICE, value) : _prodInvariant('7', COMMAND_SPLICE, value) : void 0;
|
21141 | !Array.isArray(spec[COMMAND_SPLICE]) ? "development" !== 'production' ? invariant(false, 'update(): expected spec of %s to be an array of arrays; got %s. Did you forget to wrap your parameters in an array?', COMMAND_SPLICE, spec[COMMAND_SPLICE]) : _prodInvariant('8', COMMAND_SPLICE, spec[COMMAND_SPLICE]) : void 0;
|
21142 | spec[COMMAND_SPLICE].forEach(function (args) {
|
21143 | !Array.isArray(args) ? "development" !== 'production' ? invariant(false, 'update(): expected spec of %s to be an array of arrays; got %s. Did you forget to wrap your parameters in an array?', COMMAND_SPLICE, spec[COMMAND_SPLICE]) : _prodInvariant('8', COMMAND_SPLICE, spec[COMMAND_SPLICE]) : void 0;
|
21144 | nextValue.splice.apply(nextValue, args);
|
21145 | });
|
21146 | }
|
21147 |
|
21148 | if (hasOwnProperty.call(spec, COMMAND_APPLY)) {
|
21149 | !(typeof spec[COMMAND_APPLY] === 'function') ? "development" !== 'production' ? invariant(false, 'update(): expected spec of %s to be a function; got %s.', COMMAND_APPLY, spec[COMMAND_APPLY]) : _prodInvariant('9', COMMAND_APPLY, spec[COMMAND_APPLY]) : void 0;
|
21150 | nextValue = spec[COMMAND_APPLY](nextValue);
|
21151 | }
|
21152 |
|
21153 | for (var k in spec) {
|
21154 | if (!(ALL_COMMANDS_SET.hasOwnProperty(k) && ALL_COMMANDS_SET[k])) {
|
21155 | nextValue[k] = update(value[k], spec[k]);
|
21156 | }
|
21157 | }
|
21158 |
|
21159 | return nextValue;
|
21160 | }
|
21161 |
|
21162 | module.exports = update;
|
21163 | },{"153":153,"178":178,"182":182,"188":188}],161:[function(_dereq_,module,exports){
|
21164 |
|
21165 |
|
21166 |
|
21167 |
|
21168 |
|
21169 |
|
21170 |
|
21171 |
|
21172 |
|
21173 |
|
21174 |
|
21175 | 'use strict';
|
21176 |
|
21177 | var _assign = _dereq_(188);
|
21178 |
|
21179 | var emptyFunction = _dereq_(170);
|
21180 | var warning = _dereq_(187);
|
21181 |
|
21182 | var validateDOMNesting = emptyFunction;
|
21183 |
|
21184 | if ("development" !== 'production') {
|
21185 |
|
21186 |
|
21187 |
|
21188 |
|
21189 |
|
21190 |
|
21191 |
|
21192 |
|
21193 |
|
21194 |
|
21195 |
|
21196 |
|
21197 | var specialTags = ['address', 'applet', 'area', 'article', 'aside', 'base', 'basefont', 'bgsound', 'blockquote', 'body', 'br', 'button', 'caption', 'center', 'col', 'colgroup', 'dd', 'details', 'dir', 'div', 'dl', 'dt', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'iframe', 'img', 'input', 'isindex', 'li', 'link', 'listing', 'main', 'marquee', 'menu', 'menuitem', 'meta', 'nav', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'p', 'param', 'plaintext', 'pre', 'script', 'section', 'select', 'source', 'style', 'summary', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul', 'wbr', 'xmp'];
|
21198 |
|
21199 |
|
21200 | var inScopeTags = ['applet', 'caption', 'html', 'table', 'td', 'th', 'marquee', 'object', 'template',
|
21201 |
|
21202 |
|
21203 |
|
21204 |
|
21205 | 'foreignObject', 'desc', 'title'];
|
21206 |
|
21207 |
|
21208 | var buttonScopeTags = inScopeTags.concat(['button']);
|
21209 |
|
21210 |
|
21211 | var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt'];
|
21212 |
|
21213 | var emptyAncestorInfo = {
|
21214 | current: null,
|
21215 |
|
21216 | formTag: null,
|
21217 | aTagInScope: null,
|
21218 | buttonTagInScope: null,
|
21219 | nobrTagInScope: null,
|
21220 | pTagInButtonScope: null,
|
21221 |
|
21222 | listItemTagAutoclosing: null,
|
21223 | dlItemTagAutoclosing: null
|
21224 | };
|
21225 |
|
21226 | var updatedAncestorInfo = function (oldInfo, tag, instance) {
|
21227 | var ancestorInfo = _assign({}, oldInfo || emptyAncestorInfo);
|
21228 | var info = { tag: tag, instance: instance };
|
21229 |
|
21230 | if (inScopeTags.indexOf(tag) !== -1) {
|
21231 | ancestorInfo.aTagInScope = null;
|
21232 | ancestorInfo.buttonTagInScope = null;
|
21233 | ancestorInfo.nobrTagInScope = null;
|
21234 | }
|
21235 | if (buttonScopeTags.indexOf(tag) !== -1) {
|
21236 | ancestorInfo.pTagInButtonScope = null;
|
21237 | }
|
21238 |
|
21239 |
|
21240 |
|
21241 | if (specialTags.indexOf(tag) !== -1 && tag !== 'address' && tag !== 'div' && tag !== 'p') {
|
21242 | ancestorInfo.listItemTagAutoclosing = null;
|
21243 | ancestorInfo.dlItemTagAutoclosing = null;
|
21244 | }
|
21245 |
|
21246 | ancestorInfo.current = info;
|
21247 |
|
21248 | if (tag === 'form') {
|
21249 | ancestorInfo.formTag = info;
|
21250 | }
|
21251 | if (tag === 'a') {
|
21252 | ancestorInfo.aTagInScope = info;
|
21253 | }
|
21254 | if (tag === 'button') {
|
21255 | ancestorInfo.buttonTagInScope = info;
|
21256 | }
|
21257 | if (tag === 'nobr') {
|
21258 | ancestorInfo.nobrTagInScope = info;
|
21259 | }
|
21260 | if (tag === 'p') {
|
21261 | ancestorInfo.pTagInButtonScope = info;
|
21262 | }
|
21263 | if (tag === 'li') {
|
21264 | ancestorInfo.listItemTagAutoclosing = info;
|
21265 | }
|
21266 | if (tag === 'dd' || tag === 'dt') {
|
21267 | ancestorInfo.dlItemTagAutoclosing = info;
|
21268 | }
|
21269 |
|
21270 | return ancestorInfo;
|
21271 | };
|
21272 |
|
21273 | |
21274 |
|
21275 |
|
21276 | var isTagValidWithParent = function (tag, parentTag) {
|
21277 |
|
21278 | switch (parentTag) {
|
21279 |
|
21280 | case 'select':
|
21281 | return tag === 'option' || tag === 'optgroup' || tag === '#text';
|
21282 | case 'optgroup':
|
21283 | return tag === 'option' || tag === '#text';
|
21284 |
|
21285 |
|
21286 | case 'option':
|
21287 | return tag === '#text';
|
21288 |
|
21289 |
|
21290 |
|
21291 |
|
21292 |
|
21293 |
|
21294 |
|
21295 | case 'tr':
|
21296 | return tag === 'th' || tag === 'td' || tag === 'style' || tag === 'script' || tag === 'template';
|
21297 |
|
21298 |
|
21299 | case 'tbody':
|
21300 | case 'thead':
|
21301 | case 'tfoot':
|
21302 | return tag === 'tr' || tag === 'style' || tag === 'script' || tag === 'template';
|
21303 |
|
21304 |
|
21305 | case 'colgroup':
|
21306 | return tag === 'col' || tag === 'template';
|
21307 |
|
21308 |
|
21309 | case 'table':
|
21310 | return tag === 'caption' || tag === 'colgroup' || tag === 'tbody' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' || tag === 'template';
|
21311 |
|
21312 |
|
21313 | case 'head':
|
21314 | return tag === 'base' || tag === 'basefont' || tag === 'bgsound' || tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' || tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template';
|
21315 |
|
21316 |
|
21317 | case 'html':
|
21318 | return tag === 'head' || tag === 'body';
|
21319 | case '#document':
|
21320 | return tag === 'html';
|
21321 | }
|
21322 |
|
21323 |
|
21324 |
|
21325 |
|
21326 | switch (tag) {
|
21327 | case 'h1':
|
21328 | case 'h2':
|
21329 | case 'h3':
|
21330 | case 'h4':
|
21331 | case 'h5':
|
21332 | case 'h6':
|
21333 | return parentTag !== 'h1' && parentTag !== 'h2' && parentTag !== 'h3' && parentTag !== 'h4' && parentTag !== 'h5' && parentTag !== 'h6';
|
21334 |
|
21335 | case 'rp':
|
21336 | case 'rt':
|
21337 | return impliedEndTags.indexOf(parentTag) === -1;
|
21338 |
|
21339 | case 'body':
|
21340 | case 'caption':
|
21341 | case 'col':
|
21342 | case 'colgroup':
|
21343 | case 'frame':
|
21344 | case 'head':
|
21345 | case 'html':
|
21346 | case 'tbody':
|
21347 | case 'td':
|
21348 | case 'tfoot':
|
21349 | case 'th':
|
21350 | case 'thead':
|
21351 | case 'tr':
|
21352 |
|
21353 |
|
21354 |
|
21355 |
|
21356 | return parentTag == null;
|
21357 | }
|
21358 |
|
21359 | return true;
|
21360 | };
|
21361 |
|
21362 | |
21363 |
|
21364 |
|
21365 | var findInvalidAncestorForTag = function (tag, ancestorInfo) {
|
21366 | switch (tag) {
|
21367 | case 'address':
|
21368 | case 'article':
|
21369 | case 'aside':
|
21370 | case 'blockquote':
|
21371 | case 'center':
|
21372 | case 'details':
|
21373 | case 'dialog':
|
21374 | case 'dir':
|
21375 | case 'div':
|
21376 | case 'dl':
|
21377 | case 'fieldset':
|
21378 | case 'figcaption':
|
21379 | case 'figure':
|
21380 | case 'footer':
|
21381 | case 'header':
|
21382 | case 'hgroup':
|
21383 | case 'main':
|
21384 | case 'menu':
|
21385 | case 'nav':
|
21386 | case 'ol':
|
21387 | case 'p':
|
21388 | case 'section':
|
21389 | case 'summary':
|
21390 | case 'ul':
|
21391 |
|
21392 | case 'pre':
|
21393 | case 'listing':
|
21394 |
|
21395 | case 'table':
|
21396 |
|
21397 | case 'hr':
|
21398 |
|
21399 | case 'xmp':
|
21400 |
|
21401 | case 'h1':
|
21402 | case 'h2':
|
21403 | case 'h3':
|
21404 | case 'h4':
|
21405 | case 'h5':
|
21406 | case 'h6':
|
21407 | return ancestorInfo.pTagInButtonScope;
|
21408 |
|
21409 | case 'form':
|
21410 | return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;
|
21411 |
|
21412 | case 'li':
|
21413 | return ancestorInfo.listItemTagAutoclosing;
|
21414 |
|
21415 | case 'dd':
|
21416 | case 'dt':
|
21417 | return ancestorInfo.dlItemTagAutoclosing;
|
21418 |
|
21419 | case 'button':
|
21420 | return ancestorInfo.buttonTagInScope;
|
21421 |
|
21422 | case 'a':
|
21423 |
|
21424 |
|
21425 | return ancestorInfo.aTagInScope;
|
21426 |
|
21427 | case 'nobr':
|
21428 | return ancestorInfo.nobrTagInScope;
|
21429 | }
|
21430 |
|
21431 | return null;
|
21432 | };
|
21433 |
|
21434 | |
21435 |
|
21436 |
|
21437 |
|
21438 | var findOwnerStack = function (instance) {
|
21439 | if (!instance) {
|
21440 | return [];
|
21441 | }
|
21442 |
|
21443 | var stack = [];
|
21444 | do {
|
21445 | stack.push(instance);
|
21446 | } while (instance = instance._currentElement._owner);
|
21447 | stack.reverse();
|
21448 | return stack;
|
21449 | };
|
21450 |
|
21451 | var didWarn = {};
|
21452 |
|
21453 | validateDOMNesting = function (childTag, childText, childInstance, ancestorInfo) {
|
21454 | ancestorInfo = ancestorInfo || emptyAncestorInfo;
|
21455 | var parentInfo = ancestorInfo.current;
|
21456 | var parentTag = parentInfo && parentInfo.tag;
|
21457 |
|
21458 | if (childText != null) {
|
21459 | "development" !== 'production' ? warning(childTag == null, 'validateDOMNesting: when childText is passed, childTag should be null') : void 0;
|
21460 | childTag = '#text';
|
21461 | }
|
21462 |
|
21463 | var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;
|
21464 | var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);
|
21465 | var problematic = invalidParent || invalidAncestor;
|
21466 |
|
21467 | if (problematic) {
|
21468 | var ancestorTag = problematic.tag;
|
21469 | var ancestorInstance = problematic.instance;
|
21470 |
|
21471 | var childOwner = childInstance && childInstance._currentElement._owner;
|
21472 | var ancestorOwner = ancestorInstance && ancestorInstance._currentElement._owner;
|
21473 |
|
21474 | var childOwners = findOwnerStack(childOwner);
|
21475 | var ancestorOwners = findOwnerStack(ancestorOwner);
|
21476 |
|
21477 | var minStackLen = Math.min(childOwners.length, ancestorOwners.length);
|
21478 | var i;
|
21479 |
|
21480 | var deepestCommon = -1;
|
21481 | for (i = 0; i < minStackLen; i++) {
|
21482 | if (childOwners[i] === ancestorOwners[i]) {
|
21483 | deepestCommon = i;
|
21484 | } else {
|
21485 | break;
|
21486 | }
|
21487 | }
|
21488 |
|
21489 | var UNKNOWN = '(unknown)';
|
21490 | var childOwnerNames = childOwners.slice(deepestCommon + 1).map(function (inst) {
|
21491 | return inst.getName() || UNKNOWN;
|
21492 | });
|
21493 | var ancestorOwnerNames = ancestorOwners.slice(deepestCommon + 1).map(function (inst) {
|
21494 | return inst.getName() || UNKNOWN;
|
21495 | });
|
21496 | var ownerInfo = [].concat(
|
21497 |
|
21498 |
|
21499 | deepestCommon !== -1 ? childOwners[deepestCommon].getName() || UNKNOWN : [], ancestorOwnerNames, ancestorTag,
|
21500 |
|
21501 | invalidAncestor ? ['...'] : [], childOwnerNames, childTag).join(' > ');
|
21502 |
|
21503 | var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag + '|' + ownerInfo;
|
21504 | if (didWarn[warnKey]) {
|
21505 | return;
|
21506 | }
|
21507 | didWarn[warnKey] = true;
|
21508 |
|
21509 | var tagDisplayName = childTag;
|
21510 | var whitespaceInfo = '';
|
21511 | if (childTag === '#text') {
|
21512 | if (/\S/.test(childText)) {
|
21513 | tagDisplayName = 'Text nodes';
|
21514 | } else {
|
21515 | tagDisplayName = 'Whitespace text nodes';
|
21516 | whitespaceInfo = ' Make sure you don\'t have any extra whitespace between tags on ' + 'each line of your source code.';
|
21517 | }
|
21518 | } else {
|
21519 | tagDisplayName = '<' + childTag + '>';
|
21520 | }
|
21521 |
|
21522 | if (invalidParent) {
|
21523 | var info = '';
|
21524 | if (ancestorTag === 'table' && childTag === 'tr') {
|
21525 | info += ' Add a <tbody> to your code to match the DOM tree generated by ' + 'the browser.';
|
21526 | }
|
21527 | "development" !== 'production' ? warning(false, 'validateDOMNesting(...): %s cannot appear as a child of <%s>.%s ' + 'See %s.%s', tagDisplayName, ancestorTag, whitespaceInfo, ownerInfo, info) : void 0;
|
21528 | } else {
|
21529 | "development" !== 'production' ? warning(false, 'validateDOMNesting(...): %s cannot appear as a descendant of ' + '<%s>. See %s.', tagDisplayName, ancestorTag, ownerInfo) : void 0;
|
21530 | }
|
21531 | }
|
21532 | };
|
21533 |
|
21534 | validateDOMNesting.updatedAncestorInfo = updatedAncestorInfo;
|
21535 |
|
21536 |
|
21537 | validateDOMNesting.isTagValidInContext = function (tag, ancestorInfo) {
|
21538 | ancestorInfo = ancestorInfo || emptyAncestorInfo;
|
21539 | var parentInfo = ancestorInfo.current;
|
21540 | var parentTag = parentInfo && parentInfo.tag;
|
21541 | return isTagValidWithParent(tag, parentTag) && !findInvalidAncestorForTag(tag, ancestorInfo);
|
21542 | };
|
21543 | }
|
21544 |
|
21545 | module.exports = validateDOMNesting;
|
21546 | },{"170":170,"187":187,"188":188}],162:[function(_dereq_,module,exports){
|
21547 | 'use strict';
|
21548 |
|
21549 |
|
21550 |
|
21551 |
|
21552 |
|
21553 |
|
21554 |
|
21555 |
|
21556 |
|
21557 |
|
21558 |
|
21559 |
|
21560 | var invariant = _dereq_(178);
|
21561 |
|
21562 |
|
21563 |
|
21564 |
|
21565 |
|
21566 |
|
21567 |
|
21568 |
|
21569 |
|
21570 |
|
21571 | function matchesSelector_SLOW(element, selector) {
|
21572 | var root = element;
|
21573 | while (root.parentNode) {
|
21574 | root = root.parentNode;
|
21575 | }
|
21576 |
|
21577 | var all = root.querySelectorAll(selector);
|
21578 | return Array.prototype.indexOf.call(all, element) !== -1;
|
21579 | }
|
21580 |
|
21581 | var CSSCore = {
|
21582 |
|
21583 | |
21584 |
|
21585 |
|
21586 |
|
21587 |
|
21588 |
|
21589 |
|
21590 | addClass: function addClass(element, className) {
|
21591 | !!/\s/.test(className) ? "development" !== 'production' ? invariant(false, 'CSSCore.addClass takes only a single class name. "%s" contains ' + 'multiple classes.', className) : invariant(false) : void 0;
|
21592 |
|
21593 | if (className) {
|
21594 | if (element.classList) {
|
21595 | element.classList.add(className);
|
21596 | } else if (!CSSCore.hasClass(element, className)) {
|
21597 | element.className = element.className + ' ' + className;
|
21598 | }
|
21599 | }
|
21600 | return element;
|
21601 | },
|
21602 |
|
21603 | |
21604 |
|
21605 |
|
21606 |
|
21607 |
|
21608 |
|
21609 |
|
21610 | removeClass: function removeClass(element, className) {
|
21611 | !!/\s/.test(className) ? "development" !== 'production' ? invariant(false, 'CSSCore.removeClass takes only a single class name. "%s" contains ' + 'multiple classes.', className) : invariant(false) : void 0;
|
21612 |
|
21613 | if (className) {
|
21614 | if (element.classList) {
|
21615 | element.classList.remove(className);
|
21616 | } else if (CSSCore.hasClass(element, className)) {
|
21617 | element.className = element.className.replace(new RegExp('(^|\\s)' + className + '(?:\\s|$)', 'g'), '$1').replace(/\s+/g, ' ')
|
21618 | .replace(/^\s*|\s*$/g, '');
|
21619 | }
|
21620 | }
|
21621 | return element;
|
21622 | },
|
21623 |
|
21624 | |
21625 |
|
21626 |
|
21627 |
|
21628 |
|
21629 |
|
21630 |
|
21631 |
|
21632 | conditionClass: function conditionClass(element, className, bool) {
|
21633 | return (bool ? CSSCore.addClass : CSSCore.removeClass)(element, className);
|
21634 | },
|
21635 |
|
21636 | |
21637 |
|
21638 |
|
21639 |
|
21640 |
|
21641 |
|
21642 |
|
21643 | hasClass: function hasClass(element, className) {
|
21644 | !!/\s/.test(className) ? "development" !== 'production' ? invariant(false, 'CSS.hasClass takes only a single class name.') : invariant(false) : void 0;
|
21645 | if (element.classList) {
|
21646 | return !!className && element.classList.contains(className);
|
21647 | }
|
21648 | return (' ' + element.className + ' ').indexOf(' ' + className + ' ') > -1;
|
21649 | },
|
21650 |
|
21651 | |
21652 |
|
21653 |
|
21654 |
|
21655 |
|
21656 |
|
21657 |
|
21658 | matchesSelector: function matchesSelector(element, selector) {
|
21659 | var matchesImpl = element.matches || element.webkitMatchesSelector || element.mozMatchesSelector || element.msMatchesSelector || function (s) {
|
21660 | return matchesSelector_SLOW(element, s);
|
21661 | };
|
21662 | return matchesImpl.call(element, selector);
|
21663 | }
|
21664 |
|
21665 | };
|
21666 |
|
21667 | module.exports = CSSCore;
|
21668 | },{"178":178}],163:[function(_dereq_,module,exports){
|
21669 | 'use strict';
|
21670 |
|
21671 |
|
21672 |
|
21673 |
|
21674 |
|
21675 |
|
21676 |
|
21677 |
|
21678 |
|
21679 |
|
21680 |
|
21681 |
|
21682 |
|
21683 |
|
21684 |
|
21685 |
|
21686 |
|
21687 |
|
21688 |
|
21689 | var emptyFunction = _dereq_(170);
|
21690 |
|
21691 |
|
21692 |
|
21693 |
|
21694 |
|
21695 | var EventListener = {
|
21696 | |
21697 |
|
21698 |
|
21699 |
|
21700 |
|
21701 |
|
21702 |
|
21703 |
|
21704 | listen: function listen(target, eventType, callback) {
|
21705 | if (target.addEventListener) {
|
21706 | target.addEventListener(eventType, callback, false);
|
21707 | return {
|
21708 | remove: function remove() {
|
21709 | target.removeEventListener(eventType, callback, false);
|
21710 | }
|
21711 | };
|
21712 | } else if (target.attachEvent) {
|
21713 | target.attachEvent('on' + eventType, callback);
|
21714 | return {
|
21715 | remove: function remove() {
|
21716 | target.detachEvent('on' + eventType, callback);
|
21717 | }
|
21718 | };
|
21719 | }
|
21720 | },
|
21721 |
|
21722 | |
21723 |
|
21724 |
|
21725 |
|
21726 |
|
21727 |
|
21728 |
|
21729 |
|
21730 | capture: function capture(target, eventType, callback) {
|
21731 | if (target.addEventListener) {
|
21732 | target.addEventListener(eventType, callback, true);
|
21733 | return {
|
21734 | remove: function remove() {
|
21735 | target.removeEventListener(eventType, callback, true);
|
21736 | }
|
21737 | };
|
21738 | } else {
|
21739 | if ("development" !== 'production') {
|
21740 | console.error('Attempted to listen to events during the capture phase on a ' + 'browser that does not support the capture phase. Your application ' + 'will not receive some events.');
|
21741 | }
|
21742 | return {
|
21743 | remove: emptyFunction
|
21744 | };
|
21745 | }
|
21746 | },
|
21747 |
|
21748 | registerDefault: function registerDefault() {}
|
21749 | };
|
21750 |
|
21751 | module.exports = EventListener;
|
21752 | },{"170":170}],164:[function(_dereq_,module,exports){
|
21753 |
|
21754 |
|
21755 |
|
21756 |
|
21757 |
|
21758 |
|
21759 |
|
21760 |
|
21761 |
|
21762 |
|
21763 | 'use strict';
|
21764 |
|
21765 | var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
21766 |
|
21767 |
|
21768 |
|
21769 |
|
21770 |
|
21771 |
|
21772 |
|
21773 | var ExecutionEnvironment = {
|
21774 |
|
21775 | canUseDOM: canUseDOM,
|
21776 |
|
21777 | canUseWorkers: typeof Worker !== 'undefined',
|
21778 |
|
21779 | canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent),
|
21780 |
|
21781 | canUseViewport: canUseDOM && !!window.screen,
|
21782 |
|
21783 | isInWorker: !canUseDOM
|
21784 |
|
21785 | };
|
21786 |
|
21787 | module.exports = ExecutionEnvironment;
|
21788 | },{}],165:[function(_dereq_,module,exports){
|
21789 | "use strict";
|
21790 |
|
21791 |
|
21792 |
|
21793 |
|
21794 |
|
21795 |
|
21796 |
|
21797 |
|
21798 |
|
21799 |
|
21800 |
|
21801 |
|
21802 | var _hyphenPattern = /-(.)/g;
|
21803 |
|
21804 |
|
21805 |
|
21806 |
|
21807 |
|
21808 |
|
21809 |
|
21810 |
|
21811 |
|
21812 |
|
21813 | function camelize(string) {
|
21814 | return string.replace(_hyphenPattern, function (_, character) {
|
21815 | return character.toUpperCase();
|
21816 | });
|
21817 | }
|
21818 |
|
21819 | module.exports = camelize;
|
21820 | },{}],166:[function(_dereq_,module,exports){
|
21821 |
|
21822 |
|
21823 |
|
21824 |
|
21825 |
|
21826 |
|
21827 |
|
21828 |
|
21829 |
|
21830 |
|
21831 |
|
21832 | 'use strict';
|
21833 |
|
21834 | var camelize = _dereq_(165);
|
21835 |
|
21836 | var msPattern = /^-ms-/;
|
21837 |
|
21838 |
|
21839 |
|
21840 |
|
21841 |
|
21842 |
|
21843 |
|
21844 |
|
21845 |
|
21846 |
|
21847 |
|
21848 |
|
21849 |
|
21850 |
|
21851 |
|
21852 |
|
21853 |
|
21854 |
|
21855 | function camelizeStyleName(string) {
|
21856 | return camelize(string.replace(msPattern, 'ms-'));
|
21857 | }
|
21858 |
|
21859 | module.exports = camelizeStyleName;
|
21860 | },{"165":165}],167:[function(_dereq_,module,exports){
|
21861 | 'use strict';
|
21862 |
|
21863 |
|
21864 |
|
21865 |
|
21866 |
|
21867 |
|
21868 |
|
21869 |
|
21870 |
|
21871 |
|
21872 |
|
21873 |
|
21874 | var isTextNode = _dereq_(180);
|
21875 |
|
21876 |
|
21877 |
|
21878 |
|
21879 |
|
21880 |
|
21881 | function containsNode(outerNode, innerNode) {
|
21882 | if (!outerNode || !innerNode) {
|
21883 | return false;
|
21884 | } else if (outerNode === innerNode) {
|
21885 | return true;
|
21886 | } else if (isTextNode(outerNode)) {
|
21887 | return false;
|
21888 | } else if (isTextNode(innerNode)) {
|
21889 | return containsNode(outerNode, innerNode.parentNode);
|
21890 | } else if ('contains' in outerNode) {
|
21891 | return outerNode.contains(innerNode);
|
21892 | } else if (outerNode.compareDocumentPosition) {
|
21893 | return !!(outerNode.compareDocumentPosition(innerNode) & 16);
|
21894 | } else {
|
21895 | return false;
|
21896 | }
|
21897 | }
|
21898 |
|
21899 | module.exports = containsNode;
|
21900 | },{"180":180}],168:[function(_dereq_,module,exports){
|
21901 | 'use strict';
|
21902 |
|
21903 |
|
21904 |
|
21905 |
|
21906 |
|
21907 |
|
21908 |
|
21909 |
|
21910 |
|
21911 |
|
21912 |
|
21913 |
|
21914 | var invariant = _dereq_(178);
|
21915 |
|
21916 |
|
21917 |
|
21918 |
|
21919 |
|
21920 |
|
21921 |
|
21922 |
|
21923 |
|
21924 |
|
21925 | function toArray(obj) {
|
21926 | var length = obj.length;
|
21927 |
|
21928 |
|
21929 |
|
21930 | !(!Array.isArray(obj) && (typeof obj === 'object' || typeof obj === 'function')) ? "development" !== 'production' ? invariant(false, 'toArray: Array-like object expected') : invariant(false) : void 0;
|
21931 |
|
21932 | !(typeof length === 'number') ? "development" !== 'production' ? invariant(false, 'toArray: Object needs a length property') : invariant(false) : void 0;
|
21933 |
|
21934 | !(length === 0 || length - 1 in obj) ? "development" !== 'production' ? invariant(false, 'toArray: Object should have keys for indices') : invariant(false) : void 0;
|
21935 |
|
21936 | !(typeof obj.callee !== 'function') ? "development" !== 'production' ? invariant(false, 'toArray: Object can\'t be `arguments`. Use rest params ' + '(function(...args) {}) or Array.from() instead.') : invariant(false) : void 0;
|
21937 |
|
21938 |
|
21939 |
|
21940 |
|
21941 | if (obj.hasOwnProperty) {
|
21942 | try {
|
21943 | return Array.prototype.slice.call(obj);
|
21944 | } catch (e) {
|
21945 |
|
21946 | }
|
21947 | }
|
21948 |
|
21949 |
|
21950 |
|
21951 | var ret = Array(length);
|
21952 | for (var ii = 0; ii < length; ii++) {
|
21953 | ret[ii] = obj[ii];
|
21954 | }
|
21955 | return ret;
|
21956 | }
|
21957 |
|
21958 |
|
21959 |
|
21960 |
|
21961 |
|
21962 |
|
21963 |
|
21964 |
|
21965 |
|
21966 |
|
21967 |
|
21968 |
|
21969 |
|
21970 |
|
21971 |
|
21972 |
|
21973 | function hasArrayNature(obj) {
|
21974 | return (
|
21975 |
|
21976 | !!obj && (
|
21977 |
|
21978 | typeof obj == 'object' || typeof obj == 'function') &&
|
21979 |
|
21980 | 'length' in obj &&
|
21981 |
|
21982 | !('setInterval' in obj) &&
|
21983 |
|
21984 |
|
21985 | typeof obj.nodeType != 'number' && (
|
21986 |
|
21987 | Array.isArray(obj) ||
|
21988 |
|
21989 | 'callee' in obj ||
|
21990 |
|
21991 | 'item' in obj)
|
21992 | );
|
21993 | }
|
21994 |
|
21995 |
|
21996 |
|
21997 |
|
21998 |
|
21999 |
|
22000 |
|
22001 |
|
22002 |
|
22003 |
|
22004 |
|
22005 |
|
22006 |
|
22007 |
|
22008 |
|
22009 |
|
22010 |
|
22011 |
|
22012 |
|
22013 |
|
22014 |
|
22015 |
|
22016 | function createArrayFromMixed(obj) {
|
22017 | if (!hasArrayNature(obj)) {
|
22018 | return [obj];
|
22019 | } else if (Array.isArray(obj)) {
|
22020 | return obj.slice();
|
22021 | } else {
|
22022 | return toArray(obj);
|
22023 | }
|
22024 | }
|
22025 |
|
22026 | module.exports = createArrayFromMixed;
|
22027 | },{"178":178}],169:[function(_dereq_,module,exports){
|
22028 | 'use strict';
|
22029 |
|
22030 |
|
22031 |
|
22032 |
|
22033 |
|
22034 |
|
22035 |
|
22036 |
|
22037 |
|
22038 |
|
22039 |
|
22040 |
|
22041 |
|
22042 |
|
22043 | var ExecutionEnvironment = _dereq_(164);
|
22044 |
|
22045 | var createArrayFromMixed = _dereq_(168);
|
22046 | var getMarkupWrap = _dereq_(174);
|
22047 | var invariant = _dereq_(178);
|
22048 |
|
22049 |
|
22050 |
|
22051 |
|
22052 | var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;
|
22053 |
|
22054 |
|
22055 |
|
22056 |
|
22057 | var nodeNamePattern = /^\s*<(\w+)/;
|
22058 |
|
22059 |
|
22060 |
|
22061 |
|
22062 |
|
22063 |
|
22064 |
|
22065 | function getNodeName(markup) {
|
22066 | var nodeNameMatch = markup.match(nodeNamePattern);
|
22067 | return nodeNameMatch && nodeNameMatch[1].toLowerCase();
|
22068 | }
|
22069 |
|
22070 |
|
22071 |
|
22072 |
|
22073 |
|
22074 |
|
22075 |
|
22076 |
|
22077 |
|
22078 |
|
22079 |
|
22080 | function createNodesFromMarkup(markup, handleScript) {
|
22081 | var node = dummyNode;
|
22082 | !!!dummyNode ? "development" !== 'production' ? invariant(false, 'createNodesFromMarkup dummy not initialized') : invariant(false) : void 0;
|
22083 | var nodeName = getNodeName(markup);
|
22084 |
|
22085 | var wrap = nodeName && getMarkupWrap(nodeName);
|
22086 | if (wrap) {
|
22087 | node.innerHTML = wrap[1] + markup + wrap[2];
|
22088 |
|
22089 | var wrapDepth = wrap[0];
|
22090 | while (wrapDepth--) {
|
22091 | node = node.lastChild;
|
22092 | }
|
22093 | } else {
|
22094 | node.innerHTML = markup;
|
22095 | }
|
22096 |
|
22097 | var scripts = node.getElementsByTagName('script');
|
22098 | if (scripts.length) {
|
22099 | !handleScript ? "development" !== 'production' ? invariant(false, 'createNodesFromMarkup(...): Unexpected <script> element rendered.') : invariant(false) : void 0;
|
22100 | createArrayFromMixed(scripts).forEach(handleScript);
|
22101 | }
|
22102 |
|
22103 | var nodes = Array.from(node.childNodes);
|
22104 | while (node.lastChild) {
|
22105 | node.removeChild(node.lastChild);
|
22106 | }
|
22107 | return nodes;
|
22108 | }
|
22109 |
|
22110 | module.exports = createNodesFromMarkup;
|
22111 | },{"164":164,"168":168,"174":174,"178":178}],170:[function(_dereq_,module,exports){
|
22112 | "use strict";
|
22113 |
|
22114 |
|
22115 |
|
22116 |
|
22117 |
|
22118 |
|
22119 |
|
22120 |
|
22121 |
|
22122 |
|
22123 |
|
22124 |
|
22125 | function makeEmptyFunction(arg) {
|
22126 | return function () {
|
22127 | return arg;
|
22128 | };
|
22129 | }
|
22130 |
|
22131 |
|
22132 |
|
22133 |
|
22134 |
|
22135 |
|
22136 | var emptyFunction = function emptyFunction() {};
|
22137 |
|
22138 | emptyFunction.thatReturns = makeEmptyFunction;
|
22139 | emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
|
22140 | emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
|
22141 | emptyFunction.thatReturnsNull = makeEmptyFunction(null);
|
22142 | emptyFunction.thatReturnsThis = function () {
|
22143 | return this;
|
22144 | };
|
22145 | emptyFunction.thatReturnsArgument = function (arg) {
|
22146 | return arg;
|
22147 | };
|
22148 |
|
22149 | module.exports = emptyFunction;
|
22150 | },{}],171:[function(_dereq_,module,exports){
|
22151 |
|
22152 |
|
22153 |
|
22154 |
|
22155 |
|
22156 |
|
22157 |
|
22158 |
|
22159 |
|
22160 |
|
22161 | 'use strict';
|
22162 |
|
22163 | var emptyObject = {};
|
22164 |
|
22165 | if ("development" !== 'production') {
|
22166 | Object.freeze(emptyObject);
|
22167 | }
|
22168 |
|
22169 | module.exports = emptyObject;
|
22170 | },{}],172:[function(_dereq_,module,exports){
|
22171 |
|
22172 |
|
22173 |
|
22174 |
|
22175 |
|
22176 |
|
22177 |
|
22178 |
|
22179 |
|
22180 |
|
22181 | 'use strict';
|
22182 |
|
22183 |
|
22184 |
|
22185 |
|
22186 |
|
22187 | function focusNode(node) {
|
22188 |
|
22189 |
|
22190 |
|
22191 | try {
|
22192 | node.focus();
|
22193 | } catch (e) {}
|
22194 | }
|
22195 |
|
22196 | module.exports = focusNode;
|
22197 | },{}],173:[function(_dereq_,module,exports){
|
22198 | 'use strict';
|
22199 |
|
22200 |
|
22201 |
|
22202 |
|
22203 |
|
22204 |
|
22205 |
|
22206 |
|
22207 |
|
22208 |
|
22209 |
|
22210 |
|
22211 |
|
22212 |
|
22213 |
|
22214 |
|
22215 |
|
22216 |
|
22217 |
|
22218 |
|
22219 |
|
22220 | function getActiveElement() /*?DOMElement*/{
|
22221 | if (typeof document === 'undefined') {
|
22222 | return null;
|
22223 | }
|
22224 | try {
|
22225 | return document.activeElement || document.body;
|
22226 | } catch (e) {
|
22227 | return document.body;
|
22228 | }
|
22229 | }
|
22230 |
|
22231 | module.exports = getActiveElement;
|
22232 | },{}],174:[function(_dereq_,module,exports){
|
22233 | 'use strict';
|
22234 |
|
22235 |
|
22236 |
|
22237 |
|
22238 |
|
22239 |
|
22240 |
|
22241 |
|
22242 |
|
22243 |
|
22244 |
|
22245 |
|
22246 |
|
22247 | var ExecutionEnvironment = _dereq_(164);
|
22248 |
|
22249 | var invariant = _dereq_(178);
|
22250 |
|
22251 |
|
22252 |
|
22253 |
|
22254 | var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;
|
22255 |
|
22256 |
|
22257 |
|
22258 |
|
22259 |
|
22260 |
|
22261 |
|
22262 |
|
22263 | var shouldWrap = {};
|
22264 |
|
22265 | var selectWrap = [1, '<select multiple="true">', '</select>'];
|
22266 | var tableWrap = [1, '<table>', '</table>'];
|
22267 | var trWrap = [3, '<table><tbody><tr>', '</tr></tbody></table>'];
|
22268 |
|
22269 | var svgWrap = [1, '<svg xmlns="http://www.w3.org/2000/svg">', '</svg>'];
|
22270 |
|
22271 | var markupWrap = {
|
22272 | '*': [1, '?<div>', '</div>'],
|
22273 |
|
22274 | 'area': [1, '<map>', '</map>'],
|
22275 | 'col': [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'],
|
22276 | 'legend': [1, '<fieldset>', '</fieldset>'],
|
22277 | 'param': [1, '<object>', '</object>'],
|
22278 | 'tr': [2, '<table><tbody>', '</tbody></table>'],
|
22279 |
|
22280 | 'optgroup': selectWrap,
|
22281 | 'option': selectWrap,
|
22282 |
|
22283 | 'caption': tableWrap,
|
22284 | 'colgroup': tableWrap,
|
22285 | 'tbody': tableWrap,
|
22286 | 'tfoot': tableWrap,
|
22287 | 'thead': tableWrap,
|
22288 |
|
22289 | 'td': trWrap,
|
22290 | 'th': trWrap
|
22291 | };
|
22292 |
|
22293 |
|
22294 |
|
22295 |
|
22296 | var svgElements = ['circle', 'clipPath', 'defs', 'ellipse', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'text', 'tspan'];
|
22297 | svgElements.forEach(function (nodeName) {
|
22298 | markupWrap[nodeName] = svgWrap;
|
22299 | shouldWrap[nodeName] = true;
|
22300 | });
|
22301 |
|
22302 |
|
22303 |
|
22304 |
|
22305 |
|
22306 |
|
22307 |
|
22308 |
|
22309 |
|
22310 | function getMarkupWrap(nodeName) {
|
22311 | !!!dummyNode ? "development" !== 'production' ? invariant(false, 'Markup wrapping node not initialized') : invariant(false) : void 0;
|
22312 | if (!markupWrap.hasOwnProperty(nodeName)) {
|
22313 | nodeName = '*';
|
22314 | }
|
22315 | if (!shouldWrap.hasOwnProperty(nodeName)) {
|
22316 | if (nodeName === '*') {
|
22317 | dummyNode.innerHTML = '<link />';
|
22318 | } else {
|
22319 | dummyNode.innerHTML = '<' + nodeName + '></' + nodeName + '>';
|
22320 | }
|
22321 | shouldWrap[nodeName] = !dummyNode.firstChild;
|
22322 | }
|
22323 | return shouldWrap[nodeName] ? markupWrap[nodeName] : null;
|
22324 | }
|
22325 |
|
22326 | module.exports = getMarkupWrap;
|
22327 | },{"164":164,"178":178}],175:[function(_dereq_,module,exports){
|
22328 |
|
22329 |
|
22330 |
|
22331 |
|
22332 |
|
22333 |
|
22334 |
|
22335 |
|
22336 |
|
22337 |
|
22338 |
|
22339 | 'use strict';
|
22340 |
|
22341 |
|
22342 |
|
22343 |
|
22344 |
|
22345 |
|
22346 |
|
22347 |
|
22348 |
|
22349 |
|
22350 |
|
22351 |
|
22352 | function getUnboundedScrollPosition(scrollable) {
|
22353 | if (scrollable === window) {
|
22354 | return {
|
22355 | x: window.pageXOffset || document.documentElement.scrollLeft,
|
22356 | y: window.pageYOffset || document.documentElement.scrollTop
|
22357 | };
|
22358 | }
|
22359 | return {
|
22360 | x: scrollable.scrollLeft,
|
22361 | y: scrollable.scrollTop
|
22362 | };
|
22363 | }
|
22364 |
|
22365 | module.exports = getUnboundedScrollPosition;
|
22366 | },{}],176:[function(_dereq_,module,exports){
|
22367 | 'use strict';
|
22368 |
|
22369 |
|
22370 |
|
22371 |
|
22372 |
|
22373 |
|
22374 |
|
22375 |
|
22376 |
|
22377 |
|
22378 |
|
22379 |
|
22380 | var _uppercasePattern = /([A-Z])/g;
|
22381 |
|
22382 |
|
22383 |
|
22384 |
|
22385 |
|
22386 |
|
22387 |
|
22388 |
|
22389 |
|
22390 |
|
22391 |
|
22392 |
|
22393 |
|
22394 | function hyphenate(string) {
|
22395 | return string.replace(_uppercasePattern, '-$1').toLowerCase();
|
22396 | }
|
22397 |
|
22398 | module.exports = hyphenate;
|
22399 | },{}],177:[function(_dereq_,module,exports){
|
22400 |
|
22401 |
|
22402 |
|
22403 |
|
22404 |
|
22405 |
|
22406 |
|
22407 |
|
22408 |
|
22409 |
|
22410 |
|
22411 | 'use strict';
|
22412 |
|
22413 | var hyphenate = _dereq_(176);
|
22414 |
|
22415 | var msPattern = /^ms-/;
|
22416 |
|
22417 |
|
22418 |
|
22419 |
|
22420 |
|
22421 |
|
22422 |
|
22423 |
|
22424 |
|
22425 |
|
22426 |
|
22427 |
|
22428 |
|
22429 |
|
22430 |
|
22431 |
|
22432 |
|
22433 | function hyphenateStyleName(string) {
|
22434 | return hyphenate(string).replace(msPattern, '-ms-');
|
22435 | }
|
22436 |
|
22437 | module.exports = hyphenateStyleName;
|
22438 | },{"176":176}],178:[function(_dereq_,module,exports){
|
22439 |
|
22440 |
|
22441 |
|
22442 |
|
22443 |
|
22444 |
|
22445 |
|
22446 |
|
22447 |
|
22448 |
|
22449 | 'use strict';
|
22450 |
|
22451 |
|
22452 |
|
22453 |
|
22454 |
|
22455 |
|
22456 |
|
22457 |
|
22458 |
|
22459 |
|
22460 |
|
22461 |
|
22462 | function invariant(condition, format, a, b, c, d, e, f) {
|
22463 | if ("development" !== 'production') {
|
22464 | if (format === undefined) {
|
22465 | throw new Error('invariant requires an error message argument');
|
22466 | }
|
22467 | }
|
22468 |
|
22469 | if (!condition) {
|
22470 | var error;
|
22471 | if (format === undefined) {
|
22472 | error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
|
22473 | } else {
|
22474 | var args = [a, b, c, d, e, f];
|
22475 | var argIndex = 0;
|
22476 | error = new Error(format.replace(/%s/g, function () {
|
22477 | return args[argIndex++];
|
22478 | }));
|
22479 | error.name = 'Invariant Violation';
|
22480 | }
|
22481 |
|
22482 | error.framesToPop = 1;
|
22483 | throw error;
|
22484 | }
|
22485 | }
|
22486 |
|
22487 | module.exports = invariant;
|
22488 | },{}],179:[function(_dereq_,module,exports){
|
22489 | 'use strict';
|
22490 |
|
22491 |
|
22492 |
|
22493 |
|
22494 |
|
22495 |
|
22496 |
|
22497 |
|
22498 |
|
22499 |
|
22500 |
|
22501 |
|
22502 |
|
22503 |
|
22504 |
|
22505 |
|
22506 | function isNode(object) {
|
22507 | return !!(object && (typeof Node === 'function' ? object instanceof Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string'));
|
22508 | }
|
22509 |
|
22510 | module.exports = isNode;
|
22511 | },{}],180:[function(_dereq_,module,exports){
|
22512 | 'use strict';
|
22513 |
|
22514 |
|
22515 |
|
22516 |
|
22517 |
|
22518 |
|
22519 |
|
22520 |
|
22521 |
|
22522 |
|
22523 |
|
22524 |
|
22525 | var isNode = _dereq_(179);
|
22526 |
|
22527 |
|
22528 |
|
22529 |
|
22530 |
|
22531 | function isTextNode(object) {
|
22532 | return isNode(object) && object.nodeType == 3;
|
22533 | }
|
22534 |
|
22535 | module.exports = isTextNode;
|
22536 | },{"179":179}],181:[function(_dereq_,module,exports){
|
22537 |
|
22538 |
|
22539 |
|
22540 |
|
22541 |
|
22542 |
|
22543 |
|
22544 |
|
22545 |
|
22546 |
|
22547 |
|
22548 | 'use strict';
|
22549 |
|
22550 | var invariant = _dereq_(178);
|
22551 |
|
22552 |
|
22553 |
|
22554 |
|
22555 |
|
22556 |
|
22557 |
|
22558 |
|
22559 |
|
22560 |
|
22561 |
|
22562 |
|
22563 |
|
22564 |
|
22565 |
|
22566 |
|
22567 |
|
22568 |
|
22569 |
|
22570 | var keyMirror = function keyMirror(obj) {
|
22571 | var ret = {};
|
22572 | var key;
|
22573 | !(obj instanceof Object && !Array.isArray(obj)) ? "development" !== 'production' ? invariant(false, 'keyMirror(...): Argument must be an object.') : invariant(false) : void 0;
|
22574 | for (key in obj) {
|
22575 | if (!obj.hasOwnProperty(key)) {
|
22576 | continue;
|
22577 | }
|
22578 | ret[key] = key;
|
22579 | }
|
22580 | return ret;
|
22581 | };
|
22582 |
|
22583 | module.exports = keyMirror;
|
22584 | },{"178":178}],182:[function(_dereq_,module,exports){
|
22585 | "use strict";
|
22586 |
|
22587 |
|
22588 |
|
22589 |
|
22590 |
|
22591 |
|
22592 |
|
22593 |
|
22594 |
|
22595 |
|
22596 |
|
22597 |
|
22598 |
|
22599 |
|
22600 |
|
22601 |
|
22602 |
|
22603 |
|
22604 |
|
22605 |
|
22606 |
|
22607 | var keyOf = function keyOf(oneKeyObj) {
|
22608 | var key;
|
22609 | for (key in oneKeyObj) {
|
22610 | if (!oneKeyObj.hasOwnProperty(key)) {
|
22611 | continue;
|
22612 | }
|
22613 | return key;
|
22614 | }
|
22615 | return null;
|
22616 | };
|
22617 |
|
22618 | module.exports = keyOf;
|
22619 | },{}],183:[function(_dereq_,module,exports){
|
22620 |
|
22621 |
|
22622 |
|
22623 |
|
22624 |
|
22625 |
|
22626 |
|
22627 |
|
22628 |
|
22629 |
|
22630 |
|
22631 |
|
22632 | 'use strict';
|
22633 |
|
22634 |
|
22635 |
|
22636 |
|
22637 |
|
22638 | function memoizeStringOnly(callback) {
|
22639 | var cache = {};
|
22640 | return function (string) {
|
22641 | if (!cache.hasOwnProperty(string)) {
|
22642 | cache[string] = callback.call(this, string);
|
22643 | }
|
22644 | return cache[string];
|
22645 | };
|
22646 | }
|
22647 |
|
22648 | module.exports = memoizeStringOnly;
|
22649 | },{}],184:[function(_dereq_,module,exports){
|
22650 |
|
22651 |
|
22652 |
|
22653 |
|
22654 |
|
22655 |
|
22656 |
|
22657 |
|
22658 |
|
22659 |
|
22660 |
|
22661 | 'use strict';
|
22662 |
|
22663 | var ExecutionEnvironment = _dereq_(164);
|
22664 |
|
22665 | var performance;
|
22666 |
|
22667 | if (ExecutionEnvironment.canUseDOM) {
|
22668 | performance = window.performance || window.msPerformance || window.webkitPerformance;
|
22669 | }
|
22670 |
|
22671 | module.exports = performance || {};
|
22672 | },{"164":164}],185:[function(_dereq_,module,exports){
|
22673 | 'use strict';
|
22674 |
|
22675 |
|
22676 |
|
22677 |
|
22678 |
|
22679 |
|
22680 |
|
22681 |
|
22682 |
|
22683 |
|
22684 |
|
22685 |
|
22686 | var performance = _dereq_(184);
|
22687 |
|
22688 | var performanceNow;
|
22689 |
|
22690 |
|
22691 |
|
22692 |
|
22693 |
|
22694 |
|
22695 | if (performance.now) {
|
22696 | performanceNow = function performanceNow() {
|
22697 | return performance.now();
|
22698 | };
|
22699 | } else {
|
22700 | performanceNow = function performanceNow() {
|
22701 | return Date.now();
|
22702 | };
|
22703 | }
|
22704 |
|
22705 | module.exports = performanceNow;
|
22706 | },{"184":184}],186:[function(_dereq_,module,exports){
|
22707 |
|
22708 |
|
22709 |
|
22710 |
|
22711 |
|
22712 |
|
22713 |
|
22714 |
|
22715 |
|
22716 |
|
22717 |
|
22718 |
|
22719 |
|
22720 |
|
22721 | 'use strict';
|
22722 |
|
22723 | var hasOwnProperty = Object.prototype.hasOwnProperty;
|
22724 |
|
22725 |
|
22726 |
|
22727 |
|
22728 |
|
22729 | function is(x, y) {
|
22730 |
|
22731 | if (x === y) {
|
22732 |
|
22733 |
|
22734 | return x !== 0 || 1 / x === 1 / y;
|
22735 | } else {
|
22736 |
|
22737 | return x !== x && y !== y;
|
22738 | }
|
22739 | }
|
22740 |
|
22741 |
|
22742 |
|
22743 |
|
22744 |
|
22745 |
|
22746 | function shallowEqual(objA, objB) {
|
22747 | if (is(objA, objB)) {
|
22748 | return true;
|
22749 | }
|
22750 |
|
22751 | if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
|
22752 | return false;
|
22753 | }
|
22754 |
|
22755 | var keysA = Object.keys(objA);
|
22756 | var keysB = Object.keys(objB);
|
22757 |
|
22758 | if (keysA.length !== keysB.length) {
|
22759 | return false;
|
22760 | }
|
22761 |
|
22762 |
|
22763 | for (var i = 0; i < keysA.length; i++) {
|
22764 | if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
|
22765 | return false;
|
22766 | }
|
22767 | }
|
22768 |
|
22769 | return true;
|
22770 | }
|
22771 |
|
22772 | module.exports = shallowEqual;
|
22773 | },{}],187:[function(_dereq_,module,exports){
|
22774 |
|
22775 |
|
22776 |
|
22777 |
|
22778 |
|
22779 |
|
22780 |
|
22781 |
|
22782 |
|
22783 |
|
22784 | 'use strict';
|
22785 |
|
22786 | var emptyFunction = _dereq_(170);
|
22787 |
|
22788 |
|
22789 |
|
22790 |
|
22791 |
|
22792 |
|
22793 |
|
22794 |
|
22795 | var warning = emptyFunction;
|
22796 |
|
22797 | if ("development" !== 'production') {
|
22798 | (function () {
|
22799 | var printWarning = function printWarning(format) {
|
22800 | for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
22801 | args[_key - 1] = arguments[_key];
|
22802 | }
|
22803 |
|
22804 | var argIndex = 0;
|
22805 | var message = 'Warning: ' + format.replace(/%s/g, function () {
|
22806 | return args[argIndex++];
|
22807 | });
|
22808 | if (typeof console !== 'undefined') {
|
22809 | console.error(message);
|
22810 | }
|
22811 | try {
|
22812 |
|
22813 |
|
22814 |
|
22815 | throw new Error(message);
|
22816 | } catch (x) {}
|
22817 | };
|
22818 |
|
22819 | warning = function warning(condition, format) {
|
22820 | if (format === undefined) {
|
22821 | throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
|
22822 | }
|
22823 |
|
22824 | if (format.indexOf('Failed Composite propType: ') === 0) {
|
22825 | return;
|
22826 | }
|
22827 |
|
22828 | if (!condition) {
|
22829 | for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
22830 | args[_key2 - 2] = arguments[_key2];
|
22831 | }
|
22832 |
|
22833 | printWarning.apply(undefined, [format].concat(args));
|
22834 | }
|
22835 | };
|
22836 | })();
|
22837 | }
|
22838 |
|
22839 | module.exports = warning;
|
22840 | },{"170":170}],188:[function(_dereq_,module,exports){
|
22841 | 'use strict';
|
22842 |
|
22843 | var hasOwnProperty = Object.prototype.hasOwnProperty;
|
22844 | var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
22845 |
|
22846 | function toObject(val) {
|
22847 | if (val === null || val === undefined) {
|
22848 | throw new TypeError('Object.assign cannot be called with null or undefined');
|
22849 | }
|
22850 |
|
22851 | return Object(val);
|
22852 | }
|
22853 |
|
22854 | function shouldUseNative() {
|
22855 | try {
|
22856 | if (!Object.assign) {
|
22857 | return false;
|
22858 | }
|
22859 |
|
22860 |
|
22861 |
|
22862 |
|
22863 | var test1 = new String('abc');
|
22864 | test1[5] = 'de';
|
22865 | if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
22866 | return false;
|
22867 | }
|
22868 |
|
22869 |
|
22870 | var test2 = {};
|
22871 | for (var i = 0; i < 10; i++) {
|
22872 | test2['_' + String.fromCharCode(i)] = i;
|
22873 | }
|
22874 | var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
|
22875 | return test2[n];
|
22876 | });
|
22877 | if (order2.join('') !== '0123456789') {
|
22878 | return false;
|
22879 | }
|
22880 |
|
22881 |
|
22882 | var test3 = {};
|
22883 | 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
|
22884 | test3[letter] = letter;
|
22885 | });
|
22886 | if (Object.keys(Object.assign({}, test3)).join('') !==
|
22887 | 'abcdefghijklmnopqrst') {
|
22888 | return false;
|
22889 | }
|
22890 |
|
22891 | return true;
|
22892 | } catch (e) {
|
22893 |
|
22894 | return false;
|
22895 | }
|
22896 | }
|
22897 |
|
22898 | module.exports = shouldUseNative() ? Object.assign : function (target, source) {
|
22899 | var from;
|
22900 | var to = toObject(target);
|
22901 | var symbols;
|
22902 |
|
22903 | for (var s = 1; s < arguments.length; s++) {
|
22904 | from = Object(arguments[s]);
|
22905 |
|
22906 | for (var key in from) {
|
22907 | if (hasOwnProperty.call(from, key)) {
|
22908 | to[key] = from[key];
|
22909 | }
|
22910 | }
|
22911 |
|
22912 | if (Object.getOwnPropertySymbols) {
|
22913 | symbols = Object.getOwnPropertySymbols(from);
|
22914 | for (var i = 0; i < symbols.length; i++) {
|
22915 | if (propIsEnumerable.call(from, symbols[i])) {
|
22916 | to[symbols[i]] = from[symbols[i]];
|
22917 | }
|
22918 | }
|
22919 | }
|
22920 | }
|
22921 |
|
22922 | return to;
|
22923 | };
|
22924 |
|
22925 | },{}]},{},[110])(110)
|
22926 | }); |
\ | No newline at end of file |