diff --git a/examples/dist/index.js b/examples/dist/index.js
index bde6b030..5ac7c39c 100644
--- a/examples/dist/index.js
+++ b/examples/dist/index.js
@@ -70,11 +70,26 @@ return /******/ (function(modules) { // webpackBootstrap
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
-/******/ return __webpack_require__(__webpack_require__.s = 111);
+/******/ return __webpack_require__(__webpack_require__.s = 41);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/* WEBPACK VAR INJECTION */(function(process) {
+
+if (process.env.NODE_ENV === 'production') {
+ module.exports = __webpack_require__(42);
+} else {
+ module.exports = __webpack_require__(43);
+}
+
+/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
+
+/***/ }),
+/* 1 */
/***/ (function(module, exports) {
// shim for using process in browser
@@ -264,17 +279,72 @@ process.umask = function() { return 0; };
/***/ }),
-/* 1 */
+/* 2 */
+/***/ (function(module, exports, __webpack_require__) {
+
+var freeGlobal = __webpack_require__(31);
+
+/** Detect free variable `self`. */
+var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
+
+/** Used as a reference to the global object. */
+var root = freeGlobal || freeSelf || Function('return this')();
+
+module.exports = root;
+
+
+/***/ }),
+/* 3 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+/**
+ * Copyright (c) 2013-present, Facebook, Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ *
+ */
+
+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.
+ */
+var emptyFunction = 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;
+
+/***/ }),
+/* 4 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright (c) 2013-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.
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
*
*/
@@ -323,22211 +393,20355 @@ function invariant(condition, format, a, b, c, d, e, f) {
}
module.exports = invariant;
-/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
+/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
/***/ }),
-/* 2 */
+/* 5 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-/* 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.
- *
- */
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
-var emptyFunction = __webpack_require__(8);
+var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
-/**
- * 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 _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 warning = emptyFunction;
+var _classnames = __webpack_require__(28);
-if (process.env.NODE_ENV !== 'production') {
- (function () {
- var printWarning = function printWarning(format) {
- for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- args[_key - 1] = arguments[_key];
- }
+var _classnames2 = _interopRequireDefault(_classnames);
- 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) {}
- };
+var _isEqual = __webpack_require__(58);
- warning = function warning(condition, format) {
- if (format === undefined) {
- throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
- }
+var _isEqual2 = _interopRequireDefault(_isEqual);
- if (format.indexOf('Failed Composite propType: ') === 0) {
- return; // Ignore CompositeComponent proptype check.
- }
+var _propTypes = __webpack_require__(10);
- if (!condition) {
- for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
- args[_key2 - 2] = arguments[_key2];
- }
+var _propTypes2 = _interopRequireDefault(_propTypes);
- printWarning.apply(undefined, [format].concat(args));
- }
- };
- })();
-}
+var _react = __webpack_require__(0);
-module.exports = warning;
-/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
+var _react2 = _interopRequireDefault(_react);
-/***/ }),
-/* 3 */
-/***/ (function(module, exports, __webpack_require__) {
+var _nanoid = __webpack_require__(127);
-"use strict";
-/**
- * Copyright (c) 2013-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.
- *
- *
- */
+var _nanoid2 = _interopRequireDefault(_nanoid);
+var _TreeNode = __webpack_require__(129);
-/**
- * WARNING: DO NOT manually require this module.
- * This is a replacement for `invariant(...)` used by the error code system
- * and will _only_ be required by the corresponding babel pass.
- * It always throws.
- */
+var _TreeNode2 = _interopRequireDefault(_TreeNode);
-function reactProdInvariant(code) {
- var argCount = arguments.length - 1;
+var _nodeShape = __webpack_require__(40);
- var message = 'Minified React error #' + code + '; visit ' + 'http://facebook.github.io/react/docs/error-decoder.html?invariant=' + code;
+var _nodeShape2 = _interopRequireDefault(_nodeShape);
- for (var argIdx = 0; argIdx < argCount; argIdx++) {
- message += '&args[]=' + encodeURIComponent(arguments[argIdx + 1]);
- }
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- message += ' for the full message or use the non-minified dev environment' + ' for full errors and additional helpful warnings.';
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- var error = new Error(message);
- error.name = 'Invariant Violation';
- error.framesToPop = 1; // we don't care about reactProdInvariant's own frame
+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; }
- throw error;
-}
+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; }
-module.exports = reactProdInvariant;
+var CheckboxTree = function (_React$Component) {
+ _inherits(CheckboxTree, _React$Component);
-/***/ }),
-/* 4 */
-/***/ (function(module, exports, __webpack_require__) {
+ function CheckboxTree(props) {
+ _classCallCheck(this, CheckboxTree);
-"use strict";
-/*
-object-assign
-(c) Sindre Sorhus
-@license MIT
-*/
+ var _this = _possibleConstructorReturn(this, (CheckboxTree.__proto__ || Object.getPrototypeOf(CheckboxTree)).call(this, props));
+ _this.id = 'rct-' + (0, _nanoid2.default)(7);
+ _this.nodes = {};
-/* eslint-disable no-unused-vars */
-var getOwnPropertySymbols = Object.getOwnPropertySymbols;
-var hasOwnProperty = Object.prototype.hasOwnProperty;
-var propIsEnumerable = Object.prototype.propertyIsEnumerable;
+ _this.flattenNodes(props.nodes);
+ _this.unserializeLists({
+ checked: props.checked,
+ expanded: props.expanded
+ });
-function toObject(val) {
- if (val === null || val === undefined) {
- throw new TypeError('Object.assign cannot be called with null or undefined');
- }
+ _this.onCheck = _this.onCheck.bind(_this);
+ _this.onExpand = _this.onExpand.bind(_this);
+ return _this;
+ }
- return Object(val);
-}
+ _createClass(CheckboxTree, [{
+ key: 'componentWillReceiveProps',
+ value: function componentWillReceiveProps(_ref) {
+ var nodes = _ref.nodes,
+ checked = _ref.checked,
+ expanded = _ref.expanded;
-function shouldUseNative() {
- try {
- if (!Object.assign) {
- return false;
- }
+ if (!(0, _isEqual2.default)(this.props.nodes, nodes)) {
+ this.flattenNodes(nodes);
+ }
- // Detect buggy property enumeration order in older V8 versions.
+ this.unserializeLists({ checked: checked, expanded: expanded });
+ }
+ }, {
+ key: 'onCheck',
+ value: function onCheck(node) {
+ var _props = this.props,
+ noCascade = _props.noCascade,
+ onCheck = _props.onCheck;
- // https://bugs.chromium.org/p/v8/issues/detail?id=4118
- var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
- test1[5] = 'de';
- if (Object.getOwnPropertyNames(test1)[0] === '5') {
- return false;
- }
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
- var test2 = {};
- for (var i = 0; i < 10; i++) {
- test2['_' + String.fromCharCode(i)] = i;
- }
- var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
- return test2[n];
- });
- if (order2.join('') !== '0123456789') {
- return false;
- }
+ this.toggleChecked(node, node.checked, noCascade);
+ onCheck(this.serializeList('checked'));
+ }
+ }, {
+ key: 'onExpand',
+ value: function onExpand(node) {
+ var onExpand = this.props.onExpand;
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
- var test3 = {};
- 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
- test3[letter] = letter;
- });
- if (Object.keys(Object.assign({}, test3)).join('') !==
- 'abcdefghijklmnopqrst') {
- return false;
- }
- return true;
- } catch (err) {
- // We don't expect any of the above to throw, but better to be safe.
- return false;
- }
-}
+ this.toggleNode('expanded', node, node.expanded);
+ onExpand(this.serializeList('expanded'));
+ }
+ }, {
+ key: 'getFormattedNodes',
+ value: function getFormattedNodes(nodes) {
+ var _this2 = this;
-module.exports = shouldUseNative() ? Object.assign : function (target, source) {
- var from;
- var to = toObject(target);
- var symbols;
+ return nodes.map(function (node) {
+ var formatted = _extends({}, node);
- for (var s = 1; s < arguments.length; s++) {
- from = Object(arguments[s]);
+ formatted.checked = _this2.nodes[node.value].checked;
+ formatted.expanded = _this2.nodes[node.value].expanded;
- for (var key in from) {
- if (hasOwnProperty.call(from, key)) {
- to[key] = from[key];
- }
- }
-
- if (getOwnPropertySymbols) {
- symbols = getOwnPropertySymbols(from);
- for (var i = 0; i < symbols.length; i++) {
- if (propIsEnumerable.call(from, symbols[i])) {
- to[symbols[i]] = from[symbols[i]];
- }
- }
- }
- }
-
- return to;
-};
+ if (Array.isArray(node.children) && node.children.length > 0) {
+ formatted.children = _this2.getFormattedNodes(formatted.children);
+ } else {
+ formatted.children = null;
+ }
+ return formatted;
+ });
+ }
+ }, {
+ key: 'getCheckState',
+ value: function getCheckState(node, noCascade) {
+ if (node.children === null || noCascade) {
+ return node.checked ? 1 : 0;
+ }
-/***/ }),
-/* 5 */
-/***/ (function(module, exports, __webpack_require__) {
+ if (this.isEveryChildChecked(node)) {
+ return 1;
+ }
-"use strict";
-/* WEBPACK VAR INJECTION */(function(process) {/**
- * Copyright 2013-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.
- *
- */
+ if (this.isSomeChildChecked(node)) {
+ return 2;
+ }
+ return 0;
+ }
+ }, {
+ key: 'getDisabledState',
+ value: function getDisabledState(node, parent, disabledProp, noCascade) {
+ if (disabledProp) {
+ return true;
+ }
+ if (!noCascade && parent.disabled) {
+ return true;
+ }
-var _prodInvariant = __webpack_require__(3);
+ return Boolean(node.disabled);
+ }
+ }, {
+ key: 'toggleChecked',
+ value: function toggleChecked(node, isChecked, noCascade) {
+ var _this3 = this;
-var DOMProperty = __webpack_require__(15);
-var ReactDOMComponentFlags = __webpack_require__(72);
+ if (node.children === null || noCascade) {
+ // Set the check status of a leaf node or an uncoupled parent
+ this.toggleNode('checked', node, isChecked);
+ } else {
+ // Percolate check status down to all children
+ node.children.forEach(function (child) {
+ _this3.toggleChecked(child, isChecked);
+ });
+ }
+ }
+ }, {
+ key: 'toggleNode',
+ value: function toggleNode(key, node, toggleValue) {
+ this.nodes[node.value][key] = toggleValue;
+ }
+ }, {
+ key: 'flattenNodes',
+ value: function flattenNodes(nodes) {
+ var _this4 = this;
-var invariant = __webpack_require__(1);
+ if (!Array.isArray(nodes) || nodes.length === 0) {
+ return;
+ }
-var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME;
-var Flags = ReactDOMComponentFlags;
+ nodes.forEach(function (node) {
+ _this4.nodes[node.value] = {};
+ _this4.flattenNodes(node.children);
+ });
+ }
+ }, {
+ key: 'unserializeLists',
+ value: function unserializeLists(lists) {
+ var _this5 = this;
-var internalInstanceKey = '__reactInternalInstance$' + Math.random().toString(36).slice(2);
+ // Reset values to false
+ Object.keys(this.nodes).forEach(function (value) {
+ Object.keys(lists).forEach(function (listKey) {
+ _this5.nodes[value][listKey] = false;
+ });
+ });
-/**
- * Check if a given node should be cached.
- */
-function shouldPrecacheNode(node, nodeID) {
- return node.nodeType === 1 && node.getAttribute(ATTR_NAME) === String(nodeID) || node.nodeType === 8 && node.nodeValue === ' react-text: ' + nodeID + ' ' || node.nodeType === 8 && node.nodeValue === ' react-empty: ' + nodeID + ' ';
-}
+ // Unserialize values and set their nodes to true
+ Object.keys(lists).forEach(function (listKey) {
+ lists[listKey].forEach(function (value) {
+ _this5.nodes[value][listKey] = true;
+ });
+ });
+ }
+ }, {
+ key: 'serializeList',
+ value: function serializeList(key) {
+ var _this6 = this;
-/**
- * Drill down (through composites and empty components) until we get a host or
- * host text component.
- *
- * This is pretty polymorphic but unavoidable with the current structure we have
- * for `_renderedChildren`.
- */
-function getRenderedHostOrTextFromComponent(component) {
- var rendered;
- while (rendered = component._renderedComponent) {
- component = rendered;
- }
- return component;
-}
+ var list = [];
-/**
- * Populate `_hostNode` on the rendered host/text component with the given
- * DOM node. The passed `inst` can be a composite.
- */
-function precacheNode(inst, node) {
- var hostInst = getRenderedHostOrTextFromComponent(inst);
- hostInst._hostNode = node;
- node[internalInstanceKey] = hostInst;
-}
+ Object.keys(this.nodes).forEach(function (value) {
+ if (_this6.nodes[value][key]) {
+ list.push(value);
+ }
+ });
-function uncacheNode(inst) {
- var node = inst._hostNode;
- if (node) {
- delete node[internalInstanceKey];
- inst._hostNode = null;
- }
-}
+ return list;
+ }
+ }, {
+ key: 'isEveryChildChecked',
+ value: function isEveryChildChecked(node) {
+ var _this7 = this;
-/**
- * Populate `_hostNode` on each child of `inst`, assuming that the children
- * match up with the DOM (element) children of `node`.
- *
- * We cache entire levels at once to avoid an n^2 problem where we access the
- * children of a node sequentially and have to walk from the start to our target
- * node every time.
- *
- * Since we update `_renderedChildren` and the actual DOM at (slightly)
- * different times, we could race here and see a newer `_renderedChildren` than
- * the DOM nodes we see. To avoid this, ReactMultiChild calls
- * `prepareToManageChildren` before we change `_renderedChildren`, at which
- * time the container's child nodes are always cached (until it unmounts).
- */
-function precacheChildNodes(inst, node) {
- if (inst._flags & Flags.hasCachedChildNodes) {
- return;
- }
- var children = inst._renderedChildren;
- var childNode = node.firstChild;
- outer: for (var name in children) {
- if (!children.hasOwnProperty(name)) {
- continue;
- }
- var childInst = children[name];
- var childID = getRenderedHostOrTextFromComponent(childInst)._domID;
- if (childID === 0) {
- // We're currently unmounting this child in ReactMultiChild; skip it.
- continue;
- }
- // We assume the child nodes are in the same order as the child instances.
- for (; childNode !== null; childNode = childNode.nextSibling) {
- if (shouldPrecacheNode(childNode, childID)) {
- precacheNode(childInst, childNode);
- continue outer;
- }
- }
- // We reached the end of the DOM children without finding an ID match.
- true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;
- }
- inst._flags |= Flags.hasCachedChildNodes;
-}
+ return node.children.every(function (child) {
+ if (child.children !== null) {
+ return _this7.isEveryChildChecked(child);
+ }
-/**
- * Given a DOM node, return the closest ReactDOMComponent or
- * ReactDOMTextComponent instance ancestor.
- */
-function getClosestInstanceFromNode(node) {
- if (node[internalInstanceKey]) {
- return node[internalInstanceKey];
- }
+ return child.checked;
+ });
+ }
+ }, {
+ key: 'isSomeChildChecked',
+ value: function isSomeChildChecked(node) {
+ var _this8 = this;
- // Walk up the tree until we find an ancestor whose instance we have cached.
- var parents = [];
- while (!node[internalInstanceKey]) {
- parents.push(node);
- if (node.parentNode) {
- node = node.parentNode;
- } else {
- // Top of the tree. This node must not be part of a React tree (or is
- // unmounted, potentially).
- return null;
- }
- }
+ return node.children.some(function (child) {
+ if (child.children !== null) {
+ return _this8.isSomeChildChecked(child);
+ }
- var closest;
- var inst;
- for (; node && (inst = node[internalInstanceKey]); node = parents.pop()) {
- closest = inst;
- if (parents.length) {
- precacheChildNodes(inst, node);
- }
- }
+ return child.checked;
+ });
+ }
+ }, {
+ key: 'renderTreeNodes',
+ value: function renderTreeNodes(nodes) {
+ var _this9 = this;
- return closest;
-}
+ var parent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
+ var _props2 = this.props,
+ disabled = _props2.disabled,
+ expandDisabled = _props2.expandDisabled,
+ noCascade = _props2.noCascade,
+ optimisticToggle = _props2.optimisticToggle,
+ showNodeIcon = _props2.showNodeIcon;
-/**
- * Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent
- * instance, or null if the node was not rendered by this React.
- */
-function getInstanceFromNode(node) {
- var inst = getClosestInstanceFromNode(node);
- if (inst != null && inst._hostNode === node) {
- return inst;
- } else {
- return null;
- }
-}
+ var treeNodes = nodes.map(function (node) {
+ var key = '' + node.value;
+ var checked = _this9.getCheckState(node, noCascade);
+ var children = _this9.renderChildNodes(node);
+ var nodeDisabled = _this9.getDisabledState(node, parent, disabled, noCascade);
-/**
- * Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding
- * DOM node.
- */
-function getNodeFromInstance(inst) {
- // Without this first invariant, passing a non-DOM-component triggers the next
- // invariant for a missing parent, which is super confusing.
- !(inst._hostNode !== undefined) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : _prodInvariant('33') : void 0;
+ return _react2.default.createElement(
+ _TreeNode2.default,
+ {
+ key: key,
+ checked: checked,
+ className: node.className,
+ disabled: nodeDisabled,
+ expandDisabled: expandDisabled,
+ expanded: node.expanded,
+ icon: node.icon,
+ label: node.label,
+ optimisticToggle: optimisticToggle,
+ rawChildren: node.children,
+ showNodeIcon: showNodeIcon,
+ treeId: _this9.id,
+ value: node.value,
+ onCheck: _this9.onCheck,
+ onExpand: _this9.onExpand
+ },
+ children
+ );
+ });
- if (inst._hostNode) {
- return inst._hostNode;
- }
+ return _react2.default.createElement(
+ 'ol',
+ null,
+ treeNodes
+ );
+ }
+ }, {
+ key: 'renderChildNodes',
+ value: function renderChildNodes(node) {
+ if (node.children !== null && node.expanded) {
+ return this.renderTreeNodes(node.children, node);
+ }
- // Walk up the tree until we find an ancestor whose DOM node we have cached.
- var parents = [];
- while (!inst._hostNode) {
- parents.push(inst);
- !inst._hostParent ? process.env.NODE_ENV !== 'production' ? invariant(false, 'React DOM tree root should always have a node reference.') : _prodInvariant('34') : void 0;
- inst = inst._hostParent;
- }
+ return null;
+ }
+ }, {
+ key: 'renderHiddenInput',
+ value: function renderHiddenInput() {
+ if (this.props.name === undefined) {
+ return null;
+ }
- // Now parents contains each ancestor that does *not* have a cached native
- // node, and `inst` is the deepest ancestor that does.
- for (; parents.length; inst = parents.pop()) {
- precacheChildNodes(inst, inst._hostNode);
- }
+ if (this.props.nameAsArray) {
+ return this.renderArrayHiddenInput();
+ }
- return inst._hostNode;
-}
+ return this.renderJoinedHiddenInput();
+ }
+ }, {
+ key: 'renderArrayHiddenInput',
+ value: function renderArrayHiddenInput() {
+ var _this10 = this;
-var ReactDOMComponentTree = {
- getClosestInstanceFromNode: getClosestInstanceFromNode,
- getInstanceFromNode: getInstanceFromNode,
- getNodeFromInstance: getNodeFromInstance,
- precacheChildNodes: precacheChildNodes,
- precacheNode: precacheNode,
- uncacheNode: uncacheNode
-};
+ return this.props.checked.map(function (value) {
+ var name = _this10.props.name + '[]';
+
+ return _react2.default.createElement('input', { key: value, name: name, type: 'hidden', value: value });
+ });
+ }
+ }, {
+ key: 'renderJoinedHiddenInput',
+ value: function renderJoinedHiddenInput() {
+ var checked = this.props.checked.join(',');
+
+ return _react2.default.createElement('input', { name: this.props.name, type: 'hidden', value: checked });
+ }
+ }, {
+ key: 'render',
+ value: function render() {
+ var nodes = this.getFormattedNodes(this.props.nodes);
+ var treeNodes = this.renderTreeNodes(nodes);
+ var className = (0, _classnames2.default)({
+ 'react-checkbox-tree': true,
+ 'rct-disabled': this.props.disabled
+ });
+
+ return _react2.default.createElement(
+ 'div',
+ { className: className },
+ this.renderHiddenInput(),
+ treeNodes
+ );
+ }
+ }]);
+
+ return CheckboxTree;
+}(_react2.default.Component);
+
+CheckboxTree.propTypes = {
+ nodes: _propTypes2.default.arrayOf(_nodeShape2.default).isRequired,
-module.exports = ReactDOMComponentTree;
-/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
+ checked: _propTypes2.default.arrayOf(_propTypes2.default.string),
+ disabled: _propTypes2.default.bool,
+ expandDisabled: _propTypes2.default.bool,
+ expanded: _propTypes2.default.arrayOf(_propTypes2.default.string),
+ name: _propTypes2.default.string,
+ nameAsArray: _propTypes2.default.bool,
+ noCascade: _propTypes2.default.bool,
+ optimisticToggle: _propTypes2.default.bool,
+ showNodeIcon: _propTypes2.default.bool,
+ onCheck: _propTypes2.default.func,
+ onExpand: _propTypes2.default.func
+};
+CheckboxTree.defaultProps = {
+ checked: [],
+ disabled: false,
+ expandDisabled: false,
+ expanded: [],
+ name: undefined,
+ nameAsArray: false,
+ noCascade: false,
+ optimisticToggle: true,
+ showNodeIcon: true,
+ onCheck: function onCheck() {},
+ onExpand: function onExpand() {}
+};
+exports.default = CheckboxTree;
/***/ }),
/* 6 */
/***/ (function(module, exports, __webpack_require__) {
-"use strict";
+var baseIsNative = __webpack_require__(72),
+ getValue = __webpack_require__(78);
+
/**
- * Copyright (c) 2013-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.
+ * Gets the native function at `key` of `object`.
*
+ * @private
+ * @param {Object} object The object to query.
+ * @param {string} key The key of the method to get.
+ * @returns {*} Returns the function if it's native, else `undefined`.
*/
+function getNative(object, key) {
+ var value = getValue(object, key);
+ return baseIsNative(value) ? value : undefined;
+}
+module.exports = getNative;
-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 = {
+/***/ }),
+/* 7 */
+/***/ (function(module, exports, __webpack_require__) {
- canUseDOM: canUseDOM,
+"use strict";
+/*
+object-assign
+(c) Sindre Sorhus
+@license MIT
+*/
- canUseWorkers: typeof Worker !== 'undefined',
- canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent),
+/* eslint-disable no-unused-vars */
+var getOwnPropertySymbols = Object.getOwnPropertySymbols;
+var hasOwnProperty = Object.prototype.hasOwnProperty;
+var propIsEnumerable = Object.prototype.propertyIsEnumerable;
- canUseViewport: canUseDOM && !!window.screen,
+function toObject(val) {
+ if (val === null || val === undefined) {
+ throw new TypeError('Object.assign cannot be called with null or undefined');
+ }
- isInWorker: !canUseDOM // For now, this is true - might change in the future.
+ return Object(val);
+}
-};
+function shouldUseNative() {
+ try {
+ if (!Object.assign) {
+ return false;
+ }
-module.exports = ExecutionEnvironment;
+ // Detect buggy property enumeration order in older V8 versions.
-/***/ }),
-/* 7 */
-/***/ (function(module, exports, __webpack_require__) {
+ // https://bugs.chromium.org/p/v8/issues/detail?id=4118
+ var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
+ test1[5] = 'de';
+ if (Object.getOwnPropertyNames(test1)[0] === '5') {
+ return false;
+ }
-"use strict";
-/* WEBPACK VAR INJECTION */(function(process) {/**
- * Copyright 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.
- *
- *
- */
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
+ var test2 = {};
+ for (var i = 0; i < 10; i++) {
+ test2['_' + String.fromCharCode(i)] = i;
+ }
+ var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
+ return test2[n];
+ });
+ if (order2.join('') !== '0123456789') {
+ return false;
+ }
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
+ var test3 = {};
+ 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
+ test3[letter] = letter;
+ });
+ if (Object.keys(Object.assign({}, test3)).join('') !==
+ 'abcdefghijklmnopqrst') {
+ return false;
+ }
+ return true;
+ } catch (err) {
+ // We don't expect any of the above to throw, but better to be safe.
+ return false;
+ }
+}
-var _prodInvariant = __webpack_require__(19);
+module.exports = shouldUseNative() ? Object.assign : function (target, source) {
+ var from;
+ var to = toObject(target);
+ var symbols;
-var ReactCurrentOwner = __webpack_require__(10);
+ for (var s = 1; s < arguments.length; s++) {
+ from = Object(arguments[s]);
-var invariant = __webpack_require__(1);
-var warning = __webpack_require__(2);
+ for (var key in from) {
+ if (hasOwnProperty.call(from, key)) {
+ to[key] = from[key];
+ }
+ }
-function isNative(fn) {
- // Based on isNative() from Lodash
- var funcToString = Function.prototype.toString;
- var hasOwnProperty = Object.prototype.hasOwnProperty;
- var reIsNative = RegExp('^' + funcToString
- // Take an example native function source for comparison
- .call(hasOwnProperty
- // Strip regex characters so we can use it for regex
- ).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&'
- // Remove hasOwnProperty from the template to make it generic
- ).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
- try {
- var source = funcToString.call(fn);
- return reIsNative.test(source);
- } catch (err) {
- return false;
- }
-}
+ if (getOwnPropertySymbols) {
+ symbols = getOwnPropertySymbols(from);
+ for (var i = 0; i < symbols.length; i++) {
+ if (propIsEnumerable.call(from, symbols[i])) {
+ to[symbols[i]] = from[symbols[i]];
+ }
+ }
+ }
+ }
-var canUseCollections =
-// Array.from
-typeof Array.from === 'function' &&
-// Map
-typeof Map === 'function' && isNative(Map) &&
-// Map.prototype.keys
-Map.prototype != null && typeof Map.prototype.keys === 'function' && isNative(Map.prototype.keys) &&
-// Set
-typeof Set === 'function' && isNative(Set) &&
-// Set.prototype.keys
-Set.prototype != null && typeof Set.prototype.keys === 'function' && isNative(Set.prototype.keys);
+ return to;
+};
-var setItem;
-var getItem;
-var removeItem;
-var getItemIDs;
-var addRoot;
-var removeRoot;
-var getRootIDs;
-if (canUseCollections) {
- var itemMap = new Map();
- var rootIDSet = new Set();
+/***/ }),
+/* 8 */
+/***/ (function(module, exports, __webpack_require__) {
- setItem = function (id, item) {
- itemMap.set(id, item);
- };
- getItem = function (id) {
- return itemMap.get(id);
- };
- removeItem = function (id) {
- itemMap['delete'](id);
- };
- getItemIDs = function () {
- return Array.from(itemMap.keys());
- };
+"use strict";
+/* WEBPACK VAR INJECTION */(function(process) {/**
+ * Copyright (c) 2013-present, Facebook, Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ */
- addRoot = function (id) {
- rootIDSet.add(id);
- };
- removeRoot = function (id) {
- rootIDSet['delete'](id);
- };
- getRootIDs = function () {
- return Array.from(rootIDSet.keys());
- };
-} else {
- var itemByKey = {};
- var rootByKey = {};
- // Use non-numeric keys to prevent V8 performance issues:
- // https://github.com/facebook/react/pull/7232
- var getKeyFromID = function (id) {
- return '.' + id;
- };
- var getIDFromKey = function (key) {
- return parseInt(key.substr(1), 10);
- };
- setItem = function (id, item) {
- var key = getKeyFromID(id);
- itemByKey[key] = item;
- };
- getItem = function (id) {
- var key = getKeyFromID(id);
- return itemByKey[key];
- };
- removeItem = function (id) {
- var key = getKeyFromID(id);
- delete itemByKey[key];
- };
- getItemIDs = function () {
- return Object.keys(itemByKey).map(getIDFromKey);
- };
+var emptyObject = {};
- addRoot = function (id) {
- var key = getKeyFromID(id);
- rootByKey[key] = true;
- };
- removeRoot = function (id) {
- var key = getKeyFromID(id);
- delete rootByKey[key];
- };
- getRootIDs = function () {
- return Object.keys(rootByKey).map(getIDFromKey);
- };
+if (process.env.NODE_ENV !== 'production') {
+ Object.freeze(emptyObject);
}
-var unmountedIDs = [];
+module.exports = emptyObject;
+/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
-function purgeDeep(id) {
- var item = getItem(id);
- if (item) {
- var childIDs = item.childIDs;
+/***/ }),
+/* 9 */
+/***/ (function(module, exports, __webpack_require__) {
- removeItem(id);
- childIDs.forEach(purgeDeep);
- }
-}
+"use strict";
+/* WEBPACK VAR INJECTION */(function(process) {/**
+ * Copyright (c) 2014-present, Facebook, Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ */
-function describeComponentFrame(name, source, ownerName) {
- return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');
-}
-function getDisplayName(element) {
- if (element == null) {
- return '#empty';
- } else if (typeof element === 'string' || typeof element === 'number') {
- return '#text';
- } else if (typeof element.type === 'string') {
- return element.type;
- } else {
- return element.type.displayName || element.type.name || 'Unknown';
- }
-}
-function describeID(id) {
- var name = ReactComponentTreeHook.getDisplayName(id);
- var element = ReactComponentTreeHook.getElement(id);
- var ownerID = ReactComponentTreeHook.getOwnerID(id);
- var ownerName;
- if (ownerID) {
- ownerName = ReactComponentTreeHook.getDisplayName(ownerID);
- }
- process.env.NODE_ENV !== 'production' ? warning(element, 'ReactComponentTreeHook: Missing React element for debugID %s when ' + 'building stack', id) : void 0;
- return describeComponentFrame(name, element && element._source, ownerName);
-}
+var emptyFunction = __webpack_require__(3);
-var ReactComponentTreeHook = {
- onSetChildren: function (id, nextChildIDs) {
- var item = getItem(id);
- !item ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Item must have been set') : _prodInvariant('144') : void 0;
- item.childIDs = nextChildIDs;
+/**
+ * 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.
+ */
- for (var i = 0; i < nextChildIDs.length; i++) {
- var nextChildID = nextChildIDs[i];
- var nextChild = getItem(nextChildID);
- !nextChild ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected hook events to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('140') : void 0;
- !(nextChild.childIDs != null || typeof nextChild.element !== 'object' || nextChild.element == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onSetChildren() to fire for a container child before its parent includes it in onSetChildren().') : _prodInvariant('141') : void 0;
- !nextChild.isMounted ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onMountComponent() to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('71') : void 0;
- if (nextChild.parentID == null) {
- nextChild.parentID = id;
- // TODO: This shouldn't be necessary but mounting a new root during in
- // componentWillMount currently causes not-yet-mounted components to
- // be purged from our tree data so their parent id is missing.
- }
- !(nextChild.parentID === id) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onBeforeMountComponent() parent and onSetChildren() to be consistent (%s has parents %s and %s).', nextChildID, nextChild.parentID, id) : _prodInvariant('142', nextChildID, nextChild.parentID, id) : void 0;
+var warning = emptyFunction;
+
+if (process.env.NODE_ENV !== 'production') {
+ var printWarning = function printWarning(format) {
+ for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
+ args[_key - 1] = arguments[_key];
}
- },
- onBeforeMountComponent: function (id, element, parentID) {
- var item = {
- element: element,
- parentID: parentID,
- text: null,
- childIDs: [],
- isMounted: false,
- updateCount: 0
- };
- setItem(id, item);
- },
- onBeforeUpdateComponent: function (id, element) {
- var item = getItem(id);
- if (!item || !item.isMounted) {
- // We may end up here as a result of setState() in componentWillUnmount().
- // In this case, ignore the element.
- return;
+
+ var argIndex = 0;
+ var message = 'Warning: ' + format.replace(/%s/g, function () {
+ return args[argIndex++];
+ });
+ if (typeof console !== 'undefined') {
+ console.error(message);
}
- item.element = element;
- },
- onMountComponent: function (id) {
- var item = getItem(id);
- !item ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Item must have been set') : _prodInvariant('144') : void 0;
- item.isMounted = true;
- var isRoot = item.parentID === 0;
- if (isRoot) {
- addRoot(id);
+ 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) {}
+ };
+
+ warning = function warning(condition, format) {
+ if (format === undefined) {
+ throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
}
- },
- onUpdateComponent: function (id) {
- var item = getItem(id);
- if (!item || !item.isMounted) {
- // We may end up here as a result of setState() in componentWillUnmount().
- // In this case, ignore the element.
- return;
+
+ if (format.indexOf('Failed Composite propType: ') === 0) {
+ return; // Ignore CompositeComponent proptype check.
}
- item.updateCount++;
- },
- onUnmountComponent: function (id) {
- var item = getItem(id);
- if (item) {
- // We need to check if it exists.
- // `item` might not exist if it is inside an error boundary, and a sibling
- // error boundary child threw while mounting. Then this instance never
- // got a chance to mount, but it still gets an unmounting event during
- // the error boundary cleanup.
- item.isMounted = false;
- var isRoot = item.parentID === 0;
- if (isRoot) {
- removeRoot(id);
+
+ if (!condition) {
+ for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
+ args[_key2 - 2] = arguments[_key2];
}
- }
- unmountedIDs.push(id);
- },
- purgeUnmountedComponents: function () {
- if (ReactComponentTreeHook._preventPurging) {
- // Should only be used for testing.
- return;
- }
- for (var i = 0; i < unmountedIDs.length; i++) {
- var id = unmountedIDs[i];
- purgeDeep(id);
+ printWarning.apply(undefined, [format].concat(args));
}
- unmountedIDs.length = 0;
- },
- isMounted: function (id) {
- var item = getItem(id);
- return item ? item.isMounted : false;
- },
- getCurrentStackAddendum: function (topElement) {
- var info = '';
- if (topElement) {
- var name = getDisplayName(topElement);
- var owner = topElement._owner;
- info += describeComponentFrame(name, topElement._source, owner && owner.getName());
- }
-
- var currentOwner = ReactCurrentOwner.current;
- var id = currentOwner && currentOwner._debugID;
-
- info += ReactComponentTreeHook.getStackAddendumByID(id);
- return info;
- },
- getStackAddendumByID: function (id) {
- var info = '';
- while (id) {
- info += describeID(id);
- id = ReactComponentTreeHook.getParentID(id);
- }
- return info;
- },
- getChildIDs: function (id) {
- var item = getItem(id);
- return item ? item.childIDs : [];
- },
- getDisplayName: function (id) {
- var element = ReactComponentTreeHook.getElement(id);
- if (!element) {
- return null;
- }
- return getDisplayName(element);
- },
- getElement: function (id) {
- var item = getItem(id);
- return item ? item.element : null;
- },
- getOwnerID: function (id) {
- var element = ReactComponentTreeHook.getElement(id);
- if (!element || !element._owner) {
- return null;
- }
- return element._owner._debugID;
- },
- getParentID: function (id) {
- var item = getItem(id);
- return item ? item.parentID : null;
- },
- getSource: function (id) {
- var item = getItem(id);
- var element = item ? item.element : null;
- var source = element != null ? element._source : null;
- return source;
- },
- getText: function (id) {
- var element = ReactComponentTreeHook.getElement(id);
- if (typeof element === 'string') {
- return element;
- } else if (typeof element === 'number') {
- return '' + element;
- } else {
- return null;
- }
- },
- getUpdateCount: function (id) {
- var item = getItem(id);
- return item ? item.updateCount : 0;
- },
-
+ };
+}
- getRootIDs: getRootIDs,
- getRegisteredIDs: getItemIDs,
+module.exports = warning;
+/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
- pushNonStandardWarningStack: function (isCreatingElement, currentSource) {
- if (typeof console.reactStack !== 'function') {
- return;
- }
+/***/ }),
+/* 10 */
+/***/ (function(module, exports, __webpack_require__) {
- var stack = [];
- var currentOwner = ReactCurrentOwner.current;
- var id = currentOwner && currentOwner._debugID;
+/* WEBPACK VAR INJECTION */(function(process) {/**
+ * Copyright (c) 2013-present, Facebook, Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
- try {
- if (isCreatingElement) {
- stack.push({
- name: id ? ReactComponentTreeHook.getDisplayName(id) : null,
- fileName: currentSource ? currentSource.fileName : null,
- lineNumber: currentSource ? currentSource.lineNumber : null
- });
- }
+if (process.env.NODE_ENV !== 'production') {
+ var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&
+ Symbol.for &&
+ Symbol.for('react.element')) ||
+ 0xeac7;
- while (id) {
- var element = ReactComponentTreeHook.getElement(id);
- var parentID = ReactComponentTreeHook.getParentID(id);
- var ownerID = ReactComponentTreeHook.getOwnerID(id);
- var ownerName = ownerID ? ReactComponentTreeHook.getDisplayName(ownerID) : null;
- var source = element && element._source;
- stack.push({
- name: ownerName,
- fileName: source ? source.fileName : null,
- lineNumber: source ? source.lineNumber : null
- });
- id = parentID;
- }
- } catch (err) {
- // Internal state is messed up.
- // Stop building the stack (it's just a nice to have).
- }
+ var isValidElement = function(object) {
+ return typeof object === 'object' &&
+ object !== null &&
+ object.$$typeof === REACT_ELEMENT_TYPE;
+ };
- console.reactStack(stack);
- },
- popNonStandardWarningStack: function () {
- if (typeof console.reactStackEnd !== 'function') {
- return;
- }
- console.reactStackEnd();
- }
-};
+ // By explicitly using `prop-types` you are opting into new development behavior.
+ // http://fb.me/prop-types-in-prod
+ var throwOnDirectAccess = true;
+ module.exports = __webpack_require__(55)(isValidElement, throwOnDirectAccess);
+} else {
+ // By explicitly using `prop-types` you are opting into new production behavior.
+ // http://fb.me/prop-types-in-prod
+ module.exports = __webpack_require__(56)();
+}
-module.exports = ReactComponentTreeHook;
-/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
+/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
/***/ }),
-/* 8 */
+/* 11 */
/***/ (function(module, exports, __webpack_require__) {
-"use strict";
-
+var listCacheClear = __webpack_require__(62),
+ listCacheDelete = __webpack_require__(63),
+ listCacheGet = __webpack_require__(64),
+ listCacheHas = __webpack_require__(65),
+ listCacheSet = __webpack_require__(66);
/**
- * Copyright (c) 2013-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.
+ * Creates an list cache object.
*
- *
+ * @private
+ * @constructor
+ * @param {Array} [entries] The key-value pairs to cache.
*/
+function ListCache(entries) {
+ var index = -1,
+ length = entries == null ? 0 : entries.length;
-function makeEmptyFunction(arg) {
- return function () {
- return arg;
- };
+ this.clear();
+ while (++index < length) {
+ var entry = entries[index];
+ this.set(entry[0], entry[1]);
+ }
}
-/**
- * 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.
- */
-var emptyFunction = function emptyFunction() {};
+// Add methods to `ListCache`.
+ListCache.prototype.clear = listCacheClear;
+ListCache.prototype['delete'] = listCacheDelete;
+ListCache.prototype.get = listCacheGet;
+ListCache.prototype.has = listCacheHas;
+ListCache.prototype.set = listCacheSet;
-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 = ListCache;
-module.exports = emptyFunction;
/***/ }),
-/* 9 */
+/* 12 */
/***/ (function(module, exports, __webpack_require__) {
-"use strict";
-/* WEBPACK VAR INJECTION */(function(process) {/**
- * Copyright 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.
+var eq = __webpack_require__(29);
+
+/**
+ * Gets the index at which the `key` is found in `array` of key-value pairs.
*
- *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {*} key The key to search for.
+ * @returns {number} Returns the index of the matched value, else `-1`.
*/
-
-
-
-// Trust the developer to only use ReactInstrumentation with a __DEV__ check
-
-var debugTool = null;
-
-if (process.env.NODE_ENV !== 'production') {
- var ReactDebugTool = __webpack_require__(137);
- debugTool = ReactDebugTool;
+function assocIndexOf(array, key) {
+ var length = array.length;
+ while (length--) {
+ if (eq(array[length][0], key)) {
+ return length;
+ }
+ }
+ return -1;
}
-module.exports = { debugTool: debugTool };
-/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
+module.exports = assocIndexOf;
+
/***/ }),
-/* 10 */
+/* 13 */
/***/ (function(module, exports, __webpack_require__) {
-"use strict";
-/**
- * Copyright 2013-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.
- *
- *
- */
+var Symbol = __webpack_require__(21),
+ getRawTag = __webpack_require__(74),
+ objectToString = __webpack_require__(75);
+/** `Object#toString` result references. */
+var nullTag = '[object Null]',
+ undefinedTag = '[object Undefined]';
+/** Built-in value references. */
+var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
/**
- * Keeps track of the current owner.
+ * The base implementation of `getTag` without fallbacks for buggy environments.
*
- * The current owner is the component who should own any components that are
- * currently being constructed.
+ * @private
+ * @param {*} value The value to query.
+ * @returns {string} Returns the `toStringTag`.
*/
-var ReactCurrentOwner = {
- /**
- * @internal
- * @type {ReactComponent}
- */
- current: null
-};
+function baseGetTag(value) {
+ if (value == null) {
+ return value === undefined ? undefinedTag : nullTag;
+ }
+ return (symToStringTag && symToStringTag in Object(value))
+ ? getRawTag(value)
+ : objectToString(value);
+}
+
+module.exports = baseGetTag;
-module.exports = ReactCurrentOwner;
/***/ }),
-/* 11 */
+/* 14 */
/***/ (function(module, exports, __webpack_require__) {
-"use strict";
-/* WEBPACK VAR INJECTION */(function(process) {/**
- * Copyright 2013-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.
- *
- */
-
-
+var getNative = __webpack_require__(6);
-var _prodInvariant = __webpack_require__(3),
- _assign = __webpack_require__(4);
+/* Built-in method references that are verified to be native. */
+var nativeCreate = getNative(Object, 'create');
-var CallbackQueue = __webpack_require__(76);
-var PooledClass = __webpack_require__(17);
-var ReactFeatureFlags = __webpack_require__(77);
-var ReactReconciler = __webpack_require__(20);
-var Transaction = __webpack_require__(31);
+module.exports = nativeCreate;
-var invariant = __webpack_require__(1);
-var dirtyComponents = [];
-var updateBatchNumber = 0;
-var asapCallbackQueue = CallbackQueue.getPooled();
-var asapEnqueued = false;
+/***/ }),
+/* 15 */
+/***/ (function(module, exports, __webpack_require__) {
-var batchingStrategy = null;
+var isKeyable = __webpack_require__(87);
-function ensureInjected() {
- !(ReactUpdates.ReactReconcileTransaction && batchingStrategy) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must inject a reconcile transaction class and batching strategy') : _prodInvariant('123') : void 0;
+/**
+ * Gets the data for `map`.
+ *
+ * @private
+ * @param {Object} map The map to query.
+ * @param {string} key The reference key.
+ * @returns {*} Returns the map data.
+ */
+function getMapData(map, key) {
+ var data = map.__data__;
+ return isKeyable(key)
+ ? data[typeof key == 'string' ? 'string' : 'hash']
+ : data.map;
}
-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;
- }
- }
-};
+module.exports = getMapData;
-var UPDATE_QUEUEING = {
- initialize: function () {
- this.callbackQueue.reset();
- },
- close: function () {
- this.callbackQueue.notifyAll();
- }
-};
-var TRANSACTION_WRAPPERS = [NESTED_UPDATES, UPDATE_QUEUEING];
+/***/ }),
+/* 16 */
+/***/ (function(module, exports) {
-function ReactUpdatesFlushTransaction() {
- this.reinitializeTransaction();
- this.dirtyComponentsLength = null;
- this.callbackQueue = CallbackQueue.getPooled();
- this.reconcileTransaction = ReactUpdates.ReactReconcileTransaction.getPooled(
- /* useCreateElement */true);
+/**
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
+ * and has a `typeof` result of "object".
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
+ * @example
+ *
+ * _.isObjectLike({});
+ * // => true
+ *
+ * _.isObjectLike([1, 2, 3]);
+ * // => true
+ *
+ * _.isObjectLike(_.noop);
+ * // => false
+ *
+ * _.isObjectLike(null);
+ * // => false
+ */
+function isObjectLike(value) {
+ return value != null && typeof value == 'object';
}
-_assign(ReactUpdatesFlushTransaction.prototype, Transaction, {
- getTransactionWrappers: function () {
- return TRANSACTION_WRAPPERS;
- },
+module.exports = isObjectLike;
- 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.perform.call(this, this.reconcileTransaction.perform, this.reconcileTransaction, method, scope, a);
- }
-});
+/***/ }),
+/* 17 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/* WEBPACK VAR INJECTION */(function(process) {/**
+ * Copyright (c) 2013-present, Facebook, Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
-PooledClass.addPoolingTo(ReactUpdatesFlushTransaction);
-function batchedUpdates(callback, a, b, c, d, e) {
- ensureInjected();
- return batchingStrategy.batchedUpdates(callback, a, b, c, d, e);
+
+if (process.env.NODE_ENV !== 'production') {
+ var invariant = __webpack_require__(4);
+ var warning = __webpack_require__(9);
+ var ReactPropTypesSecret = __webpack_require__(18);
+ var loggedTypeFailures = {};
}
/**
- * Array comparator for ReactComponents by mount ordering.
+ * Assert that the values match with the type specs.
+ * Error messages are memorized and will only be shown once.
*
- * @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().
+ * @param {object} typeSpecs Map of name to a ReactPropType
+ * @param {object} values Runtime values that need to be type-checked
+ * @param {string} location e.g. "prop", "context", "child context"
+ * @param {string} componentName Name of the component for error messages.
+ * @param {?Function} getStack Returns the component stack.
+ * @private
*/
-function mountOrderComparator(c1, c2) {
- return c1._mountOrder - c2._mountOrder;
-}
+function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
+ if (process.env.NODE_ENV !== 'production') {
+ for (var typeSpecName in typeSpecs) {
+ if (typeSpecs.hasOwnProperty(typeSpecName)) {
+ 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.
+ invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'the `prop-types` package, but received `%s`.', componentName || 'React class', location, typeSpecName, typeof typeSpecs[typeSpecName]);
+ error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
+ } catch (ex) {
+ error = ex;
+ }
+ warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error);
+ 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;
-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) : _prodInvariant('124', len, dirtyComponents.length) : void 0;
+ var stack = getStack ? getStack() : '';
- // 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);
+ warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');
+ }
+ }
+ }
+ }
+}
- // Any updates enqueued while reconciling must be performed after this entire
- // batch. Otherwise, if dirtyComponents is [A, B] where A has children B and
- // C, B could update twice in a single batch if C's render enqueues an update
- // to B (since B would have already updated, we should skip it, and the only
- // way we can know to do so is by checking the batch counter).
- updateBatchNumber++;
+module.exports = checkPropTypes;
- 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];
+/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
- // 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;
+/***/ }),
+/* 18 */
+/***/ (function(module, exports, __webpack_require__) {
- var markerName;
- if (ReactFeatureFlags.logTopLevelRenders) {
- var namedComponent = component;
- // Duck type TopLevelWrapper. This is probably always true.
- if (component._currentElement.type.isReactTopLevelWrapper) {
- namedComponent = component._renderedComponent;
- }
- markerName = 'React update: ' + namedComponent.getName();
- console.time(markerName);
- }
+"use strict";
+/**
+ * Copyright (c) 2013-present, Facebook, Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
- ReactReconciler.performUpdateIfNecessary(component, transaction.reconcileTransaction, updateBatchNumber);
- if (markerName) {
- console.timeEnd(markerName);
- }
- if (callbacks) {
- for (var j = 0; j < callbacks.length; j++) {
- transaction.callbackQueue.enqueue(callbacks[j], component.getPublicInstance());
- }
- }
- }
-}
+var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
-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);
- }
+module.exports = ReactPropTypesSecret;
- if (asapEnqueued) {
- asapEnqueued = false;
- var queue = asapCallbackQueue;
- asapCallbackQueue = CallbackQueue.getPooled();
- queue.notifyAll();
- CallbackQueue.release(queue);
- }
- }
-};
+/***/ }),
+/* 19 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
/**
- * Mark a component as needing a rerender, adding an optional callback to a
- * list of functions which will be executed once the rerender occurs.
+ * Copyright (c) 2013-present, Facebook, Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
*/
-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 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);
- if (component._updateBatchNumber == null) {
- component._updateBatchNumber = updateBatchNumber + 1;
- }
-}
+var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
/**
- * Enqueue a callback to be run at the end of the current batching cycle. Throws
- * if no updates are currently being performed.
+ * 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.
*/
-function asap(callback, context) {
- !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\'t enqueue an asap callback in a context whereupdates are not being batched.') : _prodInvariant('125') : void 0;
- asapCallbackQueue.enqueue(callback, context);
- asapEnqueued = true;
-}
+var ExecutionEnvironment = {
-var ReactUpdatesInjection = {
- injectReconcileTransaction: function (ReconcileTransaction) {
- !ReconcileTransaction ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a reconcile transaction class') : _prodInvariant('126') : void 0;
- ReactUpdates.ReactReconcileTransaction = ReconcileTransaction;
- },
+ canUseDOM: canUseDOM,
- injectBatchingStrategy: function (_batchingStrategy) {
- !_batchingStrategy ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a batching strategy') : _prodInvariant('127') : void 0;
- !(typeof _batchingStrategy.batchedUpdates === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a batchedUpdates() function') : _prodInvariant('128') : void 0;
- !(typeof _batchingStrategy.isBatchingUpdates === 'boolean') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide an isBatchingUpdates boolean attribute') : _prodInvariant('129') : void 0;
- batchingStrategy = _batchingStrategy;
- }
-};
+ canUseWorkers: typeof Worker !== 'undefined',
-var ReactUpdates = {
- /**
- * React references `ReactReconcileTransaction` using this property in order
- * to allow dependency injection.
- *
- * @internal
- */
- ReactReconcileTransaction: null,
+ canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent),
+
+ canUseViewport: canUseDOM && !!window.screen,
+
+ isInWorker: !canUseDOM // For now, this is true - might change in the future.
- batchedUpdates: batchedUpdates,
- enqueueUpdate: enqueueUpdate,
- flushBatchedUpdates: flushBatchedUpdates,
- injection: ReactUpdatesInjection,
- asap: asap
};
-module.exports = ReactUpdates;
-/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
+module.exports = ExecutionEnvironment;
/***/ }),
-/* 12 */
+/* 20 */
/***/ (function(module, exports, __webpack_require__) {
-"use strict";
+var getNative = __webpack_require__(6),
+ root = __webpack_require__(2);
+/* Built-in method references that are verified to be native. */
+var Map = getNative(root, 'Map');
-module.exports = __webpack_require__(18);
+module.exports = Map;
/***/ }),
-/* 13 */
+/* 21 */
/***/ (function(module, exports, __webpack_require__) {
-"use strict";
-/* WEBPACK VAR INJECTION */(function(process) {/**
- * Copyright 2013-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.
- *
- */
+var root = __webpack_require__(2);
+/** Built-in value references. */
+var Symbol = root.Symbol;
+module.exports = Symbol;
-var _assign = __webpack_require__(4);
-var PooledClass = __webpack_require__(17);
+/***/ }),
+/* 22 */
+/***/ (function(module, exports) {
-var emptyFunction = __webpack_require__(8);
-var warning = __webpack_require__(2);
+/**
+ * Checks if `value` is classified as an `Array` object.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
+ * @example
+ *
+ * _.isArray([1, 2, 3]);
+ * // => true
+ *
+ * _.isArray(document.body.children);
+ * // => false
+ *
+ * _.isArray('abc');
+ * // => false
+ *
+ * _.isArray(_.noop);
+ * // => false
+ */
+var isArray = Array.isArray;
-var didWarnForAddedNewProperty = false;
-var isProxySupported = typeof Proxy === 'function';
+module.exports = isArray;
-var shouldBeReleasedProperties = ['dispatchConfig', '_targetInst', 'nativeEvent', 'isDefaultPrevented', 'isPropagationStopped', '_dispatchListeners', '_dispatchInstances'];
-/**
- * @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
-};
+/***/ }),
+/* 23 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+/* WEBPACK VAR INJECTION */(function(process) {
/**
- * 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`.
+ * Copyright (c) 2013-present, Facebook, Inc.
*
- * 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.
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
*
- * @param {object} dispatchConfig Configuration used to dispatch this event.
- * @param {*} targetInst Marker identifying the event target.
- * @param {object} nativeEvent Native browser event.
- * @param {DOMEventTarget} nativeEventTarget Target node.
+ * @typechecks
*/
-function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) {
- if (process.env.NODE_ENV !== 'production') {
- // these have a getter/setter for warnings
- delete this.nativeEvent;
- delete this.preventDefault;
- delete this.stopPropagation;
- }
-
- this.dispatchConfig = dispatchConfig;
- this._targetInst = targetInst;
- this.nativeEvent = nativeEvent;
- var Interface = this.constructor.Interface;
- for (var propName in Interface) {
- if (!Interface.hasOwnProperty(propName)) {
- continue;
- }
- if (process.env.NODE_ENV !== 'production') {
- delete this[propName]; // this has a getter/setter for warnings
- }
- 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;
- return this;
-}
-
-_assign(SyntheticEvent.prototype, {
- preventDefault: function () {
- this.defaultPrevented = true;
- var event = this.nativeEvent;
- if (!event) {
- return;
- }
-
- if (event.preventDefault) {
- event.preventDefault();
- // eslint-disable-next-line valid-typeof
- } else if (typeof event.returnValue !== 'unknown') {
- event.returnValue = false;
- }
- this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
- },
-
- stopPropagation: function () {
- var event = this.nativeEvent;
- if (!event) {
- return;
- }
-
- if (event.stopPropagation) {
- event.stopPropagation();
- // eslint-disable-next-line valid-typeof
- } else if (typeof event.cancelBubble !== 'unknown') {
- // The ChangeEventPlugin registers a "propertychange" event for
- // IE. This event does not support bubbling or cancelling, and
- // any references to cancelBubble throw "Member not found". A
- // typeof check of "unknown" circumvents this issue (and is also
- // IE specific).
- event.cancelBubble = true;
- }
-
- this.isPropagationStopped = emptyFunction.thatReturnsTrue;
- },
+var emptyFunction = __webpack_require__(3);
+/**
+ * Upstream version of event listener. Does not take into account specific
+ * nature of platform.
+ */
+var EventListener = {
/**
- * 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.
+ * 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.
*/
- persist: function () {
- this.isPersistent = emptyFunction.thatReturnsTrue;
+ listen: function listen(target, eventType, callback) {
+ if (target.addEventListener) {
+ target.addEventListener(eventType, callback, false);
+ return {
+ remove: function remove() {
+ target.removeEventListener(eventType, callback, false);
+ }
+ };
+ } else if (target.attachEvent) {
+ target.attachEvent('on' + eventType, callback);
+ return {
+ remove: function remove() {
+ target.detachEvent('on' + eventType, callback);
+ }
+ };
+ }
},
/**
- * Checks if this event should be released back into the pool.
+ * Listen to DOM events during the capture phase.
*
- * @return {boolean} True if this should not be released, false otherwise.
- */
- isPersistent: emptyFunction.thatReturnsFalse,
-
- /**
- * `PooledClass` looks for `destructor` on each instance it releases.
+ * @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.
*/
- destructor: function () {
- var Interface = this.constructor.Interface;
- for (var propName in Interface) {
+ capture: function capture(target, eventType, callback) {
+ if (target.addEventListener) {
+ target.addEventListener(eventType, callback, true);
+ return {
+ remove: function remove() {
+ target.removeEventListener(eventType, callback, true);
+ }
+ };
+ } else {
if (process.env.NODE_ENV !== 'production') {
- Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName]));
- } else {
- this[propName] = null;
+ 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
+ };
}
- for (var i = 0; i < shouldBeReleasedProperties.length; i++) {
- this[shouldBeReleasedProperties[i]] = null;
- }
- if (process.env.NODE_ENV !== 'production') {
- Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null));
- Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', emptyFunction));
- Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', emptyFunction));
- }
- }
-});
+ },
-SyntheticEvent.Interface = EventInterface;
+ registerDefault: function registerDefault() {}
+};
-if (process.env.NODE_ENV !== 'production') {
- if (isProxySupported) {
- /*eslint-disable no-func-assign */
- SyntheticEvent = new Proxy(SyntheticEvent, {
- construct: function (target, args) {
- return this.apply(target, Object.create(target.prototype), args);
- },
- apply: function (constructor, that, args) {
- return new Proxy(constructor.apply(that, args), {
- set: function (target, prop, value) {
- if (prop !== 'isPersistent' && !target.constructor.Interface.hasOwnProperty(prop) && shouldBeReleasedProperties.indexOf(prop) === -1) {
- process.env.NODE_ENV !== 'production' ? warning(didWarnForAddedNewProperty || target.isPersistent(), "This synthetic event is reused for performance reasons. If you're " + "seeing this, you're adding a new property in the synthetic event object. " + 'The property is never released. See ' + 'https://fb.me/react-event-pooling for more information.') : void 0;
- didWarnForAddedNewProperty = true;
- }
- target[prop] = value;
- return true;
- }
- });
- }
- });
- /*eslint-enable no-func-assign */
- }
-}
+module.exports = EventListener;
+/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
+
+/***/ }),
+/* 24 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
/**
- * Helper to reduce boilerplate when creating subclasses.
+ * Copyright (c) 2013-present, Facebook, Inc.
*
- * @param {function} Class
- * @param {?object} Interface
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ * @typechecks
+ *
*/
-SyntheticEvent.augmentClass = function (Class, Interface) {
- var Super = this;
- var E = function () {};
- E.prototype = Super.prototype;
- var prototype = new E();
-
- _assign(prototype, Class.prototype);
- Class.prototype = prototype;
- Class.prototype.constructor = Class;
-
- Class.Interface = _assign({}, Super.Interface, Interface);
- Class.augmentClass = Super.augmentClass;
+/*eslint-disable no-self-compare */
- PooledClass.addPoolingTo(Class, PooledClass.fourArgumentPooler);
-};
-PooledClass.addPoolingTo(SyntheticEvent, PooledClass.fourArgumentPooler);
-module.exports = SyntheticEvent;
+var hasOwnProperty = Object.prototype.hasOwnProperty;
/**
- * Helper to nullify syntheticEvent instance properties when destructing
- *
- * @param {object} SyntheticEvent
- * @param {String} propName
- * @return {object} defineProperty object
- */
-function getPooledWarningPropertyDefinition(propName, getVal) {
- var isFunction = typeof getVal === 'function';
- return {
- configurable: true,
- set: set,
- get: get
- };
-
- function set(val) {
- var action = isFunction ? 'setting the method' : 'setting the property';
- warn(action, 'This is effectively a no-op');
- return val;
+ * inlined Object.is polyfill to avoid requiring consumers ship their own
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
+ */
+function is(x, y) {
+ // SameValue algorithm
+ if (x === y) {
+ // Steps 1-5, 7-10
+ // Steps 6.b-6.e: +0 != -0
+ // Added the nonzero y check to make Flow happy, but it is redundant
+ return x !== 0 || y !== 0 || 1 / x === 1 / y;
+ } else {
+ // Step 6.a: NaN == NaN
+ return x !== x && y !== y;
}
+}
- function get() {
- var action = isFunction ? 'accessing the method' : 'accessing the property';
- var result = isFunction ? 'This is a no-op function' : 'This is set to null';
- warn(action, result);
- return getVal;
+/**
+ * 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 (is(objA, objB)) {
+ return true;
}
- function warn(action, result) {
- var warningCondition = false;
- process.env.NODE_ENV !== 'production' ? warning(warningCondition, "This synthetic event is reused for performance reasons. If you're seeing this, " + "you're %s `%s` on a released/nullified synthetic event. %s. " + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result) : void 0;
+ if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
+ return false;
}
-}
-/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
-
-/***/ }),
-/* 14 */
-/***/ (function(module, exports, __webpack_require__) {
-var freeGlobal = __webpack_require__(100);
+ var keysA = Object.keys(objA);
+ var keysB = Object.keys(objB);
-/** Detect free variable `self`. */
-var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
+ if (keysA.length !== keysB.length) {
+ return false;
+ }
-/** Used as a reference to the global object. */
-var root = freeGlobal || freeSelf || Function('return this')();
+ // Test for A's keys different from B.
+ for (var i = 0; i < keysA.length; i++) {
+ if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
+ return false;
+ }
+ }
-module.exports = root;
+ return true;
+}
+module.exports = shallowEqual;
/***/ }),
-/* 15 */
+/* 25 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-/* WEBPACK VAR INJECTION */(function(process) {/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
+
+
+/**
+ * Copyright (c) 2013-present, Facebook, Inc.
*
- * 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.
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
*
+ *
*/
+var isTextNode = __webpack_require__(46);
+/*eslint-disable no-bitwise */
-var _prodInvariant = __webpack_require__(3);
-
-var invariant = __webpack_require__(1);
-
-function checkMask(value, bitmask) {
- return (value & bitmask) === bitmask;
+/**
+ * Checks if a given DOM node contains or is another DOM node.
+ */
+function containsNode(outerNode, innerNode) {
+ if (!outerNode || !innerNode) {
+ return false;
+ } else if (outerNode === innerNode) {
+ return true;
+ } else if (isTextNode(outerNode)) {
+ return false;
+ } else if (isTextNode(innerNode)) {
+ return containsNode(outerNode, innerNode.parentNode);
+ } else if ('contains' in outerNode) {
+ return outerNode.contains(innerNode);
+ } else if (outerNode.compareDocumentPosition) {
+ return !!(outerNode.compareDocumentPosition(innerNode) & 16);
+ } else {
+ return false;
+ }
}
-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_PROPERTY: 0x1,
- HAS_BOOLEAN_VALUE: 0x4,
- HAS_NUMERIC_VALUE: 0x8,
- HAS_POSITIVE_NUMERIC_VALUE: 0x10 | 0x8,
- HAS_OVERLOADED_BOOLEAN_VALUE: 0x20,
-
- /**
- * 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) : _prodInvariant('48', propName) : void 0;
-
- var lowerCased = propName.toLowerCase();
- var propConfig = Properties[propName];
-
- var propertyInfo = {
- attributeName: lowerCased,
- attributeNamespace: null,
- propertyName: propName,
- mutationMethod: null,
-
- mustUseProperty: checkMask(propConfig, Injection.MUST_USE_PROPERTY),
- 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.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) : _prodInvariant('50', propName) : void 0;
-
- 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;
- }
- }
-};
+module.exports = containsNode;
-/* eslint-disable max-len */
-var ATTRIBUTE_NAME_START_CHAR = ':A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD';
-/* eslint-enable max-len */
+/***/ }),
+/* 26 */
+/***/ (function(module, exports, __webpack_require__) {
+"use strict";
/**
- * DOMProperty exports lookup objects that can be used like functions:
- *
- * > DOMProperty.isValid['id']
- * true
- * > DOMProperty.isValid['foobar']
- * undefined
+ * Copyright (c) 2013-present, Facebook, Inc.
*
- * Although this may be confusing, it performs better in general.
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
*
- * @see http://jsperf.com/key-exists
- * @see http://jsperf.com/key-missing
*/
-var DOMProperty = {
- ID_ATTRIBUTE_NAME: 'data-reactid',
- ROOT_ATTRIBUTE_NAME: 'data-reactroot',
-
- ATTRIBUTE_NAME_START_CHAR: ATTRIBUTE_NAME_START_CHAR,
- ATTRIBUTE_NAME_CHAR: ATTRIBUTE_NAME_START_CHAR + '\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040',
-
- /**
- * 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.
- * mustUseProperty:
- * Whether the property must be accessed and mutated as an object property.
- * 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__.
- *
- * autofocus is predefined, because adding it to the property whitelist
- * causes unintended side effects.
- *
- * @type {Object}
- */
- getPossibleStandardName: process.env.NODE_ENV !== 'production' ? { autofocus: 'autoFocus' } : 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;
- },
+/**
+ * @param {DOMElement} node input/textarea to focus
+ */
- injection: DOMPropertyInjection
-};
+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 = DOMProperty;
-/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
+module.exports = focusNode;
/***/ }),
-/* 16 */
+/* 27 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-/* WEBPACK VAR INJECTION */(function(process) {/**
- * Copyright 2014-present, Facebook, Inc.
- * All rights reserved.
+
+
+/**
+ * Copyright (c) 2013-present, Facebook, Inc.
*
- * 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.
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
*
+ * @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.
+ *
+ * @param {?DOMDocument} doc Defaults to current document.
+ * @return {?DOMElement}
+ */
+function getActiveElement(doc) /*?DOMElement*/{
+ doc = doc || (typeof document !== 'undefined' ? document : undefined);
+ if (typeof doc === 'undefined') {
+ return null;
+ }
+ try {
+ return doc.activeElement || doc.body;
+ } catch (e) {
+ return doc.body;
+ }
+}
-var _assign = __webpack_require__(4);
+module.exports = getActiveElement;
-var ReactCurrentOwner = __webpack_require__(10);
+/***/ }),
+/* 28 */
+/***/ (function(module, exports, __webpack_require__) {
-var warning = __webpack_require__(2);
-var canDefineProperty = __webpack_require__(28);
-var hasOwnProperty = Object.prototype.hasOwnProperty;
+var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
+ Copyright (c) 2016 Jed Watson.
+ Licensed under the MIT License (MIT), see
+ http://jedwatson.github.io/classnames
+*/
+/* global define */
-var REACT_ELEMENT_TYPE = __webpack_require__(67);
+(function () {
+ 'use strict';
-var RESERVED_PROPS = {
- key: true,
- ref: true,
- __self: true,
- __source: true
-};
+ var hasOwn = {}.hasOwnProperty;
-var specialPropKeyWarningShown, specialPropRefWarningShown;
+ function classNames () {
+ var classes = [];
-function hasValidRef(config) {
- if (process.env.NODE_ENV !== 'production') {
- if (hasOwnProperty.call(config, 'ref')) {
- var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
- if (getter && getter.isReactWarning) {
- return false;
- }
- }
- }
- return config.ref !== undefined;
-}
+ for (var i = 0; i < arguments.length; i++) {
+ var arg = arguments[i];
+ if (!arg) continue;
-function hasValidKey(config) {
- if (process.env.NODE_ENV !== 'production') {
- if (hasOwnProperty.call(config, 'key')) {
- var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
- if (getter && getter.isReactWarning) {
- return false;
- }
- }
- }
- return config.key !== undefined;
-}
+ var argType = typeof arg;
-function defineKeyPropWarningGetter(props, displayName) {
- var warnAboutAccessingKey = function () {
- if (!specialPropKeyWarningShown) {
- specialPropKeyWarningShown = true;
- process.env.NODE_ENV !== 'production' ? warning(false, '%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName) : void 0;
- }
- };
- warnAboutAccessingKey.isReactWarning = true;
- Object.defineProperty(props, 'key', {
- get: warnAboutAccessingKey,
- configurable: true
- });
-}
+ if (argType === 'string' || argType === 'number') {
+ classes.push(arg);
+ } else if (Array.isArray(arg)) {
+ classes.push(classNames.apply(null, arg));
+ } else if (argType === 'object') {
+ for (var key in arg) {
+ if (hasOwn.call(arg, key) && arg[key]) {
+ classes.push(key);
+ }
+ }
+ }
+ }
-function defineRefPropWarningGetter(props, displayName) {
- var warnAboutAccessingRef = function () {
- if (!specialPropRefWarningShown) {
- specialPropRefWarningShown = true;
- process.env.NODE_ENV !== 'production' ? warning(false, '%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName) : void 0;
- }
- };
- warnAboutAccessingRef.isReactWarning = true;
- Object.defineProperty(props, 'ref', {
- get: warnAboutAccessingRef,
- configurable: true
- });
-}
+ return classes.join(' ');
+ }
+
+ if (typeof module !== 'undefined' && module.exports) {
+ module.exports = classNames;
+ } else if (true) {
+ // register as 'classnames', consistent with npm package name
+ !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function () {
+ return classNames;
+ }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
+ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
+ } else {
+ window.classNames = classNames;
+ }
+}());
+
+
+/***/ }),
+/* 29 */
+/***/ (function(module, exports) {
/**
- * Factory method to create a new React element. This no longer adheres to
- * the class pattern, so do not use new to call it. Also, no instanceof check
- * will work. Instead test $$typeof field against Symbol.for('react.element') to check
- * if something is a React Element.
+ * Performs a
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
+ * comparison between two values to determine if they are equivalent.
*
- * @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
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
+ * @example
+ *
+ * var object = { 'a': 1 };
+ * var other = { 'a': 1 };
+ *
+ * _.eq(object, object);
+ * // => true
+ *
+ * _.eq(object, other);
+ * // => false
+ *
+ * _.eq('a', 'a');
+ * // => true
+ *
+ * _.eq('a', Object('a'));
+ * // => false
+ *
+ * _.eq(NaN, NaN);
+ * // => true
*/
-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,
+function eq(value, other) {
+ return value === other || (value !== value && other !== other);
+}
- // Built-in properties that belong on the element
- type: type,
- key: key,
- ref: ref,
- props: props,
+module.exports = eq;
- // 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 = {};
+/***/ }),
+/* 30 */
+/***/ (function(module, exports, __webpack_require__) {
- // 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;
- }
- if (Object.freeze) {
- Object.freeze(element.props);
- Object.freeze(element);
- }
- }
+var baseGetTag = __webpack_require__(13),
+ isObject = __webpack_require__(32);
- return element;
-};
+/** `Object#toString` result references. */
+var asyncTag = '[object AsyncFunction]',
+ funcTag = '[object Function]',
+ genTag = '[object GeneratorFunction]',
+ proxyTag = '[object Proxy]';
/**
- * Create and return a new ReactElement of the given type.
- * See https://facebook.github.io/react/docs/top-level-api.html#react.createelement
+ * Checks if `value` is classified as a `Function` object.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
+ * @example
+ *
+ * _.isFunction(_);
+ * // => true
+ *
+ * _.isFunction(/abc/);
+ * // => false
*/
-ReactElement.createElement = function (type, config, children) {
- var propName;
+function isFunction(value) {
+ if (!isObject(value)) {
+ return false;
+ }
+ // The use of `Object#toString` avoids issues with the `typeof` operator
+ // in Safari 9 which returns 'object' for typed arrays and other constructors.
+ var tag = baseGetTag(value);
+ return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
+}
- // Reserved names are extracted
- var props = {};
+module.exports = isFunction;
- var key = null;
- var ref = null;
- var self = null;
- var source = null;
- if (config != null) {
- if (hasValidRef(config)) {
- ref = config.ref;
- }
- if (hasValidKey(config)) {
- key = '' + config.key;
- }
+/***/ }),
+/* 31 */
+/***/ (function(module, exports, __webpack_require__) {
- 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 (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
- props[propName] = config[propName];
- }
- }
- }
+/* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */
+var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
- // 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];
- }
- if (process.env.NODE_ENV !== 'production') {
- if (Object.freeze) {
- Object.freeze(childArray);
- }
- }
- props.children = childArray;
- }
+module.exports = freeGlobal;
- // Resolve default props
- if (type && type.defaultProps) {
- var defaultProps = type.defaultProps;
- for (propName in defaultProps) {
- if (props[propName] === undefined) {
- props[propName] = defaultProps[propName];
- }
- }
- }
- if (process.env.NODE_ENV !== 'production') {
- if (key || ref) {
- if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {
- var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
- if (key) {
- defineKeyPropWarningGetter(props, displayName);
- }
- if (ref) {
- defineRefPropWarningGetter(props, displayName);
- }
- }
- }
- }
- return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
-};
-
-/**
- * Return a function that produces ReactElements of a given type.
- * See https://facebook.github.io/react/docs/top-level-api.html#react.createfactory
- */
-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. `.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;
-};
-
-/**
- * Clone and return a new ReactElement using element as the starting point.
- * See https://facebook.github.io/react/docs/top-level-api.html#react.cloneelement
- */
-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 (hasValidRef(config)) {
- // Silently steal the ref from the parent.
- ref = config.ref;
- owner = ReactCurrentOwner.current;
- }
- if (hasValidKey(config)) {
- key = '' + config.key;
- }
-
- // Remaining properties override existing props
- var defaultProps;
- if (element.type && element.type.defaultProps) {
- defaultProps = element.type.defaultProps;
- }
- for (propName in config) {
- if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
- if (config[propName] === undefined && defaultProps !== undefined) {
- // Resolve default props
- props[propName] = defaultProps[propName];
- } else {
- 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);
-};
-
-/**
- * Verifies the object is a ReactElement.
- * See https://facebook.github.io/react/docs/top-level-api.html#react.isvalidelement
- * @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__(0)))
+/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(73)))
/***/ }),
-/* 17 */
-/***/ (function(module, exports, __webpack_require__) {
+/* 32 */
+/***/ (function(module, exports) {
-"use strict";
-/* WEBPACK VAR INJECTION */(function(process) {/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
+/**
+ * Checks if `value` is the
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
- * 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.
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
+ * @example
*
- *
- */
-
-
-
-var _prodInvariant = __webpack_require__(3);
-
-var invariant = __webpack_require__(1);
-
-/**
- * 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.
+ * _.isObject({});
+ * // => true
+ *
+ * _.isObject([1, 2, 3]);
+ * // => true
+ *
+ * _.isObject(_.noop);
+ * // => true
+ *
+ * _.isObject(null);
+ * // => false
*/
-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);
- }
-};
+function isObject(value) {
+ var type = typeof value;
+ return value != null && (type == 'object' || type == 'function');
+}
-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);
- }
-};
+module.exports = isObject;
-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);
- }
-};
+/***/ }),
+/* 33 */
+/***/ (function(module, exports) {
-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.') : _prodInvariant('25') : void 0;
- instance.destructor();
- if (Klass.instancePool.length < Klass.poolSize) {
- Klass.instancePool.push(instance);
- }
-};
+/** Used for built-in method references. */
+var funcProto = Function.prototype;
-var DEFAULT_POOL_SIZE = 10;
-var DEFAULT_POOLER = oneArgumentPooler;
+/** Used to resolve the decompiled source of functions. */
+var funcToString = funcProto.toString;
/**
- * 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.
+ * Converts `func` to its source code.
*
- * @param {Function} CopyConstructor Constructor that can be used to reset.
- * @param {Function} pooler Customizable pooler.
+ * @private
+ * @param {Function} func The function to convert.
+ * @returns {string} Returns the source code.
*/
-var addPoolingTo = function (CopyConstructor, pooler) {
- // Casting as any so that flow ignores the actual implementation and trusts
- // it to match the type we declared
- var NewKlass = CopyConstructor;
- NewKlass.instancePool = [];
- NewKlass.getPooled = pooler || DEFAULT_POOLER;
- if (!NewKlass.poolSize) {
- NewKlass.poolSize = DEFAULT_POOL_SIZE;
+function toSource(func) {
+ if (func != null) {
+ try {
+ return funcToString.call(func);
+ } catch (e) {}
+ try {
+ return (func + '');
+ } catch (e) {}
}
- NewKlass.release = standardReleaser;
- return NewKlass;
-};
+ return '';
+}
-var PooledClass = {
- addPoolingTo: addPoolingTo,
- oneArgumentPooler: oneArgumentPooler,
- twoArgumentPooler: twoArgumentPooler,
- threeArgumentPooler: threeArgumentPooler,
- fourArgumentPooler: fourArgumentPooler
-};
+module.exports = toSource;
-module.exports = PooledClass;
-/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
/***/ }),
-/* 18 */
+/* 34 */
/***/ (function(module, exports, __webpack_require__) {
-"use strict";
-/* WEBPACK VAR INJECTION */(function(process) {/**
- * Copyright 2013-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.
+var mapCacheClear = __webpack_require__(79),
+ mapCacheDelete = __webpack_require__(86),
+ mapCacheGet = __webpack_require__(88),
+ mapCacheHas = __webpack_require__(89),
+ mapCacheSet = __webpack_require__(90);
+
+/**
+ * Creates a map cache object to store key-value pairs.
*
+ * @private
+ * @constructor
+ * @param {Array} [entries] The key-value pairs to cache.
*/
+function MapCache(entries) {
+ var index = -1,
+ length = entries == null ? 0 : entries.length;
+ this.clear();
+ while (++index < length) {
+ var entry = entries[index];
+ this.set(entry[0], entry[1]);
+ }
+}
+// Add methods to `MapCache`.
+MapCache.prototype.clear = mapCacheClear;
+MapCache.prototype['delete'] = mapCacheDelete;
+MapCache.prototype.get = mapCacheGet;
+MapCache.prototype.has = mapCacheHas;
+MapCache.prototype.set = mapCacheSet;
-var _assign = __webpack_require__(4);
-
-var ReactBaseClasses = __webpack_require__(65);
-var ReactChildren = __webpack_require__(112);
-var ReactDOMFactories = __webpack_require__(116);
-var ReactElement = __webpack_require__(16);
-var ReactPropTypes = __webpack_require__(120);
-var ReactVersion = __webpack_require__(122);
+module.exports = MapCache;
-var createReactClass = __webpack_require__(123);
-var onlyChild = __webpack_require__(125);
-var createElement = ReactElement.createElement;
-var createFactory = ReactElement.createFactory;
-var cloneElement = ReactElement.cloneElement;
+/***/ }),
+/* 35 */
+/***/ (function(module, exports, __webpack_require__) {
-if (process.env.NODE_ENV !== 'production') {
- var lowPriorityWarning = __webpack_require__(43);
- var canDefineProperty = __webpack_require__(28);
- var ReactElementValidator = __webpack_require__(69);
- var didWarnPropTypesDeprecated = false;
- createElement = ReactElementValidator.createElement;
- createFactory = ReactElementValidator.createFactory;
- cloneElement = ReactElementValidator.cloneElement;
-}
+var SetCache = __webpack_require__(91),
+ arraySome = __webpack_require__(94),
+ cacheHas = __webpack_require__(95);
-var __spread = _assign;
-var createMixin = function (mixin) {
- return mixin;
-};
+/** Used to compose bitmasks for value comparisons. */
+var COMPARE_PARTIAL_FLAG = 1,
+ COMPARE_UNORDERED_FLAG = 2;
-if (process.env.NODE_ENV !== 'production') {
- var warnedForSpread = false;
- var warnedForCreateMixin = false;
- __spread = function () {
- lowPriorityWarning(warnedForSpread, 'React.__spread is deprecated and should not be used. Use ' + 'Object.assign directly or another helper function with similar ' + 'semantics. You may be seeing this warning due to your compiler. ' + 'See https://fb.me/react-spread-deprecation for more details.');
- warnedForSpread = true;
- return _assign.apply(null, arguments);
- };
+/**
+ * A specialized version of `baseIsEqualDeep` for arrays with support for
+ * partial deep comparisons.
+ *
+ * @private
+ * @param {Array} array The array to compare.
+ * @param {Array} other The other array to compare.
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
+ * @param {Function} customizer The function to customize comparisons.
+ * @param {Function} equalFunc The function to determine equivalents of values.
+ * @param {Object} stack Tracks traversed `array` and `other` objects.
+ * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
+ */
+function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
+ arrLength = array.length,
+ othLength = other.length;
- createMixin = function (mixin) {
- lowPriorityWarning(warnedForCreateMixin, 'React.createMixin is deprecated and should not be used. ' + 'In React v16.0, it will be removed. ' + 'You can use this mixin directly instead. ' + 'See https://fb.me/createmixin-was-never-implemented for more info.');
- warnedForCreateMixin = true;
- return mixin;
- };
-}
+ if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
+ return false;
+ }
+ // Assume cyclic values are equal.
+ var stacked = stack.get(array);
+ if (stacked && stack.get(other)) {
+ return stacked == other;
+ }
+ var index = -1,
+ result = true,
+ seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
-var React = {
- // Modern
+ stack.set(array, other);
+ stack.set(other, array);
- Children: {
- map: ReactChildren.map,
- forEach: ReactChildren.forEach,
- count: ReactChildren.count,
- toArray: ReactChildren.toArray,
- only: onlyChild
- },
+ // Ignore non-index properties.
+ while (++index < arrLength) {
+ var arrValue = array[index],
+ othValue = other[index];
- Component: ReactBaseClasses.Component,
- PureComponent: ReactBaseClasses.PureComponent,
-
- createElement: createElement,
- cloneElement: cloneElement,
- isValidElement: ReactElement.isValidElement,
-
- // Classic
+ if (customizer) {
+ var compared = isPartial
+ ? customizer(othValue, arrValue, index, other, array, stack)
+ : customizer(arrValue, othValue, index, array, other, stack);
+ }
+ if (compared !== undefined) {
+ if (compared) {
+ continue;
+ }
+ result = false;
+ break;
+ }
+ // Recursively compare arrays (susceptible to call stack limits).
+ if (seen) {
+ if (!arraySome(other, function(othValue, othIndex) {
+ if (!cacheHas(seen, othIndex) &&
+ (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
+ return seen.push(othIndex);
+ }
+ })) {
+ result = false;
+ break;
+ }
+ } else if (!(
+ arrValue === othValue ||
+ equalFunc(arrValue, othValue, bitmask, customizer, stack)
+ )) {
+ result = false;
+ break;
+ }
+ }
+ stack['delete'](array);
+ stack['delete'](other);
+ return result;
+}
- PropTypes: ReactPropTypes,
- createClass: createReactClass,
- createFactory: createFactory,
- createMixin: createMixin,
+module.exports = equalArrays;
- // This looks DOM specific but these are actually isomorphic helpers
- // since they are just generating DOM strings.
- DOM: ReactDOMFactories,
- version: ReactVersion,
+/***/ }),
+/* 36 */
+/***/ (function(module, exports, __webpack_require__) {
- // Deprecated hook for JSX spread, don't use this for anything.
- __spread: __spread
-};
+/* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(2),
+ stubFalse = __webpack_require__(112);
-if (process.env.NODE_ENV !== 'production') {
- var warnedForCreateClass = false;
- if (canDefineProperty) {
- Object.defineProperty(React, 'PropTypes', {
- get: function () {
- lowPriorityWarning(didWarnPropTypesDeprecated, 'Accessing PropTypes via the main React package is deprecated,' + ' and will be removed in React v16.0.' + ' Use the latest available v15.* prop-types package from npm instead.' + ' For info on usage, compatibility, migration and more, see ' + 'https://fb.me/prop-types-docs');
- didWarnPropTypesDeprecated = true;
- return ReactPropTypes;
- }
- });
+/** Detect free variable `exports`. */
+var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
- Object.defineProperty(React, 'createClass', {
- get: function () {
- lowPriorityWarning(warnedForCreateClass, 'Accessing createClass via the main React package is deprecated,' + ' and will be removed in React v16.0.' + " Use a plain JavaScript class instead. If you're not yet " + 'ready to migrate, create-react-class v15.* is available ' + 'on npm as a temporary, drop-in replacement. ' + 'For more info see https://fb.me/react-create-class');
- warnedForCreateClass = true;
- return createReactClass;
- }
- });
- }
+/** Detect free variable `module`. */
+var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
- // React.DOM factories are deprecated. Wrap these methods so that
- // invocations of the React.DOM namespace and alert users to switch
- // to the `react-dom-factories` package.
- React.DOM = {};
- var warnedForFactories = false;
- Object.keys(ReactDOMFactories).forEach(function (factory) {
- React.DOM[factory] = function () {
- if (!warnedForFactories) {
- lowPriorityWarning(false, 'Accessing factories like React.DOM.%s has been deprecated ' + 'and will be removed in v16.0+. Use the ' + 'react-dom-factories package instead. ' + ' Version 1.0 provides a drop-in replacement.' + ' For more info, see https://fb.me/react-dom-factories', factory);
- warnedForFactories = true;
- }
- return ReactDOMFactories[factory].apply(ReactDOMFactories, arguments);
- };
- });
-}
+/** Detect the popular CommonJS extension `module.exports`. */
+var moduleExports = freeModule && freeModule.exports === freeExports;
-module.exports = React;
-/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
+/** Built-in value references. */
+var Buffer = moduleExports ? root.Buffer : undefined;
-/***/ }),
-/* 19 */
-/***/ (function(module, exports, __webpack_require__) {
+/* Built-in method references for those with the same name as other `lodash` methods. */
+var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
-"use strict";
/**
- * Copyright (c) 2013-present, Facebook, Inc.
- * All rights reserved.
+ * Checks if `value` is a buffer.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.3.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
+ * @example
*
- * 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.
+ * _.isBuffer(new Buffer(2));
+ * // => true
*
- *
- */
-
-
-/**
- * WARNING: DO NOT manually require this module.
- * This is a replacement for `invariant(...)` used by the error code system
- * and will _only_ be required by the corresponding babel pass.
- * It always throws.
+ * _.isBuffer(new Uint8Array(2));
+ * // => false
*/
+var isBuffer = nativeIsBuffer || stubFalse;
-function reactProdInvariant(code) {
- var argCount = arguments.length - 1;
-
- var message = 'Minified React error #' + code + '; visit ' + 'http://facebook.github.io/react/docs/error-decoder.html?invariant=' + code;
-
- for (var argIdx = 0; argIdx < argCount; argIdx++) {
- message += '&args[]=' + encodeURIComponent(arguments[argIdx + 1]);
- }
+module.exports = isBuffer;
- message += ' for the full message or use the non-minified dev environment' + ' for full errors and additional helpful warnings.';
+/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(37)(module)))
- var error = new Error(message);
- error.name = 'Invariant Violation';
- error.framesToPop = 1; // we don't care about reactProdInvariant's own frame
+/***/ }),
+/* 37 */
+/***/ (function(module, exports) {
- throw error;
-}
+module.exports = function(module) {
+ if(!module.webpackPolyfill) {
+ module.deprecate = function() {};
+ module.paths = [];
+ // module.parent = undefined by default
+ if(!module.children) module.children = [];
+ Object.defineProperty(module, "loaded", {
+ enumerable: true,
+ get: function() {
+ return module.l;
+ }
+ });
+ Object.defineProperty(module, "id", {
+ enumerable: true,
+ get: function() {
+ return module.i;
+ }
+ });
+ module.webpackPolyfill = 1;
+ }
+ return module;
+};
-module.exports = reactProdInvariant;
/***/ }),
-/* 20 */
+/* 38 */
/***/ (function(module, exports, __webpack_require__) {
-"use strict";
-/* WEBPACK VAR INJECTION */(function(process) {/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
+var baseIsTypedArray = __webpack_require__(114),
+ baseUnary = __webpack_require__(115),
+ nodeUtil = __webpack_require__(116);
+
+/* Node.js helper references. */
+var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
+
+/**
+ * Checks if `value` is classified as a typed array.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
+ * @example
*
- * 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.
+ * _.isTypedArray(new Uint8Array);
+ * // => true
*
+ * _.isTypedArray([]);
+ * // => false
*/
+var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
+module.exports = isTypedArray;
-var ReactRef = __webpack_require__(135);
-var ReactInstrumentation = __webpack_require__(9);
+/***/ }),
+/* 39 */
+/***/ (function(module, exports) {
-var warning = __webpack_require__(2);
+/** Used as references for various `Number` constants. */
+var MAX_SAFE_INTEGER = 9007199254740991;
/**
- * Helper to call ReactRef.attachRefs with this composite component, split out
- * to avoid allocations in the transaction mount-ready queue.
+ * Checks if `value` is a valid array-like length.
+ *
+ * **Note:** This method is loosely based on
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
+ * @example
+ *
+ * _.isLength(3);
+ * // => true
+ *
+ * _.isLength(Number.MIN_VALUE);
+ * // => false
+ *
+ * _.isLength(Infinity);
+ * // => false
+ *
+ * _.isLength('3');
+ * // => false
*/
-function attachRefs() {
- ReactRef.attachRefs(this, this._currentElement);
+function isLength(value) {
+ return typeof value == 'number' &&
+ value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
}
-var ReactReconciler = {
- /**
- * Initializes the component, renders markup, and registers event listeners.
- *
- * @param {ReactComponent} internalInstance
- * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
- * @param {?object} the containing host component instance
- * @param {?object} info about the host container
- * @return {?string} Rendered markup to be inserted into the DOM.
- * @final
- * @internal
- */
- mountComponent: function (internalInstance, transaction, hostParent, hostContainerInfo, context, parentDebugID) // 0 in production and for roots
- {
- if (process.env.NODE_ENV !== 'production') {
- if (internalInstance._debugID !== 0) {
- ReactInstrumentation.debugTool.onBeforeMountComponent(internalInstance._debugID, internalInstance._currentElement, parentDebugID);
- }
- }
- var markup = internalInstance.mountComponent(transaction, hostParent, hostContainerInfo, context, parentDebugID);
- if (internalInstance._currentElement && internalInstance._currentElement.ref != null) {
- transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
- }
- if (process.env.NODE_ENV !== 'production') {
- if (internalInstance._debugID !== 0) {
- ReactInstrumentation.debugTool.onMountComponent(internalInstance._debugID);
- }
- }
- return markup;
- },
+module.exports = isLength;
- /**
- * Returns a value that can be passed to
- * ReactComponentEnvironment.replaceNodeWithMarkup.
- */
- getHostNode: function (internalInstance) {
- return internalInstance.getHostNode();
- },
- /**
- * Releases any resources allocated by `mountComponent`.
- *
- * @final
- * @internal
- */
- unmountComponent: function (internalInstance, safely) {
- if (process.env.NODE_ENV !== 'production') {
- if (internalInstance._debugID !== 0) {
- ReactInstrumentation.debugTool.onBeforeUnmountComponent(internalInstance._debugID);
- }
- }
- ReactRef.detachRefs(internalInstance, internalInstance._currentElement);
- internalInstance.unmountComponent(safely);
- if (process.env.NODE_ENV !== 'production') {
- if (internalInstance._debugID !== 0) {
- ReactInstrumentation.debugTool.onUnmountComponent(internalInstance._debugID);
- }
- }
- },
+/***/ }),
+/* 40 */
+/***/ (function(module, exports, __webpack_require__) {
- /**
- * 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;
- }
+"use strict";
- if (process.env.NODE_ENV !== 'production') {
- if (internalInstance._debugID !== 0) {
- ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, nextElement);
- }
- }
- var refsChanged = ReactRef.shouldUpdateRefs(prevElement, nextElement);
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
- if (refsChanged) {
- ReactRef.detachRefs(internalInstance, prevElement);
- }
+var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
- internalInstance.receiveComponent(nextElement, transaction, context);
+var _propTypes = __webpack_require__(10);
- if (refsChanged && internalInstance._currentElement && internalInstance._currentElement.ref != null) {
- transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
- }
+var _propTypes2 = _interopRequireDefault(_propTypes);
- if (process.env.NODE_ENV !== 'production') {
- if (internalInstance._debugID !== 0) {
- ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID);
- }
- }
- },
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- /**
- * Flush any dirty changes in a component.
- *
- * @param {ReactComponent} internalInstance
- * @param {ReactReconcileTransaction} transaction
- * @internal
- */
- performUpdateIfNecessary: function (internalInstance, transaction, updateBatchNumber) {
- if (internalInstance._updateBatchNumber !== updateBatchNumber) {
- // The component's enqueued batch number should always be the current
- // batch or the following one.
- process.env.NODE_ENV !== 'production' ? warning(internalInstance._updateBatchNumber == null || internalInstance._updateBatchNumber === updateBatchNumber + 1, 'performUpdateIfNecessary: Unexpected batch number (current %s, ' + 'pending %s)', updateBatchNumber, internalInstance._updateBatchNumber) : void 0;
- return;
- }
- if (process.env.NODE_ENV !== 'production') {
- if (internalInstance._debugID !== 0) {
- ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, internalInstance._currentElement);
- }
- }
- internalInstance.performUpdateIfNecessary(transaction);
- if (process.env.NODE_ENV !== 'production') {
- if (internalInstance._debugID !== 0) {
- ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID);
- }
- }
- }
+var nodeShape = {
+ label: _propTypes2.default.node.isRequired,
+ value: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]).isRequired,
+
+ icon: _propTypes2.default.node
};
-module.exports = ReactReconciler;
-/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
+var nodeShapeWithChildren = _propTypes2.default.oneOfType([_propTypes2.default.shape(nodeShape), _propTypes2.default.shape(_extends({}, nodeShape, {
+ children: _propTypes2.default.arrayOf(nodeShape).isRequired
+}))]);
+
+exports.default = nodeShapeWithChildren;
/***/ }),
-/* 21 */
+/* 41 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-/**
- * Copyright 2015-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.
- *
- */
+var _react = __webpack_require__(0);
-var DOMNamespaces = __webpack_require__(51);
-var setInnerHTML = __webpack_require__(33);
+var _react2 = _interopRequireDefault(_react);
-var createMicrosoftUnsafeLocalFunction = __webpack_require__(52);
-var setTextContent = __webpack_require__(81);
+var _reactDom = __webpack_require__(44);
-var ELEMENT_NODE_TYPE = 1;
-var DOCUMENT_FRAGMENT_NODE_TYPE = 11;
+var _reactDom2 = _interopRequireDefault(_reactDom);
-/**
- * In IE (8-11) and Edge, appending nodes with no children is dramatically
- * faster than appending a full subtree, so we essentially queue up the
- * .appendChild calls here and apply them so each node is added to its parent
- * before any children are added.
- *
- * In other browsers, doing so is slower or neutral compared to the other order
- * (in Firefox, twice as slow) so we only do this inversion in IE.
- *
- * See https://github.com/spicyj/innerhtml-vs-createelement-vs-clonenode.
- */
-var enableLazy = typeof document !== 'undefined' && typeof document.documentMode === 'number' || typeof navigator !== 'undefined' && typeof navigator.userAgent === 'string' && /\bEdge\/\d/.test(navigator.userAgent);
+var _BasicExample = __webpack_require__(57);
-function insertTreeChildren(tree) {
- if (!enableLazy) {
- return;
- }
- var node = tree.node;
- var children = tree.children;
- if (children.length) {
- for (var i = 0; i < children.length; i++) {
- insertTreeBefore(node, children[i], null);
- }
- } else if (tree.html != null) {
- setInnerHTML(node, tree.html);
- } else if (tree.text != null) {
- setTextContent(node, tree.text);
- }
-}
+var _BasicExample2 = _interopRequireDefault(_BasicExample);
-var insertTreeBefore = createMicrosoftUnsafeLocalFunction(function (parentNode, tree, referenceNode) {
- // DocumentFragments aren't actually part of the DOM after insertion so
- // appending children won't update the DOM. We need to ensure the fragment
- // is properly populated first, breaking out of our lazy approach for just
- // this level. Also, some