mirror of
https://github.com/status-im/react-native.git
synced 2025-01-19 22:09:53 +00:00
936c62a265
Reviewed By: amnn Differential Revision: D4422659 fbshipit-source-id: a32e87d2d39b6ff571f02d613b32db630e5e6de1
22712 lines
2.0 MiB
22712 lines
2.0 MiB
|
|
// @generated
|
|
|
|
/******/ (function(modules) { // webpackBootstrap
|
|
/******/ // The module cache
|
|
/******/ var installedModules = {};
|
|
/******/
|
|
/******/ // The require function
|
|
/******/ function __webpack_require__(moduleId) {
|
|
/******/
|
|
/******/ // Check if module is in cache
|
|
/******/ if(installedModules[moduleId])
|
|
/******/ return installedModules[moduleId].exports;
|
|
/******/
|
|
/******/ // Create a new module (and put it into the cache)
|
|
/******/ var module = installedModules[moduleId] = {
|
|
/******/ exports: {},
|
|
/******/ id: moduleId,
|
|
/******/ loaded: false
|
|
/******/ };
|
|
/******/
|
|
/******/ // Execute the module function
|
|
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
/******/
|
|
/******/ // Flag the module as loaded
|
|
/******/ module.loaded = true;
|
|
/******/
|
|
/******/ // Return the exports of the module
|
|
/******/ return module.exports;
|
|
/******/ }
|
|
/******/
|
|
/******/
|
|
/******/ // expose the modules object (__webpack_modules__)
|
|
/******/ __webpack_require__.m = modules;
|
|
/******/
|
|
/******/ // expose the module cache
|
|
/******/ __webpack_require__.c = installedModules;
|
|
/******/
|
|
/******/ // __webpack_public_path__
|
|
/******/ __webpack_require__.p = "";
|
|
/******/
|
|
/******/ // Load entry module and return exports
|
|
/******/ return __webpack_require__(0);
|
|
/******/ })
|
|
/************************************************************************/
|
|
/******/ ([
|
|
/* 0 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright (c) 2016-present, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*/
|
|
'use strict';
|
|
/*eslint no-console-disallow: "off"*/
|
|
/*global preLoadedCapture:true*/
|
|
|
|
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
|
|
|
var _reactDom = __webpack_require__(1);
|
|
|
|
var _reactDom2 = _interopRequireDefault(_reactDom);
|
|
|
|
var _react = __webpack_require__(147);
|
|
|
|
var _react2 = _interopRequireDefault(_react);
|
|
|
|
var _index = __webpack_require__(159);
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
function RefVisitor(refs, id) {
|
|
this.refs = refs;
|
|
this.id = id;
|
|
}
|
|
|
|
RefVisitor.prototype = {
|
|
moveToEdge: function moveToEdge(name) {
|
|
var ref = this.refs[this.id];
|
|
if (ref && ref.edges) {
|
|
var edges = ref.edges;
|
|
for (var edgeId in edges) {
|
|
if (edges[edgeId] === name) {
|
|
this.id = edgeId;
|
|
return this;
|
|
}
|
|
}
|
|
}
|
|
this.id = undefined;
|
|
return this;
|
|
},
|
|
moveToFirst: function moveToFirst(callback) {
|
|
var ref = this.refs[this.id];
|
|
if (ref && ref.edges) {
|
|
var edges = ref.edges;
|
|
for (var edgeId in edges) {
|
|
this.id = edgeId;
|
|
if (callback(edges[edgeId], this)) {
|
|
return this;
|
|
}
|
|
}
|
|
}
|
|
this.id = undefined;
|
|
return this;
|
|
},
|
|
forEachEdge: function forEachEdge(callback) {
|
|
var ref = this.refs[this.id];
|
|
if (ref && ref.edges) {
|
|
var edges = ref.edges;
|
|
var visitor = new RefVisitor(this.refs, undefined);
|
|
for (var edgeId in edges) {
|
|
visitor.id = edgeId;
|
|
callback(edges[edgeId], visitor);
|
|
}
|
|
}
|
|
},
|
|
getType: function getType() {
|
|
var ref = this.refs[this.id];
|
|
if (ref) {
|
|
return ref.type;
|
|
}
|
|
return undefined;
|
|
},
|
|
getRef: function getRef() {
|
|
return this.refs[this.id];
|
|
},
|
|
clone: function clone() {
|
|
return new RefVisitor(this.refs, this.id);
|
|
},
|
|
isDefined: function isDefined() {
|
|
return !!this.id;
|
|
},
|
|
getValue: function getValue() {
|
|
var _this = this;
|
|
|
|
var ref = this.refs[this.id];
|
|
if (ref) {
|
|
if (ref.type === 'string') {
|
|
if (ref.value) {
|
|
return ref.value;
|
|
} else {
|
|
var _ret = function () {
|
|
var rope = [];
|
|
_this.forEachEdge(function (name, visitor) {
|
|
if (name && name.startsWith('[') && name.endsWith(']')) {
|
|
var index = parseInt(name.substring(1, name.length - 1), 10);
|
|
rope[index] = visitor.getValue();
|
|
}
|
|
});
|
|
return {
|
|
v: rope.join('')
|
|
};
|
|
}();
|
|
|
|
if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === "object") return _ret.v;
|
|
}
|
|
} else if (ref.type === 'ScriptExecutable' || ref.type === 'EvalExecutable' || ref.type === 'ProgramExecutable') {
|
|
return ref.value.url + ':' + ref.value.line + ':' + ref.value.col;
|
|
} else if (ref.type === 'FunctionExecutable') {
|
|
return ref.value.name + '@' + ref.value.url + ':' + ref.value.line + ':' + ref.value.col;
|
|
} else if (ref.type === 'NativeExecutable') {
|
|
return ref.value.function + ' ' + ref.value.constructor + ' ' + ref.value.name;
|
|
} else if (ref.type === 'Function') {
|
|
var executable = this.clone().moveToEdge('@Executable');
|
|
if (executable.id) {
|
|
return executable.getRef().type + ' ' + executable.getValue();
|
|
}
|
|
}
|
|
}
|
|
return '#none';
|
|
}
|
|
};
|
|
|
|
function forEachRef(refs, callback) {
|
|
var visitor = new RefVisitor(refs, undefined);
|
|
for (var id in refs) {
|
|
visitor.id = id;
|
|
callback(visitor);
|
|
}
|
|
}
|
|
|
|
function firstRef(refs, callback) {
|
|
for (var id in refs) {
|
|
var ref = refs[id];
|
|
if (callback(id, ref)) {
|
|
return new RefVisitor(refs, id);
|
|
}
|
|
}
|
|
return new RefVisitor(refs, undefined);
|
|
}
|
|
|
|
function getInternalInstanceName(visitor) {
|
|
var type = visitor.clone().moveToEdge('_currentElement').moveToEdge('type');
|
|
if (type.getType() === 'string') {
|
|
// element.type is string
|
|
return type.getValue();
|
|
} else if (type.getType() === 'Function') {
|
|
// element.type is function
|
|
var displayName = type.clone().moveToEdge('displayName');
|
|
if (displayName.isDefined()) {
|
|
return displayName.getValue(); // element.type.displayName
|
|
}
|
|
var name = type.clone().moveToEdge('name');
|
|
if (name.isDefined()) {
|
|
return name.getValue(); // element.type.name
|
|
}
|
|
type.moveToEdge('@Executable');
|
|
if (type.getType() === 'FunctionExecutable') {
|
|
return type.getRef().value.name; // element.type symbolicated name
|
|
}
|
|
}
|
|
return '#unknown';
|
|
}
|
|
|
|
function buildReactComponentTree(visitor, registry, strings) {
|
|
var ref = visitor.getRef();
|
|
if (ref.reactTree || ref.reactParent === undefined) {
|
|
return; // has one or doesn't need one
|
|
}
|
|
var parentVisitor = ref.reactParent;
|
|
if (parentVisitor === null) {
|
|
ref.reactTree = registry.insert(registry.root, strings.intern(getInternalInstanceName(visitor)));
|
|
} else if (parentVisitor) {
|
|
var parentRef = parentVisitor.getRef();
|
|
buildReactComponentTree(parentVisitor, registry, strings);
|
|
var relativeName = getInternalInstanceName(visitor);
|
|
if (ref.reactKey) {
|
|
relativeName = ref.reactKey + ': ' + relativeName;
|
|
}
|
|
ref.reactTree = registry.insert(parentRef.reactTree, strings.intern(relativeName));
|
|
} else {
|
|
throw 'non react instance parent of react instance';
|
|
}
|
|
}
|
|
|
|
function markReactComponentTree(refs, registry, strings) {
|
|
// annotate all refs that are react internal instances with their parent and name
|
|
// ref.reactParent = visitor that points to parent instance,
|
|
// null if we know it's an instance, but don't have a parent yet
|
|
// ref.reactKey = if a key is used to distinguish siblings
|
|
forEachRef(refs, function (visitor) {
|
|
var visitorClone = visitor.clone(); // visitor will get stomped on next iteration
|
|
var ref = visitor.getRef();
|
|
visitor.forEachEdge(function (edgeName, edgeVisitor) {
|
|
var edgeRef = edgeVisitor.getRef();
|
|
if (edgeRef) {
|
|
if (edgeName === '_renderedChildren') {
|
|
if (ref.reactParent === undefined) {
|
|
// ref is react component, even if we don't have a parent yet
|
|
ref.reactParent = null;
|
|
}
|
|
edgeVisitor.forEachEdge(function (childName, childVisitor) {
|
|
var childRef = childVisitor.getRef();
|
|
if (childRef && childName.startsWith('.')) {
|
|
childRef.reactParent = visitorClone;
|
|
childRef.reactKey = childName;
|
|
}
|
|
});
|
|
} else if (edgeName === '_renderedComponent') {
|
|
if (ref.reactParent === undefined) {
|
|
ref.reactParent = null;
|
|
}
|
|
edgeRef.reactParent = visitorClone;
|
|
}
|
|
}
|
|
});
|
|
});
|
|
// build tree of react internal instances (since that's what has the structure)
|
|
// fill in ref.reactTree = path registry node
|
|
forEachRef(refs, function (visitor) {
|
|
buildReactComponentTree(visitor, registry, strings);
|
|
});
|
|
// hook in components by looking at their _reactInternalInstance fields
|
|
forEachRef(refs, function (visitor) {
|
|
var ref = visitor.getRef();
|
|
var instanceRef = visitor.moveToEdge('_reactInternalInstance').getRef();
|
|
if (instanceRef) {
|
|
ref.reactTree = instanceRef.reactTree;
|
|
}
|
|
});
|
|
}
|
|
|
|
function functionUrlFileName(visitor) {
|
|
var executable = visitor.clone().moveToEdge('@Executable');
|
|
var ref = executable.getRef();
|
|
if (ref && ref.value && ref.value.url) {
|
|
var url = ref.value.url;
|
|
var file = url.substring(url.lastIndexOf('/') + 1);
|
|
if (file.endsWith('.js')) {
|
|
file = file.substring(0, file.length - 3);
|
|
}
|
|
return file;
|
|
}
|
|
return undefined;
|
|
}
|
|
|
|
function markModules(refs) {
|
|
var modules = firstRef(refs, function (id, ref) {
|
|
return ref.type === 'CallbackGlobalObject';
|
|
});
|
|
modules.moveToEdge('require');
|
|
modules.moveToFirst(function (name, visitor) {
|
|
return visitor.getType() === 'JSActivation';
|
|
});
|
|
modules.moveToEdge('modules');
|
|
modules.forEachEdge(function (name, visitor) {
|
|
var ref = visitor.getRef();
|
|
visitor.moveToEdge('exports');
|
|
if (visitor.getType() === 'Object') {
|
|
visitor.moveToFirst(function (memberName, member) {
|
|
return member.getType() === 'Function';
|
|
});
|
|
if (visitor.isDefined()) {
|
|
ref.module = functionUrlFileName(visitor);
|
|
}
|
|
} else if (visitor.getType() === 'Function') {
|
|
var displayName = visitor.clone().moveToEdge('displayName');
|
|
if (displayName.isDefined()) {
|
|
ref.module = displayName.getValue();
|
|
}
|
|
ref.module = functionUrlFileName(visitor);
|
|
}
|
|
if (ref && !ref.module) {
|
|
ref.module = '#unknown ' + name;
|
|
}
|
|
});
|
|
}
|
|
|
|
function registerPathToRootBFS(breadth, registry, strings) {
|
|
var _loop = function _loop() {
|
|
var nextBreadth = [];
|
|
|
|
var _loop2 = function _loop2(i) {
|
|
var visitor = breadth[i];
|
|
var ref = visitor.getRef();
|
|
visitor.forEachEdge(function (edgeName, edgeVisitor) {
|
|
var edgeRef = edgeVisitor.getRef();
|
|
if (edgeRef && edgeRef.rootPath === undefined) {
|
|
var pathName = edgeRef.type;
|
|
if (edgeName) {
|
|
pathName = edgeName + ': ' + pathName;
|
|
}
|
|
edgeRef.rootPath = registry.insert(ref.rootPath, strings.intern(pathName));
|
|
nextBreadth.push(edgeVisitor.clone());
|
|
// copy module and react tree forward
|
|
if (edgeRef.module === undefined) {
|
|
edgeRef.module = ref.module;
|
|
}
|
|
if (edgeRef.reactTree === undefined) {
|
|
edgeRef.reactTree = ref.reactTree;
|
|
}
|
|
}
|
|
});
|
|
};
|
|
|
|
for (var i = 0; i < breadth.length; i++) {
|
|
_loop2(i);
|
|
}
|
|
breadth = nextBreadth;
|
|
};
|
|
|
|
while (breadth.length > 0) {
|
|
_loop();
|
|
}
|
|
}
|
|
|
|
function registerPathToRoot(capture, registry, strings) {
|
|
var refs = capture.refs;
|
|
var roots = capture.roots;
|
|
markReactComponentTree(refs, registry, strings);
|
|
markModules(refs);
|
|
var breadth = [];
|
|
// BFS from global objects first
|
|
forEachRef(refs, function (visitor) {
|
|
var ref = visitor.getRef();
|
|
if (ref.type === 'CallbackGlobalObject') {
|
|
ref.rootPath = registry.insert(registry.root, strings.intern(ref.type));
|
|
breadth.push(visitor.clone());
|
|
}
|
|
});
|
|
registerPathToRootBFS(breadth, registry, strings);
|
|
breadth = [];
|
|
// lower priority, BFS from other roots
|
|
var _iteratorNormalCompletion = true;
|
|
var _didIteratorError = false;
|
|
var _iteratorError = undefined;
|
|
|
|
try {
|
|
for (var _iterator = roots[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
var id = _step.value;
|
|
|
|
var visitor = new RefVisitor(refs, id);
|
|
var _ref = visitor.getRef();
|
|
if (_ref.rootPath === undefined) {
|
|
_ref.rootPath = registry.insert(registry.root, strings.intern('root ' + id + ': ' + _ref.type));
|
|
breadth.push(visitor.clone());
|
|
}
|
|
}
|
|
} catch (err) {
|
|
_didIteratorError = true;
|
|
_iteratorError = err;
|
|
} finally {
|
|
try {
|
|
if (!_iteratorNormalCompletion && _iterator.return) {
|
|
_iterator.return();
|
|
}
|
|
} finally {
|
|
if (_didIteratorError) {
|
|
throw _iteratorError;
|
|
}
|
|
}
|
|
}
|
|
|
|
registerPathToRootBFS(breadth, registry, strings);
|
|
}
|
|
|
|
function registerCapture(data, captureId, capture, stacks, strings) {
|
|
// NB: capture.refs is potentially VERY large, so we try to avoid making
|
|
// copies, even if iteration is a bit more annoying.
|
|
var rowCount = 0;
|
|
for (var id in capture.refs) {
|
|
// eslint-disable-line no-unused-vars
|
|
rowCount++;
|
|
}
|
|
for (var _id in capture.markedBlocks) {
|
|
// eslint-disable-line no-unused-vars
|
|
rowCount++;
|
|
}
|
|
var inserter = data.rowInserter(rowCount);
|
|
registerPathToRoot(capture, stacks, strings);
|
|
var noneString = strings.intern('#none');
|
|
var noneStack = stacks.insert(stacks.root, noneString);
|
|
forEachRef(capture.refs, function (visitor) {
|
|
// want to data.append(value, value, value), not IDs
|
|
var ref = visitor.getRef();
|
|
var id = visitor.id;
|
|
inserter.insertRow(parseInt(id, 16), ref.type, ref.size, captureId, ref.rootPath === undefined ? noneStack : ref.rootPath, ref.reactTree === undefined ? noneStack : ref.reactTree, visitor.getValue(), ref.module === undefined ? '#none' : ref.module);
|
|
});
|
|
for (var _id2 in capture.markedBlocks) {
|
|
var block = capture.markedBlocks[_id2];
|
|
inserter.insertRow(parseInt(_id2, 16), 'Marked Block Overhead', block.capacity - block.size, captureId, noneStack, noneStack, 'capacity: ' + block.capacity + ', size: ' + block.size + ', granularity: ' + block.cellSize, '#none');
|
|
}
|
|
inserter.done();
|
|
}
|
|
|
|
if (preLoadedCapture) {
|
|
(function () {
|
|
var strings = new _index.StringInterner();
|
|
var stacks = new _index.StackRegistry();
|
|
var columns = [{ name: 'id', type: 'int' }, { name: 'type', type: 'string', strings: strings }, { name: 'size', type: 'int' }, { name: 'trace', type: 'string', strings: strings }, { name: 'path', type: 'stack', stacks: stacks, getter: function getter(x) {
|
|
return strings.get(x);
|
|
}, formatter: function formatter(x) {
|
|
return x;
|
|
} }, { name: 'react', type: 'stack', stacks: stacks, getter: function getter(x) {
|
|
return strings.get(x);
|
|
}, formatter: function formatter(x) {
|
|
return x;
|
|
} }, { name: 'value', type: 'string', strings: strings }, { name: 'module', type: 'string', strings: strings }];
|
|
var data = new _index.AggrowData(columns);
|
|
registerCapture(data, 'trace', preLoadedCapture, stacks, strings);
|
|
preLoadedCapture = undefined; // let GG clean up the capture
|
|
var aggrow = new _index.Aggrow(data);
|
|
aggrow.addPointerExpander('Id', 'id');
|
|
var typeExpander = aggrow.addStringExpander('Type', 'type');
|
|
aggrow.addNumberExpander('Size', 'size');
|
|
aggrow.addStringExpander('Trace', 'trace');
|
|
var pathExpander = aggrow.addStackExpander('Path', 'path');
|
|
var reactExpander = aggrow.addStackExpander('React Tree', 'react');
|
|
var valueExpander = aggrow.addStringExpander('Value', 'value');
|
|
var moduleExpander = aggrow.addStringExpander('Module', 'module');
|
|
aggrow.expander.setActiveExpanders([pathExpander, reactExpander, moduleExpander, typeExpander, valueExpander]);
|
|
var sizeAggregator = aggrow.addSumAggregator('Size', 'size');
|
|
var countAggregator = aggrow.addCountAggregator('Count');
|
|
aggrow.expander.setActiveAggregators([sizeAggregator, countAggregator]);
|
|
_reactDom2.default.render(_react2.default.createElement(_index.AggrowTable, { aggrow: aggrow }), document.body);
|
|
})();
|
|
}
|
|
|
|
/***/ },
|
|
/* 1 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
'use strict';
|
|
|
|
module.exports = __webpack_require__(2);
|
|
|
|
|
|
/***/ },
|
|
/* 2 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactDOM
|
|
*/
|
|
|
|
/* globals __REACT_DEVTOOLS_GLOBAL_HOOK__*/
|
|
|
|
'use strict';
|
|
|
|
var ReactCurrentOwner = __webpack_require__(4);
|
|
var ReactDOMTextComponent = __webpack_require__(5);
|
|
var ReactDefaultInjection = __webpack_require__(70);
|
|
var ReactInstanceHandles = __webpack_require__(44);
|
|
var ReactMount = __webpack_require__(27);
|
|
var ReactPerf = __webpack_require__(17);
|
|
var ReactReconciler = __webpack_require__(49);
|
|
var ReactUpdates = __webpack_require__(53);
|
|
var ReactVersion = __webpack_require__(145);
|
|
|
|
var findDOMNode = __webpack_require__(90);
|
|
var renderSubtreeIntoContainer = __webpack_require__(146);
|
|
var warning = __webpack_require__(24);
|
|
|
|
ReactDefaultInjection.inject();
|
|
|
|
var render = ReactPerf.measure('React', 'render', ReactMount.render);
|
|
|
|
var React = {
|
|
findDOMNode: findDOMNode,
|
|
render: render,
|
|
unmountComponentAtNode: ReactMount.unmountComponentAtNode,
|
|
version: ReactVersion,
|
|
|
|
/* eslint-disable camelcase */
|
|
unstable_batchedUpdates: ReactUpdates.batchedUpdates,
|
|
unstable_renderSubtreeIntoContainer: renderSubtreeIntoContainer
|
|
};
|
|
|
|
// Inject the runtime into a devtools global hook regardless of browser.
|
|
// Allows for debugging when the hook is injected on the page.
|
|
/* eslint-enable camelcase */
|
|
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject === 'function') {
|
|
__REACT_DEVTOOLS_GLOBAL_HOOK__.inject({
|
|
CurrentOwner: ReactCurrentOwner,
|
|
InstanceHandles: ReactInstanceHandles,
|
|
Mount: ReactMount,
|
|
Reconciler: ReactReconciler,
|
|
TextComponent: ReactDOMTextComponent
|
|
});
|
|
}
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
var ExecutionEnvironment = __webpack_require__(8);
|
|
if (ExecutionEnvironment.canUseDOM && window.top === window.self) {
|
|
|
|
// First check if devtools is not installed
|
|
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {
|
|
// If we're in Chrome or Firefox, provide a download link if not installed.
|
|
if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) {
|
|
console.debug('Download the React DevTools for a better development experience: ' + 'https://fb.me/react-devtools');
|
|
}
|
|
}
|
|
|
|
// If we're in IE8, check to see if we are in compatibility mode and provide
|
|
// information on preventing compatibility mode
|
|
var ieCompatibilityMode = document.documentMode && document.documentMode < 8;
|
|
|
|
process.env.NODE_ENV !== '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" />') : undefined;
|
|
|
|
var expectedFeatures = [
|
|
// shims
|
|
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,
|
|
|
|
// shams
|
|
Object.create, Object.freeze];
|
|
|
|
for (var i = 0; i < expectedFeatures.length; i++) {
|
|
if (!expectedFeatures[i]) {
|
|
console.error('One or more ES5 shim/shams expected by React are not available: ' + 'https://fb.me/react-warning-polyfills');
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
module.exports = React;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 3 */
|
|
/***/ function(module, exports) {
|
|
|
|
// shim for using process in browser
|
|
var process = module.exports = {};
|
|
|
|
// cached from whatever global is present so that test runners that stub it
|
|
// don't break things. But we need to wrap it in a try catch in case it is
|
|
// wrapped in strict mode code which doesn't define any globals. It's inside a
|
|
// function because try/catches deoptimize in certain engines.
|
|
|
|
var cachedSetTimeout;
|
|
var cachedClearTimeout;
|
|
|
|
function defaultSetTimout() {
|
|
throw new Error('setTimeout has not been defined');
|
|
}
|
|
function defaultClearTimeout () {
|
|
throw new Error('clearTimeout has not been defined');
|
|
}
|
|
(function () {
|
|
try {
|
|
if (typeof setTimeout === 'function') {
|
|
cachedSetTimeout = setTimeout;
|
|
} else {
|
|
cachedSetTimeout = defaultSetTimout;
|
|
}
|
|
} catch (e) {
|
|
cachedSetTimeout = defaultSetTimout;
|
|
}
|
|
try {
|
|
if (typeof clearTimeout === 'function') {
|
|
cachedClearTimeout = clearTimeout;
|
|
} else {
|
|
cachedClearTimeout = defaultClearTimeout;
|
|
}
|
|
} catch (e) {
|
|
cachedClearTimeout = defaultClearTimeout;
|
|
}
|
|
} ())
|
|
function runTimeout(fun) {
|
|
if (cachedSetTimeout === setTimeout) {
|
|
//normal enviroments in sane situations
|
|
return setTimeout(fun, 0);
|
|
}
|
|
// if setTimeout wasn't available but was latter defined
|
|
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
|
|
cachedSetTimeout = setTimeout;
|
|
return setTimeout(fun, 0);
|
|
}
|
|
try {
|
|
// when when somebody has screwed with setTimeout but no I.E. maddness
|
|
return cachedSetTimeout(fun, 0);
|
|
} catch(e){
|
|
try {
|
|
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
|
return cachedSetTimeout.call(null, fun, 0);
|
|
} catch(e){
|
|
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
|
|
return cachedSetTimeout.call(this, fun, 0);
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
function runClearTimeout(marker) {
|
|
if (cachedClearTimeout === clearTimeout) {
|
|
//normal enviroments in sane situations
|
|
return clearTimeout(marker);
|
|
}
|
|
// if clearTimeout wasn't available but was latter defined
|
|
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
|
|
cachedClearTimeout = clearTimeout;
|
|
return clearTimeout(marker);
|
|
}
|
|
try {
|
|
// when when somebody has screwed with setTimeout but no I.E. maddness
|
|
return cachedClearTimeout(marker);
|
|
} catch (e){
|
|
try {
|
|
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
|
return cachedClearTimeout.call(null, marker);
|
|
} catch (e){
|
|
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
|
|
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
|
|
return cachedClearTimeout.call(this, marker);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
var queue = [];
|
|
var draining = false;
|
|
var currentQueue;
|
|
var queueIndex = -1;
|
|
|
|
function cleanUpNextTick() {
|
|
if (!draining || !currentQueue) {
|
|
return;
|
|
}
|
|
draining = false;
|
|
if (currentQueue.length) {
|
|
queue = currentQueue.concat(queue);
|
|
} else {
|
|
queueIndex = -1;
|
|
}
|
|
if (queue.length) {
|
|
drainQueue();
|
|
}
|
|
}
|
|
|
|
function drainQueue() {
|
|
if (draining) {
|
|
return;
|
|
}
|
|
var timeout = runTimeout(cleanUpNextTick);
|
|
draining = true;
|
|
|
|
var len = queue.length;
|
|
while(len) {
|
|
currentQueue = queue;
|
|
queue = [];
|
|
while (++queueIndex < len) {
|
|
if (currentQueue) {
|
|
currentQueue[queueIndex].run();
|
|
}
|
|
}
|
|
queueIndex = -1;
|
|
len = queue.length;
|
|
}
|
|
currentQueue = null;
|
|
draining = false;
|
|
runClearTimeout(timeout);
|
|
}
|
|
|
|
process.nextTick = function (fun) {
|
|
var args = new Array(arguments.length - 1);
|
|
if (arguments.length > 1) {
|
|
for (var i = 1; i < arguments.length; i++) {
|
|
args[i - 1] = arguments[i];
|
|
}
|
|
}
|
|
queue.push(new Item(fun, args));
|
|
if (queue.length === 1 && !draining) {
|
|
runTimeout(drainQueue);
|
|
}
|
|
};
|
|
|
|
// v8 likes predictible objects
|
|
function Item(fun, array) {
|
|
this.fun = fun;
|
|
this.array = array;
|
|
}
|
|
Item.prototype.run = function () {
|
|
this.fun.apply(null, this.array);
|
|
};
|
|
process.title = 'browser';
|
|
process.browser = true;
|
|
process.env = {};
|
|
process.argv = [];
|
|
process.version = ''; // empty string to avoid regexp issues
|
|
process.versions = {};
|
|
|
|
function noop() {}
|
|
|
|
process.on = noop;
|
|
process.addListener = noop;
|
|
process.once = noop;
|
|
process.off = noop;
|
|
process.removeListener = noop;
|
|
process.removeAllListeners = noop;
|
|
process.emit = noop;
|
|
|
|
process.binding = function (name) {
|
|
throw new Error('process.binding is not supported');
|
|
};
|
|
|
|
process.cwd = function () { return '/' };
|
|
process.chdir = function (dir) {
|
|
throw new Error('process.chdir is not supported');
|
|
};
|
|
process.umask = function() { return 0; };
|
|
|
|
|
|
/***/ },
|
|
/* 4 */
|
|
/***/ function(module, exports) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactCurrentOwner
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
/**
|
|
* Keeps track of the current owner.
|
|
*
|
|
* The current owner is the component who should own any components that are
|
|
* currently being constructed.
|
|
*/
|
|
var ReactCurrentOwner = {
|
|
|
|
/**
|
|
* @internal
|
|
* @type {ReactComponent}
|
|
*/
|
|
current: null
|
|
|
|
};
|
|
|
|
module.exports = ReactCurrentOwner;
|
|
|
|
/***/ },
|
|
/* 5 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactDOMTextComponent
|
|
* @typechecks static-only
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var DOMChildrenOperations = __webpack_require__(6);
|
|
var DOMPropertyOperations = __webpack_require__(21);
|
|
var ReactComponentBrowserEnvironment = __webpack_require__(25);
|
|
var ReactMount = __webpack_require__(27);
|
|
|
|
var assign = __webpack_require__(38);
|
|
var escapeTextContentForBrowser = __webpack_require__(20);
|
|
var setTextContent = __webpack_require__(19);
|
|
var validateDOMNesting = __webpack_require__(69);
|
|
|
|
/**
|
|
* Text nodes violate a couple assumptions that React makes about components:
|
|
*
|
|
* - When mounting text into the DOM, adjacent text nodes are merged.
|
|
* - Text nodes cannot be assigned a React root ID.
|
|
*
|
|
* This component is used to wrap strings in elements so that they can undergo
|
|
* the same reconciliation that is applied to elements.
|
|
*
|
|
* TODO: Investigate representing React components in the DOM with text nodes.
|
|
*
|
|
* @class ReactDOMTextComponent
|
|
* @extends ReactComponent
|
|
* @internal
|
|
*/
|
|
var ReactDOMTextComponent = function (props) {
|
|
// This constructor and its argument is currently used by mocks.
|
|
};
|
|
|
|
assign(ReactDOMTextComponent.prototype, {
|
|
|
|
/**
|
|
* @param {ReactText} text
|
|
* @internal
|
|
*/
|
|
construct: function (text) {
|
|
// TODO: This is really a ReactText (ReactNode), not a ReactElement
|
|
this._currentElement = text;
|
|
this._stringText = '' + text;
|
|
|
|
// Properties
|
|
this._rootNodeID = null;
|
|
this._mountIndex = 0;
|
|
},
|
|
|
|
/**
|
|
* Creates the markup for this text node. This node is not intended to have
|
|
* any features besides containing text content.
|
|
*
|
|
* @param {string} rootID DOM ID of the root node.
|
|
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
|
|
* @return {string} Markup for this text node.
|
|
* @internal
|
|
*/
|
|
mountComponent: function (rootID, transaction, context) {
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
if (context[validateDOMNesting.ancestorInfoContextKey]) {
|
|
validateDOMNesting('span', null, context[validateDOMNesting.ancestorInfoContextKey]);
|
|
}
|
|
}
|
|
|
|
this._rootNodeID = rootID;
|
|
if (transaction.useCreateElement) {
|
|
var ownerDocument = context[ReactMount.ownerDocumentContextKey];
|
|
var el = ownerDocument.createElement('span');
|
|
DOMPropertyOperations.setAttributeForID(el, rootID);
|
|
// Populate node cache
|
|
ReactMount.getID(el);
|
|
setTextContent(el, this._stringText);
|
|
return el;
|
|
} else {
|
|
var escapedText = escapeTextContentForBrowser(this._stringText);
|
|
|
|
if (transaction.renderToStaticMarkup) {
|
|
// Normally we'd wrap this in a `span` for the reasons stated above, but
|
|
// since this is a situation where React won't take over (static pages),
|
|
// we can simply return the text as it is.
|
|
return escapedText;
|
|
}
|
|
|
|
return '<span ' + DOMPropertyOperations.createMarkupForID(rootID) + '>' + escapedText + '</span>';
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Updates this component by updating the text content.
|
|
*
|
|
* @param {ReactText} nextText The next text content
|
|
* @param {ReactReconcileTransaction} transaction
|
|
* @internal
|
|
*/
|
|
receiveComponent: function (nextText, transaction) {
|
|
if (nextText !== this._currentElement) {
|
|
this._currentElement = nextText;
|
|
var nextStringText = '' + nextText;
|
|
if (nextStringText !== this._stringText) {
|
|
// TODO: Save this as pending props and use performUpdateIfNecessary
|
|
// and/or updateComponent to do the actual update for consistency with
|
|
// other component types?
|
|
this._stringText = nextStringText;
|
|
var node = ReactMount.getNode(this._rootNodeID);
|
|
DOMChildrenOperations.updateTextContent(node, nextStringText);
|
|
}
|
|
}
|
|
},
|
|
|
|
unmountComponent: function () {
|
|
ReactComponentBrowserEnvironment.unmountIDFromEnvironment(this._rootNodeID);
|
|
}
|
|
|
|
});
|
|
|
|
module.exports = ReactDOMTextComponent;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 6 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule DOMChildrenOperations
|
|
* @typechecks static-only
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var Danger = __webpack_require__(7);
|
|
var ReactMultiChildUpdateTypes = __webpack_require__(15);
|
|
var ReactPerf = __webpack_require__(17);
|
|
|
|
var setInnerHTML = __webpack_require__(18);
|
|
var setTextContent = __webpack_require__(19);
|
|
var invariant = __webpack_require__(12);
|
|
|
|
/**
|
|
* Inserts `childNode` as a child of `parentNode` at the `index`.
|
|
*
|
|
* @param {DOMElement} parentNode Parent node in which to insert.
|
|
* @param {DOMElement} childNode Child node to insert.
|
|
* @param {number} index Index at which to insert the child.
|
|
* @internal
|
|
*/
|
|
function insertChildAt(parentNode, childNode, index) {
|
|
// By exploiting arrays returning `undefined` for an undefined index, we can
|
|
// rely exclusively on `insertBefore(node, null)` instead of also using
|
|
// `appendChild(node)`. However, using `undefined` is not allowed by all
|
|
// browsers so we must replace it with `null`.
|
|
|
|
// fix render order error in safari
|
|
// IE8 will throw error when index out of list size.
|
|
var beforeChild = index >= parentNode.childNodes.length ? null : parentNode.childNodes.item(index);
|
|
|
|
parentNode.insertBefore(childNode, beforeChild);
|
|
}
|
|
|
|
/**
|
|
* Operations for updating with DOM children.
|
|
*/
|
|
var DOMChildrenOperations = {
|
|
|
|
dangerouslyReplaceNodeWithMarkup: Danger.dangerouslyReplaceNodeWithMarkup,
|
|
|
|
updateTextContent: setTextContent,
|
|
|
|
/**
|
|
* Updates a component's children by processing a series of updates. The
|
|
* update configurations are each expected to have a `parentNode` property.
|
|
*
|
|
* @param {array<object>} updates List of update configurations.
|
|
* @param {array<string>} markupList List of markup strings.
|
|
* @internal
|
|
*/
|
|
processUpdates: function (updates, markupList) {
|
|
var update;
|
|
// Mapping from parent IDs to initial child orderings.
|
|
var initialChildren = null;
|
|
// List of children that will be moved or removed.
|
|
var updatedChildren = null;
|
|
|
|
for (var i = 0; i < updates.length; i++) {
|
|
update = updates[i];
|
|
if (update.type === ReactMultiChildUpdateTypes.MOVE_EXISTING || update.type === ReactMultiChildUpdateTypes.REMOVE_NODE) {
|
|
var updatedIndex = update.fromIndex;
|
|
var updatedChild = update.parentNode.childNodes[updatedIndex];
|
|
var parentID = update.parentID;
|
|
|
|
!updatedChild ? process.env.NODE_ENV !== 'production' ? invariant(false, 'processUpdates(): Unable to find child %s of element. This ' + 'probably means the DOM was unexpectedly mutated (e.g., by the ' + 'browser), usually due to forgetting a <tbody> when using tables, ' + 'nesting tags like <form>, <p>, or <a>, or using non-SVG elements ' + 'in an <svg> parent. Try inspecting the child nodes of the element ' + 'with React ID `%s`.', updatedIndex, parentID) : invariant(false) : undefined;
|
|
|
|
initialChildren = initialChildren || {};
|
|
initialChildren[parentID] = initialChildren[parentID] || [];
|
|
initialChildren[parentID][updatedIndex] = updatedChild;
|
|
|
|
updatedChildren = updatedChildren || [];
|
|
updatedChildren.push(updatedChild);
|
|
}
|
|
}
|
|
|
|
var renderedMarkup;
|
|
// markupList is either a list of markup or just a list of elements
|
|
if (markupList.length && typeof markupList[0] === 'string') {
|
|
renderedMarkup = Danger.dangerouslyRenderMarkup(markupList);
|
|
} else {
|
|
renderedMarkup = markupList;
|
|
}
|
|
|
|
// Remove updated children first so that `toIndex` is consistent.
|
|
if (updatedChildren) {
|
|
for (var j = 0; j < updatedChildren.length; j++) {
|
|
updatedChildren[j].parentNode.removeChild(updatedChildren[j]);
|
|
}
|
|
}
|
|
|
|
for (var k = 0; k < updates.length; k++) {
|
|
update = updates[k];
|
|
switch (update.type) {
|
|
case ReactMultiChildUpdateTypes.INSERT_MARKUP:
|
|
insertChildAt(update.parentNode, renderedMarkup[update.markupIndex], update.toIndex);
|
|
break;
|
|
case ReactMultiChildUpdateTypes.MOVE_EXISTING:
|
|
insertChildAt(update.parentNode, initialChildren[update.parentID][update.fromIndex], update.toIndex);
|
|
break;
|
|
case ReactMultiChildUpdateTypes.SET_MARKUP:
|
|
setInnerHTML(update.parentNode, update.content);
|
|
break;
|
|
case ReactMultiChildUpdateTypes.TEXT_CONTENT:
|
|
setTextContent(update.parentNode, update.content);
|
|
break;
|
|
case ReactMultiChildUpdateTypes.REMOVE_NODE:
|
|
// Already removed by the for-loop above.
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
};
|
|
|
|
ReactPerf.measureMethods(DOMChildrenOperations, 'DOMChildrenOperations', {
|
|
updateTextContent: 'updateTextContent'
|
|
});
|
|
|
|
module.exports = DOMChildrenOperations;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 7 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule Danger
|
|
* @typechecks static-only
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var ExecutionEnvironment = __webpack_require__(8);
|
|
|
|
var createNodesFromMarkup = __webpack_require__(9);
|
|
var emptyFunction = __webpack_require__(14);
|
|
var getMarkupWrap = __webpack_require__(13);
|
|
var invariant = __webpack_require__(12);
|
|
|
|
var OPEN_TAG_NAME_EXP = /^(<[^ \/>]+)/;
|
|
var RESULT_INDEX_ATTR = 'data-danger-index';
|
|
|
|
/**
|
|
* Extracts the `nodeName` from a string of markup.
|
|
*
|
|
* NOTE: Extracting the `nodeName` does not require a regular expression match
|
|
* because we make assumptions about React-generated markup (i.e. there are no
|
|
* spaces surrounding the opening tag and there is at least one attribute).
|
|
*
|
|
* @param {string} markup String of markup.
|
|
* @return {string} Node name of the supplied markup.
|
|
* @see http://jsperf.com/extract-nodename
|
|
*/
|
|
function getNodeName(markup) {
|
|
return markup.substring(1, markup.indexOf(' '));
|
|
}
|
|
|
|
var Danger = {
|
|
|
|
/**
|
|
* Renders markup into an array of nodes. The markup is expected to render
|
|
* into a list of root nodes. Also, the length of `resultList` and
|
|
* `markupList` should be the same.
|
|
*
|
|
* @param {array<string>} markupList List of markup strings to render.
|
|
* @return {array<DOMElement>} List of rendered nodes.
|
|
* @internal
|
|
*/
|
|
dangerouslyRenderMarkup: function (markupList) {
|
|
!ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyRenderMarkup(...): 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.') : invariant(false) : undefined;
|
|
var nodeName;
|
|
var markupByNodeName = {};
|
|
// Group markup by `nodeName` if a wrap is necessary, else by '*'.
|
|
for (var i = 0; i < markupList.length; i++) {
|
|
!markupList[i] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyRenderMarkup(...): Missing markup.') : invariant(false) : undefined;
|
|
nodeName = getNodeName(markupList[i]);
|
|
nodeName = getMarkupWrap(nodeName) ? nodeName : '*';
|
|
markupByNodeName[nodeName] = markupByNodeName[nodeName] || [];
|
|
markupByNodeName[nodeName][i] = markupList[i];
|
|
}
|
|
var resultList = [];
|
|
var resultListAssignmentCount = 0;
|
|
for (nodeName in markupByNodeName) {
|
|
if (!markupByNodeName.hasOwnProperty(nodeName)) {
|
|
continue;
|
|
}
|
|
var markupListByNodeName = markupByNodeName[nodeName];
|
|
|
|
// This for-in loop skips the holes of the sparse array. The order of
|
|
// iteration should follow the order of assignment, which happens to match
|
|
// numerical index order, but we don't rely on that.
|
|
var resultIndex;
|
|
for (resultIndex in markupListByNodeName) {
|
|
if (markupListByNodeName.hasOwnProperty(resultIndex)) {
|
|
var markup = markupListByNodeName[resultIndex];
|
|
|
|
// Push the requested markup with an additional RESULT_INDEX_ATTR
|
|
// attribute. If the markup does not start with a < character, it
|
|
// will be discarded below (with an appropriate console.error).
|
|
markupListByNodeName[resultIndex] = markup.replace(OPEN_TAG_NAME_EXP,
|
|
// This index will be parsed back out below.
|
|
'$1 ' + RESULT_INDEX_ATTR + '="' + resultIndex + '" ');
|
|
}
|
|
}
|
|
|
|
// Render each group of markup with similar wrapping `nodeName`.
|
|
var renderNodes = createNodesFromMarkup(markupListByNodeName.join(''), emptyFunction // Do nothing special with <script> tags.
|
|
);
|
|
|
|
for (var j = 0; j < renderNodes.length; ++j) {
|
|
var renderNode = renderNodes[j];
|
|
if (renderNode.hasAttribute && renderNode.hasAttribute(RESULT_INDEX_ATTR)) {
|
|
|
|
resultIndex = +renderNode.getAttribute(RESULT_INDEX_ATTR);
|
|
renderNode.removeAttribute(RESULT_INDEX_ATTR);
|
|
|
|
!!resultList.hasOwnProperty(resultIndex) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Danger: Assigning to an already-occupied result index.') : invariant(false) : undefined;
|
|
|
|
resultList[resultIndex] = renderNode;
|
|
|
|
// This should match resultList.length and markupList.length when
|
|
// we're done.
|
|
resultListAssignmentCount += 1;
|
|
} else if (process.env.NODE_ENV !== 'production') {
|
|
console.error('Danger: Discarding unexpected node:', renderNode);
|
|
}
|
|
}
|
|
}
|
|
|
|
// Although resultList was populated out of order, it should now be a dense
|
|
// array.
|
|
!(resultListAssignmentCount === resultList.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Danger: Did not assign to every index of resultList.') : invariant(false) : undefined;
|
|
|
|
!(resultList.length === markupList.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Danger: Expected markup to render %s nodes, but rendered %s.', markupList.length, resultList.length) : invariant(false) : undefined;
|
|
|
|
return resultList;
|
|
},
|
|
|
|
/**
|
|
* Replaces a node with a string of markup at its current position within its
|
|
* parent. The markup must render into a single root node.
|
|
*
|
|
* @param {DOMElement} oldChild Child node to replace.
|
|
* @param {string} markup Markup to render in place of the child node.
|
|
* @internal
|
|
*/
|
|
dangerouslyReplaceNodeWithMarkup: function (oldChild, markup) {
|
|
!ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== '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.') : invariant(false) : undefined;
|
|
!markup ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Missing markup.') : invariant(false) : undefined;
|
|
!(oldChild.tagName.toLowerCase() !== 'html') ? process.env.NODE_ENV !== '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().') : invariant(false) : undefined;
|
|
|
|
var newChild;
|
|
if (typeof markup === 'string') {
|
|
newChild = createNodesFromMarkup(markup, emptyFunction)[0];
|
|
} else {
|
|
newChild = markup;
|
|
}
|
|
oldChild.parentNode.replaceChild(newChild, oldChild);
|
|
}
|
|
|
|
};
|
|
|
|
module.exports = Danger;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 8 */
|
|
/***/ function(module, exports) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ExecutionEnvironment
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
|
|
|
/**
|
|
* Simple, lightweight module assisting with the detection and context of
|
|
* Worker. Helps avoid circular dependencies and allows code to reason about
|
|
* whether or not they are in a Worker, even if they never include the main
|
|
* `ReactWorker` dependency.
|
|
*/
|
|
var ExecutionEnvironment = {
|
|
|
|
canUseDOM: canUseDOM,
|
|
|
|
canUseWorkers: typeof Worker !== 'undefined',
|
|
|
|
canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent),
|
|
|
|
canUseViewport: canUseDOM && !!window.screen,
|
|
|
|
isInWorker: !canUseDOM // For now, this is true - might change in the future.
|
|
|
|
};
|
|
|
|
module.exports = ExecutionEnvironment;
|
|
|
|
/***/ },
|
|
/* 9 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule createNodesFromMarkup
|
|
* @typechecks
|
|
*/
|
|
|
|
/*eslint-disable fb-www/unsafe-html*/
|
|
|
|
'use strict';
|
|
|
|
var ExecutionEnvironment = __webpack_require__(8);
|
|
|
|
var createArrayFromMixed = __webpack_require__(10);
|
|
var getMarkupWrap = __webpack_require__(13);
|
|
var invariant = __webpack_require__(12);
|
|
|
|
/**
|
|
* Dummy container used to render all markup.
|
|
*/
|
|
var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;
|
|
|
|
/**
|
|
* Pattern used by `getNodeName`.
|
|
*/
|
|
var nodeNamePattern = /^\s*<(\w+)/;
|
|
|
|
/**
|
|
* Extracts the `nodeName` of the first element in a string of markup.
|
|
*
|
|
* @param {string} markup String of markup.
|
|
* @return {?string} Node name of the supplied markup.
|
|
*/
|
|
function getNodeName(markup) {
|
|
var nodeNameMatch = markup.match(nodeNamePattern);
|
|
return nodeNameMatch && nodeNameMatch[1].toLowerCase();
|
|
}
|
|
|
|
/**
|
|
* Creates an array containing the nodes rendered from the supplied markup. The
|
|
* optionally supplied `handleScript` function will be invoked once for each
|
|
* <script> element that is rendered. If no `handleScript` function is supplied,
|
|
* an exception is thrown if any <script> elements are rendered.
|
|
*
|
|
* @param {string} markup A string of valid HTML markup.
|
|
* @param {?function} handleScript Invoked once for each rendered <script>.
|
|
* @return {array<DOMElement|DOMTextNode>} An array of rendered nodes.
|
|
*/
|
|
function createNodesFromMarkup(markup, handleScript) {
|
|
var node = dummyNode;
|
|
!!!dummyNode ? process.env.NODE_ENV !== 'production' ? invariant(false, 'createNodesFromMarkup dummy not initialized') : invariant(false) : undefined;
|
|
var nodeName = getNodeName(markup);
|
|
|
|
var wrap = nodeName && getMarkupWrap(nodeName);
|
|
if (wrap) {
|
|
node.innerHTML = wrap[1] + markup + wrap[2];
|
|
|
|
var wrapDepth = wrap[0];
|
|
while (wrapDepth--) {
|
|
node = node.lastChild;
|
|
}
|
|
} else {
|
|
node.innerHTML = markup;
|
|
}
|
|
|
|
var scripts = node.getElementsByTagName('script');
|
|
if (scripts.length) {
|
|
!handleScript ? process.env.NODE_ENV !== 'production' ? invariant(false, 'createNodesFromMarkup(...): Unexpected <script> element rendered.') : invariant(false) : undefined;
|
|
createArrayFromMixed(scripts).forEach(handleScript);
|
|
}
|
|
|
|
var nodes = createArrayFromMixed(node.childNodes);
|
|
while (node.lastChild) {
|
|
node.removeChild(node.lastChild);
|
|
}
|
|
return nodes;
|
|
}
|
|
|
|
module.exports = createNodesFromMarkup;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 10 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule createArrayFromMixed
|
|
* @typechecks
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var toArray = __webpack_require__(11);
|
|
|
|
/**
|
|
* Perform a heuristic test to determine if an object is "array-like".
|
|
*
|
|
* A monk asked Joshu, a Zen master, "Has a dog Buddha nature?"
|
|
* Joshu replied: "Mu."
|
|
*
|
|
* This function determines if its argument has "array nature": it returns
|
|
* true if the argument is an actual array, an `arguments' object, or an
|
|
* HTMLCollection (e.g. node.childNodes or node.getElementsByTagName()).
|
|
*
|
|
* It will return false for other array-like objects like Filelist.
|
|
*
|
|
* @param {*} obj
|
|
* @return {boolean}
|
|
*/
|
|
function hasArrayNature(obj) {
|
|
return(
|
|
// not null/false
|
|
!!obj && (
|
|
// arrays are objects, NodeLists are functions in Safari
|
|
typeof obj == 'object' || typeof obj == 'function') &&
|
|
// quacks like an array
|
|
'length' in obj &&
|
|
// not window
|
|
!('setInterval' in obj) &&
|
|
// no DOM node should be considered an array-like
|
|
// a 'select' element has 'length' and 'item' properties on IE8
|
|
typeof obj.nodeType != 'number' && (
|
|
// a real array
|
|
Array.isArray(obj) ||
|
|
// arguments
|
|
'callee' in obj ||
|
|
// HTMLCollection/NodeList
|
|
'item' in obj)
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Ensure that the argument is an array by wrapping it in an array if it is not.
|
|
* Creates a copy of the argument if it is already an array.
|
|
*
|
|
* This is mostly useful idiomatically:
|
|
*
|
|
* var createArrayFromMixed = require('createArrayFromMixed');
|
|
*
|
|
* function takesOneOrMoreThings(things) {
|
|
* things = createArrayFromMixed(things);
|
|
* ...
|
|
* }
|
|
*
|
|
* This allows you to treat `things' as an array, but accept scalars in the API.
|
|
*
|
|
* If you need to convert an array-like object, like `arguments`, into an array
|
|
* use toArray instead.
|
|
*
|
|
* @param {*} obj
|
|
* @return {array}
|
|
*/
|
|
function createArrayFromMixed(obj) {
|
|
if (!hasArrayNature(obj)) {
|
|
return [obj];
|
|
} else if (Array.isArray(obj)) {
|
|
return obj.slice();
|
|
} else {
|
|
return toArray(obj);
|
|
}
|
|
}
|
|
|
|
module.exports = createArrayFromMixed;
|
|
|
|
/***/ },
|
|
/* 11 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule toArray
|
|
* @typechecks
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var invariant = __webpack_require__(12);
|
|
|
|
/**
|
|
* Convert array-like objects to arrays.
|
|
*
|
|
* This API assumes the caller knows the contents of the data type. For less
|
|
* well defined inputs use createArrayFromMixed.
|
|
*
|
|
* @param {object|function|filelist} obj
|
|
* @return {array}
|
|
*/
|
|
function toArray(obj) {
|
|
var length = obj.length;
|
|
|
|
// Some browse builtin objects can report typeof 'function' (e.g. NodeList in
|
|
// old versions of Safari).
|
|
!(!Array.isArray(obj) && (typeof obj === 'object' || typeof obj === 'function')) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Array-like object expected') : invariant(false) : undefined;
|
|
|
|
!(typeof length === 'number') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object needs a length property') : invariant(false) : undefined;
|
|
|
|
!(length === 0 || length - 1 in obj) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object should have keys for indices') : invariant(false) : undefined;
|
|
|
|
// Old IE doesn't give collections access to hasOwnProperty. Assume inputs
|
|
// without method will throw during the slice call and skip straight to the
|
|
// fallback.
|
|
if (obj.hasOwnProperty) {
|
|
try {
|
|
return Array.prototype.slice.call(obj);
|
|
} catch (e) {
|
|
// IE < 9 does not support Array#slice on collections objects
|
|
}
|
|
}
|
|
|
|
// Fall back to copying key by key. This assumes all keys have a value,
|
|
// so will not preserve sparsely populated inputs.
|
|
var ret = Array(length);
|
|
for (var ii = 0; ii < length; ii++) {
|
|
ret[ii] = obj[ii];
|
|
}
|
|
return ret;
|
|
}
|
|
|
|
module.exports = toArray;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 12 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule invariant
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
/**
|
|
* Use invariant() to assert state which your program assumes to be true.
|
|
*
|
|
* Provide sprintf-style format (only %s is supported) and arguments
|
|
* to provide information about what broke and what you were
|
|
* expecting.
|
|
*
|
|
* The invariant message will be stripped in production, but the invariant
|
|
* will remain to ensure logic does not differ in production.
|
|
*/
|
|
|
|
function invariant(condition, format, a, b, c, d, e, f) {
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
if (format === undefined) {
|
|
throw new Error('invariant requires an error message argument');
|
|
}
|
|
}
|
|
|
|
if (!condition) {
|
|
var error;
|
|
if (format === undefined) {
|
|
error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
|
|
} else {
|
|
var args = [a, b, c, d, e, f];
|
|
var argIndex = 0;
|
|
error = new Error(format.replace(/%s/g, function () {
|
|
return args[argIndex++];
|
|
}));
|
|
error.name = 'Invariant Violation';
|
|
}
|
|
|
|
error.framesToPop = 1; // we don't care about invariant's own frame
|
|
throw error;
|
|
}
|
|
}
|
|
|
|
module.exports = invariant;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 13 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule getMarkupWrap
|
|
*/
|
|
|
|
/*eslint-disable fb-www/unsafe-html */
|
|
|
|
'use strict';
|
|
|
|
var ExecutionEnvironment = __webpack_require__(8);
|
|
|
|
var invariant = __webpack_require__(12);
|
|
|
|
/**
|
|
* Dummy container used to detect which wraps are necessary.
|
|
*/
|
|
var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;
|
|
|
|
/**
|
|
* Some browsers cannot use `innerHTML` to render certain elements standalone,
|
|
* so we wrap them, render the wrapped nodes, then extract the desired node.
|
|
*
|
|
* In IE8, certain elements cannot render alone, so wrap all elements ('*').
|
|
*/
|
|
|
|
var shouldWrap = {};
|
|
|
|
var selectWrap = [1, '<select multiple="true">', '</select>'];
|
|
var tableWrap = [1, '<table>', '</table>'];
|
|
var trWrap = [3, '<table><tbody><tr>', '</tr></tbody></table>'];
|
|
|
|
var svgWrap = [1, '<svg xmlns="http://www.w3.org/2000/svg">', '</svg>'];
|
|
|
|
var markupWrap = {
|
|
'*': [1, '?<div>', '</div>'],
|
|
|
|
'area': [1, '<map>', '</map>'],
|
|
'col': [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'],
|
|
'legend': [1, '<fieldset>', '</fieldset>'],
|
|
'param': [1, '<object>', '</object>'],
|
|
'tr': [2, '<table><tbody>', '</tbody></table>'],
|
|
|
|
'optgroup': selectWrap,
|
|
'option': selectWrap,
|
|
|
|
'caption': tableWrap,
|
|
'colgroup': tableWrap,
|
|
'tbody': tableWrap,
|
|
'tfoot': tableWrap,
|
|
'thead': tableWrap,
|
|
|
|
'td': trWrap,
|
|
'th': trWrap
|
|
};
|
|
|
|
// Initialize the SVG elements since we know they'll always need to be wrapped
|
|
// consistently. If they are created inside a <div> they will be initialized in
|
|
// the wrong namespace (and will not display).
|
|
var svgElements = ['circle', 'clipPath', 'defs', 'ellipse', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'text', 'tspan'];
|
|
svgElements.forEach(function (nodeName) {
|
|
markupWrap[nodeName] = svgWrap;
|
|
shouldWrap[nodeName] = true;
|
|
});
|
|
|
|
/**
|
|
* Gets the markup wrap configuration for the supplied `nodeName`.
|
|
*
|
|
* NOTE: This lazily detects which wraps are necessary for the current browser.
|
|
*
|
|
* @param {string} nodeName Lowercase `nodeName`.
|
|
* @return {?array} Markup wrap configuration, if applicable.
|
|
*/
|
|
function getMarkupWrap(nodeName) {
|
|
!!!dummyNode ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Markup wrapping node not initialized') : invariant(false) : undefined;
|
|
if (!markupWrap.hasOwnProperty(nodeName)) {
|
|
nodeName = '*';
|
|
}
|
|
if (!shouldWrap.hasOwnProperty(nodeName)) {
|
|
if (nodeName === '*') {
|
|
dummyNode.innerHTML = '<link />';
|
|
} else {
|
|
dummyNode.innerHTML = '<' + nodeName + '></' + nodeName + '>';
|
|
}
|
|
shouldWrap[nodeName] = !dummyNode.firstChild;
|
|
}
|
|
return shouldWrap[nodeName] ? markupWrap[nodeName] : null;
|
|
}
|
|
|
|
module.exports = getMarkupWrap;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 14 */
|
|
/***/ function(module, exports) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule emptyFunction
|
|
*/
|
|
|
|
"use strict";
|
|
|
|
function makeEmptyFunction(arg) {
|
|
return function () {
|
|
return arg;
|
|
};
|
|
}
|
|
|
|
/**
|
|
* This function accepts and discards inputs; it has no side effects. This is
|
|
* primarily useful idiomatically for overridable function endpoints which
|
|
* always need to be callable, since JS lacks a null-call idiom ala Cocoa.
|
|
*/
|
|
function emptyFunction() {}
|
|
|
|
emptyFunction.thatReturns = makeEmptyFunction;
|
|
emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
|
|
emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
|
|
emptyFunction.thatReturnsNull = makeEmptyFunction(null);
|
|
emptyFunction.thatReturnsThis = function () {
|
|
return this;
|
|
};
|
|
emptyFunction.thatReturnsArgument = function (arg) {
|
|
return arg;
|
|
};
|
|
|
|
module.exports = emptyFunction;
|
|
|
|
/***/ },
|
|
/* 15 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactMultiChildUpdateTypes
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var keyMirror = __webpack_require__(16);
|
|
|
|
/**
|
|
* When a component's children are updated, a series of update configuration
|
|
* objects are created in order to batch and serialize the required changes.
|
|
*
|
|
* Enumerates all the possible types of update configurations.
|
|
*
|
|
* @internal
|
|
*/
|
|
var ReactMultiChildUpdateTypes = keyMirror({
|
|
INSERT_MARKUP: null,
|
|
MOVE_EXISTING: null,
|
|
REMOVE_NODE: null,
|
|
SET_MARKUP: null,
|
|
TEXT_CONTENT: null
|
|
});
|
|
|
|
module.exports = ReactMultiChildUpdateTypes;
|
|
|
|
/***/ },
|
|
/* 16 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule keyMirror
|
|
* @typechecks static-only
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var invariant = __webpack_require__(12);
|
|
|
|
/**
|
|
* Constructs an enumeration with keys equal to their value.
|
|
*
|
|
* For example:
|
|
*
|
|
* var COLORS = keyMirror({blue: null, red: null});
|
|
* var myColor = COLORS.blue;
|
|
* var isColorValid = !!COLORS[myColor];
|
|
*
|
|
* The last line could not be performed if the values of the generated enum were
|
|
* not equal to their keys.
|
|
*
|
|
* Input: {key1: val1, key2: val2}
|
|
* Output: {key1: key1, key2: key2}
|
|
*
|
|
* @param {object} obj
|
|
* @return {object}
|
|
*/
|
|
var keyMirror = function (obj) {
|
|
var ret = {};
|
|
var key;
|
|
!(obj instanceof Object && !Array.isArray(obj)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'keyMirror(...): Argument must be an object.') : invariant(false) : undefined;
|
|
for (key in obj) {
|
|
if (!obj.hasOwnProperty(key)) {
|
|
continue;
|
|
}
|
|
ret[key] = key;
|
|
}
|
|
return ret;
|
|
};
|
|
|
|
module.exports = keyMirror;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 17 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactPerf
|
|
* @typechecks static-only
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
/**
|
|
* ReactPerf is a general AOP system designed to measure performance. This
|
|
* module only has the hooks: see ReactDefaultPerf for the analysis tool.
|
|
*/
|
|
var ReactPerf = {
|
|
/**
|
|
* Boolean to enable/disable measurement. Set to false by default to prevent
|
|
* accidental logging and perf loss.
|
|
*/
|
|
enableMeasure: false,
|
|
|
|
/**
|
|
* Holds onto the measure function in use. By default, don't measure
|
|
* anything, but we'll override this if we inject a measure function.
|
|
*/
|
|
storedMeasure: _noMeasure,
|
|
|
|
/**
|
|
* @param {object} object
|
|
* @param {string} objectName
|
|
* @param {object<string>} methodNames
|
|
*/
|
|
measureMethods: function (object, objectName, methodNames) {
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
for (var key in methodNames) {
|
|
if (!methodNames.hasOwnProperty(key)) {
|
|
continue;
|
|
}
|
|
object[key] = ReactPerf.measure(objectName, methodNames[key], object[key]);
|
|
}
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Use this to wrap methods you want to measure. Zero overhead in production.
|
|
*
|
|
* @param {string} objName
|
|
* @param {string} fnName
|
|
* @param {function} func
|
|
* @return {function}
|
|
*/
|
|
measure: function (objName, fnName, func) {
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
var measuredFunc = null;
|
|
var wrapper = function () {
|
|
if (ReactPerf.enableMeasure) {
|
|
if (!measuredFunc) {
|
|
measuredFunc = ReactPerf.storedMeasure(objName, fnName, func);
|
|
}
|
|
return measuredFunc.apply(this, arguments);
|
|
}
|
|
return func.apply(this, arguments);
|
|
};
|
|
wrapper.displayName = objName + '_' + fnName;
|
|
return wrapper;
|
|
}
|
|
return func;
|
|
},
|
|
|
|
injection: {
|
|
/**
|
|
* @param {function} measure
|
|
*/
|
|
injectMeasure: function (measure) {
|
|
ReactPerf.storedMeasure = measure;
|
|
}
|
|
}
|
|
};
|
|
|
|
/**
|
|
* Simply passes through the measured function, without measuring it.
|
|
*
|
|
* @param {string} objName
|
|
* @param {string} fnName
|
|
* @param {function} func
|
|
* @return {function}
|
|
*/
|
|
function _noMeasure(objName, fnName, func) {
|
|
return func;
|
|
}
|
|
|
|
module.exports = ReactPerf;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 18 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule setInnerHTML
|
|
*/
|
|
|
|
/* globals MSApp */
|
|
|
|
'use strict';
|
|
|
|
var ExecutionEnvironment = __webpack_require__(8);
|
|
|
|
var WHITESPACE_TEST = /^[ \r\n\t\f]/;
|
|
var NONVISIBLE_TEST = /<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/;
|
|
|
|
/**
|
|
* Set the innerHTML property of a node, ensuring that whitespace is preserved
|
|
* even in IE8.
|
|
*
|
|
* @param {DOMElement} node
|
|
* @param {string} html
|
|
* @internal
|
|
*/
|
|
var setInnerHTML = function (node, html) {
|
|
node.innerHTML = html;
|
|
};
|
|
|
|
// Win8 apps: Allow all html to be inserted
|
|
if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) {
|
|
setInnerHTML = function (node, html) {
|
|
MSApp.execUnsafeLocalFunction(function () {
|
|
node.innerHTML = html;
|
|
});
|
|
};
|
|
}
|
|
|
|
if (ExecutionEnvironment.canUseDOM) {
|
|
// IE8: When updating a just created node with innerHTML only leading
|
|
// whitespace is removed. When updating an existing node with innerHTML
|
|
// whitespace in root TextNodes is also collapsed.
|
|
// @see quirksmode.org/bugreports/archives/2004/11/innerhtml_and_t.html
|
|
|
|
// Feature detection; only IE8 is known to behave improperly like this.
|
|
var testElement = document.createElement('div');
|
|
testElement.innerHTML = ' ';
|
|
if (testElement.innerHTML === '') {
|
|
setInnerHTML = function (node, html) {
|
|
// Magic theory: IE8 supposedly differentiates between added and updated
|
|
// nodes when processing innerHTML, innerHTML on updated nodes suffers
|
|
// from worse whitespace behavior. Re-adding a node like this triggers
|
|
// the initial and more favorable whitespace behavior.
|
|
// TODO: What to do on a detached node?
|
|
if (node.parentNode) {
|
|
node.parentNode.replaceChild(node, node);
|
|
}
|
|
|
|
// We also implement a workaround for non-visible tags disappearing into
|
|
// thin air on IE8, this only happens if there is no visible text
|
|
// in-front of the non-visible tags. Piggyback on the whitespace fix
|
|
// and simply check if any non-visible tags appear in the source.
|
|
if (WHITESPACE_TEST.test(html) || html[0] === '<' && NONVISIBLE_TEST.test(html)) {
|
|
// Recover leading whitespace by temporarily prepending any character.
|
|
// \uFEFF has the potential advantage of being zero-width/invisible.
|
|
// UglifyJS drops U+FEFF chars when parsing, so use String.fromCharCode
|
|
// in hopes that this is preserved even if "\uFEFF" is transformed to
|
|
// the actual Unicode character (by Babel, for example).
|
|
// https://github.com/mishoo/UglifyJS2/blob/v2.4.20/lib/parse.js#L216
|
|
node.innerHTML = String.fromCharCode(0xFEFF) + html;
|
|
|
|
// deleteData leaves an empty `TextNode` which offsets the index of all
|
|
// children. Definitely want to avoid this.
|
|
var textNode = node.firstChild;
|
|
if (textNode.data.length === 1) {
|
|
node.removeChild(textNode);
|
|
} else {
|
|
textNode.deleteData(0, 1);
|
|
}
|
|
} else {
|
|
node.innerHTML = html;
|
|
}
|
|
};
|
|
}
|
|
}
|
|
|
|
module.exports = setInnerHTML;
|
|
|
|
/***/ },
|
|
/* 19 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule setTextContent
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var ExecutionEnvironment = __webpack_require__(8);
|
|
var escapeTextContentForBrowser = __webpack_require__(20);
|
|
var setInnerHTML = __webpack_require__(18);
|
|
|
|
/**
|
|
* Set the textContent property of a node, ensuring that whitespace is preserved
|
|
* even in IE8. innerText is a poor substitute for textContent and, among many
|
|
* issues, inserts <br> instead of the literal newline chars. innerHTML behaves
|
|
* as it should.
|
|
*
|
|
* @param {DOMElement} node
|
|
* @param {string} text
|
|
* @internal
|
|
*/
|
|
var setTextContent = function (node, text) {
|
|
node.textContent = text;
|
|
};
|
|
|
|
if (ExecutionEnvironment.canUseDOM) {
|
|
if (!('textContent' in document.documentElement)) {
|
|
setTextContent = function (node, text) {
|
|
setInnerHTML(node, escapeTextContentForBrowser(text));
|
|
};
|
|
}
|
|
}
|
|
|
|
module.exports = setTextContent;
|
|
|
|
/***/ },
|
|
/* 20 */
|
|
/***/ function(module, exports) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule escapeTextContentForBrowser
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var ESCAPE_LOOKUP = {
|
|
'&': '&',
|
|
'>': '>',
|
|
'<': '<',
|
|
'"': '"',
|
|
'\'': '''
|
|
};
|
|
|
|
var ESCAPE_REGEX = /[&><"']/g;
|
|
|
|
function escaper(match) {
|
|
return ESCAPE_LOOKUP[match];
|
|
}
|
|
|
|
/**
|
|
* Escapes text to prevent scripting attacks.
|
|
*
|
|
* @param {*} text Text value to escape.
|
|
* @return {string} An escaped string.
|
|
*/
|
|
function escapeTextContentForBrowser(text) {
|
|
return ('' + text).replace(ESCAPE_REGEX, escaper);
|
|
}
|
|
|
|
module.exports = escapeTextContentForBrowser;
|
|
|
|
/***/ },
|
|
/* 21 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule DOMPropertyOperations
|
|
* @typechecks static-only
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var DOMProperty = __webpack_require__(22);
|
|
var ReactPerf = __webpack_require__(17);
|
|
|
|
var quoteAttributeValueForBrowser = __webpack_require__(23);
|
|
var warning = __webpack_require__(24);
|
|
|
|
// Simplified subset
|
|
var VALID_ATTRIBUTE_NAME_REGEX = /^[a-zA-Z_][\w\.\-]*$/;
|
|
var illegalAttributeNameCache = {};
|
|
var validatedAttributeNameCache = {};
|
|
|
|
function isAttributeNameSafe(attributeName) {
|
|
if (validatedAttributeNameCache.hasOwnProperty(attributeName)) {
|
|
return true;
|
|
}
|
|
if (illegalAttributeNameCache.hasOwnProperty(attributeName)) {
|
|
return false;
|
|
}
|
|
if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
|
|
validatedAttributeNameCache[attributeName] = true;
|
|
return true;
|
|
}
|
|
illegalAttributeNameCache[attributeName] = true;
|
|
process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid attribute name: `%s`', attributeName) : undefined;
|
|
return false;
|
|
}
|
|
|
|
function shouldIgnoreValue(propertyInfo, value) {
|
|
return value == null || propertyInfo.hasBooleanValue && !value || propertyInfo.hasNumericValue && isNaN(value) || propertyInfo.hasPositiveNumericValue && value < 1 || propertyInfo.hasOverloadedBooleanValue && value === false;
|
|
}
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
var reactProps = {
|
|
children: true,
|
|
dangerouslySetInnerHTML: true,
|
|
key: true,
|
|
ref: true
|
|
};
|
|
var warnedProperties = {};
|
|
|
|
var warnUnknownProperty = function (name) {
|
|
if (reactProps.hasOwnProperty(name) && reactProps[name] || warnedProperties.hasOwnProperty(name) && warnedProperties[name]) {
|
|
return;
|
|
}
|
|
|
|
warnedProperties[name] = true;
|
|
var lowerCasedName = name.toLowerCase();
|
|
|
|
// data-* attributes should be lowercase; suggest the lowercase version
|
|
var standardName = DOMProperty.isCustomAttribute(lowerCasedName) ? lowerCasedName : DOMProperty.getPossibleStandardName.hasOwnProperty(lowerCasedName) ? DOMProperty.getPossibleStandardName[lowerCasedName] : null;
|
|
|
|
// For now, only warn when we have a suggested correction. This prevents
|
|
// logging too much when using transferPropsTo.
|
|
process.env.NODE_ENV !== 'production' ? warning(standardName == null, 'Unknown DOM property %s. Did you mean %s?', name, standardName) : undefined;
|
|
};
|
|
}
|
|
|
|
/**
|
|
* Operations for dealing with DOM properties.
|
|
*/
|
|
var DOMPropertyOperations = {
|
|
|
|
/**
|
|
* Creates markup for the ID property.
|
|
*
|
|
* @param {string} id Unescaped ID.
|
|
* @return {string} Markup string.
|
|
*/
|
|
createMarkupForID: function (id) {
|
|
return DOMProperty.ID_ATTRIBUTE_NAME + '=' + quoteAttributeValueForBrowser(id);
|
|
},
|
|
|
|
setAttributeForID: function (node, id) {
|
|
node.setAttribute(DOMProperty.ID_ATTRIBUTE_NAME, id);
|
|
},
|
|
|
|
/**
|
|
* Creates markup for a property.
|
|
*
|
|
* @param {string} name
|
|
* @param {*} value
|
|
* @return {?string} Markup string, or null if the property was invalid.
|
|
*/
|
|
createMarkupForProperty: function (name, value) {
|
|
var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
|
|
if (propertyInfo) {
|
|
if (shouldIgnoreValue(propertyInfo, value)) {
|
|
return '';
|
|
}
|
|
var attributeName = propertyInfo.attributeName;
|
|
if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) {
|
|
return attributeName + '=""';
|
|
}
|
|
return attributeName + '=' + quoteAttributeValueForBrowser(value);
|
|
} else if (DOMProperty.isCustomAttribute(name)) {
|
|
if (value == null) {
|
|
return '';
|
|
}
|
|
return name + '=' + quoteAttributeValueForBrowser(value);
|
|
} else if (process.env.NODE_ENV !== 'production') {
|
|
warnUnknownProperty(name);
|
|
}
|
|
return null;
|
|
},
|
|
|
|
/**
|
|
* Creates markup for a custom property.
|
|
*
|
|
* @param {string} name
|
|
* @param {*} value
|
|
* @return {string} Markup string, or empty string if the property was invalid.
|
|
*/
|
|
createMarkupForCustomAttribute: function (name, value) {
|
|
if (!isAttributeNameSafe(name) || value == null) {
|
|
return '';
|
|
}
|
|
return name + '=' + quoteAttributeValueForBrowser(value);
|
|
},
|
|
|
|
/**
|
|
* Sets the value for a property on a node.
|
|
*
|
|
* @param {DOMElement} node
|
|
* @param {string} name
|
|
* @param {*} value
|
|
*/
|
|
setValueForProperty: function (node, name, value) {
|
|
var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
|
|
if (propertyInfo) {
|
|
var mutationMethod = propertyInfo.mutationMethod;
|
|
if (mutationMethod) {
|
|
mutationMethod(node, value);
|
|
} else if (shouldIgnoreValue(propertyInfo, value)) {
|
|
this.deleteValueForProperty(node, name);
|
|
} else if (propertyInfo.mustUseAttribute) {
|
|
var attributeName = propertyInfo.attributeName;
|
|
var namespace = propertyInfo.attributeNamespace;
|
|
// `setAttribute` with objects becomes only `[object]` in IE8/9,
|
|
// ('' + value) makes it output the correct toString()-value.
|
|
if (namespace) {
|
|
node.setAttributeNS(namespace, attributeName, '' + value);
|
|
} else if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) {
|
|
node.setAttribute(attributeName, '');
|
|
} else {
|
|
node.setAttribute(attributeName, '' + value);
|
|
}
|
|
} else {
|
|
var propName = propertyInfo.propertyName;
|
|
// Must explicitly cast values for HAS_SIDE_EFFECTS-properties to the
|
|
// property type before comparing; only `value` does and is string.
|
|
if (!propertyInfo.hasSideEffects || '' + node[propName] !== '' + value) {
|
|
// Contrary to `setAttribute`, object properties are properly
|
|
// `toString`ed by IE8/9.
|
|
node[propName] = value;
|
|
}
|
|
}
|
|
} else if (DOMProperty.isCustomAttribute(name)) {
|
|
DOMPropertyOperations.setValueForAttribute(node, name, value);
|
|
} else if (process.env.NODE_ENV !== 'production') {
|
|
warnUnknownProperty(name);
|
|
}
|
|
},
|
|
|
|
setValueForAttribute: function (node, name, value) {
|
|
if (!isAttributeNameSafe(name)) {
|
|
return;
|
|
}
|
|
if (value == null) {
|
|
node.removeAttribute(name);
|
|
} else {
|
|
node.setAttribute(name, '' + value);
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Deletes the value for a property on a node.
|
|
*
|
|
* @param {DOMElement} node
|
|
* @param {string} name
|
|
*/
|
|
deleteValueForProperty: function (node, name) {
|
|
var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
|
|
if (propertyInfo) {
|
|
var mutationMethod = propertyInfo.mutationMethod;
|
|
if (mutationMethod) {
|
|
mutationMethod(node, undefined);
|
|
} else if (propertyInfo.mustUseAttribute) {
|
|
node.removeAttribute(propertyInfo.attributeName);
|
|
} else {
|
|
var propName = propertyInfo.propertyName;
|
|
var defaultValue = DOMProperty.getDefaultValueForProperty(node.nodeName, propName);
|
|
if (!propertyInfo.hasSideEffects || '' + node[propName] !== defaultValue) {
|
|
node[propName] = defaultValue;
|
|
}
|
|
}
|
|
} else if (DOMProperty.isCustomAttribute(name)) {
|
|
node.removeAttribute(name);
|
|
} else if (process.env.NODE_ENV !== 'production') {
|
|
warnUnknownProperty(name);
|
|
}
|
|
}
|
|
|
|
};
|
|
|
|
ReactPerf.measureMethods(DOMPropertyOperations, 'DOMPropertyOperations', {
|
|
setValueForProperty: 'setValueForProperty',
|
|
setValueForAttribute: 'setValueForAttribute',
|
|
deleteValueForProperty: 'deleteValueForProperty'
|
|
});
|
|
|
|
module.exports = DOMPropertyOperations;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 22 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule DOMProperty
|
|
* @typechecks static-only
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var invariant = __webpack_require__(12);
|
|
|
|
function checkMask(value, bitmask) {
|
|
return (value & bitmask) === bitmask;
|
|
}
|
|
|
|
var DOMPropertyInjection = {
|
|
/**
|
|
* Mapping from normalized, camelcased property names to a configuration that
|
|
* specifies how the associated DOM property should be accessed or rendered.
|
|
*/
|
|
MUST_USE_ATTRIBUTE: 0x1,
|
|
MUST_USE_PROPERTY: 0x2,
|
|
HAS_SIDE_EFFECTS: 0x4,
|
|
HAS_BOOLEAN_VALUE: 0x8,
|
|
HAS_NUMERIC_VALUE: 0x10,
|
|
HAS_POSITIVE_NUMERIC_VALUE: 0x20 | 0x10,
|
|
HAS_OVERLOADED_BOOLEAN_VALUE: 0x40,
|
|
|
|
/**
|
|
* Inject some specialized knowledge about the DOM. This takes a config object
|
|
* with the following properties:
|
|
*
|
|
* isCustomAttribute: function that given an attribute name will return true
|
|
* if it can be inserted into the DOM verbatim. Useful for data-* or aria-*
|
|
* attributes where it's impossible to enumerate all of the possible
|
|
* attribute names,
|
|
*
|
|
* Properties: object mapping DOM property name to one of the
|
|
* DOMPropertyInjection constants or null. If your attribute isn't in here,
|
|
* it won't get written to the DOM.
|
|
*
|
|
* DOMAttributeNames: object mapping React attribute name to the DOM
|
|
* attribute name. Attribute names not specified use the **lowercase**
|
|
* normalized name.
|
|
*
|
|
* DOMAttributeNamespaces: object mapping React attribute name to the DOM
|
|
* attribute namespace URL. (Attribute names not specified use no namespace.)
|
|
*
|
|
* DOMPropertyNames: similar to DOMAttributeNames but for DOM properties.
|
|
* Property names not specified use the normalized name.
|
|
*
|
|
* DOMMutationMethods: Properties that require special mutation methods. If
|
|
* `value` is undefined, the mutation method should unset the property.
|
|
*
|
|
* @param {object} domPropertyConfig the config as described above.
|
|
*/
|
|
injectDOMPropertyConfig: function (domPropertyConfig) {
|
|
var Injection = DOMPropertyInjection;
|
|
var Properties = domPropertyConfig.Properties || {};
|
|
var DOMAttributeNamespaces = domPropertyConfig.DOMAttributeNamespaces || {};
|
|
var DOMAttributeNames = domPropertyConfig.DOMAttributeNames || {};
|
|
var DOMPropertyNames = domPropertyConfig.DOMPropertyNames || {};
|
|
var DOMMutationMethods = domPropertyConfig.DOMMutationMethods || {};
|
|
|
|
if (domPropertyConfig.isCustomAttribute) {
|
|
DOMProperty._isCustomAttributeFunctions.push(domPropertyConfig.isCustomAttribute);
|
|
}
|
|
|
|
for (var propName in Properties) {
|
|
!!DOMProperty.properties.hasOwnProperty(propName) ? process.env.NODE_ENV !== '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) : invariant(false) : undefined;
|
|
|
|
var lowerCased = propName.toLowerCase();
|
|
var propConfig = Properties[propName];
|
|
|
|
var propertyInfo = {
|
|
attributeName: lowerCased,
|
|
attributeNamespace: null,
|
|
propertyName: propName,
|
|
mutationMethod: null,
|
|
|
|
mustUseAttribute: checkMask(propConfig, Injection.MUST_USE_ATTRIBUTE),
|
|
mustUseProperty: checkMask(propConfig, Injection.MUST_USE_PROPERTY),
|
|
hasSideEffects: checkMask(propConfig, Injection.HAS_SIDE_EFFECTS),
|
|
hasBooleanValue: checkMask(propConfig, Injection.HAS_BOOLEAN_VALUE),
|
|
hasNumericValue: checkMask(propConfig, Injection.HAS_NUMERIC_VALUE),
|
|
hasPositiveNumericValue: checkMask(propConfig, Injection.HAS_POSITIVE_NUMERIC_VALUE),
|
|
hasOverloadedBooleanValue: checkMask(propConfig, Injection.HAS_OVERLOADED_BOOLEAN_VALUE)
|
|
};
|
|
|
|
!(!propertyInfo.mustUseAttribute || !propertyInfo.mustUseProperty) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'DOMProperty: Cannot require using both attribute and property: %s', propName) : invariant(false) : undefined;
|
|
!(propertyInfo.mustUseProperty || !propertyInfo.hasSideEffects) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'DOMProperty: Properties that have side effects must use property: %s', propName) : invariant(false) : undefined;
|
|
!(propertyInfo.hasBooleanValue + propertyInfo.hasNumericValue + propertyInfo.hasOverloadedBooleanValue <= 1) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'DOMProperty: Value can be one of boolean, overloaded boolean, or ' + 'numeric value, but not a combination: %s', propName) : invariant(false) : undefined;
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
DOMProperty.getPossibleStandardName[lowerCased] = propName;
|
|
}
|
|
|
|
if (DOMAttributeNames.hasOwnProperty(propName)) {
|
|
var attributeName = DOMAttributeNames[propName];
|
|
propertyInfo.attributeName = attributeName;
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
DOMProperty.getPossibleStandardName[attributeName] = propName;
|
|
}
|
|
}
|
|
|
|
if (DOMAttributeNamespaces.hasOwnProperty(propName)) {
|
|
propertyInfo.attributeNamespace = DOMAttributeNamespaces[propName];
|
|
}
|
|
|
|
if (DOMPropertyNames.hasOwnProperty(propName)) {
|
|
propertyInfo.propertyName = DOMPropertyNames[propName];
|
|
}
|
|
|
|
if (DOMMutationMethods.hasOwnProperty(propName)) {
|
|
propertyInfo.mutationMethod = DOMMutationMethods[propName];
|
|
}
|
|
|
|
DOMProperty.properties[propName] = propertyInfo;
|
|
}
|
|
}
|
|
};
|
|
var defaultValueCache = {};
|
|
|
|
/**
|
|
* DOMProperty exports lookup objects that can be used like functions:
|
|
*
|
|
* > DOMProperty.isValid['id']
|
|
* true
|
|
* > DOMProperty.isValid['foobar']
|
|
* undefined
|
|
*
|
|
* Although this may be confusing, it performs better in general.
|
|
*
|
|
* @see http://jsperf.com/key-exists
|
|
* @see http://jsperf.com/key-missing
|
|
*/
|
|
var DOMProperty = {
|
|
|
|
ID_ATTRIBUTE_NAME: 'data-reactid',
|
|
|
|
/**
|
|
* Map from property "standard name" to an object with info about how to set
|
|
* the property in the DOM. Each object contains:
|
|
*
|
|
* attributeName:
|
|
* Used when rendering markup or with `*Attribute()`.
|
|
* attributeNamespace
|
|
* propertyName:
|
|
* Used on DOM node instances. (This includes properties that mutate due to
|
|
* external factors.)
|
|
* mutationMethod:
|
|
* If non-null, used instead of the property or `setAttribute()` after
|
|
* initial render.
|
|
* mustUseAttribute:
|
|
* Whether the property must be accessed and mutated using `*Attribute()`.
|
|
* (This includes anything that fails `<propName> in <element>`.)
|
|
* mustUseProperty:
|
|
* Whether the property must be accessed and mutated as an object property.
|
|
* hasSideEffects:
|
|
* Whether or not setting a value causes side effects such as triggering
|
|
* resources to be loaded or text selection changes. If true, we read from
|
|
* the DOM before updating to ensure that the value is only set if it has
|
|
* changed.
|
|
* hasBooleanValue:
|
|
* Whether the property should be removed when set to a falsey value.
|
|
* hasNumericValue:
|
|
* Whether the property must be numeric or parse as a numeric and should be
|
|
* removed when set to a falsey value.
|
|
* hasPositiveNumericValue:
|
|
* Whether the property must be positive numeric or parse as a positive
|
|
* numeric and should be removed when set to a falsey value.
|
|
* hasOverloadedBooleanValue:
|
|
* Whether the property can be used as a flag as well as with a value.
|
|
* Removed when strictly equal to false; present without a value when
|
|
* strictly equal to true; present with a value otherwise.
|
|
*/
|
|
properties: {},
|
|
|
|
/**
|
|
* Mapping from lowercase property names to the properly cased version, used
|
|
* to warn in the case of missing properties. Available only in __DEV__.
|
|
* @type {Object}
|
|
*/
|
|
getPossibleStandardName: process.env.NODE_ENV !== 'production' ? {} : null,
|
|
|
|
/**
|
|
* All of the isCustomAttribute() functions that have been injected.
|
|
*/
|
|
_isCustomAttributeFunctions: [],
|
|
|
|
/**
|
|
* Checks whether a property name is a custom attribute.
|
|
* @method
|
|
*/
|
|
isCustomAttribute: function (attributeName) {
|
|
for (var i = 0; i < DOMProperty._isCustomAttributeFunctions.length; i++) {
|
|
var isCustomAttributeFn = DOMProperty._isCustomAttributeFunctions[i];
|
|
if (isCustomAttributeFn(attributeName)) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
},
|
|
|
|
/**
|
|
* Returns the default property value for a DOM property (i.e., not an
|
|
* attribute). Most default values are '' or false, but not all. Worse yet,
|
|
* some (in particular, `type`) vary depending on the type of element.
|
|
*
|
|
* TODO: Is it better to grab all the possible properties when creating an
|
|
* element to avoid having to create the same element twice?
|
|
*/
|
|
getDefaultValueForProperty: function (nodeName, prop) {
|
|
var nodeDefaults = defaultValueCache[nodeName];
|
|
var testElement;
|
|
if (!nodeDefaults) {
|
|
defaultValueCache[nodeName] = nodeDefaults = {};
|
|
}
|
|
if (!(prop in nodeDefaults)) {
|
|
testElement = document.createElement(nodeName);
|
|
nodeDefaults[prop] = testElement[prop];
|
|
}
|
|
return nodeDefaults[prop];
|
|
},
|
|
|
|
injection: DOMPropertyInjection
|
|
};
|
|
|
|
module.exports = DOMProperty;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 23 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule quoteAttributeValueForBrowser
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var escapeTextContentForBrowser = __webpack_require__(20);
|
|
|
|
/**
|
|
* Escapes attribute value to prevent scripting attacks.
|
|
*
|
|
* @param {*} value Value to escape.
|
|
* @return {string} An escaped string.
|
|
*/
|
|
function quoteAttributeValueForBrowser(value) {
|
|
return '"' + escapeTextContentForBrowser(value) + '"';
|
|
}
|
|
|
|
module.exports = quoteAttributeValueForBrowser;
|
|
|
|
/***/ },
|
|
/* 24 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2014-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule warning
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var emptyFunction = __webpack_require__(14);
|
|
|
|
/**
|
|
* Similar to invariant but only logs a warning if the condition is not met.
|
|
* This can be used to log issues in development environments in critical
|
|
* paths. Removing the logging code for production environments will keep the
|
|
* same logic and follow the same code paths.
|
|
*/
|
|
|
|
var warning = emptyFunction;
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
warning = function (condition, format) {
|
|
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
args[_key - 2] = arguments[_key];
|
|
}
|
|
|
|
if (format === undefined) {
|
|
throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
|
|
}
|
|
|
|
if (format.indexOf('Failed Composite propType: ') === 0) {
|
|
return; // Ignore CompositeComponent proptype check.
|
|
}
|
|
|
|
if (!condition) {
|
|
var argIndex = 0;
|
|
var message = 'Warning: ' + format.replace(/%s/g, function () {
|
|
return args[argIndex++];
|
|
});
|
|
if (typeof console !== 'undefined') {
|
|
console.error(message);
|
|
}
|
|
try {
|
|
// --- Welcome to debugging React ---
|
|
// This error was thrown as a convenience so that you can use this stack
|
|
// to find the callsite that caused this warning to fire.
|
|
throw new Error(message);
|
|
} catch (x) {}
|
|
}
|
|
};
|
|
}
|
|
|
|
module.exports = warning;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 25 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactComponentBrowserEnvironment
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var ReactDOMIDOperations = __webpack_require__(26);
|
|
var ReactMount = __webpack_require__(27);
|
|
|
|
/**
|
|
* Abstracts away all functionality of the reconciler that requires knowledge of
|
|
* the browser context. TODO: These callers should be refactored to avoid the
|
|
* need for this injection.
|
|
*/
|
|
var ReactComponentBrowserEnvironment = {
|
|
|
|
processChildrenUpdates: ReactDOMIDOperations.dangerouslyProcessChildrenUpdates,
|
|
|
|
replaceNodeWithMarkupByID: ReactDOMIDOperations.dangerouslyReplaceNodeWithMarkupByID,
|
|
|
|
/**
|
|
* If a particular environment requires that some resources be cleaned up,
|
|
* specify this in the injected Mixin. In the DOM, we would likely want to
|
|
* purge any cached node ID lookups.
|
|
*
|
|
* @private
|
|
*/
|
|
unmountIDFromEnvironment: function (rootNodeID) {
|
|
ReactMount.purgeID(rootNodeID);
|
|
}
|
|
|
|
};
|
|
|
|
module.exports = ReactComponentBrowserEnvironment;
|
|
|
|
/***/ },
|
|
/* 26 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactDOMIDOperations
|
|
* @typechecks static-only
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var DOMChildrenOperations = __webpack_require__(6);
|
|
var DOMPropertyOperations = __webpack_require__(21);
|
|
var ReactMount = __webpack_require__(27);
|
|
var ReactPerf = __webpack_require__(17);
|
|
|
|
var invariant = __webpack_require__(12);
|
|
|
|
/**
|
|
* Errors for properties that should not be updated with `updatePropertyByID()`.
|
|
*
|
|
* @type {object}
|
|
* @private
|
|
*/
|
|
var INVALID_PROPERTY_ERRORS = {
|
|
dangerouslySetInnerHTML: '`dangerouslySetInnerHTML` must be set using `updateInnerHTMLByID()`.',
|
|
style: '`style` must be set using `updateStylesByID()`.'
|
|
};
|
|
|
|
/**
|
|
* Operations used to process updates to DOM nodes.
|
|
*/
|
|
var ReactDOMIDOperations = {
|
|
|
|
/**
|
|
* Updates a DOM node with new property values. This should only be used to
|
|
* update DOM properties in `DOMProperty`.
|
|
*
|
|
* @param {string} id ID of the node to update.
|
|
* @param {string} name A valid property name, see `DOMProperty`.
|
|
* @param {*} value New value of the property.
|
|
* @internal
|
|
*/
|
|
updatePropertyByID: function (id, name, value) {
|
|
var node = ReactMount.getNode(id);
|
|
!!INVALID_PROPERTY_ERRORS.hasOwnProperty(name) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'updatePropertyByID(...): %s', INVALID_PROPERTY_ERRORS[name]) : invariant(false) : undefined;
|
|
|
|
// If we're updating to null or undefined, we should remove the property
|
|
// from the DOM node instead of inadvertantly setting to a string. This
|
|
// brings us in line with the same behavior we have on initial render.
|
|
if (value != null) {
|
|
DOMPropertyOperations.setValueForProperty(node, name, value);
|
|
} else {
|
|
DOMPropertyOperations.deleteValueForProperty(node, name);
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Replaces a DOM node that exists in the document with markup.
|
|
*
|
|
* @param {string} id ID of child to be replaced.
|
|
* @param {string} markup Dangerous markup to inject in place of child.
|
|
* @internal
|
|
* @see {Danger.dangerouslyReplaceNodeWithMarkup}
|
|
*/
|
|
dangerouslyReplaceNodeWithMarkupByID: function (id, markup) {
|
|
var node = ReactMount.getNode(id);
|
|
DOMChildrenOperations.dangerouslyReplaceNodeWithMarkup(node, markup);
|
|
},
|
|
|
|
/**
|
|
* Updates a component's children by processing a series of updates.
|
|
*
|
|
* @param {array<object>} updates List of update configurations.
|
|
* @param {array<string>} markup List of markup strings.
|
|
* @internal
|
|
*/
|
|
dangerouslyProcessChildrenUpdates: function (updates, markup) {
|
|
for (var i = 0; i < updates.length; i++) {
|
|
updates[i].parentNode = ReactMount.getNode(updates[i].parentID);
|
|
}
|
|
DOMChildrenOperations.processUpdates(updates, markup);
|
|
}
|
|
};
|
|
|
|
ReactPerf.measureMethods(ReactDOMIDOperations, 'ReactDOMIDOperations', {
|
|
dangerouslyReplaceNodeWithMarkupByID: 'dangerouslyReplaceNodeWithMarkupByID',
|
|
dangerouslyProcessChildrenUpdates: 'dangerouslyProcessChildrenUpdates'
|
|
});
|
|
|
|
module.exports = ReactDOMIDOperations;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 27 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactMount
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var DOMProperty = __webpack_require__(22);
|
|
var ReactBrowserEventEmitter = __webpack_require__(28);
|
|
var ReactCurrentOwner = __webpack_require__(4);
|
|
var ReactDOMFeatureFlags = __webpack_require__(40);
|
|
var ReactElement = __webpack_require__(41);
|
|
var ReactEmptyComponentRegistry = __webpack_require__(43);
|
|
var ReactInstanceHandles = __webpack_require__(44);
|
|
var ReactInstanceMap = __webpack_require__(46);
|
|
var ReactMarkupChecksum = __webpack_require__(47);
|
|
var ReactPerf = __webpack_require__(17);
|
|
var ReactReconciler = __webpack_require__(49);
|
|
var ReactUpdateQueue = __webpack_require__(52);
|
|
var ReactUpdates = __webpack_require__(53);
|
|
|
|
var assign = __webpack_require__(38);
|
|
var emptyObject = __webpack_require__(57);
|
|
var containsNode = __webpack_require__(58);
|
|
var instantiateReactComponent = __webpack_require__(61);
|
|
var invariant = __webpack_require__(12);
|
|
var setInnerHTML = __webpack_require__(18);
|
|
var shouldUpdateReactComponent = __webpack_require__(66);
|
|
var validateDOMNesting = __webpack_require__(69);
|
|
var warning = __webpack_require__(24);
|
|
|
|
var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME;
|
|
var nodeCache = {};
|
|
|
|
var ELEMENT_NODE_TYPE = 1;
|
|
var DOC_NODE_TYPE = 9;
|
|
var DOCUMENT_FRAGMENT_NODE_TYPE = 11;
|
|
|
|
var ownerDocumentContextKey = '__ReactMount_ownerDocument$' + Math.random().toString(36).slice(2);
|
|
|
|
/** Mapping from reactRootID to React component instance. */
|
|
var instancesByReactRootID = {};
|
|
|
|
/** Mapping from reactRootID to `container` nodes. */
|
|
var containersByReactRootID = {};
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
/** __DEV__-only mapping from reactRootID to root elements. */
|
|
var rootElementsByReactRootID = {};
|
|
}
|
|
|
|
// Used to store breadth-first search state in findComponentRoot.
|
|
var findComponentRootReusableArray = [];
|
|
|
|
/**
|
|
* Finds the index of the first character
|
|
* that's not common between the two given strings.
|
|
*
|
|
* @return {number} the index of the character where the strings diverge
|
|
*/
|
|
function firstDifferenceIndex(string1, string2) {
|
|
var minLen = Math.min(string1.length, string2.length);
|
|
for (var i = 0; i < minLen; i++) {
|
|
if (string1.charAt(i) !== string2.charAt(i)) {
|
|
return i;
|
|
}
|
|
}
|
|
return string1.length === string2.length ? -1 : minLen;
|
|
}
|
|
|
|
/**
|
|
* @param {DOMElement|DOMDocument} container DOM element that may contain
|
|
* a React component
|
|
* @return {?*} DOM element that may have the reactRoot ID, or null.
|
|
*/
|
|
function getReactRootElementInContainer(container) {
|
|
if (!container) {
|
|
return null;
|
|
}
|
|
|
|
if (container.nodeType === DOC_NODE_TYPE) {
|
|
return container.documentElement;
|
|
} else {
|
|
return container.firstChild;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* @param {DOMElement} container DOM element that may contain a React component.
|
|
* @return {?string} A "reactRoot" ID, if a React component is rendered.
|
|
*/
|
|
function getReactRootID(container) {
|
|
var rootElement = getReactRootElementInContainer(container);
|
|
return rootElement && ReactMount.getID(rootElement);
|
|
}
|
|
|
|
/**
|
|
* Accessing node[ATTR_NAME] or calling getAttribute(ATTR_NAME) on a form
|
|
* element can return its control whose name or ID equals ATTR_NAME. All
|
|
* DOM nodes support `getAttributeNode` but this can also get called on
|
|
* other objects so just return '' if we're given something other than a
|
|
* DOM node (such as window).
|
|
*
|
|
* @param {?DOMElement|DOMWindow|DOMDocument|DOMTextNode} node DOM node.
|
|
* @return {string} ID of the supplied `domNode`.
|
|
*/
|
|
function getID(node) {
|
|
var id = internalGetID(node);
|
|
if (id) {
|
|
if (nodeCache.hasOwnProperty(id)) {
|
|
var cached = nodeCache[id];
|
|
if (cached !== node) {
|
|
!!isValid(cached, id) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactMount: Two valid but unequal nodes with the same `%s`: %s', ATTR_NAME, id) : invariant(false) : undefined;
|
|
|
|
nodeCache[id] = node;
|
|
}
|
|
} else {
|
|
nodeCache[id] = node;
|
|
}
|
|
}
|
|
|
|
return id;
|
|
}
|
|
|
|
function internalGetID(node) {
|
|
// If node is something like a window, document, or text node, none of
|
|
// which support attributes or a .getAttribute method, gracefully return
|
|
// the empty string, as if the attribute were missing.
|
|
return node && node.getAttribute && node.getAttribute(ATTR_NAME) || '';
|
|
}
|
|
|
|
/**
|
|
* Sets the React-specific ID of the given node.
|
|
*
|
|
* @param {DOMElement} node The DOM node whose ID will be set.
|
|
* @param {string} id The value of the ID attribute.
|
|
*/
|
|
function setID(node, id) {
|
|
var oldID = internalGetID(node);
|
|
if (oldID !== id) {
|
|
delete nodeCache[oldID];
|
|
}
|
|
node.setAttribute(ATTR_NAME, id);
|
|
nodeCache[id] = node;
|
|
}
|
|
|
|
/**
|
|
* Finds the node with the supplied React-generated DOM ID.
|
|
*
|
|
* @param {string} id A React-generated DOM ID.
|
|
* @return {DOMElement} DOM node with the suppled `id`.
|
|
* @internal
|
|
*/
|
|
function getNode(id) {
|
|
if (!nodeCache.hasOwnProperty(id) || !isValid(nodeCache[id], id)) {
|
|
nodeCache[id] = ReactMount.findReactNodeByID(id);
|
|
}
|
|
return nodeCache[id];
|
|
}
|
|
|
|
/**
|
|
* Finds the node with the supplied public React instance.
|
|
*
|
|
* @param {*} instance A public React instance.
|
|
* @return {?DOMElement} DOM node with the suppled `id`.
|
|
* @internal
|
|
*/
|
|
function getNodeFromInstance(instance) {
|
|
var id = ReactInstanceMap.get(instance)._rootNodeID;
|
|
if (ReactEmptyComponentRegistry.isNullComponentID(id)) {
|
|
return null;
|
|
}
|
|
if (!nodeCache.hasOwnProperty(id) || !isValid(nodeCache[id], id)) {
|
|
nodeCache[id] = ReactMount.findReactNodeByID(id);
|
|
}
|
|
return nodeCache[id];
|
|
}
|
|
|
|
/**
|
|
* A node is "valid" if it is contained by a currently mounted container.
|
|
*
|
|
* This means that the node does not have to be contained by a document in
|
|
* order to be considered valid.
|
|
*
|
|
* @param {?DOMElement} node The candidate DOM node.
|
|
* @param {string} id The expected ID of the node.
|
|
* @return {boolean} Whether the node is contained by a mounted container.
|
|
*/
|
|
function isValid(node, id) {
|
|
if (node) {
|
|
!(internalGetID(node) === id) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactMount: Unexpected modification of `%s`', ATTR_NAME) : invariant(false) : undefined;
|
|
|
|
var container = ReactMount.findReactContainerForID(id);
|
|
if (container && containsNode(container, node)) {
|
|
return true;
|
|
}
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
/**
|
|
* Causes the cache to forget about one React-specific ID.
|
|
*
|
|
* @param {string} id The ID to forget.
|
|
*/
|
|
function purgeID(id) {
|
|
delete nodeCache[id];
|
|
}
|
|
|
|
var deepestNodeSoFar = null;
|
|
function findDeepestCachedAncestorImpl(ancestorID) {
|
|
var ancestor = nodeCache[ancestorID];
|
|
if (ancestor && isValid(ancestor, ancestorID)) {
|
|
deepestNodeSoFar = ancestor;
|
|
} else {
|
|
// This node isn't populated in the cache, so presumably none of its
|
|
// descendants are. Break out of the loop.
|
|
return false;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Return the deepest cached node whose ID is a prefix of `targetID`.
|
|
*/
|
|
function findDeepestCachedAncestor(targetID) {
|
|
deepestNodeSoFar = null;
|
|
ReactInstanceHandles.traverseAncestors(targetID, findDeepestCachedAncestorImpl);
|
|
|
|
var foundNode = deepestNodeSoFar;
|
|
deepestNodeSoFar = null;
|
|
return foundNode;
|
|
}
|
|
|
|
/**
|
|
* Mounts this component and inserts it into the DOM.
|
|
*
|
|
* @param {ReactComponent} componentInstance The instance to mount.
|
|
* @param {string} rootID DOM ID of the root node.
|
|
* @param {DOMElement} container DOM element to mount into.
|
|
* @param {ReactReconcileTransaction} transaction
|
|
* @param {boolean} shouldReuseMarkup If true, do not insert markup
|
|
*/
|
|
function mountComponentIntoNode(componentInstance, rootID, container, transaction, shouldReuseMarkup, context) {
|
|
if (ReactDOMFeatureFlags.useCreateElement) {
|
|
context = assign({}, context);
|
|
if (container.nodeType === DOC_NODE_TYPE) {
|
|
context[ownerDocumentContextKey] = container;
|
|
} else {
|
|
context[ownerDocumentContextKey] = container.ownerDocument;
|
|
}
|
|
}
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
if (context === emptyObject) {
|
|
context = {};
|
|
}
|
|
var tag = container.nodeName.toLowerCase();
|
|
context[validateDOMNesting.ancestorInfoContextKey] = validateDOMNesting.updatedAncestorInfo(null, tag, null);
|
|
}
|
|
var markup = ReactReconciler.mountComponent(componentInstance, rootID, transaction, context);
|
|
componentInstance._renderedComponent._topLevelWrapper = componentInstance;
|
|
ReactMount._mountImageIntoNode(markup, container, shouldReuseMarkup, transaction);
|
|
}
|
|
|
|
/**
|
|
* Batched mount.
|
|
*
|
|
* @param {ReactComponent} componentInstance The instance to mount.
|
|
* @param {string} rootID DOM ID of the root node.
|
|
* @param {DOMElement} container DOM element to mount into.
|
|
* @param {boolean} shouldReuseMarkup If true, do not insert markup
|
|
*/
|
|
function batchedMountComponentIntoNode(componentInstance, rootID, container, shouldReuseMarkup, context) {
|
|
var transaction = ReactUpdates.ReactReconcileTransaction.getPooled(
|
|
/* forceHTML */shouldReuseMarkup);
|
|
transaction.perform(mountComponentIntoNode, null, componentInstance, rootID, container, transaction, shouldReuseMarkup, context);
|
|
ReactUpdates.ReactReconcileTransaction.release(transaction);
|
|
}
|
|
|
|
/**
|
|
* Unmounts a component and removes it from the DOM.
|
|
*
|
|
* @param {ReactComponent} instance React component instance.
|
|
* @param {DOMElement} container DOM element to unmount from.
|
|
* @final
|
|
* @internal
|
|
* @see {ReactMount.unmountComponentAtNode}
|
|
*/
|
|
function unmountComponentFromNode(instance, container) {
|
|
ReactReconciler.unmountComponent(instance);
|
|
|
|
if (container.nodeType === DOC_NODE_TYPE) {
|
|
container = container.documentElement;
|
|
}
|
|
|
|
// http://jsperf.com/emptying-a-node
|
|
while (container.lastChild) {
|
|
container.removeChild(container.lastChild);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* True if the supplied DOM node has a direct React-rendered child that is
|
|
* not a React root element. Useful for warning in `render`,
|
|
* `unmountComponentAtNode`, etc.
|
|
*
|
|
* @param {?DOMElement} node The candidate DOM node.
|
|
* @return {boolean} True if the DOM element contains a direct child that was
|
|
* rendered by React but is not a root element.
|
|
* @internal
|
|
*/
|
|
function hasNonRootReactChild(node) {
|
|
var reactRootID = getReactRootID(node);
|
|
return reactRootID ? reactRootID !== ReactInstanceHandles.getReactRootIDFromNodeID(reactRootID) : false;
|
|
}
|
|
|
|
/**
|
|
* Returns the first (deepest) ancestor of a node which is rendered by this copy
|
|
* of React.
|
|
*/
|
|
function findFirstReactDOMImpl(node) {
|
|
// This node might be from another React instance, so we make sure not to
|
|
// examine the node cache here
|
|
for (; node && node.parentNode !== node; node = node.parentNode) {
|
|
if (node.nodeType !== 1) {
|
|
// Not a DOMElement, therefore not a React component
|
|
continue;
|
|
}
|
|
var nodeID = internalGetID(node);
|
|
if (!nodeID) {
|
|
continue;
|
|
}
|
|
var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);
|
|
|
|
// If containersByReactRootID contains the container we find by crawling up
|
|
// the tree, we know that this instance of React rendered the node.
|
|
// nb. isValid's strategy (with containsNode) does not work because render
|
|
// trees may be nested and we don't want a false positive in that case.
|
|
var current = node;
|
|
var lastID;
|
|
do {
|
|
lastID = internalGetID(current);
|
|
current = current.parentNode;
|
|
if (current == null) {
|
|
// The passed-in node has been detached from the container it was
|
|
// originally rendered into.
|
|
return null;
|
|
}
|
|
} while (lastID !== reactRootID);
|
|
|
|
if (current === containersByReactRootID[reactRootID]) {
|
|
return node;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
/**
|
|
* Temporary (?) hack so that we can store all top-level pending updates on
|
|
* composites instead of having to worry about different types of components
|
|
* here.
|
|
*/
|
|
var TopLevelWrapper = function () {};
|
|
TopLevelWrapper.prototype.isReactComponent = {};
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
TopLevelWrapper.displayName = 'TopLevelWrapper';
|
|
}
|
|
TopLevelWrapper.prototype.render = function () {
|
|
// this.props is actually a ReactElement
|
|
return this.props;
|
|
};
|
|
|
|
/**
|
|
* Mounting is the process of initializing a React component by creating its
|
|
* representative DOM elements and inserting them into a supplied `container`.
|
|
* Any prior content inside `container` is destroyed in the process.
|
|
*
|
|
* ReactMount.render(
|
|
* component,
|
|
* document.getElementById('container')
|
|
* );
|
|
*
|
|
* <div id="container"> <-- Supplied `container`.
|
|
* <div data-reactid=".3"> <-- Rendered reactRoot of React
|
|
* // ... component.
|
|
* </div>
|
|
* </div>
|
|
*
|
|
* Inside of `container`, the first element rendered is the "reactRoot".
|
|
*/
|
|
var ReactMount = {
|
|
|
|
TopLevelWrapper: TopLevelWrapper,
|
|
|
|
/** Exposed for debugging purposes **/
|
|
_instancesByReactRootID: instancesByReactRootID,
|
|
|
|
/**
|
|
* This is a hook provided to support rendering React components while
|
|
* ensuring that the apparent scroll position of its `container` does not
|
|
* change.
|
|
*
|
|
* @param {DOMElement} container The `container` being rendered into.
|
|
* @param {function} renderCallback This must be called once to do the render.
|
|
*/
|
|
scrollMonitor: function (container, renderCallback) {
|
|
renderCallback();
|
|
},
|
|
|
|
/**
|
|
* Take a component that's already mounted into the DOM and replace its props
|
|
* @param {ReactComponent} prevComponent component instance already in the DOM
|
|
* @param {ReactElement} nextElement component instance to render
|
|
* @param {DOMElement} container container to render into
|
|
* @param {?function} callback function triggered on completion
|
|
*/
|
|
_updateRootComponent: function (prevComponent, nextElement, container, callback) {
|
|
ReactMount.scrollMonitor(container, function () {
|
|
ReactUpdateQueue.enqueueElementInternal(prevComponent, nextElement);
|
|
if (callback) {
|
|
ReactUpdateQueue.enqueueCallbackInternal(prevComponent, callback);
|
|
}
|
|
});
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
// Record the root element in case it later gets transplanted.
|
|
rootElementsByReactRootID[getReactRootID(container)] = getReactRootElementInContainer(container);
|
|
}
|
|
|
|
return prevComponent;
|
|
},
|
|
|
|
/**
|
|
* Register a component into the instance map and starts scroll value
|
|
* monitoring
|
|
* @param {ReactComponent} nextComponent component instance to render
|
|
* @param {DOMElement} container container to render into
|
|
* @return {string} reactRoot ID prefix
|
|
*/
|
|
_registerComponent: function (nextComponent, container) {
|
|
!(container && (container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '_registerComponent(...): Target container is not a DOM element.') : invariant(false) : undefined;
|
|
|
|
ReactBrowserEventEmitter.ensureScrollValueMonitoring();
|
|
|
|
var reactRootID = ReactMount.registerContainer(container);
|
|
instancesByReactRootID[reactRootID] = nextComponent;
|
|
return reactRootID;
|
|
},
|
|
|
|
/**
|
|
* Render a new component into the DOM.
|
|
* @param {ReactElement} nextElement element to render
|
|
* @param {DOMElement} container container to render into
|
|
* @param {boolean} shouldReuseMarkup if we should skip the markup insertion
|
|
* @return {ReactComponent} nextComponent
|
|
*/
|
|
_renderNewRootComponent: function (nextElement, container, shouldReuseMarkup, context) {
|
|
// Various parts of our code (such as ReactCompositeComponent's
|
|
// _renderValidatedComponent) assume that calls to render aren't nested;
|
|
// verify that that's the case.
|
|
process.env.NODE_ENV !== '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') : undefined;
|
|
|
|
var componentInstance = instantiateReactComponent(nextElement, null);
|
|
var reactRootID = ReactMount._registerComponent(componentInstance, container);
|
|
|
|
// The initial render is synchronous but any updates that happen during
|
|
// rendering, in componentWillMount or componentDidMount, will be batched
|
|
// according to the current batching strategy.
|
|
|
|
ReactUpdates.batchedUpdates(batchedMountComponentIntoNode, componentInstance, reactRootID, container, shouldReuseMarkup, context);
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
// Record the root element in case it later gets transplanted.
|
|
rootElementsByReactRootID[reactRootID] = getReactRootElementInContainer(container);
|
|
}
|
|
|
|
return componentInstance;
|
|
},
|
|
|
|
/**
|
|
* Renders a React component into the DOM in the supplied `container`.
|
|
*
|
|
* If the React component was previously rendered into `container`, this will
|
|
* perform an update on it and only mutate the DOM as necessary to reflect the
|
|
* latest React component.
|
|
*
|
|
* @param {ReactComponent} parentComponent The conceptual parent of this render tree.
|
|
* @param {ReactElement} nextElement Component element to render.
|
|
* @param {DOMElement} container DOM element to render into.
|
|
* @param {?function} callback function triggered on completion
|
|
* @return {ReactComponent} Component instance rendered in `container`.
|
|
*/
|
|
renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) {
|
|
!(parentComponent != null && parentComponent._reactInternalInstance != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'parentComponent must be a valid React Component') : invariant(false) : undefined;
|
|
return ReactMount._renderSubtreeIntoContainer(parentComponent, nextElement, container, callback);
|
|
},
|
|
|
|
_renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) {
|
|
!ReactElement.isValidElement(nextElement) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactDOM.render(): Invalid component element.%s', typeof nextElement === 'string' ? ' Instead of passing an element string, make sure to instantiate ' + 'it by passing it to React.createElement.' : typeof nextElement === 'function' ? ' Instead of passing a component class, make sure to instantiate ' + 'it by passing it to React.createElement.' :
|
|
// Check if it quacks like an element
|
|
nextElement != null && nextElement.props !== undefined ? ' This may be caused by unintentionally loading two independent ' + 'copies of React.' : '') : invariant(false) : undefined;
|
|
|
|
process.env.NODE_ENV !== '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.') : undefined;
|
|
|
|
var nextWrappedElement = new ReactElement(TopLevelWrapper, null, null, null, null, null, nextElement);
|
|
|
|
var prevComponent = instancesByReactRootID[getReactRootID(container)];
|
|
|
|
if (prevComponent) {
|
|
var prevWrappedElement = prevComponent._currentElement;
|
|
var prevElement = prevWrappedElement.props;
|
|
if (shouldUpdateReactComponent(prevElement, nextElement)) {
|
|
var publicInst = prevComponent._renderedComponent.getPublicInstance();
|
|
var updatedCallback = callback && function () {
|
|
callback.call(publicInst);
|
|
};
|
|
ReactMount._updateRootComponent(prevComponent, nextWrappedElement, container, updatedCallback);
|
|
return publicInst;
|
|
} else {
|
|
ReactMount.unmountComponentAtNode(container);
|
|
}
|
|
}
|
|
|
|
var reactRootElement = getReactRootElementInContainer(container);
|
|
var containerHasReactMarkup = reactRootElement && !!internalGetID(reactRootElement);
|
|
var containerHasNonRootReactChild = hasNonRootReactChild(container);
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
process.env.NODE_ENV !== '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.') : undefined;
|
|
|
|
if (!containerHasReactMarkup || reactRootElement.nextSibling) {
|
|
var rootElementSibling = reactRootElement;
|
|
while (rootElementSibling) {
|
|
if (internalGetID(rootElementSibling)) {
|
|
process.env.NODE_ENV !== '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.') : undefined;
|
|
break;
|
|
}
|
|
rootElementSibling = rootElementSibling.nextSibling;
|
|
}
|
|
}
|
|
}
|
|
|
|
var shouldReuseMarkup = containerHasReactMarkup && !prevComponent && !containerHasNonRootReactChild;
|
|
var component = ReactMount._renderNewRootComponent(nextWrappedElement, container, shouldReuseMarkup, parentComponent != null ? parentComponent._reactInternalInstance._processChildContext(parentComponent._reactInternalInstance._context) : emptyObject)._renderedComponent.getPublicInstance();
|
|
if (callback) {
|
|
callback.call(component);
|
|
}
|
|
return component;
|
|
},
|
|
|
|
/**
|
|
* Renders a React component into the DOM in the supplied `container`.
|
|
*
|
|
* If the React component was previously rendered into `container`, this will
|
|
* perform an update on it and only mutate the DOM as necessary to reflect the
|
|
* latest React component.
|
|
*
|
|
* @param {ReactElement} nextElement Component element to render.
|
|
* @param {DOMElement} container DOM element to render into.
|
|
* @param {?function} callback function triggered on completion
|
|
* @return {ReactComponent} Component instance rendered in `container`.
|
|
*/
|
|
render: function (nextElement, container, callback) {
|
|
return ReactMount._renderSubtreeIntoContainer(null, nextElement, container, callback);
|
|
},
|
|
|
|
/**
|
|
* Registers a container node into which React components will be rendered.
|
|
* This also creates the "reactRoot" ID that will be assigned to the element
|
|
* rendered within.
|
|
*
|
|
* @param {DOMElement} container DOM element to register as a container.
|
|
* @return {string} The "reactRoot" ID of elements rendered within.
|
|
*/
|
|
registerContainer: function (container) {
|
|
var reactRootID = getReactRootID(container);
|
|
if (reactRootID) {
|
|
// If one exists, make sure it is a valid "reactRoot" ID.
|
|
reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(reactRootID);
|
|
}
|
|
if (!reactRootID) {
|
|
// No valid "reactRoot" ID found, create one.
|
|
reactRootID = ReactInstanceHandles.createReactRootID();
|
|
}
|
|
containersByReactRootID[reactRootID] = container;
|
|
return reactRootID;
|
|
},
|
|
|
|
/**
|
|
* Unmounts and destroys the React component rendered in the `container`.
|
|
*
|
|
* @param {DOMElement} container DOM element containing a React component.
|
|
* @return {boolean} True if a component was found in and unmounted from
|
|
* `container`
|
|
*/
|
|
unmountComponentAtNode: function (container) {
|
|
// Various parts of our code (such as ReactCompositeComponent's
|
|
// _renderValidatedComponent) assume that calls to render aren't nested;
|
|
// verify that that's the case. (Strictly speaking, unmounting won't cause a
|
|
// render but we still don't expect to be in a render call here.)
|
|
process.env.NODE_ENV !== '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') : undefined;
|
|
|
|
!(container && (container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'unmountComponentAtNode(...): Target container is not a DOM element.') : invariant(false) : undefined;
|
|
|
|
var reactRootID = getReactRootID(container);
|
|
var component = instancesByReactRootID[reactRootID];
|
|
if (!component) {
|
|
// Check if the node being unmounted was rendered by React, but isn't a
|
|
// root node.
|
|
var containerHasNonRootReactChild = hasNonRootReactChild(container);
|
|
|
|
// Check if the container itself is a React root node.
|
|
var containerID = internalGetID(container);
|
|
var isContainerReactRoot = containerID && containerID === ReactInstanceHandles.getReactRootIDFromNodeID(containerID);
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
process.env.NODE_ENV !== '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.') : undefined;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
ReactUpdates.batchedUpdates(unmountComponentFromNode, component, container);
|
|
delete instancesByReactRootID[reactRootID];
|
|
delete containersByReactRootID[reactRootID];
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
delete rootElementsByReactRootID[reactRootID];
|
|
}
|
|
return true;
|
|
},
|
|
|
|
/**
|
|
* Finds the container DOM element that contains React component to which the
|
|
* supplied DOM `id` belongs.
|
|
*
|
|
* @param {string} id The ID of an element rendered by a React component.
|
|
* @return {?DOMElement} DOM element that contains the `id`.
|
|
*/
|
|
findReactContainerForID: function (id) {
|
|
var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(id);
|
|
var container = containersByReactRootID[reactRootID];
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
var rootElement = rootElementsByReactRootID[reactRootID];
|
|
if (rootElement && rootElement.parentNode !== container) {
|
|
process.env.NODE_ENV !== 'production' ? warning(
|
|
// Call internalGetID here because getID calls isValid which calls
|
|
// findReactContainerForID (this function).
|
|
internalGetID(rootElement) === reactRootID, 'ReactMount: Root element ID differed from reactRootID.') : undefined;
|
|
var containerChild = container.firstChild;
|
|
if (containerChild && reactRootID === internalGetID(containerChild)) {
|
|
// If the container has a new child with the same ID as the old
|
|
// root element, then rootElementsByReactRootID[reactRootID] is
|
|
// just stale and needs to be updated. The case that deserves a
|
|
// warning is when the container is empty.
|
|
rootElementsByReactRootID[reactRootID] = containerChild;
|
|
} else {
|
|
process.env.NODE_ENV !== 'production' ? warning(false, 'ReactMount: Root element has been removed from its original ' + 'container. New container: %s', rootElement.parentNode) : undefined;
|
|
}
|
|
}
|
|
}
|
|
|
|
return container;
|
|
},
|
|
|
|
/**
|
|
* Finds an element rendered by React with the supplied ID.
|
|
*
|
|
* @param {string} id ID of a DOM node in the React component.
|
|
* @return {DOMElement} Root DOM node of the React component.
|
|
*/
|
|
findReactNodeByID: function (id) {
|
|
var reactRoot = ReactMount.findReactContainerForID(id);
|
|
return ReactMount.findComponentRoot(reactRoot, id);
|
|
},
|
|
|
|
/**
|
|
* Traverses up the ancestors of the supplied node to find a node that is a
|
|
* DOM representation of a React component rendered by this copy of React.
|
|
*
|
|
* @param {*} node
|
|
* @return {?DOMEventTarget}
|
|
* @internal
|
|
*/
|
|
getFirstReactDOM: function (node) {
|
|
return findFirstReactDOMImpl(node);
|
|
},
|
|
|
|
/**
|
|
* Finds a node with the supplied `targetID` inside of the supplied
|
|
* `ancestorNode`. Exploits the ID naming scheme to perform the search
|
|
* quickly.
|
|
*
|
|
* @param {DOMEventTarget} ancestorNode Search from this root.
|
|
* @pararm {string} targetID ID of the DOM representation of the component.
|
|
* @return {DOMEventTarget} DOM node with the supplied `targetID`.
|
|
* @internal
|
|
*/
|
|
findComponentRoot: function (ancestorNode, targetID) {
|
|
var firstChildren = findComponentRootReusableArray;
|
|
var childIndex = 0;
|
|
|
|
var deepestAncestor = findDeepestCachedAncestor(targetID) || ancestorNode;
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
// This will throw on the next line; give an early warning
|
|
process.env.NODE_ENV !== 'production' ? warning(deepestAncestor != null, 'React can\'t find the root component node for data-reactid value ' + '`%s`. If you\'re seeing this message, it probably means that ' + 'you\'ve loaded two copies of React on the page. At this time, only ' + 'a single copy of React can be loaded at a time.', targetID) : undefined;
|
|
}
|
|
|
|
firstChildren[0] = deepestAncestor.firstChild;
|
|
firstChildren.length = 1;
|
|
|
|
while (childIndex < firstChildren.length) {
|
|
var child = firstChildren[childIndex++];
|
|
var targetChild;
|
|
|
|
while (child) {
|
|
var childID = ReactMount.getID(child);
|
|
if (childID) {
|
|
// Even if we find the node we're looking for, we finish looping
|
|
// through its siblings to ensure they're cached so that we don't have
|
|
// to revisit this node again. Otherwise, we make n^2 calls to getID
|
|
// when visiting the many children of a single node in order.
|
|
|
|
if (targetID === childID) {
|
|
targetChild = child;
|
|
} else if (ReactInstanceHandles.isAncestorIDOf(childID, targetID)) {
|
|
// If we find a child whose ID is an ancestor of the given ID,
|
|
// then we can be sure that we only want to search the subtree
|
|
// rooted at this child, so we can throw out the rest of the
|
|
// search state.
|
|
firstChildren.length = childIndex = 0;
|
|
firstChildren.push(child.firstChild);
|
|
}
|
|
} else {
|
|
// If this child had no ID, then there's a chance that it was
|
|
// injected automatically by the browser, as when a `<table>`
|
|
// element sprouts an extra `<tbody>` child as a side effect of
|
|
// `.innerHTML` parsing. Optimistically continue down this
|
|
// branch, but not before examining the other siblings.
|
|
firstChildren.push(child.firstChild);
|
|
}
|
|
|
|
child = child.nextSibling;
|
|
}
|
|
|
|
if (targetChild) {
|
|
// Emptying firstChildren/findComponentRootReusableArray is
|
|
// not necessary for correctness, but it helps the GC reclaim
|
|
// any nodes that were left at the end of the search.
|
|
firstChildren.length = 0;
|
|
|
|
return targetChild;
|
|
}
|
|
}
|
|
|
|
firstChildren.length = 0;
|
|
|
|
true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'findComponentRoot(..., %s): Unable to find element. This probably ' + 'means the DOM was unexpectedly mutated (e.g., by the browser), ' + 'usually due to forgetting a <tbody> when using tables, nesting tags ' + 'like <form>, <p>, or <a>, or using non-SVG elements in an <svg> ' + 'parent. ' + 'Try inspecting the child nodes of the element with React ID `%s`.', targetID, ReactMount.getID(ancestorNode)) : invariant(false) : undefined;
|
|
},
|
|
|
|
_mountImageIntoNode: function (markup, container, shouldReuseMarkup, transaction) {
|
|
!(container && (container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'mountComponentIntoNode(...): Target container is not valid.') : invariant(false) : undefined;
|
|
|
|
if (shouldReuseMarkup) {
|
|
var rootElement = getReactRootElementInContainer(container);
|
|
if (ReactMarkupChecksum.canReuseMarkup(markup, rootElement)) {
|
|
return;
|
|
} else {
|
|
var checksum = rootElement.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
|
|
rootElement.removeAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
|
|
|
|
var rootMarkup = rootElement.outerHTML;
|
|
rootElement.setAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME, checksum);
|
|
|
|
var normalizedMarkup = markup;
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
// because rootMarkup is retrieved from the DOM, various normalizations
|
|
// will have occurred which will not be present in `markup`. Here,
|
|
// insert markup into a <div> or <iframe> depending on the container
|
|
// type to perform the same normalizations before comparing.
|
|
var normalizer;
|
|
if (container.nodeType === ELEMENT_NODE_TYPE) {
|
|
normalizer = document.createElement('div');
|
|
normalizer.innerHTML = markup;
|
|
normalizedMarkup = normalizer.innerHTML;
|
|
} else {
|
|
normalizer = document.createElement('iframe');
|
|
document.body.appendChild(normalizer);
|
|
normalizer.contentDocument.write(markup);
|
|
normalizedMarkup = normalizer.contentDocument.documentElement.outerHTML;
|
|
document.body.removeChild(normalizer);
|
|
}
|
|
}
|
|
|
|
var diffIndex = firstDifferenceIndex(normalizedMarkup, rootMarkup);
|
|
var difference = ' (client) ' + normalizedMarkup.substring(diffIndex - 20, diffIndex + 20) + '\n (server) ' + rootMarkup.substring(diffIndex - 20, diffIndex + 20);
|
|
|
|
!(container.nodeType !== DOC_NODE_TYPE) ? process.env.NODE_ENV !== '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) : invariant(false) : undefined;
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
process.env.NODE_ENV !== '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) : undefined;
|
|
}
|
|
}
|
|
}
|
|
|
|
!(container.nodeType !== DOC_NODE_TYPE) ? process.env.NODE_ENV !== '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.') : invariant(false) : undefined;
|
|
|
|
if (transaction.useCreateElement) {
|
|
while (container.lastChild) {
|
|
container.removeChild(container.lastChild);
|
|
}
|
|
container.appendChild(markup);
|
|
} else {
|
|
setInnerHTML(container, markup);
|
|
}
|
|
},
|
|
|
|
ownerDocumentContextKey: ownerDocumentContextKey,
|
|
|
|
/**
|
|
* React ID utilities.
|
|
*/
|
|
|
|
getReactRootID: getReactRootID,
|
|
|
|
getID: getID,
|
|
|
|
setID: setID,
|
|
|
|
getNode: getNode,
|
|
|
|
getNodeFromInstance: getNodeFromInstance,
|
|
|
|
isValid: isValid,
|
|
|
|
purgeID: purgeID
|
|
};
|
|
|
|
ReactPerf.measureMethods(ReactMount, 'ReactMount', {
|
|
_renderNewRootComponent: '_renderNewRootComponent',
|
|
_mountImageIntoNode: '_mountImageIntoNode'
|
|
});
|
|
|
|
module.exports = ReactMount;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 28 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactBrowserEventEmitter
|
|
* @typechecks static-only
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var EventConstants = __webpack_require__(29);
|
|
var EventPluginHub = __webpack_require__(30);
|
|
var EventPluginRegistry = __webpack_require__(31);
|
|
var ReactEventEmitterMixin = __webpack_require__(36);
|
|
var ReactPerf = __webpack_require__(17);
|
|
var ViewportMetrics = __webpack_require__(37);
|
|
|
|
var assign = __webpack_require__(38);
|
|
var isEventSupported = __webpack_require__(39);
|
|
|
|
/**
|
|
* Summary of `ReactBrowserEventEmitter` event handling:
|
|
*
|
|
* - Top-level delegation is used to trap most native browser events. This
|
|
* may only occur in the main thread and is the responsibility of
|
|
* ReactEventListener, which is injected and can therefore support pluggable
|
|
* event sources. This is the only work that occurs in the main thread.
|
|
*
|
|
* - We normalize and de-duplicate events to account for browser quirks. This
|
|
* may be done in the worker thread.
|
|
*
|
|
* - Forward these native events (with the associated top-level type used to
|
|
* trap it) to `EventPluginHub`, which in turn will ask plugins if they want
|
|
* to extract any synthetic events.
|
|
*
|
|
* - The `EventPluginHub` will then process each event by annotating them with
|
|
* "dispatches", a sequence of listeners and IDs that care about that event.
|
|
*
|
|
* - The `EventPluginHub` then dispatches the events.
|
|
*
|
|
* Overview of React and the event system:
|
|
*
|
|
* +------------+ .
|
|
* | DOM | .
|
|
* +------------+ .
|
|
* | .
|
|
* v .
|
|
* +------------+ .
|
|
* | ReactEvent | .
|
|
* | Listener | .
|
|
* +------------+ . +-----------+
|
|
* | . +--------+|SimpleEvent|
|
|
* | . | |Plugin |
|
|
* +-----|------+ . v +-----------+
|
|
* | | | . +--------------+ +------------+
|
|
* | +-----------.--->|EventPluginHub| | Event |
|
|
* | | . | | +-----------+ | Propagators|
|
|
* | ReactEvent | . | | |TapEvent | |------------|
|
|
* | Emitter | . | |<---+|Plugin | |other plugin|
|
|
* | | . | | +-----------+ | utilities |
|
|
* | +-----------.--->| | +------------+
|
|
* | | | . +--------------+
|
|
* +-----|------+ . ^ +-----------+
|
|
* | . | |Enter/Leave|
|
|
* + . +-------+|Plugin |
|
|
* +-------------+ . +-----------+
|
|
* | application | .
|
|
* |-------------| .
|
|
* | | .
|
|
* | | .
|
|
* +-------------+ .
|
|
* .
|
|
* React Core . General Purpose Event Plugin System
|
|
*/
|
|
|
|
var alreadyListeningTo = {};
|
|
var isMonitoringScrollValue = false;
|
|
var reactTopListenersCounter = 0;
|
|
|
|
// For events like 'submit' which don't consistently bubble (which we trap at a
|
|
// lower node than `document`), binding at `document` would cause duplicate
|
|
// events so we don't include them here
|
|
var topEventMapping = {
|
|
topAbort: 'abort',
|
|
topBlur: 'blur',
|
|
topCanPlay: 'canplay',
|
|
topCanPlayThrough: 'canplaythrough',
|
|
topChange: 'change',
|
|
topClick: 'click',
|
|
topCompositionEnd: 'compositionend',
|
|
topCompositionStart: 'compositionstart',
|
|
topCompositionUpdate: 'compositionupdate',
|
|
topContextMenu: 'contextmenu',
|
|
topCopy: 'copy',
|
|
topCut: 'cut',
|
|
topDoubleClick: 'dblclick',
|
|
topDrag: 'drag',
|
|
topDragEnd: 'dragend',
|
|
topDragEnter: 'dragenter',
|
|
topDragExit: 'dragexit',
|
|
topDragLeave: 'dragleave',
|
|
topDragOver: 'dragover',
|
|
topDragStart: 'dragstart',
|
|
topDrop: 'drop',
|
|
topDurationChange: 'durationchange',
|
|
topEmptied: 'emptied',
|
|
topEncrypted: 'encrypted',
|
|
topEnded: 'ended',
|
|
topError: 'error',
|
|
topFocus: 'focus',
|
|
topInput: 'input',
|
|
topKeyDown: 'keydown',
|
|
topKeyPress: 'keypress',
|
|
topKeyUp: 'keyup',
|
|
topLoadedData: 'loadeddata',
|
|
topLoadedMetadata: 'loadedmetadata',
|
|
topLoadStart: 'loadstart',
|
|
topMouseDown: 'mousedown',
|
|
topMouseMove: 'mousemove',
|
|
topMouseOut: 'mouseout',
|
|
topMouseOver: 'mouseover',
|
|
topMouseUp: 'mouseup',
|
|
topPaste: 'paste',
|
|
topPause: 'pause',
|
|
topPlay: 'play',
|
|
topPlaying: 'playing',
|
|
topProgress: 'progress',
|
|
topRateChange: 'ratechange',
|
|
topScroll: 'scroll',
|
|
topSeeked: 'seeked',
|
|
topSeeking: 'seeking',
|
|
topSelectionChange: 'selectionchange',
|
|
topStalled: 'stalled',
|
|
topSuspend: 'suspend',
|
|
topTextInput: 'textInput',
|
|
topTimeUpdate: 'timeupdate',
|
|
topTouchCancel: 'touchcancel',
|
|
topTouchEnd: 'touchend',
|
|
topTouchMove: 'touchmove',
|
|
topTouchStart: 'touchstart',
|
|
topVolumeChange: 'volumechange',
|
|
topWaiting: 'waiting',
|
|
topWheel: 'wheel'
|
|
};
|
|
|
|
/**
|
|
* To ensure no conflicts with other potential React instances on the page
|
|
*/
|
|
var topListenersIDKey = '_reactListenersID' + String(Math.random()).slice(2);
|
|
|
|
function getListeningForDocument(mountAt) {
|
|
// In IE8, `mountAt` is a host object and doesn't have `hasOwnProperty`
|
|
// directly.
|
|
if (!Object.prototype.hasOwnProperty.call(mountAt, topListenersIDKey)) {
|
|
mountAt[topListenersIDKey] = reactTopListenersCounter++;
|
|
alreadyListeningTo[mountAt[topListenersIDKey]] = {};
|
|
}
|
|
return alreadyListeningTo[mountAt[topListenersIDKey]];
|
|
}
|
|
|
|
/**
|
|
* `ReactBrowserEventEmitter` is used to attach top-level event listeners. For
|
|
* example:
|
|
*
|
|
* ReactBrowserEventEmitter.putListener('myID', 'onClick', myFunction);
|
|
*
|
|
* This would allocate a "registration" of `('onClick', myFunction)` on 'myID'.
|
|
*
|
|
* @internal
|
|
*/
|
|
var ReactBrowserEventEmitter = assign({}, ReactEventEmitterMixin, {
|
|
|
|
/**
|
|
* Injectable event backend
|
|
*/
|
|
ReactEventListener: null,
|
|
|
|
injection: {
|
|
/**
|
|
* @param {object} ReactEventListener
|
|
*/
|
|
injectReactEventListener: function (ReactEventListener) {
|
|
ReactEventListener.setHandleTopLevel(ReactBrowserEventEmitter.handleTopLevel);
|
|
ReactBrowserEventEmitter.ReactEventListener = ReactEventListener;
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Sets whether or not any created callbacks should be enabled.
|
|
*
|
|
* @param {boolean} enabled True if callbacks should be enabled.
|
|
*/
|
|
setEnabled: function (enabled) {
|
|
if (ReactBrowserEventEmitter.ReactEventListener) {
|
|
ReactBrowserEventEmitter.ReactEventListener.setEnabled(enabled);
|
|
}
|
|
},
|
|
|
|
/**
|
|
* @return {boolean} True if callbacks are enabled.
|
|
*/
|
|
isEnabled: function () {
|
|
return !!(ReactBrowserEventEmitter.ReactEventListener && ReactBrowserEventEmitter.ReactEventListener.isEnabled());
|
|
},
|
|
|
|
/**
|
|
* We listen for bubbled touch events on the document object.
|
|
*
|
|
* Firefox v8.01 (and possibly others) exhibited strange behavior when
|
|
* mounting `onmousemove` events at some node that was not the document
|
|
* element. The symptoms were that if your mouse is not moving over something
|
|
* contained within that mount point (for example on the background) the
|
|
* top-level listeners for `onmousemove` won't be called. However, if you
|
|
* register the `mousemove` on the document object, then it will of course
|
|
* catch all `mousemove`s. This along with iOS quirks, justifies restricting
|
|
* top-level listeners to the document object only, at least for these
|
|
* movement types of events and possibly all events.
|
|
*
|
|
* @see http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
|
|
*
|
|
* Also, `keyup`/`keypress`/`keydown` do not bubble to the window on IE, but
|
|
* they bubble to document.
|
|
*
|
|
* @param {string} registrationName Name of listener (e.g. `onClick`).
|
|
* @param {object} contentDocumentHandle Document which owns the container
|
|
*/
|
|
listenTo: function (registrationName, contentDocumentHandle) {
|
|
var mountAt = contentDocumentHandle;
|
|
var isListening = getListeningForDocument(mountAt);
|
|
var dependencies = EventPluginRegistry.registrationNameDependencies[registrationName];
|
|
|
|
var topLevelTypes = EventConstants.topLevelTypes;
|
|
for (var i = 0; i < dependencies.length; i++) {
|
|
var dependency = dependencies[i];
|
|
if (!(isListening.hasOwnProperty(dependency) && isListening[dependency])) {
|
|
if (dependency === topLevelTypes.topWheel) {
|
|
if (isEventSupported('wheel')) {
|
|
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'wheel', mountAt);
|
|
} else if (isEventSupported('mousewheel')) {
|
|
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'mousewheel', mountAt);
|
|
} else {
|
|
// Firefox needs to capture a different mouse scroll event.
|
|
// @see http://www.quirksmode.org/dom/events/tests/scroll.html
|
|
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'DOMMouseScroll', mountAt);
|
|
}
|
|
} else if (dependency === topLevelTypes.topScroll) {
|
|
|
|
if (isEventSupported('scroll', true)) {
|
|
ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topScroll, 'scroll', mountAt);
|
|
} else {
|
|
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topScroll, 'scroll', ReactBrowserEventEmitter.ReactEventListener.WINDOW_HANDLE);
|
|
}
|
|
} else if (dependency === topLevelTypes.topFocus || dependency === topLevelTypes.topBlur) {
|
|
|
|
if (isEventSupported('focus', true)) {
|
|
ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topFocus, 'focus', mountAt);
|
|
ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topBlur, 'blur', mountAt);
|
|
} else if (isEventSupported('focusin')) {
|
|
// IE has `focusin` and `focusout` events which bubble.
|
|
// @see http://www.quirksmode.org/blog/archives/2008/04/delegating_the.html
|
|
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topFocus, 'focusin', mountAt);
|
|
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topBlur, 'focusout', mountAt);
|
|
}
|
|
|
|
// to make sure blur and focus event listeners are only attached once
|
|
isListening[topLevelTypes.topBlur] = true;
|
|
isListening[topLevelTypes.topFocus] = true;
|
|
} else if (topEventMapping.hasOwnProperty(dependency)) {
|
|
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(dependency, topEventMapping[dependency], mountAt);
|
|
}
|
|
|
|
isListening[dependency] = true;
|
|
}
|
|
}
|
|
},
|
|
|
|
trapBubbledEvent: function (topLevelType, handlerBaseName, handle) {
|
|
return ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelType, handlerBaseName, handle);
|
|
},
|
|
|
|
trapCapturedEvent: function (topLevelType, handlerBaseName, handle) {
|
|
return ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelType, handlerBaseName, handle);
|
|
},
|
|
|
|
/**
|
|
* Listens to window scroll and resize events. We cache scroll values so that
|
|
* application code can access them without triggering reflows.
|
|
*
|
|
* NOTE: Scroll events do not bubble.
|
|
*
|
|
* @see http://www.quirksmode.org/dom/events/scroll.html
|
|
*/
|
|
ensureScrollValueMonitoring: function () {
|
|
if (!isMonitoringScrollValue) {
|
|
var refresh = ViewportMetrics.refreshScrollValues;
|
|
ReactBrowserEventEmitter.ReactEventListener.monitorScrollValue(refresh);
|
|
isMonitoringScrollValue = true;
|
|
}
|
|
},
|
|
|
|
eventNameDispatchConfigs: EventPluginHub.eventNameDispatchConfigs,
|
|
|
|
registrationNameModules: EventPluginHub.registrationNameModules,
|
|
|
|
putListener: EventPluginHub.putListener,
|
|
|
|
getListener: EventPluginHub.getListener,
|
|
|
|
deleteListener: EventPluginHub.deleteListener,
|
|
|
|
deleteAllListeners: EventPluginHub.deleteAllListeners
|
|
|
|
});
|
|
|
|
ReactPerf.measureMethods(ReactBrowserEventEmitter, 'ReactBrowserEventEmitter', {
|
|
putListener: 'putListener',
|
|
deleteListener: 'deleteListener'
|
|
});
|
|
|
|
module.exports = ReactBrowserEventEmitter;
|
|
|
|
/***/ },
|
|
/* 29 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule EventConstants
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var keyMirror = __webpack_require__(16);
|
|
|
|
var PropagationPhases = keyMirror({ bubbled: null, captured: null });
|
|
|
|
/**
|
|
* Types of raw signals from the browser caught at the top level.
|
|
*/
|
|
var topLevelTypes = keyMirror({
|
|
topAbort: null,
|
|
topBlur: null,
|
|
topCanPlay: null,
|
|
topCanPlayThrough: null,
|
|
topChange: null,
|
|
topClick: null,
|
|
topCompositionEnd: null,
|
|
topCompositionStart: null,
|
|
topCompositionUpdate: null,
|
|
topContextMenu: null,
|
|
topCopy: null,
|
|
topCut: null,
|
|
topDoubleClick: null,
|
|
topDrag: null,
|
|
topDragEnd: null,
|
|
topDragEnter: null,
|
|
topDragExit: null,
|
|
topDragLeave: null,
|
|
topDragOver: null,
|
|
topDragStart: null,
|
|
topDrop: null,
|
|
topDurationChange: null,
|
|
topEmptied: null,
|
|
topEncrypted: null,
|
|
topEnded: null,
|
|
topError: null,
|
|
topFocus: null,
|
|
topInput: null,
|
|
topKeyDown: null,
|
|
topKeyPress: null,
|
|
topKeyUp: null,
|
|
topLoad: null,
|
|
topLoadedData: null,
|
|
topLoadedMetadata: null,
|
|
topLoadStart: null,
|
|
topMouseDown: null,
|
|
topMouseMove: null,
|
|
topMouseOut: null,
|
|
topMouseOver: null,
|
|
topMouseUp: null,
|
|
topPaste: null,
|
|
topPause: null,
|
|
topPlay: null,
|
|
topPlaying: null,
|
|
topProgress: null,
|
|
topRateChange: null,
|
|
topReset: null,
|
|
topScroll: null,
|
|
topSeeked: null,
|
|
topSeeking: null,
|
|
topSelectionChange: null,
|
|
topStalled: null,
|
|
topSubmit: null,
|
|
topSuspend: null,
|
|
topTextInput: null,
|
|
topTimeUpdate: null,
|
|
topTouchCancel: null,
|
|
topTouchEnd: null,
|
|
topTouchMove: null,
|
|
topTouchStart: null,
|
|
topVolumeChange: null,
|
|
topWaiting: null,
|
|
topWheel: null
|
|
});
|
|
|
|
var EventConstants = {
|
|
topLevelTypes: topLevelTypes,
|
|
PropagationPhases: PropagationPhases
|
|
};
|
|
|
|
module.exports = EventConstants;
|
|
|
|
/***/ },
|
|
/* 30 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule EventPluginHub
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var EventPluginRegistry = __webpack_require__(31);
|
|
var EventPluginUtils = __webpack_require__(32);
|
|
var ReactErrorUtils = __webpack_require__(33);
|
|
|
|
var accumulateInto = __webpack_require__(34);
|
|
var forEachAccumulated = __webpack_require__(35);
|
|
var invariant = __webpack_require__(12);
|
|
var warning = __webpack_require__(24);
|
|
|
|
/**
|
|
* Internal store for event listeners
|
|
*/
|
|
var listenerBank = {};
|
|
|
|
/**
|
|
* Internal queue of events that have accumulated their dispatches and are
|
|
* waiting to have their dispatches executed.
|
|
*/
|
|
var eventQueue = null;
|
|
|
|
/**
|
|
* Dispatches an event and releases it back into the pool, unless persistent.
|
|
*
|
|
* @param {?object} event Synthetic event to be dispatched.
|
|
* @param {boolean} simulated If the event is simulated (changes exn behavior)
|
|
* @private
|
|
*/
|
|
var executeDispatchesAndRelease = function (event, simulated) {
|
|
if (event) {
|
|
EventPluginUtils.executeDispatchesInOrder(event, simulated);
|
|
|
|
if (!event.isPersistent()) {
|
|
event.constructor.release(event);
|
|
}
|
|
}
|
|
};
|
|
var executeDispatchesAndReleaseSimulated = function (e) {
|
|
return executeDispatchesAndRelease(e, true);
|
|
};
|
|
var executeDispatchesAndReleaseTopLevel = function (e) {
|
|
return executeDispatchesAndRelease(e, false);
|
|
};
|
|
|
|
/**
|
|
* - `InstanceHandle`: [required] Module that performs logical traversals of DOM
|
|
* hierarchy given ids of the logical DOM elements involved.
|
|
*/
|
|
var InstanceHandle = null;
|
|
|
|
function validateInstanceHandle() {
|
|
var valid = InstanceHandle && InstanceHandle.traverseTwoPhase && InstanceHandle.traverseEnterLeave;
|
|
process.env.NODE_ENV !== 'production' ? warning(valid, 'InstanceHandle not injected before use!') : undefined;
|
|
}
|
|
|
|
/**
|
|
* This is a unified interface for event plugins to be installed and configured.
|
|
*
|
|
* Event plugins can implement the following properties:
|
|
*
|
|
* `extractEvents` {function(string, DOMEventTarget, string, object): *}
|
|
* Required. When a top-level event is fired, this method is expected to
|
|
* extract synthetic events that will in turn be queued and dispatched.
|
|
*
|
|
* `eventTypes` {object}
|
|
* Optional, plugins that fire events must publish a mapping of registration
|
|
* names that are used to register listeners. Values of this mapping must
|
|
* be objects that contain `registrationName` or `phasedRegistrationNames`.
|
|
*
|
|
* `executeDispatch` {function(object, function, string)}
|
|
* Optional, allows plugins to override how an event gets dispatched. By
|
|
* default, the listener is simply invoked.
|
|
*
|
|
* Each plugin that is injected into `EventsPluginHub` is immediately operable.
|
|
*
|
|
* @public
|
|
*/
|
|
var EventPluginHub = {
|
|
|
|
/**
|
|
* Methods for injecting dependencies.
|
|
*/
|
|
injection: {
|
|
|
|
/**
|
|
* @param {object} InjectedMount
|
|
* @public
|
|
*/
|
|
injectMount: EventPluginUtils.injection.injectMount,
|
|
|
|
/**
|
|
* @param {object} InjectedInstanceHandle
|
|
* @public
|
|
*/
|
|
injectInstanceHandle: function (InjectedInstanceHandle) {
|
|
InstanceHandle = InjectedInstanceHandle;
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
validateInstanceHandle();
|
|
}
|
|
},
|
|
|
|
getInstanceHandle: function () {
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
validateInstanceHandle();
|
|
}
|
|
return InstanceHandle;
|
|
},
|
|
|
|
/**
|
|
* @param {array} InjectedEventPluginOrder
|
|
* @public
|
|
*/
|
|
injectEventPluginOrder: EventPluginRegistry.injectEventPluginOrder,
|
|
|
|
/**
|
|
* @param {object} injectedNamesToPlugins Map from names to plugin modules.
|
|
*/
|
|
injectEventPluginsByName: EventPluginRegistry.injectEventPluginsByName
|
|
|
|
},
|
|
|
|
eventNameDispatchConfigs: EventPluginRegistry.eventNameDispatchConfigs,
|
|
|
|
registrationNameModules: EventPluginRegistry.registrationNameModules,
|
|
|
|
/**
|
|
* Stores `listener` at `listenerBank[registrationName][id]`. Is idempotent.
|
|
*
|
|
* @param {string} id ID of the DOM element.
|
|
* @param {string} registrationName Name of listener (e.g. `onClick`).
|
|
* @param {?function} listener The callback to store.
|
|
*/
|
|
putListener: function (id, registrationName, listener) {
|
|
!(typeof listener === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected %s listener to be a function, instead got type %s', registrationName, typeof listener) : invariant(false) : undefined;
|
|
|
|
var bankForRegistrationName = listenerBank[registrationName] || (listenerBank[registrationName] = {});
|
|
bankForRegistrationName[id] = listener;
|
|
|
|
var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
|
|
if (PluginModule && PluginModule.didPutListener) {
|
|
PluginModule.didPutListener(id, registrationName, listener);
|
|
}
|
|
},
|
|
|
|
/**
|
|
* @param {string} id ID of the DOM element.
|
|
* @param {string} registrationName Name of listener (e.g. `onClick`).
|
|
* @return {?function} The stored callback.
|
|
*/
|
|
getListener: function (id, registrationName) {
|
|
var bankForRegistrationName = listenerBank[registrationName];
|
|
return bankForRegistrationName && bankForRegistrationName[id];
|
|
},
|
|
|
|
/**
|
|
* Deletes a listener from the registration bank.
|
|
*
|
|
* @param {string} id ID of the DOM element.
|
|
* @param {string} registrationName Name of listener (e.g. `onClick`).
|
|
*/
|
|
deleteListener: function (id, registrationName) {
|
|
var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
|
|
if (PluginModule && PluginModule.willDeleteListener) {
|
|
PluginModule.willDeleteListener(id, registrationName);
|
|
}
|
|
|
|
var bankForRegistrationName = listenerBank[registrationName];
|
|
// TODO: This should never be null -- when is it?
|
|
if (bankForRegistrationName) {
|
|
delete bankForRegistrationName[id];
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Deletes all listeners for the DOM element with the supplied ID.
|
|
*
|
|
* @param {string} id ID of the DOM element.
|
|
*/
|
|
deleteAllListeners: function (id) {
|
|
for (var registrationName in listenerBank) {
|
|
if (!listenerBank[registrationName][id]) {
|
|
continue;
|
|
}
|
|
|
|
var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
|
|
if (PluginModule && PluginModule.willDeleteListener) {
|
|
PluginModule.willDeleteListener(id, registrationName);
|
|
}
|
|
|
|
delete listenerBank[registrationName][id];
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Allows registered plugins an opportunity to extract events from top-level
|
|
* native browser events.
|
|
*
|
|
* @param {string} topLevelType Record from `EventConstants`.
|
|
* @param {DOMEventTarget} topLevelTarget The listening component root node.
|
|
* @param {string} topLevelTargetID ID of `topLevelTarget`.
|
|
* @param {object} nativeEvent Native browser event.
|
|
* @return {*} An accumulation of synthetic events.
|
|
* @internal
|
|
*/
|
|
extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
|
|
var events;
|
|
var plugins = EventPluginRegistry.plugins;
|
|
for (var i = 0; i < plugins.length; i++) {
|
|
// Not every plugin in the ordering may be loaded at runtime.
|
|
var possiblePlugin = plugins[i];
|
|
if (possiblePlugin) {
|
|
var extractedEvents = possiblePlugin.extractEvents(topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget);
|
|
if (extractedEvents) {
|
|
events = accumulateInto(events, extractedEvents);
|
|
}
|
|
}
|
|
}
|
|
return events;
|
|
},
|
|
|
|
/**
|
|
* Enqueues a synthetic event that should be dispatched when
|
|
* `processEventQueue` is invoked.
|
|
*
|
|
* @param {*} events An accumulation of synthetic events.
|
|
* @internal
|
|
*/
|
|
enqueueEvents: function (events) {
|
|
if (events) {
|
|
eventQueue = accumulateInto(eventQueue, events);
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Dispatches all synthetic events on the event queue.
|
|
*
|
|
* @internal
|
|
*/
|
|
processEventQueue: function (simulated) {
|
|
// Set `eventQueue` to null before processing it so that we can tell if more
|
|
// events get enqueued while processing.
|
|
var processingEventQueue = eventQueue;
|
|
eventQueue = null;
|
|
if (simulated) {
|
|
forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated);
|
|
} else {
|
|
forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);
|
|
}
|
|
!!eventQueue ? process.env.NODE_ENV !== 'production' ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing ' + 'an event queue. Support for this has not yet been implemented.') : invariant(false) : undefined;
|
|
// This would be a good time to rethrow if any of the event handlers threw.
|
|
ReactErrorUtils.rethrowCaughtError();
|
|
},
|
|
|
|
/**
|
|
* These are needed for tests only. Do not use!
|
|
*/
|
|
__purge: function () {
|
|
listenerBank = {};
|
|
},
|
|
|
|
__getListenerBank: function () {
|
|
return listenerBank;
|
|
}
|
|
|
|
};
|
|
|
|
module.exports = EventPluginHub;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 31 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule EventPluginRegistry
|
|
* @typechecks static-only
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var invariant = __webpack_require__(12);
|
|
|
|
/**
|
|
* Injectable ordering of event plugins.
|
|
*/
|
|
var EventPluginOrder = null;
|
|
|
|
/**
|
|
* Injectable mapping from names to event plugin modules.
|
|
*/
|
|
var namesToPlugins = {};
|
|
|
|
/**
|
|
* Recomputes the plugin list using the injected plugins and plugin ordering.
|
|
*
|
|
* @private
|
|
*/
|
|
function recomputePluginOrdering() {
|
|
if (!EventPluginOrder) {
|
|
// Wait until an `EventPluginOrder` is injected.
|
|
return;
|
|
}
|
|
for (var pluginName in namesToPlugins) {
|
|
var PluginModule = namesToPlugins[pluginName];
|
|
var pluginIndex = EventPluginOrder.indexOf(pluginName);
|
|
!(pluginIndex > -1) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in ' + 'the plugin ordering, `%s`.', pluginName) : invariant(false) : undefined;
|
|
if (EventPluginRegistry.plugins[pluginIndex]) {
|
|
continue;
|
|
}
|
|
!PluginModule.extractEvents ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` ' + 'method, but `%s` does not.', pluginName) : invariant(false) : undefined;
|
|
EventPluginRegistry.plugins[pluginIndex] = PluginModule;
|
|
var publishedEvents = PluginModule.eventTypes;
|
|
for (var eventName in publishedEvents) {
|
|
!publishEventForPlugin(publishedEvents[eventName], PluginModule, eventName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : invariant(false) : undefined;
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Publishes an event so that it can be dispatched by the supplied plugin.
|
|
*
|
|
* @param {object} dispatchConfig Dispatch configuration for the event.
|
|
* @param {object} PluginModule Plugin publishing the event.
|
|
* @return {boolean} True if the event was successfully published.
|
|
* @private
|
|
*/
|
|
function publishEventForPlugin(dispatchConfig, PluginModule, eventName) {
|
|
!!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same ' + 'event name, `%s`.', eventName) : invariant(false) : undefined;
|
|
EventPluginRegistry.eventNameDispatchConfigs[eventName] = dispatchConfig;
|
|
|
|
var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
|
|
if (phasedRegistrationNames) {
|
|
for (var phaseName in phasedRegistrationNames) {
|
|
if (phasedRegistrationNames.hasOwnProperty(phaseName)) {
|
|
var phasedRegistrationName = phasedRegistrationNames[phaseName];
|
|
publishRegistrationName(phasedRegistrationName, PluginModule, eventName);
|
|
}
|
|
}
|
|
return true;
|
|
} else if (dispatchConfig.registrationName) {
|
|
publishRegistrationName(dispatchConfig.registrationName, PluginModule, eventName);
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
/**
|
|
* Publishes a registration name that is used to identify dispatched events and
|
|
* can be used with `EventPluginHub.putListener` to register listeners.
|
|
*
|
|
* @param {string} registrationName Registration name to add.
|
|
* @param {object} PluginModule Plugin publishing the event.
|
|
* @private
|
|
*/
|
|
function publishRegistrationName(registrationName, PluginModule, eventName) {
|
|
!!EventPluginRegistry.registrationNameModules[registrationName] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same ' + 'registration name, `%s`.', registrationName) : invariant(false) : undefined;
|
|
EventPluginRegistry.registrationNameModules[registrationName] = PluginModule;
|
|
EventPluginRegistry.registrationNameDependencies[registrationName] = PluginModule.eventTypes[eventName].dependencies;
|
|
}
|
|
|
|
/**
|
|
* Registers plugins so that they can extract and dispatch events.
|
|
*
|
|
* @see {EventPluginHub}
|
|
*/
|
|
var EventPluginRegistry = {
|
|
|
|
/**
|
|
* Ordered list of injected plugins.
|
|
*/
|
|
plugins: [],
|
|
|
|
/**
|
|
* Mapping from event name to dispatch config
|
|
*/
|
|
eventNameDispatchConfigs: {},
|
|
|
|
/**
|
|
* Mapping from registration name to plugin module
|
|
*/
|
|
registrationNameModules: {},
|
|
|
|
/**
|
|
* Mapping from registration name to event name
|
|
*/
|
|
registrationNameDependencies: {},
|
|
|
|
/**
|
|
* Injects an ordering of plugins (by plugin name). This allows the ordering
|
|
* to be decoupled from injection of the actual plugins so that ordering is
|
|
* always deterministic regardless of packaging, on-the-fly injection, etc.
|
|
*
|
|
* @param {array} InjectedEventPluginOrder
|
|
* @internal
|
|
* @see {EventPluginHub.injection.injectEventPluginOrder}
|
|
*/
|
|
injectEventPluginOrder: function (InjectedEventPluginOrder) {
|
|
!!EventPluginOrder ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugin ordering more than ' + 'once. You are likely trying to load more than one copy of React.') : invariant(false) : undefined;
|
|
// Clone the ordering so it cannot be dynamically mutated.
|
|
EventPluginOrder = Array.prototype.slice.call(InjectedEventPluginOrder);
|
|
recomputePluginOrdering();
|
|
},
|
|
|
|
/**
|
|
* Injects plugins to be used by `EventPluginHub`. The plugin names must be
|
|
* in the ordering injected by `injectEventPluginOrder`.
|
|
*
|
|
* Plugins can be injected as part of page initialization or on-the-fly.
|
|
*
|
|
* @param {object} injectedNamesToPlugins Map from names to plugin modules.
|
|
* @internal
|
|
* @see {EventPluginHub.injection.injectEventPluginsByName}
|
|
*/
|
|
injectEventPluginsByName: function (injectedNamesToPlugins) {
|
|
var isOrderingDirty = false;
|
|
for (var pluginName in injectedNamesToPlugins) {
|
|
if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) {
|
|
continue;
|
|
}
|
|
var PluginModule = injectedNamesToPlugins[pluginName];
|
|
if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== PluginModule) {
|
|
!!namesToPlugins[pluginName] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject two different event plugins ' + 'using the same name, `%s`.', pluginName) : invariant(false) : undefined;
|
|
namesToPlugins[pluginName] = PluginModule;
|
|
isOrderingDirty = true;
|
|
}
|
|
}
|
|
if (isOrderingDirty) {
|
|
recomputePluginOrdering();
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Looks up the plugin for the supplied event.
|
|
*
|
|
* @param {object} event A synthetic event.
|
|
* @return {?object} The plugin that created the supplied event.
|
|
* @internal
|
|
*/
|
|
getPluginModuleForEvent: function (event) {
|
|
var dispatchConfig = event.dispatchConfig;
|
|
if (dispatchConfig.registrationName) {
|
|
return EventPluginRegistry.registrationNameModules[dispatchConfig.registrationName] || null;
|
|
}
|
|
for (var phase in dispatchConfig.phasedRegistrationNames) {
|
|
if (!dispatchConfig.phasedRegistrationNames.hasOwnProperty(phase)) {
|
|
continue;
|
|
}
|
|
var PluginModule = EventPluginRegistry.registrationNameModules[dispatchConfig.phasedRegistrationNames[phase]];
|
|
if (PluginModule) {
|
|
return PluginModule;
|
|
}
|
|
}
|
|
return null;
|
|
},
|
|
|
|
/**
|
|
* Exposed for unit testing.
|
|
* @private
|
|
*/
|
|
_resetEventPlugins: function () {
|
|
EventPluginOrder = null;
|
|
for (var pluginName in namesToPlugins) {
|
|
if (namesToPlugins.hasOwnProperty(pluginName)) {
|
|
delete namesToPlugins[pluginName];
|
|
}
|
|
}
|
|
EventPluginRegistry.plugins.length = 0;
|
|
|
|
var eventNameDispatchConfigs = EventPluginRegistry.eventNameDispatchConfigs;
|
|
for (var eventName in eventNameDispatchConfigs) {
|
|
if (eventNameDispatchConfigs.hasOwnProperty(eventName)) {
|
|
delete eventNameDispatchConfigs[eventName];
|
|
}
|
|
}
|
|
|
|
var registrationNameModules = EventPluginRegistry.registrationNameModules;
|
|
for (var registrationName in registrationNameModules) {
|
|
if (registrationNameModules.hasOwnProperty(registrationName)) {
|
|
delete registrationNameModules[registrationName];
|
|
}
|
|
}
|
|
}
|
|
|
|
};
|
|
|
|
module.exports = EventPluginRegistry;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 32 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule EventPluginUtils
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var EventConstants = __webpack_require__(29);
|
|
var ReactErrorUtils = __webpack_require__(33);
|
|
|
|
var invariant = __webpack_require__(12);
|
|
var warning = __webpack_require__(24);
|
|
|
|
/**
|
|
* Injected dependencies:
|
|
*/
|
|
|
|
/**
|
|
* - `Mount`: [required] Module that can convert between React dom IDs and
|
|
* actual node references.
|
|
*/
|
|
var injection = {
|
|
Mount: null,
|
|
injectMount: function (InjectedMount) {
|
|
injection.Mount = InjectedMount;
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
process.env.NODE_ENV !== 'production' ? warning(InjectedMount && InjectedMount.getNode && InjectedMount.getID, 'EventPluginUtils.injection.injectMount(...): Injected Mount ' + 'module is missing getNode or getID.') : undefined;
|
|
}
|
|
}
|
|
};
|
|
|
|
var topLevelTypes = EventConstants.topLevelTypes;
|
|
|
|
function isEndish(topLevelType) {
|
|
return topLevelType === topLevelTypes.topMouseUp || topLevelType === topLevelTypes.topTouchEnd || topLevelType === topLevelTypes.topTouchCancel;
|
|
}
|
|
|
|
function isMoveish(topLevelType) {
|
|
return topLevelType === topLevelTypes.topMouseMove || topLevelType === topLevelTypes.topTouchMove;
|
|
}
|
|
function isStartish(topLevelType) {
|
|
return topLevelType === topLevelTypes.topMouseDown || topLevelType === topLevelTypes.topTouchStart;
|
|
}
|
|
|
|
var validateEventDispatches;
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
validateEventDispatches = function (event) {
|
|
var dispatchListeners = event._dispatchListeners;
|
|
var dispatchIDs = event._dispatchIDs;
|
|
|
|
var listenersIsArr = Array.isArray(dispatchListeners);
|
|
var idsIsArr = Array.isArray(dispatchIDs);
|
|
var IDsLen = idsIsArr ? dispatchIDs.length : dispatchIDs ? 1 : 0;
|
|
var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0;
|
|
|
|
process.env.NODE_ENV !== 'production' ? warning(idsIsArr === listenersIsArr && IDsLen === listenersLen, 'EventPluginUtils: Invalid `event`.') : undefined;
|
|
};
|
|
}
|
|
|
|
/**
|
|
* Dispatch the event to the listener.
|
|
* @param {SyntheticEvent} event SyntheticEvent to handle
|
|
* @param {boolean} simulated If the event is simulated (changes exn behavior)
|
|
* @param {function} listener Application-level callback
|
|
* @param {string} domID DOM id to pass to the callback.
|
|
*/
|
|
function executeDispatch(event, simulated, listener, domID) {
|
|
var type = event.type || 'unknown-event';
|
|
event.currentTarget = injection.Mount.getNode(domID);
|
|
if (simulated) {
|
|
ReactErrorUtils.invokeGuardedCallbackWithCatch(type, listener, event, domID);
|
|
} else {
|
|
ReactErrorUtils.invokeGuardedCallback(type, listener, event, domID);
|
|
}
|
|
event.currentTarget = null;
|
|
}
|
|
|
|
/**
|
|
* Standard/simple iteration through an event's collected dispatches.
|
|
*/
|
|
function executeDispatchesInOrder(event, simulated) {
|
|
var dispatchListeners = event._dispatchListeners;
|
|
var dispatchIDs = event._dispatchIDs;
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
validateEventDispatches(event);
|
|
}
|
|
if (Array.isArray(dispatchListeners)) {
|
|
for (var i = 0; i < dispatchListeners.length; i++) {
|
|
if (event.isPropagationStopped()) {
|
|
break;
|
|
}
|
|
// Listeners and IDs are two parallel arrays that are always in sync.
|
|
executeDispatch(event, simulated, dispatchListeners[i], dispatchIDs[i]);
|
|
}
|
|
} else if (dispatchListeners) {
|
|
executeDispatch(event, simulated, dispatchListeners, dispatchIDs);
|
|
}
|
|
event._dispatchListeners = null;
|
|
event._dispatchIDs = null;
|
|
}
|
|
|
|
/**
|
|
* Standard/simple iteration through an event's collected dispatches, but stops
|
|
* at the first dispatch execution returning true, and returns that id.
|
|
*
|
|
* @return {?string} id of the first dispatch execution who's listener returns
|
|
* true, or null if no listener returned true.
|
|
*/
|
|
function executeDispatchesInOrderStopAtTrueImpl(event) {
|
|
var dispatchListeners = event._dispatchListeners;
|
|
var dispatchIDs = event._dispatchIDs;
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
validateEventDispatches(event);
|
|
}
|
|
if (Array.isArray(dispatchListeners)) {
|
|
for (var i = 0; i < dispatchListeners.length; i++) {
|
|
if (event.isPropagationStopped()) {
|
|
break;
|
|
}
|
|
// Listeners and IDs are two parallel arrays that are always in sync.
|
|
if (dispatchListeners[i](event, dispatchIDs[i])) {
|
|
return dispatchIDs[i];
|
|
}
|
|
}
|
|
} else if (dispatchListeners) {
|
|
if (dispatchListeners(event, dispatchIDs)) {
|
|
return dispatchIDs;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
/**
|
|
* @see executeDispatchesInOrderStopAtTrueImpl
|
|
*/
|
|
function executeDispatchesInOrderStopAtTrue(event) {
|
|
var ret = executeDispatchesInOrderStopAtTrueImpl(event);
|
|
event._dispatchIDs = null;
|
|
event._dispatchListeners = null;
|
|
return ret;
|
|
}
|
|
|
|
/**
|
|
* Execution of a "direct" dispatch - there must be at most one dispatch
|
|
* accumulated on the event or it is considered an error. It doesn't really make
|
|
* sense for an event with multiple dispatches (bubbled) to keep track of the
|
|
* return values at each dispatch execution, but it does tend to make sense when
|
|
* dealing with "direct" dispatches.
|
|
*
|
|
* @return {*} The return value of executing the single dispatch.
|
|
*/
|
|
function executeDirectDispatch(event) {
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
validateEventDispatches(event);
|
|
}
|
|
var dispatchListener = event._dispatchListeners;
|
|
var dispatchID = event._dispatchIDs;
|
|
!!Array.isArray(dispatchListener) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'executeDirectDispatch(...): Invalid `event`.') : invariant(false) : undefined;
|
|
var res = dispatchListener ? dispatchListener(event, dispatchID) : null;
|
|
event._dispatchListeners = null;
|
|
event._dispatchIDs = null;
|
|
return res;
|
|
}
|
|
|
|
/**
|
|
* @param {SyntheticEvent} event
|
|
* @return {boolean} True iff number of dispatches accumulated is greater than 0.
|
|
*/
|
|
function hasDispatches(event) {
|
|
return !!event._dispatchListeners;
|
|
}
|
|
|
|
/**
|
|
* General utilities that are useful in creating custom Event Plugins.
|
|
*/
|
|
var EventPluginUtils = {
|
|
isEndish: isEndish,
|
|
isMoveish: isMoveish,
|
|
isStartish: isStartish,
|
|
|
|
executeDirectDispatch: executeDirectDispatch,
|
|
executeDispatchesInOrder: executeDispatchesInOrder,
|
|
executeDispatchesInOrderStopAtTrue: executeDispatchesInOrderStopAtTrue,
|
|
hasDispatches: hasDispatches,
|
|
|
|
getNode: function (id) {
|
|
return injection.Mount.getNode(id);
|
|
},
|
|
getID: function (node) {
|
|
return injection.Mount.getID(node);
|
|
},
|
|
|
|
injection: injection
|
|
};
|
|
|
|
module.exports = EventPluginUtils;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 33 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactErrorUtils
|
|
* @typechecks
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var caughtError = null;
|
|
|
|
/**
|
|
* Call a function while guarding against errors that happens within it.
|
|
*
|
|
* @param {?String} name of the guard to use for logging or debugging
|
|
* @param {Function} func The function to invoke
|
|
* @param {*} a First argument
|
|
* @param {*} b Second argument
|
|
*/
|
|
function invokeGuardedCallback(name, func, a, b) {
|
|
try {
|
|
return func(a, b);
|
|
} catch (x) {
|
|
if (caughtError === null) {
|
|
caughtError = x;
|
|
}
|
|
return undefined;
|
|
}
|
|
}
|
|
|
|
var ReactErrorUtils = {
|
|
invokeGuardedCallback: invokeGuardedCallback,
|
|
|
|
/**
|
|
* Invoked by ReactTestUtils.Simulate so that any errors thrown by the event
|
|
* handler are sure to be rethrown by rethrowCaughtError.
|
|
*/
|
|
invokeGuardedCallbackWithCatch: invokeGuardedCallback,
|
|
|
|
/**
|
|
* During execution of guarded functions we will capture the first error which
|
|
* we will rethrow to be handled by the top level error handler.
|
|
*/
|
|
rethrowCaughtError: function () {
|
|
if (caughtError) {
|
|
var error = caughtError;
|
|
caughtError = null;
|
|
throw error;
|
|
}
|
|
}
|
|
};
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
/**
|
|
* To help development we can get better devtools integration by simulating a
|
|
* real browser event.
|
|
*/
|
|
if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {
|
|
var fakeNode = document.createElement('react');
|
|
ReactErrorUtils.invokeGuardedCallback = function (name, func, a, b) {
|
|
var boundFunc = func.bind(null, a, b);
|
|
var evtType = 'react-' + name;
|
|
fakeNode.addEventListener(evtType, boundFunc, false);
|
|
var evt = document.createEvent('Event');
|
|
evt.initEvent(evtType, false, false);
|
|
fakeNode.dispatchEvent(evt);
|
|
fakeNode.removeEventListener(evtType, boundFunc, false);
|
|
};
|
|
}
|
|
}
|
|
|
|
module.exports = ReactErrorUtils;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 34 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2014-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule accumulateInto
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var invariant = __webpack_require__(12);
|
|
|
|
/**
|
|
*
|
|
* Accumulates items that must not be null or undefined into the first one. This
|
|
* is used to conserve memory by avoiding array allocations, and thus sacrifices
|
|
* API cleanness. Since `current` can be null before being passed in and not
|
|
* null after this function, make sure to assign it back to `current`:
|
|
*
|
|
* `a = accumulateInto(a, b);`
|
|
*
|
|
* This API should be sparingly used. Try `accumulate` for something cleaner.
|
|
*
|
|
* @return {*|array<*>} An accumulation of items.
|
|
*/
|
|
|
|
function accumulateInto(current, next) {
|
|
!(next != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'accumulateInto(...): Accumulated items must not be null or undefined.') : invariant(false) : undefined;
|
|
if (current == null) {
|
|
return next;
|
|
}
|
|
|
|
// Both are not empty. Warning: Never call x.concat(y) when you are not
|
|
// certain that x is an Array (x could be a string with concat method).
|
|
var currentIsArray = Array.isArray(current);
|
|
var nextIsArray = Array.isArray(next);
|
|
|
|
if (currentIsArray && nextIsArray) {
|
|
current.push.apply(current, next);
|
|
return current;
|
|
}
|
|
|
|
if (currentIsArray) {
|
|
current.push(next);
|
|
return current;
|
|
}
|
|
|
|
if (nextIsArray) {
|
|
// A bit too dangerous to mutate `next`.
|
|
return [current].concat(next);
|
|
}
|
|
|
|
return [current, next];
|
|
}
|
|
|
|
module.exports = accumulateInto;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 35 */
|
|
/***/ function(module, exports) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule forEachAccumulated
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
/**
|
|
* @param {array} arr an "accumulation" of items which is either an Array or
|
|
* a single item. Useful when paired with the `accumulate` module. This is a
|
|
* simple utility that allows us to reason about a collection of items, but
|
|
* handling the case when there is exactly one item (and we do not need to
|
|
* allocate an array).
|
|
*/
|
|
var forEachAccumulated = function (arr, cb, scope) {
|
|
if (Array.isArray(arr)) {
|
|
arr.forEach(cb, scope);
|
|
} else if (arr) {
|
|
cb.call(scope, arr);
|
|
}
|
|
};
|
|
|
|
module.exports = forEachAccumulated;
|
|
|
|
/***/ },
|
|
/* 36 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactEventEmitterMixin
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var EventPluginHub = __webpack_require__(30);
|
|
|
|
function runEventQueueInBatch(events) {
|
|
EventPluginHub.enqueueEvents(events);
|
|
EventPluginHub.processEventQueue(false);
|
|
}
|
|
|
|
var ReactEventEmitterMixin = {
|
|
|
|
/**
|
|
* Streams a fired top-level event to `EventPluginHub` where plugins have the
|
|
* opportunity to create `ReactEvent`s to be dispatched.
|
|
*
|
|
* @param {string} topLevelType Record from `EventConstants`.
|
|
* @param {object} topLevelTarget The listening component root node.
|
|
* @param {string} topLevelTargetID ID of `topLevelTarget`.
|
|
* @param {object} nativeEvent Native environment event.
|
|
*/
|
|
handleTopLevel: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
|
|
var events = EventPluginHub.extractEvents(topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget);
|
|
runEventQueueInBatch(events);
|
|
}
|
|
};
|
|
|
|
module.exports = ReactEventEmitterMixin;
|
|
|
|
/***/ },
|
|
/* 37 */
|
|
/***/ function(module, exports) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ViewportMetrics
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var ViewportMetrics = {
|
|
|
|
currentScrollLeft: 0,
|
|
|
|
currentScrollTop: 0,
|
|
|
|
refreshScrollValues: function (scrollPosition) {
|
|
ViewportMetrics.currentScrollLeft = scrollPosition.x;
|
|
ViewportMetrics.currentScrollTop = scrollPosition.y;
|
|
}
|
|
|
|
};
|
|
|
|
module.exports = ViewportMetrics;
|
|
|
|
/***/ },
|
|
/* 38 */
|
|
/***/ function(module, exports) {
|
|
|
|
/**
|
|
* Copyright 2014-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule Object.assign
|
|
*/
|
|
|
|
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign
|
|
|
|
'use strict';
|
|
|
|
function assign(target, sources) {
|
|
if (target == null) {
|
|
throw new TypeError('Object.assign target cannot be null or undefined');
|
|
}
|
|
|
|
var to = Object(target);
|
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
|
|
for (var nextIndex = 1; nextIndex < arguments.length; nextIndex++) {
|
|
var nextSource = arguments[nextIndex];
|
|
if (nextSource == null) {
|
|
continue;
|
|
}
|
|
|
|
var from = Object(nextSource);
|
|
|
|
// We don't currently support accessors nor proxies. Therefore this
|
|
// copy cannot throw. If we ever supported this then we must handle
|
|
// exceptions and side-effects. We don't support symbols so they won't
|
|
// be transferred.
|
|
|
|
for (var key in from) {
|
|
if (hasOwnProperty.call(from, key)) {
|
|
to[key] = from[key];
|
|
}
|
|
}
|
|
}
|
|
|
|
return to;
|
|
}
|
|
|
|
module.exports = assign;
|
|
|
|
/***/ },
|
|
/* 39 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule isEventSupported
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var ExecutionEnvironment = __webpack_require__(8);
|
|
|
|
var useHasFeature;
|
|
if (ExecutionEnvironment.canUseDOM) {
|
|
useHasFeature = document.implementation && document.implementation.hasFeature &&
|
|
// always returns true in newer browsers as per the standard.
|
|
// @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature
|
|
document.implementation.hasFeature('', '') !== true;
|
|
}
|
|
|
|
/**
|
|
* Checks if an event is supported in the current execution environment.
|
|
*
|
|
* NOTE: This will not work correctly for non-generic events such as `change`,
|
|
* `reset`, `load`, `error`, and `select`.
|
|
*
|
|
* Borrows from Modernizr.
|
|
*
|
|
* @param {string} eventNameSuffix Event name, e.g. "click".
|
|
* @param {?boolean} capture Check if the capture phase is supported.
|
|
* @return {boolean} True if the event is supported.
|
|
* @internal
|
|
* @license Modernizr 3.0.0pre (Custom Build) | MIT
|
|
*/
|
|
function isEventSupported(eventNameSuffix, capture) {
|
|
if (!ExecutionEnvironment.canUseDOM || capture && !('addEventListener' in document)) {
|
|
return false;
|
|
}
|
|
|
|
var eventName = 'on' + eventNameSuffix;
|
|
var isSupported = (eventName in document);
|
|
|
|
if (!isSupported) {
|
|
var element = document.createElement('div');
|
|
element.setAttribute(eventName, 'return;');
|
|
isSupported = typeof element[eventName] === 'function';
|
|
}
|
|
|
|
if (!isSupported && useHasFeature && eventNameSuffix === 'wheel') {
|
|
// This is the only way to test support for the `wheel` event in IE9+.
|
|
isSupported = document.implementation.hasFeature('Events.wheel', '3.0');
|
|
}
|
|
|
|
return isSupported;
|
|
}
|
|
|
|
module.exports = isEventSupported;
|
|
|
|
/***/ },
|
|
/* 40 */
|
|
/***/ function(module, exports) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactDOMFeatureFlags
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var ReactDOMFeatureFlags = {
|
|
useCreateElement: false
|
|
};
|
|
|
|
module.exports = ReactDOMFeatureFlags;
|
|
|
|
/***/ },
|
|
/* 41 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2014-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactElement
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var ReactCurrentOwner = __webpack_require__(4);
|
|
|
|
var assign = __webpack_require__(38);
|
|
var canDefineProperty = __webpack_require__(42);
|
|
|
|
// The Symbol used to tag the ReactElement type. If there is no native Symbol
|
|
// nor polyfill, then a plain number is used for performance.
|
|
var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;
|
|
|
|
var RESERVED_PROPS = {
|
|
key: true,
|
|
ref: true,
|
|
__self: true,
|
|
__source: true
|
|
};
|
|
|
|
/**
|
|
* Base constructor for all React elements. This is only used to make this
|
|
* work with a dynamic instanceof check. Nothing should live on this prototype.
|
|
*
|
|
* @param {*} type
|
|
* @param {*} key
|
|
* @param {string|object} ref
|
|
* @param {*} self A *temporary* helper to detect places where `this` is
|
|
* different from the `owner` when React.createElement is called, so that we
|
|
* can warn. We want to get rid of owner and replace string `ref`s with arrow
|
|
* functions, and as long as `this` and owner are the same, there will be no
|
|
* change in behavior.
|
|
* @param {*} source An annotation object (added by a transpiler or otherwise)
|
|
* indicating filename, line number, and/or other information.
|
|
* @param {*} owner
|
|
* @param {*} props
|
|
* @internal
|
|
*/
|
|
var ReactElement = function (type, key, ref, self, source, owner, props) {
|
|
var element = {
|
|
// This tag allow us to uniquely identify this as a React Element
|
|
$$typeof: REACT_ELEMENT_TYPE,
|
|
|
|
// Built-in properties that belong on the element
|
|
type: type,
|
|
key: key,
|
|
ref: ref,
|
|
props: props,
|
|
|
|
// Record the component responsible for creating this element.
|
|
_owner: owner
|
|
};
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
// The validation flag is currently mutative. We put it on
|
|
// an external backing store so that we can freeze the whole object.
|
|
// This can be replaced with a WeakMap once they are implemented in
|
|
// commonly used development environments.
|
|
element._store = {};
|
|
|
|
// To make comparing ReactElements easier for testing purposes, we make
|
|
// the validation flag non-enumerable (where possible, which should
|
|
// include every environment we run tests in), so the test framework
|
|
// ignores it.
|
|
if (canDefineProperty) {
|
|
Object.defineProperty(element._store, 'validated', {
|
|
configurable: false,
|
|
enumerable: false,
|
|
writable: true,
|
|
value: false
|
|
});
|
|
// self and source are DEV only properties.
|
|
Object.defineProperty(element, '_self', {
|
|
configurable: false,
|
|
enumerable: false,
|
|
writable: false,
|
|
value: self
|
|
});
|
|
// Two elements created in two different places should be considered
|
|
// equal for testing purposes and therefore we hide it from enumeration.
|
|
Object.defineProperty(element, '_source', {
|
|
configurable: false,
|
|
enumerable: false,
|
|
writable: false,
|
|
value: source
|
|
});
|
|
} else {
|
|
element._store.validated = false;
|
|
element._self = self;
|
|
element._source = source;
|
|
}
|
|
Object.freeze(element.props);
|
|
Object.freeze(element);
|
|
}
|
|
|
|
return element;
|
|
};
|
|
|
|
ReactElement.createElement = function (type, config, children) {
|
|
var propName;
|
|
|
|
// Reserved names are extracted
|
|
var props = {};
|
|
|
|
var key = null;
|
|
var ref = null;
|
|
var self = null;
|
|
var source = null;
|
|
|
|
if (config != null) {
|
|
ref = config.ref === undefined ? null : config.ref;
|
|
key = config.key === undefined ? null : '' + config.key;
|
|
self = config.__self === undefined ? null : config.__self;
|
|
source = config.__source === undefined ? null : config.__source;
|
|
// Remaining properties are added to a new props object
|
|
for (propName in config) {
|
|
if (config.hasOwnProperty(propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
props[propName] = config[propName];
|
|
}
|
|
}
|
|
}
|
|
|
|
// Children can be more than one argument, and those are transferred onto
|
|
// the newly allocated props object.
|
|
var childrenLength = arguments.length - 2;
|
|
if (childrenLength === 1) {
|
|
props.children = children;
|
|
} else if (childrenLength > 1) {
|
|
var childArray = Array(childrenLength);
|
|
for (var i = 0; i < childrenLength; i++) {
|
|
childArray[i] = arguments[i + 2];
|
|
}
|
|
props.children = childArray;
|
|
}
|
|
|
|
// Resolve default props
|
|
if (type && type.defaultProps) {
|
|
var defaultProps = type.defaultProps;
|
|
for (propName in defaultProps) {
|
|
if (typeof props[propName] === 'undefined') {
|
|
props[propName] = defaultProps[propName];
|
|
}
|
|
}
|
|
}
|
|
|
|
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
|
};
|
|
|
|
ReactElement.createFactory = function (type) {
|
|
var factory = ReactElement.createElement.bind(null, type);
|
|
// Expose the type on the factory and the prototype so that it can be
|
|
// easily accessed on elements. E.g. `<Foo />.type === Foo`.
|
|
// This should not be named `constructor` since this may not be the function
|
|
// that created the element, and it may not even be a constructor.
|
|
// Legacy hook TODO: Warn if this is accessed
|
|
factory.type = type;
|
|
return factory;
|
|
};
|
|
|
|
ReactElement.cloneAndReplaceKey = function (oldElement, newKey) {
|
|
var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
|
|
|
|
return newElement;
|
|
};
|
|
|
|
ReactElement.cloneAndReplaceProps = function (oldElement, newProps) {
|
|
var newElement = ReactElement(oldElement.type, oldElement.key, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, newProps);
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
// If the key on the original is valid, then the clone is valid
|
|
newElement._store.validated = oldElement._store.validated;
|
|
}
|
|
|
|
return newElement;
|
|
};
|
|
|
|
ReactElement.cloneElement = function (element, config, children) {
|
|
var propName;
|
|
|
|
// Original props are copied
|
|
var props = assign({}, element.props);
|
|
|
|
// Reserved names are extracted
|
|
var key = element.key;
|
|
var ref = element.ref;
|
|
// Self is preserved since the owner is preserved.
|
|
var self = element._self;
|
|
// Source is preserved since cloneElement is unlikely to be targeted by a
|
|
// transpiler, and the original source is probably a better indicator of the
|
|
// true owner.
|
|
var source = element._source;
|
|
|
|
// Owner will be preserved, unless ref is overridden
|
|
var owner = element._owner;
|
|
|
|
if (config != null) {
|
|
if (config.ref !== undefined) {
|
|
// Silently steal the ref from the parent.
|
|
ref = config.ref;
|
|
owner = ReactCurrentOwner.current;
|
|
}
|
|
if (config.key !== undefined) {
|
|
key = '' + config.key;
|
|
}
|
|
// Remaining properties override existing props
|
|
for (propName in config) {
|
|
if (config.hasOwnProperty(propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
props[propName] = config[propName];
|
|
}
|
|
}
|
|
}
|
|
|
|
// Children can be more than one argument, and those are transferred onto
|
|
// the newly allocated props object.
|
|
var childrenLength = arguments.length - 2;
|
|
if (childrenLength === 1) {
|
|
props.children = children;
|
|
} else if (childrenLength > 1) {
|
|
var childArray = Array(childrenLength);
|
|
for (var i = 0; i < childrenLength; i++) {
|
|
childArray[i] = arguments[i + 2];
|
|
}
|
|
props.children = childArray;
|
|
}
|
|
|
|
return ReactElement(element.type, key, ref, self, source, owner, props);
|
|
};
|
|
|
|
/**
|
|
* @param {?object} object
|
|
* @return {boolean} True if `object` is a valid component.
|
|
* @final
|
|
*/
|
|
ReactElement.isValidElement = function (object) {
|
|
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
};
|
|
|
|
module.exports = ReactElement;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 42 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule canDefineProperty
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var canDefineProperty = false;
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
try {
|
|
Object.defineProperty({}, 'x', { get: function () {} });
|
|
canDefineProperty = true;
|
|
} catch (x) {
|
|
// IE will fail on defineProperty
|
|
}
|
|
}
|
|
|
|
module.exports = canDefineProperty;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 43 */
|
|
/***/ function(module, exports) {
|
|
|
|
/**
|
|
* Copyright 2014-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactEmptyComponentRegistry
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
// This registry keeps track of the React IDs of the components that rendered to
|
|
// `null` (in reality a placeholder such as `noscript`)
|
|
var nullComponentIDsRegistry = {};
|
|
|
|
/**
|
|
* @param {string} id Component's `_rootNodeID`.
|
|
* @return {boolean} True if the component is rendered to null.
|
|
*/
|
|
function isNullComponentID(id) {
|
|
return !!nullComponentIDsRegistry[id];
|
|
}
|
|
|
|
/**
|
|
* Mark the component as having rendered to null.
|
|
* @param {string} id Component's `_rootNodeID`.
|
|
*/
|
|
function registerNullComponentID(id) {
|
|
nullComponentIDsRegistry[id] = true;
|
|
}
|
|
|
|
/**
|
|
* Unmark the component as having rendered to null: it renders to something now.
|
|
* @param {string} id Component's `_rootNodeID`.
|
|
*/
|
|
function deregisterNullComponentID(id) {
|
|
delete nullComponentIDsRegistry[id];
|
|
}
|
|
|
|
var ReactEmptyComponentRegistry = {
|
|
isNullComponentID: isNullComponentID,
|
|
registerNullComponentID: registerNullComponentID,
|
|
deregisterNullComponentID: deregisterNullComponentID
|
|
};
|
|
|
|
module.exports = ReactEmptyComponentRegistry;
|
|
|
|
/***/ },
|
|
/* 44 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactInstanceHandles
|
|
* @typechecks static-only
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var ReactRootIndex = __webpack_require__(45);
|
|
|
|
var invariant = __webpack_require__(12);
|
|
|
|
var SEPARATOR = '.';
|
|
var SEPARATOR_LENGTH = SEPARATOR.length;
|
|
|
|
/**
|
|
* Maximum depth of traversals before we consider the possibility of a bad ID.
|
|
*/
|
|
var MAX_TREE_DEPTH = 10000;
|
|
|
|
/**
|
|
* Creates a DOM ID prefix to use when mounting React components.
|
|
*
|
|
* @param {number} index A unique integer
|
|
* @return {string} React root ID.
|
|
* @internal
|
|
*/
|
|
function getReactRootIDString(index) {
|
|
return SEPARATOR + index.toString(36);
|
|
}
|
|
|
|
/**
|
|
* Checks if a character in the supplied ID is a separator or the end.
|
|
*
|
|
* @param {string} id A React DOM ID.
|
|
* @param {number} index Index of the character to check.
|
|
* @return {boolean} True if the character is a separator or end of the ID.
|
|
* @private
|
|
*/
|
|
function isBoundary(id, index) {
|
|
return id.charAt(index) === SEPARATOR || index === id.length;
|
|
}
|
|
|
|
/**
|
|
* Checks if the supplied string is a valid React DOM ID.
|
|
*
|
|
* @param {string} id A React DOM ID, maybe.
|
|
* @return {boolean} True if the string is a valid React DOM ID.
|
|
* @private
|
|
*/
|
|
function isValidID(id) {
|
|
return id === '' || id.charAt(0) === SEPARATOR && id.charAt(id.length - 1) !== SEPARATOR;
|
|
}
|
|
|
|
/**
|
|
* Checks if the first ID is an ancestor of or equal to the second ID.
|
|
*
|
|
* @param {string} ancestorID
|
|
* @param {string} descendantID
|
|
* @return {boolean} True if `ancestorID` is an ancestor of `descendantID`.
|
|
* @internal
|
|
*/
|
|
function isAncestorIDOf(ancestorID, descendantID) {
|
|
return descendantID.indexOf(ancestorID) === 0 && isBoundary(descendantID, ancestorID.length);
|
|
}
|
|
|
|
/**
|
|
* Gets the parent ID of the supplied React DOM ID, `id`.
|
|
*
|
|
* @param {string} id ID of a component.
|
|
* @return {string} ID of the parent, or an empty string.
|
|
* @private
|
|
*/
|
|
function getParentID(id) {
|
|
return id ? id.substr(0, id.lastIndexOf(SEPARATOR)) : '';
|
|
}
|
|
|
|
/**
|
|
* Gets the next DOM ID on the tree path from the supplied `ancestorID` to the
|
|
* supplied `destinationID`. If they are equal, the ID is returned.
|
|
*
|
|
* @param {string} ancestorID ID of an ancestor node of `destinationID`.
|
|
* @param {string} destinationID ID of the destination node.
|
|
* @return {string} Next ID on the path from `ancestorID` to `destinationID`.
|
|
* @private
|
|
*/
|
|
function getNextDescendantID(ancestorID, destinationID) {
|
|
!(isValidID(ancestorID) && isValidID(destinationID)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNextDescendantID(%s, %s): Received an invalid React DOM ID.', ancestorID, destinationID) : invariant(false) : undefined;
|
|
!isAncestorIDOf(ancestorID, destinationID) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNextDescendantID(...): React has made an invalid assumption about ' + 'the DOM hierarchy. Expected `%s` to be an ancestor of `%s`.', ancestorID, destinationID) : invariant(false) : undefined;
|
|
if (ancestorID === destinationID) {
|
|
return ancestorID;
|
|
}
|
|
// Skip over the ancestor and the immediate separator. Traverse until we hit
|
|
// another separator or we reach the end of `destinationID`.
|
|
var start = ancestorID.length + SEPARATOR_LENGTH;
|
|
var i;
|
|
for (i = start; i < destinationID.length; i++) {
|
|
if (isBoundary(destinationID, i)) {
|
|
break;
|
|
}
|
|
}
|
|
return destinationID.substr(0, i);
|
|
}
|
|
|
|
/**
|
|
* Gets the nearest common ancestor ID of two IDs.
|
|
*
|
|
* Using this ID scheme, the nearest common ancestor ID is the longest common
|
|
* prefix of the two IDs that immediately preceded a "marker" in both strings.
|
|
*
|
|
* @param {string} oneID
|
|
* @param {string} twoID
|
|
* @return {string} Nearest common ancestor ID, or the empty string if none.
|
|
* @private
|
|
*/
|
|
function getFirstCommonAncestorID(oneID, twoID) {
|
|
var minLength = Math.min(oneID.length, twoID.length);
|
|
if (minLength === 0) {
|
|
return '';
|
|
}
|
|
var lastCommonMarkerIndex = 0;
|
|
// Use `<=` to traverse until the "EOL" of the shorter string.
|
|
for (var i = 0; i <= minLength; i++) {
|
|
if (isBoundary(oneID, i) && isBoundary(twoID, i)) {
|
|
lastCommonMarkerIndex = i;
|
|
} else if (oneID.charAt(i) !== twoID.charAt(i)) {
|
|
break;
|
|
}
|
|
}
|
|
var longestCommonID = oneID.substr(0, lastCommonMarkerIndex);
|
|
!isValidID(longestCommonID) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getFirstCommonAncestorID(%s, %s): Expected a valid React DOM ID: %s', oneID, twoID, longestCommonID) : invariant(false) : undefined;
|
|
return longestCommonID;
|
|
}
|
|
|
|
/**
|
|
* Traverses the parent path between two IDs (either up or down). The IDs must
|
|
* not be the same, and there must exist a parent path between them. If the
|
|
* callback returns `false`, traversal is stopped.
|
|
*
|
|
* @param {?string} start ID at which to start traversal.
|
|
* @param {?string} stop ID at which to end traversal.
|
|
* @param {function} cb Callback to invoke each ID with.
|
|
* @param {*} arg Argument to invoke the callback with.
|
|
* @param {?boolean} skipFirst Whether or not to skip the first node.
|
|
* @param {?boolean} skipLast Whether or not to skip the last node.
|
|
* @private
|
|
*/
|
|
function traverseParentPath(start, stop, cb, arg, skipFirst, skipLast) {
|
|
start = start || '';
|
|
stop = stop || '';
|
|
!(start !== stop) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'traverseParentPath(...): Cannot traverse from and to the same ID, `%s`.', start) : invariant(false) : undefined;
|
|
var traverseUp = isAncestorIDOf(stop, start);
|
|
!(traverseUp || isAncestorIDOf(start, stop)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'traverseParentPath(%s, %s, ...): Cannot traverse from two IDs that do ' + 'not have a parent path.', start, stop) : invariant(false) : undefined;
|
|
// Traverse from `start` to `stop` one depth at a time.
|
|
var depth = 0;
|
|
var traverse = traverseUp ? getParentID : getNextDescendantID;
|
|
for (var id = start;; /* until break */id = traverse(id, stop)) {
|
|
var ret;
|
|
if ((!skipFirst || id !== start) && (!skipLast || id !== stop)) {
|
|
ret = cb(id, traverseUp, arg);
|
|
}
|
|
if (ret === false || id === stop) {
|
|
// Only break //after// visiting `stop`.
|
|
break;
|
|
}
|
|
!(depth++ < MAX_TREE_DEPTH) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'traverseParentPath(%s, %s, ...): Detected an infinite loop while ' + 'traversing the React DOM ID tree. This may be due to malformed IDs: %s', start, stop, id) : invariant(false) : undefined;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Manages the IDs assigned to DOM representations of React components. This
|
|
* uses a specific scheme in order to traverse the DOM efficiently (e.g. in
|
|
* order to simulate events).
|
|
*
|
|
* @internal
|
|
*/
|
|
var ReactInstanceHandles = {
|
|
|
|
/**
|
|
* Constructs a React root ID
|
|
* @return {string} A React root ID.
|
|
*/
|
|
createReactRootID: function () {
|
|
return getReactRootIDString(ReactRootIndex.createReactRootIndex());
|
|
},
|
|
|
|
/**
|
|
* Constructs a React ID by joining a root ID with a name.
|
|
*
|
|
* @param {string} rootID Root ID of a parent component.
|
|
* @param {string} name A component's name (as flattened children).
|
|
* @return {string} A React ID.
|
|
* @internal
|
|
*/
|
|
createReactID: function (rootID, name) {
|
|
return rootID + name;
|
|
},
|
|
|
|
/**
|
|
* Gets the DOM ID of the React component that is the root of the tree that
|
|
* contains the React component with the supplied DOM ID.
|
|
*
|
|
* @param {string} id DOM ID of a React component.
|
|
* @return {?string} DOM ID of the React component that is the root.
|
|
* @internal
|
|
*/
|
|
getReactRootIDFromNodeID: function (id) {
|
|
if (id && id.charAt(0) === SEPARATOR && id.length > 1) {
|
|
var index = id.indexOf(SEPARATOR, 1);
|
|
return index > -1 ? id.substr(0, index) : id;
|
|
}
|
|
return null;
|
|
},
|
|
|
|
/**
|
|
* Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that
|
|
* should would receive a `mouseEnter` or `mouseLeave` event.
|
|
*
|
|
* NOTE: Does not invoke the callback on the nearest common ancestor because
|
|
* nothing "entered" or "left" that element.
|
|
*
|
|
* @param {string} leaveID ID being left.
|
|
* @param {string} enterID ID being entered.
|
|
* @param {function} cb Callback to invoke on each entered/left ID.
|
|
* @param {*} upArg Argument to invoke the callback with on left IDs.
|
|
* @param {*} downArg Argument to invoke the callback with on entered IDs.
|
|
* @internal
|
|
*/
|
|
traverseEnterLeave: function (leaveID, enterID, cb, upArg, downArg) {
|
|
var ancestorID = getFirstCommonAncestorID(leaveID, enterID);
|
|
if (ancestorID !== leaveID) {
|
|
traverseParentPath(leaveID, ancestorID, cb, upArg, false, true);
|
|
}
|
|
if (ancestorID !== enterID) {
|
|
traverseParentPath(ancestorID, enterID, cb, downArg, true, false);
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Simulates the traversal of a two-phase, capture/bubble event dispatch.
|
|
*
|
|
* NOTE: This traversal happens on IDs without touching the DOM.
|
|
*
|
|
* @param {string} targetID ID of the target node.
|
|
* @param {function} cb Callback to invoke.
|
|
* @param {*} arg Argument to invoke the callback with.
|
|
* @internal
|
|
*/
|
|
traverseTwoPhase: function (targetID, cb, arg) {
|
|
if (targetID) {
|
|
traverseParentPath('', targetID, cb, arg, true, false);
|
|
traverseParentPath(targetID, '', cb, arg, false, true);
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Same as `traverseTwoPhase` but skips the `targetID`.
|
|
*/
|
|
traverseTwoPhaseSkipTarget: function (targetID, cb, arg) {
|
|
if (targetID) {
|
|
traverseParentPath('', targetID, cb, arg, true, true);
|
|
traverseParentPath(targetID, '', cb, arg, true, true);
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Traverse a node ID, calling the supplied `cb` for each ancestor ID. For
|
|
* example, passing `.0.$row-0.1` would result in `cb` getting called
|
|
* with `.0`, `.0.$row-0`, and `.0.$row-0.1`.
|
|
*
|
|
* NOTE: This traversal happens on IDs without touching the DOM.
|
|
*
|
|
* @param {string} targetID ID of the target node.
|
|
* @param {function} cb Callback to invoke.
|
|
* @param {*} arg Argument to invoke the callback with.
|
|
* @internal
|
|
*/
|
|
traverseAncestors: function (targetID, cb, arg) {
|
|
traverseParentPath('', targetID, cb, arg, true, false);
|
|
},
|
|
|
|
getFirstCommonAncestorID: getFirstCommonAncestorID,
|
|
|
|
/**
|
|
* Exposed for unit testing.
|
|
* @private
|
|
*/
|
|
_getNextDescendantID: getNextDescendantID,
|
|
|
|
isAncestorIDOf: isAncestorIDOf,
|
|
|
|
SEPARATOR: SEPARATOR
|
|
|
|
};
|
|
|
|
module.exports = ReactInstanceHandles;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 45 */
|
|
/***/ function(module, exports) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactRootIndex
|
|
* @typechecks
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var ReactRootIndexInjection = {
|
|
/**
|
|
* @param {function} _createReactRootIndex
|
|
*/
|
|
injectCreateReactRootIndex: function (_createReactRootIndex) {
|
|
ReactRootIndex.createReactRootIndex = _createReactRootIndex;
|
|
}
|
|
};
|
|
|
|
var ReactRootIndex = {
|
|
createReactRootIndex: null,
|
|
injection: ReactRootIndexInjection
|
|
};
|
|
|
|
module.exports = ReactRootIndex;
|
|
|
|
/***/ },
|
|
/* 46 */
|
|
/***/ function(module, exports) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactInstanceMap
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
/**
|
|
* `ReactInstanceMap` maintains a mapping from a public facing stateful
|
|
* instance (key) and the internal representation (value). This allows public
|
|
* methods to accept the user facing instance as an argument and map them back
|
|
* to internal methods.
|
|
*/
|
|
|
|
// TODO: Replace this with ES6: var ReactInstanceMap = new Map();
|
|
var ReactInstanceMap = {
|
|
|
|
/**
|
|
* This API should be called `delete` but we'd have to make sure to always
|
|
* transform these to strings for IE support. When this transform is fully
|
|
* supported we can rename it.
|
|
*/
|
|
remove: function (key) {
|
|
key._reactInternalInstance = undefined;
|
|
},
|
|
|
|
get: function (key) {
|
|
return key._reactInternalInstance;
|
|
},
|
|
|
|
has: function (key) {
|
|
return key._reactInternalInstance !== undefined;
|
|
},
|
|
|
|
set: function (key, value) {
|
|
key._reactInternalInstance = value;
|
|
}
|
|
|
|
};
|
|
|
|
module.exports = ReactInstanceMap;
|
|
|
|
/***/ },
|
|
/* 47 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactMarkupChecksum
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var adler32 = __webpack_require__(48);
|
|
|
|
var TAG_END = /\/?>/;
|
|
|
|
var ReactMarkupChecksum = {
|
|
CHECKSUM_ATTR_NAME: 'data-react-checksum',
|
|
|
|
/**
|
|
* @param {string} markup Markup string
|
|
* @return {string} Markup string with checksum attribute attached
|
|
*/
|
|
addChecksumToMarkup: function (markup) {
|
|
var checksum = adler32(markup);
|
|
|
|
// Add checksum (handle both parent tags and self-closing tags)
|
|
return markup.replace(TAG_END, ' ' + ReactMarkupChecksum.CHECKSUM_ATTR_NAME + '="' + checksum + '"$&');
|
|
},
|
|
|
|
/**
|
|
* @param {string} markup to use
|
|
* @param {DOMElement} element root React element
|
|
* @returns {boolean} whether or not the markup is the same
|
|
*/
|
|
canReuseMarkup: function (markup, element) {
|
|
var existingChecksum = element.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
|
|
existingChecksum = existingChecksum && parseInt(existingChecksum, 10);
|
|
var markupChecksum = adler32(markup);
|
|
return markupChecksum === existingChecksum;
|
|
}
|
|
};
|
|
|
|
module.exports = ReactMarkupChecksum;
|
|
|
|
/***/ },
|
|
/* 48 */
|
|
/***/ function(module, exports) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule adler32
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var MOD = 65521;
|
|
|
|
// adler32 is not cryptographically strong, and is only used to sanity check that
|
|
// markup generated on the server matches the markup generated on the client.
|
|
// This implementation (a modified version of the SheetJS version) has been optimized
|
|
// for our use case, at the expense of conforming to the adler32 specification
|
|
// for non-ascii inputs.
|
|
function adler32(data) {
|
|
var a = 1;
|
|
var b = 0;
|
|
var i = 0;
|
|
var l = data.length;
|
|
var m = l & ~0x3;
|
|
while (i < m) {
|
|
for (; i < Math.min(i + 4096, m); i += 4) {
|
|
b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));
|
|
}
|
|
a %= MOD;
|
|
b %= MOD;
|
|
}
|
|
for (; i < l; i++) {
|
|
b += a += data.charCodeAt(i);
|
|
}
|
|
a %= MOD;
|
|
b %= MOD;
|
|
return a | b << 16;
|
|
}
|
|
|
|
module.exports = adler32;
|
|
|
|
/***/ },
|
|
/* 49 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactReconciler
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var ReactRef = __webpack_require__(50);
|
|
|
|
/**
|
|
* Helper to call ReactRef.attachRefs with this composite component, split out
|
|
* to avoid allocations in the transaction mount-ready queue.
|
|
*/
|
|
function attachRefs() {
|
|
ReactRef.attachRefs(this, this._currentElement);
|
|
}
|
|
|
|
var ReactReconciler = {
|
|
|
|
/**
|
|
* Initializes the component, renders markup, and registers event listeners.
|
|
*
|
|
* @param {ReactComponent} internalInstance
|
|
* @param {string} rootID DOM ID of the root node.
|
|
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
|
|
* @return {?string} Rendered markup to be inserted into the DOM.
|
|
* @final
|
|
* @internal
|
|
*/
|
|
mountComponent: function (internalInstance, rootID, transaction, context) {
|
|
var markup = internalInstance.mountComponent(rootID, transaction, context);
|
|
if (internalInstance._currentElement && internalInstance._currentElement.ref != null) {
|
|
transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
|
|
}
|
|
return markup;
|
|
},
|
|
|
|
/**
|
|
* Releases any resources allocated by `mountComponent`.
|
|
*
|
|
* @final
|
|
* @internal
|
|
*/
|
|
unmountComponent: function (internalInstance) {
|
|
ReactRef.detachRefs(internalInstance, internalInstance._currentElement);
|
|
internalInstance.unmountComponent();
|
|
},
|
|
|
|
/**
|
|
* Update a component using a new element.
|
|
*
|
|
* @param {ReactComponent} internalInstance
|
|
* @param {ReactElement} nextElement
|
|
* @param {ReactReconcileTransaction} transaction
|
|
* @param {object} context
|
|
* @internal
|
|
*/
|
|
receiveComponent: function (internalInstance, nextElement, transaction, context) {
|
|
var prevElement = internalInstance._currentElement;
|
|
|
|
if (nextElement === prevElement && context === internalInstance._context) {
|
|
// Since elements are immutable after the owner is rendered,
|
|
// we can do a cheap identity compare here to determine if this is a
|
|
// superfluous reconcile. It's possible for state to be mutable but such
|
|
// change should trigger an update of the owner which would recreate
|
|
// the element. We explicitly check for the existence of an owner since
|
|
// it's possible for an element created outside a composite to be
|
|
// deeply mutated and reused.
|
|
|
|
// TODO: Bailing out early is just a perf optimization right?
|
|
// TODO: Removing the return statement should affect correctness?
|
|
return;
|
|
}
|
|
|
|
var refsChanged = ReactRef.shouldUpdateRefs(prevElement, nextElement);
|
|
|
|
if (refsChanged) {
|
|
ReactRef.detachRefs(internalInstance, prevElement);
|
|
}
|
|
|
|
internalInstance.receiveComponent(nextElement, transaction, context);
|
|
|
|
if (refsChanged && internalInstance._currentElement && internalInstance._currentElement.ref != null) {
|
|
transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Flush any dirty changes in a component.
|
|
*
|
|
* @param {ReactComponent} internalInstance
|
|
* @param {ReactReconcileTransaction} transaction
|
|
* @internal
|
|
*/
|
|
performUpdateIfNecessary: function (internalInstance, transaction) {
|
|
internalInstance.performUpdateIfNecessary(transaction);
|
|
}
|
|
|
|
};
|
|
|
|
module.exports = ReactReconciler;
|
|
|
|
/***/ },
|
|
/* 50 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactRef
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var ReactOwner = __webpack_require__(51);
|
|
|
|
var ReactRef = {};
|
|
|
|
function attachRef(ref, component, owner) {
|
|
if (typeof ref === 'function') {
|
|
ref(component.getPublicInstance());
|
|
} else {
|
|
// Legacy ref
|
|
ReactOwner.addComponentAsRefTo(component, ref, owner);
|
|
}
|
|
}
|
|
|
|
function detachRef(ref, component, owner) {
|
|
if (typeof ref === 'function') {
|
|
ref(null);
|
|
} else {
|
|
// Legacy ref
|
|
ReactOwner.removeComponentAsRefFrom(component, ref, owner);
|
|
}
|
|
}
|
|
|
|
ReactRef.attachRefs = function (instance, element) {
|
|
if (element === null || element === false) {
|
|
return;
|
|
}
|
|
var ref = element.ref;
|
|
if (ref != null) {
|
|
attachRef(ref, instance, element._owner);
|
|
}
|
|
};
|
|
|
|
ReactRef.shouldUpdateRefs = function (prevElement, nextElement) {
|
|
// If either the owner or a `ref` has changed, make sure the newest owner
|
|
// has stored a reference to `this`, and the previous owner (if different)
|
|
// has forgotten the reference to `this`. We use the element instead
|
|
// of the public this.props because the post processing cannot determine
|
|
// a ref. The ref conceptually lives on the element.
|
|
|
|
// TODO: Should this even be possible? The owner cannot change because
|
|
// it's forbidden by shouldUpdateReactComponent. The ref can change
|
|
// if you swap the keys of but not the refs. Reconsider where this check
|
|
// is made. It probably belongs where the key checking and
|
|
// instantiateReactComponent is done.
|
|
|
|
var prevEmpty = prevElement === null || prevElement === false;
|
|
var nextEmpty = nextElement === null || nextElement === false;
|
|
|
|
return(
|
|
// This has a few false positives w/r/t empty components.
|
|
prevEmpty || nextEmpty || nextElement._owner !== prevElement._owner || nextElement.ref !== prevElement.ref
|
|
);
|
|
};
|
|
|
|
ReactRef.detachRefs = function (instance, element) {
|
|
if (element === null || element === false) {
|
|
return;
|
|
}
|
|
var ref = element.ref;
|
|
if (ref != null) {
|
|
detachRef(ref, instance, element._owner);
|
|
}
|
|
};
|
|
|
|
module.exports = ReactRef;
|
|
|
|
/***/ },
|
|
/* 51 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactOwner
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var invariant = __webpack_require__(12);
|
|
|
|
/**
|
|
* ReactOwners are capable of storing references to owned components.
|
|
*
|
|
* All components are capable of //being// referenced by owner components, but
|
|
* only ReactOwner components are capable of //referencing// owned components.
|
|
* The named reference is known as a "ref".
|
|
*
|
|
* Refs are available when mounted and updated during reconciliation.
|
|
*
|
|
* var MyComponent = React.createClass({
|
|
* render: function() {
|
|
* return (
|
|
* <div onClick={this.handleClick}>
|
|
* <CustomComponent ref="custom" />
|
|
* </div>
|
|
* );
|
|
* },
|
|
* handleClick: function() {
|
|
* this.refs.custom.handleClick();
|
|
* },
|
|
* componentDidMount: function() {
|
|
* this.refs.custom.initialize();
|
|
* }
|
|
* });
|
|
*
|
|
* Refs should rarely be used. When refs are used, they should only be done to
|
|
* control data that is not handled by React's data flow.
|
|
*
|
|
* @class ReactOwner
|
|
*/
|
|
var ReactOwner = {
|
|
|
|
/**
|
|
* @param {?object} object
|
|
* @return {boolean} True if `object` is a valid owner.
|
|
* @final
|
|
*/
|
|
isValidOwner: function (object) {
|
|
return !!(object && typeof object.attachRef === 'function' && typeof object.detachRef === 'function');
|
|
},
|
|
|
|
/**
|
|
* Adds a component by ref to an owner component.
|
|
*
|
|
* @param {ReactComponent} component Component to reference.
|
|
* @param {string} ref Name by which to refer to the component.
|
|
* @param {ReactOwner} owner Component on which to record the ref.
|
|
* @final
|
|
* @internal
|
|
*/
|
|
addComponentAsRefTo: function (component, ref, owner) {
|
|
!ReactOwner.isValidOwner(owner) ? process.env.NODE_ENV !== '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).') : invariant(false) : undefined;
|
|
owner.attachRef(ref, component);
|
|
},
|
|
|
|
/**
|
|
* Removes a component by ref from an owner component.
|
|
*
|
|
* @param {ReactComponent} component Component to dereference.
|
|
* @param {string} ref Name of the ref to remove.
|
|
* @param {ReactOwner} owner Component on which the ref is recorded.
|
|
* @final
|
|
* @internal
|
|
*/
|
|
removeComponentAsRefFrom: function (component, ref, owner) {
|
|
!ReactOwner.isValidOwner(owner) ? process.env.NODE_ENV !== '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).') : invariant(false) : undefined;
|
|
// Check that `component` is still the current ref because we do not want to
|
|
// detach the ref if another component stole it.
|
|
if (owner.getPublicInstance().refs[ref] === component.getPublicInstance()) {
|
|
owner.detachRef(ref);
|
|
}
|
|
}
|
|
|
|
};
|
|
|
|
module.exports = ReactOwner;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 52 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactUpdateQueue
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var ReactCurrentOwner = __webpack_require__(4);
|
|
var ReactElement = __webpack_require__(41);
|
|
var ReactInstanceMap = __webpack_require__(46);
|
|
var ReactUpdates = __webpack_require__(53);
|
|
|
|
var assign = __webpack_require__(38);
|
|
var invariant = __webpack_require__(12);
|
|
var warning = __webpack_require__(24);
|
|
|
|
function enqueueUpdate(internalInstance) {
|
|
ReactUpdates.enqueueUpdate(internalInstance);
|
|
}
|
|
|
|
function getInternalInstanceReadyForUpdate(publicInstance, callerName) {
|
|
var internalInstance = ReactInstanceMap.get(publicInstance);
|
|
if (!internalInstance) {
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
// Only warn when we have a callerName. Otherwise we should be silent.
|
|
// We're probably calling from enqueueCallback. We don't want to warn
|
|
// there because we already warned for the corresponding lifecycle method.
|
|
process.env.NODE_ENV !== '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, publicInstance.constructor.displayName) : undefined;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, '%s(...): Cannot update during an existing state transition ' + '(such as within `render`). Render methods should be a pure function ' + 'of props and state.', callerName) : undefined;
|
|
}
|
|
|
|
return internalInstance;
|
|
}
|
|
|
|
/**
|
|
* ReactUpdateQueue allows for state updates to be scheduled into a later
|
|
* reconciliation step.
|
|
*/
|
|
var ReactUpdateQueue = {
|
|
|
|
/**
|
|
* Checks whether or not this composite component is mounted.
|
|
* @param {ReactClass} publicInstance The instance we want to test.
|
|
* @return {boolean} True if mounted, false otherwise.
|
|
* @protected
|
|
* @final
|
|
*/
|
|
isMounted: function (publicInstance) {
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
var owner = ReactCurrentOwner.current;
|
|
if (owner !== null) {
|
|
process.env.NODE_ENV !== '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') : undefined;
|
|
owner._warnedAboutRefsInRender = true;
|
|
}
|
|
}
|
|
var internalInstance = ReactInstanceMap.get(publicInstance);
|
|
if (internalInstance) {
|
|
// During componentWillMount and render this will still be null but after
|
|
// that will always render to something. At least for now. So we can use
|
|
// this hack.
|
|
return !!internalInstance._renderedComponent;
|
|
} else {
|
|
return false;
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Enqueue a callback that will be executed after all the pending updates
|
|
* have processed.
|
|
*
|
|
* @param {ReactClass} publicInstance The instance to use as `this` context.
|
|
* @param {?function} callback Called after state is updated.
|
|
* @internal
|
|
*/
|
|
enqueueCallback: function (publicInstance, callback) {
|
|
!(typeof callback === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'enqueueCallback(...): You called `setProps`, `replaceProps`, ' + '`setState`, `replaceState`, or `forceUpdate` with a callback that ' + 'isn\'t callable.') : invariant(false) : undefined;
|
|
var internalInstance = getInternalInstanceReadyForUpdate(publicInstance);
|
|
|
|
// Previously we would throw an error if we didn't have an internal
|
|
// instance. Since we want to make it a no-op instead, we mirror the same
|
|
// behavior we have in other enqueue* methods.
|
|
// We also need to ignore callbacks in componentWillMount. See
|
|
// enqueueUpdates.
|
|
if (!internalInstance) {
|
|
return null;
|
|
}
|
|
|
|
if (internalInstance._pendingCallbacks) {
|
|
internalInstance._pendingCallbacks.push(callback);
|
|
} else {
|
|
internalInstance._pendingCallbacks = [callback];
|
|
}
|
|
// TODO: The callback here is ignored when setState is called from
|
|
// componentWillMount. Either fix it or disallow doing so completely in
|
|
// favor of getInitialState. Alternatively, we can disallow
|
|
// componentWillMount during server-side rendering.
|
|
enqueueUpdate(internalInstance);
|
|
},
|
|
|
|
enqueueCallbackInternal: function (internalInstance, callback) {
|
|
!(typeof callback === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'enqueueCallback(...): You called `setProps`, `replaceProps`, ' + '`setState`, `replaceState`, or `forceUpdate` with a callback that ' + 'isn\'t callable.') : invariant(false) : undefined;
|
|
if (internalInstance._pendingCallbacks) {
|
|
internalInstance._pendingCallbacks.push(callback);
|
|
} else {
|
|
internalInstance._pendingCallbacks = [callback];
|
|
}
|
|
enqueueUpdate(internalInstance);
|
|
},
|
|
|
|
/**
|
|
* Forces an update. This should only be invoked when it is known with
|
|
* certainty that we are **not** in a DOM transaction.
|
|
*
|
|
* You may want to call this when you know that some deeper aspect of the
|
|
* component's state has changed but `setState` was not called.
|
|
*
|
|
* This will not invoke `shouldComponentUpdate`, but it will invoke
|
|
* `componentWillUpdate` and `componentDidUpdate`.
|
|
*
|
|
* @param {ReactClass} publicInstance The instance that should rerender.
|
|
* @internal
|
|
*/
|
|
enqueueForceUpdate: function (publicInstance) {
|
|
var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'forceUpdate');
|
|
|
|
if (!internalInstance) {
|
|
return;
|
|
}
|
|
|
|
internalInstance._pendingForceUpdate = true;
|
|
|
|
enqueueUpdate(internalInstance);
|
|
},
|
|
|
|
/**
|
|
* Replaces all of the state. Always use this or `setState` to mutate state.
|
|
* You should treat `this.state` as immutable.
|
|
*
|
|
* There is no guarantee that `this.state` will be immediately updated, so
|
|
* accessing `this.state` after calling this method may return the old value.
|
|
*
|
|
* @param {ReactClass} publicInstance The instance that should rerender.
|
|
* @param {object} completeState Next state.
|
|
* @internal
|
|
*/
|
|
enqueueReplaceState: function (publicInstance, completeState) {
|
|
var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'replaceState');
|
|
|
|
if (!internalInstance) {
|
|
return;
|
|
}
|
|
|
|
internalInstance._pendingStateQueue = [completeState];
|
|
internalInstance._pendingReplaceState = true;
|
|
|
|
enqueueUpdate(internalInstance);
|
|
},
|
|
|
|
/**
|
|
* Sets a subset of the state. This only exists because _pendingState is
|
|
* internal. This provides a merging strategy that is not available to deep
|
|
* properties which is confusing. TODO: Expose pendingState or don't use it
|
|
* during the merge.
|
|
*
|
|
* @param {ReactClass} publicInstance The instance that should rerender.
|
|
* @param {object} partialState Next partial state to be merged with state.
|
|
* @internal
|
|
*/
|
|
enqueueSetState: function (publicInstance, partialState) {
|
|
var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'setState');
|
|
|
|
if (!internalInstance) {
|
|
return;
|
|
}
|
|
|
|
var queue = internalInstance._pendingStateQueue || (internalInstance._pendingStateQueue = []);
|
|
queue.push(partialState);
|
|
|
|
enqueueUpdate(internalInstance);
|
|
},
|
|
|
|
/**
|
|
* Sets a subset of the props.
|
|
*
|
|
* @param {ReactClass} publicInstance The instance that should rerender.
|
|
* @param {object} partialProps Subset of the next props.
|
|
* @internal
|
|
*/
|
|
enqueueSetProps: function (publicInstance, partialProps) {
|
|
var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'setProps');
|
|
if (!internalInstance) {
|
|
return;
|
|
}
|
|
ReactUpdateQueue.enqueueSetPropsInternal(internalInstance, partialProps);
|
|
},
|
|
|
|
enqueueSetPropsInternal: function (internalInstance, partialProps) {
|
|
var topLevelWrapper = internalInstance._topLevelWrapper;
|
|
!topLevelWrapper ? process.env.NODE_ENV !== 'production' ? invariant(false, 'setProps(...): You called `setProps` on a ' + 'component with a parent. This is an anti-pattern since props will ' + 'get reactively updated when rendered. Instead, change the owner\'s ' + '`render` method to pass the correct value as props to the component ' + 'where it is created.') : invariant(false) : undefined;
|
|
|
|
// Merge with the pending element if it exists, otherwise with existing
|
|
// element props.
|
|
var wrapElement = topLevelWrapper._pendingElement || topLevelWrapper._currentElement;
|
|
var element = wrapElement.props;
|
|
var props = assign({}, element.props, partialProps);
|
|
topLevelWrapper._pendingElement = ReactElement.cloneAndReplaceProps(wrapElement, ReactElement.cloneAndReplaceProps(element, props));
|
|
|
|
enqueueUpdate(topLevelWrapper);
|
|
},
|
|
|
|
/**
|
|
* Replaces all of the props.
|
|
*
|
|
* @param {ReactClass} publicInstance The instance that should rerender.
|
|
* @param {object} props New props.
|
|
* @internal
|
|
*/
|
|
enqueueReplaceProps: function (publicInstance, props) {
|
|
var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'replaceProps');
|
|
if (!internalInstance) {
|
|
return;
|
|
}
|
|
ReactUpdateQueue.enqueueReplacePropsInternal(internalInstance, props);
|
|
},
|
|
|
|
enqueueReplacePropsInternal: function (internalInstance, props) {
|
|
var topLevelWrapper = internalInstance._topLevelWrapper;
|
|
!topLevelWrapper ? process.env.NODE_ENV !== 'production' ? invariant(false, 'replaceProps(...): You called `replaceProps` on a ' + 'component with a parent. This is an anti-pattern since props will ' + 'get reactively updated when rendered. Instead, change the owner\'s ' + '`render` method to pass the correct value as props to the component ' + 'where it is created.') : invariant(false) : undefined;
|
|
|
|
// Merge with the pending element if it exists, otherwise with existing
|
|
// element props.
|
|
var wrapElement = topLevelWrapper._pendingElement || topLevelWrapper._currentElement;
|
|
var element = wrapElement.props;
|
|
topLevelWrapper._pendingElement = ReactElement.cloneAndReplaceProps(wrapElement, ReactElement.cloneAndReplaceProps(element, props));
|
|
|
|
enqueueUpdate(topLevelWrapper);
|
|
},
|
|
|
|
enqueueElementInternal: function (internalInstance, newElement) {
|
|
internalInstance._pendingElement = newElement;
|
|
enqueueUpdate(internalInstance);
|
|
}
|
|
|
|
};
|
|
|
|
module.exports = ReactUpdateQueue;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 53 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactUpdates
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var CallbackQueue = __webpack_require__(54);
|
|
var PooledClass = __webpack_require__(55);
|
|
var ReactPerf = __webpack_require__(17);
|
|
var ReactReconciler = __webpack_require__(49);
|
|
var Transaction = __webpack_require__(56);
|
|
|
|
var assign = __webpack_require__(38);
|
|
var invariant = __webpack_require__(12);
|
|
|
|
var dirtyComponents = [];
|
|
var asapCallbackQueue = CallbackQueue.getPooled();
|
|
var asapEnqueued = false;
|
|
|
|
var batchingStrategy = null;
|
|
|
|
function ensureInjected() {
|
|
!(ReactUpdates.ReactReconcileTransaction && batchingStrategy) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must inject a reconcile transaction class and batching ' + 'strategy') : invariant(false) : undefined;
|
|
}
|
|
|
|
var NESTED_UPDATES = {
|
|
initialize: function () {
|
|
this.dirtyComponentsLength = dirtyComponents.length;
|
|
},
|
|
close: function () {
|
|
if (this.dirtyComponentsLength !== dirtyComponents.length) {
|
|
// Additional updates were enqueued by componentDidUpdate handlers or
|
|
// similar; before our own UPDATE_QUEUEING wrapper closes, we want to run
|
|
// these new updates so that if A's componentDidUpdate calls setState on
|
|
// B, B will update before the callback A's updater provided when calling
|
|
// setState.
|
|
dirtyComponents.splice(0, this.dirtyComponentsLength);
|
|
flushBatchedUpdates();
|
|
} else {
|
|
dirtyComponents.length = 0;
|
|
}
|
|
}
|
|
};
|
|
|
|
var UPDATE_QUEUEING = {
|
|
initialize: function () {
|
|
this.callbackQueue.reset();
|
|
},
|
|
close: function () {
|
|
this.callbackQueue.notifyAll();
|
|
}
|
|
};
|
|
|
|
var TRANSACTION_WRAPPERS = [NESTED_UPDATES, UPDATE_QUEUEING];
|
|
|
|
function ReactUpdatesFlushTransaction() {
|
|
this.reinitializeTransaction();
|
|
this.dirtyComponentsLength = null;
|
|
this.callbackQueue = CallbackQueue.getPooled();
|
|
this.reconcileTransaction = ReactUpdates.ReactReconcileTransaction.getPooled( /* forceHTML */false);
|
|
}
|
|
|
|
assign(ReactUpdatesFlushTransaction.prototype, Transaction.Mixin, {
|
|
getTransactionWrappers: function () {
|
|
return TRANSACTION_WRAPPERS;
|
|
},
|
|
|
|
destructor: function () {
|
|
this.dirtyComponentsLength = null;
|
|
CallbackQueue.release(this.callbackQueue);
|
|
this.callbackQueue = null;
|
|
ReactUpdates.ReactReconcileTransaction.release(this.reconcileTransaction);
|
|
this.reconcileTransaction = null;
|
|
},
|
|
|
|
perform: function (method, scope, a) {
|
|
// Essentially calls `this.reconcileTransaction.perform(method, scope, a)`
|
|
// with this transaction's wrappers around it.
|
|
return Transaction.Mixin.perform.call(this, this.reconcileTransaction.perform, this.reconcileTransaction, method, scope, a);
|
|
}
|
|
});
|
|
|
|
PooledClass.addPoolingTo(ReactUpdatesFlushTransaction);
|
|
|
|
function batchedUpdates(callback, a, b, c, d, e) {
|
|
ensureInjected();
|
|
batchingStrategy.batchedUpdates(callback, a, b, c, d, e);
|
|
}
|
|
|
|
/**
|
|
* Array comparator for ReactComponents by mount ordering.
|
|
*
|
|
* @param {ReactComponent} c1 first component you're comparing
|
|
* @param {ReactComponent} c2 second component you're comparing
|
|
* @return {number} Return value usable by Array.prototype.sort().
|
|
*/
|
|
function mountOrderComparator(c1, c2) {
|
|
return c1._mountOrder - c2._mountOrder;
|
|
}
|
|
|
|
function runBatchedUpdates(transaction) {
|
|
var len = transaction.dirtyComponentsLength;
|
|
!(len === dirtyComponents.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected flush transaction\'s stored dirty-components length (%s) to ' + 'match dirty-components array length (%s).', len, dirtyComponents.length) : invariant(false) : undefined;
|
|
|
|
// Since reconciling a component higher in the owner hierarchy usually (not
|
|
// always -- see shouldComponentUpdate()) will reconcile children, reconcile
|
|
// them before their children by sorting the array.
|
|
dirtyComponents.sort(mountOrderComparator);
|
|
|
|
for (var i = 0; i < len; i++) {
|
|
// If a component is unmounted before pending changes apply, it will still
|
|
// be here, but we assume that it has cleared its _pendingCallbacks and
|
|
// that performUpdateIfNecessary is a noop.
|
|
var component = dirtyComponents[i];
|
|
|
|
// If performUpdateIfNecessary happens to enqueue any new updates, we
|
|
// shouldn't execute the callbacks until the next render happens, so
|
|
// stash the callbacks first
|
|
var callbacks = component._pendingCallbacks;
|
|
component._pendingCallbacks = null;
|
|
|
|
ReactReconciler.performUpdateIfNecessary(component, transaction.reconcileTransaction);
|
|
|
|
if (callbacks) {
|
|
for (var j = 0; j < callbacks.length; j++) {
|
|
transaction.callbackQueue.enqueue(callbacks[j], component.getPublicInstance());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
var flushBatchedUpdates = function () {
|
|
// ReactUpdatesFlushTransaction's wrappers will clear the dirtyComponents
|
|
// array and perform any updates enqueued by mount-ready handlers (i.e.,
|
|
// componentDidUpdate) but we need to check here too in order to catch
|
|
// updates enqueued by setState callbacks and asap calls.
|
|
while (dirtyComponents.length || asapEnqueued) {
|
|
if (dirtyComponents.length) {
|
|
var transaction = ReactUpdatesFlushTransaction.getPooled();
|
|
transaction.perform(runBatchedUpdates, null, transaction);
|
|
ReactUpdatesFlushTransaction.release(transaction);
|
|
}
|
|
|
|
if (asapEnqueued) {
|
|
asapEnqueued = false;
|
|
var queue = asapCallbackQueue;
|
|
asapCallbackQueue = CallbackQueue.getPooled();
|
|
queue.notifyAll();
|
|
CallbackQueue.release(queue);
|
|
}
|
|
}
|
|
};
|
|
flushBatchedUpdates = ReactPerf.measure('ReactUpdates', 'flushBatchedUpdates', flushBatchedUpdates);
|
|
|
|
/**
|
|
* Mark a component as needing a rerender, adding an optional callback to a
|
|
* list of functions which will be executed once the rerender occurs.
|
|
*/
|
|
function enqueueUpdate(component) {
|
|
ensureInjected();
|
|
|
|
// Various parts of our code (such as ReactCompositeComponent's
|
|
// _renderValidatedComponent) assume that calls to render aren't nested;
|
|
// verify that that's the case. (This is called by each top-level update
|
|
// function, like setProps, setState, forceUpdate, etc.; creation and
|
|
// destruction of top-level components is guarded in ReactMount.)
|
|
|
|
if (!batchingStrategy.isBatchingUpdates) {
|
|
batchingStrategy.batchedUpdates(enqueueUpdate, component);
|
|
return;
|
|
}
|
|
|
|
dirtyComponents.push(component);
|
|
}
|
|
|
|
/**
|
|
* Enqueue a callback to be run at the end of the current batching cycle. Throws
|
|
* if no updates are currently being performed.
|
|
*/
|
|
function asap(callback, context) {
|
|
!batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : undefined;
|
|
asapCallbackQueue.enqueue(callback, context);
|
|
asapEnqueued = true;
|
|
}
|
|
|
|
var ReactUpdatesInjection = {
|
|
injectReconcileTransaction: function (ReconcileTransaction) {
|
|
!ReconcileTransaction ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a reconcile transaction class') : invariant(false) : undefined;
|
|
ReactUpdates.ReactReconcileTransaction = ReconcileTransaction;
|
|
},
|
|
|
|
injectBatchingStrategy: function (_batchingStrategy) {
|
|
!_batchingStrategy ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a batching strategy') : invariant(false) : undefined;
|
|
!(typeof _batchingStrategy.batchedUpdates === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a batchedUpdates() function') : invariant(false) : undefined;
|
|
!(typeof _batchingStrategy.isBatchingUpdates === 'boolean') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide an isBatchingUpdates boolean attribute') : invariant(false) : undefined;
|
|
batchingStrategy = _batchingStrategy;
|
|
}
|
|
};
|
|
|
|
var ReactUpdates = {
|
|
/**
|
|
* React references `ReactReconcileTransaction` using this property in order
|
|
* to allow dependency injection.
|
|
*
|
|
* @internal
|
|
*/
|
|
ReactReconcileTransaction: null,
|
|
|
|
batchedUpdates: batchedUpdates,
|
|
enqueueUpdate: enqueueUpdate,
|
|
flushBatchedUpdates: flushBatchedUpdates,
|
|
injection: ReactUpdatesInjection,
|
|
asap: asap
|
|
};
|
|
|
|
module.exports = ReactUpdates;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 54 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule CallbackQueue
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var PooledClass = __webpack_require__(55);
|
|
|
|
var assign = __webpack_require__(38);
|
|
var invariant = __webpack_require__(12);
|
|
|
|
/**
|
|
* A specialized pseudo-event module to help keep track of components waiting to
|
|
* be notified when their DOM representations are available for use.
|
|
*
|
|
* This implements `PooledClass`, so you should never need to instantiate this.
|
|
* Instead, use `CallbackQueue.getPooled()`.
|
|
*
|
|
* @class ReactMountReady
|
|
* @implements PooledClass
|
|
* @internal
|
|
*/
|
|
function CallbackQueue() {
|
|
this._callbacks = null;
|
|
this._contexts = null;
|
|
}
|
|
|
|
assign(CallbackQueue.prototype, {
|
|
|
|
/**
|
|
* Enqueues a callback to be invoked when `notifyAll` is invoked.
|
|
*
|
|
* @param {function} callback Invoked when `notifyAll` is invoked.
|
|
* @param {?object} context Context to call `callback` with.
|
|
* @internal
|
|
*/
|
|
enqueue: function (callback, context) {
|
|
this._callbacks = this._callbacks || [];
|
|
this._contexts = this._contexts || [];
|
|
this._callbacks.push(callback);
|
|
this._contexts.push(context);
|
|
},
|
|
|
|
/**
|
|
* Invokes all enqueued callbacks and clears the queue. This is invoked after
|
|
* the DOM representation of a component has been created or updated.
|
|
*
|
|
* @internal
|
|
*/
|
|
notifyAll: function () {
|
|
var callbacks = this._callbacks;
|
|
var contexts = this._contexts;
|
|
if (callbacks) {
|
|
!(callbacks.length === contexts.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Mismatched list of contexts in callback queue') : invariant(false) : undefined;
|
|
this._callbacks = null;
|
|
this._contexts = null;
|
|
for (var i = 0; i < callbacks.length; i++) {
|
|
callbacks[i].call(contexts[i]);
|
|
}
|
|
callbacks.length = 0;
|
|
contexts.length = 0;
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Resets the internal queue.
|
|
*
|
|
* @internal
|
|
*/
|
|
reset: function () {
|
|
this._callbacks = null;
|
|
this._contexts = null;
|
|
},
|
|
|
|
/**
|
|
* `PooledClass` looks for this.
|
|
*/
|
|
destructor: function () {
|
|
this.reset();
|
|
}
|
|
|
|
});
|
|
|
|
PooledClass.addPoolingTo(CallbackQueue);
|
|
|
|
module.exports = CallbackQueue;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 55 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule PooledClass
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var invariant = __webpack_require__(12);
|
|
|
|
/**
|
|
* Static poolers. Several custom versions for each potential number of
|
|
* arguments. A completely generic pooler is easy to implement, but would
|
|
* require accessing the `arguments` object. In each of these, `this` refers to
|
|
* the Class itself, not an instance. If any others are needed, simply add them
|
|
* here, or in their own files.
|
|
*/
|
|
var oneArgumentPooler = function (copyFieldsFrom) {
|
|
var Klass = this;
|
|
if (Klass.instancePool.length) {
|
|
var instance = Klass.instancePool.pop();
|
|
Klass.call(instance, copyFieldsFrom);
|
|
return instance;
|
|
} else {
|
|
return new Klass(copyFieldsFrom);
|
|
}
|
|
};
|
|
|
|
var twoArgumentPooler = function (a1, a2) {
|
|
var Klass = this;
|
|
if (Klass.instancePool.length) {
|
|
var instance = Klass.instancePool.pop();
|
|
Klass.call(instance, a1, a2);
|
|
return instance;
|
|
} else {
|
|
return new Klass(a1, a2);
|
|
}
|
|
};
|
|
|
|
var threeArgumentPooler = function (a1, a2, a3) {
|
|
var Klass = this;
|
|
if (Klass.instancePool.length) {
|
|
var instance = Klass.instancePool.pop();
|
|
Klass.call(instance, a1, a2, a3);
|
|
return instance;
|
|
} else {
|
|
return new Klass(a1, a2, a3);
|
|
}
|
|
};
|
|
|
|
var fourArgumentPooler = function (a1, a2, a3, a4) {
|
|
var Klass = this;
|
|
if (Klass.instancePool.length) {
|
|
var instance = Klass.instancePool.pop();
|
|
Klass.call(instance, a1, a2, a3, a4);
|
|
return instance;
|
|
} else {
|
|
return new Klass(a1, a2, a3, a4);
|
|
}
|
|
};
|
|
|
|
var fiveArgumentPooler = function (a1, a2, a3, a4, a5) {
|
|
var Klass = this;
|
|
if (Klass.instancePool.length) {
|
|
var instance = Klass.instancePool.pop();
|
|
Klass.call(instance, a1, a2, a3, a4, a5);
|
|
return instance;
|
|
} else {
|
|
return new Klass(a1, a2, a3, a4, a5);
|
|
}
|
|
};
|
|
|
|
var standardReleaser = function (instance) {
|
|
var Klass = this;
|
|
!(instance instanceof Klass) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : invariant(false) : undefined;
|
|
instance.destructor();
|
|
if (Klass.instancePool.length < Klass.poolSize) {
|
|
Klass.instancePool.push(instance);
|
|
}
|
|
};
|
|
|
|
var DEFAULT_POOL_SIZE = 10;
|
|
var DEFAULT_POOLER = oneArgumentPooler;
|
|
|
|
/**
|
|
* Augments `CopyConstructor` to be a poolable class, augmenting only the class
|
|
* itself (statically) not adding any prototypical fields. Any CopyConstructor
|
|
* you give this may have a `poolSize` property, and will look for a
|
|
* prototypical `destructor` on instances (optional).
|
|
*
|
|
* @param {Function} CopyConstructor Constructor that can be used to reset.
|
|
* @param {Function} pooler Customizable pooler.
|
|
*/
|
|
var addPoolingTo = function (CopyConstructor, pooler) {
|
|
var NewKlass = CopyConstructor;
|
|
NewKlass.instancePool = [];
|
|
NewKlass.getPooled = pooler || DEFAULT_POOLER;
|
|
if (!NewKlass.poolSize) {
|
|
NewKlass.poolSize = DEFAULT_POOL_SIZE;
|
|
}
|
|
NewKlass.release = standardReleaser;
|
|
return NewKlass;
|
|
};
|
|
|
|
var PooledClass = {
|
|
addPoolingTo: addPoolingTo,
|
|
oneArgumentPooler: oneArgumentPooler,
|
|
twoArgumentPooler: twoArgumentPooler,
|
|
threeArgumentPooler: threeArgumentPooler,
|
|
fourArgumentPooler: fourArgumentPooler,
|
|
fiveArgumentPooler: fiveArgumentPooler
|
|
};
|
|
|
|
module.exports = PooledClass;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 56 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule Transaction
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var invariant = __webpack_require__(12);
|
|
|
|
/**
|
|
* `Transaction` creates a black box that is able to wrap any method such that
|
|
* certain invariants are maintained before and after the method is invoked
|
|
* (Even if an exception is thrown while invoking the wrapped method). Whoever
|
|
* instantiates a transaction can provide enforcers of the invariants at
|
|
* creation time. The `Transaction` class itself will supply one additional
|
|
* automatic invariant for you - the invariant that any transaction instance
|
|
* should not be run while it is already being run. You would typically create a
|
|
* single instance of a `Transaction` for reuse multiple times, that potentially
|
|
* is used to wrap several different methods. Wrappers are extremely simple -
|
|
* they only require implementing two methods.
|
|
*
|
|
* <pre>
|
|
* wrappers (injected at creation time)
|
|
* + +
|
|
* | |
|
|
* +-----------------|--------|--------------+
|
|
* | v | |
|
|
* | +---------------+ | |
|
|
* | +--| wrapper1 |---|----+ |
|
|
* | | +---------------+ v | |
|
|
* | | +-------------+ | |
|
|
* | | +----| wrapper2 |--------+ |
|
|
* | | | +-------------+ | | |
|
|
* | | | | | |
|
|
* | v v v v | wrapper
|
|
* | +---+ +---+ +---------+ +---+ +---+ | invariants
|
|
* perform(anyMethod) | | | | | | | | | | | | maintained
|
|
* +----------------->|-|---|-|---|-->|anyMethod|---|---|-|---|-|-------->
|
|
* | | | | | | | | | | | |
|
|
* | | | | | | | | | | | |
|
|
* | | | | | | | | | | | |
|
|
* | +---+ +---+ +---------+ +---+ +---+ |
|
|
* | initialize close |
|
|
* +-----------------------------------------+
|
|
* </pre>
|
|
*
|
|
* Use cases:
|
|
* - Preserving the input selection ranges before/after reconciliation.
|
|
* Restoring selection even in the event of an unexpected error.
|
|
* - Deactivating events while rearranging the DOM, preventing blurs/focuses,
|
|
* while guaranteeing that afterwards, the event system is reactivated.
|
|
* - Flushing a queue of collected DOM mutations to the main UI thread after a
|
|
* reconciliation takes place in a worker thread.
|
|
* - Invoking any collected `componentDidUpdate` callbacks after rendering new
|
|
* content.
|
|
* - (Future use case): Wrapping particular flushes of the `ReactWorker` queue
|
|
* to preserve the `scrollTop` (an automatic scroll aware DOM).
|
|
* - (Future use case): Layout calculations before and after DOM updates.
|
|
*
|
|
* Transactional plugin API:
|
|
* - A module that has an `initialize` method that returns any precomputation.
|
|
* - and a `close` method that accepts the precomputation. `close` is invoked
|
|
* when the wrapped process is completed, or has failed.
|
|
*
|
|
* @param {Array<TransactionalWrapper>} transactionWrapper Wrapper modules
|
|
* that implement `initialize` and `close`.
|
|
* @return {Transaction} Single transaction for reuse in thread.
|
|
*
|
|
* @class Transaction
|
|
*/
|
|
var Mixin = {
|
|
/**
|
|
* Sets up this instance so that it is prepared for collecting metrics. Does
|
|
* so such that this setup method may be used on an instance that is already
|
|
* initialized, in a way that does not consume additional memory upon reuse.
|
|
* That can be useful if you decide to make your subclass of this mixin a
|
|
* "PooledClass".
|
|
*/
|
|
reinitializeTransaction: function () {
|
|
this.transactionWrappers = this.getTransactionWrappers();
|
|
if (this.wrapperInitData) {
|
|
this.wrapperInitData.length = 0;
|
|
} else {
|
|
this.wrapperInitData = [];
|
|
}
|
|
this._isInTransaction = false;
|
|
},
|
|
|
|
_isInTransaction: false,
|
|
|
|
/**
|
|
* @abstract
|
|
* @return {Array<TransactionWrapper>} Array of transaction wrappers.
|
|
*/
|
|
getTransactionWrappers: null,
|
|
|
|
isInTransaction: function () {
|
|
return !!this._isInTransaction;
|
|
},
|
|
|
|
/**
|
|
* Executes the function within a safety window. Use this for the top level
|
|
* methods that result in large amounts of computation/mutations that would
|
|
* need to be safety checked. The optional arguments helps prevent the need
|
|
* to bind in many cases.
|
|
*
|
|
* @param {function} method Member of scope to call.
|
|
* @param {Object} scope Scope to invoke from.
|
|
* @param {Object?=} a Argument to pass to the method.
|
|
* @param {Object?=} b Argument to pass to the method.
|
|
* @param {Object?=} c Argument to pass to the method.
|
|
* @param {Object?=} d Argument to pass to the method.
|
|
* @param {Object?=} e Argument to pass to the method.
|
|
* @param {Object?=} f Argument to pass to the method.
|
|
*
|
|
* @return {*} Return value from `method`.
|
|
*/
|
|
perform: function (method, scope, a, b, c, d, e, f) {
|
|
!!this.isInTransaction() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Transaction.perform(...): Cannot initialize a transaction when there ' + 'is already an outstanding transaction.') : invariant(false) : undefined;
|
|
var errorThrown;
|
|
var ret;
|
|
try {
|
|
this._isInTransaction = true;
|
|
// Catching errors makes debugging more difficult, so we start with
|
|
// errorThrown set to true before setting it to false after calling
|
|
// close -- if it's still set to true in the finally block, it means
|
|
// one of these calls threw.
|
|
errorThrown = true;
|
|
this.initializeAll(0);
|
|
ret = method.call(scope, a, b, c, d, e, f);
|
|
errorThrown = false;
|
|
} finally {
|
|
try {
|
|
if (errorThrown) {
|
|
// If `method` throws, prefer to show that stack trace over any thrown
|
|
// by invoking `closeAll`.
|
|
try {
|
|
this.closeAll(0);
|
|
} catch (err) {}
|
|
} else {
|
|
// Since `method` didn't throw, we don't want to silence the exception
|
|
// here.
|
|
this.closeAll(0);
|
|
}
|
|
} finally {
|
|
this._isInTransaction = false;
|
|
}
|
|
}
|
|
return ret;
|
|
},
|
|
|
|
initializeAll: function (startIndex) {
|
|
var transactionWrappers = this.transactionWrappers;
|
|
for (var i = startIndex; i < transactionWrappers.length; i++) {
|
|
var wrapper = transactionWrappers[i];
|
|
try {
|
|
// Catching errors makes debugging more difficult, so we start with the
|
|
// OBSERVED_ERROR state before overwriting it with the real return value
|
|
// of initialize -- if it's still set to OBSERVED_ERROR in the finally
|
|
// block, it means wrapper.initialize threw.
|
|
this.wrapperInitData[i] = Transaction.OBSERVED_ERROR;
|
|
this.wrapperInitData[i] = wrapper.initialize ? wrapper.initialize.call(this) : null;
|
|
} finally {
|
|
if (this.wrapperInitData[i] === Transaction.OBSERVED_ERROR) {
|
|
// The initializer for wrapper i threw an error; initialize the
|
|
// remaining wrappers but silence any exceptions from them to ensure
|
|
// that the first error is the one to bubble up.
|
|
try {
|
|
this.initializeAll(i + 1);
|
|
} catch (err) {}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Invokes each of `this.transactionWrappers.close[i]` functions, passing into
|
|
* them the respective return values of `this.transactionWrappers.init[i]`
|
|
* (`close`rs that correspond to initializers that failed will not be
|
|
* invoked).
|
|
*/
|
|
closeAll: function (startIndex) {
|
|
!this.isInTransaction() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Transaction.closeAll(): Cannot close transaction when none are open.') : invariant(false) : undefined;
|
|
var transactionWrappers = this.transactionWrappers;
|
|
for (var i = startIndex; i < transactionWrappers.length; i++) {
|
|
var wrapper = transactionWrappers[i];
|
|
var initData = this.wrapperInitData[i];
|
|
var errorThrown;
|
|
try {
|
|
// Catching errors makes debugging more difficult, so we start with
|
|
// errorThrown set to true before setting it to false after calling
|
|
// close -- if it's still set to true in the finally block, it means
|
|
// wrapper.close threw.
|
|
errorThrown = true;
|
|
if (initData !== Transaction.OBSERVED_ERROR && wrapper.close) {
|
|
wrapper.close.call(this, initData);
|
|
}
|
|
errorThrown = false;
|
|
} finally {
|
|
if (errorThrown) {
|
|
// The closer for wrapper i threw an error; close the remaining
|
|
// wrappers but silence any exceptions from them to ensure that the
|
|
// first error is the one to bubble up.
|
|
try {
|
|
this.closeAll(i + 1);
|
|
} catch (e) {}
|
|
}
|
|
}
|
|
}
|
|
this.wrapperInitData.length = 0;
|
|
}
|
|
};
|
|
|
|
var Transaction = {
|
|
|
|
Mixin: Mixin,
|
|
|
|
/**
|
|
* Token to look for to determine if an error occurred.
|
|
*/
|
|
OBSERVED_ERROR: {}
|
|
|
|
};
|
|
|
|
module.exports = Transaction;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 57 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule emptyObject
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var emptyObject = {};
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
Object.freeze(emptyObject);
|
|
}
|
|
|
|
module.exports = emptyObject;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 58 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule containsNode
|
|
* @typechecks
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var isTextNode = __webpack_require__(59);
|
|
|
|
/*eslint-disable no-bitwise */
|
|
|
|
/**
|
|
* Checks if a given DOM node contains or is another DOM node.
|
|
*
|
|
* @param {?DOMNode} outerNode Outer DOM node.
|
|
* @param {?DOMNode} innerNode Inner DOM node.
|
|
* @return {boolean} True if `outerNode` contains or is `innerNode`.
|
|
*/
|
|
function containsNode(_x, _x2) {
|
|
var _again = true;
|
|
|
|
_function: while (_again) {
|
|
var outerNode = _x,
|
|
innerNode = _x2;
|
|
_again = false;
|
|
|
|
if (!outerNode || !innerNode) {
|
|
return false;
|
|
} else if (outerNode === innerNode) {
|
|
return true;
|
|
} else if (isTextNode(outerNode)) {
|
|
return false;
|
|
} else if (isTextNode(innerNode)) {
|
|
_x = outerNode;
|
|
_x2 = innerNode.parentNode;
|
|
_again = true;
|
|
continue _function;
|
|
} else if (outerNode.contains) {
|
|
return outerNode.contains(innerNode);
|
|
} else if (outerNode.compareDocumentPosition) {
|
|
return !!(outerNode.compareDocumentPosition(innerNode) & 16);
|
|
} else {
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
|
|
module.exports = containsNode;
|
|
|
|
/***/ },
|
|
/* 59 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule isTextNode
|
|
* @typechecks
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var isNode = __webpack_require__(60);
|
|
|
|
/**
|
|
* @param {*} object The object to check.
|
|
* @return {boolean} Whether or not the object is a DOM text node.
|
|
*/
|
|
function isTextNode(object) {
|
|
return isNode(object) && object.nodeType == 3;
|
|
}
|
|
|
|
module.exports = isTextNode;
|
|
|
|
/***/ },
|
|
/* 60 */
|
|
/***/ function(module, exports) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule isNode
|
|
* @typechecks
|
|
*/
|
|
|
|
/**
|
|
* @param {*} object The object to check.
|
|
* @return {boolean} Whether or not the object is a DOM node.
|
|
*/
|
|
'use strict';
|
|
|
|
function isNode(object) {
|
|
return !!(object && (typeof Node === 'function' ? object instanceof Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string'));
|
|
}
|
|
|
|
module.exports = isNode;
|
|
|
|
/***/ },
|
|
/* 61 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule instantiateReactComponent
|
|
* @typechecks static-only
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var ReactCompositeComponent = __webpack_require__(62);
|
|
var ReactEmptyComponent = __webpack_require__(67);
|
|
var ReactNativeComponent = __webpack_require__(68);
|
|
|
|
var assign = __webpack_require__(38);
|
|
var invariant = __webpack_require__(12);
|
|
var warning = __webpack_require__(24);
|
|
|
|
// To avoid a cyclic dependency, we create the final class in this module
|
|
var ReactCompositeComponentWrapper = function () {};
|
|
assign(ReactCompositeComponentWrapper.prototype, ReactCompositeComponent.Mixin, {
|
|
_instantiateReactComponent: instantiateReactComponent
|
|
});
|
|
|
|
function getDeclarationErrorAddendum(owner) {
|
|
if (owner) {
|
|
var name = owner.getName();
|
|
if (name) {
|
|
return ' Check the render method of `' + name + '`.';
|
|
}
|
|
}
|
|
return '';
|
|
}
|
|
|
|
/**
|
|
* Check if the type reference is a known internal type. I.e. not a user
|
|
* provided composite type.
|
|
*
|
|
* @param {function} type
|
|
* @return {boolean} Returns true if this is a valid internal type.
|
|
*/
|
|
function isInternalComponentType(type) {
|
|
return typeof type === 'function' && typeof type.prototype !== 'undefined' && typeof type.prototype.mountComponent === 'function' && typeof type.prototype.receiveComponent === 'function';
|
|
}
|
|
|
|
/**
|
|
* Given a ReactNode, create an instance that will actually be mounted.
|
|
*
|
|
* @param {ReactNode} node
|
|
* @return {object} A new instance of the element's constructor.
|
|
* @protected
|
|
*/
|
|
function instantiateReactComponent(node) {
|
|
var instance;
|
|
|
|
if (node === null || node === false) {
|
|
instance = new ReactEmptyComponent(instantiateReactComponent);
|
|
} else if (typeof node === 'object') {
|
|
var element = node;
|
|
!(element && (typeof element.type === 'function' || typeof element.type === 'string')) ? process.env.NODE_ENV !== '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)) : invariant(false) : undefined;
|
|
|
|
// Special case string values
|
|
if (typeof element.type === 'string') {
|
|
instance = ReactNativeComponent.createInternalComponent(element);
|
|
} else if (isInternalComponentType(element.type)) {
|
|
// This is temporarily available for custom components that are not string
|
|
// representations. I.e. ART. Once those are updated to use the string
|
|
// representation, we can drop this code path.
|
|
instance = new element.type(element);
|
|
} else {
|
|
instance = new ReactCompositeComponentWrapper();
|
|
}
|
|
} else if (typeof node === 'string' || typeof node === 'number') {
|
|
instance = ReactNativeComponent.createInstanceForText(node);
|
|
} else {
|
|
true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Encountered invalid React node of type %s', typeof node) : invariant(false) : undefined;
|
|
}
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
process.env.NODE_ENV !== 'production' ? warning(typeof instance.construct === 'function' && typeof instance.mountComponent === 'function' && typeof instance.receiveComponent === 'function' && typeof instance.unmountComponent === 'function', 'Only React Components can be mounted.') : undefined;
|
|
}
|
|
|
|
// Sets up the instance. This can probably just move into the constructor now.
|
|
instance.construct(node);
|
|
|
|
// These two fields are used by the DOM and ART diffing algorithms
|
|
// respectively. Instead of using expandos on components, we should be
|
|
// storing the state needed by the diffing algorithms elsewhere.
|
|
instance._mountIndex = 0;
|
|
instance._mountImage = null;
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
instance._isOwnerNecessary = false;
|
|
instance._warnedAboutRefsInRender = false;
|
|
}
|
|
|
|
// Internal instances should fully constructed at this point, so they should
|
|
// not get any new fields added to them at this point.
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
if (Object.preventExtensions) {
|
|
Object.preventExtensions(instance);
|
|
}
|
|
}
|
|
|
|
return instance;
|
|
}
|
|
|
|
module.exports = instantiateReactComponent;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 62 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactCompositeComponent
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var ReactComponentEnvironment = __webpack_require__(63);
|
|
var ReactCurrentOwner = __webpack_require__(4);
|
|
var ReactElement = __webpack_require__(41);
|
|
var ReactInstanceMap = __webpack_require__(46);
|
|
var ReactPerf = __webpack_require__(17);
|
|
var ReactPropTypeLocations = __webpack_require__(64);
|
|
var ReactPropTypeLocationNames = __webpack_require__(65);
|
|
var ReactReconciler = __webpack_require__(49);
|
|
var ReactUpdateQueue = __webpack_require__(52);
|
|
|
|
var assign = __webpack_require__(38);
|
|
var emptyObject = __webpack_require__(57);
|
|
var invariant = __webpack_require__(12);
|
|
var shouldUpdateReactComponent = __webpack_require__(66);
|
|
var warning = __webpack_require__(24);
|
|
|
|
function getDeclarationErrorAddendum(component) {
|
|
var owner = component._currentElement._owner || null;
|
|
if (owner) {
|
|
var name = owner.getName();
|
|
if (name) {
|
|
return ' Check the render method of `' + name + '`.';
|
|
}
|
|
}
|
|
return '';
|
|
}
|
|
|
|
function StatelessComponent(Component) {}
|
|
StatelessComponent.prototype.render = function () {
|
|
var Component = ReactInstanceMap.get(this)._currentElement.type;
|
|
return Component(this.props, this.context, this.updater);
|
|
};
|
|
|
|
/**
|
|
* ------------------ The Life-Cycle of a Composite Component ------------------
|
|
*
|
|
* - constructor: Initialization of state. The instance is now retained.
|
|
* - componentWillMount
|
|
* - render
|
|
* - [children's constructors]
|
|
* - [children's componentWillMount and render]
|
|
* - [children's componentDidMount]
|
|
* - componentDidMount
|
|
*
|
|
* Update Phases:
|
|
* - componentWillReceiveProps (only called if parent updated)
|
|
* - shouldComponentUpdate
|
|
* - componentWillUpdate
|
|
* - render
|
|
* - [children's constructors or receive props phases]
|
|
* - componentDidUpdate
|
|
*
|
|
* - componentWillUnmount
|
|
* - [children's componentWillUnmount]
|
|
* - [children destroyed]
|
|
* - (destroyed): The instance is now blank, released by React and ready for GC.
|
|
*
|
|
* -----------------------------------------------------------------------------
|
|
*/
|
|
|
|
/**
|
|
* An incrementing ID assigned to each component when it is mounted. This is
|
|
* used to enforce the order in which `ReactUpdates` updates dirty components.
|
|
*
|
|
* @private
|
|
*/
|
|
var nextMountID = 1;
|
|
|
|
/**
|
|
* @lends {ReactCompositeComponent.prototype}
|
|
*/
|
|
var ReactCompositeComponentMixin = {
|
|
|
|
/**
|
|
* Base constructor for all composite component.
|
|
*
|
|
* @param {ReactElement} element
|
|
* @final
|
|
* @internal
|
|
*/
|
|
construct: function (element) {
|
|
this._currentElement = element;
|
|
this._rootNodeID = null;
|
|
this._instance = null;
|
|
|
|
// See ReactUpdateQueue
|
|
this._pendingElement = null;
|
|
this._pendingStateQueue = null;
|
|
this._pendingReplaceState = false;
|
|
this._pendingForceUpdate = false;
|
|
|
|
this._renderedComponent = null;
|
|
|
|
this._context = null;
|
|
this._mountOrder = 0;
|
|
this._topLevelWrapper = null;
|
|
|
|
// See ReactUpdates and ReactUpdateQueue.
|
|
this._pendingCallbacks = null;
|
|
},
|
|
|
|
/**
|
|
* Initializes the component, renders markup, and registers event listeners.
|
|
*
|
|
* @param {string} rootID DOM ID of the root node.
|
|
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
|
|
* @return {?string} Rendered markup to be inserted into the DOM.
|
|
* @final
|
|
* @internal
|
|
*/
|
|
mountComponent: function (rootID, transaction, context) {
|
|
this._context = context;
|
|
this._mountOrder = nextMountID++;
|
|
this._rootNodeID = rootID;
|
|
|
|
var publicProps = this._processProps(this._currentElement.props);
|
|
var publicContext = this._processContext(context);
|
|
|
|
var Component = this._currentElement.type;
|
|
|
|
// Initialize the public class
|
|
var inst;
|
|
var renderedElement;
|
|
|
|
// This is a way to detect if Component is a stateless arrow function
|
|
// component, which is not newable. It might not be 100% reliable but is
|
|
// something we can do until we start detecting that Component extends
|
|
// React.Component. We already assume that typeof Component === 'function'.
|
|
var canInstantiate = ('prototype' in Component);
|
|
|
|
if (canInstantiate) {
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
ReactCurrentOwner.current = this;
|
|
try {
|
|
inst = new Component(publicProps, publicContext, ReactUpdateQueue);
|
|
} finally {
|
|
ReactCurrentOwner.current = null;
|
|
}
|
|
} else {
|
|
inst = new Component(publicProps, publicContext, ReactUpdateQueue);
|
|
}
|
|
}
|
|
|
|
if (!canInstantiate || inst === null || inst === false || ReactElement.isValidElement(inst)) {
|
|
renderedElement = inst;
|
|
inst = new StatelessComponent(Component);
|
|
}
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
// This will throw later in _renderValidatedComponent, but add an early
|
|
// warning now to help debugging
|
|
if (inst.render == null) {
|
|
process.env.NODE_ENV !== 'production' ? warning(false, '%s(...): No `render` method found on the returned component ' + 'instance: you may have forgotten to define `render`, returned ' + 'null/false from a stateless component, or tried to render an ' + 'element whose type is a function that isn\'t a React component.', Component.displayName || Component.name || 'Component') : undefined;
|
|
} else {
|
|
// We support ES6 inheriting from React.Component, the module pattern,
|
|
// and stateless components, but not ES6 classes that don't extend
|
|
process.env.NODE_ENV !== 'production' ? warning(Component.prototype && Component.prototype.isReactComponent || !canInstantiate || !(inst instanceof Component), '%s(...): React component classes must extend React.Component.', Component.displayName || Component.name || 'Component') : undefined;
|
|
}
|
|
}
|
|
|
|
// These should be set up in the constructor, but as a convenience for
|
|
// simpler class abstractions, we set them up after the fact.
|
|
inst.props = publicProps;
|
|
inst.context = publicContext;
|
|
inst.refs = emptyObject;
|
|
inst.updater = ReactUpdateQueue;
|
|
|
|
this._instance = inst;
|
|
|
|
// Store a reference from the instance back to the internal representation
|
|
ReactInstanceMap.set(inst, this);
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
// Since plain JS classes are defined without any special initialization
|
|
// logic, we can not catch common errors early. Therefore, we have to
|
|
// catch them here, at initialization time, instead.
|
|
process.env.NODE_ENV !== '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') : undefined;
|
|
process.env.NODE_ENV !== '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') : undefined;
|
|
process.env.NODE_ENV !== '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') : undefined;
|
|
process.env.NODE_ENV !== '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') : undefined;
|
|
process.env.NODE_ENV !== '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') : undefined;
|
|
process.env.NODE_ENV !== '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') : undefined;
|
|
process.env.NODE_ENV !== 'production' ? warning(typeof inst.componentWillRecieveProps !== 'function', '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', this.getName() || 'A component') : undefined;
|
|
}
|
|
|
|
var initialState = inst.state;
|
|
if (initialState === undefined) {
|
|
inst.state = initialState = null;
|
|
}
|
|
!(typeof initialState === 'object' && !Array.isArray(initialState)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.state: must be set to an object or null', this.getName() || 'ReactCompositeComponent') : invariant(false) : undefined;
|
|
|
|
this._pendingStateQueue = null;
|
|
this._pendingReplaceState = false;
|
|
this._pendingForceUpdate = false;
|
|
|
|
if (inst.componentWillMount) {
|
|
inst.componentWillMount();
|
|
// When mounting, calls to `setState` by `componentWillMount` will set
|
|
// `this._pendingStateQueue` without triggering a re-render.
|
|
if (this._pendingStateQueue) {
|
|
inst.state = this._processPendingState(inst.props, inst.context);
|
|
}
|
|
}
|
|
|
|
// If not a stateless component, we now render
|
|
if (renderedElement === undefined) {
|
|
renderedElement = this._renderValidatedComponent();
|
|
}
|
|
|
|
this._renderedComponent = this._instantiateReactComponent(renderedElement);
|
|
|
|
var markup = ReactReconciler.mountComponent(this._renderedComponent, rootID, transaction, this._processChildContext(context));
|
|
if (inst.componentDidMount) {
|
|
transaction.getReactMountReady().enqueue(inst.componentDidMount, inst);
|
|
}
|
|
|
|
return markup;
|
|
},
|
|
|
|
/**
|
|
* Releases any resources allocated by `mountComponent`.
|
|
*
|
|
* @final
|
|
* @internal
|
|
*/
|
|
unmountComponent: function () {
|
|
var inst = this._instance;
|
|
|
|
if (inst.componentWillUnmount) {
|
|
inst.componentWillUnmount();
|
|
}
|
|
|
|
ReactReconciler.unmountComponent(this._renderedComponent);
|
|
this._renderedComponent = null;
|
|
this._instance = null;
|
|
|
|
// Reset pending fields
|
|
// Even if this component is scheduled for another update in ReactUpdates,
|
|
// it would still be ignored because these fields are reset.
|
|
this._pendingStateQueue = null;
|
|
this._pendingReplaceState = false;
|
|
this._pendingForceUpdate = false;
|
|
this._pendingCallbacks = null;
|
|
this._pendingElement = null;
|
|
|
|
// These fields do not really need to be reset since this object is no
|
|
// longer accessible.
|
|
this._context = null;
|
|
this._rootNodeID = null;
|
|
this._topLevelWrapper = null;
|
|
|
|
// Delete the reference from the instance to this internal representation
|
|
// which allow the internals to be properly cleaned up even if the user
|
|
// leaks a reference to the public instance.
|
|
ReactInstanceMap.remove(inst);
|
|
|
|
// Some existing components rely on inst.props even after they've been
|
|
// destroyed (in event handlers).
|
|
// TODO: inst.props = null;
|
|
// TODO: inst.state = null;
|
|
// TODO: inst.context = null;
|
|
},
|
|
|
|
/**
|
|
* Filters the context object to only contain keys specified in
|
|
* `contextTypes`
|
|
*
|
|
* @param {object} context
|
|
* @return {?object}
|
|
* @private
|
|
*/
|
|
_maskContext: function (context) {
|
|
var maskedContext = null;
|
|
var Component = this._currentElement.type;
|
|
var contextTypes = Component.contextTypes;
|
|
if (!contextTypes) {
|
|
return emptyObject;
|
|
}
|
|
maskedContext = {};
|
|
for (var contextName in contextTypes) {
|
|
maskedContext[contextName] = context[contextName];
|
|
}
|
|
return maskedContext;
|
|
},
|
|
|
|
/**
|
|
* Filters the context object to only contain keys specified in
|
|
* `contextTypes`, and asserts that they are valid.
|
|
*
|
|
* @param {object} context
|
|
* @return {?object}
|
|
* @private
|
|
*/
|
|
_processContext: function (context) {
|
|
var maskedContext = this._maskContext(context);
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
var Component = this._currentElement.type;
|
|
if (Component.contextTypes) {
|
|
this._checkPropTypes(Component.contextTypes, maskedContext, ReactPropTypeLocations.context);
|
|
}
|
|
}
|
|
return maskedContext;
|
|
},
|
|
|
|
/**
|
|
* @param {object} currentContext
|
|
* @return {object}
|
|
* @private
|
|
*/
|
|
_processChildContext: function (currentContext) {
|
|
var Component = this._currentElement.type;
|
|
var inst = this._instance;
|
|
var childContext = inst.getChildContext && inst.getChildContext();
|
|
if (childContext) {
|
|
!(typeof Component.childContextTypes === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', this.getName() || 'ReactCompositeComponent') : invariant(false) : undefined;
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
this._checkPropTypes(Component.childContextTypes, childContext, ReactPropTypeLocations.childContext);
|
|
}
|
|
for (var name in childContext) {
|
|
!(name in Component.childContextTypes) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.getChildContext(): key "%s" is not defined in childContextTypes.', this.getName() || 'ReactCompositeComponent', name) : invariant(false) : undefined;
|
|
}
|
|
return assign({}, currentContext, childContext);
|
|
}
|
|
return currentContext;
|
|
},
|
|
|
|
/**
|
|
* Processes props by setting default values for unspecified props and
|
|
* asserting that the props are valid. Does not mutate its argument; returns
|
|
* a new props object with defaults merged in.
|
|
*
|
|
* @param {object} newProps
|
|
* @return {object}
|
|
* @private
|
|
*/
|
|
_processProps: function (newProps) {
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
var Component = this._currentElement.type;
|
|
if (Component.propTypes) {
|
|
this._checkPropTypes(Component.propTypes, newProps, ReactPropTypeLocations.prop);
|
|
}
|
|
}
|
|
return newProps;
|
|
},
|
|
|
|
/**
|
|
* Assert that the props are valid
|
|
*
|
|
* @param {object} propTypes Map of prop name to a ReactPropType
|
|
* @param {object} props
|
|
* @param {string} location e.g. "prop", "context", "child context"
|
|
* @private
|
|
*/
|
|
_checkPropTypes: function (propTypes, props, location) {
|
|
// TODO: Stop validating prop types here and only use the element
|
|
// validation.
|
|
var componentName = this.getName();
|
|
for (var propName in propTypes) {
|
|
if (propTypes.hasOwnProperty(propName)) {
|
|
var error;
|
|
try {
|
|
// This is intentionally an invariant that gets caught. It's the same
|
|
// behavior as without this statement except with a better message.
|
|
!(typeof propTypes[propName] === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s: %s type `%s` is invalid; it must be a function, usually ' + 'from React.PropTypes.', componentName || 'React class', ReactPropTypeLocationNames[location], propName) : invariant(false) : undefined;
|
|
error = propTypes[propName](props, propName, componentName, location);
|
|
} catch (ex) {
|
|
error = ex;
|
|
}
|
|
if (error instanceof Error) {
|
|
// We may want to extend this logic for similar errors in
|
|
// top-level render calls, so I'm abstracting it away into
|
|
// a function to minimize refactoring in the future
|
|
var addendum = getDeclarationErrorAddendum(this);
|
|
|
|
if (location === ReactPropTypeLocations.prop) {
|
|
// Preface gives us something to blacklist in warning module
|
|
process.env.NODE_ENV !== 'production' ? warning(false, 'Failed Composite propType: %s%s', error.message, addendum) : undefined;
|
|
} else {
|
|
process.env.NODE_ENV !== 'production' ? warning(false, 'Failed Context Types: %s%s', error.message, addendum) : undefined;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
|
|
receiveComponent: function (nextElement, transaction, nextContext) {
|
|
var prevElement = this._currentElement;
|
|
var prevContext = this._context;
|
|
|
|
this._pendingElement = null;
|
|
|
|
this.updateComponent(transaction, prevElement, nextElement, prevContext, nextContext);
|
|
},
|
|
|
|
/**
|
|
* If any of `_pendingElement`, `_pendingStateQueue`, or `_pendingForceUpdate`
|
|
* is set, update the component.
|
|
*
|
|
* @param {ReactReconcileTransaction} transaction
|
|
* @internal
|
|
*/
|
|
performUpdateIfNecessary: function (transaction) {
|
|
if (this._pendingElement != null) {
|
|
ReactReconciler.receiveComponent(this, this._pendingElement || this._currentElement, transaction, this._context);
|
|
}
|
|
|
|
if (this._pendingStateQueue !== null || this._pendingForceUpdate) {
|
|
this.updateComponent(transaction, this._currentElement, this._currentElement, this._context, this._context);
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Perform an update to a mounted component. The componentWillReceiveProps and
|
|
* shouldComponentUpdate methods are called, then (assuming the update isn't
|
|
* skipped) the remaining update lifecycle methods are called and the DOM
|
|
* representation is updated.
|
|
*
|
|
* By default, this implements React's rendering and reconciliation algorithm.
|
|
* Sophisticated clients may wish to override this.
|
|
*
|
|
* @param {ReactReconcileTransaction} transaction
|
|
* @param {ReactElement} prevParentElement
|
|
* @param {ReactElement} nextParentElement
|
|
* @internal
|
|
* @overridable
|
|
*/
|
|
updateComponent: function (transaction, prevParentElement, nextParentElement, prevUnmaskedContext, nextUnmaskedContext) {
|
|
var inst = this._instance;
|
|
|
|
var nextContext = this._context === nextUnmaskedContext ? inst.context : this._processContext(nextUnmaskedContext);
|
|
var nextProps;
|
|
|
|
// Distinguish between a props update versus a simple state update
|
|
if (prevParentElement === nextParentElement) {
|
|
// Skip checking prop types again -- we don't read inst.props to avoid
|
|
// warning for DOM component props in this upgrade
|
|
nextProps = nextParentElement.props;
|
|
} else {
|
|
nextProps = this._processProps(nextParentElement.props);
|
|
// An update here will schedule an update but immediately set
|
|
// _pendingStateQueue which will ensure that any state updates gets
|
|
// immediately reconciled instead of waiting for the next batch.
|
|
|
|
if (inst.componentWillReceiveProps) {
|
|
inst.componentWillReceiveProps(nextProps, nextContext);
|
|
}
|
|
}
|
|
|
|
var nextState = this._processPendingState(nextProps, nextContext);
|
|
|
|
var shouldUpdate = this._pendingForceUpdate || !inst.shouldComponentUpdate || inst.shouldComponentUpdate(nextProps, nextState, nextContext);
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
process.env.NODE_ENV !== 'production' ? warning(typeof shouldUpdate !== 'undefined', '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', this.getName() || 'ReactCompositeComponent') : undefined;
|
|
}
|
|
|
|
if (shouldUpdate) {
|
|
this._pendingForceUpdate = false;
|
|
// Will set `this.props`, `this.state` and `this.context`.
|
|
this._performComponentUpdate(nextParentElement, nextProps, nextState, nextContext, transaction, nextUnmaskedContext);
|
|
} else {
|
|
// If it's determined that a component should not update, we still want
|
|
// to set props and state but we shortcut the rest of the update.
|
|
this._currentElement = nextParentElement;
|
|
this._context = nextUnmaskedContext;
|
|
inst.props = nextProps;
|
|
inst.state = nextState;
|
|
inst.context = nextContext;
|
|
}
|
|
},
|
|
|
|
_processPendingState: function (props, context) {
|
|
var inst = this._instance;
|
|
var queue = this._pendingStateQueue;
|
|
var replace = this._pendingReplaceState;
|
|
this._pendingReplaceState = false;
|
|
this._pendingStateQueue = null;
|
|
|
|
if (!queue) {
|
|
return inst.state;
|
|
}
|
|
|
|
if (replace && queue.length === 1) {
|
|
return queue[0];
|
|
}
|
|
|
|
var nextState = assign({}, replace ? queue[0] : inst.state);
|
|
for (var i = replace ? 1 : 0; i < queue.length; i++) {
|
|
var partial = queue[i];
|
|
assign(nextState, typeof partial === 'function' ? partial.call(inst, nextState, props, context) : partial);
|
|
}
|
|
|
|
return nextState;
|
|
},
|
|
|
|
/**
|
|
* Merges new props and state, notifies delegate methods of update and
|
|
* performs update.
|
|
*
|
|
* @param {ReactElement} nextElement Next element
|
|
* @param {object} nextProps Next public object to set as properties.
|
|
* @param {?object} nextState Next object to set as state.
|
|
* @param {?object} nextContext Next public object to set as context.
|
|
* @param {ReactReconcileTransaction} transaction
|
|
* @param {?object} unmaskedContext
|
|
* @private
|
|
*/
|
|
_performComponentUpdate: function (nextElement, nextProps, nextState, nextContext, transaction, unmaskedContext) {
|
|
var inst = this._instance;
|
|
|
|
var hasComponentDidUpdate = Boolean(inst.componentDidUpdate);
|
|
var prevProps;
|
|
var prevState;
|
|
var prevContext;
|
|
if (hasComponentDidUpdate) {
|
|
prevProps = inst.props;
|
|
prevState = inst.state;
|
|
prevContext = inst.context;
|
|
}
|
|
|
|
if (inst.componentWillUpdate) {
|
|
inst.componentWillUpdate(nextProps, nextState, nextContext);
|
|
}
|
|
|
|
this._currentElement = nextElement;
|
|
this._context = unmaskedContext;
|
|
inst.props = nextProps;
|
|
inst.state = nextState;
|
|
inst.context = nextContext;
|
|
|
|
this._updateRenderedComponent(transaction, unmaskedContext);
|
|
|
|
if (hasComponentDidUpdate) {
|
|
transaction.getReactMountReady().enqueue(inst.componentDidUpdate.bind(inst, prevProps, prevState, prevContext), inst);
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Call the component's `render` method and update the DOM accordingly.
|
|
*
|
|
* @param {ReactReconcileTransaction} transaction
|
|
* @internal
|
|
*/
|
|
_updateRenderedComponent: function (transaction, context) {
|
|
var prevComponentInstance = this._renderedComponent;
|
|
var prevRenderedElement = prevComponentInstance._currentElement;
|
|
var nextRenderedElement = this._renderValidatedComponent();
|
|
if (shouldUpdateReactComponent(prevRenderedElement, nextRenderedElement)) {
|
|
ReactReconciler.receiveComponent(prevComponentInstance, nextRenderedElement, transaction, this._processChildContext(context));
|
|
} else {
|
|
// These two IDs are actually the same! But nothing should rely on that.
|
|
var thisID = this._rootNodeID;
|
|
var prevComponentID = prevComponentInstance._rootNodeID;
|
|
ReactReconciler.unmountComponent(prevComponentInstance);
|
|
|
|
this._renderedComponent = this._instantiateReactComponent(nextRenderedElement);
|
|
var nextMarkup = ReactReconciler.mountComponent(this._renderedComponent, thisID, transaction, this._processChildContext(context));
|
|
this._replaceNodeWithMarkupByID(prevComponentID, nextMarkup);
|
|
}
|
|
},
|
|
|
|
/**
|
|
* @protected
|
|
*/
|
|
_replaceNodeWithMarkupByID: function (prevComponentID, nextMarkup) {
|
|
ReactComponentEnvironment.replaceNodeWithMarkupByID(prevComponentID, nextMarkup);
|
|
},
|
|
|
|
/**
|
|
* @protected
|
|
*/
|
|
_renderValidatedComponentWithoutOwnerOrContext: function () {
|
|
var inst = this._instance;
|
|
var renderedComponent = inst.render();
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
// We allow auto-mocks to proceed as if they're returning null.
|
|
if (typeof renderedComponent === 'undefined' && inst.render._isMockFunction) {
|
|
// This is probably bad practice. Consider warning here and
|
|
// deprecating this convenience.
|
|
renderedComponent = null;
|
|
}
|
|
}
|
|
|
|
return renderedComponent;
|
|
},
|
|
|
|
/**
|
|
* @private
|
|
*/
|
|
_renderValidatedComponent: function () {
|
|
var renderedComponent;
|
|
ReactCurrentOwner.current = this;
|
|
try {
|
|
renderedComponent = this._renderValidatedComponentWithoutOwnerOrContext();
|
|
} finally {
|
|
ReactCurrentOwner.current = null;
|
|
}
|
|
!(
|
|
// TODO: An `isValidNode` function would probably be more appropriate
|
|
renderedComponent === null || renderedComponent === false || ReactElement.isValidElement(renderedComponent)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.render(): A valid ReactComponent must be returned. You may have ' + 'returned undefined, an array or some other invalid object.', this.getName() || 'ReactCompositeComponent') : invariant(false) : undefined;
|
|
return renderedComponent;
|
|
},
|
|
|
|
/**
|
|
* Lazily allocates the refs object and stores `component` as `ref`.
|
|
*
|
|
* @param {string} ref Reference name.
|
|
* @param {component} component Component to store as `ref`.
|
|
* @final
|
|
* @private
|
|
*/
|
|
attachRef: function (ref, component) {
|
|
var inst = this.getPublicInstance();
|
|
!(inst != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Stateless function components cannot have refs.') : invariant(false) : undefined;
|
|
var publicComponentInstance = component.getPublicInstance();
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
var componentName = component && component.getName ? component.getName() : 'a component';
|
|
process.env.NODE_ENV !== 'production' ? warning(publicComponentInstance != null, 'Stateless function components cannot be given refs ' + '(See ref "%s" in %s created by %s). ' + 'Attempts to access this ref will fail.', ref, componentName, this.getName()) : undefined;
|
|
}
|
|
var refs = inst.refs === emptyObject ? inst.refs = {} : inst.refs;
|
|
refs[ref] = publicComponentInstance;
|
|
},
|
|
|
|
/**
|
|
* Detaches a reference name.
|
|
*
|
|
* @param {string} ref Name to dereference.
|
|
* @final
|
|
* @private
|
|
*/
|
|
detachRef: function (ref) {
|
|
var refs = this.getPublicInstance().refs;
|
|
delete refs[ref];
|
|
},
|
|
|
|
/**
|
|
* Get a text description of the component that can be used to identify it
|
|
* in error messages.
|
|
* @return {string} The name or null.
|
|
* @internal
|
|
*/
|
|
getName: function () {
|
|
var type = this._currentElement.type;
|
|
var constructor = this._instance && this._instance.constructor;
|
|
return type.displayName || constructor && constructor.displayName || type.name || constructor && constructor.name || null;
|
|
},
|
|
|
|
/**
|
|
* Get the publicly accessible representation of this component - i.e. what
|
|
* is exposed by refs and returned by render. Can be null for stateless
|
|
* components.
|
|
*
|
|
* @return {ReactComponent} the public component instance.
|
|
* @internal
|
|
*/
|
|
getPublicInstance: function () {
|
|
var inst = this._instance;
|
|
if (inst instanceof StatelessComponent) {
|
|
return null;
|
|
}
|
|
return inst;
|
|
},
|
|
|
|
// Stub
|
|
_instantiateReactComponent: null
|
|
|
|
};
|
|
|
|
ReactPerf.measureMethods(ReactCompositeComponentMixin, 'ReactCompositeComponent', {
|
|
mountComponent: 'mountComponent',
|
|
updateComponent: 'updateComponent',
|
|
_renderValidatedComponent: '_renderValidatedComponent'
|
|
});
|
|
|
|
var ReactCompositeComponent = {
|
|
|
|
Mixin: ReactCompositeComponentMixin
|
|
|
|
};
|
|
|
|
module.exports = ReactCompositeComponent;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 63 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2014-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactComponentEnvironment
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var invariant = __webpack_require__(12);
|
|
|
|
var injected = false;
|
|
|
|
var ReactComponentEnvironment = {
|
|
|
|
/**
|
|
* Optionally injectable environment dependent cleanup hook. (server vs.
|
|
* browser etc). Example: A browser system caches DOM nodes based on component
|
|
* ID and must remove that cache entry when this instance is unmounted.
|
|
*/
|
|
unmountIDFromEnvironment: null,
|
|
|
|
/**
|
|
* Optionally injectable hook for swapping out mount images in the middle of
|
|
* the tree.
|
|
*/
|
|
replaceNodeWithMarkupByID: null,
|
|
|
|
/**
|
|
* Optionally injectable hook for processing a queue of child updates. Will
|
|
* later move into MultiChildComponents.
|
|
*/
|
|
processChildrenUpdates: null,
|
|
|
|
injection: {
|
|
injectEnvironment: function (environment) {
|
|
!!injected ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactCompositeComponent: injectEnvironment() can only be called once.') : invariant(false) : undefined;
|
|
ReactComponentEnvironment.unmountIDFromEnvironment = environment.unmountIDFromEnvironment;
|
|
ReactComponentEnvironment.replaceNodeWithMarkupByID = environment.replaceNodeWithMarkupByID;
|
|
ReactComponentEnvironment.processChildrenUpdates = environment.processChildrenUpdates;
|
|
injected = true;
|
|
}
|
|
}
|
|
|
|
};
|
|
|
|
module.exports = ReactComponentEnvironment;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 64 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactPropTypeLocations
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var keyMirror = __webpack_require__(16);
|
|
|
|
var ReactPropTypeLocations = keyMirror({
|
|
prop: null,
|
|
context: null,
|
|
childContext: null
|
|
});
|
|
|
|
module.exports = ReactPropTypeLocations;
|
|
|
|
/***/ },
|
|
/* 65 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactPropTypeLocationNames
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var ReactPropTypeLocationNames = {};
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
ReactPropTypeLocationNames = {
|
|
prop: 'prop',
|
|
context: 'context',
|
|
childContext: 'child context'
|
|
};
|
|
}
|
|
|
|
module.exports = ReactPropTypeLocationNames;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 66 */
|
|
/***/ function(module, exports) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule shouldUpdateReactComponent
|
|
* @typechecks static-only
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
/**
|
|
* Given a `prevElement` and `nextElement`, determines if the existing
|
|
* instance should be updated as opposed to being destroyed or replaced by a new
|
|
* instance. Both arguments are elements. This ensures that this logic can
|
|
* operate on stateless trees without any backing instance.
|
|
*
|
|
* @param {?object} prevElement
|
|
* @param {?object} nextElement
|
|
* @return {boolean} True if the existing instance should be updated.
|
|
* @protected
|
|
*/
|
|
function shouldUpdateReactComponent(prevElement, nextElement) {
|
|
var prevEmpty = prevElement === null || prevElement === false;
|
|
var nextEmpty = nextElement === null || nextElement === false;
|
|
if (prevEmpty || nextEmpty) {
|
|
return prevEmpty === nextEmpty;
|
|
}
|
|
|
|
var prevType = typeof prevElement;
|
|
var nextType = typeof nextElement;
|
|
if (prevType === 'string' || prevType === 'number') {
|
|
return nextType === 'string' || nextType === 'number';
|
|
} else {
|
|
return nextType === 'object' && prevElement.type === nextElement.type && prevElement.key === nextElement.key;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
module.exports = shouldUpdateReactComponent;
|
|
|
|
/***/ },
|
|
/* 67 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2014-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactEmptyComponent
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var ReactElement = __webpack_require__(41);
|
|
var ReactEmptyComponentRegistry = __webpack_require__(43);
|
|
var ReactReconciler = __webpack_require__(49);
|
|
|
|
var assign = __webpack_require__(38);
|
|
|
|
var placeholderElement;
|
|
|
|
var ReactEmptyComponentInjection = {
|
|
injectEmptyComponent: function (component) {
|
|
placeholderElement = ReactElement.createElement(component);
|
|
}
|
|
};
|
|
|
|
function registerNullComponentID() {
|
|
ReactEmptyComponentRegistry.registerNullComponentID(this._rootNodeID);
|
|
}
|
|
|
|
var ReactEmptyComponent = function (instantiate) {
|
|
this._currentElement = null;
|
|
this._rootNodeID = null;
|
|
this._renderedComponent = instantiate(placeholderElement);
|
|
};
|
|
assign(ReactEmptyComponent.prototype, {
|
|
construct: function (element) {},
|
|
mountComponent: function (rootID, transaction, context) {
|
|
transaction.getReactMountReady().enqueue(registerNullComponentID, this);
|
|
this._rootNodeID = rootID;
|
|
return ReactReconciler.mountComponent(this._renderedComponent, rootID, transaction, context);
|
|
},
|
|
receiveComponent: function () {},
|
|
unmountComponent: function (rootID, transaction, context) {
|
|
ReactReconciler.unmountComponent(this._renderedComponent);
|
|
ReactEmptyComponentRegistry.deregisterNullComponentID(this._rootNodeID);
|
|
this._rootNodeID = null;
|
|
this._renderedComponent = null;
|
|
}
|
|
});
|
|
|
|
ReactEmptyComponent.injection = ReactEmptyComponentInjection;
|
|
|
|
module.exports = ReactEmptyComponent;
|
|
|
|
/***/ },
|
|
/* 68 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2014-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactNativeComponent
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var assign = __webpack_require__(38);
|
|
var invariant = __webpack_require__(12);
|
|
|
|
var autoGenerateWrapperClass = null;
|
|
var genericComponentClass = null;
|
|
// This registry keeps track of wrapper classes around native tags.
|
|
var tagToComponentClass = {};
|
|
var textComponentClass = null;
|
|
|
|
var ReactNativeComponentInjection = {
|
|
// This accepts a class that receives the tag string. This is a catch all
|
|
// that can render any kind of tag.
|
|
injectGenericComponentClass: function (componentClass) {
|
|
genericComponentClass = componentClass;
|
|
},
|
|
// This accepts a text component class that takes the text string to be
|
|
// rendered as props.
|
|
injectTextComponentClass: function (componentClass) {
|
|
textComponentClass = componentClass;
|
|
},
|
|
// This accepts a keyed object with classes as values. Each key represents a
|
|
// tag. That particular tag will use this class instead of the generic one.
|
|
injectComponentClasses: function (componentClasses) {
|
|
assign(tagToComponentClass, componentClasses);
|
|
}
|
|
};
|
|
|
|
/**
|
|
* Get a composite component wrapper class for a specific tag.
|
|
*
|
|
* @param {ReactElement} element The tag for which to get the class.
|
|
* @return {function} The React class constructor function.
|
|
*/
|
|
function getComponentClassForElement(element) {
|
|
if (typeof element.type === 'function') {
|
|
return element.type;
|
|
}
|
|
var tag = element.type;
|
|
var componentClass = tagToComponentClass[tag];
|
|
if (componentClass == null) {
|
|
tagToComponentClass[tag] = componentClass = autoGenerateWrapperClass(tag);
|
|
}
|
|
return componentClass;
|
|
}
|
|
|
|
/**
|
|
* Get a native internal component class for a specific tag.
|
|
*
|
|
* @param {ReactElement} element The element to create.
|
|
* @return {function} The internal class constructor function.
|
|
*/
|
|
function createInternalComponent(element) {
|
|
!genericComponentClass ? process.env.NODE_ENV !== 'production' ? invariant(false, 'There is no registered component for the tag %s', element.type) : invariant(false) : undefined;
|
|
return new genericComponentClass(element.type, element.props);
|
|
}
|
|
|
|
/**
|
|
* @param {ReactText} text
|
|
* @return {ReactComponent}
|
|
*/
|
|
function createInstanceForText(text) {
|
|
return new textComponentClass(text);
|
|
}
|
|
|
|
/**
|
|
* @param {ReactComponent} component
|
|
* @return {boolean}
|
|
*/
|
|
function isTextComponent(component) {
|
|
return component instanceof textComponentClass;
|
|
}
|
|
|
|
var ReactNativeComponent = {
|
|
getComponentClassForElement: getComponentClassForElement,
|
|
createInternalComponent: createInternalComponent,
|
|
createInstanceForText: createInstanceForText,
|
|
isTextComponent: isTextComponent,
|
|
injection: ReactNativeComponentInjection
|
|
};
|
|
|
|
module.exports = ReactNativeComponent;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 69 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule validateDOMNesting
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var assign = __webpack_require__(38);
|
|
var emptyFunction = __webpack_require__(14);
|
|
var warning = __webpack_require__(24);
|
|
|
|
var validateDOMNesting = emptyFunction;
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
// This validation code was written based on the HTML5 parsing spec:
|
|
// https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
|
|
//
|
|
// Note: this does not catch all invalid nesting, nor does it try to (as it's
|
|
// not clear what practical benefit doing so provides); instead, we warn only
|
|
// for cases where the parser will give a parse tree differing from what React
|
|
// intended. For example, <b><div></div></b> is invalid but we don't warn
|
|
// because it still parses correctly; we do warn for other cases like nested
|
|
// <p> tags where the beginning of the second element implicitly closes the
|
|
// first, causing a confusing mess.
|
|
|
|
// https://html.spec.whatwg.org/multipage/syntax.html#special
|
|
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'];
|
|
|
|
// https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
|
|
var inScopeTags = ['applet', 'caption', 'html', 'table', 'td', 'th', 'marquee', 'object', 'template',
|
|
|
|
// https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point
|
|
// TODO: Distinguish by namespace here -- for <title>, including it here
|
|
// errs on the side of fewer warnings
|
|
'foreignObject', 'desc', 'title'];
|
|
|
|
// https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-button-scope
|
|
var buttonScopeTags = inScopeTags.concat(['button']);
|
|
|
|
// https://html.spec.whatwg.org/multipage/syntax.html#generate-implied-end-tags
|
|
var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt'];
|
|
|
|
var emptyAncestorInfo = {
|
|
parentTag: null,
|
|
|
|
formTag: null,
|
|
aTagInScope: null,
|
|
buttonTagInScope: null,
|
|
nobrTagInScope: null,
|
|
pTagInButtonScope: null,
|
|
|
|
listItemTagAutoclosing: null,
|
|
dlItemTagAutoclosing: null
|
|
};
|
|
|
|
var updatedAncestorInfo = function (oldInfo, tag, instance) {
|
|
var ancestorInfo = assign({}, oldInfo || emptyAncestorInfo);
|
|
var info = { tag: tag, instance: instance };
|
|
|
|
if (inScopeTags.indexOf(tag) !== -1) {
|
|
ancestorInfo.aTagInScope = null;
|
|
ancestorInfo.buttonTagInScope = null;
|
|
ancestorInfo.nobrTagInScope = null;
|
|
}
|
|
if (buttonScopeTags.indexOf(tag) !== -1) {
|
|
ancestorInfo.pTagInButtonScope = null;
|
|
}
|
|
|
|
// See rules for 'li', 'dd', 'dt' start tags in
|
|
// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
|
|
if (specialTags.indexOf(tag) !== -1 && tag !== 'address' && tag !== 'div' && tag !== 'p') {
|
|
ancestorInfo.listItemTagAutoclosing = null;
|
|
ancestorInfo.dlItemTagAutoclosing = null;
|
|
}
|
|
|
|
ancestorInfo.parentTag = info;
|
|
|
|
if (tag === 'form') {
|
|
ancestorInfo.formTag = info;
|
|
}
|
|
if (tag === 'a') {
|
|
ancestorInfo.aTagInScope = info;
|
|
}
|
|
if (tag === 'button') {
|
|
ancestorInfo.buttonTagInScope = info;
|
|
}
|
|
if (tag === 'nobr') {
|
|
ancestorInfo.nobrTagInScope = info;
|
|
}
|
|
if (tag === 'p') {
|
|
ancestorInfo.pTagInButtonScope = info;
|
|
}
|
|
if (tag === 'li') {
|
|
ancestorInfo.listItemTagAutoclosing = info;
|
|
}
|
|
if (tag === 'dd' || tag === 'dt') {
|
|
ancestorInfo.dlItemTagAutoclosing = info;
|
|
}
|
|
|
|
return ancestorInfo;
|
|
};
|
|
|
|
/**
|
|
* Returns whether
|
|
*/
|
|
var isTagValidWithParent = function (tag, parentTag) {
|
|
// First, let's check if we're in an unusual parsing mode...
|
|
switch (parentTag) {
|
|
// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inselect
|
|
case 'select':
|
|
return tag === 'option' || tag === 'optgroup' || tag === '#text';
|
|
case 'optgroup':
|
|
return tag === 'option' || tag === '#text';
|
|
// Strictly speaking, seeing an <option> doesn't mean we're in a <select>
|
|
// but
|
|
case 'option':
|
|
return tag === '#text';
|
|
|
|
// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intd
|
|
// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incaption
|
|
// No special behavior since these rules fall back to "in body" mode for
|
|
// all except special table nodes which cause bad parsing behavior anyway.
|
|
|
|
// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intr
|
|
case 'tr':
|
|
return tag === 'th' || tag === 'td' || tag === 'style' || tag === 'script' || tag === 'template';
|
|
|
|
// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intbody
|
|
case 'tbody':
|
|
case 'thead':
|
|
case 'tfoot':
|
|
return tag === 'tr' || tag === 'style' || tag === 'script' || tag === 'template';
|
|
|
|
// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incolgroup
|
|
case 'colgroup':
|
|
return tag === 'col' || tag === 'template';
|
|
|
|
// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intable
|
|
case 'table':
|
|
return tag === 'caption' || tag === 'colgroup' || tag === 'tbody' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' || tag === 'template';
|
|
|
|
// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead
|
|
case 'head':
|
|
return tag === 'base' || tag === 'basefont' || tag === 'bgsound' || tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' || tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template';
|
|
|
|
// https://html.spec.whatwg.org/multipage/semantics.html#the-html-element
|
|
case 'html':
|
|
return tag === 'head' || tag === 'body';
|
|
}
|
|
|
|
// Probably in the "in body" parsing mode, so we outlaw only tag combos
|
|
// where the parsing rules cause implicit opens or closes to be added.
|
|
// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
|
|
switch (tag) {
|
|
case 'h1':
|
|
case 'h2':
|
|
case 'h3':
|
|
case 'h4':
|
|
case 'h5':
|
|
case 'h6':
|
|
return parentTag !== 'h1' && parentTag !== 'h2' && parentTag !== 'h3' && parentTag !== 'h4' && parentTag !== 'h5' && parentTag !== 'h6';
|
|
|
|
case 'rp':
|
|
case 'rt':
|
|
return impliedEndTags.indexOf(parentTag) === -1;
|
|
|
|
case 'caption':
|
|
case 'col':
|
|
case 'colgroup':
|
|
case 'frame':
|
|
case 'head':
|
|
case 'tbody':
|
|
case 'td':
|
|
case 'tfoot':
|
|
case 'th':
|
|
case 'thead':
|
|
case 'tr':
|
|
// These tags are only valid with a few parents that have special child
|
|
// parsing rules -- if we're down here, then none of those matched and
|
|
// so we allow it only if we don't know what the parent is, as all other
|
|
// cases are invalid.
|
|
return parentTag == null;
|
|
}
|
|
|
|
return true;
|
|
};
|
|
|
|
/**
|
|
* Returns whether
|
|
*/
|
|
var findInvalidAncestorForTag = function (tag, ancestorInfo) {
|
|
switch (tag) {
|
|
case 'address':
|
|
case 'article':
|
|
case 'aside':
|
|
case 'blockquote':
|
|
case 'center':
|
|
case 'details':
|
|
case 'dialog':
|
|
case 'dir':
|
|
case 'div':
|
|
case 'dl':
|
|
case 'fieldset':
|
|
case 'figcaption':
|
|
case 'figure':
|
|
case 'footer':
|
|
case 'header':
|
|
case 'hgroup':
|
|
case 'main':
|
|
case 'menu':
|
|
case 'nav':
|
|
case 'ol':
|
|
case 'p':
|
|
case 'section':
|
|
case 'summary':
|
|
case 'ul':
|
|
|
|
case 'pre':
|
|
case 'listing':
|
|
|
|
case 'table':
|
|
|
|
case 'hr':
|
|
|
|
case 'xmp':
|
|
|
|
case 'h1':
|
|
case 'h2':
|
|
case 'h3':
|
|
case 'h4':
|
|
case 'h5':
|
|
case 'h6':
|
|
return ancestorInfo.pTagInButtonScope;
|
|
|
|
case 'form':
|
|
return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;
|
|
|
|
case 'li':
|
|
return ancestorInfo.listItemTagAutoclosing;
|
|
|
|
case 'dd':
|
|
case 'dt':
|
|
return ancestorInfo.dlItemTagAutoclosing;
|
|
|
|
case 'button':
|
|
return ancestorInfo.buttonTagInScope;
|
|
|
|
case 'a':
|
|
// Spec says something about storing a list of markers, but it sounds
|
|
// equivalent to this check.
|
|
return ancestorInfo.aTagInScope;
|
|
|
|
case 'nobr':
|
|
return ancestorInfo.nobrTagInScope;
|
|
}
|
|
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Given a ReactCompositeComponent instance, return a list of its recursive
|
|
* owners, starting at the root and ending with the instance itself.
|
|
*/
|
|
var findOwnerStack = function (instance) {
|
|
if (!instance) {
|
|
return [];
|
|
}
|
|
|
|
var stack = [];
|
|
/*eslint-disable space-after-keywords */
|
|
do {
|
|
/*eslint-enable space-after-keywords */
|
|
stack.push(instance);
|
|
} while (instance = instance._currentElement._owner);
|
|
stack.reverse();
|
|
return stack;
|
|
};
|
|
|
|
var didWarn = {};
|
|
|
|
validateDOMNesting = function (childTag, childInstance, ancestorInfo) {
|
|
ancestorInfo = ancestorInfo || emptyAncestorInfo;
|
|
var parentInfo = ancestorInfo.parentTag;
|
|
var parentTag = parentInfo && parentInfo.tag;
|
|
|
|
var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;
|
|
var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);
|
|
var problematic = invalidParent || invalidAncestor;
|
|
|
|
if (problematic) {
|
|
var ancestorTag = problematic.tag;
|
|
var ancestorInstance = problematic.instance;
|
|
|
|
var childOwner = childInstance && childInstance._currentElement._owner;
|
|
var ancestorOwner = ancestorInstance && ancestorInstance._currentElement._owner;
|
|
|
|
var childOwners = findOwnerStack(childOwner);
|
|
var ancestorOwners = findOwnerStack(ancestorOwner);
|
|
|
|
var minStackLen = Math.min(childOwners.length, ancestorOwners.length);
|
|
var i;
|
|
|
|
var deepestCommon = -1;
|
|
for (i = 0; i < minStackLen; i++) {
|
|
if (childOwners[i] === ancestorOwners[i]) {
|
|
deepestCommon = i;
|
|
} else {
|
|
break;
|
|
}
|
|
}
|
|
|
|
var UNKNOWN = '(unknown)';
|
|
var childOwnerNames = childOwners.slice(deepestCommon + 1).map(function (inst) {
|
|
return inst.getName() || UNKNOWN;
|
|
});
|
|
var ancestorOwnerNames = ancestorOwners.slice(deepestCommon + 1).map(function (inst) {
|
|
return inst.getName() || UNKNOWN;
|
|
});
|
|
var ownerInfo = [].concat(
|
|
// If the parent and child instances have a common owner ancestor, start
|
|
// with that -- otherwise we just start with the parent's owners.
|
|
deepestCommon !== -1 ? childOwners[deepestCommon].getName() || UNKNOWN : [], ancestorOwnerNames, ancestorTag,
|
|
// If we're warning about an invalid (non-parent) ancestry, add '...'
|
|
invalidAncestor ? ['...'] : [], childOwnerNames, childTag).join(' > ');
|
|
|
|
var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag + '|' + ownerInfo;
|
|
if (didWarn[warnKey]) {
|
|
return;
|
|
}
|
|
didWarn[warnKey] = true;
|
|
|
|
if (invalidParent) {
|
|
var info = '';
|
|
if (ancestorTag === 'table' && childTag === 'tr') {
|
|
info += ' Add a <tbody> to your code to match the DOM tree generated by ' + 'the browser.';
|
|
}
|
|
process.env.NODE_ENV !== 'production' ? warning(false, 'validateDOMNesting(...): <%s> cannot appear as a child of <%s>. ' + 'See %s.%s', childTag, ancestorTag, ownerInfo, info) : undefined;
|
|
} else {
|
|
process.env.NODE_ENV !== 'production' ? warning(false, 'validateDOMNesting(...): <%s> cannot appear as a descendant of ' + '<%s>. See %s.', childTag, ancestorTag, ownerInfo) : undefined;
|
|
}
|
|
}
|
|
};
|
|
|
|
validateDOMNesting.ancestorInfoContextKey = '__validateDOMNesting_ancestorInfo$' + Math.random().toString(36).slice(2);
|
|
|
|
validateDOMNesting.updatedAncestorInfo = updatedAncestorInfo;
|
|
|
|
// For testing
|
|
validateDOMNesting.isTagValidInContext = function (tag, ancestorInfo) {
|
|
ancestorInfo = ancestorInfo || emptyAncestorInfo;
|
|
var parentInfo = ancestorInfo.parentTag;
|
|
var parentTag = parentInfo && parentInfo.tag;
|
|
return isTagValidWithParent(tag, parentTag) && !findInvalidAncestorForTag(tag, ancestorInfo);
|
|
};
|
|
}
|
|
|
|
module.exports = validateDOMNesting;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 70 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactDefaultInjection
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var BeforeInputEventPlugin = __webpack_require__(71);
|
|
var ChangeEventPlugin = __webpack_require__(79);
|
|
var ClientReactRootIndex = __webpack_require__(82);
|
|
var DefaultEventPluginOrder = __webpack_require__(83);
|
|
var EnterLeaveEventPlugin = __webpack_require__(84);
|
|
var ExecutionEnvironment = __webpack_require__(8);
|
|
var HTMLDOMPropertyConfig = __webpack_require__(88);
|
|
var ReactBrowserComponentMixin = __webpack_require__(89);
|
|
var ReactComponentBrowserEnvironment = __webpack_require__(25);
|
|
var ReactDefaultBatchingStrategy = __webpack_require__(91);
|
|
var ReactDOMComponent = __webpack_require__(92);
|
|
var ReactDOMTextComponent = __webpack_require__(5);
|
|
var ReactEventListener = __webpack_require__(117);
|
|
var ReactInjection = __webpack_require__(120);
|
|
var ReactInstanceHandles = __webpack_require__(44);
|
|
var ReactMount = __webpack_require__(27);
|
|
var ReactReconcileTransaction = __webpack_require__(124);
|
|
var SelectEventPlugin = __webpack_require__(129);
|
|
var ServerReactRootIndex = __webpack_require__(130);
|
|
var SimpleEventPlugin = __webpack_require__(131);
|
|
var SVGDOMPropertyConfig = __webpack_require__(140);
|
|
|
|
var alreadyInjected = false;
|
|
|
|
function inject() {
|
|
if (alreadyInjected) {
|
|
// TODO: This is currently true because these injections are shared between
|
|
// the client and the server package. They should be built independently
|
|
// and not share any injection state. Then this problem will be solved.
|
|
return;
|
|
}
|
|
alreadyInjected = true;
|
|
|
|
ReactInjection.EventEmitter.injectReactEventListener(ReactEventListener);
|
|
|
|
/**
|
|
* Inject modules for resolving DOM hierarchy and plugin ordering.
|
|
*/
|
|
ReactInjection.EventPluginHub.injectEventPluginOrder(DefaultEventPluginOrder);
|
|
ReactInjection.EventPluginHub.injectInstanceHandle(ReactInstanceHandles);
|
|
ReactInjection.EventPluginHub.injectMount(ReactMount);
|
|
|
|
/**
|
|
* Some important event plugins included by default (without having to require
|
|
* them).
|
|
*/
|
|
ReactInjection.EventPluginHub.injectEventPluginsByName({
|
|
SimpleEventPlugin: SimpleEventPlugin,
|
|
EnterLeaveEventPlugin: EnterLeaveEventPlugin,
|
|
ChangeEventPlugin: ChangeEventPlugin,
|
|
SelectEventPlugin: SelectEventPlugin,
|
|
BeforeInputEventPlugin: BeforeInputEventPlugin
|
|
});
|
|
|
|
ReactInjection.NativeComponent.injectGenericComponentClass(ReactDOMComponent);
|
|
|
|
ReactInjection.NativeComponent.injectTextComponentClass(ReactDOMTextComponent);
|
|
|
|
ReactInjection.Class.injectMixin(ReactBrowserComponentMixin);
|
|
|
|
ReactInjection.DOMProperty.injectDOMPropertyConfig(HTMLDOMPropertyConfig);
|
|
ReactInjection.DOMProperty.injectDOMPropertyConfig(SVGDOMPropertyConfig);
|
|
|
|
ReactInjection.EmptyComponent.injectEmptyComponent('noscript');
|
|
|
|
ReactInjection.Updates.injectReconcileTransaction(ReactReconcileTransaction);
|
|
ReactInjection.Updates.injectBatchingStrategy(ReactDefaultBatchingStrategy);
|
|
|
|
ReactInjection.RootIndex.injectCreateReactRootIndex(ExecutionEnvironment.canUseDOM ? ClientReactRootIndex.createReactRootIndex : ServerReactRootIndex.createReactRootIndex);
|
|
|
|
ReactInjection.Component.injectEnvironment(ReactComponentBrowserEnvironment);
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
var url = ExecutionEnvironment.canUseDOM && window.location.href || '';
|
|
if (/[?&]react_perf\b/.test(url)) {
|
|
var ReactDefaultPerf = __webpack_require__(141);
|
|
ReactDefaultPerf.start();
|
|
}
|
|
}
|
|
}
|
|
|
|
module.exports = {
|
|
inject: inject
|
|
};
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 71 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015 Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule BeforeInputEventPlugin
|
|
* @typechecks static-only
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var EventConstants = __webpack_require__(29);
|
|
var EventPropagators = __webpack_require__(72);
|
|
var ExecutionEnvironment = __webpack_require__(8);
|
|
var FallbackCompositionState = __webpack_require__(73);
|
|
var SyntheticCompositionEvent = __webpack_require__(75);
|
|
var SyntheticInputEvent = __webpack_require__(77);
|
|
|
|
var keyOf = __webpack_require__(78);
|
|
|
|
var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space
|
|
var START_KEYCODE = 229;
|
|
|
|
var canUseCompositionEvent = ExecutionEnvironment.canUseDOM && 'CompositionEvent' in window;
|
|
|
|
var documentMode = null;
|
|
if (ExecutionEnvironment.canUseDOM && 'documentMode' in document) {
|
|
documentMode = document.documentMode;
|
|
}
|
|
|
|
// Webkit offers a very useful `textInput` event that can be used to
|
|
// directly represent `beforeInput`. The IE `textinput` event is not as
|
|
// useful, so we don't use it.
|
|
var canUseTextInputEvent = ExecutionEnvironment.canUseDOM && 'TextEvent' in window && !documentMode && !isPresto();
|
|
|
|
// In IE9+, we have access to composition events, but the data supplied
|
|
// by the native compositionend event may be incorrect. Japanese ideographic
|
|
// spaces, for instance (\u3000) are not recorded correctly.
|
|
var useFallbackCompositionData = ExecutionEnvironment.canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);
|
|
|
|
/**
|
|
* Opera <= 12 includes TextEvent in window, but does not fire
|
|
* text input events. Rely on keypress instead.
|
|
*/
|
|
function isPresto() {
|
|
var opera = window.opera;
|
|
return typeof opera === 'object' && typeof opera.version === 'function' && parseInt(opera.version(), 10) <= 12;
|
|
}
|
|
|
|
var SPACEBAR_CODE = 32;
|
|
var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);
|
|
|
|
var topLevelTypes = EventConstants.topLevelTypes;
|
|
|
|
// Events and their corresponding property names.
|
|
var eventTypes = {
|
|
beforeInput: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onBeforeInput: null }),
|
|
captured: keyOf({ onBeforeInputCapture: null })
|
|
},
|
|
dependencies: [topLevelTypes.topCompositionEnd, topLevelTypes.topKeyPress, topLevelTypes.topTextInput, topLevelTypes.topPaste]
|
|
},
|
|
compositionEnd: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onCompositionEnd: null }),
|
|
captured: keyOf({ onCompositionEndCapture: null })
|
|
},
|
|
dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionEnd, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown]
|
|
},
|
|
compositionStart: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onCompositionStart: null }),
|
|
captured: keyOf({ onCompositionStartCapture: null })
|
|
},
|
|
dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionStart, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown]
|
|
},
|
|
compositionUpdate: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onCompositionUpdate: null }),
|
|
captured: keyOf({ onCompositionUpdateCapture: null })
|
|
},
|
|
dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionUpdate, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown]
|
|
}
|
|
};
|
|
|
|
// Track whether we've ever handled a keypress on the space key.
|
|
var hasSpaceKeypress = false;
|
|
|
|
/**
|
|
* Return whether a native keypress event is assumed to be a command.
|
|
* This is required because Firefox fires `keypress` events for key commands
|
|
* (cut, copy, select-all, etc.) even though no character is inserted.
|
|
*/
|
|
function isKeypressCommand(nativeEvent) {
|
|
return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&
|
|
// ctrlKey && altKey is equivalent to AltGr, and is not a command.
|
|
!(nativeEvent.ctrlKey && nativeEvent.altKey);
|
|
}
|
|
|
|
/**
|
|
* Translate native top level events into event types.
|
|
*
|
|
* @param {string} topLevelType
|
|
* @return {object}
|
|
*/
|
|
function getCompositionEventType(topLevelType) {
|
|
switch (topLevelType) {
|
|
case topLevelTypes.topCompositionStart:
|
|
return eventTypes.compositionStart;
|
|
case topLevelTypes.topCompositionEnd:
|
|
return eventTypes.compositionEnd;
|
|
case topLevelTypes.topCompositionUpdate:
|
|
return eventTypes.compositionUpdate;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Does our fallback best-guess model think this event signifies that
|
|
* composition has begun?
|
|
*
|
|
* @param {string} topLevelType
|
|
* @param {object} nativeEvent
|
|
* @return {boolean}
|
|
*/
|
|
function isFallbackCompositionStart(topLevelType, nativeEvent) {
|
|
return topLevelType === topLevelTypes.topKeyDown && nativeEvent.keyCode === START_KEYCODE;
|
|
}
|
|
|
|
/**
|
|
* Does our fallback mode think that this event is the end of composition?
|
|
*
|
|
* @param {string} topLevelType
|
|
* @param {object} nativeEvent
|
|
* @return {boolean}
|
|
*/
|
|
function isFallbackCompositionEnd(topLevelType, nativeEvent) {
|
|
switch (topLevelType) {
|
|
case topLevelTypes.topKeyUp:
|
|
// Command keys insert or clear IME input.
|
|
return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
|
|
case topLevelTypes.topKeyDown:
|
|
// Expect IME keyCode on each keydown. If we get any other
|
|
// code we must have exited earlier.
|
|
return nativeEvent.keyCode !== START_KEYCODE;
|
|
case topLevelTypes.topKeyPress:
|
|
case topLevelTypes.topMouseDown:
|
|
case topLevelTypes.topBlur:
|
|
// Events are not possible without cancelling IME.
|
|
return true;
|
|
default:
|
|
return false;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Google Input Tools provides composition data via a CustomEvent,
|
|
* with the `data` property populated in the `detail` object. If this
|
|
* is available on the event object, use it. If not, this is a plain
|
|
* composition event and we have nothing special to extract.
|
|
*
|
|
* @param {object} nativeEvent
|
|
* @return {?string}
|
|
*/
|
|
function getDataFromCustomEvent(nativeEvent) {
|
|
var detail = nativeEvent.detail;
|
|
if (typeof detail === 'object' && 'data' in detail) {
|
|
return detail.data;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
// Track the current IME composition fallback object, if any.
|
|
var currentComposition = null;
|
|
|
|
/**
|
|
* @param {string} topLevelType Record from `EventConstants`.
|
|
* @param {DOMEventTarget} topLevelTarget The listening component root node.
|
|
* @param {string} topLevelTargetID ID of `topLevelTarget`.
|
|
* @param {object} nativeEvent Native browser event.
|
|
* @return {?object} A SyntheticCompositionEvent.
|
|
*/
|
|
function extractCompositionEvent(topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
|
|
var eventType;
|
|
var fallbackData;
|
|
|
|
if (canUseCompositionEvent) {
|
|
eventType = getCompositionEventType(topLevelType);
|
|
} else if (!currentComposition) {
|
|
if (isFallbackCompositionStart(topLevelType, nativeEvent)) {
|
|
eventType = eventTypes.compositionStart;
|
|
}
|
|
} else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) {
|
|
eventType = eventTypes.compositionEnd;
|
|
}
|
|
|
|
if (!eventType) {
|
|
return null;
|
|
}
|
|
|
|
if (useFallbackCompositionData) {
|
|
// The current composition is stored statically and must not be
|
|
// overwritten while composition continues.
|
|
if (!currentComposition && eventType === eventTypes.compositionStart) {
|
|
currentComposition = FallbackCompositionState.getPooled(topLevelTarget);
|
|
} else if (eventType === eventTypes.compositionEnd) {
|
|
if (currentComposition) {
|
|
fallbackData = currentComposition.getData();
|
|
}
|
|
}
|
|
}
|
|
|
|
var event = SyntheticCompositionEvent.getPooled(eventType, topLevelTargetID, nativeEvent, nativeEventTarget);
|
|
|
|
if (fallbackData) {
|
|
// Inject data generated from fallback path into the synthetic event.
|
|
// This matches the property of native CompositionEventInterface.
|
|
event.data = fallbackData;
|
|
} else {
|
|
var customData = getDataFromCustomEvent(nativeEvent);
|
|
if (customData !== null) {
|
|
event.data = customData;
|
|
}
|
|
}
|
|
|
|
EventPropagators.accumulateTwoPhaseDispatches(event);
|
|
return event;
|
|
}
|
|
|
|
/**
|
|
* @param {string} topLevelType Record from `EventConstants`.
|
|
* @param {object} nativeEvent Native browser event.
|
|
* @return {?string} The string corresponding to this `beforeInput` event.
|
|
*/
|
|
function getNativeBeforeInputChars(topLevelType, nativeEvent) {
|
|
switch (topLevelType) {
|
|
case topLevelTypes.topCompositionEnd:
|
|
return getDataFromCustomEvent(nativeEvent);
|
|
case topLevelTypes.topKeyPress:
|
|
/**
|
|
* If native `textInput` events are available, our goal is to make
|
|
* use of them. However, there is a special case: the spacebar key.
|
|
* In Webkit, preventing default on a spacebar `textInput` event
|
|
* cancels character insertion, but it *also* causes the browser
|
|
* to fall back to its default spacebar behavior of scrolling the
|
|
* page.
|
|
*
|
|
* Tracking at:
|
|
* https://code.google.com/p/chromium/issues/detail?id=355103
|
|
*
|
|
* To avoid this issue, use the keypress event as if no `textInput`
|
|
* event is available.
|
|
*/
|
|
var which = nativeEvent.which;
|
|
if (which !== SPACEBAR_CODE) {
|
|
return null;
|
|
}
|
|
|
|
hasSpaceKeypress = true;
|
|
return SPACEBAR_CHAR;
|
|
|
|
case topLevelTypes.topTextInput:
|
|
// Record the characters to be added to the DOM.
|
|
var chars = nativeEvent.data;
|
|
|
|
// If it's a spacebar character, assume that we have already handled
|
|
// it at the keypress level and bail immediately. Android Chrome
|
|
// doesn't give us keycodes, so we need to blacklist it.
|
|
if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {
|
|
return null;
|
|
}
|
|
|
|
return chars;
|
|
|
|
default:
|
|
// For other native event types, do nothing.
|
|
return null;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* For browsers that do not provide the `textInput` event, extract the
|
|
* appropriate string to use for SyntheticInputEvent.
|
|
*
|
|
* @param {string} topLevelType Record from `EventConstants`.
|
|
* @param {object} nativeEvent Native browser event.
|
|
* @return {?string} The fallback string for this `beforeInput` event.
|
|
*/
|
|
function getFallbackBeforeInputChars(topLevelType, nativeEvent) {
|
|
// If we are currently composing (IME) and using a fallback to do so,
|
|
// try to extract the composed characters from the fallback object.
|
|
if (currentComposition) {
|
|
if (topLevelType === topLevelTypes.topCompositionEnd || isFallbackCompositionEnd(topLevelType, nativeEvent)) {
|
|
var chars = currentComposition.getData();
|
|
FallbackCompositionState.release(currentComposition);
|
|
currentComposition = null;
|
|
return chars;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
switch (topLevelType) {
|
|
case topLevelTypes.topPaste:
|
|
// If a paste event occurs after a keypress, throw out the input
|
|
// chars. Paste events should not lead to BeforeInput events.
|
|
return null;
|
|
case topLevelTypes.topKeyPress:
|
|
/**
|
|
* As of v27, Firefox may fire keypress events even when no character
|
|
* will be inserted. A few possibilities:
|
|
*
|
|
* - `which` is `0`. Arrow keys, Esc key, etc.
|
|
*
|
|
* - `which` is the pressed key code, but no char is available.
|
|
* Ex: 'AltGr + d` in Polish. There is no modified character for
|
|
* this key combination and no character is inserted into the
|
|
* document, but FF fires the keypress for char code `100` anyway.
|
|
* No `input` event will occur.
|
|
*
|
|
* - `which` is the pressed key code, but a command combination is
|
|
* being used. Ex: `Cmd+C`. No character is inserted, and no
|
|
* `input` event will occur.
|
|
*/
|
|
if (nativeEvent.which && !isKeypressCommand(nativeEvent)) {
|
|
return String.fromCharCode(nativeEvent.which);
|
|
}
|
|
return null;
|
|
case topLevelTypes.topCompositionEnd:
|
|
return useFallbackCompositionData ? null : nativeEvent.data;
|
|
default:
|
|
return null;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Extract a SyntheticInputEvent for `beforeInput`, based on either native
|
|
* `textInput` or fallback behavior.
|
|
*
|
|
* @param {string} topLevelType Record from `EventConstants`.
|
|
* @param {DOMEventTarget} topLevelTarget The listening component root node.
|
|
* @param {string} topLevelTargetID ID of `topLevelTarget`.
|
|
* @param {object} nativeEvent Native browser event.
|
|
* @return {?object} A SyntheticInputEvent.
|
|
*/
|
|
function extractBeforeInputEvent(topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
|
|
var chars;
|
|
|
|
if (canUseTextInputEvent) {
|
|
chars = getNativeBeforeInputChars(topLevelType, nativeEvent);
|
|
} else {
|
|
chars = getFallbackBeforeInputChars(topLevelType, nativeEvent);
|
|
}
|
|
|
|
// If no characters are being inserted, no BeforeInput event should
|
|
// be fired.
|
|
if (!chars) {
|
|
return null;
|
|
}
|
|
|
|
var event = SyntheticInputEvent.getPooled(eventTypes.beforeInput, topLevelTargetID, nativeEvent, nativeEventTarget);
|
|
|
|
event.data = chars;
|
|
EventPropagators.accumulateTwoPhaseDispatches(event);
|
|
return event;
|
|
}
|
|
|
|
/**
|
|
* Create an `onBeforeInput` event to match
|
|
* http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents.
|
|
*
|
|
* This event plugin is based on the native `textInput` event
|
|
* available in Chrome, Safari, Opera, and IE. This event fires after
|
|
* `onKeyPress` and `onCompositionEnd`, but before `onInput`.
|
|
*
|
|
* `beforeInput` is spec'd but not implemented in any browsers, and
|
|
* the `input` event does not provide any useful information about what has
|
|
* actually been added, contrary to the spec. Thus, `textInput` is the best
|
|
* available event to identify the characters that have actually been inserted
|
|
* into the target node.
|
|
*
|
|
* This plugin is also responsible for emitting `composition` events, thus
|
|
* allowing us to share composition fallback code for both `beforeInput` and
|
|
* `composition` event types.
|
|
*/
|
|
var BeforeInputEventPlugin = {
|
|
|
|
eventTypes: eventTypes,
|
|
|
|
/**
|
|
* @param {string} topLevelType Record from `EventConstants`.
|
|
* @param {DOMEventTarget} topLevelTarget The listening component root node.
|
|
* @param {string} topLevelTargetID ID of `topLevelTarget`.
|
|
* @param {object} nativeEvent Native browser event.
|
|
* @return {*} An accumulation of synthetic events.
|
|
* @see {EventPluginHub.extractEvents}
|
|
*/
|
|
extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
|
|
return [extractCompositionEvent(topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget), extractBeforeInputEvent(topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget)];
|
|
}
|
|
};
|
|
|
|
module.exports = BeforeInputEventPlugin;
|
|
|
|
/***/ },
|
|
/* 72 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule EventPropagators
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var EventConstants = __webpack_require__(29);
|
|
var EventPluginHub = __webpack_require__(30);
|
|
|
|
var warning = __webpack_require__(24);
|
|
|
|
var accumulateInto = __webpack_require__(34);
|
|
var forEachAccumulated = __webpack_require__(35);
|
|
|
|
var PropagationPhases = EventConstants.PropagationPhases;
|
|
var getListener = EventPluginHub.getListener;
|
|
|
|
/**
|
|
* Some event types have a notion of different registration names for different
|
|
* "phases" of propagation. This finds listeners by a given phase.
|
|
*/
|
|
function listenerAtPhase(id, event, propagationPhase) {
|
|
var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];
|
|
return getListener(id, registrationName);
|
|
}
|
|
|
|
/**
|
|
* Tags a `SyntheticEvent` with dispatched listeners. Creating this function
|
|
* here, allows us to not have to bind or create functions for each event.
|
|
* Mutating the event's members allows us to not have to create a wrapping
|
|
* "dispatch" object that pairs the event with the listener.
|
|
*/
|
|
function accumulateDirectionalDispatches(domID, upwards, event) {
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
process.env.NODE_ENV !== 'production' ? warning(domID, 'Dispatching id must not be null') : undefined;
|
|
}
|
|
var phase = upwards ? PropagationPhases.bubbled : PropagationPhases.captured;
|
|
var listener = listenerAtPhase(domID, event, phase);
|
|
if (listener) {
|
|
event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
|
|
event._dispatchIDs = accumulateInto(event._dispatchIDs, domID);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Collect dispatches (must be entirely collected before dispatching - see unit
|
|
* tests). Lazily allocate the array to conserve memory. We must loop through
|
|
* each event and perform the traversal for each one. We cannot perform a
|
|
* single traversal for the entire collection of events because each event may
|
|
* have a different target.
|
|
*/
|
|
function accumulateTwoPhaseDispatchesSingle(event) {
|
|
if (event && event.dispatchConfig.phasedRegistrationNames) {
|
|
EventPluginHub.injection.getInstanceHandle().traverseTwoPhase(event.dispatchMarker, accumulateDirectionalDispatches, event);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Same as `accumulateTwoPhaseDispatchesSingle`, but skips over the targetID.
|
|
*/
|
|
function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {
|
|
if (event && event.dispatchConfig.phasedRegistrationNames) {
|
|
EventPluginHub.injection.getInstanceHandle().traverseTwoPhaseSkipTarget(event.dispatchMarker, accumulateDirectionalDispatches, event);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Accumulates without regard to direction, does not look for phased
|
|
* registration names. Same as `accumulateDirectDispatchesSingle` but without
|
|
* requiring that the `dispatchMarker` be the same as the dispatched ID.
|
|
*/
|
|
function accumulateDispatches(id, ignoredDirection, event) {
|
|
if (event && event.dispatchConfig.registrationName) {
|
|
var registrationName = event.dispatchConfig.registrationName;
|
|
var listener = getListener(id, registrationName);
|
|
if (listener) {
|
|
event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
|
|
event._dispatchIDs = accumulateInto(event._dispatchIDs, id);
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Accumulates dispatches on an `SyntheticEvent`, but only for the
|
|
* `dispatchMarker`.
|
|
* @param {SyntheticEvent} event
|
|
*/
|
|
function accumulateDirectDispatchesSingle(event) {
|
|
if (event && event.dispatchConfig.registrationName) {
|
|
accumulateDispatches(event.dispatchMarker, null, event);
|
|
}
|
|
}
|
|
|
|
function accumulateTwoPhaseDispatches(events) {
|
|
forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle);
|
|
}
|
|
|
|
function accumulateTwoPhaseDispatchesSkipTarget(events) {
|
|
forEachAccumulated(events, accumulateTwoPhaseDispatchesSingleSkipTarget);
|
|
}
|
|
|
|
function accumulateEnterLeaveDispatches(leave, enter, fromID, toID) {
|
|
EventPluginHub.injection.getInstanceHandle().traverseEnterLeave(fromID, toID, accumulateDispatches, leave, enter);
|
|
}
|
|
|
|
function accumulateDirectDispatches(events) {
|
|
forEachAccumulated(events, accumulateDirectDispatchesSingle);
|
|
}
|
|
|
|
/**
|
|
* A small set of propagation patterns, each of which will accept a small amount
|
|
* of information, and generate a set of "dispatch ready event objects" - which
|
|
* are sets of events that have already been annotated with a set of dispatched
|
|
* listener functions/ids. The API is designed this way to discourage these
|
|
* propagation strategies from actually executing the dispatches, since we
|
|
* always want to collect the entire set of dispatches before executing event a
|
|
* single one.
|
|
*
|
|
* @constructor EventPropagators
|
|
*/
|
|
var EventPropagators = {
|
|
accumulateTwoPhaseDispatches: accumulateTwoPhaseDispatches,
|
|
accumulateTwoPhaseDispatchesSkipTarget: accumulateTwoPhaseDispatchesSkipTarget,
|
|
accumulateDirectDispatches: accumulateDirectDispatches,
|
|
accumulateEnterLeaveDispatches: accumulateEnterLeaveDispatches
|
|
};
|
|
|
|
module.exports = EventPropagators;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 73 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule FallbackCompositionState
|
|
* @typechecks static-only
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var PooledClass = __webpack_require__(55);
|
|
|
|
var assign = __webpack_require__(38);
|
|
var getTextContentAccessor = __webpack_require__(74);
|
|
|
|
/**
|
|
* This helper class stores information about text content of a target node,
|
|
* allowing comparison of content before and after a given event.
|
|
*
|
|
* Identify the node where selection currently begins, then observe
|
|
* both its text content and its current position in the DOM. Since the
|
|
* browser may natively replace the target node during composition, we can
|
|
* use its position to find its replacement.
|
|
*
|
|
* @param {DOMEventTarget} root
|
|
*/
|
|
function FallbackCompositionState(root) {
|
|
this._root = root;
|
|
this._startText = this.getText();
|
|
this._fallbackText = null;
|
|
}
|
|
|
|
assign(FallbackCompositionState.prototype, {
|
|
destructor: function () {
|
|
this._root = null;
|
|
this._startText = null;
|
|
this._fallbackText = null;
|
|
},
|
|
|
|
/**
|
|
* Get current text of input.
|
|
*
|
|
* @return {string}
|
|
*/
|
|
getText: function () {
|
|
if ('value' in this._root) {
|
|
return this._root.value;
|
|
}
|
|
return this._root[getTextContentAccessor()];
|
|
},
|
|
|
|
/**
|
|
* Determine the differing substring between the initially stored
|
|
* text content and the current content.
|
|
*
|
|
* @return {string}
|
|
*/
|
|
getData: function () {
|
|
if (this._fallbackText) {
|
|
return this._fallbackText;
|
|
}
|
|
|
|
var start;
|
|
var startValue = this._startText;
|
|
var startLength = startValue.length;
|
|
var end;
|
|
var endValue = this.getText();
|
|
var endLength = endValue.length;
|
|
|
|
for (start = 0; start < startLength; start++) {
|
|
if (startValue[start] !== endValue[start]) {
|
|
break;
|
|
}
|
|
}
|
|
|
|
var minEnd = startLength - start;
|
|
for (end = 1; end <= minEnd; end++) {
|
|
if (startValue[startLength - end] !== endValue[endLength - end]) {
|
|
break;
|
|
}
|
|
}
|
|
|
|
var sliceTail = end > 1 ? 1 - end : undefined;
|
|
this._fallbackText = endValue.slice(start, sliceTail);
|
|
return this._fallbackText;
|
|
}
|
|
});
|
|
|
|
PooledClass.addPoolingTo(FallbackCompositionState);
|
|
|
|
module.exports = FallbackCompositionState;
|
|
|
|
/***/ },
|
|
/* 74 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule getTextContentAccessor
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var ExecutionEnvironment = __webpack_require__(8);
|
|
|
|
var contentKey = null;
|
|
|
|
/**
|
|
* Gets the key used to access text content on a DOM node.
|
|
*
|
|
* @return {?string} Key used to access text content.
|
|
* @internal
|
|
*/
|
|
function getTextContentAccessor() {
|
|
if (!contentKey && ExecutionEnvironment.canUseDOM) {
|
|
// Prefer textContent to innerText because many browsers support both but
|
|
// SVG <text> elements don't support innerText even when <div> does.
|
|
contentKey = 'textContent' in document.documentElement ? 'textContent' : 'innerText';
|
|
}
|
|
return contentKey;
|
|
}
|
|
|
|
module.exports = getTextContentAccessor;
|
|
|
|
/***/ },
|
|
/* 75 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule SyntheticCompositionEvent
|
|
* @typechecks static-only
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var SyntheticEvent = __webpack_require__(76);
|
|
|
|
/**
|
|
* @interface Event
|
|
* @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents
|
|
*/
|
|
var CompositionEventInterface = {
|
|
data: null
|
|
};
|
|
|
|
/**
|
|
* @param {object} dispatchConfig Configuration used to dispatch this event.
|
|
* @param {string} dispatchMarker Marker identifying the event target.
|
|
* @param {object} nativeEvent Native browser event.
|
|
* @extends {SyntheticUIEvent}
|
|
*/
|
|
function SyntheticCompositionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
|
SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
|
}
|
|
|
|
SyntheticEvent.augmentClass(SyntheticCompositionEvent, CompositionEventInterface);
|
|
|
|
module.exports = SyntheticCompositionEvent;
|
|
|
|
/***/ },
|
|
/* 76 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule SyntheticEvent
|
|
* @typechecks static-only
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var PooledClass = __webpack_require__(55);
|
|
|
|
var assign = __webpack_require__(38);
|
|
var emptyFunction = __webpack_require__(14);
|
|
var warning = __webpack_require__(24);
|
|
|
|
/**
|
|
* @interface Event
|
|
* @see http://www.w3.org/TR/DOM-Level-3-Events/
|
|
*/
|
|
var EventInterface = {
|
|
type: null,
|
|
target: null,
|
|
// currentTarget is set when dispatching; no use in copying it here
|
|
currentTarget: emptyFunction.thatReturnsNull,
|
|
eventPhase: null,
|
|
bubbles: null,
|
|
cancelable: null,
|
|
timeStamp: function (event) {
|
|
return event.timeStamp || Date.now();
|
|
},
|
|
defaultPrevented: null,
|
|
isTrusted: null
|
|
};
|
|
|
|
/**
|
|
* Synthetic events are dispatched by event plugins, typically in response to a
|
|
* top-level event delegation handler.
|
|
*
|
|
* These systems should generally use pooling to reduce the frequency of garbage
|
|
* collection. The system should check `isPersistent` to determine whether the
|
|
* event should be released into the pool after being dispatched. Users that
|
|
* need a persisted event should invoke `persist`.
|
|
*
|
|
* Synthetic events (and subclasses) implement the DOM Level 3 Events API by
|
|
* normalizing browser quirks. Subclasses do not necessarily have to implement a
|
|
* DOM interface; custom application-specific events can also subclass this.
|
|
*
|
|
* @param {object} dispatchConfig Configuration used to dispatch this event.
|
|
* @param {string} dispatchMarker Marker identifying the event target.
|
|
* @param {object} nativeEvent Native browser event.
|
|
*/
|
|
function SyntheticEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
|
this.dispatchConfig = dispatchConfig;
|
|
this.dispatchMarker = dispatchMarker;
|
|
this.nativeEvent = nativeEvent;
|
|
|
|
var Interface = this.constructor.Interface;
|
|
for (var propName in Interface) {
|
|
if (!Interface.hasOwnProperty(propName)) {
|
|
continue;
|
|
}
|
|
var normalize = Interface[propName];
|
|
if (normalize) {
|
|
this[propName] = normalize(nativeEvent);
|
|
} else {
|
|
if (propName === 'target') {
|
|
this.target = nativeEventTarget;
|
|
} else {
|
|
this[propName] = nativeEvent[propName];
|
|
}
|
|
}
|
|
}
|
|
|
|
var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;
|
|
if (defaultPrevented) {
|
|
this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
|
|
} else {
|
|
this.isDefaultPrevented = emptyFunction.thatReturnsFalse;
|
|
}
|
|
this.isPropagationStopped = emptyFunction.thatReturnsFalse;
|
|
}
|
|
|
|
assign(SyntheticEvent.prototype, {
|
|
|
|
preventDefault: function () {
|
|
this.defaultPrevented = true;
|
|
var event = this.nativeEvent;
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
process.env.NODE_ENV !== 'production' ? warning(event, 'This synthetic event is reused for performance reasons. If you\'re ' + 'seeing this, you\'re calling `preventDefault` on a ' + 'released/nullified synthetic event. This is a no-op. See ' + 'https://fb.me/react-event-pooling for more information.') : undefined;
|
|
}
|
|
if (!event) {
|
|
return;
|
|
}
|
|
|
|
if (event.preventDefault) {
|
|
event.preventDefault();
|
|
} else {
|
|
event.returnValue = false;
|
|
}
|
|
this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
|
|
},
|
|
|
|
stopPropagation: function () {
|
|
var event = this.nativeEvent;
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
process.env.NODE_ENV !== 'production' ? warning(event, 'This synthetic event is reused for performance reasons. If you\'re ' + 'seeing this, you\'re calling `stopPropagation` on a ' + 'released/nullified synthetic event. This is a no-op. See ' + 'https://fb.me/react-event-pooling for more information.') : undefined;
|
|
}
|
|
if (!event) {
|
|
return;
|
|
}
|
|
|
|
if (event.stopPropagation) {
|
|
event.stopPropagation();
|
|
} else {
|
|
event.cancelBubble = true;
|
|
}
|
|
this.isPropagationStopped = emptyFunction.thatReturnsTrue;
|
|
},
|
|
|
|
/**
|
|
* We release all dispatched `SyntheticEvent`s after each event loop, adding
|
|
* them back into the pool. This allows a way to hold onto a reference that
|
|
* won't be added back into the pool.
|
|
*/
|
|
persist: function () {
|
|
this.isPersistent = emptyFunction.thatReturnsTrue;
|
|
},
|
|
|
|
/**
|
|
* Checks if this event should be released back into the pool.
|
|
*
|
|
* @return {boolean} True if this should not be released, false otherwise.
|
|
*/
|
|
isPersistent: emptyFunction.thatReturnsFalse,
|
|
|
|
/**
|
|
* `PooledClass` looks for `destructor` on each instance it releases.
|
|
*/
|
|
destructor: function () {
|
|
var Interface = this.constructor.Interface;
|
|
for (var propName in Interface) {
|
|
this[propName] = null;
|
|
}
|
|
this.dispatchConfig = null;
|
|
this.dispatchMarker = null;
|
|
this.nativeEvent = null;
|
|
}
|
|
|
|
});
|
|
|
|
SyntheticEvent.Interface = EventInterface;
|
|
|
|
/**
|
|
* Helper to reduce boilerplate when creating subclasses.
|
|
*
|
|
* @param {function} Class
|
|
* @param {?object} Interface
|
|
*/
|
|
SyntheticEvent.augmentClass = function (Class, Interface) {
|
|
var Super = this;
|
|
|
|
var prototype = Object.create(Super.prototype);
|
|
assign(prototype, Class.prototype);
|
|
Class.prototype = prototype;
|
|
Class.prototype.constructor = Class;
|
|
|
|
Class.Interface = assign({}, Super.Interface, Interface);
|
|
Class.augmentClass = Super.augmentClass;
|
|
|
|
PooledClass.addPoolingTo(Class, PooledClass.fourArgumentPooler);
|
|
};
|
|
|
|
PooledClass.addPoolingTo(SyntheticEvent, PooledClass.fourArgumentPooler);
|
|
|
|
module.exports = SyntheticEvent;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 77 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule SyntheticInputEvent
|
|
* @typechecks static-only
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var SyntheticEvent = __webpack_require__(76);
|
|
|
|
/**
|
|
* @interface Event
|
|
* @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105
|
|
* /#events-inputevents
|
|
*/
|
|
var InputEventInterface = {
|
|
data: null
|
|
};
|
|
|
|
/**
|
|
* @param {object} dispatchConfig Configuration used to dispatch this event.
|
|
* @param {string} dispatchMarker Marker identifying the event target.
|
|
* @param {object} nativeEvent Native browser event.
|
|
* @extends {SyntheticUIEvent}
|
|
*/
|
|
function SyntheticInputEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
|
SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
|
}
|
|
|
|
SyntheticEvent.augmentClass(SyntheticInputEvent, InputEventInterface);
|
|
|
|
module.exports = SyntheticInputEvent;
|
|
|
|
/***/ },
|
|
/* 78 */
|
|
/***/ function(module, exports) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule keyOf
|
|
*/
|
|
|
|
/**
|
|
* Allows extraction of a minified key. Let's the build system minify keys
|
|
* without losing the ability to dynamically use key strings as values
|
|
* themselves. Pass in an object with a single key/val pair and it will return
|
|
* you the string key of that single record. Suppose you want to grab the
|
|
* value for a key 'className' inside of an object. Key/val minification may
|
|
* have aliased that key to be 'xa12'. keyOf({className: null}) will return
|
|
* 'xa12' in that case. Resolve keys you want to use once at startup time, then
|
|
* reuse those resolutions.
|
|
*/
|
|
"use strict";
|
|
|
|
var keyOf = function (oneKeyObj) {
|
|
var key;
|
|
for (key in oneKeyObj) {
|
|
if (!oneKeyObj.hasOwnProperty(key)) {
|
|
continue;
|
|
}
|
|
return key;
|
|
}
|
|
return null;
|
|
};
|
|
|
|
module.exports = keyOf;
|
|
|
|
/***/ },
|
|
/* 79 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ChangeEventPlugin
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var EventConstants = __webpack_require__(29);
|
|
var EventPluginHub = __webpack_require__(30);
|
|
var EventPropagators = __webpack_require__(72);
|
|
var ExecutionEnvironment = __webpack_require__(8);
|
|
var ReactUpdates = __webpack_require__(53);
|
|
var SyntheticEvent = __webpack_require__(76);
|
|
|
|
var getEventTarget = __webpack_require__(80);
|
|
var isEventSupported = __webpack_require__(39);
|
|
var isTextInputElement = __webpack_require__(81);
|
|
var keyOf = __webpack_require__(78);
|
|
|
|
var topLevelTypes = EventConstants.topLevelTypes;
|
|
|
|
var eventTypes = {
|
|
change: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onChange: null }),
|
|
captured: keyOf({ onChangeCapture: null })
|
|
},
|
|
dependencies: [topLevelTypes.topBlur, topLevelTypes.topChange, topLevelTypes.topClick, topLevelTypes.topFocus, topLevelTypes.topInput, topLevelTypes.topKeyDown, topLevelTypes.topKeyUp, topLevelTypes.topSelectionChange]
|
|
}
|
|
};
|
|
|
|
/**
|
|
* For IE shims
|
|
*/
|
|
var activeElement = null;
|
|
var activeElementID = null;
|
|
var activeElementValue = null;
|
|
var activeElementValueProp = null;
|
|
|
|
/**
|
|
* SECTION: handle `change` event
|
|
*/
|
|
function shouldUseChangeEvent(elem) {
|
|
var nodeName = elem.nodeName && elem.nodeName.toLowerCase();
|
|
return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';
|
|
}
|
|
|
|
var doesChangeEventBubble = false;
|
|
if (ExecutionEnvironment.canUseDOM) {
|
|
// See `handleChange` comment below
|
|
doesChangeEventBubble = isEventSupported('change') && (!('documentMode' in document) || document.documentMode > 8);
|
|
}
|
|
|
|
function manualDispatchChangeEvent(nativeEvent) {
|
|
var event = SyntheticEvent.getPooled(eventTypes.change, activeElementID, nativeEvent, getEventTarget(nativeEvent));
|
|
EventPropagators.accumulateTwoPhaseDispatches(event);
|
|
|
|
// If change and propertychange bubbled, we'd just bind to it like all the
|
|
// other events and have it go through ReactBrowserEventEmitter. Since it
|
|
// doesn't, we manually listen for the events and so we have to enqueue and
|
|
// process the abstract event manually.
|
|
//
|
|
// Batching is necessary here in order to ensure that all event handlers run
|
|
// before the next rerender (including event handlers attached to ancestor
|
|
// elements instead of directly on the input). Without this, controlled
|
|
// components don't work properly in conjunction with event bubbling because
|
|
// the component is rerendered and the value reverted before all the event
|
|
// handlers can run. See https://github.com/facebook/react/issues/708.
|
|
ReactUpdates.batchedUpdates(runEventInBatch, event);
|
|
}
|
|
|
|
function runEventInBatch(event) {
|
|
EventPluginHub.enqueueEvents(event);
|
|
EventPluginHub.processEventQueue(false);
|
|
}
|
|
|
|
function startWatchingForChangeEventIE8(target, targetID) {
|
|
activeElement = target;
|
|
activeElementID = targetID;
|
|
activeElement.attachEvent('onchange', manualDispatchChangeEvent);
|
|
}
|
|
|
|
function stopWatchingForChangeEventIE8() {
|
|
if (!activeElement) {
|
|
return;
|
|
}
|
|
activeElement.detachEvent('onchange', manualDispatchChangeEvent);
|
|
activeElement = null;
|
|
activeElementID = null;
|
|
}
|
|
|
|
function getTargetIDForChangeEvent(topLevelType, topLevelTarget, topLevelTargetID) {
|
|
if (topLevelType === topLevelTypes.topChange) {
|
|
return topLevelTargetID;
|
|
}
|
|
}
|
|
function handleEventsForChangeEventIE8(topLevelType, topLevelTarget, topLevelTargetID) {
|
|
if (topLevelType === topLevelTypes.topFocus) {
|
|
// stopWatching() should be a noop here but we call it just in case we
|
|
// missed a blur event somehow.
|
|
stopWatchingForChangeEventIE8();
|
|
startWatchingForChangeEventIE8(topLevelTarget, topLevelTargetID);
|
|
} else if (topLevelType === topLevelTypes.topBlur) {
|
|
stopWatchingForChangeEventIE8();
|
|
}
|
|
}
|
|
|
|
/**
|
|
* SECTION: handle `input` event
|
|
*/
|
|
var isInputEventSupported = false;
|
|
if (ExecutionEnvironment.canUseDOM) {
|
|
// IE9 claims to support the input event but fails to trigger it when
|
|
// deleting text, so we ignore its input events
|
|
isInputEventSupported = isEventSupported('input') && (!('documentMode' in document) || document.documentMode > 9);
|
|
}
|
|
|
|
/**
|
|
* (For old IE.) Replacement getter/setter for the `value` property that gets
|
|
* set on the active element.
|
|
*/
|
|
var newValueProp = {
|
|
get: function () {
|
|
return activeElementValueProp.get.call(this);
|
|
},
|
|
set: function (val) {
|
|
// Cast to a string so we can do equality checks.
|
|
activeElementValue = '' + val;
|
|
activeElementValueProp.set.call(this, val);
|
|
}
|
|
};
|
|
|
|
/**
|
|
* (For old IE.) Starts tracking propertychange events on the passed-in element
|
|
* and override the value property so that we can distinguish user events from
|
|
* value changes in JS.
|
|
*/
|
|
function startWatchingForValueChange(target, targetID) {
|
|
activeElement = target;
|
|
activeElementID = targetID;
|
|
activeElementValue = target.value;
|
|
activeElementValueProp = Object.getOwnPropertyDescriptor(target.constructor.prototype, 'value');
|
|
|
|
// Not guarded in a canDefineProperty check: IE8 supports defineProperty only
|
|
// on DOM elements
|
|
Object.defineProperty(activeElement, 'value', newValueProp);
|
|
activeElement.attachEvent('onpropertychange', handlePropertyChange);
|
|
}
|
|
|
|
/**
|
|
* (For old IE.) Removes the event listeners from the currently-tracked element,
|
|
* if any exists.
|
|
*/
|
|
function stopWatchingForValueChange() {
|
|
if (!activeElement) {
|
|
return;
|
|
}
|
|
|
|
// delete restores the original property definition
|
|
delete activeElement.value;
|
|
activeElement.detachEvent('onpropertychange', handlePropertyChange);
|
|
|
|
activeElement = null;
|
|
activeElementID = null;
|
|
activeElementValue = null;
|
|
activeElementValueProp = null;
|
|
}
|
|
|
|
/**
|
|
* (For old IE.) Handles a propertychange event, sending a `change` event if
|
|
* the value of the active element has changed.
|
|
*/
|
|
function handlePropertyChange(nativeEvent) {
|
|
if (nativeEvent.propertyName !== 'value') {
|
|
return;
|
|
}
|
|
var value = nativeEvent.srcElement.value;
|
|
if (value === activeElementValue) {
|
|
return;
|
|
}
|
|
activeElementValue = value;
|
|
|
|
manualDispatchChangeEvent(nativeEvent);
|
|
}
|
|
|
|
/**
|
|
* If a `change` event should be fired, returns the target's ID.
|
|
*/
|
|
function getTargetIDForInputEvent(topLevelType, topLevelTarget, topLevelTargetID) {
|
|
if (topLevelType === topLevelTypes.topInput) {
|
|
// In modern browsers (i.e., not IE8 or IE9), the input event is exactly
|
|
// what we want so fall through here and trigger an abstract event
|
|
return topLevelTargetID;
|
|
}
|
|
}
|
|
|
|
// For IE8 and IE9.
|
|
function handleEventsForInputEventIE(topLevelType, topLevelTarget, topLevelTargetID) {
|
|
if (topLevelType === topLevelTypes.topFocus) {
|
|
// In IE8, we can capture almost all .value changes by adding a
|
|
// propertychange handler and looking for events with propertyName
|
|
// equal to 'value'
|
|
// In IE9, propertychange fires for most input events but is buggy and
|
|
// doesn't fire when text is deleted, but conveniently, selectionchange
|
|
// appears to fire in all of the remaining cases so we catch those and
|
|
// forward the event if the value has changed
|
|
// In either case, we don't want to call the event handler if the value
|
|
// is changed from JS so we redefine a setter for `.value` that updates
|
|
// our activeElementValue variable, allowing us to ignore those changes
|
|
//
|
|
// stopWatching() should be a noop here but we call it just in case we
|
|
// missed a blur event somehow.
|
|
stopWatchingForValueChange();
|
|
startWatchingForValueChange(topLevelTarget, topLevelTargetID);
|
|
} else if (topLevelType === topLevelTypes.topBlur) {
|
|
stopWatchingForValueChange();
|
|
}
|
|
}
|
|
|
|
// For IE8 and IE9.
|
|
function getTargetIDForInputEventIE(topLevelType, topLevelTarget, topLevelTargetID) {
|
|
if (topLevelType === topLevelTypes.topSelectionChange || topLevelType === topLevelTypes.topKeyUp || topLevelType === topLevelTypes.topKeyDown) {
|
|
// On the selectionchange event, the target is just document which isn't
|
|
// helpful for us so just check activeElement instead.
|
|
//
|
|
// 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire
|
|
// propertychange on the first input event after setting `value` from a
|
|
// script and fires only keydown, keypress, keyup. Catching keyup usually
|
|
// gets it and catching keydown lets us fire an event for the first
|
|
// keystroke if user does a key repeat (it'll be a little delayed: right
|
|
// before the second keystroke). Other input methods (e.g., paste) seem to
|
|
// fire selectionchange normally.
|
|
if (activeElement && activeElement.value !== activeElementValue) {
|
|
activeElementValue = activeElement.value;
|
|
return activeElementID;
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
* SECTION: handle `click` event
|
|
*/
|
|
function shouldUseClickEvent(elem) {
|
|
// Use the `click` event to detect changes to checkbox and radio inputs.
|
|
// This approach works across all browsers, whereas `change` does not fire
|
|
// until `blur` in IE8.
|
|
return elem.nodeName && elem.nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio');
|
|
}
|
|
|
|
function getTargetIDForClickEvent(topLevelType, topLevelTarget, topLevelTargetID) {
|
|
if (topLevelType === topLevelTypes.topClick) {
|
|
return topLevelTargetID;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* This plugin creates an `onChange` event that normalizes change events
|
|
* across form elements. This event fires at a time when it's possible to
|
|
* change the element's value without seeing a flicker.
|
|
*
|
|
* Supported elements are:
|
|
* - input (see `isTextInputElement`)
|
|
* - textarea
|
|
* - select
|
|
*/
|
|
var ChangeEventPlugin = {
|
|
|
|
eventTypes: eventTypes,
|
|
|
|
/**
|
|
* @param {string} topLevelType Record from `EventConstants`.
|
|
* @param {DOMEventTarget} topLevelTarget The listening component root node.
|
|
* @param {string} topLevelTargetID ID of `topLevelTarget`.
|
|
* @param {object} nativeEvent Native browser event.
|
|
* @return {*} An accumulation of synthetic events.
|
|
* @see {EventPluginHub.extractEvents}
|
|
*/
|
|
extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
|
|
|
|
var getTargetIDFunc, handleEventFunc;
|
|
if (shouldUseChangeEvent(topLevelTarget)) {
|
|
if (doesChangeEventBubble) {
|
|
getTargetIDFunc = getTargetIDForChangeEvent;
|
|
} else {
|
|
handleEventFunc = handleEventsForChangeEventIE8;
|
|
}
|
|
} else if (isTextInputElement(topLevelTarget)) {
|
|
if (isInputEventSupported) {
|
|
getTargetIDFunc = getTargetIDForInputEvent;
|
|
} else {
|
|
getTargetIDFunc = getTargetIDForInputEventIE;
|
|
handleEventFunc = handleEventsForInputEventIE;
|
|
}
|
|
} else if (shouldUseClickEvent(topLevelTarget)) {
|
|
getTargetIDFunc = getTargetIDForClickEvent;
|
|
}
|
|
|
|
if (getTargetIDFunc) {
|
|
var targetID = getTargetIDFunc(topLevelType, topLevelTarget, topLevelTargetID);
|
|
if (targetID) {
|
|
var event = SyntheticEvent.getPooled(eventTypes.change, targetID, nativeEvent, nativeEventTarget);
|
|
event.type = 'change';
|
|
EventPropagators.accumulateTwoPhaseDispatches(event);
|
|
return event;
|
|
}
|
|
}
|
|
|
|
if (handleEventFunc) {
|
|
handleEventFunc(topLevelType, topLevelTarget, topLevelTargetID);
|
|
}
|
|
}
|
|
|
|
};
|
|
|
|
module.exports = ChangeEventPlugin;
|
|
|
|
/***/ },
|
|
/* 80 */
|
|
/***/ function(module, exports) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule getEventTarget
|
|
* @typechecks static-only
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
/**
|
|
* Gets the target node from a native browser event by accounting for
|
|
* inconsistencies in browser DOM APIs.
|
|
*
|
|
* @param {object} nativeEvent Native browser event.
|
|
* @return {DOMEventTarget} Target node.
|
|
*/
|
|
function getEventTarget(nativeEvent) {
|
|
var target = nativeEvent.target || nativeEvent.srcElement || window;
|
|
// Safari may fire events on text nodes (Node.TEXT_NODE is 3).
|
|
// @see http://www.quirksmode.org/js/events_properties.html
|
|
return target.nodeType === 3 ? target.parentNode : target;
|
|
}
|
|
|
|
module.exports = getEventTarget;
|
|
|
|
/***/ },
|
|
/* 81 */
|
|
/***/ function(module, exports) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule isTextInputElement
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
/**
|
|
* @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary
|
|
*/
|
|
var supportedInputTypes = {
|
|
'color': true,
|
|
'date': true,
|
|
'datetime': true,
|
|
'datetime-local': true,
|
|
'email': true,
|
|
'month': true,
|
|
'number': true,
|
|
'password': true,
|
|
'range': true,
|
|
'search': true,
|
|
'tel': true,
|
|
'text': true,
|
|
'time': true,
|
|
'url': true,
|
|
'week': true
|
|
};
|
|
|
|
function isTextInputElement(elem) {
|
|
var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
|
|
return nodeName && (nodeName === 'input' && supportedInputTypes[elem.type] || nodeName === 'textarea');
|
|
}
|
|
|
|
module.exports = isTextInputElement;
|
|
|
|
/***/ },
|
|
/* 82 */
|
|
/***/ function(module, exports) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ClientReactRootIndex
|
|
* @typechecks
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var nextReactRootIndex = 0;
|
|
|
|
var ClientReactRootIndex = {
|
|
createReactRootIndex: function () {
|
|
return nextReactRootIndex++;
|
|
}
|
|
};
|
|
|
|
module.exports = ClientReactRootIndex;
|
|
|
|
/***/ },
|
|
/* 83 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule DefaultEventPluginOrder
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var keyOf = __webpack_require__(78);
|
|
|
|
/**
|
|
* Module that is injectable into `EventPluginHub`, that specifies a
|
|
* deterministic ordering of `EventPlugin`s. A convenient way to reason about
|
|
* plugins, without having to package every one of them. This is better than
|
|
* having plugins be ordered in the same order that they are injected because
|
|
* that ordering would be influenced by the packaging order.
|
|
* `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that
|
|
* preventing default on events is convenient in `SimpleEventPlugin` handlers.
|
|
*/
|
|
var DefaultEventPluginOrder = [keyOf({ ResponderEventPlugin: null }), keyOf({ SimpleEventPlugin: null }), keyOf({ TapEventPlugin: null }), keyOf({ EnterLeaveEventPlugin: null }), keyOf({ ChangeEventPlugin: null }), keyOf({ SelectEventPlugin: null }), keyOf({ BeforeInputEventPlugin: null })];
|
|
|
|
module.exports = DefaultEventPluginOrder;
|
|
|
|
/***/ },
|
|
/* 84 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule EnterLeaveEventPlugin
|
|
* @typechecks static-only
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var EventConstants = __webpack_require__(29);
|
|
var EventPropagators = __webpack_require__(72);
|
|
var SyntheticMouseEvent = __webpack_require__(85);
|
|
|
|
var ReactMount = __webpack_require__(27);
|
|
var keyOf = __webpack_require__(78);
|
|
|
|
var topLevelTypes = EventConstants.topLevelTypes;
|
|
var getFirstReactDOM = ReactMount.getFirstReactDOM;
|
|
|
|
var eventTypes = {
|
|
mouseEnter: {
|
|
registrationName: keyOf({ onMouseEnter: null }),
|
|
dependencies: [topLevelTypes.topMouseOut, topLevelTypes.topMouseOver]
|
|
},
|
|
mouseLeave: {
|
|
registrationName: keyOf({ onMouseLeave: null }),
|
|
dependencies: [topLevelTypes.topMouseOut, topLevelTypes.topMouseOver]
|
|
}
|
|
};
|
|
|
|
var extractedEvents = [null, null];
|
|
|
|
var EnterLeaveEventPlugin = {
|
|
|
|
eventTypes: eventTypes,
|
|
|
|
/**
|
|
* For almost every interaction we care about, there will be both a top-level
|
|
* `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that
|
|
* we do not extract duplicate events. However, moving the mouse into the
|
|
* browser from outside will not fire a `mouseout` event. In this case, we use
|
|
* the `mouseover` top-level event.
|
|
*
|
|
* @param {string} topLevelType Record from `EventConstants`.
|
|
* @param {DOMEventTarget} topLevelTarget The listening component root node.
|
|
* @param {string} topLevelTargetID ID of `topLevelTarget`.
|
|
* @param {object} nativeEvent Native browser event.
|
|
* @return {*} An accumulation of synthetic events.
|
|
* @see {EventPluginHub.extractEvents}
|
|
*/
|
|
extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
|
|
if (topLevelType === topLevelTypes.topMouseOver && (nativeEvent.relatedTarget || nativeEvent.fromElement)) {
|
|
return null;
|
|
}
|
|
if (topLevelType !== topLevelTypes.topMouseOut && topLevelType !== topLevelTypes.topMouseOver) {
|
|
// Must not be a mouse in or mouse out - ignoring.
|
|
return null;
|
|
}
|
|
|
|
var win;
|
|
if (topLevelTarget.window === topLevelTarget) {
|
|
// `topLevelTarget` is probably a window object.
|
|
win = topLevelTarget;
|
|
} else {
|
|
// TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
|
|
var doc = topLevelTarget.ownerDocument;
|
|
if (doc) {
|
|
win = doc.defaultView || doc.parentWindow;
|
|
} else {
|
|
win = window;
|
|
}
|
|
}
|
|
|
|
var from;
|
|
var to;
|
|
var fromID = '';
|
|
var toID = '';
|
|
if (topLevelType === topLevelTypes.topMouseOut) {
|
|
from = topLevelTarget;
|
|
fromID = topLevelTargetID;
|
|
to = getFirstReactDOM(nativeEvent.relatedTarget || nativeEvent.toElement);
|
|
if (to) {
|
|
toID = ReactMount.getID(to);
|
|
} else {
|
|
to = win;
|
|
}
|
|
to = to || win;
|
|
} else {
|
|
from = win;
|
|
to = topLevelTarget;
|
|
toID = topLevelTargetID;
|
|
}
|
|
|
|
if (from === to) {
|
|
// Nothing pertains to our managed components.
|
|
return null;
|
|
}
|
|
|
|
var leave = SyntheticMouseEvent.getPooled(eventTypes.mouseLeave, fromID, nativeEvent, nativeEventTarget);
|
|
leave.type = 'mouseleave';
|
|
leave.target = from;
|
|
leave.relatedTarget = to;
|
|
|
|
var enter = SyntheticMouseEvent.getPooled(eventTypes.mouseEnter, toID, nativeEvent, nativeEventTarget);
|
|
enter.type = 'mouseenter';
|
|
enter.target = to;
|
|
enter.relatedTarget = from;
|
|
|
|
EventPropagators.accumulateEnterLeaveDispatches(leave, enter, fromID, toID);
|
|
|
|
extractedEvents[0] = leave;
|
|
extractedEvents[1] = enter;
|
|
|
|
return extractedEvents;
|
|
}
|
|
|
|
};
|
|
|
|
module.exports = EnterLeaveEventPlugin;
|
|
|
|
/***/ },
|
|
/* 85 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule SyntheticMouseEvent
|
|
* @typechecks static-only
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var SyntheticUIEvent = __webpack_require__(86);
|
|
var ViewportMetrics = __webpack_require__(37);
|
|
|
|
var getEventModifierState = __webpack_require__(87);
|
|
|
|
/**
|
|
* @interface MouseEvent
|
|
* @see http://www.w3.org/TR/DOM-Level-3-Events/
|
|
*/
|
|
var MouseEventInterface = {
|
|
screenX: null,
|
|
screenY: null,
|
|
clientX: null,
|
|
clientY: null,
|
|
ctrlKey: null,
|
|
shiftKey: null,
|
|
altKey: null,
|
|
metaKey: null,
|
|
getModifierState: getEventModifierState,
|
|
button: function (event) {
|
|
// Webkit, Firefox, IE9+
|
|
// which: 1 2 3
|
|
// button: 0 1 2 (standard)
|
|
var button = event.button;
|
|
if ('which' in event) {
|
|
return button;
|
|
}
|
|
// IE<9
|
|
// which: undefined
|
|
// button: 0 0 0
|
|
// button: 1 4 2 (onmouseup)
|
|
return button === 2 ? 2 : button === 4 ? 1 : 0;
|
|
},
|
|
buttons: null,
|
|
relatedTarget: function (event) {
|
|
return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement);
|
|
},
|
|
// "Proprietary" Interface.
|
|
pageX: function (event) {
|
|
return 'pageX' in event ? event.pageX : event.clientX + ViewportMetrics.currentScrollLeft;
|
|
},
|
|
pageY: function (event) {
|
|
return 'pageY' in event ? event.pageY : event.clientY + ViewportMetrics.currentScrollTop;
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @param {object} dispatchConfig Configuration used to dispatch this event.
|
|
* @param {string} dispatchMarker Marker identifying the event target.
|
|
* @param {object} nativeEvent Native browser event.
|
|
* @extends {SyntheticUIEvent}
|
|
*/
|
|
function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
|
SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
|
}
|
|
|
|
SyntheticUIEvent.augmentClass(SyntheticMouseEvent, MouseEventInterface);
|
|
|
|
module.exports = SyntheticMouseEvent;
|
|
|
|
/***/ },
|
|
/* 86 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule SyntheticUIEvent
|
|
* @typechecks static-only
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var SyntheticEvent = __webpack_require__(76);
|
|
|
|
var getEventTarget = __webpack_require__(80);
|
|
|
|
/**
|
|
* @interface UIEvent
|
|
* @see http://www.w3.org/TR/DOM-Level-3-Events/
|
|
*/
|
|
var UIEventInterface = {
|
|
view: function (event) {
|
|
if (event.view) {
|
|
return event.view;
|
|
}
|
|
|
|
var target = getEventTarget(event);
|
|
if (target != null && target.window === target) {
|
|
// target is a window object
|
|
return target;
|
|
}
|
|
|
|
var doc = target.ownerDocument;
|
|
// TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
|
|
if (doc) {
|
|
return doc.defaultView || doc.parentWindow;
|
|
} else {
|
|
return window;
|
|
}
|
|
},
|
|
detail: function (event) {
|
|
return event.detail || 0;
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @param {object} dispatchConfig Configuration used to dispatch this event.
|
|
* @param {string} dispatchMarker Marker identifying the event target.
|
|
* @param {object} nativeEvent Native browser event.
|
|
* @extends {SyntheticEvent}
|
|
*/
|
|
function SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
|
SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
|
}
|
|
|
|
SyntheticEvent.augmentClass(SyntheticUIEvent, UIEventInterface);
|
|
|
|
module.exports = SyntheticUIEvent;
|
|
|
|
/***/ },
|
|
/* 87 */
|
|
/***/ function(module, exports) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule getEventModifierState
|
|
* @typechecks static-only
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
/**
|
|
* Translation from modifier key to the associated property in the event.
|
|
* @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers
|
|
*/
|
|
|
|
var modifierKeyToProp = {
|
|
'Alt': 'altKey',
|
|
'Control': 'ctrlKey',
|
|
'Meta': 'metaKey',
|
|
'Shift': 'shiftKey'
|
|
};
|
|
|
|
// IE8 does not implement getModifierState so we simply map it to the only
|
|
// modifier keys exposed by the event itself, does not support Lock-keys.
|
|
// Currently, all major browsers except Chrome seems to support Lock-keys.
|
|
function modifierStateGetter(keyArg) {
|
|
var syntheticEvent = this;
|
|
var nativeEvent = syntheticEvent.nativeEvent;
|
|
if (nativeEvent.getModifierState) {
|
|
return nativeEvent.getModifierState(keyArg);
|
|
}
|
|
var keyProp = modifierKeyToProp[keyArg];
|
|
return keyProp ? !!nativeEvent[keyProp] : false;
|
|
}
|
|
|
|
function getEventModifierState(nativeEvent) {
|
|
return modifierStateGetter;
|
|
}
|
|
|
|
module.exports = getEventModifierState;
|
|
|
|
/***/ },
|
|
/* 88 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule HTMLDOMPropertyConfig
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var DOMProperty = __webpack_require__(22);
|
|
var ExecutionEnvironment = __webpack_require__(8);
|
|
|
|
var MUST_USE_ATTRIBUTE = DOMProperty.injection.MUST_USE_ATTRIBUTE;
|
|
var MUST_USE_PROPERTY = DOMProperty.injection.MUST_USE_PROPERTY;
|
|
var HAS_BOOLEAN_VALUE = DOMProperty.injection.HAS_BOOLEAN_VALUE;
|
|
var HAS_SIDE_EFFECTS = DOMProperty.injection.HAS_SIDE_EFFECTS;
|
|
var HAS_NUMERIC_VALUE = DOMProperty.injection.HAS_NUMERIC_VALUE;
|
|
var HAS_POSITIVE_NUMERIC_VALUE = DOMProperty.injection.HAS_POSITIVE_NUMERIC_VALUE;
|
|
var HAS_OVERLOADED_BOOLEAN_VALUE = DOMProperty.injection.HAS_OVERLOADED_BOOLEAN_VALUE;
|
|
|
|
var hasSVG;
|
|
if (ExecutionEnvironment.canUseDOM) {
|
|
var implementation = document.implementation;
|
|
hasSVG = implementation && implementation.hasFeature && implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#BasicStructure', '1.1');
|
|
}
|
|
|
|
var HTMLDOMPropertyConfig = {
|
|
isCustomAttribute: RegExp.prototype.test.bind(/^(data|aria)-[a-z_][a-z\d_.\-]*$/),
|
|
Properties: {
|
|
/**
|
|
* Standard Properties
|
|
*/
|
|
accept: null,
|
|
acceptCharset: null,
|
|
accessKey: null,
|
|
action: null,
|
|
allowFullScreen: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
|
|
allowTransparency: MUST_USE_ATTRIBUTE,
|
|
alt: null,
|
|
async: HAS_BOOLEAN_VALUE,
|
|
autoComplete: null,
|
|
// autoFocus is polyfilled/normalized by AutoFocusUtils
|
|
// autoFocus: HAS_BOOLEAN_VALUE,
|
|
autoPlay: HAS_BOOLEAN_VALUE,
|
|
capture: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
|
|
cellPadding: null,
|
|
cellSpacing: null,
|
|
charSet: MUST_USE_ATTRIBUTE,
|
|
challenge: MUST_USE_ATTRIBUTE,
|
|
checked: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
|
|
classID: MUST_USE_ATTRIBUTE,
|
|
// To set className on SVG elements, it's necessary to use .setAttribute;
|
|
// this works on HTML elements too in all browsers except IE8. Conveniently,
|
|
// IE8 doesn't support SVG and so we can simply use the attribute in
|
|
// browsers that support SVG and the property in browsers that don't,
|
|
// regardless of whether the element is HTML or SVG.
|
|
className: hasSVG ? MUST_USE_ATTRIBUTE : MUST_USE_PROPERTY,
|
|
cols: MUST_USE_ATTRIBUTE | HAS_POSITIVE_NUMERIC_VALUE,
|
|
colSpan: null,
|
|
content: null,
|
|
contentEditable: null,
|
|
contextMenu: MUST_USE_ATTRIBUTE,
|
|
controls: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
|
|
coords: null,
|
|
crossOrigin: null,
|
|
data: null, // For `<object />` acts as `src`.
|
|
dateTime: MUST_USE_ATTRIBUTE,
|
|
'default': HAS_BOOLEAN_VALUE,
|
|
defer: HAS_BOOLEAN_VALUE,
|
|
dir: null,
|
|
disabled: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
|
|
download: HAS_OVERLOADED_BOOLEAN_VALUE,
|
|
draggable: null,
|
|
encType: null,
|
|
form: MUST_USE_ATTRIBUTE,
|
|
formAction: MUST_USE_ATTRIBUTE,
|
|
formEncType: MUST_USE_ATTRIBUTE,
|
|
formMethod: MUST_USE_ATTRIBUTE,
|
|
formNoValidate: HAS_BOOLEAN_VALUE,
|
|
formTarget: MUST_USE_ATTRIBUTE,
|
|
frameBorder: MUST_USE_ATTRIBUTE,
|
|
headers: null,
|
|
height: MUST_USE_ATTRIBUTE,
|
|
hidden: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
|
|
high: null,
|
|
href: null,
|
|
hrefLang: null,
|
|
htmlFor: null,
|
|
httpEquiv: null,
|
|
icon: null,
|
|
id: MUST_USE_PROPERTY,
|
|
inputMode: MUST_USE_ATTRIBUTE,
|
|
integrity: null,
|
|
is: MUST_USE_ATTRIBUTE,
|
|
keyParams: MUST_USE_ATTRIBUTE,
|
|
keyType: MUST_USE_ATTRIBUTE,
|
|
kind: null,
|
|
label: null,
|
|
lang: null,
|
|
list: MUST_USE_ATTRIBUTE,
|
|
loop: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
|
|
low: null,
|
|
manifest: MUST_USE_ATTRIBUTE,
|
|
marginHeight: null,
|
|
marginWidth: null,
|
|
max: null,
|
|
maxLength: MUST_USE_ATTRIBUTE,
|
|
media: MUST_USE_ATTRIBUTE,
|
|
mediaGroup: null,
|
|
method: null,
|
|
min: null,
|
|
minLength: MUST_USE_ATTRIBUTE,
|
|
multiple: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
|
|
muted: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
|
|
name: null,
|
|
nonce: MUST_USE_ATTRIBUTE,
|
|
noValidate: HAS_BOOLEAN_VALUE,
|
|
open: HAS_BOOLEAN_VALUE,
|
|
optimum: null,
|
|
pattern: null,
|
|
placeholder: null,
|
|
poster: null,
|
|
preload: null,
|
|
radioGroup: null,
|
|
readOnly: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
|
|
rel: null,
|
|
required: HAS_BOOLEAN_VALUE,
|
|
reversed: HAS_BOOLEAN_VALUE,
|
|
role: MUST_USE_ATTRIBUTE,
|
|
rows: MUST_USE_ATTRIBUTE | HAS_POSITIVE_NUMERIC_VALUE,
|
|
rowSpan: null,
|
|
sandbox: null,
|
|
scope: null,
|
|
scoped: HAS_BOOLEAN_VALUE,
|
|
scrolling: null,
|
|
seamless: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
|
|
selected: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
|
|
shape: null,
|
|
size: MUST_USE_ATTRIBUTE | HAS_POSITIVE_NUMERIC_VALUE,
|
|
sizes: MUST_USE_ATTRIBUTE,
|
|
span: HAS_POSITIVE_NUMERIC_VALUE,
|
|
spellCheck: null,
|
|
src: null,
|
|
srcDoc: MUST_USE_PROPERTY,
|
|
srcLang: null,
|
|
srcSet: MUST_USE_ATTRIBUTE,
|
|
start: HAS_NUMERIC_VALUE,
|
|
step: null,
|
|
style: null,
|
|
summary: null,
|
|
tabIndex: null,
|
|
target: null,
|
|
title: null,
|
|
type: null,
|
|
useMap: null,
|
|
value: MUST_USE_PROPERTY | HAS_SIDE_EFFECTS,
|
|
width: MUST_USE_ATTRIBUTE,
|
|
wmode: MUST_USE_ATTRIBUTE,
|
|
wrap: null,
|
|
|
|
/**
|
|
* RDFa Properties
|
|
*/
|
|
about: MUST_USE_ATTRIBUTE,
|
|
datatype: MUST_USE_ATTRIBUTE,
|
|
inlist: MUST_USE_ATTRIBUTE,
|
|
prefix: MUST_USE_ATTRIBUTE,
|
|
// property is also supported for OpenGraph in meta tags.
|
|
property: MUST_USE_ATTRIBUTE,
|
|
resource: MUST_USE_ATTRIBUTE,
|
|
'typeof': MUST_USE_ATTRIBUTE,
|
|
vocab: MUST_USE_ATTRIBUTE,
|
|
|
|
/**
|
|
* Non-standard Properties
|
|
*/
|
|
// autoCapitalize and autoCorrect are supported in Mobile Safari for
|
|
// keyboard hints.
|
|
autoCapitalize: MUST_USE_ATTRIBUTE,
|
|
autoCorrect: MUST_USE_ATTRIBUTE,
|
|
// autoSave allows WebKit/Blink to persist values of input fields on page reloads
|
|
autoSave: null,
|
|
// color is for Safari mask-icon link
|
|
color: null,
|
|
// itemProp, itemScope, itemType are for
|
|
// Microdata support. See http://schema.org/docs/gs.html
|
|
itemProp: MUST_USE_ATTRIBUTE,
|
|
itemScope: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
|
|
itemType: MUST_USE_ATTRIBUTE,
|
|
// itemID and itemRef are for Microdata support as well but
|
|
// only specified in the the WHATWG spec document. See
|
|
// https://html.spec.whatwg.org/multipage/microdata.html#microdata-dom-api
|
|
itemID: MUST_USE_ATTRIBUTE,
|
|
itemRef: MUST_USE_ATTRIBUTE,
|
|
// results show looking glass icon and recent searches on input
|
|
// search fields in WebKit/Blink
|
|
results: null,
|
|
// IE-only attribute that specifies security restrictions on an iframe
|
|
// as an alternative to the sandbox attribute on IE<10
|
|
security: MUST_USE_ATTRIBUTE,
|
|
// IE-only attribute that controls focus behavior
|
|
unselectable: MUST_USE_ATTRIBUTE
|
|
},
|
|
DOMAttributeNames: {
|
|
acceptCharset: 'accept-charset',
|
|
className: 'class',
|
|
htmlFor: 'for',
|
|
httpEquiv: 'http-equiv'
|
|
},
|
|
DOMPropertyNames: {
|
|
autoComplete: 'autocomplete',
|
|
autoFocus: 'autofocus',
|
|
autoPlay: 'autoplay',
|
|
autoSave: 'autosave',
|
|
// `encoding` is equivalent to `enctype`, IE8 lacks an `enctype` setter.
|
|
// http://www.w3.org/TR/html5/forms.html#dom-fs-encoding
|
|
encType: 'encoding',
|
|
hrefLang: 'hreflang',
|
|
radioGroup: 'radiogroup',
|
|
spellCheck: 'spellcheck',
|
|
srcDoc: 'srcdoc',
|
|
srcSet: 'srcset'
|
|
}
|
|
};
|
|
|
|
module.exports = HTMLDOMPropertyConfig;
|
|
|
|
/***/ },
|
|
/* 89 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactBrowserComponentMixin
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var ReactInstanceMap = __webpack_require__(46);
|
|
|
|
var findDOMNode = __webpack_require__(90);
|
|
var warning = __webpack_require__(24);
|
|
|
|
var didWarnKey = '_getDOMNodeDidWarn';
|
|
|
|
var ReactBrowserComponentMixin = {
|
|
/**
|
|
* Returns the DOM node rendered by this component.
|
|
*
|
|
* @return {DOMElement} The root node of this component.
|
|
* @final
|
|
* @protected
|
|
*/
|
|
getDOMNode: function () {
|
|
process.env.NODE_ENV !== 'production' ? warning(this.constructor[didWarnKey], '%s.getDOMNode(...) is deprecated. Please use ' + 'ReactDOM.findDOMNode(instance) instead.', ReactInstanceMap.get(this).getName() || this.tagName || 'Unknown') : undefined;
|
|
this.constructor[didWarnKey] = true;
|
|
return findDOMNode(this);
|
|
}
|
|
};
|
|
|
|
module.exports = ReactBrowserComponentMixin;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 90 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule findDOMNode
|
|
* @typechecks static-only
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var ReactCurrentOwner = __webpack_require__(4);
|
|
var ReactInstanceMap = __webpack_require__(46);
|
|
var ReactMount = __webpack_require__(27);
|
|
|
|
var invariant = __webpack_require__(12);
|
|
var warning = __webpack_require__(24);
|
|
|
|
/**
|
|
* Returns the DOM node rendered by this element.
|
|
*
|
|
* @param {ReactComponent|DOMElement} componentOrElement
|
|
* @return {?DOMElement} The root node of this element.
|
|
*/
|
|
function findDOMNode(componentOrElement) {
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
var owner = ReactCurrentOwner.current;
|
|
if (owner !== null) {
|
|
process.env.NODE_ENV !== 'production' ? warning(owner._warnedAboutRefsInRender, '%s is accessing getDOMNode or 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') : undefined;
|
|
owner._warnedAboutRefsInRender = true;
|
|
}
|
|
}
|
|
if (componentOrElement == null) {
|
|
return null;
|
|
}
|
|
if (componentOrElement.nodeType === 1) {
|
|
return componentOrElement;
|
|
}
|
|
if (ReactInstanceMap.has(componentOrElement)) {
|
|
return ReactMount.getNodeFromInstance(componentOrElement);
|
|
}
|
|
!(componentOrElement.render == null || typeof componentOrElement.render !== 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'findDOMNode was called on an unmounted component.') : invariant(false) : undefined;
|
|
true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Element appears to be neither ReactComponent nor DOMNode (keys: %s)', Object.keys(componentOrElement)) : invariant(false) : undefined;
|
|
}
|
|
|
|
module.exports = findDOMNode;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 91 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactDefaultBatchingStrategy
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var ReactUpdates = __webpack_require__(53);
|
|
var Transaction = __webpack_require__(56);
|
|
|
|
var assign = __webpack_require__(38);
|
|
var emptyFunction = __webpack_require__(14);
|
|
|
|
var RESET_BATCHED_UPDATES = {
|
|
initialize: emptyFunction,
|
|
close: function () {
|
|
ReactDefaultBatchingStrategy.isBatchingUpdates = false;
|
|
}
|
|
};
|
|
|
|
var FLUSH_BATCHED_UPDATES = {
|
|
initialize: emptyFunction,
|
|
close: ReactUpdates.flushBatchedUpdates.bind(ReactUpdates)
|
|
};
|
|
|
|
var TRANSACTION_WRAPPERS = [FLUSH_BATCHED_UPDATES, RESET_BATCHED_UPDATES];
|
|
|
|
function ReactDefaultBatchingStrategyTransaction() {
|
|
this.reinitializeTransaction();
|
|
}
|
|
|
|
assign(ReactDefaultBatchingStrategyTransaction.prototype, Transaction.Mixin, {
|
|
getTransactionWrappers: function () {
|
|
return TRANSACTION_WRAPPERS;
|
|
}
|
|
});
|
|
|
|
var transaction = new ReactDefaultBatchingStrategyTransaction();
|
|
|
|
var ReactDefaultBatchingStrategy = {
|
|
isBatchingUpdates: false,
|
|
|
|
/**
|
|
* Call the provided function in a context within which calls to `setState`
|
|
* and friends are batched such that components aren't updated unnecessarily.
|
|
*/
|
|
batchedUpdates: function (callback, a, b, c, d, e) {
|
|
var alreadyBatchingUpdates = ReactDefaultBatchingStrategy.isBatchingUpdates;
|
|
|
|
ReactDefaultBatchingStrategy.isBatchingUpdates = true;
|
|
|
|
// The code is written this way to avoid extra allocations
|
|
if (alreadyBatchingUpdates) {
|
|
callback(a, b, c, d, e);
|
|
} else {
|
|
transaction.perform(callback, null, a, b, c, d, e);
|
|
}
|
|
}
|
|
};
|
|
|
|
module.exports = ReactDefaultBatchingStrategy;
|
|
|
|
/***/ },
|
|
/* 92 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactDOMComponent
|
|
* @typechecks static-only
|
|
*/
|
|
|
|
/* global hasOwnProperty:true */
|
|
|
|
'use strict';
|
|
|
|
var AutoFocusUtils = __webpack_require__(93);
|
|
var CSSPropertyOperations = __webpack_require__(95);
|
|
var DOMProperty = __webpack_require__(22);
|
|
var DOMPropertyOperations = __webpack_require__(21);
|
|
var EventConstants = __webpack_require__(29);
|
|
var ReactBrowserEventEmitter = __webpack_require__(28);
|
|
var ReactComponentBrowserEnvironment = __webpack_require__(25);
|
|
var ReactDOMButton = __webpack_require__(103);
|
|
var ReactDOMInput = __webpack_require__(104);
|
|
var ReactDOMOption = __webpack_require__(108);
|
|
var ReactDOMSelect = __webpack_require__(111);
|
|
var ReactDOMTextarea = __webpack_require__(112);
|
|
var ReactMount = __webpack_require__(27);
|
|
var ReactMultiChild = __webpack_require__(113);
|
|
var ReactPerf = __webpack_require__(17);
|
|
var ReactUpdateQueue = __webpack_require__(52);
|
|
|
|
var assign = __webpack_require__(38);
|
|
var canDefineProperty = __webpack_require__(42);
|
|
var escapeTextContentForBrowser = __webpack_require__(20);
|
|
var invariant = __webpack_require__(12);
|
|
var isEventSupported = __webpack_require__(39);
|
|
var keyOf = __webpack_require__(78);
|
|
var setInnerHTML = __webpack_require__(18);
|
|
var setTextContent = __webpack_require__(19);
|
|
var shallowEqual = __webpack_require__(116);
|
|
var validateDOMNesting = __webpack_require__(69);
|
|
var warning = __webpack_require__(24);
|
|
|
|
var deleteListener = ReactBrowserEventEmitter.deleteListener;
|
|
var listenTo = ReactBrowserEventEmitter.listenTo;
|
|
var registrationNameModules = ReactBrowserEventEmitter.registrationNameModules;
|
|
|
|
// For quickly matching children type, to test if can be treated as content.
|
|
var CONTENT_TYPES = { 'string': true, 'number': true };
|
|
|
|
var CHILDREN = keyOf({ children: null });
|
|
var STYLE = keyOf({ style: null });
|
|
var HTML = keyOf({ __html: null });
|
|
|
|
var ELEMENT_NODE_TYPE = 1;
|
|
|
|
function getDeclarationErrorAddendum(internalInstance) {
|
|
if (internalInstance) {
|
|
var owner = internalInstance._currentElement._owner || null;
|
|
if (owner) {
|
|
var name = owner.getName();
|
|
if (name) {
|
|
return ' This DOM node was rendered by `' + name + '`.';
|
|
}
|
|
}
|
|
}
|
|
return '';
|
|
}
|
|
|
|
var legacyPropsDescriptor;
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
legacyPropsDescriptor = {
|
|
props: {
|
|
enumerable: false,
|
|
get: function () {
|
|
var component = this._reactInternalComponent;
|
|
process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDOMComponent: Do not access .props of a DOM node; instead, ' + 'recreate the props as `render` did originally or read the DOM ' + 'properties/attributes directly from this node (e.g., ' + 'this.refs.box.className).%s', getDeclarationErrorAddendum(component)) : undefined;
|
|
return component._currentElement.props;
|
|
}
|
|
}
|
|
};
|
|
}
|
|
|
|
function legacyGetDOMNode() {
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
var component = this._reactInternalComponent;
|
|
process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDOMComponent: Do not access .getDOMNode() of a DOM node; ' + 'instead, use the node directly.%s', getDeclarationErrorAddendum(component)) : undefined;
|
|
}
|
|
return this;
|
|
}
|
|
|
|
function legacyIsMounted() {
|
|
var component = this._reactInternalComponent;
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDOMComponent: Do not access .isMounted() of a DOM node.%s', getDeclarationErrorAddendum(component)) : undefined;
|
|
}
|
|
return !!component;
|
|
}
|
|
|
|
function legacySetStateEtc() {
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
var component = this._reactInternalComponent;
|
|
process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDOMComponent: Do not access .setState(), .replaceState(), or ' + '.forceUpdate() of a DOM node. This is a no-op.%s', getDeclarationErrorAddendum(component)) : undefined;
|
|
}
|
|
}
|
|
|
|
function legacySetProps(partialProps, callback) {
|
|
var component = this._reactInternalComponent;
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDOMComponent: Do not access .setProps() of a DOM node. ' + 'Instead, call ReactDOM.render again at the top level.%s', getDeclarationErrorAddendum(component)) : undefined;
|
|
}
|
|
if (!component) {
|
|
return;
|
|
}
|
|
ReactUpdateQueue.enqueueSetPropsInternal(component, partialProps);
|
|
if (callback) {
|
|
ReactUpdateQueue.enqueueCallbackInternal(component, callback);
|
|
}
|
|
}
|
|
|
|
function legacyReplaceProps(partialProps, callback) {
|
|
var component = this._reactInternalComponent;
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDOMComponent: Do not access .replaceProps() of a DOM node. ' + 'Instead, call ReactDOM.render again at the top level.%s', getDeclarationErrorAddendum(component)) : undefined;
|
|
}
|
|
if (!component) {
|
|
return;
|
|
}
|
|
ReactUpdateQueue.enqueueReplacePropsInternal(component, partialProps);
|
|
if (callback) {
|
|
ReactUpdateQueue.enqueueCallbackInternal(component, callback);
|
|
}
|
|
}
|
|
|
|
function friendlyStringify(obj) {
|
|
if (typeof obj === 'object') {
|
|
if (Array.isArray(obj)) {
|
|
return '[' + obj.map(friendlyStringify).join(', ') + ']';
|
|
} else {
|
|
var pairs = [];
|
|
for (var key in obj) {
|
|
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var keyEscaped = /^[a-z$_][\w$_]*$/i.test(key) ? key : JSON.stringify(key);
|
|
pairs.push(keyEscaped + ': ' + friendlyStringify(obj[key]));
|
|
}
|
|
}
|
|
return '{' + pairs.join(', ') + '}';
|
|
}
|
|
} else if (typeof obj === 'string') {
|
|
return JSON.stringify(obj);
|
|
} else if (typeof obj === 'function') {
|
|
return '[function object]';
|
|
}
|
|
// Differs from JSON.stringify in that undefined becauses undefined and that
|
|
// inf and nan don't become null
|
|
return String(obj);
|
|
}
|
|
|
|
var styleMutationWarning = {};
|
|
|
|
function checkAndWarnForMutatedStyle(style1, style2, component) {
|
|
if (style1 == null || style2 == null) {
|
|
return;
|
|
}
|
|
if (shallowEqual(style1, style2)) {
|
|
return;
|
|
}
|
|
|
|
var componentName = component._tag;
|
|
var owner = component._currentElement._owner;
|
|
var ownerName;
|
|
if (owner) {
|
|
ownerName = owner.getName();
|
|
}
|
|
|
|
var hash = ownerName + '|' + componentName;
|
|
|
|
if (styleMutationWarning.hasOwnProperty(hash)) {
|
|
return;
|
|
}
|
|
|
|
styleMutationWarning[hash] = true;
|
|
|
|
process.env.NODE_ENV !== '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)) : undefined;
|
|
}
|
|
|
|
/**
|
|
* @param {object} component
|
|
* @param {?object} props
|
|
*/
|
|
function assertValidProps(component, props) {
|
|
if (!props) {
|
|
return;
|
|
}
|
|
// Note the use of `==` which checks for null or undefined.
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
if (voidElementTags[component._tag]) {
|
|
process.env.NODE_ENV !== 'production' ? warning(props.children == null && props.dangerouslySetInnerHTML == null, '%s is a void element tag and must not have `children` or ' + 'use `props.dangerouslySetInnerHTML`.%s', component._tag, component._currentElement._owner ? ' Check the render method of ' + component._currentElement._owner.getName() + '.' : '') : undefined;
|
|
}
|
|
}
|
|
if (props.dangerouslySetInnerHTML != null) {
|
|
!(props.children == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Can only set one of `children` or `props.dangerouslySetInnerHTML`.') : invariant(false) : undefined;
|
|
!(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML) ? process.env.NODE_ENV !== '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.') : invariant(false) : undefined;
|
|
}
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
process.env.NODE_ENV !== 'production' ? warning(props.innerHTML == null, 'Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.') : undefined;
|
|
process.env.NODE_ENV !== 'production' ? warning(!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.') : undefined;
|
|
}
|
|
!(props.style == null || typeof props.style === 'object') ? process.env.NODE_ENV !== '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)) : invariant(false) : undefined;
|
|
}
|
|
|
|
function enqueuePutListener(id, registrationName, listener, transaction) {
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
// IE8 has no API for event capturing and the `onScroll` event doesn't
|
|
// bubble.
|
|
process.env.NODE_ENV !== 'production' ? warning(registrationName !== 'onScroll' || isEventSupported('scroll', true), 'This browser doesn\'t support the `onScroll` event') : undefined;
|
|
}
|
|
var container = ReactMount.findReactContainerForID(id);
|
|
if (container) {
|
|
var doc = container.nodeType === ELEMENT_NODE_TYPE ? container.ownerDocument : container;
|
|
listenTo(registrationName, doc);
|
|
}
|
|
transaction.getReactMountReady().enqueue(putListener, {
|
|
id: id,
|
|
registrationName: registrationName,
|
|
listener: listener
|
|
});
|
|
}
|
|
|
|
function putListener() {
|
|
var listenerToPut = this;
|
|
ReactBrowserEventEmitter.putListener(listenerToPut.id, listenerToPut.registrationName, listenerToPut.listener);
|
|
}
|
|
|
|
// There are so many media events, it makes sense to just
|
|
// maintain a list rather than create a `trapBubbledEvent` for each
|
|
var mediaEvents = {
|
|
topAbort: 'abort',
|
|
topCanPlay: 'canplay',
|
|
topCanPlayThrough: 'canplaythrough',
|
|
topDurationChange: 'durationchange',
|
|
topEmptied: 'emptied',
|
|
topEncrypted: 'encrypted',
|
|
topEnded: 'ended',
|
|
topError: 'error',
|
|
topLoadedData: 'loadeddata',
|
|
topLoadedMetadata: 'loadedmetadata',
|
|
topLoadStart: 'loadstart',
|
|
topPause: 'pause',
|
|
topPlay: 'play',
|
|
topPlaying: 'playing',
|
|
topProgress: 'progress',
|
|
topRateChange: 'ratechange',
|
|
topSeeked: 'seeked',
|
|
topSeeking: 'seeking',
|
|
topStalled: 'stalled',
|
|
topSuspend: 'suspend',
|
|
topTimeUpdate: 'timeupdate',
|
|
topVolumeChange: 'volumechange',
|
|
topWaiting: 'waiting'
|
|
};
|
|
|
|
function trapBubbledEventsLocal() {
|
|
var inst = this;
|
|
// If a component renders to null or if another component fatals and causes
|
|
// the state of the tree to be corrupted, `node` here can be null.
|
|
!inst._rootNodeID ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Must be mounted to trap events') : invariant(false) : undefined;
|
|
var node = ReactMount.getNode(inst._rootNodeID);
|
|
!node ? process.env.NODE_ENV !== 'production' ? invariant(false, 'trapBubbledEvent(...): Requires node to be rendered.') : invariant(false) : undefined;
|
|
|
|
switch (inst._tag) {
|
|
case 'iframe':
|
|
inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topLoad, 'load', node)];
|
|
break;
|
|
case 'video':
|
|
case 'audio':
|
|
|
|
inst._wrapperState.listeners = [];
|
|
// create listener for each media event
|
|
for (var event in mediaEvents) {
|
|
if (mediaEvents.hasOwnProperty(event)) {
|
|
inst._wrapperState.listeners.push(ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes[event], mediaEvents[event], node));
|
|
}
|
|
}
|
|
|
|
break;
|
|
case 'img':
|
|
inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topError, 'error', node), ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topLoad, 'load', node)];
|
|
break;
|
|
case 'form':
|
|
inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topReset, 'reset', node), ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topSubmit, 'submit', node)];
|
|
break;
|
|
}
|
|
}
|
|
|
|
function mountReadyInputWrapper() {
|
|
ReactDOMInput.mountReadyWrapper(this);
|
|
}
|
|
|
|
function postUpdateSelectWrapper() {
|
|
ReactDOMSelect.postUpdateWrapper(this);
|
|
}
|
|
|
|
// For HTML, certain tags should omit their close tag. We keep a whitelist for
|
|
// those special cased tags.
|
|
|
|
var omittedCloseTags = {
|
|
'area': true,
|
|
'base': true,
|
|
'br': true,
|
|
'col': true,
|
|
'embed': true,
|
|
'hr': true,
|
|
'img': true,
|
|
'input': true,
|
|
'keygen': true,
|
|
'link': true,
|
|
'meta': true,
|
|
'param': true,
|
|
'source': true,
|
|
'track': true,
|
|
'wbr': true
|
|
};
|
|
|
|
// NOTE: menuitem's close tag should be omitted, but that causes problems.
|
|
var newlineEatingTags = {
|
|
'listing': true,
|
|
'pre': true,
|
|
'textarea': true
|
|
};
|
|
|
|
// For HTML, certain tags cannot have children. This has the same purpose as
|
|
// `omittedCloseTags` except that `menuitem` should still have its closing tag.
|
|
|
|
var voidElementTags = assign({
|
|
'menuitem': true
|
|
}, omittedCloseTags);
|
|
|
|
// We accept any tag to be rendered but since this gets injected into arbitrary
|
|
// HTML, we want to make sure that it's a safe tag.
|
|
// http://www.w3.org/TR/REC-xml/#NT-Name
|
|
|
|
var VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/; // Simplified subset
|
|
var validatedTagCache = {};
|
|
var hasOwnProperty = ({}).hasOwnProperty;
|
|
|
|
function validateDangerousTag(tag) {
|
|
if (!hasOwnProperty.call(validatedTagCache, tag)) {
|
|
!VALID_TAG_REGEX.test(tag) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Invalid tag: %s', tag) : invariant(false) : undefined;
|
|
validatedTagCache[tag] = true;
|
|
}
|
|
}
|
|
|
|
function processChildContextDev(context, inst) {
|
|
// Pass down our tag name to child components for validation purposes
|
|
context = assign({}, context);
|
|
var info = context[validateDOMNesting.ancestorInfoContextKey];
|
|
context[validateDOMNesting.ancestorInfoContextKey] = validateDOMNesting.updatedAncestorInfo(info, inst._tag, inst);
|
|
return context;
|
|
}
|
|
|
|
function isCustomComponent(tagName, props) {
|
|
return tagName.indexOf('-') >= 0 || props.is != null;
|
|
}
|
|
|
|
/**
|
|
* Creates a new React class that is idempotent and capable of containing other
|
|
* React components. It accepts event listeners and DOM properties that are
|
|
* valid according to `DOMProperty`.
|
|
*
|
|
* - Event listeners: `onClick`, `onMouseDown`, etc.
|
|
* - DOM properties: `className`, `name`, `title`, etc.
|
|
*
|
|
* The `style` property functions differently from the DOM API. It accepts an
|
|
* object mapping of style properties to values.
|
|
*
|
|
* @constructor ReactDOMComponent
|
|
* @extends ReactMultiChild
|
|
*/
|
|
function ReactDOMComponent(tag) {
|
|
validateDangerousTag(tag);
|
|
this._tag = tag.toLowerCase();
|
|
this._renderedChildren = null;
|
|
this._previousStyle = null;
|
|
this._previousStyleCopy = null;
|
|
this._rootNodeID = null;
|
|
this._wrapperState = null;
|
|
this._topLevelWrapper = null;
|
|
this._nodeWithLegacyProperties = null;
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
this._unprocessedContextDev = null;
|
|
this._processedContextDev = null;
|
|
}
|
|
}
|
|
|
|
ReactDOMComponent.displayName = 'ReactDOMComponent';
|
|
|
|
ReactDOMComponent.Mixin = {
|
|
|
|
construct: function (element) {
|
|
this._currentElement = element;
|
|
},
|
|
|
|
/**
|
|
* Generates root tag markup then recurses. This method has side effects and
|
|
* is not idempotent.
|
|
*
|
|
* @internal
|
|
* @param {string} rootID The root DOM ID for this node.
|
|
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
|
|
* @param {object} context
|
|
* @return {string} The computed markup.
|
|
*/
|
|
mountComponent: function (rootID, transaction, context) {
|
|
this._rootNodeID = rootID;
|
|
|
|
var props = this._currentElement.props;
|
|
|
|
switch (this._tag) {
|
|
case 'iframe':
|
|
case 'img':
|
|
case 'form':
|
|
case 'video':
|
|
case 'audio':
|
|
this._wrapperState = {
|
|
listeners: null
|
|
};
|
|
transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
|
|
break;
|
|
case 'button':
|
|
props = ReactDOMButton.getNativeProps(this, props, context);
|
|
break;
|
|
case 'input':
|
|
ReactDOMInput.mountWrapper(this, props, context);
|
|
props = ReactDOMInput.getNativeProps(this, props, context);
|
|
break;
|
|
case 'option':
|
|
ReactDOMOption.mountWrapper(this, props, context);
|
|
props = ReactDOMOption.getNativeProps(this, props, context);
|
|
break;
|
|
case 'select':
|
|
ReactDOMSelect.mountWrapper(this, props, context);
|
|
props = ReactDOMSelect.getNativeProps(this, props, context);
|
|
context = ReactDOMSelect.processChildContext(this, props, context);
|
|
break;
|
|
case 'textarea':
|
|
ReactDOMTextarea.mountWrapper(this, props, context);
|
|
props = ReactDOMTextarea.getNativeProps(this, props, context);
|
|
break;
|
|
}
|
|
|
|
assertValidProps(this, props);
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
if (context[validateDOMNesting.ancestorInfoContextKey]) {
|
|
validateDOMNesting(this._tag, this, context[validateDOMNesting.ancestorInfoContextKey]);
|
|
}
|
|
}
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
this._unprocessedContextDev = context;
|
|
this._processedContextDev = processChildContextDev(context, this);
|
|
context = this._processedContextDev;
|
|
}
|
|
|
|
var mountImage;
|
|
if (transaction.useCreateElement) {
|
|
var ownerDocument = context[ReactMount.ownerDocumentContextKey];
|
|
var el = ownerDocument.createElement(this._currentElement.type);
|
|
DOMPropertyOperations.setAttributeForID(el, this._rootNodeID);
|
|
// Populate node cache
|
|
ReactMount.getID(el);
|
|
this._updateDOMProperties({}, props, transaction, el);
|
|
this._createInitialChildren(transaction, props, context, el);
|
|
mountImage = el;
|
|
} else {
|
|
var tagOpen = this._createOpenTagMarkupAndPutListeners(transaction, props);
|
|
var tagContent = this._createContentMarkup(transaction, props, context);
|
|
if (!tagContent && omittedCloseTags[this._tag]) {
|
|
mountImage = tagOpen + '/>';
|
|
} else {
|
|
mountImage = tagOpen + '>' + tagContent + '</' + this._currentElement.type + '>';
|
|
}
|
|
}
|
|
|
|
switch (this._tag) {
|
|
case 'input':
|
|
transaction.getReactMountReady().enqueue(mountReadyInputWrapper, this);
|
|
// falls through
|
|
case 'button':
|
|
case 'select':
|
|
case 'textarea':
|
|
if (props.autoFocus) {
|
|
transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);
|
|
}
|
|
break;
|
|
}
|
|
|
|
return mountImage;
|
|
},
|
|
|
|
/**
|
|
* Creates markup for the open tag and all attributes.
|
|
*
|
|
* This method has side effects because events get registered.
|
|
*
|
|
* Iterating over object properties is faster than iterating over arrays.
|
|
* @see http://jsperf.com/obj-vs-arr-iteration
|
|
*
|
|
* @private
|
|
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
|
|
* @param {object} props
|
|
* @return {string} Markup of opening tag.
|
|
*/
|
|
_createOpenTagMarkupAndPutListeners: function (transaction, props) {
|
|
var ret = '<' + this._currentElement.type;
|
|
|
|
for (var propKey in props) {
|
|
if (!props.hasOwnProperty(propKey)) {
|
|
continue;
|
|
}
|
|
var propValue = props[propKey];
|
|
if (propValue == null) {
|
|
continue;
|
|
}
|
|
if (registrationNameModules.hasOwnProperty(propKey)) {
|
|
if (propValue) {
|
|
enqueuePutListener(this._rootNodeID, propKey, propValue, transaction);
|
|
}
|
|
} else {
|
|
if (propKey === STYLE) {
|
|
if (propValue) {
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
// See `_updateDOMProperties`. style block
|
|
this._previousStyle = propValue;
|
|
}
|
|
propValue = this._previousStyleCopy = assign({}, props.style);
|
|
}
|
|
propValue = CSSPropertyOperations.createMarkupForStyles(propValue);
|
|
}
|
|
var markup = null;
|
|
if (this._tag != null && isCustomComponent(this._tag, props)) {
|
|
if (propKey !== CHILDREN) {
|
|
markup = DOMPropertyOperations.createMarkupForCustomAttribute(propKey, propValue);
|
|
}
|
|
} else {
|
|
markup = DOMPropertyOperations.createMarkupForProperty(propKey, propValue);
|
|
}
|
|
if (markup) {
|
|
ret += ' ' + markup;
|
|
}
|
|
}
|
|
}
|
|
|
|
// For static pages, no need to put React ID and checksum. Saves lots of
|
|
// bytes.
|
|
if (transaction.renderToStaticMarkup) {
|
|
return ret;
|
|
}
|
|
|
|
var markupForID = DOMPropertyOperations.createMarkupForID(this._rootNodeID);
|
|
return ret + ' ' + markupForID;
|
|
},
|
|
|
|
/**
|
|
* Creates markup for the content between the tags.
|
|
*
|
|
* @private
|
|
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
|
|
* @param {object} props
|
|
* @param {object} context
|
|
* @return {string} Content markup.
|
|
*/
|
|
_createContentMarkup: function (transaction, props, context) {
|
|
var ret = '';
|
|
|
|
// Intentional use of != to avoid catching zero/false.
|
|
var innerHTML = props.dangerouslySetInnerHTML;
|
|
if (innerHTML != null) {
|
|
if (innerHTML.__html != null) {
|
|
ret = innerHTML.__html;
|
|
}
|
|
} else {
|
|
var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null;
|
|
var childrenToUse = contentToUse != null ? null : props.children;
|
|
if (contentToUse != null) {
|
|
// TODO: Validate that text is allowed as a child of this node
|
|
ret = escapeTextContentForBrowser(contentToUse);
|
|
} else if (childrenToUse != null) {
|
|
var mountImages = this.mountChildren(childrenToUse, transaction, context);
|
|
ret = mountImages.join('');
|
|
}
|
|
}
|
|
if (newlineEatingTags[this._tag] && ret.charAt(0) === '\n') {
|
|
// text/html ignores the first character in these tags if it's a newline
|
|
// Prefer to break application/xml over text/html (for now) by adding
|
|
// a newline specifically to get eaten by the parser. (Alternately for
|
|
// textareas, replacing "^\n" with "\r\n" doesn't get eaten, and the first
|
|
// \r is normalized out by HTMLTextAreaElement#value.)
|
|
// See: <http://www.w3.org/TR/html-polyglot/#newlines-in-textarea-and-pre>
|
|
// See: <http://www.w3.org/TR/html5/syntax.html#element-restrictions>
|
|
// See: <http://www.w3.org/TR/html5/syntax.html#newlines>
|
|
// See: Parsing of "textarea" "listing" and "pre" elements
|
|
// from <http://www.w3.org/TR/html5/syntax.html#parsing-main-inbody>
|
|
return '\n' + ret;
|
|
} else {
|
|
return ret;
|
|
}
|
|
},
|
|
|
|
_createInitialChildren: function (transaction, props, context, el) {
|
|
// Intentional use of != to avoid catching zero/false.
|
|
var innerHTML = props.dangerouslySetInnerHTML;
|
|
if (innerHTML != null) {
|
|
if (innerHTML.__html != null) {
|
|
setInnerHTML(el, innerHTML.__html);
|
|
}
|
|
} else {
|
|
var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null;
|
|
var childrenToUse = contentToUse != null ? null : props.children;
|
|
if (contentToUse != null) {
|
|
// TODO: Validate that text is allowed as a child of this node
|
|
setTextContent(el, contentToUse);
|
|
} else if (childrenToUse != null) {
|
|
var mountImages = this.mountChildren(childrenToUse, transaction, context);
|
|
for (var i = 0; i < mountImages.length; i++) {
|
|
el.appendChild(mountImages[i]);
|
|
}
|
|
}
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Receives a next element and updates the component.
|
|
*
|
|
* @internal
|
|
* @param {ReactElement} nextElement
|
|
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
|
|
* @param {object} context
|
|
*/
|
|
receiveComponent: function (nextElement, transaction, context) {
|
|
var prevElement = this._currentElement;
|
|
this._currentElement = nextElement;
|
|
this.updateComponent(transaction, prevElement, nextElement, context);
|
|
},
|
|
|
|
/**
|
|
* Updates a native DOM component after it has already been allocated and
|
|
* attached to the DOM. Reconciles the root DOM node, then recurses.
|
|
*
|
|
* @param {ReactReconcileTransaction} transaction
|
|
* @param {ReactElement} prevElement
|
|
* @param {ReactElement} nextElement
|
|
* @internal
|
|
* @overridable
|
|
*/
|
|
updateComponent: function (transaction, prevElement, nextElement, context) {
|
|
var lastProps = prevElement.props;
|
|
var nextProps = this._currentElement.props;
|
|
|
|
switch (this._tag) {
|
|
case 'button':
|
|
lastProps = ReactDOMButton.getNativeProps(this, lastProps);
|
|
nextProps = ReactDOMButton.getNativeProps(this, nextProps);
|
|
break;
|
|
case 'input':
|
|
ReactDOMInput.updateWrapper(this);
|
|
lastProps = ReactDOMInput.getNativeProps(this, lastProps);
|
|
nextProps = ReactDOMInput.getNativeProps(this, nextProps);
|
|
break;
|
|
case 'option':
|
|
lastProps = ReactDOMOption.getNativeProps(this, lastProps);
|
|
nextProps = ReactDOMOption.getNativeProps(this, nextProps);
|
|
break;
|
|
case 'select':
|
|
lastProps = ReactDOMSelect.getNativeProps(this, lastProps);
|
|
nextProps = ReactDOMSelect.getNativeProps(this, nextProps);
|
|
break;
|
|
case 'textarea':
|
|
ReactDOMTextarea.updateWrapper(this);
|
|
lastProps = ReactDOMTextarea.getNativeProps(this, lastProps);
|
|
nextProps = ReactDOMTextarea.getNativeProps(this, nextProps);
|
|
break;
|
|
}
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
// If the context is reference-equal to the old one, pass down the same
|
|
// processed object so the update bailout in ReactReconciler behaves
|
|
// correctly (and identically in dev and prod). See #5005.
|
|
if (this._unprocessedContextDev !== context) {
|
|
this._unprocessedContextDev = context;
|
|
this._processedContextDev = processChildContextDev(context, this);
|
|
}
|
|
context = this._processedContextDev;
|
|
}
|
|
|
|
assertValidProps(this, nextProps);
|
|
this._updateDOMProperties(lastProps, nextProps, transaction, null);
|
|
this._updateDOMChildren(lastProps, nextProps, transaction, context);
|
|
|
|
if (!canDefineProperty && this._nodeWithLegacyProperties) {
|
|
this._nodeWithLegacyProperties.props = nextProps;
|
|
}
|
|
|
|
if (this._tag === 'select') {
|
|
// <select> value update needs to occur after <option> children
|
|
// reconciliation
|
|
transaction.getReactMountReady().enqueue(postUpdateSelectWrapper, this);
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Reconciles the properties by detecting differences in property values and
|
|
* updating the DOM as necessary. This function is probably the single most
|
|
* critical path for performance optimization.
|
|
*
|
|
* TODO: Benchmark whether checking for changed values in memory actually
|
|
* improves performance (especially statically positioned elements).
|
|
* TODO: Benchmark the effects of putting this at the top since 99% of props
|
|
* do not change for a given reconciliation.
|
|
* TODO: Benchmark areas that can be improved with caching.
|
|
*
|
|
* @private
|
|
* @param {object} lastProps
|
|
* @param {object} nextProps
|
|
* @param {ReactReconcileTransaction} transaction
|
|
* @param {?DOMElement} node
|
|
*/
|
|
_updateDOMProperties: function (lastProps, nextProps, transaction, node) {
|
|
var propKey;
|
|
var styleName;
|
|
var styleUpdates;
|
|
for (propKey in lastProps) {
|
|
if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey)) {
|
|
continue;
|
|
}
|
|
if (propKey === STYLE) {
|
|
var lastStyle = this._previousStyleCopy;
|
|
for (styleName in lastStyle) {
|
|
if (lastStyle.hasOwnProperty(styleName)) {
|
|
styleUpdates = styleUpdates || {};
|
|
styleUpdates[styleName] = '';
|
|
}
|
|
}
|
|
this._previousStyleCopy = null;
|
|
} else if (registrationNameModules.hasOwnProperty(propKey)) {
|
|
if (lastProps[propKey]) {
|
|
// Only call deleteListener if there was a listener previously or
|
|
// else willDeleteListener gets called when there wasn't actually a
|
|
// listener (e.g., onClick={null})
|
|
deleteListener(this._rootNodeID, propKey);
|
|
}
|
|
} else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) {
|
|
if (!node) {
|
|
node = ReactMount.getNode(this._rootNodeID);
|
|
}
|
|
DOMPropertyOperations.deleteValueForProperty(node, propKey);
|
|
}
|
|
}
|
|
for (propKey in nextProps) {
|
|
var nextProp = nextProps[propKey];
|
|
var lastProp = propKey === STYLE ? this._previousStyleCopy : lastProps[propKey];
|
|
if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp) {
|
|
continue;
|
|
}
|
|
if (propKey === STYLE) {
|
|
if (nextProp) {
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
checkAndWarnForMutatedStyle(this._previousStyleCopy, this._previousStyle, this);
|
|
this._previousStyle = nextProp;
|
|
}
|
|
nextProp = this._previousStyleCopy = assign({}, nextProp);
|
|
} else {
|
|
this._previousStyleCopy = null;
|
|
}
|
|
if (lastProp) {
|
|
// Unset styles on `lastProp` but not on `nextProp`.
|
|
for (styleName in lastProp) {
|
|
if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) {
|
|
styleUpdates = styleUpdates || {};
|
|
styleUpdates[styleName] = '';
|
|
}
|
|
}
|
|
// Update styles that changed since `lastProp`.
|
|
for (styleName in nextProp) {
|
|
if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {
|
|
styleUpdates = styleUpdates || {};
|
|
styleUpdates[styleName] = nextProp[styleName];
|
|
}
|
|
}
|
|
} else {
|
|
// Relies on `updateStylesByID` not mutating `styleUpdates`.
|
|
styleUpdates = nextProp;
|
|
}
|
|
} else if (registrationNameModules.hasOwnProperty(propKey)) {
|
|
if (nextProp) {
|
|
enqueuePutListener(this._rootNodeID, propKey, nextProp, transaction);
|
|
} else if (lastProp) {
|
|
deleteListener(this._rootNodeID, propKey);
|
|
}
|
|
} else if (isCustomComponent(this._tag, nextProps)) {
|
|
if (!node) {
|
|
node = ReactMount.getNode(this._rootNodeID);
|
|
}
|
|
if (propKey === CHILDREN) {
|
|
nextProp = null;
|
|
}
|
|
DOMPropertyOperations.setValueForAttribute(node, propKey, nextProp);
|
|
} else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) {
|
|
if (!node) {
|
|
node = ReactMount.getNode(this._rootNodeID);
|
|
}
|
|
// If we're updating to null or undefined, we should remove the property
|
|
// from the DOM node instead of inadvertantly setting to a string. This
|
|
// brings us in line with the same behavior we have on initial render.
|
|
if (nextProp != null) {
|
|
DOMPropertyOperations.setValueForProperty(node, propKey, nextProp);
|
|
} else {
|
|
DOMPropertyOperations.deleteValueForProperty(node, propKey);
|
|
}
|
|
}
|
|
}
|
|
if (styleUpdates) {
|
|
if (!node) {
|
|
node = ReactMount.getNode(this._rootNodeID);
|
|
}
|
|
CSSPropertyOperations.setValueForStyles(node, styleUpdates);
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Reconciles the children with the various properties that affect the
|
|
* children content.
|
|
*
|
|
* @param {object} lastProps
|
|
* @param {object} nextProps
|
|
* @param {ReactReconcileTransaction} transaction
|
|
* @param {object} context
|
|
*/
|
|
_updateDOMChildren: function (lastProps, nextProps, transaction, context) {
|
|
var lastContent = CONTENT_TYPES[typeof lastProps.children] ? lastProps.children : null;
|
|
var nextContent = CONTENT_TYPES[typeof nextProps.children] ? nextProps.children : null;
|
|
|
|
var lastHtml = lastProps.dangerouslySetInnerHTML && lastProps.dangerouslySetInnerHTML.__html;
|
|
var nextHtml = nextProps.dangerouslySetInnerHTML && nextProps.dangerouslySetInnerHTML.__html;
|
|
|
|
// Note the use of `!=` which checks for null or undefined.
|
|
var lastChildren = lastContent != null ? null : lastProps.children;
|
|
var nextChildren = nextContent != null ? null : nextProps.children;
|
|
|
|
// If we're switching from children to content/html or vice versa, remove
|
|
// the old content
|
|
var lastHasContentOrHtml = lastContent != null || lastHtml != null;
|
|
var nextHasContentOrHtml = nextContent != null || nextHtml != null;
|
|
if (lastChildren != null && nextChildren == null) {
|
|
this.updateChildren(null, transaction, context);
|
|
} else if (lastHasContentOrHtml && !nextHasContentOrHtml) {
|
|
this.updateTextContent('');
|
|
}
|
|
|
|
if (nextContent != null) {
|
|
if (lastContent !== nextContent) {
|
|
this.updateTextContent('' + nextContent);
|
|
}
|
|
} else if (nextHtml != null) {
|
|
if (lastHtml !== nextHtml) {
|
|
this.updateMarkup('' + nextHtml);
|
|
}
|
|
} else if (nextChildren != null) {
|
|
this.updateChildren(nextChildren, transaction, context);
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Destroys all event registrations for this instance. Does not remove from
|
|
* the DOM. That must be done by the parent.
|
|
*
|
|
* @internal
|
|
*/
|
|
unmountComponent: function () {
|
|
switch (this._tag) {
|
|
case 'iframe':
|
|
case 'img':
|
|
case 'form':
|
|
case 'video':
|
|
case 'audio':
|
|
var listeners = this._wrapperState.listeners;
|
|
if (listeners) {
|
|
for (var i = 0; i < listeners.length; i++) {
|
|
listeners[i].remove();
|
|
}
|
|
}
|
|
break;
|
|
case 'input':
|
|
ReactDOMInput.unmountWrapper(this);
|
|
break;
|
|
case 'html':
|
|
case 'head':
|
|
case 'body':
|
|
/**
|
|
* Components like <html> <head> and <body> can't be removed or added
|
|
* easily in a cross-browser way, however it's valuable to be able to
|
|
* take advantage of React's reconciliation for styling and <title>
|
|
* management. So we just document it and throw in dangerous cases.
|
|
*/
|
|
true ? process.env.NODE_ENV !== '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) : invariant(false) : undefined;
|
|
break;
|
|
}
|
|
|
|
this.unmountChildren();
|
|
ReactBrowserEventEmitter.deleteAllListeners(this._rootNodeID);
|
|
ReactComponentBrowserEnvironment.unmountIDFromEnvironment(this._rootNodeID);
|
|
this._rootNodeID = null;
|
|
this._wrapperState = null;
|
|
if (this._nodeWithLegacyProperties) {
|
|
var node = this._nodeWithLegacyProperties;
|
|
node._reactInternalComponent = null;
|
|
this._nodeWithLegacyProperties = null;
|
|
}
|
|
},
|
|
|
|
getPublicInstance: function () {
|
|
if (!this._nodeWithLegacyProperties) {
|
|
var node = ReactMount.getNode(this._rootNodeID);
|
|
|
|
node._reactInternalComponent = this;
|
|
node.getDOMNode = legacyGetDOMNode;
|
|
node.isMounted = legacyIsMounted;
|
|
node.setState = legacySetStateEtc;
|
|
node.replaceState = legacySetStateEtc;
|
|
node.forceUpdate = legacySetStateEtc;
|
|
node.setProps = legacySetProps;
|
|
node.replaceProps = legacyReplaceProps;
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
if (canDefineProperty) {
|
|
Object.defineProperties(node, legacyPropsDescriptor);
|
|
} else {
|
|
// updateComponent will update this property on subsequent renders
|
|
node.props = this._currentElement.props;
|
|
}
|
|
} else {
|
|
// updateComponent will update this property on subsequent renders
|
|
node.props = this._currentElement.props;
|
|
}
|
|
|
|
this._nodeWithLegacyProperties = node;
|
|
}
|
|
return this._nodeWithLegacyProperties;
|
|
}
|
|
|
|
};
|
|
|
|
ReactPerf.measureMethods(ReactDOMComponent, 'ReactDOMComponent', {
|
|
mountComponent: 'mountComponent',
|
|
updateComponent: 'updateComponent'
|
|
});
|
|
|
|
assign(ReactDOMComponent.prototype, ReactDOMComponent.Mixin, ReactMultiChild.Mixin);
|
|
|
|
module.exports = ReactDOMComponent;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 93 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule AutoFocusUtils
|
|
* @typechecks static-only
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var ReactMount = __webpack_require__(27);
|
|
|
|
var findDOMNode = __webpack_require__(90);
|
|
var focusNode = __webpack_require__(94);
|
|
|
|
var Mixin = {
|
|
componentDidMount: function () {
|
|
if (this.props.autoFocus) {
|
|
focusNode(findDOMNode(this));
|
|
}
|
|
}
|
|
};
|
|
|
|
var AutoFocusUtils = {
|
|
Mixin: Mixin,
|
|
|
|
focusDOMComponent: function () {
|
|
focusNode(ReactMount.getNode(this._rootNodeID));
|
|
}
|
|
};
|
|
|
|
module.exports = AutoFocusUtils;
|
|
|
|
/***/ },
|
|
/* 94 */
|
|
/***/ function(module, exports) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule focusNode
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
/**
|
|
* @param {DOMElement} node input/textarea to focus
|
|
*/
|
|
function focusNode(node) {
|
|
// IE8 can throw "Can't move focus to the control because it is invisible,
|
|
// not enabled, or of a type that does not accept the focus." for all kinds of
|
|
// reasons that are too expensive and fragile to test.
|
|
try {
|
|
node.focus();
|
|
} catch (e) {}
|
|
}
|
|
|
|
module.exports = focusNode;
|
|
|
|
/***/ },
|
|
/* 95 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule CSSPropertyOperations
|
|
* @typechecks static-only
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var CSSProperty = __webpack_require__(96);
|
|
var ExecutionEnvironment = __webpack_require__(8);
|
|
var ReactPerf = __webpack_require__(17);
|
|
|
|
var camelizeStyleName = __webpack_require__(97);
|
|
var dangerousStyleValue = __webpack_require__(99);
|
|
var hyphenateStyleName = __webpack_require__(100);
|
|
var memoizeStringOnly = __webpack_require__(102);
|
|
var warning = __webpack_require__(24);
|
|
|
|
var processStyleName = memoizeStringOnly(function (styleName) {
|
|
return hyphenateStyleName(styleName);
|
|
});
|
|
|
|
var hasShorthandPropertyBug = false;
|
|
var styleFloatAccessor = 'cssFloat';
|
|
if (ExecutionEnvironment.canUseDOM) {
|
|
var tempStyle = document.createElement('div').style;
|
|
try {
|
|
// IE8 throws "Invalid argument." if resetting shorthand style properties.
|
|
tempStyle.font = '';
|
|
} catch (e) {
|
|
hasShorthandPropertyBug = true;
|
|
}
|
|
// IE8 only supports accessing cssFloat (standard) as styleFloat
|
|
if (document.documentElement.style.cssFloat === undefined) {
|
|
styleFloatAccessor = 'styleFloat';
|
|
}
|
|
}
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
// 'msTransform' is correct, but the other prefixes should be capitalized
|
|
var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
|
|
|
|
// style values shouldn't contain a semicolon
|
|
var badStyleValueWithSemicolonPattern = /;\s*$/;
|
|
|
|
var warnedStyleNames = {};
|
|
var warnedStyleValues = {};
|
|
|
|
var warnHyphenatedStyleName = function (name) {
|
|
if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
|
|
return;
|
|
}
|
|
|
|
warnedStyleNames[name] = true;
|
|
process.env.NODE_ENV !== 'production' ? warning(false, 'Unsupported style property %s. Did you mean %s?', name, camelizeStyleName(name)) : undefined;
|
|
};
|
|
|
|
var warnBadVendoredStyleName = function (name) {
|
|
if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
|
|
return;
|
|
}
|
|
|
|
warnedStyleNames[name] = true;
|
|
process.env.NODE_ENV !== 'production' ? warning(false, 'Unsupported vendor-prefixed style property %s. Did you mean %s?', name, name.charAt(0).toUpperCase() + name.slice(1)) : undefined;
|
|
};
|
|
|
|
var warnStyleValueWithSemicolon = function (name, value) {
|
|
if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
|
|
return;
|
|
}
|
|
|
|
warnedStyleValues[value] = true;
|
|
process.env.NODE_ENV !== 'production' ? warning(false, 'Style property values shouldn\'t contain a semicolon. ' + 'Try "%s: %s" instead.', name, value.replace(badStyleValueWithSemicolonPattern, '')) : undefined;
|
|
};
|
|
|
|
/**
|
|
* @param {string} name
|
|
* @param {*} value
|
|
*/
|
|
var warnValidStyle = function (name, value) {
|
|
if (name.indexOf('-') > -1) {
|
|
warnHyphenatedStyleName(name);
|
|
} else if (badVendoredStyleNamePattern.test(name)) {
|
|
warnBadVendoredStyleName(name);
|
|
} else if (badStyleValueWithSemicolonPattern.test(value)) {
|
|
warnStyleValueWithSemicolon(name, value);
|
|
}
|
|
};
|
|
}
|
|
|
|
/**
|
|
* Operations for dealing with CSS properties.
|
|
*/
|
|
var CSSPropertyOperations = {
|
|
|
|
/**
|
|
* Serializes a mapping of style properties for use as inline styles:
|
|
*
|
|
* > createMarkupForStyles({width: '200px', height: 0})
|
|
* "width:200px;height:0;"
|
|
*
|
|
* Undefined values are ignored so that declarative programming is easier.
|
|
* The result should be HTML-escaped before insertion into the DOM.
|
|
*
|
|
* @param {object} styles
|
|
* @return {?string}
|
|
*/
|
|
createMarkupForStyles: function (styles) {
|
|
var serialized = '';
|
|
for (var styleName in styles) {
|
|
if (!styles.hasOwnProperty(styleName)) {
|
|
continue;
|
|
}
|
|
var styleValue = styles[styleName];
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
warnValidStyle(styleName, styleValue);
|
|
}
|
|
if (styleValue != null) {
|
|
serialized += processStyleName(styleName) + ':';
|
|
serialized += dangerousStyleValue(styleName, styleValue) + ';';
|
|
}
|
|
}
|
|
return serialized || null;
|
|
},
|
|
|
|
/**
|
|
* Sets the value for multiple styles on a node. If a value is specified as
|
|
* '' (empty string), the corresponding style property will be unset.
|
|
*
|
|
* @param {DOMElement} node
|
|
* @param {object} styles
|
|
*/
|
|
setValueForStyles: function (node, styles) {
|
|
var style = node.style;
|
|
for (var styleName in styles) {
|
|
if (!styles.hasOwnProperty(styleName)) {
|
|
continue;
|
|
}
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
warnValidStyle(styleName, styles[styleName]);
|
|
}
|
|
var styleValue = dangerousStyleValue(styleName, styles[styleName]);
|
|
if (styleName === 'float') {
|
|
styleName = styleFloatAccessor;
|
|
}
|
|
if (styleValue) {
|
|
style[styleName] = styleValue;
|
|
} else {
|
|
var expansion = hasShorthandPropertyBug && CSSProperty.shorthandPropertyExpansions[styleName];
|
|
if (expansion) {
|
|
// Shorthand property that IE8 won't like unsetting, so unset each
|
|
// component to placate it
|
|
for (var individualStyleName in expansion) {
|
|
style[individualStyleName] = '';
|
|
}
|
|
} else {
|
|
style[styleName] = '';
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
};
|
|
|
|
ReactPerf.measureMethods(CSSPropertyOperations, 'CSSPropertyOperations', {
|
|
setValueForStyles: 'setValueForStyles'
|
|
});
|
|
|
|
module.exports = CSSPropertyOperations;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 96 */
|
|
/***/ function(module, exports) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule CSSProperty
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
/**
|
|
* CSS properties which accept numbers but are not in units of "px".
|
|
*/
|
|
var isUnitlessNumber = {
|
|
animationIterationCount: true,
|
|
boxFlex: true,
|
|
boxFlexGroup: true,
|
|
boxOrdinalGroup: true,
|
|
columnCount: true,
|
|
flex: true,
|
|
flexGrow: true,
|
|
flexPositive: true,
|
|
flexShrink: true,
|
|
flexNegative: true,
|
|
flexOrder: true,
|
|
fontWeight: true,
|
|
lineClamp: true,
|
|
lineHeight: true,
|
|
opacity: true,
|
|
order: true,
|
|
orphans: true,
|
|
tabSize: true,
|
|
widows: true,
|
|
zIndex: true,
|
|
zoom: true,
|
|
|
|
// SVG-related properties
|
|
fillOpacity: true,
|
|
stopOpacity: true,
|
|
strokeDashoffset: true,
|
|
strokeOpacity: true,
|
|
strokeWidth: true
|
|
};
|
|
|
|
/**
|
|
* @param {string} prefix vendor-specific prefix, eg: Webkit
|
|
* @param {string} key style name, eg: transitionDuration
|
|
* @return {string} style name prefixed with `prefix`, properly camelCased, eg:
|
|
* WebkitTransitionDuration
|
|
*/
|
|
function prefixKey(prefix, key) {
|
|
return prefix + key.charAt(0).toUpperCase() + key.substring(1);
|
|
}
|
|
|
|
/**
|
|
* Support style names that may come passed in prefixed by adding permutations
|
|
* of vendor prefixes.
|
|
*/
|
|
var prefixes = ['Webkit', 'ms', 'Moz', 'O'];
|
|
|
|
// Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an
|
|
// infinite loop, because it iterates over the newly added props too.
|
|
Object.keys(isUnitlessNumber).forEach(function (prop) {
|
|
prefixes.forEach(function (prefix) {
|
|
isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
|
|
});
|
|
});
|
|
|
|
/**
|
|
* Most style properties can be unset by doing .style[prop] = '' but IE8
|
|
* doesn't like doing that with shorthand properties so for the properties that
|
|
* IE8 breaks on, which are listed here, we instead unset each of the
|
|
* individual properties. See http://bugs.jquery.com/ticket/12385.
|
|
* The 4-value 'clock' properties like margin, padding, border-width seem to
|
|
* behave without any problems. Curiously, list-style works too without any
|
|
* special prodding.
|
|
*/
|
|
var shorthandPropertyExpansions = {
|
|
background: {
|
|
backgroundAttachment: true,
|
|
backgroundColor: true,
|
|
backgroundImage: true,
|
|
backgroundPositionX: true,
|
|
backgroundPositionY: true,
|
|
backgroundRepeat: true
|
|
},
|
|
backgroundPosition: {
|
|
backgroundPositionX: true,
|
|
backgroundPositionY: true
|
|
},
|
|
border: {
|
|
borderWidth: true,
|
|
borderStyle: true,
|
|
borderColor: true
|
|
},
|
|
borderBottom: {
|
|
borderBottomWidth: true,
|
|
borderBottomStyle: true,
|
|
borderBottomColor: true
|
|
},
|
|
borderLeft: {
|
|
borderLeftWidth: true,
|
|
borderLeftStyle: true,
|
|
borderLeftColor: true
|
|
},
|
|
borderRight: {
|
|
borderRightWidth: true,
|
|
borderRightStyle: true,
|
|
borderRightColor: true
|
|
},
|
|
borderTop: {
|
|
borderTopWidth: true,
|
|
borderTopStyle: true,
|
|
borderTopColor: true
|
|
},
|
|
font: {
|
|
fontStyle: true,
|
|
fontVariant: true,
|
|
fontWeight: true,
|
|
fontSize: true,
|
|
lineHeight: true,
|
|
fontFamily: true
|
|
},
|
|
outline: {
|
|
outlineWidth: true,
|
|
outlineStyle: true,
|
|
outlineColor: true
|
|
}
|
|
};
|
|
|
|
var CSSProperty = {
|
|
isUnitlessNumber: isUnitlessNumber,
|
|
shorthandPropertyExpansions: shorthandPropertyExpansions
|
|
};
|
|
|
|
module.exports = CSSProperty;
|
|
|
|
/***/ },
|
|
/* 97 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule camelizeStyleName
|
|
* @typechecks
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var camelize = __webpack_require__(98);
|
|
|
|
var msPattern = /^-ms-/;
|
|
|
|
/**
|
|
* Camelcases a hyphenated CSS property name, for example:
|
|
*
|
|
* > camelizeStyleName('background-color')
|
|
* < "backgroundColor"
|
|
* > camelizeStyleName('-moz-transition')
|
|
* < "MozTransition"
|
|
* > camelizeStyleName('-ms-transition')
|
|
* < "msTransition"
|
|
*
|
|
* As Andi Smith suggests
|
|
* (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix
|
|
* is converted to lowercase `ms`.
|
|
*
|
|
* @param {string} string
|
|
* @return {string}
|
|
*/
|
|
function camelizeStyleName(string) {
|
|
return camelize(string.replace(msPattern, 'ms-'));
|
|
}
|
|
|
|
module.exports = camelizeStyleName;
|
|
|
|
/***/ },
|
|
/* 98 */
|
|
/***/ function(module, exports) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule camelize
|
|
* @typechecks
|
|
*/
|
|
|
|
"use strict";
|
|
|
|
var _hyphenPattern = /-(.)/g;
|
|
|
|
/**
|
|
* Camelcases a hyphenated string, for example:
|
|
*
|
|
* > camelize('background-color')
|
|
* < "backgroundColor"
|
|
*
|
|
* @param {string} string
|
|
* @return {string}
|
|
*/
|
|
function camelize(string) {
|
|
return string.replace(_hyphenPattern, function (_, character) {
|
|
return character.toUpperCase();
|
|
});
|
|
}
|
|
|
|
module.exports = camelize;
|
|
|
|
/***/ },
|
|
/* 99 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule dangerousStyleValue
|
|
* @typechecks static-only
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var CSSProperty = __webpack_require__(96);
|
|
|
|
var isUnitlessNumber = CSSProperty.isUnitlessNumber;
|
|
|
|
/**
|
|
* Convert a value into the proper css writable value. The style name `name`
|
|
* should be logical (no hyphens), as specified
|
|
* in `CSSProperty.isUnitlessNumber`.
|
|
*
|
|
* @param {string} name CSS property name such as `topMargin`.
|
|
* @param {*} value CSS property value such as `10px`.
|
|
* @return {string} Normalized style value with dimensions applied.
|
|
*/
|
|
function dangerousStyleValue(name, value) {
|
|
// Note that we've removed escapeTextForBrowser() calls here since the
|
|
// whole string will be escaped when the attribute is injected into
|
|
// the markup. If you provide unsafe user data here they can inject
|
|
// arbitrary CSS which may be problematic (I couldn't repro this):
|
|
// https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet
|
|
// http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/
|
|
// This is not an XSS hole but instead a potential CSS injection issue
|
|
// which has lead to a greater discussion about how we're going to
|
|
// trust URLs moving forward. See #2115901
|
|
|
|
var isEmpty = value == null || typeof value === 'boolean' || value === '';
|
|
if (isEmpty) {
|
|
return '';
|
|
}
|
|
|
|
var isNonNumeric = isNaN(value);
|
|
if (isNonNumeric || value === 0 || isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name]) {
|
|
return '' + value; // cast to string
|
|
}
|
|
|
|
if (typeof value === 'string') {
|
|
value = value.trim();
|
|
}
|
|
return value + 'px';
|
|
}
|
|
|
|
module.exports = dangerousStyleValue;
|
|
|
|
/***/ },
|
|
/* 100 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule hyphenateStyleName
|
|
* @typechecks
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var hyphenate = __webpack_require__(101);
|
|
|
|
var msPattern = /^ms-/;
|
|
|
|
/**
|
|
* Hyphenates a camelcased CSS property name, for example:
|
|
*
|
|
* > hyphenateStyleName('backgroundColor')
|
|
* < "background-color"
|
|
* > hyphenateStyleName('MozTransition')
|
|
* < "-moz-transition"
|
|
* > hyphenateStyleName('msTransition')
|
|
* < "-ms-transition"
|
|
*
|
|
* As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix
|
|
* is converted to `-ms-`.
|
|
*
|
|
* @param {string} string
|
|
* @return {string}
|
|
*/
|
|
function hyphenateStyleName(string) {
|
|
return hyphenate(string).replace(msPattern, '-ms-');
|
|
}
|
|
|
|
module.exports = hyphenateStyleName;
|
|
|
|
/***/ },
|
|
/* 101 */
|
|
/***/ function(module, exports) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule hyphenate
|
|
* @typechecks
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var _uppercasePattern = /([A-Z])/g;
|
|
|
|
/**
|
|
* Hyphenates a camelcased string, for example:
|
|
*
|
|
* > hyphenate('backgroundColor')
|
|
* < "background-color"
|
|
*
|
|
* For CSS style names, use `hyphenateStyleName` instead which works properly
|
|
* with all vendor prefixes, including `ms`.
|
|
*
|
|
* @param {string} string
|
|
* @return {string}
|
|
*/
|
|
function hyphenate(string) {
|
|
return string.replace(_uppercasePattern, '-$1').toLowerCase();
|
|
}
|
|
|
|
module.exports = hyphenate;
|
|
|
|
/***/ },
|
|
/* 102 */
|
|
/***/ function(module, exports) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule memoizeStringOnly
|
|
* @typechecks static-only
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
/**
|
|
* Memoizes the return value of a function that accepts one string argument.
|
|
*
|
|
* @param {function} callback
|
|
* @return {function}
|
|
*/
|
|
function memoizeStringOnly(callback) {
|
|
var cache = {};
|
|
return function (string) {
|
|
if (!cache.hasOwnProperty(string)) {
|
|
cache[string] = callback.call(this, string);
|
|
}
|
|
return cache[string];
|
|
};
|
|
}
|
|
|
|
module.exports = memoizeStringOnly;
|
|
|
|
/***/ },
|
|
/* 103 */
|
|
/***/ function(module, exports) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactDOMButton
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var mouseListenerNames = {
|
|
onClick: true,
|
|
onDoubleClick: true,
|
|
onMouseDown: true,
|
|
onMouseMove: true,
|
|
onMouseUp: true,
|
|
|
|
onClickCapture: true,
|
|
onDoubleClickCapture: true,
|
|
onMouseDownCapture: true,
|
|
onMouseMoveCapture: true,
|
|
onMouseUpCapture: true
|
|
};
|
|
|
|
/**
|
|
* Implements a <button> native component that does not receive mouse events
|
|
* when `disabled` is set.
|
|
*/
|
|
var ReactDOMButton = {
|
|
getNativeProps: function (inst, props, context) {
|
|
if (!props.disabled) {
|
|
return props;
|
|
}
|
|
|
|
// Copy the props, except the mouse listeners
|
|
var nativeProps = {};
|
|
for (var key in props) {
|
|
if (props.hasOwnProperty(key) && !mouseListenerNames[key]) {
|
|
nativeProps[key] = props[key];
|
|
}
|
|
}
|
|
|
|
return nativeProps;
|
|
}
|
|
};
|
|
|
|
module.exports = ReactDOMButton;
|
|
|
|
/***/ },
|
|
/* 104 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactDOMInput
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var ReactDOMIDOperations = __webpack_require__(26);
|
|
var LinkedValueUtils = __webpack_require__(105);
|
|
var ReactMount = __webpack_require__(27);
|
|
var ReactUpdates = __webpack_require__(53);
|
|
|
|
var assign = __webpack_require__(38);
|
|
var invariant = __webpack_require__(12);
|
|
|
|
var instancesByReactID = {};
|
|
|
|
function forceUpdateIfMounted() {
|
|
if (this._rootNodeID) {
|
|
// DOM component is still mounted; update
|
|
ReactDOMInput.updateWrapper(this);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Implements an <input> native component that allows setting these optional
|
|
* props: `checked`, `value`, `defaultChecked`, and `defaultValue`.
|
|
*
|
|
* If `checked` or `value` are not supplied (or null/undefined), user actions
|
|
* that affect the checked state or value will trigger updates to the element.
|
|
*
|
|
* If they are supplied (and not null/undefined), the rendered element will not
|
|
* trigger updates to the element. Instead, the props must change in order for
|
|
* the rendered element to be updated.
|
|
*
|
|
* The rendered element will be initialized as unchecked (or `defaultChecked`)
|
|
* with an empty value (or `defaultValue`).
|
|
*
|
|
* @see http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html
|
|
*/
|
|
var ReactDOMInput = {
|
|
getNativeProps: function (inst, props, context) {
|
|
var value = LinkedValueUtils.getValue(props);
|
|
var checked = LinkedValueUtils.getChecked(props);
|
|
|
|
var nativeProps = assign({}, props, {
|
|
defaultChecked: undefined,
|
|
defaultValue: undefined,
|
|
value: value != null ? value : inst._wrapperState.initialValue,
|
|
checked: checked != null ? checked : inst._wrapperState.initialChecked,
|
|
onChange: inst._wrapperState.onChange
|
|
});
|
|
|
|
return nativeProps;
|
|
},
|
|
|
|
mountWrapper: function (inst, props) {
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
LinkedValueUtils.checkPropTypes('input', props, inst._currentElement._owner);
|
|
}
|
|
|
|
var defaultValue = props.defaultValue;
|
|
inst._wrapperState = {
|
|
initialChecked: props.defaultChecked || false,
|
|
initialValue: defaultValue != null ? defaultValue : null,
|
|
onChange: _handleChange.bind(inst)
|
|
};
|
|
},
|
|
|
|
mountReadyWrapper: function (inst) {
|
|
// Can't be in mountWrapper or else server rendering leaks.
|
|
instancesByReactID[inst._rootNodeID] = inst;
|
|
},
|
|
|
|
unmountWrapper: function (inst) {
|
|
delete instancesByReactID[inst._rootNodeID];
|
|
},
|
|
|
|
updateWrapper: function (inst) {
|
|
var props = inst._currentElement.props;
|
|
|
|
// TODO: Shouldn't this be getChecked(props)?
|
|
var checked = props.checked;
|
|
if (checked != null) {
|
|
ReactDOMIDOperations.updatePropertyByID(inst._rootNodeID, 'checked', checked || false);
|
|
}
|
|
|
|
var value = LinkedValueUtils.getValue(props);
|
|
if (value != null) {
|
|
// Cast `value` to a string to ensure the value is set correctly. While
|
|
// browsers typically do this as necessary, jsdom doesn't.
|
|
ReactDOMIDOperations.updatePropertyByID(inst._rootNodeID, 'value', '' + value);
|
|
}
|
|
}
|
|
};
|
|
|
|
function _handleChange(event) {
|
|
var props = this._currentElement.props;
|
|
|
|
var returnValue = LinkedValueUtils.executeOnChange(props, event);
|
|
|
|
// Here we use asap to wait until all updates have propagated, which
|
|
// is important when using controlled components within layers:
|
|
// https://github.com/facebook/react/issues/1698
|
|
ReactUpdates.asap(forceUpdateIfMounted, this);
|
|
|
|
var name = props.name;
|
|
if (props.type === 'radio' && name != null) {
|
|
var rootNode = ReactMount.getNode(this._rootNodeID);
|
|
var queryRoot = rootNode;
|
|
|
|
while (queryRoot.parentNode) {
|
|
queryRoot = queryRoot.parentNode;
|
|
}
|
|
|
|
// If `rootNode.form` was non-null, then we could try `form.elements`,
|
|
// but that sometimes behaves strangely in IE8. We could also try using
|
|
// `form.getElementsByName`, but that will only return direct children
|
|
// and won't include inputs that use the HTML5 `form=` attribute. Since
|
|
// the input might not even be in a form, let's just use the global
|
|
// `querySelectorAll` to ensure we don't miss anything.
|
|
var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type="radio"]');
|
|
|
|
for (var i = 0; i < group.length; i++) {
|
|
var otherNode = group[i];
|
|
if (otherNode === rootNode || otherNode.form !== rootNode.form) {
|
|
continue;
|
|
}
|
|
// This will throw if radio buttons rendered by different copies of React
|
|
// and the same name are rendered into the same form (same as #1939).
|
|
// That's probably okay; we don't support it just as we don't support
|
|
// mixing React with non-React.
|
|
var otherID = ReactMount.getID(otherNode);
|
|
!otherID ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactDOMInput: Mixing React and non-React radio inputs with the ' + 'same `name` is not supported.') : invariant(false) : undefined;
|
|
var otherInstance = instancesByReactID[otherID];
|
|
!otherInstance ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactDOMInput: Unknown radio button ID %s.', otherID) : invariant(false) : undefined;
|
|
// If this is a controlled radio button group, forcing the input that
|
|
// was previously checked to update will cause it to be come re-checked
|
|
// as appropriate.
|
|
ReactUpdates.asap(forceUpdateIfMounted, otherInstance);
|
|
}
|
|
}
|
|
|
|
return returnValue;
|
|
}
|
|
|
|
module.exports = ReactDOMInput;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 105 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule LinkedValueUtils
|
|
* @typechecks static-only
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var ReactPropTypes = __webpack_require__(106);
|
|
var ReactPropTypeLocations = __webpack_require__(64);
|
|
|
|
var invariant = __webpack_require__(12);
|
|
var warning = __webpack_require__(24);
|
|
|
|
var hasReadOnlyValue = {
|
|
'button': true,
|
|
'checkbox': true,
|
|
'image': true,
|
|
'hidden': true,
|
|
'radio': true,
|
|
'reset': true,
|
|
'submit': true
|
|
};
|
|
|
|
function _assertSingleLink(inputProps) {
|
|
!(inputProps.checkedLink == null || inputProps.valueLink == null) ? process.env.NODE_ENV !== '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.') : invariant(false) : undefined;
|
|
}
|
|
function _assertValueLink(inputProps) {
|
|
_assertSingleLink(inputProps);
|
|
!(inputProps.value == null && inputProps.onChange == null) ? process.env.NODE_ENV !== '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.') : invariant(false) : undefined;
|
|
}
|
|
|
|
function _assertCheckedLink(inputProps) {
|
|
_assertSingleLink(inputProps);
|
|
!(inputProps.checked == null && inputProps.onChange == null) ? process.env.NODE_ENV !== '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') : invariant(false) : undefined;
|
|
}
|
|
|
|
var propTypes = {
|
|
value: function (props, propName, componentName) {
|
|
if (!props[propName] || hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled) {
|
|
return null;
|
|
}
|
|
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`.');
|
|
},
|
|
checked: function (props, propName, componentName) {
|
|
if (!props[propName] || props.onChange || props.readOnly || props.disabled) {
|
|
return null;
|
|
}
|
|
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`.');
|
|
},
|
|
onChange: ReactPropTypes.func
|
|
};
|
|
|
|
var loggedTypeFailures = {};
|
|
function getDeclarationErrorAddendum(owner) {
|
|
if (owner) {
|
|
var name = owner.getName();
|
|
if (name) {
|
|
return ' Check the render method of `' + name + '`.';
|
|
}
|
|
}
|
|
return '';
|
|
}
|
|
|
|
/**
|
|
* Provide a linked `value` attribute for controlled forms. You should not use
|
|
* this outside of the ReactDOM controlled form components.
|
|
*/
|
|
var LinkedValueUtils = {
|
|
checkPropTypes: function (tagName, props, owner) {
|
|
for (var propName in propTypes) {
|
|
if (propTypes.hasOwnProperty(propName)) {
|
|
var error = propTypes[propName](props, propName, tagName, ReactPropTypeLocations.prop);
|
|
}
|
|
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
|
// Only monitor this failure once because there tends to be a lot of the
|
|
// same error.
|
|
loggedTypeFailures[error.message] = true;
|
|
|
|
var addendum = getDeclarationErrorAddendum(owner);
|
|
process.env.NODE_ENV !== 'production' ? warning(false, 'Failed form propType: %s%s', error.message, addendum) : undefined;
|
|
}
|
|
}
|
|
},
|
|
|
|
/**
|
|
* @param {object} inputProps Props for form component
|
|
* @return {*} current value of the input either from value prop or link.
|
|
*/
|
|
getValue: function (inputProps) {
|
|
if (inputProps.valueLink) {
|
|
_assertValueLink(inputProps);
|
|
return inputProps.valueLink.value;
|
|
}
|
|
return inputProps.value;
|
|
},
|
|
|
|
/**
|
|
* @param {object} inputProps Props for form component
|
|
* @return {*} current checked status of the input either from checked prop
|
|
* or link.
|
|
*/
|
|
getChecked: function (inputProps) {
|
|
if (inputProps.checkedLink) {
|
|
_assertCheckedLink(inputProps);
|
|
return inputProps.checkedLink.value;
|
|
}
|
|
return inputProps.checked;
|
|
},
|
|
|
|
/**
|
|
* @param {object} inputProps Props for form component
|
|
* @param {SyntheticEvent} event change event to handle
|
|
*/
|
|
executeOnChange: function (inputProps, event) {
|
|
if (inputProps.valueLink) {
|
|
_assertValueLink(inputProps);
|
|
return inputProps.valueLink.requestChange(event.target.value);
|
|
} else if (inputProps.checkedLink) {
|
|
_assertCheckedLink(inputProps);
|
|
return inputProps.checkedLink.requestChange(event.target.checked);
|
|
} else if (inputProps.onChange) {
|
|
return inputProps.onChange.call(undefined, event);
|
|
}
|
|
}
|
|
};
|
|
|
|
module.exports = LinkedValueUtils;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 106 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactPropTypes
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var ReactElement = __webpack_require__(41);
|
|
var ReactPropTypeLocationNames = __webpack_require__(65);
|
|
|
|
var emptyFunction = __webpack_require__(14);
|
|
var getIteratorFn = __webpack_require__(107);
|
|
|
|
/**
|
|
* Collection of methods that allow declaration and validation of props that are
|
|
* supplied to React components. Example usage:
|
|
*
|
|
* var Props = require('ReactPropTypes');
|
|
* var MyArticle = React.createClass({
|
|
* propTypes: {
|
|
* // An optional string prop named "description".
|
|
* description: Props.string,
|
|
*
|
|
* // A required enum prop named "category".
|
|
* category: Props.oneOf(['News','Photos']).isRequired,
|
|
*
|
|
* // A prop named "dialog" that requires an instance of Dialog.
|
|
* dialog: Props.instanceOf(Dialog).isRequired
|
|
* },
|
|
* render: function() { ... }
|
|
* });
|
|
*
|
|
* A more formal specification of how these methods are used:
|
|
*
|
|
* type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
|
|
* decl := ReactPropTypes.{type}(.isRequired)?
|
|
*
|
|
* Each and every declaration produces a function with the same signature. This
|
|
* allows the creation of custom validation functions. For example:
|
|
*
|
|
* var MyLink = React.createClass({
|
|
* propTypes: {
|
|
* // An optional string or URI prop named "href".
|
|
* href: function(props, propName, componentName) {
|
|
* var propValue = props[propName];
|
|
* if (propValue != null && typeof propValue !== 'string' &&
|
|
* !(propValue instanceof URI)) {
|
|
* return new Error(
|
|
* 'Expected a string or an URI for ' + propName + ' in ' +
|
|
* componentName
|
|
* );
|
|
* }
|
|
* }
|
|
* },
|
|
* render: function() {...}
|
|
* });
|
|
*
|
|
* @internal
|
|
*/
|
|
|
|
var ANONYMOUS = '<<anonymous>>';
|
|
|
|
var ReactPropTypes = {
|
|
array: createPrimitiveTypeChecker('array'),
|
|
bool: createPrimitiveTypeChecker('boolean'),
|
|
func: createPrimitiveTypeChecker('function'),
|
|
number: createPrimitiveTypeChecker('number'),
|
|
object: createPrimitiveTypeChecker('object'),
|
|
string: createPrimitiveTypeChecker('string'),
|
|
|
|
any: createAnyTypeChecker(),
|
|
arrayOf: createArrayOfTypeChecker,
|
|
element: createElementTypeChecker(),
|
|
instanceOf: createInstanceTypeChecker,
|
|
node: createNodeChecker(),
|
|
objectOf: createObjectOfTypeChecker,
|
|
oneOf: createEnumTypeChecker,
|
|
oneOfType: createUnionTypeChecker,
|
|
shape: createShapeTypeChecker
|
|
};
|
|
|
|
function createChainableTypeChecker(validate) {
|
|
function checkType(isRequired, props, propName, componentName, location, propFullName) {
|
|
componentName = componentName || ANONYMOUS;
|
|
propFullName = propFullName || propName;
|
|
if (props[propName] == null) {
|
|
var locationName = ReactPropTypeLocationNames[location];
|
|
if (isRequired) {
|
|
return new Error('Required ' + locationName + ' `' + propFullName + '` was not specified in ' + ('`' + componentName + '`.'));
|
|
}
|
|
return null;
|
|
} else {
|
|
return validate(props, propName, componentName, location, propFullName);
|
|
}
|
|
}
|
|
|
|
var chainedCheckType = checkType.bind(null, false);
|
|
chainedCheckType.isRequired = checkType.bind(null, true);
|
|
|
|
return chainedCheckType;
|
|
}
|
|
|
|
function createPrimitiveTypeChecker(expectedType) {
|
|
function validate(props, propName, componentName, location, propFullName) {
|
|
var propValue = props[propName];
|
|
var propType = getPropType(propValue);
|
|
if (propType !== expectedType) {
|
|
var locationName = ReactPropTypeLocationNames[location];
|
|
// `propValue` being instance of, say, date/regexp, pass the 'object'
|
|
// check, but we can offer a more precise error message here rather than
|
|
// 'of type `object`'.
|
|
var preciseType = getPreciseType(propValue);
|
|
|
|
return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
|
|
}
|
|
return null;
|
|
}
|
|
return createChainableTypeChecker(validate);
|
|
}
|
|
|
|
function createAnyTypeChecker() {
|
|
return createChainableTypeChecker(emptyFunction.thatReturns(null));
|
|
}
|
|
|
|
function createArrayOfTypeChecker(typeChecker) {
|
|
function validate(props, propName, componentName, location, propFullName) {
|
|
var propValue = props[propName];
|
|
if (!Array.isArray(propValue)) {
|
|
var locationName = ReactPropTypeLocationNames[location];
|
|
var propType = getPropType(propValue);
|
|
return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
|
|
}
|
|
for (var i = 0; i < propValue.length; i++) {
|
|
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']');
|
|
if (error instanceof Error) {
|
|
return error;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
return createChainableTypeChecker(validate);
|
|
}
|
|
|
|
function createElementTypeChecker() {
|
|
function validate(props, propName, componentName, location, propFullName) {
|
|
if (!ReactElement.isValidElement(props[propName])) {
|
|
var locationName = ReactPropTypeLocationNames[location];
|
|
return new Error('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a single ReactElement.'));
|
|
}
|
|
return null;
|
|
}
|
|
return createChainableTypeChecker(validate);
|
|
}
|
|
|
|
function createInstanceTypeChecker(expectedClass) {
|
|
function validate(props, propName, componentName, location, propFullName) {
|
|
if (!(props[propName] instanceof expectedClass)) {
|
|
var locationName = ReactPropTypeLocationNames[location];
|
|
var expectedClassName = expectedClass.name || ANONYMOUS;
|
|
var actualClassName = getClassName(props[propName]);
|
|
return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
|
|
}
|
|
return null;
|
|
}
|
|
return createChainableTypeChecker(validate);
|
|
}
|
|
|
|
function createEnumTypeChecker(expectedValues) {
|
|
if (!Array.isArray(expectedValues)) {
|
|
return createChainableTypeChecker(function () {
|
|
return new Error('Invalid argument supplied to oneOf, expected an instance of array.');
|
|
});
|
|
}
|
|
|
|
function validate(props, propName, componentName, location, propFullName) {
|
|
var propValue = props[propName];
|
|
for (var i = 0; i < expectedValues.length; i++) {
|
|
if (propValue === expectedValues[i]) {
|
|
return null;
|
|
}
|
|
}
|
|
|
|
var locationName = ReactPropTypeLocationNames[location];
|
|
var valuesString = JSON.stringify(expectedValues);
|
|
return new Error('Invalid ' + locationName + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
|
|
}
|
|
return createChainableTypeChecker(validate);
|
|
}
|
|
|
|
function createObjectOfTypeChecker(typeChecker) {
|
|
function validate(props, propName, componentName, location, propFullName) {
|
|
var propValue = props[propName];
|
|
var propType = getPropType(propValue);
|
|
if (propType !== 'object') {
|
|
var locationName = ReactPropTypeLocationNames[location];
|
|
return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
|
|
}
|
|
for (var key in propValue) {
|
|
if (propValue.hasOwnProperty(key)) {
|
|
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key);
|
|
if (error instanceof Error) {
|
|
return error;
|
|
}
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
return createChainableTypeChecker(validate);
|
|
}
|
|
|
|
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
|
if (!Array.isArray(arrayOfTypeCheckers)) {
|
|
return createChainableTypeChecker(function () {
|
|
return new Error('Invalid argument supplied to oneOfType, expected an instance of array.');
|
|
});
|
|
}
|
|
|
|
function validate(props, propName, componentName, location, propFullName) {
|
|
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
var checker = arrayOfTypeCheckers[i];
|
|
if (checker(props, propName, componentName, location, propFullName) == null) {
|
|
return null;
|
|
}
|
|
}
|
|
|
|
var locationName = ReactPropTypeLocationNames[location];
|
|
return new Error('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
|
|
}
|
|
return createChainableTypeChecker(validate);
|
|
}
|
|
|
|
function createNodeChecker() {
|
|
function validate(props, propName, componentName, location, propFullName) {
|
|
if (!isNode(props[propName])) {
|
|
var locationName = ReactPropTypeLocationNames[location];
|
|
return new Error('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
|
|
}
|
|
return null;
|
|
}
|
|
return createChainableTypeChecker(validate);
|
|
}
|
|
|
|
function createShapeTypeChecker(shapeTypes) {
|
|
function validate(props, propName, componentName, location, propFullName) {
|
|
var propValue = props[propName];
|
|
var propType = getPropType(propValue);
|
|
if (propType !== 'object') {
|
|
var locationName = ReactPropTypeLocationNames[location];
|
|
return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
}
|
|
for (var key in shapeTypes) {
|
|
var checker = shapeTypes[key];
|
|
if (!checker) {
|
|
continue;
|
|
}
|
|
var error = checker(propValue, key, componentName, location, propFullName + '.' + key);
|
|
if (error) {
|
|
return error;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
return createChainableTypeChecker(validate);
|
|
}
|
|
|
|
function isNode(propValue) {
|
|
switch (typeof propValue) {
|
|
case 'number':
|
|
case 'string':
|
|
case 'undefined':
|
|
return true;
|
|
case 'boolean':
|
|
return !propValue;
|
|
case 'object':
|
|
if (Array.isArray(propValue)) {
|
|
return propValue.every(isNode);
|
|
}
|
|
if (propValue === null || ReactElement.isValidElement(propValue)) {
|
|
return true;
|
|
}
|
|
|
|
var iteratorFn = getIteratorFn(propValue);
|
|
if (iteratorFn) {
|
|
var iterator = iteratorFn.call(propValue);
|
|
var step;
|
|
if (iteratorFn !== propValue.entries) {
|
|
while (!(step = iterator.next()).done) {
|
|
if (!isNode(step.value)) {
|
|
return false;
|
|
}
|
|
}
|
|
} else {
|
|
// Iterator will provide entry [k,v] tuples rather than values.
|
|
while (!(step = iterator.next()).done) {
|
|
var entry = step.value;
|
|
if (entry) {
|
|
if (!isNode(entry[1])) {
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
default:
|
|
return false;
|
|
}
|
|
}
|
|
|
|
// Equivalent of `typeof` but with special handling for array and regexp.
|
|
function getPropType(propValue) {
|
|
var propType = typeof propValue;
|
|
if (Array.isArray(propValue)) {
|
|
return 'array';
|
|
}
|
|
if (propValue instanceof RegExp) {
|
|
// Old webkits (at least until Android 4.0) return 'function' rather than
|
|
// 'object' for typeof a RegExp. We'll normalize this here so that /bla/
|
|
// passes PropTypes.object.
|
|
return 'object';
|
|
}
|
|
return propType;
|
|
}
|
|
|
|
// This handles more types than `getPropType`. Only used for error messages.
|
|
// See `createPrimitiveTypeChecker`.
|
|
function getPreciseType(propValue) {
|
|
var propType = getPropType(propValue);
|
|
if (propType === 'object') {
|
|
if (propValue instanceof Date) {
|
|
return 'date';
|
|
} else if (propValue instanceof RegExp) {
|
|
return 'regexp';
|
|
}
|
|
}
|
|
return propType;
|
|
}
|
|
|
|
// Returns class name of the object, if any.
|
|
function getClassName(propValue) {
|
|
if (!propValue.constructor || !propValue.constructor.name) {
|
|
return '<<anonymous>>';
|
|
}
|
|
return propValue.constructor.name;
|
|
}
|
|
|
|
module.exports = ReactPropTypes;
|
|
|
|
/***/ },
|
|
/* 107 */
|
|
/***/ function(module, exports) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule getIteratorFn
|
|
* @typechecks static-only
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
/* global Symbol */
|
|
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
|
|
|
|
/**
|
|
* Returns the iterator method function contained on the iterable object.
|
|
*
|
|
* Be sure to invoke the function with the iterable as context:
|
|
*
|
|
* var iteratorFn = getIteratorFn(myIterable);
|
|
* if (iteratorFn) {
|
|
* var iterator = iteratorFn.call(myIterable);
|
|
* ...
|
|
* }
|
|
*
|
|
* @param {?object} maybeIterable
|
|
* @return {?function}
|
|
*/
|
|
function getIteratorFn(maybeIterable) {
|
|
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
|
if (typeof iteratorFn === 'function') {
|
|
return iteratorFn;
|
|
}
|
|
}
|
|
|
|
module.exports = getIteratorFn;
|
|
|
|
/***/ },
|
|
/* 108 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactDOMOption
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var ReactChildren = __webpack_require__(109);
|
|
var ReactDOMSelect = __webpack_require__(111);
|
|
|
|
var assign = __webpack_require__(38);
|
|
var warning = __webpack_require__(24);
|
|
|
|
var valueContextKey = ReactDOMSelect.valueContextKey;
|
|
|
|
/**
|
|
* Implements an <option> native component that warns when `selected` is set.
|
|
*/
|
|
var ReactDOMOption = {
|
|
mountWrapper: function (inst, props, context) {
|
|
// TODO (yungsters): Remove support for `selected` in <option>.
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
process.env.NODE_ENV !== 'production' ? warning(props.selected == null, 'Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.') : undefined;
|
|
}
|
|
|
|
// Look up whether this option is 'selected' via context
|
|
var selectValue = context[valueContextKey];
|
|
|
|
// If context key is null (e.g., no specified value or after initial mount)
|
|
// or missing (e.g., for <datalist>), we don't change props.selected
|
|
var selected = null;
|
|
if (selectValue != null) {
|
|
selected = false;
|
|
if (Array.isArray(selectValue)) {
|
|
// multiple
|
|
for (var i = 0; i < selectValue.length; i++) {
|
|
if ('' + selectValue[i] === '' + props.value) {
|
|
selected = true;
|
|
break;
|
|
}
|
|
}
|
|
} else {
|
|
selected = '' + selectValue === '' + props.value;
|
|
}
|
|
}
|
|
|
|
inst._wrapperState = { selected: selected };
|
|
},
|
|
|
|
getNativeProps: function (inst, props, context) {
|
|
var nativeProps = assign({ selected: undefined, children: undefined }, props);
|
|
|
|
// Read state only from initial mount because <select> updates value
|
|
// manually; we need the initial state only for server rendering
|
|
if (inst._wrapperState.selected != null) {
|
|
nativeProps.selected = inst._wrapperState.selected;
|
|
}
|
|
|
|
var content = '';
|
|
|
|
// Flatten children and warn if they aren't strings or numbers;
|
|
// invalid types are ignored.
|
|
ReactChildren.forEach(props.children, function (child) {
|
|
if (child == null) {
|
|
return;
|
|
}
|
|
if (typeof child === 'string' || typeof child === 'number') {
|
|
content += child;
|
|
} else {
|
|
process.env.NODE_ENV !== 'production' ? warning(false, 'Only strings and numbers are supported as <option> children.') : undefined;
|
|
}
|
|
});
|
|
|
|
if (content) {
|
|
nativeProps.children = content;
|
|
}
|
|
|
|
return nativeProps;
|
|
}
|
|
|
|
};
|
|
|
|
module.exports = ReactDOMOption;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 109 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactChildren
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var PooledClass = __webpack_require__(55);
|
|
var ReactElement = __webpack_require__(41);
|
|
|
|
var emptyFunction = __webpack_require__(14);
|
|
var traverseAllChildren = __webpack_require__(110);
|
|
|
|
var twoArgumentPooler = PooledClass.twoArgumentPooler;
|
|
var fourArgumentPooler = PooledClass.fourArgumentPooler;
|
|
|
|
var userProvidedKeyEscapeRegex = /\/(?!\/)/g;
|
|
function escapeUserProvidedKey(text) {
|
|
return ('' + text).replace(userProvidedKeyEscapeRegex, '//');
|
|
}
|
|
|
|
/**
|
|
* PooledClass representing the bookkeeping associated with performing a child
|
|
* traversal. Allows avoiding binding callbacks.
|
|
*
|
|
* @constructor ForEachBookKeeping
|
|
* @param {!function} forEachFunction Function to perform traversal with.
|
|
* @param {?*} forEachContext Context to perform context with.
|
|
*/
|
|
function ForEachBookKeeping(forEachFunction, forEachContext) {
|
|
this.func = forEachFunction;
|
|
this.context = forEachContext;
|
|
this.count = 0;
|
|
}
|
|
ForEachBookKeeping.prototype.destructor = function () {
|
|
this.func = null;
|
|
this.context = null;
|
|
this.count = 0;
|
|
};
|
|
PooledClass.addPoolingTo(ForEachBookKeeping, twoArgumentPooler);
|
|
|
|
function forEachSingleChild(bookKeeping, child, name) {
|
|
var func = bookKeeping.func;
|
|
var context = bookKeeping.context;
|
|
|
|
func.call(context, child, bookKeeping.count++);
|
|
}
|
|
|
|
/**
|
|
* Iterates through children that are typically specified as `props.children`.
|
|
*
|
|
* The provided forEachFunc(child, index) will be called for each
|
|
* leaf child.
|
|
*
|
|
* @param {?*} children Children tree container.
|
|
* @param {function(*, int)} forEachFunc
|
|
* @param {*} forEachContext Context for forEachContext.
|
|
*/
|
|
function forEachChildren(children, forEachFunc, forEachContext) {
|
|
if (children == null) {
|
|
return children;
|
|
}
|
|
var traverseContext = ForEachBookKeeping.getPooled(forEachFunc, forEachContext);
|
|
traverseAllChildren(children, forEachSingleChild, traverseContext);
|
|
ForEachBookKeeping.release(traverseContext);
|
|
}
|
|
|
|
/**
|
|
* PooledClass representing the bookkeeping associated with performing a child
|
|
* mapping. Allows avoiding binding callbacks.
|
|
*
|
|
* @constructor MapBookKeeping
|
|
* @param {!*} mapResult Object containing the ordered map of results.
|
|
* @param {!function} mapFunction Function to perform mapping with.
|
|
* @param {?*} mapContext Context to perform mapping with.
|
|
*/
|
|
function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) {
|
|
this.result = mapResult;
|
|
this.keyPrefix = keyPrefix;
|
|
this.func = mapFunction;
|
|
this.context = mapContext;
|
|
this.count = 0;
|
|
}
|
|
MapBookKeeping.prototype.destructor = function () {
|
|
this.result = null;
|
|
this.keyPrefix = null;
|
|
this.func = null;
|
|
this.context = null;
|
|
this.count = 0;
|
|
};
|
|
PooledClass.addPoolingTo(MapBookKeeping, fourArgumentPooler);
|
|
|
|
function mapSingleChildIntoContext(bookKeeping, child, childKey) {
|
|
var result = bookKeeping.result;
|
|
var keyPrefix = bookKeeping.keyPrefix;
|
|
var func = bookKeeping.func;
|
|
var context = bookKeeping.context;
|
|
|
|
var mappedChild = func.call(context, child, bookKeeping.count++);
|
|
if (Array.isArray(mappedChild)) {
|
|
mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument);
|
|
} else if (mappedChild != null) {
|
|
if (ReactElement.isValidElement(mappedChild)) {
|
|
mappedChild = ReactElement.cloneAndReplaceKey(mappedChild,
|
|
// Keep both the (mapped) and old keys if they differ, just as
|
|
// traverseAllChildren used to do for objects as children
|
|
keyPrefix + (mappedChild !== child ? escapeUserProvidedKey(mappedChild.key || '') + '/' : '') + childKey);
|
|
}
|
|
result.push(mappedChild);
|
|
}
|
|
}
|
|
|
|
function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
|
|
var escapedPrefix = '';
|
|
if (prefix != null) {
|
|
escapedPrefix = escapeUserProvidedKey(prefix) + '/';
|
|
}
|
|
var traverseContext = MapBookKeeping.getPooled(array, escapedPrefix, func, context);
|
|
traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
|
|
MapBookKeeping.release(traverseContext);
|
|
}
|
|
|
|
/**
|
|
* Maps children that are typically specified as `props.children`.
|
|
*
|
|
* The provided mapFunction(child, key, index) will be called for each
|
|
* leaf child.
|
|
*
|
|
* @param {?*} children Children tree container.
|
|
* @param {function(*, int)} func The map function.
|
|
* @param {*} context Context for mapFunction.
|
|
* @return {object} Object containing the ordered map of results.
|
|
*/
|
|
function mapChildren(children, func, context) {
|
|
if (children == null) {
|
|
return children;
|
|
}
|
|
var result = [];
|
|
mapIntoWithKeyPrefixInternal(children, result, null, func, context);
|
|
return result;
|
|
}
|
|
|
|
function forEachSingleChildDummy(traverseContext, child, name) {
|
|
return null;
|
|
}
|
|
|
|
/**
|
|
* Count the number of children that are typically specified as
|
|
* `props.children`.
|
|
*
|
|
* @param {?*} children Children tree container.
|
|
* @return {number} The number of children.
|
|
*/
|
|
function countChildren(children, context) {
|
|
return traverseAllChildren(children, forEachSingleChildDummy, null);
|
|
}
|
|
|
|
/**
|
|
* Flatten a children object (typically specified as `props.children`) and
|
|
* return an array with appropriately re-keyed children.
|
|
*/
|
|
function toArray(children) {
|
|
var result = [];
|
|
mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);
|
|
return result;
|
|
}
|
|
|
|
var ReactChildren = {
|
|
forEach: forEachChildren,
|
|
map: mapChildren,
|
|
mapIntoWithKeyPrefixInternal: mapIntoWithKeyPrefixInternal,
|
|
count: countChildren,
|
|
toArray: toArray
|
|
};
|
|
|
|
module.exports = ReactChildren;
|
|
|
|
/***/ },
|
|
/* 110 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule traverseAllChildren
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var ReactCurrentOwner = __webpack_require__(4);
|
|
var ReactElement = __webpack_require__(41);
|
|
var ReactInstanceHandles = __webpack_require__(44);
|
|
|
|
var getIteratorFn = __webpack_require__(107);
|
|
var invariant = __webpack_require__(12);
|
|
var warning = __webpack_require__(24);
|
|
|
|
var SEPARATOR = ReactInstanceHandles.SEPARATOR;
|
|
var SUBSEPARATOR = ':';
|
|
|
|
/**
|
|
* TODO: Test that a single child and an array with one item have the same key
|
|
* pattern.
|
|
*/
|
|
|
|
var userProvidedKeyEscaperLookup = {
|
|
'=': '=0',
|
|
'.': '=1',
|
|
':': '=2'
|
|
};
|
|
|
|
var userProvidedKeyEscapeRegex = /[=.:]/g;
|
|
|
|
var didWarnAboutMaps = false;
|
|
|
|
function userProvidedKeyEscaper(match) {
|
|
return userProvidedKeyEscaperLookup[match];
|
|
}
|
|
|
|
/**
|
|
* Generate a key string that identifies a component within a set.
|
|
*
|
|
* @param {*} component A component that could contain a manual key.
|
|
* @param {number} index Index that is used if a manual key is not provided.
|
|
* @return {string}
|
|
*/
|
|
function getComponentKey(component, index) {
|
|
if (component && component.key != null) {
|
|
// Explicit key
|
|
return wrapUserProvidedKey(component.key);
|
|
}
|
|
// Implicit key determined by the index in the set
|
|
return index.toString(36);
|
|
}
|
|
|
|
/**
|
|
* Escape a component key so that it is safe to use in a reactid.
|
|
*
|
|
* @param {*} text Component key to be escaped.
|
|
* @return {string} An escaped string.
|
|
*/
|
|
function escapeUserProvidedKey(text) {
|
|
return ('' + text).replace(userProvidedKeyEscapeRegex, userProvidedKeyEscaper);
|
|
}
|
|
|
|
/**
|
|
* Wrap a `key` value explicitly provided by the user to distinguish it from
|
|
* implicitly-generated keys generated by a component's index in its parent.
|
|
*
|
|
* @param {string} key Value of a user-provided `key` attribute
|
|
* @return {string}
|
|
*/
|
|
function wrapUserProvidedKey(key) {
|
|
return '$' + escapeUserProvidedKey(key);
|
|
}
|
|
|
|
/**
|
|
* @param {?*} children Children tree container.
|
|
* @param {!string} nameSoFar Name of the key path so far.
|
|
* @param {!function} callback Callback to invoke with each child found.
|
|
* @param {?*} traverseContext Used to pass information throughout the traversal
|
|
* process.
|
|
* @return {!number} The number of children in this subtree.
|
|
*/
|
|
function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
|
|
var type = typeof children;
|
|
|
|
if (type === 'undefined' || type === 'boolean') {
|
|
// All of the above are perceived as null.
|
|
children = null;
|
|
}
|
|
|
|
if (children === null || type === 'string' || type === 'number' || ReactElement.isValidElement(children)) {
|
|
callback(traverseContext, children,
|
|
// If it's the only child, treat the name as if it was wrapped in an array
|
|
// so that it's consistent if the number of children grows.
|
|
nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
|
|
return 1;
|
|
}
|
|
|
|
var child;
|
|
var nextName;
|
|
var subtreeCount = 0; // Count of children found in the current subtree.
|
|
var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
|
|
|
|
if (Array.isArray(children)) {
|
|
for (var i = 0; i < children.length; i++) {
|
|
child = children[i];
|
|
nextName = nextNamePrefix + getComponentKey(child, i);
|
|
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
|
|
}
|
|
} else {
|
|
var iteratorFn = getIteratorFn(children);
|
|
if (iteratorFn) {
|
|
var iterator = iteratorFn.call(children);
|
|
var step;
|
|
if (iteratorFn !== children.entries) {
|
|
var ii = 0;
|
|
while (!(step = iterator.next()).done) {
|
|
child = step.value;
|
|
nextName = nextNamePrefix + getComponentKey(child, ii++);
|
|
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
|
|
}
|
|
} else {
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
process.env.NODE_ENV !== 'production' ? warning(didWarnAboutMaps, 'Using Maps as children is not yet fully supported. It is an ' + 'experimental feature that might be removed. Convert it to a ' + 'sequence / iterable of keyed ReactElements instead.') : undefined;
|
|
didWarnAboutMaps = true;
|
|
}
|
|
// Iterator will provide entry [k,v] tuples rather than values.
|
|
while (!(step = iterator.next()).done) {
|
|
var entry = step.value;
|
|
if (entry) {
|
|
child = entry[1];
|
|
nextName = nextNamePrefix + wrapUserProvidedKey(entry[0]) + SUBSEPARATOR + getComponentKey(child, 0);
|
|
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
|
|
}
|
|
}
|
|
}
|
|
} else if (type === 'object') {
|
|
var addendum = '';
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
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.';
|
|
if (children._isReactElement) {
|
|
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.';
|
|
}
|
|
if (ReactCurrentOwner.current) {
|
|
var name = ReactCurrentOwner.current.getName();
|
|
if (name) {
|
|
addendum += ' Check the render method of `' + name + '`.';
|
|
}
|
|
}
|
|
}
|
|
var childrenString = String(children);
|
|
true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : invariant(false) : undefined;
|
|
}
|
|
}
|
|
|
|
return subtreeCount;
|
|
}
|
|
|
|
/**
|
|
* Traverses children that are typically specified as `props.children`, but
|
|
* might also be specified through attributes:
|
|
*
|
|
* - `traverseAllChildren(this.props.children, ...)`
|
|
* - `traverseAllChildren(this.props.leftPanelChildren, ...)`
|
|
*
|
|
* The `traverseContext` is an optional argument that is passed through the
|
|
* entire traversal. It can be used to store accumulations or anything else that
|
|
* the callback might find relevant.
|
|
*
|
|
* @param {?*} children Children tree object.
|
|
* @param {!function} callback To invoke upon traversing each child.
|
|
* @param {?*} traverseContext Context for traversal.
|
|
* @return {!number} The number of children in this subtree.
|
|
*/
|
|
function traverseAllChildren(children, callback, traverseContext) {
|
|
if (children == null) {
|
|
return 0;
|
|
}
|
|
|
|
return traverseAllChildrenImpl(children, '', callback, traverseContext);
|
|
}
|
|
|
|
module.exports = traverseAllChildren;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 111 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactDOMSelect
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var LinkedValueUtils = __webpack_require__(105);
|
|
var ReactMount = __webpack_require__(27);
|
|
var ReactUpdates = __webpack_require__(53);
|
|
|
|
var assign = __webpack_require__(38);
|
|
var warning = __webpack_require__(24);
|
|
|
|
var valueContextKey = '__ReactDOMSelect_value$' + Math.random().toString(36).slice(2);
|
|
|
|
function updateOptionsIfPendingUpdateAndMounted() {
|
|
if (this._rootNodeID && this._wrapperState.pendingUpdate) {
|
|
this._wrapperState.pendingUpdate = false;
|
|
|
|
var props = this._currentElement.props;
|
|
var value = LinkedValueUtils.getValue(props);
|
|
|
|
if (value != null) {
|
|
updateOptions(this, Boolean(props.multiple), value);
|
|
}
|
|
}
|
|
}
|
|
|
|
function getDeclarationErrorAddendum(owner) {
|
|
if (owner) {
|
|
var name = owner.getName();
|
|
if (name) {
|
|
return ' Check the render method of `' + name + '`.';
|
|
}
|
|
}
|
|
return '';
|
|
}
|
|
|
|
var valuePropNames = ['value', 'defaultValue'];
|
|
|
|
/**
|
|
* Validation function for `value` and `defaultValue`.
|
|
* @private
|
|
*/
|
|
function checkSelectPropTypes(inst, props) {
|
|
var owner = inst._currentElement._owner;
|
|
LinkedValueUtils.checkPropTypes('select', props, owner);
|
|
|
|
for (var i = 0; i < valuePropNames.length; i++) {
|
|
var propName = valuePropNames[i];
|
|
if (props[propName] == null) {
|
|
continue;
|
|
}
|
|
if (props.multiple) {
|
|
process.env.NODE_ENV !== 'production' ? warning(Array.isArray(props[propName]), 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : undefined;
|
|
} else {
|
|
process.env.NODE_ENV !== 'production' ? warning(!Array.isArray(props[propName]), 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : undefined;
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
* @param {ReactDOMComponent} inst
|
|
* @param {boolean} multiple
|
|
* @param {*} propValue A stringable (with `multiple`, a list of stringables).
|
|
* @private
|
|
*/
|
|
function updateOptions(inst, multiple, propValue) {
|
|
var selectedValue, i;
|
|
var options = ReactMount.getNode(inst._rootNodeID).options;
|
|
|
|
if (multiple) {
|
|
selectedValue = {};
|
|
for (i = 0; i < propValue.length; i++) {
|
|
selectedValue['' + propValue[i]] = true;
|
|
}
|
|
for (i = 0; i < options.length; i++) {
|
|
var selected = selectedValue.hasOwnProperty(options[i].value);
|
|
if (options[i].selected !== selected) {
|
|
options[i].selected = selected;
|
|
}
|
|
}
|
|
} else {
|
|
// Do not set `select.value` as exact behavior isn't consistent across all
|
|
// browsers for all cases.
|
|
selectedValue = '' + propValue;
|
|
for (i = 0; i < options.length; i++) {
|
|
if (options[i].value === selectedValue) {
|
|
options[i].selected = true;
|
|
return;
|
|
}
|
|
}
|
|
if (options.length) {
|
|
options[0].selected = true;
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Implements a <select> native component that allows optionally setting the
|
|
* props `value` and `defaultValue`. If `multiple` is false, the prop must be a
|
|
* stringable. If `multiple` is true, the prop must be an array of stringables.
|
|
*
|
|
* If `value` is not supplied (or null/undefined), user actions that change the
|
|
* selected option will trigger updates to the rendered options.
|
|
*
|
|
* If it is supplied (and not null/undefined), the rendered options will not
|
|
* update in response to user actions. Instead, the `value` prop must change in
|
|
* order for the rendered options to update.
|
|
*
|
|
* If `defaultValue` is provided, any options with the supplied values will be
|
|
* selected.
|
|
*/
|
|
var ReactDOMSelect = {
|
|
valueContextKey: valueContextKey,
|
|
|
|
getNativeProps: function (inst, props, context) {
|
|
return assign({}, props, {
|
|
onChange: inst._wrapperState.onChange,
|
|
value: undefined
|
|
});
|
|
},
|
|
|
|
mountWrapper: function (inst, props) {
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
checkSelectPropTypes(inst, props);
|
|
}
|
|
|
|
var value = LinkedValueUtils.getValue(props);
|
|
inst._wrapperState = {
|
|
pendingUpdate: false,
|
|
initialValue: value != null ? value : props.defaultValue,
|
|
onChange: _handleChange.bind(inst),
|
|
wasMultiple: Boolean(props.multiple)
|
|
};
|
|
},
|
|
|
|
processChildContext: function (inst, props, context) {
|
|
// Pass down initial value so initial generated markup has correct
|
|
// `selected` attributes
|
|
var childContext = assign({}, context);
|
|
childContext[valueContextKey] = inst._wrapperState.initialValue;
|
|
return childContext;
|
|
},
|
|
|
|
postUpdateWrapper: function (inst) {
|
|
var props = inst._currentElement.props;
|
|
|
|
// After the initial mount, we control selected-ness manually so don't pass
|
|
// the context value down
|
|
inst._wrapperState.initialValue = undefined;
|
|
|
|
var wasMultiple = inst._wrapperState.wasMultiple;
|
|
inst._wrapperState.wasMultiple = Boolean(props.multiple);
|
|
|
|
var value = LinkedValueUtils.getValue(props);
|
|
if (value != null) {
|
|
inst._wrapperState.pendingUpdate = false;
|
|
updateOptions(inst, Boolean(props.multiple), value);
|
|
} else if (wasMultiple !== Boolean(props.multiple)) {
|
|
// For simplicity, reapply `defaultValue` if `multiple` is toggled.
|
|
if (props.defaultValue != null) {
|
|
updateOptions(inst, Boolean(props.multiple), props.defaultValue);
|
|
} else {
|
|
// Revert the select back to its default unselected state.
|
|
updateOptions(inst, Boolean(props.multiple), props.multiple ? [] : '');
|
|
}
|
|
}
|
|
}
|
|
};
|
|
|
|
function _handleChange(event) {
|
|
var props = this._currentElement.props;
|
|
var returnValue = LinkedValueUtils.executeOnChange(props, event);
|
|
|
|
this._wrapperState.pendingUpdate = true;
|
|
ReactUpdates.asap(updateOptionsIfPendingUpdateAndMounted, this);
|
|
return returnValue;
|
|
}
|
|
|
|
module.exports = ReactDOMSelect;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 112 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactDOMTextarea
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var LinkedValueUtils = __webpack_require__(105);
|
|
var ReactDOMIDOperations = __webpack_require__(26);
|
|
var ReactUpdates = __webpack_require__(53);
|
|
|
|
var assign = __webpack_require__(38);
|
|
var invariant = __webpack_require__(12);
|
|
var warning = __webpack_require__(24);
|
|
|
|
function forceUpdateIfMounted() {
|
|
if (this._rootNodeID) {
|
|
// DOM component is still mounted; update
|
|
ReactDOMTextarea.updateWrapper(this);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Implements a <textarea> native component that allows setting `value`, and
|
|
* `defaultValue`. This differs from the traditional DOM API because value is
|
|
* usually set as PCDATA children.
|
|
*
|
|
* If `value` is not supplied (or null/undefined), user actions that affect the
|
|
* value will trigger updates to the element.
|
|
*
|
|
* If `value` is supplied (and not null/undefined), the rendered element will
|
|
* not trigger updates to the element. Instead, the `value` prop must change in
|
|
* order for the rendered element to be updated.
|
|
*
|
|
* The rendered element will be initialized with an empty value, the prop
|
|
* `defaultValue` if specified, or the children content (deprecated).
|
|
*/
|
|
var ReactDOMTextarea = {
|
|
getNativeProps: function (inst, props, context) {
|
|
!(props.dangerouslySetInnerHTML == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, '`dangerouslySetInnerHTML` does not make sense on <textarea>.') : invariant(false) : undefined;
|
|
|
|
// Always set children to the same thing. In IE9, the selection range will
|
|
// get reset if `textContent` is mutated.
|
|
var nativeProps = assign({}, props, {
|
|
defaultValue: undefined,
|
|
value: undefined,
|
|
children: inst._wrapperState.initialValue,
|
|
onChange: inst._wrapperState.onChange
|
|
});
|
|
|
|
return nativeProps;
|
|
},
|
|
|
|
mountWrapper: function (inst, props) {
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
LinkedValueUtils.checkPropTypes('textarea', props, inst._currentElement._owner);
|
|
}
|
|
|
|
var defaultValue = props.defaultValue;
|
|
// TODO (yungsters): Remove support for children content in <textarea>.
|
|
var children = props.children;
|
|
if (children != null) {
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
process.env.NODE_ENV !== 'production' ? warning(false, 'Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.') : undefined;
|
|
}
|
|
!(defaultValue == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'If you supply `defaultValue` on a <textarea>, do not pass children.') : invariant(false) : undefined;
|
|
if (Array.isArray(children)) {
|
|
!(children.length <= 1) ? process.env.NODE_ENV !== 'production' ? invariant(false, '<textarea> can only have at most one child.') : invariant(false) : undefined;
|
|
children = children[0];
|
|
}
|
|
|
|
defaultValue = '' + children;
|
|
}
|
|
if (defaultValue == null) {
|
|
defaultValue = '';
|
|
}
|
|
var value = LinkedValueUtils.getValue(props);
|
|
|
|
inst._wrapperState = {
|
|
// We save the initial value so that `ReactDOMComponent` doesn't update
|
|
// `textContent` (unnecessary since we update value).
|
|
// The initial value can be a boolean or object so that's why it's
|
|
// forced to be a string.
|
|
initialValue: '' + (value != null ? value : defaultValue),
|
|
onChange: _handleChange.bind(inst)
|
|
};
|
|
},
|
|
|
|
updateWrapper: function (inst) {
|
|
var props = inst._currentElement.props;
|
|
var value = LinkedValueUtils.getValue(props);
|
|
if (value != null) {
|
|
// Cast `value` to a string to ensure the value is set correctly. While
|
|
// browsers typically do this as necessary, jsdom doesn't.
|
|
ReactDOMIDOperations.updatePropertyByID(inst._rootNodeID, 'value', '' + value);
|
|
}
|
|
}
|
|
};
|
|
|
|
function _handleChange(event) {
|
|
var props = this._currentElement.props;
|
|
var returnValue = LinkedValueUtils.executeOnChange(props, event);
|
|
ReactUpdates.asap(forceUpdateIfMounted, this);
|
|
return returnValue;
|
|
}
|
|
|
|
module.exports = ReactDOMTextarea;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 113 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactMultiChild
|
|
* @typechecks static-only
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var ReactComponentEnvironment = __webpack_require__(63);
|
|
var ReactMultiChildUpdateTypes = __webpack_require__(15);
|
|
|
|
var ReactCurrentOwner = __webpack_require__(4);
|
|
var ReactReconciler = __webpack_require__(49);
|
|
var ReactChildReconciler = __webpack_require__(114);
|
|
|
|
var flattenChildren = __webpack_require__(115);
|
|
|
|
/**
|
|
* Updating children of a component may trigger recursive updates. The depth is
|
|
* used to batch recursive updates to render markup more efficiently.
|
|
*
|
|
* @type {number}
|
|
* @private
|
|
*/
|
|
var updateDepth = 0;
|
|
|
|
/**
|
|
* Queue of update configuration objects.
|
|
*
|
|
* Each object has a `type` property that is in `ReactMultiChildUpdateTypes`.
|
|
*
|
|
* @type {array<object>}
|
|
* @private
|
|
*/
|
|
var updateQueue = [];
|
|
|
|
/**
|
|
* Queue of markup to be rendered.
|
|
*
|
|
* @type {array<string>}
|
|
* @private
|
|
*/
|
|
var markupQueue = [];
|
|
|
|
/**
|
|
* Enqueues markup to be rendered and inserted at a supplied index.
|
|
*
|
|
* @param {string} parentID ID of the parent component.
|
|
* @param {string} markup Markup that renders into an element.
|
|
* @param {number} toIndex Destination index.
|
|
* @private
|
|
*/
|
|
function enqueueInsertMarkup(parentID, markup, toIndex) {
|
|
// NOTE: Null values reduce hidden classes.
|
|
updateQueue.push({
|
|
parentID: parentID,
|
|
parentNode: null,
|
|
type: ReactMultiChildUpdateTypes.INSERT_MARKUP,
|
|
markupIndex: markupQueue.push(markup) - 1,
|
|
content: null,
|
|
fromIndex: null,
|
|
toIndex: toIndex
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Enqueues moving an existing element to another index.
|
|
*
|
|
* @param {string} parentID ID of the parent component.
|
|
* @param {number} fromIndex Source index of the existing element.
|
|
* @param {number} toIndex Destination index of the element.
|
|
* @private
|
|
*/
|
|
function enqueueMove(parentID, fromIndex, toIndex) {
|
|
// NOTE: Null values reduce hidden classes.
|
|
updateQueue.push({
|
|
parentID: parentID,
|
|
parentNode: null,
|
|
type: ReactMultiChildUpdateTypes.MOVE_EXISTING,
|
|
markupIndex: null,
|
|
content: null,
|
|
fromIndex: fromIndex,
|
|
toIndex: toIndex
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Enqueues removing an element at an index.
|
|
*
|
|
* @param {string} parentID ID of the parent component.
|
|
* @param {number} fromIndex Index of the element to remove.
|
|
* @private
|
|
*/
|
|
function enqueueRemove(parentID, fromIndex) {
|
|
// NOTE: Null values reduce hidden classes.
|
|
updateQueue.push({
|
|
parentID: parentID,
|
|
parentNode: null,
|
|
type: ReactMultiChildUpdateTypes.REMOVE_NODE,
|
|
markupIndex: null,
|
|
content: null,
|
|
fromIndex: fromIndex,
|
|
toIndex: null
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Enqueues setting the markup of a node.
|
|
*
|
|
* @param {string} parentID ID of the parent component.
|
|
* @param {string} markup Markup that renders into an element.
|
|
* @private
|
|
*/
|
|
function enqueueSetMarkup(parentID, markup) {
|
|
// NOTE: Null values reduce hidden classes.
|
|
updateQueue.push({
|
|
parentID: parentID,
|
|
parentNode: null,
|
|
type: ReactMultiChildUpdateTypes.SET_MARKUP,
|
|
markupIndex: null,
|
|
content: markup,
|
|
fromIndex: null,
|
|
toIndex: null
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Enqueues setting the text content.
|
|
*
|
|
* @param {string} parentID ID of the parent component.
|
|
* @param {string} textContent Text content to set.
|
|
* @private
|
|
*/
|
|
function enqueueTextContent(parentID, textContent) {
|
|
// NOTE: Null values reduce hidden classes.
|
|
updateQueue.push({
|
|
parentID: parentID,
|
|
parentNode: null,
|
|
type: ReactMultiChildUpdateTypes.TEXT_CONTENT,
|
|
markupIndex: null,
|
|
content: textContent,
|
|
fromIndex: null,
|
|
toIndex: null
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Processes any enqueued updates.
|
|
*
|
|
* @private
|
|
*/
|
|
function processQueue() {
|
|
if (updateQueue.length) {
|
|
ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);
|
|
clearQueue();
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Clears any enqueued updates.
|
|
*
|
|
* @private
|
|
*/
|
|
function clearQueue() {
|
|
updateQueue.length = 0;
|
|
markupQueue.length = 0;
|
|
}
|
|
|
|
/**
|
|
* ReactMultiChild are capable of reconciling multiple children.
|
|
*
|
|
* @class ReactMultiChild
|
|
* @internal
|
|
*/
|
|
var ReactMultiChild = {
|
|
|
|
/**
|
|
* Provides common functionality for components that must reconcile multiple
|
|
* children. This is used by `ReactDOMComponent` to mount, update, and
|
|
* unmount child components.
|
|
*
|
|
* @lends {ReactMultiChild.prototype}
|
|
*/
|
|
Mixin: {
|
|
|
|
_reconcilerInstantiateChildren: function (nestedChildren, transaction, context) {
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
if (this._currentElement) {
|
|
try {
|
|
ReactCurrentOwner.current = this._currentElement._owner;
|
|
return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context);
|
|
} finally {
|
|
ReactCurrentOwner.current = null;
|
|
}
|
|
}
|
|
}
|
|
return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context);
|
|
},
|
|
|
|
_reconcilerUpdateChildren: function (prevChildren, nextNestedChildrenElements, transaction, context) {
|
|
var nextChildren;
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
if (this._currentElement) {
|
|
try {
|
|
ReactCurrentOwner.current = this._currentElement._owner;
|
|
nextChildren = flattenChildren(nextNestedChildrenElements);
|
|
} finally {
|
|
ReactCurrentOwner.current = null;
|
|
}
|
|
return ReactChildReconciler.updateChildren(prevChildren, nextChildren, transaction, context);
|
|
}
|
|
}
|
|
nextChildren = flattenChildren(nextNestedChildrenElements);
|
|
return ReactChildReconciler.updateChildren(prevChildren, nextChildren, transaction, context);
|
|
},
|
|
|
|
/**
|
|
* Generates a "mount image" for each of the supplied children. In the case
|
|
* of `ReactDOMComponent`, a mount image is a string of markup.
|
|
*
|
|
* @param {?object} nestedChildren Nested child maps.
|
|
* @return {array} An array of mounted representations.
|
|
* @internal
|
|
*/
|
|
mountChildren: function (nestedChildren, transaction, context) {
|
|
var children = this._reconcilerInstantiateChildren(nestedChildren, transaction, context);
|
|
this._renderedChildren = children;
|
|
var mountImages = [];
|
|
var index = 0;
|
|
for (var name in children) {
|
|
if (children.hasOwnProperty(name)) {
|
|
var child = children[name];
|
|
// Inlined for performance, see `ReactInstanceHandles.createReactID`.
|
|
var rootID = this._rootNodeID + name;
|
|
var mountImage = ReactReconciler.mountComponent(child, rootID, transaction, context);
|
|
child._mountIndex = index++;
|
|
mountImages.push(mountImage);
|
|
}
|
|
}
|
|
return mountImages;
|
|
},
|
|
|
|
/**
|
|
* Replaces any rendered children with a text content string.
|
|
*
|
|
* @param {string} nextContent String of content.
|
|
* @internal
|
|
*/
|
|
updateTextContent: function (nextContent) {
|
|
updateDepth++;
|
|
var errorThrown = true;
|
|
try {
|
|
var prevChildren = this._renderedChildren;
|
|
// Remove any rendered children.
|
|
ReactChildReconciler.unmountChildren(prevChildren);
|
|
// TODO: The setTextContent operation should be enough
|
|
for (var name in prevChildren) {
|
|
if (prevChildren.hasOwnProperty(name)) {
|
|
this._unmountChild(prevChildren[name]);
|
|
}
|
|
}
|
|
// Set new text content.
|
|
this.setTextContent(nextContent);
|
|
errorThrown = false;
|
|
} finally {
|
|
updateDepth--;
|
|
if (!updateDepth) {
|
|
if (errorThrown) {
|
|
clearQueue();
|
|
} else {
|
|
processQueue();
|
|
}
|
|
}
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Replaces any rendered children with a markup string.
|
|
*
|
|
* @param {string} nextMarkup String of markup.
|
|
* @internal
|
|
*/
|
|
updateMarkup: function (nextMarkup) {
|
|
updateDepth++;
|
|
var errorThrown = true;
|
|
try {
|
|
var prevChildren = this._renderedChildren;
|
|
// Remove any rendered children.
|
|
ReactChildReconciler.unmountChildren(prevChildren);
|
|
for (var name in prevChildren) {
|
|
if (prevChildren.hasOwnProperty(name)) {
|
|
this._unmountChildByName(prevChildren[name], name);
|
|
}
|
|
}
|
|
this.setMarkup(nextMarkup);
|
|
errorThrown = false;
|
|
} finally {
|
|
updateDepth--;
|
|
if (!updateDepth) {
|
|
if (errorThrown) {
|
|
clearQueue();
|
|
} else {
|
|
processQueue();
|
|
}
|
|
}
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Updates the rendered children with new children.
|
|
*
|
|
* @param {?object} nextNestedChildrenElements Nested child element maps.
|
|
* @param {ReactReconcileTransaction} transaction
|
|
* @internal
|
|
*/
|
|
updateChildren: function (nextNestedChildrenElements, transaction, context) {
|
|
updateDepth++;
|
|
var errorThrown = true;
|
|
try {
|
|
this._updateChildren(nextNestedChildrenElements, transaction, context);
|
|
errorThrown = false;
|
|
} finally {
|
|
updateDepth--;
|
|
if (!updateDepth) {
|
|
if (errorThrown) {
|
|
clearQueue();
|
|
} else {
|
|
processQueue();
|
|
}
|
|
}
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Improve performance by isolating this hot code path from the try/catch
|
|
* block in `updateChildren`.
|
|
*
|
|
* @param {?object} nextNestedChildrenElements Nested child element maps.
|
|
* @param {ReactReconcileTransaction} transaction
|
|
* @final
|
|
* @protected
|
|
*/
|
|
_updateChildren: function (nextNestedChildrenElements, transaction, context) {
|
|
var prevChildren = this._renderedChildren;
|
|
var nextChildren = this._reconcilerUpdateChildren(prevChildren, nextNestedChildrenElements, transaction, context);
|
|
this._renderedChildren = nextChildren;
|
|
if (!nextChildren && !prevChildren) {
|
|
return;
|
|
}
|
|
var name;
|
|
// `nextIndex` will increment for each child in `nextChildren`, but
|
|
// `lastIndex` will be the last index visited in `prevChildren`.
|
|
var lastIndex = 0;
|
|
var nextIndex = 0;
|
|
for (name in nextChildren) {
|
|
if (!nextChildren.hasOwnProperty(name)) {
|
|
continue;
|
|
}
|
|
var prevChild = prevChildren && prevChildren[name];
|
|
var nextChild = nextChildren[name];
|
|
if (prevChild === nextChild) {
|
|
this.moveChild(prevChild, nextIndex, lastIndex);
|
|
lastIndex = Math.max(prevChild._mountIndex, lastIndex);
|
|
prevChild._mountIndex = nextIndex;
|
|
} else {
|
|
if (prevChild) {
|
|
// Update `lastIndex` before `_mountIndex` gets unset by unmounting.
|
|
lastIndex = Math.max(prevChild._mountIndex, lastIndex);
|
|
this._unmountChild(prevChild);
|
|
}
|
|
// The child must be instantiated before it's mounted.
|
|
this._mountChildByNameAtIndex(nextChild, name, nextIndex, transaction, context);
|
|
}
|
|
nextIndex++;
|
|
}
|
|
// Remove children that are no longer present.
|
|
for (name in prevChildren) {
|
|
if (prevChildren.hasOwnProperty(name) && !(nextChildren && nextChildren.hasOwnProperty(name))) {
|
|
this._unmountChild(prevChildren[name]);
|
|
}
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Unmounts all rendered children. This should be used to clean up children
|
|
* when this component is unmounted.
|
|
*
|
|
* @internal
|
|
*/
|
|
unmountChildren: function () {
|
|
var renderedChildren = this._renderedChildren;
|
|
ReactChildReconciler.unmountChildren(renderedChildren);
|
|
this._renderedChildren = null;
|
|
},
|
|
|
|
/**
|
|
* Moves a child component to the supplied index.
|
|
*
|
|
* @param {ReactComponent} child Component to move.
|
|
* @param {number} toIndex Destination index of the element.
|
|
* @param {number} lastIndex Last index visited of the siblings of `child`.
|
|
* @protected
|
|
*/
|
|
moveChild: function (child, toIndex, lastIndex) {
|
|
// If the index of `child` is less than `lastIndex`, then it needs to
|
|
// be moved. Otherwise, we do not need to move it because a child will be
|
|
// inserted or moved before `child`.
|
|
if (child._mountIndex < lastIndex) {
|
|
enqueueMove(this._rootNodeID, child._mountIndex, toIndex);
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Creates a child component.
|
|
*
|
|
* @param {ReactComponent} child Component to create.
|
|
* @param {string} mountImage Markup to insert.
|
|
* @protected
|
|
*/
|
|
createChild: function (child, mountImage) {
|
|
enqueueInsertMarkup(this._rootNodeID, mountImage, child._mountIndex);
|
|
},
|
|
|
|
/**
|
|
* Removes a child component.
|
|
*
|
|
* @param {ReactComponent} child Child to remove.
|
|
* @protected
|
|
*/
|
|
removeChild: function (child) {
|
|
enqueueRemove(this._rootNodeID, child._mountIndex);
|
|
},
|
|
|
|
/**
|
|
* Sets this text content string.
|
|
*
|
|
* @param {string} textContent Text content to set.
|
|
* @protected
|
|
*/
|
|
setTextContent: function (textContent) {
|
|
enqueueTextContent(this._rootNodeID, textContent);
|
|
},
|
|
|
|
/**
|
|
* Sets this markup string.
|
|
*
|
|
* @param {string} markup Markup to set.
|
|
* @protected
|
|
*/
|
|
setMarkup: function (markup) {
|
|
enqueueSetMarkup(this._rootNodeID, markup);
|
|
},
|
|
|
|
/**
|
|
* Mounts a child with the supplied name.
|
|
*
|
|
* NOTE: This is part of `updateChildren` and is here for readability.
|
|
*
|
|
* @param {ReactComponent} child Component to mount.
|
|
* @param {string} name Name of the child.
|
|
* @param {number} index Index at which to insert the child.
|
|
* @param {ReactReconcileTransaction} transaction
|
|
* @private
|
|
*/
|
|
_mountChildByNameAtIndex: function (child, name, index, transaction, context) {
|
|
// Inlined for performance, see `ReactInstanceHandles.createReactID`.
|
|
var rootID = this._rootNodeID + name;
|
|
var mountImage = ReactReconciler.mountComponent(child, rootID, transaction, context);
|
|
child._mountIndex = index;
|
|
this.createChild(child, mountImage);
|
|
},
|
|
|
|
/**
|
|
* Unmounts a rendered child.
|
|
*
|
|
* NOTE: This is part of `updateChildren` and is here for readability.
|
|
*
|
|
* @param {ReactComponent} child Component to unmount.
|
|
* @private
|
|
*/
|
|
_unmountChild: function (child) {
|
|
this.removeChild(child);
|
|
child._mountIndex = null;
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
module.exports = ReactMultiChild;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 114 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2014-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactChildReconciler
|
|
* @typechecks static-only
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var ReactReconciler = __webpack_require__(49);
|
|
|
|
var instantiateReactComponent = __webpack_require__(61);
|
|
var shouldUpdateReactComponent = __webpack_require__(66);
|
|
var traverseAllChildren = __webpack_require__(110);
|
|
var warning = __webpack_require__(24);
|
|
|
|
function instantiateChild(childInstances, child, name) {
|
|
// We found a component instance.
|
|
var keyUnique = childInstances[name] === undefined;
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
process.env.NODE_ENV !== 'production' ? warning(keyUnique, 'flattenChildren(...): Encountered two children with the same key, ' + '`%s`. Child keys must be unique; when two children share a key, only ' + 'the first child will be used.', name) : undefined;
|
|
}
|
|
if (child != null && keyUnique) {
|
|
childInstances[name] = instantiateReactComponent(child, null);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* ReactChildReconciler provides helpers for initializing or updating a set of
|
|
* children. Its output is suitable for passing it onto ReactMultiChild which
|
|
* does diffed reordering and insertion.
|
|
*/
|
|
var ReactChildReconciler = {
|
|
/**
|
|
* Generates a "mount image" for each of the supplied children. In the case
|
|
* of `ReactDOMComponent`, a mount image is a string of markup.
|
|
*
|
|
* @param {?object} nestedChildNodes Nested child maps.
|
|
* @return {?object} A set of child instances.
|
|
* @internal
|
|
*/
|
|
instantiateChildren: function (nestedChildNodes, transaction, context) {
|
|
if (nestedChildNodes == null) {
|
|
return null;
|
|
}
|
|
var childInstances = {};
|
|
traverseAllChildren(nestedChildNodes, instantiateChild, childInstances);
|
|
return childInstances;
|
|
},
|
|
|
|
/**
|
|
* Updates the rendered children and returns a new set of children.
|
|
*
|
|
* @param {?object} prevChildren Previously initialized set of children.
|
|
* @param {?object} nextChildren Flat child element maps.
|
|
* @param {ReactReconcileTransaction} transaction
|
|
* @param {object} context
|
|
* @return {?object} A new set of child instances.
|
|
* @internal
|
|
*/
|
|
updateChildren: function (prevChildren, nextChildren, transaction, context) {
|
|
// We currently don't have a way to track moves here but if we use iterators
|
|
// instead of for..in we can zip the iterators and check if an item has
|
|
// moved.
|
|
// TODO: If nothing has changed, return the prevChildren object so that we
|
|
// can quickly bailout if nothing has changed.
|
|
if (!nextChildren && !prevChildren) {
|
|
return null;
|
|
}
|
|
var name;
|
|
for (name in nextChildren) {
|
|
if (!nextChildren.hasOwnProperty(name)) {
|
|
continue;
|
|
}
|
|
var prevChild = prevChildren && prevChildren[name];
|
|
var prevElement = prevChild && prevChild._currentElement;
|
|
var nextElement = nextChildren[name];
|
|
if (prevChild != null && shouldUpdateReactComponent(prevElement, nextElement)) {
|
|
ReactReconciler.receiveComponent(prevChild, nextElement, transaction, context);
|
|
nextChildren[name] = prevChild;
|
|
} else {
|
|
if (prevChild) {
|
|
ReactReconciler.unmountComponent(prevChild, name);
|
|
}
|
|
// The child must be instantiated before it's mounted.
|
|
var nextChildInstance = instantiateReactComponent(nextElement, null);
|
|
nextChildren[name] = nextChildInstance;
|
|
}
|
|
}
|
|
// Unmount children that are no longer present.
|
|
for (name in prevChildren) {
|
|
if (prevChildren.hasOwnProperty(name) && !(nextChildren && nextChildren.hasOwnProperty(name))) {
|
|
ReactReconciler.unmountComponent(prevChildren[name]);
|
|
}
|
|
}
|
|
return nextChildren;
|
|
},
|
|
|
|
/**
|
|
* Unmounts all rendered children. This should be used to clean up children
|
|
* when this component is unmounted.
|
|
*
|
|
* @param {?object} renderedChildren Previously initialized set of children.
|
|
* @internal
|
|
*/
|
|
unmountChildren: function (renderedChildren) {
|
|
for (var name in renderedChildren) {
|
|
if (renderedChildren.hasOwnProperty(name)) {
|
|
var renderedChild = renderedChildren[name];
|
|
ReactReconciler.unmountComponent(renderedChild);
|
|
}
|
|
}
|
|
}
|
|
|
|
};
|
|
|
|
module.exports = ReactChildReconciler;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 115 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule flattenChildren
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var traverseAllChildren = __webpack_require__(110);
|
|
var warning = __webpack_require__(24);
|
|
|
|
/**
|
|
* @param {function} traverseContext Context passed through traversal.
|
|
* @param {?ReactComponent} child React child component.
|
|
* @param {!string} name String name of key path to child.
|
|
*/
|
|
function flattenSingleChildIntoContext(traverseContext, child, name) {
|
|
// We found a component instance.
|
|
var result = traverseContext;
|
|
var keyUnique = result[name] === undefined;
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
process.env.NODE_ENV !== 'production' ? warning(keyUnique, 'flattenChildren(...): Encountered two children with the same key, ' + '`%s`. Child keys must be unique; when two children share a key, only ' + 'the first child will be used.', name) : undefined;
|
|
}
|
|
if (keyUnique && child != null) {
|
|
result[name] = child;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Flattens children that are typically specified as `props.children`. Any null
|
|
* children will not be included in the resulting object.
|
|
* @return {!object} flattened children keyed by name.
|
|
*/
|
|
function flattenChildren(children) {
|
|
if (children == null) {
|
|
return children;
|
|
}
|
|
var result = {};
|
|
traverseAllChildren(children, flattenSingleChildIntoContext, result);
|
|
return result;
|
|
}
|
|
|
|
module.exports = flattenChildren;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 116 */
|
|
/***/ function(module, exports) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule shallowEqual
|
|
* @typechecks
|
|
*
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
|
|
/**
|
|
* Performs equality by iterating through keys on an object and returning false
|
|
* when any key has values which are not strictly equal between the arguments.
|
|
* Returns true when the values of all keys are strictly equal.
|
|
*/
|
|
function shallowEqual(objA, objB) {
|
|
if (objA === objB) {
|
|
return true;
|
|
}
|
|
|
|
if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
|
|
return false;
|
|
}
|
|
|
|
var keysA = Object.keys(objA);
|
|
var keysB = Object.keys(objB);
|
|
|
|
if (keysA.length !== keysB.length) {
|
|
return false;
|
|
}
|
|
|
|
// Test for A's keys different from B.
|
|
var bHasOwnProperty = hasOwnProperty.bind(objB);
|
|
for (var i = 0; i < keysA.length; i++) {
|
|
if (!bHasOwnProperty(keysA[i]) || objA[keysA[i]] !== objB[keysA[i]]) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
module.exports = shallowEqual;
|
|
|
|
/***/ },
|
|
/* 117 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactEventListener
|
|
* @typechecks static-only
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var EventListener = __webpack_require__(118);
|
|
var ExecutionEnvironment = __webpack_require__(8);
|
|
var PooledClass = __webpack_require__(55);
|
|
var ReactInstanceHandles = __webpack_require__(44);
|
|
var ReactMount = __webpack_require__(27);
|
|
var ReactUpdates = __webpack_require__(53);
|
|
|
|
var assign = __webpack_require__(38);
|
|
var getEventTarget = __webpack_require__(80);
|
|
var getUnboundedScrollPosition = __webpack_require__(119);
|
|
|
|
var DOCUMENT_FRAGMENT_NODE_TYPE = 11;
|
|
|
|
/**
|
|
* Finds the parent React component of `node`.
|
|
*
|
|
* @param {*} node
|
|
* @return {?DOMEventTarget} Parent container, or `null` if the specified node
|
|
* is not nested.
|
|
*/
|
|
function findParent(node) {
|
|
// TODO: It may be a good idea to cache this to prevent unnecessary DOM
|
|
// traversal, but caching is difficult to do correctly without using a
|
|
// mutation observer to listen for all DOM changes.
|
|
var nodeID = ReactMount.getID(node);
|
|
var rootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);
|
|
var container = ReactMount.findReactContainerForID(rootID);
|
|
var parent = ReactMount.getFirstReactDOM(container);
|
|
return parent;
|
|
}
|
|
|
|
// Used to store ancestor hierarchy in top level callback
|
|
function TopLevelCallbackBookKeeping(topLevelType, nativeEvent) {
|
|
this.topLevelType = topLevelType;
|
|
this.nativeEvent = nativeEvent;
|
|
this.ancestors = [];
|
|
}
|
|
assign(TopLevelCallbackBookKeeping.prototype, {
|
|
destructor: function () {
|
|
this.topLevelType = null;
|
|
this.nativeEvent = null;
|
|
this.ancestors.length = 0;
|
|
}
|
|
});
|
|
PooledClass.addPoolingTo(TopLevelCallbackBookKeeping, PooledClass.twoArgumentPooler);
|
|
|
|
function handleTopLevelImpl(bookKeeping) {
|
|
// TODO: Re-enable event.path handling
|
|
//
|
|
// if (bookKeeping.nativeEvent.path && bookKeeping.nativeEvent.path.length > 1) {
|
|
// // New browsers have a path attribute on native events
|
|
// handleTopLevelWithPath(bookKeeping);
|
|
// } else {
|
|
// // Legacy browsers don't have a path attribute on native events
|
|
// handleTopLevelWithoutPath(bookKeeping);
|
|
// }
|
|
|
|
void handleTopLevelWithPath; // temporarily unused
|
|
handleTopLevelWithoutPath(bookKeeping);
|
|
}
|
|
|
|
// Legacy browsers don't have a path attribute on native events
|
|
function handleTopLevelWithoutPath(bookKeeping) {
|
|
var topLevelTarget = ReactMount.getFirstReactDOM(getEventTarget(bookKeeping.nativeEvent)) || window;
|
|
|
|
// Loop through the hierarchy, in case there's any nested components.
|
|
// It's important that we build the array of ancestors before calling any
|
|
// event handlers, because event handlers can modify the DOM, leading to
|
|
// inconsistencies with ReactMount's node cache. See #1105.
|
|
var ancestor = topLevelTarget;
|
|
while (ancestor) {
|
|
bookKeeping.ancestors.push(ancestor);
|
|
ancestor = findParent(ancestor);
|
|
}
|
|
|
|
for (var i = 0; i < bookKeeping.ancestors.length; i++) {
|
|
topLevelTarget = bookKeeping.ancestors[i];
|
|
var topLevelTargetID = ReactMount.getID(topLevelTarget) || '';
|
|
ReactEventListener._handleTopLevel(bookKeeping.topLevelType, topLevelTarget, topLevelTargetID, bookKeeping.nativeEvent, getEventTarget(bookKeeping.nativeEvent));
|
|
}
|
|
}
|
|
|
|
// New browsers have a path attribute on native events
|
|
function handleTopLevelWithPath(bookKeeping) {
|
|
var path = bookKeeping.nativeEvent.path;
|
|
var currentNativeTarget = path[0];
|
|
var eventsFired = 0;
|
|
for (var i = 0; i < path.length; i++) {
|
|
var currentPathElement = path[i];
|
|
if (currentPathElement.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE) {
|
|
currentNativeTarget = path[i + 1];
|
|
}
|
|
// TODO: slow
|
|
var reactParent = ReactMount.getFirstReactDOM(currentPathElement);
|
|
if (reactParent === currentPathElement) {
|
|
var currentPathElementID = ReactMount.getID(currentPathElement);
|
|
var newRootID = ReactInstanceHandles.getReactRootIDFromNodeID(currentPathElementID);
|
|
bookKeeping.ancestors.push(currentPathElement);
|
|
|
|
var topLevelTargetID = ReactMount.getID(currentPathElement) || '';
|
|
eventsFired++;
|
|
ReactEventListener._handleTopLevel(bookKeeping.topLevelType, currentPathElement, topLevelTargetID, bookKeeping.nativeEvent, currentNativeTarget);
|
|
|
|
// Jump to the root of this React render tree
|
|
while (currentPathElementID !== newRootID) {
|
|
i++;
|
|
currentPathElement = path[i];
|
|
currentPathElementID = ReactMount.getID(currentPathElement);
|
|
}
|
|
}
|
|
}
|
|
if (eventsFired === 0) {
|
|
ReactEventListener._handleTopLevel(bookKeeping.topLevelType, window, '', bookKeeping.nativeEvent, getEventTarget(bookKeeping.nativeEvent));
|
|
}
|
|
}
|
|
|
|
function scrollValueMonitor(cb) {
|
|
var scrollPosition = getUnboundedScrollPosition(window);
|
|
cb(scrollPosition);
|
|
}
|
|
|
|
var ReactEventListener = {
|
|
_enabled: true,
|
|
_handleTopLevel: null,
|
|
|
|
WINDOW_HANDLE: ExecutionEnvironment.canUseDOM ? window : null,
|
|
|
|
setHandleTopLevel: function (handleTopLevel) {
|
|
ReactEventListener._handleTopLevel = handleTopLevel;
|
|
},
|
|
|
|
setEnabled: function (enabled) {
|
|
ReactEventListener._enabled = !!enabled;
|
|
},
|
|
|
|
isEnabled: function () {
|
|
return ReactEventListener._enabled;
|
|
},
|
|
|
|
/**
|
|
* Traps top-level events by using event bubbling.
|
|
*
|
|
* @param {string} topLevelType Record from `EventConstants`.
|
|
* @param {string} handlerBaseName Event name (e.g. "click").
|
|
* @param {object} handle Element on which to attach listener.
|
|
* @return {?object} An object with a remove function which will forcefully
|
|
* remove the listener.
|
|
* @internal
|
|
*/
|
|
trapBubbledEvent: function (topLevelType, handlerBaseName, handle) {
|
|
var element = handle;
|
|
if (!element) {
|
|
return null;
|
|
}
|
|
return EventListener.listen(element, handlerBaseName, ReactEventListener.dispatchEvent.bind(null, topLevelType));
|
|
},
|
|
|
|
/**
|
|
* Traps a top-level event by using event capturing.
|
|
*
|
|
* @param {string} topLevelType Record from `EventConstants`.
|
|
* @param {string} handlerBaseName Event name (e.g. "click").
|
|
* @param {object} handle Element on which to attach listener.
|
|
* @return {?object} An object with a remove function which will forcefully
|
|
* remove the listener.
|
|
* @internal
|
|
*/
|
|
trapCapturedEvent: function (topLevelType, handlerBaseName, handle) {
|
|
var element = handle;
|
|
if (!element) {
|
|
return null;
|
|
}
|
|
return EventListener.capture(element, handlerBaseName, ReactEventListener.dispatchEvent.bind(null, topLevelType));
|
|
},
|
|
|
|
monitorScrollValue: function (refresh) {
|
|
var callback = scrollValueMonitor.bind(null, refresh);
|
|
EventListener.listen(window, 'scroll', callback);
|
|
},
|
|
|
|
dispatchEvent: function (topLevelType, nativeEvent) {
|
|
if (!ReactEventListener._enabled) {
|
|
return;
|
|
}
|
|
|
|
var bookKeeping = TopLevelCallbackBookKeeping.getPooled(topLevelType, nativeEvent);
|
|
try {
|
|
// Event queue being processed in the same cycle allows
|
|
// `preventDefault`.
|
|
ReactUpdates.batchedUpdates(handleTopLevelImpl, bookKeeping);
|
|
} finally {
|
|
TopLevelCallbackBookKeeping.release(bookKeeping);
|
|
}
|
|
}
|
|
};
|
|
|
|
module.exports = ReactEventListener;
|
|
|
|
/***/ },
|
|
/* 118 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*
|
|
* @providesModule EventListener
|
|
* @typechecks
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var emptyFunction = __webpack_require__(14);
|
|
|
|
/**
|
|
* Upstream version of event listener. Does not take into account specific
|
|
* nature of platform.
|
|
*/
|
|
var EventListener = {
|
|
/**
|
|
* Listen to DOM events during the bubble phase.
|
|
*
|
|
* @param {DOMEventTarget} target DOM element to register listener on.
|
|
* @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
|
|
* @param {function} callback Callback function.
|
|
* @return {object} Object with a `remove` method.
|
|
*/
|
|
listen: function (target, eventType, callback) {
|
|
if (target.addEventListener) {
|
|
target.addEventListener(eventType, callback, false);
|
|
return {
|
|
remove: function () {
|
|
target.removeEventListener(eventType, callback, false);
|
|
}
|
|
};
|
|
} else if (target.attachEvent) {
|
|
target.attachEvent('on' + eventType, callback);
|
|
return {
|
|
remove: function () {
|
|
target.detachEvent('on' + eventType, callback);
|
|
}
|
|
};
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Listen to DOM events during the capture phase.
|
|
*
|
|
* @param {DOMEventTarget} target DOM element to register listener on.
|
|
* @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
|
|
* @param {function} callback Callback function.
|
|
* @return {object} Object with a `remove` method.
|
|
*/
|
|
capture: function (target, eventType, callback) {
|
|
if (target.addEventListener) {
|
|
target.addEventListener(eventType, callback, true);
|
|
return {
|
|
remove: function () {
|
|
target.removeEventListener(eventType, callback, true);
|
|
}
|
|
};
|
|
} else {
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
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.');
|
|
}
|
|
return {
|
|
remove: emptyFunction
|
|
};
|
|
}
|
|
},
|
|
|
|
registerDefault: function () {}
|
|
};
|
|
|
|
module.exports = EventListener;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 119 */
|
|
/***/ function(module, exports) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule getUnboundedScrollPosition
|
|
* @typechecks
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
/**
|
|
* Gets the scroll position of the supplied element or window.
|
|
*
|
|
* The return values are unbounded, unlike `getScrollPosition`. This means they
|
|
* may be negative or exceed the element boundaries (which is possible using
|
|
* inertial scrolling).
|
|
*
|
|
* @param {DOMWindow|DOMElement} scrollable
|
|
* @return {object} Map with `x` and `y` keys.
|
|
*/
|
|
function getUnboundedScrollPosition(scrollable) {
|
|
if (scrollable === window) {
|
|
return {
|
|
x: window.pageXOffset || document.documentElement.scrollLeft,
|
|
y: window.pageYOffset || document.documentElement.scrollTop
|
|
};
|
|
}
|
|
return {
|
|
x: scrollable.scrollLeft,
|
|
y: scrollable.scrollTop
|
|
};
|
|
}
|
|
|
|
module.exports = getUnboundedScrollPosition;
|
|
|
|
/***/ },
|
|
/* 120 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactInjection
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var DOMProperty = __webpack_require__(22);
|
|
var EventPluginHub = __webpack_require__(30);
|
|
var ReactComponentEnvironment = __webpack_require__(63);
|
|
var ReactClass = __webpack_require__(121);
|
|
var ReactEmptyComponent = __webpack_require__(67);
|
|
var ReactBrowserEventEmitter = __webpack_require__(28);
|
|
var ReactNativeComponent = __webpack_require__(68);
|
|
var ReactPerf = __webpack_require__(17);
|
|
var ReactRootIndex = __webpack_require__(45);
|
|
var ReactUpdates = __webpack_require__(53);
|
|
|
|
var ReactInjection = {
|
|
Component: ReactComponentEnvironment.injection,
|
|
Class: ReactClass.injection,
|
|
DOMProperty: DOMProperty.injection,
|
|
EmptyComponent: ReactEmptyComponent.injection,
|
|
EventPluginHub: EventPluginHub.injection,
|
|
EventEmitter: ReactBrowserEventEmitter.injection,
|
|
NativeComponent: ReactNativeComponent.injection,
|
|
Perf: ReactPerf.injection,
|
|
RootIndex: ReactRootIndex.injection,
|
|
Updates: ReactUpdates.injection
|
|
};
|
|
|
|
module.exports = ReactInjection;
|
|
|
|
/***/ },
|
|
/* 121 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactClass
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var ReactComponent = __webpack_require__(122);
|
|
var ReactElement = __webpack_require__(41);
|
|
var ReactPropTypeLocations = __webpack_require__(64);
|
|
var ReactPropTypeLocationNames = __webpack_require__(65);
|
|
var ReactNoopUpdateQueue = __webpack_require__(123);
|
|
|
|
var assign = __webpack_require__(38);
|
|
var emptyObject = __webpack_require__(57);
|
|
var invariant = __webpack_require__(12);
|
|
var keyMirror = __webpack_require__(16);
|
|
var keyOf = __webpack_require__(78);
|
|
var warning = __webpack_require__(24);
|
|
|
|
var MIXINS_KEY = keyOf({ mixins: null });
|
|
|
|
/**
|
|
* Policies that describe methods in `ReactClassInterface`.
|
|
*/
|
|
var SpecPolicy = keyMirror({
|
|
/**
|
|
* These methods may be defined only once by the class specification or mixin.
|
|
*/
|
|
DEFINE_ONCE: null,
|
|
/**
|
|
* These methods may be defined by both the class specification and mixins.
|
|
* Subsequent definitions will be chained. These methods must return void.
|
|
*/
|
|
DEFINE_MANY: null,
|
|
/**
|
|
* These methods are overriding the base class.
|
|
*/
|
|
OVERRIDE_BASE: null,
|
|
/**
|
|
* These methods are similar to DEFINE_MANY, except we assume they return
|
|
* objects. We try to merge the keys of the return values of all the mixed in
|
|
* functions. If there is a key conflict we throw.
|
|
*/
|
|
DEFINE_MANY_MERGED: null
|
|
});
|
|
|
|
var injectedMixins = [];
|
|
|
|
var warnedSetProps = false;
|
|
function warnSetProps() {
|
|
if (!warnedSetProps) {
|
|
warnedSetProps = true;
|
|
process.env.NODE_ENV !== 'production' ? warning(false, 'setProps(...) and replaceProps(...) are deprecated. ' + 'Instead, call render again at the top level.') : undefined;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Composite components are higher-level components that compose other composite
|
|
* or native components.
|
|
*
|
|
* To create a new type of `ReactClass`, pass a specification of
|
|
* your new class to `React.createClass`. The only requirement of your class
|
|
* specification is that you implement a `render` method.
|
|
*
|
|
* var MyComponent = React.createClass({
|
|
* render: function() {
|
|
* return <div>Hello World</div>;
|
|
* }
|
|
* });
|
|
*
|
|
* The class specification supports a specific protocol of methods that have
|
|
* special meaning (e.g. `render`). See `ReactClassInterface` for
|
|
* more the comprehensive protocol. Any other properties and methods in the
|
|
* class specification will be available on the prototype.
|
|
*
|
|
* @interface ReactClassInterface
|
|
* @internal
|
|
*/
|
|
var ReactClassInterface = {
|
|
|
|
/**
|
|
* An array of Mixin objects to include when defining your component.
|
|
*
|
|
* @type {array}
|
|
* @optional
|
|
*/
|
|
mixins: SpecPolicy.DEFINE_MANY,
|
|
|
|
/**
|
|
* An object containing properties and methods that should be defined on
|
|
* the component's constructor instead of its prototype (static methods).
|
|
*
|
|
* @type {object}
|
|
* @optional
|
|
*/
|
|
statics: SpecPolicy.DEFINE_MANY,
|
|
|
|
/**
|
|
* Definition of prop types for this component.
|
|
*
|
|
* @type {object}
|
|
* @optional
|
|
*/
|
|
propTypes: SpecPolicy.DEFINE_MANY,
|
|
|
|
/**
|
|
* Definition of context types for this component.
|
|
*
|
|
* @type {object}
|
|
* @optional
|
|
*/
|
|
contextTypes: SpecPolicy.DEFINE_MANY,
|
|
|
|
/**
|
|
* Definition of context types this component sets for its children.
|
|
*
|
|
* @type {object}
|
|
* @optional
|
|
*/
|
|
childContextTypes: SpecPolicy.DEFINE_MANY,
|
|
|
|
// ==== Definition methods ====
|
|
|
|
/**
|
|
* Invoked when the component is mounted. Values in the mapping will be set on
|
|
* `this.props` if that prop is not specified (i.e. using an `in` check).
|
|
*
|
|
* This method is invoked before `getInitialState` and therefore cannot rely
|
|
* on `this.state` or use `this.setState`.
|
|
*
|
|
* @return {object}
|
|
* @optional
|
|
*/
|
|
getDefaultProps: SpecPolicy.DEFINE_MANY_MERGED,
|
|
|
|
/**
|
|
* Invoked once before the component is mounted. The return value will be used
|
|
* as the initial value of `this.state`.
|
|
*
|
|
* getInitialState: function() {
|
|
* return {
|
|
* isOn: false,
|
|
* fooBaz: new BazFoo()
|
|
* }
|
|
* }
|
|
*
|
|
* @return {object}
|
|
* @optional
|
|
*/
|
|
getInitialState: SpecPolicy.DEFINE_MANY_MERGED,
|
|
|
|
/**
|
|
* @return {object}
|
|
* @optional
|
|
*/
|
|
getChildContext: SpecPolicy.DEFINE_MANY_MERGED,
|
|
|
|
/**
|
|
* Uses props from `this.props` and state from `this.state` to render the
|
|
* structure of the component.
|
|
*
|
|
* No guarantees are made about when or how often this method is invoked, so
|
|
* it must not have side effects.
|
|
*
|
|
* render: function() {
|
|
* var name = this.props.name;
|
|
* return <div>Hello, {name}!</div>;
|
|
* }
|
|
*
|
|
* @return {ReactComponent}
|
|
* @nosideeffects
|
|
* @required
|
|
*/
|
|
render: SpecPolicy.DEFINE_ONCE,
|
|
|
|
// ==== Delegate methods ====
|
|
|
|
/**
|
|
* Invoked when the component is initially created and about to be mounted.
|
|
* This may have side effects, but any external subscriptions or data created
|
|
* by this method must be cleaned up in `componentWillUnmount`.
|
|
*
|
|
* @optional
|
|
*/
|
|
componentWillMount: SpecPolicy.DEFINE_MANY,
|
|
|
|
/**
|
|
* Invoked when the component has been mounted and has a DOM representation.
|
|
* However, there is no guarantee that the DOM node is in the document.
|
|
*
|
|
* Use this as an opportunity to operate on the DOM when the component has
|
|
* been mounted (initialized and rendered) for the first time.
|
|
*
|
|
* @param {DOMElement} rootNode DOM element representing the component.
|
|
* @optional
|
|
*/
|
|
componentDidMount: SpecPolicy.DEFINE_MANY,
|
|
|
|
/**
|
|
* Invoked before the component receives new props.
|
|
*
|
|
* Use this as an opportunity to react to a prop transition by updating the
|
|
* state using `this.setState`. Current props are accessed via `this.props`.
|
|
*
|
|
* componentWillReceiveProps: function(nextProps, nextContext) {
|
|
* this.setState({
|
|
* likesIncreasing: nextProps.likeCount > this.props.likeCount
|
|
* });
|
|
* }
|
|
*
|
|
* NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop
|
|
* transition may cause a state change, but the opposite is not true. If you
|
|
* need it, you are probably looking for `componentWillUpdate`.
|
|
*
|
|
* @param {object} nextProps
|
|
* @optional
|
|
*/
|
|
componentWillReceiveProps: SpecPolicy.DEFINE_MANY,
|
|
|
|
/**
|
|
* Invoked while deciding if the component should be updated as a result of
|
|
* receiving new props, state and/or context.
|
|
*
|
|
* Use this as an opportunity to `return false` when you're certain that the
|
|
* transition to the new props/state/context will not require a component
|
|
* update.
|
|
*
|
|
* shouldComponentUpdate: function(nextProps, nextState, nextContext) {
|
|
* return !equal(nextProps, this.props) ||
|
|
* !equal(nextState, this.state) ||
|
|
* !equal(nextContext, this.context);
|
|
* }
|
|
*
|
|
* @param {object} nextProps
|
|
* @param {?object} nextState
|
|
* @param {?object} nextContext
|
|
* @return {boolean} True if the component should update.
|
|
* @optional
|
|
*/
|
|
shouldComponentUpdate: SpecPolicy.DEFINE_ONCE,
|
|
|
|
/**
|
|
* Invoked when the component is about to update due to a transition from
|
|
* `this.props`, `this.state` and `this.context` to `nextProps`, `nextState`
|
|
* and `nextContext`.
|
|
*
|
|
* Use this as an opportunity to perform preparation before an update occurs.
|
|
*
|
|
* NOTE: You **cannot** use `this.setState()` in this method.
|
|
*
|
|
* @param {object} nextProps
|
|
* @param {?object} nextState
|
|
* @param {?object} nextContext
|
|
* @param {ReactReconcileTransaction} transaction
|
|
* @optional
|
|
*/
|
|
componentWillUpdate: SpecPolicy.DEFINE_MANY,
|
|
|
|
/**
|
|
* Invoked when the component's DOM representation has been updated.
|
|
*
|
|
* Use this as an opportunity to operate on the DOM when the component has
|
|
* been updated.
|
|
*
|
|
* @param {object} prevProps
|
|
* @param {?object} prevState
|
|
* @param {?object} prevContext
|
|
* @param {DOMElement} rootNode DOM element representing the component.
|
|
* @optional
|
|
*/
|
|
componentDidUpdate: SpecPolicy.DEFINE_MANY,
|
|
|
|
/**
|
|
* Invoked when the component is about to be removed from its parent and have
|
|
* its DOM representation destroyed.
|
|
*
|
|
* Use this as an opportunity to deallocate any external resources.
|
|
*
|
|
* NOTE: There is no `componentDidUnmount` since your component will have been
|
|
* destroyed by that point.
|
|
*
|
|
* @optional
|
|
*/
|
|
componentWillUnmount: SpecPolicy.DEFINE_MANY,
|
|
|
|
// ==== Advanced methods ====
|
|
|
|
/**
|
|
* Updates the component's currently mounted DOM representation.
|
|
*
|
|
* By default, this implements React's rendering and reconciliation algorithm.
|
|
* Sophisticated clients may wish to override this.
|
|
*
|
|
* @param {ReactReconcileTransaction} transaction
|
|
* @internal
|
|
* @overridable
|
|
*/
|
|
updateComponent: SpecPolicy.OVERRIDE_BASE
|
|
|
|
};
|
|
|
|
/**
|
|
* Mapping from class specification keys to special processing functions.
|
|
*
|
|
* Although these are declared like instance properties in the specification
|
|
* when defining classes using `React.createClass`, they are actually static
|
|
* and are accessible on the constructor instead of the prototype. Despite
|
|
* being static, they must be defined outside of the "statics" key under
|
|
* which all other static methods are defined.
|
|
*/
|
|
var RESERVED_SPEC_KEYS = {
|
|
displayName: function (Constructor, displayName) {
|
|
Constructor.displayName = displayName;
|
|
},
|
|
mixins: function (Constructor, mixins) {
|
|
if (mixins) {
|
|
for (var i = 0; i < mixins.length; i++) {
|
|
mixSpecIntoComponent(Constructor, mixins[i]);
|
|
}
|
|
}
|
|
},
|
|
childContextTypes: function (Constructor, childContextTypes) {
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
validateTypeDef(Constructor, childContextTypes, ReactPropTypeLocations.childContext);
|
|
}
|
|
Constructor.childContextTypes = assign({}, Constructor.childContextTypes, childContextTypes);
|
|
},
|
|
contextTypes: function (Constructor, contextTypes) {
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
validateTypeDef(Constructor, contextTypes, ReactPropTypeLocations.context);
|
|
}
|
|
Constructor.contextTypes = assign({}, Constructor.contextTypes, contextTypes);
|
|
},
|
|
/**
|
|
* Special case getDefaultProps which should move into statics but requires
|
|
* automatic merging.
|
|
*/
|
|
getDefaultProps: function (Constructor, getDefaultProps) {
|
|
if (Constructor.getDefaultProps) {
|
|
Constructor.getDefaultProps = createMergedResultFunction(Constructor.getDefaultProps, getDefaultProps);
|
|
} else {
|
|
Constructor.getDefaultProps = getDefaultProps;
|
|
}
|
|
},
|
|
propTypes: function (Constructor, propTypes) {
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
validateTypeDef(Constructor, propTypes, ReactPropTypeLocations.prop);
|
|
}
|
|
Constructor.propTypes = assign({}, Constructor.propTypes, propTypes);
|
|
},
|
|
statics: function (Constructor, statics) {
|
|
mixStaticSpecIntoComponent(Constructor, statics);
|
|
},
|
|
autobind: function () {} };
|
|
|
|
// noop
|
|
function validateTypeDef(Constructor, typeDef, location) {
|
|
for (var propName in typeDef) {
|
|
if (typeDef.hasOwnProperty(propName)) {
|
|
// use a warning instead of an invariant so components
|
|
// don't show up in prod but not in __DEV__
|
|
process.env.NODE_ENV !== 'production' ? warning(typeof typeDef[propName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', Constructor.displayName || 'ReactClass', ReactPropTypeLocationNames[location], propName) : undefined;
|
|
}
|
|
}
|
|
}
|
|
|
|
function validateMethodOverride(proto, name) {
|
|
var specPolicy = ReactClassInterface.hasOwnProperty(name) ? ReactClassInterface[name] : null;
|
|
|
|
// Disallow overriding of base class methods unless explicitly allowed.
|
|
if (ReactClassMixin.hasOwnProperty(name)) {
|
|
!(specPolicy === SpecPolicy.OVERRIDE_BASE) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClassInterface: You are attempting to override ' + '`%s` from your class specification. Ensure that your method names ' + 'do not overlap with React methods.', name) : invariant(false) : undefined;
|
|
}
|
|
|
|
// Disallow defining methods more than once unless explicitly allowed.
|
|
if (proto.hasOwnProperty(name)) {
|
|
!(specPolicy === SpecPolicy.DEFINE_MANY || specPolicy === SpecPolicy.DEFINE_MANY_MERGED) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClassInterface: You are attempting to define ' + '`%s` on your component more than once. This conflict may be due ' + 'to a mixin.', name) : invariant(false) : undefined;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Mixin helper which handles policy validation and reserved
|
|
* specification keys when building React classses.
|
|
*/
|
|
function mixSpecIntoComponent(Constructor, spec) {
|
|
if (!spec) {
|
|
return;
|
|
}
|
|
|
|
!(typeof spec !== 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You\'re attempting to ' + 'use a component class as a mixin. Instead, just use a regular object.') : invariant(false) : undefined;
|
|
!!ReactElement.isValidElement(spec) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You\'re attempting to ' + 'use a component as a mixin. Instead, just use a regular object.') : invariant(false) : undefined;
|
|
|
|
var proto = Constructor.prototype;
|
|
|
|
// By handling mixins before any other properties, we ensure the same
|
|
// chaining order is applied to methods with DEFINE_MANY policy, whether
|
|
// mixins are listed before or after these methods in the spec.
|
|
if (spec.hasOwnProperty(MIXINS_KEY)) {
|
|
RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);
|
|
}
|
|
|
|
for (var name in spec) {
|
|
if (!spec.hasOwnProperty(name)) {
|
|
continue;
|
|
}
|
|
|
|
if (name === MIXINS_KEY) {
|
|
// We have already handled mixins in a special case above.
|
|
continue;
|
|
}
|
|
|
|
var property = spec[name];
|
|
validateMethodOverride(proto, name);
|
|
|
|
if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {
|
|
RESERVED_SPEC_KEYS[name](Constructor, property);
|
|
} else {
|
|
// Setup methods on prototype:
|
|
// The following member methods should not be automatically bound:
|
|
// 1. Expected ReactClass methods (in the "interface").
|
|
// 2. Overridden methods (that were mixed in).
|
|
var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);
|
|
var isAlreadyDefined = proto.hasOwnProperty(name);
|
|
var isFunction = typeof property === 'function';
|
|
var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && spec.autobind !== false;
|
|
|
|
if (shouldAutoBind) {
|
|
if (!proto.__reactAutoBindMap) {
|
|
proto.__reactAutoBindMap = {};
|
|
}
|
|
proto.__reactAutoBindMap[name] = property;
|
|
proto[name] = property;
|
|
} else {
|
|
if (isAlreadyDefined) {
|
|
var specPolicy = ReactClassInterface[name];
|
|
|
|
// These cases should already be caught by validateMethodOverride.
|
|
!(isReactClassMethod && (specPolicy === SpecPolicy.DEFINE_MANY_MERGED || specPolicy === SpecPolicy.DEFINE_MANY)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: Unexpected spec policy %s for key %s ' + 'when mixing in component specs.', specPolicy, name) : invariant(false) : undefined;
|
|
|
|
// For methods which are defined more than once, call the existing
|
|
// methods before calling the new property, merging if appropriate.
|
|
if (specPolicy === SpecPolicy.DEFINE_MANY_MERGED) {
|
|
proto[name] = createMergedResultFunction(proto[name], property);
|
|
} else if (specPolicy === SpecPolicy.DEFINE_MANY) {
|
|
proto[name] = createChainedFunction(proto[name], property);
|
|
}
|
|
} else {
|
|
proto[name] = property;
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
// Add verbose displayName to the function, which helps when looking
|
|
// at profiling tools.
|
|
if (typeof property === 'function' && spec.displayName) {
|
|
proto[name].displayName = spec.displayName + '_' + name;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function mixStaticSpecIntoComponent(Constructor, statics) {
|
|
if (!statics) {
|
|
return;
|
|
}
|
|
for (var name in statics) {
|
|
var property = statics[name];
|
|
if (!statics.hasOwnProperty(name)) {
|
|
continue;
|
|
}
|
|
|
|
var isReserved = (name in RESERVED_SPEC_KEYS);
|
|
!!isReserved ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You are attempting to define a reserved ' + 'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' + 'as an instance property instead; it will still be accessible on the ' + 'constructor.', name) : invariant(false) : undefined;
|
|
|
|
var isInherited = (name in Constructor);
|
|
!!isInherited ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You are attempting to define ' + '`%s` on your component more than once. This conflict may be ' + 'due to a mixin.', name) : invariant(false) : undefined;
|
|
Constructor[name] = property;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Merge two objects, but throw if both contain the same key.
|
|
*
|
|
* @param {object} one The first object, which is mutated.
|
|
* @param {object} two The second object
|
|
* @return {object} one after it has been mutated to contain everything in two.
|
|
*/
|
|
function mergeIntoWithNoDuplicateKeys(one, two) {
|
|
!(one && two && typeof one === 'object' && typeof two === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.') : invariant(false) : undefined;
|
|
|
|
for (var key in two) {
|
|
if (two.hasOwnProperty(key)) {
|
|
!(one[key] === undefined) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'mergeIntoWithNoDuplicateKeys(): ' + 'Tried to merge two objects with the same key: `%s`. This conflict ' + 'may be due to a mixin; in particular, this may be caused by two ' + 'getInitialState() or getDefaultProps() methods returning objects ' + 'with clashing keys.', key) : invariant(false) : undefined;
|
|
one[key] = two[key];
|
|
}
|
|
}
|
|
return one;
|
|
}
|
|
|
|
/**
|
|
* Creates a function that invokes two functions and merges their return values.
|
|
*
|
|
* @param {function} one Function to invoke first.
|
|
* @param {function} two Function to invoke second.
|
|
* @return {function} Function that invokes the two argument functions.
|
|
* @private
|
|
*/
|
|
function createMergedResultFunction(one, two) {
|
|
return function mergedResult() {
|
|
var a = one.apply(this, arguments);
|
|
var b = two.apply(this, arguments);
|
|
if (a == null) {
|
|
return b;
|
|
} else if (b == null) {
|
|
return a;
|
|
}
|
|
var c = {};
|
|
mergeIntoWithNoDuplicateKeys(c, a);
|
|
mergeIntoWithNoDuplicateKeys(c, b);
|
|
return c;
|
|
};
|
|
}
|
|
|
|
/**
|
|
* Creates a function that invokes two functions and ignores their return vales.
|
|
*
|
|
* @param {function} one Function to invoke first.
|
|
* @param {function} two Function to invoke second.
|
|
* @return {function} Function that invokes the two argument functions.
|
|
* @private
|
|
*/
|
|
function createChainedFunction(one, two) {
|
|
return function chainedFunction() {
|
|
one.apply(this, arguments);
|
|
two.apply(this, arguments);
|
|
};
|
|
}
|
|
|
|
/**
|
|
* Binds a method to the component.
|
|
*
|
|
* @param {object} component Component whose method is going to be bound.
|
|
* @param {function} method Method to be bound.
|
|
* @return {function} The bound method.
|
|
*/
|
|
function bindAutoBindMethod(component, method) {
|
|
var boundMethod = method.bind(component);
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
boundMethod.__reactBoundContext = component;
|
|
boundMethod.__reactBoundMethod = method;
|
|
boundMethod.__reactBoundArguments = null;
|
|
var componentName = component.constructor.displayName;
|
|
var _bind = boundMethod.bind;
|
|
/* eslint-disable block-scoped-var, no-undef */
|
|
boundMethod.bind = function (newThis) {
|
|
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
args[_key - 1] = arguments[_key];
|
|
}
|
|
|
|
// User is trying to bind() an autobound method; we effectively will
|
|
// ignore the value of "this" that the user is trying to use, so
|
|
// let's warn.
|
|
if (newThis !== component && newThis !== null) {
|
|
process.env.NODE_ENV !== 'production' ? warning(false, 'bind(): React component methods may only be bound to the ' + 'component instance. See %s', componentName) : undefined;
|
|
} else if (!args.length) {
|
|
process.env.NODE_ENV !== 'production' ? warning(false, 'bind(): You are binding a component method to the component. ' + 'React does this for you automatically in a high-performance ' + 'way, so you can safely remove this call. See %s', componentName) : undefined;
|
|
return boundMethod;
|
|
}
|
|
var reboundMethod = _bind.apply(boundMethod, arguments);
|
|
reboundMethod.__reactBoundContext = component;
|
|
reboundMethod.__reactBoundMethod = method;
|
|
reboundMethod.__reactBoundArguments = args;
|
|
return reboundMethod;
|
|
/* eslint-enable */
|
|
};
|
|
}
|
|
return boundMethod;
|
|
}
|
|
|
|
/**
|
|
* Binds all auto-bound methods in a component.
|
|
*
|
|
* @param {object} component Component whose method is going to be bound.
|
|
*/
|
|
function bindAutoBindMethods(component) {
|
|
for (var autoBindKey in component.__reactAutoBindMap) {
|
|
if (component.__reactAutoBindMap.hasOwnProperty(autoBindKey)) {
|
|
var method = component.__reactAutoBindMap[autoBindKey];
|
|
component[autoBindKey] = bindAutoBindMethod(component, method);
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Add more to the ReactClass base class. These are all legacy features and
|
|
* therefore not already part of the modern ReactComponent.
|
|
*/
|
|
var ReactClassMixin = {
|
|
|
|
/**
|
|
* TODO: This will be deprecated because state should always keep a consistent
|
|
* type signature and the only use case for this, is to avoid that.
|
|
*/
|
|
replaceState: function (newState, callback) {
|
|
this.updater.enqueueReplaceState(this, newState);
|
|
if (callback) {
|
|
this.updater.enqueueCallback(this, callback);
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Checks whether or not this composite component is mounted.
|
|
* @return {boolean} True if mounted, false otherwise.
|
|
* @protected
|
|
* @final
|
|
*/
|
|
isMounted: function () {
|
|
return this.updater.isMounted(this);
|
|
},
|
|
|
|
/**
|
|
* Sets a subset of the props.
|
|
*
|
|
* @param {object} partialProps Subset of the next props.
|
|
* @param {?function} callback Called after props are updated.
|
|
* @final
|
|
* @public
|
|
* @deprecated
|
|
*/
|
|
setProps: function (partialProps, callback) {
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
warnSetProps();
|
|
}
|
|
this.updater.enqueueSetProps(this, partialProps);
|
|
if (callback) {
|
|
this.updater.enqueueCallback(this, callback);
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Replace all the props.
|
|
*
|
|
* @param {object} newProps Subset of the next props.
|
|
* @param {?function} callback Called after props are updated.
|
|
* @final
|
|
* @public
|
|
* @deprecated
|
|
*/
|
|
replaceProps: function (newProps, callback) {
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
warnSetProps();
|
|
}
|
|
this.updater.enqueueReplaceProps(this, newProps);
|
|
if (callback) {
|
|
this.updater.enqueueCallback(this, callback);
|
|
}
|
|
}
|
|
};
|
|
|
|
var ReactClassComponent = function () {};
|
|
assign(ReactClassComponent.prototype, ReactComponent.prototype, ReactClassMixin);
|
|
|
|
/**
|
|
* Module for creating composite components.
|
|
*
|
|
* @class ReactClass
|
|
*/
|
|
var ReactClass = {
|
|
|
|
/**
|
|
* Creates a composite component class given a class specification.
|
|
*
|
|
* @param {object} spec Class specification (which must define `render`).
|
|
* @return {function} Component constructor function.
|
|
* @public
|
|
*/
|
|
createClass: function (spec) {
|
|
var Constructor = function (props, context, updater) {
|
|
// This constructor is overridden by mocks. The argument is used
|
|
// by mocks to assert on what gets mounted.
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
process.env.NODE_ENV !== 'production' ? warning(this instanceof Constructor, 'Something is calling a React component directly. Use a factory or ' + 'JSX instead. See: https://fb.me/react-legacyfactory') : undefined;
|
|
}
|
|
|
|
// Wire up auto-binding
|
|
if (this.__reactAutoBindMap) {
|
|
bindAutoBindMethods(this);
|
|
}
|
|
|
|
this.props = props;
|
|
this.context = context;
|
|
this.refs = emptyObject;
|
|
this.updater = updater || ReactNoopUpdateQueue;
|
|
|
|
this.state = null;
|
|
|
|
// ReactClasses doesn't have constructors. Instead, they use the
|
|
// getInitialState and componentWillMount methods for initialization.
|
|
|
|
var initialState = this.getInitialState ? this.getInitialState() : null;
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
// We allow auto-mocks to proceed as if they're returning null.
|
|
if (typeof initialState === 'undefined' && this.getInitialState._isMockFunction) {
|
|
// This is probably bad practice. Consider warning here and
|
|
// deprecating this convenience.
|
|
initialState = null;
|
|
}
|
|
}
|
|
!(typeof initialState === 'object' && !Array.isArray(initialState)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.getInitialState(): must return an object or null', Constructor.displayName || 'ReactCompositeComponent') : invariant(false) : undefined;
|
|
|
|
this.state = initialState;
|
|
};
|
|
Constructor.prototype = new ReactClassComponent();
|
|
Constructor.prototype.constructor = Constructor;
|
|
|
|
injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor));
|
|
|
|
mixSpecIntoComponent(Constructor, spec);
|
|
|
|
// Initialize the defaultProps property after all mixins have been merged.
|
|
if (Constructor.getDefaultProps) {
|
|
Constructor.defaultProps = Constructor.getDefaultProps();
|
|
}
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
// This is a tag to indicate that the use of these method names is ok,
|
|
// since it's used with createClass. If it's not, then it's likely a
|
|
// mistake so we'll warn you to use the static property, property
|
|
// initializer or constructor respectively.
|
|
if (Constructor.getDefaultProps) {
|
|
Constructor.getDefaultProps.isReactClassApproved = {};
|
|
}
|
|
if (Constructor.prototype.getInitialState) {
|
|
Constructor.prototype.getInitialState.isReactClassApproved = {};
|
|
}
|
|
}
|
|
|
|
!Constructor.prototype.render ? process.env.NODE_ENV !== 'production' ? invariant(false, 'createClass(...): Class specification must implement a `render` method.') : invariant(false) : undefined;
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
process.env.NODE_ENV !== 'production' ? warning(!Constructor.prototype.componentShouldUpdate, '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', spec.displayName || 'A component') : undefined;
|
|
process.env.NODE_ENV !== 'production' ? warning(!Constructor.prototype.componentWillRecieveProps, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', spec.displayName || 'A component') : undefined;
|
|
}
|
|
|
|
// Reduce time spent doing lookups by setting these on the prototype.
|
|
for (var methodName in ReactClassInterface) {
|
|
if (!Constructor.prototype[methodName]) {
|
|
Constructor.prototype[methodName] = null;
|
|
}
|
|
}
|
|
|
|
return Constructor;
|
|
},
|
|
|
|
injection: {
|
|
injectMixin: function (mixin) {
|
|
injectedMixins.push(mixin);
|
|
}
|
|
}
|
|
|
|
};
|
|
|
|
module.exports = ReactClass;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 122 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactComponent
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var ReactNoopUpdateQueue = __webpack_require__(123);
|
|
|
|
var canDefineProperty = __webpack_require__(42);
|
|
var emptyObject = __webpack_require__(57);
|
|
var invariant = __webpack_require__(12);
|
|
var warning = __webpack_require__(24);
|
|
|
|
/**
|
|
* Base class helpers for the updating state of a component.
|
|
*/
|
|
function ReactComponent(props, context, updater) {
|
|
this.props = props;
|
|
this.context = context;
|
|
this.refs = emptyObject;
|
|
// We initialize the default updater but the real one gets injected by the
|
|
// renderer.
|
|
this.updater = updater || ReactNoopUpdateQueue;
|
|
}
|
|
|
|
ReactComponent.prototype.isReactComponent = {};
|
|
|
|
/**
|
|
* Sets a subset of the state. Always use this to mutate
|
|
* state. You should treat `this.state` as immutable.
|
|
*
|
|
* There is no guarantee that `this.state` will be immediately updated, so
|
|
* accessing `this.state` after calling this method may return the old value.
|
|
*
|
|
* There is no guarantee that calls to `setState` will run synchronously,
|
|
* as they may eventually be batched together. You can provide an optional
|
|
* callback that will be executed when the call to setState is actually
|
|
* completed.
|
|
*
|
|
* When a function is provided to setState, it will be called at some point in
|
|
* the future (not synchronously). It will be called with the up to date
|
|
* component arguments (state, props, context). These values can be different
|
|
* from this.* because your function may be called after receiveProps but before
|
|
* shouldComponentUpdate, and this new state, props, and context will not yet be
|
|
* assigned to this.
|
|
*
|
|
* @param {object|function} partialState Next partial state or function to
|
|
* produce next partial state to be merged with current state.
|
|
* @param {?function} callback Called after state is updated.
|
|
* @final
|
|
* @protected
|
|
*/
|
|
ReactComponent.prototype.setState = function (partialState, callback) {
|
|
!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'setState(...): takes an object of state variables to update or a ' + 'function which returns an object of state variables.') : invariant(false) : undefined;
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
process.env.NODE_ENV !== 'production' ? warning(partialState != null, 'setState(...): You passed an undefined or null state object; ' + 'instead, use forceUpdate().') : undefined;
|
|
}
|
|
this.updater.enqueueSetState(this, partialState);
|
|
if (callback) {
|
|
this.updater.enqueueCallback(this, callback);
|
|
}
|
|
};
|
|
|
|
/**
|
|
* Forces an update. This should only be invoked when it is known with
|
|
* certainty that we are **not** in a DOM transaction.
|
|
*
|
|
* You may want to call this when you know that some deeper aspect of the
|
|
* component's state has changed but `setState` was not called.
|
|
*
|
|
* This will not invoke `shouldComponentUpdate`, but it will invoke
|
|
* `componentWillUpdate` and `componentDidUpdate`.
|
|
*
|
|
* @param {?function} callback Called after update is complete.
|
|
* @final
|
|
* @protected
|
|
*/
|
|
ReactComponent.prototype.forceUpdate = function (callback) {
|
|
this.updater.enqueueForceUpdate(this);
|
|
if (callback) {
|
|
this.updater.enqueueCallback(this, callback);
|
|
}
|
|
};
|
|
|
|
/**
|
|
* Deprecated APIs. These APIs used to exist on classic React classes but since
|
|
* we would like to deprecate them, we're not going to move them over to this
|
|
* modern base class. Instead, we define a getter that warns if it's accessed.
|
|
*/
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
var deprecatedAPIs = {
|
|
getDOMNode: ['getDOMNode', 'Use ReactDOM.findDOMNode(component) instead.'],
|
|
isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
|
|
replaceProps: ['replaceProps', 'Instead, call render again at the top level.'],
|
|
replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).'],
|
|
setProps: ['setProps', 'Instead, call render again at the top level.']
|
|
};
|
|
var defineDeprecationWarning = function (methodName, info) {
|
|
if (canDefineProperty) {
|
|
Object.defineProperty(ReactComponent.prototype, methodName, {
|
|
get: function () {
|
|
process.env.NODE_ENV !== 'production' ? warning(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]) : undefined;
|
|
return undefined;
|
|
}
|
|
});
|
|
}
|
|
};
|
|
for (var fnName in deprecatedAPIs) {
|
|
if (deprecatedAPIs.hasOwnProperty(fnName)) {
|
|
defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
|
|
}
|
|
}
|
|
}
|
|
|
|
module.exports = ReactComponent;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 123 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactNoopUpdateQueue
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var warning = __webpack_require__(24);
|
|
|
|
function warnTDZ(publicInstance, callerName) {
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
process.env.NODE_ENV !== 'production' ? warning(false, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, publicInstance.constructor && publicInstance.constructor.displayName || '') : undefined;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* This is the abstract API for an update queue.
|
|
*/
|
|
var ReactNoopUpdateQueue = {
|
|
|
|
/**
|
|
* Checks whether or not this composite component is mounted.
|
|
* @param {ReactClass} publicInstance The instance we want to test.
|
|
* @return {boolean} True if mounted, false otherwise.
|
|
* @protected
|
|
* @final
|
|
*/
|
|
isMounted: function (publicInstance) {
|
|
return false;
|
|
},
|
|
|
|
/**
|
|
* Enqueue a callback that will be executed after all the pending updates
|
|
* have processed.
|
|
*
|
|
* @param {ReactClass} publicInstance The instance to use as `this` context.
|
|
* @param {?function} callback Called after state is updated.
|
|
* @internal
|
|
*/
|
|
enqueueCallback: function (publicInstance, callback) {},
|
|
|
|
/**
|
|
* Forces an update. This should only be invoked when it is known with
|
|
* certainty that we are **not** in a DOM transaction.
|
|
*
|
|
* You may want to call this when you know that some deeper aspect of the
|
|
* component's state has changed but `setState` was not called.
|
|
*
|
|
* This will not invoke `shouldComponentUpdate`, but it will invoke
|
|
* `componentWillUpdate` and `componentDidUpdate`.
|
|
*
|
|
* @param {ReactClass} publicInstance The instance that should rerender.
|
|
* @internal
|
|
*/
|
|
enqueueForceUpdate: function (publicInstance) {
|
|
warnTDZ(publicInstance, 'forceUpdate');
|
|
},
|
|
|
|
/**
|
|
* Replaces all of the state. Always use this or `setState` to mutate state.
|
|
* You should treat `this.state` as immutable.
|
|
*
|
|
* There is no guarantee that `this.state` will be immediately updated, so
|
|
* accessing `this.state` after calling this method may return the old value.
|
|
*
|
|
* @param {ReactClass} publicInstance The instance that should rerender.
|
|
* @param {object} completeState Next state.
|
|
* @internal
|
|
*/
|
|
enqueueReplaceState: function (publicInstance, completeState) {
|
|
warnTDZ(publicInstance, 'replaceState');
|
|
},
|
|
|
|
/**
|
|
* Sets a subset of the state. This only exists because _pendingState is
|
|
* internal. This provides a merging strategy that is not available to deep
|
|
* properties which is confusing. TODO: Expose pendingState or don't use it
|
|
* during the merge.
|
|
*
|
|
* @param {ReactClass} publicInstance The instance that should rerender.
|
|
* @param {object} partialState Next partial state to be merged with state.
|
|
* @internal
|
|
*/
|
|
enqueueSetState: function (publicInstance, partialState) {
|
|
warnTDZ(publicInstance, 'setState');
|
|
},
|
|
|
|
/**
|
|
* Sets a subset of the props.
|
|
*
|
|
* @param {ReactClass} publicInstance The instance that should rerender.
|
|
* @param {object} partialProps Subset of the next props.
|
|
* @internal
|
|
*/
|
|
enqueueSetProps: function (publicInstance, partialProps) {
|
|
warnTDZ(publicInstance, 'setProps');
|
|
},
|
|
|
|
/**
|
|
* Replaces all of the props.
|
|
*
|
|
* @param {ReactClass} publicInstance The instance that should rerender.
|
|
* @param {object} props New props.
|
|
* @internal
|
|
*/
|
|
enqueueReplaceProps: function (publicInstance, props) {
|
|
warnTDZ(publicInstance, 'replaceProps');
|
|
}
|
|
|
|
};
|
|
|
|
module.exports = ReactNoopUpdateQueue;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 124 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactReconcileTransaction
|
|
* @typechecks static-only
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var CallbackQueue = __webpack_require__(54);
|
|
var PooledClass = __webpack_require__(55);
|
|
var ReactBrowserEventEmitter = __webpack_require__(28);
|
|
var ReactDOMFeatureFlags = __webpack_require__(40);
|
|
var ReactInputSelection = __webpack_require__(125);
|
|
var Transaction = __webpack_require__(56);
|
|
|
|
var assign = __webpack_require__(38);
|
|
|
|
/**
|
|
* Ensures that, when possible, the selection range (currently selected text
|
|
* input) is not disturbed by performing the transaction.
|
|
*/
|
|
var SELECTION_RESTORATION = {
|
|
/**
|
|
* @return {Selection} Selection information.
|
|
*/
|
|
initialize: ReactInputSelection.getSelectionInformation,
|
|
/**
|
|
* @param {Selection} sel Selection information returned from `initialize`.
|
|
*/
|
|
close: ReactInputSelection.restoreSelection
|
|
};
|
|
|
|
/**
|
|
* Suppresses events (blur/focus) that could be inadvertently dispatched due to
|
|
* high level DOM manipulations (like temporarily removing a text input from the
|
|
* DOM).
|
|
*/
|
|
var EVENT_SUPPRESSION = {
|
|
/**
|
|
* @return {boolean} The enabled status of `ReactBrowserEventEmitter` before
|
|
* the reconciliation.
|
|
*/
|
|
initialize: function () {
|
|
var currentlyEnabled = ReactBrowserEventEmitter.isEnabled();
|
|
ReactBrowserEventEmitter.setEnabled(false);
|
|
return currentlyEnabled;
|
|
},
|
|
|
|
/**
|
|
* @param {boolean} previouslyEnabled Enabled status of
|
|
* `ReactBrowserEventEmitter` before the reconciliation occurred. `close`
|
|
* restores the previous value.
|
|
*/
|
|
close: function (previouslyEnabled) {
|
|
ReactBrowserEventEmitter.setEnabled(previouslyEnabled);
|
|
}
|
|
};
|
|
|
|
/**
|
|
* Provides a queue for collecting `componentDidMount` and
|
|
* `componentDidUpdate` callbacks during the the transaction.
|
|
*/
|
|
var ON_DOM_READY_QUEUEING = {
|
|
/**
|
|
* Initializes the internal `onDOMReady` queue.
|
|
*/
|
|
initialize: function () {
|
|
this.reactMountReady.reset();
|
|
},
|
|
|
|
/**
|
|
* After DOM is flushed, invoke all registered `onDOMReady` callbacks.
|
|
*/
|
|
close: function () {
|
|
this.reactMountReady.notifyAll();
|
|
}
|
|
};
|
|
|
|
/**
|
|
* Executed within the scope of the `Transaction` instance. Consider these as
|
|
* being member methods, but with an implied ordering while being isolated from
|
|
* each other.
|
|
*/
|
|
var TRANSACTION_WRAPPERS = [SELECTION_RESTORATION, EVENT_SUPPRESSION, ON_DOM_READY_QUEUEING];
|
|
|
|
/**
|
|
* Currently:
|
|
* - The order that these are listed in the transaction is critical:
|
|
* - Suppresses events.
|
|
* - Restores selection range.
|
|
*
|
|
* Future:
|
|
* - Restore document/overflow scroll positions that were unintentionally
|
|
* modified via DOM insertions above the top viewport boundary.
|
|
* - Implement/integrate with customized constraint based layout system and keep
|
|
* track of which dimensions must be remeasured.
|
|
*
|
|
* @class ReactReconcileTransaction
|
|
*/
|
|
function ReactReconcileTransaction(forceHTML) {
|
|
this.reinitializeTransaction();
|
|
// Only server-side rendering really needs this option (see
|
|
// `ReactServerRendering`), but server-side uses
|
|
// `ReactServerRenderingTransaction` instead. This option is here so that it's
|
|
// accessible and defaults to false when `ReactDOMComponent` and
|
|
// `ReactTextComponent` checks it in `mountComponent`.`
|
|
this.renderToStaticMarkup = false;
|
|
this.reactMountReady = CallbackQueue.getPooled(null);
|
|
this.useCreateElement = !forceHTML && ReactDOMFeatureFlags.useCreateElement;
|
|
}
|
|
|
|
var Mixin = {
|
|
/**
|
|
* @see Transaction
|
|
* @abstract
|
|
* @final
|
|
* @return {array<object>} List of operation wrap procedures.
|
|
* TODO: convert to array<TransactionWrapper>
|
|
*/
|
|
getTransactionWrappers: function () {
|
|
return TRANSACTION_WRAPPERS;
|
|
},
|
|
|
|
/**
|
|
* @return {object} The queue to collect `onDOMReady` callbacks with.
|
|
*/
|
|
getReactMountReady: function () {
|
|
return this.reactMountReady;
|
|
},
|
|
|
|
/**
|
|
* `PooledClass` looks for this, and will invoke this before allowing this
|
|
* instance to be reused.
|
|
*/
|
|
destructor: function () {
|
|
CallbackQueue.release(this.reactMountReady);
|
|
this.reactMountReady = null;
|
|
}
|
|
};
|
|
|
|
assign(ReactReconcileTransaction.prototype, Transaction.Mixin, Mixin);
|
|
|
|
PooledClass.addPoolingTo(ReactReconcileTransaction);
|
|
|
|
module.exports = ReactReconcileTransaction;
|
|
|
|
/***/ },
|
|
/* 125 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactInputSelection
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var ReactDOMSelection = __webpack_require__(126);
|
|
|
|
var containsNode = __webpack_require__(58);
|
|
var focusNode = __webpack_require__(94);
|
|
var getActiveElement = __webpack_require__(128);
|
|
|
|
function isInDocument(node) {
|
|
return containsNode(document.documentElement, node);
|
|
}
|
|
|
|
/**
|
|
* @ReactInputSelection: React input selection module. Based on Selection.js,
|
|
* but modified to be suitable for react and has a couple of bug fixes (doesn't
|
|
* assume buttons have range selections allowed).
|
|
* Input selection module for React.
|
|
*/
|
|
var ReactInputSelection = {
|
|
|
|
hasSelectionCapabilities: function (elem) {
|
|
var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
|
|
return nodeName && (nodeName === 'input' && elem.type === 'text' || nodeName === 'textarea' || elem.contentEditable === 'true');
|
|
},
|
|
|
|
getSelectionInformation: function () {
|
|
var focusedElem = getActiveElement();
|
|
return {
|
|
focusedElem: focusedElem,
|
|
selectionRange: ReactInputSelection.hasSelectionCapabilities(focusedElem) ? ReactInputSelection.getSelection(focusedElem) : null
|
|
};
|
|
},
|
|
|
|
/**
|
|
* @restoreSelection: If any selection information was potentially lost,
|
|
* restore it. This is useful when performing operations that could remove dom
|
|
* nodes and place them back in, resulting in focus being lost.
|
|
*/
|
|
restoreSelection: function (priorSelectionInformation) {
|
|
var curFocusedElem = getActiveElement();
|
|
var priorFocusedElem = priorSelectionInformation.focusedElem;
|
|
var priorSelectionRange = priorSelectionInformation.selectionRange;
|
|
if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) {
|
|
if (ReactInputSelection.hasSelectionCapabilities(priorFocusedElem)) {
|
|
ReactInputSelection.setSelection(priorFocusedElem, priorSelectionRange);
|
|
}
|
|
focusNode(priorFocusedElem);
|
|
}
|
|
},
|
|
|
|
/**
|
|
* @getSelection: Gets the selection bounds of a focused textarea, input or
|
|
* contentEditable node.
|
|
* -@input: Look up selection bounds of this input
|
|
* -@return {start: selectionStart, end: selectionEnd}
|
|
*/
|
|
getSelection: function (input) {
|
|
var selection;
|
|
|
|
if ('selectionStart' in input) {
|
|
// Modern browser with input or textarea.
|
|
selection = {
|
|
start: input.selectionStart,
|
|
end: input.selectionEnd
|
|
};
|
|
} else if (document.selection && (input.nodeName && input.nodeName.toLowerCase() === 'input')) {
|
|
// IE8 input.
|
|
var range = document.selection.createRange();
|
|
// There can only be one selection per document in IE, so it must
|
|
// be in our element.
|
|
if (range.parentElement() === input) {
|
|
selection = {
|
|
start: -range.moveStart('character', -input.value.length),
|
|
end: -range.moveEnd('character', -input.value.length)
|
|
};
|
|
}
|
|
} else {
|
|
// Content editable or old IE textarea.
|
|
selection = ReactDOMSelection.getOffsets(input);
|
|
}
|
|
|
|
return selection || { start: 0, end: 0 };
|
|
},
|
|
|
|
/**
|
|
* @setSelection: Sets the selection bounds of a textarea or input and focuses
|
|
* the input.
|
|
* -@input Set selection bounds of this input or textarea
|
|
* -@offsets Object of same form that is returned from get*
|
|
*/
|
|
setSelection: function (input, offsets) {
|
|
var start = offsets.start;
|
|
var end = offsets.end;
|
|
if (typeof end === 'undefined') {
|
|
end = start;
|
|
}
|
|
|
|
if ('selectionStart' in input) {
|
|
input.selectionStart = start;
|
|
input.selectionEnd = Math.min(end, input.value.length);
|
|
} else if (document.selection && (input.nodeName && input.nodeName.toLowerCase() === 'input')) {
|
|
var range = input.createTextRange();
|
|
range.collapse(true);
|
|
range.moveStart('character', start);
|
|
range.moveEnd('character', end - start);
|
|
range.select();
|
|
} else {
|
|
ReactDOMSelection.setOffsets(input, offsets);
|
|
}
|
|
}
|
|
};
|
|
|
|
module.exports = ReactInputSelection;
|
|
|
|
/***/ },
|
|
/* 126 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactDOMSelection
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var ExecutionEnvironment = __webpack_require__(8);
|
|
|
|
var getNodeForCharacterOffset = __webpack_require__(127);
|
|
var getTextContentAccessor = __webpack_require__(74);
|
|
|
|
/**
|
|
* While `isCollapsed` is available on the Selection object and `collapsed`
|
|
* is available on the Range object, IE11 sometimes gets them wrong.
|
|
* If the anchor/focus nodes and offsets are the same, the range is collapsed.
|
|
*/
|
|
function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {
|
|
return anchorNode === focusNode && anchorOffset === focusOffset;
|
|
}
|
|
|
|
/**
|
|
* Get the appropriate anchor and focus node/offset pairs for IE.
|
|
*
|
|
* The catch here is that IE's selection API doesn't provide information
|
|
* about whether the selection is forward or backward, so we have to
|
|
* behave as though it's always forward.
|
|
*
|
|
* IE text differs from modern selection in that it behaves as though
|
|
* block elements end with a new line. This means character offsets will
|
|
* differ between the two APIs.
|
|
*
|
|
* @param {DOMElement} node
|
|
* @return {object}
|
|
*/
|
|
function getIEOffsets(node) {
|
|
var selection = document.selection;
|
|
var selectedRange = selection.createRange();
|
|
var selectedLength = selectedRange.text.length;
|
|
|
|
// Duplicate selection so we can move range without breaking user selection.
|
|
var fromStart = selectedRange.duplicate();
|
|
fromStart.moveToElementText(node);
|
|
fromStart.setEndPoint('EndToStart', selectedRange);
|
|
|
|
var startOffset = fromStart.text.length;
|
|
var endOffset = startOffset + selectedLength;
|
|
|
|
return {
|
|
start: startOffset,
|
|
end: endOffset
|
|
};
|
|
}
|
|
|
|
/**
|
|
* @param {DOMElement} node
|
|
* @return {?object}
|
|
*/
|
|
function getModernOffsets(node) {
|
|
var selection = window.getSelection && window.getSelection();
|
|
|
|
if (!selection || selection.rangeCount === 0) {
|
|
return null;
|
|
}
|
|
|
|
var anchorNode = selection.anchorNode;
|
|
var anchorOffset = selection.anchorOffset;
|
|
var focusNode = selection.focusNode;
|
|
var focusOffset = selection.focusOffset;
|
|
|
|
var currentRange = selection.getRangeAt(0);
|
|
|
|
// In Firefox, range.startContainer and range.endContainer can be "anonymous
|
|
// divs", e.g. the up/down buttons on an <input type="number">. Anonymous
|
|
// divs do not seem to expose properties, triggering a "Permission denied
|
|
// error" if any of its properties are accessed. The only seemingly possible
|
|
// way to avoid erroring is to access a property that typically works for
|
|
// non-anonymous divs and catch any error that may otherwise arise. See
|
|
// https://bugzilla.mozilla.org/show_bug.cgi?id=208427
|
|
try {
|
|
/* eslint-disable no-unused-expressions */
|
|
currentRange.startContainer.nodeType;
|
|
currentRange.endContainer.nodeType;
|
|
/* eslint-enable no-unused-expressions */
|
|
} catch (e) {
|
|
return null;
|
|
}
|
|
|
|
// If the node and offset values are the same, the selection is collapsed.
|
|
// `Selection.isCollapsed` is available natively, but IE sometimes gets
|
|
// this value wrong.
|
|
var isSelectionCollapsed = isCollapsed(selection.anchorNode, selection.anchorOffset, selection.focusNode, selection.focusOffset);
|
|
|
|
var rangeLength = isSelectionCollapsed ? 0 : currentRange.toString().length;
|
|
|
|
var tempRange = currentRange.cloneRange();
|
|
tempRange.selectNodeContents(node);
|
|
tempRange.setEnd(currentRange.startContainer, currentRange.startOffset);
|
|
|
|
var isTempRangeCollapsed = isCollapsed(tempRange.startContainer, tempRange.startOffset, tempRange.endContainer, tempRange.endOffset);
|
|
|
|
var start = isTempRangeCollapsed ? 0 : tempRange.toString().length;
|
|
var end = start + rangeLength;
|
|
|
|
// Detect whether the selection is backward.
|
|
var detectionRange = document.createRange();
|
|
detectionRange.setStart(anchorNode, anchorOffset);
|
|
detectionRange.setEnd(focusNode, focusOffset);
|
|
var isBackward = detectionRange.collapsed;
|
|
|
|
return {
|
|
start: isBackward ? end : start,
|
|
end: isBackward ? start : end
|
|
};
|
|
}
|
|
|
|
/**
|
|
* @param {DOMElement|DOMTextNode} node
|
|
* @param {object} offsets
|
|
*/
|
|
function setIEOffsets(node, offsets) {
|
|
var range = document.selection.createRange().duplicate();
|
|
var start, end;
|
|
|
|
if (typeof offsets.end === 'undefined') {
|
|
start = offsets.start;
|
|
end = start;
|
|
} else if (offsets.start > offsets.end) {
|
|
start = offsets.end;
|
|
end = offsets.start;
|
|
} else {
|
|
start = offsets.start;
|
|
end = offsets.end;
|
|
}
|
|
|
|
range.moveToElementText(node);
|
|
range.moveStart('character', start);
|
|
range.setEndPoint('EndToStart', range);
|
|
range.moveEnd('character', end - start);
|
|
range.select();
|
|
}
|
|
|
|
/**
|
|
* In modern non-IE browsers, we can support both forward and backward
|
|
* selections.
|
|
*
|
|
* Note: IE10+ supports the Selection object, but it does not support
|
|
* the `extend` method, which means that even in modern IE, it's not possible
|
|
* to programatically create a backward selection. Thus, for all IE
|
|
* versions, we use the old IE API to create our selections.
|
|
*
|
|
* @param {DOMElement|DOMTextNode} node
|
|
* @param {object} offsets
|
|
*/
|
|
function setModernOffsets(node, offsets) {
|
|
if (!window.getSelection) {
|
|
return;
|
|
}
|
|
|
|
var selection = window.getSelection();
|
|
var length = node[getTextContentAccessor()].length;
|
|
var start = Math.min(offsets.start, length);
|
|
var end = typeof offsets.end === 'undefined' ? start : Math.min(offsets.end, length);
|
|
|
|
// IE 11 uses modern selection, but doesn't support the extend method.
|
|
// Flip backward selections, so we can set with a single range.
|
|
if (!selection.extend && start > end) {
|
|
var temp = end;
|
|
end = start;
|
|
start = temp;
|
|
}
|
|
|
|
var startMarker = getNodeForCharacterOffset(node, start);
|
|
var endMarker = getNodeForCharacterOffset(node, end);
|
|
|
|
if (startMarker && endMarker) {
|
|
var range = document.createRange();
|
|
range.setStart(startMarker.node, startMarker.offset);
|
|
selection.removeAllRanges();
|
|
|
|
if (start > end) {
|
|
selection.addRange(range);
|
|
selection.extend(endMarker.node, endMarker.offset);
|
|
} else {
|
|
range.setEnd(endMarker.node, endMarker.offset);
|
|
selection.addRange(range);
|
|
}
|
|
}
|
|
}
|
|
|
|
var useIEOffsets = ExecutionEnvironment.canUseDOM && 'selection' in document && !('getSelection' in window);
|
|
|
|
var ReactDOMSelection = {
|
|
/**
|
|
* @param {DOMElement} node
|
|
*/
|
|
getOffsets: useIEOffsets ? getIEOffsets : getModernOffsets,
|
|
|
|
/**
|
|
* @param {DOMElement|DOMTextNode} node
|
|
* @param {object} offsets
|
|
*/
|
|
setOffsets: useIEOffsets ? setIEOffsets : setModernOffsets
|
|
};
|
|
|
|
module.exports = ReactDOMSelection;
|
|
|
|
/***/ },
|
|
/* 127 */
|
|
/***/ function(module, exports) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule getNodeForCharacterOffset
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
/**
|
|
* Given any node return the first leaf node without children.
|
|
*
|
|
* @param {DOMElement|DOMTextNode} node
|
|
* @return {DOMElement|DOMTextNode}
|
|
*/
|
|
function getLeafNode(node) {
|
|
while (node && node.firstChild) {
|
|
node = node.firstChild;
|
|
}
|
|
return node;
|
|
}
|
|
|
|
/**
|
|
* Get the next sibling within a container. This will walk up the
|
|
* DOM if a node's siblings have been exhausted.
|
|
*
|
|
* @param {DOMElement|DOMTextNode} node
|
|
* @return {?DOMElement|DOMTextNode}
|
|
*/
|
|
function getSiblingNode(node) {
|
|
while (node) {
|
|
if (node.nextSibling) {
|
|
return node.nextSibling;
|
|
}
|
|
node = node.parentNode;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Get object describing the nodes which contain characters at offset.
|
|
*
|
|
* @param {DOMElement|DOMTextNode} root
|
|
* @param {number} offset
|
|
* @return {?object}
|
|
*/
|
|
function getNodeForCharacterOffset(root, offset) {
|
|
var node = getLeafNode(root);
|
|
var nodeStart = 0;
|
|
var nodeEnd = 0;
|
|
|
|
while (node) {
|
|
if (node.nodeType === 3) {
|
|
nodeEnd = nodeStart + node.textContent.length;
|
|
|
|
if (nodeStart <= offset && nodeEnd >= offset) {
|
|
return {
|
|
node: node,
|
|
offset: offset - nodeStart
|
|
};
|
|
}
|
|
|
|
nodeStart = nodeEnd;
|
|
}
|
|
|
|
node = getLeafNode(getSiblingNode(node));
|
|
}
|
|
}
|
|
|
|
module.exports = getNodeForCharacterOffset;
|
|
|
|
/***/ },
|
|
/* 128 */
|
|
/***/ function(module, exports) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule getActiveElement
|
|
* @typechecks
|
|
*/
|
|
|
|
/* eslint-disable fb-www/typeof-undefined */
|
|
|
|
/**
|
|
* Same as document.activeElement but wraps in a try-catch block. In IE it is
|
|
* not safe to call document.activeElement if there is nothing focused.
|
|
*
|
|
* The activeElement will be null only if the document or document body is not
|
|
* yet defined.
|
|
*/
|
|
'use strict';
|
|
|
|
function getActiveElement() /*?DOMElement*/{
|
|
if (typeof document === 'undefined') {
|
|
return null;
|
|
}
|
|
try {
|
|
return document.activeElement || document.body;
|
|
} catch (e) {
|
|
return document.body;
|
|
}
|
|
}
|
|
|
|
module.exports = getActiveElement;
|
|
|
|
/***/ },
|
|
/* 129 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule SelectEventPlugin
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var EventConstants = __webpack_require__(29);
|
|
var EventPropagators = __webpack_require__(72);
|
|
var ExecutionEnvironment = __webpack_require__(8);
|
|
var ReactInputSelection = __webpack_require__(125);
|
|
var SyntheticEvent = __webpack_require__(76);
|
|
|
|
var getActiveElement = __webpack_require__(128);
|
|
var isTextInputElement = __webpack_require__(81);
|
|
var keyOf = __webpack_require__(78);
|
|
var shallowEqual = __webpack_require__(116);
|
|
|
|
var topLevelTypes = EventConstants.topLevelTypes;
|
|
|
|
var skipSelectionChangeEvent = ExecutionEnvironment.canUseDOM && 'documentMode' in document && document.documentMode <= 11;
|
|
|
|
var eventTypes = {
|
|
select: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onSelect: null }),
|
|
captured: keyOf({ onSelectCapture: null })
|
|
},
|
|
dependencies: [topLevelTypes.topBlur, topLevelTypes.topContextMenu, topLevelTypes.topFocus, topLevelTypes.topKeyDown, topLevelTypes.topMouseDown, topLevelTypes.topMouseUp, topLevelTypes.topSelectionChange]
|
|
}
|
|
};
|
|
|
|
var activeElement = null;
|
|
var activeElementID = null;
|
|
var lastSelection = null;
|
|
var mouseDown = false;
|
|
|
|
// Track whether a listener exists for this plugin. If none exist, we do
|
|
// not extract events.
|
|
var hasListener = false;
|
|
var ON_SELECT_KEY = keyOf({ onSelect: null });
|
|
|
|
/**
|
|
* Get an object which is a unique representation of the current selection.
|
|
*
|
|
* The return value will not be consistent across nodes or browsers, but
|
|
* two identical selections on the same node will return identical objects.
|
|
*
|
|
* @param {DOMElement} node
|
|
* @return {object}
|
|
*/
|
|
function getSelection(node) {
|
|
if ('selectionStart' in node && ReactInputSelection.hasSelectionCapabilities(node)) {
|
|
return {
|
|
start: node.selectionStart,
|
|
end: node.selectionEnd
|
|
};
|
|
} else if (window.getSelection) {
|
|
var selection = window.getSelection();
|
|
return {
|
|
anchorNode: selection.anchorNode,
|
|
anchorOffset: selection.anchorOffset,
|
|
focusNode: selection.focusNode,
|
|
focusOffset: selection.focusOffset
|
|
};
|
|
} else if (document.selection) {
|
|
var range = document.selection.createRange();
|
|
return {
|
|
parentElement: range.parentElement(),
|
|
text: range.text,
|
|
top: range.boundingTop,
|
|
left: range.boundingLeft
|
|
};
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Poll selection to see whether it's changed.
|
|
*
|
|
* @param {object} nativeEvent
|
|
* @return {?SyntheticEvent}
|
|
*/
|
|
function constructSelectEvent(nativeEvent, nativeEventTarget) {
|
|
// Ensure we have the right element, and that the user is not dragging a
|
|
// selection (this matches native `select` event behavior). In HTML5, select
|
|
// fires only on input and textarea thus if there's no focused element we
|
|
// won't dispatch.
|
|
if (mouseDown || activeElement == null || activeElement !== getActiveElement()) {
|
|
return null;
|
|
}
|
|
|
|
// Only fire when selection has actually changed.
|
|
var currentSelection = getSelection(activeElement);
|
|
if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {
|
|
lastSelection = currentSelection;
|
|
|
|
var syntheticEvent = SyntheticEvent.getPooled(eventTypes.select, activeElementID, nativeEvent, nativeEventTarget);
|
|
|
|
syntheticEvent.type = 'select';
|
|
syntheticEvent.target = activeElement;
|
|
|
|
EventPropagators.accumulateTwoPhaseDispatches(syntheticEvent);
|
|
|
|
return syntheticEvent;
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
/**
|
|
* This plugin creates an `onSelect` event that normalizes select events
|
|
* across form elements.
|
|
*
|
|
* Supported elements are:
|
|
* - input (see `isTextInputElement`)
|
|
* - textarea
|
|
* - contentEditable
|
|
*
|
|
* This differs from native browser implementations in the following ways:
|
|
* - Fires on contentEditable fields as well as inputs.
|
|
* - Fires for collapsed selection.
|
|
* - Fires after user input.
|
|
*/
|
|
var SelectEventPlugin = {
|
|
|
|
eventTypes: eventTypes,
|
|
|
|
/**
|
|
* @param {string} topLevelType Record from `EventConstants`.
|
|
* @param {DOMEventTarget} topLevelTarget The listening component root node.
|
|
* @param {string} topLevelTargetID ID of `topLevelTarget`.
|
|
* @param {object} nativeEvent Native browser event.
|
|
* @return {*} An accumulation of synthetic events.
|
|
* @see {EventPluginHub.extractEvents}
|
|
*/
|
|
extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
|
|
if (!hasListener) {
|
|
return null;
|
|
}
|
|
|
|
switch (topLevelType) {
|
|
// Track the input node that has focus.
|
|
case topLevelTypes.topFocus:
|
|
if (isTextInputElement(topLevelTarget) || topLevelTarget.contentEditable === 'true') {
|
|
activeElement = topLevelTarget;
|
|
activeElementID = topLevelTargetID;
|
|
lastSelection = null;
|
|
}
|
|
break;
|
|
case topLevelTypes.topBlur:
|
|
activeElement = null;
|
|
activeElementID = null;
|
|
lastSelection = null;
|
|
break;
|
|
|
|
// Don't fire the event while the user is dragging. This matches the
|
|
// semantics of the native select event.
|
|
case topLevelTypes.topMouseDown:
|
|
mouseDown = true;
|
|
break;
|
|
case topLevelTypes.topContextMenu:
|
|
case topLevelTypes.topMouseUp:
|
|
mouseDown = false;
|
|
return constructSelectEvent(nativeEvent, nativeEventTarget);
|
|
|
|
// Chrome and IE fire non-standard event when selection is changed (and
|
|
// sometimes when it hasn't). IE's event fires out of order with respect
|
|
// to key and input events on deletion, so we discard it.
|
|
//
|
|
// Firefox doesn't support selectionchange, so check selection status
|
|
// after each key entry. The selection changes after keydown and before
|
|
// keyup, but we check on keydown as well in the case of holding down a
|
|
// key, when multiple keydown events are fired but only one keyup is.
|
|
// This is also our approach for IE handling, for the reason above.
|
|
case topLevelTypes.topSelectionChange:
|
|
if (skipSelectionChangeEvent) {
|
|
break;
|
|
}
|
|
// falls through
|
|
case topLevelTypes.topKeyDown:
|
|
case topLevelTypes.topKeyUp:
|
|
return constructSelectEvent(nativeEvent, nativeEventTarget);
|
|
}
|
|
|
|
return null;
|
|
},
|
|
|
|
didPutListener: function (id, registrationName, listener) {
|
|
if (registrationName === ON_SELECT_KEY) {
|
|
hasListener = true;
|
|
}
|
|
}
|
|
};
|
|
|
|
module.exports = SelectEventPlugin;
|
|
|
|
/***/ },
|
|
/* 130 */
|
|
/***/ function(module, exports) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ServerReactRootIndex
|
|
* @typechecks
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
/**
|
|
* Size of the reactRoot ID space. We generate random numbers for React root
|
|
* IDs and if there's a collision the events and DOM update system will
|
|
* get confused. In the future we need a way to generate GUIDs but for
|
|
* now this will work on a smaller scale.
|
|
*/
|
|
var GLOBAL_MOUNT_POINT_MAX = Math.pow(2, 53);
|
|
|
|
var ServerReactRootIndex = {
|
|
createReactRootIndex: function () {
|
|
return Math.ceil(Math.random() * GLOBAL_MOUNT_POINT_MAX);
|
|
}
|
|
};
|
|
|
|
module.exports = ServerReactRootIndex;
|
|
|
|
/***/ },
|
|
/* 131 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule SimpleEventPlugin
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var EventConstants = __webpack_require__(29);
|
|
var EventListener = __webpack_require__(118);
|
|
var EventPropagators = __webpack_require__(72);
|
|
var ReactMount = __webpack_require__(27);
|
|
var SyntheticClipboardEvent = __webpack_require__(132);
|
|
var SyntheticEvent = __webpack_require__(76);
|
|
var SyntheticFocusEvent = __webpack_require__(133);
|
|
var SyntheticKeyboardEvent = __webpack_require__(134);
|
|
var SyntheticMouseEvent = __webpack_require__(85);
|
|
var SyntheticDragEvent = __webpack_require__(137);
|
|
var SyntheticTouchEvent = __webpack_require__(138);
|
|
var SyntheticUIEvent = __webpack_require__(86);
|
|
var SyntheticWheelEvent = __webpack_require__(139);
|
|
|
|
var emptyFunction = __webpack_require__(14);
|
|
var getEventCharCode = __webpack_require__(135);
|
|
var invariant = __webpack_require__(12);
|
|
var keyOf = __webpack_require__(78);
|
|
|
|
var topLevelTypes = EventConstants.topLevelTypes;
|
|
|
|
var eventTypes = {
|
|
abort: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onAbort: true }),
|
|
captured: keyOf({ onAbortCapture: true })
|
|
}
|
|
},
|
|
blur: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onBlur: true }),
|
|
captured: keyOf({ onBlurCapture: true })
|
|
}
|
|
},
|
|
canPlay: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onCanPlay: true }),
|
|
captured: keyOf({ onCanPlayCapture: true })
|
|
}
|
|
},
|
|
canPlayThrough: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onCanPlayThrough: true }),
|
|
captured: keyOf({ onCanPlayThroughCapture: true })
|
|
}
|
|
},
|
|
click: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onClick: true }),
|
|
captured: keyOf({ onClickCapture: true })
|
|
}
|
|
},
|
|
contextMenu: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onContextMenu: true }),
|
|
captured: keyOf({ onContextMenuCapture: true })
|
|
}
|
|
},
|
|
copy: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onCopy: true }),
|
|
captured: keyOf({ onCopyCapture: true })
|
|
}
|
|
},
|
|
cut: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onCut: true }),
|
|
captured: keyOf({ onCutCapture: true })
|
|
}
|
|
},
|
|
doubleClick: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onDoubleClick: true }),
|
|
captured: keyOf({ onDoubleClickCapture: true })
|
|
}
|
|
},
|
|
drag: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onDrag: true }),
|
|
captured: keyOf({ onDragCapture: true })
|
|
}
|
|
},
|
|
dragEnd: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onDragEnd: true }),
|
|
captured: keyOf({ onDragEndCapture: true })
|
|
}
|
|
},
|
|
dragEnter: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onDragEnter: true }),
|
|
captured: keyOf({ onDragEnterCapture: true })
|
|
}
|
|
},
|
|
dragExit: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onDragExit: true }),
|
|
captured: keyOf({ onDragExitCapture: true })
|
|
}
|
|
},
|
|
dragLeave: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onDragLeave: true }),
|
|
captured: keyOf({ onDragLeaveCapture: true })
|
|
}
|
|
},
|
|
dragOver: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onDragOver: true }),
|
|
captured: keyOf({ onDragOverCapture: true })
|
|
}
|
|
},
|
|
dragStart: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onDragStart: true }),
|
|
captured: keyOf({ onDragStartCapture: true })
|
|
}
|
|
},
|
|
drop: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onDrop: true }),
|
|
captured: keyOf({ onDropCapture: true })
|
|
}
|
|
},
|
|
durationChange: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onDurationChange: true }),
|
|
captured: keyOf({ onDurationChangeCapture: true })
|
|
}
|
|
},
|
|
emptied: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onEmptied: true }),
|
|
captured: keyOf({ onEmptiedCapture: true })
|
|
}
|
|
},
|
|
encrypted: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onEncrypted: true }),
|
|
captured: keyOf({ onEncryptedCapture: true })
|
|
}
|
|
},
|
|
ended: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onEnded: true }),
|
|
captured: keyOf({ onEndedCapture: true })
|
|
}
|
|
},
|
|
error: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onError: true }),
|
|
captured: keyOf({ onErrorCapture: true })
|
|
}
|
|
},
|
|
focus: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onFocus: true }),
|
|
captured: keyOf({ onFocusCapture: true })
|
|
}
|
|
},
|
|
input: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onInput: true }),
|
|
captured: keyOf({ onInputCapture: true })
|
|
}
|
|
},
|
|
keyDown: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onKeyDown: true }),
|
|
captured: keyOf({ onKeyDownCapture: true })
|
|
}
|
|
},
|
|
keyPress: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onKeyPress: true }),
|
|
captured: keyOf({ onKeyPressCapture: true })
|
|
}
|
|
},
|
|
keyUp: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onKeyUp: true }),
|
|
captured: keyOf({ onKeyUpCapture: true })
|
|
}
|
|
},
|
|
load: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onLoad: true }),
|
|
captured: keyOf({ onLoadCapture: true })
|
|
}
|
|
},
|
|
loadedData: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onLoadedData: true }),
|
|
captured: keyOf({ onLoadedDataCapture: true })
|
|
}
|
|
},
|
|
loadedMetadata: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onLoadedMetadata: true }),
|
|
captured: keyOf({ onLoadedMetadataCapture: true })
|
|
}
|
|
},
|
|
loadStart: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onLoadStart: true }),
|
|
captured: keyOf({ onLoadStartCapture: true })
|
|
}
|
|
},
|
|
// Note: We do not allow listening to mouseOver events. Instead, use the
|
|
// onMouseEnter/onMouseLeave created by `EnterLeaveEventPlugin`.
|
|
mouseDown: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onMouseDown: true }),
|
|
captured: keyOf({ onMouseDownCapture: true })
|
|
}
|
|
},
|
|
mouseMove: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onMouseMove: true }),
|
|
captured: keyOf({ onMouseMoveCapture: true })
|
|
}
|
|
},
|
|
mouseOut: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onMouseOut: true }),
|
|
captured: keyOf({ onMouseOutCapture: true })
|
|
}
|
|
},
|
|
mouseOver: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onMouseOver: true }),
|
|
captured: keyOf({ onMouseOverCapture: true })
|
|
}
|
|
},
|
|
mouseUp: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onMouseUp: true }),
|
|
captured: keyOf({ onMouseUpCapture: true })
|
|
}
|
|
},
|
|
paste: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onPaste: true }),
|
|
captured: keyOf({ onPasteCapture: true })
|
|
}
|
|
},
|
|
pause: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onPause: true }),
|
|
captured: keyOf({ onPauseCapture: true })
|
|
}
|
|
},
|
|
play: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onPlay: true }),
|
|
captured: keyOf({ onPlayCapture: true })
|
|
}
|
|
},
|
|
playing: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onPlaying: true }),
|
|
captured: keyOf({ onPlayingCapture: true })
|
|
}
|
|
},
|
|
progress: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onProgress: true }),
|
|
captured: keyOf({ onProgressCapture: true })
|
|
}
|
|
},
|
|
rateChange: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onRateChange: true }),
|
|
captured: keyOf({ onRateChangeCapture: true })
|
|
}
|
|
},
|
|
reset: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onReset: true }),
|
|
captured: keyOf({ onResetCapture: true })
|
|
}
|
|
},
|
|
scroll: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onScroll: true }),
|
|
captured: keyOf({ onScrollCapture: true })
|
|
}
|
|
},
|
|
seeked: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onSeeked: true }),
|
|
captured: keyOf({ onSeekedCapture: true })
|
|
}
|
|
},
|
|
seeking: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onSeeking: true }),
|
|
captured: keyOf({ onSeekingCapture: true })
|
|
}
|
|
},
|
|
stalled: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onStalled: true }),
|
|
captured: keyOf({ onStalledCapture: true })
|
|
}
|
|
},
|
|
submit: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onSubmit: true }),
|
|
captured: keyOf({ onSubmitCapture: true })
|
|
}
|
|
},
|
|
suspend: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onSuspend: true }),
|
|
captured: keyOf({ onSuspendCapture: true })
|
|
}
|
|
},
|
|
timeUpdate: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onTimeUpdate: true }),
|
|
captured: keyOf({ onTimeUpdateCapture: true })
|
|
}
|
|
},
|
|
touchCancel: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onTouchCancel: true }),
|
|
captured: keyOf({ onTouchCancelCapture: true })
|
|
}
|
|
},
|
|
touchEnd: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onTouchEnd: true }),
|
|
captured: keyOf({ onTouchEndCapture: true })
|
|
}
|
|
},
|
|
touchMove: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onTouchMove: true }),
|
|
captured: keyOf({ onTouchMoveCapture: true })
|
|
}
|
|
},
|
|
touchStart: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onTouchStart: true }),
|
|
captured: keyOf({ onTouchStartCapture: true })
|
|
}
|
|
},
|
|
volumeChange: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onVolumeChange: true }),
|
|
captured: keyOf({ onVolumeChangeCapture: true })
|
|
}
|
|
},
|
|
waiting: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onWaiting: true }),
|
|
captured: keyOf({ onWaitingCapture: true })
|
|
}
|
|
},
|
|
wheel: {
|
|
phasedRegistrationNames: {
|
|
bubbled: keyOf({ onWheel: true }),
|
|
captured: keyOf({ onWheelCapture: true })
|
|
}
|
|
}
|
|
};
|
|
|
|
var topLevelEventsToDispatchConfig = {
|
|
topAbort: eventTypes.abort,
|
|
topBlur: eventTypes.blur,
|
|
topCanPlay: eventTypes.canPlay,
|
|
topCanPlayThrough: eventTypes.canPlayThrough,
|
|
topClick: eventTypes.click,
|
|
topContextMenu: eventTypes.contextMenu,
|
|
topCopy: eventTypes.copy,
|
|
topCut: eventTypes.cut,
|
|
topDoubleClick: eventTypes.doubleClick,
|
|
topDrag: eventTypes.drag,
|
|
topDragEnd: eventTypes.dragEnd,
|
|
topDragEnter: eventTypes.dragEnter,
|
|
topDragExit: eventTypes.dragExit,
|
|
topDragLeave: eventTypes.dragLeave,
|
|
topDragOver: eventTypes.dragOver,
|
|
topDragStart: eventTypes.dragStart,
|
|
topDrop: eventTypes.drop,
|
|
topDurationChange: eventTypes.durationChange,
|
|
topEmptied: eventTypes.emptied,
|
|
topEncrypted: eventTypes.encrypted,
|
|
topEnded: eventTypes.ended,
|
|
topError: eventTypes.error,
|
|
topFocus: eventTypes.focus,
|
|
topInput: eventTypes.input,
|
|
topKeyDown: eventTypes.keyDown,
|
|
topKeyPress: eventTypes.keyPress,
|
|
topKeyUp: eventTypes.keyUp,
|
|
topLoad: eventTypes.load,
|
|
topLoadedData: eventTypes.loadedData,
|
|
topLoadedMetadata: eventTypes.loadedMetadata,
|
|
topLoadStart: eventTypes.loadStart,
|
|
topMouseDown: eventTypes.mouseDown,
|
|
topMouseMove: eventTypes.mouseMove,
|
|
topMouseOut: eventTypes.mouseOut,
|
|
topMouseOver: eventTypes.mouseOver,
|
|
topMouseUp: eventTypes.mouseUp,
|
|
topPaste: eventTypes.paste,
|
|
topPause: eventTypes.pause,
|
|
topPlay: eventTypes.play,
|
|
topPlaying: eventTypes.playing,
|
|
topProgress: eventTypes.progress,
|
|
topRateChange: eventTypes.rateChange,
|
|
topReset: eventTypes.reset,
|
|
topScroll: eventTypes.scroll,
|
|
topSeeked: eventTypes.seeked,
|
|
topSeeking: eventTypes.seeking,
|
|
topStalled: eventTypes.stalled,
|
|
topSubmit: eventTypes.submit,
|
|
topSuspend: eventTypes.suspend,
|
|
topTimeUpdate: eventTypes.timeUpdate,
|
|
topTouchCancel: eventTypes.touchCancel,
|
|
topTouchEnd: eventTypes.touchEnd,
|
|
topTouchMove: eventTypes.touchMove,
|
|
topTouchStart: eventTypes.touchStart,
|
|
topVolumeChange: eventTypes.volumeChange,
|
|
topWaiting: eventTypes.waiting,
|
|
topWheel: eventTypes.wheel
|
|
};
|
|
|
|
for (var type in topLevelEventsToDispatchConfig) {
|
|
topLevelEventsToDispatchConfig[type].dependencies = [type];
|
|
}
|
|
|
|
var ON_CLICK_KEY = keyOf({ onClick: null });
|
|
var onClickListeners = {};
|
|
|
|
var SimpleEventPlugin = {
|
|
|
|
eventTypes: eventTypes,
|
|
|
|
/**
|
|
* @param {string} topLevelType Record from `EventConstants`.
|
|
* @param {DOMEventTarget} topLevelTarget The listening component root node.
|
|
* @param {string} topLevelTargetID ID of `topLevelTarget`.
|
|
* @param {object} nativeEvent Native browser event.
|
|
* @return {*} An accumulation of synthetic events.
|
|
* @see {EventPluginHub.extractEvents}
|
|
*/
|
|
extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
|
|
var dispatchConfig = topLevelEventsToDispatchConfig[topLevelType];
|
|
if (!dispatchConfig) {
|
|
return null;
|
|
}
|
|
var EventConstructor;
|
|
switch (topLevelType) {
|
|
case topLevelTypes.topAbort:
|
|
case topLevelTypes.topCanPlay:
|
|
case topLevelTypes.topCanPlayThrough:
|
|
case topLevelTypes.topDurationChange:
|
|
case topLevelTypes.topEmptied:
|
|
case topLevelTypes.topEncrypted:
|
|
case topLevelTypes.topEnded:
|
|
case topLevelTypes.topError:
|
|
case topLevelTypes.topInput:
|
|
case topLevelTypes.topLoad:
|
|
case topLevelTypes.topLoadedData:
|
|
case topLevelTypes.topLoadedMetadata:
|
|
case topLevelTypes.topLoadStart:
|
|
case topLevelTypes.topPause:
|
|
case topLevelTypes.topPlay:
|
|
case topLevelTypes.topPlaying:
|
|
case topLevelTypes.topProgress:
|
|
case topLevelTypes.topRateChange:
|
|
case topLevelTypes.topReset:
|
|
case topLevelTypes.topSeeked:
|
|
case topLevelTypes.topSeeking:
|
|
case topLevelTypes.topStalled:
|
|
case topLevelTypes.topSubmit:
|
|
case topLevelTypes.topSuspend:
|
|
case topLevelTypes.topTimeUpdate:
|
|
case topLevelTypes.topVolumeChange:
|
|
case topLevelTypes.topWaiting:
|
|
// HTML Events
|
|
// @see http://www.w3.org/TR/html5/index.html#events-0
|
|
EventConstructor = SyntheticEvent;
|
|
break;
|
|
case topLevelTypes.topKeyPress:
|
|
// FireFox creates a keypress event for function keys too. This removes
|
|
// the unwanted keypress events. Enter is however both printable and
|
|
// non-printable. One would expect Tab to be as well (but it isn't).
|
|
if (getEventCharCode(nativeEvent) === 0) {
|
|
return null;
|
|
}
|
|
/* falls through */
|
|
case topLevelTypes.topKeyDown:
|
|
case topLevelTypes.topKeyUp:
|
|
EventConstructor = SyntheticKeyboardEvent;
|
|
break;
|
|
case topLevelTypes.topBlur:
|
|
case topLevelTypes.topFocus:
|
|
EventConstructor = SyntheticFocusEvent;
|
|
break;
|
|
case topLevelTypes.topClick:
|
|
// Firefox creates a click event on right mouse clicks. This removes the
|
|
// unwanted click events.
|
|
if (nativeEvent.button === 2) {
|
|
return null;
|
|
}
|
|
/* falls through */
|
|
case topLevelTypes.topContextMenu:
|
|
case topLevelTypes.topDoubleClick:
|
|
case topLevelTypes.topMouseDown:
|
|
case topLevelTypes.topMouseMove:
|
|
case topLevelTypes.topMouseOut:
|
|
case topLevelTypes.topMouseOver:
|
|
case topLevelTypes.topMouseUp:
|
|
EventConstructor = SyntheticMouseEvent;
|
|
break;
|
|
case topLevelTypes.topDrag:
|
|
case topLevelTypes.topDragEnd:
|
|
case topLevelTypes.topDragEnter:
|
|
case topLevelTypes.topDragExit:
|
|
case topLevelTypes.topDragLeave:
|
|
case topLevelTypes.topDragOver:
|
|
case topLevelTypes.topDragStart:
|
|
case topLevelTypes.topDrop:
|
|
EventConstructor = SyntheticDragEvent;
|
|
break;
|
|
case topLevelTypes.topTouchCancel:
|
|
case topLevelTypes.topTouchEnd:
|
|
case topLevelTypes.topTouchMove:
|
|
case topLevelTypes.topTouchStart:
|
|
EventConstructor = SyntheticTouchEvent;
|
|
break;
|
|
case topLevelTypes.topScroll:
|
|
EventConstructor = SyntheticUIEvent;
|
|
break;
|
|
case topLevelTypes.topWheel:
|
|
EventConstructor = SyntheticWheelEvent;
|
|
break;
|
|
case topLevelTypes.topCopy:
|
|
case topLevelTypes.topCut:
|
|
case topLevelTypes.topPaste:
|
|
EventConstructor = SyntheticClipboardEvent;
|
|
break;
|
|
}
|
|
!EventConstructor ? process.env.NODE_ENV !== 'production' ? invariant(false, 'SimpleEventPlugin: Unhandled event type, `%s`.', topLevelType) : invariant(false) : undefined;
|
|
var event = EventConstructor.getPooled(dispatchConfig, topLevelTargetID, nativeEvent, nativeEventTarget);
|
|
EventPropagators.accumulateTwoPhaseDispatches(event);
|
|
return event;
|
|
},
|
|
|
|
didPutListener: function (id, registrationName, listener) {
|
|
// Mobile Safari does not fire properly bubble click events on
|
|
// non-interactive elements, which means delegated click listeners do not
|
|
// fire. The workaround for this bug involves attaching an empty click
|
|
// listener on the target node.
|
|
if (registrationName === ON_CLICK_KEY) {
|
|
var node = ReactMount.getNode(id);
|
|
if (!onClickListeners[id]) {
|
|
onClickListeners[id] = EventListener.listen(node, 'click', emptyFunction);
|
|
}
|
|
}
|
|
},
|
|
|
|
willDeleteListener: function (id, registrationName) {
|
|
if (registrationName === ON_CLICK_KEY) {
|
|
onClickListeners[id].remove();
|
|
delete onClickListeners[id];
|
|
}
|
|
}
|
|
|
|
};
|
|
|
|
module.exports = SimpleEventPlugin;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 132 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule SyntheticClipboardEvent
|
|
* @typechecks static-only
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var SyntheticEvent = __webpack_require__(76);
|
|
|
|
/**
|
|
* @interface Event
|
|
* @see http://www.w3.org/TR/clipboard-apis/
|
|
*/
|
|
var ClipboardEventInterface = {
|
|
clipboardData: function (event) {
|
|
return 'clipboardData' in event ? event.clipboardData : window.clipboardData;
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @param {object} dispatchConfig Configuration used to dispatch this event.
|
|
* @param {string} dispatchMarker Marker identifying the event target.
|
|
* @param {object} nativeEvent Native browser event.
|
|
* @extends {SyntheticUIEvent}
|
|
*/
|
|
function SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
|
SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
|
}
|
|
|
|
SyntheticEvent.augmentClass(SyntheticClipboardEvent, ClipboardEventInterface);
|
|
|
|
module.exports = SyntheticClipboardEvent;
|
|
|
|
/***/ },
|
|
/* 133 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule SyntheticFocusEvent
|
|
* @typechecks static-only
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var SyntheticUIEvent = __webpack_require__(86);
|
|
|
|
/**
|
|
* @interface FocusEvent
|
|
* @see http://www.w3.org/TR/DOM-Level-3-Events/
|
|
*/
|
|
var FocusEventInterface = {
|
|
relatedTarget: null
|
|
};
|
|
|
|
/**
|
|
* @param {object} dispatchConfig Configuration used to dispatch this event.
|
|
* @param {string} dispatchMarker Marker identifying the event target.
|
|
* @param {object} nativeEvent Native browser event.
|
|
* @extends {SyntheticUIEvent}
|
|
*/
|
|
function SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
|
SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
|
}
|
|
|
|
SyntheticUIEvent.augmentClass(SyntheticFocusEvent, FocusEventInterface);
|
|
|
|
module.exports = SyntheticFocusEvent;
|
|
|
|
/***/ },
|
|
/* 134 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule SyntheticKeyboardEvent
|
|
* @typechecks static-only
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var SyntheticUIEvent = __webpack_require__(86);
|
|
|
|
var getEventCharCode = __webpack_require__(135);
|
|
var getEventKey = __webpack_require__(136);
|
|
var getEventModifierState = __webpack_require__(87);
|
|
|
|
/**
|
|
* @interface KeyboardEvent
|
|
* @see http://www.w3.org/TR/DOM-Level-3-Events/
|
|
*/
|
|
var KeyboardEventInterface = {
|
|
key: getEventKey,
|
|
location: null,
|
|
ctrlKey: null,
|
|
shiftKey: null,
|
|
altKey: null,
|
|
metaKey: null,
|
|
repeat: null,
|
|
locale: null,
|
|
getModifierState: getEventModifierState,
|
|
// Legacy Interface
|
|
charCode: function (event) {
|
|
// `charCode` is the result of a KeyPress event and represents the value of
|
|
// the actual printable character.
|
|
|
|
// KeyPress is deprecated, but its replacement is not yet final and not
|
|
// implemented in any major browser. Only KeyPress has charCode.
|
|
if (event.type === 'keypress') {
|
|
return getEventCharCode(event);
|
|
}
|
|
return 0;
|
|
},
|
|
keyCode: function (event) {
|
|
// `keyCode` is the result of a KeyDown/Up event and represents the value of
|
|
// physical keyboard key.
|
|
|
|
// The actual meaning of the value depends on the users' keyboard layout
|
|
// which cannot be detected. Assuming that it is a US keyboard layout
|
|
// provides a surprisingly accurate mapping for US and European users.
|
|
// Due to this, it is left to the user to implement at this time.
|
|
if (event.type === 'keydown' || event.type === 'keyup') {
|
|
return event.keyCode;
|
|
}
|
|
return 0;
|
|
},
|
|
which: function (event) {
|
|
// `which` is an alias for either `keyCode` or `charCode` depending on the
|
|
// type of the event.
|
|
if (event.type === 'keypress') {
|
|
return getEventCharCode(event);
|
|
}
|
|
if (event.type === 'keydown' || event.type === 'keyup') {
|
|
return event.keyCode;
|
|
}
|
|
return 0;
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @param {object} dispatchConfig Configuration used to dispatch this event.
|
|
* @param {string} dispatchMarker Marker identifying the event target.
|
|
* @param {object} nativeEvent Native browser event.
|
|
* @extends {SyntheticUIEvent}
|
|
*/
|
|
function SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
|
SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
|
}
|
|
|
|
SyntheticUIEvent.augmentClass(SyntheticKeyboardEvent, KeyboardEventInterface);
|
|
|
|
module.exports = SyntheticKeyboardEvent;
|
|
|
|
/***/ },
|
|
/* 135 */
|
|
/***/ function(module, exports) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule getEventCharCode
|
|
* @typechecks static-only
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
/**
|
|
* `charCode` represents the actual "character code" and is safe to use with
|
|
* `String.fromCharCode`. As such, only keys that correspond to printable
|
|
* characters produce a valid `charCode`, the only exception to this is Enter.
|
|
* The Tab-key is considered non-printable and does not have a `charCode`,
|
|
* presumably because it does not produce a tab-character in browsers.
|
|
*
|
|
* @param {object} nativeEvent Native browser event.
|
|
* @return {number} Normalized `charCode` property.
|
|
*/
|
|
function getEventCharCode(nativeEvent) {
|
|
var charCode;
|
|
var keyCode = nativeEvent.keyCode;
|
|
|
|
if ('charCode' in nativeEvent) {
|
|
charCode = nativeEvent.charCode;
|
|
|
|
// FF does not set `charCode` for the Enter-key, check against `keyCode`.
|
|
if (charCode === 0 && keyCode === 13) {
|
|
charCode = 13;
|
|
}
|
|
} else {
|
|
// IE8 does not implement `charCode`, but `keyCode` has the correct value.
|
|
charCode = keyCode;
|
|
}
|
|
|
|
// Some non-printable keys are reported in `charCode`/`keyCode`, discard them.
|
|
// Must not discard the (non-)printable Enter-key.
|
|
if (charCode >= 32 || charCode === 13) {
|
|
return charCode;
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|
|
module.exports = getEventCharCode;
|
|
|
|
/***/ },
|
|
/* 136 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule getEventKey
|
|
* @typechecks static-only
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var getEventCharCode = __webpack_require__(135);
|
|
|
|
/**
|
|
* Normalization of deprecated HTML5 `key` values
|
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
|
|
*/
|
|
var normalizeKey = {
|
|
'Esc': 'Escape',
|
|
'Spacebar': ' ',
|
|
'Left': 'ArrowLeft',
|
|
'Up': 'ArrowUp',
|
|
'Right': 'ArrowRight',
|
|
'Down': 'ArrowDown',
|
|
'Del': 'Delete',
|
|
'Win': 'OS',
|
|
'Menu': 'ContextMenu',
|
|
'Apps': 'ContextMenu',
|
|
'Scroll': 'ScrollLock',
|
|
'MozPrintableKey': 'Unidentified'
|
|
};
|
|
|
|
/**
|
|
* Translation from legacy `keyCode` to HTML5 `key`
|
|
* Only special keys supported, all others depend on keyboard layout or browser
|
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
|
|
*/
|
|
var translateToKey = {
|
|
8: 'Backspace',
|
|
9: 'Tab',
|
|
12: 'Clear',
|
|
13: 'Enter',
|
|
16: 'Shift',
|
|
17: 'Control',
|
|
18: 'Alt',
|
|
19: 'Pause',
|
|
20: 'CapsLock',
|
|
27: 'Escape',
|
|
32: ' ',
|
|
33: 'PageUp',
|
|
34: 'PageDown',
|
|
35: 'End',
|
|
36: 'Home',
|
|
37: 'ArrowLeft',
|
|
38: 'ArrowUp',
|
|
39: 'ArrowRight',
|
|
40: 'ArrowDown',
|
|
45: 'Insert',
|
|
46: 'Delete',
|
|
112: 'F1', 113: 'F2', 114: 'F3', 115: 'F4', 116: 'F5', 117: 'F6',
|
|
118: 'F7', 119: 'F8', 120: 'F9', 121: 'F10', 122: 'F11', 123: 'F12',
|
|
144: 'NumLock',
|
|
145: 'ScrollLock',
|
|
224: 'Meta'
|
|
};
|
|
|
|
/**
|
|
* @param {object} nativeEvent Native browser event.
|
|
* @return {string} Normalized `key` property.
|
|
*/
|
|
function getEventKey(nativeEvent) {
|
|
if (nativeEvent.key) {
|
|
// Normalize inconsistent values reported by browsers due to
|
|
// implementations of a working draft specification.
|
|
|
|
// FireFox implements `key` but returns `MozPrintableKey` for all
|
|
// printable characters (normalized to `Unidentified`), ignore it.
|
|
var key = normalizeKey[nativeEvent.key] || nativeEvent.key;
|
|
if (key !== 'Unidentified') {
|
|
return key;
|
|
}
|
|
}
|
|
|
|
// Browser does not implement `key`, polyfill as much of it as we can.
|
|
if (nativeEvent.type === 'keypress') {
|
|
var charCode = getEventCharCode(nativeEvent);
|
|
|
|
// The enter-key is technically both printable and non-printable and can
|
|
// thus be captured by `keypress`, no other non-printable key should.
|
|
return charCode === 13 ? 'Enter' : String.fromCharCode(charCode);
|
|
}
|
|
if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') {
|
|
// While user keyboard layout determines the actual meaning of each
|
|
// `keyCode` value, almost all function keys have a universal value.
|
|
return translateToKey[nativeEvent.keyCode] || 'Unidentified';
|
|
}
|
|
return '';
|
|
}
|
|
|
|
module.exports = getEventKey;
|
|
|
|
/***/ },
|
|
/* 137 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule SyntheticDragEvent
|
|
* @typechecks static-only
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var SyntheticMouseEvent = __webpack_require__(85);
|
|
|
|
/**
|
|
* @interface DragEvent
|
|
* @see http://www.w3.org/TR/DOM-Level-3-Events/
|
|
*/
|
|
var DragEventInterface = {
|
|
dataTransfer: null
|
|
};
|
|
|
|
/**
|
|
* @param {object} dispatchConfig Configuration used to dispatch this event.
|
|
* @param {string} dispatchMarker Marker identifying the event target.
|
|
* @param {object} nativeEvent Native browser event.
|
|
* @extends {SyntheticUIEvent}
|
|
*/
|
|
function SyntheticDragEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
|
SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
|
}
|
|
|
|
SyntheticMouseEvent.augmentClass(SyntheticDragEvent, DragEventInterface);
|
|
|
|
module.exports = SyntheticDragEvent;
|
|
|
|
/***/ },
|
|
/* 138 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule SyntheticTouchEvent
|
|
* @typechecks static-only
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var SyntheticUIEvent = __webpack_require__(86);
|
|
|
|
var getEventModifierState = __webpack_require__(87);
|
|
|
|
/**
|
|
* @interface TouchEvent
|
|
* @see http://www.w3.org/TR/touch-events/
|
|
*/
|
|
var TouchEventInterface = {
|
|
touches: null,
|
|
targetTouches: null,
|
|
changedTouches: null,
|
|
altKey: null,
|
|
metaKey: null,
|
|
ctrlKey: null,
|
|
shiftKey: null,
|
|
getModifierState: getEventModifierState
|
|
};
|
|
|
|
/**
|
|
* @param {object} dispatchConfig Configuration used to dispatch this event.
|
|
* @param {string} dispatchMarker Marker identifying the event target.
|
|
* @param {object} nativeEvent Native browser event.
|
|
* @extends {SyntheticUIEvent}
|
|
*/
|
|
function SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
|
SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
|
}
|
|
|
|
SyntheticUIEvent.augmentClass(SyntheticTouchEvent, TouchEventInterface);
|
|
|
|
module.exports = SyntheticTouchEvent;
|
|
|
|
/***/ },
|
|
/* 139 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule SyntheticWheelEvent
|
|
* @typechecks static-only
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var SyntheticMouseEvent = __webpack_require__(85);
|
|
|
|
/**
|
|
* @interface WheelEvent
|
|
* @see http://www.w3.org/TR/DOM-Level-3-Events/
|
|
*/
|
|
var WheelEventInterface = {
|
|
deltaX: function (event) {
|
|
return 'deltaX' in event ? event.deltaX :
|
|
// Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).
|
|
'wheelDeltaX' in event ? -event.wheelDeltaX : 0;
|
|
},
|
|
deltaY: function (event) {
|
|
return 'deltaY' in event ? event.deltaY :
|
|
// Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).
|
|
'wheelDeltaY' in event ? -event.wheelDeltaY :
|
|
// Fallback to `wheelDelta` for IE<9 and normalize (down is positive).
|
|
'wheelDelta' in event ? -event.wheelDelta : 0;
|
|
},
|
|
deltaZ: null,
|
|
|
|
// Browsers without "deltaMode" is reporting in raw wheel delta where one
|
|
// notch on the scroll is always +/- 120, roughly equivalent to pixels.
|
|
// A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or
|
|
// ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.
|
|
deltaMode: null
|
|
};
|
|
|
|
/**
|
|
* @param {object} dispatchConfig Configuration used to dispatch this event.
|
|
* @param {string} dispatchMarker Marker identifying the event target.
|
|
* @param {object} nativeEvent Native browser event.
|
|
* @extends {SyntheticMouseEvent}
|
|
*/
|
|
function SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
|
SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
|
}
|
|
|
|
SyntheticMouseEvent.augmentClass(SyntheticWheelEvent, WheelEventInterface);
|
|
|
|
module.exports = SyntheticWheelEvent;
|
|
|
|
/***/ },
|
|
/* 140 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule SVGDOMPropertyConfig
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var DOMProperty = __webpack_require__(22);
|
|
|
|
var MUST_USE_ATTRIBUTE = DOMProperty.injection.MUST_USE_ATTRIBUTE;
|
|
|
|
var NS = {
|
|
xlink: 'http://www.w3.org/1999/xlink',
|
|
xml: 'http://www.w3.org/XML/1998/namespace'
|
|
};
|
|
|
|
var SVGDOMPropertyConfig = {
|
|
Properties: {
|
|
clipPath: MUST_USE_ATTRIBUTE,
|
|
cx: MUST_USE_ATTRIBUTE,
|
|
cy: MUST_USE_ATTRIBUTE,
|
|
d: MUST_USE_ATTRIBUTE,
|
|
dx: MUST_USE_ATTRIBUTE,
|
|
dy: MUST_USE_ATTRIBUTE,
|
|
fill: MUST_USE_ATTRIBUTE,
|
|
fillOpacity: MUST_USE_ATTRIBUTE,
|
|
fontFamily: MUST_USE_ATTRIBUTE,
|
|
fontSize: MUST_USE_ATTRIBUTE,
|
|
fx: MUST_USE_ATTRIBUTE,
|
|
fy: MUST_USE_ATTRIBUTE,
|
|
gradientTransform: MUST_USE_ATTRIBUTE,
|
|
gradientUnits: MUST_USE_ATTRIBUTE,
|
|
markerEnd: MUST_USE_ATTRIBUTE,
|
|
markerMid: MUST_USE_ATTRIBUTE,
|
|
markerStart: MUST_USE_ATTRIBUTE,
|
|
offset: MUST_USE_ATTRIBUTE,
|
|
opacity: MUST_USE_ATTRIBUTE,
|
|
patternContentUnits: MUST_USE_ATTRIBUTE,
|
|
patternUnits: MUST_USE_ATTRIBUTE,
|
|
points: MUST_USE_ATTRIBUTE,
|
|
preserveAspectRatio: MUST_USE_ATTRIBUTE,
|
|
r: MUST_USE_ATTRIBUTE,
|
|
rx: MUST_USE_ATTRIBUTE,
|
|
ry: MUST_USE_ATTRIBUTE,
|
|
spreadMethod: MUST_USE_ATTRIBUTE,
|
|
stopColor: MUST_USE_ATTRIBUTE,
|
|
stopOpacity: MUST_USE_ATTRIBUTE,
|
|
stroke: MUST_USE_ATTRIBUTE,
|
|
strokeDasharray: MUST_USE_ATTRIBUTE,
|
|
strokeLinecap: MUST_USE_ATTRIBUTE,
|
|
strokeOpacity: MUST_USE_ATTRIBUTE,
|
|
strokeWidth: MUST_USE_ATTRIBUTE,
|
|
textAnchor: MUST_USE_ATTRIBUTE,
|
|
transform: MUST_USE_ATTRIBUTE,
|
|
version: MUST_USE_ATTRIBUTE,
|
|
viewBox: MUST_USE_ATTRIBUTE,
|
|
x1: MUST_USE_ATTRIBUTE,
|
|
x2: MUST_USE_ATTRIBUTE,
|
|
x: MUST_USE_ATTRIBUTE,
|
|
xlinkActuate: MUST_USE_ATTRIBUTE,
|
|
xlinkArcrole: MUST_USE_ATTRIBUTE,
|
|
xlinkHref: MUST_USE_ATTRIBUTE,
|
|
xlinkRole: MUST_USE_ATTRIBUTE,
|
|
xlinkShow: MUST_USE_ATTRIBUTE,
|
|
xlinkTitle: MUST_USE_ATTRIBUTE,
|
|
xlinkType: MUST_USE_ATTRIBUTE,
|
|
xmlBase: MUST_USE_ATTRIBUTE,
|
|
xmlLang: MUST_USE_ATTRIBUTE,
|
|
xmlSpace: MUST_USE_ATTRIBUTE,
|
|
y1: MUST_USE_ATTRIBUTE,
|
|
y2: MUST_USE_ATTRIBUTE,
|
|
y: MUST_USE_ATTRIBUTE
|
|
},
|
|
DOMAttributeNamespaces: {
|
|
xlinkActuate: NS.xlink,
|
|
xlinkArcrole: NS.xlink,
|
|
xlinkHref: NS.xlink,
|
|
xlinkRole: NS.xlink,
|
|
xlinkShow: NS.xlink,
|
|
xlinkTitle: NS.xlink,
|
|
xlinkType: NS.xlink,
|
|
xmlBase: NS.xml,
|
|
xmlLang: NS.xml,
|
|
xmlSpace: NS.xml
|
|
},
|
|
DOMAttributeNames: {
|
|
clipPath: 'clip-path',
|
|
fillOpacity: 'fill-opacity',
|
|
fontFamily: 'font-family',
|
|
fontSize: 'font-size',
|
|
gradientTransform: 'gradientTransform',
|
|
gradientUnits: 'gradientUnits',
|
|
markerEnd: 'marker-end',
|
|
markerMid: 'marker-mid',
|
|
markerStart: 'marker-start',
|
|
patternContentUnits: 'patternContentUnits',
|
|
patternUnits: 'patternUnits',
|
|
preserveAspectRatio: 'preserveAspectRatio',
|
|
spreadMethod: 'spreadMethod',
|
|
stopColor: 'stop-color',
|
|
stopOpacity: 'stop-opacity',
|
|
strokeDasharray: 'stroke-dasharray',
|
|
strokeLinecap: 'stroke-linecap',
|
|
strokeOpacity: 'stroke-opacity',
|
|
strokeWidth: 'stroke-width',
|
|
textAnchor: 'text-anchor',
|
|
viewBox: 'viewBox',
|
|
xlinkActuate: 'xlink:actuate',
|
|
xlinkArcrole: 'xlink:arcrole',
|
|
xlinkHref: 'xlink:href',
|
|
xlinkRole: 'xlink:role',
|
|
xlinkShow: 'xlink:show',
|
|
xlinkTitle: 'xlink:title',
|
|
xlinkType: 'xlink:type',
|
|
xmlBase: 'xml:base',
|
|
xmlLang: 'xml:lang',
|
|
xmlSpace: 'xml:space'
|
|
}
|
|
};
|
|
|
|
module.exports = SVGDOMPropertyConfig;
|
|
|
|
/***/ },
|
|
/* 141 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactDefaultPerf
|
|
* @typechecks static-only
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var DOMProperty = __webpack_require__(22);
|
|
var ReactDefaultPerfAnalysis = __webpack_require__(142);
|
|
var ReactMount = __webpack_require__(27);
|
|
var ReactPerf = __webpack_require__(17);
|
|
|
|
var performanceNow = __webpack_require__(143);
|
|
|
|
function roundFloat(val) {
|
|
return Math.floor(val * 100) / 100;
|
|
}
|
|
|
|
function addValue(obj, key, val) {
|
|
obj[key] = (obj[key] || 0) + val;
|
|
}
|
|
|
|
var ReactDefaultPerf = {
|
|
_allMeasurements: [], // last item in the list is the current one
|
|
_mountStack: [0],
|
|
_injected: false,
|
|
|
|
start: function () {
|
|
if (!ReactDefaultPerf._injected) {
|
|
ReactPerf.injection.injectMeasure(ReactDefaultPerf.measure);
|
|
}
|
|
|
|
ReactDefaultPerf._allMeasurements.length = 0;
|
|
ReactPerf.enableMeasure = true;
|
|
},
|
|
|
|
stop: function () {
|
|
ReactPerf.enableMeasure = false;
|
|
},
|
|
|
|
getLastMeasurements: function () {
|
|
return ReactDefaultPerf._allMeasurements;
|
|
},
|
|
|
|
printExclusive: function (measurements) {
|
|
measurements = measurements || ReactDefaultPerf._allMeasurements;
|
|
var summary = ReactDefaultPerfAnalysis.getExclusiveSummary(measurements);
|
|
console.table(summary.map(function (item) {
|
|
return {
|
|
'Component class name': item.componentName,
|
|
'Total inclusive time (ms)': roundFloat(item.inclusive),
|
|
'Exclusive mount time (ms)': roundFloat(item.exclusive),
|
|
'Exclusive render time (ms)': roundFloat(item.render),
|
|
'Mount time per instance (ms)': roundFloat(item.exclusive / item.count),
|
|
'Render time per instance (ms)': roundFloat(item.render / item.count),
|
|
'Instances': item.count
|
|
};
|
|
}));
|
|
// TODO: ReactDefaultPerfAnalysis.getTotalTime() does not return the correct
|
|
// number.
|
|
},
|
|
|
|
printInclusive: function (measurements) {
|
|
measurements = measurements || ReactDefaultPerf._allMeasurements;
|
|
var summary = ReactDefaultPerfAnalysis.getInclusiveSummary(measurements);
|
|
console.table(summary.map(function (item) {
|
|
return {
|
|
'Owner > component': item.componentName,
|
|
'Inclusive time (ms)': roundFloat(item.time),
|
|
'Instances': item.count
|
|
};
|
|
}));
|
|
console.log('Total time:', ReactDefaultPerfAnalysis.getTotalTime(measurements).toFixed(2) + ' ms');
|
|
},
|
|
|
|
getMeasurementsSummaryMap: function (measurements) {
|
|
var summary = ReactDefaultPerfAnalysis.getInclusiveSummary(measurements, true);
|
|
return summary.map(function (item) {
|
|
return {
|
|
'Owner > component': item.componentName,
|
|
'Wasted time (ms)': item.time,
|
|
'Instances': item.count
|
|
};
|
|
});
|
|
},
|
|
|
|
printWasted: function (measurements) {
|
|
measurements = measurements || ReactDefaultPerf._allMeasurements;
|
|
console.table(ReactDefaultPerf.getMeasurementsSummaryMap(measurements));
|
|
console.log('Total time:', ReactDefaultPerfAnalysis.getTotalTime(measurements).toFixed(2) + ' ms');
|
|
},
|
|
|
|
printDOM: function (measurements) {
|
|
measurements = measurements || ReactDefaultPerf._allMeasurements;
|
|
var summary = ReactDefaultPerfAnalysis.getDOMSummary(measurements);
|
|
console.table(summary.map(function (item) {
|
|
var result = {};
|
|
result[DOMProperty.ID_ATTRIBUTE_NAME] = item.id;
|
|
result.type = item.type;
|
|
result.args = JSON.stringify(item.args);
|
|
return result;
|
|
}));
|
|
console.log('Total time:', ReactDefaultPerfAnalysis.getTotalTime(measurements).toFixed(2) + ' ms');
|
|
},
|
|
|
|
_recordWrite: function (id, fnName, totalTime, args) {
|
|
// TODO: totalTime isn't that useful since it doesn't count paints/reflows
|
|
var writes = ReactDefaultPerf._allMeasurements[ReactDefaultPerf._allMeasurements.length - 1].writes;
|
|
writes[id] = writes[id] || [];
|
|
writes[id].push({
|
|
type: fnName,
|
|
time: totalTime,
|
|
args: args
|
|
});
|
|
},
|
|
|
|
measure: function (moduleName, fnName, func) {
|
|
return function () {
|
|
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
|
|
var totalTime;
|
|
var rv;
|
|
var start;
|
|
|
|
if (fnName === '_renderNewRootComponent' || fnName === 'flushBatchedUpdates') {
|
|
// A "measurement" is a set of metrics recorded for each flush. We want
|
|
// to group the metrics for a given flush together so we can look at the
|
|
// components that rendered and the DOM operations that actually
|
|
// happened to determine the amount of "wasted work" performed.
|
|
ReactDefaultPerf._allMeasurements.push({
|
|
exclusive: {},
|
|
inclusive: {},
|
|
render: {},
|
|
counts: {},
|
|
writes: {},
|
|
displayNames: {},
|
|
totalTime: 0,
|
|
created: {}
|
|
});
|
|
start = performanceNow();
|
|
rv = func.apply(this, args);
|
|
ReactDefaultPerf._allMeasurements[ReactDefaultPerf._allMeasurements.length - 1].totalTime = performanceNow() - start;
|
|
return rv;
|
|
} else if (fnName === '_mountImageIntoNode' || moduleName === 'ReactBrowserEventEmitter' || moduleName === 'ReactDOMIDOperations' || moduleName === 'CSSPropertyOperations' || moduleName === 'DOMChildrenOperations' || moduleName === 'DOMPropertyOperations') {
|
|
start = performanceNow();
|
|
rv = func.apply(this, args);
|
|
totalTime = performanceNow() - start;
|
|
|
|
if (fnName === '_mountImageIntoNode') {
|
|
var mountID = ReactMount.getID(args[1]);
|
|
ReactDefaultPerf._recordWrite(mountID, fnName, totalTime, args[0]);
|
|
} else if (fnName === 'dangerouslyProcessChildrenUpdates') {
|
|
// special format
|
|
args[0].forEach(function (update) {
|
|
var writeArgs = {};
|
|
if (update.fromIndex !== null) {
|
|
writeArgs.fromIndex = update.fromIndex;
|
|
}
|
|
if (update.toIndex !== null) {
|
|
writeArgs.toIndex = update.toIndex;
|
|
}
|
|
if (update.textContent !== null) {
|
|
writeArgs.textContent = update.textContent;
|
|
}
|
|
if (update.markupIndex !== null) {
|
|
writeArgs.markup = args[1][update.markupIndex];
|
|
}
|
|
ReactDefaultPerf._recordWrite(update.parentID, update.type, totalTime, writeArgs);
|
|
});
|
|
} else {
|
|
// basic format
|
|
var id = args[0];
|
|
if (typeof id === 'object') {
|
|
id = ReactMount.getID(args[0]);
|
|
}
|
|
ReactDefaultPerf._recordWrite(id, fnName, totalTime, Array.prototype.slice.call(args, 1));
|
|
}
|
|
return rv;
|
|
} else if (moduleName === 'ReactCompositeComponent' && (fnName === 'mountComponent' || fnName === 'updateComponent' || // TODO: receiveComponent()?
|
|
fnName === '_renderValidatedComponent')) {
|
|
|
|
if (this._currentElement.type === ReactMount.TopLevelWrapper) {
|
|
return func.apply(this, args);
|
|
}
|
|
|
|
var rootNodeID = fnName === 'mountComponent' ? args[0] : this._rootNodeID;
|
|
var isRender = fnName === '_renderValidatedComponent';
|
|
var isMount = fnName === 'mountComponent';
|
|
|
|
var mountStack = ReactDefaultPerf._mountStack;
|
|
var entry = ReactDefaultPerf._allMeasurements[ReactDefaultPerf._allMeasurements.length - 1];
|
|
|
|
if (isRender) {
|
|
addValue(entry.counts, rootNodeID, 1);
|
|
} else if (isMount) {
|
|
entry.created[rootNodeID] = true;
|
|
mountStack.push(0);
|
|
}
|
|
|
|
start = performanceNow();
|
|
rv = func.apply(this, args);
|
|
totalTime = performanceNow() - start;
|
|
|
|
if (isRender) {
|
|
addValue(entry.render, rootNodeID, totalTime);
|
|
} else if (isMount) {
|
|
var subMountTime = mountStack.pop();
|
|
mountStack[mountStack.length - 1] += totalTime;
|
|
addValue(entry.exclusive, rootNodeID, totalTime - subMountTime);
|
|
addValue(entry.inclusive, rootNodeID, totalTime);
|
|
} else {
|
|
addValue(entry.inclusive, rootNodeID, totalTime);
|
|
}
|
|
|
|
entry.displayNames[rootNodeID] = {
|
|
current: this.getName(),
|
|
owner: this._currentElement._owner ? this._currentElement._owner.getName() : '<root>'
|
|
};
|
|
|
|
return rv;
|
|
} else {
|
|
return func.apply(this, args);
|
|
}
|
|
};
|
|
}
|
|
};
|
|
|
|
module.exports = ReactDefaultPerf;
|
|
|
|
/***/ },
|
|
/* 142 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactDefaultPerfAnalysis
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var assign = __webpack_require__(38);
|
|
|
|
// Don't try to save users less than 1.2ms (a number I made up)
|
|
var DONT_CARE_THRESHOLD = 1.2;
|
|
var DOM_OPERATION_TYPES = {
|
|
'_mountImageIntoNode': 'set innerHTML',
|
|
INSERT_MARKUP: 'set innerHTML',
|
|
MOVE_EXISTING: 'move',
|
|
REMOVE_NODE: 'remove',
|
|
SET_MARKUP: 'set innerHTML',
|
|
TEXT_CONTENT: 'set textContent',
|
|
'setValueForProperty': 'update attribute',
|
|
'setValueForAttribute': 'update attribute',
|
|
'deleteValueForProperty': 'remove attribute',
|
|
'setValueForStyles': 'update styles',
|
|
'replaceNodeWithMarkup': 'replace',
|
|
'updateTextContent': 'set textContent'
|
|
};
|
|
|
|
function getTotalTime(measurements) {
|
|
// TODO: return number of DOM ops? could be misleading.
|
|
// TODO: measure dropped frames after reconcile?
|
|
// TODO: log total time of each reconcile and the top-level component
|
|
// class that triggered it.
|
|
var totalTime = 0;
|
|
for (var i = 0; i < measurements.length; i++) {
|
|
var measurement = measurements[i];
|
|
totalTime += measurement.totalTime;
|
|
}
|
|
return totalTime;
|
|
}
|
|
|
|
function getDOMSummary(measurements) {
|
|
var items = [];
|
|
measurements.forEach(function (measurement) {
|
|
Object.keys(measurement.writes).forEach(function (id) {
|
|
measurement.writes[id].forEach(function (write) {
|
|
items.push({
|
|
id: id,
|
|
type: DOM_OPERATION_TYPES[write.type] || write.type,
|
|
args: write.args
|
|
});
|
|
});
|
|
});
|
|
});
|
|
return items;
|
|
}
|
|
|
|
function getExclusiveSummary(measurements) {
|
|
var candidates = {};
|
|
var displayName;
|
|
|
|
for (var i = 0; i < measurements.length; i++) {
|
|
var measurement = measurements[i];
|
|
var allIDs = assign({}, measurement.exclusive, measurement.inclusive);
|
|
|
|
for (var id in allIDs) {
|
|
displayName = measurement.displayNames[id].current;
|
|
|
|
candidates[displayName] = candidates[displayName] || {
|
|
componentName: displayName,
|
|
inclusive: 0,
|
|
exclusive: 0,
|
|
render: 0,
|
|
count: 0
|
|
};
|
|
if (measurement.render[id]) {
|
|
candidates[displayName].render += measurement.render[id];
|
|
}
|
|
if (measurement.exclusive[id]) {
|
|
candidates[displayName].exclusive += measurement.exclusive[id];
|
|
}
|
|
if (measurement.inclusive[id]) {
|
|
candidates[displayName].inclusive += measurement.inclusive[id];
|
|
}
|
|
if (measurement.counts[id]) {
|
|
candidates[displayName].count += measurement.counts[id];
|
|
}
|
|
}
|
|
}
|
|
|
|
// Now make a sorted array with the results.
|
|
var arr = [];
|
|
for (displayName in candidates) {
|
|
if (candidates[displayName].exclusive >= DONT_CARE_THRESHOLD) {
|
|
arr.push(candidates[displayName]);
|
|
}
|
|
}
|
|
|
|
arr.sort(function (a, b) {
|
|
return b.exclusive - a.exclusive;
|
|
});
|
|
|
|
return arr;
|
|
}
|
|
|
|
function getInclusiveSummary(measurements, onlyClean) {
|
|
var candidates = {};
|
|
var inclusiveKey;
|
|
|
|
for (var i = 0; i < measurements.length; i++) {
|
|
var measurement = measurements[i];
|
|
var allIDs = assign({}, measurement.exclusive, measurement.inclusive);
|
|
var cleanComponents;
|
|
|
|
if (onlyClean) {
|
|
cleanComponents = getUnchangedComponents(measurement);
|
|
}
|
|
|
|
for (var id in allIDs) {
|
|
if (onlyClean && !cleanComponents[id]) {
|
|
continue;
|
|
}
|
|
|
|
var displayName = measurement.displayNames[id];
|
|
|
|
// Inclusive time is not useful for many components without knowing where
|
|
// they are instantiated. So we aggregate inclusive time with both the
|
|
// owner and current displayName as the key.
|
|
inclusiveKey = displayName.owner + ' > ' + displayName.current;
|
|
|
|
candidates[inclusiveKey] = candidates[inclusiveKey] || {
|
|
componentName: inclusiveKey,
|
|
time: 0,
|
|
count: 0
|
|
};
|
|
|
|
if (measurement.inclusive[id]) {
|
|
candidates[inclusiveKey].time += measurement.inclusive[id];
|
|
}
|
|
if (measurement.counts[id]) {
|
|
candidates[inclusiveKey].count += measurement.counts[id];
|
|
}
|
|
}
|
|
}
|
|
|
|
// Now make a sorted array with the results.
|
|
var arr = [];
|
|
for (inclusiveKey in candidates) {
|
|
if (candidates[inclusiveKey].time >= DONT_CARE_THRESHOLD) {
|
|
arr.push(candidates[inclusiveKey]);
|
|
}
|
|
}
|
|
|
|
arr.sort(function (a, b) {
|
|
return b.time - a.time;
|
|
});
|
|
|
|
return arr;
|
|
}
|
|
|
|
function getUnchangedComponents(measurement) {
|
|
// For a given reconcile, look at which components did not actually
|
|
// render anything to the DOM and return a mapping of their ID to
|
|
// the amount of time it took to render the entire subtree.
|
|
var cleanComponents = {};
|
|
var dirtyLeafIDs = Object.keys(measurement.writes);
|
|
var allIDs = assign({}, measurement.exclusive, measurement.inclusive);
|
|
|
|
for (var id in allIDs) {
|
|
var isDirty = false;
|
|
// For each component that rendered, see if a component that triggered
|
|
// a DOM op is in its subtree.
|
|
for (var i = 0; i < dirtyLeafIDs.length; i++) {
|
|
if (dirtyLeafIDs[i].indexOf(id) === 0) {
|
|
isDirty = true;
|
|
break;
|
|
}
|
|
}
|
|
// check if component newly created
|
|
if (measurement.created[id]) {
|
|
isDirty = true;
|
|
}
|
|
if (!isDirty && measurement.counts[id] > 0) {
|
|
cleanComponents[id] = true;
|
|
}
|
|
}
|
|
return cleanComponents;
|
|
}
|
|
|
|
var ReactDefaultPerfAnalysis = {
|
|
getExclusiveSummary: getExclusiveSummary,
|
|
getInclusiveSummary: getInclusiveSummary,
|
|
getDOMSummary: getDOMSummary,
|
|
getTotalTime: getTotalTime
|
|
};
|
|
|
|
module.exports = ReactDefaultPerfAnalysis;
|
|
|
|
/***/ },
|
|
/* 143 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule performanceNow
|
|
* @typechecks
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var performance = __webpack_require__(144);
|
|
|
|
var performanceNow;
|
|
|
|
/**
|
|
* Detect if we can use `window.performance.now()` and gracefully fallback to
|
|
* `Date.now()` if it doesn't exist. We need to support Firefox < 15 for now
|
|
* because of Facebook's testing infrastructure.
|
|
*/
|
|
if (performance.now) {
|
|
performanceNow = function () {
|
|
return performance.now();
|
|
};
|
|
} else {
|
|
performanceNow = function () {
|
|
return Date.now();
|
|
};
|
|
}
|
|
|
|
module.exports = performanceNow;
|
|
|
|
/***/ },
|
|
/* 144 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule performance
|
|
* @typechecks
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var ExecutionEnvironment = __webpack_require__(8);
|
|
|
|
var performance;
|
|
|
|
if (ExecutionEnvironment.canUseDOM) {
|
|
performance = window.performance || window.msPerformance || window.webkitPerformance;
|
|
}
|
|
|
|
module.exports = performance || {};
|
|
|
|
/***/ },
|
|
/* 145 */
|
|
/***/ function(module, exports) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactVersion
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
module.exports = '0.14.8';
|
|
|
|
/***/ },
|
|
/* 146 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule renderSubtreeIntoContainer
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var ReactMount = __webpack_require__(27);
|
|
|
|
module.exports = ReactMount.renderSubtreeIntoContainer;
|
|
|
|
/***/ },
|
|
/* 147 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
'use strict';
|
|
|
|
module.exports = __webpack_require__(148);
|
|
|
|
|
|
/***/ },
|
|
/* 148 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule React
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var ReactDOM = __webpack_require__(2);
|
|
var ReactDOMServer = __webpack_require__(149);
|
|
var ReactIsomorphic = __webpack_require__(153);
|
|
|
|
var assign = __webpack_require__(38);
|
|
var deprecated = __webpack_require__(158);
|
|
|
|
// `version` will be added here by ReactIsomorphic.
|
|
var React = {};
|
|
|
|
assign(React, ReactIsomorphic);
|
|
|
|
assign(React, {
|
|
// ReactDOM
|
|
findDOMNode: deprecated('findDOMNode', 'ReactDOM', 'react-dom', ReactDOM, ReactDOM.findDOMNode),
|
|
render: deprecated('render', 'ReactDOM', 'react-dom', ReactDOM, ReactDOM.render),
|
|
unmountComponentAtNode: deprecated('unmountComponentAtNode', 'ReactDOM', 'react-dom', ReactDOM, ReactDOM.unmountComponentAtNode),
|
|
|
|
// ReactDOMServer
|
|
renderToString: deprecated('renderToString', 'ReactDOMServer', 'react-dom/server', ReactDOMServer, ReactDOMServer.renderToString),
|
|
renderToStaticMarkup: deprecated('renderToStaticMarkup', 'ReactDOMServer', 'react-dom/server', ReactDOMServer, ReactDOMServer.renderToStaticMarkup)
|
|
});
|
|
|
|
React.__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactDOM;
|
|
React.__SECRET_DOM_SERVER_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactDOMServer;
|
|
|
|
module.exports = React;
|
|
|
|
/***/ },
|
|
/* 149 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactDOMServer
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var ReactDefaultInjection = __webpack_require__(70);
|
|
var ReactServerRendering = __webpack_require__(150);
|
|
var ReactVersion = __webpack_require__(145);
|
|
|
|
ReactDefaultInjection.inject();
|
|
|
|
var ReactDOMServer = {
|
|
renderToString: ReactServerRendering.renderToString,
|
|
renderToStaticMarkup: ReactServerRendering.renderToStaticMarkup,
|
|
version: ReactVersion
|
|
};
|
|
|
|
module.exports = ReactDOMServer;
|
|
|
|
/***/ },
|
|
/* 150 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @typechecks static-only
|
|
* @providesModule ReactServerRendering
|
|
*/
|
|
'use strict';
|
|
|
|
var ReactDefaultBatchingStrategy = __webpack_require__(91);
|
|
var ReactElement = __webpack_require__(41);
|
|
var ReactInstanceHandles = __webpack_require__(44);
|
|
var ReactMarkupChecksum = __webpack_require__(47);
|
|
var ReactServerBatchingStrategy = __webpack_require__(151);
|
|
var ReactServerRenderingTransaction = __webpack_require__(152);
|
|
var ReactUpdates = __webpack_require__(53);
|
|
|
|
var emptyObject = __webpack_require__(57);
|
|
var instantiateReactComponent = __webpack_require__(61);
|
|
var invariant = __webpack_require__(12);
|
|
|
|
/**
|
|
* @param {ReactElement} element
|
|
* @return {string} the HTML markup
|
|
*/
|
|
function renderToString(element) {
|
|
!ReactElement.isValidElement(element) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'renderToString(): You must pass a valid ReactElement.') : invariant(false) : undefined;
|
|
|
|
var transaction;
|
|
try {
|
|
ReactUpdates.injection.injectBatchingStrategy(ReactServerBatchingStrategy);
|
|
|
|
var id = ReactInstanceHandles.createReactRootID();
|
|
transaction = ReactServerRenderingTransaction.getPooled(false);
|
|
|
|
return transaction.perform(function () {
|
|
var componentInstance = instantiateReactComponent(element, null);
|
|
var markup = componentInstance.mountComponent(id, transaction, emptyObject);
|
|
return ReactMarkupChecksum.addChecksumToMarkup(markup);
|
|
}, null);
|
|
} finally {
|
|
ReactServerRenderingTransaction.release(transaction);
|
|
// Revert to the DOM batching strategy since these two renderers
|
|
// currently share these stateful modules.
|
|
ReactUpdates.injection.injectBatchingStrategy(ReactDefaultBatchingStrategy);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* @param {ReactElement} element
|
|
* @return {string} the HTML markup, without the extra React ID and checksum
|
|
* (for generating static pages)
|
|
*/
|
|
function renderToStaticMarkup(element) {
|
|
!ReactElement.isValidElement(element) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'renderToStaticMarkup(): You must pass a valid ReactElement.') : invariant(false) : undefined;
|
|
|
|
var transaction;
|
|
try {
|
|
ReactUpdates.injection.injectBatchingStrategy(ReactServerBatchingStrategy);
|
|
|
|
var id = ReactInstanceHandles.createReactRootID();
|
|
transaction = ReactServerRenderingTransaction.getPooled(true);
|
|
|
|
return transaction.perform(function () {
|
|
var componentInstance = instantiateReactComponent(element, null);
|
|
return componentInstance.mountComponent(id, transaction, emptyObject);
|
|
}, null);
|
|
} finally {
|
|
ReactServerRenderingTransaction.release(transaction);
|
|
// Revert to the DOM batching strategy since these two renderers
|
|
// currently share these stateful modules.
|
|
ReactUpdates.injection.injectBatchingStrategy(ReactDefaultBatchingStrategy);
|
|
}
|
|
}
|
|
|
|
module.exports = {
|
|
renderToString: renderToString,
|
|
renderToStaticMarkup: renderToStaticMarkup
|
|
};
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 151 */
|
|
/***/ function(module, exports) {
|
|
|
|
/**
|
|
* Copyright 2014-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactServerBatchingStrategy
|
|
* @typechecks
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var ReactServerBatchingStrategy = {
|
|
isBatchingUpdates: false,
|
|
batchedUpdates: function (callback) {
|
|
// Don't do anything here. During the server rendering we don't want to
|
|
// schedule any updates. We will simply ignore them.
|
|
}
|
|
};
|
|
|
|
module.exports = ReactServerBatchingStrategy;
|
|
|
|
/***/ },
|
|
/* 152 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* Copyright 2014-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactServerRenderingTransaction
|
|
* @typechecks
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var PooledClass = __webpack_require__(55);
|
|
var CallbackQueue = __webpack_require__(54);
|
|
var Transaction = __webpack_require__(56);
|
|
|
|
var assign = __webpack_require__(38);
|
|
var emptyFunction = __webpack_require__(14);
|
|
|
|
/**
|
|
* Provides a `CallbackQueue` queue for collecting `onDOMReady` callbacks
|
|
* during the performing of the transaction.
|
|
*/
|
|
var ON_DOM_READY_QUEUEING = {
|
|
/**
|
|
* Initializes the internal `onDOMReady` queue.
|
|
*/
|
|
initialize: function () {
|
|
this.reactMountReady.reset();
|
|
},
|
|
|
|
close: emptyFunction
|
|
};
|
|
|
|
/**
|
|
* Executed within the scope of the `Transaction` instance. Consider these as
|
|
* being member methods, but with an implied ordering while being isolated from
|
|
* each other.
|
|
*/
|
|
var TRANSACTION_WRAPPERS = [ON_DOM_READY_QUEUEING];
|
|
|
|
/**
|
|
* @class ReactServerRenderingTransaction
|
|
* @param {boolean} renderToStaticMarkup
|
|
*/
|
|
function ReactServerRenderingTransaction(renderToStaticMarkup) {
|
|
this.reinitializeTransaction();
|
|
this.renderToStaticMarkup = renderToStaticMarkup;
|
|
this.reactMountReady = CallbackQueue.getPooled(null);
|
|
this.useCreateElement = false;
|
|
}
|
|
|
|
var Mixin = {
|
|
/**
|
|
* @see Transaction
|
|
* @abstract
|
|
* @final
|
|
* @return {array} Empty list of operation wrap procedures.
|
|
*/
|
|
getTransactionWrappers: function () {
|
|
return TRANSACTION_WRAPPERS;
|
|
},
|
|
|
|
/**
|
|
* @return {object} The queue to collect `onDOMReady` callbacks with.
|
|
*/
|
|
getReactMountReady: function () {
|
|
return this.reactMountReady;
|
|
},
|
|
|
|
/**
|
|
* `PooledClass` looks for this, and will invoke this before allowing this
|
|
* instance to be reused.
|
|
*/
|
|
destructor: function () {
|
|
CallbackQueue.release(this.reactMountReady);
|
|
this.reactMountReady = null;
|
|
}
|
|
};
|
|
|
|
assign(ReactServerRenderingTransaction.prototype, Transaction.Mixin, Mixin);
|
|
|
|
PooledClass.addPoolingTo(ReactServerRenderingTransaction);
|
|
|
|
module.exports = ReactServerRenderingTransaction;
|
|
|
|
/***/ },
|
|
/* 153 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactIsomorphic
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var ReactChildren = __webpack_require__(109);
|
|
var ReactComponent = __webpack_require__(122);
|
|
var ReactClass = __webpack_require__(121);
|
|
var ReactDOMFactories = __webpack_require__(154);
|
|
var ReactElement = __webpack_require__(41);
|
|
var ReactElementValidator = __webpack_require__(155);
|
|
var ReactPropTypes = __webpack_require__(106);
|
|
var ReactVersion = __webpack_require__(145);
|
|
|
|
var assign = __webpack_require__(38);
|
|
var onlyChild = __webpack_require__(157);
|
|
|
|
var createElement = ReactElement.createElement;
|
|
var createFactory = ReactElement.createFactory;
|
|
var cloneElement = ReactElement.cloneElement;
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
createElement = ReactElementValidator.createElement;
|
|
createFactory = ReactElementValidator.createFactory;
|
|
cloneElement = ReactElementValidator.cloneElement;
|
|
}
|
|
|
|
var React = {
|
|
|
|
// Modern
|
|
|
|
Children: {
|
|
map: ReactChildren.map,
|
|
forEach: ReactChildren.forEach,
|
|
count: ReactChildren.count,
|
|
toArray: ReactChildren.toArray,
|
|
only: onlyChild
|
|
},
|
|
|
|
Component: ReactComponent,
|
|
|
|
createElement: createElement,
|
|
cloneElement: cloneElement,
|
|
isValidElement: ReactElement.isValidElement,
|
|
|
|
// Classic
|
|
|
|
PropTypes: ReactPropTypes,
|
|
createClass: ReactClass.createClass,
|
|
createFactory: createFactory,
|
|
createMixin: function (mixin) {
|
|
// Currently a noop. Will be used to validate and trace mixins.
|
|
return mixin;
|
|
},
|
|
|
|
// This looks DOM specific but these are actually isomorphic helpers
|
|
// since they are just generating DOM strings.
|
|
DOM: ReactDOMFactories,
|
|
|
|
version: ReactVersion,
|
|
|
|
// Hook for JSX spread, don't use this for anything else.
|
|
__spread: assign
|
|
};
|
|
|
|
module.exports = React;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 154 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactDOMFactories
|
|
* @typechecks static-only
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var ReactElement = __webpack_require__(41);
|
|
var ReactElementValidator = __webpack_require__(155);
|
|
|
|
var mapObject = __webpack_require__(156);
|
|
|
|
/**
|
|
* Create a factory that creates HTML tag elements.
|
|
*
|
|
* @param {string} tag Tag name (e.g. `div`).
|
|
* @private
|
|
*/
|
|
function createDOMFactory(tag) {
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
return ReactElementValidator.createFactory(tag);
|
|
}
|
|
return ReactElement.createFactory(tag);
|
|
}
|
|
|
|
/**
|
|
* Creates a mapping from supported HTML tags to `ReactDOMComponent` classes.
|
|
* This is also accessible via `React.DOM`.
|
|
*
|
|
* @public
|
|
*/
|
|
var ReactDOMFactories = mapObject({
|
|
a: 'a',
|
|
abbr: 'abbr',
|
|
address: 'address',
|
|
area: 'area',
|
|
article: 'article',
|
|
aside: 'aside',
|
|
audio: 'audio',
|
|
b: 'b',
|
|
base: 'base',
|
|
bdi: 'bdi',
|
|
bdo: 'bdo',
|
|
big: 'big',
|
|
blockquote: 'blockquote',
|
|
body: 'body',
|
|
br: 'br',
|
|
button: 'button',
|
|
canvas: 'canvas',
|
|
caption: 'caption',
|
|
cite: 'cite',
|
|
code: 'code',
|
|
col: 'col',
|
|
colgroup: 'colgroup',
|
|
data: 'data',
|
|
datalist: 'datalist',
|
|
dd: 'dd',
|
|
del: 'del',
|
|
details: 'details',
|
|
dfn: 'dfn',
|
|
dialog: 'dialog',
|
|
div: 'div',
|
|
dl: 'dl',
|
|
dt: 'dt',
|
|
em: 'em',
|
|
embed: 'embed',
|
|
fieldset: 'fieldset',
|
|
figcaption: 'figcaption',
|
|
figure: 'figure',
|
|
footer: 'footer',
|
|
form: 'form',
|
|
h1: 'h1',
|
|
h2: 'h2',
|
|
h3: 'h3',
|
|
h4: 'h4',
|
|
h5: 'h5',
|
|
h6: 'h6',
|
|
head: 'head',
|
|
header: 'header',
|
|
hgroup: 'hgroup',
|
|
hr: 'hr',
|
|
html: 'html',
|
|
i: 'i',
|
|
iframe: 'iframe',
|
|
img: 'img',
|
|
input: 'input',
|
|
ins: 'ins',
|
|
kbd: 'kbd',
|
|
keygen: 'keygen',
|
|
label: 'label',
|
|
legend: 'legend',
|
|
li: 'li',
|
|
link: 'link',
|
|
main: 'main',
|
|
map: 'map',
|
|
mark: 'mark',
|
|
menu: 'menu',
|
|
menuitem: 'menuitem',
|
|
meta: 'meta',
|
|
meter: 'meter',
|
|
nav: 'nav',
|
|
noscript: 'noscript',
|
|
object: 'object',
|
|
ol: 'ol',
|
|
optgroup: 'optgroup',
|
|
option: 'option',
|
|
output: 'output',
|
|
p: 'p',
|
|
param: 'param',
|
|
picture: 'picture',
|
|
pre: 'pre',
|
|
progress: 'progress',
|
|
q: 'q',
|
|
rp: 'rp',
|
|
rt: 'rt',
|
|
ruby: 'ruby',
|
|
s: 's',
|
|
samp: 'samp',
|
|
script: 'script',
|
|
section: 'section',
|
|
select: 'select',
|
|
small: 'small',
|
|
source: 'source',
|
|
span: 'span',
|
|
strong: 'strong',
|
|
style: 'style',
|
|
sub: 'sub',
|
|
summary: 'summary',
|
|
sup: 'sup',
|
|
table: 'table',
|
|
tbody: 'tbody',
|
|
td: 'td',
|
|
textarea: 'textarea',
|
|
tfoot: 'tfoot',
|
|
th: 'th',
|
|
thead: 'thead',
|
|
time: 'time',
|
|
title: 'title',
|
|
tr: 'tr',
|
|
track: 'track',
|
|
u: 'u',
|
|
ul: 'ul',
|
|
'var': 'var',
|
|
video: 'video',
|
|
wbr: 'wbr',
|
|
|
|
// SVG
|
|
circle: 'circle',
|
|
clipPath: 'clipPath',
|
|
defs: 'defs',
|
|
ellipse: 'ellipse',
|
|
g: 'g',
|
|
image: 'image',
|
|
line: 'line',
|
|
linearGradient: 'linearGradient',
|
|
mask: 'mask',
|
|
path: 'path',
|
|
pattern: 'pattern',
|
|
polygon: 'polygon',
|
|
polyline: 'polyline',
|
|
radialGradient: 'radialGradient',
|
|
rect: 'rect',
|
|
stop: 'stop',
|
|
svg: 'svg',
|
|
text: 'text',
|
|
tspan: 'tspan'
|
|
|
|
}, createDOMFactory);
|
|
|
|
module.exports = ReactDOMFactories;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 155 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2014-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ReactElementValidator
|
|
*/
|
|
|
|
/**
|
|
* ReactElementValidator provides a wrapper around a element factory
|
|
* which validates the props passed to the element. This is intended to be
|
|
* used only in DEV and could be replaced by a static type checker for languages
|
|
* that support it.
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var ReactElement = __webpack_require__(41);
|
|
var ReactPropTypeLocations = __webpack_require__(64);
|
|
var ReactPropTypeLocationNames = __webpack_require__(65);
|
|
var ReactCurrentOwner = __webpack_require__(4);
|
|
|
|
var canDefineProperty = __webpack_require__(42);
|
|
var getIteratorFn = __webpack_require__(107);
|
|
var invariant = __webpack_require__(12);
|
|
var warning = __webpack_require__(24);
|
|
|
|
function getDeclarationErrorAddendum() {
|
|
if (ReactCurrentOwner.current) {
|
|
var name = ReactCurrentOwner.current.getName();
|
|
if (name) {
|
|
return ' Check the render method of `' + name + '`.';
|
|
}
|
|
}
|
|
return '';
|
|
}
|
|
|
|
/**
|
|
* Warn if there's no key explicitly set on dynamic arrays of children or
|
|
* object keys are not valid. This allows us to keep track of children between
|
|
* updates.
|
|
*/
|
|
var ownerHasKeyUseWarning = {};
|
|
|
|
var loggedTypeFailures = {};
|
|
|
|
/**
|
|
* Warn if the element doesn't have an explicit key assigned to it.
|
|
* This element is in an array. The array could grow and shrink or be
|
|
* reordered. All children that haven't already been validated are required to
|
|
* have a "key" property assigned to it.
|
|
*
|
|
* @internal
|
|
* @param {ReactElement} element Element that requires a key.
|
|
* @param {*} parentType element's parent's type.
|
|
*/
|
|
function validateExplicitKey(element, parentType) {
|
|
if (!element._store || element._store.validated || element.key != null) {
|
|
return;
|
|
}
|
|
element._store.validated = true;
|
|
|
|
var addenda = getAddendaForKeyUse('uniqueKey', element, parentType);
|
|
if (addenda === null) {
|
|
// we already showed the warning
|
|
return;
|
|
}
|
|
process.env.NODE_ENV !== 'production' ? warning(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s%s', addenda.parentOrOwner || '', addenda.childOwner || '', addenda.url || '') : undefined;
|
|
}
|
|
|
|
/**
|
|
* Shared warning and monitoring code for the key warnings.
|
|
*
|
|
* @internal
|
|
* @param {string} messageType A key used for de-duping warnings.
|
|
* @param {ReactElement} element Component that requires a key.
|
|
* @param {*} parentType element's parent's type.
|
|
* @returns {?object} A set of addenda to use in the warning message, or null
|
|
* if the warning has already been shown before (and shouldn't be shown again).
|
|
*/
|
|
function getAddendaForKeyUse(messageType, element, parentType) {
|
|
var addendum = getDeclarationErrorAddendum();
|
|
if (!addendum) {
|
|
var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
|
|
if (parentName) {
|
|
addendum = ' Check the top-level render call using <' + parentName + '>.';
|
|
}
|
|
}
|
|
|
|
var memoizer = ownerHasKeyUseWarning[messageType] || (ownerHasKeyUseWarning[messageType] = {});
|
|
if (memoizer[addendum]) {
|
|
return null;
|
|
}
|
|
memoizer[addendum] = true;
|
|
|
|
var addenda = {
|
|
parentOrOwner: addendum,
|
|
url: ' See https://fb.me/react-warning-keys for more information.',
|
|
childOwner: null
|
|
};
|
|
|
|
// Usually the current owner is the offender, but if it accepts children as a
|
|
// property, it may be the creator of the child that's responsible for
|
|
// assigning it a key.
|
|
if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
|
|
// Give the component that originally created this child.
|
|
addenda.childOwner = ' It was passed a child from ' + element._owner.getName() + '.';
|
|
}
|
|
|
|
return addenda;
|
|
}
|
|
|
|
/**
|
|
* Ensure that every element either is passed in a static location, in an
|
|
* array with an explicit keys property defined, or in an object literal
|
|
* with valid key property.
|
|
*
|
|
* @internal
|
|
* @param {ReactNode} node Statically passed child of any type.
|
|
* @param {*} parentType node's parent's type.
|
|
*/
|
|
function validateChildKeys(node, parentType) {
|
|
if (typeof node !== 'object') {
|
|
return;
|
|
}
|
|
if (Array.isArray(node)) {
|
|
for (var i = 0; i < node.length; i++) {
|
|
var child = node[i];
|
|
if (ReactElement.isValidElement(child)) {
|
|
validateExplicitKey(child, parentType);
|
|
}
|
|
}
|
|
} else if (ReactElement.isValidElement(node)) {
|
|
// This element was passed in a valid location.
|
|
if (node._store) {
|
|
node._store.validated = true;
|
|
}
|
|
} else if (node) {
|
|
var iteratorFn = getIteratorFn(node);
|
|
// Entry iterators provide implicit keys.
|
|
if (iteratorFn) {
|
|
if (iteratorFn !== node.entries) {
|
|
var iterator = iteratorFn.call(node);
|
|
var step;
|
|
while (!(step = iterator.next()).done) {
|
|
if (ReactElement.isValidElement(step.value)) {
|
|
validateExplicitKey(step.value, parentType);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Assert that the props are valid
|
|
*
|
|
* @param {string} componentName Name of the component for error messages.
|
|
* @param {object} propTypes Map of prop name to a ReactPropType
|
|
* @param {object} props
|
|
* @param {string} location e.g. "prop", "context", "child context"
|
|
* @private
|
|
*/
|
|
function checkPropTypes(componentName, propTypes, props, location) {
|
|
for (var propName in propTypes) {
|
|
if (propTypes.hasOwnProperty(propName)) {
|
|
var error;
|
|
// Prop type validation may throw. In case they do, we don't want to
|
|
// fail the render phase where it didn't fail before. So we log it.
|
|
// After these have been cleaned up, we'll let them throw.
|
|
try {
|
|
// This is intentionally an invariant that gets caught. It's the same
|
|
// behavior as without this statement except with a better message.
|
|
!(typeof propTypes[propName] === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', ReactPropTypeLocationNames[location], propName) : invariant(false) : undefined;
|
|
error = propTypes[propName](props, propName, componentName, location);
|
|
} catch (ex) {
|
|
error = ex;
|
|
}
|
|
process.env.NODE_ENV !== 'production' ? warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', ReactPropTypeLocationNames[location], propName, typeof error) : undefined;
|
|
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
|
// Only monitor this failure once because there tends to be a lot of the
|
|
// same error.
|
|
loggedTypeFailures[error.message] = true;
|
|
|
|
var addendum = getDeclarationErrorAddendum();
|
|
process.env.NODE_ENV !== 'production' ? warning(false, 'Failed propType: %s%s', error.message, addendum) : undefined;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Given an element, validate that its props follow the propTypes definition,
|
|
* provided by the type.
|
|
*
|
|
* @param {ReactElement} element
|
|
*/
|
|
function validatePropTypes(element) {
|
|
var componentClass = element.type;
|
|
if (typeof componentClass !== 'function') {
|
|
return;
|
|
}
|
|
var name = componentClass.displayName || componentClass.name;
|
|
if (componentClass.propTypes) {
|
|
checkPropTypes(name, componentClass.propTypes, element.props, ReactPropTypeLocations.prop);
|
|
}
|
|
if (typeof componentClass.getDefaultProps === 'function') {
|
|
process.env.NODE_ENV !== 'production' ? warning(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : undefined;
|
|
}
|
|
}
|
|
|
|
var ReactElementValidator = {
|
|
|
|
createElement: function (type, props, children) {
|
|
var validType = typeof type === 'string' || typeof type === 'function';
|
|
// We warn in this case but don't throw. We expect the element creation to
|
|
// succeed and there will likely be errors in render.
|
|
process.env.NODE_ENV !== 'production' ? warning(validType, 'React.createElement: type should not be null, undefined, boolean, or ' + 'number. It should be a string (for DOM elements) or a ReactClass ' + '(for composite components).%s', getDeclarationErrorAddendum()) : undefined;
|
|
|
|
var element = ReactElement.createElement.apply(this, arguments);
|
|
|
|
// The result can be nullish if a mock or a custom function is used.
|
|
// TODO: Drop this when these are no longer allowed as the type argument.
|
|
if (element == null) {
|
|
return element;
|
|
}
|
|
|
|
// Skip key warning if the type isn't valid since our key validation logic
|
|
// doesn't expect a non-string/function type and can throw confusing errors.
|
|
// We don't want exception behavior to differ between dev and prod.
|
|
// (Rendering will throw with a helpful message and as soon as the type is
|
|
// fixed, the key warnings will appear.)
|
|
if (validType) {
|
|
for (var i = 2; i < arguments.length; i++) {
|
|
validateChildKeys(arguments[i], type);
|
|
}
|
|
}
|
|
|
|
validatePropTypes(element);
|
|
|
|
return element;
|
|
},
|
|
|
|
createFactory: function (type) {
|
|
var validatedFactory = ReactElementValidator.createElement.bind(null, type);
|
|
// Legacy hook TODO: Warn if this is accessed
|
|
validatedFactory.type = type;
|
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
if (canDefineProperty) {
|
|
Object.defineProperty(validatedFactory, 'type', {
|
|
enumerable: false,
|
|
get: function () {
|
|
process.env.NODE_ENV !== 'production' ? warning(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.') : undefined;
|
|
Object.defineProperty(this, 'type', {
|
|
value: type
|
|
});
|
|
return type;
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
return validatedFactory;
|
|
},
|
|
|
|
cloneElement: function (element, props, children) {
|
|
var newElement = ReactElement.cloneElement.apply(this, arguments);
|
|
for (var i = 2; i < arguments.length; i++) {
|
|
validateChildKeys(arguments[i], newElement.type);
|
|
}
|
|
validatePropTypes(newElement);
|
|
return newElement;
|
|
}
|
|
|
|
};
|
|
|
|
module.exports = ReactElementValidator;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 156 */
|
|
/***/ function(module, exports) {
|
|
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule mapObject
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
|
|
/**
|
|
* Executes the provided `callback` once for each enumerable own property in the
|
|
* object and constructs a new object from the results. The `callback` is
|
|
* invoked with three arguments:
|
|
*
|
|
* - the property value
|
|
* - the property name
|
|
* - the object being traversed
|
|
*
|
|
* Properties that are added after the call to `mapObject` will not be visited
|
|
* by `callback`. If the values of existing properties are changed, the value
|
|
* passed to `callback` will be the value at the time `mapObject` visits them.
|
|
* Properties that are deleted before being visited are not visited.
|
|
*
|
|
* @grep function objectMap()
|
|
* @grep function objMap()
|
|
*
|
|
* @param {?object} object
|
|
* @param {function} callback
|
|
* @param {*} context
|
|
* @return {?object}
|
|
*/
|
|
function mapObject(object, callback, context) {
|
|
if (!object) {
|
|
return null;
|
|
}
|
|
var result = {};
|
|
for (var name in object) {
|
|
if (hasOwnProperty.call(object, name)) {
|
|
result[name] = callback.call(context, object[name], name, object);
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
|
|
module.exports = mapObject;
|
|
|
|
/***/ },
|
|
/* 157 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule onlyChild
|
|
*/
|
|
'use strict';
|
|
|
|
var ReactElement = __webpack_require__(41);
|
|
|
|
var invariant = __webpack_require__(12);
|
|
|
|
/**
|
|
* Returns the first child in a collection of children and verifies that there
|
|
* is only one child in the collection. The current implementation of this
|
|
* function assumes that a single child gets passed without a wrapper, but the
|
|
* purpose of this helper function is to abstract away the particular structure
|
|
* of children.
|
|
*
|
|
* @param {?object} children Child collection structure.
|
|
* @return {ReactComponent} The first and only `ReactComponent` contained in the
|
|
* structure.
|
|
*/
|
|
function onlyChild(children) {
|
|
!ReactElement.isValidElement(children) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'onlyChild must be passed a children with exactly one child.') : invariant(false) : undefined;
|
|
return children;
|
|
}
|
|
|
|
module.exports = onlyChild;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 158 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule deprecated
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var assign = __webpack_require__(38);
|
|
var warning = __webpack_require__(24);
|
|
|
|
/**
|
|
* This will log a single deprecation notice per function and forward the call
|
|
* on to the new API.
|
|
*
|
|
* @param {string} fnName The name of the function
|
|
* @param {string} newModule The module that fn will exist in
|
|
* @param {string} newPackage The module that fn will exist in
|
|
* @param {*} ctx The context this forwarded call should run in
|
|
* @param {function} fn The function to forward on to
|
|
* @return {function} The function that will warn once and then call fn
|
|
*/
|
|
function deprecated(fnName, newModule, newPackage, ctx, fn) {
|
|
var warned = false;
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
var newFn = function () {
|
|
process.env.NODE_ENV !== 'production' ? warning(warned,
|
|
// Require examples in this string must be split to prevent React's
|
|
// build tools from mistaking them for real requires.
|
|
// Otherwise the build tools will attempt to build a '%s' module.
|
|
'React.%s is deprecated. Please use %s.%s from require' + '(\'%s\') ' + 'instead.', fnName, newModule, fnName, newPackage) : undefined;
|
|
warned = true;
|
|
return fn.apply(ctx, arguments);
|
|
};
|
|
// We need to make sure all properties of the original fn are copied over.
|
|
// In particular, this is needed to support PropTypes
|
|
return assign(newFn, fn);
|
|
}
|
|
|
|
return fn;
|
|
}
|
|
|
|
module.exports = deprecated;
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 159 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
'use strict';
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.StringInterner = exports.StackRegistry = exports.AggrowTable = exports.AggrowExpander = exports.AggrowData = exports.Aggrow = undefined;
|
|
|
|
var _Aggrow = __webpack_require__(160);
|
|
|
|
var _Aggrow2 = _interopRequireDefault(_Aggrow);
|
|
|
|
var _AggrowData = __webpack_require__(162);
|
|
|
|
var _AggrowData2 = _interopRequireDefault(_AggrowData);
|
|
|
|
var _AggrowExpander = __webpack_require__(165);
|
|
|
|
var _AggrowExpander2 = _interopRequireDefault(_AggrowExpander);
|
|
|
|
var _AggrowTable = __webpack_require__(166);
|
|
|
|
var _AggrowTable2 = _interopRequireDefault(_AggrowTable);
|
|
|
|
var _StackRegistry = __webpack_require__(163);
|
|
|
|
var _StackRegistry2 = _interopRequireDefault(_StackRegistry);
|
|
|
|
var _StringInterner = __webpack_require__(164);
|
|
|
|
var _StringInterner2 = _interopRequireDefault(_StringInterner);
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
exports.Aggrow = _Aggrow2.default;
|
|
exports.AggrowData = _AggrowData2.default;
|
|
exports.AggrowExpander = _AggrowExpander2.default;
|
|
exports.AggrowTable = _AggrowTable2.default;
|
|
exports.StackRegistry = _StackRegistry2.default;
|
|
exports.StringInterner = _StringInterner2.default;
|
|
|
|
/***/ },
|
|
/* 160 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
'use strict';
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
|
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
|
|
var _invariant = __webpack_require__(161);
|
|
|
|
var _invariant2 = _interopRequireDefault(_invariant);
|
|
|
|
var _AggrowData = __webpack_require__(162);
|
|
|
|
var _AggrowData2 = _interopRequireDefault(_AggrowData);
|
|
|
|
var _AggrowExpander = __webpack_require__(165);
|
|
|
|
var _AggrowExpander2 = _interopRequireDefault(_AggrowExpander);
|
|
|
|
var _StackRegistry = __webpack_require__(163);
|
|
|
|
var _StackRegistry2 = _interopRequireDefault(_StackRegistry);
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
|
var Aggrow = function () {
|
|
function Aggrow(aggrowData) {
|
|
_classCallCheck(this, Aggrow);
|
|
|
|
aggrowData.flattenStacks();
|
|
this.data = aggrowData;
|
|
this.expander = new _AggrowExpander2.default(aggrowData.rowCount);
|
|
}
|
|
|
|
_createClass(Aggrow, [{
|
|
key: 'addSumAggregator',
|
|
value: function addSumAggregator(aggregatorName, columnName) {
|
|
var column = this.data.getColumn(columnName);
|
|
|
|
(0, _invariant2.default)(column, 'Column ' + columnName + ' does not exist.');
|
|
(0, _invariant2.default)(column instanceof _AggrowData.AggrowIntColumn || column instanceof _AggrowData.AggrowDoubleColumn, 'Sum aggregator does not support ' + column.constructor.name + ' columns!');
|
|
return this.expander.addAggregator(aggregatorName, function (indices) {
|
|
var size = 0;
|
|
indices.forEach(function (i) {
|
|
size += column.get(i);
|
|
});
|
|
return size;
|
|
}, function (value) {
|
|
return value.toLocaleString();
|
|
}, function (a, b) {
|
|
return b - a;
|
|
});
|
|
}
|
|
}, {
|
|
key: 'addCountAggregator',
|
|
value: function addCountAggregator(aggregatorName) {
|
|
return this.expander.addAggregator(aggregatorName, function (indices) {
|
|
return indices.length;
|
|
}, function (value) {
|
|
return value.toLocaleString();
|
|
}, function (a, b) {
|
|
return b - a;
|
|
});
|
|
}
|
|
}, {
|
|
key: 'addStringExpander',
|
|
value: function addStringExpander(expanderName, columnName) {
|
|
var column = this.data.getColumn(columnName);
|
|
(0, _invariant2.default)(column, 'Column ' + columnName + ' does not exist.');
|
|
(0, _invariant2.default)(column instanceof _AggrowData.AggrowStringColumn, 'String expander needs a string column.');
|
|
var strings = column.strings;
|
|
return this.expander.addFieldExpander(expanderName, function (rowA, rowB) {
|
|
return column.get(rowA) - column.get(rowB);
|
|
}, function (row) {
|
|
return strings.get(column.get(row));
|
|
}, function (s) {
|
|
return s;
|
|
});
|
|
}
|
|
}, {
|
|
key: 'addNumberExpander',
|
|
value: function addNumberExpander(expanderName, columnName) {
|
|
var column = this.data.getColumn(columnName);
|
|
(0, _invariant2.default)(column, 'Column ' + columnName + ' does not exist.');
|
|
(0, _invariant2.default)(column instanceof _AggrowData.AggrowIntColumn || column instanceof _AggrowData.AggrowDoubleColumn, 'Number expander does not support ' + column.constructor.name + ' columns.');
|
|
return this.expander.addFieldExpander(expanderName, function (rowA, rowB) {
|
|
return column.get(rowA) - column.get(rowB);
|
|
}, function (row) {
|
|
return column.get(row);
|
|
}, function (n) {
|
|
return n.toLocaleString();
|
|
});
|
|
}
|
|
}, {
|
|
key: 'addPointerExpander',
|
|
value: function addPointerExpander(expanderName, columnName) {
|
|
var column = this.data.getColumn(columnName);
|
|
(0, _invariant2.default)(column, 'Column ' + columnName + ' does not exist.');
|
|
(0, _invariant2.default)(column instanceof _AggrowData.AggrowIntColumn, 'Pointer expander does not support ' + column.constructor.name + ' columns.');
|
|
return this.expander.addFieldExpander(expanderName, function (rowA, rowB) {
|
|
return column.get(rowA) - column.get(rowB);
|
|
}, function (row) {
|
|
return column.get(row);
|
|
}, function (p) {
|
|
return '0x' + (p >>> 0).toString(16);
|
|
});
|
|
}
|
|
}, {
|
|
key: 'addStackExpander',
|
|
value: function addStackExpander(expanderName, columnName, reverse, focus) {
|
|
var column = this.data.getColumn(columnName);
|
|
(0, _invariant2.default)(column, 'Column ' + columnName + ' does not exist.');
|
|
(0, _invariant2.default)(column instanceof _AggrowData.AggrowStackColumn, 'Stack expander does not support ' + column.constructor.name + ' columns.');
|
|
var stacks = column.stacks;
|
|
var getter = column.getter;
|
|
var formatter = column.formatter;
|
|
if (focus) {
|
|
(function () {
|
|
var re = focus.pattern;
|
|
var predicate = function predicate(frameId) {
|
|
return re.test(formatter(getter(frameId)));
|
|
};
|
|
stacks = focusStacks(stacks, predicate, focus.firstMatch, focus.leftSide);
|
|
})();
|
|
}
|
|
return this.expander.addStackExpander(expanderName, stacks.maxDepth, function (row) {
|
|
return stacks.get(column.get(row));
|
|
}, getter, formatter, !!reverse);
|
|
}
|
|
}]);
|
|
|
|
return Aggrow;
|
|
}();
|
|
|
|
exports.default = Aggrow;
|
|
|
|
|
|
function focusStacks(stacks, predicate, firstMatch, leftSide) {
|
|
var stackMapper = void 0;
|
|
if (firstMatch && leftSide) {
|
|
stackMapper = function stackMapper(stack) {
|
|
for (var i = 0; i < stack.length; i++) {
|
|
if (predicate(stack[i])) {
|
|
return stack.subarray(0, i + 1);
|
|
}
|
|
}
|
|
return stack.subarray(0, 0);
|
|
};
|
|
} else if (firstMatch && !leftSide) {
|
|
stackMapper = function stackMapper(stack) {
|
|
for (var i = 0; i < stack.length; i++) {
|
|
if (predicate(stack[i])) {
|
|
return stack.subarray(i, stack.length);
|
|
}
|
|
}
|
|
return stack.subarray(0, 0);
|
|
};
|
|
} else if (!firstMatch && leftSide) {
|
|
stackMapper = function stackMapper(stack) {
|
|
for (var i = stack.length - 1; i >= 0; i--) {
|
|
if (predicate(stack[i])) {
|
|
return stack.subarray(0, i + 1);
|
|
}
|
|
}
|
|
return stack.subarray(0, 0);
|
|
};
|
|
} else {
|
|
// !firstMatch && !leftSide
|
|
stackMapper = function stackMapper(stack) {
|
|
for (var i = stack.length - 1; i >= 0; i--) {
|
|
if (predicate(stack[i])) {
|
|
return stack.subarray(i, stack.length);
|
|
}
|
|
}
|
|
return stack.subarray(0, 0);
|
|
};
|
|
}
|
|
|
|
(0, _invariant2.default)(stacks.stackIdMap, 'Stacks were not flattened.');
|
|
return new FocusedStackRegistry(stacks.stackIdMap.map(stackMapper), stacks.maxDepth);
|
|
}
|
|
|
|
var FocusedStackRegistry = function () {
|
|
function FocusedStackRegistry(stackIdMap, maxDepth) {
|
|
_classCallCheck(this, FocusedStackRegistry);
|
|
|
|
this.maxDepth = maxDepth;
|
|
this.stackIdMap = stackIdMap;
|
|
}
|
|
|
|
_createClass(FocusedStackRegistry, [{
|
|
key: 'get',
|
|
value: function get(id) {
|
|
return this.stackIdMap[id];
|
|
}
|
|
}]);
|
|
|
|
return FocusedStackRegistry;
|
|
}();
|
|
|
|
/***/ },
|
|
/* 161 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
/**
|
|
* Use invariant() to assert state which your program assumes to be true.
|
|
*
|
|
* Provide sprintf-style format (only %s is supported) and arguments
|
|
* to provide information about what broke and what you were
|
|
* expecting.
|
|
*
|
|
* The invariant message will be stripped in production, but the invariant
|
|
* will remain to ensure logic does not differ in production.
|
|
*/
|
|
|
|
var invariant = function(condition, format, a, b, c, d, e, f) {
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
if (format === undefined) {
|
|
throw new Error('invariant requires an error message argument');
|
|
}
|
|
}
|
|
|
|
if (!condition) {
|
|
var error;
|
|
if (format === undefined) {
|
|
error = new Error(
|
|
'Minified exception occurred; use the non-minified dev environment ' +
|
|
'for the full error message and additional helpful warnings.'
|
|
);
|
|
} else {
|
|
var args = [a, b, c, d, e, f];
|
|
var argIndex = 0;
|
|
error = new Error(
|
|
format.replace(/%s/g, function() { return args[argIndex++]; })
|
|
);
|
|
error.name = 'Invariant Violation';
|
|
}
|
|
|
|
error.framesToPop = 1; // we don't care about invariant's own frame
|
|
throw error;
|
|
}
|
|
};
|
|
|
|
module.exports = invariant;
|
|
|
|
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
|
|
/***/ },
|
|
/* 162 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
'use strict';
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.AggrowStackColumn = exports.AggrowDoubleColumn = exports.AggrowIntColumn = exports.AggrowStringColumn = undefined;
|
|
|
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
|
|
var _invariant = __webpack_require__(161);
|
|
|
|
var _invariant2 = _interopRequireDefault(_invariant);
|
|
|
|
var _StackRegistry = __webpack_require__(163);
|
|
|
|
var _StackRegistry2 = _interopRequireDefault(_StackRegistry);
|
|
|
|
var _StringInterner = __webpack_require__(164);
|
|
|
|
var _StringInterner2 = _interopRequireDefault(_StringInterner);
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
|
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
|
var AggrowColumnBase = function AggrowColumnBase(def) {
|
|
_classCallCheck(this, AggrowColumnBase);
|
|
|
|
this.name = def.name;
|
|
};
|
|
|
|
var AggrowStringColumn = exports.AggrowStringColumn = function (_AggrowColumnBase) {
|
|
_inherits(AggrowStringColumn, _AggrowColumnBase);
|
|
|
|
function AggrowStringColumn(def) {
|
|
_classCallCheck(this, AggrowStringColumn);
|
|
|
|
var _this = _possibleConstructorReturn(this, (AggrowStringColumn.__proto__ || Object.getPrototypeOf(AggrowStringColumn)).call(this, def));
|
|
|
|
_this.data = new Int32Array(0);
|
|
|
|
_this.strings = def.strings;
|
|
return _this;
|
|
}
|
|
|
|
_createClass(AggrowStringColumn, [{
|
|
key: 'get',
|
|
value: function get(row) {
|
|
return this.data[row];
|
|
}
|
|
}, {
|
|
key: 'insert',
|
|
value: function insert(row, s) {
|
|
this.data[row] = this.strings.intern(s);
|
|
}
|
|
}, {
|
|
key: 'extend',
|
|
value: function extend(count) {
|
|
var newData = new Int32Array(this.data.length + count);
|
|
newData.set(this.data);
|
|
this.data = newData;
|
|
}
|
|
}]);
|
|
|
|
return AggrowStringColumn;
|
|
}(AggrowColumnBase);
|
|
|
|
var AggrowIntColumn = exports.AggrowIntColumn = function (_AggrowColumnBase2) {
|
|
_inherits(AggrowIntColumn, _AggrowColumnBase2);
|
|
|
|
function AggrowIntColumn() {
|
|
var _ref;
|
|
|
|
var _temp, _this2, _ret;
|
|
|
|
_classCallCheck(this, AggrowIntColumn);
|
|
|
|
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
|
|
return _ret = (_temp = (_this2 = _possibleConstructorReturn(this, (_ref = AggrowIntColumn.__proto__ || Object.getPrototypeOf(AggrowIntColumn)).call.apply(_ref, [this].concat(args))), _this2), _this2.data = new Int32Array(0), _temp), _possibleConstructorReturn(_this2, _ret);
|
|
}
|
|
|
|
_createClass(AggrowIntColumn, [{
|
|
key: 'get',
|
|
value: function get(row) {
|
|
return this.data[row];
|
|
}
|
|
}, {
|
|
key: 'insert',
|
|
value: function insert(row, i) {
|
|
this.data[row] = i;
|
|
}
|
|
}, {
|
|
key: 'extend',
|
|
value: function extend(count) {
|
|
var newData = new Int32Array(this.data.length + count);
|
|
newData.set(this.data);
|
|
this.data = newData;
|
|
}
|
|
}]);
|
|
|
|
return AggrowIntColumn;
|
|
}(AggrowColumnBase);
|
|
|
|
var AggrowDoubleColumn = exports.AggrowDoubleColumn = function (_AggrowColumnBase3) {
|
|
_inherits(AggrowDoubleColumn, _AggrowColumnBase3);
|
|
|
|
function AggrowDoubleColumn() {
|
|
var _ref2;
|
|
|
|
var _temp2, _this3, _ret2;
|
|
|
|
_classCallCheck(this, AggrowDoubleColumn);
|
|
|
|
for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
args[_key2] = arguments[_key2];
|
|
}
|
|
|
|
return _ret2 = (_temp2 = (_this3 = _possibleConstructorReturn(this, (_ref2 = AggrowDoubleColumn.__proto__ || Object.getPrototypeOf(AggrowDoubleColumn)).call.apply(_ref2, [this].concat(args))), _this3), _this3.data = new Float64Array(0), _temp2), _possibleConstructorReturn(_this3, _ret2);
|
|
}
|
|
|
|
_createClass(AggrowDoubleColumn, [{
|
|
key: 'get',
|
|
value: function get(row) {
|
|
return this.data[row];
|
|
}
|
|
}, {
|
|
key: 'insert',
|
|
value: function insert(row, d) {
|
|
this.data[row] = d;
|
|
}
|
|
}, {
|
|
key: 'extend',
|
|
value: function extend(count) {
|
|
var newData = new Float64Array(this.data.length + count);
|
|
newData.set(this.data);
|
|
this.data = newData;
|
|
}
|
|
}]);
|
|
|
|
return AggrowDoubleColumn;
|
|
}(AggrowColumnBase);
|
|
|
|
var AggrowStackColumn = exports.AggrowStackColumn = function (_AggrowColumnBase4) {
|
|
_inherits(AggrowStackColumn, _AggrowColumnBase4);
|
|
|
|
function AggrowStackColumn(def) {
|
|
_classCallCheck(this, AggrowStackColumn);
|
|
|
|
var _this4 = _possibleConstructorReturn(this, (AggrowStackColumn.__proto__ || Object.getPrototypeOf(AggrowStackColumn)).call(this, def));
|
|
|
|
_this4.data = new Int32Array(0);
|
|
|
|
_this4.stacks = def.stacks;
|
|
_this4.getter = def.getter;
|
|
_this4.formatter = def.formatter;
|
|
return _this4;
|
|
}
|
|
|
|
_createClass(AggrowStackColumn, [{
|
|
key: 'get',
|
|
value: function get(row) {
|
|
return this.data[row];
|
|
}
|
|
}, {
|
|
key: 'insert',
|
|
value: function insert(row, s) {
|
|
this.data[row] = s.id;
|
|
}
|
|
}, {
|
|
key: 'extend',
|
|
value: function extend(count) {
|
|
var newData = new Int32Array(this.data.length + count);
|
|
newData.set(this.data);
|
|
this.data = newData;
|
|
}
|
|
}]);
|
|
|
|
return AggrowStackColumn;
|
|
}(AggrowColumnBase);
|
|
|
|
function newColumn(def) {
|
|
switch (def.type) {
|
|
case 'string':
|
|
return new AggrowStringColumn(def);
|
|
case 'int':
|
|
return new AggrowIntColumn(def);
|
|
case 'double':
|
|
return new AggrowDoubleColumn(def);
|
|
case 'stack':
|
|
return new AggrowStackColumn(def);
|
|
default:
|
|
throw new Error('Unknown column type: ' + def.type);
|
|
}
|
|
}
|
|
|
|
var AggrowData = function () {
|
|
function AggrowData(columnDefs) {
|
|
_classCallCheck(this, AggrowData);
|
|
|
|
this.rowCount = 0;
|
|
|
|
this.columns = columnDefs.map(newColumn);
|
|
}
|
|
|
|
_createClass(AggrowData, [{
|
|
key: 'rowInserter',
|
|
value: function rowInserter(numRows) {
|
|
var columns = this.columns;
|
|
columns.forEach(function (c) {
|
|
return c.extend(numRows);
|
|
});
|
|
var currRow = this.rowCount;
|
|
var endRow = currRow + numRows;
|
|
this.rowCount = endRow;
|
|
|
|
return new RowInserter(columns, { currRow: currRow, endRow: endRow });
|
|
}
|
|
}, {
|
|
key: 'getColumn',
|
|
value: function getColumn(name) {
|
|
return this.columns.find(function (c) {
|
|
return c.name === name;
|
|
});
|
|
}
|
|
}, {
|
|
key: 'flattenStacks',
|
|
value: function flattenStacks() {
|
|
this.columns.forEach(function (c) {
|
|
if (c instanceof AggrowStackColumn) {
|
|
c.stacks.flatten();
|
|
}
|
|
});
|
|
}
|
|
}]);
|
|
|
|
return AggrowData;
|
|
}();
|
|
|
|
exports.default = AggrowData;
|
|
|
|
var RowInserter = function () {
|
|
function RowInserter(columns, params) {
|
|
_classCallCheck(this, RowInserter);
|
|
|
|
this.columns = columns;
|
|
this.currRow = params.currRow;
|
|
this.endRow = params.endRow;
|
|
}
|
|
|
|
_createClass(RowInserter, [{
|
|
key: 'insertRow',
|
|
value: function insertRow() {
|
|
var _this5 = this;
|
|
|
|
(0, _invariant2.default)(this.currRow < this.endRow, 'Tried to insert data off end of added range!');
|
|
|
|
for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
args[_key3] = arguments[_key3];
|
|
}
|
|
|
|
(0, _invariant2.default)(args.length === this.columns.length, 'Expected data for ' + this.columns.length + ' columns, got ' + args.length + ' columns');
|
|
|
|
args.forEach(function (arg, i) {
|
|
return _this5.columns[i].insert(_this5.currRow, arg);
|
|
});
|
|
this.currRow += 1;
|
|
}
|
|
}, {
|
|
key: 'done',
|
|
value: function done() {
|
|
(0, _invariant2.default)(this.currRow === this.endRow, 'Unfilled rows!');
|
|
}
|
|
}]);
|
|
|
|
return RowInserter;
|
|
}();
|
|
|
|
/***/ },
|
|
/* 163 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
'use strict';
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
|
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
|
|
var _invariant = __webpack_require__(161);
|
|
|
|
var _invariant2 = _interopRequireDefault(_invariant);
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
|
var StackRegistry = function () {
|
|
function StackRegistry() {
|
|
_classCallCheck(this, StackRegistry);
|
|
|
|
this.root = { id: 0 };
|
|
this.nodeCount = 1;
|
|
this.maxDepth = -1;
|
|
this.stackIdMap = null;
|
|
}
|
|
|
|
_createClass(StackRegistry, [{
|
|
key: 'insert',
|
|
value: function insert(parent, frameId) {
|
|
(0, _invariant2.default)(this.stackIdMap === null, 'Stacks already flattened!');
|
|
var node = parent[frameId];
|
|
if (node === undefined) {
|
|
node = { id: this.nodeCount };
|
|
this.nodeCount += 1;
|
|
|
|
// TODO: make a builder instead of mutating the array?
|
|
parent[frameId] = node; // eslint-disable-line no-param-reassign
|
|
}
|
|
return node;
|
|
}
|
|
}, {
|
|
key: 'get',
|
|
value: function get(id) {
|
|
(0, _invariant2.default)(this.stackIdMap, 'Stacks not flattened!');
|
|
return this.stackIdMap[id];
|
|
}
|
|
}, {
|
|
key: 'flatten',
|
|
value: function flatten() {
|
|
if (this.stackIdMap !== null) {
|
|
return;
|
|
}
|
|
var stackFrameCount = 0;
|
|
function countStacks(tree, depth) {
|
|
var leaf = true;
|
|
Object.keys(tree).forEach(function (frameId) {
|
|
if (frameId !== 'id') {
|
|
leaf = countStacks(tree[Number(frameId)], depth + 1);
|
|
}
|
|
});
|
|
if (leaf) {
|
|
stackFrameCount += depth;
|
|
}
|
|
return false;
|
|
}
|
|
var root = this.root;
|
|
(0, _invariant2.default)(root, 'Stacks already flattened');
|
|
countStacks(root, 0);
|
|
var stackIdMap = new Array(this.nodeCount);
|
|
var stackArray = new Int32Array(stackFrameCount);
|
|
var maxStackDepth = 0;
|
|
stackFrameCount = 0;
|
|
function flattenStacksImpl(tree, stack) {
|
|
var childStack = void 0;
|
|
maxStackDepth = Math.max(maxStackDepth, stack.length);
|
|
Object.keys(tree).forEach(function (frameId) {
|
|
if (frameId !== 'id') {
|
|
stack.push(Number(frameId));
|
|
childStack = flattenStacksImpl(tree[frameId], stack);
|
|
stack.pop();
|
|
}
|
|
});
|
|
|
|
var id = tree.id;
|
|
(0, _invariant2.default)(id >= 0 && id < stackIdMap.length && stackIdMap[id] === undefined, 'Invalid stack ID!');
|
|
|
|
if (childStack !== undefined) {
|
|
// each child must have our stack as a prefix, so just use that
|
|
stackIdMap[id] = childStack.subarray(0, stack.length);
|
|
} else {
|
|
var newStack = stackArray.subarray(stackFrameCount, stackFrameCount + stack.length);
|
|
stackFrameCount += stack.length;
|
|
for (var i = 0; i < stack.length; i++) {
|
|
newStack[i] = stack[i];
|
|
}
|
|
stackIdMap[id] = newStack;
|
|
}
|
|
return stackIdMap[id];
|
|
}
|
|
flattenStacksImpl(root, []);
|
|
this.root = null;
|
|
this.stackIdMap = stackIdMap;
|
|
this.maxDepth = maxStackDepth;
|
|
}
|
|
}]);
|
|
|
|
return StackRegistry;
|
|
}();
|
|
|
|
exports.default = StackRegistry;
|
|
|
|
/***/ },
|
|
/* 164 */
|
|
/***/ function(module, exports) {
|
|
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
|
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
|
var StringInterner = function () {
|
|
function StringInterner() {
|
|
_classCallCheck(this, StringInterner);
|
|
|
|
this.strings = [];
|
|
this.ids = {};
|
|
}
|
|
|
|
_createClass(StringInterner, [{
|
|
key: "intern",
|
|
value: function intern(s) {
|
|
var find = this.ids[s];
|
|
if (find === undefined) {
|
|
var id = this.strings.length;
|
|
this.ids[s] = id;
|
|
this.strings.push(s);
|
|
return id;
|
|
}
|
|
|
|
return find;
|
|
}
|
|
}, {
|
|
key: "get",
|
|
value: function get(id) {
|
|
return this.strings[id];
|
|
}
|
|
}]);
|
|
|
|
return StringInterner;
|
|
}();
|
|
|
|
exports.default = StringInterner;
|
|
|
|
/***/ },
|
|
/* 165 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
'use strict';
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
|
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
|
|
var _invariant = __webpack_require__(161);
|
|
|
|
var _invariant2 = _interopRequireDefault(_invariant);
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
|
// expander ID definitions
|
|
var FIELD_EXPANDER_ID_MIN = 0x0000;
|
|
var FIELD_EXPANDER_ID_MAX = 0x7fff;
|
|
var STACK_EXPANDER_ID_MIN = 0x8000;
|
|
var STACK_EXPANDER_ID_MAX = 0xffff;
|
|
|
|
// used for row.expander which reference state.activeExpanders (with frame index masked in)
|
|
var INVALID_ACTIVE_EXPANDER = -1;
|
|
var ACTIVE_EXPANDER_MASK = 0xffff;
|
|
var ACTIVE_EXPANDER_FRAME_SHIFT = 16;
|
|
|
|
// aggregator ID definitions
|
|
var AGGREGATOR_ID_MAX = 0xffff;
|
|
|
|
// active aggragators can have sort order changed in the reference
|
|
var ACTIVE_AGGREGATOR_MASK = 0xffff;
|
|
var ACTIVE_AGGREGATOR_ASC_BIT = 0x10000;
|
|
|
|
// tree node state definitions
|
|
var NODE_EXPANDED_BIT = 0x0001; // this row is expanded
|
|
var NODE_REAGGREGATE_BIT = 0x0002; // children need aggregates
|
|
var NODE_REORDER_BIT = 0x0004; // children need to be sorted
|
|
var NODE_REPOSITION_BIT = 0x0008; // children need position
|
|
var NODE_INDENT_SHIFT = 16;
|
|
|
|
function _calleeFrameIdGetter(stack, depth) {
|
|
return stack[depth];
|
|
}
|
|
|
|
function _callerFrameIdGetter(stack, depth) {
|
|
return stack[stack.length - depth - 1];
|
|
}
|
|
|
|
function _createStackComparers(stackGetter, frameIdGetter, maxStackDepth) {
|
|
var comparers = new Array(maxStackDepth);
|
|
|
|
var _loop = function _loop(_depth) {
|
|
var captureDepth = _depth; // NB: to capture depth per loop iteration
|
|
comparers[_depth] = function calleeStackComparer(rowA, rowB) {
|
|
var a = stackGetter(rowA);
|
|
var b = stackGetter(rowB);
|
|
// NB: we put the stacks that are too short at the top,
|
|
// so they can be grouped into the '<exclusive>' bucket
|
|
if (a.length <= captureDepth && b.length <= captureDepth) {
|
|
return 0;
|
|
} else if (a.length <= captureDepth) {
|
|
return -1;
|
|
} else if (b.length <= captureDepth) {
|
|
return 1;
|
|
}
|
|
return frameIdGetter(a, captureDepth) - frameIdGetter(b, captureDepth);
|
|
};
|
|
};
|
|
|
|
for (var _depth = 0; _depth < maxStackDepth; _depth++) {
|
|
_loop(_depth);
|
|
}
|
|
return comparers;
|
|
}
|
|
|
|
function _createTreeNode(parent, label, indices, expander) {
|
|
var indent = parent === null ? 0 : (parent.state >>> NODE_INDENT_SHIFT) + 1; // eslint-disable-line no-bitwise, max-len
|
|
var state = NODE_REPOSITION_BIT | // eslint-disable-line no-bitwise
|
|
NODE_REAGGREGATE_BIT | NODE_REORDER_BIT | indent << NODE_INDENT_SHIFT; // eslint-disable-line no-bitwise
|
|
return {
|
|
parent: parent, // null if root
|
|
children: null, // array of children nodes
|
|
label: label, // string to show in UI
|
|
indices: indices, // row indices under this node
|
|
aggregates: null, // result of aggregate on indices
|
|
expander: expander, // index into state.activeExpanders
|
|
top: 0, // y position of top row (in rows)
|
|
height: 1, // number of rows including children
|
|
state: state };
|
|
}
|
|
|
|
var NO_SORT_ORDER = function NO_SORT_ORDER() {
|
|
return 0;
|
|
}; // (row) => [frameId int]
|
|
// (stack,depth) -> frame id
|
|
// (frameId int) => frame obj
|
|
// (frame obj) => display string
|
|
|
|
var AggrowExpander = function () {
|
|
// eslint-disable-line no-unused-vars
|
|
function AggrowExpander(numRows) {
|
|
_classCallCheck(this, AggrowExpander);
|
|
|
|
this.indices = new Int32Array(numRows);
|
|
for (var i = 0; i < numRows; i++) {
|
|
this.indices[i] = i;
|
|
}
|
|
|
|
this.state = {
|
|
fieldExpanders: [],
|
|
stackExpanders: [],
|
|
activeExpanders: [],
|
|
aggregators: [],
|
|
activeAggregators: [],
|
|
sorter: NO_SORT_ORDER,
|
|
root: _createTreeNode(null, '<root>', this.indices, INVALID_ACTIVE_EXPANDER)
|
|
};
|
|
}
|
|
|
|
_createClass(AggrowExpander, [{
|
|
key: '_evaluateAggregate',
|
|
value: function _evaluateAggregate(row) {
|
|
var activeAggregators = this.state.activeAggregators;
|
|
var aggregates = new Array(activeAggregators.length);
|
|
for (var j = 0; j < activeAggregators.length; j++) {
|
|
var _aggregator = this.state.aggregators[activeAggregators[j]];
|
|
aggregates[j] = _aggregator.aggregator(row.indices);
|
|
}
|
|
row.aggregates = aggregates; // eslint-disable-line no-param-reassign
|
|
row.state |= NODE_REAGGREGATE_BIT; // eslint-disable-line no-bitwise, no-param-reassign
|
|
}
|
|
}, {
|
|
key: '_evaluateAggregates',
|
|
value: function _evaluateAggregates(row) {
|
|
if ((row.state & NODE_EXPANDED_BIT) !== 0) {
|
|
// eslint-disable-line no-bitwise
|
|
var _children = row.children;
|
|
(0, _invariant2.default)(_children, 'Expected non-null children');
|
|
for (var i = 0; i < _children.length; i++) {
|
|
this._evaluateAggregate(_children[i]);
|
|
}
|
|
row.state |= NODE_REORDER_BIT; // eslint-disable-line no-bitwise, no-param-reassign
|
|
}
|
|
row.state ^= NODE_REAGGREGATE_BIT; // eslint-disable-line no-bitwise, no-param-reassign
|
|
}
|
|
}, {
|
|
key: '_evaluateOrder',
|
|
value: function _evaluateOrder(row) {
|
|
if ((row.state & NODE_EXPANDED_BIT) !== 0) {
|
|
// eslint-disable-line no-bitwise
|
|
var _children2 = row.children;
|
|
(0, _invariant2.default)(_children2, 'Expected non-null children');
|
|
for (var i = 0; i < _children2.length; i++) {
|
|
var child = _children2[i];
|
|
child.state |= NODE_REORDER_BIT; // eslint-disable-line no-bitwise
|
|
}
|
|
_children2.sort(this.state.sorter);
|
|
row.state |= NODE_REPOSITION_BIT; // eslint-disable-line no-bitwise, no-param-reassign
|
|
}
|
|
row.state ^= NODE_REORDER_BIT; // eslint-disable-line no-bitwise, no-param-reassign
|
|
}
|
|
}, {
|
|
key: '_evaluatePosition',
|
|
value: function _evaluatePosition(row) {
|
|
// eslint-disable-line class-methods-use-this
|
|
if ((row.state & NODE_EXPANDED_BIT) !== 0) {
|
|
// eslint-disable-line no-bitwise
|
|
var _children3 = row.children;
|
|
(0, _invariant2.default)(_children3, 'Expected a children array');
|
|
var childTop = row.top + 1;
|
|
for (var i = 0; i < _children3.length; i++) {
|
|
var child = _children3[i];
|
|
if (child.top !== childTop) {
|
|
child.top = childTop;
|
|
child.state |= NODE_REPOSITION_BIT; // eslint-disable-line no-bitwise
|
|
}
|
|
childTop += child.height;
|
|
}
|
|
}
|
|
row.state ^= NODE_REPOSITION_BIT; // eslint-disable-line no-bitwise, no-param-reassign
|
|
}
|
|
}, {
|
|
key: '_getRowsImpl',
|
|
value: function _getRowsImpl(row, top, height, result) {
|
|
if ((row.state & NODE_REAGGREGATE_BIT) !== 0) {
|
|
// eslint-disable-line no-bitwise
|
|
this._evaluateAggregates(row);
|
|
}
|
|
if ((row.state & NODE_REORDER_BIT) !== 0) {
|
|
// eslint-disable-line no-bitwise
|
|
this._evaluateOrder(row);
|
|
}
|
|
if ((row.state & NODE_REPOSITION_BIT) !== 0) {
|
|
// eslint-disable-line no-bitwise
|
|
this._evaluatePosition(row);
|
|
}
|
|
|
|
if (row.top >= top && row.top < top + height) {
|
|
(0, _invariant2.default)(result[row.top - top] === null, 'getRows put more than one row at position ' + row.top + ' into result');
|
|
result[row.top - top] = row; // eslint-disable-line no-param-reassign
|
|
}
|
|
if ((row.state & NODE_EXPANDED_BIT) !== 0) {
|
|
// eslint-disable-line no-bitwise
|
|
var _children4 = row.children;
|
|
(0, _invariant2.default)(_children4, 'Expected non-null children');
|
|
for (var i = 0; i < _children4.length; i++) {
|
|
var child = _children4[i];
|
|
if (child.top < top + height && top < child.top + child.height) {
|
|
this._getRowsImpl(child, top, height, result);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}, {
|
|
key: '_updateHeight',
|
|
value: function _updateHeight(row, heightChange) {
|
|
// eslint-disable-line class-methods-use-this, max-len
|
|
while (row !== null) {
|
|
row.height += heightChange; // eslint-disable-line no-param-reassign
|
|
row.state |= NODE_REPOSITION_BIT; // eslint-disable-line no-bitwise, no-param-reassign
|
|
row = row.parent; // eslint-disable-line no-param-reassign
|
|
}
|
|
}
|
|
}, {
|
|
key: '_addChildrenWithFieldExpander',
|
|
value: function _addChildrenWithFieldExpander(row, expander, nextActiveIndex) {
|
|
// eslint-disable-line class-methods-use-this, max-len
|
|
var rowIndices = row.indices;
|
|
var comparer = expander.comparer;
|
|
var formatter = expander.formatter;
|
|
var getter = expander.getter;
|
|
rowIndices.sort(comparer);
|
|
var begin = 0;
|
|
var end = 1;
|
|
row.children = []; // eslint-disable-line no-param-reassign
|
|
while (end < rowIndices.length) {
|
|
if (comparer(rowIndices[begin], rowIndices[end]) !== 0) {
|
|
(0, _invariant2.default)(row.children, 'Expected a children array');
|
|
row.children.push(_createTreeNode(row, expander.name + ': ' + formatter(getter(rowIndices[begin])), rowIndices.subarray(begin, end), nextActiveIndex));
|
|
begin = end;
|
|
}
|
|
end += 1;
|
|
}
|
|
row.children.push(_createTreeNode(row, expander.name + ': ' + formatter(getter(rowIndices[begin])), rowIndices.subarray(begin, end), nextActiveIndex));
|
|
}
|
|
}, {
|
|
key: '_addChildrenWithStackExpander',
|
|
value: function _addChildrenWithStackExpander( // eslint-disable-line class-methods-use-this
|
|
row, expander, activeIndex, depth, nextActiveIndex) {
|
|
var rowIndices = row.indices;
|
|
var stackGetter = expander.stackGetter;
|
|
var frameIdGetter = expander.frameIdGetter;
|
|
var frameGetter = expander.frameGetter;
|
|
var frameFormatter = expander.frameFormatter;
|
|
var comparer = expander.comparers[depth];
|
|
var expandNextFrame = activeIndex | depth + 1 << ACTIVE_EXPANDER_FRAME_SHIFT; // eslint-disable-line no-bitwise, max-len
|
|
rowIndices.sort(comparer);
|
|
var columnName = '';
|
|
if (depth === 0) {
|
|
columnName = expander.name + ': ';
|
|
}
|
|
|
|
// put all the too-short stacks under <exclusive>
|
|
var begin = 0;
|
|
var beginStack = null;
|
|
row.children = []; // eslint-disable-line no-param-reassign
|
|
while (begin < rowIndices.length) {
|
|
beginStack = stackGetter(rowIndices[begin]);
|
|
if (beginStack.length > depth) {
|
|
break;
|
|
}
|
|
begin += 1;
|
|
}
|
|
(0, _invariant2.default)(beginStack !== null, 'Expected beginStack at this point');
|
|
if (begin > 0) {
|
|
row.children.push(_createTreeNode(row, columnName + '<exclusive>', rowIndices.subarray(0, begin), nextActiveIndex));
|
|
}
|
|
// aggregate the rest under frames
|
|
if (begin < rowIndices.length) {
|
|
var end = begin + 1;
|
|
while (end < rowIndices.length) {
|
|
var endStack = stackGetter(rowIndices[end]);
|
|
if (frameIdGetter(beginStack, depth) !== frameIdGetter(endStack, depth)) {
|
|
(0, _invariant2.default)(row.children, 'Expected a children array');
|
|
row.children.push(_createTreeNode(row, columnName + frameFormatter(frameGetter(frameIdGetter(beginStack, depth))), rowIndices.subarray(begin, end), expandNextFrame));
|
|
begin = end;
|
|
beginStack = endStack;
|
|
}
|
|
end += 1;
|
|
}
|
|
row.children.push(_createTreeNode(row, columnName + frameFormatter(frameGetter(frameIdGetter(beginStack, depth))), rowIndices.subarray(begin, end), expandNextFrame));
|
|
}
|
|
}
|
|
}, {
|
|
key: '_contractRow',
|
|
value: function _contractRow(row) {
|
|
(0, _invariant2.default)((row.state & NODE_EXPANDED_BIT) !== 0, // eslint-disable-line no-bitwise
|
|
'Cannot contract row; already contracted!');
|
|
row.state ^= NODE_EXPANDED_BIT; // eslint-disable-line no-bitwise, no-param-reassign
|
|
var heightChange = 1 - row.height;
|
|
this._updateHeight(row, heightChange);
|
|
}
|
|
}, {
|
|
key: '_pruneExpanders',
|
|
value: function _pruneExpanders(row, oldExpander, newExpander) {
|
|
row.state |= NODE_REPOSITION_BIT; // eslint-disable-line no-bitwise, no-param-reassign
|
|
if (row.expander === oldExpander) {
|
|
row.state |= NODE_REAGGREGATE_BIT | NODE_REORDER_BIT | NODE_REPOSITION_BIT; // eslint-disable-line no-bitwise, no-param-reassign, max-len
|
|
if ((row.state & NODE_EXPANDED_BIT) !== 0) {
|
|
// eslint-disable-line no-bitwise
|
|
this._contractRow(row);
|
|
}
|
|
row.children = null; // eslint-disable-line no-param-reassign
|
|
row.expander = newExpander; // eslint-disable-line no-param-reassign
|
|
} else {
|
|
row.state |= NODE_REPOSITION_BIT; // eslint-disable-line no-bitwise, no-param-reassign
|
|
var _children5 = row.children;
|
|
if (_children5 != null) {
|
|
for (var i = 0; i < _children5.length; i++) {
|
|
var child = _children5[i];
|
|
this._pruneExpanders(child, oldExpander, newExpander);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}, {
|
|
key: 'addFieldExpander',
|
|
value: function addFieldExpander(name, comparer, getter, formatter) {
|
|
(0, _invariant2.default)(FIELD_EXPANDER_ID_MIN + this.state.fieldExpanders.length < FIELD_EXPANDER_ID_MAX, 'too many field expanders!');
|
|
this.state.fieldExpanders.push({ name: name, comparer: comparer, getter: getter, formatter: formatter });
|
|
return FIELD_EXPANDER_ID_MIN + this.state.fieldExpanders.length - 1;
|
|
}
|
|
}, {
|
|
key: 'addStackExpander',
|
|
value: function addStackExpander(name, maxStackDepth, stackGetter, frameGetter, frameFormatter, reverse) {
|
|
(0, _invariant2.default)(STACK_EXPANDER_ID_MIN + this.state.fieldExpanders.length < STACK_EXPANDER_ID_MAX, 'Too many stack expanders!');
|
|
var idGetter = reverse ? _callerFrameIdGetter : _calleeFrameIdGetter;
|
|
this.state.stackExpanders.push({
|
|
name: name,
|
|
stackGetter: stackGetter,
|
|
comparers: _createStackComparers(stackGetter, idGetter, maxStackDepth),
|
|
frameIdGetter: idGetter,
|
|
frameGetter: frameGetter,
|
|
frameFormatter: frameFormatter
|
|
});
|
|
return STACK_EXPANDER_ID_MIN + this.state.stackExpanders.length - 1;
|
|
}
|
|
}, {
|
|
key: 'getExpanders',
|
|
value: function getExpanders() {
|
|
var expanders = [];
|
|
for (var i = 0; i < this.state.fieldExpanders.length; i++) {
|
|
expanders.push(FIELD_EXPANDER_ID_MIN + i);
|
|
}
|
|
for (var _i = 0; _i < this.state.stackExpanders.length; _i++) {
|
|
expanders.push(STACK_EXPANDER_ID_MIN + _i);
|
|
}
|
|
return expanders;
|
|
}
|
|
}, {
|
|
key: 'getExpanderName',
|
|
value: function getExpanderName(id) {
|
|
if (id >= FIELD_EXPANDER_ID_MIN && id <= FIELD_EXPANDER_ID_MAX) {
|
|
return this.state.fieldExpanders[id - FIELD_EXPANDER_ID_MIN].name;
|
|
} else if (id >= STACK_EXPANDER_ID_MIN && id <= STACK_EXPANDER_ID_MAX) {
|
|
return this.state.stackExpanders[id - STACK_EXPANDER_ID_MIN].name;
|
|
}
|
|
throw new Error('Unknown expander ID ' + id.toString());
|
|
}
|
|
}, {
|
|
key: 'setActiveExpanders',
|
|
value: function setActiveExpanders(ids) {
|
|
for (var i = 0; i < ids.length; i++) {
|
|
var _id = ids[i];
|
|
if (_id >= FIELD_EXPANDER_ID_MIN && _id <= FIELD_EXPANDER_ID_MAX) {
|
|
(0, _invariant2.default)(_id - FIELD_EXPANDER_ID_MIN < this.state.fieldExpanders.length, 'field expander for id ' + _id.toString() + ' does not exist!');
|
|
} else if (_id >= STACK_EXPANDER_ID_MIN && _id <= STACK_EXPANDER_ID_MAX) {
|
|
(0, _invariant2.default)(_id - STACK_EXPANDER_ID_MIN < this.state.stackExpanders.length, 'stack expander for id ' + _id.toString() + ' does not exist!');
|
|
}
|
|
}
|
|
for (var _i2 = 0; _i2 < ids.length; _i2++) {
|
|
if (this.state.activeExpanders.length <= _i2) {
|
|
this._pruneExpanders(this.state.root, INVALID_ACTIVE_EXPANDER, _i2);
|
|
break;
|
|
} else if (ids[_i2] !== this.state.activeExpanders[_i2]) {
|
|
this._pruneExpanders(this.state.root, _i2, _i2);
|
|
break;
|
|
}
|
|
}
|
|
// TODO: if ids is prefix of activeExpanders, we need to make an expander invalid
|
|
this.state.activeExpanders = ids.slice();
|
|
}
|
|
}, {
|
|
key: 'getActiveExpanders',
|
|
value: function getActiveExpanders() {
|
|
return this.state.activeExpanders.slice();
|
|
}
|
|
}, {
|
|
key: 'addAggregator',
|
|
value: function addAggregator(name, aggregator, formatter, sorter) {
|
|
(0, _invariant2.default)(this.state.aggregators.length < AGGREGATOR_ID_MAX, 'too many aggregators!');
|
|
this.state.aggregators.push({ name: name, aggregator: aggregator, formatter: formatter, sorter: sorter });
|
|
return this.state.aggregators.length - 1;
|
|
}
|
|
}, {
|
|
key: 'getAggregators',
|
|
value: function getAggregators() {
|
|
var aggregators = [];
|
|
for (var i = 0; i < this.state.aggregators.length; i++) {
|
|
aggregators.push(i);
|
|
}
|
|
return aggregators;
|
|
}
|
|
}, {
|
|
key: 'getAggregatorName',
|
|
value: function getAggregatorName(id) {
|
|
return this.state.aggregators[id & ACTIVE_AGGREGATOR_MASK].name; // eslint-disable-line no-bitwise, max-len
|
|
}
|
|
}, {
|
|
key: 'setActiveAggregators',
|
|
value: function setActiveAggregators(ids) {
|
|
var _this = this;
|
|
|
|
for (var i = 0; i < ids.length; i++) {
|
|
var _id2 = ids[i] & ACTIVE_AGGREGATOR_MASK; // eslint-disable-line no-bitwise
|
|
(0, _invariant2.default)(_id2 >= 0 && _id2 < this.state.aggregators.length, 'aggregator id ' + _id2.toString() + ' not valid');
|
|
}
|
|
this.state.activeAggregators = ids.slice();
|
|
// NB: evaluate root here because dirty bit is for children
|
|
// so someone has to start with root, and it might as well be right away
|
|
this._evaluateAggregate(this.state.root);
|
|
var sorter = NO_SORT_ORDER;
|
|
|
|
var _loop2 = function _loop2(_i3) {
|
|
var ascending = (ids[_i3] & ACTIVE_AGGREGATOR_ASC_BIT) !== 0; // eslint-disable-line no-bitwise, max-len
|
|
var id = ids[_i3] & ACTIVE_AGGREGATOR_MASK; // eslint-disable-line no-bitwise
|
|
var comparer = _this.state.aggregators[id].sorter;
|
|
var captureSorter = sorter;
|
|
var captureIndex = _i3;
|
|
sorter = function sorter(a, b) {
|
|
(0, _invariant2.default)(a.aggregates && b.aggregates, 'Expected aggregates.');
|
|
var c = comparer(a.aggregates[captureIndex], b.aggregates[captureIndex]);
|
|
if (c === 0) {
|
|
return captureSorter(a, b);
|
|
}
|
|
return ascending ? -c : c;
|
|
};
|
|
};
|
|
|
|
for (var _i3 = ids.length - 1; _i3 >= 0; _i3--) {
|
|
_loop2(_i3);
|
|
}
|
|
this.state.sorter = sorter; // eslint-disable-line no-param-reassign
|
|
this.state.root.state |= NODE_REORDER_BIT; // eslint-disable-line no-bitwise, no-param-reassign
|
|
}
|
|
}, {
|
|
key: 'getActiveAggregators',
|
|
value: function getActiveAggregators() {
|
|
return this.state.activeAggregators.slice();
|
|
}
|
|
}, {
|
|
key: 'getRows',
|
|
value: function getRows(top, height) {
|
|
var result = new Array(height);
|
|
for (var i = 0; i < height; i++) {
|
|
result[i] = null;
|
|
}
|
|
this._getRowsImpl(this.state.root, top, height, result);
|
|
return result;
|
|
}
|
|
}, {
|
|
key: '_findRowImpl',
|
|
value: function _findRowImpl(fromRow, predicate, row) {
|
|
if (row.top > fromRow && predicate(row)) {
|
|
return row.top; // this row is a match!
|
|
}
|
|
|
|
// remember how to clean up after ourselves so we only expand as little as possible
|
|
var contractChildren = this.canExpand(row);
|
|
var cleanUpChildren = row.children === null;
|
|
if (contractChildren) {
|
|
this.expand(row);
|
|
}
|
|
|
|
// evaluate position so we search in the correct order
|
|
if ((row.state & NODE_REAGGREGATE_BIT) !== 0) {
|
|
// eslint-disable-line no-bitwise
|
|
this._evaluateAggregates(row);
|
|
}
|
|
if ((row.state & NODE_REORDER_BIT) !== 0) {
|
|
// eslint-disable-line no-bitwise
|
|
this._evaluateOrder(row);
|
|
}
|
|
if ((row.state & NODE_REPOSITION_BIT) !== 0) {
|
|
// eslint-disable-line no-bitwise
|
|
this._evaluatePosition(row);
|
|
}
|
|
// TODO: encapsulate row state management somewhere so logic can be shared with _getRowsImpl
|
|
|
|
// search in children
|
|
var children = row.children;
|
|
if (children !== null) {
|
|
for (var i = 0; i < children.length; i++) {
|
|
var child = children[i];
|
|
if (child.top + child.height > fromRow) {
|
|
var find = this._findRowImpl(fromRow, predicate, child);
|
|
if (find >= 0) {
|
|
return find;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// clean up to leave the tree how it was if we didn't find anything
|
|
// this also saves memory
|
|
if (contractChildren) {
|
|
this.contract(row);
|
|
}
|
|
if (cleanUpChildren) {
|
|
row.children = null;
|
|
}
|
|
return -1;
|
|
}
|
|
|
|
// findRow - find the first row that matches a predicate
|
|
// parameters
|
|
// predicate: returns true when row is found
|
|
// fromRow: start search from after this row index (negative for start at beginning)
|
|
// returns: index of first row that matches, -1 if no match found
|
|
|
|
}, {
|
|
key: 'findRow',
|
|
value: function findRow(predicate, fromRow) {
|
|
return this._findRowImpl(!fromRow ? -1 : fromRow, predicate, this.state.root);
|
|
}
|
|
}, {
|
|
key: 'getRowLabel',
|
|
value: function getRowLabel(row) {
|
|
// eslint-disable-line class-methods-use-this
|
|
return row.label;
|
|
}
|
|
}, {
|
|
key: 'getRowIndent',
|
|
value: function getRowIndent(row) {
|
|
// eslint-disable-line class-methods-use-this
|
|
return row.state >>> NODE_INDENT_SHIFT; // eslint-disable-line no-bitwise
|
|
}
|
|
}, {
|
|
key: 'getRowExpanderIndex',
|
|
value: function getRowExpanderIndex(row) {
|
|
// eslint-disable-line class-methods-use-this
|
|
if (row.parent) {
|
|
return row.parent.expander & ACTIVE_EXPANDER_MASK; // eslint-disable-line no-bitwise
|
|
}
|
|
return -1;
|
|
}
|
|
}, {
|
|
key: 'getRowExpansionPath',
|
|
value: function getRowExpansionPath(row) {
|
|
var path = [];
|
|
(0, _invariant2.default)(row, 'Expected non-null row here');
|
|
var index = row.indices[0];
|
|
row = row.parent; // eslint-disable-line no-param-reassign
|
|
while (row) {
|
|
var exIndex = row.expander & ACTIVE_EXPANDER_MASK; // eslint-disable-line no-bitwise
|
|
var exId = this.state.activeExpanders[exIndex];
|
|
if (exId >= FIELD_EXPANDER_ID_MIN && exId < FIELD_EXPANDER_ID_MIN + this.state.fieldExpanders.length) {
|
|
var _expander = this.state.fieldExpanders[exId - FIELD_EXPANDER_ID_MIN]; // eslint-disable-line no-bitwise, max-len
|
|
path.push(_expander.getter(index));
|
|
row = row.parent; // eslint-disable-line no-param-reassign
|
|
} else if (exId >= STACK_EXPANDER_ID_MIN && exId < STACK_EXPANDER_ID_MIN + this.state.stackExpanders.length) {
|
|
var _expander2 = this.state.stackExpanders[exId - STACK_EXPANDER_ID_MIN];
|
|
var _stackGetter = _expander2.stackGetter;
|
|
var _frameIdGetter = _expander2.frameIdGetter;
|
|
var _frameGetter = _expander2.frameGetter;
|
|
var _stack = [];
|
|
while (row && (row.expander & ACTIVE_EXPANDER_MASK) === exIndex) {
|
|
// eslint-disable-line no-bitwise, max-len
|
|
var _depth2 = row.expander >>> ACTIVE_EXPANDER_FRAME_SHIFT; // eslint-disable-line no-bitwise, max-len
|
|
var rowStack = _stackGetter(index);
|
|
if (_depth2 >= rowStack.length) {
|
|
_stack.push('<exclusive>');
|
|
} else {
|
|
_stack.push(_frameGetter(_frameIdGetter(rowStack, _depth2)));
|
|
}
|
|
row = row.parent; // eslint-disable-line no-param-reassign
|
|
}
|
|
path.push(_stack.reverse());
|
|
}
|
|
}
|
|
return path.reverse();
|
|
}
|
|
}, {
|
|
key: 'getRowAggregate',
|
|
value: function getRowAggregate(row, index) {
|
|
var aggregator = this.state.aggregators[this.state.activeAggregators[index]];
|
|
(0, _invariant2.default)(row.aggregates, 'Expected aggregates');
|
|
return aggregator.formatter(row.aggregates[index]);
|
|
}
|
|
}, {
|
|
key: 'getHeight',
|
|
value: function getHeight() {
|
|
return this.state.root.height;
|
|
}
|
|
}, {
|
|
key: 'canExpand',
|
|
value: function canExpand(row) {
|
|
// eslint-disable-line class-methods-use-this
|
|
return (row.state & NODE_EXPANDED_BIT) === 0 && row.expander !== INVALID_ACTIVE_EXPANDER; // eslint-disable-line no-bitwise, max-len
|
|
}
|
|
}, {
|
|
key: 'canContract',
|
|
value: function canContract(row) {
|
|
// eslint-disable-line class-methods-use-this
|
|
return (row.state & NODE_EXPANDED_BIT) !== 0; // eslint-disable-line no-bitwise
|
|
}
|
|
}, {
|
|
key: 'expand',
|
|
value: function expand(row) {
|
|
(0, _invariant2.default)((row.state & NODE_EXPANDED_BIT) === 0, // eslint-disable-line no-bitwise
|
|
'can not expand row, already expanded');
|
|
(0, _invariant2.default)(row.height === 1, 'unexpanded row has height ' + row.height.toString() + ' != 1');
|
|
if (row.children === null) {
|
|
// first expand, generate children
|
|
var activeIndex = row.expander & ACTIVE_EXPANDER_MASK; // eslint-disable-line no-bitwise
|
|
var nextActiveIndex = activeIndex + 1; // NB: if next is stack, frame is 0
|
|
if (nextActiveIndex >= this.state.activeExpanders.length) {
|
|
nextActiveIndex = INVALID_ACTIVE_EXPANDER;
|
|
}
|
|
(0, _invariant2.default)(activeIndex < this.state.activeExpanders.length, 'invalid active expander index ' + activeIndex.toString());
|
|
var exId = this.state.activeExpanders[activeIndex];
|
|
if (exId >= FIELD_EXPANDER_ID_MIN && exId < FIELD_EXPANDER_ID_MIN + this.state.fieldExpanders.length) {
|
|
var _expander3 = this.state.fieldExpanders[exId - FIELD_EXPANDER_ID_MIN];
|
|
this._addChildrenWithFieldExpander(row, _expander3, nextActiveIndex);
|
|
} else if (exId >= STACK_EXPANDER_ID_MIN && exId < STACK_EXPANDER_ID_MIN + this.state.stackExpanders.length) {
|
|
var _depth3 = row.expander >>> ACTIVE_EXPANDER_FRAME_SHIFT; // eslint-disable-line no-bitwise, max-len
|
|
var _expander4 = this.state.stackExpanders[exId - STACK_EXPANDER_ID_MIN];
|
|
this._addChildrenWithStackExpander(row, _expander4, activeIndex, _depth3, nextActiveIndex);
|
|
} else {
|
|
throw new Error('state.activeIndex ' + activeIndex + ' has invalid expander' + exId);
|
|
}
|
|
}
|
|
row.state |= NODE_EXPANDED_BIT | NODE_REAGGREGATE_BIT | NODE_REORDER_BIT | NODE_REPOSITION_BIT; // eslint-disable-line no-bitwise, no-param-reassign, max-len
|
|
var heightChange = 0;
|
|
(0, _invariant2.default)(row.children, 'Expected a children array');
|
|
for (var i = 0; i < row.children.length; i++) {
|
|
heightChange += row.children[i].height;
|
|
}
|
|
this._updateHeight(row, heightChange);
|
|
// if children only contains one node, then expand it as well
|
|
(0, _invariant2.default)(row.children, 'Expected a children array');
|
|
if (row.children.length === 1 && this.canExpand(row.children[0])) {
|
|
this.expand(row.children[0]);
|
|
}
|
|
}
|
|
}, {
|
|
key: 'contract',
|
|
value: function contract(row) {
|
|
this._contractRow(row);
|
|
}
|
|
}]);
|
|
|
|
return AggrowExpander;
|
|
}();
|
|
|
|
exports.default = AggrowExpander;
|
|
|
|
/***/ },
|
|
/* 166 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
'use strict';
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
|
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
|
|
var _invariant = __webpack_require__(161);
|
|
|
|
var _invariant2 = _interopRequireDefault(_invariant);
|
|
|
|
var _react = __webpack_require__(147);
|
|
|
|
var _react2 = _interopRequireDefault(_react);
|
|
|
|
var _Aggrow = __webpack_require__(160);
|
|
|
|
var _Aggrow2 = _interopRequireDefault(_Aggrow);
|
|
|
|
var _TableConfiguration = __webpack_require__(167);
|
|
|
|
var _TableConfiguration2 = _interopRequireDefault(_TableConfiguration);
|
|
|
|
var _TableHeader = __webpack_require__(171);
|
|
|
|
var _TableHeader2 = _interopRequireDefault(_TableHeader);
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
|
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
|
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
|
|
var rowHeight = 20;
|
|
var treeIndent = 16;
|
|
|
|
var AggrowTable = function (_React$Component) {
|
|
_inherits(AggrowTable, _React$Component);
|
|
|
|
function AggrowTable(props) {
|
|
_classCallCheck(this, AggrowTable);
|
|
|
|
var _this = _possibleConstructorReturn(this, (AggrowTable.__proto__ || Object.getPrototypeOf(AggrowTable)).call(this, props));
|
|
|
|
_this.scroll = function (e) {
|
|
var viewport = e.target;
|
|
(0, _invariant2.default)(viewport instanceof HTMLElement, 'Expected an HTML element');
|
|
var top = Math.floor((viewport.scrollTop - viewport.clientHeight * 1.0) / rowHeight);
|
|
var height = Math.ceil(viewport.clientHeight * 3.0 / rowHeight);
|
|
if (top !== _this.state.viewport.top || height !== _this.state.viewport.height) {
|
|
_this.setState({ viewport: { top: top, height: height } });
|
|
}
|
|
};
|
|
|
|
_this._scrollDiv = null;
|
|
|
|
_this._setScrollDiv = function (div) {
|
|
_this._scrollDiv = div;
|
|
};
|
|
|
|
_this.keydown = function (e) {
|
|
var expander = _this.state.aggrow.expander;
|
|
var cursor = _this.state.cursor;
|
|
var row = expander.getRows(cursor, 1)[0];
|
|
(0, _invariant2.default)(row, 'Expected a row');
|
|
switch (e.keyCode) {
|
|
case 38:
|
|
// up
|
|
if (cursor > 0) {
|
|
_this._updateCursor(cursor - 1);
|
|
_this._keepCursorInViewport();
|
|
}
|
|
e.preventDefault();
|
|
break;
|
|
case 40:
|
|
// down
|
|
if (cursor < expander.getHeight() - 1) {
|
|
_this._updateCursor(cursor + 1);
|
|
_this._keepCursorInViewport();
|
|
}
|
|
e.preventDefault();
|
|
break;
|
|
case 37:
|
|
// left
|
|
if (expander.canContract(row)) {
|
|
_this._contractRow(row);
|
|
} else if (expander.getRowIndent(row) > 0) {
|
|
var indent = expander.getRowIndent(row) - 1;
|
|
while (expander.getRowIndent(row) > indent) {
|
|
cursor -= 1;
|
|
row = expander.getRows(cursor, 1)[0];
|
|
}
|
|
_this._updateCursor(cursor);
|
|
_this._keepCursorInViewport();
|
|
}
|
|
e.preventDefault();
|
|
break;
|
|
case 39:
|
|
// right
|
|
if (expander.canExpand(row)) {
|
|
_this._expandRow(row);
|
|
} else if (cursor < expander.getHeight() - 1) {
|
|
_this._updateCursor(cursor + 1);
|
|
_this._keepCursorInViewport();
|
|
}
|
|
e.preventDefault();
|
|
break;
|
|
default:
|
|
// Do nothing
|
|
break;
|
|
}
|
|
};
|
|
|
|
_this.dropAction = function (s, d) {
|
|
var expander = _this.state.aggrow.expander;
|
|
if (s.startsWith('aggregate:active:')) {
|
|
var sIndex = parseInt(s.substr(17), 10);
|
|
var dIndex = -1;
|
|
var active = expander.getActiveAggregators();
|
|
var dragged = active[sIndex];
|
|
if (d.startsWith('aggregate:insert:')) {
|
|
dIndex = parseInt(d.substr(17), 10);
|
|
} else if (d === 'divider:insert') {
|
|
dIndex = active.length;
|
|
} else {
|
|
throw new Error('not allowed to drag ' + s + ' to ' + d);
|
|
}
|
|
if (dIndex > sIndex) {
|
|
dIndex -= 1;
|
|
}
|
|
active.splice(sIndex, 1);
|
|
active.splice(dIndex, 0, dragged);
|
|
expander.setActiveAggregators(active);
|
|
_this._updateCursor(0);
|
|
} else if (s.startsWith('expander:active:')) {
|
|
var _sIndex = parseInt(s.substr(16), 10);
|
|
var _dIndex = -1;
|
|
var _active = expander.getActiveExpanders();
|
|
var _dragged = _active[_sIndex];
|
|
if (d.startsWith('expander:insert:')) {
|
|
_dIndex = parseInt(d.substr(16), 10);
|
|
} else if (d === 'divider:insert') {
|
|
_dIndex = 0;
|
|
} else {
|
|
throw new Error('not allowed to drag ' + s + ' to ' + d);
|
|
}
|
|
if (_dIndex > _sIndex) {
|
|
_dIndex -= 1;
|
|
}
|
|
_active.splice(_sIndex, 1);
|
|
_active.splice(_dIndex, 0, _dragged);
|
|
expander.setActiveExpanders(_active);
|
|
_this._updateCursor(0);
|
|
} else if (s.startsWith('expander:add:')) {
|
|
var _dIndex2 = -1;
|
|
var sExpander = parseInt(s.substring(13), 10);
|
|
if (d.startsWith('expander:insert:')) {
|
|
_dIndex2 = parseInt(d.substr(16), 10);
|
|
} else if (d === 'divider:insert') {
|
|
_dIndex2 = 0;
|
|
} else {
|
|
throw new Error('not allowed to drag ' + s + ' to ' + d);
|
|
}
|
|
var _active2 = expander.getActiveExpanders();
|
|
_active2.splice(_dIndex2, 0, sExpander);
|
|
expander.setActiveExpanders(_active2);
|
|
_this._updateCursor(0);
|
|
}
|
|
};
|
|
|
|
_this._handleUpdate = function () {
|
|
_this.setState({ aggrow: _this.state.aggrow });
|
|
};
|
|
|
|
_this.state = {
|
|
aggrow: props.aggrow,
|
|
viewport: { top: 0, height: 100 },
|
|
cursor: 0,
|
|
searchValue: ''
|
|
};
|
|
return _this;
|
|
}
|
|
|
|
_createClass(AggrowTable, [{
|
|
key: 'componentDidMount',
|
|
value: function componentDidMount() {
|
|
document.body.addEventListener('keydown', this.keydown);
|
|
}
|
|
}, {
|
|
key: 'componentWillReceiveProps',
|
|
value: function componentWillReceiveProps(nextProps) {
|
|
if (this.props.aggrow !== nextProps.aggrow) {
|
|
this.setState({
|
|
aggrow: nextProps.aggrow,
|
|
viewport: { top: 0, height: 100 },
|
|
cursor: 0
|
|
});
|
|
}
|
|
}
|
|
}, {
|
|
key: 'componentWillUnmount',
|
|
value: function componentWillUnmount() {
|
|
document.body.removeEventListener('keydown', this.keydown);
|
|
}
|
|
}, {
|
|
key: '_updateCursor',
|
|
value: function _updateCursor(position) {
|
|
this.setState({ cursor: position });
|
|
var onSelectionChange = this.props.onSelectionChange;
|
|
if (onSelectionChange) {
|
|
var _row = this.state.aggrow.expander.getRows(position, 1)[0];
|
|
(0, _invariant2.default)(_row, 'Expected a row');
|
|
onSelectionChange(_row);
|
|
}
|
|
}
|
|
}, {
|
|
key: '_contractRow',
|
|
value: function _contractRow(row) {
|
|
var newCursor = this.state.cursor;
|
|
if (newCursor > row.top && newCursor < row.top + row.height) {
|
|
// in contracted section
|
|
newCursor = row.top;
|
|
} else if (newCursor >= row.top + row.height) {
|
|
// below contracted section
|
|
newCursor -= row.height - 1;
|
|
}
|
|
this.state.aggrow.expander.contract(row);
|
|
this._updateCursor(newCursor);
|
|
}
|
|
}, {
|
|
key: '_expandRow',
|
|
value: function _expandRow(row) {
|
|
var newCursor = this.state.cursor;
|
|
this.state.aggrow.expander.expand(row);
|
|
if (newCursor > row.top) {
|
|
// below expanded section
|
|
newCursor += row.height - 1;
|
|
}
|
|
this._updateCursor(newCursor);
|
|
}
|
|
}, {
|
|
key: '_keepCursorInViewport',
|
|
value: function _keepCursorInViewport() {
|
|
if (this._scrollDiv) {
|
|
var _cursor = this.state.cursor;
|
|
var scrollDiv = this._scrollDiv;
|
|
if (_cursor * rowHeight < scrollDiv.scrollTop + scrollDiv.clientHeight * 0.1) {
|
|
scrollDiv.scrollTop = _cursor * rowHeight - scrollDiv.clientHeight * 0.1;
|
|
} else if ((_cursor + 1) * rowHeight > scrollDiv.scrollTop + scrollDiv.clientHeight * 0.9) {
|
|
scrollDiv.scrollTop = (_cursor + 1) * rowHeight - scrollDiv.clientHeight * 0.9;
|
|
}
|
|
}
|
|
}
|
|
}, {
|
|
key: 'renderVirtualizedRows',
|
|
value: function renderVirtualizedRows() {
|
|
var _this2 = this;
|
|
|
|
var expander = this.state.aggrow.expander;
|
|
var viewport = this.state.viewport;
|
|
var rows = expander.getRows(viewport.top, viewport.height);
|
|
return _react2.default.createElement(
|
|
'div',
|
|
{
|
|
style: {
|
|
position: 'absolute',
|
|
width: '100%',
|
|
height: rowHeight * (expander.getHeight() + 20) + 'px'
|
|
} },
|
|
rows.map(function (child) {
|
|
return _this2.renderRow(child);
|
|
})
|
|
);
|
|
}
|
|
}, {
|
|
key: 'renderRow',
|
|
value: function renderRow(toRender) {
|
|
var _this3 = this;
|
|
|
|
if (toRender === null) {
|
|
return null;
|
|
}
|
|
var row = toRender;
|
|
var bg = 'white';
|
|
var expander = this.state.aggrow.expander;
|
|
var columns = [];
|
|
var rowText = '';
|
|
var indent = 4 + expander.getRowIndent(row) * treeIndent;
|
|
var aggregates = expander.getActiveAggregators();
|
|
if (expander.getRowExpanderIndex(row) % 2 === 1) {
|
|
bg = '#f0f0f0';
|
|
}
|
|
if (row.top === this.state.cursor) {
|
|
bg = '#dfe3ee';
|
|
}
|
|
for (var i = 0; i < aggregates.length; i++) {
|
|
var aggregate = expander.getRowAggregate(row, i);
|
|
columns.push(_react2.default.createElement('div', {
|
|
key: 'ag' + i,
|
|
style: {
|
|
width: '16px',
|
|
height: 'inherit',
|
|
backgroundColor: '#8b9dc3',
|
|
flexShrink: '0'
|
|
}
|
|
}));
|
|
columns.push(_react2.default.createElement(
|
|
'div',
|
|
{
|
|
key: 'agsep' + i,
|
|
style: {
|
|
width: '128px',
|
|
textAlign: 'right',
|
|
backgroundColor: bg,
|
|
flexShrink: '0'
|
|
} },
|
|
aggregate
|
|
));
|
|
}
|
|
columns.push(_react2.default.createElement('div', {
|
|
key: 'sep',
|
|
style: {
|
|
width: '16px',
|
|
height: 'inherit',
|
|
backgroundColor: '#3b5998',
|
|
flexShrink: '0'
|
|
}
|
|
}));
|
|
if (expander.canExpand(row)) {
|
|
columns.push(_react2.default.createElement(
|
|
'div',
|
|
{ // eslint-disable-line jsx-a11y/no-static-element-interactions
|
|
key: 'indent'
|
|
// TODO: Fix this to not need an arrow function
|
|
// eslint-disable-next-line react/jsx-no-bind
|
|
, onClick: function onClick() {
|
|
return _this3._expandRow(row);
|
|
},
|
|
style: {
|
|
marginLeft: indent + 'px',
|
|
flexShrink: '0',
|
|
width: '12px',
|
|
textAlign: 'center',
|
|
border: '1px solid gray'
|
|
} },
|
|
'+'
|
|
));
|
|
} else if (expander.canContract(row)) {
|
|
columns.push(_react2.default.createElement(
|
|
'div',
|
|
{ // eslint-disable-line jsx-a11y/no-static-element-interactions
|
|
key: 'indent'
|
|
// TODO: Fix this to not need an arrow function
|
|
// eslint-disable-next-line react/jsx-no-bind
|
|
, onClick: function onClick() {
|
|
return _this3._contractRow(row);
|
|
},
|
|
style: {
|
|
marginLeft: indent + 'px',
|
|
flexShrink: '0',
|
|
width: '12px',
|
|
textAlign: 'center',
|
|
border: '1px solid gray'
|
|
} },
|
|
'-'
|
|
));
|
|
} else {
|
|
columns.push(_react2.default.createElement('div', {
|
|
key: 'indent',
|
|
style: {
|
|
marginLeft: indent + 'px'
|
|
}
|
|
}));
|
|
}
|
|
rowText += expander.getRowLabel(row);
|
|
columns.push(_react2.default.createElement(
|
|
'div',
|
|
{
|
|
key: 'data',
|
|
style: {
|
|
flexShrink: '0',
|
|
whiteSpace: 'nowrap',
|
|
marginRight: '20px'
|
|
} },
|
|
rowText
|
|
));
|
|
return _react2.default.createElement(
|
|
'div',
|
|
{ // eslint-disable-line jsx-a11y/no-static-element-interactions
|
|
key: row.top
|
|
// TODO: Fix this to not need an arrow function
|
|
, onClick: function onClick() {
|
|
// eslint-disable-line react/jsx-no-bind
|
|
_this3._updateCursor(row.top);
|
|
},
|
|
style: {
|
|
position: 'absolute',
|
|
height: rowHeight - 1 + 'px',
|
|
top: rowHeight * row.top + 'px',
|
|
display: 'flex',
|
|
flexDirection: 'row',
|
|
alignItems: 'center',
|
|
backgroundColor: bg,
|
|
borderBottom: '1px solid gray'
|
|
} },
|
|
columns
|
|
);
|
|
}
|
|
}, {
|
|
key: 'render',
|
|
value: function render() {
|
|
var _this4 = this;
|
|
|
|
var expander = this.state.aggrow.expander;
|
|
var cursor = this.state.cursor;
|
|
var row = expander.getRows(cursor, 1)[0];
|
|
(0, _invariant2.default)(row, 'Expected a row');
|
|
var selectedExpander = expander.getRowExpanderIndex(row);
|
|
return _react2.default.createElement(
|
|
'div',
|
|
{ style: { width: '100%', height: '100%', display: 'flex', flexDirection: 'row' } },
|
|
_react2.default.createElement(
|
|
'div',
|
|
{
|
|
style: {
|
|
width: '100%',
|
|
height: '100%',
|
|
display: 'flex',
|
|
flexDirection: 'column',
|
|
overflow: 'hidden'
|
|
} },
|
|
_react2.default.createElement(
|
|
'div',
|
|
null,
|
|
_react2.default.createElement('input', { type: 'text', value: this.state.searchValue, onChange: function onChange(event) {
|
|
_this4.setState({ searchValue: event.target.value });
|
|
} }),
|
|
_react2.default.createElement('input', { type: 'button', value: 'search!', onClick: function onClick() {
|
|
var re = new RegExp(_this4.state.searchValue);
|
|
var i = _this4.state.aggrow.expander.findRow(function (row) {
|
|
return re.test(row.label);
|
|
}, _this4.state.cursor);
|
|
if (i >= 0) {
|
|
_this4._updateCursor(i);
|
|
_this4._keepCursorInViewport();
|
|
}
|
|
} })
|
|
),
|
|
_react2.default.createElement(_TableHeader2.default, {
|
|
aggrow: this.state.aggrow,
|
|
dropAction: this.dropAction,
|
|
selectedExpander: selectedExpander
|
|
}),
|
|
_react2.default.createElement(
|
|
'div',
|
|
{
|
|
onScroll: this.scroll,
|
|
ref: this._setScrollDiv,
|
|
style: {
|
|
width: '100%',
|
|
flexGrow: '1',
|
|
overflow: 'scroll'
|
|
} },
|
|
_react2.default.createElement(
|
|
'div',
|
|
{ style: { position: 'relative' } },
|
|
this.renderVirtualizedRows()
|
|
)
|
|
)
|
|
),
|
|
this.props.enableConfigurationPane ? _react2.default.createElement(_TableConfiguration2.default, {
|
|
aggrow: this.state.aggrow,
|
|
onUpdate: this._handleUpdate
|
|
}) : undefined
|
|
);
|
|
}
|
|
}]);
|
|
|
|
return AggrowTable;
|
|
}(_react2.default.Component);
|
|
|
|
AggrowTable.defaultProps = {
|
|
enableConfigurationPane: true
|
|
};
|
|
exports.default = AggrowTable;
|
|
|
|
/***/ },
|
|
/* 167 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
'use strict';
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
|
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
|
|
var _react = __webpack_require__(147);
|
|
|
|
var _react2 = _interopRequireDefault(_react);
|
|
|
|
var _Aggrow = __webpack_require__(160);
|
|
|
|
var _Aggrow2 = _interopRequireDefault(_Aggrow);
|
|
|
|
var _ExpanderConfiguration = __webpack_require__(168);
|
|
|
|
var _ExpanderConfiguration2 = _interopRequireDefault(_ExpanderConfiguration);
|
|
|
|
var _StackExpanderCreator = __webpack_require__(170);
|
|
|
|
var _StackExpanderCreator2 = _interopRequireDefault(_StackExpanderCreator);
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
|
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
|
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
|
|
var TableConfiguration = function (_React$Component) {
|
|
_inherits(TableConfiguration, _React$Component);
|
|
|
|
function TableConfiguration() {
|
|
var _ref;
|
|
|
|
var _temp, _this, _ret;
|
|
|
|
_classCallCheck(this, TableConfiguration);
|
|
|
|
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
|
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = TableConfiguration.__proto__ || Object.getPrototypeOf(TableConfiguration)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
|
|
expanded: false
|
|
}, _this._handleUpdate = function () {
|
|
_this.props.onUpdate();
|
|
}, _this._toggleExpanded = function () {
|
|
_this.setState({ expanded: !_this.state.expanded });
|
|
}, _temp), _possibleConstructorReturn(_this, _ret);
|
|
}
|
|
|
|
_createClass(TableConfiguration, [{
|
|
key: 'renderExpander',
|
|
value: function renderExpander(id) {
|
|
return _react2.default.createElement(_ExpanderConfiguration2.default, { expander: this.props.aggrow.expander, id: id });
|
|
}
|
|
}, {
|
|
key: 'render',
|
|
value: function render() {
|
|
var _this2 = this;
|
|
|
|
var expanderText = this.state.expanded ? '>>' : '<<';
|
|
var expander = this.props.aggrow.expander;
|
|
var config = [];
|
|
if (this.state.expanded) {
|
|
config = expander.getExpanders().map(function (ex) {
|
|
return _this2.renderExpander(ex);
|
|
});
|
|
}
|
|
return _react2.default.createElement(
|
|
'div',
|
|
{
|
|
style: {
|
|
width: this.state.expanded ? '512px' : '26px',
|
|
height: '100%',
|
|
display: 'flex',
|
|
flexDirection: 'column',
|
|
borderLeft: '2px solid black'
|
|
} },
|
|
_react2.default.createElement(
|
|
'div',
|
|
{ // eslint-disable-line jsx-a11y/no-static-element-interactions
|
|
onClick: this._toggleExpanded,
|
|
style: {
|
|
width: '100%',
|
|
height: '26px',
|
|
border: '1px solid darkGray'
|
|
} },
|
|
expanderText
|
|
),
|
|
_react2.default.createElement(
|
|
'div',
|
|
{
|
|
style: {
|
|
width: '100%',
|
|
height: '26px',
|
|
flexGrow: '1',
|
|
display: 'flex',
|
|
flexDirection: 'column'
|
|
} },
|
|
config
|
|
),
|
|
_react2.default.createElement(
|
|
'div',
|
|
{
|
|
style: {
|
|
width: '100%',
|
|
height: '256px',
|
|
display: 'flex',
|
|
flexDirection: 'column',
|
|
borderTop: '1px solid darkGray'
|
|
} },
|
|
_react2.default.createElement(_StackExpanderCreator2.default, { aggrow: this.props.aggrow, onCreate: this._handleUpdate })
|
|
)
|
|
);
|
|
}
|
|
}]);
|
|
|
|
return TableConfiguration;
|
|
}(_react2.default.Component);
|
|
|
|
exports.default = TableConfiguration;
|
|
|
|
/***/ },
|
|
/* 168 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
'use strict';
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = ExpanderConfiguration;
|
|
|
|
var _react = __webpack_require__(147);
|
|
|
|
var _react2 = _interopRequireDefault(_react);
|
|
|
|
var _AggrowExpander = __webpack_require__(165);
|
|
|
|
var _AggrowExpander2 = _interopRequireDefault(_AggrowExpander);
|
|
|
|
var _Draggable = __webpack_require__(169);
|
|
|
|
var _Draggable2 = _interopRequireDefault(_Draggable);
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
function ExpanderConfiguration(props) {
|
|
var expander = props.expander;
|
|
var id = props.id;
|
|
return _react2.default.createElement(
|
|
_Draggable2.default,
|
|
{ id: 'expander:add:' + id },
|
|
_react2.default.createElement(
|
|
'div',
|
|
{
|
|
style: {
|
|
width: 'auto',
|
|
height: '26px',
|
|
border: '1px solid darkGray',
|
|
margin: '2px'
|
|
} },
|
|
expander.getExpanderName(id)
|
|
)
|
|
);
|
|
}
|
|
|
|
/***/ },
|
|
/* 169 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
'use strict';
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
|
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
|
|
var _react = __webpack_require__(147);
|
|
|
|
var _react2 = _interopRequireDefault(_react);
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
|
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
|
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
|
|
var Draggable = function (_React$Component) {
|
|
_inherits(Draggable, _React$Component);
|
|
|
|
function Draggable() {
|
|
var _ref;
|
|
|
|
var _temp, _this, _ret;
|
|
|
|
_classCallCheck(this, Draggable);
|
|
|
|
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
|
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Draggable.__proto__ || Object.getPrototypeOf(Draggable)).call.apply(_ref, [this].concat(args))), _this), _this._handleDragStart = function (e) {
|
|
e.dataTransfer.setData('text', _this.props.id);
|
|
}, _temp), _possibleConstructorReturn(_this, _ret);
|
|
}
|
|
|
|
_createClass(Draggable, [{
|
|
key: 'render',
|
|
value: function render() {
|
|
return _react2.default.cloneElement(_react2.default.Children.only(this.props.children), {
|
|
draggable: 'true',
|
|
onDragStart: this._handleDragStart
|
|
});
|
|
}
|
|
}]);
|
|
|
|
return Draggable;
|
|
}(_react2.default.Component);
|
|
|
|
exports.default = Draggable;
|
|
|
|
/***/ },
|
|
/* 170 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
'use strict';
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
|
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
|
|
var _invariant = __webpack_require__(161);
|
|
|
|
var _invariant2 = _interopRequireDefault(_invariant);
|
|
|
|
var _react = __webpack_require__(147);
|
|
|
|
var _react2 = _interopRequireDefault(_react);
|
|
|
|
var _Aggrow = __webpack_require__(160);
|
|
|
|
var _Aggrow2 = _interopRequireDefault(_Aggrow);
|
|
|
|
var _AggrowData = __webpack_require__(162);
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
|
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
|
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
/* eslint-disable jsx-a11y/label-has-for */
|
|
|
|
var StackExpanderCreator = function (_React$Component) {
|
|
_inherits(StackExpanderCreator, _React$Component);
|
|
|
|
function StackExpanderCreator(props) {
|
|
_classCallCheck(this, StackExpanderCreator);
|
|
|
|
var _this = _possibleConstructorReturn(this, (StackExpanderCreator.__proto__ || Object.getPrototypeOf(StackExpanderCreator)).call(this, props));
|
|
|
|
_this._handleColumnSelected = function (e) {
|
|
(0, _invariant2.default)(e.target instanceof HTMLSelectElement, 'Expected select element');
|
|
_this.setState({ column: e.target.value });
|
|
};
|
|
|
|
_this._handlePatternSelected = function (e) {
|
|
(0, _invariant2.default)(e.target instanceof HTMLInputElement, 'Expected input element');
|
|
_this.setState({ pattern: e.target.value });
|
|
};
|
|
|
|
_this._handleReverseSelected = function (e) {
|
|
(0, _invariant2.default)(e.target instanceof HTMLInputElement, 'Expected input element');
|
|
_this.setState({ reverse: e.target.checked });
|
|
};
|
|
|
|
_this._handleFirstMatchSelected = function (e) {
|
|
(0, _invariant2.default)(e.target instanceof HTMLInputElement, 'Expected input element');
|
|
_this.setState({ firstMatch: e.target.checked });
|
|
};
|
|
|
|
_this._handleLeftSideSelected = function (e) {
|
|
(0, _invariant2.default)(e.target instanceof HTMLInputElement, 'Expected input element');
|
|
_this.setState({ leftSide: e.target.checked });
|
|
};
|
|
|
|
_this._handleCreateClicked = function () {
|
|
var focus = void 0;
|
|
var expanderName = _this.state.column;
|
|
if (_this.state.pattern !== '') {
|
|
focus = {
|
|
pattern: new RegExp(_this.state.pattern),
|
|
firstMatch: _this.state.firstMatch,
|
|
leftSide: _this.state.leftSide
|
|
};
|
|
expanderName += _this.state.reverse ? ' reversed' : '';
|
|
expanderName += _this.state.leftSide ? ' before' : ' after';
|
|
expanderName += _this.state.firstMatch ? ' first ' : ' last ';
|
|
expanderName += _this.state.pattern;
|
|
}
|
|
|
|
_this.props.onCreate(_this.props.aggrow.addStackExpander(expanderName, _this.state.column, _this.state.reverse, focus));
|
|
};
|
|
|
|
var data = _this.props.aggrow.data;
|
|
var firstColumn = data.columns.find(isStackColumn);
|
|
_this.state = {
|
|
column: firstColumn ? firstColumn.name : '',
|
|
pattern: '',
|
|
reverse: false,
|
|
leftSide: false,
|
|
firstMatch: true
|
|
};
|
|
return _this;
|
|
}
|
|
|
|
_createClass(StackExpanderCreator, [{
|
|
key: 'render',
|
|
value: function render() {
|
|
var data = this.props.aggrow.data;
|
|
var stackColumns = data.columns.filter(isStackColumn);
|
|
return _react2.default.createElement(
|
|
'div',
|
|
{
|
|
style: {
|
|
width: '100%',
|
|
height: '100%',
|
|
display: 'flex',
|
|
flexDirection: 'column'
|
|
} },
|
|
_react2.default.createElement(
|
|
'select',
|
|
{
|
|
key: 'columnselect',
|
|
onChange: this._handleColumnSelected,
|
|
value: this.state.column },
|
|
stackColumns.map(function (c) {
|
|
return _react2.default.createElement(
|
|
'option',
|
|
{ key: c.name, value: c.name },
|
|
c.name
|
|
);
|
|
})
|
|
),
|
|
_react2.default.createElement('input', {
|
|
key: 'pattern',
|
|
onChange: this._handlePatternSelected,
|
|
type: 'text',
|
|
value: this.state.pattern
|
|
}),
|
|
_react2.default.createElement(
|
|
'label',
|
|
{ key: 'reverse' },
|
|
_react2.default.createElement('input', {
|
|
checked: this.state.reverse,
|
|
onChange: this._handleReverseSelected,
|
|
type: 'checkbox'
|
|
}),
|
|
'Reverse'
|
|
),
|
|
_react2.default.createElement(
|
|
'label',
|
|
{ key: 'firstmatch' },
|
|
_react2.default.createElement('input', {
|
|
checked: this.state.firstMatch,
|
|
onChange: this._handleFirstMatchSelected,
|
|
type: 'checkbox'
|
|
}),
|
|
'First Match'
|
|
),
|
|
_react2.default.createElement(
|
|
'label',
|
|
{ key: 'leftside' },
|
|
_react2.default.createElement('input', {
|
|
checked: this.state.leftSide,
|
|
onChange: this._handleLeftSideSelected,
|
|
type: 'checkbox'
|
|
}),
|
|
'Left of Match'
|
|
),
|
|
_react2.default.createElement(
|
|
'button',
|
|
{
|
|
key: 'create',
|
|
onClick: this._handleCreateClicked },
|
|
'Create'
|
|
)
|
|
);
|
|
}
|
|
}]);
|
|
|
|
return StackExpanderCreator;
|
|
}(_react2.default.Component);
|
|
|
|
exports.default = StackExpanderCreator;
|
|
|
|
|
|
function isStackColumn(c) {
|
|
return c instanceof _AggrowData.AggrowStackColumn;
|
|
}
|
|
|
|
/***/ },
|
|
/* 171 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
'use strict';
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = TableHeader;
|
|
|
|
var _react = __webpack_require__(147);
|
|
|
|
var _react2 = _interopRequireDefault(_react);
|
|
|
|
var _Aggrow = __webpack_require__(160);
|
|
|
|
var _Aggrow2 = _interopRequireDefault(_Aggrow);
|
|
|
|
var _Draggable = __webpack_require__(169);
|
|
|
|
var _Draggable2 = _interopRequireDefault(_Draggable);
|
|
|
|
var _DropTarget = __webpack_require__(172);
|
|
|
|
var _DropTarget2 = _interopRequireDefault(_DropTarget);
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
function TableHeader(props) {
|
|
var expander = props.aggrow.expander;
|
|
var aggregators = expander.getActiveAggregators();
|
|
var expanders = expander.getActiveExpanders();
|
|
var headers = [];
|
|
for (var i = 0; i < aggregators.length; i++) {
|
|
var name = expander.getAggregatorName(aggregators[i]);
|
|
headers.push(_react2.default.createElement(
|
|
_DropTarget2.default,
|
|
{
|
|
dropAction: props.dropAction,
|
|
id: 'aggregate:insert:' + i,
|
|
key: 'aggregate:insert:' + i },
|
|
_react2.default.createElement('div', {
|
|
style: {
|
|
width: '16px',
|
|
height: 'inherit',
|
|
backgroundColor: '#8b9dc3',
|
|
flexShrink: '0'
|
|
}
|
|
})
|
|
));
|
|
headers.push(_react2.default.createElement(
|
|
_Draggable2.default,
|
|
{
|
|
id: 'aggregate:active:' + i,
|
|
key: 'aggregate:active:' + i },
|
|
_react2.default.createElement(
|
|
'div',
|
|
{ style: { width: '128px', textAlign: 'center', flexShrink: '0' } },
|
|
name
|
|
)
|
|
));
|
|
}
|
|
headers.push(_react2.default.createElement(
|
|
_DropTarget2.default,
|
|
{
|
|
dropAction: props.dropAction,
|
|
id: 'divider:insert',
|
|
key: 'divider:insert' },
|
|
_react2.default.createElement('div', {
|
|
style: {
|
|
width: '16px',
|
|
height: 'inherit',
|
|
backgroundColor: '#3b5998',
|
|
flexShrink: '0'
|
|
}
|
|
})
|
|
));
|
|
for (var _i = 0; _i < expanders.length; _i++) {
|
|
var _name = expander.getExpanderName(expanders[_i]);
|
|
headers.push(_react2.default.createElement(
|
|
_Draggable2.default,
|
|
{
|
|
id: 'expander:active:' + _i,
|
|
key: 'expander:active:' + _i },
|
|
_react2.default.createElement(
|
|
'div',
|
|
{
|
|
style: {
|
|
textAlign: 'center',
|
|
flexShrink: '0',
|
|
padding: '4px',
|
|
backgroundColor: _i === props.selectedExpander ? '#dfe3ee' : 'white'
|
|
} },
|
|
_name
|
|
)
|
|
));
|
|
var sep = _i + 1 < expanders.length ? '->' : '...';
|
|
headers.push(_react2.default.createElement(
|
|
_DropTarget2.default,
|
|
{
|
|
dropAction: props.dropAction,
|
|
id: 'expander:insert:' + (_i + 1),
|
|
key: 'expander:insert:' + (_i + 1) },
|
|
_react2.default.createElement(
|
|
'div',
|
|
{
|
|
style: {
|
|
height: 'inherit',
|
|
backgroundColor: '#8b9dc3',
|
|
flexShrink: '0'
|
|
} },
|
|
sep
|
|
)
|
|
));
|
|
}
|
|
return _react2.default.createElement(
|
|
'div',
|
|
{
|
|
style: {
|
|
width: '100%',
|
|
height: '26px',
|
|
display: 'flex',
|
|
flexDirection: 'row',
|
|
alignItems: 'center',
|
|
borderBottom: '2px solid black'
|
|
} },
|
|
headers
|
|
);
|
|
}
|
|
|
|
/***/ },
|
|
/* 172 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
'use strict';
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
|
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
|
|
var _react = __webpack_require__(147);
|
|
|
|
var _react2 = _interopRequireDefault(_react);
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
|
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
|
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
|
|
var DropTarget = function (_React$Component) {
|
|
_inherits(DropTarget, _React$Component);
|
|
|
|
function DropTarget() {
|
|
var _ref;
|
|
|
|
var _temp, _this, _ret;
|
|
|
|
_classCallCheck(this, DropTarget);
|
|
|
|
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
|
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = DropTarget.__proto__ || Object.getPrototypeOf(DropTarget)).call.apply(_ref, [this].concat(args))), _this), _this._handleDragOver = function (e) {
|
|
e.preventDefault();
|
|
}, _this._handleDrop = function (e) {
|
|
var sourceId = e.dataTransfer.getData('text');
|
|
e.preventDefault();
|
|
_this.props.dropAction(sourceId, _this.props.id);
|
|
}, _temp), _possibleConstructorReturn(_this, _ret);
|
|
}
|
|
|
|
_createClass(DropTarget, [{
|
|
key: 'render',
|
|
value: function render() {
|
|
return _react2.default.cloneElement(_react2.default.Children.only(this.props.children), {
|
|
onDragOver: this._handleDragOver,
|
|
onDrop: this._handleDrop
|
|
});
|
|
}
|
|
}]);
|
|
|
|
return DropTarget;
|
|
}(_react2.default.Component);
|
|
|
|
exports.default = DropTarget;
|
|
|
|
/***/ }
|
|
/******/ ]);
|
|
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vd2VicGFjay9ib290c3RyYXAgZWZjY2NhMzMyYmMwYWVhZWQ2ZDkiLCJ3ZWJwYWNrOi8vLy4vc3JjL2hlYXBDYXB0dXJlLmpzIiwid2VicGFjazovLy8uL34vcmVhY3QtZG9tL2luZGV4LmpzIiwid2VicGFjazovLy8uL34vcmVhY3QvbGliL1JlYWN0RE9NLmpzIiwid2VicGFjazovLy8uL34vcHJvY2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gKiArLS0tLS0tLS0tLS0tKyAgICAuXG4gKiAgICAgICB8ICAgICAgICAgICAuXG4gKiAgICAgICB2ICAgICAgICAgICAuXG4gKiArLS0tLS0tLS0tLS0tKyAgICAuXG4gKiB8IFJlYWN0RXZlbnQgfCAgICAuXG4gKiB8ICBMaXN0ZW5lciAgfCAgICAuXG4gKiArLS0tLS0tLS0tLS0tKyAgICAuICAgICAgICAgICAgICAgICAgICAgICAgICstLS0tLS0tLS0tLStcbiAqICAgICAgIHwgICAgICAgICAgIC4gICAgICAgICAgICAgICArLS0tLS0tLS0rfFNpbXBsZUV2ZW50fFxuICogICAgICAgfCAgICAgICAgICAgLiAgICAgICAgICAgICAgIHwgICAgICAgICB8UGx1Z2luICAgICB8XG4gKiArLS0tLS18LS0tLS0tKyAgICAuICAgICAgICAgICAgICAgdiAgICAgICAgICstLS0tLS0tLS0tLStcbiAqIHwgICAgIHwgICAgICB8ICAgIC4gICAgKy0tLS0tLS0tLS0tLS0tKyAgICAgICAgICAgICAgICAgICAgKy0tLS0tLS0tLS0tLStcbiAqIHwgICAgICstLS0tLS0tLS0tLS4tLS0+fEV2ZW50UGx1Z2luSHVifCAgICAgICAgICAgICAgICAgICAgfCAgICBFdmVudCAgIHxcbiAqIHwgICAgICAgICAgICB8ICAgIC4gICAgfCAgICAgICAgICAgICAgfCAgICAgKy0tLS0tLS0tLS0tKyAgfCBQcm9wYWdhdG9yc3xcbiAqIHwgUmVhY3RFdmVudCB8ICAgIC4gICAgfCAgICAgICAgICAgICAgfCAgICAgfFRhcEV2ZW50ICAgfCAgfC0tLS0tLS0tLS0tLXxcbiAqIHwgIEVtaXR0ZXIgICB8ICAgIC4gICAgfCAgICAgICAgICAgICAgfDwtLS0rfFBsdWdpbiAgICAgfCAgfG90aGVyIHBsdWdpbnxcbiAqIHwgICAgICAgICAgICB8ICAgIC4gICAgfCAgICAgICAgICAgICAgfCAgICAgKy0tLS0tLS0tLS0tKyAgfCAgdXRpbGl0aWVzIHxcbiAqIHwgICAgICstLS0tLS0tLS0tLS4tLS0+fCAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgKy0tLS0tLS0tLS0tLStcbiAqIHwgICAgIHwgICAgICB8ICAgIC4gICAgKy0tLS0tLS0tLS0tLS0tK1xuICogKy0tLS0tfC0tLS0tLSsgICAgLiAgICAgICAgICAgICAgICBeICAgICAgICArLS0tLS0tLS0tLS0rXG4gKiAgICAgICB8ICAgICAgICAgICAuICAgICAgICAgICAgICAgIHwgICAgICAgIHxFbnRlci9MZWF2ZXxcbiAqICAgICAgICsgICAgICAgICAgIC4gICAgICAgICAgICAgICAgKy0tLS0tLS0rfFBsdWdpbiAgICAgfFxuICogKy0tLS0tLS0tLS0tLS0rICAgLiAgICAgICAgICAgICAgICAgICAgICAgICArLS0tLS0tLS0tLS0rXG4gKiB8IGFwcGxpY2F0aW9uIHwgICAuXG4gKiB8LS0tLS0tLS0tLS0tLXwgICAuXG4gKiB8ICAgICAgICAgICAgIHwgICAuXG4gKiB8ICAgICAgICAgICAgIHwgICAuXG4gKiArLS0tLS0tLS0tLS0tLSsgICAuXG4gKiAgICAgICAgICAgICAgICAgICAuXG4gKiAgICBSZWFjdCBDb3JlICAgICAuICBHZW5lcmFsIFB1cnBvc2UgRXZlbnQgUGx1Z2luIFN5c3RlbVxuICovXG5cbnZhciBhbHJlYWR5TGlzdGVuaW5nVG8gPSB7fTtcbnZhciBpc01vbml0b3JpbmdTY3JvbGxWYWx1ZSA9IGZhbHNlO1xudmFyIHJlYWN0VG9wTGlzdGVuZXJzQ291bnRlciA9IDA7XG5cbi8vIEZvciBldmVudHMgbGlrZSAnc3VibWl0JyB3aGljaCBkb24ndCBjb25zaXN0ZW50bHkgYnViYmxlICh3aGljaCB3ZSB0cmFwIGF0IGFcbi8vIGxvd2VyIG5vZGUgdGhhbiBgZG9jdW1lbnRgKSwgYmluZGluZyBhdCBgZG9jdW1lbnRgIHdvdWxkIGNhdXNlIGR1cGxpY2F0ZVxuLy8gZXZ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CBkaWZmZXJlbnQgbWV0aG9kcy4gV3JhcHBlcnMgYXJlIGV4dHJlbWVseSBzaW1wbGUgLVxuICogdGhleSBvbmx5IHJlcXVpcmUgaW1wbGVtZW50aW5nIHR3byBtZXRob2RzLlxuICpcbiAqIDxwcmU+XG4gKiAgICAgICAgICAgICAgICAgICAgICAgd3JhcHBlcnMgKGluamVjdGVkIGF0IGNyZWF0aW9uIHRpbWUpXG4gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAgICAgICAgK1xuICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgIHxcbiAqICAgICAgICAgICAgICAgICAgICArLS0tLS0tLS0tLS0tLS0tLS18LS0tLS0tLS18LS0tLS0tLS0tLS0tLS0rXG4gKiAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgdiAgICAgICAgfCAgICAgICAgICAgICAgfFxuICogICAgICAgICAgICAgICAgICAgIHwgICAgICArLS0tLS0tLS0tLS0tLS0tKyAgIHwgICAgICAgICAgICAgIHxcbiAqICAgICAgICAgICAgICAgICAgICB8ICAgKy0tfCAgICB3cmFwcGVyMSAgIHwtLS18LS0tLSsgICAgICAgICB8XG4gKiAgICAgICAgICAgICAgICAgICAgfCAgIHwgICstLS0tLS0tLS0tLS0tLS0rICAgdiAgICB8ICAgICAgICAgfFxuICogICAgICAgICAgICAgICAgICAgIHwgICB8ICAgICAgICAgICstLS0tLS0tLS0tLS0tKyAgfCAgICAgICAgIHxcbiAqICAgICAgICAgICAgICAgICAgICB8ICAgfCAgICAgKy0tLS18ICAgd3JhcHBlcjIgIHwtLS0tLS0tLSsgICB8XG4gKiAgICAgICAgICAgICAgICAgICAgfCAgIHwgICAgIHwgICAgKy0tLS0tLS0tLS0tLS0rICB8ICAgICB8ICAgfFxuICogICAgICAgICAgICAgICAgICAgIHwgICB8ICAgICB8ICAgICAgICAgICAgICAgICAgICAgfCAgICAgfCAgIHxcbiAqICAgICAgICAgICAgICAgICAgICB8ICAgdiAgICAgdiAgICAgICAgICAgICAgICAgICAgIHYgICAgIHYgICB8IHdyYXBwZXJcbiAqICAgICAgICAgICAgICAgICAgICB8ICstLS0rICstLS0rICAgKy0tLS0tLS0tLSsgICArLS0tKyArLS0tKyB8IGludmFyaWFudHNcbiAqIHBlcmZvcm0oYW55TWV0aG9kKSB8IHwgICB8IHwgICB8ICAgfCAgICAgICAgIHwgICB8ICAgfCB8ICAgfCB8IG1haW50YWluZWRcbiAqICstLS0tLS0tLS0tLS0tLS0tLT58LXwtLS18LXwtLS18LS0+fGFueU1ldGhvZHwtLS18LS0tfC18LS0tfC18LS0tLS0tLS0+XG4gKiAgICAgICAgICAgICAgICAgICAgfCB8ICAgfCB8ICAgfCAgIHwgICAgICAgICB8ICAgfCAgIHwgfCAgIHwgfFxuICogICAgICAgICAgICAgICAgICAgIHwgfCAgIHwgfCAgIHwgICB8ICAgICAgICAgfCAgIHwgICB8IHwgICB8IHxcbiAqICAgICAgICAgICAgICAgICAgICB8IHwgICB8IHwgICB8ICAgfCAgICAgICAgIHwgICB8ICAgfCB8ICAgfCB8XG4gKiAgICAgICAgICAgICAgICAgICAgfCArLS0tKyArLS0tKyAgICstLS0tLS0tLS0rICAgKy0tLSsgKy0tLSsgfFxuICogICAgICAgICAgICAgICAgICAgIHwgIGluaXRpYWxpemUgICAgICAgICAgICAgICAgICAgIGNsb3NlICAgIHxcbiAqICAgICAgICAgICAgICAgICAgICArLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rXG4gKiA8L3ByZT5cbiAqXG4gKiBVc2UgY2FzZXM6XG4gKiAtIFByZXNlcnZpbmcgdGhlIGlucHV0IHNlbGVjdGlvbiByYW5nZXMgYmVmb3JlL2FmdGVyIHJlY29uY2lsaWF0aW9uLlxuICogICBSZXN0b3Jpbmcgc2VsZWN0aW9uIGV2ZW4gaW4gdGhlIGV2ZW50IG9mIGFuIHVuZXhwZWN0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Lm1vdW50Q29tcG9uZW50KGNoaWxkLCByb290SUQsIHRyYW5zYWN0aW9uLCBjb250ZXh0KTtcbiAgICAgICAgICBjaGlsZC5fbW91bnRJbmRleCA9IGluZGV4Kys7XG4gICAgICAgICAgbW91bnRJbWFnZXMucHVzaChtb3VudEltYWdlKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgcmV0dXJuIG1vdW50SW1hZ2VzO1xuICAgIH0sXG5cbiAgICAvKipcbiAgICAgKiBSZXBsYWNlcyBhbnkgcmVuZGVyZWQgY2hpbGRyZW4gd2l0aCBhIHRleHQgY29udGVudCBzdHJpbmcuXG4gICAgICpcbiAgICAgKiBAcGFyYW0ge3N0cmluZ30gbmV4dENvbnRlbnQgU3RyaW5nIG9mIGNvbnRlbnQuXG4gICAgICogQGludGVybmFsXG4gICAgICovXG4gICAgdXBkYXRlVGV4dENvbnRlbnQ6IGZ1bmN0aW9uIChuZXh0Q29udGVudCkge1xuICAgICAgdXBkYXRlRGVwdGgrKztcbiAgICAgIHZhciBlcnJvclRocm93biA9IHRydWU7XG4gICAgICB0cnkge1xuICAgICAgICB2YXIgcHJldkNoaWxkcmVuID0gdGhpcy5fcmVuZGVyZWRDaGlsZHJlbjtcbiAgICAgICAgLy8gUmVtb3ZlIGFueSByZW5kZXJlZCBjaGlsZHJlbi5cbiAgICAgICAgUmVhY3RDaGlsZFJlY29uY2lsZXIudW5tb3VudENoaWxkcmVuKHByZXZDaGlsZHJlbik7XG4gICAgICAgIC8vIFRPRE86IFRoZSBzZXRUZXh0Q29udGVudCBvcGVyYXRpb24gc2hvdWxkIGJlIGVub3VnaFxuICAgICAgICBmb3IgKHZhciBuYW1lIGluIHByZXZDaGlsZHJlbikge1xuICAgICAgICAgIGlmIChwcmV2Q2hpbGRyZW4uaGFzT3duUHJvcGVydHkobmFtZSkpIHtcbiAgICAgICAgICAgIHRoaXMuX3VubW91bnRDaGlsZChwcmV2Q2hpbGRyZW5bbmFtZV0pO1xuICAgICAgICAgIH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29yZFdyaXRlKG1vdW50SUQsIGZuTmFtZSwgdG90YWxUaW1lLCBhcmdzWzBdKTtcbiAgICAgICAgfSBlbHNlIGlmIChmbk5hbWUgPT09ICdkYW5nZXJvdXNseVByb2Nlc3NDaGlsZHJlblVwZGF0ZXMnKSB7XG4gICAgICAgICAgLy8gc3BlY2lhbCBmb3JtYXRcbiAgICAgICAgICBhcmdzWzBdLmZvckVhY2goZnVuY3Rpb24gKHVwZGF0ZSkge1xuICAgICAgICAgICAgdmFyIHdyaXRlQXJncyA9IHt9O1xuICAgICAgICAgICAgaWYgKHVwZGF0ZS5mcm9tSW5kZXggIT09IG51bGwpIHtcbiAgICAgICAgICAgICAgd3JpdGVBcmdzLmZyb21JbmRleCA9IHVwZGF0ZS5mcm9tSW5kZXg7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodXBkYXRlLnRvSW5kZXggIT09IG51bGwpIHtcbiAgICAgICAgICAgICAgd3JpdGVBcmdzLnRvSW5kZXggPSB1cGRhdGUudG9JbmRleDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICh1cGRhdGUudGV4dENvbnRlbnQgIT09IG51bGwpIHtcbiAgICAgICAgICAgICAgd3JpdGVBcmdzLnRleHRDb250ZW50ID0gdXBkYXRlLnRleHRDb250ZW50O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHVwZGF0ZS5tYXJrdXBJbmRleCAhPT0gbnVsbCkge1xuICAgICAgICAgICAgICB3cml0ZUFyZ3MubWFya3VwID0gYXJnc1sxXVt1cGRhdGUubWFya3VwSW5kZXhdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgUmVhY3REZWZhdWx0UGVyZi5fcmVjb3JkV3JpdGUodXBkYXRlLnBhcmVudElELCB1cGRhdGUudHlwZSwgdG90YWxUaW1lLCB3cml0ZUFyZ3MpO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIC8vIGJhc2ljIGZvcm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cbiAgICAgICAgfVxuICAgICAgICBlLnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSAzNzogLy8gbGVmdFxuICAgICAgICBpZiAoZXhwYW5kZXIuY2FuQ29udHJhY3Qocm93KSkge1xuICAgICAgICAgIHRoaXMuX2NvbnRyYWN0Um93KHJvdyk7XG4gICAgICAgIH0gZWxzZSBpZiAoZXhwYW5kZXIuZ2V0Um93SW5kZW50KHJvdykgPiAwKSB7XG4gICAgICAgICAgY29uc3QgaW5kZW50ID0gZXhwYW5kZXIuZ2V0Um93SW5kZW50KHJvdykgLSAxO1xuICAgICAgICAgIHdoaWxlIChleHBhbmRlci5nZXRSb3dJbmRlbnQocm93KSA+IGluZGVudCkge1xuICAgICAgICAgICAgY3Vyc29yIC09IDE7XG4gICAgICAgICAgICByb3cgPSBleHBhbmRlci5nZXRSb3dzKGN1cnNvciwgMSlbMF07XG4gICAgICAgICAgfVxuICAgICAgICAgIHRoaXMuX3VwZGF0ZUN1cnNvcihjdXJzb3IpO1xuICAgICAgICAgIHRoaXMuX2tlZXBDdXJzb3JJblZpZXdwb3J0KCk7XG4gICAgICAgIH1cbiAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICBicmVhaztcbiAgICAgIGNhc2UgMzk6IC8vIHJpZ2h0XG4gICAgICAgIGlmIChleHBhbmRlci5jYW5FeHBhbmQocm93KSkge1xuICAgICAgICAgIHRoaXMuX2V4cGFuZFJvdyhyb3cpO1xuICAgICAgICB9IGVsc2UgaWYgKGN1cnNvciA8IGV4cGFuZGVyLmdldEhlaWdodCgpIC0gMSkge1xuICAgICAgICAgIHRoaXMuX3VwZGF0ZUN1cnNvcihjdXJzb3IgKyAxKTtcbiAgICAgICAgICB0aGlzLl9rZWVwQ3Vyc29ySW5WaWV3cG9ydCgpO1xuICAgICAgICB9XG4gICAgICAgIGUucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgYnJlYWs7XG4gICA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IGFnZ3JlZ2F0ZSA9IGV4cGFuZGVyLmdldFJvd0FnZ3JlZ2F0ZShyb3csIGkpO1xuICAgICAgY29sdW1ucy5wdXNoKChcbiAgICAgICAgPGRpdlxuICAgICAgICAgIGtleT17YGFnJHtpfWB9XG4gICAgICAgICAgc3R5bGU9e3tcbiAgICAgICAgICAgIHdpZHRoOiAnMTZweCcsXG4gICAgICAgICAgICBoZWlnaHQ6ICdpbmhlcml0JyxcbiAgICAgICAgICAgIGJhY2tncm91bmRDb2xvcjogJyM4YjlkYzMnLFxuICAgICAgICAgICAgZmxleFNocmluazogJzAnLFxuICAgICAgICAgIH19XG4gICAgICAgIC8+XG4gICAgICApKTtcbiAgICAgIGNvbHVtbnMucHVzaCgoXG4gICAgICAgIDxkaXZcbiAgICAgICAgICBrZXk9e2BhZ3NlcCR7aX1gfVxuICAgICAgICAgIHN0eWxlPXt7XG4gICAgICAgICAgICB3aWR0aDogJzEyOHB4JyxcbiAgICAgICAgICAgIHRleHRBbGlnbjogJ3JpZ2h0JyxcbiAgICAgICAgICAgIGJhY2tncm91bmRDb2xvcjogYmcsXG4gICAgICAgICAgICBmbGV4U2hyaW5rOiAnMCcsXG4gICAgICAgICAgfX0+XG4gICAgICAgICAge2FnZ3JlZ2F0ZX1cbiAgICAgICAgPC9kaXY+XG4gICAgICApKTtcbiAgICB9XG4gICAgY29sdW1ucy5wdXNoKChcbiAgICAgIDxkaXZcbiAgICAgICAga2V5PVwic2VwXCJcbiAgICAgICAgc3R5bGU9e3tcbiAgICAgICAgICB3aWR0aDogJzE2cHgnLFxuICAgICAgICAgIGhlaWdodDogJ2luaGVyaXQnLFxuICAgICAgICAgIGJhY2tncm91bmRDb2xvcjogJyMzYjU5OTgnLFxuICAgICAgICAgIGZsZXhTaHJpbms6ICcwJyxcbiAgICAgICAgfX1cbiAgICAgIC8+XG4gICAgKSk7XG4gICAgaWYgKGV4cGFuZGVyLmNhbkV4cGFuZChyb3cpKSB7XG4gICAgICBjb2x1bW5zLnB1c2goKFxuICAgICAgICA8ZGl2ICAvLyBlc2xpbnQtZGlzYWJsZS1saW5lIGpzeC1hMTF5L25vLXN0YXRpYy1lbGVtZW50LWludGVyYWN0aW9uc1xuICAgICAgICAgIGtleT1cImluZGVudFwiXG4gICAgICAgICAgLy8gVE9ETzogRml4IHRoaXMgdG8gbm90IG5lZWQgYW4gYXJyb3cgZnVuY3Rpb25cbiAgICAgICAgICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgcmVhY3QvanN4LW5vLWJpbmRcbiAgICAgICAgICBvbkNsaWNrPXsoKTogdm9pZCA9PiB0aGlzLl9leHBhbmRSb3cocm93KX1cbiAgICAgICAgICBzdHlsZT17e1xuICAgICAgICAgICAgbWFyZ2luTGVmdDogYCR7aW5kZW50fXB4YCxcbiAgICAgICAgICAgIGZsZXhTaHJpbms6ICcwJyxcbiAgICAgICAgICAgIHdpZHRoOiAnMTJweCcsXG4gICAgICAgICAgICB0ZXh0QWxpZ246ICdjZW50ZXInLFxuICAgICAgICAgICAgYm9yZGVyOiAnMXB4IHNvbGlkIGdyYXknLFxuICAgICAgICAgIH19PlxuICAgICAgICAgICtcbiAgICAgICAgPC9kaXY+XG4gICAgICApKTtcbiAgICB9IGVsc2UgaWYgKGV4cGFuZGVyLmNhbkNvbnRyYWN0KHJvdykpIHtcbiAgICAgIGNvbHVtbnMucHVzaCgoXG4gICAgICAgIDxkaXYgIC8vIGVzbGludC1kaXNhYmxlLWxpbmUganN4LWExMXkvbm8tc3RhdGljLWVsZW1lbnQtaW50ZXJhY3Rpb25zXG4gICAgICAgICAga2V5PVwiaW5kZW50XCJcbiAgICAgICAgICAvLyBUT0RPOiBGaXggdGhpcyB0byBub3QgbmVlZCBhbiBhcnJvdyBmdW5jdGlvblxuICAgICAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSByZWFjdC9qc3gtbm8tYmluZFxuICAgICAgICAgIG9uQ2xpY2s9eygpOiB2b2lkID0+IHRoaXMuX2NvbnRyYWN0Um93KHJvdyl9XG4gICAgICAgICAgc3R5bGU9e3tcbiAgICAgICAgICAgIG1hcmdpbkxlZnQ6IGAke2luZGVudH1weGAsXG4gICAgICAgICAgICBmbGV4U2hyaW5rOiAnMCcsXG4gICAgICAgICAgICB3aWR0aDogJzEycHgnLFxuICAgICAgICAgICAgdGV4dEFsaWduOiAnY2VudGVyJyxcbiAgICAgICAgICAgIGJvcmRlcjogJzFweCBzb2xpZCBncmF5JyxcbiAgICAgICAgICB9fT5cbiAgICAgICAgICAtXG4gICAgICAgIDwvZGl2PlxuICAgICAgKSk7XG4gICAgfSBlbHNlIHtcbiAgICAgIGNvbHVtbnMucHVzaCgoXG4gICAgICAgIDxkaXZcbiAgICAgICAgICBrZXk9XCJpbmRlbnRcIlxuICAgICAgICAgIHN0eWxlPXt7XG4gICAgICAgICAgICBtYXJnaW5MZWZ0OiBgJHtpbmRlbnR9cHhgLFxuICAgICAgICAgIH19XG4gICAgICAgIC8+XG4gICAgICApKTtcbiAgICB9XG4gICAgcm93VGV4dCArPSBleHBhbmRlci5nZXRSb3dMYWJlbChyb3cpO1xuICAgIGNvbHVtbnMucHVzaCgoXG4gICAgICA8ZGl2XG4gICAgICAgIGtleT1cImRhdGFcIlxuICAgICAgICBzdHlsZT17e1xuICAgICAgICAgIGZsZXhTaHJpbms6ICcwJyxcbiAgICAgICAgICB3aGl0ZVNwYWNlOiAnbm93cmFwJyxcbiAgICAgICAgICBtYXJnaW5SaWdodDogJzIwcHgnLFxuICAgICAgICB9fT5cbiAgICAgICAge3Jvd1RleHR9XG4gICAgICA8L2Rpdj5cbiAgICApKTtcbiAgICByZXR1cm4gKFxuICAgICAgPGRpdiAgLy8gZXNsaW50LWRpc2FibGUtbGluZSBqc3gtYTExeS9uby1zdGF0aWMtZWxlbWVudC1pbnRlcmFjdGlvbnNcbiAgICAgICAga2V5PXtyb3cudG9wfVxuICAgICAgICAvLyBUT0RPOiBGaXggdGhpcyB0byBub3QgbmVlZCB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ICAgICAgIDxUYWJsZUhlYWRlclxuICAgICAgICAgICAgYWdncm93PXt0aGlzLnN0YXRlLmFnZ3Jvd31cbiAgICAgICAgICAgIGRyb3BBY3Rpb249e3RoaXMuZHJvcEFjdGlvbn1cbiAgICAgICAgICAgIHNlbGVjdGVkRXhwYW5kZXI9e3NlbGVjdGVkRXhwYW5kZXJ9XG4gICAgICAgICAgLz5cbiAgICAgICAgICA8ZGl2XG4gICAgICAgICAgICBvblNjcm9sbD17dGhpcy5zY3JvbGx9XG4gICAgICAgICAgICByZWY9e3RoaXMuX3NldFNjcm9sbERpdn1cbiAgICAgICAgICAgIHN0eWxlPXt7XG4gICAgICAgICAgICAgIHdpZHRoOiAnMTAwJScsXG4gICAgICAgICAgICAgIGZsZXhHcm93OiAnMScsXG4gICAgICAgICAgICAgIG92ZXJmbG93OiAnc2Nyb2xsJyxcbiAgICAgICAgICAgIH19PlxuICAgICAgICAgICAgPGRpdiBzdHlsZT17eyBwb3NpdGlvbjogJ3JlbGF0aXZlJyB9fT5cbiAgICAgICAgICAgICAgeyB0aGlzLnJlbmRlclZpcnR1YWxpemVkUm93cygpIH1cbiAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgIDwvZGl2PlxuICAgICAgICA8L2Rpdj5cbiAgICAgICAge1xuICAgICAgICAgIHRoaXMucHJvcHMuZW5hYmxlQ29uZmlndXJhdGlvblBhbmUgP1xuICAgICAgICAgICAgPFRhYmxlQ29uZmlndXJhdGlvblxuICAgICAgICAgICAgICBhZ2dyb3c9e3RoaXMuc3RhdGUuYWdncm93fVxuICAgICAgICAgICAgICBvblVwZGF0ZT17dGhpcy5faGFuZGxlVXBkYXRlfVxuICAgICAgICAgICAgLz4gOlxuICAgICAgICAgICAgdW5kZWZpbmVkXG4gICAgICAgIH1cbiAgICAgIDwvZGl2PlxuICAgICk7XG4gIH1cbn1cblxuXG5cbi8vIFdFQlBBQ0sgRk9PVEVSIC8vXG4vLyAuL3NyYy9BZ2dyb3dUYWJsZS5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2NlbnRlcicsXG4gICAgICAgICAgICBmbGV4U2hyaW5rOiAnMCcsXG4gICAgICAgICAgICBwYWRkaW5nOiAnNHB4JyxcbiAgICAgICAgICAgIGJhY2tncm91bmRDb2xvcjogaSA9PT0gcHJvcHMuc2VsZWN0ZWRFeHBhbmRlciA/ICcjZGZlM2VlJyA6ICd3aGl0ZScsXG4gICAgICAgICAgfX0+XG4gICAgICAgICAge25hbWV9XG4gICAgICAgIDwvZGl2PlxuICAgICAgPC9EcmFnZ2FibGU+KSk7XG4gICAgY29uc3Qgc2VwID0gaSArIDEgPCBleHBhbmRlcnMubGVuZ3RoID8gJy0+JyA6ICcuLi4nO1xuICAgIGhlYWRlcnMucHVzaCgoXG4gICAgICA8RHJvcFRhcmdldFxuICAgICAgICBkcm9wQWN0aW9uPXtwcm9wcy5kcm9wQWN0aW9ufVxuICAgICAgICBpZD17YGV4cGFuZGVyOmluc2VydDoke2kgKyAxfWB9XG4gICAgICAgIGtleT17YGV4cGFuZGVyOmluc2VydDoke2kgKyAxfWB9PlxuICAgICAgICA8ZGl2XG4gICAgICAgICAgc3R5bGU9e3tcbiAgICAgICAgICAgIGhlaWdodDogJ2luaGVyaXQnLFxuICAgICAgICAgICAgYmFja2dyb3VuZENvbG9yOiAnIzhiOWRjMycsXG4gICAgICAgICAgICBmbGV4U2hyaW5rOiAnMCcsXG4gICAgICAgICAgfX0+XG4gICAgICAgICAge3NlcH1cbiAgICAgICAgPC9kaXY+XG4gICAgICA8L0Ryb3BUYXJnZXQ+KVxuICAgICk7XG4gIH1cbiAgcmV0dXJuIChcbiAgICA8ZGl2XG4gICAgICBzdHlsZT17e1xuICAgICAgICB3aWR0aDogJzEwMCUnLFxuICAgICAgICBoZWlnaHQ6ICcyNnB4JyxcbiAgICAgICAgZGlzcGxheTogJ2ZsZXgnLFxuICAgICAgICBmbGV4RGlyZWN0aW9uOiAncm93JyxcbiAgICAgICAgYWxpZ25JdGVtczogJ2NlbnRlcicsXG4gICAgICAgIGJvcm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