Created
March 8, 2017 21:52
-
-
Save ajkovar/bfc771f1b093ebc8811745134236953f to your computer and use it in GitHub Desktop.
This file has been truncated, but you can view the full file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/******/ (function(modules) { // webpackBootstrap | |
/******/ // The module cache | |
/******/ var installedModules = {}; | |
/******/ | |
/******/ // The require function | |
/******/ function __webpack_require__(moduleId) { | |
/******/ | |
/******/ // Check if module is in cache | |
/******/ if(installedModules[moduleId]) | |
/******/ return installedModules[moduleId].exports; | |
/******/ | |
/******/ // Create a new module (and put it into the cache) | |
/******/ var module = installedModules[moduleId] = { | |
/******/ i: moduleId, | |
/******/ l: false, | |
/******/ exports: {} | |
/******/ }; | |
/******/ | |
/******/ // Execute the module function | |
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); | |
/******/ | |
/******/ // Flag the module as loaded | |
/******/ module.l = true; | |
/******/ | |
/******/ // Return the exports of the module | |
/******/ return module.exports; | |
/******/ } | |
/******/ | |
/******/ | |
/******/ // expose the modules object (__webpack_modules__) | |
/******/ __webpack_require__.m = modules; | |
/******/ | |
/******/ // expose the module cache | |
/******/ __webpack_require__.c = installedModules; | |
/******/ | |
/******/ // identity function for calling harmony imports with the correct context | |
/******/ __webpack_require__.i = function(value) { return value; }; | |
/******/ | |
/******/ // define getter function for harmony exports | |
/******/ __webpack_require__.d = function(exports, name, getter) { | |
/******/ if(!__webpack_require__.o(exports, name)) { | |
/******/ Object.defineProperty(exports, name, { | |
/******/ configurable: false, | |
/******/ enumerable: true, | |
/******/ get: getter | |
/******/ }); | |
/******/ } | |
/******/ }; | |
/******/ | |
/******/ // getDefaultExport function for compatibility with non-harmony modules | |
/******/ __webpack_require__.n = function(module) { | |
/******/ var getter = module && module.__esModule ? | |
/******/ function getDefault() { return module['default']; } : | |
/******/ function getModuleExports() { return module; }; | |
/******/ __webpack_require__.d(getter, 'a', getter); | |
/******/ return getter; | |
/******/ }; | |
/******/ | |
/******/ // Object.prototype.hasOwnProperty.call | |
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; | |
/******/ | |
/******/ // __webpack_public_path__ | |
/******/ __webpack_require__.p = ""; | |
/******/ | |
/******/ // Load entry module and return exports | |
/******/ return __webpack_require__(__webpack_require__.s = 545); | |
/******/ }) | |
/************************************************************************/ | |
/******/ ([ | |
/* 0 */ | |
/***/ (function(module, exports) { | |
// shim for using process in browser | |
var process = module.exports = {}; | |
// cached from whatever global is present so that test runners that stub it | |
// don't break things. But we need to wrap it in a try catch in case it is | |
// wrapped in strict mode code which doesn't define any globals. It's inside a | |
// function because try/catches deoptimize in certain engines. | |
var cachedSetTimeout; | |
var cachedClearTimeout; | |
function defaultSetTimout() { | |
throw new Error('setTimeout has not been defined'); | |
} | |
function defaultClearTimeout () { | |
throw new Error('clearTimeout has not been defined'); | |
} | |
(function () { | |
try { | |
if (typeof setTimeout === 'function') { | |
cachedSetTimeout = setTimeout; | |
} else { | |
cachedSetTimeout = defaultSetTimout; | |
} | |
} catch (e) { | |
cachedSetTimeout = defaultSetTimout; | |
} | |
try { | |
if (typeof clearTimeout === 'function') { | |
cachedClearTimeout = clearTimeout; | |
} else { | |
cachedClearTimeout = defaultClearTimeout; | |
} | |
} catch (e) { | |
cachedClearTimeout = defaultClearTimeout; | |
} | |
} ()) | |
function runTimeout(fun) { | |
if (cachedSetTimeout === setTimeout) { | |
//normal enviroments in sane situations | |
return setTimeout(fun, 0); | |
} | |
// if setTimeout wasn't available but was latter defined | |
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { | |
cachedSetTimeout = setTimeout; | |
return setTimeout(fun, 0); | |
} | |
try { | |
// when when somebody has screwed with setTimeout but no I.E. maddness | |
return cachedSetTimeout(fun, 0); | |
} catch(e){ | |
try { | |
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally | |
return cachedSetTimeout.call(null, fun, 0); | |
} catch(e){ | |
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error | |
return cachedSetTimeout.call(this, fun, 0); | |
} | |
} | |
} | |
function runClearTimeout(marker) { | |
if (cachedClearTimeout === clearTimeout) { | |
//normal enviroments in sane situations | |
return clearTimeout(marker); | |
} | |
// if clearTimeout wasn't available but was latter defined | |
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { | |
cachedClearTimeout = clearTimeout; | |
return clearTimeout(marker); | |
} | |
try { | |
// when when somebody has screwed with setTimeout but no I.E. maddness | |
return cachedClearTimeout(marker); | |
} catch (e){ | |
try { | |
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally | |
return cachedClearTimeout.call(null, marker); | |
} catch (e){ | |
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. | |
// Some versions of I.E. have different rules for clearTimeout vs setTimeout | |
return cachedClearTimeout.call(this, marker); | |
} | |
} | |
} | |
var queue = []; | |
var draining = false; | |
var currentQueue; | |
var queueIndex = -1; | |
function cleanUpNextTick() { | |
if (!draining || !currentQueue) { | |
return; | |
} | |
draining = false; | |
if (currentQueue.length) { | |
queue = currentQueue.concat(queue); | |
} else { | |
queueIndex = -1; | |
} | |
if (queue.length) { | |
drainQueue(); | |
} | |
} | |
function drainQueue() { | |
if (draining) { | |
return; | |
} | |
var timeout = runTimeout(cleanUpNextTick); | |
draining = true; | |
var len = queue.length; | |
while(len) { | |
currentQueue = queue; | |
queue = []; | |
while (++queueIndex < len) { | |
if (currentQueue) { | |
currentQueue[queueIndex].run(); | |
} | |
} | |
queueIndex = -1; | |
len = queue.length; | |
} | |
currentQueue = null; | |
draining = false; | |
runClearTimeout(timeout); | |
} | |
process.nextTick = function (fun) { | |
var args = new Array(arguments.length - 1); | |
if (arguments.length > 1) { | |
for (var i = 1; i < arguments.length; i++) { | |
args[i - 1] = arguments[i]; | |
} | |
} | |
queue.push(new Item(fun, args)); | |
if (queue.length === 1 && !draining) { | |
runTimeout(drainQueue); | |
} | |
}; | |
// v8 likes predictible objects | |
function Item(fun, array) { | |
this.fun = fun; | |
this.array = array; | |
} | |
Item.prototype.run = function () { | |
this.fun.apply(null, this.array); | |
}; | |
process.title = 'browser'; | |
process.browser = true; | |
process.env = {}; | |
process.argv = []; | |
process.version = ''; // empty string to avoid regexp issues | |
process.versions = {}; | |
function noop() {} | |
process.on = noop; | |
process.addListener = noop; | |
process.once = noop; | |
process.off = noop; | |
process.removeListener = noop; | |
process.removeAllListeners = noop; | |
process.emit = noop; | |
process.binding = function (name) { | |
throw new Error('process.binding is not supported'); | |
}; | |
process.cwd = function () { return '/' }; | |
process.chdir = function (dir) { | |
throw new Error('process.chdir is not supported'); | |
}; | |
process.umask = function() { return 0; }; | |
/***/ }), | |
/* 1 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
module.exports = __webpack_require__(49); | |
/***/ }), | |
/* 2 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
exports.__esModule = true; | |
exports.default = function (instance, Constructor) { | |
if (!(instance instanceof Constructor)) { | |
throw new TypeError("Cannot call a class as a function"); | |
} | |
}; | |
/***/ }), | |
/* 3 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
exports.__esModule = true; | |
var _defineProperty = __webpack_require__(94); | |
var _defineProperty2 = _interopRequireDefault(_defineProperty); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.default = 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; | |
(0, _defineProperty2.default)(target, descriptor.key, descriptor); | |
} | |
} | |
return function (Constructor, protoProps, staticProps) { | |
if (protoProps) defineProperties(Constructor.prototype, protoProps); | |
if (staticProps) defineProperties(Constructor, staticProps); | |
return Constructor; | |
}; | |
}(); | |
/***/ }), | |
/* 4 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
module.exports = { "default": __webpack_require__(270), __esModule: true }; | |
/***/ }), | |
/* 5 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
exports.__esModule = true; | |
var _setPrototypeOf = __webpack_require__(260); | |
var _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf); | |
var _create = __webpack_require__(259); | |
var _create2 = _interopRequireDefault(_create); | |
var _typeof2 = __webpack_require__(42); | |
var _typeof3 = _interopRequireDefault(_typeof2); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.default = function (subClass, superClass) { | |
if (typeof superClass !== "function" && superClass !== null) { | |
throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : (0, _typeof3.default)(superClass))); | |
} | |
subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, { | |
constructor: { | |
value: subClass, | |
enumerable: false, | |
writable: true, | |
configurable: true | |
} | |
}); | |
if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass; | |
}; | |
/***/ }), | |
/* 6 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
exports.__esModule = true; | |
var _typeof2 = __webpack_require__(42); | |
var _typeof3 = _interopRequireDefault(_typeof2); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.default = function (self, call) { | |
if (!self) { | |
throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); | |
} | |
return call && ((typeof call === "undefined" ? "undefined" : (0, _typeof3.default)(call)) === "object" || typeof call === "function") ? call : self; | |
}; | |
/***/ }), | |
/* 7 */ | |
/***/ (function(module, exports) { | |
module.exports = 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; | |
}; | |
/***/ }), | |
/* 8 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
exports.__esModule = true; | |
var _assign = __webpack_require__(167); | |
var _assign2 = _interopRequireDefault(_assign); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.default = _assign2.default || 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; | |
}; | |
/***/ }), | |
/* 9 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
exports.__esModule = true; | |
exports.default = function (obj, keys) { | |
var target = {}; | |
for (var i in obj) { | |
if (keys.indexOf(i) >= 0) continue; | |
if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; | |
target[i] = obj[i]; | |
} | |
return target; | |
}; | |
/***/ }), | |
/* 10 */ | |
/***/ (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. | |
* | |
*/ | |
var emptyFunction = __webpack_require__(24); | |
/** | |
* Similar to invariant but only logs a warning if the condition is not met. | |
* This can be used to log issues in development environments in critical | |
* paths. Removing the logging code for production environments will keep the | |
* same logic and follow the same code paths. | |
*/ | |
var warning = emptyFunction; | |
if (process.env.NODE_ENV !== 'production') { | |
(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 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) {} | |
}; | |
warning = function warning(condition, format) { | |
if (format === undefined) { | |
throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); | |
} | |
if (format.indexOf('Failed Composite propType: ') === 0) { | |
return; // Ignore CompositeComponent proptype check. | |
} | |
if (!condition) { | |
for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { | |
args[_key2 - 2] = arguments[_key2]; | |
} | |
printWarning.apply(undefined, [format].concat(args)); | |
} | |
}; | |
})(); | |
} | |
module.exports = warning; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 11 */ | |
/***/ (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. | |
* | |
*/ | |
/** | |
* Use invariant() to assert state which your program assumes to be true. | |
* | |
* Provide sprintf-style format (only %s is supported) and arguments | |
* to provide information about what broke and what you were | |
* expecting. | |
* | |
* The invariant message will be stripped in production, but the invariant | |
* will remain to ensure logic does not differ in production. | |
*/ | |
var validateFormat = function validateFormat(format) {}; | |
if (process.env.NODE_ENV !== 'production') { | |
validateFormat = function validateFormat(format) { | |
if (format === undefined) { | |
throw new Error('invariant requires an error message argument'); | |
} | |
}; | |
} | |
function invariant(condition, format, a, b, c, d, e, f) { | |
validateFormat(format); | |
if (!condition) { | |
var error; | |
if (format === undefined) { | |
error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.'); | |
} else { | |
var args = [a, b, c, d, e, f]; | |
var argIndex = 0; | |
error = new Error(format.replace(/%s/g, function () { | |
return args[argIndex++]; | |
})); | |
error.name = 'Invariant Violation'; | |
} | |
error.framesToPop = 1; // we don't care about invariant's own frame | |
throw error; | |
} | |
} | |
module.exports = invariant; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 12 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = { | |
easeOutFunction: 'cubic-bezier(0.23, 1, 0.32, 1)', | |
easeInOutFunction: 'cubic-bezier(0.445, 0.05, 0.55, 0.95)', | |
easeOut: function easeOut(duration, property, delay, easeFunction) { | |
easeFunction = easeFunction || this.easeOutFunction; | |
if (property && Object.prototype.toString.call(property) === '[object Array]') { | |
var transitions = ''; | |
for (var i = 0; i < property.length; i++) { | |
if (transitions) transitions += ','; | |
transitions += this.create(duration, property[i], delay, easeFunction); | |
} | |
return transitions; | |
} else { | |
return this.create(duration, property, delay, easeFunction); | |
} | |
}, | |
create: function create(duration, property, delay, easeFunction) { | |
duration = duration || '450ms'; | |
property = property || 'all'; | |
delay = delay || '0ms'; | |
easeFunction = easeFunction || 'linear'; | |
return property + ' ' + duration + ' ' + easeFunction + ' ' + delay; | |
} | |
}; | |
/***/ }), | |
/* 13 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"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. | |
* | |
* | |
*/ | |
/** | |
* 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. | |
*/ | |
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]); | |
} | |
message += ' for the full message or use the non-minified dev environment' + ' for full errors and additional helpful warnings.'; | |
var error = new Error(message); | |
error.name = 'Invariant Violation'; | |
error.framesToPop = 1; // we don't care about reactProdInvariant's own frame | |
throw error; | |
} | |
module.exports = reactProdInvariant; | |
/***/ }), | |
/* 14 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* | |
object-assign | |
(c) Sindre Sorhus | |
@license MIT | |
*/ | |
/* eslint-disable no-unused-vars */ | |
var getOwnPropertySymbols = Object.getOwnPropertySymbols; | |
var hasOwnProperty = Object.prototype.hasOwnProperty; | |
var propIsEnumerable = Object.prototype.propertyIsEnumerable; | |
function toObject(val) { | |
if (val === null || val === undefined) { | |
throw new TypeError('Object.assign cannot be called with null or undefined'); | |
} | |
return Object(val); | |
} | |
function shouldUseNative() { | |
try { | |
if (!Object.assign) { | |
return false; | |
} | |
// Detect buggy property enumeration order in older V8 versions. | |
// 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; | |
} | |
// 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; | |
} | |
} | |
module.exports = shouldUseNative() ? Object.assign : function (target, source) { | |
var from; | |
var to = toObject(target); | |
var symbols; | |
for (var s = 1; s < arguments.length; s++) { | |
from = Object(arguments[s]); | |
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; | |
}; | |
/***/ }), | |
/* 15 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
module.exports = __webpack_require__(462); | |
/***/ }), | |
/* 16 */ | |
/***/ (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 _prodInvariant = __webpack_require__(13); | |
var DOMProperty = __webpack_require__(39); | |
var ReactDOMComponentFlags = __webpack_require__(201); | |
var invariant = __webpack_require__(11); | |
var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME; | |
var Flags = ReactDOMComponentFlags; | |
var internalInstanceKey = '__reactInternalInstance$' + Math.random().toString(36).slice(2); | |
/** | |
* 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 + ' '; | |
} | |
/** | |
* 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; | |
} | |
/** | |
* 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; | |
} | |
function uncacheNode(inst) { | |
var node = inst._hostNode; | |
if (node) { | |
delete node[internalInstanceKey]; | |
inst._hostNode = null; | |
} | |
} | |
/** | |
* 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; | |
} | |
/** | |
* Given a DOM node, return the closest ReactDOMComponent or | |
* ReactDOMTextComponent instance ancestor. | |
*/ | |
function getClosestInstanceFromNode(node) { | |
if (node[internalInstanceKey]) { | |
return node[internalInstanceKey]; | |
} | |
// 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; | |
} | |
} | |
var closest; | |
var inst; | |
for (; node && (inst = node[internalInstanceKey]); node = parents.pop()) { | |
closest = inst; | |
if (parents.length) { | |
precacheChildNodes(inst, node); | |
} | |
} | |
return closest; | |
} | |
/** | |
* 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; | |
} | |
} | |
/** | |
* 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; | |
if (inst._hostNode) { | |
return inst._hostNode; | |
} | |
// 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; | |
} | |
// 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); | |
} | |
return inst._hostNode; | |
} | |
var ReactDOMComponentTree = { | |
getClosestInstanceFromNode: getClosestInstanceFromNode, | |
getInstanceFromNode: getInstanceFromNode, | |
getNodeFromInstance: getNodeFromInstance, | |
precacheChildNodes: precacheChildNodes, | |
precacheNode: precacheNode, | |
uncacheNode: uncacheNode | |
}; | |
module.exports = ReactDOMComponentTree; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 17 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = undefined; | |
var _SvgIcon = __webpack_require__(394); | |
var _SvgIcon2 = _interopRequireDefault(_SvgIcon); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.default = _SvgIcon2.default; | |
/***/ }), | |
/* 18 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"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 canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); | |
/** | |
* Simple, lightweight module assisting with the detection and context of | |
* Worker. Helps avoid circular dependencies and allows code to reason about | |
* whether or not they are in a Worker, even if they never include the main | |
* `ReactWorker` dependency. | |
*/ | |
var ExecutionEnvironment = { | |
canUseDOM: canUseDOM, | |
canUseWorkers: typeof Worker !== 'undefined', | |
canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent), | |
canUseViewport: canUseDOM && !!window.screen, | |
isInWorker: !canUseDOM // For now, this is true - might change in the future. | |
}; | |
module.exports = ExecutionEnvironment; | |
/***/ }), | |
/* 19 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
exports.__esModule = true; | |
var _shouldUpdate = __webpack_require__(540); | |
var _shouldUpdate2 = _interopRequireDefault(_shouldUpdate); | |
var _shallowEqual = __webpack_require__(50); | |
var _shallowEqual2 = _interopRequireDefault(_shallowEqual); | |
var _createHelper = __webpack_require__(225); | |
var _createHelper2 = _interopRequireDefault(_createHelper); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
var pure = (0, _shouldUpdate2.default)(function (props, nextProps) { | |
return !(0, _shallowEqual2.default)(props, nextProps); | |
}); | |
exports.default = (0, _createHelper2.default)(pure, 'pure', true, true); | |
/***/ }), | |
/* 20 */ | |
/***/ (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. | |
*/ | |
/** | |
* Similar to invariant but only logs a warning if the condition is not met. | |
* This can be used to log issues in development environments in critical | |
* paths. Removing the logging code for production environments will keep the | |
* same logic and follow the same code paths. | |
*/ | |
var warning = function() {}; | |
if (process.env.NODE_ENV !== 'production') { | |
warning = function(condition, format, args) { | |
var len = arguments.length; | |
args = new Array(len > 2 ? len - 2 : 0); | |
for (var key = 2; key < len; key++) { | |
args[key - 2] = arguments[key]; | |
} | |
if (format === undefined) { | |
throw new Error( | |
'`warning(condition, format, ...args)` requires a warning ' + | |
'message argument' | |
); | |
} | |
if (format.length < 10 || (/^[s\W]*$/).test(format)) { | |
throw new Error( | |
'The warning format should be able to uniquely identify this ' + | |
'warning. Please, use a more descriptive format than: ' + format | |
); | |
} | |
if (!condition) { | |
var argIndex = 0; | |
var message = 'Warning: ' + | |
format.replace(/%s/g, function() { | |
return args[argIndex++]; | |
}); | |
if (typeof console !== 'undefined') { | |
console.error(message); | |
} | |
try { | |
// This error was thrown as a convenience so that you can use this stack | |
// to find the callsite that caused this warning to fire. | |
throw new Error(message); | |
} catch(x) {} | |
} | |
}; | |
} | |
module.exports = warning; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 21 */ | |
/***/ (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 _prodInvariant = __webpack_require__(41); | |
var ReactCurrentOwner = __webpack_require__(31); | |
var invariant = __webpack_require__(11); | |
var warning = __webpack_require__(10); | |
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; | |
} | |
} | |
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); | |
var setItem; | |
var getItem; | |
var removeItem; | |
var getItemIDs; | |
var addRoot; | |
var removeRoot; | |
var getRootIDs; | |
if (canUseCollections) { | |
var itemMap = new Map(); | |
var rootIDSet = new Set(); | |
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()); | |
}; | |
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); | |
}; | |
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); | |
}; | |
} | |
var unmountedIDs = []; | |
function purgeDeep(id) { | |
var item = getItem(id); | |
if (item) { | |
var childIDs = item.childIDs; | |
removeItem(id); | |
childIDs.forEach(purgeDeep); | |
} | |
} | |
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 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; | |
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; | |
} | |
}, | |
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; | |
} | |
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); | |
} | |
}, | |
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; | |
} | |
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); | |
} | |
} | |
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); | |
} | |
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 = ReactComponentTreeHook; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 22 */ | |
/***/ (function(module, exports) { | |
var core = module.exports = {version: '2.4.0'}; | |
if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef | |
/***/ }), | |
/* 23 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = undefined; | |
var _Paper = __webpack_require__(384); | |
var _Paper2 = _interopRequireDefault(_Paper); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.default = _Paper2.default; | |
/***/ }), | |
/* 24 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"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. | |
* | |
* | |
*/ | |
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; | |
/***/ }), | |
/* 25 */ | |
/***/ (function(module, exports) { | |
// Source: http://jsfiddle.net/vWx8V/ | |
// http://stackoverflow.com/questions/5603195/full-list-of-javascript-keycodes | |
/** | |
* Conenience method returns corresponding value for given keyName or keyCode. | |
* | |
* @param {Mixed} keyCode {Number} or keyName {String} | |
* @return {Mixed} | |
* @api public | |
*/ | |
exports = module.exports = function(searchInput) { | |
// Keyboard Events | |
if (searchInput && 'object' === typeof searchInput) { | |
var hasKeyCode = searchInput.which || searchInput.keyCode || searchInput.charCode | |
if (hasKeyCode) searchInput = hasKeyCode | |
} | |
// Numbers | |
if ('number' === typeof searchInput) return names[searchInput] | |
// Everything else (cast to string) | |
var search = String(searchInput) | |
// check codes | |
var foundNamedKey = codes[search.toLowerCase()] | |
if (foundNamedKey) return foundNamedKey | |
// check aliases | |
var foundNamedKey = aliases[search.toLowerCase()] | |
if (foundNamedKey) return foundNamedKey | |
// weird character? | |
if (search.length === 1) return search.charCodeAt(0) | |
return undefined | |
} | |
/** | |
* Get by name | |
* | |
* exports.code['enter'] // => 13 | |
*/ | |
var codes = exports.code = exports.codes = { | |
'backspace': 8, | |
'tab': 9, | |
'enter': 13, | |
'shift': 16, | |
'ctrl': 17, | |
'alt': 18, | |
'pause/break': 19, | |
'caps lock': 20, | |
'esc': 27, | |
'space': 32, | |
'page up': 33, | |
'page down': 34, | |
'end': 35, | |
'home': 36, | |
'left': 37, | |
'up': 38, | |
'right': 39, | |
'down': 40, | |
'insert': 45, | |
'delete': 46, | |
'command': 91, | |
'left command': 91, | |
'right command': 93, | |
'numpad *': 106, | |
'numpad +': 107, | |
'numpad -': 109, | |
'numpad .': 110, | |
'numpad /': 111, | |
'num lock': 144, | |
'scroll lock': 145, | |
'my computer': 182, | |
'my calculator': 183, | |
';': 186, | |
'=': 187, | |
',': 188, | |
'-': 189, | |
'.': 190, | |
'/': 191, | |
'`': 192, | |
'[': 219, | |
'\\': 220, | |
']': 221, | |
"'": 222 | |
} | |
// Helper aliases | |
var aliases = exports.aliases = { | |
'windows': 91, | |
'⇧': 16, | |
'⌥': 18, | |
'⌃': 17, | |
'⌘': 91, | |
'ctl': 17, | |
'control': 17, | |
'option': 18, | |
'pause': 19, | |
'break': 19, | |
'caps': 20, | |
'return': 13, | |
'escape': 27, | |
'spc': 32, | |
'pgup': 33, | |
'pgdn': 34, | |
'ins': 45, | |
'del': 46, | |
'cmd': 91 | |
} | |
/*! | |
* Programatically add the following | |
*/ | |
// lower case chars | |
for (i = 97; i < 123; i++) codes[String.fromCharCode(i)] = i - 32 | |
// numbers | |
for (var i = 48; i < 58; i++) codes[i - 48] = i | |
// function keys | |
for (i = 1; i < 13; i++) codes['f'+i] = i + 111 | |
// numpad keys | |
for (i = 0; i < 10; i++) codes['numpad '+i] = i + 96 | |
/** | |
* Get by code | |
* | |
* exports.name[13] // => 'Enter' | |
*/ | |
var names = exports.names = exports.title = {} // title for backward compat | |
// Create reverse mapping | |
for (i in codes) names[codes[i]] = i | |
// Add aliases | |
for (var alias in aliases) { | |
codes[alias] = aliases[alias] | |
} | |
/***/ }), | |
/* 26 */ | |
/***/ (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. | |
* | |
* | |
*/ | |
// Trust the developer to only use ReactInstrumentation with a __DEV__ check | |
var debugTool = null; | |
if (process.env.NODE_ENV !== 'production') { | |
var ReactDebugTool = __webpack_require__(477); | |
debugTool = ReactDebugTool; | |
} | |
module.exports = { debugTool: debugTool }; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 27 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
var store = __webpack_require__(106)('wks') | |
, uid = __webpack_require__(77) | |
, Symbol = __webpack_require__(36).Symbol | |
, USE_SYMBOL = typeof Symbol == 'function'; | |
var $exports = module.exports = function(name){ | |
return store[name] || (store[name] = | |
USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); | |
}; | |
$exports.store = store; | |
/***/ }), | |
/* 28 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _extends2 = __webpack_require__(8); | |
var _extends3 = _interopRequireDefault(_extends2); | |
var _objectWithoutProperties2 = __webpack_require__(9); | |
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | |
var _getPrototypeOf = __webpack_require__(4); | |
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | |
var _classCallCheck2 = __webpack_require__(2); | |
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | |
var _createClass2 = __webpack_require__(3); | |
var _createClass3 = _interopRequireDefault(_createClass2); | |
var _possibleConstructorReturn2 = __webpack_require__(6); | |
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | |
var _inherits2 = __webpack_require__(5); | |
var _inherits3 = _interopRequireDefault(_inherits2); | |
var _simpleAssign = __webpack_require__(7); | |
var _simpleAssign2 = _interopRequireDefault(_simpleAssign); | |
var _react = __webpack_require__(1); | |
var _react2 = _interopRequireDefault(_react); | |
var _childUtils = __webpack_require__(68); | |
var _events = __webpack_require__(81); | |
var _events2 = _interopRequireDefault(_events); | |
var _keycode = __webpack_require__(25); | |
var _keycode2 = _interopRequireDefault(_keycode); | |
var _FocusRipple = __webpack_require__(119); | |
var _FocusRipple2 = _interopRequireDefault(_FocusRipple); | |
var _TouchRipple = __webpack_require__(196); | |
var _TouchRipple2 = _interopRequireDefault(_TouchRipple); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
var styleInjected = false; | |
var listening = false; | |
var tabPressed = false; | |
function injectStyle() { | |
if (!styleInjected) { | |
// Remove inner padding and border in Firefox 4+. | |
var style = document.createElement('style'); | |
style.innerHTML = '\n button::-moz-focus-inner,\n input::-moz-focus-inner {\n border: 0;\n padding: 0;\n }\n '; | |
document.body.appendChild(style); | |
styleInjected = true; | |
} | |
} | |
function listenForTabPresses() { | |
if (!listening) { | |
_events2.default.on(window, 'keydown', function (event) { | |
tabPressed = (0, _keycode2.default)(event) === 'tab'; | |
}); | |
listening = true; | |
} | |
} | |
var EnhancedButton = function (_Component) { | |
(0, _inherits3.default)(EnhancedButton, _Component); | |
function EnhancedButton() { | |
var _ref; | |
var _temp, _this, _ret; | |
(0, _classCallCheck3.default)(this, EnhancedButton); | |
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | |
args[_key] = arguments[_key]; | |
} | |
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = EnhancedButton.__proto__ || (0, _getPrototypeOf2.default)(EnhancedButton)).call.apply(_ref, [this].concat(args))), _this), _this.state = { | |
isKeyboardFocused: false | |
}, _this.handleKeyDown = function (event) { | |
if (!_this.props.disabled && !_this.props.disableKeyboardFocus) { | |
if ((0, _keycode2.default)(event) === 'enter' && _this.state.isKeyboardFocused) { | |
_this.handleTouchTap(event); | |
} | |
if ((0, _keycode2.default)(event) === 'esc' && _this.state.isKeyboardFocused) { | |
_this.removeKeyboardFocus(event); | |
} | |
} | |
_this.props.onKeyDown(event); | |
}, _this.handleKeyUp = function (event) { | |
if (!_this.props.disabled && !_this.props.disableKeyboardFocus) { | |
if ((0, _keycode2.default)(event) === 'space' && _this.state.isKeyboardFocused) { | |
_this.handleTouchTap(event); | |
} | |
} | |
_this.props.onKeyUp(event); | |
}, _this.handleBlur = function (event) { | |
_this.cancelFocusTimeout(); | |
_this.removeKeyboardFocus(event); | |
_this.props.onBlur(event); | |
}, _this.handleFocus = function (event) { | |
if (event) event.persist(); | |
if (!_this.props.disabled && !_this.props.disableKeyboardFocus) { | |
// setTimeout is needed because the focus event fires first | |
// Wait so that we can capture if this was a keyboard focus | |
// or touch focus | |
_this.focusTimeout = setTimeout(function () { | |
if (tabPressed) { | |
_this.setKeyboardFocus(event); | |
tabPressed = false; | |
} | |
}, 150); | |
_this.props.onFocus(event); | |
} | |
}, _this.handleClick = function (event) { | |
if (!_this.props.disabled) { | |
tabPressed = false; | |
_this.props.onClick(event); | |
} | |
}, _this.handleTouchTap = function (event) { | |
_this.cancelFocusTimeout(); | |
if (!_this.props.disabled) { | |
tabPressed = false; | |
_this.removeKeyboardFocus(event); | |
_this.props.onTouchTap(event); | |
} | |
}, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); | |
} | |
(0, _createClass3.default)(EnhancedButton, [{ | |
key: 'componentWillMount', | |
value: function componentWillMount() { | |
var _props = this.props, | |
disabled = _props.disabled, | |
disableKeyboardFocus = _props.disableKeyboardFocus, | |
keyboardFocused = _props.keyboardFocused; | |
if (!disabled && keyboardFocused && !disableKeyboardFocus) { | |
this.setState({ isKeyboardFocused: true }); | |
} | |
} | |
}, { | |
key: 'componentDidMount', | |
value: function componentDidMount() { | |
injectStyle(); | |
listenForTabPresses(); | |
if (this.state.isKeyboardFocused) { | |
this.refs.enhancedButton.focus(); | |
this.props.onKeyboardFocus(null, true); | |
} | |
} | |
}, { | |
key: 'componentWillReceiveProps', | |
value: function componentWillReceiveProps(nextProps) { | |
if ((nextProps.disabled || nextProps.disableKeyboardFocus) && this.state.isKeyboardFocused) { | |
this.setState({ isKeyboardFocused: false }); | |
if (nextProps.onKeyboardFocus) { | |
nextProps.onKeyboardFocus(null, false); | |
} | |
} | |
} | |
}, { | |
key: 'componentWillUnmount', | |
value: function componentWillUnmount() { | |
clearTimeout(this.focusTimeout); | |
} | |
}, { | |
key: 'isKeyboardFocused', | |
value: function isKeyboardFocused() { | |
return this.state.isKeyboardFocused; | |
} | |
}, { | |
key: 'removeKeyboardFocus', | |
value: function removeKeyboardFocus(event) { | |
if (this.state.isKeyboardFocused) { | |
this.setState({ isKeyboardFocused: false }); | |
this.props.onKeyboardFocus(event, false); | |
} | |
} | |
}, { | |
key: 'setKeyboardFocus', | |
value: function setKeyboardFocus(event) { | |
if (!this.state.isKeyboardFocused) { | |
this.setState({ isKeyboardFocused: true }); | |
this.props.onKeyboardFocus(event, true); | |
} | |
} | |
}, { | |
key: 'cancelFocusTimeout', | |
value: function cancelFocusTimeout() { | |
if (this.focusTimeout) { | |
clearTimeout(this.focusTimeout); | |
this.focusTimeout = null; | |
} | |
} | |
}, { | |
key: 'createButtonChildren', | |
value: function createButtonChildren() { | |
var _props2 = this.props, | |
centerRipple = _props2.centerRipple, | |
children = _props2.children, | |
disabled = _props2.disabled, | |
disableFocusRipple = _props2.disableFocusRipple, | |
disableKeyboardFocus = _props2.disableKeyboardFocus, | |
disableTouchRipple = _props2.disableTouchRipple, | |
focusRippleColor = _props2.focusRippleColor, | |
focusRippleOpacity = _props2.focusRippleOpacity, | |
touchRippleColor = _props2.touchRippleColor, | |
touchRippleOpacity = _props2.touchRippleOpacity; | |
var isKeyboardFocused = this.state.isKeyboardFocused; | |
// Focus Ripple | |
var focusRipple = isKeyboardFocused && !disabled && !disableFocusRipple && !disableKeyboardFocus ? _react2.default.createElement(_FocusRipple2.default, { | |
color: focusRippleColor, | |
opacity: focusRippleOpacity, | |
show: isKeyboardFocused | |
}) : undefined; | |
// Touch Ripple | |
var touchRipple = !disabled && !disableTouchRipple ? _react2.default.createElement( | |
_TouchRipple2.default, | |
{ | |
centerRipple: centerRipple, | |
color: touchRippleColor, | |
opacity: touchRippleOpacity | |
}, | |
children | |
) : undefined; | |
return (0, _childUtils.createChildFragment)({ | |
focusRipple: focusRipple, | |
touchRipple: touchRipple, | |
children: touchRipple ? undefined : children | |
}); | |
} | |
}, { | |
key: 'render', | |
value: function render() { | |
var _props3 = this.props, | |
centerRipple = _props3.centerRipple, | |
children = _props3.children, | |
containerElement = _props3.containerElement, | |
disabled = _props3.disabled, | |
disableFocusRipple = _props3.disableFocusRipple, | |
disableKeyboardFocus = _props3.disableKeyboardFocus, | |
disableTouchRipple = _props3.disableTouchRipple, | |
focusRippleColor = _props3.focusRippleColor, | |
focusRippleOpacity = _props3.focusRippleOpacity, | |
href = _props3.href, | |
keyboardFocused = _props3.keyboardFocused, | |
touchRippleColor = _props3.touchRippleColor, | |
touchRippleOpacity = _props3.touchRippleOpacity, | |
onBlur = _props3.onBlur, | |
onClick = _props3.onClick, | |
onFocus = _props3.onFocus, | |
onKeyUp = _props3.onKeyUp, | |
onKeyDown = _props3.onKeyDown, | |
onKeyboardFocus = _props3.onKeyboardFocus, | |
onTouchTap = _props3.onTouchTap, | |
style = _props3.style, | |
tabIndex = _props3.tabIndex, | |
type = _props3.type, | |
other = (0, _objectWithoutProperties3.default)(_props3, ['centerRipple', 'children', 'containerElement', 'disabled', 'disableFocusRipple', 'disableKeyboardFocus', 'disableTouchRipple', 'focusRippleColor', 'focusRippleOpacity', 'href', 'keyboardFocused', 'touchRippleColor', 'touchRippleOpacity', 'onBlur', 'onClick', 'onFocus', 'onKeyUp', 'onKeyDown', 'onKeyboardFocus', 'onTouchTap', 'style', 'tabIndex', 'type']); | |
var _context$muiTheme = this.context.muiTheme, | |
prepareStyles = _context$muiTheme.prepareStyles, | |
enhancedButton = _context$muiTheme.enhancedButton; | |
var mergedStyles = (0, _simpleAssign2.default)({ | |
border: 10, | |
boxSizing: 'border-box', | |
display: 'inline-block', | |
fontFamily: this.context.muiTheme.baseTheme.fontFamily, | |
WebkitTapHighlightColor: enhancedButton.tapHighlightColor, // Remove mobile color flashing (deprecated) | |
cursor: disabled ? 'default' : 'pointer', | |
textDecoration: 'none', | |
margin: 0, | |
padding: 0, | |
outline: 'none', | |
fontSize: 'inherit', | |
fontWeight: 'inherit', | |
position: 'relative', // This is needed so that ripples do not bleed past border radius. | |
verticalAlign: href ? 'middle' : null, | |
zIndex: 1 }, style); | |
// Passing both background:none & backgroundColor can break due to object iteration order | |
if (!mergedStyles.backgroundColor && !mergedStyles.background) { | |
mergedStyles.background = 'none'; | |
} | |
if (disabled && href) { | |
return _react2.default.createElement( | |
'span', | |
(0, _extends3.default)({}, other, { | |
style: mergedStyles | |
}), | |
children | |
); | |
} | |
var buttonProps = (0, _extends3.default)({}, other, { | |
style: prepareStyles(mergedStyles), | |
ref: 'enhancedButton', | |
disabled: disabled, | |
href: href, | |
onBlur: this.handleBlur, | |
onClick: this.handleClick, | |
onFocus: this.handleFocus, | |
onKeyUp: this.handleKeyUp, | |
onKeyDown: this.handleKeyDown, | |
onTouchTap: this.handleTouchTap, | |
tabIndex: disabled || disableKeyboardFocus ? -1 : tabIndex | |
}); | |
var buttonChildren = this.createButtonChildren(); | |
if (_react2.default.isValidElement(containerElement)) { | |
return _react2.default.cloneElement(containerElement, buttonProps, buttonChildren); | |
} | |
if (!href && containerElement === 'button') { | |
buttonProps.type = type; | |
} | |
return _react2.default.createElement(href ? 'a' : containerElement, buttonProps, buttonChildren); | |
} | |
}]); | |
return EnhancedButton; | |
}(_react.Component); | |
EnhancedButton.defaultProps = { | |
containerElement: 'button', | |
onBlur: function onBlur() {}, | |
onClick: function onClick() {}, | |
onFocus: function onFocus() {}, | |
onKeyDown: function onKeyDown() {}, | |
onKeyUp: function onKeyUp() {}, | |
onKeyboardFocus: function onKeyboardFocus() {}, | |
onTouchTap: function onTouchTap() {}, | |
tabIndex: 0, | |
type: 'button' | |
}; | |
EnhancedButton.contextTypes = { | |
muiTheme: _react.PropTypes.object.isRequired | |
}; | |
process.env.NODE_ENV !== "production" ? EnhancedButton.propTypes = { | |
centerRipple: _react.PropTypes.bool, | |
children: _react.PropTypes.node, | |
containerElement: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.element]), | |
disableFocusRipple: _react.PropTypes.bool, | |
disableKeyboardFocus: _react.PropTypes.bool, | |
disableTouchRipple: _react.PropTypes.bool, | |
disabled: _react.PropTypes.bool, | |
focusRippleColor: _react.PropTypes.string, | |
focusRippleOpacity: _react.PropTypes.number, | |
href: _react.PropTypes.string, | |
keyboardFocused: _react.PropTypes.bool, | |
onBlur: _react.PropTypes.func, | |
onClick: _react.PropTypes.func, | |
onFocus: _react.PropTypes.func, | |
onKeyDown: _react.PropTypes.func, | |
onKeyUp: _react.PropTypes.func, | |
onKeyboardFocus: _react.PropTypes.func, | |
onTouchTap: _react.PropTypes.func, | |
style: _react.PropTypes.object, | |
tabIndex: _react.PropTypes.number, | |
touchRippleColor: _react.PropTypes.string, | |
touchRippleOpacity: _react.PropTypes.number, | |
type: _react.PropTypes.string | |
} : void 0; | |
exports.default = EnhancedButton; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 29 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _react = __webpack_require__(1); | |
var horizontal = _react.PropTypes.oneOf(['left', 'middle', 'right']); | |
var vertical = _react.PropTypes.oneOf(['top', 'center', 'bottom']); | |
exports.default = { | |
corners: _react.PropTypes.oneOf(['bottom-left', 'bottom-right', 'top-left', 'top-right']), | |
horizontal: horizontal, | |
vertical: vertical, | |
origin: _react.PropTypes.shape({ | |
horizontal: horizontal, | |
vertical: vertical | |
}), | |
cornersAndCenter: _react.PropTypes.oneOf(['bottom-center', 'bottom-left', 'bottom-right', 'top-center', 'top-left', 'top-right']), | |
stringOrNumber: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.number]), | |
zDepth: _react.PropTypes.oneOf([0, 1, 2, 3, 4, 5]) | |
}; | |
/***/ }), | |
/* 30 */ | |
/***/ (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 _prodInvariant = __webpack_require__(13), | |
_assign = __webpack_require__(14); | |
var CallbackQueue = __webpack_require__(199); | |
var PooledClass = __webpack_require__(48); | |
var ReactFeatureFlags = __webpack_require__(204); | |
var ReactReconciler = __webpack_require__(59); | |
var Transaction = __webpack_require__(85); | |
var invariant = __webpack_require__(11); | |
var dirtyComponents = []; | |
var updateBatchNumber = 0; | |
var asapCallbackQueue = CallbackQueue.getPooled(); | |
var asapEnqueued = false; | |
var batchingStrategy = null; | |
function ensureInjected() { | |
!(ReactUpdates.ReactReconcileTransaction && batchingStrategy) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must inject a reconcile transaction class and batching strategy') : _prodInvariant('123') : void 0; | |
} | |
var NESTED_UPDATES = { | |
initialize: function () { | |
this.dirtyComponentsLength = dirtyComponents.length; | |
}, | |
close: function () { | |
if (this.dirtyComponentsLength !== dirtyComponents.length) { | |
// Additional updates were enqueued by componentDidUpdate handlers or | |
// similar; before our own UPDATE_QUEUEING wrapper closes, we want to run | |
// these new updates so that if A's componentDidUpdate calls setState on | |
// B, B will update before the callback A's updater provided when calling | |
// setState. | |
dirtyComponents.splice(0, this.dirtyComponentsLength); | |
flushBatchedUpdates(); | |
} else { | |
dirtyComponents.length = 0; | |
} | |
} | |
}; | |
var UPDATE_QUEUEING = { | |
initialize: function () { | |
this.callbackQueue.reset(); | |
}, | |
close: function () { | |
this.callbackQueue.notifyAll(); | |
} | |
}; | |
var TRANSACTION_WRAPPERS = [NESTED_UPDATES, UPDATE_QUEUEING]; | |
function ReactUpdatesFlushTransaction() { | |
this.reinitializeTransaction(); | |
this.dirtyComponentsLength = null; | |
this.callbackQueue = CallbackQueue.getPooled(); | |
this.reconcileTransaction = ReactUpdates.ReactReconcileTransaction.getPooled( | |
/* useCreateElement */true); | |
} | |
_assign(ReactUpdatesFlushTransaction.prototype, Transaction, { | |
getTransactionWrappers: function () { | |
return TRANSACTION_WRAPPERS; | |
}, | |
destructor: function () { | |
this.dirtyComponentsLength = null; | |
CallbackQueue.release(this.callbackQueue); | |
this.callbackQueue = null; | |
ReactUpdates.ReactReconcileTransaction.release(this.reconcileTransaction); | |
this.reconcileTransaction = null; | |
}, | |
perform: function (method, scope, a) { | |
// Essentially calls `this.reconcileTransaction.perform(method, scope, a)` | |
// with this transaction's wrappers around it. | |
return Transaction.perform.call(this, this.reconcileTransaction.perform, this.reconcileTransaction, method, scope, a); | |
} | |
}); | |
PooledClass.addPoolingTo(ReactUpdatesFlushTransaction); | |
function batchedUpdates(callback, a, b, c, d, e) { | |
ensureInjected(); | |
return batchingStrategy.batchedUpdates(callback, a, b, c, d, e); | |
} | |
/** | |
* Array comparator for ReactComponents by mount ordering. | |
* | |
* @param {ReactComponent} c1 first component you're comparing | |
* @param {ReactComponent} c2 second component you're comparing | |
* @return {number} Return value usable by Array.prototype.sort(). | |
*/ | |
function mountOrderComparator(c1, c2) { | |
return c1._mountOrder - c2._mountOrder; | |
} | |
function runBatchedUpdates(transaction) { | |
var len = transaction.dirtyComponentsLength; | |
!(len === dirtyComponents.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected flush transaction\'s stored dirty-components length (%s) to match dirty-components array length (%s).', len, dirtyComponents.length) : _prodInvariant('124', len, dirtyComponents.length) : void 0; | |
// 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); | |
// 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++; | |
for (var i = 0; i < len; i++) { | |
// If a component is unmounted before pending changes apply, it will still | |
// be here, but we assume that it has cleared its _pendingCallbacks and | |
// that performUpdateIfNecessary is a noop. | |
var component = dirtyComponents[i]; | |
// If performUpdateIfNecessary happens to enqueue any new updates, we | |
// shouldn't execute the callbacks until the next render happens, so | |
// stash the callbacks first | |
var callbacks = component._pendingCallbacks; | |
component._pendingCallbacks = null; | |
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); | |
} | |
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 flushBatchedUpdates = function () { | |
// ReactUpdatesFlushTransaction's wrappers will clear the dirtyComponents | |
// array and perform any updates enqueued by mount-ready handlers (i.e., | |
// componentDidUpdate) but we need to check here too in order to catch | |
// updates enqueued by setState callbacks and asap calls. | |
while (dirtyComponents.length || asapEnqueued) { | |
if (dirtyComponents.length) { | |
var transaction = ReactUpdatesFlushTransaction.getPooled(); | |
transaction.perform(runBatchedUpdates, null, transaction); | |
ReactUpdatesFlushTransaction.release(transaction); | |
} | |
if (asapEnqueued) { | |
asapEnqueued = false; | |
var queue = asapCallbackQueue; | |
asapCallbackQueue = CallbackQueue.getPooled(); | |
queue.notifyAll(); | |
CallbackQueue.release(queue); | |
} | |
} | |
}; | |
/** | |
* Mark a component as needing a rerender, adding an optional callback to a | |
* list of functions which will be executed once the rerender occurs. | |
*/ | |
function enqueueUpdate(component) { | |
ensureInjected(); | |
// Various parts of our code (such as ReactCompositeComponent's | |
// _renderValidatedComponent) assume that calls to render aren't nested; | |
// verify that that's the case. (This is called by each top-level update | |
// function, like 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; | |
} | |
} | |
/** | |
* Enqueue a callback to be run at the end of the current batching cycle. Throws | |
* if no updates are currently being performed. | |
*/ | |
function asap(callback, context) { | |
!batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\'t enqueue an asap callback in a context whereupdates are not being batched.') : _prodInvariant('125') : void 0; | |
asapCallbackQueue.enqueue(callback, context); | |
asapEnqueued = true; | |
} | |
var ReactUpdatesInjection = { | |
injectReconcileTransaction: function (ReconcileTransaction) { | |
!ReconcileTransaction ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a reconcile transaction class') : _prodInvariant('126') : void 0; | |
ReactUpdates.ReactReconcileTransaction = ReconcileTransaction; | |
}, | |
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; | |
} | |
}; | |
var ReactUpdates = { | |
/** | |
* React references `ReactReconcileTransaction` using this property in order | |
* to allow dependency injection. | |
* | |
* @internal | |
*/ | |
ReactReconcileTransaction: null, | |
batchedUpdates: batchedUpdates, | |
enqueueUpdate: enqueueUpdate, | |
flushBatchedUpdates: flushBatchedUpdates, | |
injection: ReactUpdatesInjection, | |
asap: asap | |
}; | |
module.exports = ReactUpdates; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 31 */ | |
/***/ (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. | |
* | |
* | |
*/ | |
/** | |
* Keeps track of the current owner. | |
* | |
* The current owner is the component who should own any components that are | |
* currently being constructed. | |
*/ | |
var ReactCurrentOwner = { | |
/** | |
* @internal | |
* @type {ReactComponent} | |
*/ | |
current: null | |
}; | |
module.exports = ReactCurrentOwner; | |
/***/ }), | |
/* 32 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = function (prefixedValue, value, keepUnprefixed) { | |
return keepUnprefixed ? [prefixedValue, value] : prefixedValue; | |
}; | |
module.exports = exports["default"]; | |
/***/ }), | |
/* 33 */ | |
/***/ (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 _assign = __webpack_require__(14); | |
var PooledClass = __webpack_require__(48); | |
var emptyFunction = __webpack_require__(24); | |
var warning = __webpack_require__(10); | |
var didWarnForAddedNewProperty = false; | |
var isProxySupported = typeof Proxy === 'function'; | |
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 | |
}; | |
/** | |
* Synthetic events are dispatched by event plugins, typically in response to a | |
* top-level event delegation handler. | |
* | |
* These systems should generally use pooling to reduce the frequency of garbage | |
* collection. The system should check `isPersistent` to determine whether the | |
* event should be released into the pool after being dispatched. Users that | |
* need a persisted event should invoke `persist`. | |
* | |
* Synthetic events (and subclasses) implement the DOM Level 3 Events API by | |
* normalizing browser quirks. Subclasses do not necessarily have to implement a | |
* DOM interface; custom application-specific events can also subclass this. | |
* | |
* @param {object} dispatchConfig Configuration used to dispatch this event. | |
* @param {*} targetInst Marker identifying the event target. | |
* @param {object} nativeEvent Native browser event. | |
* @param {DOMEventTarget} nativeEventTarget Target node. | |
*/ | |
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(); | |
} else if (typeof event.returnValue !== 'unknown') { | |
// eslint-disable-line valid-typeof | |
event.returnValue = false; | |
} | |
this.isDefaultPrevented = emptyFunction.thatReturnsTrue; | |
}, | |
stopPropagation: function () { | |
var event = this.nativeEvent; | |
if (!event) { | |
return; | |
} | |
if (event.stopPropagation) { | |
event.stopPropagation(); | |
} else if (typeof event.cancelBubble !== 'unknown') { | |
// eslint-disable-line valid-typeof | |
// 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; | |
}, | |
/** | |
* We release all dispatched `SyntheticEvent`s after each event loop, adding | |
* them back into the pool. This allows a way to hold onto a reference that | |
* won't be added back into the pool. | |
*/ | |
persist: function () { | |
this.isPersistent = emptyFunction.thatReturnsTrue; | |
}, | |
/** | |
* Checks if this event should be released back into the pool. | |
* | |
* @return {boolean} True if this should not be released, false otherwise. | |
*/ | |
isPersistent: emptyFunction.thatReturnsFalse, | |
/** | |
* `PooledClass` looks for `destructor` on each instance it releases. | |
*/ | |
destructor: function () { | |
var Interface = this.constructor.Interface; | |
for (var propName in Interface) { | |
if (process.env.NODE_ENV !== 'production') { | |
Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName])); | |
} else { | |
this[propName] = null; | |
} | |
} | |
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; | |
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 */ | |
} | |
} | |
/** | |
* Helper to reduce boilerplate when creating subclasses. | |
* | |
* @param {function} Class | |
* @param {?object} Interface | |
*/ | |
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; | |
PooledClass.addPoolingTo(Class, PooledClass.fourArgumentPooler); | |
}; | |
PooledClass.addPoolingTo(SyntheticEvent, PooledClass.fourArgumentPooler); | |
module.exports = SyntheticEvent; | |
/** | |
* 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; | |
} | |
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; | |
} | |
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; | |
} | |
} | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 34 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _getPrototypeOf = __webpack_require__(4); | |
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | |
var _classCallCheck2 = __webpack_require__(2); | |
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | |
var _createClass2 = __webpack_require__(3); | |
var _createClass3 = _interopRequireDefault(_createClass2); | |
var _possibleConstructorReturn2 = __webpack_require__(6); | |
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | |
var _inherits2 = __webpack_require__(5); | |
var _inherits3 = _interopRequireDefault(_inherits2); | |
var _typeof2 = __webpack_require__(42); | |
var _typeof3 = _interopRequireDefault(_typeof2); | |
var _keys = __webpack_require__(95); | |
var _keys2 = _interopRequireDefault(_keys); | |
var _assign = __webpack_require__(167); | |
var _assign2 = _interopRequireDefault(_assign); | |
exports.withOptions = withOptions; | |
var _react = __webpack_require__(1); | |
var _react2 = _interopRequireDefault(_react); | |
var _reactAddonsShallowCompare = __webpack_require__(448); | |
var _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare); | |
var _warning = __webpack_require__(20); | |
var _warning2 = _interopRequireDefault(_warning); | |
var _supports = __webpack_require__(521); | |
var supports = _interopRequireWildcard(_supports); | |
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
/* eslint-disable prefer-spread */ | |
var defaultEventOptions = { | |
capture: false, | |
passive: false | |
}; | |
function mergeDefaultEventOptions(options) { | |
return (0, _assign2.default)({}, defaultEventOptions, options); | |
} | |
function getEventListenerArgs(eventName, callback, options) { | |
var args = [eventName, callback]; | |
args.push(supports.passiveOption ? options : options.capture); | |
return args; | |
} | |
function on(target, eventName, callback, options) { | |
if (supports.addEventListener) { | |
target.addEventListener.apply(target, getEventListenerArgs(eventName, callback, options)); | |
} else if (supports.attachEvent) { | |
// IE8+ Support | |
target.attachEvent('on' + eventName, function () { | |
callback.call(target); | |
}); | |
} | |
} | |
function off(target, eventName, callback, options) { | |
if (supports.removeEventListener) { | |
target.removeEventListener.apply(target, getEventListenerArgs(eventName, callback, options)); | |
} else if (supports.detachEvent) { | |
// IE8+ Support | |
target.detachEvent('on' + eventName, callback); | |
} | |
} | |
var state = {}; | |
function forEachListener(props, iteratee) { | |
(0, _keys2.default)(props).forEach(function (name) { | |
if (name.substring(0, 2) !== 'on') { | |
return; | |
} | |
var prop = props[name]; | |
var type = typeof prop === 'undefined' ? 'undefined' : (0, _typeof3.default)(prop); | |
var isObject = type === 'object'; | |
var isFunction = type === 'function'; | |
if (!isObject && !isFunction) { | |
return; | |
} | |
var capture = name.substr(-7).toLowerCase() === 'capture'; | |
var eventName = name.substring(2).toLowerCase(); | |
eventName = capture ? eventName.substring(0, eventName.length - 7) : eventName; | |
if (isObject) { | |
iteratee(eventName, prop.handler, prop.options); | |
} else { | |
iteratee(eventName, prop, mergeDefaultEventOptions({ capture: capture })); | |
} | |
}); | |
} | |
function withOptions(handler, options) { | |
process.env.NODE_ENV !== "production" ? (0, _warning2.default)(options, 'react-event-listener: Should be specified options in withOptions.') : void 0; | |
return { | |
handler: handler, | |
options: mergeDefaultEventOptions(options) | |
}; | |
} | |
var EventListener = function (_Component) { | |
(0, _inherits3.default)(EventListener, _Component); | |
function EventListener() { | |
(0, _classCallCheck3.default)(this, EventListener); | |
return (0, _possibleConstructorReturn3.default)(this, (EventListener.__proto__ || (0, _getPrototypeOf2.default)(EventListener)).apply(this, arguments)); | |
} | |
(0, _createClass3.default)(EventListener, [{ | |
key: 'componentDidMount', | |
value: function componentDidMount() { | |
this.addListeners(); | |
} | |
}, { | |
key: 'shouldComponentUpdate', | |
value: function shouldComponentUpdate(nextProps) { | |
return (0, _reactAddonsShallowCompare2.default)({ | |
props: this.props, | |
state: state | |
}, nextProps, state); | |
} | |
}, { | |
key: 'componentWillUpdate', | |
value: function componentWillUpdate() { | |
this.removeListeners(); | |
} | |
}, { | |
key: 'componentDidUpdate', | |
value: function componentDidUpdate() { | |
this.addListeners(); | |
} | |
}, { | |
key: 'componentWillUnmount', | |
value: function componentWillUnmount() { | |
this.removeListeners(); | |
} | |
}, { | |
key: 'addListeners', | |
value: function addListeners() { | |
this.applyListeners(on); | |
} | |
}, { | |
key: 'removeListeners', | |
value: function removeListeners() { | |
this.applyListeners(off); | |
} | |
}, { | |
key: 'applyListeners', | |
value: function applyListeners(onOrOff) { | |
var target = this.props.target; | |
if (target) { | |
var element = target; | |
if (typeof target === 'string') { | |
element = window[target]; | |
} | |
forEachListener(this.props, onOrOff.bind(null, element)); | |
} | |
} | |
}, { | |
key: 'render', | |
value: function render() { | |
return this.props.children || null; | |
} | |
}]); | |
return EventListener; | |
}(_react.Component); | |
process.env.NODE_ENV !== "production" ? EventListener.propTypes = { | |
/** | |
* You can provide a single child too. | |
*/ | |
children: _react.PropTypes.element, | |
/** | |
* The DOM target to listen to. | |
*/ | |
target: _react.PropTypes.oneOfType([_react.PropTypes.object, _react.PropTypes.string]).isRequired | |
} : void 0; | |
exports.default = EventListener; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 35 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
var global = __webpack_require__(36) | |
, core = __webpack_require__(22) | |
, ctx = __webpack_require__(98) | |
, hide = __webpack_require__(53) | |
, PROTOTYPE = 'prototype'; | |
var $export = function(type, name, source){ | |
var IS_FORCED = type & $export.F | |
, IS_GLOBAL = type & $export.G | |
, IS_STATIC = type & $export.S | |
, IS_PROTO = type & $export.P | |
, IS_BIND = type & $export.B | |
, IS_WRAP = type & $export.W | |
, exports = IS_GLOBAL ? core : core[name] || (core[name] = {}) | |
, expProto = exports[PROTOTYPE] | |
, target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE] | |
, key, own, out; | |
if(IS_GLOBAL)source = name; | |
for(key in source){ | |
// contains in native | |
own = !IS_FORCED && target && target[key] !== undefined; | |
if(own && key in exports)continue; | |
// export native or passed | |
out = own ? target[key] : source[key]; | |
// prevent global pollution for namespaces | |
exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key] | |
// bind timers to global for call from export context | |
: IS_BIND && own ? ctx(out, global) | |
// wrap global constructors for prevent change them in library | |
: IS_WRAP && target[key] == out ? (function(C){ | |
var F = function(a, b, c){ | |
if(this instanceof C){ | |
switch(arguments.length){ | |
case 0: return new C; | |
case 1: return new C(a); | |
case 2: return new C(a, b); | |
} return new C(a, b, c); | |
} return C.apply(this, arguments); | |
}; | |
F[PROTOTYPE] = C[PROTOTYPE]; | |
return F; | |
// make static versions for prototype methods | |
})(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; | |
// export proto methods to core.%CONSTRUCTOR%.methods.%NAME% | |
if(IS_PROTO){ | |
(exports.virtual || (exports.virtual = {}))[key] = out; | |
// export proto methods to core.%CONSTRUCTOR%.prototype.%NAME% | |
if(type & $export.R && expProto && !expProto[key])hide(expProto, key, out); | |
} | |
} | |
}; | |
// type bitmap | |
$export.F = 1; // forced | |
$export.G = 2; // global | |
$export.S = 4; // static | |
$export.P = 8; // proto | |
$export.B = 16; // bind | |
$export.W = 32; // wrap | |
$export.U = 64; // safe | |
$export.R = 128; // real proto method for `library` | |
module.exports = $export; | |
/***/ }), | |
/* 36 */ | |
/***/ (function(module, exports) { | |
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 | |
var global = module.exports = typeof window != 'undefined' && window.Math == Math | |
? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')(); | |
if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef | |
/***/ }), | |
/* 37 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
var anObject = __webpack_require__(43) | |
, IE8_DOM_DEFINE = __webpack_require__(172) | |
, toPrimitive = __webpack_require__(108) | |
, dP = Object.defineProperty; | |
exports.f = __webpack_require__(44) ? Object.defineProperty : function defineProperty(O, P, Attributes){ | |
anObject(O); | |
P = toPrimitive(P, true); | |
anObject(Attributes); | |
if(IE8_DOM_DEFINE)try { | |
return dP(O, P, Attributes); | |
} catch(e){ /* empty */ } | |
if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!'); | |
if('value' in Attributes)O[P] = Attributes.value; | |
return O; | |
}; | |
/***/ }), | |
/* 38 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.convertColorToString = convertColorToString; | |
exports.convertHexToRGB = convertHexToRGB; | |
exports.decomposeColor = decomposeColor; | |
exports.getContrastRatio = getContrastRatio; | |
exports.getLuminance = getLuminance; | |
exports.emphasize = emphasize; | |
exports.fade = fade; | |
exports.darken = darken; | |
exports.lighten = lighten; | |
var _warning = __webpack_require__(20); | |
var _warning2 = _interopRequireDefault(_warning); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
/** | |
* Returns a number whose value is limited to the given range. | |
* | |
* @param {number} value The value to be clamped | |
* @param {number} min The lower boundary of the output range | |
* @param {number} max The upper boundary of the output range | |
* @returns {number} A number in the range [min, max] | |
*/ | |
function clamp(value, min, max) { | |
if (value < min) { | |
return min; | |
} | |
if (value > max) { | |
return max; | |
} | |
return value; | |
} | |
/** | |
* Converts a color object with type and values to a string. | |
* | |
* @param {object} color - Decomposed color | |
* @param {string} color.type - One of, 'rgb', 'rgba', 'hsl', 'hsla' | |
* @param {array} color.values - [n,n,n] or [n,n,n,n] | |
* @returns {string} A CSS color string | |
*/ | |
function convertColorToString(color) { | |
var type = color.type, | |
values = color.values; | |
if (type.indexOf('rgb') > -1) { | |
// Only convert the first 3 values to int (i.e. not alpha) | |
for (var i = 0; i < 3; i++) { | |
values[i] = parseInt(values[i]); | |
} | |
} | |
var colorString = void 0; | |
if (type.indexOf('hsl') > -1) { | |
colorString = color.type + '(' + values[0] + ', ' + values[1] + '%, ' + values[2] + '%'; | |
} else { | |
colorString = color.type + '(' + values[0] + ', ' + values[1] + ', ' + values[2]; | |
} | |
if (values.length === 4) { | |
colorString += ', ' + color.values[3] + ')'; | |
} else { | |
colorString += ')'; | |
} | |
return colorString; | |
} | |
/** | |
* Converts a color from CSS hex format to CSS rgb format. | |
* | |
* @param {string} color - Hex color, i.e. #nnn or #nnnnnn | |
* @returns {string} A CSS rgb color string | |
*/ | |
function convertHexToRGB(color) { | |
if (color.length === 4) { | |
var extendedColor = '#'; | |
for (var i = 1; i < color.length; i++) { | |
extendedColor += color.charAt(i) + color.charAt(i); | |
} | |
color = extendedColor; | |
} | |
var values = { | |
r: parseInt(color.substr(1, 2), 16), | |
g: parseInt(color.substr(3, 2), 16), | |
b: parseInt(color.substr(5, 2), 16) | |
}; | |
return 'rgb(' + values.r + ', ' + values.g + ', ' + values.b + ')'; | |
} | |
/** | |
* Returns an object with the type and values of a color. | |
* | |
* Note: Does not support rgb % values and color names. | |
* | |
* @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla() | |
* @returns {{type: string, values: number[]}} A MUI color object | |
*/ | |
function decomposeColor(color) { | |
if (color.charAt(0) === '#') { | |
return decomposeColor(convertHexToRGB(color)); | |
} | |
var marker = color.indexOf('('); | |
process.env.NODE_ENV !== "production" ? (0, _warning2.default)(marker !== -1, 'Material-UI: The ' + color + ' color was not parsed correctly,\n because it has an unsupported format (color name or RGB %). This may cause issues in component rendering.') : void 0; | |
var type = color.substring(0, marker); | |
var values = color.substring(marker + 1, color.length - 1).split(','); | |
values = values.map(function (value) { | |
return parseFloat(value); | |
}); | |
return { type: type, values: values }; | |
} | |
/** | |
* Calculates the contrast ratio between two colors. | |
* | |
* Formula: http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef | |
* | |
* @param {string} foreground - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla() | |
* @param {string} background - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla() | |
* @returns {number} A contrast ratio value in the range 0 - 21 with 2 digit precision. | |
*/ | |
function getContrastRatio(foreground, background) { | |
var lumA = getLuminance(foreground); | |
var lumB = getLuminance(background); | |
var contrastRatio = (Math.max(lumA, lumB) + 0.05) / (Math.min(lumA, lumB) + 0.05); | |
return Number(contrastRatio.toFixed(2)); // Truncate at two digits | |
} | |
/** | |
* The relative brightness of any point in a color space, | |
* normalized to 0 for darkest black and 1 for lightest white. | |
* | |
* Formula: https://www.w3.org/WAI/GL/wiki/Relative_luminance | |
* | |
* @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla() | |
* @returns {number} The relative brightness of the color in the range 0 - 1 | |
*/ | |
function getLuminance(color) { | |
color = decomposeColor(color); | |
if (color.type.indexOf('rgb') > -1) { | |
var rgb = color.values.map(function (val) { | |
val /= 255; // normalized | |
return val <= 0.03928 ? val / 12.92 : Math.pow((val + 0.055) / 1.055, 2.4); | |
}); | |
return Number((0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2]).toFixed(3)); // Truncate at 3 digits | |
} else if (color.type.indexOf('hsl') > -1) { | |
return color.values[2] / 100; | |
} | |
} | |
/** | |
* Darken or lighten a colour, depending on its luminance. | |
* Light colors are darkened, dark colors are lightened. | |
* | |
* @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla() | |
* @param {number} coefficient=0.15 - multiplier in the range 0 - 1 | |
* @returns {string} A CSS color string. Hex input values are returned as rgb | |
*/ | |
function emphasize(color) { | |
var coefficient = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.15; | |
return getLuminance(color) > 0.5 ? darken(color, coefficient) : lighten(color, coefficient); | |
} | |
/** | |
* Set the absolute transparency of a color. | |
* Any existing alpha values are overwritten. | |
* | |
* @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla() | |
* @param {number} value - value to set the alpha channel to in the range 0 -1 | |
* @returns {string} A CSS color string. Hex input values are returned as rgb | |
*/ | |
function fade(color, value) { | |
color = decomposeColor(color); | |
value = clamp(value, 0, 1); | |
if (color.type === 'rgb' || color.type === 'hsl') { | |
color.type += 'a'; | |
} | |
color.values[3] = value; | |
return convertColorToString(color); | |
} | |
/** | |
* Darkens a color. | |
* | |
* @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla() | |
* @param {number} coefficient - multiplier in the range 0 - 1 | |
* @returns {string} A CSS color string. Hex input values are returned as rgb | |
*/ | |
function darken(color, coefficient) { | |
color = decomposeColor(color); | |
coefficient = clamp(coefficient, 0, 1); | |
if (color.type.indexOf('hsl') > -1) { | |
color.values[2] *= 1 - coefficient; | |
} else if (color.type.indexOf('rgb') > -1) { | |
for (var i = 0; i < 3; i++) { | |
color.values[i] *= 1 - coefficient; | |
} | |
} | |
return convertColorToString(color); | |
} | |
/** | |
* Lightens a color. | |
* | |
* @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla() | |
* @param {number} coefficient - multiplier in the range 0 - 1 | |
* @returns {string} A CSS color string. Hex input values are returned as rgb | |
*/ | |
function lighten(color, coefficient) { | |
color = decomposeColor(color); | |
coefficient = clamp(coefficient, 0, 1); | |
if (color.type.indexOf('hsl') > -1) { | |
color.values[2] += (100 - color.values[2]) * coefficient; | |
} else if (color.type.indexOf('rgb') > -1) { | |
for (var i = 0; i < 3; i++) { | |
color.values[i] += (255 - color.values[i]) * coefficient; | |
} | |
} | |
return convertColorToString(color); | |
} | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 39 */ | |
/***/ (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 _prodInvariant = __webpack_require__(13); | |
var invariant = __webpack_require__(11); | |
function checkMask(value, bitmask) { | |
return (value & bitmask) === bitmask; | |
} | |
var DOMPropertyInjection = { | |
/** | |
* Mapping from normalized, camelcased property names to a configuration that | |
* specifies how the associated DOM property should be accessed or rendered. | |
*/ | |
MUST_USE_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; | |
} | |
} | |
}; | |
/* 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 */ | |
/** | |
* DOMProperty exports lookup objects that can be used like functions: | |
* | |
* > DOMProperty.isValid['id'] | |
* true | |
* > DOMProperty.isValid['foobar'] | |
* undefined | |
* | |
* Although this may be confusing, it performs better in general. | |
* | |
* @see http://jsperf.com/key-exists | |
* @see http://jsperf.com/key-missing | |
*/ | |
var DOMProperty = { | |
ID_ATTRIBUTE_NAME: 'data-reactid', | |
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; | |
}, | |
injection: DOMPropertyInjection | |
}; | |
module.exports = DOMProperty; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 40 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) {/** | |
* Copyright 2014-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 _assign = __webpack_require__(14); | |
var ReactCurrentOwner = __webpack_require__(31); | |
var warning = __webpack_require__(10); | |
var canDefineProperty = __webpack_require__(140); | |
var hasOwnProperty = Object.prototype.hasOwnProperty; | |
var REACT_ELEMENT_TYPE = __webpack_require__(221); | |
var RESERVED_PROPS = { | |
key: true, | |
ref: true, | |
__self: true, | |
__source: true | |
}; | |
var specialPropKeyWarningShown, specialPropRefWarningShown; | |
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; | |
} | |
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; | |
} | |
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 | |
}); | |
} | |
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 | |
}); | |
} | |
/** | |
* 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. | |
* | |
* @param {*} type | |
* @param {*} key | |
* @param {string|object} ref | |
* @param {*} self A *temporary* helper to detect places where `this` is | |
* different from the `owner` when React.createElement is called, so that we | |
* can warn. We want to get rid of owner and replace string `ref`s with arrow | |
* functions, and as long as `this` and owner are the same, there will be no | |
* change in behavior. | |
* @param {*} source An annotation object (added by a transpiler or otherwise) | |
* indicating filename, line number, and/or other information. | |
* @param {*} owner | |
* @param {*} props | |
* @internal | |
*/ | |
var ReactElement = function (type, key, ref, self, source, owner, props) { | |
var element = { | |
// This tag allow us to uniquely identify this as a React Element | |
$$typeof: REACT_ELEMENT_TYPE, | |
// Built-in properties that belong on the element | |
type: type, | |
key: key, | |
ref: ref, | |
props: props, | |
// Record the component responsible for creating this element. | |
_owner: owner | |
}; | |
if (process.env.NODE_ENV !== 'production') { | |
// The validation flag is currently mutative. We put it on | |
// an external backing store so that we can freeze the whole object. | |
// This can be replaced with a WeakMap once they are implemented in | |
// commonly used development environments. | |
element._store = {}; | |
// To make comparing ReactElements easier for testing purposes, we make | |
// the validation flag non-enumerable (where possible, which should | |
// include every environment we run tests in), so the test framework | |
// ignores it. | |
if (canDefineProperty) { | |
Object.defineProperty(element._store, 'validated', { | |
configurable: false, | |
enumerable: false, | |
writable: true, | |
value: false | |
}); | |
// self and source are DEV only properties. | |
Object.defineProperty(element, '_self', { | |
configurable: false, | |
enumerable: false, | |
writable: false, | |
value: self | |
}); | |
// Two elements created in two different places should be considered | |
// equal for testing purposes and therefore we hide it from enumeration. | |
Object.defineProperty(element, '_source', { | |
configurable: false, | |
enumerable: false, | |
writable: false, | |
value: source | |
}); | |
} else { | |
element._store.validated = false; | |
element._self = self; | |
element._source = source; | |
} | |
if (Object.freeze) { | |
Object.freeze(element.props); | |
Object.freeze(element); | |
} | |
} | |
return element; | |
}; | |
/** | |
* Create and return a new ReactElement of the given type. | |
* See https://facebook.github.io/react/docs/top-level-api.html#react.createelement | |
*/ | |
ReactElement.createElement = function (type, config, children) { | |
var propName; | |
// Reserved names are extracted | |
var props = {}; | |
var key = null; | |
var ref = null; | |
var self = null; | |
var source = null; | |
if (config != null) { | |
if (hasValidRef(config)) { | |
ref = config.ref; | |
} | |
if (hasValidKey(config)) { | |
key = '' + config.key; | |
} | |
self = config.__self === undefined ? null : config.__self; | |
source = config.__source === undefined ? null : config.__source; | |
// Remaining properties are added to a new props object | |
for (propName in config) { | |
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { | |
props[propName] = config[propName]; | |
} | |
} | |
} | |
// Children can be more than one argument, and those are transferred onto | |
// the newly allocated props object. | |
var childrenLength = arguments.length - 2; | |
if (childrenLength === 1) { | |
props.children = children; | |
} else if (childrenLength > 1) { | |
var childArray = Array(childrenLength); | |
for (var i = 0; i < childrenLength; i++) { | |
childArray[i] = arguments[i + 2]; | |
} | |
if (process.env.NODE_ENV !== 'production') { | |
if (Object.freeze) { | |
Object.freeze(childArray); | |
} | |
} | |
props.children = childArray; | |
} | |
// 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. `<Foo />.type === Foo`. | |
// This should not be named `constructor` since this may not be the function | |
// that created the element, and it may not even be a constructor. | |
// Legacy hook TODO: Warn if this is accessed | |
factory.type = type; | |
return factory; | |
}; | |
ReactElement.cloneAndReplaceKey = function (oldElement, newKey) { | |
var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props); | |
return newElement; | |
}; | |
/** | |
* 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))) | |
/***/ }), | |
/* 41 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"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. | |
* | |
* | |
*/ | |
/** | |
* 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. | |
*/ | |
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]); | |
} | |
message += ' for the full message or use the non-minified dev environment' + ' for full errors and additional helpful warnings.'; | |
var error = new Error(message); | |
error.name = 'Invariant Violation'; | |
error.framesToPop = 1; // we don't care about reactProdInvariant's own frame | |
throw error; | |
} | |
module.exports = reactProdInvariant; | |
/***/ }), | |
/* 42 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
exports.__esModule = true; | |
var _iterator = __webpack_require__(262); | |
var _iterator2 = _interopRequireDefault(_iterator); | |
var _symbol = __webpack_require__(261); | |
var _symbol2 = _interopRequireDefault(_symbol); | |
var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; }; | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) { | |
return typeof obj === "undefined" ? "undefined" : _typeof(obj); | |
} : function (obj) { | |
return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj); | |
}; | |
/***/ }), | |
/* 43 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
var isObject = __webpack_require__(62); | |
module.exports = function(it){ | |
if(!isObject(it))throw TypeError(it + ' is not an object!'); | |
return it; | |
}; | |
/***/ }), | |
/* 44 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
// Thank's IE8 for his funny defineProperty | |
module.exports = !__webpack_require__(52)(function(){ | |
return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7; | |
}); | |
/***/ }), | |
/* 45 */ | |
/***/ (function(module, exports) { | |
var hasOwnProperty = {}.hasOwnProperty; | |
module.exports = function(it, key){ | |
return hasOwnProperty.call(it, key); | |
}; | |
/***/ }), | |
/* 46 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
// to indexed object, toObject with fallback for non-array-like ES3 strings | |
var IObject = __webpack_require__(173) | |
, defined = __webpack_require__(99); | |
module.exports = function(it){ | |
return IObject(defined(it)); | |
}; | |
/***/ }), | |
/* 47 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = { | |
set: function set(style, key, value) { | |
style[key] = value; | |
} | |
}; | |
/***/ }), | |
/* 48 */ | |
/***/ (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 _prodInvariant = __webpack_require__(13); | |
var invariant = __webpack_require__(11); | |
/** | |
* Static poolers. Several custom versions for each potential number of | |
* arguments. A completely generic pooler is easy to implement, but would | |
* require accessing the `arguments` object. In each of these, `this` refers to | |
* the Class itself, not an instance. If any others are needed, simply add them | |
* here, or in their own files. | |
*/ | |
var oneArgumentPooler = function (copyFieldsFrom) { | |
var Klass = this; | |
if (Klass.instancePool.length) { | |
var instance = Klass.instancePool.pop(); | |
Klass.call(instance, copyFieldsFrom); | |
return instance; | |
} else { | |
return new Klass(copyFieldsFrom); | |
} | |
}; | |
var twoArgumentPooler = function (a1, a2) { | |
var Klass = this; | |
if (Klass.instancePool.length) { | |
var instance = Klass.instancePool.pop(); | |
Klass.call(instance, a1, a2); | |
return instance; | |
} else { | |
return new Klass(a1, a2); | |
} | |
}; | |
var threeArgumentPooler = function (a1, a2, a3) { | |
var Klass = this; | |
if (Klass.instancePool.length) { | |
var instance = Klass.instancePool.pop(); | |
Klass.call(instance, a1, a2, a3); | |
return instance; | |
} else { | |
return new Klass(a1, a2, a3); | |
} | |
}; | |
var fourArgumentPooler = function (a1, a2, a3, a4) { | |
var Klass = this; | |
if (Klass.instancePool.length) { | |
var instance = Klass.instancePool.pop(); | |
Klass.call(instance, a1, a2, a3, a4); | |
return instance; | |
} else { | |
return new Klass(a1, a2, a3, a4); | |
} | |
}; | |
var 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); | |
} | |
}; | |
var DEFAULT_POOL_SIZE = 10; | |
var DEFAULT_POOLER = oneArgumentPooler; | |
/** | |
* Augments `CopyConstructor` to be a poolable class, augmenting only the class | |
* itself (statically) not adding any prototypical fields. Any CopyConstructor | |
* you give this may have a `poolSize` property, and will look for a | |
* prototypical `destructor` on instances. | |
* | |
* @param {Function} CopyConstructor Constructor that can be used to reset. | |
* @param {Function} pooler Customizable pooler. | |
*/ | |
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; | |
} | |
NewKlass.release = standardReleaser; | |
return NewKlass; | |
}; | |
var PooledClass = { | |
addPoolingTo: addPoolingTo, | |
oneArgumentPooler: oneArgumentPooler, | |
twoArgumentPooler: twoArgumentPooler, | |
threeArgumentPooler: threeArgumentPooler, | |
fourArgumentPooler: fourArgumentPooler | |
}; | |
module.exports = PooledClass; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 49 */ | |
/***/ (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 _assign = __webpack_require__(14); | |
var ReactChildren = __webpack_require__(220); | |
var ReactComponent = __webpack_require__(137); | |
var ReactPureComponent = __webpack_require__(527); | |
var ReactClass = __webpack_require__(523); | |
var ReactDOMFactories = __webpack_require__(524); | |
var ReactElement = __webpack_require__(40); | |
var ReactPropTypes = __webpack_require__(526); | |
var ReactVersion = __webpack_require__(530); | |
var onlyChild = __webpack_require__(533); | |
var warning = __webpack_require__(10); | |
var createElement = ReactElement.createElement; | |
var createFactory = ReactElement.createFactory; | |
var cloneElement = ReactElement.cloneElement; | |
if (process.env.NODE_ENV !== 'production') { | |
var ReactElementValidator = __webpack_require__(222); | |
createElement = ReactElementValidator.createElement; | |
createFactory = ReactElementValidator.createFactory; | |
cloneElement = ReactElementValidator.cloneElement; | |
} | |
var __spread = _assign; | |
if (process.env.NODE_ENV !== 'production') { | |
var warned = false; | |
__spread = function () { | |
process.env.NODE_ENV !== 'production' ? warning(warned, 'React.__spread is deprecated and should not be used. Use ' + 'Object.assign directly or another helper function with similar ' + 'semantics. You may be seeing this warning due to your compiler. ' + 'See https://fb.me/react-spread-deprecation for more details.') : void 0; | |
warned = true; | |
return _assign.apply(null, arguments); | |
}; | |
} | |
var React = { | |
// Modern | |
Children: { | |
map: ReactChildren.map, | |
forEach: ReactChildren.forEach, | |
count: ReactChildren.count, | |
toArray: ReactChildren.toArray, | |
only: onlyChild | |
}, | |
Component: ReactComponent, | |
PureComponent: ReactPureComponent, | |
createElement: createElement, | |
cloneElement: cloneElement, | |
isValidElement: ReactElement.isValidElement, | |
// Classic | |
PropTypes: ReactPropTypes, | |
createClass: ReactClass.createClass, | |
createFactory: createFactory, | |
createMixin: function (mixin) { | |
// Currently a noop. Will be used to validate and trace mixins. | |
return mixin; | |
}, | |
// This looks DOM specific but these are actually isomorphic helpers | |
// since they are just generating DOM strings. | |
DOM: ReactDOMFactories, | |
version: ReactVersion, | |
// Deprecated hook for JSX spread, don't use this for anything. | |
__spread: __spread | |
}; | |
module.exports = React; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 50 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
exports.__esModule = true; | |
var _shallowEqual = __webpack_require__(66); | |
var _shallowEqual2 = _interopRequireDefault(_shallowEqual); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.default = _shallowEqual2.default; | |
/***/ }), | |
/* 51 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = undefined; | |
var _IconButton = __webpack_require__(379); | |
var _IconButton2 = _interopRequireDefault(_IconButton); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.default = _IconButton2.default; | |
/***/ }), | |
/* 52 */ | |
/***/ (function(module, exports) { | |
module.exports = function(exec){ | |
try { | |
return !!exec(); | |
} catch(e){ | |
return true; | |
} | |
}; | |
/***/ }), | |
/* 53 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
var dP = __webpack_require__(37) | |
, createDesc = __webpack_require__(63); | |
module.exports = __webpack_require__(44) ? function(object, key, value){ | |
return dP.f(object, key, createDesc(1, value)); | |
} : function(object, key, value){ | |
object[key] = value; | |
return object; | |
}; | |
/***/ }), | |
/* 54 */ | |
/***/ (function(module, exports) { | |
module.exports = {}; | |
/***/ }), | |
/* 55 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
// 19.1.2.14 / 15.2.3.14 Object.keys(O) | |
var $keys = __webpack_require__(178) | |
, enumBugKeys = __webpack_require__(100); | |
module.exports = Object.keys || function keys(O){ | |
return $keys(O, enumBugKeys); | |
}; | |
/***/ }), | |
/* 56 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.dateTimeFormat = dateTimeFormat; | |
exports.addDays = addDays; | |
exports.addMonths = addMonths; | |
exports.addYears = addYears; | |
exports.cloneDate = cloneDate; | |
exports.cloneAsDate = cloneAsDate; | |
exports.getDaysInMonth = getDaysInMonth; | |
exports.getFirstDayOfMonth = getFirstDayOfMonth; | |
exports.getFirstDayOfWeek = getFirstDayOfWeek; | |
exports.getWeekArray = getWeekArray; | |
exports.localizedWeekday = localizedWeekday; | |
exports.formatIso = formatIso; | |
exports.isEqualDate = isEqualDate; | |
exports.isBeforeDate = isBeforeDate; | |
exports.isAfterDate = isAfterDate; | |
exports.isBetweenDates = isBetweenDates; | |
exports.monthDiff = monthDiff; | |
exports.yearDiff = yearDiff; | |
var _warning = __webpack_require__(20); | |
var _warning2 = _interopRequireDefault(_warning); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
var dayAbbreviation = ['S', 'M', 'T', 'W', 'T', 'F', 'S']; | |
var dayList = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; | |
var monthList = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; | |
var monthLongList = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']; | |
function dateTimeFormat(locale, options) { | |
process.env.NODE_ENV !== "production" ? (0, _warning2.default)(locale === 'en-US', 'Material-UI: The ' + locale + ' locale is not supported by the built-in DateTimeFormat.\n Use the `DateTimeFormat` prop to supply an alternative implementation.') : void 0; | |
this.format = function (date) { | |
if (options.month === 'short' && options.weekday === 'short' && options.day === '2-digit') { | |
return dayList[date.getDay()] + ', ' + monthList[date.getMonth()] + ' ' + date.getDate(); | |
} else if (options.year === 'numeric' && options.month === 'numeric' && options.day === 'numeric') { | |
return date.getMonth() + 1 + '/' + date.getDate() + '/' + date.getFullYear(); | |
} else if (options.year === 'numeric' && options.month === 'long') { | |
return monthLongList[date.getMonth()] + ' ' + date.getFullYear(); | |
} else if (options.weekday === 'narrow') { | |
return dayAbbreviation[date.getDay()]; | |
} else if (options.year === 'numeric') { | |
return date.getFullYear().toString(); | |
} else if (options.day === 'numeric') { | |
return date.getDate(); | |
} else { | |
process.env.NODE_ENV !== "production" ? (0, _warning2.default)(false, 'Material-UI: Wrong usage of DateTimeFormat') : void 0; | |
} | |
}; | |
} | |
function addDays(d, days) { | |
var newDate = cloneDate(d); | |
newDate.setDate(d.getDate() + days); | |
return newDate; | |
} | |
function addMonths(d, months) { | |
var newDate = cloneDate(d); | |
newDate.setMonth(d.getMonth() + months); | |
return newDate; | |
} | |
function addYears(d, years) { | |
var newDate = cloneDate(d); | |
newDate.setFullYear(d.getFullYear() + years); | |
return newDate; | |
} | |
function cloneDate(d) { | |
return new Date(d.getTime()); | |
} | |
function cloneAsDate(d) { | |
var clonedDate = cloneDate(d); | |
clonedDate.setHours(0, 0, 0, 0); | |
return clonedDate; | |
} | |
function getDaysInMonth(d) { | |
var resultDate = getFirstDayOfMonth(d); | |
resultDate.setMonth(resultDate.getMonth() + 1); | |
resultDate.setDate(resultDate.getDate() - 1); | |
return resultDate.getDate(); | |
} | |
function getFirstDayOfMonth(d) { | |
return new Date(d.getFullYear(), d.getMonth(), 1); | |
} | |
function getFirstDayOfWeek() { | |
var now = new Date(); | |
return new Date(now.setDate(now.getDate() - now.getDay())); | |
} | |
function getWeekArray(d, firstDayOfWeek) { | |
var dayArray = []; | |
var daysInMonth = getDaysInMonth(d); | |
var weekArray = []; | |
var week = []; | |
for (var i = 1; i <= daysInMonth; i++) { | |
dayArray.push(new Date(d.getFullYear(), d.getMonth(), i)); | |
} | |
var addWeek = function addWeek(week) { | |
var emptyDays = 7 - week.length; | |
for (var _i = 0; _i < emptyDays; ++_i) { | |
week[weekArray.length ? 'push' : 'unshift'](null); | |
} | |
weekArray.push(week); | |
}; | |
dayArray.forEach(function (day) { | |
if (week.length > 0 && day.getDay() === firstDayOfWeek) { | |
addWeek(week); | |
week = []; | |
} | |
week.push(day); | |
if (dayArray.indexOf(day) === dayArray.length - 1) { | |
addWeek(week); | |
} | |
}); | |
return weekArray; | |
} | |
function localizedWeekday(DateTimeFormat, locale, day, firstDayOfWeek) { | |
var weekdayFormatter = new DateTimeFormat(locale, { weekday: 'narrow' }); | |
var firstDayDate = getFirstDayOfWeek(); | |
return weekdayFormatter.format(addDays(firstDayDate, day + firstDayOfWeek)); | |
} | |
// Convert date to ISO 8601 (YYYY-MM-DD) date string, accounting for current timezone | |
function formatIso(date) { | |
return new Date(date.toDateString() + ' 12:00:00 +0000').toISOString().substring(0, 10); | |
} | |
function isEqualDate(d1, d2) { | |
return d1 && d2 && d1.getFullYear() === d2.getFullYear() && d1.getMonth() === d2.getMonth() && d1.getDate() === d2.getDate(); | |
} | |
function isBeforeDate(d1, d2) { | |
var date1 = cloneAsDate(d1); | |
var date2 = cloneAsDate(d2); | |
return date1.getTime() < date2.getTime(); | |
} | |
function isAfterDate(d1, d2) { | |
var date1 = cloneAsDate(d1); | |
var date2 = cloneAsDate(d2); | |
return date1.getTime() > date2.getTime(); | |
} | |
function isBetweenDates(dateToCheck, startDate, endDate) { | |
return !isBeforeDate(dateToCheck, startDate) && !isAfterDate(dateToCheck, endDate); | |
} | |
function monthDiff(d1, d2) { | |
var m = void 0; | |
m = (d1.getFullYear() - d2.getFullYear()) * 12; | |
m += d1.getMonth(); | |
m -= d2.getMonth(); | |
return m; | |
} | |
function yearDiff(d1, d2) { | |
return ~~(monthDiff(d1, d2) / 12); | |
} | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 57 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _extends2 = __webpack_require__(8); | |
var _extends3 = _interopRequireDefault(_extends2); | |
var _objectWithoutProperties2 = __webpack_require__(9); | |
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | |
var _getPrototypeOf = __webpack_require__(4); | |
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | |
var _classCallCheck2 = __webpack_require__(2); | |
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | |
var _createClass2 = __webpack_require__(3); | |
var _createClass3 = _interopRequireDefault(_createClass2); | |
var _possibleConstructorReturn2 = __webpack_require__(6); | |
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | |
var _inherits2 = __webpack_require__(5); | |
var _inherits3 = _interopRequireDefault(_inherits2); | |
var _simpleAssign = __webpack_require__(7); | |
var _simpleAssign2 = _interopRequireDefault(_simpleAssign); | |
var _react = __webpack_require__(1); | |
var _react2 = _interopRequireDefault(_react); | |
var _reactDom = __webpack_require__(15); | |
var _reactDom2 = _interopRequireDefault(_reactDom); | |
var _reactEventListener = __webpack_require__(34); | |
var _reactEventListener2 = _interopRequireDefault(_reactEventListener); | |
var _RenderToLayer = __webpack_require__(194); | |
var _RenderToLayer2 = _interopRequireDefault(_RenderToLayer); | |
var _propTypes = __webpack_require__(29); | |
var _propTypes2 = _interopRequireDefault(_propTypes); | |
var _Paper = __webpack_require__(23); | |
var _Paper2 = _interopRequireDefault(_Paper); | |
var _lodash = __webpack_require__(350); | |
var _lodash2 = _interopRequireDefault(_lodash); | |
var _PopoverAnimationDefault = __webpack_require__(385); | |
var _PopoverAnimationDefault2 = _interopRequireDefault(_PopoverAnimationDefault); | |
var _iOSHelpers = __webpack_require__(444); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
var styles = { | |
root: { | |
display: 'none' | |
} | |
}; | |
var Popover = function (_Component) { | |
(0, _inherits3.default)(Popover, _Component); | |
function Popover(props, context) { | |
(0, _classCallCheck3.default)(this, Popover); | |
var _this = (0, _possibleConstructorReturn3.default)(this, (Popover.__proto__ || (0, _getPrototypeOf2.default)(Popover)).call(this, props, context)); | |
_this.timeout = null; | |
_this.renderLayer = function () { | |
var _this$props = _this.props, | |
animated = _this$props.animated, | |
animation = _this$props.animation, | |
anchorEl = _this$props.anchorEl, | |
anchorOrigin = _this$props.anchorOrigin, | |
autoCloseWhenOffScreen = _this$props.autoCloseWhenOffScreen, | |
canAutoPosition = _this$props.canAutoPosition, | |
children = _this$props.children, | |
onRequestClose = _this$props.onRequestClose, | |
style = _this$props.style, | |
targetOrigin = _this$props.targetOrigin, | |
useLayerForClickAway = _this$props.useLayerForClickAway, | |
other = (0, _objectWithoutProperties3.default)(_this$props, ['animated', 'animation', 'anchorEl', 'anchorOrigin', 'autoCloseWhenOffScreen', 'canAutoPosition', 'children', 'onRequestClose', 'style', 'targetOrigin', 'useLayerForClickAway']); | |
var styleRoot = style; | |
if (!animated) { | |
styleRoot = { | |
position: 'fixed', | |
zIndex: _this.context.muiTheme.zIndex.popover | |
}; | |
if (!_this.state.open) { | |
return null; | |
} | |
return _react2.default.createElement( | |
_Paper2.default, | |
(0, _extends3.default)({ style: (0, _simpleAssign2.default)(styleRoot, style) }, other), | |
children | |
); | |
} | |
var Animation = animation || _PopoverAnimationDefault2.default; | |
return _react2.default.createElement( | |
Animation, | |
(0, _extends3.default)({ | |
targetOrigin: targetOrigin, | |
style: styleRoot | |
}, other, { | |
open: _this.state.open && !_this.state.closing | |
}), | |
children | |
); | |
}; | |
_this.componentClickAway = function (event) { | |
event.preventDefault(); | |
_this.requestClose('clickAway'); | |
}; | |
_this.setPlacement = function (scrolling) { | |
if (!_this.state.open) { | |
return; | |
} | |
if (!_this.refs.layer.getLayer()) { | |
return; | |
} | |
var targetEl = _this.refs.layer.getLayer().children[0]; | |
if (!targetEl) { | |
return; | |
} | |
var _this$props2 = _this.props, | |
targetOrigin = _this$props2.targetOrigin, | |
anchorOrigin = _this$props2.anchorOrigin; | |
var anchorEl = _this.props.anchorEl || _this.anchorEl; | |
var anchor = _this.getAnchorPosition(anchorEl); | |
var target = _this.getTargetPosition(targetEl); | |
var targetPosition = { | |
top: anchor[anchorOrigin.vertical] - target[targetOrigin.vertical], | |
left: anchor[anchorOrigin.horizontal] - target[targetOrigin.horizontal] | |
}; | |
if (scrolling && _this.props.autoCloseWhenOffScreen) { | |
_this.autoCloseWhenOffScreen(anchor); | |
} | |
if (_this.props.canAutoPosition) { | |
target = _this.getTargetPosition(targetEl); // update as height may have changed | |
targetPosition = _this.applyAutoPositionIfNeeded(anchor, target, targetOrigin, anchorOrigin, targetPosition); | |
} | |
targetEl.style.top = Math.max(0, targetPosition.top) + 'px'; | |
targetEl.style.left = Math.max(0, targetPosition.left) + 'px'; | |
targetEl.style.maxHeight = window.innerHeight + 'px'; | |
}; | |
_this.handleResize = (0, _lodash2.default)(_this.setPlacement, 100); | |
_this.handleScroll = (0, _lodash2.default)(_this.setPlacement.bind(_this, true), 50); | |
_this.state = { | |
open: props.open, | |
closing: false | |
}; | |
return _this; | |
} | |
(0, _createClass3.default)(Popover, [{ | |
key: 'componentDidMount', | |
value: function componentDidMount() { | |
this.setPlacement(); | |
} | |
}, { | |
key: 'componentWillReceiveProps', | |
value: function componentWillReceiveProps(nextProps) { | |
var _this2 = this; | |
if (nextProps.open === this.props.open) { | |
return; | |
} | |
if (nextProps.open) { | |
clearTimeout(this.timeout); | |
this.timeout = null; | |
this.anchorEl = nextProps.anchorEl || this.props.anchorEl; | |
this.setState({ | |
open: true, | |
closing: false | |
}); | |
} else { | |
if (nextProps.animated) { | |
if (this.timeout !== null) return; | |
this.setState({ closing: true }); | |
this.timeout = setTimeout(function () { | |
_this2.setState({ | |
open: false | |
}, function () { | |
_this2.timeout = null; | |
}); | |
}, 500); | |
} else { | |
this.setState({ | |
open: false | |
}); | |
} | |
} | |
} | |
}, { | |
key: 'componentDidUpdate', | |
value: function componentDidUpdate() { | |
this.setPlacement(); | |
} | |
}, { | |
key: 'componentWillUnmount', | |
value: function componentWillUnmount() { | |
this.handleResize.cancel(); | |
this.handleScroll.cancel(); | |
if (this.timeout) { | |
clearTimeout(this.timeout); | |
this.timeout = null; | |
} | |
} | |
}, { | |
key: 'requestClose', | |
value: function requestClose(reason) { | |
if (this.props.onRequestClose) { | |
this.props.onRequestClose(reason); | |
} | |
} | |
}, { | |
key: 'getAnchorPosition', | |
value: function getAnchorPosition(el) { | |
if (!el) { | |
el = _reactDom2.default.findDOMNode(this); | |
} | |
var rect = el.getBoundingClientRect(); | |
var a = { | |
top: rect.top, | |
left: rect.left, | |
width: el.offsetWidth, | |
height: el.offsetHeight | |
}; | |
a.right = rect.right || a.left + a.width; | |
// The fixed positioning isn't respected on iOS when an input is focused. | |
// We need to compute the position from the top of the page and not the viewport. | |
if ((0, _iOSHelpers.isIOS)() && document.activeElement.tagName === 'INPUT') { | |
a.bottom = (0, _iOSHelpers.getOffsetTop)(el) + a.height; | |
} else { | |
a.bottom = rect.bottom || a.top + a.height; | |
} | |
a.middle = a.left + (a.right - a.left) / 2; | |
a.center = a.top + (a.bottom - a.top) / 2; | |
return a; | |
} | |
}, { | |
key: 'getTargetPosition', | |
value: function getTargetPosition(targetEl) { | |
return { | |
top: 0, | |
center: targetEl.offsetHeight / 2, | |
bottom: targetEl.offsetHeight, | |
left: 0, | |
middle: targetEl.offsetWidth / 2, | |
right: targetEl.offsetWidth | |
}; | |
} | |
}, { | |
key: 'autoCloseWhenOffScreen', | |
value: function autoCloseWhenOffScreen(anchorPosition) { | |
if (anchorPosition.top < 0 || anchorPosition.top > window.innerHeight || anchorPosition.left < 0 || anchorPosition.left > window.innerWidth) { | |
this.requestClose('offScreen'); | |
} | |
} | |
}, { | |
key: 'getOverlapMode', | |
value: function getOverlapMode(anchor, target, median) { | |
if ([anchor, target].indexOf(median) >= 0) return 'auto'; | |
if (anchor === target) return 'inclusive'; | |
return 'exclusive'; | |
} | |
}, { | |
key: 'getPositions', | |
value: function getPositions(anchor, target) { | |
var a = (0, _extends3.default)({}, anchor); | |
var t = (0, _extends3.default)({}, target); | |
var positions = { | |
x: ['left', 'right'].filter(function (p) { | |
return p !== t.horizontal; | |
}), | |
y: ['top', 'bottom'].filter(function (p) { | |
return p !== t.vertical; | |
}) | |
}; | |
var overlap = { | |
x: this.getOverlapMode(a.horizontal, t.horizontal, 'middle'), | |
y: this.getOverlapMode(a.vertical, t.vertical, 'center') | |
}; | |
positions.x.splice(overlap.x === 'auto' ? 0 : 1, 0, 'middle'); | |
positions.y.splice(overlap.y === 'auto' ? 0 : 1, 0, 'center'); | |
if (overlap.y !== 'auto') { | |
a.vertical = a.vertical === 'top' ? 'bottom' : 'top'; | |
if (overlap.y === 'inclusive') { | |
t.vertical = t.vertical; | |
} | |
} | |
if (overlap.x !== 'auto') { | |
a.horizontal = a.horizontal === 'left' ? 'right' : 'left'; | |
if (overlap.y === 'inclusive') { | |
t.horizontal = t.horizontal; | |
} | |
} | |
return { | |
positions: positions, | |
anchorPos: a | |
}; | |
} | |
}, { | |
key: 'applyAutoPositionIfNeeded', | |
value: function applyAutoPositionIfNeeded(anchor, target, targetOrigin, anchorOrigin, targetPosition) { | |
var _getPositions = this.getPositions(anchorOrigin, targetOrigin), | |
positions = _getPositions.positions, | |
anchorPos = _getPositions.anchorPos; | |
if (targetPosition.top < 0 || targetPosition.top + target.bottom > window.innerHeight) { | |
var newTop = anchor[anchorPos.vertical] - target[positions.y[0]]; | |
if (newTop + target.bottom <= window.innerHeight) { | |
targetPosition.top = Math.max(0, newTop); | |
} else { | |
newTop = anchor[anchorPos.vertical] - target[positions.y[1]]; | |
if (newTop + target.bottom <= window.innerHeight) { | |
targetPosition.top = Math.max(0, newTop); | |
} | |
} | |
} | |
if (targetPosition.left < 0 || targetPosition.left + target.right > window.innerWidth) { | |
var newLeft = anchor[anchorPos.horizontal] - target[positions.x[0]]; | |
if (newLeft + target.right <= window.innerWidth) { | |
targetPosition.left = Math.max(0, newLeft); | |
} else { | |
newLeft = anchor[anchorPos.horizontal] - target[positions.x[1]]; | |
if (newLeft + target.right <= window.innerWidth) { | |
targetPosition.left = Math.max(0, newLeft); | |
} | |
} | |
} | |
return targetPosition; | |
} | |
}, { | |
key: 'render', | |
value: function render() { | |
return _react2.default.createElement( | |
'div', | |
{ style: styles.root }, | |
_react2.default.createElement(_reactEventListener2.default, { | |
target: 'window', | |
onScroll: this.handleScroll, | |
onResize: this.handleResize | |
}), | |
_react2.default.createElement(_RenderToLayer2.default, { | |
ref: 'layer', | |
open: this.state.open, | |
componentClickAway: this.componentClickAway, | |
useLayerForClickAway: this.props.useLayerForClickAway, | |
render: this.renderLayer | |
}) | |
); | |
} | |
}]); | |
return Popover; | |
}(_react.Component); | |
Popover.defaultProps = { | |
anchorOrigin: { | |
vertical: 'bottom', | |
horizontal: 'left' | |
}, | |
animated: true, | |
autoCloseWhenOffScreen: true, | |
canAutoPosition: true, | |
onRequestClose: function onRequestClose() {}, | |
open: false, | |
style: { | |
overflowY: 'auto' | |
}, | |
targetOrigin: { | |
vertical: 'top', | |
horizontal: 'left' | |
}, | |
useLayerForClickAway: true, | |
zDepth: 1 | |
}; | |
Popover.contextTypes = { | |
muiTheme: _react.PropTypes.object.isRequired | |
}; | |
process.env.NODE_ENV !== "production" ? Popover.propTypes = { | |
/** | |
* This is the DOM element that will be used to set the position of the | |
* popover. | |
*/ | |
anchorEl: _react.PropTypes.object, | |
/** | |
* This is the point on the anchor where the popover's | |
* `targetOrigin` will attach to. | |
* Options: | |
* vertical: [top, center, bottom] | |
* horizontal: [left, middle, right]. | |
*/ | |
anchorOrigin: _propTypes2.default.origin, | |
/** | |
* If true, the popover will apply transitions when | |
* it is added to the DOM. | |
*/ | |
animated: _react.PropTypes.bool, | |
/** | |
* Override the default animation component used. | |
*/ | |
animation: _react.PropTypes.func, | |
/** | |
* If true, the popover will hide when the anchor is scrolled off the screen. | |
*/ | |
autoCloseWhenOffScreen: _react.PropTypes.bool, | |
/** | |
* If true, the popover (potentially) ignores `targetOrigin` | |
* and `anchorOrigin` to make itself fit on screen, | |
* which is useful for mobile devices. | |
*/ | |
canAutoPosition: _react.PropTypes.bool, | |
/** | |
* The content of the popover. | |
*/ | |
children: _react.PropTypes.node, | |
/** | |
* The CSS class name of the root element. | |
*/ | |
className: _react.PropTypes.string, | |
/** | |
* Callback function fired when the popover is requested to be closed. | |
* | |
* @param {string} reason The reason for the close request. Possibles values | |
* are 'clickAway' and 'offScreen'. | |
*/ | |
onRequestClose: _react.PropTypes.func, | |
/** | |
* If true, the popover is visible. | |
*/ | |
open: _react.PropTypes.bool, | |
/** | |
* Override the inline-styles of the root element. | |
*/ | |
style: _react.PropTypes.object, | |
/** | |
* This is the point on the popover which will attach to | |
* the anchor's origin. | |
* Options: | |
* vertical: [top, center, bottom] | |
* horizontal: [left, middle, right]. | |
*/ | |
targetOrigin: _propTypes2.default.origin, | |
/** | |
* If true, the popover will render on top of an invisible | |
* layer, which will prevent clicks to the underlying | |
* elements, and trigger an `onRequestClose('clickAway')` call. | |
*/ | |
useLayerForClickAway: _react.PropTypes.bool, | |
/** | |
* The zDepth of the popover. | |
*/ | |
zDepth: _propTypes2.default.zDepth | |
} : void 0; | |
exports.default = Popover; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 58 */ | |
/***/ (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 DOMNamespaces = __webpack_require__(123); | |
var setInnerHTML = __webpack_require__(87); | |
var createMicrosoftUnsafeLocalFunction = __webpack_require__(130); | |
var setTextContent = __webpack_require__(217); | |
var ELEMENT_NODE_TYPE = 1; | |
var DOCUMENT_FRAGMENT_NODE_TYPE = 11; | |
/** | |
* 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); | |
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 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 <object> plugins (like Flash Player) will read | |
// <param> nodes immediately upon insertion into the DOM, so <object> | |
// must also be populated prior to insertion into the DOM. | |
if (tree.node.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE || tree.node.nodeType === ELEMENT_NODE_TYPE && tree.node.nodeName.toLowerCase() === 'object' && (tree.node.namespaceURI == null || tree.node.namespaceURI === DOMNamespaces.html)) { | |
insertTreeChildren(tree); | |
parentNode.insertBefore(tree.node, referenceNode); | |
} else { | |
parentNode.insertBefore(tree.node, referenceNode); | |
insertTreeChildren(tree); | |
} | |
}); | |
function replaceChildWithTree(oldNode, newTree) { | |
oldNode.parentNode.replaceChild(newTree.node, oldNode); | |
insertTreeChildren(newTree); | |
} | |
function queueChild(parentTree, childTree) { | |
if (enableLazy) { | |
parentTree.children.push(childTree); | |
} else { | |
parentTree.node.appendChild(childTree.node); | |
} | |
} | |
function queueHTML(tree, html) { | |
if (enableLazy) { | |
tree.html = html; | |
} else { | |
setInnerHTML(tree.node, html); | |
} | |
} | |
function queueText(tree, text) { | |
if (enableLazy) { | |
tree.text = text; | |
} else { | |
setTextContent(tree.node, text); | |
} | |
} | |
function toString() { | |
return this.node.nodeName; | |
} | |
function DOMLazyTree(node) { | |
return { | |
node: node, | |
children: [], | |
html: null, | |
text: null, | |
toString: toString | |
}; | |
} | |
DOMLazyTree.insertTreeBefore = insertTreeBefore; | |
DOMLazyTree.replaceChildWithTree = replaceChildWithTree; | |
DOMLazyTree.queueChild = queueChild; | |
DOMLazyTree.queueHTML = queueHTML; | |
DOMLazyTree.queueText = queueText; | |
module.exports = DOMLazyTree; | |
/***/ }), | |
/* 59 */ | |
/***/ (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 ReactRef = __webpack_require__(491); | |
var ReactInstrumentation = __webpack_require__(26); | |
var warning = __webpack_require__(10); | |
/** | |
* Helper to call ReactRef.attachRefs with this composite component, split out | |
* to avoid allocations in the transaction mount-ready queue. | |
*/ | |
function attachRefs() { | |
ReactRef.attachRefs(this, this._currentElement); | |
} | |
var ReactReconciler = { | |
/** | |
* Initializes the component, renders markup, and registers event listeners. | |
* | |
* @param {ReactComponent} internalInstance | |
* @param {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; | |
}, | |
/** | |
* 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); | |
} | |
} | |
}, | |
/** | |
* 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; | |
} | |
if (process.env.NODE_ENV !== 'production') { | |
if (internalInstance._debugID !== 0) { | |
ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, nextElement); | |
} | |
} | |
var refsChanged = ReactRef.shouldUpdateRefs(prevElement, nextElement); | |
if (refsChanged) { | |
ReactRef.detachRefs(internalInstance, prevElement); | |
} | |
internalInstance.receiveComponent(nextElement, transaction, context); | |
if (refsChanged && internalInstance._currentElement && internalInstance._currentElement.ref != null) { | |
transaction.getReactMountReady().enqueue(attachRefs, internalInstance); | |
} | |
if (process.env.NODE_ENV !== 'production') { | |
if (internalInstance._debugID !== 0) { | |
ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID); | |
} | |
} | |
}, | |
/** | |
* 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); | |
} | |
} | |
} | |
}; | |
module.exports = ReactReconciler; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 60 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = undefined; | |
var _TextField = __webpack_require__(400); | |
var _TextField2 = _interopRequireDefault(_TextField); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.default = _TextField2.default; | |
/***/ }), | |
/* 61 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
exports.__esModule = true; | |
var _from = __webpack_require__(165); | |
var _from2 = _interopRequireDefault(_from); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.default = function (arr) { | |
if (Array.isArray(arr)) { | |
for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { | |
arr2[i] = arr[i]; | |
} | |
return arr2; | |
} else { | |
return (0, _from2.default)(arr); | |
} | |
}; | |
/***/ }), | |
/* 62 */ | |
/***/ (function(module, exports) { | |
module.exports = function(it){ | |
return typeof it === 'object' ? it !== null : typeof it === 'function'; | |
}; | |
/***/ }), | |
/* 63 */ | |
/***/ (function(module, exports) { | |
module.exports = function(bitmap, value){ | |
return { | |
enumerable : !(bitmap & 1), | |
configurable: !(bitmap & 2), | |
writable : !(bitmap & 4), | |
value : value | |
}; | |
}; | |
/***/ }), | |
/* 64 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
// 7.1.13 ToObject(argument) | |
var defined = __webpack_require__(99); | |
module.exports = function(it){ | |
return Object(defined(it)); | |
}; | |
/***/ }), | |
/* 65 */ | |
/***/ (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. | |
* | |
*/ | |
var emptyObject = {}; | |
if (process.env.NODE_ENV !== 'production') { | |
Object.freeze(emptyObject); | |
} | |
module.exports = emptyObject; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 66 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"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. | |
* | |
* @typechecks | |
* | |
*/ | |
/*eslint-disable no-self-compare */ | |
var hasOwnProperty = Object.prototype.hasOwnProperty; | |
/** | |
* 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; | |
} | |
} | |
/** | |
* 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; | |
} | |
if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) { | |
return false; | |
} | |
var keysA = Object.keys(objA); | |
var keysB = Object.keys(objB); | |
if (keysA.length !== keysB.length) { | |
return false; | |
} | |
// Test for A's keys different from B. | |
for (var i = 0; i < keysA.length; i++) { | |
if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) { | |
return false; | |
} | |
} | |
return true; | |
} | |
module.exports = shallowEqual; | |
/***/ }), | |
/* 67 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.addHours = addHours; | |
exports.addMinutes = addMinutes; | |
exports.addSeconds = addSeconds; | |
exports.formatTime = formatTime; | |
exports.rad2deg = rad2deg; | |
exports.getTouchEventOffsetValues = getTouchEventOffsetValues; | |
exports.isInner = isInner; | |
function addHours(d, hours) { | |
var newDate = clone(d); | |
newDate.setHours(d.getHours() + hours); | |
return newDate; | |
} | |
function addMinutes(d, minutes) { | |
var newDate = clone(d); | |
newDate.setMinutes(d.getMinutes() + minutes); | |
return newDate; | |
} | |
function addSeconds(d, seconds) { | |
var newDate = clone(d); | |
newDate.setSeconds(d.getMinutes() + seconds); | |
return newDate; | |
} | |
function clone(d) { | |
return new Date(d.getTime()); | |
} | |
/** | |
* @param date [Date] A Date object. | |
* @param format [String] One of 'ampm', '24hr', defaults to 'ampm'. | |
* @param pedantic [Boolean] Check time-picker/time-picker.jsx file. | |
* | |
* @return String A string representing the formatted time. | |
*/ | |
function formatTime(date) { | |
var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'ampm'; | |
var pedantic = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; | |
if (!date) return ''; | |
var hours = date.getHours(); | |
var mins = date.getMinutes().toString(); | |
if (format === 'ampm') { | |
var isAM = hours < 12; | |
hours = hours % 12; | |
var additional = isAM ? ' am' : ' pm'; | |
hours = (hours || 12).toString(); | |
if (mins.length < 2) mins = '0' + mins; | |
if (pedantic) { | |
// Treat midday/midnight specially http://www.nist.gov/pml/div688/times.cfm | |
if (hours === '12' && mins === '00') { | |
return additional === ' pm' ? '12 noon' : '12 midnight'; | |
} | |
} | |
return hours + (mins === '00' ? '' : ':' + mins) + additional; | |
} | |
hours = hours.toString(); | |
if (hours.length < 2) hours = '0' + hours; | |
if (mins.length < 2) mins = '0' + mins; | |
return hours + ':' + mins; | |
} | |
function rad2deg(rad) { | |
return rad * 57.29577951308232; | |
} | |
function getTouchEventOffsetValues(event) { | |
var el = event.target; | |
var boundingRect = el.getBoundingClientRect(); | |
return { | |
offsetX: event.clientX - boundingRect.left, | |
offsetY: event.clientY - boundingRect.top | |
}; | |
} | |
function isInner(props) { | |
if (props.type !== 'hour') { | |
return false; | |
} | |
return props.value < 1 || props.value > 12; | |
} | |
/***/ }), | |
/* 68 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.createChildFragment = createChildFragment; | |
exports.extendChildren = extendChildren; | |
var _react = __webpack_require__(1); | |
var _react2 = _interopRequireDefault(_react); | |
var _reactAddonsCreateFragment = __webpack_require__(447); | |
var _reactAddonsCreateFragment2 = _interopRequireDefault(_reactAddonsCreateFragment); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
function createChildFragment(fragments) { | |
var newFragments = {}; | |
var validChildrenCount = 0; | |
var firstKey = void 0; | |
// Only create non-empty key fragments | |
for (var key in fragments) { | |
var currentChild = fragments[key]; | |
if (currentChild) { | |
if (validChildrenCount === 0) firstKey = key; | |
newFragments[key] = currentChild; | |
validChildrenCount++; | |
} | |
} | |
if (validChildrenCount === 0) return undefined; | |
if (validChildrenCount === 1) return newFragments[firstKey]; | |
return (0, _reactAddonsCreateFragment2.default)(newFragments); | |
} | |
function extendChildren(children, extendedProps, extendedChildren) { | |
return _react2.default.Children.map(children, function (child) { | |
if (!_react2.default.isValidElement(child)) { | |
return child; | |
} | |
var newProps = typeof extendedProps === 'function' ? extendedProps(child) : extendedProps; | |
var newChildren = typeof extendedChildren === 'function' ? extendedChildren(child) : extendedChildren ? extendedChildren : child.props.children; | |
return _react2.default.cloneElement(child, newProps, newChildren); | |
}); | |
} | |
/***/ }), | |
/* 69 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
module.exports = __webpack_require__(529); | |
/***/ }), | |
/* 70 */ | |
/***/ (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 _prodInvariant = __webpack_require__(13); | |
var EventPluginRegistry = __webpack_require__(82); | |
var EventPluginUtils = __webpack_require__(124); | |
var ReactErrorUtils = __webpack_require__(128); | |
var accumulateInto = __webpack_require__(211); | |
var forEachAccumulated = __webpack_require__(212); | |
var invariant = __webpack_require__(11); | |
/** | |
* Internal store for event listeners | |
*/ | |
var listenerBank = {}; | |
/** | |
* Internal queue of events that have accumulated their dispatches and are | |
* waiting to have their dispatches executed. | |
*/ | |
var eventQueue = null; | |
/** | |
* Dispatches an event and releases it back into the pool, unless persistent. | |
* | |
* @param {?object} event Synthetic event to be dispatched. | |
* @param {boolean} simulated If the event is simulated (changes exn behavior) | |
* @private | |
*/ | |
var executeDispatchesAndRelease = function (event, simulated) { | |
if (event) { | |
EventPluginUtils.executeDispatchesInOrder(event, simulated); | |
if (!event.isPersistent()) { | |
event.constructor.release(event); | |
} | |
} | |
}; | |
var executeDispatchesAndReleaseSimulated = function (e) { | |
return executeDispatchesAndRelease(e, true); | |
}; | |
var executeDispatchesAndReleaseTopLevel = function (e) { | |
return executeDispatchesAndRelease(e, false); | |
}; | |
var getDictionaryKey = function (inst) { | |
// Prevents V8 performance issue: | |
// https://github.com/facebook/react/pull/7232 | |
return '.' + inst._rootNodeID; | |
}; | |
function isInteractive(tag) { | |
return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea'; | |
} | |
function shouldPreventMouseEvent(name, type, props) { | |
switch (name) { | |
case 'onClick': | |
case 'onClickCapture': | |
case 'onDoubleClick': | |
case 'onDoubleClickCapture': | |
case 'onMouseDown': | |
case 'onMouseDownCapture': | |
case 'onMouseMove': | |
case 'onMouseMoveCapture': | |
case 'onMouseUp': | |
case 'onMouseUpCapture': | |
return !!(props.disabled && isInteractive(type)); | |
default: | |
return false; | |
} | |
} | |
/** | |
* This is a unified interface for event plugins to be installed and configured. | |
* | |
* Event plugins can implement the following properties: | |
* | |
* `extractEvents` {function(string, DOMEventTarget, string, object): *} | |
* Required. When a top-level event is fired, this method is expected to | |
* extract synthetic events that will in turn be queued and dispatched. | |
* | |
* `eventTypes` {object} | |
* Optional, plugins that fire events must publish a mapping of registration | |
* names that are used to register listeners. Values of this mapping must | |
* be objects that contain `registrationName` or `phasedRegistrationNames`. | |
* | |
* `executeDispatch` {function(object, function, string)} | |
* Optional, allows plugins to override how an event gets dispatched. By | |
* default, the listener is simply invoked. | |
* | |
* Each plugin that is injected into `EventsPluginHub` is immediately operable. | |
* | |
* @public | |
*/ | |
var EventPluginHub = { | |
/** | |
* Methods for injecting dependencies. | |
*/ | |
injection: { | |
/** | |
* @param {array} InjectedEventPluginOrder | |
* @public | |
*/ | |
injectEventPluginOrder: EventPluginRegistry.injectEventPluginOrder, | |
/** | |
* @param {object} injectedNamesToPlugins Map from names to plugin modules. | |
*/ | |
injectEventPluginsByName: EventPluginRegistry.injectEventPluginsByName | |
}, | |
/** | |
* Stores `listener` at `listenerBank[registrationName][key]`. Is idempotent. | |
* | |
* @param {object} inst The instance, which is the source of events. | |
* @param {string} registrationName Name of listener (e.g. `onClick`). | |
* @param {function} listener The callback to store. | |
*/ | |
putListener: function (inst, registrationName, listener) { | |
!(typeof listener === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected %s listener to be a function, instead got type %s', registrationName, typeof listener) : _prodInvariant('94', registrationName, typeof listener) : void 0; | |
var key = getDictionaryKey(inst); | |
var bankForRegistrationName = listenerBank[registrationName] || (listenerBank[registrationName] = {}); | |
bankForRegistrationName[key] = listener; | |
var PluginModule = EventPluginRegistry.registrationNameModules[registrationName]; | |
if (PluginModule && PluginModule.didPutListener) { | |
PluginModule.didPutListener(inst, registrationName, listener); | |
} | |
}, | |
/** | |
* @param {object} inst The instance, which is the source of events. | |
* @param {string} registrationName Name of listener (e.g. `onClick`). | |
* @return {?function} The stored callback. | |
*/ | |
getListener: function (inst, registrationName) { | |
// TODO: shouldPreventMouseEvent is DOM-specific and definitely should not | |
// live here; needs to be moved to a better place soon | |
var bankForRegistrationName = listenerBank[registrationName]; | |
if (shouldPreventMouseEvent(registrationName, inst._currentElement.type, inst._currentElement.props)) { | |
return null; | |
} | |
var key = getDictionaryKey(inst); | |
return bankForRegistrationName && bankForRegistrationName[key]; | |
}, | |
/** | |
* Deletes a listener from the registration bank. | |
* | |
* @param {object} inst The instance, which is the source of events. | |
* @param {string} registrationName Name of listener (e.g. `onClick`). | |
*/ | |
deleteListener: function (inst, registrationName) { | |
var PluginModule = EventPluginRegistry.registrationNameModules[registrationName]; | |
if (PluginModule && PluginModule.willDeleteListener) { | |
PluginModule.willDeleteListener(inst, registrationName); | |
} | |
var bankForRegistrationName = listenerBank[registrationName]; | |
// TODO: This should never be null -- when is it? | |
if (bankForRegistrationName) { | |
var key = getDictionaryKey(inst); | |
delete bankForRegistrationName[key]; | |
} | |
}, | |
/** | |
* Deletes all listeners for the DOM element with the supplied ID. | |
* | |
* @param {object} inst The instance, which is the source of events. | |
*/ | |
deleteAllListeners: function (inst) { | |
var key = getDictionaryKey(inst); | |
for (var registrationName in listenerBank) { | |
if (!listenerBank.hasOwnProperty(registrationName)) { | |
continue; | |
} | |
if (!listenerBank[registrationName][key]) { | |
continue; | |
} | |
var PluginModule = EventPluginRegistry.registrationNameModules[registrationName]; | |
if (PluginModule && PluginModule.willDeleteListener) { | |
PluginModule.willDeleteListener(inst, registrationName); | |
} | |
delete listenerBank[registrationName][key]; | |
} | |
}, | |
/** | |
* Allows registered plugins an opportunity to extract events from top-level | |
* native browser events. | |
* | |
* @return {*} An accumulation of synthetic events. | |
* @internal | |
*/ | |
extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) { | |
var events; | |
var plugins = EventPluginRegistry.plugins; | |
for (var i = 0; i < plugins.length; i++) { | |
// Not every plugin in the ordering may be loaded at runtime. | |
var possiblePlugin = plugins[i]; | |
if (possiblePlugin) { | |
var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget); | |
if (extractedEvents) { | |
events = accumulateInto(events, extractedEvents); | |
} | |
} | |
} | |
return events; | |
}, | |
/** | |
* Enqueues a synthetic event that should be dispatched when | |
* `processEventQueue` is invoked. | |
* | |
* @param {*} events An accumulation of synthetic events. | |
* @internal | |
*/ | |
enqueueEvents: function (events) { | |
if (events) { | |
eventQueue = accumulateInto(eventQueue, events); | |
} | |
}, | |
/** | |
* Dispatches all synthetic events on the event queue. | |
* | |
* @internal | |
*/ | |
processEventQueue: function (simulated) { | |
// Set `eventQueue` to null before processing it so that we can tell if more | |
// events get enqueued while processing. | |
var processingEventQueue = eventQueue; | |
eventQueue = null; | |
if (simulated) { | |
forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated); | |
} else { | |
forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel); | |
} | |
!!eventQueue ? process.env.NODE_ENV !== 'production' ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.') : _prodInvariant('95') : void 0; | |
// This would be a good time to rethrow if any of the event handlers threw. | |
ReactErrorUtils.rethrowCaughtError(); | |
}, | |
/** | |
* These are needed for tests only. Do not use! | |
*/ | |
__purge: function () { | |
listenerBank = {}; | |
}, | |
__getListenerBank: function () { | |
return listenerBank; | |
} | |
}; | |
module.exports = EventPluginHub; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 71 */ | |
/***/ (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 EventPluginHub = __webpack_require__(70); | |
var EventPluginUtils = __webpack_require__(124); | |
var accumulateInto = __webpack_require__(211); | |
var forEachAccumulated = __webpack_require__(212); | |
var warning = __webpack_require__(10); | |
var getListener = EventPluginHub.getListener; | |
/** | |
* Some event types have a notion of different registration names for different | |
* "phases" of propagation. This finds listeners by a given phase. | |
*/ | |
function listenerAtPhase(inst, event, propagationPhase) { | |
var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase]; | |
return getListener(inst, registrationName); | |
} | |
/** | |
* Tags a `SyntheticEvent` with dispatched listeners. Creating this function | |
* here, allows us to not have to bind or create functions for each event. | |
* Mutating the event's members allows us to not have to create a wrapping | |
* "dispatch" object that pairs the event with the listener. | |
*/ | |
function accumulateDirectionalDispatches(inst, phase, event) { | |
if (process.env.NODE_ENV !== 'production') { | |
process.env.NODE_ENV !== 'production' ? warning(inst, 'Dispatching inst must not be null') : void 0; | |
} | |
var listener = listenerAtPhase(inst, event, phase); | |
if (listener) { | |
event._dispatchListeners = accumulateInto(event._dispatchListeners, listener); | |
event._dispatchInstances = accumulateInto(event._dispatchInstances, inst); | |
} | |
} | |
/** | |
* Collect dispatches (must be entirely collected before dispatching - see unit | |
* tests). Lazily allocate the array to conserve memory. We must loop through | |
* each event and perform the traversal for each one. We cannot perform a | |
* single traversal for the entire collection of events because each event may | |
* have a different target. | |
*/ | |
function accumulateTwoPhaseDispatchesSingle(event) { | |
if (event && event.dispatchConfig.phasedRegistrationNames) { | |
EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event); | |
} | |
} | |
/** | |
* Same as `accumulateTwoPhaseDispatchesSingle`, but skips over the targetID. | |
*/ | |
function accumulateTwoPhaseDispatchesSingleSkipTarget(event) { | |
if (event && event.dispatchConfig.phasedRegistrationNames) { | |
var targetInst = event._targetInst; | |
var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null; | |
EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event); | |
} | |
} | |
/** | |
* Accumulates without regard to direction, does not look for phased | |
* registration names. Same as `accumulateDirectDispatchesSingle` but without | |
* requiring that the `dispatchMarker` be the same as the dispatched ID. | |
*/ | |
function accumulateDispatches(inst, ignoredDirection, event) { | |
if (event && event.dispatchConfig.registrationName) { | |
var registrationName = event.dispatchConfig.registrationName; | |
var listener = getListener(inst, registrationName); | |
if (listener) { | |
event._dispatchListeners = accumulateInto(event._dispatchListeners, listener); | |
event._dispatchInstances = accumulateInto(event._dispatchInstances, inst); | |
} | |
} | |
} | |
/** | |
* Accumulates dispatches on an `SyntheticEvent`, but only for the | |
* `dispatchMarker`. | |
* @param {SyntheticEvent} event | |
*/ | |
function accumulateDirectDispatchesSingle(event) { | |
if (event && event.dispatchConfig.registrationName) { | |
accumulateDispatches(event._targetInst, null, event); | |
} | |
} | |
function accumulateTwoPhaseDispatches(events) { | |
forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle); | |
} | |
function accumulateTwoPhaseDispatchesSkipTarget(events) { | |
forEachAccumulated(events, accumulateTwoPhaseDispatchesSingleSkipTarget); | |
} | |
function accumulateEnterLeaveDispatches(leave, enter, from, to) { | |
EventPluginUtils.traverseEnterLeave(from, to, accumulateDispatches, leave, enter); | |
} | |
function accumulateDirectDispatches(events) { | |
forEachAccumulated(events, accumulateDirectDispatchesSingle); | |
} | |
/** | |
* A small set of propagation patterns, each of which will accept a small amount | |
* of information, and generate a set of "dispatch ready event objects" - which | |
* are sets of events that have already been annotated with a set of dispatched | |
* listener functions/ids. The API is designed this way to discourage these | |
* propagation strategies from actually executing the dispatches, since we | |
* always want to collect the entire set of dispatches before executing event a | |
* single one. | |
* | |
* @constructor EventPropagators | |
*/ | |
var EventPropagators = { | |
accumulateTwoPhaseDispatches: accumulateTwoPhaseDispatches, | |
accumulateTwoPhaseDispatchesSkipTarget: accumulateTwoPhaseDispatchesSkipTarget, | |
accumulateDirectDispatches: accumulateDirectDispatches, | |
accumulateEnterLeaveDispatches: accumulateEnterLeaveDispatches | |
}; | |
module.exports = EventPropagators; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 72 */ | |
/***/ (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. | |
* | |
*/ | |
/** | |
* `ReactInstanceMap` maintains a mapping from a public facing stateful | |
* instance (key) and the internal representation (value). This allows public | |
* methods to accept the user facing instance as an argument and map them back | |
* to internal methods. | |
*/ | |
// TODO: Replace this with ES6: var ReactInstanceMap = new Map(); | |
var ReactInstanceMap = { | |
/** | |
* This API should be called `delete` but we'd have to make sure to always | |
* transform these to strings for IE support. When this transform is fully | |
* supported we can rename it. | |
*/ | |
remove: function (key) { | |
key._reactInternalInstance = undefined; | |
}, | |
get: function (key) { | |
return key._reactInternalInstance; | |
}, | |
has: function (key) { | |
return key._reactInternalInstance !== undefined; | |
}, | |
set: function (key, value) { | |
key._reactInternalInstance = value; | |
} | |
}; | |
module.exports = ReactInstanceMap; | |
/***/ }), | |
/* 73 */ | |
/***/ (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 SyntheticEvent = __webpack_require__(33); | |
var getEventTarget = __webpack_require__(133); | |
/** | |
* @interface UIEvent | |
* @see http://www.w3.org/TR/DOM-Level-3-Events/ | |
*/ | |
var UIEventInterface = { | |
view: function (event) { | |
if (event.view) { | |
return event.view; | |
} | |
var target = getEventTarget(event); | |
if (target.window === target) { | |
// target is a window object | |
return target; | |
} | |
var doc = target.ownerDocument; | |
// TODO: Figure out why `ownerDocument` is sometimes undefined in IE8. | |
if (doc) { | |
return doc.defaultView || doc.parentWindow; | |
} else { | |
return window; | |
} | |
}, | |
detail: function (event) { | |
return event.detail || 0; | |
} | |
}; | |
/** | |
* @param {object} dispatchConfig Configuration used to dispatch this event. | |
* @param {string} dispatchMarker Marker identifying the event target. | |
* @param {object} nativeEvent Native browser event. | |
* @extends {SyntheticEvent} | |
*/ | |
function SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { | |
return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); | |
} | |
SyntheticEvent.augmentClass(SyntheticUIEvent, UIEventInterface); | |
module.exports = SyntheticUIEvent; | |
/***/ }), | |
/* 74 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = undefined; | |
var _FlatButton = __webpack_require__(374); | |
var _FlatButton2 = _interopRequireDefault(_FlatButton); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.default = _FlatButton2.default; | |
/***/ }), | |
/* 75 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _extends2 = __webpack_require__(8); | |
var _extends3 = _interopRequireDefault(_extends2); | |
var _objectWithoutProperties2 = __webpack_require__(9); | |
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | |
var _getPrototypeOf = __webpack_require__(4); | |
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | |
var _classCallCheck2 = __webpack_require__(2); | |
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | |
var _createClass2 = __webpack_require__(3); | |
var _createClass3 = _interopRequireDefault(_createClass2); | |
var _possibleConstructorReturn2 = __webpack_require__(6); | |
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | |
var _inherits2 = __webpack_require__(5); | |
var _inherits3 = _interopRequireDefault(_inherits2); | |
var _simpleAssign = __webpack_require__(7); | |
var _simpleAssign2 = _interopRequireDefault(_simpleAssign); | |
var _react = __webpack_require__(1); | |
var _react2 = _interopRequireDefault(_react); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
function getStyles(props, context) { | |
var tableRowColumn = context.muiTheme.tableRowColumn; | |
var styles = { | |
root: { | |
paddingLeft: tableRowColumn.spacing, | |
paddingRight: tableRowColumn.spacing, | |
height: tableRowColumn.height, | |
textAlign: 'left', | |
fontSize: 13, | |
overflow: 'hidden', | |
whiteSpace: 'nowrap', | |
textOverflow: 'ellipsis' | |
} | |
}; | |
if (_react2.default.Children.count(props.children) === 1 && !isNaN(props.children)) { | |
styles.textAlign = 'right'; | |
} | |
return styles; | |
} | |
var TableRowColumn = function (_Component) { | |
(0, _inherits3.default)(TableRowColumn, _Component); | |
function TableRowColumn() { | |
var _ref; | |
var _temp, _this, _ret; | |
(0, _classCallCheck3.default)(this, TableRowColumn); | |
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | |
args[_key] = arguments[_key]; | |
} | |
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = TableRowColumn.__proto__ || (0, _getPrototypeOf2.default)(TableRowColumn)).call.apply(_ref, [this].concat(args))), _this), _this.state = { | |
hovered: false | |
}, _this.onClick = function (event) { | |
if (_this.props.onClick) { | |
_this.props.onClick(event, _this.props.columnNumber); | |
} | |
}, _this.onMouseEnter = function (event) { | |
if (_this.props.hoverable) { | |
_this.setState({ hovered: true }); | |
if (_this.props.onHover) { | |
_this.props.onHover(event, _this.props.columnNumber); | |
} | |
} | |
}, _this.onMouseLeave = function (event) { | |
if (_this.props.hoverable) { | |
_this.setState({ hovered: false }); | |
if (_this.props.onHoverExit) { | |
_this.props.onHoverExit(event, _this.props.columnNumber); | |
} | |
} | |
}, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); | |
} | |
(0, _createClass3.default)(TableRowColumn, [{ | |
key: 'render', | |
value: function render() { | |
var _props = this.props, | |
children = _props.children, | |
className = _props.className, | |
columnNumber = _props.columnNumber, | |
hoverable = _props.hoverable, | |
onClick = _props.onClick, | |
onHover = _props.onHover, | |
onHoverExit = _props.onHoverExit, | |
style = _props.style, | |
other = (0, _objectWithoutProperties3.default)(_props, ['children', 'className', 'columnNumber', 'hoverable', 'onClick', 'onHover', 'onHoverExit', 'style']); | |
var prepareStyles = this.context.muiTheme.prepareStyles; | |
var styles = getStyles(this.props, this.context); | |
var handlers = { | |
onClick: this.onClick, | |
onMouseEnter: this.onMouseEnter, | |
onMouseLeave: this.onMouseLeave | |
}; | |
return _react2.default.createElement( | |
'td', | |
(0, _extends3.default)({ | |
className: className, | |
style: prepareStyles((0, _simpleAssign2.default)(styles.root, style)) | |
}, handlers, other), | |
children | |
); | |
} | |
}]); | |
return TableRowColumn; | |
}(_react.Component); | |
TableRowColumn.defaultProps = { | |
hoverable: false | |
}; | |
TableRowColumn.contextTypes = { | |
muiTheme: _react.PropTypes.object.isRequired | |
}; | |
process.env.NODE_ENV !== "production" ? TableRowColumn.propTypes = { | |
children: _react.PropTypes.node, | |
/** | |
* The css class name of the root element. | |
*/ | |
className: _react.PropTypes.string, | |
/** | |
* @ignore | |
* Number to identify the header row. This property | |
* is automatically populated when used with TableHeader. | |
*/ | |
columnNumber: _react.PropTypes.number, | |
/** | |
* @ignore | |
* If true, this column responds to hover events. | |
*/ | |
hoverable: _react.PropTypes.bool, | |
/** @ignore */ | |
onClick: _react.PropTypes.func, | |
/** @ignore */ | |
onHover: _react.PropTypes.func, | |
/** | |
* @ignore | |
* Callback function for hover exit event. | |
*/ | |
onHoverExit: _react.PropTypes.func, | |
/** | |
* Override the inline-styles of the root element. | |
*/ | |
style: _react.PropTypes.object | |
} : void 0; | |
exports.default = TableRowColumn; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 76 */ | |
/***/ (function(module, exports) { | |
exports.f = {}.propertyIsEnumerable; | |
/***/ }), | |
/* 77 */ | |
/***/ (function(module, exports) { | |
var id = 0 | |
, px = Math.random(); | |
module.exports = function(key){ | |
return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); | |
}; | |
/***/ }), | |
/* 78 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
var $at = __webpack_require__(293)(true); | |
// 21.1.3.27 String.prototype[@@iterator]() | |
__webpack_require__(174)(String, 'String', function(iterated){ | |
this._t = String(iterated); // target | |
this._i = 0; // next index | |
// 21.1.5.2.1 %StringIteratorPrototype%.next() | |
}, function(){ | |
var O = this._t | |
, index = this._i | |
, point; | |
if(index >= O.length)return {value: undefined, done: true}; | |
point = $at(O, index); | |
this._i += point.length; | |
return {value: point, done: false}; | |
}); | |
/***/ }), | |
/* 79 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | |
// returns a style object with a single concated prefixed value string | |
exports.default = function (property, value) { | |
var replacer = arguments.length <= 2 || arguments[2] === undefined ? function (prefix, value) { | |
return prefix + value; | |
} : arguments[2]; | |
return _defineProperty({}, property, ['-webkit-', '-moz-', ''].map(function (prefix) { | |
return replacer(prefix, value); | |
})); | |
}; | |
module.exports = exports['default']; | |
/***/ }), | |
/* 80 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _extends2 = __webpack_require__(8); | |
var _extends3 = _interopRequireDefault(_extends2); | |
var _objectWithoutProperties2 = __webpack_require__(9); | |
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | |
var _toArray2 = __webpack_require__(169); | |
var _toArray3 = _interopRequireDefault(_toArray2); | |
var _getPrototypeOf = __webpack_require__(4); | |
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | |
var _classCallCheck2 = __webpack_require__(2); | |
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | |
var _createClass2 = __webpack_require__(3); | |
var _createClass3 = _interopRequireDefault(_createClass2); | |
var _possibleConstructorReturn2 = __webpack_require__(6); | |
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | |
var _inherits2 = __webpack_require__(5); | |
var _inherits3 = _interopRequireDefault(_inherits2); | |
var _simpleAssign = __webpack_require__(7); | |
var _simpleAssign2 = _interopRequireDefault(_simpleAssign); | |
var _react = __webpack_require__(1); | |
var _react2 = _interopRequireDefault(_react); | |
var _reactDom = __webpack_require__(15); | |
var _reactDom2 = _interopRequireDefault(_reactDom); | |
var _shallowEqual = __webpack_require__(50); | |
var _shallowEqual2 = _interopRequireDefault(_shallowEqual); | |
var _ClickAwayListener = __webpack_require__(117); | |
var _ClickAwayListener2 = _interopRequireDefault(_ClickAwayListener); | |
var _keycode = __webpack_require__(25); | |
var _keycode2 = _interopRequireDefault(_keycode); | |
var _propTypes = __webpack_require__(29); | |
var _propTypes2 = _interopRequireDefault(_propTypes); | |
var _List = __webpack_require__(114); | |
var _List2 = _interopRequireDefault(_List); | |
var _menuUtils = __webpack_require__(383); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
function getStyles(props, context) { | |
var desktop = props.desktop, | |
maxHeight = props.maxHeight, | |
width = props.width; | |
var muiTheme = context.muiTheme; | |
var styles = { | |
root: { | |
// Nested div bacause the List scales x faster than it scales y | |
zIndex: muiTheme.zIndex.menu, | |
maxHeight: maxHeight, | |
overflowY: maxHeight ? 'auto' : null | |
}, | |
divider: { | |
marginTop: 7, | |
marginBottom: 8 | |
}, | |
list: { | |
display: 'table-cell', | |
paddingBottom: desktop ? 16 : 8, | |
paddingTop: desktop ? 16 : 8, | |
userSelect: 'none', | |
width: width | |
}, | |
selectedMenuItem: { | |
color: muiTheme.menuItem.selectedTextColor | |
} | |
}; | |
return styles; | |
} | |
var Menu = function (_Component) { | |
(0, _inherits3.default)(Menu, _Component); | |
function Menu(props, context) { | |
(0, _classCallCheck3.default)(this, Menu); | |
var _this = (0, _possibleConstructorReturn3.default)(this, (Menu.__proto__ || (0, _getPrototypeOf2.default)(Menu)).call(this, props, context)); | |
_initialiseProps.call(_this); | |
var filteredChildren = _this.getFilteredChildren(props.children); | |
var selectedIndex = _this.getSelectedIndex(props, filteredChildren); | |
var newFocusIndex = props.disableAutoFocus ? -1 : selectedIndex >= 0 ? selectedIndex : 0; | |
if (newFocusIndex !== -1 && props.onMenuItemFocusChange) { | |
props.onMenuItemFocusChange(null, newFocusIndex); | |
} | |
_this.state = { | |
focusIndex: newFocusIndex, | |
isKeyboardFocused: props.initiallyKeyboardFocused, | |
keyWidth: props.desktop ? 64 : 56 | |
}; | |
_this.hotKeyHolder = new _menuUtils.HotKeyHolder(); | |
return _this; | |
} | |
(0, _createClass3.default)(Menu, [{ | |
key: 'componentDidMount', | |
value: function componentDidMount() { | |
if (this.props.autoWidth) { | |
this.setWidth(); | |
} | |
this.setScollPosition(); | |
} | |
}, { | |
key: 'componentWillReceiveProps', | |
value: function componentWillReceiveProps(nextProps) { | |
var filteredChildren = this.getFilteredChildren(nextProps.children); | |
var selectedIndex = this.getSelectedIndex(nextProps, filteredChildren); | |
var newFocusIndex = nextProps.disableAutoFocus ? -1 : selectedIndex >= 0 ? selectedIndex : 0; | |
if (newFocusIndex !== this.state.focusIndex && this.props.onMenuItemFocusChange) { | |
this.props.onMenuItemFocusChange(null, newFocusIndex); | |
} | |
this.setState({ | |
focusIndex: newFocusIndex, | |
keyWidth: nextProps.desktop ? 64 : 56 | |
}); | |
} | |
}, { | |
key: 'shouldComponentUpdate', | |
value: function shouldComponentUpdate(nextProps, nextState, nextContext) { | |
return !(0, _shallowEqual2.default)(this.props, nextProps) || !(0, _shallowEqual2.default)(this.state, nextState) || !(0, _shallowEqual2.default)(this.context, nextContext); | |
} | |
}, { | |
key: 'componentDidUpdate', | |
value: function componentDidUpdate() { | |
if (this.props.autoWidth) this.setWidth(); | |
} | |
}, { | |
key: 'getValueLink', | |
// Do not use outside of this component, it will be removed once valueLink is deprecated | |
value: function getValueLink(props) { | |
return props.valueLink || { | |
value: props.value, | |
requestChange: props.onChange | |
}; | |
} | |
}, { | |
key: 'setKeyboardFocused', | |
value: function setKeyboardFocused(keyboardFocused) { | |
this.setState({ | |
isKeyboardFocused: keyboardFocused | |
}); | |
} | |
}, { | |
key: 'getFilteredChildren', | |
value: function getFilteredChildren(children) { | |
var filteredChildren = []; | |
_react2.default.Children.forEach(children, function (child) { | |
if (child) { | |
filteredChildren.push(child); | |
} | |
}); | |
return filteredChildren; | |
} | |
}, { | |
key: 'cloneMenuItem', | |
value: function cloneMenuItem(child, childIndex, styles, index) { | |
var _this2 = this; | |
var _props = this.props, | |
desktop = _props.desktop, | |
menuItemStyle = _props.menuItemStyle, | |
selectedMenuItemStyle = _props.selectedMenuItemStyle; | |
var selected = this.isChildSelected(child, this.props); | |
var selectedChildrenStyles = {}; | |
if (selected) { | |
selectedChildrenStyles = (0, _simpleAssign2.default)(styles.selectedMenuItem, selectedMenuItemStyle); | |
} | |
var mergedChildrenStyles = (0, _simpleAssign2.default)({}, child.props.style, menuItemStyle, selectedChildrenStyles); | |
var isFocused = childIndex === this.state.focusIndex; | |
var focusState = 'none'; | |
if (isFocused) { | |
focusState = this.state.isKeyboardFocused ? 'keyboard-focused' : 'focused'; | |
} | |
return _react2.default.cloneElement(child, { | |
desktop: desktop, | |
focusState: focusState, | |
onTouchTap: function onTouchTap(event) { | |
_this2.handleMenuItemTouchTap(event, child, index); | |
if (child.props.onTouchTap) child.props.onTouchTap(event); | |
}, | |
ref: isFocused ? 'focusedMenuItem' : null, | |
style: mergedChildrenStyles | |
}); | |
} | |
}, { | |
key: 'decrementKeyboardFocusIndex', | |
value: function decrementKeyboardFocusIndex(event) { | |
var index = this.state.focusIndex; | |
index--; | |
if (index < 0) index = 0; | |
this.setFocusIndex(event, index, true); | |
} | |
}, { | |
key: 'getMenuItemCount', | |
value: function getMenuItemCount(filteredChildren) { | |
var menuItemCount = 0; | |
filteredChildren.forEach(function (child) { | |
var childIsADivider = child.type && child.type.muiName === 'Divider'; | |
var childIsDisabled = child.props.disabled; | |
if (!childIsADivider && !childIsDisabled) menuItemCount++; | |
}); | |
return menuItemCount; | |
} | |
}, { | |
key: 'getSelectedIndex', | |
value: function getSelectedIndex(props, filteredChildren) { | |
var _this3 = this; | |
var selectedIndex = -1; | |
var menuItemIndex = 0; | |
filteredChildren.forEach(function (child) { | |
var childIsADivider = child.type && child.type.muiName === 'Divider'; | |
if (_this3.isChildSelected(child, props)) selectedIndex = menuItemIndex; | |
if (!childIsADivider) menuItemIndex++; | |
}); | |
return selectedIndex; | |
} | |
}, { | |
key: 'setFocusIndexStartsWith', | |
value: function setFocusIndexStartsWith(event, keys) { | |
var foundIndex = -1; | |
_react2.default.Children.forEach(this.props.children, function (child, index) { | |
if (foundIndex >= 0) { | |
return; | |
} | |
var primaryText = child.props.primaryText; | |
if (typeof primaryText === 'string' && new RegExp('^' + keys, 'i').test(primaryText)) { | |
foundIndex = index; | |
} | |
}); | |
if (foundIndex >= 0) { | |
this.setFocusIndex(event, foundIndex, true); | |
return true; | |
} | |
return false; | |
} | |
}, { | |
key: 'handleMenuItemTouchTap', | |
value: function handleMenuItemTouchTap(event, item, index) { | |
var children = this.props.children; | |
var multiple = this.props.multiple; | |
var valueLink = this.getValueLink(this.props); | |
var menuValue = valueLink.value; | |
var itemValue = item.props.value; | |
var focusIndex = _react2.default.isValidElement(children) ? 0 : children.indexOf(item); | |
this.setFocusIndex(event, focusIndex, false); | |
if (multiple) { | |
var itemIndex = menuValue.indexOf(itemValue); | |
var _menuValue = (0, _toArray3.default)(menuValue), | |
newMenuValue = _menuValue; | |
if (itemIndex === -1) { | |
newMenuValue.push(itemValue); | |
} else { | |
newMenuValue.splice(itemIndex, 1); | |
} | |
valueLink.requestChange(event, newMenuValue); | |
} else if (!multiple && itemValue !== menuValue) { | |
valueLink.requestChange(event, itemValue); | |
} | |
this.props.onItemTouchTap(event, item, index); | |
} | |
}, { | |
key: 'incrementKeyboardFocusIndex', | |
value: function incrementKeyboardFocusIndex(event, filteredChildren) { | |
var index = this.state.focusIndex; | |
var maxIndex = this.getMenuItemCount(filteredChildren) - 1; | |
index++; | |
if (index > maxIndex) index = maxIndex; | |
this.setFocusIndex(event, index, true); | |
} | |
}, { | |
key: 'isChildSelected', | |
value: function isChildSelected(child, props) { | |
var menuValue = this.getValueLink(props).value; | |
var childValue = child.props.value; | |
if (props.multiple) { | |
return menuValue.length && menuValue.indexOf(childValue) !== -1; | |
} else { | |
return child.props.hasOwnProperty('value') && menuValue === childValue; | |
} | |
} | |
}, { | |
key: 'setFocusIndex', | |
value: function setFocusIndex(event, newIndex, isKeyboardFocused) { | |
if (this.props.onMenuItemFocusChange) { | |
// Do this even if `newIndex === this.state.focusIndex` to allow users | |
// to detect up-arrow on the first MenuItem or down-arrow on the last. | |
this.props.onMenuItemFocusChange(event, newIndex); | |
} | |
this.setState({ | |
focusIndex: newIndex, | |
isKeyboardFocused: isKeyboardFocused | |
}); | |
} | |
}, { | |
key: 'setScollPosition', | |
value: function setScollPosition() { | |
var desktop = this.props.desktop; | |
var focusedMenuItem = this.refs.focusedMenuItem; | |
var menuItemHeight = desktop ? 32 : 48; | |
if (focusedMenuItem) { | |
var selectedOffSet = _reactDom2.default.findDOMNode(focusedMenuItem).offsetTop; | |
// Make the focused item be the 2nd item in the list the user sees | |
var scrollTop = selectedOffSet - menuItemHeight; | |
if (scrollTop < menuItemHeight) scrollTop = 0; | |
_reactDom2.default.findDOMNode(this.refs.scrollContainer).scrollTop = scrollTop; | |
} | |
} | |
}, { | |
key: 'cancelScrollEvent', | |
value: function cancelScrollEvent(event) { | |
event.stopPropagation(); | |
event.preventDefault(); | |
return false; | |
} | |
}, { | |
key: 'setWidth', | |
value: function setWidth() { | |
var el = _reactDom2.default.findDOMNode(this); | |
var listEl = _reactDom2.default.findDOMNode(this.refs.list); | |
var elWidth = el.offsetWidth; | |
var keyWidth = this.state.keyWidth; | |
var minWidth = keyWidth * 1.5; | |
var keyIncrements = elWidth / keyWidth; | |
var newWidth = void 0; | |
keyIncrements = keyIncrements <= 1.5 ? 1.5 : Math.ceil(keyIncrements); | |
newWidth = keyIncrements * keyWidth; | |
if (newWidth < minWidth) newWidth = minWidth; | |
el.style.width = newWidth + 'px'; | |
listEl.style.width = newWidth + 'px'; | |
} | |
}, { | |
key: 'render', | |
value: function render() { | |
var _this4 = this; | |
var _props2 = this.props, | |
autoWidth = _props2.autoWidth, | |
children = _props2.children, | |
desktop = _props2.desktop, | |
disableAutoFocus = _props2.disableAutoFocus, | |
initiallyKeyboardFocused = _props2.initiallyKeyboardFocused, | |
listStyle = _props2.listStyle, | |
maxHeight = _props2.maxHeight, | |
multiple = _props2.multiple, | |
onItemTouchTap = _props2.onItemTouchTap, | |
onEscKeyDown = _props2.onEscKeyDown, | |
onMenuItemFocusChange = _props2.onMenuItemFocusChange, | |
selectedMenuItemStyle = _props2.selectedMenuItemStyle, | |
menuItemStyle = _props2.menuItemStyle, | |
style = _props2.style, | |
value = _props2.value, | |
valueLink = _props2.valueLink, | |
width = _props2.width, | |
other = (0, _objectWithoutProperties3.default)(_props2, ['autoWidth', 'children', 'desktop', 'disableAutoFocus', 'initiallyKeyboardFocused', 'listStyle', 'maxHeight', 'multiple', 'onItemTouchTap', 'onEscKeyDown', 'onMenuItemFocusChange', 'selectedMenuItemStyle', 'menuItemStyle', 'style', 'value', 'valueLink', 'width']); | |
var prepareStyles = this.context.muiTheme.prepareStyles; | |
var styles = getStyles(this.props, this.context); | |
var mergedRootStyles = (0, _simpleAssign2.default)(styles.root, style); | |
var mergedListStyles = (0, _simpleAssign2.default)(styles.list, listStyle); | |
var filteredChildren = this.getFilteredChildren(children); | |
var menuItemIndex = 0; | |
var newChildren = _react2.default.Children.map(filteredChildren, function (child, index) { | |
var childIsDisabled = child.props.disabled; | |
var childName = child.type ? child.type.muiName : ''; | |
var newChild = child; | |
switch (childName) { | |
case 'MenuItem': | |
newChild = childIsDisabled ? _react2.default.cloneElement(child, { desktop: desktop }) : _this4.cloneMenuItem(child, menuItemIndex, styles, index); | |
break; | |
case 'Divider': | |
newChild = _react2.default.cloneElement(child, { | |
style: (0, _simpleAssign2.default)({}, styles.divider, child.props.style) | |
}); | |
break; | |
} | |
if (childName === 'MenuItem' && !childIsDisabled) { | |
menuItemIndex++; | |
} | |
return newChild; | |
}); | |
return _react2.default.createElement( | |
_ClickAwayListener2.default, | |
{ onClickAway: this.handleClickAway }, | |
_react2.default.createElement( | |
'div', | |
{ | |
onKeyDown: this.handleKeyDown, | |
onWheel: this.handleOnWheel, | |
style: prepareStyles(mergedRootStyles), | |
ref: 'scrollContainer' | |
}, | |
_react2.default.createElement( | |
_List2.default, | |
(0, _extends3.default)({}, other, { | |
ref: 'list', | |
style: mergedListStyles | |
}), | |
newChildren | |
) | |
) | |
); | |
} | |
}]); | |
return Menu; | |
}(_react.Component); | |
Menu.defaultProps = { | |
autoWidth: true, | |
desktop: false, | |
disableAutoFocus: false, | |
initiallyKeyboardFocused: false, | |
maxHeight: null, | |
multiple: false, | |
onChange: function onChange() {}, | |
onEscKeyDown: function onEscKeyDown() {}, | |
onItemTouchTap: function onItemTouchTap() {}, | |
onKeyDown: function onKeyDown() {} | |
}; | |
Menu.contextTypes = { | |
muiTheme: _react.PropTypes.object.isRequired | |
}; | |
var _initialiseProps = function _initialiseProps() { | |
var _this5 = this; | |
this.handleClickAway = function (event) { | |
if (event.defaultPrevented) { | |
return; | |
} | |
_this5.setFocusIndex(event, -1, false); | |
}; | |
this.handleKeyDown = function (event) { | |
var filteredChildren = _this5.getFilteredChildren(_this5.props.children); | |
var key = (0, _keycode2.default)(event); | |
switch (key) { | |
case 'down': | |
event.preventDefault(); | |
_this5.incrementKeyboardFocusIndex(event, filteredChildren); | |
break; | |
case 'esc': | |
_this5.props.onEscKeyDown(event); | |
break; | |
case 'tab': | |
event.preventDefault(); | |
if (event.shiftKey) { | |
_this5.decrementKeyboardFocusIndex(event); | |
} else { | |
_this5.incrementKeyboardFocusIndex(event, filteredChildren); | |
} | |
break; | |
case 'up': | |
event.preventDefault(); | |
_this5.decrementKeyboardFocusIndex(event); | |
break; | |
default: | |
if (key && key.length === 1) { | |
var hotKeys = _this5.hotKeyHolder.append(key); | |
if (_this5.setFocusIndexStartsWith(event, hotKeys)) { | |
event.preventDefault(); | |
} | |
} | |
} | |
_this5.props.onKeyDown(event); | |
}; | |
this.handleOnWheel = function (event) { | |
var scrollContainer = _this5.refs.scrollContainer; | |
// Only scroll lock if the the Menu is scrollable. | |
if (scrollContainer.scrollHeight <= scrollContainer.clientHeight) return; | |
var scrollTop = scrollContainer.scrollTop, | |
scrollHeight = scrollContainer.scrollHeight, | |
clientHeight = scrollContainer.clientHeight; | |
var wheelDelta = event.deltaY; | |
var isDeltaPositive = wheelDelta > 0; | |
if (isDeltaPositive && wheelDelta > scrollHeight - clientHeight - scrollTop) { | |
scrollContainer.scrollTop = scrollHeight; | |
return _this5.cancelScrollEvent(event); | |
} else if (!isDeltaPositive && -wheelDelta > scrollTop) { | |
scrollContainer.scrollTop = 0; | |
return _this5.cancelScrollEvent(event); | |
} | |
}; | |
}; | |
process.env.NODE_ENV !== "production" ? Menu.propTypes = { | |
/** | |
* If true, the width of the menu will be set automatically | |
* according to the widths of its children, | |
* using proper keyline increments (64px for desktop, | |
* 56px otherwise). | |
*/ | |
autoWidth: _react.PropTypes.bool, | |
/** | |
* The content of the menu. This is usually used to pass `MenuItem` | |
* elements. | |
*/ | |
children: _react.PropTypes.node, | |
/** | |
* If true, the menu item will render with compact desktop styles. | |
*/ | |
desktop: _react.PropTypes.bool, | |
/** | |
* If true, the menu will not be auto-focused. | |
*/ | |
disableAutoFocus: _react.PropTypes.bool, | |
/** | |
* If true, the menu will be keyboard-focused initially. | |
*/ | |
initiallyKeyboardFocused: _react.PropTypes.bool, | |
/** | |
* Override the inline-styles of the underlying `List` element. | |
*/ | |
listStyle: _react.PropTypes.object, | |
/** | |
* The maximum height of the menu in pixels. If specified, | |
* the menu will be scrollable if it is taller than the provided | |
* height. | |
*/ | |
maxHeight: _react.PropTypes.number, | |
/** | |
* Override the inline-styles of menu items. | |
*/ | |
menuItemStyle: _react.PropTypes.object, | |
/** | |
* If true, `value` must be an array and the menu will support | |
* multiple selections. | |
*/ | |
multiple: _react.PropTypes.bool, | |
/** | |
* Callback function fired when a menu item with `value` not | |
* equal to the current `value` of the menu is touch-tapped. | |
* | |
* @param {object} event TouchTap event targeting the menu item. | |
* @param {any} value If `multiple` is true, the menu's `value` | |
* array with either the menu item's `value` added (if | |
* it wasn't already selected) or omitted (if it was already selected). | |
* Otherwise, the `value` of the menu item. | |
*/ | |
onChange: _react.PropTypes.func, | |
/** | |
* Callback function fired when the menu is focused and the *Esc* key | |
* is pressed. | |
* | |
* @param {object} event `keydown` event targeting the menu. | |
*/ | |
onEscKeyDown: _react.PropTypes.func, | |
/** | |
* Callback function fired when a menu item is touch-tapped. | |
* | |
* @param {object} event TouchTap event targeting the menu item. | |
* @param {object} menuItem The menu item. | |
* @param {number} index The index of the menu item. | |
*/ | |
onItemTouchTap: _react.PropTypes.func, | |
/** @ignore */ | |
onKeyDown: _react.PropTypes.func, | |
/** | |
* Callback function fired when the focus on a `MenuItem` is changed. | |
* There will be some "duplicate" changes reported if two different | |
* focusing event happen, for example if a `MenuItem` is focused via | |
* the keyboard and then it is clicked on. | |
* | |
* @param {object} event The event that triggered the focus change. | |
* The event can be null since the focus can be changed for non-event | |
* reasons such as prop changes. | |
* @param {number} newFocusIndex The index of the newly focused | |
* `MenuItem` or `-1` if focus was lost. | |
*/ | |
onMenuItemFocusChange: _react.PropTypes.func, | |
/** | |
* Override the inline-styles of selected menu items. | |
*/ | |
selectedMenuItemStyle: _react.PropTypes.object, | |
/** | |
* Override the inline-styles of the root element. | |
*/ | |
style: _react.PropTypes.object, | |
/** | |
* If `multiple` is true, an array of the `value`s of the selected | |
* menu items. Otherwise, the `value` of the selected menu item. | |
* If provided, the menu will be a controlled component. | |
* This component also supports valueLink. | |
*/ | |
value: _react.PropTypes.any, | |
/** | |
* ValueLink for the menu's `value`. | |
*/ | |
valueLink: _react.PropTypes.object, | |
/** | |
* The width of the menu. If not specified, the menu's width | |
* will be set according to the widths of its children, using | |
* proper keyline increments (64px for desktop, 56px otherwise). | |
*/ | |
width: _propTypes2.default.stringOrNumber | |
} : void 0; | |
exports.default = Menu; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 81 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = { | |
once: function once(el, type, callback) { | |
var typeArray = type ? type.split(' ') : []; | |
var recursiveFunction = function recursiveFunction(event) { | |
event.target.removeEventListener(event.type, recursiveFunction); | |
return callback(event); | |
}; | |
for (var i = typeArray.length - 1; i >= 0; i--) { | |
this.on(el, typeArray[i], recursiveFunction); | |
} | |
}, | |
on: function on(el, type, callback) { | |
if (el.addEventListener) { | |
el.addEventListener(type, callback); | |
} else { | |
// IE8+ Support | |
el.attachEvent('on' + type, function () { | |
callback.call(el); | |
}); | |
} | |
}, | |
off: function off(el, type, callback) { | |
if (el.removeEventListener) { | |
el.removeEventListener(type, callback); | |
} else { | |
// IE8+ Support | |
el.detachEvent('on' + type, callback); | |
} | |
}, | |
isKeyboard: function isKeyboard(event) { | |
return ['keydown', 'keypress', 'keyup'].indexOf(event.type) !== -1; | |
} | |
}; | |
/***/ }), | |
/* 82 */ | |
/***/ (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 _prodInvariant = __webpack_require__(13); | |
var invariant = __webpack_require__(11); | |
/** | |
* Injectable ordering of event plugins. | |
*/ | |
var eventPluginOrder = null; | |
/** | |
* Injectable mapping from names to event plugin modules. | |
*/ | |
var namesToPlugins = {}; | |
/** | |
* Recomputes the plugin list using the injected plugins and plugin ordering. | |
* | |
* @private | |
*/ | |
function recomputePluginOrdering() { | |
if (!eventPluginOrder) { | |
// Wait until an `eventPluginOrder` is injected. | |
return; | |
} | |
for (var pluginName in namesToPlugins) { | |
var pluginModule = namesToPlugins[pluginName]; | |
var pluginIndex = eventPluginOrder.indexOf(pluginName); | |
!(pluginIndex > -1) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : _prodInvariant('96', pluginName) : void 0; | |
if (EventPluginRegistry.plugins[pluginIndex]) { | |
continue; | |
} | |
!pluginModule.extractEvents ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : _prodInvariant('97', pluginName) : void 0; | |
EventPluginRegistry.plugins[pluginIndex] = pluginModule; | |
var publishedEvents = pluginModule.eventTypes; | |
for (var eventName in publishedEvents) { | |
!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : _prodInvariant('98', eventName, pluginName) : void 0; | |
} | |
} | |
} | |
/** | |
* Publishes an event so that it can be dispatched by the supplied plugin. | |
* | |
* @param {object} dispatchConfig Dispatch configuration for the event. | |
* @param {object} PluginModule Plugin publishing the event. | |
* @return {boolean} True if the event was successfully published. | |
* @private | |
*/ | |
function publishEventForPlugin(dispatchConfig, pluginModule, eventName) { | |
!!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same event name, `%s`.', eventName) : _prodInvariant('99', eventName) : void 0; | |
EventPluginRegistry.eventNameDispatchConfigs[eventName] = dispatchConfig; | |
var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames; | |
if (phasedRegistrationNames) { | |
for (var phaseName in phasedRegistrationNames) { | |
if (phasedRegistrationNames.hasOwnProperty(phaseName)) { | |
var phasedRegistrationName = phasedRegistrationNames[phaseName]; | |
publishRegistrationName(phasedRegistrationName, pluginModule, eventName); | |
} | |
} | |
return true; | |
} else if (dispatchConfig.registrationName) { | |
publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName); | |
return true; | |
} | |
return false; | |
} | |
/** | |
* Publishes a registration name that is used to identify dispatched events and | |
* can be used with `EventPluginHub.putListener` to register listeners. | |
* | |
* @param {string} registrationName Registration name to add. | |
* @param {object} PluginModule Plugin publishing the event. | |
* @private | |
*/ | |
function publishRegistrationName(registrationName, pluginModule, eventName) { | |
!!EventPluginRegistry.registrationNameModules[registrationName] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same registration name, `%s`.', registrationName) : _prodInvariant('100', registrationName) : void 0; | |
EventPluginRegistry.registrationNameModules[registrationName] = pluginModule; | |
EventPluginRegistry.registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies; | |
if (process.env.NODE_ENV !== 'production') { | |
var lowerCasedName = registrationName.toLowerCase(); | |
EventPluginRegistry.possibleRegistrationNames[lowerCasedName] = registrationName; | |
if (registrationName === 'onDoubleClick') { | |
EventPluginRegistry.possibleRegistrationNames.ondblclick = registrationName; | |
} | |
} | |
} | |
/** | |
* Registers plugins so that they can extract and dispatch events. | |
* | |
* @see {EventPluginHub} | |
*/ | |
var EventPluginRegistry = { | |
/** | |
* Ordered list of injected plugins. | |
*/ | |
plugins: [], | |
/** | |
* Mapping from event name to dispatch config | |
*/ | |
eventNameDispatchConfigs: {}, | |
/** | |
* Mapping from registration name to plugin module | |
*/ | |
registrationNameModules: {}, | |
/** | |
* Mapping from registration name to event name | |
*/ | |
registrationNameDependencies: {}, | |
/** | |
* Mapping from lowercase registration names to the properly cased version, | |
* used to warn in the case of missing event handlers. Available | |
* only in __DEV__. | |
* @type {Object} | |
*/ | |
possibleRegistrationNames: process.env.NODE_ENV !== 'production' ? {} : null, | |
// Trust the developer to only use possibleRegistrationNames in __DEV__ | |
/** | |
* Injects an ordering of plugins (by plugin name). This allows the ordering | |
* to be decoupled from injection of the actual plugins so that ordering is | |
* always deterministic regardless of packaging, on-the-fly injection, etc. | |
* | |
* @param {array} InjectedEventPluginOrder | |
* @internal | |
* @see {EventPluginHub.injection.injectEventPluginOrder} | |
*/ | |
injectEventPluginOrder: function (injectedEventPluginOrder) { | |
!!eventPluginOrder ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React.') : _prodInvariant('101') : void 0; | |
// Clone the ordering so it cannot be dynamically mutated. | |
eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder); | |
recomputePluginOrdering(); | |
}, | |
/** | |
* Injects plugins to be used by `EventPluginHub`. The plugin names must be | |
* in the ordering injected by `injectEventPluginOrder`. | |
* | |
* Plugins can be injected as part of page initialization or on-the-fly. | |
* | |
* @param {object} injectedNamesToPlugins Map from names to plugin modules. | |
* @internal | |
* @see {EventPluginHub.injection.injectEventPluginsByName} | |
*/ | |
injectEventPluginsByName: function (injectedNamesToPlugins) { | |
var isOrderingDirty = false; | |
for (var pluginName in injectedNamesToPlugins) { | |
if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) { | |
continue; | |
} | |
var pluginModule = injectedNamesToPlugins[pluginName]; | |
if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== pluginModule) { | |
!!namesToPlugins[pluginName] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject two different event plugins using the same name, `%s`.', pluginName) : _prodInvariant('102', pluginName) : void 0; | |
namesToPlugins[pluginName] = pluginModule; | |
isOrderingDirty = true; | |
} | |
} | |
if (isOrderingDirty) { | |
recomputePluginOrdering(); | |
} | |
}, | |
/** | |
* Looks up the plugin for the supplied event. | |
* | |
* @param {object} event A synthetic event. | |
* @return {?object} The plugin that created the supplied event. | |
* @internal | |
*/ | |
getPluginModuleForEvent: function (event) { | |
var dispatchConfig = event.dispatchConfig; | |
if (dispatchConfig.registrationName) { | |
return EventPluginRegistry.registrationNameModules[dispatchConfig.registrationName] || null; | |
} | |
if (dispatchConfig.phasedRegistrationNames !== undefined) { | |
// pulling phasedRegistrationNames out of dispatchConfig helps Flow see | |
// that it is not undefined. | |
var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames; | |
for (var phase in phasedRegistrationNames) { | |
if (!phasedRegistrationNames.hasOwnProperty(phase)) { | |
continue; | |
} | |
var pluginModule = EventPluginRegistry.registrationNameModules[phasedRegistrationNames[phase]]; | |
if (pluginModule) { | |
return pluginModule; | |
} | |
} | |
} | |
return null; | |
}, | |
/** | |
* Exposed for unit testing. | |
* @private | |
*/ | |
_resetEventPlugins: function () { | |
eventPluginOrder = null; | |
for (var pluginName in namesToPlugins) { | |
if (namesToPlugins.hasOwnProperty(pluginName)) { | |
delete namesToPlugins[pluginName]; | |
} | |
} | |
EventPluginRegistry.plugins.length = 0; | |
var eventNameDispatchConfigs = EventPluginRegistry.eventNameDispatchConfigs; | |
for (var eventName in eventNameDispatchConfigs) { | |
if (eventNameDispatchConfigs.hasOwnProperty(eventName)) { | |
delete eventNameDispatchConfigs[eventName]; | |
} | |
} | |
var registrationNameModules = EventPluginRegistry.registrationNameModules; | |
for (var registrationName in registrationNameModules) { | |
if (registrationNameModules.hasOwnProperty(registrationName)) { | |
delete registrationNameModules[registrationName]; | |
} | |
} | |
if (process.env.NODE_ENV !== 'production') { | |
var possibleRegistrationNames = EventPluginRegistry.possibleRegistrationNames; | |
for (var lowerCasedName in possibleRegistrationNames) { | |
if (possibleRegistrationNames.hasOwnProperty(lowerCasedName)) { | |
delete possibleRegistrationNames[lowerCasedName]; | |
} | |
} | |
} | |
} | |
}; | |
module.exports = EventPluginRegistry; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 83 */ | |
/***/ (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 _assign = __webpack_require__(14); | |
var EventPluginRegistry = __webpack_require__(82); | |
var ReactEventEmitterMixin = __webpack_require__(481); | |
var ViewportMetrics = __webpack_require__(210); | |
var getVendorPrefixedEventName = __webpack_require__(517); | |
var isEventSupported = __webpack_require__(134); | |
/** | |
* Summary of `ReactBrowserEventEmitter` event handling: | |
* | |
* - Top-level delegation is used to trap most native browser events. This | |
* may only occur in the main thread and is the responsibility of | |
* ReactEventListener, which is injected and can therefore support pluggable | |
* event sources. This is the only work that occurs in the main thread. | |
* | |
* - We normalize and de-duplicate events to account for browser quirks. This | |
* may be done in the worker thread. | |
* | |
* - Forward these native events (with the associated top-level type used to | |
* trap it) to `EventPluginHub`, which in turn will ask plugins if they want | |
* to extract any synthetic events. | |
* | |
* - The `EventPluginHub` will then process each event by annotating them with | |
* "dispatches", a sequence of listeners and IDs that care about that event. | |
* | |
* - The `EventPluginHub` then dispatches the events. | |
* | |
* Overview of React and the event system: | |
* | |
* +------------+ . | |
* | DOM | . | |
* +------------+ . | |
* | . | |
* v . | |
* +------------+ . | |
* | ReactEvent | . | |
* | Listener | . | |
* +------------+ . +-----------+ | |
* | . +--------+|SimpleEvent| | |
* | . | |Plugin | | |
* +-----|------+ . v +-----------+ | |
* | | | . +--------------+ +------------+ | |
* | +-----------.--->|EventPluginHub| | Event | | |
* | | . | | +-----------+ | Propagators| | |
* | ReactEvent | . | | |TapEvent | |------------| | |
* | Emitter | . | |<---+|Plugin | |other plugin| | |
* | | . | | +-----------+ | utilities | | |
* | +-----------.--->| | +------------+ | |
* | | | . +--------------+ | |
* +-----|------+ . ^ +-----------+ | |
* | . | |Enter/Leave| | |
* + . +-------+|Plugin | | |
* +-------------+ . +-----------+ | |
* | application | . | |
* |-------------| . | |
* | | . | |
* | | . | |
* +-------------+ . | |
* . | |
* React Core . General Purpose Event Plugin System | |
*/ | |
var hasEventPageXY; | |
var alreadyListeningTo = {}; | |
var isMonitoringScrollValue = false; | |
var reactTopListenersCounter = 0; | |
// For events like 'submit' which don't consistently bubble (which we trap at a | |
// lower node than `document`), binding at `document` would cause duplicate | |
// events so we don't include them here | |
var topEventMapping = { | |
topAbort: 'abort', | |
topAnimationEnd: getVendorPrefixedEventName('animationend') || 'animationend', | |
topAnimationIteration: getVendorPrefixedEventName('animationiteration') || 'animationiteration', | |
topAnimationStart: getVendorPrefixedEventName('animationstart') || 'animationstart', | |
topBlur: 'blur', | |
topCanPlay: 'canplay', | |
topCanPlayThrough: 'canplaythrough', | |
topChange: 'change', | |
topClick: 'click', | |
topCompositionEnd: 'compositionend', | |
topCompositionStart: 'compositionstart', | |
topCompositionUpdate: 'compositionupdate', | |
topContextMenu: 'contextmenu', | |
topCopy: 'copy', | |
topCut: 'cut', | |
topDoubleClick: 'dblclick', | |
topDrag: 'drag', | |
topDragEnd: 'dragend', | |
topDragEnter: 'dragenter', | |
topDragExit: 'dragexit', | |
topDragLeave: 'dragleave', | |
topDragOver: 'dragover', | |
topDragStart: 'dragstart', | |
topDrop: 'drop', | |
topDurationChange: 'durationchange', | |
topEmptied: 'emptied', | |
topEncrypted: 'encrypted', | |
topEnded: 'ended', | |
topError: 'error', | |
topFocus: 'focus', | |
topInput: 'input', | |
topKeyDown: 'keydown', | |
topKeyPress: 'keypress', | |
topKeyUp: 'keyup', | |
topLoadedData: 'loadeddata', | |
topLoadedMetadata: 'loadedmetadata', | |
topLoadStart: 'loadstart', | |
topMouseDown: 'mousedown', | |
topMouseMove: 'mousemove', | |
topMouseOut: 'mouseout', | |
topMouseOver: 'mouseover', | |
topMouseUp: 'mouseup', | |
topPaste: 'paste', | |
topPause: 'pause', | |
topPlay: 'play', | |
topPlaying: 'playing', | |
topProgress: 'progress', | |
topRateChange: 'ratechange', | |
topScroll: 'scroll', | |
topSeeked: 'seeked', | |
topSeeking: 'seeking', | |
topSelectionChange: 'selectionchange', | |
topStalled: 'stalled', | |
topSuspend: 'suspend', | |
topTextInput: 'textInput', | |
topTimeUpdate: 'timeupdate', | |
topTouchCancel: 'touchcancel', | |
topTouchEnd: 'touchend', | |
topTouchMove: 'touchmove', | |
topTouchStart: 'touchstart', | |
topTransitionEnd: getVendorPrefixedEventName('transitionend') || 'transitionend', | |
topVolumeChange: 'volumechange', | |
topWaiting: 'waiting', | |
topWheel: 'wheel' | |
}; | |
/** | |
* To ensure no conflicts with other potential React instances on the page | |
*/ | |
var topListenersIDKey = '_reactListenersID' + String(Math.random()).slice(2); | |
function getListeningForDocument(mountAt) { | |
// In IE8, `mountAt` is a host object and doesn't have `hasOwnProperty` | |
// directly. | |
if (!Object.prototype.hasOwnProperty.call(mountAt, topListenersIDKey)) { | |
mountAt[topListenersIDKey] = reactTopListenersCounter++; | |
alreadyListeningTo[mountAt[topListenersIDKey]] = {}; | |
} | |
return alreadyListeningTo[mountAt[topListenersIDKey]]; | |
} | |
/** | |
* `ReactBrowserEventEmitter` is used to attach top-level event listeners. For | |
* example: | |
* | |
* EventPluginHub.putListener('myID', 'onClick', myFunction); | |
* | |
* This would allocate a "registration" of `('onClick', myFunction)` on 'myID'. | |
* | |
* @internal | |
*/ | |
var ReactBrowserEventEmitter = _assign({}, ReactEventEmitterMixin, { | |
/** | |
* Injectable event backend | |
*/ | |
ReactEventListener: null, | |
injection: { | |
/** | |
* @param {object} ReactEventListener | |
*/ | |
injectReactEventListener: function (ReactEventListener) { | |
ReactEventListener.setHandleTopLevel(ReactBrowserEventEmitter.handleTopLevel); | |
ReactBrowserEventEmitter.ReactEventListener = ReactEventListener; | |
} | |
}, | |
/** | |
* Sets whether or not any created callbacks should be enabled. | |
* | |
* @param {boolean} enabled True if callbacks should be enabled. | |
*/ | |
setEnabled: function (enabled) { | |
if (ReactBrowserEventEmitter.ReactEventListener) { | |
ReactBrowserEventEmitter.ReactEventListener.setEnabled(enabled); | |
} | |
}, | |
/** | |
* @return {boolean} True if callbacks are enabled. | |
*/ | |
isEnabled: function () { | |
return !!(ReactBrowserEventEmitter.ReactEventListener && ReactBrowserEventEmitter.ReactEventListener.isEnabled()); | |
}, | |
/** | |
* We listen for bubbled touch events on the document object. | |
* | |
* Firefox v8.01 (and possibly others) exhibited strange behavior when | |
* mounting `onmousemove` events at some node that was not the document | |
* element. The symptoms were that if your mouse is not moving over something | |
* contained within that mount point (for example on the background) the | |
* top-level listeners for `onmousemove` won't be called. However, if you | |
* register the `mousemove` on the document object, then it will of course | |
* catch all `mousemove`s. This along with iOS quirks, justifies restricting | |
* top-level listeners to the document object only, at least for these | |
* movement types of events and possibly all events. | |
* | |
* @see http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html | |
* | |
* Also, `keyup`/`keypress`/`keydown` do not bubble to the window on IE, but | |
* they bubble to document. | |
* | |
* @param {string} registrationName Name of listener (e.g. `onClick`). | |
* @param {object} contentDocumentHandle Document which owns the container | |
*/ | |
listenTo: function (registrationName, contentDocumentHandle) { | |
var mountAt = contentDocumentHandle; | |
var isListening = getListeningForDocument(mountAt); | |
var dependencies = EventPluginRegistry.registrationNameDependencies[registrationName]; | |
for (var i = 0; i < dependencies.length; i++) { | |
var dependency = dependencies[i]; | |
if (!(isListening.hasOwnProperty(dependency) && isListening[dependency])) { | |
if (dependency === 'topWheel') { | |
if (isEventSupported('wheel')) { | |
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topWheel', 'wheel', mountAt); | |
} else if (isEventSupported('mousewheel')) { | |
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topWheel', 'mousewheel', mountAt); | |
} else { | |
// Firefox needs to capture a different mouse scroll event. | |
// @see http://www.quirksmode.org/dom/events/tests/scroll.html | |
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topWheel', 'DOMMouseScroll', mountAt); | |
} | |
} else if (dependency === 'topScroll') { | |
if (isEventSupported('scroll', true)) { | |
ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent('topScroll', 'scroll', mountAt); | |
} else { | |
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topScroll', 'scroll', ReactBrowserEventEmitter.ReactEventListener.WINDOW_HANDLE); | |
} | |
} else if (dependency === 'topFocus' || dependency === 'topBlur') { | |
if (isEventSupported('focus', true)) { | |
ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent('topFocus', 'focus', mountAt); | |
ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent('topBlur', 'blur', mountAt); | |
} else if (isEventSupported('focusin')) { | |
// IE has `focusin` and `focusout` events which bubble. | |
// @see http://www.quirksmode.org/blog/archives/2008/04/delegating_the.html | |
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topFocus', 'focusin', mountAt); | |
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topBlur', 'focusout', mountAt); | |
} | |
// to make sure blur and focus event listeners are only attached once | |
isListening.topBlur = true; | |
isListening.topFocus = true; | |
} else if (topEventMapping.hasOwnProperty(dependency)) { | |
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(dependency, topEventMapping[dependency], mountAt); | |
} | |
isListening[dependency] = true; | |
} | |
} | |
}, | |
trapBubbledEvent: function (topLevelType, handlerBaseName, handle) { | |
return ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelType, handlerBaseName, handle); | |
}, | |
trapCapturedEvent: function (topLevelType, handlerBaseName, handle) { | |
return ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelType, handlerBaseName, handle); | |
}, | |
/** | |
* Protect against document.createEvent() returning null | |
* Some popup blocker extensions appear to do this: | |
* https://github.com/facebook/react/issues/6887 | |
*/ | |
supportsEventPageXY: function () { | |
if (!document.createEvent) { | |
return false; | |
} | |
var ev = document.createEvent('MouseEvent'); | |
return ev != null && 'pageX' in ev; | |
}, | |
/** | |
* Listens to window scroll and resize events. We cache scroll values so that | |
* application code can access them without triggering reflows. | |
* | |
* ViewportMetrics is only used by SyntheticMouse/TouchEvent and only when | |
* pageX/pageY isn't supported (legacy browsers). | |
* | |
* NOTE: Scroll events do not bubble. | |
* | |
* @see http://www.quirksmode.org/dom/events/scroll.html | |
*/ | |
ensureScrollValueMonitoring: function () { | |
if (hasEventPageXY === undefined) { | |
hasEventPageXY = ReactBrowserEventEmitter.supportsEventPageXY(); | |
} | |
if (!hasEventPageXY && !isMonitoringScrollValue) { | |
var refresh = ViewportMetrics.refreshScrollValues; | |
ReactBrowserEventEmitter.ReactEventListener.monitorScrollValue(refresh); | |
isMonitoringScrollValue = true; | |
} | |
} | |
}); | |
module.exports = ReactBrowserEventEmitter; | |
/***/ }), | |
/* 84 */ | |
/***/ (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 SyntheticUIEvent = __webpack_require__(73); | |
var ViewportMetrics = __webpack_require__(210); | |
var getEventModifierState = __webpack_require__(132); | |
/** | |
* @interface MouseEvent | |
* @see http://www.w3.org/TR/DOM-Level-3-Events/ | |
*/ | |
var MouseEventInterface = { | |
screenX: null, | |
screenY: null, | |
clientX: null, | |
clientY: null, | |
ctrlKey: null, | |
shiftKey: null, | |
altKey: null, | |
metaKey: null, | |
getModifierState: getEventModifierState, | |
button: function (event) { | |
// Webkit, Firefox, IE9+ | |
// which: 1 2 3 | |
// button: 0 1 2 (standard) | |
var button = event.button; | |
if ('which' in event) { | |
return button; | |
} | |
// IE<9 | |
// which: undefined | |
// button: 0 0 0 | |
// button: 1 4 2 (onmouseup) | |
return button === 2 ? 2 : button === 4 ? 1 : 0; | |
}, | |
buttons: null, | |
relatedTarget: function (event) { | |
return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement); | |
}, | |
// "Proprietary" Interface. | |
pageX: function (event) { | |
return 'pageX' in event ? event.pageX : event.clientX + ViewportMetrics.currentScrollLeft; | |
}, | |
pageY: function (event) { | |
return 'pageY' in event ? event.pageY : event.clientY + ViewportMetrics.currentScrollTop; | |
} | |
}; | |
/** | |
* @param {object} dispatchConfig Configuration used to dispatch this event. | |
* @param {string} dispatchMarker Marker identifying the event target. | |
* @param {object} nativeEvent Native browser event. | |
* @extends {SyntheticUIEvent} | |
*/ | |
function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { | |
return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); | |
} | |
SyntheticUIEvent.augmentClass(SyntheticMouseEvent, MouseEventInterface); | |
module.exports = SyntheticMouseEvent; | |
/***/ }), | |
/* 85 */ | |
/***/ (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 _prodInvariant = __webpack_require__(13); | |
var invariant = __webpack_require__(11); | |
var OBSERVED_ERROR = {}; | |
/** | |
* `Transaction` creates a black box that is able to wrap any method such that | |
* certain invariants are maintained before and after the method is invoked | |
* (Even if an exception is thrown while invoking the wrapped method). Whoever | |
* instantiates a transaction can provide enforcers of the invariants at | |
* creation time. The `Transaction` class itself will supply one additional | |
* automatic invariant for you - the invariant that any transaction instance | |
* should not be run while it is already being run. You would typically create a | |
* single instance of a `Transaction` for reuse multiple times, that potentially | |
* is used to wrap several different methods. Wrappers are extremely simple - | |
* they only require implementing two methods. | |
* | |
* <pre> | |
* wrappers (injected at creation time) | |
* + + | |
* | | | |
* +-----------------|--------|--------------+ | |
* | v | | | |
* | +---------------+ | | | |
* | +--| wrapper1 |---|----+ | | |
* | | +---------------+ v | | | |
* | | +-------------+ | | | |
* | | +----| wrapper2 |--------+ | | |
* | | | +-------------+ | | | | |
* | | | | | | | |
* | v v v v | wrapper | |
* | +---+ +---+ +---------+ +---+ +---+ | invariants | |
* perform(anyMethod) | | | | | | | | | | | | maintained | |
* +----------------->|-|---|-|---|-->|anyMethod|---|---|-|---|-|--------> | |
* | | | | | | | | | | | | | |
* | | | | | | | | | | | | | |
* | | | | | | | | | | | | | |
* | +---+ +---+ +---------+ +---+ +---+ | | |
* | initialize close | | |
* +-----------------------------------------+ | |
* </pre> | |
* | |
* Use cases: | |
* - Preserving the input selection ranges before/after reconciliation. | |
* Restoring selection even in the event of an unexpected error. | |
* - Deactivating events while rearranging the DOM, preventing blurs/focuses, | |
* while guaranteeing that afterwards, the event system is reactivated. | |
* - Flushing a queue of collected DOM mutations to the main UI thread after a | |
* reconciliation takes place in a worker thread. | |
* - Invoking any collected `componentDidUpdate` callbacks after rendering new | |
* content. | |
* - (Future use case): Wrapping particular flushes of the `ReactWorker` queue | |
* to preserve the `scrollTop` (an automatic scroll aware DOM). | |
* - (Future use case): Layout calculations before and after DOM updates. | |
* | |
* Transactional plugin API: | |
* - A module that has an `initialize` method that returns any precomputation. | |
* - and a `close` method that accepts the precomputation. `close` is invoked | |
* when the wrapped process is completed, or has failed. | |
* | |
* @param {Array<TransactionalWrapper>} transactionWrapper Wrapper modules | |
* that implement `initialize` and `close`. | |
* @return {Transaction} Single transaction for reuse in thread. | |
* | |
* @class Transaction | |
*/ | |
var TransactionImpl = { | |
/** | |
* Sets up this instance so that it is prepared for collecting metrics. Does | |
* so such that this setup method may be used on an instance that is already | |
* initialized, in a way that does not consume additional memory upon reuse. | |
* That can be useful if you decide to make your subclass of this mixin a | |
* "PooledClass". | |
*/ | |
reinitializeTransaction: function () { | |
this.transactionWrappers = this.getTransactionWrappers(); | |
if (this.wrapperInitData) { | |
this.wrapperInitData.length = 0; | |
} else { | |
this.wrapperInitData = []; | |
} | |
this._isInTransaction = false; | |
}, | |
_isInTransaction: false, | |
/** | |
* @abstract | |
* @return {Array<TransactionWrapper>} Array of transaction wrappers. | |
*/ | |
getTransactionWrappers: null, | |
isInTransaction: function () { | |
return !!this._isInTransaction; | |
}, | |
/** | |
* Executes the function within a safety window. Use this for the top level | |
* methods that result in large amounts of computation/mutations that would | |
* need to be safety checked. The optional arguments helps prevent the need | |
* to bind in many cases. | |
* | |
* @param {function} method Member of scope to call. | |
* @param {Object} scope Scope to invoke from. | |
* @param {Object?=} a Argument to pass to the method. | |
* @param {Object?=} b Argument to pass to the method. | |
* @param {Object?=} c Argument to pass to the method. | |
* @param {Object?=} d Argument to pass to the method. | |
* @param {Object?=} e Argument to pass to the method. | |
* @param {Object?=} f Argument to pass to the method. | |
* | |
* @return {*} Return value from `method`. | |
*/ | |
perform: function (method, scope, a, b, c, d, e, f) { | |
!!this.isInTransaction() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Transaction.perform(...): Cannot initialize a transaction when there is already an outstanding transaction.') : _prodInvariant('27') : void 0; | |
var errorThrown; | |
var ret; | |
try { | |
this._isInTransaction = true; | |
// Catching errors makes debugging more difficult, so we start with | |
// errorThrown set to true before setting it to false after calling | |
// close -- if it's still set to true in the finally block, it means | |
// one of these calls threw. | |
errorThrown = true; | |
this.initializeAll(0); | |
ret = method.call(scope, a, b, c, d, e, f); | |
errorThrown = false; | |
} finally { | |
try { | |
if (errorThrown) { | |
// If `method` throws, prefer to show that stack trace over any thrown | |
// by invoking `closeAll`. | |
try { | |
this.closeAll(0); | |
} catch (err) {} | |
} else { | |
// Since `method` didn't throw, we don't want to silence the exception | |
// here. | |
this.closeAll(0); | |
} | |
} finally { | |
this._isInTransaction = false; | |
} | |
} | |
return ret; | |
}, | |
initializeAll: function (startIndex) { | |
var transactionWrappers = this.transactionWrappers; | |
for (var i = startIndex; i < transactionWrappers.length; i++) { | |
var wrapper = transactionWrappers[i]; | |
try { | |
// Catching errors makes debugging more difficult, so we start with the | |
// OBSERVED_ERROR state before overwriting it with the real return value | |
// of initialize -- if it's still set to OBSERVED_ERROR in the finally | |
// block, it means wrapper.initialize threw. | |
this.wrapperInitData[i] = OBSERVED_ERROR; | |
this.wrapperInitData[i] = wrapper.initialize ? wrapper.initialize.call(this) : null; | |
} finally { | |
if (this.wrapperInitData[i] === OBSERVED_ERROR) { | |
// The initializer for wrapper i threw an error; initialize the | |
// remaining wrappers but silence any exceptions from them to ensure | |
// that the first error is the one to bubble up. | |
try { | |
this.initializeAll(i + 1); | |
} catch (err) {} | |
} | |
} | |
} | |
}, | |
/** | |
* Invokes each of `this.transactionWrappers.close[i]` functions, passing into | |
* them the respective return values of `this.transactionWrappers.init[i]` | |
* (`close`rs that correspond to initializers that failed will not be | |
* invoked). | |
*/ | |
closeAll: function (startIndex) { | |
!this.isInTransaction() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Transaction.closeAll(): Cannot close transaction when none are open.') : _prodInvariant('28') : void 0; | |
var transactionWrappers = this.transactionWrappers; | |
for (var i = startIndex; i < transactionWrappers.length; i++) { | |
var wrapper = transactionWrappers[i]; | |
var initData = this.wrapperInitData[i]; | |
var errorThrown; | |
try { | |
// Catching errors makes debugging more difficult, so we start with | |
// errorThrown set to true before setting it to false after calling | |
// close -- if it's still set to true in the finally block, it means | |
// wrapper.close threw. | |
errorThrown = true; | |
if (initData !== OBSERVED_ERROR && wrapper.close) { | |
wrapper.close.call(this, initData); | |
} | |
errorThrown = false; | |
} finally { | |
if (errorThrown) { | |
// The closer for wrapper i threw an error; close the remaining | |
// wrappers but silence any exceptions from them to ensure that the | |
// first error is the one to bubble up. | |
try { | |
this.closeAll(i + 1); | |
} catch (e) {} | |
} | |
} | |
} | |
this.wrapperInitData.length = 0; | |
} | |
}; | |
module.exports = TransactionImpl; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 86 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/** | |
* 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. | |
* | |
* Based on the escape-html library, which is used under the MIT License below: | |
* | |
* Copyright (c) 2012-2013 TJ Holowaychuk | |
* Copyright (c) 2015 Andreas Lubbe | |
* Copyright (c) 2015 Tiancheng "Timothy" Gu | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining | |
* a copy of this software and associated documentation files (the | |
* 'Software'), to deal in the Software without restriction, including | |
* without limitation the rights to use, copy, modify, merge, publish, | |
* distribute, sublicense, and/or sell copies of the Software, and to | |
* permit persons to whom the Software is furnished to do so, subject to | |
* the following conditions: | |
* | |
* The above copyright notice and this permission notice shall be | |
* included in all copies or substantial portions of the Software. | |
* | |
* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, | |
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | |
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | |
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | |
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |
* | |
*/ | |
// code copied and modified from escape-html | |
/** | |
* Module variables. | |
* @private | |
*/ | |
var matchHtmlRegExp = /["'&<>]/; | |
/** | |
* Escape special characters in the given string of html. | |
* | |
* @param {string} string The string to escape for inserting into HTML | |
* @return {string} | |
* @public | |
*/ | |
function escapeHtml(string) { | |
var str = '' + string; | |
var match = matchHtmlRegExp.exec(str); | |
if (!match) { | |
return str; | |
} | |
var escape; | |
var html = ''; | |
var index = 0; | |
var lastIndex = 0; | |
for (index = match.index; index < str.length; index++) { | |
switch (str.charCodeAt(index)) { | |
case 34: | |
// " | |
escape = '"'; | |
break; | |
case 38: | |
// & | |
escape = '&'; | |
break; | |
case 39: | |
// ' | |
escape = '''; // modified from escape-html; used to be ''' | |
break; | |
case 60: | |
// < | |
escape = '<'; | |
break; | |
case 62: | |
// > | |
escape = '>'; | |
break; | |
default: | |
continue; | |
} | |
if (lastIndex !== index) { | |
html += str.substring(lastIndex, index); | |
} | |
lastIndex = index + 1; | |
html += escape; | |
} | |
return lastIndex !== index ? html + str.substring(lastIndex, index) : html; | |
} | |
// end code copied and modified from escape-html | |
/** | |
* Escapes text to prevent scripting attacks. | |
* | |
* @param {*} text Text value to escape. | |
* @return {string} An escaped string. | |
*/ | |
function escapeTextContentForBrowser(text) { | |
if (typeof text === 'boolean' || typeof text === 'number') { | |
// this shortcircuit helps perf for types that we know will never have | |
// special characters, especially given that this function is used often | |
// for numeric dom ids. | |
return '' + text; | |
} | |
return escapeHtml(text); | |
} | |
module.exports = escapeTextContentForBrowser; | |
/***/ }), | |
/* 87 */ | |
/***/ (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 ExecutionEnvironment = __webpack_require__(18); | |
var DOMNamespaces = __webpack_require__(123); | |
var WHITESPACE_TEST = /^[ \r\n\t\f]/; | |
var NONVISIBLE_TEST = /<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/; | |
var createMicrosoftUnsafeLocalFunction = __webpack_require__(130); | |
// SVG temp container for IE lacking innerHTML | |
var reusableSVGContainer; | |
/** | |
* Set the innerHTML property of a node, ensuring that whitespace is preserved | |
* even in IE8. | |
* | |
* @param {DOMElement} node | |
* @param {string} html | |
* @internal | |
*/ | |
var setInnerHTML = createMicrosoftUnsafeLocalFunction(function (node, html) { | |
// IE does not have innerHTML for SVG nodes, so instead we inject the | |
// new markup in a temp node and then move the child nodes across into | |
// the target node | |
if (node.namespaceURI === DOMNamespaces.svg && !('innerHTML' in node)) { | |
reusableSVGContainer = reusableSVGContainer || document.createElement('div'); | |
reusableSVGContainer.innerHTML = '<svg>' + html + '</svg>'; | |
var svgNode = reusableSVGContainer.firstChild; | |
while (svgNode.firstChild) { | |
node.appendChild(svgNode.firstChild); | |
} | |
} else { | |
node.innerHTML = html; | |
} | |
}); | |
if (ExecutionEnvironment.canUseDOM) { | |
// IE8: When updating a just created node with innerHTML only leading | |
// whitespace is removed. When updating an existing node with innerHTML | |
// whitespace in root TextNodes is also collapsed. | |
// @see quirksmode.org/bugreports/archives/2004/11/innerhtml_and_t.html | |
// Feature detection; only IE8 is known to behave improperly like this. | |
var testElement = document.createElement('div'); | |
testElement.innerHTML = ' '; | |
if (testElement.innerHTML === '') { | |
setInnerHTML = function (node, html) { | |
// Magic theory: IE8 supposedly differentiates between added and updated | |
// nodes when processing innerHTML, innerHTML on updated nodes suffers | |
// from worse whitespace behavior. Re-adding a node like this triggers | |
// the initial and more favorable whitespace behavior. | |
// TODO: What to do on a detached node? | |
if (node.parentNode) { | |
node.parentNode.replaceChild(node, node); | |
} | |
// We also implement a workaround for non-visible tags disappearing into | |
// thin air on IE8, this only happens if there is no visible text | |
// in-front of the non-visible tags. Piggyback on the whitespace fix | |
// and simply check if any non-visible tags appear in the source. | |
if (WHITESPACE_TEST.test(html) || html[0] === '<' && NONVISIBLE_TEST.test(html)) { | |
// Recover leading whitespace by temporarily prepending any character. | |
// \uFEFF has the potential advantage of being zero-width/invisible. | |
// UglifyJS drops U+FEFF chars when parsing, so use String.fromCharCode | |
// in hopes that this is preserved even if "\uFEFF" is transformed to | |
// the actual Unicode character (by Babel, for example). | |
// https://github.com/mishoo/UglifyJS2/blob/v2.4.20/lib/parse.js#L216 | |
node.innerHTML = String.fromCharCode(0xFEFF) + html; | |
// deleteData leaves an empty `TextNode` which offsets the index of all | |
// children. Definitely want to avoid this. | |
var textNode = node.firstChild; | |
if (textNode.data.length === 1) { | |
node.removeChild(textNode); | |
} else { | |
textNode.deleteData(0, 1); | |
} | |
} else { | |
node.innerHTML = html; | |
} | |
}; | |
} | |
testElement = null; | |
} | |
module.exports = setInnerHTML; | |
/***/ }), | |
/* 88 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = undefined; | |
var _Checkbox = __webpack_require__(357); | |
var _Checkbox2 = _interopRequireDefault(_Checkbox); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.default = _Checkbox2.default; | |
/***/ }), | |
/* 89 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = undefined; | |
var _Dialog = __webpack_require__(370); | |
var _Dialog2 = _interopRequireDefault(_Dialog); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.default = _Dialog2.default; | |
/***/ }), | |
/* 90 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = undefined; | |
var _FontIcon = __webpack_require__(377); | |
var _FontIcon2 = _interopRequireDefault(_FontIcon); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.default = _FontIcon2.default; | |
/***/ }), | |
/* 91 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _objectWithoutProperties2 = __webpack_require__(9); | |
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | |
var _extends2 = __webpack_require__(8); | |
var _extends3 = _interopRequireDefault(_extends2); | |
var _getPrototypeOf = __webpack_require__(4); | |
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | |
var _classCallCheck2 = __webpack_require__(2); | |
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | |
var _createClass2 = __webpack_require__(3); | |
var _createClass3 = _interopRequireDefault(_createClass2); | |
var _possibleConstructorReturn2 = __webpack_require__(6); | |
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | |
var _inherits2 = __webpack_require__(5); | |
var _inherits3 = _interopRequireDefault(_inherits2); | |
var _simpleAssign = __webpack_require__(7); | |
var _simpleAssign2 = _interopRequireDefault(_simpleAssign); | |
var _react = __webpack_require__(1); | |
var _react2 = _interopRequireDefault(_react); | |
var _reactDom = __webpack_require__(15); | |
var _reactDom2 = _interopRequireDefault(_reactDom); | |
var _shallowEqual = __webpack_require__(50); | |
var _shallowEqual2 = _interopRequireDefault(_shallowEqual); | |
var _colorManipulator = __webpack_require__(38); | |
var _transitions = __webpack_require__(12); | |
var _transitions2 = _interopRequireDefault(_transitions); | |
var _EnhancedButton = __webpack_require__(28); | |
var _EnhancedButton2 = _interopRequireDefault(_EnhancedButton); | |
var _IconButton = __webpack_require__(51); | |
var _IconButton2 = _interopRequireDefault(_IconButton); | |
var _expandLess = __webpack_require__(434); | |
var _expandLess2 = _interopRequireDefault(_expandLess); | |
var _expandMore = __webpack_require__(435); | |
var _expandMore2 = _interopRequireDefault(_expandMore); | |
var _NestedList = __webpack_require__(382); | |
var _NestedList2 = _interopRequireDefault(_NestedList); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
function getStyles(props, context, state) { | |
var insetChildren = props.insetChildren, | |
leftAvatar = props.leftAvatar, | |
leftCheckbox = props.leftCheckbox, | |
leftIcon = props.leftIcon, | |
nestedLevel = props.nestedLevel, | |
rightAvatar = props.rightAvatar, | |
rightIcon = props.rightIcon, | |
rightIconButton = props.rightIconButton, | |
rightToggle = props.rightToggle, | |
secondaryText = props.secondaryText, | |
secondaryTextLines = props.secondaryTextLines; | |
var muiTheme = context.muiTheme; | |
var listItem = muiTheme.listItem; | |
var textColor = muiTheme.baseTheme.palette.textColor; | |
var hoverColor = props.hoverColor || (0, _colorManipulator.fade)(textColor, 0.1); | |
var singleAvatar = !secondaryText && (leftAvatar || rightAvatar); | |
var singleNoAvatar = !secondaryText && !(leftAvatar || rightAvatar); | |
var twoLine = secondaryText && secondaryTextLines === 1; | |
var threeLine = secondaryText && secondaryTextLines > 1; | |
var styles = { | |
root: { | |
backgroundColor: (state.isKeyboardFocused || state.hovered) && !state.rightIconButtonHovered && !state.rightIconButtonKeyboardFocused ? hoverColor : null, | |
color: textColor, | |
display: 'block', | |
fontSize: 16, | |
lineHeight: '16px', | |
position: 'relative', | |
transition: _transitions2.default.easeOut() | |
}, | |
// This inner div is needed so that ripples will span the entire container | |
innerDiv: { | |
marginLeft: nestedLevel * listItem.nestedLevelDepth, | |
paddingLeft: leftIcon || leftAvatar || leftCheckbox || insetChildren ? 72 : 16, | |
paddingRight: rightIcon || rightAvatar || rightIconButton ? 56 : rightToggle ? 72 : 16, | |
paddingBottom: singleAvatar ? 20 : 16, | |
paddingTop: singleNoAvatar || threeLine ? 16 : 20, | |
position: 'relative' | |
}, | |
icons: { | |
height: 24, | |
width: 24, | |
display: 'block', | |
position: 'absolute', | |
top: twoLine ? 12 : singleAvatar ? 4 : 0, | |
margin: 12 | |
}, | |
leftIcon: { | |
left: 4 | |
}, | |
rightIcon: { | |
right: 4 | |
}, | |
avatars: { | |
position: 'absolute', | |
top: singleAvatar ? 8 : 16 | |
}, | |
label: { | |
cursor: 'pointer' | |
}, | |
leftAvatar: { | |
left: 16 | |
}, | |
rightAvatar: { | |
right: 16 | |
}, | |
leftCheckbox: { | |
position: 'absolute', | |
display: 'block', | |
width: 24, | |
top: twoLine ? 24 : singleAvatar ? 16 : 12, | |
left: 16 | |
}, | |
primaryText: {}, | |
rightIconButton: { | |
position: 'absolute', | |
display: 'block', | |
top: twoLine ? 12 : singleAvatar ? 4 : 0, | |
right: 4 | |
}, | |
rightToggle: { | |
position: 'absolute', | |
display: 'block', | |
width: 54, | |
top: twoLine ? 25 : singleAvatar ? 17 : 13, | |
right: 8 | |
}, | |
secondaryText: { | |
fontSize: 14, | |
lineHeight: threeLine ? '18px' : '16px', | |
height: threeLine ? 36 : 16, | |
margin: 0, | |
marginTop: 4, | |
color: listItem.secondaryTextColor, | |
// needed for 2 and 3 line ellipsis | |
overflow: 'hidden', | |
textOverflow: 'ellipsis', | |
whiteSpace: threeLine ? null : 'nowrap', | |
display: threeLine ? '-webkit-box' : null, | |
WebkitLineClamp: threeLine ? 2 : null, | |
WebkitBoxOrient: threeLine ? 'vertical' : null | |
} | |
}; | |
return styles; | |
} | |
var ListItem = function (_Component) { | |
(0, _inherits3.default)(ListItem, _Component); | |
function ListItem() { | |
var _ref; | |
var _temp, _this, _ret; | |
(0, _classCallCheck3.default)(this, ListItem); | |
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | |
args[_key] = arguments[_key]; | |
} | |
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = ListItem.__proto__ || (0, _getPrototypeOf2.default)(ListItem)).call.apply(_ref, [this].concat(args))), _this), _this.state = { | |
hovered: false, | |
isKeyboardFocused: false, | |
open: false, | |
rightIconButtonHovered: false, | |
rightIconButtonKeyboardFocused: false, | |
touch: false | |
}, _this.handleKeyboardFocus = function (event, isKeyboardFocused) { | |
_this.setState({ isKeyboardFocused: isKeyboardFocused }); | |
_this.props.onKeyboardFocus(event, isKeyboardFocused); | |
}, _this.handleMouseEnter = function (event) { | |
if (!_this.state.touch) _this.setState({ hovered: true }); | |
_this.props.onMouseEnter(event); | |
}, _this.handleMouseLeave = function (event) { | |
_this.setState({ hovered: false }); | |
_this.props.onMouseLeave(event); | |
}, _this.handleNestedListToggle = function (event) { | |
event.stopPropagation(); | |
if (_this.props.open === null) { | |
_this.setState({ open: !_this.state.open }, function () { | |
_this.props.onNestedListToggle(_this); | |
}); | |
} else { | |
// Exposing `this` in the callback is quite a bad API. | |
// I'm doing a one level deep clone to expose a fake state.open. | |
_this.props.onNestedListToggle((0, _extends3.default)({}, _this, { | |
state: { | |
open: !_this.state.open | |
} | |
})); | |
} | |
}, _this.handleRightIconButtonKeyboardFocus = function (event, isKeyboardFocused) { | |
if (isKeyboardFocused) { | |
_this.setState({ | |
isKeyboardFocused: false, | |
rightIconButtonKeyboardFocused: isKeyboardFocused | |
}); | |
} | |
var iconButton = _this.props.rightIconButton; | |
if (iconButton && iconButton.props.onKeyboardFocus) iconButton.props.onKeyboardFocus(event, isKeyboardFocused); | |
}, _this.handleRightIconButtonMouseLeave = function (event) { | |
var iconButton = _this.props.rightIconButton; | |
_this.setState({ rightIconButtonHovered: false }); | |
if (iconButton && iconButton.props.onMouseLeave) iconButton.props.onMouseLeave(event); | |
}, _this.handleRightIconButtonMouseEnter = function (event) { | |
var iconButton = _this.props.rightIconButton; | |
_this.setState({ rightIconButtonHovered: true }); | |
if (iconButton && iconButton.props.onMouseEnter) iconButton.props.onMouseEnter(event); | |
}, _this.handleRightIconButtonMouseUp = function (event) { | |
var iconButton = _this.props.rightIconButton; | |
event.stopPropagation(); | |
if (iconButton && iconButton.props.onMouseUp) iconButton.props.onMouseUp(event); | |
}, _this.handleRightIconButtonTouchTap = function (event) { | |
var iconButton = _this.props.rightIconButton; | |
// Stop the event from bubbling up to the list-item | |
event.stopPropagation(); | |
if (iconButton && iconButton.props.onTouchTap) iconButton.props.onTouchTap(event); | |
}, _this.handleTouchStart = function (event) { | |
_this.setState({ touch: true }); | |
_this.props.onTouchStart(event); | |
}, _this.handleTouchEnd = function (event) { | |
_this.setState({ touch: true }); | |
_this.props.onTouchEnd(event); | |
}, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); | |
} | |
(0, _createClass3.default)(ListItem, [{ | |
key: 'componentWillMount', | |
value: function componentWillMount() { | |
this.setState({ | |
open: this.props.open === null ? this.props.initiallyOpen === true : this.props.open | |
}); | |
} | |
}, { | |
key: 'componentWillReceiveProps', | |
value: function componentWillReceiveProps(nextProps) { | |
// update the state when the component is controlled. | |
if (nextProps.open !== null) this.setState({ open: nextProps.open }); | |
if (nextProps.disabled && this.state.hovered) this.setState({ hovered: false }); | |
} | |
}, { | |
key: 'shouldComponentUpdate', | |
value: function shouldComponentUpdate(nextProps, nextState, nextContext) { | |
return !(0, _shallowEqual2.default)(this.props, nextProps) || !(0, _shallowEqual2.default)(this.state, nextState) || !(0, _shallowEqual2.default)(this.context, nextContext); | |
} | |
// This method is needed by the `MenuItem` component. | |
}, { | |
key: 'applyFocusState', | |
value: function applyFocusState(focusState) { | |
var button = this.refs.enhancedButton; | |
if (button) { | |
var buttonEl = _reactDom2.default.findDOMNode(button); | |
switch (focusState) { | |
case 'none': | |
buttonEl.blur(); | |
break; | |
case 'focused': | |
buttonEl.focus(); | |
break; | |
case 'keyboard-focused': | |
button.setKeyboardFocus(); | |
buttonEl.focus(); | |
break; | |
} | |
} | |
} | |
}, { | |
key: 'createDisabledElement', | |
value: function createDisabledElement(styles, contentChildren, additionalProps) { | |
var _props = this.props, | |
innerDivStyle = _props.innerDivStyle, | |
style = _props.style; | |
var mergedDivStyles = (0, _simpleAssign2.default)({}, styles.root, styles.innerDiv, innerDivStyle, style); | |
return _react2.default.createElement( | |
'div', | |
(0, _extends3.default)({}, additionalProps, { | |
style: this.context.muiTheme.prepareStyles(mergedDivStyles) | |
}), | |
contentChildren | |
); | |
} | |
}, { | |
key: 'createLabelElement', | |
value: function createLabelElement(styles, contentChildren, additionalProps) { | |
var _props2 = this.props, | |
innerDivStyle = _props2.innerDivStyle, | |
style = _props2.style; | |
var mergedLabelStyles = (0, _simpleAssign2.default)({}, styles.root, styles.innerDiv, innerDivStyle, styles.label, style); | |
return _react2.default.createElement( | |
'label', | |
(0, _extends3.default)({}, additionalProps, { | |
style: this.context.muiTheme.prepareStyles(mergedLabelStyles) | |
}), | |
contentChildren | |
); | |
} | |
}, { | |
key: 'createTextElement', | |
value: function createTextElement(styles, data, key) { | |
var prepareStyles = this.context.muiTheme.prepareStyles; | |
if (_react2.default.isValidElement(data)) { | |
var style = (0, _simpleAssign2.default)({}, styles, data.props.style); | |
if (typeof data.type === 'string') { | |
// if element is a native dom node | |
style = prepareStyles(style); | |
} | |
return _react2.default.cloneElement(data, { | |
key: key, | |
style: style | |
}); | |
} | |
return _react2.default.createElement( | |
'div', | |
{ key: key, style: prepareStyles(styles) }, | |
data | |
); | |
} | |
}, { | |
key: 'pushElement', | |
value: function pushElement(children, element, baseStyles, additionalProps) { | |
if (element) { | |
var styles = (0, _simpleAssign2.default)({}, baseStyles, element.props.style); | |
children.push(_react2.default.cloneElement(element, (0, _extends3.default)({ | |
key: children.length, | |
style: styles | |
}, additionalProps))); | |
} | |
} | |
}, { | |
key: 'render', | |
value: function render() { | |
var _props3 = this.props, | |
autoGenerateNestedIndicator = _props3.autoGenerateNestedIndicator, | |
children = _props3.children, | |
disabled = _props3.disabled, | |
disableKeyboardFocus = _props3.disableKeyboardFocus, | |
hoverColor = _props3.hoverColor, | |
initiallyOpen = _props3.initiallyOpen, | |
innerDivStyle = _props3.innerDivStyle, | |
insetChildren = _props3.insetChildren, | |
leftAvatar = _props3.leftAvatar, | |
leftCheckbox = _props3.leftCheckbox, | |
leftIcon = _props3.leftIcon, | |
nestedItems = _props3.nestedItems, | |
nestedLevel = _props3.nestedLevel, | |
nestedListStyle = _props3.nestedListStyle, | |
onKeyboardFocus = _props3.onKeyboardFocus, | |
onMouseEnter = _props3.onMouseEnter, | |
onMouseLeave = _props3.onMouseLeave, | |
onNestedListToggle = _props3.onNestedListToggle, | |
onTouchStart = _props3.onTouchStart, | |
onTouchTap = _props3.onTouchTap, | |
rightAvatar = _props3.rightAvatar, | |
rightIcon = _props3.rightIcon, | |
rightIconButton = _props3.rightIconButton, | |
rightToggle = _props3.rightToggle, | |
primaryText = _props3.primaryText, | |
primaryTogglesNestedList = _props3.primaryTogglesNestedList, | |
secondaryText = _props3.secondaryText, | |
secondaryTextLines = _props3.secondaryTextLines, | |
style = _props3.style, | |
other = (0, _objectWithoutProperties3.default)(_props3, ['autoGenerateNestedIndicator', 'children', 'disabled', 'disableKeyboardFocus', 'hoverColor', 'initiallyOpen', 'innerDivStyle', 'insetChildren', 'leftAvatar', 'leftCheckbox', 'leftIcon', 'nestedItems', 'nestedLevel', 'nestedListStyle', 'onKeyboardFocus', 'onMouseEnter', 'onMouseLeave', 'onNestedListToggle', 'onTouchStart', 'onTouchTap', 'rightAvatar', 'rightIcon', 'rightIconButton', 'rightToggle', 'primaryText', 'primaryTogglesNestedList', 'secondaryText', 'secondaryTextLines', 'style']); | |
var prepareStyles = this.context.muiTheme.prepareStyles; | |
var styles = getStyles(this.props, this.context, this.state); | |
var contentChildren = [children]; | |
if (leftIcon) { | |
var additionalProps = { | |
color: leftIcon.props.color || this.context.muiTheme.listItem.leftIconColor | |
}; | |
this.pushElement(contentChildren, leftIcon, (0, _simpleAssign2.default)({}, styles.icons, styles.leftIcon), additionalProps); | |
} | |
if (rightIcon) { | |
var _additionalProps = { | |
color: rightIcon.props.color || this.context.muiTheme.listItem.rightIconColor | |
}; | |
this.pushElement(contentChildren, rightIcon, (0, _simpleAssign2.default)({}, styles.icons, styles.rightIcon), _additionalProps); | |
} | |
if (leftAvatar) { | |
this.pushElement(contentChildren, leftAvatar, (0, _simpleAssign2.default)({}, styles.avatars, styles.leftAvatar)); | |
} | |
if (rightAvatar) { | |
this.pushElement(contentChildren, rightAvatar, (0, _simpleAssign2.default)({}, styles.avatars, styles.rightAvatar)); | |
} | |
if (leftCheckbox) { | |
this.pushElement(contentChildren, leftCheckbox, (0, _simpleAssign2.default)({}, styles.leftCheckbox)); | |
} | |
// RightIconButtonElement | |
var hasNestListItems = nestedItems.length; | |
var hasRightElement = rightAvatar || rightIcon || rightIconButton || rightToggle; | |
var needsNestedIndicator = hasNestListItems && autoGenerateNestedIndicator && !hasRightElement; | |
if (rightIconButton || needsNestedIndicator) { | |
var rightIconButtonElement = rightIconButton; | |
var rightIconButtonHandlers = { | |
onKeyboardFocus: this.handleRightIconButtonKeyboardFocus, | |
onMouseEnter: this.handleRightIconButtonMouseEnter, | |
onMouseLeave: this.handleRightIconButtonMouseLeave, | |
onTouchTap: this.handleRightIconButtonTouchTap, | |
onMouseDown: this.handleRightIconButtonMouseUp, | |
onMouseUp: this.handleRightIconButtonMouseUp | |
}; | |
// Create a nested list indicator icon if we don't have an icon on the right | |
if (needsNestedIndicator) { | |
rightIconButtonElement = this.state.open ? _react2.default.createElement( | |
_IconButton2.default, | |
null, | |
_react2.default.createElement(_expandLess2.default, null) | |
) : _react2.default.createElement( | |
_IconButton2.default, | |
null, | |
_react2.default.createElement(_expandMore2.default, null) | |
); | |
rightIconButtonHandlers.onTouchTap = this.handleNestedListToggle; | |
} | |
this.pushElement(contentChildren, rightIconButtonElement, (0, _simpleAssign2.default)({}, styles.rightIconButton), rightIconButtonHandlers); | |
} | |
if (rightToggle) { | |
this.pushElement(contentChildren, rightToggle, (0, _simpleAssign2.default)({}, styles.rightToggle)); | |
} | |
if (primaryText) { | |
var primaryTextElement = this.createTextElement(styles.primaryText, primaryText, 'primaryText'); | |
contentChildren.push(primaryTextElement); | |
} | |
if (secondaryText) { | |
var secondaryTextElement = this.createTextElement(styles.secondaryText, secondaryText, 'secondaryText'); | |
contentChildren.push(secondaryTextElement); | |
} | |
var nestedList = nestedItems.length ? _react2.default.createElement( | |
_NestedList2.default, | |
{ nestedLevel: nestedLevel, open: this.state.open, style: nestedListStyle }, | |
nestedItems | |
) : undefined; | |
var simpleLabel = !primaryTogglesNestedList && (leftCheckbox || rightToggle); | |
return _react2.default.createElement( | |
'div', | |
null, | |
simpleLabel ? this.createLabelElement(styles, contentChildren, other) : disabled ? this.createDisabledElement(styles, contentChildren, other) : _react2.default.createElement( | |
_EnhancedButton2.default, | |
(0, _extends3.default)({ | |
containerElement: 'span' | |
}, other, { | |
disableKeyboardFocus: disableKeyboardFocus || this.state.rightIconButtonKeyboardFocused, | |
onKeyboardFocus: this.handleKeyboardFocus, | |
onMouseLeave: this.handleMouseLeave, | |
onMouseEnter: this.handleMouseEnter, | |
onTouchStart: this.handleTouchStart, | |
onTouchEnd: this.handleTouchEnd, | |
onTouchTap: primaryTogglesNestedList ? this.handleNestedListToggle : onTouchTap, | |
ref: 'enhancedButton', | |
style: (0, _simpleAssign2.default)({}, styles.root, style) | |
}), | |
_react2.default.createElement( | |
'div', | |
{ style: prepareStyles((0, _simpleAssign2.default)(styles.innerDiv, innerDivStyle)) }, | |
contentChildren | |
) | |
), | |
nestedList | |
); | |
} | |
}]); | |
return ListItem; | |
}(_react.Component); | |
ListItem.muiName = 'ListItem'; | |
ListItem.defaultProps = { | |
autoGenerateNestedIndicator: true, | |
disableKeyboardFocus: false, | |
disabled: false, | |
initiallyOpen: false, | |
insetChildren: false, | |
nestedItems: [], | |
nestedLevel: 0, | |
onKeyboardFocus: function onKeyboardFocus() {}, | |
onMouseEnter: function onMouseEnter() {}, | |
onMouseLeave: function onMouseLeave() {}, | |
onNestedListToggle: function onNestedListToggle() {}, | |
onTouchEnd: function onTouchEnd() {}, | |
onTouchStart: function onTouchStart() {}, | |
open: null, | |
primaryTogglesNestedList: false, | |
secondaryTextLines: 1 | |
}; | |
ListItem.contextTypes = { | |
muiTheme: _react.PropTypes.object.isRequired | |
}; | |
process.env.NODE_ENV !== "production" ? ListItem.propTypes = { | |
/** | |
* If true, generate a nested-list-indicator icon when nested list | |
* items are detected. Note that an indicator will not be created | |
* if a `rightIcon` or `rightIconButton` has been provided to | |
* the element. | |
*/ | |
autoGenerateNestedIndicator: _react.PropTypes.bool, | |
/** | |
* Children passed into the `ListItem`. | |
*/ | |
children: _react.PropTypes.node, | |
/** | |
* If true, the element will not be able to be focused by the keyboard. | |
*/ | |
disableKeyboardFocus: _react.PropTypes.bool, | |
/** | |
* If true, the element will not be clickable | |
* and will not display hover effects. | |
* This is automatically disabled if either `leftCheckbox` | |
* or `rightToggle` is set. | |
*/ | |
disabled: _react.PropTypes.bool, | |
/** | |
* Override the hover background color. | |
*/ | |
hoverColor: _react.PropTypes.string, | |
/** | |
* If true, the nested `ListItem`s are initially displayed. | |
*/ | |
initiallyOpen: _react.PropTypes.bool, | |
/** | |
* Override the inline-styles of the inner div element. | |
*/ | |
innerDivStyle: _react.PropTypes.object, | |
/** | |
* If true, the children will be indented by 72px. | |
* This is useful if there is no left avatar or left icon. | |
*/ | |
insetChildren: _react.PropTypes.bool, | |
/** | |
* This is the `Avatar` element to be displayed on the left side. | |
*/ | |
leftAvatar: _react.PropTypes.element, | |
/** | |
* This is the `Checkbox` element to be displayed on the left side. | |
*/ | |
leftCheckbox: _react.PropTypes.element, | |
/** | |
* This is the `SvgIcon` or `FontIcon` to be displayed on the left side. | |
*/ | |
leftIcon: _react.PropTypes.element, | |
/** | |
* An array of `ListItem`s to nest underneath the current `ListItem`. | |
*/ | |
nestedItems: _react.PropTypes.arrayOf(_react.PropTypes.element), | |
/** | |
* Controls how deep a `ListItem` appears. | |
* This property is automatically managed, so modify at your own risk. | |
*/ | |
nestedLevel: _react.PropTypes.number, | |
/** | |
* Override the inline-styles of the nested items' `NestedList`. | |
*/ | |
nestedListStyle: _react.PropTypes.object, | |
/** | |
* Callback function fired when the `ListItem` is focused or blurred by the keyboard. | |
* | |
* @param {object} event `focus` or `blur` event targeting the `ListItem`. | |
* @param {boolean} isKeyboardFocused If true, the `ListItem` is focused. | |
*/ | |
onKeyboardFocus: _react.PropTypes.func, | |
/** @ignore */ | |
onMouseEnter: _react.PropTypes.func, | |
/** @ignore */ | |
onMouseLeave: _react.PropTypes.func, | |
/** | |
* Callbak function fired when the `ListItem` toggles its nested list. | |
* | |
* @param {object} listItem The `ListItem`. | |
*/ | |
onNestedListToggle: _react.PropTypes.func, | |
/** @ignore */ | |
onTouchEnd: _react.PropTypes.func, | |
/** @ignore */ | |
onTouchStart: _react.PropTypes.func, | |
/** @ignore */ | |
onTouchTap: _react.PropTypes.func, | |
/** | |
* Control toggle state of nested list. | |
*/ | |
open: _react.PropTypes.bool, | |
/** | |
* This is the block element that contains the primary text. | |
* If a string is passed in, a div tag will be rendered. | |
*/ | |
primaryText: _react.PropTypes.node, | |
/** | |
* If true, clicking or tapping the primary text of the `ListItem` | |
* toggles the nested list. | |
*/ | |
primaryTogglesNestedList: _react.PropTypes.bool, | |
/** | |
* This is the `Avatar` element to be displayed on the right side. | |
*/ | |
rightAvatar: _react.PropTypes.element, | |
/** | |
* This is the `SvgIcon` or `FontIcon` to be displayed on the right side. | |
*/ | |
rightIcon: _react.PropTypes.element, | |
/** | |
* This is the `IconButton` to be displayed on the right side. | |
* Hovering over this button will remove the `ListItem` hover. | |
* Also, clicking on this button will not trigger a | |
* ripple on the `ListItem`; the event will be stopped and prevented | |
* from bubbling up to cause a `ListItem` click. | |
*/ | |
rightIconButton: _react.PropTypes.element, | |
/** | |
* This is the `Toggle` element to display on the right side. | |
*/ | |
rightToggle: _react.PropTypes.element, | |
/** | |
* This is the block element that contains the secondary text. | |
* If a string is passed in, a div tag will be rendered. | |
*/ | |
secondaryText: _react.PropTypes.node, | |
/** | |
* Can be 1 or 2. This is the number of secondary | |
* text lines before ellipsis will show. | |
*/ | |
secondaryTextLines: _react.PropTypes.oneOf([1, 2]), | |
/** | |
* Override the inline-styles of the root element. | |
*/ | |
style: _react.PropTypes.object | |
} : void 0; | |
exports.default = ListItem; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 92 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = undefined; | |
var _MenuItem = __webpack_require__(115); | |
var _MenuItem2 = _interopRequireDefault(_MenuItem); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.default = _MenuItem2.default; | |
/***/ }), | |
/* 93 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _extends2 = __webpack_require__(8); | |
var _extends3 = _interopRequireDefault(_extends2); | |
var _objectWithoutProperties2 = __webpack_require__(9); | |
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | |
var _getPrototypeOf = __webpack_require__(4); | |
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | |
var _classCallCheck2 = __webpack_require__(2); | |
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | |
var _createClass2 = __webpack_require__(3); | |
var _createClass3 = _interopRequireDefault(_createClass2); | |
var _possibleConstructorReturn2 = __webpack_require__(6); | |
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | |
var _inherits2 = __webpack_require__(5); | |
var _inherits3 = _interopRequireDefault(_inherits2); | |
var _simpleAssign = __webpack_require__(7); | |
var _simpleAssign2 = _interopRequireDefault(_simpleAssign); | |
var _react = __webpack_require__(1); | |
var _react2 = _interopRequireDefault(_react); | |
var _Tooltip = __webpack_require__(195); | |
var _Tooltip2 = _interopRequireDefault(_Tooltip); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
function getStyles(props, context) { | |
var tableHeaderColumn = context.muiTheme.tableHeaderColumn; | |
return { | |
root: { | |
fontWeight: 'normal', | |
fontSize: 12, | |
paddingLeft: tableHeaderColumn.spacing, | |
paddingRight: tableHeaderColumn.spacing, | |
height: tableHeaderColumn.height, | |
textAlign: 'left', | |
whiteSpace: 'nowrap', | |
textOverflow: 'ellipsis', | |
color: tableHeaderColumn.textColor, | |
position: 'relative' | |
}, | |
tooltip: { | |
boxSizing: 'border-box', | |
marginTop: tableHeaderColumn.height / 2 | |
} | |
}; | |
} | |
var TableHeaderColumn = function (_Component) { | |
(0, _inherits3.default)(TableHeaderColumn, _Component); | |
function TableHeaderColumn() { | |
var _ref; | |
var _temp, _this, _ret; | |
(0, _classCallCheck3.default)(this, TableHeaderColumn); | |
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | |
args[_key] = arguments[_key]; | |
} | |
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = TableHeaderColumn.__proto__ || (0, _getPrototypeOf2.default)(TableHeaderColumn)).call.apply(_ref, [this].concat(args))), _this), _this.state = { | |
hovered: false | |
}, _this.onMouseEnter = function () { | |
if (_this.props.tooltip !== undefined) { | |
_this.setState({ hovered: true }); | |
} | |
}, _this.onMouseLeave = function () { | |
if (_this.props.tooltip !== undefined) { | |
_this.setState({ hovered: false }); | |
} | |
}, _this.onClick = function (event) { | |
if (_this.props.onClick) { | |
_this.props.onClick(event, _this.props.columnNumber); | |
} | |
}, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); | |
} | |
(0, _createClass3.default)(TableHeaderColumn, [{ | |
key: 'render', | |
value: function render() { | |
var _props = this.props, | |
children = _props.children, | |
className = _props.className, | |
columnNumber = _props.columnNumber, | |
hoverable = _props.hoverable, | |
onClick = _props.onClick, | |
onHover = _props.onHover, | |
onHoverExit = _props.onHoverExit, | |
style = _props.style, | |
tooltip = _props.tooltip, | |
tooltipStyle = _props.tooltipStyle, | |
other = (0, _objectWithoutProperties3.default)(_props, ['children', 'className', 'columnNumber', 'hoverable', 'onClick', 'onHover', 'onHoverExit', 'style', 'tooltip', 'tooltipStyle']); | |
var prepareStyles = this.context.muiTheme.prepareStyles; | |
var styles = getStyles(this.props, this.context); | |
var handlers = { | |
onMouseEnter: this.onMouseEnter, | |
onMouseLeave: this.onMouseLeave, | |
onClick: this.onClick | |
}; | |
var tooltipNode = void 0; | |
if (tooltip !== undefined) { | |
tooltipNode = _react2.default.createElement(_Tooltip2.default, { | |
label: tooltip, | |
show: this.state.hovered, | |
style: (0, _simpleAssign2.default)(styles.tooltip, tooltipStyle) | |
}); | |
} | |
return _react2.default.createElement( | |
'th', | |
(0, _extends3.default)({ | |
className: className, | |
style: prepareStyles((0, _simpleAssign2.default)(styles.root, style)) | |
}, handlers, other), | |
tooltipNode, | |
children | |
); | |
} | |
}]); | |
return TableHeaderColumn; | |
}(_react.Component); | |
TableHeaderColumn.contextTypes = { | |
muiTheme: _react.PropTypes.object.isRequired | |
}; | |
process.env.NODE_ENV !== "production" ? TableHeaderColumn.propTypes = { | |
children: _react.PropTypes.node, | |
/** | |
* The css class name of the root element. | |
*/ | |
className: _react.PropTypes.string, | |
/** | |
* Number to identify the header row. This property | |
* is automatically populated when used with TableHeader. | |
*/ | |
columnNumber: _react.PropTypes.number, | |
/** | |
* @ignore | |
* Not used here but we need to remove it from the root element. | |
*/ | |
hoverable: _react.PropTypes.bool, | |
/** @ignore */ | |
onClick: _react.PropTypes.func, | |
/** | |
* @ignore | |
* Not used here but we need to remove it from the root element. | |
*/ | |
onHover: _react.PropTypes.func, | |
/** | |
* @ignore | |
* Not used here but we need to remove it from the root element. | |
*/ | |
onHoverExit: _react.PropTypes.func, | |
/** | |
* Override the inline-styles of the root element. | |
*/ | |
style: _react.PropTypes.object, | |
/** | |
* The string to supply to the tooltip. If not | |
* string is supplied no tooltip will be shown. | |
*/ | |
tooltip: _react.PropTypes.string, | |
/** | |
* Additional styling that can be applied to the tooltip. | |
*/ | |
tooltipStyle: _react.PropTypes.object | |
} : void 0; | |
exports.default = TableHeaderColumn; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 94 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
module.exports = { "default": __webpack_require__(269), __esModule: true }; | |
/***/ }), | |
/* 95 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
module.exports = { "default": __webpack_require__(271), __esModule: true }; | |
/***/ }), | |
/* 96 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
exports.__esModule = true; | |
var _isIterable2 = __webpack_require__(258); | |
var _isIterable3 = _interopRequireDefault(_isIterable2); | |
var _getIterator2 = __webpack_require__(166); | |
var _getIterator3 = _interopRequireDefault(_getIterator2); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.default = function () { | |
function sliceIterator(arr, i) { | |
var _arr = []; | |
var _n = true; | |
var _d = false; | |
var _e = undefined; | |
try { | |
for (var _i = (0, _getIterator3.default)(arr), _s; !(_n = (_s = _i.next()).done); _n = true) { | |
_arr.push(_s.value); | |
if (i && _arr.length === i) break; | |
} | |
} catch (err) { | |
_d = true; | |
_e = err; | |
} finally { | |
try { | |
if (!_n && _i["return"]) _i["return"](); | |
} finally { | |
if (_d) throw _e; | |
} | |
} | |
return _arr; | |
} | |
return function (arr, i) { | |
if (Array.isArray(arr)) { | |
return arr; | |
} else if ((0, _isIterable3.default)(Object(arr))) { | |
return sliceIterator(arr, i); | |
} else { | |
throw new TypeError("Invalid attempt to destructure non-iterable instance"); | |
} | |
}; | |
}(); | |
/***/ }), | |
/* 97 */ | |
/***/ (function(module, exports) { | |
var toString = {}.toString; | |
module.exports = function(it){ | |
return toString.call(it).slice(8, -1); | |
}; | |
/***/ }), | |
/* 98 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
// optional / simple context binding | |
var aFunction = __webpack_require__(275); | |
module.exports = function(fn, that, length){ | |
aFunction(fn); | |
if(that === undefined)return fn; | |
switch(length){ | |
case 1: return function(a){ | |
return fn.call(that, a); | |
}; | |
case 2: return function(a, b){ | |
return fn.call(that, a, b); | |
}; | |
case 3: return function(a, b, c){ | |
return fn.call(that, a, b, c); | |
}; | |
} | |
return function(/* ...args */){ | |
return fn.apply(that, arguments); | |
}; | |
}; | |
/***/ }), | |
/* 99 */ | |
/***/ (function(module, exports) { | |
// 7.2.1 RequireObjectCoercible(argument) | |
module.exports = function(it){ | |
if(it == undefined)throw TypeError("Can't call method on " + it); | |
return it; | |
}; | |
/***/ }), | |
/* 100 */ | |
/***/ (function(module, exports) { | |
// IE 8- don't enum bug keys | |
module.exports = ( | |
'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' | |
).split(','); | |
/***/ }), | |
/* 101 */ | |
/***/ (function(module, exports) { | |
module.exports = true; | |
/***/ }), | |
/* 102 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) | |
var anObject = __webpack_require__(43) | |
, dPs = __webpack_require__(290) | |
, enumBugKeys = __webpack_require__(100) | |
, IE_PROTO = __webpack_require__(105)('IE_PROTO') | |
, Empty = function(){ /* empty */ } | |
, PROTOTYPE = 'prototype'; | |
// Create object with fake `null` prototype: use iframe Object with cleared prototype | |
var createDict = function(){ | |
// Thrash, waste and sodomy: IE GC bug | |
var iframe = __webpack_require__(171)('iframe') | |
, i = enumBugKeys.length | |
, lt = '<' | |
, gt = '>' | |
, iframeDocument; | |
iframe.style.display = 'none'; | |
__webpack_require__(280).appendChild(iframe); | |
iframe.src = 'javascript:'; // eslint-disable-line no-script-url | |
// createDict = iframe.contentWindow.Object; | |
// html.removeChild(iframe); | |
iframeDocument = iframe.contentWindow.document; | |
iframeDocument.open(); | |
iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); | |
iframeDocument.close(); | |
createDict = iframeDocument.F; | |
while(i--)delete createDict[PROTOTYPE][enumBugKeys[i]]; | |
return createDict(); | |
}; | |
module.exports = Object.create || function create(O, Properties){ | |
var result; | |
if(O !== null){ | |
Empty[PROTOTYPE] = anObject(O); | |
result = new Empty; | |
Empty[PROTOTYPE] = null; | |
// add "__proto__" for Object.getPrototypeOf polyfill | |
result[IE_PROTO] = O; | |
} else result = createDict(); | |
return Properties === undefined ? result : dPs(result, Properties); | |
}; | |
/***/ }), | |
/* 103 */ | |
/***/ (function(module, exports) { | |
exports.f = Object.getOwnPropertySymbols; | |
/***/ }), | |
/* 104 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
var def = __webpack_require__(37).f | |
, has = __webpack_require__(45) | |
, TAG = __webpack_require__(27)('toStringTag'); | |
module.exports = function(it, tag, stat){ | |
if(it && !has(it = stat ? it : it.prototype, TAG))def(it, TAG, {configurable: true, value: tag}); | |
}; | |
/***/ }), | |
/* 105 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
var shared = __webpack_require__(106)('keys') | |
, uid = __webpack_require__(77); | |
module.exports = function(key){ | |
return shared[key] || (shared[key] = uid(key)); | |
}; | |
/***/ }), | |
/* 106 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
var global = __webpack_require__(36) | |
, SHARED = '__core-js_shared__' | |
, store = global[SHARED] || (global[SHARED] = {}); | |
module.exports = function(key){ | |
return store[key] || (store[key] = {}); | |
}; | |
/***/ }), | |
/* 107 */ | |
/***/ (function(module, exports) { | |
// 7.1.4 ToInteger | |
var ceil = Math.ceil | |
, floor = Math.floor; | |
module.exports = function(it){ | |
return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); | |
}; | |
/***/ }), | |
/* 108 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
// 7.1.1 ToPrimitive(input [, PreferredType]) | |
var isObject = __webpack_require__(62); | |
// instead of the ES6 spec version, we didn't implement @@toPrimitive case | |
// and the second argument - flag - preferred type is a string | |
module.exports = function(it, S){ | |
if(!isObject(it))return it; | |
var fn, val; | |
if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; | |
if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val; | |
if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; | |
throw TypeError("Can't convert object to primitive value"); | |
}; | |
/***/ }), | |
/* 109 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
var global = __webpack_require__(36) | |
, core = __webpack_require__(22) | |
, LIBRARY = __webpack_require__(101) | |
, wksExt = __webpack_require__(110) | |
, defineProperty = __webpack_require__(37).f; | |
module.exports = function(name){ | |
var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); | |
if(name.charAt(0) != '_' && !(name in $Symbol))defineProperty($Symbol, name, {value: wksExt.f(name)}); | |
}; | |
/***/ }), | |
/* 110 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
exports.f = __webpack_require__(27); | |
/***/ }), | |
/* 111 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
__webpack_require__(298); | |
var global = __webpack_require__(36) | |
, hide = __webpack_require__(53) | |
, Iterators = __webpack_require__(54) | |
, TO_STRING_TAG = __webpack_require__(27)('toStringTag'); | |
for(var collections = ['NodeList', 'DOMTokenList', 'MediaList', 'StyleSheetList', 'CSSRuleList'], i = 0; i < 5; i++){ | |
var NAME = collections[i] | |
, Collection = global[NAME] | |
, proto = Collection && Collection.prototype; | |
if(proto && !proto[TO_STRING_TAG])hide(proto, TO_STRING_TAG, NAME); | |
Iterators[NAME] = Iterators.Array; | |
} | |
/***/ }), | |
/* 112 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
// helper to capitalize strings | |
exports.default = function (str) { | |
return str.charAt(0).toUpperCase() + str.slice(1); | |
}; | |
module.exports = exports["default"]; | |
/***/ }), | |
/* 113 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = function (value) { | |
if (Array.isArray(value)) value = value.join(','); | |
return value.match(/-webkit-|-moz-|-ms-/) !== null; | |
}; | |
module.exports = exports['default']; | |
/***/ }), | |
/* 114 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _extends2 = __webpack_require__(8); | |
var _extends3 = _interopRequireDefault(_extends2); | |
var _objectWithoutProperties2 = __webpack_require__(9); | |
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | |
var _getPrototypeOf = __webpack_require__(4); | |
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | |
var _classCallCheck2 = __webpack_require__(2); | |
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | |
var _createClass2 = __webpack_require__(3); | |
var _createClass3 = _interopRequireDefault(_createClass2); | |
var _possibleConstructorReturn2 = __webpack_require__(6); | |
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | |
var _inherits2 = __webpack_require__(5); | |
var _inherits3 = _interopRequireDefault(_inherits2); | |
var _simpleAssign = __webpack_require__(7); | |
var _simpleAssign2 = _interopRequireDefault(_simpleAssign); | |
var _react = __webpack_require__(1); | |
var _react2 = _interopRequireDefault(_react); | |
var _Subheader = __webpack_require__(156); | |
var _Subheader2 = _interopRequireDefault(_Subheader); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
var List = function (_Component) { | |
(0, _inherits3.default)(List, _Component); | |
function List() { | |
(0, _classCallCheck3.default)(this, List); | |
return (0, _possibleConstructorReturn3.default)(this, (List.__proto__ || (0, _getPrototypeOf2.default)(List)).apply(this, arguments)); | |
} | |
(0, _createClass3.default)(List, [{ | |
key: 'render', | |
value: function render() { | |
var _props = this.props, | |
children = _props.children, | |
style = _props.style, | |
other = (0, _objectWithoutProperties3.default)(_props, ['children', 'style']); | |
var prepareStyles = this.context.muiTheme.prepareStyles; | |
var hasSubheader = false; | |
var firstChild = _react.Children.toArray(children)[0]; | |
if ((0, _react.isValidElement)(firstChild) && firstChild.type === _Subheader2.default) { | |
hasSubheader = true; | |
} | |
var styles = { | |
root: { | |
padding: (hasSubheader ? 0 : 8) + 'px 0px 8px 0px' | |
} | |
}; | |
return _react2.default.createElement( | |
'div', | |
(0, _extends3.default)({}, other, { style: prepareStyles((0, _simpleAssign2.default)(styles.root, style)) }), | |
children | |
); | |
} | |
}]); | |
return List; | |
}(_react.Component); | |
List.contextTypes = { | |
muiTheme: _react.PropTypes.object.isRequired | |
}; | |
process.env.NODE_ENV !== "production" ? List.propTypes = { | |
/** | |
* These are usually `ListItem`s that are passed to | |
* be part of the list. | |
*/ | |
children: _react.PropTypes.node, | |
/** | |
* Override the inline-styles of the root element. | |
*/ | |
style: _react.PropTypes.object | |
} : void 0; | |
exports.default = List; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 115 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _extends2 = __webpack_require__(8); | |
var _extends3 = _interopRequireDefault(_extends2); | |
var _objectWithoutProperties2 = __webpack_require__(9); | |
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | |
var _getPrototypeOf = __webpack_require__(4); | |
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | |
var _classCallCheck2 = __webpack_require__(2); | |
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | |
var _createClass2 = __webpack_require__(3); | |
var _createClass3 = _interopRequireDefault(_createClass2); | |
var _possibleConstructorReturn2 = __webpack_require__(6); | |
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | |
var _inherits2 = __webpack_require__(5); | |
var _inherits3 = _interopRequireDefault(_inherits2); | |
var _simpleAssign = __webpack_require__(7); | |
var _simpleAssign2 = _interopRequireDefault(_simpleAssign); | |
var _react = __webpack_require__(1); | |
var _react2 = _interopRequireDefault(_react); | |
var _reactDom = __webpack_require__(15); | |
var _reactDom2 = _interopRequireDefault(_reactDom); | |
var _shallowEqual = __webpack_require__(50); | |
var _shallowEqual2 = _interopRequireDefault(_shallowEqual); | |
var _Popover = __webpack_require__(57); | |
var _Popover2 = _interopRequireDefault(_Popover); | |
var _check = __webpack_require__(431); | |
var _check2 = _interopRequireDefault(_check); | |
var _ListItem = __webpack_require__(91); | |
var _ListItem2 = _interopRequireDefault(_ListItem); | |
var _Menu = __webpack_require__(80); | |
var _Menu2 = _interopRequireDefault(_Menu); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
var nestedMenuStyle = { | |
position: 'relative' | |
}; | |
function getStyles(props, context) { | |
var disabledColor = context.muiTheme.baseTheme.palette.disabledColor; | |
var textColor = context.muiTheme.baseTheme.palette.textColor; | |
var indent = props.desktop ? 64 : 72; | |
var sidePadding = props.desktop ? 24 : 16; | |
var styles = { | |
root: { | |
color: props.disabled ? disabledColor : textColor, | |
cursor: props.disabled ? 'not-allowed' : 'pointer', | |
minHeight: props.desktop ? '32px' : '48px', | |
lineHeight: props.desktop ? '32px' : '48px', | |
fontSize: props.desktop ? 15 : 16, | |
whiteSpace: 'nowrap' | |
}, | |
innerDivStyle: { | |
paddingLeft: props.leftIcon || props.insetChildren || props.checked ? indent : sidePadding, | |
paddingRight: props.rightIcon ? indent : sidePadding, | |
paddingBottom: 0, | |
paddingTop: 0 | |
}, | |
secondaryText: { | |
float: 'right' | |
}, | |
leftIconDesktop: { | |
margin: 0, | |
left: 24, | |
top: 4 | |
}, | |
rightIconDesktop: { | |
margin: 0, | |
right: 24, | |
top: 4, | |
fill: context.muiTheme.menuItem.rightIconDesktopFill | |
} | |
}; | |
return styles; | |
} | |
var MenuItem = function (_Component) { | |
(0, _inherits3.default)(MenuItem, _Component); | |
function MenuItem() { | |
var _ref; | |
var _temp, _this, _ret; | |
(0, _classCallCheck3.default)(this, MenuItem); | |
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | |
args[_key] = arguments[_key]; | |
} | |
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = MenuItem.__proto__ || (0, _getPrototypeOf2.default)(MenuItem)).call.apply(_ref, [this].concat(args))), _this), _this.state = { | |
open: false | |
}, _this.cloneMenuItem = function (item) { | |
return _react2.default.cloneElement(item, { | |
onTouchTap: function onTouchTap(event) { | |
if (!item.props.menuItems) { | |
_this.handleRequestClose(); | |
} | |
if (item.props.onTouchTap) { | |
item.props.onTouchTap(event); | |
} | |
} | |
}); | |
}, _this.handleTouchTap = function (event) { | |
event.preventDefault(); | |
_this.setState({ | |
open: true, | |
anchorEl: _reactDom2.default.findDOMNode(_this) | |
}); | |
if (_this.props.onTouchTap) { | |
_this.props.onTouchTap(event); | |
} | |
}, _this.handleRequestClose = function () { | |
_this.setState({ | |
open: false, | |
anchorEl: null | |
}); | |
}, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); | |
} | |
(0, _createClass3.default)(MenuItem, [{ | |
key: 'componentDidMount', | |
value: function componentDidMount() { | |
this.applyFocusState(); | |
} | |
}, { | |
key: 'componentWillReceiveProps', | |
value: function componentWillReceiveProps(nextProps) { | |
if (this.state.open && nextProps.focusState === 'none') { | |
this.handleRequestClose(); | |
} | |
} | |
}, { | |
key: 'shouldComponentUpdate', | |
value: function shouldComponentUpdate(nextProps, nextState, nextContext) { | |
return !(0, _shallowEqual2.default)(this.props, nextProps) || !(0, _shallowEqual2.default)(this.state, nextState) || !(0, _shallowEqual2.default)(this.context, nextContext); | |
} | |
}, { | |
key: 'componentDidUpdate', | |
value: function componentDidUpdate() { | |
this.applyFocusState(); | |
} | |
}, { | |
key: 'componentWillUnmount', | |
value: function componentWillUnmount() { | |
if (this.state.open) { | |
this.setState({ | |
open: false | |
}); | |
} | |
} | |
}, { | |
key: 'applyFocusState', | |
value: function applyFocusState() { | |
this.refs.listItem.applyFocusState(this.props.focusState); | |
} | |
}, { | |
key: 'render', | |
value: function render() { | |
var _props = this.props, | |
checked = _props.checked, | |
children = _props.children, | |
desktop = _props.desktop, | |
disabled = _props.disabled, | |
focusState = _props.focusState, | |
innerDivStyle = _props.innerDivStyle, | |
insetChildren = _props.insetChildren, | |
leftIcon = _props.leftIcon, | |
menuItems = _props.menuItems, | |
rightIcon = _props.rightIcon, | |
secondaryText = _props.secondaryText, | |
style = _props.style, | |
animation = _props.animation, | |
value = _props.value, | |
other = (0, _objectWithoutProperties3.default)(_props, ['checked', 'children', 'desktop', 'disabled', 'focusState', 'innerDivStyle', 'insetChildren', 'leftIcon', 'menuItems', 'rightIcon', 'secondaryText', 'style', 'animation', 'value']); | |
var prepareStyles = this.context.muiTheme.prepareStyles; | |
var styles = getStyles(this.props, this.context); | |
var mergedRootStyles = (0, _simpleAssign2.default)(styles.root, style); | |
var mergedInnerDivStyles = (0, _simpleAssign2.default)(styles.innerDivStyle, innerDivStyle); | |
// Left Icon | |
var leftIconElement = leftIcon ? leftIcon : checked ? _react2.default.createElement(_check2.default, null) : null; | |
if (leftIconElement) { | |
var mergedLeftIconStyles = desktop ? (0, _simpleAssign2.default)(styles.leftIconDesktop, leftIconElement.props.style) : leftIconElement.props.style; | |
leftIconElement = _react2.default.cloneElement(leftIconElement, { style: mergedLeftIconStyles }); | |
} | |
// Right Icon | |
var rightIconElement = void 0; | |
if (rightIcon) { | |
var mergedRightIconStyles = desktop ? (0, _simpleAssign2.default)(styles.rightIconDesktop, rightIcon.props.style) : rightIcon.props.style; | |
rightIconElement = _react2.default.cloneElement(rightIcon, { style: mergedRightIconStyles }); | |
} | |
// Secondary Text | |
var secondaryTextElement = void 0; | |
if (secondaryText) { | |
var secondaryTextIsAnElement = _react2.default.isValidElement(secondaryText); | |
var mergedSecondaryTextStyles = secondaryTextIsAnElement ? (0, _simpleAssign2.default)(styles.secondaryText, secondaryText.props.style) : null; | |
secondaryTextElement = secondaryTextIsAnElement ? _react2.default.cloneElement(secondaryText, { style: mergedSecondaryTextStyles }) : _react2.default.createElement( | |
'div', | |
{ style: prepareStyles(styles.secondaryText) }, | |
secondaryText | |
); | |
} | |
var childMenuPopover = void 0; | |
if (menuItems) { | |
childMenuPopover = _react2.default.createElement( | |
_Popover2.default, | |
{ | |
animation: animation, | |
anchorOrigin: { horizontal: 'right', vertical: 'top' }, | |
anchorEl: this.state.anchorEl, | |
open: this.state.open, | |
useLayerForClickAway: false, | |
onRequestClose: this.handleRequestClose | |
}, | |
_react2.default.createElement( | |
_Menu2.default, | |
{ desktop: desktop, disabled: disabled, style: nestedMenuStyle }, | |
_react2.default.Children.map(menuItems, this.cloneMenuItem) | |
) | |
); | |
other.onTouchTap = this.handleTouchTap; | |
} | |
return _react2.default.createElement( | |
_ListItem2.default, | |
(0, _extends3.default)({}, other, { | |
disabled: disabled, | |
hoverColor: this.context.muiTheme.menuItem.hoverColor, | |
innerDivStyle: mergedInnerDivStyles, | |
insetChildren: insetChildren, | |
leftIcon: leftIconElement, | |
ref: 'listItem', | |
rightIcon: rightIconElement, | |
style: mergedRootStyles | |
}), | |
children, | |
secondaryTextElement, | |
childMenuPopover | |
); | |
} | |
}]); | |
return MenuItem; | |
}(_react.Component); | |
MenuItem.muiName = 'MenuItem'; | |
MenuItem.defaultProps = { | |
checked: false, | |
desktop: false, | |
disabled: false, | |
focusState: 'none', | |
insetChildren: false | |
}; | |
MenuItem.contextTypes = { | |
muiTheme: _react.PropTypes.object.isRequired | |
}; | |
process.env.NODE_ENV !== "production" ? MenuItem.propTypes = { | |
/** | |
* Override the default animation component used. | |
*/ | |
animation: _react.PropTypes.func, | |
/** | |
* If true, a left check mark will be rendered. | |
*/ | |
checked: _react.PropTypes.bool, | |
/** | |
* Elements passed as children to the underlying `ListItem`. | |
*/ | |
children: _react.PropTypes.node, | |
/** | |
* @ignore | |
* If true, the menu item will render with compact desktop | |
* styles. | |
*/ | |
desktop: _react.PropTypes.bool, | |
/** | |
* If true, the menu item will be disabled. | |
*/ | |
disabled: _react.PropTypes.bool, | |
/** | |
* The focus state of the menu item. This prop is used to set the focus | |
* state of the underlying `ListItem`. | |
*/ | |
focusState: _react.PropTypes.oneOf(['none', 'focused', 'keyboard-focused']), | |
/** | |
* Override the inline-styles of the inner div. | |
*/ | |
innerDivStyle: _react.PropTypes.object, | |
/** | |
* If true, the children will be indented. | |
* This is only needed when there is no `leftIcon`. | |
*/ | |
insetChildren: _react.PropTypes.bool, | |
/** | |
* The `SvgIcon` or `FontIcon` to be displayed on the left side. | |
*/ | |
leftIcon: _react.PropTypes.element, | |
/** | |
* `MenuItem` elements to nest within the menu item. | |
*/ | |
menuItems: _react.PropTypes.node, | |
/** | |
* Callback function fired when the menu item is touch-tapped. | |
* | |
* @param {object} event TouchTap event targeting the menu item. | |
*/ | |
onTouchTap: _react.PropTypes.func, | |
/** | |
* Can be used to render primary text within the menu item. | |
*/ | |
primaryText: _react.PropTypes.node, | |
/** | |
* The `SvgIcon` or `FontIcon` to be displayed on the right side. | |
*/ | |
rightIcon: _react.PropTypes.element, | |
/** | |
* Can be used to render secondary text within the menu item. | |
*/ | |
secondaryText: _react.PropTypes.node, | |
/** | |
* Override the inline-styles of the root element. | |
*/ | |
style: _react.PropTypes.object, | |
/** | |
* The value of the menu item. | |
*/ | |
value: _react.PropTypes.any | |
} : void 0; | |
exports.default = MenuItem; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 116 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _getPrototypeOf = __webpack_require__(4); | |
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | |
var _classCallCheck2 = __webpack_require__(2); | |
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | |
var _createClass2 = __webpack_require__(3); | |
var _createClass3 = _interopRequireDefault(_createClass2); | |
var _possibleConstructorReturn2 = __webpack_require__(6); | |
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | |
var _inherits2 = __webpack_require__(5); | |
var _inherits3 = _interopRequireDefault(_inherits2); | |
var _simpleAssign = __webpack_require__(7); | |
var _simpleAssign2 = _interopRequireDefault(_simpleAssign); | |
var _react = __webpack_require__(1); | |
var _react2 = _interopRequireDefault(_react); | |
var _Paper = __webpack_require__(23); | |
var _Paper2 = _interopRequireDefault(_Paper); | |
var _transitions = __webpack_require__(12); | |
var _transitions2 = _interopRequireDefault(_transitions); | |
var _propTypes = __webpack_require__(29); | |
var _propTypes2 = _interopRequireDefault(_propTypes); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
function getStyles(props, context, state) { | |
var targetOrigin = props.targetOrigin; | |
var open = state.open; | |
var muiTheme = context.muiTheme; | |
var horizontal = targetOrigin.horizontal.replace('middle', 'vertical'); | |
return { | |
root: { | |
position: 'fixed', | |
zIndex: muiTheme.zIndex.popover, | |
opacity: open ? 1 : 0, | |
transform: open ? 'scaleY(1)' : 'scaleY(0)', | |
transformOrigin: horizontal + ' ' + targetOrigin.vertical, | |
transition: _transitions2.default.easeOut('450ms', ['transform', 'opacity']), | |
maxHeight: '100%' | |
} | |
}; | |
} | |
var PopoverAnimationVertical = function (_Component) { | |
(0, _inherits3.default)(PopoverAnimationVertical, _Component); | |
function PopoverAnimationVertical() { | |
var _ref; | |
var _temp, _this, _ret; | |
(0, _classCallCheck3.default)(this, PopoverAnimationVertical); | |
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | |
args[_key] = arguments[_key]; | |
} | |
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = PopoverAnimationVertical.__proto__ || (0, _getPrototypeOf2.default)(PopoverAnimationVertical)).call.apply(_ref, [this].concat(args))), _this), _this.state = { | |
open: false | |
}, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); | |
} | |
(0, _createClass3.default)(PopoverAnimationVertical, [{ | |
key: 'componentDidMount', | |
value: function componentDidMount() { | |
this.setState({ open: true }); // eslint-disable-line react/no-did-mount-set-state | |
} | |
}, { | |
key: 'componentWillReceiveProps', | |
value: function componentWillReceiveProps(nextProps) { | |
this.setState({ | |
open: nextProps.open | |
}); | |
} | |
}, { | |
key: 'render', | |
value: function render() { | |
var _props = this.props, | |
className = _props.className, | |
style = _props.style, | |
zDepth = _props.zDepth; | |
var styles = getStyles(this.props, this.context, this.state); | |
return _react2.default.createElement( | |
_Paper2.default, | |
{ | |
style: (0, _simpleAssign2.default)(styles.root, style), | |
zDepth: zDepth, | |
className: className | |
}, | |
this.props.children | |
); | |
} | |
}]); | |
return PopoverAnimationVertical; | |
}(_react.Component); | |
PopoverAnimationVertical.defaultProps = { | |
style: {}, | |
zDepth: 1 | |
}; | |
PopoverAnimationVertical.contextTypes = { | |
muiTheme: _react.PropTypes.object.isRequired | |
}; | |
process.env.NODE_ENV !== "production" ? PopoverAnimationVertical.propTypes = { | |
children: _react.PropTypes.node, | |
className: _react.PropTypes.string, | |
open: _react.PropTypes.bool.isRequired, | |
/** | |
* Override the inline-styles of the root element. | |
*/ | |
style: _react.PropTypes.object, | |
targetOrigin: _propTypes2.default.origin.isRequired, | |
zDepth: _propTypes2.default.zDepth | |
} : void 0; | |
exports.default = PopoverAnimationVertical; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 117 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _getPrototypeOf = __webpack_require__(4); | |
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | |
var _classCallCheck2 = __webpack_require__(2); | |
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | |
var _createClass2 = __webpack_require__(3); | |
var _createClass3 = _interopRequireDefault(_createClass2); | |
var _possibleConstructorReturn2 = __webpack_require__(6); | |
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | |
var _inherits2 = __webpack_require__(5); | |
var _inherits3 = _interopRequireDefault(_inherits2); | |
var _react = __webpack_require__(1); | |
var _reactDom = __webpack_require__(15); | |
var _reactDom2 = _interopRequireDefault(_reactDom); | |
var _events = __webpack_require__(81); | |
var _events2 = _interopRequireDefault(_events); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
var isDescendant = function isDescendant(el, target) { | |
if (target !== null) { | |
return el === target || isDescendant(el, target.parentNode); | |
} | |
return false; | |
}; | |
var clickAwayEvents = ['mouseup', 'touchend']; | |
var bind = function bind(callback) { | |
return clickAwayEvents.forEach(function (event) { | |
return _events2.default.on(document, event, callback); | |
}); | |
}; | |
var unbind = function unbind(callback) { | |
return clickAwayEvents.forEach(function (event) { | |
return _events2.default.off(document, event, callback); | |
}); | |
}; | |
var ClickAwayListener = function (_Component) { | |
(0, _inherits3.default)(ClickAwayListener, _Component); | |
function ClickAwayListener() { | |
var _ref; | |
var _temp, _this, _ret; | |
(0, _classCallCheck3.default)(this, ClickAwayListener); | |
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | |
args[_key] = arguments[_key]; | |
} | |
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = ClickAwayListener.__proto__ || (0, _getPrototypeOf2.default)(ClickAwayListener)).call.apply(_ref, [this].concat(args))), _this), _this.handleClickAway = function (event) { | |
if (event.defaultPrevented) { | |
return; | |
} | |
// IE11 support, which trigger the handleClickAway even after the unbind | |
if (_this.isCurrentlyMounted) { | |
var el = _reactDom2.default.findDOMNode(_this); | |
if (document.documentElement.contains(event.target) && !isDescendant(el, event.target)) { | |
_this.props.onClickAway(event); | |
} | |
} | |
}, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); | |
} | |
(0, _createClass3.default)(ClickAwayListener, [{ | |
key: 'componentDidMount', | |
value: function componentDidMount() { | |
this.isCurrentlyMounted = true; | |
if (this.props.onClickAway) { | |
bind(this.handleClickAway); | |
} | |
} | |
}, { | |
key: 'componentDidUpdate', | |
value: function componentDidUpdate(prevProps) { | |
if (prevProps.onClickAway !== this.props.onClickAway) { | |
unbind(this.handleClickAway); | |
if (this.props.onClickAway) { | |
bind(this.handleClickAway); | |
} | |
} | |
} | |
}, { | |
key: 'componentWillUnmount', | |
value: function componentWillUnmount() { | |
this.isCurrentlyMounted = false; | |
unbind(this.handleClickAway); | |
} | |
}, { | |
key: 'render', | |
value: function render() { | |
return this.props.children; | |
} | |
}]); | |
return ClickAwayListener; | |
}(_react.Component); | |
process.env.NODE_ENV !== "production" ? ClickAwayListener.propTypes = { | |
children: _react.PropTypes.element, | |
onClickAway: _react.PropTypes.func | |
} : void 0; | |
exports.default = ClickAwayListener; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 118 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _extends2 = __webpack_require__(8); | |
var _extends3 = _interopRequireDefault(_extends2); | |
var _objectWithoutProperties2 = __webpack_require__(9); | |
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | |
var _getPrototypeOf = __webpack_require__(4); | |
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | |
var _classCallCheck2 = __webpack_require__(2); | |
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | |
var _createClass2 = __webpack_require__(3); | |
var _createClass3 = _interopRequireDefault(_createClass2); | |
var _possibleConstructorReturn2 = __webpack_require__(6); | |
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | |
var _inherits2 = __webpack_require__(5); | |
var _inherits3 = _interopRequireDefault(_inherits2); | |
var _simpleAssign = __webpack_require__(7); | |
var _simpleAssign2 = _interopRequireDefault(_simpleAssign); | |
var _react = __webpack_require__(1); | |
var _react2 = _interopRequireDefault(_react); | |
var _reactEventListener = __webpack_require__(34); | |
var _reactEventListener2 = _interopRequireDefault(_reactEventListener); | |
var _keycode = __webpack_require__(25); | |
var _keycode2 = _interopRequireDefault(_keycode); | |
var _transitions = __webpack_require__(12); | |
var _transitions2 = _interopRequireDefault(_transitions); | |
var _FocusRipple = __webpack_require__(119); | |
var _FocusRipple2 = _interopRequireDefault(_FocusRipple); | |
var _TouchRipple = __webpack_require__(196); | |
var _TouchRipple2 = _interopRequireDefault(_TouchRipple); | |
var _Paper = __webpack_require__(23); | |
var _Paper2 = _interopRequireDefault(_Paper); | |
var _warning = __webpack_require__(20); | |
var _warning2 = _interopRequireDefault(_warning); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
function getStyles(props, context) { | |
var baseTheme = context.muiTheme.baseTheme; | |
return { | |
root: { | |
cursor: props.disabled ? 'not-allowed' : 'pointer', | |
position: 'relative', | |
overflow: 'visible', | |
display: 'table', | |
height: 'auto', | |
width: '100%' | |
}, | |
input: { | |
position: 'absolute', | |
cursor: 'inherit', | |
pointerEvents: 'all', | |
opacity: 0, | |
width: '100%', | |
height: '100%', | |
zIndex: 2, | |
left: 0, | |
boxSizing: 'border-box', | |
padding: 0, | |
margin: 0 | |
}, | |
controls: { | |
display: 'flex', | |
width: '100%', | |
height: '100%' | |
}, | |
label: { | |
float: 'left', | |
position: 'relative', | |
display: 'block', | |
width: 'calc(100% - 60px)', | |
lineHeight: '24px', | |
color: baseTheme.palette.textColor, | |
fontFamily: baseTheme.fontFamily | |
}, | |
wrap: { | |
transition: _transitions2.default.easeOut(), | |
float: 'left', | |
position: 'relative', | |
display: 'block', | |
flexShrink: 0, | |
width: 60 - baseTheme.spacing.desktopGutterLess, | |
marginRight: props.labelPosition === 'right' ? baseTheme.spacing.desktopGutterLess : 0, | |
marginLeft: props.labelPosition === 'left' ? baseTheme.spacing.desktopGutterLess : 0 | |
}, | |
ripple: { | |
color: props.rippleColor || baseTheme.palette.primary1Color, | |
height: '200%', | |
width: '200%', | |
top: -12, | |
left: -12 | |
} | |
}; | |
} | |
var EnhancedSwitch = function (_Component) { | |
(0, _inherits3.default)(EnhancedSwitch, _Component); | |
function EnhancedSwitch() { | |
var _ref; | |
var _temp, _this, _ret; | |
(0, _classCallCheck3.default)(this, EnhancedSwitch); | |
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | |
args[_key] = arguments[_key]; | |
} | |
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = EnhancedSwitch.__proto__ || (0, _getPrototypeOf2.default)(EnhancedSwitch)).call.apply(_ref, [this].concat(args))), _this), _this.state = { | |
isKeyboardFocused: false | |
}, _this.handleChange = function (event) { | |
_this.tabPressed = false; | |
_this.setState({ | |
isKeyboardFocused: false | |
}); | |
var isInputChecked = _this.refs.checkbox.checked; | |
if (!_this.props.hasOwnProperty('checked') && _this.props.onParentShouldUpdate) { | |
_this.props.onParentShouldUpdate(isInputChecked); | |
} | |
if (_this.props.onSwitch) { | |
_this.props.onSwitch(event, isInputChecked); | |
} | |
}, _this.handleKeyDown = function (event) { | |
var code = (0, _keycode2.default)(event); | |
if (code === 'tab') { | |
_this.tabPressed = true; | |
} | |
if (_this.state.isKeyboardFocused && code === 'space') { | |
_this.handleChange(event); | |
} | |
}, _this.handleKeyUp = function (event) { | |
if (_this.state.isKeyboardFocused && (0, _keycode2.default)(event) === 'space') { | |
_this.handleChange(event); | |
} | |
}, _this.handleMouseDown = function (event) { | |
// only listen to left clicks | |
if (event.button === 0) { | |
_this.refs.touchRipple.start(event); | |
} | |
}, _this.handleMouseUp = function () { | |
_this.refs.touchRipple.end(); | |
}, _this.handleMouseLeave = function () { | |
_this.refs.touchRipple.end(); | |
}, _this.handleTouchStart = function (event) { | |
_this.refs.touchRipple.start(event); | |
}, _this.handleTouchEnd = function () { | |
_this.refs.touchRipple.end(); | |
}, _this.handleBlur = function (event) { | |
_this.setState({ | |
isKeyboardFocused: false | |
}); | |
if (_this.props.onBlur) { | |
_this.props.onBlur(event); | |
} | |
}, _this.handleFocus = function (event) { | |
// setTimeout is needed becuase the focus event fires first | |
// Wait so that we can capture if this was a keyboard focus | |
// or touch focus | |
setTimeout(function () { | |
if (_this.tabPressed) { | |
_this.setState({ | |
isKeyboardFocused: true | |
}); | |
} | |
}, 150); | |
if (_this.props.onFocus) { | |
_this.props.onFocus(event); | |
} | |
}, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); | |
} | |
(0, _createClass3.default)(EnhancedSwitch, [{ | |
key: 'componentDidMount', | |
value: function componentDidMount() { | |
var inputNode = this.refs.checkbox; | |
if ((!this.props.switched || inputNode.checked !== this.props.switched) && this.props.onParentShouldUpdate) { | |
this.props.onParentShouldUpdate(inputNode.checked); | |
} | |
} | |
}, { | |
key: 'componentWillReceiveProps', | |
value: function componentWillReceiveProps(nextProps) { | |
var hasCheckedProp = nextProps.hasOwnProperty('checked'); | |
var hasToggledProp = nextProps.hasOwnProperty('toggled'); | |
var hasNewDefaultProp = nextProps.hasOwnProperty('defaultChecked') && nextProps.defaultChecked !== this.props.defaultChecked; | |
if (hasCheckedProp || hasToggledProp || hasNewDefaultProp) { | |
var switched = nextProps.checked || nextProps.toggled || nextProps.defaultChecked || false; | |
this.setState({ | |
switched: switched | |
}); | |
if (this.props.onParentShouldUpdate && switched !== this.props.switched) { | |
this.props.onParentShouldUpdate(switched); | |
} | |
} | |
} | |
}, { | |
key: 'isSwitched', | |
value: function isSwitched() { | |
return this.refs.checkbox.checked; | |
} | |
// no callback here because there is no event | |
}, { | |
key: 'setSwitched', | |
value: function setSwitched(newSwitchedValue) { | |
if (!this.props.hasOwnProperty('checked') || this.props.checked === false) { | |
if (this.props.onParentShouldUpdate) { | |
this.props.onParentShouldUpdate(newSwitchedValue); | |
} | |
this.refs.checkbox.checked = newSwitchedValue; | |
} else { | |
process.env.NODE_ENV !== "production" ? (0, _warning2.default)(false, 'Material-UI: Cannot call set method while checked is defined as a property.') : void 0; | |
} | |
} | |
}, { | |
key: 'getValue', | |
value: function getValue() { | |
return this.refs.checkbox.value; | |
} | |
// Checkbox inputs only use SPACE to change their state. Using ENTER will | |
// update the ui but not the input. | |
/** | |
* Because both the ripples and the checkbox input cannot share pointer | |
* events, the checkbox input takes control of pointer events and calls | |
* ripple animations manually. | |
*/ | |
}, { | |
key: 'render', | |
value: function render() { | |
var _props = this.props, | |
name = _props.name, | |
value = _props.value, | |
iconStyle = _props.iconStyle, | |
inputStyle = _props.inputStyle, | |
inputType = _props.inputType, | |
label = _props.label, | |
labelStyle = _props.labelStyle, | |
labelPosition = _props.labelPosition, | |
onSwitch = _props.onSwitch, | |
onBlur = _props.onBlur, | |
onFocus = _props.onFocus, | |
onMouseUp = _props.onMouseUp, | |
onMouseDown = _props.onMouseDown, | |
onMouseLeave = _props.onMouseLeave, | |
onTouchStart = _props.onTouchStart, | |
onTouchEnd = _props.onTouchEnd, | |
onParentShouldUpdate = _props.onParentShouldUpdate, | |
disabled = _props.disabled, | |
disableTouchRipple = _props.disableTouchRipple, | |
disableFocusRipple = _props.disableFocusRipple, | |
className = _props.className, | |
rippleColor = _props.rippleColor, | |
rippleStyle = _props.rippleStyle, | |
style = _props.style, | |
switched = _props.switched, | |
switchElement = _props.switchElement, | |
thumbStyle = _props.thumbStyle, | |
trackStyle = _props.trackStyle, | |
other = (0, _objectWithoutProperties3.default)(_props, ['name', 'value', 'iconStyle', 'inputStyle', 'inputType', 'label', 'labelStyle', 'labelPosition', 'onSwitch', 'onBlur', 'onFocus', 'onMouseUp', 'onMouseDown', 'onMouseLeave', 'onTouchStart', 'onTouchEnd', 'onParentShouldUpdate', 'disabled', 'disableTouchRipple', 'disableFocusRipple', 'className', 'rippleColor', 'rippleStyle', 'style', 'switched', 'switchElement', 'thumbStyle', 'trackStyle']); | |
var prepareStyles = this.context.muiTheme.prepareStyles; | |
var styles = getStyles(this.props, this.context); | |
var wrapStyles = (0, _simpleAssign2.default)(styles.wrap, iconStyle); | |
var mergedRippleStyle = (0, _simpleAssign2.default)(styles.ripple, rippleStyle); | |
if (thumbStyle) { | |
wrapStyles.marginLeft /= 2; | |
wrapStyles.marginRight /= 2; | |
} | |
var labelElement = label && _react2.default.createElement( | |
'label', | |
{ style: prepareStyles((0, _simpleAssign2.default)(styles.label, labelStyle)) }, | |
label | |
); | |
var showTouchRipple = !disabled && !disableTouchRipple; | |
var showFocusRipple = !disabled && !disableFocusRipple; | |
var touchRipple = _react2.default.createElement(_TouchRipple2.default, { | |
ref: 'touchRipple', | |
key: 'touchRipple', | |
style: mergedRippleStyle, | |
color: mergedRippleStyle.color, | |
muiTheme: this.context.muiTheme, | |
centerRipple: true | |
}); | |
var focusRipple = _react2.default.createElement(_FocusRipple2.default, { | |
key: 'focusRipple', | |
innerStyle: mergedRippleStyle, | |
color: mergedRippleStyle.color, | |
muiTheme: this.context.muiTheme, | |
show: this.state.isKeyboardFocused | |
}); | |
var ripples = [showTouchRipple ? touchRipple : null, showFocusRipple ? focusRipple : null]; | |
var inputElement = _react2.default.createElement('input', (0, _extends3.default)({}, other, { | |
ref: 'checkbox', | |
type: inputType, | |
style: prepareStyles((0, _simpleAssign2.default)(styles.input, inputStyle)), | |
name: name, | |
value: value, | |
disabled: disabled, | |
onBlur: this.handleBlur, | |
onFocus: this.handleFocus, | |
onChange: this.handleChange, | |
onMouseUp: showTouchRipple && this.handleMouseUp, | |
onMouseDown: showTouchRipple && this.handleMouseDown, | |
onMouseLeave: showTouchRipple && this.handleMouseLeave, | |
onTouchStart: showTouchRipple && this.handleTouchStart, | |
onTouchEnd: showTouchRipple && this.handleTouchEnd | |
})); | |
// If toggle component (indicated by whether the style includes thumb) manually lay out | |
// elements in order to nest ripple elements | |
var switchOrThumbElement = !thumbStyle ? _react2.default.createElement( | |
'div', | |
{ style: prepareStyles(wrapStyles) }, | |
switchElement, | |
ripples | |
) : _react2.default.createElement( | |
'div', | |
{ style: prepareStyles(wrapStyles) }, | |
_react2.default.createElement('div', { style: prepareStyles((0, _simpleAssign2.default)({}, trackStyle)) }), | |
_react2.default.createElement( | |
_Paper2.default, | |
{ style: thumbStyle, zDepth: 1, circle: true }, | |
' ', | |
ripples, | |
' ' | |
) | |
); | |
var elementsInOrder = labelPosition === 'right' ? _react2.default.createElement( | |
'div', | |
{ style: styles.controls }, | |
switchOrThumbElement, | |
labelElement | |
) : _react2.default.createElement( | |
'div', | |
{ style: styles.controls }, | |
labelElement, | |
switchOrThumbElement | |
); | |
return _react2.default.createElement( | |
'div', | |
{ ref: 'root', className: className, style: prepareStyles((0, _simpleAssign2.default)(styles.root, style)) }, | |
_react2.default.createElement(_reactEventListener2.default, { | |
target: 'window', | |
onKeyDown: this.handleKeyDown, | |
onKeyUp: this.handleKeyUp | |
}), | |
inputElement, | |
elementsInOrder | |
); | |
} | |
}]); | |
return EnhancedSwitch; | |
}(_react.Component); | |
EnhancedSwitch.contextTypes = { | |
muiTheme: _react.PropTypes.object.isRequired | |
}; | |
process.env.NODE_ENV !== "production" ? EnhancedSwitch.propTypes = { | |
checked: _react.PropTypes.bool, | |
className: _react.PropTypes.string, | |
defaultChecked: _react.PropTypes.bool, | |
disableFocusRipple: _react.PropTypes.bool, | |
disableTouchRipple: _react.PropTypes.bool, | |
disabled: _react.PropTypes.bool, | |
iconStyle: _react.PropTypes.object, | |
inputStyle: _react.PropTypes.object, | |
inputType: _react.PropTypes.string.isRequired, | |
label: _react.PropTypes.node, | |
labelPosition: _react.PropTypes.oneOf(['left', 'right']), | |
labelStyle: _react.PropTypes.object, | |
name: _react.PropTypes.string, | |
onBlur: _react.PropTypes.func, | |
onFocus: _react.PropTypes.func, | |
onMouseDown: _react.PropTypes.func, | |
onMouseLeave: _react.PropTypes.func, | |
onMouseUp: _react.PropTypes.func, | |
onParentShouldUpdate: _react.PropTypes.func, | |
onSwitch: _react.PropTypes.func, | |
onTouchEnd: _react.PropTypes.func, | |
onTouchStart: _react.PropTypes.func, | |
rippleColor: _react.PropTypes.string, | |
rippleStyle: _react.PropTypes.object, | |
style: _react.PropTypes.object, | |
switchElement: _react.PropTypes.element.isRequired, | |
switched: _react.PropTypes.bool.isRequired, | |
thumbStyle: _react.PropTypes.object, | |
trackStyle: _react.PropTypes.object, | |
value: _react.PropTypes.any | |
} : void 0; | |
exports.default = EnhancedSwitch; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 119 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _getPrototypeOf = __webpack_require__(4); | |
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | |
var _classCallCheck2 = __webpack_require__(2); | |
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | |
var _createClass2 = __webpack_require__(3); | |
var _createClass3 = _interopRequireDefault(_createClass2); | |
var _possibleConstructorReturn2 = __webpack_require__(6); | |
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | |
var _inherits2 = __webpack_require__(5); | |
var _inherits3 = _interopRequireDefault(_inherits2); | |
var _simpleAssign = __webpack_require__(7); | |
var _simpleAssign2 = _interopRequireDefault(_simpleAssign); | |
var _react = __webpack_require__(1); | |
var _react2 = _interopRequireDefault(_react); | |
var _reactDom = __webpack_require__(15); | |
var _reactDom2 = _interopRequireDefault(_reactDom); | |
var _shallowEqual = __webpack_require__(50); | |
var _shallowEqual2 = _interopRequireDefault(_shallowEqual); | |
var _autoPrefix = __webpack_require__(47); | |
var _autoPrefix2 = _interopRequireDefault(_autoPrefix); | |
var _transitions = __webpack_require__(12); | |
var _transitions2 = _interopRequireDefault(_transitions); | |
var _ScaleIn = __webpack_require__(418); | |
var _ScaleIn2 = _interopRequireDefault(_ScaleIn); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
var pulsateDuration = 750; | |
var FocusRipple = function (_Component) { | |
(0, _inherits3.default)(FocusRipple, _Component); | |
function FocusRipple() { | |
var _ref; | |
var _temp, _this, _ret; | |
(0, _classCallCheck3.default)(this, FocusRipple); | |
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | |
args[_key] = arguments[_key]; | |
} | |
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = FocusRipple.__proto__ || (0, _getPrototypeOf2.default)(FocusRipple)).call.apply(_ref, [this].concat(args))), _this), _this.pulsate = function () { | |
var innerCircle = _reactDom2.default.findDOMNode(_this.refs.innerCircle); | |
if (!innerCircle) return; | |
var startScale = 'scale(1)'; | |
var endScale = 'scale(0.85)'; | |
var currentScale = innerCircle.style.transform || startScale; | |
var nextScale = currentScale === startScale ? endScale : startScale; | |
_autoPrefix2.default.set(innerCircle.style, 'transform', nextScale); | |
_this.timeout = setTimeout(_this.pulsate, pulsateDuration); | |
}, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); | |
} | |
(0, _createClass3.default)(FocusRipple, [{ | |
key: 'componentDidMount', | |
value: function componentDidMount() { | |
if (this.props.show) { | |
this.setRippleSize(); | |
this.pulsate(); | |
} | |
} | |
}, { | |
key: 'shouldComponentUpdate', | |
value: function shouldComponentUpdate(nextProps, nextState) { | |
return !(0, _shallowEqual2.default)(this.props, nextProps) || !(0, _shallowEqual2.default)(this.state, nextState); | |
} | |
}, { | |
key: 'componentDidUpdate', | |
value: function componentDidUpdate() { | |
if (this.props.show) { | |
this.setRippleSize(); | |
this.pulsate(); | |
} else { | |
if (this.timeout) clearTimeout(this.timeout); | |
} | |
} | |
}, { | |
key: 'componentWillUnmount', | |
value: function componentWillUnmount() { | |
clearTimeout(this.timeout); | |
} | |
}, { | |
key: 'getRippleElement', | |
value: function getRippleElement(props) { | |
var color = props.color, | |
innerStyle = props.innerStyle, | |
opacity = props.opacity; | |
var _context$muiTheme = this.context.muiTheme, | |
prepareStyles = _context$muiTheme.prepareStyles, | |
ripple = _context$muiTheme.ripple; | |
var innerStyles = (0, _simpleAssign2.default)({ | |
position: 'absolute', | |
height: '100%', | |
width: '100%', | |
borderRadius: '50%', | |
opacity: opacity ? opacity : 0.16, | |
backgroundColor: color || ripple.color, | |
transition: _transitions2.default.easeOut(pulsateDuration + 'ms', 'transform', null, _transitions2.default.easeInOutFunction) | |
}, innerStyle); | |
return _react2.default.createElement('div', { ref: 'innerCircle', style: prepareStyles((0, _simpleAssign2.default)({}, innerStyles)) }); | |
} | |
}, { | |
key: 'setRippleSize', | |
value: function setRippleSize() { | |
var el = _reactDom2.default.findDOMNode(this.refs.innerCircle); | |
var height = el.offsetHeight; | |
var width = el.offsetWidth; | |
var size = Math.max(height, width); | |
var oldTop = 0; | |
// For browsers that don't support endsWith() | |
if (el.style.top.indexOf('px', el.style.top.length - 2) !== -1) { | |
oldTop = parseInt(el.style.top); | |
} | |
el.style.height = size + 'px'; | |
el.style.top = height / 2 - size / 2 + oldTop + 'px'; | |
} | |
}, { | |
key: 'render', | |
value: function render() { | |
var _props = this.props, | |
show = _props.show, | |
style = _props.style; | |
var mergedRootStyles = (0, _simpleAssign2.default)({ | |
height: '100%', | |
width: '100%', | |
position: 'absolute', | |
top: 0, | |
left: 0 | |
}, style); | |
var ripple = show ? this.getRippleElement(this.props) : null; | |
return _react2.default.createElement( | |
_ScaleIn2.default, | |
{ | |
maxScale: 0.85, | |
style: mergedRootStyles | |
}, | |
ripple | |
); | |
} | |
}]); | |
return FocusRipple; | |
}(_react.Component); | |
FocusRipple.contextTypes = { | |
muiTheme: _react.PropTypes.object.isRequired | |
}; | |
process.env.NODE_ENV !== "production" ? FocusRipple.propTypes = { | |
color: _react.PropTypes.string, | |
innerStyle: _react.PropTypes.object, | |
opacity: _react.PropTypes.number, | |
show: _react.PropTypes.bool, | |
style: _react.PropTypes.object | |
} : void 0; | |
exports.default = FocusRipple; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 120 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _extends2 = __webpack_require__(8); | |
var _extends3 = _interopRequireDefault(_extends2); | |
var _objectWithoutProperties2 = __webpack_require__(9); | |
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | |
var _getPrototypeOf = __webpack_require__(4); | |
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | |
var _classCallCheck2 = __webpack_require__(2); | |
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | |
var _createClass2 = __webpack_require__(3); | |
var _createClass3 = _interopRequireDefault(_createClass2); | |
var _possibleConstructorReturn2 = __webpack_require__(6); | |
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | |
var _inherits2 = __webpack_require__(5); | |
var _inherits3 = _interopRequireDefault(_inherits2); | |
var _simpleAssign = __webpack_require__(7); | |
var _simpleAssign2 = _interopRequireDefault(_simpleAssign); | |
var _react = __webpack_require__(1); | |
var _react2 = _interopRequireDefault(_react); | |
var _reactAddonsTransitionGroup = __webpack_require__(69); | |
var _reactAddonsTransitionGroup2 = _interopRequireDefault(_reactAddonsTransitionGroup); | |
var _SlideInChild = __webpack_require__(420); | |
var _SlideInChild2 = _interopRequireDefault(_SlideInChild); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
var SlideIn = function (_Component) { | |
(0, _inherits3.default)(SlideIn, _Component); | |
function SlideIn() { | |
var _ref; | |
var _temp, _this, _ret; | |
(0, _classCallCheck3.default)(this, SlideIn); | |
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | |
args[_key] = arguments[_key]; | |
} | |
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = SlideIn.__proto__ || (0, _getPrototypeOf2.default)(SlideIn)).call.apply(_ref, [this].concat(args))), _this), _this.getLeaveDirection = function () { | |
return _this.props.direction; | |
}, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); | |
} | |
(0, _createClass3.default)(SlideIn, [{ | |
key: 'render', | |
value: function render() { | |
var _this2 = this; | |
var _props = this.props, | |
enterDelay = _props.enterDelay, | |
children = _props.children, | |
childStyle = _props.childStyle, | |
direction = _props.direction, | |
style = _props.style, | |
other = (0, _objectWithoutProperties3.default)(_props, ['enterDelay', 'children', 'childStyle', 'direction', 'style']); | |
var prepareStyles = this.context.muiTheme.prepareStyles; | |
var mergedRootStyles = (0, _simpleAssign2.default)({}, { | |
position: 'relative', | |
overflow: 'hidden', | |
height: '100%' | |
}, style); | |
var newChildren = _react2.default.Children.map(children, function (child) { | |
return _react2.default.createElement( | |
_SlideInChild2.default, | |
{ | |
key: child.key, | |
direction: direction, | |
enterDelay: enterDelay, | |
getLeaveDirection: _this2.getLeaveDirection, | |
style: childStyle | |
}, | |
child | |
); | |
}, this); | |
return _react2.default.createElement( | |
_reactAddonsTransitionGroup2.default, | |
(0, _extends3.default)({}, other, { | |
style: prepareStyles(mergedRootStyles), | |
component: 'div' | |
}), | |
newChildren | |
); | |
} | |
}]); | |
return SlideIn; | |
}(_react.Component); | |
SlideIn.defaultProps = { | |
enterDelay: 0, | |
direction: 'left' | |
}; | |
SlideIn.contextTypes = { | |
muiTheme: _react.PropTypes.object.isRequired | |
}; | |
process.env.NODE_ENV !== "production" ? SlideIn.propTypes = { | |
childStyle: _react.PropTypes.object, | |
children: _react.PropTypes.node, | |
direction: _react.PropTypes.oneOf(['left', 'right', 'up', 'down']), | |
enterDelay: _react.PropTypes.number, | |
style: _react.PropTypes.object | |
} : void 0; | |
exports.default = SlideIn; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 121 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var red50 = exports.red50 = '#ffebee'; | |
var red100 = exports.red100 = '#ffcdd2'; | |
var red200 = exports.red200 = '#ef9a9a'; | |
var red300 = exports.red300 = '#e57373'; | |
var red400 = exports.red400 = '#ef5350'; | |
var red500 = exports.red500 = '#f44336'; | |
var red600 = exports.red600 = '#e53935'; | |
var red700 = exports.red700 = '#d32f2f'; | |
var red800 = exports.red800 = '#c62828'; | |
var red900 = exports.red900 = '#b71c1c'; | |
var redA100 = exports.redA100 = '#ff8a80'; | |
var redA200 = exports.redA200 = '#ff5252'; | |
var redA400 = exports.redA400 = '#ff1744'; | |
var redA700 = exports.redA700 = '#d50000'; | |
var pink50 = exports.pink50 = '#fce4ec'; | |
var pink100 = exports.pink100 = '#f8bbd0'; | |
var pink200 = exports.pink200 = '#f48fb1'; | |
var pink300 = exports.pink300 = '#f06292'; | |
var pink400 = exports.pink400 = '#ec407a'; | |
var pink500 = exports.pink500 = '#e91e63'; | |
var pink600 = exports.pink600 = '#d81b60'; | |
var pink700 = exports.pink700 = '#c2185b'; | |
var pink800 = exports.pink800 = '#ad1457'; | |
var pink900 = exports.pink900 = '#880e4f'; | |
var pinkA100 = exports.pinkA100 = '#ff80ab'; | |
var pinkA200 = exports.pinkA200 = '#ff4081'; | |
var pinkA400 = exports.pinkA400 = '#f50057'; | |
var pinkA700 = exports.pinkA700 = '#c51162'; | |
var purple50 = exports.purple50 = '#f3e5f5'; | |
var purple100 = exports.purple100 = '#e1bee7'; | |
var purple200 = exports.purple200 = '#ce93d8'; | |
var purple300 = exports.purple300 = '#ba68c8'; | |
var purple400 = exports.purple400 = '#ab47bc'; | |
var purple500 = exports.purple500 = '#9c27b0'; | |
var purple600 = exports.purple600 = '#8e24aa'; | |
var purple700 = exports.purple700 = '#7b1fa2'; | |
var purple800 = exports.purple800 = '#6a1b9a'; | |
var purple900 = exports.purple900 = '#4a148c'; | |
var purpleA100 = exports.purpleA100 = '#ea80fc'; | |
var purpleA200 = exports.purpleA200 = '#e040fb'; | |
var purpleA400 = exports.purpleA400 = '#d500f9'; | |
var purpleA700 = exports.purpleA700 = '#aa00ff'; | |
var deepPurple50 = exports.deepPurple50 = '#ede7f6'; | |
var deepPurple100 = exports.deepPurple100 = '#d1c4e9'; | |
var deepPurple200 = exports.deepPurple200 = '#b39ddb'; | |
var deepPurple300 = exports.deepPurple300 = '#9575cd'; | |
var deepPurple400 = exports.deepPurple400 = '#7e57c2'; | |
var deepPurple500 = exports.deepPurple500 = '#673ab7'; | |
var deepPurple600 = exports.deepPurple600 = '#5e35b1'; | |
var deepPurple700 = exports.deepPurple700 = '#512da8'; | |
var deepPurple800 = exports.deepPurple800 = '#4527a0'; | |
var deepPurple900 = exports.deepPurple900 = '#311b92'; | |
var deepPurpleA100 = exports.deepPurpleA100 = '#b388ff'; | |
var deepPurpleA200 = exports.deepPurpleA200 = '#7c4dff'; | |
var deepPurpleA400 = exports.deepPurpleA400 = '#651fff'; | |
var deepPurpleA700 = exports.deepPurpleA700 = '#6200ea'; | |
var indigo50 = exports.indigo50 = '#e8eaf6'; | |
var indigo100 = exports.indigo100 = '#c5cae9'; | |
var indigo200 = exports.indigo200 = '#9fa8da'; | |
var indigo300 = exports.indigo300 = '#7986cb'; | |
var indigo400 = exports.indigo400 = '#5c6bc0'; | |
var indigo500 = exports.indigo500 = '#3f51b5'; | |
var indigo600 = exports.indigo600 = '#3949ab'; | |
var indigo700 = exports.indigo700 = '#303f9f'; | |
var indigo800 = exports.indigo800 = '#283593'; | |
var indigo900 = exports.indigo900 = '#1a237e'; | |
var indigoA100 = exports.indigoA100 = '#8c9eff'; | |
var indigoA200 = exports.indigoA200 = '#536dfe'; | |
var indigoA400 = exports.indigoA400 = '#3d5afe'; | |
var indigoA700 = exports.indigoA700 = '#304ffe'; | |
var blue50 = exports.blue50 = '#e3f2fd'; | |
var blue100 = exports.blue100 = '#bbdefb'; | |
var blue200 = exports.blue200 = '#90caf9'; | |
var blue300 = exports.blue300 = '#64b5f6'; | |
var blue400 = exports.blue400 = '#42a5f5'; | |
var blue500 = exports.blue500 = '#2196f3'; | |
var blue600 = exports.blue600 = '#1e88e5'; | |
var blue700 = exports.blue700 = '#1976d2'; | |
var blue800 = exports.blue800 = '#1565c0'; | |
var blue900 = exports.blue900 = '#0d47a1'; | |
var blueA100 = exports.blueA100 = '#82b1ff'; | |
var blueA200 = exports.blueA200 = '#448aff'; | |
var blueA400 = exports.blueA400 = '#2979ff'; | |
var blueA700 = exports.blueA700 = '#2962ff'; | |
var lightBlue50 = exports.lightBlue50 = '#e1f5fe'; | |
var lightBlue100 = exports.lightBlue100 = '#b3e5fc'; | |
var lightBlue200 = exports.lightBlue200 = '#81d4fa'; | |
var lightBlue300 = exports.lightBlue300 = '#4fc3f7'; | |
var lightBlue400 = exports.lightBlue400 = '#29b6f6'; | |
var lightBlue500 = exports.lightBlue500 = '#03a9f4'; | |
var lightBlue600 = exports.lightBlue600 = '#039be5'; | |
var lightBlue700 = exports.lightBlue700 = '#0288d1'; | |
var lightBlue800 = exports.lightBlue800 = '#0277bd'; | |
var lightBlue900 = exports.lightBlue900 = '#01579b'; | |
var lightBlueA100 = exports.lightBlueA100 = '#80d8ff'; | |
var lightBlueA200 = exports.lightBlueA200 = '#40c4ff'; | |
var lightBlueA400 = exports.lightBlueA400 = '#00b0ff'; | |
var lightBlueA700 = exports.lightBlueA700 = '#0091ea'; | |
var cyan50 = exports.cyan50 = '#e0f7fa'; | |
var cyan100 = exports.cyan100 = '#b2ebf2'; | |
var cyan200 = exports.cyan200 = '#80deea'; | |
var cyan300 = exports.cyan300 = '#4dd0e1'; | |
var cyan400 = exports.cyan400 = '#26c6da'; | |
var cyan500 = exports.cyan500 = '#00bcd4'; | |
var cyan600 = exports.cyan600 = '#00acc1'; | |
var cyan700 = exports.cyan700 = '#0097a7'; | |
var cyan800 = exports.cyan800 = '#00838f'; | |
var cyan900 = exports.cyan900 = '#006064'; | |
var cyanA100 = exports.cyanA100 = '#84ffff'; | |
var cyanA200 = exports.cyanA200 = '#18ffff'; | |
var cyanA400 = exports.cyanA400 = '#00e5ff'; | |
var cyanA700 = exports.cyanA700 = '#00b8d4'; | |
var teal50 = exports.teal50 = '#e0f2f1'; | |
var teal100 = exports.teal100 = '#b2dfdb'; | |
var teal200 = exports.teal200 = '#80cbc4'; | |
var teal300 = exports.teal300 = '#4db6ac'; | |
var teal400 = exports.teal400 = '#26a69a'; | |
var teal500 = exports.teal500 = '#009688'; | |
var teal600 = exports.teal600 = '#00897b'; | |
var teal700 = exports.teal700 = '#00796b'; | |
var teal800 = exports.teal800 = '#00695c'; | |
var teal900 = exports.teal900 = '#004d40'; | |
var tealA100 = exports.tealA100 = '#a7ffeb'; | |
var tealA200 = exports.tealA200 = '#64ffda'; | |
var tealA400 = exports.tealA400 = '#1de9b6'; | |
var tealA700 = exports.tealA700 = '#00bfa5'; | |
var green50 = exports.green50 = '#e8f5e9'; | |
var green100 = exports.green100 = '#c8e6c9'; | |
var green200 = exports.green200 = '#a5d6a7'; | |
var green300 = exports.green300 = '#81c784'; | |
var green400 = exports.green400 = '#66bb6a'; | |
var green500 = exports.green500 = '#4caf50'; | |
var green600 = exports.green600 = '#43a047'; | |
var green700 = exports.green700 = '#388e3c'; | |
var green800 = exports.green800 = '#2e7d32'; | |
var green900 = exports.green900 = '#1b5e20'; | |
var greenA100 = exports.greenA100 = '#b9f6ca'; | |
var greenA200 = exports.greenA200 = '#69f0ae'; | |
var greenA400 = exports.greenA400 = '#00e676'; | |
var greenA700 = exports.greenA700 = '#00c853'; | |
var lightGreen50 = exports.lightGreen50 = '#f1f8e9'; | |
var lightGreen100 = exports.lightGreen100 = '#dcedc8'; | |
var lightGreen200 = exports.lightGreen200 = '#c5e1a5'; | |
var lightGreen300 = exports.lightGreen300 = '#aed581'; | |
var lightGreen400 = exports.lightGreen400 = '#9ccc65'; | |
var lightGreen500 = exports.lightGreen500 = '#8bc34a'; | |
var lightGreen600 = exports.lightGreen600 = '#7cb342'; | |
var lightGreen700 = exports.lightGreen700 = '#689f38'; | |
var lightGreen800 = exports.lightGreen800 = '#558b2f'; | |
var lightGreen900 = exports.lightGreen900 = '#33691e'; | |
var lightGreenA100 = exports.lightGreenA100 = '#ccff90'; | |
var lightGreenA200 = exports.lightGreenA200 = '#b2ff59'; | |
var lightGreenA400 = exports.lightGreenA400 = '#76ff03'; | |
var lightGreenA700 = exports.lightGreenA700 = '#64dd17'; | |
var lime50 = exports.lime50 = '#f9fbe7'; | |
var lime100 = exports.lime100 = '#f0f4c3'; | |
var lime200 = exports.lime200 = '#e6ee9c'; | |
var lime300 = exports.lime300 = '#dce775'; | |
var lime400 = exports.lime400 = '#d4e157'; | |
var lime500 = exports.lime500 = '#cddc39'; | |
var lime600 = exports.lime600 = '#c0ca33'; | |
var lime700 = exports.lime700 = '#afb42b'; | |
var lime800 = exports.lime800 = '#9e9d24'; | |
var lime900 = exports.lime900 = '#827717'; | |
var limeA100 = exports.limeA100 = '#f4ff81'; | |
var limeA200 = exports.limeA200 = '#eeff41'; | |
var limeA400 = exports.limeA400 = '#c6ff00'; | |
var limeA700 = exports.limeA700 = '#aeea00'; | |
var yellow50 = exports.yellow50 = '#fffde7'; | |
var yellow100 = exports.yellow100 = '#fff9c4'; | |
var yellow200 = exports.yellow200 = '#fff59d'; | |
var yellow300 = exports.yellow300 = '#fff176'; | |
var yellow400 = exports.yellow400 = '#ffee58'; | |
var yellow500 = exports.yellow500 = '#ffeb3b'; | |
var yellow600 = exports.yellow600 = '#fdd835'; | |
var yellow700 = exports.yellow700 = '#fbc02d'; | |
var yellow800 = exports.yellow800 = '#f9a825'; | |
var yellow900 = exports.yellow900 = '#f57f17'; | |
var yellowA100 = exports.yellowA100 = '#ffff8d'; | |
var yellowA200 = exports.yellowA200 = '#ffff00'; | |
var yellowA400 = exports.yellowA400 = '#ffea00'; | |
var yellowA700 = exports.yellowA700 = '#ffd600'; | |
var amber50 = exports.amber50 = '#fff8e1'; | |
var amber100 = exports.amber100 = '#ffecb3'; | |
var amber200 = exports.amber200 = '#ffe082'; | |
var amber300 = exports.amber300 = '#ffd54f'; | |
var amber400 = exports.amber400 = '#ffca28'; | |
var amber500 = exports.amber500 = '#ffc107'; | |
var amber600 = exports.amber600 = '#ffb300'; | |
var amber700 = exports.amber700 = '#ffa000'; | |
var amber800 = exports.amber800 = '#ff8f00'; | |
var amber900 = exports.amber900 = '#ff6f00'; | |
var amberA100 = exports.amberA100 = '#ffe57f'; | |
var amberA200 = exports.amberA200 = '#ffd740'; | |
var amberA400 = exports.amberA400 = '#ffc400'; | |
var amberA700 = exports.amberA700 = '#ffab00'; | |
var orange50 = exports.orange50 = '#fff3e0'; | |
var orange100 = exports.orange100 = '#ffe0b2'; | |
var orange200 = exports.orange200 = '#ffcc80'; | |
var orange300 = exports.orange300 = '#ffb74d'; | |
var orange400 = exports.orange400 = '#ffa726'; | |
var orange500 = exports.orange500 = '#ff9800'; | |
var orange600 = exports.orange600 = '#fb8c00'; | |
var orange700 = exports.orange700 = '#f57c00'; | |
var orange800 = exports.orange800 = '#ef6c00'; | |
var orange900 = exports.orange900 = '#e65100'; | |
var orangeA100 = exports.orangeA100 = '#ffd180'; | |
var orangeA200 = exports.orangeA200 = '#ffab40'; | |
var orangeA400 = exports.orangeA400 = '#ff9100'; | |
var orangeA700 = exports.orangeA700 = '#ff6d00'; | |
var deepOrange50 = exports.deepOrange50 = '#fbe9e7'; | |
var deepOrange100 = exports.deepOrange100 = '#ffccbc'; | |
var deepOrange200 = exports.deepOrange200 = '#ffab91'; | |
var deepOrange300 = exports.deepOrange300 = '#ff8a65'; | |
var deepOrange400 = exports.deepOrange400 = '#ff7043'; | |
var deepOrange500 = exports.deepOrange500 = '#ff5722'; | |
var deepOrange600 = exports.deepOrange600 = '#f4511e'; | |
var deepOrange700 = exports.deepOrange700 = '#e64a19'; | |
var deepOrange800 = exports.deepOrange800 = '#d84315'; | |
var deepOrange900 = exports.deepOrange900 = '#bf360c'; | |
var deepOrangeA100 = exports.deepOrangeA100 = '#ff9e80'; | |
var deepOrangeA200 = exports.deepOrangeA200 = '#ff6e40'; | |
var deepOrangeA400 = exports.deepOrangeA400 = '#ff3d00'; | |
var deepOrangeA700 = exports.deepOrangeA700 = '#dd2c00'; | |
var brown50 = exports.brown50 = '#efebe9'; | |
var brown100 = exports.brown100 = '#d7ccc8'; | |
var brown200 = exports.brown200 = '#bcaaa4'; | |
var brown300 = exports.brown300 = '#a1887f'; | |
var brown400 = exports.brown400 = '#8d6e63'; | |
var brown500 = exports.brown500 = '#795548'; | |
var brown600 = exports.brown600 = '#6d4c41'; | |
var brown700 = exports.brown700 = '#5d4037'; | |
var brown800 = exports.brown800 = '#4e342e'; | |
var brown900 = exports.brown900 = '#3e2723'; | |
var blueGrey50 = exports.blueGrey50 = '#eceff1'; | |
var blueGrey100 = exports.blueGrey100 = '#cfd8dc'; | |
var blueGrey200 = exports.blueGrey200 = '#b0bec5'; | |
var blueGrey300 = exports.blueGrey300 = '#90a4ae'; | |
var blueGrey400 = exports.blueGrey400 = '#78909c'; | |
var blueGrey500 = exports.blueGrey500 = '#607d8b'; | |
var blueGrey600 = exports.blueGrey600 = '#546e7a'; | |
var blueGrey700 = exports.blueGrey700 = '#455a64'; | |
var blueGrey800 = exports.blueGrey800 = '#37474f'; | |
var blueGrey900 = exports.blueGrey900 = '#263238'; | |
var grey50 = exports.grey50 = '#fafafa'; | |
var grey100 = exports.grey100 = '#f5f5f5'; | |
var grey200 = exports.grey200 = '#eeeeee'; | |
var grey300 = exports.grey300 = '#e0e0e0'; | |
var grey400 = exports.grey400 = '#bdbdbd'; | |
var grey500 = exports.grey500 = '#9e9e9e'; | |
var grey600 = exports.grey600 = '#757575'; | |
var grey700 = exports.grey700 = '#616161'; | |
var grey800 = exports.grey800 = '#424242'; | |
var grey900 = exports.grey900 = '#212121'; | |
var black = exports.black = '#000000'; | |
var white = exports.white = '#ffffff'; | |
var transparent = exports.transparent = 'rgba(0, 0, 0, 0)'; | |
var fullBlack = exports.fullBlack = 'rgba(0, 0, 0, 1)'; | |
var darkBlack = exports.darkBlack = 'rgba(0, 0, 0, 0.87)'; | |
var lightBlack = exports.lightBlack = 'rgba(0, 0, 0, 0.54)'; | |
var minBlack = exports.minBlack = 'rgba(0, 0, 0, 0.26)'; | |
var faintBlack = exports.faintBlack = 'rgba(0, 0, 0, 0.12)'; | |
var fullWhite = exports.fullWhite = 'rgba(255, 255, 255, 1)'; | |
var darkWhite = exports.darkWhite = 'rgba(255, 255, 255, 0.87)'; | |
var lightWhite = exports.lightWhite = 'rgba(255, 255, 255, 0.54)'; | |
/***/ }), | |
/* 122 */ | |
/***/ (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 DOMLazyTree = __webpack_require__(58); | |
var Danger = __webpack_require__(454); | |
var ReactDOMComponentTree = __webpack_require__(16); | |
var ReactInstrumentation = __webpack_require__(26); | |
var createMicrosoftUnsafeLocalFunction = __webpack_require__(130); | |
var setInnerHTML = __webpack_require__(87); | |
var setTextContent = __webpack_require__(217); | |
function getNodeAfter(parentNode, node) { | |
// Special case for text components, which return [open, close] comments | |
// from getHostNode. | |
if (Array.isArray(node)) { | |
node = node[1]; | |
} | |
return node ? node.nextSibling : parentNode.firstChild; | |
} | |
/** | |
* Inserts `childNode` as a child of `parentNode` at the `index`. | |
* | |
* @param {DOMElement} parentNode Parent node in which to insert. | |
* @param {DOMElement} childNode Child node to insert. | |
* @param {number} index Index at which to insert the child. | |
* @internal | |
*/ | |
var insertChildAt = createMicrosoftUnsafeLocalFunction(function (parentNode, childNode, referenceNode) { | |
// We rely exclusively on `insertBefore(node, null)` instead of also using | |
// `appendChild(node)`. (Using `undefined` is not allowed by all browsers so | |
// we are careful to use `null`.) | |
parentNode.insertBefore(childNode, referenceNode); | |
}); | |
function insertLazyTreeChildAt(parentNode, childTree, referenceNode) { | |
DOMLazyTree.insertTreeBefore(parentNode, childTree, referenceNode); | |
} | |
function moveChild(parentNode, childNode, referenceNode) { | |
if (Array.isArray(childNode)) { | |
moveDelimitedText(parentNode, childNode[0], childNode[1], referenceNode); | |
} else { | |
insertChildAt(parentNode, childNode, referenceNode); | |
} | |
} | |
function removeChild(parentNode, childNode) { | |
if (Array.isArray(childNode)) { | |
var closingComment = childNode[1]; | |
childNode = childNode[0]; | |
removeDelimitedText(parentNode, childNode, closingComment); | |
parentNode.removeChild(closingComment); | |
} | |
parentNode.removeChild(childNode); | |
} | |
function moveDelimitedText(parentNode, openingComment, closingComment, referenceNode) { | |
var node = openingComment; | |
while (true) { | |
var nextNode = node.nextSibling; | |
insertChildAt(parentNode, node, referenceNode); | |
if (node === closingComment) { | |
break; | |
} | |
node = nextNode; | |
} | |
} | |
function removeDelimitedText(parentNode, startNode, closingComment) { | |
while (true) { | |
var node = startNode.nextSibling; | |
if (node === closingComment) { | |
// The closing comment is removed by ReactMultiChild. | |
break; | |
} else { | |
parentNode.removeChild(node); | |
} | |
} | |
} | |
function replaceDelimitedText(openingComment, closingComment, stringText) { | |
var parentNode = openingComment.parentNode; | |
var nodeAfterComment = openingComment.nextSibling; | |
if (nodeAfterComment === closingComment) { | |
// There are no text nodes between the opening and closing comments; insert | |
// a new one if stringText isn't empty. | |
if (stringText) { | |
insertChildAt(parentNode, document.createTextNode(stringText), nodeAfterComment); | |
} | |
} else { | |
if (stringText) { | |
// Set the text content of the first node after the opening comment, and | |
// remove all following nodes up until the closing comment. | |
setTextContent(nodeAfterComment, stringText); | |
removeDelimitedText(parentNode, nodeAfterComment, closingComment); | |
} else { | |
removeDelimitedText(parentNode, openingComment, closingComment); | |
} | |
} | |
if (process.env.NODE_ENV !== 'production') { | |
ReactInstrumentation.debugTool.onHostOperation({ | |
instanceID: ReactDOMComponentTree.getInstanceFromNode(openingComment)._debugID, | |
type: 'replace text', | |
payload: stringText | |
}); | |
} | |
} | |
var dangerouslyReplaceNodeWithMarkup = Danger.dangerouslyReplaceNodeWithMarkup; | |
if (process.env.NODE_ENV !== 'production') { | |
dangerouslyReplaceNodeWithMarkup = function (oldChild, markup, prevInstance) { | |
Danger.dangerouslyReplaceNodeWithMarkup(oldChild, markup); | |
if (prevInstance._debugID !== 0) { | |
ReactInstrumentation.debugTool.onHostOperation({ | |
instanceID: prevInstance._debugID, | |
type: 'replace with', | |
payload: markup.toString() | |
}); | |
} else { | |
var nextInstance = ReactDOMComponentTree.getInstanceFromNode(markup.node); | |
if (nextInstance._debugID !== 0) { | |
ReactInstrumentation.debugTool.onHostOperation({ | |
instanceID: nextInstance._debugID, | |
type: 'mount', | |
payload: markup.toString() | |
}); | |
} | |
} | |
}; | |
} | |
/** | |
* Operations for updating with DOM children. | |
*/ | |
var DOMChildrenOperations = { | |
dangerouslyReplaceNodeWithMarkup: dangerouslyReplaceNodeWithMarkup, | |
replaceDelimitedText: replaceDelimitedText, | |
/** | |
* Updates a component's children by processing a series of updates. The | |
* update configurations are each expected to have a `parentNode` property. | |
* | |
* @param {array<object>} updates List of update configurations. | |
* @internal | |
*/ | |
processUpdates: function (parentNode, updates) { | |
if (process.env.NODE_ENV !== 'production') { | |
var parentNodeDebugID = ReactDOMComponentTree.getInstanceFromNode(parentNode)._debugID; | |
} | |
for (var k = 0; k < updates.length; k++) { | |
var update = updates[k]; | |
switch (update.type) { | |
case 'INSERT_MARKUP': | |
insertLazyTreeChildAt(parentNode, update.content, getNodeAfter(parentNode, update.afterNode)); | |
if (process.env.NODE_ENV !== 'production') { | |
ReactInstrumentation.debugTool.onHostOperation({ | |
instanceID: parentNodeDebugID, | |
type: 'insert child', | |
payload: { toIndex: update.toIndex, content: update.content.toString() } | |
}); | |
} | |
break; | |
case 'MOVE_EXISTING': | |
moveChild(parentNode, update.fromNode, getNodeAfter(parentNode, update.afterNode)); | |
if (process.env.NODE_ENV !== 'production') { | |
ReactInstrumentation.debugTool.onHostOperation({ | |
instanceID: parentNodeDebugID, | |
type: 'move child', | |
payload: { fromIndex: update.fromIndex, toIndex: update.toIndex } | |
}); | |
} | |
break; | |
case 'SET_MARKUP': | |
setInnerHTML(parentNode, update.content); | |
if (process.env.NODE_ENV !== 'production') { | |
ReactInstrumentation.debugTool.onHostOperation({ | |
instanceID: parentNodeDebugID, | |
type: 'replace children', | |
payload: update.content.toString() | |
}); | |
} | |
break; | |
case 'TEXT_CONTENT': | |
setTextContent(parentNode, update.content); | |
if (process.env.NODE_ENV !== 'production') { | |
ReactInstrumentation.debugTool.onHostOperation({ | |
instanceID: parentNodeDebugID, | |
type: 'replace text', | |
payload: update.content.toString() | |
}); | |
} | |
break; | |
case 'REMOVE_NODE': | |
removeChild(parentNode, update.fromNode); | |
if (process.env.NODE_ENV !== 'production') { | |
ReactInstrumentation.debugTool.onHostOperation({ | |
instanceID: parentNodeDebugID, | |
type: 'remove child', | |
payload: { fromIndex: update.fromIndex } | |
}); | |
} | |
break; | |
} | |
} | |
} | |
}; | |
module.exports = DOMChildrenOperations; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 123 */ | |
/***/ (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 DOMNamespaces = { | |
html: 'http://www.w3.org/1999/xhtml', | |
mathml: 'http://www.w3.org/1998/Math/MathML', | |
svg: 'http://www.w3.org/2000/svg' | |
}; | |
module.exports = DOMNamespaces; | |
/***/ }), | |
/* 124 */ | |
/***/ (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 _prodInvariant = __webpack_require__(13); | |
var ReactErrorUtils = __webpack_require__(128); | |
var invariant = __webpack_require__(11); | |
var warning = __webpack_require__(10); | |
/** | |
* Injected dependencies: | |
*/ | |
/** | |
* - `ComponentTree`: [required] Module that can convert between React instances | |
* and actual node references. | |
*/ | |
var ComponentTree; | |
var TreeTraversal; | |
var injection = { | |
injectComponentTree: function (Injected) { | |
ComponentTree = Injected; | |
if (process.env.NODE_ENV !== 'production') { | |
process.env.NODE_ENV !== 'production' ? warning(Injected && Injected.getNodeFromInstance && Injected.getInstanceFromNode, 'EventPluginUtils.injection.injectComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.') : void 0; | |
} | |
}, | |
injectTreeTraversal: function (Injected) { | |
TreeTraversal = Injected; | |
if (process.env.NODE_ENV !== 'production') { | |
process.env.NODE_ENV !== 'production' ? warning(Injected && Injected.isAncestor && Injected.getLowestCommonAncestor, 'EventPluginUtils.injection.injectTreeTraversal(...): Injected ' + 'module is missing isAncestor or getLowestCommonAncestor.') : void 0; | |
} | |
} | |
}; | |
function isEndish(topLevelType) { | |
return topLevelType === 'topMouseUp' || topLevelType === 'topTouchEnd' || topLevelType === 'topTouchCancel'; | |
} | |
function isMoveish(topLevelType) { | |
return topLevelType === 'topMouseMove' || topLevelType === 'topTouchMove'; | |
} | |
function isStartish(topLevelType) { | |
return topLevelType === 'topMouseDown' || topLevelType === 'topTouchStart'; | |
} | |
var validateEventDispatches; | |
if (process.env.NODE_ENV !== 'production') { | |
validateEventDispatches = function (event) { | |
var dispatchListeners = event._dispatchListeners; | |
var dispatchInstances = event._dispatchInstances; | |
var listenersIsArr = Array.isArray(dispatchListeners); | |
var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0; | |
var instancesIsArr = Array.isArray(dispatchInstances); | |
var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0; | |
process.env.NODE_ENV !== 'production' ? warning(instancesIsArr === listenersIsArr && instancesLen === listenersLen, 'EventPluginUtils: Invalid `event`.') : void 0; | |
}; | |
} | |
/** | |
* Dispatch the event to the listener. | |
* @param {SyntheticEvent} event SyntheticEvent to handle | |
* @param {boolean} simulated If the event is simulated (changes exn behavior) | |
* @param {function} listener Application-level callback | |
* @param {*} inst Internal component instance | |
*/ | |
function executeDispatch(event, simulated, listener, inst) { | |
var type = event.type || 'unknown-event'; | |
event.currentTarget = EventPluginUtils.getNodeFromInstance(inst); | |
if (simulated) { | |
ReactErrorUtils.invokeGuardedCallbackWithCatch(type, listener, event); | |
} else { | |
ReactErrorUtils.invokeGuardedCallback(type, listener, event); | |
} | |
event.currentTarget = null; | |
} | |
/** | |
* Standard/simple iteration through an event's collected dispatches. | |
*/ | |
function executeDispatchesInOrder(event, simulated) { | |
var dispatchListeners = event._dispatchListeners; | |
var dispatchInstances = event._dispatchInstances; | |
if (process.env.NODE_ENV !== 'production') { | |
validateEventDispatches(event); | |
} | |
if (Array.isArray(dispatchListeners)) { | |
for (var i = 0; i < dispatchListeners.length; i++) { | |
if (event.isPropagationStopped()) { | |
break; | |
} | |
// Listeners and Instances are two parallel arrays that are always in sync. | |
executeDispatch(event, simulated, dispatchListeners[i], dispatchInstances[i]); | |
} | |
} else if (dispatchListeners) { | |
executeDispatch(event, simulated, dispatchListeners, dispatchInstances); | |
} | |
event._dispatchListeners = null; | |
event._dispatchInstances = null; | |
} | |
/** | |
* Standard/simple iteration through an event's collected dispatches, but stops | |
* at the first dispatch execution returning true, and returns that id. | |
* | |
* @return {?string} id of the first dispatch execution who's listener returns | |
* true, or null if no listener returned true. | |
*/ | |
function executeDispatchesInOrderStopAtTrueImpl(event) { | |
var dispatchListeners = event._dispatchListeners; | |
var dispatchInstances = event._dispatchInstances; | |
if (process.env.NODE_ENV !== 'production') { | |
validateEventDispatches(event); | |
} | |
if (Array.isArray(dispatchListeners)) { | |
for (var i = 0; i < dispatchListeners.length; i++) { | |
if (event.isPropagationStopped()) { | |
break; | |
} | |
// Listeners and Instances are two parallel arrays that are always in sync. | |
if (dispatchListeners[i](event, dispatchInstances[i])) { | |
return dispatchInstances[i]; | |
} | |
} | |
} else if (dispatchListeners) { | |
if (dispatchListeners(event, dispatchInstances)) { | |
return dispatchInstances; | |
} | |
} | |
return null; | |
} | |
/** | |
* @see executeDispatchesInOrderStopAtTrueImpl | |
*/ | |
function executeDispatchesInOrderStopAtTrue(event) { | |
var ret = executeDispatchesInOrderStopAtTrueImpl(event); | |
event._dispatchInstances = null; | |
event._dispatchListeners = null; | |
return ret; | |
} | |
/** | |
* Execution of a "direct" dispatch - there must be at most one dispatch | |
* accumulated on the event or it is considered an error. It doesn't really make | |
* sense for an event with multiple dispatches (bubbled) to keep track of the | |
* return values at each dispatch execution, but it does tend to make sense when | |
* dealing with "direct" dispatches. | |
* | |
* @return {*} The return value of executing the single dispatch. | |
*/ | |
function executeDirectDispatch(event) { | |
if (process.env.NODE_ENV !== 'production') { | |
validateEventDispatches(event); | |
} | |
var dispatchListener = event._dispatchListeners; | |
var dispatchInstance = event._dispatchInstances; | |
!!Array.isArray(dispatchListener) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'executeDirectDispatch(...): Invalid `event`.') : _prodInvariant('103') : void 0; | |
event.currentTarget = dispatchListener ? EventPluginUtils.getNodeFromInstance(dispatchInstance) : null; | |
var res = dispatchListener ? dispatchListener(event) : null; | |
event.currentTarget = null; | |
event._dispatchListeners = null; | |
event._dispatchInstances = null; | |
return res; | |
} | |
/** | |
* @param {SyntheticEvent} event | |
* @return {boolean} True iff number of dispatches accumulated is greater than 0. | |
*/ | |
function hasDispatches(event) { | |
return !!event._dispatchListeners; | |
} | |
/** | |
* General utilities that are useful in creating custom Event Plugins. | |
*/ | |
var EventPluginUtils = { | |
isEndish: isEndish, | |
isMoveish: isMoveish, | |
isStartish: isStartish, | |
executeDirectDispatch: executeDirectDispatch, | |
executeDispatchesInOrder: executeDispatchesInOrder, | |
executeDispatchesInOrderStopAtTrue: executeDispatchesInOrderStopAtTrue, | |
hasDispatches: hasDispatches, | |
getInstanceFromNode: function (node) { | |
return ComponentTree.getInstanceFromNode(node); | |
}, | |
getNodeFromInstance: function (node) { | |
return ComponentTree.getNodeFromInstance(node); | |
}, | |
isAncestor: function (a, b) { | |
return TreeTraversal.isAncestor(a, b); | |
}, | |
getLowestCommonAncestor: function (a, b) { | |
return TreeTraversal.getLowestCommonAncestor(a, b); | |
}, | |
getParentInstance: function (inst) { | |
return TreeTraversal.getParentInstance(inst); | |
}, | |
traverseTwoPhase: function (target, fn, arg) { | |
return TreeTraversal.traverseTwoPhase(target, fn, arg); | |
}, | |
traverseEnterLeave: function (from, to, fn, argFrom, argTo) { | |
return TreeTraversal.traverseEnterLeave(from, to, fn, argFrom, argTo); | |
}, | |
injection: injection | |
}; | |
module.exports = EventPluginUtils; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 125 */ | |
/***/ (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. | |
* | |
* | |
*/ | |
/** | |
* Escape and wrap key so it is safe to use as a reactid | |
* | |
* @param {string} key to be escaped. | |
* @return {string} the escaped key. | |
*/ | |
function escape(key) { | |
var escapeRegex = /[=:]/g; | |
var escaperLookup = { | |
'=': '=0', | |
':': '=2' | |
}; | |
var escapedString = ('' + key).replace(escapeRegex, function (match) { | |
return escaperLookup[match]; | |
}); | |
return '$' + escapedString; | |
} | |
/** | |
* Unescape and unwrap key for human-readable display | |
* | |
* @param {string} key to unescape. | |
* @return {string} the unescaped key. | |
*/ | |
function unescape(key) { | |
var unescapeRegex = /(=0|=2)/g; | |
var unescaperLookup = { | |
'=0': '=', | |
'=2': ':' | |
}; | |
var keySubstring = key[0] === '.' && key[1] === '$' ? key.substring(2) : key.substring(1); | |
return ('' + keySubstring).replace(unescapeRegex, function (match) { | |
return unescaperLookup[match]; | |
}); | |
} | |
var KeyEscapeUtils = { | |
escape: escape, | |
unescape: unescape | |
}; | |
module.exports = KeyEscapeUtils; | |
/***/ }), | |
/* 126 */ | |
/***/ (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 _prodInvariant = __webpack_require__(13); | |
var React = __webpack_require__(49); | |
var ReactPropTypesSecret = __webpack_require__(209); | |
var invariant = __webpack_require__(11); | |
var warning = __webpack_require__(10); | |
var hasReadOnlyValue = { | |
'button': true, | |
'checkbox': true, | |
'image': true, | |
'hidden': true, | |
'radio': true, | |
'reset': true, | |
'submit': true | |
}; | |
function _assertSingleLink(inputProps) { | |
!(inputProps.checkedLink == null || inputProps.valueLink == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a valueLink. If you want to use checkedLink, you probably don\'t want to use valueLink and vice versa.') : _prodInvariant('87') : void 0; | |
} | |
function _assertValueLink(inputProps) { | |
_assertSingleLink(inputProps); | |
!(inputProps.value == null && inputProps.onChange == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a valueLink and a value or onChange event. If you want to use value or onChange, you probably don\'t want to use valueLink.') : _prodInvariant('88') : void 0; | |
} | |
function _assertCheckedLink(inputProps) { | |
_assertSingleLink(inputProps); | |
!(inputProps.checked == null && inputProps.onChange == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a checked property or onChange event. If you want to use checked or onChange, you probably don\'t want to use checkedLink') : _prodInvariant('89') : void 0; | |
} | |
var propTypes = { | |
value: function (props, propName, componentName) { | |
if (!props[propName] || hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled) { | |
return null; | |
} | |
return new Error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.'); | |
}, | |
checked: function (props, propName, componentName) { | |
if (!props[propName] || props.onChange || props.readOnly || props.disabled) { | |
return null; | |
} | |
return new Error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.'); | |
}, | |
onChange: React.PropTypes.func | |
}; | |
var loggedTypeFailures = {}; | |
function getDeclarationErrorAddendum(owner) { | |
if (owner) { | |
var name = owner.getName(); | |
if (name) { | |
return ' Check the render method of `' + name + '`.'; | |
} | |
} | |
return ''; | |
} | |
/** | |
* Provide a linked `value` attribute for controlled forms. You should not use | |
* this outside of the ReactDOM controlled form components. | |
*/ | |
var LinkedValueUtils = { | |
checkPropTypes: function (tagName, props, owner) { | |
for (var propName in propTypes) { | |
if (propTypes.hasOwnProperty(propName)) { | |
var error = propTypes[propName](props, propName, tagName, 'prop', null, ReactPropTypesSecret); | |
} | |
if (error instanceof Error && !(error.message in loggedTypeFailures)) { | |
// Only monitor this failure once because there tends to be a lot of the | |
// same error. | |
loggedTypeFailures[error.message] = true; | |
var addendum = getDeclarationErrorAddendum(owner); | |
process.env.NODE_ENV !== 'production' ? warning(false, 'Failed form propType: %s%s', error.message, addendum) : void 0; | |
} | |
} | |
}, | |
/** | |
* @param {object} inputProps Props for form component | |
* @return {*} current value of the input either from value prop or link. | |
*/ | |
getValue: function (inputProps) { | |
if (inputProps.valueLink) { | |
_assertValueLink(inputProps); | |
return inputProps.valueLink.value; | |
} | |
return inputProps.value; | |
}, | |
/** | |
* @param {object} inputProps Props for form component | |
* @return {*} current checked status of the input either from checked prop | |
* or link. | |
*/ | |
getChecked: function (inputProps) { | |
if (inputProps.checkedLink) { | |
_assertCheckedLink(inputProps); | |
return inputProps.checkedLink.value; | |
} | |
return inputProps.checked; | |
}, | |
/** | |
* @param {object} inputProps Props for form component | |
* @param {SyntheticEvent} event change event to handle | |
*/ | |
executeOnChange: function (inputProps, event) { | |
if (inputProps.valueLink) { | |
_assertValueLink(inputProps); | |
return inputProps.valueLink.requestChange(event.target.value); | |
} else if (inputProps.checkedLink) { | |
_assertCheckedLink(inputProps); | |
return inputProps.checkedLink.requestChange(event.target.checked); | |
} else if (inputProps.onChange) { | |
return inputProps.onChange.call(undefined, event); | |
} | |
} | |
}; | |
module.exports = LinkedValueUtils; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 127 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) {/** | |
* Copyright 2014-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 _prodInvariant = __webpack_require__(13); | |
var invariant = __webpack_require__(11); | |
var injected = false; | |
var ReactComponentEnvironment = { | |
/** | |
* Optionally injectable hook for swapping out mount images in the middle of | |
* the tree. | |
*/ | |
replaceNodeWithMarkup: null, | |
/** | |
* Optionally injectable hook for processing a queue of child updates. Will | |
* later move into MultiChildComponents. | |
*/ | |
processChildrenUpdates: null, | |
injection: { | |
injectEnvironment: function (environment) { | |
!!injected ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactCompositeComponent: injectEnvironment() can only be called once.') : _prodInvariant('104') : void 0; | |
ReactComponentEnvironment.replaceNodeWithMarkup = environment.replaceNodeWithMarkup; | |
ReactComponentEnvironment.processChildrenUpdates = environment.processChildrenUpdates; | |
injected = true; | |
} | |
} | |
}; | |
module.exports = ReactComponentEnvironment; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 128 */ | |
/***/ (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 caughtError = null; | |
/** | |
* Call a function while guarding against errors that happens within it. | |
* | |
* @param {String} name of the guard to use for logging or debugging | |
* @param {Function} func The function to invoke | |
* @param {*} a First argument | |
* @param {*} b Second argument | |
*/ | |
function invokeGuardedCallback(name, func, a) { | |
try { | |
func(a); | |
} catch (x) { | |
if (caughtError === null) { | |
caughtError = x; | |
} | |
} | |
} | |
var ReactErrorUtils = { | |
invokeGuardedCallback: invokeGuardedCallback, | |
/** | |
* Invoked by ReactTestUtils.Simulate so that any errors thrown by the event | |
* handler are sure to be rethrown by rethrowCaughtError. | |
*/ | |
invokeGuardedCallbackWithCatch: invokeGuardedCallback, | |
/** | |
* During execution of guarded functions we will capture the first error which | |
* we will rethrow to be handled by the top level error handler. | |
*/ | |
rethrowCaughtError: function () { | |
if (caughtError) { | |
var error = caughtError; | |
caughtError = null; | |
throw error; | |
} | |
} | |
}; | |
if (process.env.NODE_ENV !== 'production') { | |
/** | |
* To help development we can get better devtools integration by simulating a | |
* real browser event. | |
*/ | |
if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') { | |
var fakeNode = document.createElement('react'); | |
ReactErrorUtils.invokeGuardedCallback = function (name, func, a) { | |
var boundFunc = func.bind(null, a); | |
var evtType = 'react-' + name; | |
fakeNode.addEventListener(evtType, boundFunc, false); | |
var evt = document.createEvent('Event'); | |
// $FlowFixMe https://github.com/facebook/flow/issues/2336 | |
evt.initEvent(evtType, false, false); | |
fakeNode.dispatchEvent(evt); | |
fakeNode.removeEventListener(evtType, boundFunc, false); | |
}; | |
} | |
} | |
module.exports = ReactErrorUtils; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 129 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) {/** | |
* 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 _prodInvariant = __webpack_require__(13); | |
var ReactCurrentOwner = __webpack_require__(31); | |
var ReactInstanceMap = __webpack_require__(72); | |
var ReactInstrumentation = __webpack_require__(26); | |
var ReactUpdates = __webpack_require__(30); | |
var invariant = __webpack_require__(11); | |
var warning = __webpack_require__(10); | |
function enqueueUpdate(internalInstance) { | |
ReactUpdates.enqueueUpdate(internalInstance); | |
} | |
function formatUnexpectedArgument(arg) { | |
var type = typeof arg; | |
if (type !== 'object') { | |
return type; | |
} | |
var displayName = arg.constructor && arg.constructor.name || type; | |
var keys = Object.keys(arg); | |
if (keys.length > 0 && keys.length < 20) { | |
return displayName + ' (keys: ' + keys.join(', ') + ')'; | |
} | |
return displayName; | |
} | |
function getInternalInstanceReadyForUpdate(publicInstance, callerName) { | |
var internalInstance = ReactInstanceMap.get(publicInstance); | |
if (!internalInstance) { | |
if (process.env.NODE_ENV !== 'production') { | |
var ctor = publicInstance.constructor; | |
// Only warn when we have a callerName. Otherwise we should be silent. | |
// We're probably calling from enqueueCallback. We don't want to warn | |
// there because we already warned for the corresponding lifecycle method. | |
process.env.NODE_ENV !== 'production' ? warning(!callerName, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, ctor && (ctor.displayName || ctor.name) || 'ReactClass') : void 0; | |
} | |
return null; | |
} | |
if (process.env.NODE_ENV !== 'production') { | |
process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, '%s(...): Cannot update during an existing state transition (such as ' + 'within `render` or another component\'s constructor). Render methods ' + 'should be a pure function of props and state; constructor ' + 'side-effects are an anti-pattern, but can be moved to ' + '`componentWillMount`.', callerName) : void 0; | |
} | |
return internalInstance; | |
} | |
/** | |
* ReactUpdateQueue allows for state updates to be scheduled into a later | |
* reconciliation step. | |
*/ | |
var ReactUpdateQueue = { | |
/** | |
* Checks whether or not this composite component is mounted. | |
* @param {ReactClass} publicInstance The instance we want to test. | |
* @return {boolean} True if mounted, false otherwise. | |
* @protected | |
* @final | |
*/ | |
isMounted: function (publicInstance) { | |
if (process.env.NODE_ENV !== 'production') { | |
var owner = ReactCurrentOwner.current; | |
if (owner !== null) { | |
process.env.NODE_ENV !== 'production' ? warning(owner._warnedAboutRefsInRender, '%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', owner.getName() || 'A component') : void 0; | |
owner._warnedAboutRefsInRender = true; | |
} | |
} | |
var internalInstance = ReactInstanceMap.get(publicInstance); | |
if (internalInstance) { | |
// During componentWillMount and render this will still be null but after | |
// that will always render to something. At least for now. So we can use | |
// this hack. | |
return !!internalInstance._renderedComponent; | |
} else { | |
return false; | |
} | |
}, | |
/** | |
* Enqueue a callback that will be executed after all the pending updates | |
* have processed. | |
* | |
* @param {ReactClass} publicInstance The instance to use as `this` context. | |
* @param {?function} callback Called after state is updated. | |
* @param {string} callerName Name of the calling function in the public API. | |
* @internal | |
*/ | |
enqueueCallback: function (publicInstance, callback, callerName) { | |
ReactUpdateQueue.validateCallback(callback, callerName); | |
var internalInstance = getInternalInstanceReadyForUpdate(publicInstance); | |
// Previously we would throw an error if we didn't have an internal | |
// instance. Since we want to make it a no-op instead, we mirror the same | |
// behavior we have in other enqueue* methods. | |
// We also need to ignore callbacks in componentWillMount. See | |
// enqueueUpdates. | |
if (!internalInstance) { | |
return null; | |
} | |
if (internalInstance._pendingCallbacks) { | |
internalInstance._pendingCallbacks.push(callback); | |
} else { | |
internalInstance._pendingCallbacks = [callback]; | |
} | |
// TODO: The callback here is ignored when setState is called from | |
// componentWillMount. Either fix it or disallow doing so completely in | |
// favor of getInitialState. Alternatively, we can disallow | |
// componentWillMount during server-side rendering. | |
enqueueUpdate(internalInstance); | |
}, | |
enqueueCallbackInternal: function (internalInstance, callback) { | |
if (internalInstance._pendingCallbacks) { | |
internalInstance._pendingCallbacks.push(callback); | |
} else { | |
internalInstance._pendingCallbacks = [callback]; | |
} | |
enqueueUpdate(internalInstance); | |
}, | |
/** | |
* Forces an update. This should only be invoked when it is known with | |
* certainty that we are **not** in a DOM transaction. | |
* | |
* You may want to call this when you know that some deeper aspect of the | |
* component's state has changed but `setState` was not called. | |
* | |
* This will not invoke `shouldComponentUpdate`, but it will invoke | |
* `componentWillUpdate` and `componentDidUpdate`. | |
* | |
* @param {ReactClass} publicInstance The instance that should rerender. | |
* @internal | |
*/ | |
enqueueForceUpdate: function (publicInstance) { | |
var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'forceUpdate'); | |
if (!internalInstance) { | |
return; | |
} | |
internalInstance._pendingForceUpdate = true; | |
enqueueUpdate(internalInstance); | |
}, | |
/** | |
* Replaces all of the state. Always use this or `setState` to mutate state. | |
* You should treat `this.state` as immutable. | |
* | |
* There is no guarantee that `this.state` will be immediately updated, so | |
* accessing `this.state` after calling this method may return the old value. | |
* | |
* @param {ReactClass} publicInstance The instance that should rerender. | |
* @param {object} completeState Next state. | |
* @internal | |
*/ | |
enqueueReplaceState: function (publicInstance, completeState) { | |
var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'replaceState'); | |
if (!internalInstance) { | |
return; | |
} | |
internalInstance._pendingStateQueue = [completeState]; | |
internalInstance._pendingReplaceState = true; | |
enqueueUpdate(internalInstance); | |
}, | |
/** | |
* Sets a subset of the state. This only exists because _pendingState is | |
* internal. This provides a merging strategy that is not available to deep | |
* properties which is confusing. TODO: Expose pendingState or don't use it | |
* during the merge. | |
* | |
* @param {ReactClass} publicInstance The instance that should rerender. | |
* @param {object} partialState Next partial state to be merged with state. | |
* @internal | |
*/ | |
enqueueSetState: function (publicInstance, partialState) { | |
if (process.env.NODE_ENV !== 'production') { | |
ReactInstrumentation.debugTool.onSetState(); | |
process.env.NODE_ENV !== 'production' ? warning(partialState != null, 'setState(...): You passed an undefined or null state object; ' + 'instead, use forceUpdate().') : void 0; | |
} | |
var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'setState'); | |
if (!internalInstance) { | |
return; | |
} | |
var queue = internalInstance._pendingStateQueue || (internalInstance._pendingStateQueue = []); | |
queue.push(partialState); | |
enqueueUpdate(internalInstance); | |
}, | |
enqueueElementInternal: function (internalInstance, nextElement, nextContext) { | |
internalInstance._pendingElement = nextElement; | |
// TODO: introduce _pendingContext instead of setting it directly. | |
internalInstance._context = nextContext; | |
enqueueUpdate(internalInstance); | |
}, | |
validateCallback: function (callback, callerName) { | |
!(!callback || typeof callback === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.', callerName, formatUnexpectedArgument(callback)) : _prodInvariant('122', callerName, formatUnexpectedArgument(callback)) : void 0; | |
} | |
}; | |
module.exports = ReactUpdateQueue; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 130 */ | |
/***/ (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. | |
* | |
*/ | |
/* globals MSApp */ | |
/** | |
* Create a function which has 'unsafe' privileges (required by windows8 apps) | |
*/ | |
var createMicrosoftUnsafeLocalFunction = function (func) { | |
if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) { | |
return function (arg0, arg1, arg2, arg3) { | |
MSApp.execUnsafeLocalFunction(function () { | |
return func(arg0, arg1, arg2, arg3); | |
}); | |
}; | |
} else { | |
return func; | |
} | |
}; | |
module.exports = createMicrosoftUnsafeLocalFunction; | |
/***/ }), | |
/* 131 */ | |
/***/ (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. | |
* | |
*/ | |
/** | |
* `charCode` represents the actual "character code" and is safe to use with | |
* `String.fromCharCode`. As such, only keys that correspond to printable | |
* characters produce a valid `charCode`, the only exception to this is Enter. | |
* The Tab-key is considered non-printable and does not have a `charCode`, | |
* presumably because it does not produce a tab-character in browsers. | |
* | |
* @param {object} nativeEvent Native browser event. | |
* @return {number} Normalized `charCode` property. | |
*/ | |
function getEventCharCode(nativeEvent) { | |
var charCode; | |
var keyCode = nativeEvent.keyCode; | |
if ('charCode' in nativeEvent) { | |
charCode = nativeEvent.charCode; | |
// FF does not set `charCode` for the Enter-key, check against `keyCode`. | |
if (charCode === 0 && keyCode === 13) { | |
charCode = 13; | |
} | |
} else { | |
// IE8 does not implement `charCode`, but `keyCode` has the correct value. | |
charCode = keyCode; | |
} | |
// Some non-printable keys are reported in `charCode`/`keyCode`, discard them. | |
// Must not discard the (non-)printable Enter-key. | |
if (charCode >= 32 || charCode === 13) { | |
return charCode; | |
} | |
return 0; | |
} | |
module.exports = getEventCharCode; | |
/***/ }), | |
/* 132 */ | |
/***/ (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. | |
* | |
*/ | |
/** | |
* Translation from modifier key to the associated property in the event. | |
* @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers | |
*/ | |
var modifierKeyToProp = { | |
'Alt': 'altKey', | |
'Control': 'ctrlKey', | |
'Meta': 'metaKey', | |
'Shift': 'shiftKey' | |
}; | |
// IE8 does not implement getModifierState so we simply map it to the only | |
// modifier keys exposed by the event itself, does not support Lock-keys. | |
// Currently, all major browsers except Chrome seems to support Lock-keys. | |
function modifierStateGetter(keyArg) { | |
var syntheticEvent = this; | |
var nativeEvent = syntheticEvent.nativeEvent; | |
if (nativeEvent.getModifierState) { | |
return nativeEvent.getModifierState(keyArg); | |
} | |
var keyProp = modifierKeyToProp[keyArg]; | |
return keyProp ? !!nativeEvent[keyProp] : false; | |
} | |
function getEventModifierState(nativeEvent) { | |
return modifierStateGetter; | |
} | |
module.exports = getEventModifierState; | |
/***/ }), | |
/* 133 */ | |
/***/ (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. | |
* | |
*/ | |
/** | |
* Gets the target node from a native browser event by accounting for | |
* inconsistencies in browser DOM APIs. | |
* | |
* @param {object} nativeEvent Native browser event. | |
* @return {DOMEventTarget} Target node. | |
*/ | |
function getEventTarget(nativeEvent) { | |
var target = nativeEvent.target || nativeEvent.srcElement || window; | |
// Normalize SVG <use> element events #4963 | |
if (target.correspondingUseElement) { | |
target = target.correspondingUseElement; | |
} | |
// Safari may fire events on text nodes (Node.TEXT_NODE is 3). | |
// @see http://www.quirksmode.org/js/events_properties.html | |
return target.nodeType === 3 ? target.parentNode : target; | |
} | |
module.exports = getEventTarget; | |
/***/ }), | |
/* 134 */ | |
/***/ (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 ExecutionEnvironment = __webpack_require__(18); | |
var useHasFeature; | |
if (ExecutionEnvironment.canUseDOM) { | |
useHasFeature = document.implementation && document.implementation.hasFeature && | |
// always returns true in newer browsers as per the standard. | |
// @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature | |
document.implementation.hasFeature('', '') !== true; | |
} | |
/** | |
* Checks if an event is supported in the current execution environment. | |
* | |
* NOTE: This will not work correctly for non-generic events such as `change`, | |
* `reset`, `load`, `error`, and `select`. | |
* | |
* Borrows from Modernizr. | |
* | |
* @param {string} eventNameSuffix Event name, e.g. "click". | |
* @param {?boolean} capture Check if the capture phase is supported. | |
* @return {boolean} True if the event is supported. | |
* @internal | |
* @license Modernizr 3.0.0pre (Custom Build) | MIT | |
*/ | |
function isEventSupported(eventNameSuffix, capture) { | |
if (!ExecutionEnvironment.canUseDOM || capture && !('addEventListener' in document)) { | |
return false; | |
} | |
var eventName = 'on' + eventNameSuffix; | |
var isSupported = eventName in document; | |
if (!isSupported) { | |
var element = document.createElement('div'); | |
element.setAttribute(eventName, 'return;'); | |
isSupported = typeof element[eventName] === 'function'; | |
} | |
if (!isSupported && useHasFeature && eventNameSuffix === 'wheel') { | |
// This is the only way to test support for the `wheel` event in IE9+. | |
isSupported = document.implementation.hasFeature('Events.wheel', '3.0'); | |
} | |
return isSupported; | |
} | |
module.exports = isEventSupported; | |
/***/ }), | |
/* 135 */ | |
/***/ (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. | |
* | |
*/ | |
/** | |
* Given a `prevElement` and `nextElement`, determines if the existing | |
* instance should be updated as opposed to being destroyed or replaced by a new | |
* instance. Both arguments are elements. This ensures that this logic can | |
* operate on stateless trees without any backing instance. | |
* | |
* @param {?object} prevElement | |
* @param {?object} nextElement | |
* @return {boolean} True if the existing instance should be updated. | |
* @protected | |
*/ | |
function shouldUpdateReactComponent(prevElement, nextElement) { | |
var prevEmpty = prevElement === null || prevElement === false; | |
var nextEmpty = nextElement === null || nextElement === false; | |
if (prevEmpty || nextEmpty) { | |
return prevEmpty === nextEmpty; | |
} | |
var prevType = typeof prevElement; | |
var nextType = typeof nextElement; | |
if (prevType === 'string' || prevType === 'number') { | |
return nextType === 'string' || nextType === 'number'; | |
} else { | |
return nextType === 'object' && prevElement.type === nextElement.type && prevElement.key === nextElement.key; | |
} | |
} | |
module.exports = shouldUpdateReactComponent; | |
/***/ }), | |
/* 136 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) {/** | |
* 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 _assign = __webpack_require__(14); | |
var emptyFunction = __webpack_require__(24); | |
var warning = __webpack_require__(10); | |
var validateDOMNesting = emptyFunction; | |
if (process.env.NODE_ENV !== 'production') { | |
// This validation code was written based on the HTML5 parsing spec: | |
// https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope | |
// | |
// Note: this does not catch all invalid nesting, nor does it try to (as it's | |
// not clear what practical benefit doing so provides); instead, we warn only | |
// for cases where the parser will give a parse tree differing from what React | |
// intended. For example, <b><div></div></b> is invalid but we don't warn | |
// because it still parses correctly; we do warn for other cases like nested | |
// <p> tags where the beginning of the second element implicitly closes the | |
// first, causing a confusing mess. | |
// https://html.spec.whatwg.org/multipage/syntax.html#special | |
var specialTags = ['address', 'applet', 'area', 'article', 'aside', 'base', 'basefont', 'bgsound', 'blockquote', 'body', 'br', 'button', 'caption', 'center', 'col', 'colgroup', 'dd', 'details', 'dir', 'div', 'dl', 'dt', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'iframe', 'img', 'input', 'isindex', 'li', 'link', 'listing', 'main', 'marquee', 'menu', 'menuitem', 'meta', 'nav', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'p', 'param', 'plaintext', 'pre', 'script', 'section', 'select', 'source', 'style', 'summary', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul', 'wbr', 'xmp']; | |
// https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope | |
var inScopeTags = ['applet', 'caption', 'html', 'table', 'td', 'th', 'marquee', 'object', 'template', | |
// https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point | |
// TODO: Distinguish by namespace here -- for <title>, including it here | |
// errs on the side of fewer warnings | |
'foreignObject', 'desc', 'title']; | |
// https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-button-scope | |
var buttonScopeTags = inScopeTags.concat(['button']); | |
// https://html.spec.whatwg.org/multipage/syntax.html#generate-implied-end-tags | |
var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt']; | |
var emptyAncestorInfo = { | |
current: null, | |
formTag: null, | |
aTagInScope: null, | |
buttonTagInScope: null, | |
nobrTagInScope: null, | |
pTagInButtonScope: null, | |
listItemTagAutoclosing: null, | |
dlItemTagAutoclosing: null | |
}; | |
var updatedAncestorInfo = function (oldInfo, tag, instance) { | |
var ancestorInfo = _assign({}, oldInfo || emptyAncestorInfo); | |
var info = { tag: tag, instance: instance }; | |
if (inScopeTags.indexOf(tag) !== -1) { | |
ancestorInfo.aTagInScope = null; | |
ancestorInfo.buttonTagInScope = null; | |
ancestorInfo.nobrTagInScope = null; | |
} | |
if (buttonScopeTags.indexOf(tag) !== -1) { | |
ancestorInfo.pTagInButtonScope = null; | |
} | |
// See rules for 'li', 'dd', 'dt' start tags in | |
// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody | |
if (specialTags.indexOf(tag) !== -1 && tag !== 'address' && tag !== 'div' && tag !== 'p') { | |
ancestorInfo.listItemTagAutoclosing = null; | |
ancestorInfo.dlItemTagAutoclosing = null; | |
} | |
ancestorInfo.current = info; | |
if (tag === 'form') { | |
ancestorInfo.formTag = info; | |
} | |
if (tag === 'a') { | |
ancestorInfo.aTagInScope = info; | |
} | |
if (tag === 'button') { | |
ancestorInfo.buttonTagInScope = info; | |
} | |
if (tag === 'nobr') { | |
ancestorInfo.nobrTagInScope = info; | |
} | |
if (tag === 'p') { | |
ancestorInfo.pTagInButtonScope = info; | |
} | |
if (tag === 'li') { | |
ancestorInfo.listItemTagAutoclosing = info; | |
} | |
if (tag === 'dd' || tag === 'dt') { | |
ancestorInfo.dlItemTagAutoclosing = info; | |
} | |
return ancestorInfo; | |
}; | |
/** | |
* Returns whether | |
*/ | |
var isTagValidWithParent = function (tag, parentTag) { | |
// First, let's check if we're in an unusual parsing mode... | |
switch (parentTag) { | |
// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inselect | |
case 'select': | |
return tag === 'option' || tag === 'optgroup' || tag === '#text'; | |
case 'optgroup': | |
return tag === 'option' || tag === '#text'; | |
// Strictly speaking, seeing an <option> doesn't mean we're in a <select> | |
// but | |
case 'option': | |
return tag === '#text'; | |
// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intd | |
// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incaption | |
// No special behavior since these rules fall back to "in body" mode for | |
// all except special table nodes which cause bad parsing behavior anyway. | |
// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intr | |
case 'tr': | |
return tag === 'th' || tag === 'td' || tag === 'style' || tag === 'script' || tag === 'template'; | |
// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intbody | |
case 'tbody': | |
case 'thead': | |
case 'tfoot': | |
return tag === 'tr' || tag === 'style' || tag === 'script' || tag === 'template'; | |
// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incolgroup | |
case 'colgroup': | |
return tag === 'col' || tag === 'template'; | |
// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intable | |
case 'table': | |
return tag === 'caption' || tag === 'colgroup' || tag === 'tbody' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' || tag === 'template'; | |
// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead | |
case 'head': | |
return tag === 'base' || tag === 'basefont' || tag === 'bgsound' || tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' || tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template'; | |
// https://html.spec.whatwg.org/multipage/semantics.html#the-html-element | |
case 'html': | |
return tag === 'head' || tag === 'body'; | |
case '#document': | |
return tag === 'html'; | |
} | |
// Probably in the "in body" parsing mode, so we outlaw only tag combos | |
// where the parsing rules cause implicit opens or closes to be added. | |
// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody | |
switch (tag) { | |
case 'h1': | |
case 'h2': | |
case 'h3': | |
case 'h4': | |
case 'h5': | |
case 'h6': | |
return parentTag !== 'h1' && parentTag !== 'h2' && parentTag !== 'h3' && parentTag !== 'h4' && parentTag !== 'h5' && parentTag !== 'h6'; | |
case 'rp': | |
case 'rt': | |
return impliedEndTags.indexOf(parentTag) === -1; | |
case 'body': | |
case 'caption': | |
case 'col': | |
case 'colgroup': | |
case 'frame': | |
case 'head': | |
case 'html': | |
case 'tbody': | |
case 'td': | |
case 'tfoot': | |
case 'th': | |
case 'thead': | |
case 'tr': | |
// These tags are only valid with a few parents that have special child | |
// parsing rules -- if we're down here, then none of those matched and | |
// so we allow it only if we don't know what the parent is, as all other | |
// cases are invalid. | |
return parentTag == null; | |
} | |
return true; | |
}; | |
/** | |
* Returns whether | |
*/ | |
var findInvalidAncestorForTag = function (tag, ancestorInfo) { | |
switch (tag) { | |
case 'address': | |
case 'article': | |
case 'aside': | |
case 'blockquote': | |
case 'center': | |
case 'details': | |
case 'dialog': | |
case 'dir': | |
case 'div': | |
case 'dl': | |
case 'fieldset': | |
case 'figcaption': | |
case 'figure': | |
case 'footer': | |
case 'header': | |
case 'hgroup': | |
case 'main': | |
case 'menu': | |
case 'nav': | |
case 'ol': | |
case 'p': | |
case 'section': | |
case 'summary': | |
case 'ul': | |
case 'pre': | |
case 'listing': | |
case 'table': | |
case 'hr': | |
case 'xmp': | |
case 'h1': | |
case 'h2': | |
case 'h3': | |
case 'h4': | |
case 'h5': | |
case 'h6': | |
return ancestorInfo.pTagInButtonScope; | |
case 'form': | |
return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope; | |
case 'li': | |
return ancestorInfo.listItemTagAutoclosing; | |
case 'dd': | |
case 'dt': | |
return ancestorInfo.dlItemTagAutoclosing; | |
case 'button': | |
return ancestorInfo.buttonTagInScope; | |
case 'a': | |
// Spec says something about storing a list of markers, but it sounds | |
// equivalent to this check. | |
return ancestorInfo.aTagInScope; | |
case 'nobr': | |
return ancestorInfo.nobrTagInScope; | |
} | |
return null; | |
}; | |
/** | |
* Given a ReactCompositeComponent instance, return a list of its recursive | |
* owners, starting at the root and ending with the instance itself. | |
*/ | |
var findOwnerStack = function (instance) { | |
if (!instance) { | |
return []; | |
} | |
var stack = []; | |
do { | |
stack.push(instance); | |
} while (instance = instance._currentElement._owner); | |
stack.reverse(); | |
return stack; | |
}; | |
var didWarn = {}; | |
validateDOMNesting = function (childTag, childText, childInstance, ancestorInfo) { | |
ancestorInfo = ancestorInfo || emptyAncestorInfo; | |
var parentInfo = ancestorInfo.current; | |
var parentTag = parentInfo && parentInfo.tag; | |
if (childText != null) { | |
process.env.NODE_ENV !== 'production' ? warning(childTag == null, 'validateDOMNesting: when childText is passed, childTag should be null') : void 0; | |
childTag = '#text'; | |
} | |
var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo; | |
var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo); | |
var problematic = invalidParent || invalidAncestor; | |
if (problematic) { | |
var ancestorTag = problematic.tag; | |
var ancestorInstance = problematic.instance; | |
var childOwner = childInstance && childInstance._currentElement._owner; | |
var ancestorOwner = ancestorInstance && ancestorInstance._currentElement._owner; | |
var childOwners = findOwnerStack(childOwner); | |
var ancestorOwners = findOwnerStack(ancestorOwner); | |
var minStackLen = Math.min(childOwners.length, ancestorOwners.length); | |
var i; | |
var deepestCommon = -1; | |
for (i = 0; i < minStackLen; i++) { | |
if (childOwners[i] === ancestorOwners[i]) { | |
deepestCommon = i; | |
} else { | |
break; | |
} | |
} | |
var UNKNOWN = '(unknown)'; | |
var childOwnerNames = childOwners.slice(deepestCommon + 1).map(function (inst) { | |
return inst.getName() || UNKNOWN; | |
}); | |
var ancestorOwnerNames = ancestorOwners.slice(deepestCommon + 1).map(function (inst) { | |
return inst.getName() || UNKNOWN; | |
}); | |
var ownerInfo = [].concat( | |
// If the parent and child instances have a common owner ancestor, start | |
// with that -- otherwise we just start with the parent's owners. | |
deepestCommon !== -1 ? childOwners[deepestCommon].getName() || UNKNOWN : [], ancestorOwnerNames, ancestorTag, | |
// If we're warning about an invalid (non-parent) ancestry, add '...' | |
invalidAncestor ? ['...'] : [], childOwnerNames, childTag).join(' > '); | |
var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag + '|' + ownerInfo; | |
if (didWarn[warnKey]) { | |
return; | |
} | |
didWarn[warnKey] = true; | |
var tagDisplayName = childTag; | |
var whitespaceInfo = ''; | |
if (childTag === '#text') { | |
if (/\S/.test(childText)) { | |
tagDisplayName = 'Text nodes'; | |
} else { | |
tagDisplayName = 'Whitespace text nodes'; | |
whitespaceInfo = ' Make sure you don\'t have any extra whitespace between tags on ' + 'each line of your source code.'; | |
} | |
} else { | |
tagDisplayName = '<' + childTag + '>'; | |
} | |
if (invalidParent) { | |
var info = ''; | |
if (ancestorTag === 'table' && childTag === 'tr') { | |
info += ' Add a <tbody> to your code to match the DOM tree generated by ' + 'the browser.'; | |
} | |
process.env.NODE_ENV !== 'production' ? warning(false, 'validateDOMNesting(...): %s cannot appear as a child of <%s>.%s ' + 'See %s.%s', tagDisplayName, ancestorTag, whitespaceInfo, ownerInfo, info) : void 0; | |
} else { | |
process.env.NODE_ENV !== 'production' ? warning(false, 'validateDOMNesting(...): %s cannot appear as a descendant of ' + '<%s>. See %s.', tagDisplayName, ancestorTag, ownerInfo) : void 0; | |
} | |
} | |
}; | |
validateDOMNesting.updatedAncestorInfo = updatedAncestorInfo; | |
// For testing | |
validateDOMNesting.isTagValidInContext = function (tag, ancestorInfo) { | |
ancestorInfo = ancestorInfo || emptyAncestorInfo; | |
var parentInfo = ancestorInfo.current; | |
var parentTag = parentInfo && parentInfo.tag; | |
return isTagValidWithParent(tag, parentTag) && !findInvalidAncestorForTag(tag, ancestorInfo); | |
}; | |
} | |
module.exports = validateDOMNesting; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 137 */ | |
/***/ (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 _prodInvariant = __webpack_require__(41); | |
var ReactNoopUpdateQueue = __webpack_require__(138); | |
var canDefineProperty = __webpack_require__(140); | |
var emptyObject = __webpack_require__(65); | |
var invariant = __webpack_require__(11); | |
var warning = __webpack_require__(10); | |
/** | |
* Base class helpers for the updating state of a component. | |
*/ | |
function ReactComponent(props, context, updater) { | |
this.props = props; | |
this.context = context; | |
this.refs = emptyObject; | |
// We initialize the default updater but the real one gets injected by the | |
// renderer. | |
this.updater = updater || ReactNoopUpdateQueue; | |
} | |
ReactComponent.prototype.isReactComponent = {}; | |
/** | |
* Sets a subset of the state. Always use this to mutate | |
* state. You should treat `this.state` as immutable. | |
* | |
* There is no guarantee that `this.state` will be immediately updated, so | |
* accessing `this.state` after calling this method may return the old value. | |
* | |
* There is no guarantee that calls to `setState` will run synchronously, | |
* as they may eventually be batched together. You can provide an optional | |
* callback that will be executed when the call to setState is actually | |
* completed. | |
* | |
* When a function is provided to setState, it will be called at some point in | |
* the future (not synchronously). It will be called with the up to date | |
* component arguments (state, props, context). These values can be different | |
* from this.* because your function may be called after receiveProps but before | |
* shouldComponentUpdate, and this new state, props, and context will not yet be | |
* assigned to this. | |
* | |
* @param {object|function} partialState Next partial state or function to | |
* produce next partial state to be merged with current state. | |
* @param {?function} callback Called after state is updated. | |
* @final | |
* @protected | |
*/ | |
ReactComponent.prototype.setState = function (partialState, callback) { | |
!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'setState(...): takes an object of state variables to update or a function which returns an object of state variables.') : _prodInvariant('85') : void 0; | |
this.updater.enqueueSetState(this, partialState); | |
if (callback) { | |
this.updater.enqueueCallback(this, callback, 'setState'); | |
} | |
}; | |
/** | |
* Forces an update. This should only be invoked when it is known with | |
* certainty that we are **not** in a DOM transaction. | |
* | |
* You may want to call this when you know that some deeper aspect of the | |
* component's state has changed but `setState` was not called. | |
* | |
* This will not invoke `shouldComponentUpdate`, but it will invoke | |
* `componentWillUpdate` and `componentDidUpdate`. | |
* | |
* @param {?function} callback Called after update is complete. | |
* @final | |
* @protected | |
*/ | |
ReactComponent.prototype.forceUpdate = function (callback) { | |
this.updater.enqueueForceUpdate(this); | |
if (callback) { | |
this.updater.enqueueCallback(this, callback, 'forceUpdate'); | |
} | |
}; | |
/** | |
* Deprecated APIs. These APIs used to exist on classic React classes but since | |
* we would like to deprecate them, we're not going to move them over to this | |
* modern base class. Instead, we define a getter that warns if it's accessed. | |
*/ | |
if (process.env.NODE_ENV !== 'production') { | |
var deprecatedAPIs = { | |
isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'], | |
replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).'] | |
}; | |
var defineDeprecationWarning = function (methodName, info) { | |
if (canDefineProperty) { | |
Object.defineProperty(ReactComponent.prototype, methodName, { | |
get: function () { | |
process.env.NODE_ENV !== 'production' ? warning(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]) : void 0; | |
return undefined; | |
} | |
}); | |
} | |
}; | |
for (var fnName in deprecatedAPIs) { | |
if (deprecatedAPIs.hasOwnProperty(fnName)) { | |
defineDeprecationWarning(fnName, deprecatedAPIs[fnName]); | |
} | |
} | |
} | |
module.exports = ReactComponent; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 138 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) {/** | |
* 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 warning = __webpack_require__(10); | |
function warnNoop(publicInstance, callerName) { | |
if (process.env.NODE_ENV !== 'production') { | |
var constructor = publicInstance.constructor; | |
process.env.NODE_ENV !== 'production' ? warning(false, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, constructor && (constructor.displayName || constructor.name) || 'ReactClass') : void 0; | |
} | |
} | |
/** | |
* This is the abstract API for an update queue. | |
*/ | |
var ReactNoopUpdateQueue = { | |
/** | |
* Checks whether or not this composite component is mounted. | |
* @param {ReactClass} publicInstance The instance we want to test. | |
* @return {boolean} True if mounted, false otherwise. | |
* @protected | |
* @final | |
*/ | |
isMounted: function (publicInstance) { | |
return false; | |
}, | |
/** | |
* Enqueue a callback that will be executed after all the pending updates | |
* have processed. | |
* | |
* @param {ReactClass} publicInstance The instance to use as `this` context. | |
* @param {?function} callback Called after state is updated. | |
* @internal | |
*/ | |
enqueueCallback: function (publicInstance, callback) {}, | |
/** | |
* Forces an update. This should only be invoked when it is known with | |
* certainty that we are **not** in a DOM transaction. | |
* | |
* You may want to call this when you know that some deeper aspect of the | |
* component's state has changed but `setState` was not called. | |
* | |
* This will not invoke `shouldComponentUpdate`, but it will invoke | |
* `componentWillUpdate` and `componentDidUpdate`. | |
* | |
* @param {ReactClass} publicInstance The instance that should rerender. | |
* @internal | |
*/ | |
enqueueForceUpdate: function (publicInstance) { | |
warnNoop(publicInstance, 'forceUpdate'); | |
}, | |
/** | |
* Replaces all of the state. Always use this or `setState` to mutate state. | |
* You should treat `this.state` as immutable. | |
* | |
* There is no guarantee that `this.state` will be immediately updated, so | |
* accessing `this.state` after calling this method may return the old value. | |
* | |
* @param {ReactClass} publicInstance The instance that should rerender. | |
* @param {object} completeState Next state. | |
* @internal | |
*/ | |
enqueueReplaceState: function (publicInstance, completeState) { | |
warnNoop(publicInstance, 'replaceState'); | |
}, | |
/** | |
* Sets a subset of the state. This only exists because _pendingState is | |
* internal. This provides a merging strategy that is not available to deep | |
* properties which is confusing. TODO: Expose pendingState or don't use it | |
* during the merge. | |
* | |
* @param {ReactClass} publicInstance The instance that should rerender. | |
* @param {object} partialState Next partial state to be merged with state. | |
* @internal | |
*/ | |
enqueueSetState: function (publicInstance, partialState) { | |
warnNoop(publicInstance, 'setState'); | |
} | |
}; | |
module.exports = ReactNoopUpdateQueue; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 139 */ | |
/***/ (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 ReactPropTypeLocationNames = {}; | |
if (process.env.NODE_ENV !== 'production') { | |
ReactPropTypeLocationNames = { | |
prop: 'prop', | |
context: 'context', | |
childContext: 'child context' | |
}; | |
} | |
module.exports = ReactPropTypeLocationNames; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 140 */ | |
/***/ (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 canDefineProperty = false; | |
if (process.env.NODE_ENV !== 'production') { | |
try { | |
// $FlowFixMe https://github.com/facebook/flow/issues/285 | |
Object.defineProperty({}, 'x', { get: function () {} }); | |
canDefineProperty = true; | |
} catch (x) { | |
// IE will fail on defineProperty | |
} | |
} | |
module.exports = canDefineProperty; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 141 */ | |
/***/ (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. | |
* | |
* | |
*/ | |
/* global Symbol */ | |
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; | |
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. | |
/** | |
* Returns the iterator method function contained on the iterable object. | |
* | |
* Be sure to invoke the function with the iterable as context: | |
* | |
* var iteratorFn = getIteratorFn(myIterable); | |
* if (iteratorFn) { | |
* var iterator = iteratorFn.call(myIterable); | |
* ... | |
* } | |
* | |
* @param {?object} maybeIterable | |
* @return {?function} | |
*/ | |
function getIteratorFn(maybeIterable) { | |
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); | |
if (typeof iteratorFn === 'function') { | |
return iteratorFn; | |
} | |
} | |
module.exports = getIteratorFn; | |
/***/ }), | |
/* 142 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = undefined; | |
var _Avatar = __webpack_require__(353); | |
var _Avatar2 = _interopRequireDefault(_Avatar); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.default = _Avatar2.default; | |
/***/ }), | |
/* 143 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _extends2 = __webpack_require__(8); | |
var _extends3 = _interopRequireDefault(_extends2); | |
var _objectWithoutProperties2 = __webpack_require__(9); | |
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | |
var _simpleAssign = __webpack_require__(7); | |
var _simpleAssign2 = _interopRequireDefault(_simpleAssign); | |
var _react = __webpack_require__(1); | |
var _react2 = _interopRequireDefault(_react); | |
var _EnhancedButton = __webpack_require__(28); | |
var _EnhancedButton2 = _interopRequireDefault(_EnhancedButton); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
function getStyles(props, context) { | |
var selected = props.selected; | |
var bottomNavigation = context.muiTheme.bottomNavigation; | |
var color = selected ? bottomNavigation.selectedColor : bottomNavigation.unselectedColor; | |
var styles = { | |
root: { | |
transition: 'padding-top 0.3s', | |
paddingTop: selected ? 6 : 8, | |
paddingBottom: 10, | |
paddingLeft: 12, | |
paddingRight: 12, | |
minWidth: 80, | |
maxWidth: 168 | |
}, | |
label: { | |
fontSize: selected ? bottomNavigation.selectedFontSize : bottomNavigation.unselectedFontSize, | |
transition: 'color 0.3s, font-size 0.3s', | |
color: color | |
}, | |
icon: { | |
display: 'block', | |
/** | |
* Used to ensure SVG icons are centered | |
*/ | |
width: '100%' | |
}, | |
iconColor: color | |
}; | |
return styles; | |
} | |
var BottomNavigationItem = function BottomNavigationItem(props, context) { | |
var label = props.label, | |
icon = props.icon, | |
style = props.style, | |
other = (0, _objectWithoutProperties3.default)(props, ['label', 'icon', 'style']); | |
var prepareStyles = context.muiTheme.prepareStyles; | |
var styles = getStyles(props, context); | |
var styledIcon = (0, _react.cloneElement)(icon, { | |
style: (0, _simpleAssign2.default)({}, styles.icon, icon.props.style), | |
color: icon.props.color || styles.iconColor | |
}); | |
return _react2.default.createElement( | |
_EnhancedButton2.default, | |
(0, _extends3.default)({}, other, { style: (0, _simpleAssign2.default)({}, styles.root, style) }), | |
styledIcon, | |
_react2.default.createElement( | |
'div', | |
{ style: prepareStyles(styles.label) }, | |
label | |
) | |
); | |
}; | |
process.env.NODE_ENV !== "production" ? BottomNavigationItem.propTypes = { | |
/** | |
* Set the icon representing the view for this item. | |
*/ | |
icon: _react.PropTypes.node, | |
/** | |
* Set the label describing the view for this item. | |
*/ | |
label: _react.PropTypes.node, | |
/** | |
* @ignore | |
* Override the inline-styles of the root element. | |
*/ | |
style: _react.PropTypes.object | |
} : void 0; | |
BottomNavigationItem.contextTypes = { | |
muiTheme: _react.PropTypes.object.isRequired | |
}; | |
exports.default = BottomNavigationItem; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 144 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _extends2 = __webpack_require__(8); | |
var _extends3 = _interopRequireDefault(_extends2); | |
var _objectWithoutProperties2 = __webpack_require__(9); | |
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | |
var _getPrototypeOf = __webpack_require__(4); | |
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | |
var _classCallCheck2 = __webpack_require__(2); | |
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | |
var _createClass2 = __webpack_require__(3); | |
var _createClass3 = _interopRequireDefault(_createClass2); | |
var _possibleConstructorReturn2 = __webpack_require__(6); | |
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | |
var _inherits2 = __webpack_require__(5); | |
var _inherits3 = _interopRequireDefault(_inherits2); | |
var _simpleAssign = __webpack_require__(7); | |
var _simpleAssign2 = _interopRequireDefault(_simpleAssign); | |
var _react = __webpack_require__(1); | |
var _react2 = _interopRequireDefault(_react); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
function getStyles() { | |
return { | |
root: { | |
padding: 8, | |
position: 'relative' | |
}, | |
action: { | |
marginRight: 8 | |
} | |
}; | |
} | |
var CardActions = function (_Component) { | |
(0, _inherits3.default)(CardActions, _Component); | |
function CardActions() { | |
(0, _classCallCheck3.default)(this, CardActions); | |
return (0, _possibleConstructorReturn3.default)(this, (CardActions.__proto__ || (0, _getPrototypeOf2.default)(CardActions)).apply(this, arguments)); | |
} | |
(0, _createClass3.default)(CardActions, [{ | |
key: 'render', | |
value: function render() { | |
var _props = this.props, | |
actAsExpander = _props.actAsExpander, | |
children = _props.children, | |
expandable = _props.expandable, | |
style = _props.style, | |
other = (0, _objectWithoutProperties3.default)(_props, ['actAsExpander', 'children', 'expandable', 'style']); | |
var prepareStyles = this.context.muiTheme.prepareStyles; | |
var styles = getStyles(this.props, this.context); | |
var styledChildren = _react2.default.Children.map(children, function (child) { | |
if (_react2.default.isValidElement(child)) { | |
return _react2.default.cloneElement(child, { | |
style: (0, _simpleAssign2.default)({}, styles.action, child.props.style) | |
}); | |
} | |
}); | |
return _react2.default.createElement( | |
'div', | |
(0, _extends3.default)({}, other, { style: prepareStyles((0, _simpleAssign2.default)(styles.root, style)) }), | |
styledChildren | |
); | |
} | |
}]); | |
return CardActions; | |
}(_react.Component); | |
CardActions.contextTypes = { | |
muiTheme: _react.PropTypes.object.isRequired | |
}; | |
process.env.NODE_ENV !== "production" ? CardActions.propTypes = { | |
/** | |
* If true, a click on this card component expands the card. | |
*/ | |
actAsExpander: _react.PropTypes.bool, | |
/** | |
* Can be used to render elements inside the Card Action. | |
*/ | |
children: _react.PropTypes.node, | |
/** | |
* If true, this card component is expandable. | |
*/ | |
expandable: _react.PropTypes.bool, | |
/** | |
* If true, this card component will include a button to expand the card. | |
*/ | |
showExpandableButton: _react.PropTypes.bool, | |
/** | |
* Override the inline-styles of the root element. | |
*/ | |
style: _react.PropTypes.object | |
} : void 0; | |
exports.default = CardActions; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 145 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _extends2 = __webpack_require__(8); | |
var _extends3 = _interopRequireDefault(_extends2); | |
var _objectWithoutProperties2 = __webpack_require__(9); | |
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | |
var _getPrototypeOf = __webpack_require__(4); | |
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | |
var _classCallCheck2 = __webpack_require__(2); | |
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | |
var _createClass2 = __webpack_require__(3); | |
var _createClass3 = _interopRequireDefault(_createClass2); | |
var _possibleConstructorReturn2 = __webpack_require__(6); | |
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | |
var _inherits2 = __webpack_require__(5); | |
var _inherits3 = _interopRequireDefault(_inherits2); | |
var _simpleAssign = __webpack_require__(7); | |
var _simpleAssign2 = _interopRequireDefault(_simpleAssign); | |
var _react = __webpack_require__(1); | |
var _react2 = _interopRequireDefault(_react); | |
var _Avatar = __webpack_require__(142); | |
var _Avatar2 = _interopRequireDefault(_Avatar); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
function getStyles(props, context) { | |
var card = context.muiTheme.card; | |
return { | |
root: { | |
padding: 16, | |
fontWeight: card.fontWeight, | |
boxSizing: 'border-box', | |
position: 'relative', | |
whiteSpace: 'nowrap' | |
}, | |
text: { | |
display: 'inline-block', | |
verticalAlign: 'top', | |
whiteSpace: 'normal', | |
paddingRight: '90px' | |
}, | |
avatar: { | |
marginRight: 16 | |
}, | |
title: { | |
color: props.titleColor || card.titleColor, | |
display: 'block', | |
fontSize: 15 | |
}, | |
subtitle: { | |
color: props.subtitleColor || card.subtitleColor, | |
display: 'block', | |
fontSize: 14 | |
} | |
}; | |
} | |
var CardHeader = function (_Component) { | |
(0, _inherits3.default)(CardHeader, _Component); | |
function CardHeader() { | |
(0, _classCallCheck3.default)(this, CardHeader); | |
return (0, _possibleConstructorReturn3.default)(this, (CardHeader.__proto__ || (0, _getPrototypeOf2.default)(CardHeader)).apply(this, arguments)); | |
} | |
(0, _createClass3.default)(CardHeader, [{ | |
key: 'render', | |
value: function render() { | |
var _props = this.props, | |
actAsExpander = _props.actAsExpander, | |
avatarProp = _props.avatar, | |
children = _props.children, | |
closeIcon = _props.closeIcon, | |
expandable = _props.expandable, | |
openIcon = _props.openIcon, | |
showExpandableButton = _props.showExpandableButton, | |
style = _props.style, | |
subtitle = _props.subtitle, | |
subtitleColor = _props.subtitleColor, | |
subtitleStyle = _props.subtitleStyle, | |
textStyle = _props.textStyle, | |
title = _props.title, | |
titleColor = _props.titleColor, | |
titleStyle = _props.titleStyle, | |
other = (0, _objectWithoutProperties3.default)(_props, ['actAsExpander', 'avatar', 'children', 'closeIcon', 'expandable', 'openIcon', 'showExpandableButton', 'style', 'subtitle', 'subtitleColor', 'subtitleStyle', 'textStyle', 'title', 'titleColor', 'titleStyle']); | |
var prepareStyles = this.context.muiTheme.prepareStyles; | |
var styles = getStyles(this.props, this.context); | |
var avatar = avatarProp; | |
if ((0, _react.isValidElement)(avatarProp)) { | |
avatar = _react2.default.cloneElement(avatar, { | |
style: (0, _simpleAssign2.default)(styles.avatar, avatar.props.style) | |
}); | |
} else if (avatar !== null) { | |
avatar = _react2.default.createElement(_Avatar2.default, { src: avatarProp, style: styles.avatar }); | |
} | |
return _react2.default.createElement( | |
'div', | |
(0, _extends3.default)({}, other, { style: prepareStyles((0, _simpleAssign2.default)(styles.root, style)) }), | |
avatar, | |
_react2.default.createElement( | |
'div', | |
{ style: prepareStyles((0, _simpleAssign2.default)(styles.text, textStyle)) }, | |
_react2.default.createElement( | |
'span', | |
{ style: prepareStyles((0, _simpleAssign2.default)(styles.title, titleStyle)) }, | |
title | |
), | |
_react2.default.createElement( | |
'span', | |
{ style: prepareStyles((0, _simpleAssign2.default)(styles.subtitle, subtitleStyle)) }, | |
subtitle | |
) | |
), | |
children | |
); | |
} | |
}]); | |
return CardHeader; | |
}(_react.Component); | |
CardHeader.muiName = 'CardHeader'; | |
CardHeader.defaultProps = { | |
avatar: null | |
}; | |
CardHeader.contextTypes = { | |
muiTheme: _react.PropTypes.object.isRequired | |
}; | |
process.env.NODE_ENV !== "production" ? CardHeader.propTypes = { | |
/** | |
* If true, a click on this card component expands the card. | |
*/ | |
actAsExpander: _react.PropTypes.bool, | |
/** | |
* This is the [Avatar](/#/components/avatar) element to be displayed on the Card Header. | |
* If `avatar` is an `Avatar` or other element, it will be rendered. | |
* If `avatar` is a string, it will be used as the image `src` for an `Avatar`. | |
*/ | |
avatar: _react.PropTypes.node, | |
/** | |
* Can be used to render elements inside the Card Header. | |
*/ | |
children: _react.PropTypes.node, | |
/** | |
* Can be used to pass a closeIcon if you don't like the default expandable close Icon. | |
*/ | |
closeIcon: _react.PropTypes.node, | |
/** | |
* If true, this card component is expandable. | |
*/ | |
expandable: _react.PropTypes.bool, | |
/** | |
* Can be used to pass a openIcon if you don't like the default expandable open Icon. | |
*/ | |
openIcon: _react.PropTypes.node, | |
/** | |
* If true, this card component will include a button to expand the card. | |
*/ | |
showExpandableButton: _react.PropTypes.bool, | |
/** | |
* Override the inline-styles of the root element. | |
*/ | |
style: _react.PropTypes.object, | |
/** | |
* Can be used to render a subtitle in Card Header. | |
*/ | |
subtitle: _react.PropTypes.node, | |
/** | |
* Override the subtitle color. | |
*/ | |
subtitleColor: _react.PropTypes.string, | |
/** | |
* Override the inline-styles of the subtitle. | |
*/ | |
subtitleStyle: _react.PropTypes.object, | |
/** | |
* Override the inline-styles of the text. | |
*/ | |
textStyle: _react.PropTypes.object, | |
/** | |
* Can be used to render a title in Card Header. | |
*/ | |
title: _react.PropTypes.node, | |
/** | |
* Override the title color. | |
*/ | |
titleColor: _react.PropTypes.string, | |
/** | |
* Override the inline-styles of the title. | |
*/ | |
titleStyle: _react.PropTypes.object | |
} : void 0; | |
exports.default = CardHeader; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 146 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _extends2 = __webpack_require__(8); | |
var _extends3 = _interopRequireDefault(_extends2); | |
var _objectWithoutProperties2 = __webpack_require__(9); | |
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | |
var _getPrototypeOf = __webpack_require__(4); | |
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | |
var _classCallCheck2 = __webpack_require__(2); | |
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | |
var _createClass2 = __webpack_require__(3); | |
var _createClass3 = _interopRequireDefault(_createClass2); | |
var _possibleConstructorReturn2 = __webpack_require__(6); | |
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | |
var _inherits2 = __webpack_require__(5); | |
var _inherits3 = _interopRequireDefault(_inherits2); | |
var _simpleAssign = __webpack_require__(7); | |
var _simpleAssign2 = _interopRequireDefault(_simpleAssign); | |
var _react = __webpack_require__(1); | |
var _react2 = _interopRequireDefault(_react); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
function getStyles(props, context) { | |
var cardMedia = context.muiTheme.cardMedia; | |
return { | |
root: { | |
position: 'relative' | |
}, | |
overlayContainer: { | |
position: 'absolute', | |
top: 0, | |
bottom: 0, | |
right: 0, | |
left: 0 | |
}, | |
overlay: { | |
height: '100%', | |
position: 'relative' | |
}, | |
overlayContent: { | |
position: 'absolute', | |
bottom: 0, | |
right: 0, | |
left: 0, | |
paddingTop: 8, | |
background: cardMedia.overlayContentBackground | |
}, | |
media: {}, | |
mediaChild: { | |
verticalAlign: 'top', | |
maxWidth: '100%', | |
minWidth: '100%', | |
width: '100%' | |
} | |
}; | |
} | |
var CardMedia = function (_Component) { | |
(0, _inherits3.default)(CardMedia, _Component); | |
function CardMedia() { | |
(0, _classCallCheck3.default)(this, CardMedia); | |
return (0, _possibleConstructorReturn3.default)(this, (CardMedia.__proto__ || (0, _getPrototypeOf2.default)(CardMedia)).apply(this, arguments)); | |
} | |
(0, _createClass3.default)(CardMedia, [{ | |
key: 'render', | |
value: function render() { | |
var _props = this.props, | |
actAsExpander = _props.actAsExpander, | |
children = _props.children, | |
expandable = _props.expandable, | |
mediaStyle = _props.mediaStyle, | |
overlay = _props.overlay, | |
overlayContainerStyle = _props.overlayContainerStyle, | |
overlayContentStyle = _props.overlayContentStyle, | |
overlayStyle = _props.overlayStyle, | |
style = _props.style, | |
other = (0, _objectWithoutProperties3.default)(_props, ['actAsExpander', 'children', 'expandable', 'mediaStyle', 'overlay', 'overlayContainerStyle', 'overlayContentStyle', 'overlayStyle', 'style']); | |
var prepareStyles = this.context.muiTheme.prepareStyles; | |
var styles = getStyles(this.props, this.context); | |
var rootStyle = (0, _simpleAssign2.default)(styles.root, style); | |
var extendedMediaStyle = (0, _simpleAssign2.default)(styles.media, mediaStyle); | |
var extendedOverlayContainerStyle = (0, _simpleAssign2.default)(styles.overlayContainer, overlayContainerStyle); | |
var extendedOverlayContentStyle = (0, _simpleAssign2.default)(styles.overlayContent, overlayContentStyle); | |
var extendedOverlayStyle = (0, _simpleAssign2.default)(styles.overlay, overlayStyle); | |
var titleColor = this.context.muiTheme.cardMedia.titleColor; | |
var subtitleColor = this.context.muiTheme.cardMedia.subtitleColor; | |
var color = this.context.muiTheme.cardMedia.color; | |
var styledChildren = _react2.default.Children.map(children, function (child) { | |
return _react2.default.cloneElement(child, { | |
style: prepareStyles((0, _simpleAssign2.default)({}, styles.mediaChild, child.props.style)) | |
}); | |
}); | |
var overlayChildren = _react2.default.Children.map(overlay, function (child) { | |
if (child.type.muiName === 'CardHeader' || child.type.muiName === 'CardTitle') { | |
return _react2.default.cloneElement(child, { | |
titleColor: titleColor, | |
subtitleColor: subtitleColor | |
}); | |
} else if (child.type.muiName === 'CardText') { | |
return _react2.default.cloneElement(child, { | |
color: color | |
}); | |
} else { | |
return child; | |
} | |
}); | |
return _react2.default.createElement( | |
'div', | |
(0, _extends3.default)({}, other, { style: prepareStyles(rootStyle) }), | |
_react2.default.createElement( | |
'div', | |
{ style: prepareStyles(extendedMediaStyle) }, | |
styledChildren | |
), | |
overlay ? _react2.default.createElement( | |
'div', | |
{ style: prepareStyles(extendedOverlayContainerStyle) }, | |
_react2.default.createElement( | |
'div', | |
{ style: prepareStyles(extendedOverlayStyle) }, | |
_react2.default.createElement( | |
'div', | |
{ style: prepareStyles(extendedOverlayContentStyle) }, | |
overlayChildren | |
) | |
) | |
) : '' | |
); | |
} | |
}]); | |
return CardMedia; | |
}(_react.Component); | |
CardMedia.contextTypes = { | |
muiTheme: _react.PropTypes.object.isRequired | |
}; | |
process.env.NODE_ENV !== "production" ? CardMedia.propTypes = { | |
/** | |
* If true, a click on this card component expands the card. | |
*/ | |
actAsExpander: _react.PropTypes.bool, | |
/** | |
* Can be used to render elements inside the Card Media. | |
*/ | |
children: _react.PropTypes.node, | |
/** | |
* If true, this card component is expandable. | |
*/ | |
expandable: _react.PropTypes.bool, | |
/** | |
* Override the inline-styles of the Card Media. | |
*/ | |
mediaStyle: _react.PropTypes.object, | |
/** | |
* Can be used to render overlay element in Card Media. | |
*/ | |
overlay: _react.PropTypes.node, | |
/** | |
* Override the inline-styles of the overlay container. | |
*/ | |
overlayContainerStyle: _react.PropTypes.object, | |
/** | |
* Override the inline-styles of the overlay content. | |
*/ | |
overlayContentStyle: _react.PropTypes.object, | |
/** | |
* Override the inline-styles of the overlay element. | |
*/ | |
overlayStyle: _react.PropTypes.object, | |
/** | |
* Override the inline-styles of the root element. | |
*/ | |
style: _react.PropTypes.object | |
} : void 0; | |
exports.default = CardMedia; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 147 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _extends2 = __webpack_require__(8); | |
var _extends3 = _interopRequireDefault(_extends2); | |
var _objectWithoutProperties2 = __webpack_require__(9); | |
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | |
var _getPrototypeOf = __webpack_require__(4); | |
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | |
var _classCallCheck2 = __webpack_require__(2); | |
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | |
var _createClass2 = __webpack_require__(3); | |
var _createClass3 = _interopRequireDefault(_createClass2); | |
var _possibleConstructorReturn2 = __webpack_require__(6); | |
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | |
var _inherits2 = __webpack_require__(5); | |
var _inherits3 = _interopRequireDefault(_inherits2); | |
var _simpleAssign = __webpack_require__(7); | |
var _simpleAssign2 = _interopRequireDefault(_simpleAssign); | |
var _react = __webpack_require__(1); | |
var _react2 = _interopRequireDefault(_react); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
function getStyles(props, context) { | |
var cardText = context.muiTheme.cardText; | |
return { | |
root: { | |
padding: 16, | |
fontSize: 14, | |
color: props.color || cardText.textColor | |
} | |
}; | |
} | |
var CardText = function (_Component) { | |
(0, _inherits3.default)(CardText, _Component); | |
function CardText() { | |
(0, _classCallCheck3.default)(this, CardText); | |
return (0, _possibleConstructorReturn3.default)(this, (CardText.__proto__ || (0, _getPrototypeOf2.default)(CardText)).apply(this, arguments)); | |
} | |
(0, _createClass3.default)(CardText, [{ | |
key: 'render', | |
value: function render() { | |
var _props = this.props, | |
actAsExpander = _props.actAsExpander, | |
children = _props.children, | |
color = _props.color, | |
expandable = _props.expandable, | |
style = _props.style, | |
other = (0, _objectWithoutProperties3.default)(_props, ['actAsExpander', 'children', 'color', 'expandable', 'style']); | |
var prepareStyles = this.context.muiTheme.prepareStyles; | |
var styles = getStyles(this.props, this.context); | |
var rootStyle = (0, _simpleAssign2.default)(styles.root, style); | |
return _react2.default.createElement( | |
'div', | |
(0, _extends3.default)({}, other, { style: prepareStyles(rootStyle) }), | |
children | |
); | |
} | |
}]); | |
return CardText; | |
}(_react.Component); | |
CardText.muiName = 'CardText'; | |
CardText.contextTypes = { | |
muiTheme: _react.PropTypes.object.isRequired | |
}; | |
process.env.NODE_ENV !== "production" ? CardText.propTypes = { | |
/** | |
* If true, a click on this card component expands the card. | |
*/ | |
actAsExpander: _react.PropTypes.bool, | |
/** | |
* Can be used to render elements inside the Card Text. | |
*/ | |
children: _react.PropTypes.node, | |
/** | |
* Override the CardText color. | |
*/ | |
color: _react.PropTypes.string, | |
/** | |
* If true, this card component is expandable. | |
*/ | |
expandable: _react.PropTypes.bool, | |
/** | |
* Override the inline-styles of the root element. | |
*/ | |
style: _react.PropTypes.object | |
} : void 0; | |
exports.default = CardText; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 148 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _extends2 = __webpack_require__(8); | |
var _extends3 = _interopRequireDefault(_extends2); | |
var _objectWithoutProperties2 = __webpack_require__(9); | |
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | |
var _getPrototypeOf = __webpack_require__(4); | |
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | |
var _classCallCheck2 = __webpack_require__(2); | |
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | |
var _createClass2 = __webpack_require__(3); | |
var _createClass3 = _interopRequireDefault(_createClass2); | |
var _possibleConstructorReturn2 = __webpack_require__(6); | |
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | |
var _inherits2 = __webpack_require__(5); | |
var _inherits3 = _interopRequireDefault(_inherits2); | |
var _simpleAssign = __webpack_require__(7); | |
var _simpleAssign2 = _interopRequireDefault(_simpleAssign); | |
var _react = __webpack_require__(1); | |
var _react2 = _interopRequireDefault(_react); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
function getStyles(props, context) { | |
var card = context.muiTheme.card; | |
return { | |
root: { | |
padding: 16, | |
position: 'relative' | |
}, | |
title: { | |
fontSize: 24, | |
color: props.titleColor || card.titleColor, | |
display: 'block', | |
lineHeight: '36px' | |
}, | |
subtitle: { | |
fontSize: 14, | |
color: props.subtitleColor || card.subtitleColor, | |
display: 'block' | |
} | |
}; | |
} | |
var CardTitle = function (_Component) { | |
(0, _inherits3.default)(CardTitle, _Component); | |
function CardTitle() { | |
(0, _classCallCheck3.default)(this, CardTitle); | |
return (0, _possibleConstructorReturn3.default)(this, (CardTitle.__proto__ || (0, _getPrototypeOf2.default)(CardTitle)).apply(this, arguments)); | |
} | |
(0, _createClass3.default)(CardTitle, [{ | |
key: 'render', | |
value: function render() { | |
var _props = this.props, | |
actAsExpander = _props.actAsExpander, | |
children = _props.children, | |
expandable = _props.expandable, | |
showExpandableButton = _props.showExpandableButton, | |
style = _props.style, | |
subtitle = _props.subtitle, | |
subtitleColor = _props.subtitleColor, | |
subtitleStyle = _props.subtitleStyle, | |
title = _props.title, | |
titleColor = _props.titleColor, | |
titleStyle = _props.titleStyle, | |
other = (0, _objectWithoutProperties3.default)(_props, ['actAsExpander', 'children', 'expandable', 'showExpandableButton', 'style', 'subtitle', 'subtitleColor', 'subtitleStyle', 'title', 'titleColor', 'titleStyle']); | |
var prepareStyles = this.context.muiTheme.prepareStyles; | |
var styles = getStyles(this.props, this.context); | |
var rootStyle = (0, _simpleAssign2.default)({}, styles.root, style); | |
var extendedTitleStyle = (0, _simpleAssign2.default)({}, styles.title, titleStyle); | |
var extendedSubtitleStyle = (0, _simpleAssign2.default)({}, styles.subtitle, subtitleStyle); | |
return _react2.default.createElement( | |
'div', | |
(0, _extends3.default)({}, other, { style: prepareStyles(rootStyle) }), | |
_react2.default.createElement( | |
'span', | |
{ style: prepareStyles(extendedTitleStyle) }, | |
title | |
), | |
_react2.default.createElement( | |
'span', | |
{ style: prepareStyles(extendedSubtitleStyle) }, | |
subtitle | |
), | |
children | |
); | |
} | |
}]); | |
return CardTitle; | |
}(_react.Component); | |
CardTitle.muiName = 'CardTitle'; | |
CardTitle.contextTypes = { | |
muiTheme: _react.PropTypes.object.isRequired | |
}; | |
process.env.NODE_ENV !== "production" ? CardTitle.propTypes = { | |
/** | |
* If true, a click on this card component expands the card. | |
*/ | |
actAsExpander: _react.PropTypes.bool, | |
/** | |
* Can be used to render elements inside the Card Title. | |
*/ | |
children: _react.PropTypes.node, | |
/** | |
* If true, this card component is expandable. | |
*/ | |
expandable: _react.PropTypes.bool, | |
/** | |
* If true, this card component will include a button to expand the card. | |
*/ | |
showExpandableButton: _react.PropTypes.bool, | |
/** | |
* Override the inline-styles of the root element. | |
*/ | |
style: _react.PropTypes.object, | |
/** | |
* Can be used to render a subtitle in the Card Title. | |
*/ | |
subtitle: _react.PropTypes.node, | |
/** | |
* Override the subtitle color. | |
*/ | |
subtitleColor: _react.PropTypes.string, | |
/** | |
* Override the inline-styles of the subtitle. | |
*/ | |
subtitleStyle: _react.PropTypes.object, | |
/** | |
* Can be used to render a title in the Card Title. | |
*/ | |
title: _react.PropTypes.node, | |
/** | |
* Override the title color. | |
*/ | |
titleColor: _react.PropTypes.string, | |
/** | |
* Override the inline-styles of the title. | |
*/ | |
titleStyle: _react.PropTypes.object | |
} : void 0; | |
exports.default = CardTitle; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 149 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = undefined; | |
var _Divider = __webpack_require__(371); | |
var _Divider2 = _interopRequireDefault(_Divider); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.default = _Divider2.default; | |
/***/ }), | |
/* 150 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = exports.MenuItem = exports.DropDownMenu = undefined; | |
var _DropDownMenu2 = __webpack_require__(373); | |
var _DropDownMenu3 = _interopRequireDefault(_DropDownMenu2); | |
var _MenuItem2 = __webpack_require__(115); | |
var _MenuItem3 = _interopRequireDefault(_MenuItem2); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.DropDownMenu = _DropDownMenu3.default; | |
exports.MenuItem = _MenuItem3.default; | |
exports.default = _DropDownMenu3.default; | |
/***/ }), | |
/* 151 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _extends2 = __webpack_require__(8); | |
var _extends3 = _interopRequireDefault(_extends2); | |
var _objectWithoutProperties2 = __webpack_require__(9); | |
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | |
var _getPrototypeOf = __webpack_require__(4); | |
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | |
var _classCallCheck2 = __webpack_require__(2); | |
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | |
var _createClass2 = __webpack_require__(3); | |
var _createClass3 = _interopRequireDefault(_createClass2); | |
var _possibleConstructorReturn2 = __webpack_require__(6); | |
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | |
var _inherits2 = __webpack_require__(5); | |
var _inherits3 = _interopRequireDefault(_inherits2); | |
var _defineProperty2 = __webpack_require__(168); | |
var _defineProperty3 = _interopRequireDefault(_defineProperty2); | |
var _simpleAssign = __webpack_require__(7); | |
var _simpleAssign2 = _interopRequireDefault(_simpleAssign); | |
var _react = __webpack_require__(1); | |
var _react2 = _interopRequireDefault(_react); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
function getStyles(props, context) { | |
var _titleBar; | |
var _context$muiTheme = context.muiTheme, | |
baseTheme = _context$muiTheme.baseTheme, | |
gridTile = _context$muiTheme.gridTile; | |
var actionPos = props.actionIcon && props.actionPosition; | |
var styles = { | |
root: { | |
position: 'relative', | |
display: 'block', | |
height: '100%', | |
overflow: 'hidden' | |
}, | |
titleBar: (_titleBar = { | |
position: 'absolute', | |
left: 0, | |
right: 0 | |
}, (0, _defineProperty3.default)(_titleBar, props.titlePosition, 0), (0, _defineProperty3.default)(_titleBar, 'height', props.subtitle ? 68 : 48), (0, _defineProperty3.default)(_titleBar, 'background', props.titleBackground), (0, _defineProperty3.default)(_titleBar, 'display', 'flex'), (0, _defineProperty3.default)(_titleBar, 'alignItems', 'center'), _titleBar), | |
titleWrap: { | |
flexGrow: 1, | |
marginLeft: actionPos !== 'left' ? baseTheme.spacing.desktopGutterLess : 0, | |
marginRight: actionPos === 'left' ? baseTheme.spacing.desktopGutterLess : 0, | |
color: gridTile.textColor, | |
overflow: 'hidden' | |
}, | |
title: { | |
fontSize: '16px', | |
textOverflow: 'ellipsis', | |
overflow: 'hidden', | |
whiteSpace: 'nowrap' | |
}, | |
subtitle: { | |
fontSize: '12px', | |
textOverflow: 'ellipsis', | |
overflow: 'hidden', | |
whiteSpace: 'nowrap' | |
}, | |
actionIcon: { | |
order: actionPos === 'left' ? -1 : 1 | |
}, | |
childImg: { | |
height: '100%', | |
transform: 'translateX(-50%)', | |
position: 'relative', | |
left: '50%' | |
} | |
}; | |
return styles; | |
} | |
var GridTile = function (_Component) { | |
(0, _inherits3.default)(GridTile, _Component); | |
function GridTile() { | |
(0, _classCallCheck3.default)(this, GridTile); | |
return (0, _possibleConstructorReturn3.default)(this, (GridTile.__proto__ || (0, _getPrototypeOf2.default)(GridTile)).apply(this, arguments)); | |
} | |
(0, _createClass3.default)(GridTile, [{ | |
key: 'componentDidMount', | |
value: function componentDidMount() { | |
this.ensureImageCover(); | |
} | |
}, { | |
key: 'componentDidUpdate', | |
value: function componentDidUpdate() { | |
this.ensureImageCover(); | |
} | |
}, { | |
key: 'ensureImageCover', | |
value: function ensureImageCover() { | |
var _this2 = this; | |
var imgEl = this.refs.img; | |
if (imgEl) { | |
(function () { | |
var fit = function fit() { | |
if (imgEl.offsetWidth < imgEl.parentNode.offsetWidth) { | |
var isRtl = _this2.context.muiTheme.isRtl; | |
imgEl.style.height = 'auto'; | |
if (isRtl) { | |
imgEl.style.right = '0'; | |
} else { | |
imgEl.style.left = '0'; | |
} | |
imgEl.style.width = '100%'; | |
imgEl.style.top = '50%'; | |
imgEl.style.transform = imgEl.style.WebkitTransform = 'translateY(-50%)'; | |
} | |
imgEl.removeEventListener('load', fit); | |
imgEl = null; // prevent closure memory leak | |
}; | |
if (imgEl.complete) { | |
fit(); | |
} else { | |
imgEl.addEventListener('load', fit); | |
} | |
})(); | |
} | |
} | |
}, { | |
key: 'render', | |
value: function render() { | |
var _props = this.props, | |
title = _props.title, | |
subtitle = _props.subtitle, | |
titlePosition = _props.titlePosition, | |
titleBackground = _props.titleBackground, | |
titleStyle = _props.titleStyle, | |
actionIcon = _props.actionIcon, | |
actionPosition = _props.actionPosition, | |
style = _props.style, | |
children = _props.children, | |
containerElement = _props.containerElement, | |
other = (0, _objectWithoutProperties3.default)(_props, ['title', 'subtitle', 'titlePosition', 'titleBackground', 'titleStyle', 'actionIcon', 'actionPosition', 'style', 'children', 'containerElement']); | |
var prepareStyles = this.context.muiTheme.prepareStyles; | |
var styles = getStyles(this.props, this.context); | |
var mergedRootStyles = (0, _simpleAssign2.default)(styles.root, style); | |
var titleBar = null; | |
if (title) { | |
titleBar = _react2.default.createElement( | |
'div', | |
{ key: 'titlebar', style: prepareStyles(styles.titleBar) }, | |
_react2.default.createElement( | |
'div', | |
{ style: prepareStyles(styles.titleWrap) }, | |
_react2.default.createElement( | |
'div', | |
{ style: prepareStyles((0, _simpleAssign2.default)(styles.title, titleStyle)) }, | |
title | |
), | |
subtitle ? _react2.default.createElement( | |
'div', | |
{ style: prepareStyles(styles.subtitle) }, | |
subtitle | |
) : null | |
), | |
actionIcon ? _react2.default.createElement( | |
'div', | |
{ style: prepareStyles(styles.actionIcon) }, | |
actionIcon | |
) : null | |
); | |
} | |
var newChildren = children; | |
// if there is a single image passed as children | |
// clone it and add our styles | |
if (_react2.default.Children.count(children) === 1) { | |
newChildren = _react2.default.Children.map(children, function (child) { | |
if (child.type === 'img') { | |
return _react2.default.cloneElement(child, { | |
key: 'img', | |
ref: 'img', | |
style: prepareStyles((0, _simpleAssign2.default)({}, styles.childImg, child.props.style)) | |
}); | |
} else { | |
return child; | |
} | |
}); | |
} | |
var containerProps = (0, _extends3.default)({ | |
style: prepareStyles(mergedRootStyles) | |
}, other); | |
return _react2.default.isValidElement(containerElement) ? _react2.default.cloneElement(containerElement, containerProps, [newChildren, titleBar]) : _react2.default.createElement(containerElement, containerProps, [newChildren, titleBar]); | |
} | |
}]); | |
return GridTile; | |
}(_react.Component); | |
GridTile.defaultProps = { | |
titlePosition: 'bottom', | |
titleBackground: 'rgba(0, 0, 0, 0.4)', | |
actionPosition: 'right', | |
cols: 1, | |
rows: 1, | |
containerElement: 'div' | |
}; | |
GridTile.contextTypes = { | |
muiTheme: _react.PropTypes.object.isRequired | |
}; | |
process.env.NODE_ENV !== "production" ? GridTile.propTypes = { | |
/** | |
* An IconButton element to be used as secondary action target | |
* (primary action target is the tile itself). | |
*/ | |
actionIcon: _react.PropTypes.element, | |
/** | |
* Position of secondary action IconButton. | |
*/ | |
actionPosition: _react.PropTypes.oneOf(['left', 'right']), | |
/** | |
* Theoretically you can pass any node as children, but the main use case is to pass an img, | |
* in whichcase GridTile takes care of making the image "cover" available space | |
* (similar to background-size: cover or to object-fit:cover). | |
*/ | |
children: _react.PropTypes.node, | |
/** | |
* Width of the tile in number of grid cells. | |
*/ | |
cols: _react.PropTypes.number, | |
/** | |
* Either a string used as tag name for the tile root element, or a ReactElement. | |
* This is useful when you have, for example, a custom implementation of | |
* a navigation link (that knows about your routes) and you want to use it as the primary tile action. | |
* In case you pass a ReactElement, please ensure that it passes all props, | |
* accepts styles overrides and render it's children. | |
*/ | |
containerElement: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.element]), | |
/** | |
* Height of the tile in number of grid cells. | |
*/ | |
rows: _react.PropTypes.number, | |
/** | |
* Override the inline-styles of the root element. | |
*/ | |
style: _react.PropTypes.object, | |
/** | |
* String or element serving as subtitle (support text). | |
*/ | |
subtitle: _react.PropTypes.node, | |
/** | |
* Title to be displayed on tile. | |
*/ | |
title: _react.PropTypes.node, | |
/** | |
* Style used for title bar background. | |
* Useful for setting custom gradients for example | |
*/ | |
titleBackground: _react.PropTypes.string, | |
/** | |
* Position of the title bar (container of title, subtitle and action icon). | |
*/ | |
titlePosition: _react.PropTypes.oneOf(['top', 'bottom']), | |
/** | |
* Override the inline-styles of the title element. | |
*/ | |
titleStyle: _react.PropTypes.object | |
} : void 0; | |
exports.default = GridTile; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 152 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.makeSelectable = undefined; | |
var _extends2 = __webpack_require__(8); | |
var _extends3 = _interopRequireDefault(_extends2); | |
var _objectWithoutProperties2 = __webpack_require__(9); | |
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | |
var _getPrototypeOf = __webpack_require__(4); | |
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | |
var _classCallCheck2 = __webpack_require__(2); | |
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | |
var _createClass2 = __webpack_require__(3); | |
var _createClass3 = _interopRequireDefault(_createClass2); | |
var _possibleConstructorReturn2 = __webpack_require__(6); | |
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | |
var _inherits2 = __webpack_require__(5); | |
var _inherits3 = _interopRequireDefault(_inherits2); | |
var _simpleAssign = __webpack_require__(7); | |
var _simpleAssign2 = _interopRequireDefault(_simpleAssign); | |
var _react = __webpack_require__(1); | |
var _react2 = _interopRequireDefault(_react); | |
var _colorManipulator = __webpack_require__(38); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
var makeSelectable = exports.makeSelectable = function makeSelectable(MyComponent) { | |
var _class, _temp2; | |
return _temp2 = _class = function (_Component) { | |
(0, _inherits3.default)(_class, _Component); | |
function _class() { | |
var _ref; | |
var _temp, _this, _ret; | |
(0, _classCallCheck3.default)(this, _class); | |
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | |
args[_key] = arguments[_key]; | |
} | |
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = _class.__proto__ || (0, _getPrototypeOf2.default)(_class)).call.apply(_ref, [this].concat(args))), _this), _this.hasSelectedDescendant = function (previousValue, child) { | |
if (_react2.default.isValidElement(child) && child.props.nestedItems && child.props.nestedItems.length > 0) { | |
return child.props.nestedItems.reduce(_this.hasSelectedDescendant, previousValue); | |
} | |
return previousValue || _this.isChildSelected(child, _this.props); | |
}, _this.handleItemTouchTap = function (event, item) { | |
var itemValue = item.props.value; | |
if (itemValue !== _this.props.value) { | |
if (_this.props.onChange) { | |
_this.props.onChange(event, itemValue); | |
} | |
} | |
}, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); | |
} | |
(0, _createClass3.default)(_class, [{ | |
key: 'extendChild', | |
value: function extendChild(child, styles, selectedItemStyle) { | |
var _this2 = this; | |
if (child && child.type && child.type.muiName === 'ListItem') { | |
var selected = this.isChildSelected(child, this.props); | |
var selectedChildrenStyles = void 0; | |
if (selected) { | |
selectedChildrenStyles = (0, _simpleAssign2.default)({}, styles, selectedItemStyle); | |
} | |
var mergedChildrenStyles = (0, _simpleAssign2.default)({}, child.props.style, selectedChildrenStyles); | |
this.keyIndex += 1; | |
return _react2.default.cloneElement(child, { | |
onTouchTap: function onTouchTap(event) { | |
_this2.handleItemTouchTap(event, child); | |
if (child.props.onTouchTap) { | |
child.props.onTouchTap(event); | |
} | |
}, | |
key: this.keyIndex, | |
style: mergedChildrenStyles, | |
nestedItems: child.props.nestedItems.map(function (child) { | |
return _this2.extendChild(child, styles, selectedItemStyle); | |
}), | |
initiallyOpen: this.isInitiallyOpen(child) | |
}); | |
} else { | |
return child; | |
} | |
} | |
}, { | |
key: 'isInitiallyOpen', | |
value: function isInitiallyOpen(child) { | |
if (child.props.initiallyOpen) { | |
return child.props.initiallyOpen; | |
} | |
return this.hasSelectedDescendant(false, child); | |
} | |
}, { | |
key: 'isChildSelected', | |
value: function isChildSelected(child, props) { | |
return props.value === child.props.value; | |
} | |
}, { | |
key: 'render', | |
value: function render() { | |
var _this3 = this; | |
var _props = this.props, | |
children = _props.children, | |
selectedItemStyle = _props.selectedItemStyle, | |
other = (0, _objectWithoutProperties3.default)(_props, ['children', 'selectedItemStyle']); | |
this.keyIndex = 0; | |
var styles = {}; | |
if (!selectedItemStyle) { | |
var textColor = this.context.muiTheme.baseTheme.palette.textColor; | |
styles.backgroundColor = (0, _colorManipulator.fade)(textColor, 0.2); | |
} | |
return _react2.default.createElement( | |
MyComponent, | |
(0, _extends3.default)({}, other, this.state), | |
_react.Children.map(children, function (child) { | |
return _this3.extendChild(child, styles, selectedItemStyle); | |
}) | |
); | |
} | |
}]); | |
return _class; | |
}(_react.Component), _class.propTypes = { | |
children: _react.PropTypes.node, | |
onChange: _react.PropTypes.func, | |
selectedItemStyle: _react.PropTypes.object, | |
value: _react.PropTypes.any | |
}, _class.contextTypes = { | |
muiTheme: _react.PropTypes.object.isRequired | |
}, _temp2; | |
}; | |
exports.default = makeSelectable; | |
/***/ }), | |
/* 153 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = exports.MenuItem = exports.Menu = undefined; | |
var _Menu2 = __webpack_require__(80); | |
var _Menu3 = _interopRequireDefault(_Menu2); | |
var _MenuItem2 = __webpack_require__(92); | |
var _MenuItem3 = _interopRequireDefault(_MenuItem2); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.Menu = _Menu3.default; | |
exports.MenuItem = _MenuItem3.default; | |
exports.default = _Menu3.default; | |
/***/ }), | |
/* 154 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _extends2 = __webpack_require__(8); | |
var _extends3 = _interopRequireDefault(_extends2); | |
var _objectWithoutProperties2 = __webpack_require__(9); | |
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | |
var _getPrototypeOf = __webpack_require__(4); | |
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | |
var _classCallCheck2 = __webpack_require__(2); | |
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | |
var _createClass2 = __webpack_require__(3); | |
var _createClass3 = _interopRequireDefault(_createClass2); | |
var _possibleConstructorReturn2 = __webpack_require__(6); | |
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | |
var _inherits2 = __webpack_require__(5); | |
var _inherits3 = _interopRequireDefault(_inherits2); | |
var _simpleAssign = __webpack_require__(7); | |
var _simpleAssign2 = _interopRequireDefault(_simpleAssign); | |
var _react = __webpack_require__(1); | |
var _react2 = _interopRequireDefault(_react); | |
var _RadioButton = __webpack_require__(190); | |
var _RadioButton2 = _interopRequireDefault(_RadioButton); | |
var _warning = __webpack_require__(20); | |
var _warning2 = _interopRequireDefault(_warning); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
var RadioButtonGroup = function (_Component) { | |
(0, _inherits3.default)(RadioButtonGroup, _Component); | |
function RadioButtonGroup() { | |
var _ref; | |
var _temp, _this, _ret; | |
(0, _classCallCheck3.default)(this, RadioButtonGroup); | |
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | |
args[_key] = arguments[_key]; | |
} | |
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = RadioButtonGroup.__proto__ || (0, _getPrototypeOf2.default)(RadioButtonGroup)).call.apply(_ref, [this].concat(args))), _this), _this.state = { | |
numberCheckedRadioButtons: 0, | |
selected: '' | |
}, _this.handleChange = function (event, newSelection) { | |
_this.updateRadioButtons(newSelection); | |
// Successful update | |
if (_this.state.numberCheckedRadioButtons === 0) { | |
if (_this.props.onChange) _this.props.onChange(event, newSelection); | |
} | |
}, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); | |
} | |
(0, _createClass3.default)(RadioButtonGroup, [{ | |
key: 'componentWillMount', | |
value: function componentWillMount() { | |
var _this2 = this; | |
var cnt = 0; | |
var selected = ''; | |
var _props = this.props, | |
valueSelected = _props.valueSelected, | |
defaultSelected = _props.defaultSelected; | |
if (valueSelected !== undefined) { | |
selected = valueSelected; | |
} else if (defaultSelected !== undefined) { | |
selected = defaultSelected; | |
} | |
_react2.default.Children.forEach(this.props.children, function (option) { | |
if (_this2.hasCheckAttribute(option)) cnt++; | |
}, this); | |
this.setState({ | |
numberCheckedRadioButtons: cnt, | |
selected: selected | |
}); | |
} | |
}, { | |
key: 'componentWillReceiveProps', | |
value: function componentWillReceiveProps(nextProps) { | |
if (nextProps.hasOwnProperty('valueSelected')) { | |
this.setState({ | |
selected: nextProps.valueSelected | |
}); | |
} | |
} | |
}, { | |
key: 'hasCheckAttribute', | |
value: function hasCheckAttribute(radioButton) { | |
return radioButton.props.hasOwnProperty('checked') && radioButton.props.checked; | |
} | |
}, { | |
key: 'updateRadioButtons', | |
value: function updateRadioButtons(newSelection) { | |
if (this.state.numberCheckedRadioButtons === 0) { | |
this.setState({ selected: newSelection }); | |
} else { | |
process.env.NODE_ENV !== "production" ? (0, _warning2.default)(false, 'Material-UI: Cannot select a different radio button while another radio button\n has the \'checked\' property set to true.') : void 0; | |
} | |
} | |
}, { | |
key: 'getSelectedValue', | |
value: function getSelectedValue() { | |
return this.state.selected; | |
} | |
}, { | |
key: 'setSelectedValue', | |
value: function setSelectedValue(newSelectionValue) { | |
this.updateRadioButtons(newSelectionValue); | |
} | |
}, { | |
key: 'clearValue', | |
value: function clearValue() { | |
this.setSelectedValue(''); | |
} | |
}, { | |
key: 'render', | |
value: function render() { | |
var _this3 = this; | |
var prepareStyles = this.context.muiTheme.prepareStyles; | |
var options = _react2.default.Children.map(this.props.children, function (option) { | |
var _option$props = option.props, | |
name = _option$props.name, | |
value = _option$props.value, | |
label = _option$props.label, | |
onCheck = _option$props.onCheck, | |
other = (0, _objectWithoutProperties3.default)(_option$props, ['name', 'value', 'label', 'onCheck']); | |
return _react2.default.createElement(_RadioButton2.default, (0, _extends3.default)({}, other, { | |
ref: option.props.value, | |
name: _this3.props.name, | |
key: option.props.value, | |
value: option.props.value, | |
label: option.props.label, | |
labelPosition: _this3.props.labelPosition, | |
onCheck: _this3.handleChange, | |
checked: option.props.value === _this3.state.selected | |
})); | |
}, this); | |
return _react2.default.createElement( | |
'div', | |
{ | |
style: prepareStyles((0, _simpleAssign2.default)({}, this.props.style)), | |
className: this.props.className | |
}, | |
options | |
); | |
} | |
}]); | |
return RadioButtonGroup; | |
}(_react.Component); | |
RadioButtonGroup.defaultProps = { | |
style: {} | |
}; | |
RadioButtonGroup.contextTypes = { | |
muiTheme: _react.PropTypes.object.isRequired | |
}; | |
process.env.NODE_ENV !== "production" ? RadioButtonGroup.propTypes = { | |
/** | |
* Should be used to pass `RadioButton` components. | |
*/ | |
children: _react.PropTypes.node, | |
/** | |
* The CSS class name of the root element. | |
*/ | |
className: _react.PropTypes.string, | |
/** | |
* The `value` property of the radio button that will be | |
* selected by default. This takes precedence over the `checked` property | |
* of the `RadioButton` elements. | |
*/ | |
defaultSelected: _react.PropTypes.any, | |
/** | |
* Where the label will be placed for all child radio buttons. | |
* This takes precedence over the `labelPosition` property of the | |
* `RadioButton` elements. | |
*/ | |
labelPosition: _react.PropTypes.oneOf(['left', 'right']), | |
/** | |
* The name that will be applied to all child radio buttons. | |
*/ | |
name: _react.PropTypes.string.isRequired, | |
/** | |
* Callback function that is fired when a radio button has | |
* been checked. | |
* | |
* @param {object} event `change` event targeting the selected | |
* radio button. | |
* @param {*} value The `value` of the selected radio button. | |
*/ | |
onChange: _react.PropTypes.func, | |
/** | |
* Override the inline-styles of the root element. | |
*/ | |
style: _react.PropTypes.object, | |
/** | |
* The `value` of the currently selected radio button. | |
*/ | |
valueSelected: _react.PropTypes.any | |
} : void 0; | |
exports.default = RadioButtonGroup; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 155 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _extends2 = __webpack_require__(8); | |
var _extends3 = _interopRequireDefault(_extends2); | |
var _objectWithoutProperties2 = __webpack_require__(9); | |
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | |
var _typeof2 = __webpack_require__(42); | |
var _typeof3 = _interopRequireDefault(_typeof2); | |
var _simpleAssign = __webpack_require__(7); | |
var _simpleAssign2 = _interopRequireDefault(_simpleAssign); | |
var _react = __webpack_require__(1); | |
var _react2 = _interopRequireDefault(_react); | |
var _checkCircle = __webpack_require__(426); | |
var _checkCircle2 = _interopRequireDefault(_checkCircle); | |
var _SvgIcon = __webpack_require__(17); | |
var _SvgIcon2 = _interopRequireDefault(_SvgIcon); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
var getStyles = function getStyles(_ref, _ref2) { | |
var active = _ref.active, | |
completed = _ref.completed, | |
disabled = _ref.disabled; | |
var muiTheme = _ref2.muiTheme, | |
stepper = _ref2.stepper; | |
var _muiTheme$stepper = muiTheme.stepper, | |
textColor = _muiTheme$stepper.textColor, | |
disabledTextColor = _muiTheme$stepper.disabledTextColor, | |
iconColor = _muiTheme$stepper.iconColor, | |
inactiveIconColor = _muiTheme$stepper.inactiveIconColor; | |
var baseTheme = muiTheme.baseTheme; | |
var orientation = stepper.orientation; | |
var styles = { | |
root: { | |
height: orientation === 'horizontal' ? 72 : 64, | |
color: textColor, | |
display: 'flex', | |
alignItems: 'center', | |
fontFamily: baseTheme.fontFamily, | |
fontSize: 14, | |
paddingLeft: 14, | |
paddingRight: 14 | |
}, | |
icon: { | |
color: iconColor, | |
display: 'block', | |
fontSize: 24, | |
width: 24, | |
height: 24 | |
}, | |
iconContainer: { | |
paddingRight: 8 | |
} | |
}; | |
if (active) { | |
styles.root.fontWeight = 500; | |
} | |
if (!completed && !active) { | |
styles.icon.color = inactiveIconColor; | |
} | |
if (disabled) { | |
styles.icon.color = inactiveIconColor; | |
styles.root.color = disabledTextColor; | |
styles.root.cursor = 'not-allowed'; | |
} | |
return styles; | |
}; | |
var renderIcon = function renderIcon(completed, icon, styles) { | |
var iconType = typeof icon === 'undefined' ? 'undefined' : (0, _typeof3.default)(icon); | |
if (iconType === 'number' || iconType === 'string') { | |
if (completed) { | |
return _react2.default.createElement(_checkCircle2.default, { | |
color: styles.icon.color, | |
style: styles.icon | |
}); | |
} | |
return _react2.default.createElement( | |
_SvgIcon2.default, | |
{ color: styles.icon.color, style: styles.icon }, | |
_react2.default.createElement('circle', { cx: '12', cy: '12', r: '10' }), | |
_react2.default.createElement( | |
'text', | |
{ | |
x: '12', | |
y: '16', | |
textAnchor: 'middle', | |
fontSize: '12', | |
fill: '#fff' | |
}, | |
icon | |
) | |
); | |
} | |
return icon; | |
}; | |
var StepLabel = function StepLabel(props, context) { | |
var active = props.active, | |
children = props.children, | |
completed = props.completed, | |
userIcon = props.icon, | |
iconContainerStyle = props.iconContainerStyle, | |
last = props.last, | |
style = props.style, | |
other = (0, _objectWithoutProperties3.default)(props, ['active', 'children', 'completed', 'icon', 'iconContainerStyle', 'last', 'style']); | |
var prepareStyles = context.muiTheme.prepareStyles; | |
var styles = getStyles(props, context); | |
var icon = renderIcon(completed, userIcon, styles); | |
return _react2.default.createElement( | |
'span', | |
(0, _extends3.default)({ style: prepareStyles((0, _simpleAssign2.default)(styles.root, style)) }, other), | |
icon && _react2.default.createElement( | |
'span', | |
{ style: prepareStyles((0, _simpleAssign2.default)(styles.iconContainer, iconContainerStyle)) }, | |
icon | |
), | |
children | |
); | |
}; | |
StepLabel.muiName = 'StepLabel'; | |
process.env.NODE_ENV !== "production" ? StepLabel.propTypes = { | |
/** | |
* Sets active styling. Overrides disabled coloring. | |
*/ | |
active: _react.PropTypes.bool, | |
/** | |
* The label text node | |
*/ | |
children: _react.PropTypes.node, | |
/** | |
* Sets completed styling. Overrides disabled coloring. | |
*/ | |
completed: _react.PropTypes.bool, | |
/** | |
* Sets disabled styling. | |
*/ | |
disabled: _react.PropTypes.bool, | |
/** | |
* The icon displayed by the step label. | |
*/ | |
icon: _react.PropTypes.oneOfType([_react.PropTypes.element, _react.PropTypes.string, _react.PropTypes.number]), | |
/** | |
* Override the inline-styles of the icon container element. | |
*/ | |
iconContainerStyle: _react.PropTypes.object, | |
/** | |
* @ignore | |
*/ | |
last: _react.PropTypes.bool, | |
/** | |
* Override the inline-style of the root element. | |
*/ | |
style: _react.PropTypes.object | |
} : void 0; | |
StepLabel.contextTypes = { | |
muiTheme: _react.PropTypes.object.isRequired, | |
stepper: _react.PropTypes.object | |
}; | |
exports.default = StepLabel; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 156 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = undefined; | |
var _Subheader = __webpack_require__(393); | |
var _Subheader2 = _interopRequireDefault(_Subheader); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.default = _Subheader2.default; | |
/***/ }), | |
/* 157 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _getIterator2 = __webpack_require__(166); | |
var _getIterator3 = _interopRequireDefault(_getIterator2); | |
var _toConsumableArray2 = __webpack_require__(61); | |
var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2); | |
var _typeof2 = __webpack_require__(42); | |
var _typeof3 = _interopRequireDefault(_typeof2); | |
var _extends2 = __webpack_require__(8); | |
var _extends3 = _interopRequireDefault(_extends2); | |
var _getPrototypeOf = __webpack_require__(4); | |
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | |
var _classCallCheck2 = __webpack_require__(2); | |
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | |
var _createClass2 = __webpack_require__(3); | |
var _createClass3 = _interopRequireDefault(_createClass2); | |
var _possibleConstructorReturn2 = __webpack_require__(6); | |
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | |
var _inherits2 = __webpack_require__(5); | |
var _inherits3 = _interopRequireDefault(_inherits2); | |
var _simpleAssign = __webpack_require__(7); | |
var _simpleAssign2 = _interopRequireDefault(_simpleAssign); | |
var _react = __webpack_require__(1); | |
var _react2 = _interopRequireDefault(_react); | |
var _Checkbox = __webpack_require__(88); | |
var _Checkbox2 = _interopRequireDefault(_Checkbox); | |
var _TableRowColumn = __webpack_require__(75); | |
var _TableRowColumn2 = _interopRequireDefault(_TableRowColumn); | |
var _ClickAwayListener = __webpack_require__(117); | |
var _ClickAwayListener2 = _interopRequireDefault(_ClickAwayListener); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
var TableBody = function (_Component) { | |
(0, _inherits3.default)(TableBody, _Component); | |
function TableBody() { | |
var _ref; | |
var _temp, _this, _ret; | |
(0, _classCallCheck3.default)(this, TableBody); | |
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | |
args[_key] = arguments[_key]; | |
} | |
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = TableBody.__proto__ || (0, _getPrototypeOf2.default)(TableBody)).call.apply(_ref, [this].concat(args))), _this), _this.state = { | |
selectedRows: [] | |
}, _this.handleClickAway = function () { | |
if (_this.props.deselectOnClickaway && _this.state.selectedRows.length) { | |
_this.setState({ | |
selectedRows: [] | |
}); | |
if (_this.props.onRowSelection) { | |
_this.props.onRowSelection([]); | |
} | |
} | |
}, _this.onRowClick = function (event, rowNumber) { | |
event.stopPropagation(); | |
if (_this.props.selectable) { | |
// Prevent text selection while selecting rows. | |
window.getSelection().removeAllRanges(); | |
_this.processRowSelection(event, rowNumber); | |
} | |
}, _this.onCellClick = function (event, rowNumber, columnNumber) { | |
event.stopPropagation(); | |
if (_this.props.onCellClick) { | |
_this.props.onCellClick(rowNumber, _this.getColumnId(columnNumber), event); | |
} | |
}, _this.onCellHover = function (event, rowNumber, columnNumber) { | |
if (_this.props.onCellHover) { | |
_this.props.onCellHover(rowNumber, _this.getColumnId(columnNumber), event); | |
} | |
_this.onRowHover(event, rowNumber); | |
}, _this.onCellHoverExit = function (event, rowNumber, columnNumber) { | |
if (_this.props.onCellHoverExit) { | |
_this.props.onCellHoverExit(rowNumber, _this.getColumnId(columnNumber), event); | |
} | |
_this.onRowHoverExit(event, rowNumber); | |
}, _this.onRowHover = function (event, rowNumber) { | |
if (_this.props.onRowHover) { | |
_this.props.onRowHover(rowNumber); | |
} | |
}, _this.onRowHoverExit = function (event, rowNumber) { | |
if (_this.props.onRowHoverExit) { | |
_this.props.onRowHoverExit(rowNumber); | |
} | |
}, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); | |
} | |
(0, _createClass3.default)(TableBody, [{ | |
key: 'componentWillMount', | |
value: function componentWillMount() { | |
this.setState({ selectedRows: this.calculatePreselectedRows(this.props) }); | |
} | |
}, { | |
key: 'componentWillReceiveProps', | |
value: function componentWillReceiveProps(nextProps) { | |
if (this.props.allRowsSelected !== nextProps.allRowsSelected) { | |
if (!nextProps.allRowsSelected) { | |
this.setState({ | |
selectedRows: [] | |
}); | |
} else { | |
this.setState({ | |
selectedRows: this.calculatePreselectedRows(nextProps) | |
}); | |
} | |
} | |
} | |
}, { | |
key: 'createRows', | |
value: function createRows() { | |
var _this2 = this; | |
var numChildren = _react2.default.Children.count(this.props.children); | |
var rowNumber = 0; | |
var handlers = { | |
onCellClick: this.onCellClick, | |
onCellHover: this.onCellHover, | |
onCellHoverExit: this.onCellHoverExit, | |
onRowHover: this.onRowHover, | |
onRowHoverExit: this.onRowHoverExit, | |
onRowClick: this.onRowClick | |
}; | |
return _react2.default.Children.map(this.props.children, function (child) { | |
if (_react2.default.isValidElement(child)) { | |
var _ret2 = function () { | |
var props = { | |
hoverable: _this2.props.showRowHover, | |
selected: _this2.isRowSelected(rowNumber), | |
striped: _this2.props.stripedRows && rowNumber % 2 === 0, | |
rowNumber: rowNumber++ | |
}; | |
if (rowNumber === numChildren) { | |
props.displayBorder = false; | |
} | |
var children = [_this2.createRowCheckboxColumn(props)]; | |
_react2.default.Children.forEach(child.props.children, function (child) { | |
children.push(child); | |
}); | |
return { | |
v: _react2.default.cloneElement(child, (0, _extends3.default)({}, props, handlers), children) | |
}; | |
}(); | |
if ((typeof _ret2 === 'undefined' ? 'undefined' : (0, _typeof3.default)(_ret2)) === "object") return _ret2.v; | |
} | |
}); | |
} | |
}, { | |
key: 'createRowCheckboxColumn', | |
value: function createRowCheckboxColumn(rowProps) { | |
if (!this.props.displayRowCheckbox) { | |
return null; | |
} | |
var key = rowProps.rowNumber + '-cb'; | |
var disabled = !this.props.selectable; | |
var checkbox = _react2.default.createElement(_Checkbox2.default, { | |
ref: 'rowSelectCB', | |
name: key, | |
value: 'selected', | |
disabled: disabled, | |
checked: rowProps.selected | |
}); | |
return _react2.default.createElement( | |
_TableRowColumn2.default, | |
{ | |
key: key, | |
columnNumber: 0, | |
style: { | |
width: 24, | |
cursor: disabled ? 'not-allowed' : 'inherit' | |
} | |
}, | |
checkbox | |
); | |
} | |
}, { | |
key: 'calculatePreselectedRows', | |
value: function calculatePreselectedRows(props) { | |
// Determine what rows are 'pre-selected'. | |
var preSelectedRows = []; | |
if (props.selectable && props.preScanRows) { | |
(function () { | |
var index = 0; | |
_react2.default.Children.forEach(props.children, function (child) { | |
if (_react2.default.isValidElement(child)) { | |
if (child.props.selected && (preSelectedRows.length === 0 || props.multiSelectable)) { | |
preSelectedRows.push(index); | |
} | |
index++; | |
} | |
}); | |
})(); | |
} | |
return preSelectedRows; | |
} | |
}, { | |
key: 'isRowSelected', | |
value: function isRowSelected(rowNumber) { | |
if (this.props.allRowsSelected) { | |
return true; | |
} | |
for (var i = 0; i < this.state.selectedRows.length; i++) { | |
var selection = this.state.selectedRows[i]; | |
if ((typeof selection === 'undefined' ? 'undefined' : (0, _typeof3.default)(selection)) === 'object') { | |
if (this.isValueInRange(rowNumber, selection)) return true; | |
} else { | |
if (selection === rowNumber) return true; | |
} | |
} | |
return false; | |
} | |
}, { | |
key: 'isValueInRange', | |
value: function isValueInRange(value, range) { | |
if (!range) return false; | |
if (range.start <= value && value <= range.end || range.end <= value && value <= range.start) { | |
return true; | |
} | |
return false; | |
} | |
}, { | |
key: 'processRowSelection', | |
value: function processRowSelection(event, rowNumber) { | |
var selectedRows = this.state.selectedRows; | |
if (event.shiftKey && this.props.multiSelectable && selectedRows.length) { | |
var lastIndex = selectedRows.length - 1; | |
var lastSelection = selectedRows[lastIndex]; | |
if ((typeof lastSelection === 'undefined' ? 'undefined' : (0, _typeof3.default)(lastSelection)) === 'object') { | |
lastSelection.end = rowNumber; | |
} else { | |
selectedRows.splice(lastIndex, 1, { start: lastSelection, end: rowNumber }); | |
} | |
} else if ((event.ctrlKey && !event.metaKey || event.metaKey && !event.ctrlKey) && this.props.multiSelectable) { | |
var idx = selectedRows.indexOf(rowNumber); | |
if (idx < 0) { | |
var foundRange = false; | |
for (var i = 0; i < selectedRows.length; i++) { | |
var range = selectedRows[i]; | |
if ((typeof range === 'undefined' ? 'undefined' : (0, _typeof3.default)(range)) !== 'object') continue; | |
if (this.isValueInRange(rowNumber, range)) { | |
var _selectedRows; | |
foundRange = true; | |
var values = this.splitRange(range, rowNumber); | |
(_selectedRows = selectedRows).splice.apply(_selectedRows, [i, 1].concat((0, _toConsumableArray3.default)(values))); | |
} | |
} | |
if (!foundRange) selectedRows.push(rowNumber); | |
} else { | |
selectedRows.splice(idx, 1); | |
} | |
} else { | |
if (selectedRows.length === 1 && selectedRows[0] === rowNumber) { | |
selectedRows = []; | |
} else { | |
selectedRows = [rowNumber]; | |
} | |
} | |
this.setState({ selectedRows: selectedRows }); | |
if (this.props.onRowSelection) this.props.onRowSelection(this.flattenRanges(selectedRows)); | |
} | |
}, { | |
key: 'splitRange', | |
value: function splitRange(range, splitPoint) { | |
var splitValues = []; | |
var startOffset = range.start - splitPoint; | |
var endOffset = range.end - splitPoint; | |
// Process start half | |
splitValues.push.apply(splitValues, (0, _toConsumableArray3.default)(this.genRangeOfValues(splitPoint, startOffset))); | |
// Process end half | |
splitValues.push.apply(splitValues, (0, _toConsumableArray3.default)(this.genRangeOfValues(splitPoint, endOffset))); | |
return splitValues; | |
} | |
}, { | |
key: 'genRangeOfValues', | |
value: function genRangeOfValues(start, offset) { | |
var values = []; | |
var dir = offset > 0 ? -1 : 1; // This forces offset to approach 0 from either direction. | |
while (offset !== 0) { | |
values.push(start + offset); | |
offset += dir; | |
} | |
return values; | |
} | |
}, { | |
key: 'flattenRanges', | |
value: function flattenRanges(selectedRows) { | |
var rows = []; | |
var _iteratorNormalCompletion = true; | |
var _didIteratorError = false; | |
var _iteratorError = undefined; | |
try { | |
for (var _iterator = (0, _getIterator3.default)(selectedRows), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { | |
var selection = _step.value; | |
if ((typeof selection === 'undefined' ? 'undefined' : (0, _typeof3.default)(selection)) === 'object') { | |
var values = this.genRangeOfValues(selection.end, selection.start - selection.end); | |
rows.push.apply(rows, [selection.end].concat((0, _toConsumableArray3.default)(values))); | |
} else { | |
rows.push(selection); | |
} | |
} | |
} catch (err) { | |
_didIteratorError = true; | |
_iteratorError = err; | |
} finally { | |
try { | |
if (!_iteratorNormalCompletion && _iterator.return) { | |
_iterator.return(); | |
} | |
} finally { | |
if (_didIteratorError) { | |
throw _iteratorError; | |
} | |
} | |
} | |
return rows.sort(); | |
} | |
}, { | |
key: 'getColumnId', | |
value: function getColumnId(columnNumber) { | |
var columnId = columnNumber; | |
if (this.props.displayRowCheckbox) { | |
columnId--; | |
} | |
return columnId; | |
} | |
}, { | |
key: 'render', | |
value: function render() { | |
var _props = this.props, | |
className = _props.className, | |
style = _props.style; | |
var prepareStyles = this.context.muiTheme.prepareStyles; | |
return _react2.default.createElement( | |
_ClickAwayListener2.default, | |
{ onClickAway: this.handleClickAway }, | |
_react2.default.createElement( | |
'tbody', | |
{ className: className, style: prepareStyles((0, _simpleAssign2.default)({}, style)) }, | |
this.createRows() | |
) | |
); | |
} | |
}]); | |
return TableBody; | |
}(_react.Component); | |
TableBody.muiName = 'TableBody'; | |
TableBody.defaultProps = { | |
allRowsSelected: false, | |
deselectOnClickaway: true, | |
displayRowCheckbox: true, | |
multiSelectable: false, | |
preScanRows: true, | |
selectable: true, | |
style: {} | |
}; | |
TableBody.contextTypes = { | |
muiTheme: _react.PropTypes.object.isRequired | |
}; | |
process.env.NODE_ENV !== "production" ? TableBody.propTypes = { | |
/** | |
* @ignore | |
* Set to true to indicate that all rows should be selected. | |
*/ | |
allRowsSelected: _react.PropTypes.bool, | |
/** | |
* Children passed to table body. | |
*/ | |
children: _react.PropTypes.node, | |
/** | |
* The css class name of the root element. | |
*/ | |
className: _react.PropTypes.string, | |
/** | |
* Controls whether or not to deselect all selected | |
* rows after clicking outside the table. | |
*/ | |
deselectOnClickaway: _react.PropTypes.bool, | |
/** | |
* Controls the display of the row checkbox. The default value is true. | |
*/ | |
displayRowCheckbox: _react.PropTypes.bool, | |
/** | |
* @ignore | |
* If true, multiple table rows can be selected. | |
* CTRL/CMD+Click and SHIFT+Click are valid actions. | |
* The default value is false. | |
*/ | |
multiSelectable: _react.PropTypes.bool, | |
/** | |
* @ignore | |
* Callback function for when a cell is clicked. | |
*/ | |
onCellClick: _react.PropTypes.func, | |
/** | |
* @ignore | |
* Called when a table cell is hovered. rowNumber | |
* is the row number of the hovered row and columnId | |
* is the column number or the column key of the cell. | |
*/ | |
onCellHover: _react.PropTypes.func, | |
/** | |
* @ignore | |
* Called when a table cell is no longer hovered. | |
* rowNumber is the row number of the row and columnId | |
* is the column number or the column key of the cell. | |
*/ | |
onCellHoverExit: _react.PropTypes.func, | |
/** | |
* @ignore | |
* Called when a table row is hovered. | |
* rowNumber is the row number of the hovered row. | |
*/ | |
onRowHover: _react.PropTypes.func, | |
/** | |
* @ignore | |
* Called when a table row is no longer | |
* hovered. rowNumber is the row number of the row | |
* that is no longer hovered. | |
*/ | |
onRowHoverExit: _react.PropTypes.func, | |
/** | |
* @ignore | |
* Called when a row is selected. selectedRows is an | |
* array of all row selections. IF all rows have been selected, | |
* the string "all" will be returned instead to indicate that | |
* all rows have been selected. | |
*/ | |
onRowSelection: _react.PropTypes.func, | |
/** | |
* Controls whether or not the rows are pre-scanned to determine | |
* initial state. If your table has a large number of rows and | |
* you are experiencing a delay in rendering, turn off this property. | |
*/ | |
preScanRows: _react.PropTypes.bool, | |
/** | |
* @ignore | |
* If true, table rows can be selected. If multiple | |
* row selection is desired, enable multiSelectable. | |
* The default value is true. | |
*/ | |
selectable: _react.PropTypes.bool, | |
/** | |
* If true, table rows will be highlighted when | |
* the cursor is hovering over the row. The default | |
* value is false. | |
*/ | |
showRowHover: _react.PropTypes.bool, | |
/** | |
* If true, every other table row starting | |
* with the first row will be striped. The default value is false. | |
*/ | |
stripedRows: _react.PropTypes.bool, | |
/** | |
* Override the inline-styles of the root element. | |
*/ | |
style: _react.PropTypes.object | |
} : void 0; | |
exports.default = TableBody; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 158 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _extends2 = __webpack_require__(8); | |
var _extends3 = _interopRequireDefault(_extends2); | |
var _toConsumableArray2 = __webpack_require__(61); | |
var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2); | |
var _objectWithoutProperties2 = __webpack_require__(9); | |
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | |
var _getPrototypeOf = __webpack_require__(4); | |
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | |
var _classCallCheck2 = __webpack_require__(2); | |
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | |
var _createClass2 = __webpack_require__(3); | |
var _createClass3 = _interopRequireDefault(_createClass2); | |
var _possibleConstructorReturn2 = __webpack_require__(6); | |
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | |
var _inherits2 = __webpack_require__(5); | |
var _inherits3 = _interopRequireDefault(_inherits2); | |
var _simpleAssign = __webpack_require__(7); | |
var _simpleAssign2 = _interopRequireDefault(_simpleAssign); | |
var _react = __webpack_require__(1); | |
var _react2 = _interopRequireDefault(_react); | |
var _TableRowColumn = __webpack_require__(75); | |
var _TableRowColumn2 = _interopRequireDefault(_TableRowColumn); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
function getStyles(props, context) { | |
var tableFooter = context.muiTheme.tableFooter; | |
return { | |
cell: { | |
borderTop: '1px solid ' + tableFooter.borderColor, | |
verticalAlign: 'bottom', | |
padding: 20, | |
textAlign: 'left', | |
whiteSpace: 'nowrap' | |
} | |
}; | |
} | |
var TableFooter = function (_Component) { | |
(0, _inherits3.default)(TableFooter, _Component); | |
function TableFooter() { | |
(0, _classCallCheck3.default)(this, TableFooter); | |
return (0, _possibleConstructorReturn3.default)(this, (TableFooter.__proto__ || (0, _getPrototypeOf2.default)(TableFooter)).apply(this, arguments)); | |
} | |
(0, _createClass3.default)(TableFooter, [{ | |
key: 'render', | |
value: function render() { | |
var _props = this.props, | |
adjustForCheckbox = _props.adjustForCheckbox, | |
children = _props.children, | |
className = _props.className, | |
style = _props.style, | |
other = (0, _objectWithoutProperties3.default)(_props, ['adjustForCheckbox', 'children', 'className', 'style']); | |
var prepareStyles = this.context.muiTheme.prepareStyles; | |
var styles = getStyles(this.props, this.context); | |
var footerRows = _react2.default.Children.map(children, function (child, rowNumber) { | |
var newChildProps = { | |
displayBorder: false, | |
key: 'f-' + rowNumber, | |
rowNumber: rowNumber, | |
style: (0, _simpleAssign2.default)({}, styles.cell, child.props.style) | |
}; | |
var newDescendants = void 0; | |
if (adjustForCheckbox) { | |
newDescendants = [_react2.default.createElement(_TableRowColumn2.default, { key: 'fpcb' + rowNumber, style: { width: 24 } })].concat((0, _toConsumableArray3.default)(_react2.default.Children.toArray(child.props.children))); | |
} else { | |
newDescendants = child.props.children; | |
} | |
return _react2.default.cloneElement(child, newChildProps, newDescendants); | |
}); | |
return _react2.default.createElement( | |
'tfoot', | |
(0, _extends3.default)({ className: className, style: prepareStyles((0, _simpleAssign2.default)({}, style)) }, other), | |
footerRows | |
); | |
} | |
}]); | |
return TableFooter; | |
}(_react.Component); | |
TableFooter.muiName = 'TableFooter'; | |
TableFooter.defaultProps = { | |
adjustForCheckbox: true, | |
style: {} | |
}; | |
TableFooter.contextTypes = { | |
muiTheme: _react.PropTypes.object.isRequired | |
}; | |
process.env.NODE_ENV !== "production" ? TableFooter.propTypes = { | |
/** | |
* @ignore | |
* Controls whether or not header rows should be adjusted | |
* for a checkbox column. If the select all checkbox is true, | |
* this property will not influence the number of columns. | |
* This is mainly useful for "super header" rows so that | |
* the checkbox column does not create an offset that needs | |
* to be accounted for manually. | |
*/ | |
adjustForCheckbox: _react.PropTypes.bool, | |
/** | |
* Children passed to table footer. | |
*/ | |
children: _react.PropTypes.node, | |
/** | |
* The css class name of the root element. | |
*/ | |
className: _react.PropTypes.string, | |
/** | |
* Override the inline-styles of the root element. | |
*/ | |
style: _react.PropTypes.object | |
} : void 0; | |
exports.default = TableFooter; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 159 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _getPrototypeOf = __webpack_require__(4); | |
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | |
var _classCallCheck2 = __webpack_require__(2); | |
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | |
var _createClass2 = __webpack_require__(3); | |
var _createClass3 = _interopRequireDefault(_createClass2); | |
var _possibleConstructorReturn2 = __webpack_require__(6); | |
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | |
var _inherits2 = __webpack_require__(5); | |
var _inherits3 = _interopRequireDefault(_inherits2); | |
var _simpleAssign = __webpack_require__(7); | |
var _simpleAssign2 = _interopRequireDefault(_simpleAssign); | |
var _react = __webpack_require__(1); | |
var _react2 = _interopRequireDefault(_react); | |
var _Checkbox = __webpack_require__(88); | |
var _Checkbox2 = _interopRequireDefault(_Checkbox); | |
var _TableHeaderColumn = __webpack_require__(93); | |
var _TableHeaderColumn2 = _interopRequireDefault(_TableHeaderColumn); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
function getStyles(props, context) { | |
var tableHeader = context.muiTheme.tableHeader; | |
return { | |
root: { | |
borderBottom: '1px solid ' + tableHeader.borderColor | |
} | |
}; | |
} | |
var TableHeader = function (_Component) { | |
(0, _inherits3.default)(TableHeader, _Component); | |
function TableHeader() { | |
var _ref; | |
var _temp, _this, _ret; | |
(0, _classCallCheck3.default)(this, TableHeader); | |
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | |
args[_key] = arguments[_key]; | |
} | |
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = TableHeader.__proto__ || (0, _getPrototypeOf2.default)(TableHeader)).call.apply(_ref, [this].concat(args))), _this), _this.handleCheckAll = function (event, checked) { | |
if (_this.props.onSelectAll) { | |
_this.props.onSelectAll(checked); | |
} | |
}, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); | |
} | |
(0, _createClass3.default)(TableHeader, [{ | |
key: 'createSuperHeaderRows', | |
value: function createSuperHeaderRows() { | |
var numChildren = _react2.default.Children.count(this.props.children); | |
if (numChildren === 1) return undefined; | |
var superHeaders = []; | |
for (var index = 0; index < numChildren - 1; index++) { | |
var child = this.props.children[index]; | |
if (!_react2.default.isValidElement(child)) continue; | |
var props = { | |
key: 'sh' + index, | |
rowNumber: index | |
}; | |
superHeaders.push(this.createSuperHeaderRow(child, props)); | |
} | |
if (superHeaders.length) return superHeaders; | |
} | |
}, { | |
key: 'createSuperHeaderRow', | |
value: function createSuperHeaderRow(child, props) { | |
var children = []; | |
if (this.props.adjustForCheckbox) { | |
children.push(this.getCheckboxPlaceholder(props)); | |
} | |
_react2.default.Children.forEach(child.props.children, function (child) { | |
children.push(child); | |
}); | |
return _react2.default.cloneElement(child, props, children); | |
} | |
}, { | |
key: 'createBaseHeaderRow', | |
value: function createBaseHeaderRow() { | |
var numChildren = _react2.default.Children.count(this.props.children); | |
var child = numChildren === 1 ? this.props.children : this.props.children[numChildren - 1]; | |
var props = { | |
key: 'h' + numChildren, | |
rowNumber: numChildren | |
}; | |
var children = [this.getSelectAllCheckboxColumn(props)]; | |
_react2.default.Children.forEach(child.props.children, function (child) { | |
children.push(child); | |
}); | |
return _react2.default.cloneElement(child, props, children); | |
} | |
}, { | |
key: 'getCheckboxPlaceholder', | |
value: function getCheckboxPlaceholder(props) { | |
if (!this.props.adjustForCheckbox) return null; | |
var disabled = !this.props.enableSelectAll; | |
var key = 'hpcb' + props.rowNumber; | |
return _react2.default.createElement(_TableHeaderColumn2.default, { | |
key: key, | |
style: { | |
width: 24, | |
cursor: disabled ? 'not-allowed' : 'inherit' | |
} | |
}); | |
} | |
}, { | |
key: 'getSelectAllCheckboxColumn', | |
value: function getSelectAllCheckboxColumn(props) { | |
if (!this.props.displaySelectAll) return this.getCheckboxPlaceholder(props); | |
var disabled = !this.props.enableSelectAll; | |
var checkbox = _react2.default.createElement(_Checkbox2.default, { | |
key: 'selectallcb', | |
name: 'selectallcb', | |
value: 'selected', | |
disabled: disabled, | |
checked: this.props.selectAllSelected, | |
onCheck: this.handleCheckAll | |
}); | |
var key = 'hpcb' + props.rowNumber; | |
return _react2.default.createElement( | |
_TableHeaderColumn2.default, | |
{ | |
key: key, | |
style: { | |
width: 24, | |
cursor: disabled ? 'not-allowed' : 'inherit' | |
} | |
}, | |
checkbox | |
); | |
} | |
}, { | |
key: 'render', | |
value: function render() { | |
var _props = this.props, | |
className = _props.className, | |
style = _props.style; | |
var prepareStyles = this.context.muiTheme.prepareStyles; | |
var styles = getStyles(this.props, this.context); | |
var superHeaderRows = this.createSuperHeaderRows(); | |
var baseHeaderRow = this.createBaseHeaderRow(); | |
return _react2.default.createElement( | |
'thead', | |
{ className: className, style: prepareStyles((0, _simpleAssign2.default)(styles.root, style)) }, | |
superHeaderRows, | |
baseHeaderRow | |
); | |
} | |
}]); | |
return TableHeader; | |
}(_react.Component); | |
TableHeader.muiName = 'TableHeader'; | |
TableHeader.defaultProps = { | |
adjustForCheckbox: true, | |
displaySelectAll: true, | |
enableSelectAll: true, | |
selectAllSelected: false | |
}; | |
TableHeader.contextTypes = { | |
muiTheme: _react.PropTypes.object.isRequired | |
}; | |
process.env.NODE_ENV !== "production" ? TableHeader.propTypes = { | |
/** | |
* Controls whether or not header rows should be | |
* adjusted for a checkbox column. If the select all | |
* checkbox is true, this property will not influence | |
* the number of columns. This is mainly useful for | |
* "super header" rows so that the checkbox column | |
* does not create an offset that needs to be accounted | |
* for manually. | |
*/ | |
adjustForCheckbox: _react.PropTypes.bool, | |
/** | |
* Children passed to table header. | |
*/ | |
children: _react.PropTypes.node, | |
/** | |
* The css class name of the root element. | |
*/ | |
className: _react.PropTypes.string, | |
/** | |
* Controls whether or not the select all checkbox is displayed. | |
*/ | |
displaySelectAll: _react.PropTypes.bool, | |
/** | |
* If set to true, the select all button will be interactable. | |
* If set to false, the button will not be interactable. | |
* To hide the checkbox, set displaySelectAll to false. | |
*/ | |
enableSelectAll: _react.PropTypes.bool, | |
/** | |
* @ignore | |
* Callback when select all has been checked. | |
*/ | |
onSelectAll: _react.PropTypes.func, | |
/** | |
* @ignore | |
* True when select all has been checked. | |
*/ | |
selectAllSelected: _react.PropTypes.bool, | |
/** | |
* Override the inline-styles of the root element. | |
*/ | |
style: _react.PropTypes.object | |
} : void 0; | |
exports.default = TableHeader; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 160 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _extends2 = __webpack_require__(8); | |
var _extends3 = _interopRequireDefault(_extends2); | |
var _objectWithoutProperties2 = __webpack_require__(9); | |
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | |
var _getPrototypeOf = __webpack_require__(4); | |
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | |
var _classCallCheck2 = __webpack_require__(2); | |
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | |
var _createClass2 = __webpack_require__(3); | |
var _createClass3 = _interopRequireDefault(_createClass2); | |
var _possibleConstructorReturn2 = __webpack_require__(6); | |
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | |
var _inherits2 = __webpack_require__(5); | |
var _inherits3 = _interopRequireDefault(_inherits2); | |
var _simpleAssign = __webpack_require__(7); | |
var _simpleAssign2 = _interopRequireDefault(_simpleAssign); | |
var _react = __webpack_require__(1); | |
var _react2 = _interopRequireDefault(_react); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
function getStyles(props, context, state) { | |
var tableRow = context.muiTheme.tableRow; | |
var cellBgColor = 'inherit'; | |
if (props.hovered || state.hovered) { | |
cellBgColor = tableRow.hoverColor; | |
} else if (props.selected) { | |
cellBgColor = tableRow.selectedColor; | |
} else if (props.striped) { | |
cellBgColor = tableRow.stripeColor; | |
} | |
return { | |
root: { | |
borderBottom: props.displayBorder && '1px solid ' + tableRow.borderColor, | |
color: tableRow.textColor, | |
height: tableRow.height | |
}, | |
cell: { | |
backgroundColor: cellBgColor | |
} | |
}; | |
} | |
var TableRow = function (_Component) { | |
(0, _inherits3.default)(TableRow, _Component); | |
function TableRow() { | |
var _ref; | |
var _temp, _this, _ret; | |
(0, _classCallCheck3.default)(this, TableRow); | |
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | |
args[_key] = arguments[_key]; | |
} | |
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = TableRow.__proto__ || (0, _getPrototypeOf2.default)(TableRow)).call.apply(_ref, [this].concat(args))), _this), _this.state = { | |
hovered: false | |
}, _this.onCellClick = function (event, columnIndex) { | |
if (_this.props.selectable && _this.props.onCellClick) { | |
_this.props.onCellClick(event, _this.props.rowNumber, columnIndex); | |
} | |
event.ctrlKey = true; | |
_this.onRowClick(event); | |
}, _this.onCellHover = function (event, columnIndex) { | |
if (_this.props.hoverable) { | |
_this.setState({ hovered: true }); | |
if (_this.props.onCellHover) _this.props.onCellHover(event, _this.props.rowNumber, columnIndex); | |
_this.onRowHover(event); | |
} | |
}, _this.onCellHoverExit = function (event, columnIndex) { | |
if (_this.props.hoverable) { | |
_this.setState({ hovered: false }); | |
if (_this.props.onCellHoverExit) _this.props.onCellHoverExit(event, _this.props.rowNumber, columnIndex); | |
_this.onRowHoverExit(event); | |
} | |
}, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); | |
} | |
(0, _createClass3.default)(TableRow, [{ | |
key: 'onRowClick', | |
value: function onRowClick(event) { | |
if (this.props.selectable && this.props.onRowClick) this.props.onRowClick(event, this.props.rowNumber); | |
} | |
}, { | |
key: 'onRowHover', | |
value: function onRowHover(event) { | |
if (this.props.onRowHover) this.props.onRowHover(event, this.props.rowNumber); | |
} | |
}, { | |
key: 'onRowHoverExit', | |
value: function onRowHoverExit(event) { | |
if (this.props.onRowHoverExit) this.props.onRowHoverExit(event, this.props.rowNumber); | |
} | |
}, { | |
key: 'render', | |
value: function render() { | |
var _this2 = this; | |
var _props = this.props, | |
className = _props.className, | |
displayBorder = _props.displayBorder, | |
hoverable = _props.hoverable, | |
hovered = _props.hovered, | |
onCellClick = _props.onCellClick, | |
onCellHover = _props.onCellHover, | |
onCellHoverExit = _props.onCellHoverExit, | |
onRowClick = _props.onRowClick, | |
onRowHover = _props.onRowHover, | |
onRowHoverExit = _props.onRowHoverExit, | |
rowNumber = _props.rowNumber, | |
selectable = _props.selectable, | |
selected = _props.selected, | |
striped = _props.striped, | |
style = _props.style, | |
other = (0, _objectWithoutProperties3.default)(_props, ['className', 'displayBorder', 'hoverable', 'hovered', 'onCellClick', 'onCellHover', 'onCellHoverExit', 'onRowClick', 'onRowHover', 'onRowHoverExit', 'rowNumber', 'selectable', 'selected', 'striped', 'style']); | |
var prepareStyles = this.context.muiTheme.prepareStyles; | |
var styles = getStyles(this.props, this.context, this.state); | |
var rowColumns = _react2.default.Children.map(this.props.children, function (child, columnNumber) { | |
if (_react2.default.isValidElement(child)) { | |
return _react2.default.cloneElement(child, { | |
columnNumber: columnNumber, | |
hoverable: _this2.props.hoverable, | |
key: _this2.props.rowNumber + '-' + columnNumber, | |
onClick: _this2.onCellClick, | |
onHover: _this2.onCellHover, | |
onHoverExit: _this2.onCellHoverExit, | |
style: (0, _simpleAssign2.default)({}, styles.cell, child.props.style) | |
}); | |
} | |
}); | |
return _react2.default.createElement( | |
'tr', | |
(0, _extends3.default)({ | |
className: className, | |
style: prepareStyles((0, _simpleAssign2.default)(styles.root, style)) | |
}, other), | |
rowColumns | |
); | |
} | |
}]); | |
return TableRow; | |
}(_react.Component); | |
TableRow.defaultProps = { | |
displayBorder: true, | |
hoverable: false, | |
hovered: false, | |
selectable: true, | |
selected: false, | |
striped: false | |
}; | |
TableRow.contextTypes = { | |
muiTheme: _react.PropTypes.object.isRequired | |
}; | |
process.env.NODE_ENV !== "production" ? TableRow.propTypes = { | |
/** | |
* Children passed to table row. | |
*/ | |
children: _react.PropTypes.node, | |
/** | |
* The css class name of the root element. | |
*/ | |
className: _react.PropTypes.string, | |
/** | |
* If true, row border will be displayed for the row. | |
* If false, no border will be drawn. | |
*/ | |
displayBorder: _react.PropTypes.bool, | |
/** | |
* Controls whether or not the row reponseds to hover events. | |
*/ | |
hoverable: _react.PropTypes.bool, | |
/** | |
* Controls whether or not the row should be rendered as being | |
* hovered. This property is evaluated in addition to this.state.hovered | |
* and can be used to synchronize the hovered state with some other | |
* external events. | |
*/ | |
hovered: _react.PropTypes.bool, | |
/** | |
* @ignore | |
* Called when a row cell is clicked. | |
* rowNumber is the row number and columnId is | |
* the column number or the column key. | |
*/ | |
onCellClick: _react.PropTypes.func, | |
/** | |
* @ignore | |
* Called when a table cell is hovered. | |
* rowNumber is the row number of the hovered row | |
* and columnId is the column number or the column key of the cell. | |
*/ | |
onCellHover: _react.PropTypes.func, | |
/** | |
* @ignore | |
* Called when a table cell is no longer hovered. | |
* rowNumber is the row number of the row and columnId | |
* is the column number or the column key of the cell. | |
*/ | |
onCellHoverExit: _react.PropTypes.func, | |
/** | |
* @ignore | |
* Called when row is clicked. | |
*/ | |
onRowClick: _react.PropTypes.func, | |
/** | |
* @ignore | |
* Called when a table row is hovered. | |
* rowNumber is the row number of the hovered row. | |
*/ | |
onRowHover: _react.PropTypes.func, | |
/** | |
* @ignore | |
* Called when a table row is no longer hovered. | |
* rowNumber is the row number of the row that is no longer hovered. | |
*/ | |
onRowHoverExit: _react.PropTypes.func, | |
/** | |
* Number to identify the row. This property is | |
* automatically populated when used with the TableBody component. | |
*/ | |
rowNumber: _react.PropTypes.number, | |
/** | |
* If true, table rows can be selected. If multiple row | |
* selection is desired, enable multiSelectable. | |
* The default value is true. | |
*/ | |
selectable: _react.PropTypes.bool, | |
/** | |
* Indicates that a particular row is selected. | |
* This property can be used to programmatically select rows. | |
*/ | |
selected: _react.PropTypes.bool, | |
/** | |
* Indicates whether or not the row is striped. | |
*/ | |
striped: _react.PropTypes.bool, | |
/** | |
* Override the inline-styles of the root element. | |
*/ | |
style: _react.PropTypes.object | |
} : void 0; | |
exports.default = TableRow; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 161 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _extends2 = __webpack_require__(8); | |
var _extends3 = _interopRequireDefault(_extends2); | |
var _objectWithoutProperties2 = __webpack_require__(9); | |
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | |
var _getPrototypeOf = __webpack_require__(4); | |
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | |
var _classCallCheck2 = __webpack_require__(2); | |
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | |
var _createClass2 = __webpack_require__(3); | |
var _createClass3 = _interopRequireDefault(_createClass2); | |
var _possibleConstructorReturn2 = __webpack_require__(6); | |
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | |
var _inherits2 = __webpack_require__(5); | |
var _inherits3 = _interopRequireDefault(_inherits2); | |
var _simpleAssign = __webpack_require__(7); | |
var _simpleAssign2 = _interopRequireDefault(_simpleAssign); | |
var _react = __webpack_require__(1); | |
var _react2 = _interopRequireDefault(_react); | |
var _EnhancedButton = __webpack_require__(28); | |
var _EnhancedButton2 = _interopRequireDefault(_EnhancedButton); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
function getStyles(props, context) { | |
var tabs = context.muiTheme.tabs; | |
return { | |
root: { | |
color: props.selected ? tabs.selectedTextColor : tabs.textColor, | |
fontWeight: 500, | |
fontSize: 14, | |
width: props.width, | |
textTransform: 'uppercase', | |
padding: 0 | |
}, | |
button: { | |
display: 'flex', | |
flexDirection: 'column', | |
alignItems: 'center', | |
justifyContent: 'center', | |
height: props.label && props.icon ? 72 : 48 | |
} | |
}; | |
} | |
var Tab = function (_Component) { | |
(0, _inherits3.default)(Tab, _Component); | |
function Tab() { | |
var _ref; | |
var _temp, _this, _ret; | |
(0, _classCallCheck3.default)(this, Tab); | |
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | |
args[_key] = arguments[_key]; | |
} | |
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = Tab.__proto__ || (0, _getPrototypeOf2.default)(Tab)).call.apply(_ref, [this].concat(args))), _this), _this.handleTouchTap = function (event) { | |
if (_this.props.onTouchTap) { | |
_this.props.onTouchTap(_this.props.value, event, _this); | |
} | |
}, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); | |
} | |
(0, _createClass3.default)(Tab, [{ | |
key: 'render', | |
value: function render() { | |
var _props = this.props, | |
icon = _props.icon, | |
index = _props.index, | |
onActive = _props.onActive, | |
onTouchTap = _props.onTouchTap, | |
selected = _props.selected, | |
label = _props.label, | |
buttonStyle = _props.buttonStyle, | |
style = _props.style, | |
value = _props.value, | |
width = _props.width, | |
other = (0, _objectWithoutProperties3.default)(_props, ['icon', 'index', 'onActive', 'onTouchTap', 'selected', 'label', 'buttonStyle', 'style', 'value', 'width']); | |
var styles = getStyles(this.props, this.context); | |
var iconElement = void 0; | |
if (icon && _react2.default.isValidElement(icon)) { | |
var iconProps = { | |
style: { | |
fontSize: 24, | |
color: styles.root.color, | |
marginBottom: label ? 5 : 0 | |
} | |
}; | |
// If it's svg icon set color via props | |
if (icon.type.muiName !== 'FontIcon') { | |
iconProps.color = styles.root.color; | |
} | |
iconElement = _react2.default.cloneElement(icon, iconProps); | |
} | |
var rippleOpacity = 0.3; | |
var rippleColor = this.context.muiTheme.tabs.selectedTextColor; | |
return _react2.default.createElement( | |
_EnhancedButton2.default, | |
(0, _extends3.default)({}, other, { | |
style: (0, _simpleAssign2.default)(styles.root, style), | |
focusRippleColor: rippleColor, | |
touchRippleColor: rippleColor, | |
focusRippleOpacity: rippleOpacity, | |
touchRippleOpacity: rippleOpacity, | |
onTouchTap: this.handleTouchTap | |
}), | |
_react2.default.createElement( | |
'div', | |
{ style: (0, _simpleAssign2.default)(styles.button, buttonStyle) }, | |
iconElement, | |
label | |
) | |
); | |
} | |
}]); | |
return Tab; | |
}(_react.Component); | |
Tab.muiName = 'Tab'; | |
Tab.contextTypes = { | |
muiTheme: _react.PropTypes.object.isRequired | |
}; | |
process.env.NODE_ENV !== "production" ? Tab.propTypes = { | |
/** | |
* Override the inline-styles of the button element. | |
*/ | |
buttonStyle: _react.PropTypes.object, | |
/** | |
* The css class name of the root element. | |
*/ | |
className: _react.PropTypes.string, | |
/** | |
* Sets the icon of the tab, you can pass `FontIcon` or `SvgIcon` elements. | |
*/ | |
icon: _react.PropTypes.node, | |
/** | |
* @ignore | |
*/ | |
index: _react.PropTypes.any, | |
/** | |
* Sets the text value of the tab item to the string specified. | |
*/ | |
label: _react.PropTypes.node, | |
/** | |
* Fired when the active tab changes by touch or tap. | |
* Use this event to specify any functionality when an active tab changes. | |
* For example - we are using this to route to home when the third tab becomes active. | |
* This function will always recieve the active tab as it\'s first argument. | |
*/ | |
onActive: _react.PropTypes.func, | |
/** | |
* @ignore | |
* This property is overriden by the Tabs component. | |
*/ | |
onTouchTap: _react.PropTypes.func, | |
/** | |
* @ignore | |
* Defines if the current tab is selected or not. | |
* The Tabs component is responsible for setting this property. | |
*/ | |
selected: _react.PropTypes.bool, | |
/** | |
* Override the inline-styles of the root element. | |
*/ | |
style: _react.PropTypes.object, | |
/** | |
* If value prop passed to Tabs component, this value prop is also required. | |
* It assigns a value to the tab so that it can be selected by the Tabs. | |
*/ | |
value: _react.PropTypes.any, | |
/** | |
* @ignore | |
* This property is overriden by the Tabs component. | |
*/ | |
width: _react.PropTypes.string | |
} : void 0; | |
exports.default = Tab; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 162 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _extends2 = __webpack_require__(8); | |
var _extends3 = _interopRequireDefault(_extends2); | |
var _objectWithoutProperties2 = __webpack_require__(9); | |
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | |
var _getPrototypeOf = __webpack_require__(4); | |
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | |
var _classCallCheck2 = __webpack_require__(2); | |
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | |
var _createClass2 = __webpack_require__(3); | |
var _createClass3 = _interopRequireDefault(_createClass2); | |
var _possibleConstructorReturn2 = __webpack_require__(6); | |
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | |
var _inherits2 = __webpack_require__(5); | |
var _inherits3 = _interopRequireDefault(_inherits2); | |
var _simpleAssign = __webpack_require__(7); | |
var _simpleAssign2 = _interopRequireDefault(_simpleAssign); | |
var _react = __webpack_require__(1); | |
var _react2 = _interopRequireDefault(_react); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
function getStyles(props, context) { | |
var firstChild = props.firstChild, | |
lastChild = props.lastChild; | |
var _context$muiTheme = context.muiTheme, | |
baseTheme = _context$muiTheme.baseTheme, | |
button = _context$muiTheme.button, | |
toolbar = _context$muiTheme.toolbar; | |
var marginHorizontal = baseTheme.spacing.desktopGutter; | |
var marginVertical = (toolbar.height - button.height) / 2; | |
var styles = { | |
root: { | |
position: 'relative', | |
marginLeft: firstChild ? -marginHorizontal : undefined, | |
marginRight: lastChild ? -marginHorizontal : undefined, | |
display: 'flex', | |
justifyContent: 'space-between', | |
alignItems: 'center' | |
}, | |
dropDownMenu: { | |
root: { | |
color: toolbar.color, // removes hover color change, we want to keep it | |
marginRight: baseTheme.spacing.desktopGutter, | |
flex: 1, | |
whiteSpace: 'nowrap' | |
}, | |
controlBg: { | |
backgroundColor: toolbar.menuHoverColor, | |
borderRadius: 0 | |
}, | |
underline: { | |
display: 'none' | |
} | |
}, | |
button: { | |
margin: marginVertical + 'px ' + marginHorizontal + 'px', | |
position: 'relative' | |
}, | |
icon: { | |
root: { | |
cursor: 'pointer', | |
lineHeight: toolbar.height + 'px', | |
paddingLeft: baseTheme.spacing.desktopGutter | |
} | |
}, | |
span: { | |
color: toolbar.iconColor, | |
lineHeight: toolbar.height + 'px' | |
} | |
}; | |
return styles; | |
} | |
var ToolbarGroup = function (_Component) { | |
(0, _inherits3.default)(ToolbarGroup, _Component); | |
function ToolbarGroup() { | |
(0, _classCallCheck3.default)(this, ToolbarGroup); | |
return (0, _possibleConstructorReturn3.default)(this, (ToolbarGroup.__proto__ || (0, _getPrototypeOf2.default)(ToolbarGroup)).apply(this, arguments)); | |
} | |
(0, _createClass3.default)(ToolbarGroup, [{ | |
key: 'handleMouseLeaveFontIcon', | |
value: function handleMouseLeaveFontIcon(style) { | |
return function (event) { | |
event.target.style.zIndex = 'auto'; | |
event.target.style.color = style.root.color; | |
}; | |
} | |
}, { | |
key: 'render', | |
value: function render() { | |
var _this2 = this; | |
var _props = this.props, | |
children = _props.children, | |
className = _props.className, | |
firstChild = _props.firstChild, | |
lastChild = _props.lastChild, | |
style = _props.style, | |
other = (0, _objectWithoutProperties3.default)(_props, ['children', 'className', 'firstChild', 'lastChild', 'style']); | |
var prepareStyles = this.context.muiTheme.prepareStyles; | |
var styles = getStyles(this.props, this.context); | |
var newChildren = _react2.default.Children.map(children, function (currentChild) { | |
if (!currentChild) { | |
return null; | |
} | |
if (!currentChild.type) { | |
return currentChild; | |
} | |
switch (currentChild.type.muiName) { | |
case 'DropDownMenu': | |
return _react2.default.cloneElement(currentChild, { | |
style: (0, _simpleAssign2.default)({}, styles.dropDownMenu.root, currentChild.props.style), | |
underlineStyle: styles.dropDownMenu.underline | |
}); | |
case 'RaisedButton': | |
case 'FlatButton': | |
return _react2.default.cloneElement(currentChild, { | |
style: (0, _simpleAssign2.default)({}, styles.button, currentChild.props.style) | |
}); | |
case 'FontIcon': | |
return _react2.default.cloneElement(currentChild, { | |
style: (0, _simpleAssign2.default)({}, styles.icon.root, currentChild.props.style), | |
color: currentChild.props.color || _this2.context.muiTheme.toolbar.iconColor, | |
hoverColor: currentChild.props.hoverColor || _this2.context.muiTheme.toolbar.hoverColor | |
}); | |
case 'ToolbarSeparator': | |
case 'ToolbarTitle': | |
return _react2.default.cloneElement(currentChild, { | |
style: (0, _simpleAssign2.default)({}, styles.span, currentChild.props.style) | |
}); | |
default: | |
return currentChild; | |
} | |
}, this); | |
return _react2.default.createElement( | |
'div', | |
(0, _extends3.default)({}, other, { className: className, style: prepareStyles((0, _simpleAssign2.default)({}, styles.root, style)) }), | |
newChildren | |
); | |
} | |
}]); | |
return ToolbarGroup; | |
}(_react.Component); | |
ToolbarGroup.defaultProps = { | |
firstChild: false, | |
lastChild: false | |
}; | |
ToolbarGroup.contextTypes = { | |
muiTheme: _react.PropTypes.object.isRequired | |
}; | |
process.env.NODE_ENV !== "production" ? ToolbarGroup.propTypes = { | |
/** | |
* Can be any node or number of nodes. | |
*/ | |
children: _react.PropTypes.node, | |
/** | |
* The css class name of the root element. | |
*/ | |
className: _react.PropTypes.string, | |
/** | |
* Set this to true for if the `ToolbarGroup` is the first child of `Toolbar` | |
* to prevent setting the left gap. | |
*/ | |
firstChild: _react.PropTypes.bool, | |
/** | |
* Set this to true for if the `ToolbarGroup` is the last child of `Toolbar` | |
* to prevent setting the right gap. | |
*/ | |
lastChild: _react.PropTypes.bool, | |
/** | |
* Override the inline-styles of the root element. | |
*/ | |
style: _react.PropTypes.object | |
} : void 0; | |
exports.default = ToolbarGroup; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 163 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _extends2 = __webpack_require__(8); | |
var _extends3 = _interopRequireDefault(_extends2); | |
var _objectWithoutProperties2 = __webpack_require__(9); | |
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | |
var _getPrototypeOf = __webpack_require__(4); | |
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | |
var _classCallCheck2 = __webpack_require__(2); | |
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | |
var _createClass2 = __webpack_require__(3); | |
var _createClass3 = _interopRequireDefault(_createClass2); | |
var _possibleConstructorReturn2 = __webpack_require__(6); | |
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | |
var _inherits2 = __webpack_require__(5); | |
var _inherits3 = _interopRequireDefault(_inherits2); | |
var _simpleAssign = __webpack_require__(7); | |
var _simpleAssign2 = _interopRequireDefault(_simpleAssign); | |
var _react = __webpack_require__(1); | |
var _react2 = _interopRequireDefault(_react); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
function getStyles(props, context) { | |
var _context$muiTheme = context.muiTheme, | |
baseTheme = _context$muiTheme.baseTheme, | |
toolbar = _context$muiTheme.toolbar; | |
return { | |
root: { | |
backgroundColor: toolbar.separatorColor, | |
display: 'block', | |
height: baseTheme.spacing.desktopGutterMore, | |
marginLeft: baseTheme.spacing.desktopGutter, | |
width: 1 | |
} | |
}; | |
} | |
var ToolbarSeparator = function (_Component) { | |
(0, _inherits3.default)(ToolbarSeparator, _Component); | |
function ToolbarSeparator() { | |
(0, _classCallCheck3.default)(this, ToolbarSeparator); | |
return (0, _possibleConstructorReturn3.default)(this, (ToolbarSeparator.__proto__ || (0, _getPrototypeOf2.default)(ToolbarSeparator)).apply(this, arguments)); | |
} | |
(0, _createClass3.default)(ToolbarSeparator, [{ | |
key: 'render', | |
value: function render() { | |
var _props = this.props, | |
className = _props.className, | |
style = _props.style, | |
other = (0, _objectWithoutProperties3.default)(_props, ['className', 'style']); | |
var prepareStyles = this.context.muiTheme.prepareStyles; | |
var styles = getStyles(this.props, this.context); | |
return _react2.default.createElement('span', (0, _extends3.default)({}, other, { className: className, style: prepareStyles((0, _simpleAssign2.default)({}, styles.root, style)) })); | |
} | |
}]); | |
return ToolbarSeparator; | |
}(_react.Component); | |
ToolbarSeparator.muiName = 'ToolbarSeparator'; | |
ToolbarSeparator.contextTypes = { | |
muiTheme: _react.PropTypes.object.isRequired | |
}; | |
process.env.NODE_ENV !== "production" ? ToolbarSeparator.propTypes = { | |
/** | |
* The css class name of the root element. | |
*/ | |
className: _react.PropTypes.string, | |
/** | |
* Override the inline-styles of the root element. | |
*/ | |
style: _react.PropTypes.object | |
} : void 0; | |
exports.default = ToolbarSeparator; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 164 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _extends2 = __webpack_require__(8); | |
var _extends3 = _interopRequireDefault(_extends2); | |
var _objectWithoutProperties2 = __webpack_require__(9); | |
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | |
var _getPrototypeOf = __webpack_require__(4); | |
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | |
var _classCallCheck2 = __webpack_require__(2); | |
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | |
var _createClass2 = __webpack_require__(3); | |
var _createClass3 = _interopRequireDefault(_createClass2); | |
var _possibleConstructorReturn2 = __webpack_require__(6); | |
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | |
var _inherits2 = __webpack_require__(5); | |
var _inherits3 = _interopRequireDefault(_inherits2); | |
var _simpleAssign = __webpack_require__(7); | |
var _simpleAssign2 = _interopRequireDefault(_simpleAssign); | |
var _react = __webpack_require__(1); | |
var _react2 = _interopRequireDefault(_react); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
function getStyles(props, context) { | |
var _context$muiTheme = context.muiTheme, | |
baseTheme = _context$muiTheme.baseTheme, | |
toolbar = _context$muiTheme.toolbar; | |
return { | |
root: { | |
paddingRight: baseTheme.spacing.desktopGutterLess, | |
lineHeight: toolbar.height + 'px', | |
fontSize: toolbar.titleFontSize, | |
fontFamily: baseTheme.fontFamily, | |
position: 'relative', | |
textOverflow: 'ellipsis', | |
whiteSpace: 'nowrap', | |
overflow: 'hidden' | |
} | |
}; | |
} | |
var ToolbarTitle = function (_Component) { | |
(0, _inherits3.default)(ToolbarTitle, _Component); | |
function ToolbarTitle() { | |
(0, _classCallCheck3.default)(this, ToolbarTitle); | |
return (0, _possibleConstructorReturn3.default)(this, (ToolbarTitle.__proto__ || (0, _getPrototypeOf2.default)(ToolbarTitle)).apply(this, arguments)); | |
} | |
(0, _createClass3.default)(ToolbarTitle, [{ | |
key: 'render', | |
value: function render() { | |
var _props = this.props, | |
className = _props.className, | |
style = _props.style, | |
text = _props.text, | |
other = (0, _objectWithoutProperties3.default)(_props, ['className', 'style', 'text']); | |
var prepareStyles = this.context.muiTheme.prepareStyles; | |
var styles = getStyles(this.props, this.context); | |
return _react2.default.createElement( | |
'span', | |
(0, _extends3.default)({}, other, { className: className, style: prepareStyles((0, _simpleAssign2.default)({}, styles.root, style)) }), | |
text | |
); | |
} | |
}]); | |
return ToolbarTitle; | |
}(_react.Component); | |
ToolbarTitle.muiName = 'ToolbarTitle'; | |
ToolbarTitle.contextTypes = { | |
muiTheme: _react.PropTypes.object.isRequired | |
}; | |
process.env.NODE_ENV !== "production" ? ToolbarTitle.propTypes = { | |
/** | |
* The css class name of the root element. | |
*/ | |
className: _react.PropTypes.string, | |
/** | |
* Override the inline-styles of the root element. | |
*/ | |
style: _react.PropTypes.object, | |
/** | |
* The text to be displayed. | |
*/ | |
text: _react.PropTypes.string | |
} : void 0; | |
exports.default = ToolbarTitle; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 165 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
module.exports = { "default": __webpack_require__(264), __esModule: true }; | |
/***/ }), | |
/* 166 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
module.exports = { "default": __webpack_require__(265), __esModule: true }; | |
/***/ }), | |
/* 167 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
module.exports = { "default": __webpack_require__(267), __esModule: true }; | |
/***/ }), | |
/* 168 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
exports.__esModule = true; | |
var _defineProperty = __webpack_require__(94); | |
var _defineProperty2 = _interopRequireDefault(_defineProperty); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.default = function (obj, key, value) { | |
if (key in obj) { | |
(0, _defineProperty2.default)(obj, key, { | |
value: value, | |
enumerable: true, | |
configurable: true, | |
writable: true | |
}); | |
} else { | |
obj[key] = value; | |
} | |
return obj; | |
}; | |
/***/ }), | |
/* 169 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
exports.__esModule = true; | |
var _from = __webpack_require__(165); | |
var _from2 = _interopRequireDefault(_from); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.default = function (arr) { | |
return Array.isArray(arr) ? arr : (0, _from2.default)(arr); | |
}; | |
/***/ }), | |
/* 170 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
// getting tag from 19.1.3.6 Object.prototype.toString() | |
var cof = __webpack_require__(97) | |
, TAG = __webpack_require__(27)('toStringTag') | |
// ES3 wrong here | |
, ARG = cof(function(){ return arguments; }()) == 'Arguments'; | |
// fallback for IE11 Script Access Denied error | |
var tryGet = function(it, key){ | |
try { | |
return it[key]; | |
} catch(e){ /* empty */ } | |
}; | |
module.exports = function(it){ | |
var O, T, B; | |
return it === undefined ? 'Undefined' : it === null ? 'Null' | |
// @@toStringTag case | |
: typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T | |
// builtinTag case | |
: ARG ? cof(O) | |
// ES3 arguments fallback | |
: (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; | |
}; | |
/***/ }), | |
/* 171 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
var isObject = __webpack_require__(62) | |
, document = __webpack_require__(36).document | |
// in old IE typeof document.createElement is 'object' | |
, is = isObject(document) && isObject(document.createElement); | |
module.exports = function(it){ | |
return is ? document.createElement(it) : {}; | |
}; | |
/***/ }), | |
/* 172 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
module.exports = !__webpack_require__(44) && !__webpack_require__(52)(function(){ | |
return Object.defineProperty(__webpack_require__(171)('div'), 'a', {get: function(){ return 7; }}).a != 7; | |
}); | |
/***/ }), | |
/* 173 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
// fallback for non-array-like ES3 and non-enumerable old V8 strings | |
var cof = __webpack_require__(97); | |
module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){ | |
return cof(it) == 'String' ? it.split('') : Object(it); | |
}; | |
/***/ }), | |
/* 174 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
var LIBRARY = __webpack_require__(101) | |
, $export = __webpack_require__(35) | |
, redefine = __webpack_require__(180) | |
, hide = __webpack_require__(53) | |
, has = __webpack_require__(45) | |
, Iterators = __webpack_require__(54) | |
, $iterCreate = __webpack_require__(284) | |
, setToStringTag = __webpack_require__(104) | |
, getPrototypeOf = __webpack_require__(177) | |
, ITERATOR = __webpack_require__(27)('iterator') | |
, BUGGY = !([].keys && 'next' in [].keys()) // Safari has buggy iterators w/o `next` | |
, FF_ITERATOR = '@@iterator' | |
, KEYS = 'keys' | |
, VALUES = 'values'; | |
var returnThis = function(){ return this; }; | |
module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED){ | |
$iterCreate(Constructor, NAME, next); | |
var getMethod = function(kind){ | |
if(!BUGGY && kind in proto)return proto[kind]; | |
switch(kind){ | |
case KEYS: return function keys(){ return new Constructor(this, kind); }; | |
case VALUES: return function values(){ return new Constructor(this, kind); }; | |
} return function entries(){ return new Constructor(this, kind); }; | |
}; | |
var TAG = NAME + ' Iterator' | |
, DEF_VALUES = DEFAULT == VALUES | |
, VALUES_BUG = false | |
, proto = Base.prototype | |
, $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT] | |
, $default = $native || getMethod(DEFAULT) | |
, $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined | |
, $anyNative = NAME == 'Array' ? proto.entries || $native : $native | |
, methods, key, IteratorPrototype; | |
// Fix native | |
if($anyNative){ | |
IteratorPrototype = getPrototypeOf($anyNative.call(new Base)); | |
if(IteratorPrototype !== Object.prototype){ | |
// Set @@toStringTag to native iterators | |
setToStringTag(IteratorPrototype, TAG, true); | |
// fix for some old engines | |
if(!LIBRARY && !has(IteratorPrototype, ITERATOR))hide(IteratorPrototype, ITERATOR, returnThis); | |
} | |
} | |
// fix Array#{values, @@iterator}.name in V8 / FF | |
if(DEF_VALUES && $native && $native.name !== VALUES){ | |
VALUES_BUG = true; | |
$default = function values(){ return $native.call(this); }; | |
} | |
// Define iterator | |
if((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])){ | |
hide(proto, ITERATOR, $default); | |
} | |
// Plug for library | |
Iterators[NAME] = $default; | |
Iterators[TAG] = returnThis; | |
if(DEFAULT){ | |
methods = { | |
values: DEF_VALUES ? $default : getMethod(VALUES), | |
keys: IS_SET ? $default : getMethod(KEYS), | |
entries: $entries | |
}; | |
if(FORCED)for(key in methods){ | |
if(!(key in proto))redefine(proto, key, methods[key]); | |
} else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); | |
} | |
return methods; | |
}; | |
/***/ }), | |
/* 175 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
var pIE = __webpack_require__(76) | |
, createDesc = __webpack_require__(63) | |
, toIObject = __webpack_require__(46) | |
, toPrimitive = __webpack_require__(108) | |
, has = __webpack_require__(45) | |
, IE8_DOM_DEFINE = __webpack_require__(172) | |
, gOPD = Object.getOwnPropertyDescriptor; | |
exports.f = __webpack_require__(44) ? gOPD : function getOwnPropertyDescriptor(O, P){ | |
O = toIObject(O); | |
P = toPrimitive(P, true); | |
if(IE8_DOM_DEFINE)try { | |
return gOPD(O, P); | |
} catch(e){ /* empty */ } | |
if(has(O, P))return createDesc(!pIE.f.call(O, P), O[P]); | |
}; | |
/***/ }), | |
/* 176 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) | |
var $keys = __webpack_require__(178) | |
, hiddenKeys = __webpack_require__(100).concat('length', 'prototype'); | |
exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O){ | |
return $keys(O, hiddenKeys); | |
}; | |
/***/ }), | |
/* 177 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) | |
var has = __webpack_require__(45) | |
, toObject = __webpack_require__(64) | |
, IE_PROTO = __webpack_require__(105)('IE_PROTO') | |
, ObjectProto = Object.prototype; | |
module.exports = Object.getPrototypeOf || function(O){ | |
O = toObject(O); | |
if(has(O, IE_PROTO))return O[IE_PROTO]; | |
if(typeof O.constructor == 'function' && O instanceof O.constructor){ | |
return O.constructor.prototype; | |
} return O instanceof Object ? ObjectProto : null; | |
}; | |
/***/ }), | |
/* 178 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
var has = __webpack_require__(45) | |
, toIObject = __webpack_require__(46) | |
, arrayIndexOf = __webpack_require__(277)(false) | |
, IE_PROTO = __webpack_require__(105)('IE_PROTO'); | |
module.exports = function(object, names){ | |
var O = toIObject(object) | |
, i = 0 | |
, result = [] | |
, key; | |
for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key); | |
// Don't enum bug & hidden keys | |
while(names.length > i)if(has(O, key = names[i++])){ | |
~arrayIndexOf(result, key) || result.push(key); | |
} | |
return result; | |
}; | |
/***/ }), | |
/* 179 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
// most Object methods by ES6 should accept primitives | |
var $export = __webpack_require__(35) | |
, core = __webpack_require__(22) | |
, fails = __webpack_require__(52); | |
module.exports = function(KEY, exec){ | |
var fn = (core.Object || {})[KEY] || Object[KEY] | |
, exp = {}; | |
exp[KEY] = exec(fn); | |
$export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp); | |
}; | |
/***/ }), | |
/* 180 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
module.exports = __webpack_require__(53); | |
/***/ }), | |
/* 181 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
// 7.1.15 ToLength | |
var toInteger = __webpack_require__(107) | |
, min = Math.min; | |
module.exports = function(it){ | |
return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 | |
}; | |
/***/ }), | |
/* 182 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
var classof = __webpack_require__(170) | |
, ITERATOR = __webpack_require__(27)('iterator') | |
, Iterators = __webpack_require__(54); | |
module.exports = __webpack_require__(22).getIteratorMethod = function(it){ | |
if(it != undefined)return it[ITERATOR] | |
|| it['@@iterator'] | |
|| Iterators[classof(it)]; | |
}; | |
/***/ }), | |
/* 183 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
/** | |
* Copyright (c) 2013-present, Facebook, Inc. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software | |
* distributed under the License is distributed on an "AS IS" BASIS, | |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
* See the License for the specific language governing permissions and | |
* limitations under the License. | |
* | |
* @typechecks | |
*/ | |
var emptyFunction = __webpack_require__(24); | |
/** | |
* Upstream version of event listener. Does not take into account specific | |
* nature of platform. | |
*/ | |
var EventListener = { | |
/** | |
* Listen to DOM events during the bubble phase. | |
* | |
* @param {DOMEventTarget} target DOM element to register listener on. | |
* @param {string} eventType Event type, e.g. 'click' or 'mouseover'. | |
* @param {function} callback Callback function. | |
* @return {object} Object with a `remove` method. | |
*/ | |
listen: function 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); | |
} | |
}; | |
} | |
}, | |
/** | |
* Listen to DOM events during the capture phase. | |
* | |
* @param {DOMEventTarget} target DOM element to register listener on. | |
* @param {string} eventType Event type, e.g. 'click' or 'mouseover'. | |
* @param {function} callback Callback function. | |
* @return {object} Object with a `remove` method. | |
*/ | |
capture: function 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') { | |
console.error('Attempted to listen to events during the capture phase on a ' + 'browser that does not support the capture phase. Your application ' + 'will not receive some events.'); | |
} | |
return { | |
remove: emptyFunction | |
}; | |
} | |
}, | |
registerDefault: function registerDefault() {} | |
}; | |
module.exports = EventListener; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 184 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"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. | |
* | |
*/ | |
/** | |
* @param {DOMElement} node input/textarea to focus | |
*/ | |
function focusNode(node) { | |
// IE8 can throw "Can't move focus to the control because it is invisible, | |
// not enabled, or of a type that does not accept the focus." for all kinds of | |
// reasons that are too expensive and fragile to test. | |
try { | |
node.focus(); | |
} catch (e) {} | |
} | |
module.exports = focusNode; | |
/***/ }), | |
/* 185 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"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. | |
* | |
* @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. | |
*/ | |
function getActiveElement() /*?DOMElement*/{ | |
if (typeof document === 'undefined') { | |
return null; | |
} | |
try { | |
return document.activeElement || document.body; | |
} catch (e) { | |
return document.body; | |
} | |
} | |
module.exports = getActiveElement; | |
/***/ }), | |
/* 186 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
var uppercasePattern = /[A-Z]/g; | |
var msPattern = /^ms-/; | |
var cache = {}; | |
function hyphenateStyleName(string) { | |
return string in cache | |
? cache[string] | |
: cache[string] = string | |
.replace(uppercasePattern, '-$&') | |
.toLowerCase() | |
.replace(msPattern, '-ms-'); | |
} | |
module.exports = hyphenateStyleName; | |
/***/ }), | |
/* 187 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = { "Webkit": { "transform": true, "transformOrigin": true, "transformOriginX": true, "transformOriginY": true, "backfaceVisibility": true, "perspective": true, "perspectiveOrigin": true, "transformStyle": true, "transformOriginZ": true, "animation": true, "animationDelay": true, "animationDirection": true, "animationFillMode": true, "animationDuration": true, "animationIterationCount": true, "animationName": true, "animationPlayState": true, "animationTimingFunction": true, "appearance": true, "userSelect": true, "fontKerning": true, "textEmphasisPosition": true, "textEmphasis": true, "textEmphasisStyle": true, "textEmphasisColor": true, "boxDecorationBreak": true, "clipPath": true, "maskImage": true, "maskMode": true, "maskRepeat": true, "maskPosition": true, "maskClip": true, "maskOrigin": true, "maskSize": true, "maskComposite": true, "mask": true, "maskBorderSource": true, "maskBorderMode": true, "maskBorderSlice": true, "maskBorderWidth": true, "maskBorderOutset": true, "maskBorderRepeat": true, "maskBorder": true, "maskType": true, "textDecorationStyle": true, "textDecorationSkip": true, "textDecorationLine": true, "textDecorationColor": true, "filter": true, "fontFeatureSettings": true, "breakAfter": true, "breakBefore": true, "breakInside": true, "columnCount": true, "columnFill": true, "columnGap": true, "columnRule": true, "columnRuleColor": true, "columnRuleStyle": true, "columnRuleWidth": true, "columns": true, "columnSpan": true, "columnWidth": true, "flex": true, "flexBasis": true, "flexDirection": true, "flexGrow": true, "flexFlow": true, "flexShrink": true, "flexWrap": true, "alignContent": true, "alignItems": true, "alignSelf": true, "justifyContent": true, "order": true, "transition": true, "transitionDelay": true, "transitionDuration": true, "transitionProperty": true, "transitionTimingFunction": true, "backdropFilter": true, "scrollSnapType": true, "scrollSnapPointsX": true, "scrollSnapPointsY": true, "scrollSnapDestination": true, "scrollSnapCoordinate": true, "shapeImageThreshold": true, "shapeImageMargin": true, "shapeImageOutside": true, "hyphens": true, "flowInto": true, "flowFrom": true, "regionFragment": true, "textSizeAdjust": true }, "Moz": { "appearance": true, "userSelect": true, "boxSizing": true, "textAlignLast": true, "textDecorationStyle": true, "textDecorationSkip": true, "textDecorationLine": true, "textDecorationColor": true, "tabSize": true, "hyphens": true, "fontFeatureSettings": true, "breakAfter": true, "breakBefore": true, "breakInside": true, "columnCount": true, "columnFill": true, "columnGap": true, "columnRule": true, "columnRuleColor": true, "columnRuleStyle": true, "columnRuleWidth": true, "columns": true, "columnSpan": true, "columnWidth": true }, "ms": { "flex": true, "flexBasis": false, "flexDirection": true, "flexGrow": false, "flexFlow": true, "flexShrink": false, "flexWrap": true, "alignContent": false, "alignItems": false, "alignSelf": false, "justifyContent": false, "order": false, "transform": true, "transformOrigin": true, "transformOriginX": true, "transformOriginY": true, "userSelect": true, "wrapFlow": true, "wrapThrough": true, "wrapMargin": true, "scrollSnapType": true, "scrollSnapPointsX": true, "scrollSnapPointsY": true, "scrollSnapDestination": true, "scrollSnapCoordinate": true, "touchAction": true, "hyphens": true, "flowInto": true, "flowFrom": true, "breakBefore": true, "breakAfter": true, "breakInside": true, "regionFragment": true, "gridTemplateColumns": true, "gridTemplateRows": true, "gridTemplateAreas": true, "gridTemplate": true, "gridAutoColumns": true, "gridAutoRows": true, "gridAutoFlow": true, "grid": true, "gridRowStart": true, "gridColumnStart": true, "gridRowEnd": true, "gridRow": true, "gridColumn": true, "gridColumnEnd": true, "gridColumnGap": true, "gridRowGap": true, "gridArea": true, "gridGap": true, "textSizeAdjust": true } }; | |
module.exports = exports["default"]; | |
/***/ }), | |
/* 188 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = sortPrefixedStyle; | |
var _isPrefixedProperty = __webpack_require__(347); | |
var _isPrefixedProperty2 = _interopRequireDefault(_isPrefixedProperty); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
function sortPrefixedStyle(style) { | |
return Object.keys(style).sort(function (left, right) { | |
if ((0, _isPrefixedProperty2.default)(left) && !(0, _isPrefixedProperty2.default)(right)) { | |
return -1; | |
} else if (!(0, _isPrefixedProperty2.default)(left) && (0, _isPrefixedProperty2.default)(right)) { | |
return 1; | |
} | |
return 0; | |
}).reduce(function (sortedStyle, prop) { | |
sortedStyle[prop] = style[prop]; | |
return sortedStyle; | |
}, {}); | |
} | |
module.exports = exports['default']; | |
/***/ }), | |
/* 189 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _getPrototypeOf = __webpack_require__(4); | |
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | |
var _classCallCheck2 = __webpack_require__(2); | |
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | |
var _createClass2 = __webpack_require__(3); | |
var _createClass3 = _interopRequireDefault(_createClass2); | |
var _possibleConstructorReturn2 = __webpack_require__(6); | |
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | |
var _inherits2 = __webpack_require__(5); | |
var _inherits3 = _interopRequireDefault(_inherits2); | |
var _simpleAssign = __webpack_require__(7); | |
var _simpleAssign2 = _interopRequireDefault(_simpleAssign); | |
var _react = __webpack_require__(1); | |
var _react2 = _interopRequireDefault(_react); | |
var _keyboardArrowUp = __webpack_require__(428); | |
var _keyboardArrowUp2 = _interopRequireDefault(_keyboardArrowUp); | |
var _keyboardArrowDown = __webpack_require__(427); | |
var _keyboardArrowDown2 = _interopRequireDefault(_keyboardArrowDown); | |
var _IconButton = __webpack_require__(51); | |
var _IconButton2 = _interopRequireDefault(_IconButton); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
function getStyles() { | |
return { | |
root: { | |
top: 0, | |
bottom: 0, | |
right: 4, | |
margin: 'auto', | |
position: 'absolute' | |
} | |
}; | |
} | |
var CardExpandable = function (_Component) { | |
(0, _inherits3.default)(CardExpandable, _Component); | |
function CardExpandable() { | |
(0, _classCallCheck3.default)(this, CardExpandable); | |
return (0, _possibleConstructorReturn3.default)(this, (CardExpandable.__proto__ || (0, _getPrototypeOf2.default)(CardExpandable)).apply(this, arguments)); | |
} | |
(0, _createClass3.default)(CardExpandable, [{ | |
key: 'render', | |
value: function render() { | |
var styles = getStyles(this.props, this.context); | |
return _react2.default.createElement( | |
_IconButton2.default, | |
{ | |
style: (0, _simpleAssign2.default)(styles.root, this.props.style), | |
onTouchTap: this.props.onExpanding | |
}, | |
this.props.expanded ? this.props.openIcon : this.props.closeIcon | |
); | |
} | |
}]); | |
return CardExpandable; | |
}(_react.Component); | |
CardExpandable.contextTypes = { | |
muiTheme: _react.PropTypes.object.isRequired | |
}; | |
CardExpandable.defaultProps = { | |
closeIcon: _react2.default.createElement(_keyboardArrowDown2.default, null), | |
openIcon: _react2.default.createElement(_keyboardArrowUp2.default, null) | |
}; | |
process.env.NODE_ENV !== "production" ? CardExpandable.propTypes = { | |
closeIcon: _react.PropTypes.node, | |
expanded: _react.PropTypes.bool, | |
onExpanding: _react.PropTypes.func.isRequired, | |
openIcon: _react.PropTypes.node, | |
style: _react.PropTypes.object | |
} : void 0; | |
exports.default = CardExpandable; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 190 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _extends2 = __webpack_require__(8); | |
var _extends3 = _interopRequireDefault(_extends2); | |
var _objectWithoutProperties2 = __webpack_require__(9); | |
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | |
var _getPrototypeOf = __webpack_require__(4); | |
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | |
var _classCallCheck2 = __webpack_require__(2); | |
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | |
var _createClass2 = __webpack_require__(3); | |
var _createClass3 = _interopRequireDefault(_createClass2); | |
var _possibleConstructorReturn2 = __webpack_require__(6); | |
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | |
var _inherits2 = __webpack_require__(5); | |
var _inherits3 = _interopRequireDefault(_inherits2); | |
var _simpleAssign = __webpack_require__(7); | |
var _simpleAssign2 = _interopRequireDefault(_simpleAssign); | |
var _react = __webpack_require__(1); | |
var _react2 = _interopRequireDefault(_react); | |
var _transitions = __webpack_require__(12); | |
var _transitions2 = _interopRequireDefault(_transitions); | |
var _EnhancedSwitch = __webpack_require__(118); | |
var _EnhancedSwitch2 = _interopRequireDefault(_EnhancedSwitch); | |
var _radioButtonUnchecked = __webpack_require__(440); | |
var _radioButtonUnchecked2 = _interopRequireDefault(_radioButtonUnchecked); | |
var _radioButtonChecked = __webpack_require__(439); | |
var _radioButtonChecked2 = _interopRequireDefault(_radioButtonChecked); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
function getStyles(props, context) { | |
var radioButton = context.muiTheme.radioButton; | |
return { | |
icon: { | |
height: radioButton.size, | |
width: radioButton.size | |
}, | |
target: { | |
transition: _transitions2.default.easeOut(), | |
position: 'absolute', | |
opacity: 1, | |
transform: 'scale(1)', | |
fill: radioButton.borderColor | |
}, | |
fill: { | |
position: 'absolute', | |
opacity: 1, | |
transform: 'scale(0)', | |
transformOrigin: '50% 50%', | |
transition: _transitions2.default.easeOut(), | |
fill: radioButton.checkedColor | |
}, | |
targetWhenChecked: { | |
opacity: 0, | |
transform: 'scale(0)' | |
}, | |
fillWhenChecked: { | |
opacity: 1, | |
transform: 'scale(1)' | |
}, | |
targetWhenDisabled: { | |
fill: radioButton.disabledColor | |
}, | |
fillWhenDisabled: { | |
fill: radioButton.disabledColor | |
}, | |
label: { | |
color: props.disabled ? radioButton.labelDisabledColor : radioButton.labelColor | |
}, | |
ripple: { | |
color: props.checked ? radioButton.checkedColor : radioButton.borderColor | |
} | |
}; | |
} | |
var RadioButton = function (_Component) { | |
(0, _inherits3.default)(RadioButton, _Component); | |
function RadioButton() { | |
var _ref; | |
var _temp, _this, _ret; | |
(0, _classCallCheck3.default)(this, RadioButton); | |
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | |
args[_key] = arguments[_key]; | |
} | |
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = RadioButton.__proto__ || (0, _getPrototypeOf2.default)(RadioButton)).call.apply(_ref, [this].concat(args))), _this), _this.handleSwitch = function (event) { | |
if (_this.props.onCheck) { | |
_this.props.onCheck(event, _this.props.value); | |
} | |
}, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); | |
} | |
// Only called when selected, not when unselected. | |
(0, _createClass3.default)(RadioButton, [{ | |
key: 'isChecked', | |
value: function isChecked() { | |
return this.refs.enhancedSwitch.isSwitched(); | |
} | |
// Use RadioButtonGroup.setSelectedValue(newSelectionValue) to set a | |
// RadioButton's checked value. | |
}, { | |
key: 'setChecked', | |
value: function setChecked(newCheckedValue) { | |
this.refs.enhancedSwitch.setSwitched(newCheckedValue); | |
} | |
}, { | |
key: 'getValue', | |
value: function getValue() { | |
return this.refs.enhancedSwitch.getValue(); | |
} | |
}, { | |
key: 'render', | |
value: function render() { | |
var _props = this.props, | |
checkedIcon = _props.checkedIcon, | |
checked = _props.checked, | |
iconStyle = _props.iconStyle, | |
labelStyle = _props.labelStyle, | |
labelPosition = _props.labelPosition, | |
onCheck = _props.onCheck, | |
uncheckedIcon = _props.uncheckedIcon, | |
disabled = _props.disabled, | |
other = (0, _objectWithoutProperties3.default)(_props, ['checkedIcon', 'checked', 'iconStyle', 'labelStyle', 'labelPosition', 'onCheck', 'uncheckedIcon', 'disabled']); | |
var styles = getStyles(this.props, this.context); | |
var uncheckedStyles = (0, _simpleAssign2.default)(styles.target, checked && styles.targetWhenChecked, iconStyle, disabled && styles.targetWhenDisabled); | |
var checkedStyles = (0, _simpleAssign2.default)(styles.fill, checked && styles.fillWhenChecked, iconStyle, disabled && styles.fillWhenDisabled); | |
var uncheckedElement = _react2.default.isValidElement(uncheckedIcon) ? _react2.default.cloneElement(uncheckedIcon, { | |
style: (0, _simpleAssign2.default)(uncheckedStyles, uncheckedIcon.props.style) | |
}) : _react2.default.createElement(_radioButtonUnchecked2.default, { style: uncheckedStyles }); | |
var checkedElement = _react2.default.isValidElement(checkedIcon) ? _react2.default.cloneElement(checkedIcon, { | |
style: (0, _simpleAssign2.default)(checkedStyles, checkedIcon.props.style) | |
}) : _react2.default.createElement(_radioButtonChecked2.default, { style: checkedStyles }); | |
var mergedIconStyle = (0, _simpleAssign2.default)(styles.icon, iconStyle); | |
var mergedLabelStyle = (0, _simpleAssign2.default)(styles.label, labelStyle); | |
return _react2.default.createElement(_EnhancedSwitch2.default, (0, _extends3.default)({}, other, { | |
ref: 'enhancedSwitch', | |
inputType: 'radio', | |
checked: checked, | |
switched: checked, | |
disabled: disabled, | |
rippleColor: styles.ripple.color, | |
iconStyle: mergedIconStyle, | |
labelStyle: mergedLabelStyle, | |
labelPosition: labelPosition, | |
onSwitch: this.handleSwitch, | |
switchElement: _react2.default.createElement( | |
'div', | |
null, | |
uncheckedElement, | |
checkedElement | |
) | |
})); | |
} | |
}]); | |
return RadioButton; | |
}(_react.Component); | |
RadioButton.defaultProps = { | |
checked: false, | |
disabled: false, | |
labelPosition: 'right' | |
}; | |
RadioButton.contextTypes = { | |
muiTheme: _react.PropTypes.object.isRequired | |
}; | |
process.env.NODE_ENV !== "production" ? RadioButton.propTypes = { | |
/** | |
* @ignore | |
* checked if true | |
* Used internally by `RadioButtonGroup`. | |
*/ | |
checked: _react.PropTypes.bool, | |
/** | |
* The icon element to show when the radio button is checked. | |
*/ | |
checkedIcon: _react.PropTypes.element, | |
/** | |
* If true, the radio button is disabled. | |
*/ | |
disabled: _react.PropTypes.bool, | |
/** | |
* Override the inline-styles of the icon element. | |
*/ | |
iconStyle: _react.PropTypes.object, | |
/** | |
* Override the inline-styles of the input element. | |
*/ | |
inputStyle: _react.PropTypes.object, | |
/** | |
* @ignore | |
* Used internally by `RadioButtonGroup`. Use the `labelPosition` property of `RadioButtonGroup` instead. | |
* Where the label will be placed next to the radio button. | |
*/ | |
labelPosition: _react.PropTypes.oneOf(['left', 'right']), | |
/** | |
* Override the inline-styles of the label element. | |
*/ | |
labelStyle: _react.PropTypes.object, | |
/** | |
* @ignore | |
* Callback function fired when the radio button is checked. Note that this | |
* function will not be called if the radio button is part of a | |
* radio button group: in this case, use the `onChange` property of | |
* `RadioButtonGroup`. | |
* | |
* @param {object} event `change` event targeting the element. | |
* @param {string} value The element's `value`. | |
*/ | |
onCheck: _react.PropTypes.func, | |
/** | |
* Override the inline-styles of the root element. | |
*/ | |
style: _react.PropTypes.object, | |
/** | |
* The icon element to show when the radio button is unchecked. | |
*/ | |
uncheckedIcon: _react.PropTypes.element, | |
/** | |
* The value of the radio button. | |
*/ | |
value: _react.PropTypes.any | |
} : void 0; | |
exports.default = RadioButton; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 191 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _getPrototypeOf = __webpack_require__(4); | |
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | |
var _classCallCheck2 = __webpack_require__(2); | |
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | |
var _createClass2 = __webpack_require__(3); | |
var _createClass3 = _interopRequireDefault(_createClass2); | |
var _possibleConstructorReturn2 = __webpack_require__(6); | |
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | |
var _inherits2 = __webpack_require__(5); | |
var _inherits3 = _interopRequireDefault(_inherits2); | |
var _slicedToArray2 = __webpack_require__(96); | |
var _slicedToArray3 = _interopRequireDefault(_slicedToArray2); | |
var _react = __webpack_require__(1); | |
var _react2 = _interopRequireDefault(_react); | |
var _timeUtils = __webpack_require__(67); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
function getStyles(props, context) { | |
var styles = { | |
root: { | |
directionInvariant: true, | |
display: 'inline-block', | |
position: 'absolute', | |
width: 32, | |
height: 32, | |
borderRadius: '100%', | |
left: 'calc(50% - 16px)', | |
top: 10, | |
textAlign: 'center', | |
paddingTop: 5, | |
userSelect: 'none', /* Chrome all / Safari all */ | |
fontSize: '1.1em', | |
pointerEvents: 'none', | |
boxSizing: 'border-box' | |
} | |
}; | |
var muiTheme = context.muiTheme; | |
var pos = props.value; | |
if (props.type === 'hour') { | |
pos %= 12; | |
} else { | |
pos = pos / 5; | |
} | |
var positions = [[0, 5], [54.5, 16.6], [94.4, 59.5], [109, 114], [94.4, 168.5], [54.5, 208.4], [0, 223], [-54.5, 208.4], [-94.4, 168.5], [-109, 114], [-94.4, 59.5], [-54.5, 19.6]]; | |
var innerPositions = [[0, 40], [36.9, 49.9], [64, 77], [74, 114], [64, 151], [37, 178], [0, 188], [-37, 178], [-64, 151], [-74, 114], [-64, 77], [-37, 50]]; | |
if (props.isSelected) { | |
styles.root.backgroundColor = muiTheme.timePicker.accentColor; | |
styles.root.color = muiTheme.timePicker.selectTextColor; | |
} | |
var transformPos = positions[pos]; | |
if ((0, _timeUtils.isInner)(props)) { | |
styles.root.width = 28; | |
styles.root.height = 28; | |
styles.root.left = 'calc(50% - 14px)'; | |
transformPos = innerPositions[pos]; | |
} | |
var _transformPos = transformPos, | |
_transformPos2 = (0, _slicedToArray3.default)(_transformPos, 2), | |
x = _transformPos2[0], | |
y = _transformPos2[1]; | |
styles.root.transform = 'translate(' + x + 'px, ' + y + 'px)'; | |
return styles; | |
} | |
var ClockNumber = function (_Component) { | |
(0, _inherits3.default)(ClockNumber, _Component); | |
function ClockNumber() { | |
(0, _classCallCheck3.default)(this, ClockNumber); | |
return (0, _possibleConstructorReturn3.default)(this, (ClockNumber.__proto__ || (0, _getPrototypeOf2.default)(ClockNumber)).apply(this, arguments)); | |
} | |
(0, _createClass3.default)(ClockNumber, [{ | |
key: 'render', | |
value: function render() { | |
var prepareStyles = this.context.muiTheme.prepareStyles; | |
var styles = getStyles(this.props, this.context); | |
var clockNumber = this.props.value === 0 ? '00' : this.props.value; | |
return _react2.default.createElement( | |
'span', | |
{ style: prepareStyles(styles.root) }, | |
clockNumber | |
); | |
} | |
}]); | |
return ClockNumber; | |
}(_react.Component); | |
ClockNumber.defaultProps = { | |
value: 0, | |
type: 'minute', | |
isSelected: false | |
}; | |
ClockNumber.contextTypes = { | |
muiTheme: _react.PropTypes.object.isRequired | |
}; | |
process.env.NODE_ENV !== "production" ? ClockNumber.propTypes = { | |
isSelected: _react.PropTypes.bool, | |
onSelected: _react.PropTypes.func, | |
type: _react.PropTypes.oneOf(['hour', 'minute']), | |
value: _react.PropTypes.number | |
} : void 0; | |
exports.default = ClockNumber; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 192 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _getPrototypeOf = __webpack_require__(4); | |
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | |
var _classCallCheck2 = __webpack_require__(2); | |
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | |
var _createClass2 = __webpack_require__(3); | |
var _createClass3 = _interopRequireDefault(_createClass2); | |
var _possibleConstructorReturn2 = __webpack_require__(6); | |
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | |
var _inherits2 = __webpack_require__(5); | |
var _inherits3 = _interopRequireDefault(_inherits2); | |
var _react = __webpack_require__(1); | |
var _react2 = _interopRequireDefault(_react); | |
var _timeUtils = __webpack_require__(67); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
function calcAngle(value, base) { | |
value %= base; | |
var angle = 360 / base * value; | |
return angle; | |
} | |
function getStyles(props, context, state) { | |
var hasSelected = props.hasSelected, | |
type = props.type, | |
value = props.value; | |
var inner = state.inner; | |
var timePicker = context.muiTheme.timePicker; | |
var angle = type === 'hour' ? calcAngle(value, 12) : calcAngle(value, 60); | |
var styles = { | |
root: { | |
height: inner ? '30%' : '40%', | |
background: timePicker.accentColor, | |
width: 2, | |
left: 'calc(50% - 1px)', | |
position: 'absolute', | |
bottom: '50%', | |
transformOrigin: 'bottom', | |
pointerEvents: 'none', | |
transform: 'rotateZ(' + angle + 'deg)' | |
}, | |
mark: { | |
boxSizing: 'content-box', | |
background: timePicker.selectTextColor, | |
border: '4px solid ' + timePicker.accentColor, | |
display: hasSelected && 'none', | |
width: 7, | |
height: 7, | |
position: 'absolute', | |
top: -5, | |
left: -6, | |
borderRadius: '100%' | |
} | |
}; | |
return styles; | |
} | |
var ClockPointer = function (_Component) { | |
(0, _inherits3.default)(ClockPointer, _Component); | |
function ClockPointer() { | |
var _ref; | |
var _temp, _this, _ret; | |
(0, _classCallCheck3.default)(this, ClockPointer); | |
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | |
args[_key] = arguments[_key]; | |
} | |
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = ClockPointer.__proto__ || (0, _getPrototypeOf2.default)(ClockPointer)).call.apply(_ref, [this].concat(args))), _this), _this.state = { | |
inner: false | |
}, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); | |
} | |
(0, _createClass3.default)(ClockPointer, [{ | |
key: 'componentWillMount', | |
value: function componentWillMount() { | |
this.setState({ | |
inner: (0, _timeUtils.isInner)(this.props) | |
}); | |
} | |
}, { | |
key: 'componentWillReceiveProps', | |
value: function componentWillReceiveProps(nextProps) { | |
this.setState({ | |
inner: (0, _timeUtils.isInner)(nextProps) | |
}); | |
} | |
}, { | |
key: 'render', | |
value: function render() { | |
if (this.props.value === null) { | |
return _react2.default.createElement('span', null); | |
} | |
var styles = getStyles(this.props, this.context, this.state); | |
var prepareStyles = this.context.muiTheme.prepareStyles; | |
return _react2.default.createElement( | |
'div', | |
{ style: prepareStyles(styles.root) }, | |
_react2.default.createElement('div', { style: prepareStyles(styles.mark) }) | |
); | |
} | |
}]); | |
return ClockPointer; | |
}(_react.Component); | |
ClockPointer.defaultProps = { | |
hasSelected: false, | |
value: null, | |
type: 'minute' | |
}; | |
ClockPointer.contextTypes = { | |
muiTheme: _react.PropTypes.object.isRequired | |
}; | |
process.env.NODE_ENV !== "production" ? ClockPointer.propTypes = { | |
hasSelected: _react.PropTypes.bool, | |
type: _react.PropTypes.oneOf(['hour', 'minute']), | |
value: _react.PropTypes.number | |
} : void 0; | |
exports.default = ClockPointer; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 193 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _extends2 = __webpack_require__(8); | |
var _extends3 = _interopRequireDefault(_extends2); | |
var _objectWithoutProperties2 = __webpack_require__(9); | |
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | |
var _getPrototypeOf = __webpack_require__(4); | |
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | |
var _classCallCheck2 = __webpack_require__(2); | |
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | |
var _createClass2 = __webpack_require__(3); | |
var _createClass3 = _interopRequireDefault(_createClass2); | |
var _possibleConstructorReturn2 = __webpack_require__(6); | |
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | |
var _inherits2 = __webpack_require__(5); | |
var _inherits3 = _interopRequireDefault(_inherits2); | |
var _simpleAssign = __webpack_require__(7); | |
var _simpleAssign2 = _interopRequireDefault(_simpleAssign); | |
var _react = __webpack_require__(1); | |
var _react2 = _interopRequireDefault(_react); | |
var _transitions = __webpack_require__(12); | |
var _transitions2 = _interopRequireDefault(_transitions); | |
var _AutoLockScrolling = __webpack_require__(412); | |
var _AutoLockScrolling2 = _interopRequireDefault(_AutoLockScrolling); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
function getStyles(props, context) { | |
var overlay = context.muiTheme.overlay; | |
var style = { | |
root: { | |
position: 'fixed', | |
height: '100%', | |
width: '100%', | |
top: 0, | |
left: '-100%', | |
opacity: 0, | |
backgroundColor: overlay.backgroundColor, | |
WebkitTapHighlightColor: 'rgba(0, 0, 0, 0)', // Remove mobile color flashing (deprecated) | |
// Two ways to promote overlay to its own render layer | |
willChange: 'opacity', | |
transform: 'translateZ(0)', | |
transition: props.transitionEnabled && _transitions2.default.easeOut('0ms', 'left', '400ms') + ', ' + _transitions2.default.easeOut('400ms', 'opacity') | |
} | |
}; | |
if (props.show) { | |
(0, _simpleAssign2.default)(style.root, { | |
left: 0, | |
opacity: 1, | |
transition: _transitions2.default.easeOut('0ms', 'left') + ', ' + _transitions2.default.easeOut('400ms', 'opacity') | |
}); | |
} | |
return style; | |
} | |
var Overlay = function (_Component) { | |
(0, _inherits3.default)(Overlay, _Component); | |
function Overlay() { | |
(0, _classCallCheck3.default)(this, Overlay); | |
return (0, _possibleConstructorReturn3.default)(this, (Overlay.__proto__ || (0, _getPrototypeOf2.default)(Overlay)).apply(this, arguments)); | |
} | |
(0, _createClass3.default)(Overlay, [{ | |
key: 'setOpacity', | |
value: function setOpacity(opacity) { | |
this.refs.overlay.style.opacity = opacity; | |
} | |
}, { | |
key: 'render', | |
value: function render() { | |
var _props = this.props, | |
autoLockScrolling = _props.autoLockScrolling, | |
show = _props.show, | |
style = _props.style, | |
transitionEnabled = _props.transitionEnabled, | |
other = (0, _objectWithoutProperties3.default)(_props, ['autoLockScrolling', 'show', 'style', 'transitionEnabled']); | |
var prepareStyles = this.context.muiTheme.prepareStyles; | |
var styles = getStyles(this.props, this.context); | |
return _react2.default.createElement( | |
'div', | |
(0, _extends3.default)({}, other, { ref: 'overlay', style: prepareStyles((0, _simpleAssign2.default)(styles.root, style)) }), | |
autoLockScrolling && _react2.default.createElement(_AutoLockScrolling2.default, { lock: show }) | |
); | |
} | |
}]); | |
return Overlay; | |
}(_react.Component); | |
Overlay.defaultProps = { | |
autoLockScrolling: true, | |
style: {}, | |
transitionEnabled: true | |
}; | |
Overlay.contextTypes = { | |
muiTheme: _react.PropTypes.object.isRequired | |
}; | |
process.env.NODE_ENV !== "production" ? Overlay.propTypes = { | |
autoLockScrolling: _react.PropTypes.bool, | |
show: _react.PropTypes.bool.isRequired, | |
/** | |
* Override the inline-styles of the root element. | |
*/ | |
style: _react.PropTypes.object, | |
transitionEnabled: _react.PropTypes.bool | |
} : void 0; | |
exports.default = Overlay; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 194 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _getPrototypeOf = __webpack_require__(4); | |
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | |
var _classCallCheck2 = __webpack_require__(2); | |
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | |
var _createClass2 = __webpack_require__(3); | |
var _createClass3 = _interopRequireDefault(_createClass2); | |
var _possibleConstructorReturn2 = __webpack_require__(6); | |
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | |
var _inherits2 = __webpack_require__(5); | |
var _inherits3 = _interopRequireDefault(_inherits2); | |
var _react = __webpack_require__(1); | |
var _reactDom = __webpack_require__(15); | |
var _dom = __webpack_require__(197); | |
var _dom2 = _interopRequireDefault(_dom); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
// heavily inspired by https://github.com/Khan/react-components/blob/master/js/layered-component-mixin.jsx | |
var RenderToLayer = function (_Component) { | |
(0, _inherits3.default)(RenderToLayer, _Component); | |
function RenderToLayer() { | |
var _ref; | |
var _temp, _this, _ret; | |
(0, _classCallCheck3.default)(this, RenderToLayer); | |
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | |
args[_key] = arguments[_key]; | |
} | |
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = RenderToLayer.__proto__ || (0, _getPrototypeOf2.default)(RenderToLayer)).call.apply(_ref, [this].concat(args))), _this), _this.onClickAway = function (event) { | |
if (event.defaultPrevented) { | |
return; | |
} | |
if (!_this.props.componentClickAway) { | |
return; | |
} | |
if (!_this.props.open) { | |
return; | |
} | |
var el = _this.layer; | |
if (event.target !== el && event.target === window || document.documentElement.contains(event.target) && !_dom2.default.isDescendant(el, event.target)) { | |
_this.props.componentClickAway(event); | |
} | |
}, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); | |
} | |
(0, _createClass3.default)(RenderToLayer, [{ | |
key: 'componentDidMount', | |
value: function componentDidMount() { | |
this.renderLayer(); | |
} | |
}, { | |
key: 'componentDidUpdate', | |
value: function componentDidUpdate() { | |
this.renderLayer(); | |
} | |
}, { | |
key: 'componentWillUnmount', | |
value: function componentWillUnmount() { | |
this.unrenderLayer(); | |
} | |
}, { | |
key: 'getLayer', | |
value: function getLayer() { | |
return this.layer; | |
} | |
}, { | |
key: 'unrenderLayer', | |
value: function unrenderLayer() { | |
if (!this.layer) { | |
return; | |
} | |
if (this.props.useLayerForClickAway) { | |
this.layer.style.position = 'relative'; | |
this.layer.removeEventListener('touchstart', this.onClickAway); | |
this.layer.removeEventListener('click', this.onClickAway); | |
} else { | |
window.removeEventListener('touchstart', this.onClickAway); | |
window.removeEventListener('click', this.onClickAway); | |
} | |
(0, _reactDom.unmountComponentAtNode)(this.layer); | |
document.body.removeChild(this.layer); | |
this.layer = null; | |
} | |
/** | |
* By calling this method in componentDidMount() and | |
* componentDidUpdate(), you're effectively creating a "wormhole" that | |
* funnels React's hierarchical updates through to a DOM node on an | |
* entirely different part of the page. | |
*/ | |
}, { | |
key: 'renderLayer', | |
value: function renderLayer() { | |
var _this2 = this; | |
var _props = this.props, | |
open = _props.open, | |
render = _props.render; | |
if (open) { | |
if (!this.layer) { | |
this.layer = document.createElement('div'); | |
document.body.appendChild(this.layer); | |
if (this.props.useLayerForClickAway) { | |
this.layer.addEventListener('touchstart', this.onClickAway); | |
this.layer.addEventListener('click', this.onClickAway); | |
this.layer.style.position = 'fixed'; | |
this.layer.style.top = 0; | |
this.layer.style.bottom = 0; | |
this.layer.style.left = 0; | |
this.layer.style.right = 0; | |
this.layer.style.zIndex = this.context.muiTheme.zIndex.layer; | |
} else { | |
setTimeout(function () { | |
window.addEventListener('touchstart', _this2.onClickAway); | |
window.addEventListener('click', _this2.onClickAway); | |
}, 0); | |
} | |
} | |
var layerElement = render(); | |
this.layerElement = (0, _reactDom.unstable_renderSubtreeIntoContainer)(this, layerElement, this.layer); | |
} else { | |
this.unrenderLayer(); | |
} | |
} | |
}, { | |
key: 'render', | |
value: function render() { | |
return null; | |
} | |
}]); | |
return RenderToLayer; | |
}(_react.Component); | |
RenderToLayer.defaultProps = { | |
useLayerForClickAway: true | |
}; | |
RenderToLayer.contextTypes = { | |
muiTheme: _react.PropTypes.object.isRequired | |
}; | |
process.env.NODE_ENV !== "production" ? RenderToLayer.propTypes = { | |
componentClickAway: _react.PropTypes.func, | |
open: _react.PropTypes.bool.isRequired, | |
render: _react.PropTypes.func.isRequired, | |
useLayerForClickAway: _react.PropTypes.bool | |
} : void 0; | |
exports.default = RenderToLayer; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 195 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _extends2 = __webpack_require__(8); | |
var _extends3 = _interopRequireDefault(_extends2); | |
var _objectWithoutProperties2 = __webpack_require__(9); | |
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | |
var _getPrototypeOf = __webpack_require__(4); | |
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | |
var _classCallCheck2 = __webpack_require__(2); | |
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | |
var _createClass2 = __webpack_require__(3); | |
var _createClass3 = _interopRequireDefault(_createClass2); | |
var _possibleConstructorReturn2 = __webpack_require__(6); | |
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | |
var _inherits2 = __webpack_require__(5); | |
var _inherits3 = _interopRequireDefault(_inherits2); | |
var _simpleAssign = __webpack_require__(7); | |
var _simpleAssign2 = _interopRequireDefault(_simpleAssign); | |
var _react = __webpack_require__(1); | |
var _react2 = _interopRequireDefault(_react); | |
var _transitions = __webpack_require__(12); | |
var _transitions2 = _interopRequireDefault(_transitions); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
function getStyles(props, context, state) { | |
var verticalPosition = props.verticalPosition; | |
var horizontalPosition = props.horizontalPosition; | |
var touchMarginOffset = props.touch ? 10 : 0; | |
var touchOffsetTop = props.touch ? -20 : -10; | |
var offset = verticalPosition === 'bottom' ? 14 + touchMarginOffset : -14 - touchMarginOffset; | |
var _context$muiTheme = context.muiTheme, | |
baseTheme = _context$muiTheme.baseTheme, | |
zIndex = _context$muiTheme.zIndex, | |
tooltip = _context$muiTheme.tooltip; | |
var styles = { | |
root: { | |
position: 'absolute', | |
fontFamily: baseTheme.fontFamily, | |
fontSize: '10px', | |
lineHeight: '22px', | |
padding: '0 8px', | |
zIndex: zIndex.tooltip, | |
color: tooltip.color, | |
overflow: 'hidden', | |
top: -10000, | |
borderRadius: 2, | |
userSelect: 'none', | |
opacity: 0, | |
right: horizontalPosition === 'left' ? 12 : null, | |
left: horizontalPosition === 'center' ? (state.offsetWidth - 48) / 2 * -1 : horizontalPosition === 'right' ? 12 : null, | |
transition: _transitions2.default.easeOut('0ms', 'top', '450ms') + ', ' + _transitions2.default.easeOut('450ms', 'transform', '0ms') + ', ' + _transitions2.default.easeOut('450ms', 'opacity', '0ms') | |
}, | |
label: { | |
position: 'relative', | |
whiteSpace: 'nowrap' | |
}, | |
ripple: { | |
position: 'absolute', | |
left: horizontalPosition === 'center' ? '50%' : horizontalPosition === 'left' ? '100%' : '0%', | |
top: verticalPosition === 'bottom' ? 0 : '100%', | |
transform: 'translate(-50%, -50%)', | |
borderRadius: '50%', | |
backgroundColor: 'transparent', | |
transition: _transitions2.default.easeOut('0ms', 'width', '450ms') + ', ' + _transitions2.default.easeOut('0ms', 'height', '450ms') + ', ' + _transitions2.default.easeOut('450ms', 'backgroundColor', '0ms') | |
}, | |
rootWhenShown: { | |
top: verticalPosition === 'top' ? touchOffsetTop : 36, | |
opacity: 0.9, | |
transform: 'translate(0px, ' + offset + 'px)', | |
transition: _transitions2.default.easeOut('0ms', 'top', '0ms') + ', ' + _transitions2.default.easeOut('450ms', 'transform', '0ms') + ', ' + _transitions2.default.easeOut('450ms', 'opacity', '0ms') | |
}, | |
rootWhenTouched: { | |
fontSize: '14px', | |
lineHeight: '32px', | |
padding: '0 16px' | |
}, | |
rippleWhenShown: { | |
backgroundColor: tooltip.rippleBackgroundColor, | |
transition: _transitions2.default.easeOut('450ms', 'width', '0ms') + ', ' + _transitions2.default.easeOut('450ms', 'height', '0ms') + ', ' + _transitions2.default.easeOut('450ms', 'backgroundColor', '0ms') | |
} | |
}; | |
return styles; | |
} | |
var Tooltip = function (_Component) { | |
(0, _inherits3.default)(Tooltip, _Component); | |
function Tooltip() { | |
var _ref; | |
var _temp, _this, _ret; | |
(0, _classCallCheck3.default)(this, Tooltip); | |
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | |
args[_key] = arguments[_key]; | |
} | |
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = Tooltip.__proto__ || (0, _getPrototypeOf2.default)(Tooltip)).call.apply(_ref, [this].concat(args))), _this), _this.state = { | |
offsetWidth: null | |
}, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); | |
} | |
(0, _createClass3.default)(Tooltip, [{ | |
key: 'componentDidMount', | |
value: function componentDidMount() { | |
this.setRippleSize(); | |
this.setTooltipPosition(); | |
} | |
}, { | |
key: 'componentWillReceiveProps', | |
value: function componentWillReceiveProps() { | |
this.setTooltipPosition(); | |
} | |
}, { | |
key: 'componentDidUpdate', | |
value: function componentDidUpdate() { | |
this.setRippleSize(); | |
} | |
}, { | |
key: 'setRippleSize', | |
value: function setRippleSize() { | |
var ripple = this.refs.ripple; | |
var tooltip = this.refs.tooltip; | |
var tooltipWidth = parseInt(tooltip.offsetWidth, 10) / (this.props.horizontalPosition === 'center' ? 2 : 1); | |
var tooltipHeight = parseInt(tooltip.offsetHeight, 10); | |
var rippleDiameter = Math.ceil(Math.sqrt(Math.pow(tooltipHeight, 2) + Math.pow(tooltipWidth, 2)) * 2); | |
if (this.props.show) { | |
ripple.style.height = rippleDiameter + 'px'; | |
ripple.style.width = rippleDiameter + 'px'; | |
} else { | |
ripple.style.width = '0px'; | |
ripple.style.height = '0px'; | |
} | |
} | |
}, { | |
key: 'setTooltipPosition', | |
value: function setTooltipPosition() { | |
this.setState({ offsetWidth: this.refs.tooltip.offsetWidth }); | |
} | |
}, { | |
key: 'render', | |
value: function render() { | |
var _props = this.props, | |
horizontalPosition = _props.horizontalPosition, | |
label = _props.label, | |
show = _props.show, | |
touch = _props.touch, | |
verticalPosition = _props.verticalPosition, | |
other = (0, _objectWithoutProperties3.default)(_props, ['horizontalPosition', 'label', 'show', 'touch', 'verticalPosition']); | |
var prepareStyles = this.context.muiTheme.prepareStyles; | |
var styles = getStyles(this.props, this.context, this.state); | |
return _react2.default.createElement( | |
'div', | |
(0, _extends3.default)({}, other, { | |
ref: 'tooltip', | |
style: prepareStyles((0, _simpleAssign2.default)(styles.root, this.props.show && styles.rootWhenShown, this.props.touch && styles.rootWhenTouched, this.props.style)) | |
}), | |
_react2.default.createElement('div', { | |
ref: 'ripple', | |
style: prepareStyles((0, _simpleAssign2.default)(styles.ripple, this.props.show && styles.rippleWhenShown)) | |
}), | |
_react2.default.createElement( | |
'span', | |
{ style: prepareStyles(styles.label) }, | |
label | |
) | |
); | |
} | |
}]); | |
return Tooltip; | |
}(_react.Component); | |
Tooltip.contextTypes = { | |
muiTheme: _react.PropTypes.object.isRequired | |
}; | |
process.env.NODE_ENV !== "production" ? Tooltip.propTypes = { | |
/** | |
* The css class name of the root element. | |
*/ | |
className: _react.PropTypes.string, | |
horizontalPosition: _react.PropTypes.oneOf(['left', 'right', 'center']), | |
label: _react.PropTypes.node.isRequired, | |
show: _react.PropTypes.bool, | |
/** | |
* Override the inline-styles of the root element. | |
*/ | |
style: _react.PropTypes.object, | |
touch: _react.PropTypes.bool, | |
verticalPosition: _react.PropTypes.oneOf(['top', 'bottom']) | |
} : void 0; | |
exports.default = Tooltip; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 196 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _toConsumableArray2 = __webpack_require__(61); | |
var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2); | |
var _getPrototypeOf = __webpack_require__(4); | |
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | |
var _classCallCheck2 = __webpack_require__(2); | |
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | |
var _createClass2 = __webpack_require__(3); | |
var _createClass3 = _interopRequireDefault(_createClass2); | |
var _possibleConstructorReturn2 = __webpack_require__(6); | |
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | |
var _inherits2 = __webpack_require__(5); | |
var _inherits3 = _interopRequireDefault(_inherits2); | |
var _toArray2 = __webpack_require__(169); | |
var _toArray3 = _interopRequireDefault(_toArray2); | |
var _simpleAssign = __webpack_require__(7); | |
var _simpleAssign2 = _interopRequireDefault(_simpleAssign); | |
var _react = __webpack_require__(1); | |
var _react2 = _interopRequireDefault(_react); | |
var _reactDom = __webpack_require__(15); | |
var _reactDom2 = _interopRequireDefault(_reactDom); | |
var _reactAddonsTransitionGroup = __webpack_require__(69); | |
var _reactAddonsTransitionGroup2 = _interopRequireDefault(_reactAddonsTransitionGroup); | |
var _dom = __webpack_require__(197); | |
var _dom2 = _interopRequireDefault(_dom); | |
var _CircleRipple = __webpack_require__(414); | |
var _CircleRipple2 = _interopRequireDefault(_CircleRipple); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
// Remove the first element of the array | |
var shift = function shift(_ref) { | |
var _ref2 = (0, _toArray3.default)(_ref), | |
newArray = _ref2.slice(1); | |
return newArray; | |
}; | |
var TouchRipple = function (_Component) { | |
(0, _inherits3.default)(TouchRipple, _Component); | |
function TouchRipple(props, context) { | |
(0, _classCallCheck3.default)(this, TouchRipple); | |
// Touch start produces a mouse down event for compat reasons. To avoid | |
// showing ripples twice we skip showing a ripple for the first mouse down | |
// after a touch start. Note we don't store ignoreNextMouseDown in this.state | |
// to avoid re-rendering when we change it. | |
var _this = (0, _possibleConstructorReturn3.default)(this, (TouchRipple.__proto__ || (0, _getPrototypeOf2.default)(TouchRipple)).call(this, props, context)); | |
_this.handleMouseDown = function (event) { | |
// only listen to left clicks | |
if (event.button === 0) { | |
_this.start(event, false); | |
} | |
}; | |
_this.handleMouseUp = function () { | |
_this.end(); | |
}; | |
_this.handleMouseLeave = function () { | |
_this.end(); | |
}; | |
_this.handleTouchStart = function (event) { | |
event.stopPropagation(); | |
// If the user is swiping (not just tapping), save the position so we can | |
// abort ripples if the user appears to be scrolling. | |
if (_this.props.abortOnScroll && event.touches) { | |
_this.startListeningForScrollAbort(event); | |
_this.startTime = Date.now(); | |
} | |
_this.start(event, true); | |
}; | |
_this.handleTouchEnd = function () { | |
_this.end(); | |
}; | |
_this.handleTouchMove = function (event) { | |
// Stop trying to abort if we're already 300ms into the animation | |
var timeSinceStart = Math.abs(Date.now() - _this.startTime); | |
if (timeSinceStart > 300) { | |
_this.stopListeningForScrollAbort(); | |
return; | |
} | |
// If the user is scrolling... | |
var deltaY = Math.abs(event.touches[0].clientY - _this.firstTouchY); | |
var deltaX = Math.abs(event.touches[0].clientX - _this.firstTouchX); | |
// Call it a scroll after an arbitrary 6px (feels reasonable in testing) | |
if (deltaY > 6 || deltaX > 6) { | |
var currentRipples = _this.state.ripples; | |
var ripple = currentRipples[0]; | |
// This clone will replace the ripple in ReactTransitionGroup with a | |
// version that will disappear immediately when removed from the DOM | |
var abortedRipple = _react2.default.cloneElement(ripple, { aborted: true }); | |
// Remove the old ripple and replace it with the new updated one | |
currentRipples = shift(currentRipples); | |
currentRipples = [].concat((0, _toConsumableArray3.default)(currentRipples), [abortedRipple]); | |
_this.setState({ ripples: currentRipples }, function () { | |
// Call end after we've set the ripple to abort otherwise the setState | |
// in end() merges with this and the ripple abort fails | |
_this.end(); | |
}); | |
} | |
}; | |
_this.ignoreNextMouseDown = false; | |
_this.state = { | |
// This prop allows us to only render the ReactTransitionGroup | |
// on the first click of the component, making the inital render faster. | |
hasRipples: false, | |
nextKey: 0, | |
ripples: [] | |
}; | |
return _this; | |
} | |
(0, _createClass3.default)(TouchRipple, [{ | |
key: 'start', | |
value: function start(event, isRippleTouchGenerated) { | |
var theme = this.context.muiTheme.ripple; | |
if (this.ignoreNextMouseDown && !isRippleTouchGenerated) { | |
this.ignoreNextMouseDown = false; | |
return; | |
} | |
var ripples = this.state.ripples; | |
// Add a ripple to the ripples array | |
ripples = [].concat((0, _toConsumableArray3.default)(ripples), [_react2.default.createElement(_CircleRipple2.default, { | |
key: this.state.nextKey, | |
style: !this.props.centerRipple ? this.getRippleStyle(event) : {}, | |
color: this.props.color || theme.color, | |
opacity: this.props.opacity, | |
touchGenerated: isRippleTouchGenerated | |
})]); | |
this.ignoreNextMouseDown = isRippleTouchGenerated; | |
this.setState({ | |
hasRipples: true, | |
nextKey: this.state.nextKey + 1, | |
ripples: ripples | |
}); | |
} | |
}, { | |
key: 'end', | |
value: function end() { | |
var currentRipples = this.state.ripples; | |
this.setState({ | |
ripples: shift(currentRipples) | |
}); | |
if (this.props.abortOnScroll) { | |
this.stopListeningForScrollAbort(); | |
} | |
} | |
// Check if the user seems to be scrolling and abort the animation if so | |
}, { | |
key: 'startListeningForScrollAbort', | |
value: function startListeningForScrollAbort(event) { | |
this.firstTouchY = event.touches[0].clientY; | |
this.firstTouchX = event.touches[0].clientX; | |
// Note that when scolling Chrome throttles this event to every 200ms | |
// Also note we don't listen for scroll events directly as there's no general | |
// way to cover cases like scrolling within containers on the page | |
document.body.addEventListener('touchmove', this.handleTouchMove); | |
} | |
}, { | |
key: 'stopListeningForScrollAbort', | |
value: function stopListeningForScrollAbort() { | |
document.body.removeEventListener('touchmove', this.handleTouchMove); | |
} | |
}, { | |
key: 'getRippleStyle', | |
value: function getRippleStyle(event) { | |
var el = _reactDom2.default.findDOMNode(this); | |
var elHeight = el.offsetHeight; | |
var elWidth = el.offsetWidth; | |
var offset = _dom2.default.offset(el); | |
var isTouchEvent = event.touches && event.touches.length; | |
var pageX = isTouchEvent ? event.touches[0].pageX : event.pageX; | |
var pageY = isTouchEvent ? event.touches[0].pageY : event.pageY; | |
var pointerX = pageX - offset.left; | |
var pointerY = pageY - offset.top; | |
var topLeftDiag = this.calcDiag(pointerX, pointerY); | |
var topRightDiag = this.calcDiag(elWidth - pointerX, pointerY); | |
var botRightDiag = this.calcDiag(elWidth - pointerX, elHeight - pointerY); | |
var botLeftDiag = this.calcDiag(pointerX, elHeight - pointerY); | |
var rippleRadius = Math.max(topLeftDiag, topRightDiag, botRightDiag, botLeftDiag); | |
var rippleSize = rippleRadius * 2; | |
var left = pointerX - rippleRadius; | |
var top = pointerY - rippleRadius; | |
return { | |
directionInvariant: true, | |
height: rippleSize, | |
width: rippleSize, | |
top: top, | |
left: left | |
}; | |
} | |
}, { | |
key: 'calcDiag', | |
value: function calcDiag(a, b) { | |
return Math.sqrt(a * a + b * b); | |
} | |
}, { | |
key: 'render', | |
value: function render() { | |
var _props = this.props, | |
children = _props.children, | |
style = _props.style; | |
var _state = this.state, | |
hasRipples = _state.hasRipples, | |
ripples = _state.ripples; | |
var prepareStyles = this.context.muiTheme.prepareStyles; | |
var rippleGroup = void 0; | |
if (hasRipples) { | |
var mergedStyles = (0, _simpleAssign2.default)({ | |
height: '100%', | |
width: '100%', | |
position: 'absolute', | |
top: 0, | |
left: 0, | |
overflow: 'hidden', | |
pointerEvents: 'none' | |
}, style); | |
rippleGroup = _react2.default.createElement( | |
_reactAddonsTransitionGroup2.default, | |
{ style: prepareStyles(mergedStyles) }, | |
ripples | |
); | |
} | |
return _react2.default.createElement( | |
'div', | |
{ | |
onMouseUp: this.handleMouseUp, | |
onMouseDown: this.handleMouseDown, | |
onMouseLeave: this.handleMouseLeave, | |
onTouchStart: this.handleTouchStart, | |
onTouchEnd: this.handleTouchEnd | |
}, | |
rippleGroup, | |
children | |
); | |
} | |
}]); | |
return TouchRipple; | |
}(_react.Component); | |
TouchRipple.defaultProps = { | |
abortOnScroll: true | |
}; | |
TouchRipple.contextTypes = { | |
muiTheme: _react.PropTypes.object.isRequired | |
}; | |
process.env.NODE_ENV !== "production" ? TouchRipple.propTypes = { | |
abortOnScroll: _react.PropTypes.bool, | |
centerRipple: _react.PropTypes.bool, | |
children: _react.PropTypes.node, | |
color: _react.PropTypes.string, | |
opacity: _react.PropTypes.number, | |
style: _react.PropTypes.object | |
} : void 0; | |
exports.default = TouchRipple; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 197 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = { | |
isDescendant: function isDescendant(parent, child) { | |
var node = child.parentNode; | |
while (node !== null) { | |
if (node === parent) return true; | |
node = node.parentNode; | |
} | |
return false; | |
}, | |
offset: function offset(el) { | |
var rect = el.getBoundingClientRect(); | |
return { | |
top: rect.top + document.body.scrollTop, | |
left: rect.left + document.body.scrollLeft | |
}; | |
} | |
}; | |
/***/ }), | |
/* 198 */ | |
/***/ (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. | |
* | |
*/ | |
/** | |
* CSS properties which accept numbers but are not in units of "px". | |
*/ | |
var isUnitlessNumber = { | |
animationIterationCount: true, | |
borderImageOutset: true, | |
borderImageSlice: true, | |
borderImageWidth: true, | |
boxFlex: true, | |
boxFlexGroup: true, | |
boxOrdinalGroup: true, | |
columnCount: true, | |
flex: true, | |
flexGrow: true, | |
flexPositive: true, | |
flexShrink: true, | |
flexNegative: true, | |
flexOrder: true, | |
gridRow: true, | |
gridColumn: true, | |
fontWeight: true, | |
lineClamp: true, | |
lineHeight: true, | |
opacity: true, | |
order: true, | |
orphans: true, | |
tabSize: true, | |
widows: true, | |
zIndex: true, | |
zoom: true, | |
// SVG-related properties | |
fillOpacity: true, | |
floodOpacity: true, | |
stopOpacity: true, | |
strokeDasharray: true, | |
strokeDashoffset: true, | |
strokeMiterlimit: true, | |
strokeOpacity: true, | |
strokeWidth: true | |
}; | |
/** | |
* @param {string} prefix vendor-specific prefix, eg: Webkit | |
* @param {string} key style name, eg: transitionDuration | |
* @return {string} style name prefixed with `prefix`, properly camelCased, eg: | |
* WebkitTransitionDuration | |
*/ | |
function prefixKey(prefix, key) { | |
return prefix + key.charAt(0).toUpperCase() + key.substring(1); | |
} | |
/** | |
* Support style names that may come passed in prefixed by adding permutations | |
* of vendor prefixes. | |
*/ | |
var prefixes = ['Webkit', 'ms', 'Moz', 'O']; | |
// Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an | |
// infinite loop, because it iterates over the newly added props too. | |
Object.keys(isUnitlessNumber).forEach(function (prop) { | |
prefixes.forEach(function (prefix) { | |
isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop]; | |
}); | |
}); | |
/** | |
* Most style properties can be unset by doing .style[prop] = '' but IE8 | |
* doesn't like doing that with shorthand properties so for the properties that | |
* IE8 breaks on, which are listed here, we instead unset each of the | |
* individual properties. See http://bugs.jquery.com/ticket/12385. | |
* The 4-value 'clock' properties like margin, padding, border-width seem to | |
* behave without any problems. Curiously, list-style works too without any | |
* special prodding. | |
*/ | |
var shorthandPropertyExpansions = { | |
background: { | |
backgroundAttachment: true, | |
backgroundColor: true, | |
backgroundImage: true, | |
backgroundPositionX: true, | |
backgroundPositionY: true, | |
backgroundRepeat: true | |
}, | |
backgroundPosition: { | |
backgroundPositionX: true, | |
backgroundPositionY: true | |
}, | |
border: { | |
borderWidth: true, | |
borderStyle: true, | |
borderColor: true | |
}, | |
borderBottom: { | |
borderBottomWidth: true, | |
borderBottomStyle: true, | |
borderBottomColor: true | |
}, | |
borderLeft: { | |
borderLeftWidth: true, | |
borderLeftStyle: true, | |
borderLeftColor: true | |
}, | |
borderRight: { | |
borderRightWidth: true, | |
borderRightStyle: true, | |
borderRightColor: true | |
}, | |
borderTop: { | |
borderTopWidth: true, | |
borderTopStyle: true, | |
borderTopColor: true | |
}, | |
font: { | |
fontStyle: true, | |
fontVariant: true, | |
fontWeight: true, | |
fontSize: true, | |
lineHeight: true, | |
fontFamily: true | |
}, | |
outline: { | |
outlineWidth: true, | |
outlineStyle: true, | |
outlineColor: true | |
} | |
}; | |
var CSSProperty = { | |
isUnitlessNumber: isUnitlessNumber, | |
shorthandPropertyExpansions: shorthandPropertyExpansions | |
}; | |
module.exports = CSSProperty; | |
/***/ }), | |
/* 199 */ | |
/***/ (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 _prodInvariant = __webpack_require__(13); | |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | |
var PooledClass = __webpack_require__(48); | |
var invariant = __webpack_require__(11); | |
/** | |
* A specialized pseudo-event module to help keep track of components waiting to | |
* be notified when their DOM representations are available for use. | |
* | |
* This implements `PooledClass`, so you should never need to instantiate this. | |
* Instead, use `CallbackQueue.getPooled()`. | |
* | |
* @class ReactMountReady | |
* @implements PooledClass | |
* @internal | |
*/ | |
var CallbackQueue = function () { | |
function CallbackQueue(arg) { | |
_classCallCheck(this, CallbackQueue); | |
this._callbacks = null; | |
this._contexts = null; | |
this._arg = arg; | |
} | |
/** | |
* Enqueues a callback to be invoked when `notifyAll` is invoked. | |
* | |
* @param {function} callback Invoked when `notifyAll` is invoked. | |
* @param {?object} context Context to call `callback` with. | |
* @internal | |
*/ | |
CallbackQueue.prototype.enqueue = function enqueue(callback, context) { | |
this._callbacks = this._callbacks || []; | |
this._callbacks.push(callback); | |
this._contexts = this._contexts || []; | |
this._contexts.push(context); | |
}; | |
/** | |
* Invokes all enqueued callbacks and clears the queue. This is invoked after | |
* the DOM representation of a component has been created or updated. | |
* | |
* @internal | |
*/ | |
CallbackQueue.prototype.notifyAll = function notifyAll() { | |
var callbacks = this._callbacks; | |
var contexts = this._contexts; | |
var arg = this._arg; | |
if (callbacks && contexts) { | |
!(callbacks.length === contexts.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Mismatched list of contexts in callback queue') : _prodInvariant('24') : void 0; | |
this._callbacks = null; | |
this._contexts = null; | |
for (var i = 0; i < callbacks.length; i++) { | |
callbacks[i].call(contexts[i], arg); | |
} | |
callbacks.length = 0; | |
contexts.length = 0; | |
} | |
}; | |
CallbackQueue.prototype.checkpoint = function checkpoint() { | |
return this._callbacks ? this._callbacks.length : 0; | |
}; | |
CallbackQueue.prototype.rollback = function rollback(len) { | |
if (this._callbacks && this._contexts) { | |
this._callbacks.length = len; | |
this._contexts.length = len; | |
} | |
}; | |
/** | |
* Resets the internal queue. | |
* | |
* @internal | |
*/ | |
CallbackQueue.prototype.reset = function reset() { | |
this._callbacks = null; | |
this._contexts = null; | |
}; | |
/** | |
* `PooledClass` looks for this. | |
*/ | |
CallbackQueue.prototype.destructor = function destructor() { | |
this.reset(); | |
}; | |
return CallbackQueue; | |
}(); | |
module.exports = PooledClass.addPoolingTo(CallbackQueue); | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 200 */ | |
/***/ (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 DOMProperty = __webpack_require__(39); | |
var ReactDOMComponentTree = __webpack_require__(16); | |
var ReactInstrumentation = __webpack_require__(26); | |
var quoteAttributeValueForBrowser = __webpack_require__(518); | |
var warning = __webpack_require__(10); | |
var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + DOMProperty.ATTRIBUTE_NAME_START_CHAR + '][' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$'); | |
var illegalAttributeNameCache = {}; | |
var validatedAttributeNameCache = {}; | |
function isAttributeNameSafe(attributeName) { | |
if (validatedAttributeNameCache.hasOwnProperty(attributeName)) { | |
return true; | |
} | |
if (illegalAttributeNameCache.hasOwnProperty(attributeName)) { | |
return false; | |
} | |
if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) { | |
validatedAttributeNameCache[attributeName] = true; | |
return true; | |
} | |
illegalAttributeNameCache[attributeName] = true; | |
process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid attribute name: `%s`', attributeName) : void 0; | |
return false; | |
} | |
function shouldIgnoreValue(propertyInfo, value) { | |
return value == null || propertyInfo.hasBooleanValue && !value || propertyInfo.hasNumericValue && isNaN(value) || propertyInfo.hasPositiveNumericValue && value < 1 || propertyInfo.hasOverloadedBooleanValue && value === false; | |
} | |
/** | |
* Operations for dealing with DOM properties. | |
*/ | |
var DOMPropertyOperations = { | |
/** | |
* Creates markup for the ID property. | |
* | |
* @param {string} id Unescaped ID. | |
* @return {string} Markup string. | |
*/ | |
createMarkupForID: function (id) { | |
return DOMProperty.ID_ATTRIBUTE_NAME + '=' + quoteAttributeValueForBrowser(id); | |
}, | |
setAttributeForID: function (node, id) { | |
node.setAttribute(DOMProperty.ID_ATTRIBUTE_NAME, id); | |
}, | |
createMarkupForRoot: function () { | |
return DOMProperty.ROOT_ATTRIBUTE_NAME + '=""'; | |
}, | |
setAttributeForRoot: function (node) { | |
node.setAttribute(DOMProperty.ROOT_ATTRIBUTE_NAME, ''); | |
}, | |
/** | |
* Creates markup for a property. | |
* | |
* @param {string} name | |
* @param {*} value | |
* @return {?string} Markup string, or null if the property was invalid. | |
*/ | |
createMarkupForProperty: function (name, value) { | |
var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null; | |
if (propertyInfo) { | |
if (shouldIgnoreValue(propertyInfo, value)) { | |
return ''; | |
} | |
var attributeName = propertyInfo.attributeName; | |
if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) { | |
return attributeName + '=""'; | |
} | |
return attributeName + '=' + quoteAttributeValueForBrowser(value); | |
} else if (DOMProperty.isCustomAttribute(name)) { | |
if (value == null) { | |
return ''; | |
} | |
return name + '=' + quoteAttributeValueForBrowser(value); | |
} | |
return null; | |
}, | |
/** | |
* Creates markup for a custom property. | |
* | |
* @param {string} name | |
* @param {*} value | |
* @return {string} Markup string, or empty string if the property was invalid. | |
*/ | |
createMarkupForCustomAttribute: function (name, value) { | |
if (!isAttributeNameSafe(name) || value == null) { | |
return ''; | |
} | |
return name + '=' + quoteAttributeValueForBrowser(value); | |
}, | |
/** | |
* Sets the value for a property on a node. | |
* | |
* @param {DOMElement} node | |
* @param {string} name | |
* @param {*} value | |
*/ | |
setValueForProperty: function (node, name, value) { | |
var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null; | |
if (propertyInfo) { | |
var mutationMethod = propertyInfo.mutationMethod; | |
if (mutationMethod) { | |
mutationMethod(node, value); | |
} else if (shouldIgnoreValue(propertyInfo, value)) { | |
this.deleteValueForProperty(node, name); | |
return; | |
} else if (propertyInfo.mustUseProperty) { | |
// Contrary to `setAttribute`, object properties are properly | |
// `toString`ed by IE8/9. | |
node[propertyInfo.propertyName] = value; | |
} else { | |
var attributeName = propertyInfo.attributeName; | |
var namespace = propertyInfo.attributeNamespace; | |
// `setAttribute` with objects becomes only `[object]` in IE8/9, | |
// ('' + value) makes it output the correct toString()-value. | |
if (namespace) { | |
node.setAttributeNS(namespace, attributeName, '' + value); | |
} else if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) { | |
node.setAttribute(attributeName, ''); | |
} else { | |
node.setAttribute(attributeName, '' + value); | |
} | |
} | |
} else if (DOMProperty.isCustomAttribute(name)) { | |
DOMPropertyOperations.setValueForAttribute(node, name, value); | |
return; | |
} | |
if (process.env.NODE_ENV !== 'production') { | |
var payload = {}; | |
payload[name] = value; | |
ReactInstrumentation.debugTool.onHostOperation({ | |
instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID, | |
type: 'update attribute', | |
payload: payload | |
}); | |
} | |
}, | |
setValueForAttribute: function (node, name, value) { | |
if (!isAttributeNameSafe(name)) { | |
return; | |
} | |
if (value == null) { | |
node.removeAttribute(name); | |
} else { | |
node.setAttribute(name, '' + value); | |
} | |
if (process.env.NODE_ENV !== 'production') { | |
var payload = {}; | |
payload[name] = value; | |
ReactInstrumentation.debugTool.onHostOperation({ | |
instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID, | |
type: 'update attribute', | |
payload: payload | |
}); | |
} | |
}, | |
/** | |
* Deletes an attributes from a node. | |
* | |
* @param {DOMElement} node | |
* @param {string} name | |
*/ | |
deleteValueForAttribute: function (node, name) { | |
node.removeAttribute(name); | |
if (process.env.NODE_ENV !== 'production') { | |
ReactInstrumentation.debugTool.onHostOperation({ | |
instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID, | |
type: 'remove attribute', | |
payload: name | |
}); | |
} | |
}, | |
/** | |
* Deletes the value for a property on a node. | |
* | |
* @param {DOMElement} node | |
* @param {string} name | |
*/ | |
deleteValueForProperty: function (node, name) { | |
var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null; | |
if (propertyInfo) { | |
var mutationMethod = propertyInfo.mutationMethod; | |
if (mutationMethod) { | |
mutationMethod(node, undefined); | |
} else if (propertyInfo.mustUseProperty) { | |
var propName = propertyInfo.propertyName; | |
if (propertyInfo.hasBooleanValue) { | |
node[propName] = false; | |
} else { | |
node[propName] = ''; | |
} | |
} else { | |
node.removeAttribute(propertyInfo.attributeName); | |
} | |
} else if (DOMProperty.isCustomAttribute(name)) { | |
node.removeAttribute(name); | |
} | |
if (process.env.NODE_ENV !== 'production') { | |
ReactInstrumentation.debugTool.onHostOperation({ | |
instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID, | |
type: 'remove attribute', | |
payload: name | |
}); | |
} | |
} | |
}; | |
module.exports = DOMPropertyOperations; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 201 */ | |
/***/ (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 ReactDOMComponentFlags = { | |
hasCachedChildNodes: 1 << 0 | |
}; | |
module.exports = ReactDOMComponentFlags; | |
/***/ }), | |
/* 202 */ | |
/***/ (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 _assign = __webpack_require__(14); | |
var LinkedValueUtils = __webpack_require__(126); | |
var ReactDOMComponentTree = __webpack_require__(16); | |
var ReactUpdates = __webpack_require__(30); | |
var warning = __webpack_require__(10); | |
var didWarnValueLink = false; | |
var didWarnValueDefaultValue = false; | |
function updateOptionsIfPendingUpdateAndMounted() { | |
if (this._rootNodeID && this._wrapperState.pendingUpdate) { | |
this._wrapperState.pendingUpdate = false; | |
var props = this._currentElement.props; | |
var value = LinkedValueUtils.getValue(props); | |
if (value != null) { | |
updateOptions(this, Boolean(props.multiple), value); | |
} | |
} | |
} | |
function getDeclarationErrorAddendum(owner) { | |
if (owner) { | |
var name = owner.getName(); | |
if (name) { | |
return ' Check the render method of `' + name + '`.'; | |
} | |
} | |
return ''; | |
} | |
var valuePropNames = ['value', 'defaultValue']; | |
/** | |
* Validation function for `value` and `defaultValue`. | |
* @private | |
*/ | |
function checkSelectPropTypes(inst, props) { | |
var owner = inst._currentElement._owner; | |
LinkedValueUtils.checkPropTypes('select', props, owner); | |
if (props.valueLink !== undefined && !didWarnValueLink) { | |
process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0; | |
didWarnValueLink = true; | |
} | |
for (var i = 0; i < valuePropNames.length; i++) { | |
var propName = valuePropNames[i]; | |
if (props[propName] == null) { | |
continue; | |
} | |
var isArray = Array.isArray(props[propName]); | |
if (props.multiple && !isArray) { | |
process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0; | |
} else if (!props.multiple && isArray) { | |
process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0; | |
} | |
} | |
} | |
/** | |
* @param {ReactDOMComponent} inst | |
* @param {boolean} multiple | |
* @param {*} propValue A stringable (with `multiple`, a list of stringables). | |
* @private | |
*/ | |
function updateOptions(inst, multiple, propValue) { | |
var selectedValue, i; | |
var options = ReactDOMComponentTree.getNodeFromInstance(inst).options; | |
if (multiple) { | |
selectedValue = {}; | |
for (i = 0; i < propValue.length; i++) { | |
selectedValue['' + propValue[i]] = true; | |
} | |
for (i = 0; i < options.length; i++) { | |
var selected = selectedValue.hasOwnProperty(options[i].value); | |
if (options[i].selected !== selected) { | |
options[i].selected = selected; | |
} | |
} | |
} else { | |
// Do not set `select.value` as exact behavior isn't consistent across all | |
// browsers for all cases. | |
selectedValue = '' + propValue; | |
for (i = 0; i < options.length; i++) { | |
if (options[i].value === selectedValue) { | |
options[i].selected = true; | |
return; | |
} | |
} | |
if (options.length) { | |
options[0].selected = true; | |
} | |
} | |
} | |
/** | |
* Implements a <select> host component that allows optionally setting the | |
* props `value` and `defaultValue`. If `multiple` is false, the prop must be a | |
* stringable. If `multiple` is true, the prop must be an array of stringables. | |
* | |
* If `value` is not supplied (or null/undefined), user actions that change the | |
* selected option will trigger updates to the rendered options. | |
* | |
* If it is supplied (and not null/undefined), the rendered options will not | |
* update in response to user actions. Instead, the `value` prop must change in | |
* order for the rendered options to update. | |
* | |
* If `defaultValue` is provided, any options with the supplied values will be | |
* selected. | |
*/ | |
var ReactDOMSelect = { | |
getHostProps: function (inst, props) { | |
return _assign({}, props, { | |
onChange: inst._wrapperState.onChange, | |
value: undefined | |
}); | |
}, | |
mountWrapper: function (inst, props) { | |
if (process.env.NODE_ENV !== 'production') { | |
checkSelectPropTypes(inst, props); | |
} | |
var value = LinkedValueUtils.getValue(props); | |
inst._wrapperState = { | |
pendingUpdate: false, | |
initialValue: value != null ? value : props.defaultValue, | |
listeners: null, | |
onChange: _handleChange.bind(inst), | |
wasMultiple: Boolean(props.multiple) | |
}; | |
if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) { | |
process.env.NODE_ENV !== 'production' ? warning(false, 'Select elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled select ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components') : void 0; | |
didWarnValueDefaultValue = true; | |
} | |
}, | |
getSelectValueContext: function (inst) { | |
// ReactDOMOption looks at this initial value so the initial generated | |
// markup has correct `selected` attributes | |
return inst._wrapperState.initialValue; | |
}, | |
postUpdateWrapper: function (inst) { | |
var props = inst._currentElement.props; | |
// After the initial mount, we control selected-ness manually so don't pass | |
// this value down | |
inst._wrapperState.initialValue = undefined; | |
var wasMultiple = inst._wrapperState.wasMultiple; | |
inst._wrapperState.wasMultiple = Boolean(props.multiple); | |
var value = LinkedValueUtils.getValue(props); | |
if (value != null) { | |
inst._wrapperState.pendingUpdate = false; | |
updateOptions(inst, Boolean(props.multiple), value); | |
} else if (wasMultiple !== Boolean(props.multiple)) { | |
// For simplicity, reapply `defaultValue` if `multiple` is toggled. | |
if (props.defaultValue != null) { | |
updateOptions(inst, Boolean(props.multiple), props.defaultValue); | |
} else { | |
// Revert the select back to its default unselected state. | |
updateOptions(inst, Boolean(props.multiple), props.multiple ? [] : ''); | |
} | |
} | |
} | |
}; | |
function _handleChange(event) { | |
var props = this._currentElement.props; | |
var returnValue = LinkedValueUtils.executeOnChange(props, event); | |
if (this._rootNodeID) { | |
this._wrapperState.pendingUpdate = true; | |
} | |
ReactUpdates.asap(updateOptionsIfPendingUpdateAndMounted, this); | |
return returnValue; | |
} | |
module.exports = ReactDOMSelect; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 203 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/** | |
* Copyright 2014-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 emptyComponentFactory; | |
var ReactEmptyComponentInjection = { | |
injectEmptyComponentFactory: function (factory) { | |
emptyComponentFactory = factory; | |
} | |
}; | |
var ReactEmptyComponent = { | |
create: function (instantiate) { | |
return emptyComponentFactory(instantiate); | |
} | |
}; | |
ReactEmptyComponent.injection = ReactEmptyComponentInjection; | |
module.exports = ReactEmptyComponent; | |
/***/ }), | |
/* 204 */ | |
/***/ (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 ReactFeatureFlags = { | |
// When true, call console.time() before and .timeEnd() after each top-level | |
// render (both initial renders and updates). Useful when looking at prod-mode | |
// timeline profiles in Chrome, for example. | |
logTopLevelRenders: false | |
}; | |
module.exports = ReactFeatureFlags; | |
/***/ }), | |
/* 205 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) {/** | |
* Copyright 2014-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 _prodInvariant = __webpack_require__(13); | |
var invariant = __webpack_require__(11); | |
var genericComponentClass = null; | |
var textComponentClass = null; | |
var ReactHostComponentInjection = { | |
// This accepts a class that receives the tag string. This is a catch all | |
// that can render any kind of tag. | |
injectGenericComponentClass: function (componentClass) { | |
genericComponentClass = componentClass; | |
}, | |
// This accepts a text component class that takes the text string to be | |
// rendered as props. | |
injectTextComponentClass: function (componentClass) { | |
textComponentClass = componentClass; | |
} | |
}; | |
/** | |
* Get a host internal component class for a specific tag. | |
* | |
* @param {ReactElement} element The element to create. | |
* @return {function} The internal class constructor function. | |
*/ | |
function createInternalComponent(element) { | |
!genericComponentClass ? process.env.NODE_ENV !== 'production' ? invariant(false, 'There is no registered component for the tag %s', element.type) : _prodInvariant('111', element.type) : void 0; | |
return new genericComponentClass(element); | |
} | |
/** | |
* @param {ReactText} text | |
* @return {ReactComponent} | |
*/ | |
function createInstanceForText(text) { | |
return new textComponentClass(text); | |
} | |
/** | |
* @param {ReactComponent} component | |
* @return {boolean} | |
*/ | |
function isTextComponent(component) { | |
return component instanceof textComponentClass; | |
} | |
var ReactHostComponent = { | |
createInternalComponent: createInternalComponent, | |
createInstanceForText: createInstanceForText, | |
isTextComponent: isTextComponent, | |
injection: ReactHostComponentInjection | |
}; | |
module.exports = ReactHostComponent; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 206 */ | |
/***/ (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 ReactDOMSelection = __webpack_require__(472); | |
var containsNode = __webpack_require__(311); | |
var focusNode = __webpack_require__(184); | |
var getActiveElement = __webpack_require__(185); | |
function isInDocument(node) { | |
return containsNode(document.documentElement, node); | |
} | |
/** | |
* @ReactInputSelection: React input selection module. Based on Selection.js, | |
* but modified to be suitable for react and has a couple of bug fixes (doesn't | |
* assume buttons have range selections allowed). | |
* Input selection module for React. | |
*/ | |
var ReactInputSelection = { | |
hasSelectionCapabilities: function (elem) { | |
var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase(); | |
return nodeName && (nodeName === 'input' && elem.type === 'text' || nodeName === 'textarea' || elem.contentEditable === 'true'); | |
}, | |
getSelectionInformation: function () { | |
var focusedElem = getActiveElement(); | |
return { | |
focusedElem: focusedElem, | |
selectionRange: ReactInputSelection.hasSelectionCapabilities(focusedElem) ? ReactInputSelection.getSelection(focusedElem) : null | |
}; | |
}, | |
/** | |
* @restoreSelection: If any selection information was potentially lost, | |
* restore it. This is useful when performing operations that could remove dom | |
* nodes and place them back in, resulting in focus being lost. | |
*/ | |
restoreSelection: function (priorSelectionInformation) { | |
var curFocusedElem = getActiveElement(); | |
var priorFocusedElem = priorSelectionInformation.focusedElem; | |
var priorSelectionRange = priorSelectionInformation.selectionRange; | |
if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) { | |
if (ReactInputSelection.hasSelectionCapabilities(priorFocusedElem)) { | |
ReactInputSelection.setSelection(priorFocusedElem, priorSelectionRange); | |
} | |
focusNode(priorFocusedElem); | |
} | |
}, | |
/** | |
* @getSelection: Gets the selection bounds of a focused textarea, input or | |
* contentEditable node. | |
* -@input: Look up selection bounds of this input | |
* -@return {start: selectionStart, end: selectionEnd} | |
*/ | |
getSelection: function (input) { | |
var selection; | |
if ('selectionStart' in input) { | |
// Modern browser with input or textarea. | |
selection = { | |
start: input.selectionStart, | |
end: input.selectionEnd | |
}; | |
} else if (document.selection && input.nodeName && input.nodeName.toLowerCase() === 'input') { | |
// IE8 input. | |
var range = document.selection.createRange(); | |
// There can only be one selection per document in IE, so it must | |
// be in our element. | |
if (range.parentElement() === input) { | |
selection = { | |
start: -range.moveStart('character', -input.value.length), | |
end: -range.moveEnd('character', -input.value.length) | |
}; | |
} | |
} else { | |
// Content editable or old IE textarea. | |
selection = ReactDOMSelection.getOffsets(input); | |
} | |
return selection || { start: 0, end: 0 }; | |
}, | |
/** | |
* @setSelection: Sets the selection bounds of a textarea or input and focuses | |
* the input. | |
* -@input Set selection bounds of this input or textarea | |
* -@offsets Object of same form that is returned from get* | |
*/ | |
setSelection: function (input, offsets) { | |
var start = offsets.start; | |
var end = offsets.end; | |
if (end === undefined) { | |
end = start; | |
} | |
if ('selectionStart' in input) { | |
input.selectionStart = start; | |
input.selectionEnd = Math.min(end, input.value.length); | |
} else if (document.selection && input.nodeName && input.nodeName.toLowerCase() === 'input') { | |
var range = input.createTextRange(); | |
range.collapse(true); | |
range.moveStart('character', start); | |
range.moveEnd('character', end - start); | |
range.select(); | |
} else { | |
ReactDOMSelection.setOffsets(input, offsets); | |
} | |
} | |
}; | |
module.exports = ReactInputSelection; | |
/***/ }), | |
/* 207 */ | |
/***/ (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 _prodInvariant = __webpack_require__(13); | |
var DOMLazyTree = __webpack_require__(58); | |
var DOMProperty = __webpack_require__(39); | |
var React = __webpack_require__(49); | |
var ReactBrowserEventEmitter = __webpack_require__(83); | |
var ReactCurrentOwner = __webpack_require__(31); | |
var ReactDOMComponentTree = __webpack_require__(16); | |
var ReactDOMContainerInfo = __webpack_require__(464); | |
var ReactDOMFeatureFlags = __webpack_require__(466); | |
var ReactFeatureFlags = __webpack_require__(204); | |
var ReactInstanceMap = __webpack_require__(72); | |
var ReactInstrumentation = __webpack_require__(26); | |
var ReactMarkupChecksum = __webpack_require__(486); | |
var ReactReconciler = __webpack_require__(59); | |
var ReactUpdateQueue = __webpack_require__(129); | |
var ReactUpdates = __webpack_require__(30); | |
var emptyObject = __webpack_require__(65); | |
var instantiateReactComponent = __webpack_require__(215); | |
var invariant = __webpack_require__(11); | |
var setInnerHTML = __webpack_require__(87); | |
var shouldUpdateReactComponent = __webpack_require__(135); | |
var warning = __webpack_require__(10); | |
var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME; | |
var ROOT_ATTR_NAME = DOMProperty.ROOT_ATTRIBUTE_NAME; | |
var ELEMENT_NODE_TYPE = 1; | |
var DOC_NODE_TYPE = 9; | |
var DOCUMENT_FRAGMENT_NODE_TYPE = 11; | |
var instancesByReactRootID = {}; | |
/** | |
* Finds the index of the first character | |
* that's not common between the two given strings. | |
* | |
* @return {number} the index of the character where the strings diverge | |
*/ | |
function firstDifferenceIndex(string1, string2) { | |
var minLen = Math.min(string1.length, string2.length); | |
for (var i = 0; i < minLen; i++) { | |
if (string1.charAt(i) !== string2.charAt(i)) { | |
return i; | |
} | |
} | |
return string1.length === string2.length ? -1 : minLen; | |
} | |
/** | |
* @param {DOMElement|DOMDocument} container DOM element that may contain | |
* a React component | |
* @return {?*} DOM element that may have the reactRoot ID, or null. | |
*/ | |
function getReactRootElementInContainer(container) { | |
if (!container) { | |
return null; | |
} | |
if (container.nodeType === DOC_NODE_TYPE) { | |
return container.documentElement; | |
} else { | |
return container.firstChild; | |
} | |
} | |
function internalGetID(node) { | |
// If node is something like a window, document, or text node, none of | |
// which support attributes or a .getAttribute method, gracefully return | |
// the empty string, as if the attribute were missing. | |
return node.getAttribute && node.getAttribute(ATTR_NAME) || ''; | |
} | |
/** | |
* Mounts this component and inserts it into the DOM. | |
* | |
* @param {ReactComponent} componentInstance The instance to mount. | |
* @param {DOMElement} container DOM element to mount into. | |
* @param {ReactReconcileTransaction} transaction | |
* @param {boolean} shouldReuseMarkup If true, do not insert markup | |
*/ | |
function mountComponentIntoNode(wrapperInstance, container, transaction, shouldReuseMarkup, context) { | |
var markerName; | |
if (ReactFeatureFlags.logTopLevelRenders) { | |
var wrappedElement = wrapperInstance._currentElement.props.child; | |
var type = wrappedElement.type; | |
markerName = 'React mount: ' + (typeof type === 'string' ? type : type.displayName || type.name); | |
console.time(markerName); | |
} | |
var markup = ReactReconciler.mountComponent(wrapperInstance, transaction, null, ReactDOMContainerInfo(wrapperInstance, container), context, 0 /* parentDebugID */ | |
); | |
if (markerName) { | |
console.timeEnd(markerName); | |
} | |
wrapperInstance._renderedComponent._topLevelWrapper = wrapperInstance; | |
ReactMount._mountImageIntoNode(markup, container, wrapperInstance, shouldReuseMarkup, transaction); | |
} | |
/** | |
* Batched mount. | |
* | |
* @param {ReactComponent} componentInstance The instance to mount. | |
* @param {DOMElement} container DOM element to mount into. | |
* @param {boolean} shouldReuseMarkup If true, do not insert markup | |
*/ | |
function batchedMountComponentIntoNode(componentInstance, container, shouldReuseMarkup, context) { | |
var transaction = ReactUpdates.ReactReconcileTransaction.getPooled( | |
/* useCreateElement */ | |
!shouldReuseMarkup && ReactDOMFeatureFlags.useCreateElement); | |
transaction.perform(mountComponentIntoNode, null, componentInstance, container, transaction, shouldReuseMarkup, context); | |
ReactUpdates.ReactReconcileTransaction.release(transaction); | |
} | |
/** | |
* Unmounts a component and removes it from the DOM. | |
* | |
* @param {ReactComponent} instance React component instance. | |
* @param {DOMElement} container DOM element to unmount from. | |
* @final | |
* @internal | |
* @see {ReactMount.unmountComponentAtNode} | |
*/ | |
function unmountComponentFromNode(instance, container, safely) { | |
if (process.env.NODE_ENV !== 'production') { | |
ReactInstrumentation.debugTool.onBeginFlush(); | |
} | |
ReactReconciler.unmountComponent(instance, safely); | |
if (process.env.NODE_ENV !== 'production') { | |
ReactInstrumentation.debugTool.onEndFlush(); | |
} | |
if (container.nodeType === DOC_NODE_TYPE) { | |
container = container.documentElement; | |
} | |
// http://jsperf.com/emptying-a-node | |
while (container.lastChild) { | |
container.removeChild(container.lastChild); | |
} | |
} | |
/** | |
* True if the supplied DOM node has a direct React-rendered child that is | |
* not a React root element. Useful for warning in `render`, | |
* `unmountComponentAtNode`, etc. | |
* | |
* @param {?DOMElement} node The candidate DOM node. | |
* @return {boolean} True if the DOM element contains a direct child that was | |
* rendered by React but is not a root element. | |
* @internal | |
*/ | |
function hasNonRootReactChild(container) { | |
var rootEl = getReactRootElementInContainer(container); | |
if (rootEl) { | |
var inst = ReactDOMComponentTree.getInstanceFromNode(rootEl); | |
return !!(inst && inst._hostParent); | |
} | |
} | |
/** | |
* True if the supplied DOM node is a React DOM element and | |
* it has been rendered by another copy of React. | |
* | |
* @param {?DOMElement} node The candidate DOM node. | |
* @return {boolean} True if the DOM has been rendered by another copy of React | |
* @internal | |
*/ | |
function nodeIsRenderedByOtherInstance(container) { | |
var rootEl = getReactRootElementInContainer(container); | |
return !!(rootEl && isReactNode(rootEl) && !ReactDOMComponentTree.getInstanceFromNode(rootEl)); | |
} | |
/** | |
* True if the supplied DOM node is a valid node element. | |
* | |
* @param {?DOMElement} node The candidate DOM node. | |
* @return {boolean} True if the DOM is a valid DOM node. | |
* @internal | |
*/ | |
function isValidContainer(node) { | |
return !!(node && (node.nodeType === ELEMENT_NODE_TYPE || node.nodeType === DOC_NODE_TYPE || node.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE)); | |
} | |
/** | |
* True if the supplied DOM node is a valid React node element. | |
* | |
* @param {?DOMElement} node The candidate DOM node. | |
* @return {boolean} True if the DOM is a valid React DOM node. | |
* @internal | |
*/ | |
function isReactNode(node) { | |
return isValidContainer(node) && (node.hasAttribute(ROOT_ATTR_NAME) || node.hasAttribute(ATTR_NAME)); | |
} | |
function getHostRootInstanceInContainer(container) { | |
var rootEl = getReactRootElementInContainer(container); | |
var prevHostInstance = rootEl && ReactDOMComponentTree.getInstanceFromNode(rootEl); | |
return prevHostInstance && !prevHostInstance._hostParent ? prevHostInstance : null; | |
} | |
function getTopLevelWrapperInContainer(container) { | |
var root = getHostRootInstanceInContainer(container); | |
return root ? root._hostContainerInfo._topLevelWrapper : null; | |
} | |
/** | |
* Temporary (?) hack so that we can store all top-level pending updates on | |
* composites instead of having to worry about different types of components | |
* here. | |
*/ | |
var topLevelRootCounter = 1; | |
var TopLevelWrapper = function () { | |
this.rootID = topLevelRootCounter++; | |
}; | |
TopLevelWrapper.prototype.isReactComponent = {}; | |
if (process.env.NODE_ENV !== 'production') { | |
TopLevelWrapper.displayName = 'TopLevelWrapper'; | |
} | |
TopLevelWrapper.prototype.render = function () { | |
return this.props.child; | |
}; | |
TopLevelWrapper.isReactTopLevelWrapper = true; | |
/** | |
* Mounting is the process of initializing a React component by creating its | |
* representative DOM elements and inserting them into a supplied `container`. | |
* Any prior content inside `container` is destroyed in the process. | |
* | |
* ReactMount.render( | |
* component, | |
* document.getElementById('container') | |
* ); | |
* | |
* <div id="container"> <-- Supplied `container`. | |
* <div data-reactid=".3"> <-- Rendered reactRoot of React | |
* // ... component. | |
* </div> | |
* </div> | |
* | |
* Inside of `container`, the first element rendered is the "reactRoot". | |
*/ | |
var ReactMount = { | |
TopLevelWrapper: TopLevelWrapper, | |
/** | |
* Used by devtools. The keys are not important. | |
*/ | |
_instancesByReactRootID: instancesByReactRootID, | |
/** | |
* This is a hook provided to support rendering React components while | |
* ensuring that the apparent scroll position of its `container` does not | |
* change. | |
* | |
* @param {DOMElement} container The `container` being rendered into. | |
* @param {function} renderCallback This must be called once to do the render. | |
*/ | |
scrollMonitor: function (container, renderCallback) { | |
renderCallback(); | |
}, | |
/** | |
* Take a component that's already mounted into the DOM and replace its props | |
* @param {ReactComponent} prevComponent component instance already in the DOM | |
* @param {ReactElement} nextElement component instance to render | |
* @param {DOMElement} container container to render into | |
* @param {?function} callback function triggered on completion | |
*/ | |
_updateRootComponent: function (prevComponent, nextElement, nextContext, container, callback) { | |
ReactMount.scrollMonitor(container, function () { | |
ReactUpdateQueue.enqueueElementInternal(prevComponent, nextElement, nextContext); | |
if (callback) { | |
ReactUpdateQueue.enqueueCallbackInternal(prevComponent, callback); | |
} | |
}); | |
return prevComponent; | |
}, | |
/** | |
* Render a new component into the DOM. Hooked by hooks! | |
* | |
* @param {ReactElement} nextElement element to render | |
* @param {DOMElement} container container to render into | |
* @param {boolean} shouldReuseMarkup if we should skip the markup insertion | |
* @return {ReactComponent} nextComponent | |
*/ | |
_renderNewRootComponent: function (nextElement, container, shouldReuseMarkup, context) { | |
// Various parts of our code (such as ReactCompositeComponent's | |
// _renderValidatedComponent) assume that calls to render aren't nested; | |
// verify that that's the case. | |
process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, '_renderNewRootComponent(): Render methods should be a pure function ' + 'of props and state; triggering nested component updates from ' + 'render is not allowed. If necessary, trigger nested updates in ' + 'componentDidUpdate. Check the render method of %s.', ReactCurrentOwner.current && ReactCurrentOwner.current.getName() || 'ReactCompositeComponent') : void 0; | |
!isValidContainer(container) ? process.env.NODE_ENV !== 'production' ? invariant(false, '_registerComponent(...): Target container is not a DOM element.') : _prodInvariant('37') : void 0; | |
ReactBrowserEventEmitter.ensureScrollValueMonitoring(); | |
var componentInstance = instantiateReactComponent(nextElement, false); | |
// The initial render is synchronous but any updates that happen during | |
// rendering, in componentWillMount or componentDidMount, will be batched | |
// according to the current batching strategy. | |
ReactUpdates.batchedUpdates(batchedMountComponentIntoNode, componentInstance, container, shouldReuseMarkup, context); | |
var wrapperID = componentInstance._instance.rootID; | |
instancesByReactRootID[wrapperID] = componentInstance; | |
return componentInstance; | |
}, | |
/** | |
* Renders a React component into the DOM in the supplied `container`. | |
* | |
* If the React component was previously rendered into `container`, this will | |
* perform an update on it and only mutate the DOM as necessary to reflect the | |
* latest React component. | |
* | |
* @param {ReactComponent} parentComponent The conceptual parent of this render tree. | |
* @param {ReactElement} nextElement Component element to render. | |
* @param {DOMElement} container DOM element to render into. | |
* @param {?function} callback function triggered on completion | |
* @return {ReactComponent} Component instance rendered in `container`. | |
*/ | |
renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) { | |
!(parentComponent != null && ReactInstanceMap.has(parentComponent)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'parentComponent must be a valid React Component') : _prodInvariant('38') : void 0; | |
return ReactMount._renderSubtreeIntoContainer(parentComponent, nextElement, container, callback); | |
}, | |
_renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) { | |
ReactUpdateQueue.validateCallback(callback, 'ReactDOM.render'); | |
!React.isValidElement(nextElement) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactDOM.render(): Invalid component element.%s', typeof nextElement === 'string' ? ' Instead of passing a string like \'div\', pass ' + 'React.createElement(\'div\') or <div />.' : typeof nextElement === 'function' ? ' Instead of passing a class like Foo, pass ' + 'React.createElement(Foo) or <Foo />.' : | |
// Check if it quacks like an element | |
nextElement != null && nextElement.props !== undefined ? ' This may be caused by unintentionally loading two independent ' + 'copies of React.' : '') : _prodInvariant('39', typeof nextElement === 'string' ? ' Instead of passing a string like \'div\', pass ' + 'React.createElement(\'div\') or <div />.' : typeof nextElement === 'function' ? ' Instead of passing a class like Foo, pass ' + 'React.createElement(Foo) or <Foo />.' : nextElement != null && nextElement.props !== undefined ? ' This may be caused by unintentionally loading two independent ' + 'copies of React.' : '') : void 0; | |
process.env.NODE_ENV !== 'production' ? warning(!container || !container.tagName || container.tagName.toUpperCase() !== 'BODY', 'render(): Rendering components directly into document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try rendering into a container element created ' + 'for your app.') : void 0; | |
var nextWrappedElement = React.createElement(TopLevelWrapper, { child: nextElement }); | |
var nextContext; | |
if (parentComponent) { | |
var parentInst = ReactInstanceMap.get(parentComponent); | |
nextContext = parentInst._processChildContext(parentInst._context); | |
} else { | |
nextContext = emptyObject; | |
} | |
var prevComponent = getTopLevelWrapperInContainer(container); | |
if (prevComponent) { | |
var prevWrappedElement = prevComponent._currentElement; | |
var prevElement = prevWrappedElement.props.child; | |
if (shouldUpdateReactComponent(prevElement, nextElement)) { | |
var publicInst = prevComponent._renderedComponent.getPublicInstance(); | |
var updatedCallback = callback && function () { | |
callback.call(publicInst); | |
}; | |
ReactMount._updateRootComponent(prevComponent, nextWrappedElement, nextContext, container, updatedCallback); | |
return publicInst; | |
} else { | |
ReactMount.unmountComponentAtNode(container); | |
} | |
} | |
var reactRootElement = getReactRootElementInContainer(container); | |
var containerHasReactMarkup = reactRootElement && !!internalGetID(reactRootElement); | |
var containerHasNonRootReactChild = hasNonRootReactChild(container); | |
if (process.env.NODE_ENV !== 'production') { | |
process.env.NODE_ENV !== 'production' ? warning(!containerHasNonRootReactChild, 'render(...): Replacing React-rendered children with a new root ' + 'component. If you intended to update the children of this node, ' + 'you should instead have the existing children update their state ' + 'and render the new components instead of calling ReactDOM.render.') : void 0; | |
if (!containerHasReactMarkup || reactRootElement.nextSibling) { | |
var rootElementSibling = reactRootElement; | |
while (rootElementSibling) { | |
if (internalGetID(rootElementSibling)) { | |
process.env.NODE_ENV !== 'production' ? warning(false, 'render(): Target node has markup rendered by React, but there ' + 'are unrelated nodes as well. This is most commonly caused by ' + 'white-space inserted around server-rendered markup.') : void 0; | |
break; | |
} | |
rootElementSibling = rootElementSibling.nextSibling; | |
} | |
} | |
} | |
var shouldReuseMarkup = containerHasReactMarkup && !prevComponent && !containerHasNonRootReactChild; | |
var component = ReactMount._renderNewRootComponent(nextWrappedElement, container, shouldReuseMarkup, nextContext)._renderedComponent.getPublicInstance(); | |
if (callback) { | |
callback.call(component); | |
} | |
return component; | |
}, | |
/** | |
* Renders a React component into the DOM in the supplied `container`. | |
* See https://facebook.github.io/react/docs/top-level-api.html#reactdom.render | |
* | |
* If the React component was previously rendered into `container`, this will | |
* perform an update on it and only mutate the DOM as necessary to reflect the | |
* latest React component. | |
* | |
* @param {ReactElement} nextElement Component element to render. | |
* @param {DOMElement} container DOM element to render into. | |
* @param {?function} callback function triggered on completion | |
* @return {ReactComponent} Component instance rendered in `container`. | |
*/ | |
render: function (nextElement, container, callback) { | |
return ReactMount._renderSubtreeIntoContainer(null, nextElement, container, callback); | |
}, | |
/** | |
* Unmounts and destroys the React component rendered in the `container`. | |
* See https://facebook.github.io/react/docs/top-level-api.html#reactdom.unmountcomponentatnode | |
* | |
* @param {DOMElement} container DOM element containing a React component. | |
* @return {boolean} True if a component was found in and unmounted from | |
* `container` | |
*/ | |
unmountComponentAtNode: function (container) { | |
// Various parts of our code (such as ReactCompositeComponent's | |
// _renderValidatedComponent) assume that calls to render aren't nested; | |
// verify that that's the case. (Strictly speaking, unmounting won't cause a | |
// render but we still don't expect to be in a render call here.) | |
process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, 'unmountComponentAtNode(): Render methods should be a pure function ' + 'of props and state; triggering nested component updates from render ' + 'is not allowed. If necessary, trigger nested updates in ' + 'componentDidUpdate. Check the render method of %s.', ReactCurrentOwner.current && ReactCurrentOwner.current.getName() || 'ReactCompositeComponent') : void 0; | |
!isValidContainer(container) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'unmountComponentAtNode(...): Target container is not a DOM element.') : _prodInvariant('40') : void 0; | |
if (process.env.NODE_ENV !== 'production') { | |
process.env.NODE_ENV !== 'production' ? warning(!nodeIsRenderedByOtherInstance(container), 'unmountComponentAtNode(): The node you\'re attempting to unmount ' + 'was rendered by another copy of React.') : void 0; | |
} | |
var prevComponent = getTopLevelWrapperInContainer(container); | |
if (!prevComponent) { | |
// Check if the node being unmounted was rendered by React, but isn't a | |
// root node. | |
var containerHasNonRootReactChild = hasNonRootReactChild(container); | |
// Check if the container itself is a React root node. | |
var isContainerReactRoot = container.nodeType === 1 && container.hasAttribute(ROOT_ATTR_NAME); | |
if (process.env.NODE_ENV !== 'production') { | |
process.env.NODE_ENV !== 'production' ? warning(!containerHasNonRootReactChild, 'unmountComponentAtNode(): The node you\'re attempting to unmount ' + 'was rendered by React and is not a top-level container. %s', isContainerReactRoot ? 'You may have accidentally passed in a React root node instead ' + 'of its container.' : 'Instead, have the parent component update its state and ' + 'rerender in order to remove this component.') : void 0; | |
} | |
return false; | |
} | |
delete instancesByReactRootID[prevComponent._instance.rootID]; | |
ReactUpdates.batchedUpdates(unmountComponentFromNode, prevComponent, container, false); | |
return true; | |
}, | |
_mountImageIntoNode: function (markup, container, instance, shouldReuseMarkup, transaction) { | |
!isValidContainer(container) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'mountComponentIntoNode(...): Target container is not valid.') : _prodInvariant('41') : void 0; | |
if (shouldReuseMarkup) { | |
var rootElement = getReactRootElementInContainer(container); | |
if (ReactMarkupChecksum.canReuseMarkup(markup, rootElement)) { | |
ReactDOMComponentTree.precacheNode(instance, rootElement); | |
return; | |
} else { | |
var checksum = rootElement.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME); | |
rootElement.removeAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME); | |
var rootMarkup = rootElement.outerHTML; | |
rootElement.setAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME, checksum); | |
var normalizedMarkup = markup; | |
if (process.env.NODE_ENV !== 'production') { | |
// because rootMarkup is retrieved from the DOM, various normalizations | |
// will have occurred which will not be present in `markup`. Here, | |
// insert markup into a <div> or <iframe> depending on the container | |
// type to perform the same normalizations before comparing. | |
var normalizer; | |
if (container.nodeType === ELEMENT_NODE_TYPE) { | |
normalizer = document.createElement('div'); | |
normalizer.innerHTML = markup; | |
normalizedMarkup = normalizer.innerHTML; | |
} else { | |
normalizer = document.createElement('iframe'); | |
document.body.appendChild(normalizer); | |
normalizer.contentDocument.write(markup); | |
normalizedMarkup = normalizer.contentDocument.documentElement.outerHTML; | |
document.body.removeChild(normalizer); | |
} | |
} | |
var diffIndex = firstDifferenceIndex(normalizedMarkup, rootMarkup); | |
var difference = ' (client) ' + normalizedMarkup.substring(diffIndex - 20, diffIndex + 20) + '\n (server) ' + rootMarkup.substring(diffIndex - 20, diffIndex + 20); | |
!(container.nodeType !== DOC_NODE_TYPE) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'You\'re trying to render a component to the document using server rendering but the checksum was invalid. This usually means you rendered a different component type or props on the client from the one on the server, or your render() methods are impure. React cannot handle this case due to cross-browser quirks by rendering at the document root. You should look for environment dependent code in your components and ensure the props are the same client and server side:\n%s', difference) : _prodInvariant('42', difference) : void 0; | |
if (process.env.NODE_ENV !== 'production') { | |
process.env.NODE_ENV !== 'production' ? warning(false, 'React attempted to reuse markup in a container but the ' + 'checksum was invalid. This generally means that you are ' + 'using server rendering and the markup generated on the ' + 'server was not what the client was expecting. React injected ' + 'new markup to compensate which works but you have lost many ' + 'of the benefits of server rendering. Instead, figure out ' + 'why the markup being generated is different on the client ' + 'or server:\n%s', difference) : void 0; | |
} | |
} | |
} | |
!(container.nodeType !== DOC_NODE_TYPE) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'You\'re trying to render a component to the document but you didn\'t use server rendering. We can\'t do this without using server rendering due to cross-browser quirks. See ReactDOMServer.renderToString() for server rendering.') : _prodInvariant('43') : void 0; | |
if (transaction.useCreateElement) { | |
while (container.lastChild) { | |
container.removeChild(container.lastChild); | |
} | |
DOMLazyTree.insertTreeBefore(container, markup, null); | |
} else { | |
setInnerHTML(container, markup); | |
ReactDOMComponentTree.precacheNode(instance, container.firstChild); | |
} | |
if (process.env.NODE_ENV !== 'production') { | |
var hostNode = ReactDOMComponentTree.getInstanceFromNode(container.firstChild); | |
if (hostNode._debugID !== 0) { | |
ReactInstrumentation.debugTool.onHostOperation({ | |
instanceID: hostNode._debugID, | |
type: 'mount', | |
payload: markup.toString() | |
}); | |
} | |
} | |
} | |
}; | |
module.exports = ReactMount; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 208 */ | |
/***/ (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 _prodInvariant = __webpack_require__(13); | |
var React = __webpack_require__(49); | |
var invariant = __webpack_require__(11); | |
var ReactNodeTypes = { | |
HOST: 0, | |
COMPOSITE: 1, | |
EMPTY: 2, | |
getType: function (node) { | |
if (node === null || node === false) { | |
return ReactNodeTypes.EMPTY; | |
} else if (React.isValidElement(node)) { | |
if (typeof node.type === 'function') { | |
return ReactNodeTypes.COMPOSITE; | |
} else { | |
return ReactNodeTypes.HOST; | |
} | |
} | |
true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unexpected node: %s', node) : _prodInvariant('26', node) : void 0; | |
} | |
}; | |
module.exports = ReactNodeTypes; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 209 */ | |
/***/ (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 ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; | |
module.exports = ReactPropTypesSecret; | |
/***/ }), | |
/* 210 */ | |
/***/ (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 ViewportMetrics = { | |
currentScrollLeft: 0, | |
currentScrollTop: 0, | |
refreshScrollValues: function (scrollPosition) { | |
ViewportMetrics.currentScrollLeft = scrollPosition.x; | |
ViewportMetrics.currentScrollTop = scrollPosition.y; | |
} | |
}; | |
module.exports = ViewportMetrics; | |
/***/ }), | |
/* 211 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) {/** | |
* Copyright 2014-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 _prodInvariant = __webpack_require__(13); | |
var invariant = __webpack_require__(11); | |
/** | |
* Accumulates items that must not be null or undefined into the first one. This | |
* is used to conserve memory by avoiding array allocations, and thus sacrifices | |
* API cleanness. Since `current` can be null before being passed in and not | |
* null after this function, make sure to assign it back to `current`: | |
* | |
* `a = accumulateInto(a, b);` | |
* | |
* This API should be sparingly used. Try `accumulate` for something cleaner. | |
* | |
* @return {*|array<*>} An accumulation of items. | |
*/ | |
function accumulateInto(current, next) { | |
!(next != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'accumulateInto(...): Accumulated items must not be null or undefined.') : _prodInvariant('30') : void 0; | |
if (current == null) { | |
return next; | |
} | |
// Both are not empty. Warning: Never call x.concat(y) when you are not | |
// certain that x is an Array (x could be a string with concat method). | |
if (Array.isArray(current)) { | |
if (Array.isArray(next)) { | |
current.push.apply(current, next); | |
return current; | |
} | |
current.push(next); | |
return current; | |
} | |
if (Array.isArray(next)) { | |
// A bit too dangerous to mutate `next`. | |
return [current].concat(next); | |
} | |
return [current, next]; | |
} | |
module.exports = accumulateInto; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 212 */ | |
/***/ (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. | |
* | |
* | |
*/ | |
/** | |
* @param {array} arr an "accumulation" of items which is either an Array or | |
* a single item. Useful when paired with the `accumulate` module. This is a | |
* simple utility that allows us to reason about a collection of items, but | |
* handling the case when there is exactly one item (and we do not need to | |
* allocate an array). | |
*/ | |
function forEachAccumulated(arr, cb, scope) { | |
if (Array.isArray(arr)) { | |
arr.forEach(cb, scope); | |
} else if (arr) { | |
cb.call(scope, arr); | |
} | |
} | |
module.exports = forEachAccumulated; | |
/***/ }), | |
/* 213 */ | |
/***/ (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 ReactNodeTypes = __webpack_require__(208); | |
function getHostComponentFromComposite(inst) { | |
var type; | |
while ((type = inst._renderedNodeType) === ReactNodeTypes.COMPOSITE) { | |
inst = inst._renderedComponent; | |
} | |
if (type === ReactNodeTypes.HOST) { | |
return inst._renderedComponent; | |
} else if (type === ReactNodeTypes.EMPTY) { | |
return null; | |
} | |
} | |
module.exports = getHostComponentFromComposite; | |
/***/ }), | |
/* 214 */ | |
/***/ (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 ExecutionEnvironment = __webpack_require__(18); | |
var contentKey = null; | |
/** | |
* Gets the key used to access text content on a DOM node. | |
* | |
* @return {?string} Key used to access text content. | |
* @internal | |
*/ | |
function getTextContentAccessor() { | |
if (!contentKey && ExecutionEnvironment.canUseDOM) { | |
// Prefer textContent to innerText because many browsers support both but | |
// SVG <text> elements don't support innerText even when <div> does. | |
contentKey = 'textContent' in document.documentElement ? 'textContent' : 'innerText'; | |
} | |
return contentKey; | |
} | |
module.exports = getTextContentAccessor; | |
/***/ }), | |
/* 215 */ | |
/***/ (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 _prodInvariant = __webpack_require__(13), | |
_assign = __webpack_require__(14); | |
var ReactCompositeComponent = __webpack_require__(461); | |
var ReactEmptyComponent = __webpack_require__(203); | |
var ReactHostComponent = __webpack_require__(205); | |
var getNextDebugID = __webpack_require__(515); | |
var invariant = __webpack_require__(11); | |
var warning = __webpack_require__(10); | |
// To avoid a cyclic dependency, we create the final class in this module | |
var ReactCompositeComponentWrapper = function (element) { | |
this.construct(element); | |
}; | |
_assign(ReactCompositeComponentWrapper.prototype, ReactCompositeComponent, { | |
_instantiateReactComponent: instantiateReactComponent | |
}); | |
function getDeclarationErrorAddendum(owner) { | |
if (owner) { | |
var name = owner.getName(); | |
if (name) { | |
return ' Check the render method of `' + name + '`.'; | |
} | |
} | |
return ''; | |
} | |
/** | |
* Check if the type reference is a known internal type. I.e. not a user | |
* provided composite type. | |
* | |
* @param {function} type | |
* @return {boolean} Returns true if this is a valid internal type. | |
*/ | |
function isInternalComponentType(type) { | |
return typeof type === 'function' && typeof type.prototype !== 'undefined' && typeof type.prototype.mountComponent === 'function' && typeof type.prototype.receiveComponent === 'function'; | |
} | |
/** | |
* Given a ReactNode, create an instance that will actually be mounted. | |
* | |
* @param {ReactNode} node | |
* @param {boolean} shouldHaveDebugID | |
* @return {object} A new instance of the element's constructor. | |
* @protected | |
*/ | |
function instantiateReactComponent(node, shouldHaveDebugID) { | |
var instance; | |
if (node === null || node === false) { | |
instance = ReactEmptyComponent.create(instantiateReactComponent); | |
} else if (typeof node === 'object') { | |
var element = node; | |
var type = element.type; | |
if (typeof type !== 'function' && typeof type !== 'string') { | |
var info = ''; | |
if (process.env.NODE_ENV !== 'production') { | |
if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) { | |
info += ' You likely forgot to export your component from the file ' + 'it\'s defined in.'; | |
} | |
} | |
info += getDeclarationErrorAddendum(element._owner); | |
true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s', type == null ? type : typeof type, info) : _prodInvariant('130', type == null ? type : typeof type, info) : void 0; | |
} | |
// Special case string values | |
if (typeof element.type === 'string') { | |
instance = ReactHostComponent.createInternalComponent(element); | |
} else if (isInternalComponentType(element.type)) { | |
// This is temporarily available for custom components that are not string | |
// representations. I.e. ART. Once those are updated to use the string | |
// representation, we can drop this code path. | |
instance = new element.type(element); | |
// We renamed this. Allow the old name for compat. :( | |
if (!instance.getHostNode) { | |
instance.getHostNode = instance.getNativeNode; | |
} | |
} else { | |
instance = new ReactCompositeComponentWrapper(element); | |
} | |
} else if (typeof node === 'string' || typeof node === 'number') { | |
instance = ReactHostComponent.createInstanceForText(node); | |
} else { | |
true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Encountered invalid React node of type %s', typeof node) : _prodInvariant('131', typeof node) : void 0; | |
} | |
if (process.env.NODE_ENV !== 'production') { | |
process.env.NODE_ENV !== 'production' ? warning(typeof instance.mountComponent === 'function' && typeof instance.receiveComponent === 'function' && typeof instance.getHostNode === 'function' && typeof instance.unmountComponent === 'function', 'Only React Components can be mounted.') : void 0; | |
} | |
// These two fields are used by the DOM and ART diffing algorithms | |
// respectively. Instead of using expandos on components, we should be | |
// storing the state needed by the diffing algorithms elsewhere. | |
instance._mountIndex = 0; | |
instance._mountImage = null; | |
if (process.env.NODE_ENV !== 'production') { | |
instance._debugID = shouldHaveDebugID ? getNextDebugID() : 0; | |
} | |
// Internal instances should fully constructed at this point, so they should | |
// not get any new fields added to them at this point. | |
if (process.env.NODE_ENV !== 'production') { | |
if (Object.preventExtensions) { | |
Object.preventExtensions(instance); | |
} | |
} | |
return instance; | |
} | |
module.exports = instantiateReactComponent; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 216 */ | |
/***/ (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. | |
* | |
* | |
*/ | |
/** | |
* @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary | |
*/ | |
var supportedInputTypes = { | |
'color': true, | |
'date': true, | |
'datetime': true, | |
'datetime-local': true, | |
'email': true, | |
'month': true, | |
'number': true, | |
'password': true, | |
'range': true, | |
'search': true, | |
'tel': true, | |
'text': true, | |
'time': true, | |
'url': true, | |
'week': true | |
}; | |
function isTextInputElement(elem) { | |
var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase(); | |
if (nodeName === 'input') { | |
return !!supportedInputTypes[elem.type]; | |
} | |
if (nodeName === 'textarea') { | |
return true; | |
} | |
return false; | |
} | |
module.exports = isTextInputElement; | |
/***/ }), | |
/* 217 */ | |
/***/ (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 ExecutionEnvironment = __webpack_require__(18); | |
var escapeTextContentForBrowser = __webpack_require__(86); | |
var setInnerHTML = __webpack_require__(87); | |
/** | |
* Set the textContent property of a node, ensuring that whitespace is preserved | |
* even in IE8. innerText is a poor substitute for textContent and, among many | |
* issues, inserts <br> instead of the literal newline chars. innerHTML behaves | |
* as it should. | |
* | |
* @param {DOMElement} node | |
* @param {string} text | |
* @internal | |
*/ | |
var setTextContent = function (node, text) { | |
if (text) { | |
var firstChild = node.firstChild; | |
if (firstChild && firstChild === node.lastChild && firstChild.nodeType === 3) { | |
firstChild.nodeValue = text; | |
return; | |
} | |
} | |
node.textContent = text; | |
}; | |
if (ExecutionEnvironment.canUseDOM) { | |
if (!('textContent' in document.documentElement)) { | |
setTextContent = function (node, text) { | |
if (node.nodeType === 3) { | |
node.nodeValue = text; | |
return; | |
} | |
setInnerHTML(node, escapeTextContentForBrowser(text)); | |
}; | |
} | |
} | |
module.exports = setTextContent; | |
/***/ }), | |
/* 218 */ | |
/***/ (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 _prodInvariant = __webpack_require__(13); | |
var ReactCurrentOwner = __webpack_require__(31); | |
var REACT_ELEMENT_TYPE = __webpack_require__(480); | |
var getIteratorFn = __webpack_require__(514); | |
var invariant = __webpack_require__(11); | |
var KeyEscapeUtils = __webpack_require__(125); | |
var warning = __webpack_require__(10); | |
var SEPARATOR = '.'; | |
var SUBSEPARATOR = ':'; | |
/** | |
* This is inlined from ReactElement since this file is shared between | |
* isomorphic and renderers. We could extract this to a | |
* | |
*/ | |
/** | |
* TODO: Test that a single child and an array with one item have the same key | |
* pattern. | |
*/ | |
var didWarnAboutMaps = false; | |
/** | |
* Generate a key string that identifies a component within a set. | |
* | |
* @param {*} component A component that could contain a manual key. | |
* @param {number} index Index that is used if a manual key is not provided. | |
* @return {string} | |
*/ | |
function getComponentKey(component, index) { | |
// Do some typechecking here since we call this blindly. We want to ensure | |
// that we don't block potential future ES APIs. | |
if (component && typeof component === 'object' && component.key != null) { | |
// Explicit key | |
return KeyEscapeUtils.escape(component.key); | |
} | |
// Implicit key determined by the index in the set | |
return index.toString(36); | |
} | |
/** | |
* @param {?*} children Children tree container. | |
* @param {!string} nameSoFar Name of the key path so far. | |
* @param {!function} callback Callback to invoke with each child found. | |
* @param {?*} traverseContext Used to pass information throughout the traversal | |
* process. | |
* @return {!number} The number of children in this subtree. | |
*/ | |
function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) { | |
var type = typeof children; | |
if (type === 'undefined' || type === 'boolean') { | |
// All of the above are perceived as null. | |
children = null; | |
} | |
if (children === null || type === 'string' || type === 'number' || | |
// The following is inlined from ReactElement. This means we can optimize | |
// some checks. React Fiber also inlines this logic for similar purposes. | |
type === 'object' && children.$$typeof === REACT_ELEMENT_TYPE) { | |
callback(traverseContext, children, | |
// If it's the only child, treat the name as if it was wrapped in an array | |
// so that it's consistent if the number of children grows. | |
nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar); | |
return 1; | |
} | |
var child; | |
var nextName; | |
var subtreeCount = 0; // Count of children found in the current subtree. | |
var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR; | |
if (Array.isArray(children)) { | |
for (var i = 0; i < children.length; i++) { | |
child = children[i]; | |
nextName = nextNamePrefix + getComponentKey(child, i); | |
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); | |
} | |
} else { | |
var iteratorFn = getIteratorFn(children); | |
if (iteratorFn) { | |
var iterator = iteratorFn.call(children); | |
var step; | |
if (iteratorFn !== children.entries) { | |
var ii = 0; | |
while (!(step = iterator.next()).done) { | |
child = step.value; | |
nextName = nextNamePrefix + getComponentKey(child, ii++); | |
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); | |
} | |
} else { | |
if (process.env.NODE_ENV !== 'production') { | |
var mapsAsChildrenAddendum = ''; | |
if (ReactCurrentOwner.current) { | |
var mapsAsChildrenOwnerName = ReactCurrentOwner.current.getName(); | |
if (mapsAsChildrenOwnerName) { | |
mapsAsChildrenAddendum = ' Check the render method of `' + mapsAsChildrenOwnerName + '`.'; | |
} | |
} | |
process.env.NODE_ENV !== 'production' ? warning(didWarnAboutMaps, 'Using Maps as children is not yet fully supported. It is an ' + 'experimental feature that might be removed. Convert it to a ' + 'sequence / iterable of keyed ReactElements instead.%s', mapsAsChildrenAddendum) : void 0; | |
didWarnAboutMaps = true; | |
} | |
// Iterator will provide entry [k,v] tuples rather than values. | |
while (!(step = iterator.next()).done) { | |
var entry = step.value; | |
if (entry) { | |
child = entry[1]; | |
nextName = nextNamePrefix + KeyEscapeUtils.escape(entry[0]) + SUBSEPARATOR + getComponentKey(child, 0); | |
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); | |
} | |
} | |
} | |
} else if (type === 'object') { | |
var addendum = ''; | |
if (process.env.NODE_ENV !== 'production') { | |
addendum = ' If you meant to render a collection of children, use an array ' + 'instead or wrap the object using createFragment(object) from the ' + 'React add-ons.'; | |
if (children._isReactElement) { | |
addendum = ' It looks like you\'re using an element created by a different ' + 'version of React. Make sure to use only one copy of React.'; | |
} | |
if (ReactCurrentOwner.current) { | |
var name = ReactCurrentOwner.current.getName(); | |
if (name) { | |
addendum += ' Check the render method of `' + name + '`.'; | |
} | |
} | |
} | |
var childrenString = String(children); | |
true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : _prodInvariant('31', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : void 0; | |
} | |
} | |
return subtreeCount; | |
} | |
/** | |
* Traverses children that are typically specified as `props.children`, but | |
* might also be specified through attributes: | |
* | |
* - `traverseAllChildren(this.props.children, ...)` | |
* - `traverseAllChildren(this.props.leftPanelChildren, ...)` | |
* | |
* The `traverseContext` is an optional argument that is passed through the | |
* entire traversal. It can be used to store accumulations or anything else that | |
* the callback might find relevant. | |
* | |
* @param {?*} children Children tree object. | |
* @param {!function} callback To invoke upon traversing each child. | |
* @param {?*} traverseContext Context for traversal. | |
* @return {!number} The number of children in this subtree. | |
*/ | |
function traverseAllChildren(children, callback, traverseContext) { | |
if (children == null) { | |
return 0; | |
} | |
return traverseAllChildrenImpl(children, '', callback, traverseContext); | |
} | |
module.exports = traverseAllChildren; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 219 */ | |
/***/ (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. | |
* | |
* | |
*/ | |
/** | |
* Escape and wrap key so it is safe to use as a reactid | |
* | |
* @param {string} key to be escaped. | |
* @return {string} the escaped key. | |
*/ | |
function escape(key) { | |
var escapeRegex = /[=:]/g; | |
var escaperLookup = { | |
'=': '=0', | |
':': '=2' | |
}; | |
var escapedString = ('' + key).replace(escapeRegex, function (match) { | |
return escaperLookup[match]; | |
}); | |
return '$' + escapedString; | |
} | |
/** | |
* Unescape and unwrap key for human-readable display | |
* | |
* @param {string} key to unescape. | |
* @return {string} the unescaped key. | |
*/ | |
function unescape(key) { | |
var unescapeRegex = /(=0|=2)/g; | |
var unescaperLookup = { | |
'=0': '=', | |
'=2': ':' | |
}; | |
var keySubstring = key[0] === '.' && key[1] === '$' ? key.substring(2) : key.substring(1); | |
return ('' + keySubstring).replace(unescapeRegex, function (match) { | |
return unescaperLookup[match]; | |
}); | |
} | |
var KeyEscapeUtils = { | |
escape: escape, | |
unescape: unescape | |
}; | |
module.exports = KeyEscapeUtils; | |
/***/ }), | |
/* 220 */ | |
/***/ (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 PooledClass = __webpack_require__(522); | |
var ReactElement = __webpack_require__(40); | |
var emptyFunction = __webpack_require__(24); | |
var traverseAllChildren = __webpack_require__(224); | |
var twoArgumentPooler = PooledClass.twoArgumentPooler; | |
var fourArgumentPooler = PooledClass.fourArgumentPooler; | |
var userProvidedKeyEscapeRegex = /\/+/g; | |
function escapeUserProvidedKey(text) { | |
return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/'); | |
} | |
/** | |
* PooledClass representing the bookkeeping associated with performing a child | |
* traversal. Allows avoiding binding callbacks. | |
* | |
* @constructor ForEachBookKeeping | |
* @param {!function} forEachFunction Function to perform traversal with. | |
* @param {?*} forEachContext Context to perform context with. | |
*/ | |
function ForEachBookKeeping(forEachFunction, forEachContext) { | |
this.func = forEachFunction; | |
this.context = forEachContext; | |
this.count = 0; | |
} | |
ForEachBookKeeping.prototype.destructor = function () { | |
this.func = null; | |
this.context = null; | |
this.count = 0; | |
}; | |
PooledClass.addPoolingTo(ForEachBookKeeping, twoArgumentPooler); | |
function forEachSingleChild(bookKeeping, child, name) { | |
var func = bookKeeping.func, | |
context = bookKeeping.context; | |
func.call(context, child, bookKeeping.count++); | |
} | |
/** | |
* Iterates through children that are typically specified as `props.children`. | |
* | |
* See https://facebook.github.io/react/docs/top-level-api.html#react.children.foreach | |
* | |
* The provided forEachFunc(child, index) will be called for each | |
* leaf child. | |
* | |
* @param {?*} children Children tree container. | |
* @param {function(*, int)} forEachFunc | |
* @param {*} forEachContext Context for forEachContext. | |
*/ | |
function forEachChildren(children, forEachFunc, forEachContext) { | |
if (children == null) { | |
return children; | |
} | |
var traverseContext = ForEachBookKeeping.getPooled(forEachFunc, forEachContext); | |
traverseAllChildren(children, forEachSingleChild, traverseContext); | |
ForEachBookKeeping.release(traverseContext); | |
} | |
/** | |
* PooledClass representing the bookkeeping associated with performing a child | |
* mapping. Allows avoiding binding callbacks. | |
* | |
* @constructor MapBookKeeping | |
* @param {!*} mapResult Object containing the ordered map of results. | |
* @param {!function} mapFunction Function to perform mapping with. | |
* @param {?*} mapContext Context to perform mapping with. | |
*/ | |
function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) { | |
this.result = mapResult; | |
this.keyPrefix = keyPrefix; | |
this.func = mapFunction; | |
this.context = mapContext; | |
this.count = 0; | |
} | |
MapBookKeeping.prototype.destructor = function () { | |
this.result = null; | |
this.keyPrefix = null; | |
this.func = null; | |
this.context = null; | |
this.count = 0; | |
}; | |
PooledClass.addPoolingTo(MapBookKeeping, fourArgumentPooler); | |
function mapSingleChildIntoContext(bookKeeping, child, childKey) { | |
var result = bookKeeping.result, | |
keyPrefix = bookKeeping.keyPrefix, | |
func = bookKeeping.func, | |
context = bookKeeping.context; | |
var mappedChild = func.call(context, child, bookKeeping.count++); | |
if (Array.isArray(mappedChild)) { | |
mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument); | |
} else if (mappedChild != null) { | |
if (ReactElement.isValidElement(mappedChild)) { | |
mappedChild = ReactElement.cloneAndReplaceKey(mappedChild, | |
// Keep both the (mapped) and old keys if they differ, just as | |
// traverseAllChildren used to do for objects as children | |
keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey); | |
} | |
result.push(mappedChild); | |
} | |
} | |
function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) { | |
var escapedPrefix = ''; | |
if (prefix != null) { | |
escapedPrefix = escapeUserProvidedKey(prefix) + '/'; | |
} | |
var traverseContext = MapBookKeeping.getPooled(array, escapedPrefix, func, context); | |
traverseAllChildren(children, mapSingleChildIntoContext, traverseContext); | |
MapBookKeeping.release(traverseContext); | |
} | |
/** | |
* Maps children that are typically specified as `props.children`. | |
* | |
* See https://facebook.github.io/react/docs/top-level-api.html#react.children.map | |
* | |
* The provided mapFunction(child, key, index) will be called for each | |
* leaf child. | |
* | |
* @param {?*} children Children tree container. | |
* @param {function(*, int)} func The map function. | |
* @param {*} context Context for mapFunction. | |
* @return {object} Object containing the ordered map of results. | |
*/ | |
function mapChildren(children, func, context) { | |
if (children == null) { | |
return children; | |
} | |
var result = []; | |
mapIntoWithKeyPrefixInternal(children, result, null, func, context); | |
return result; | |
} | |
function forEachSingleChildDummy(traverseContext, child, name) { | |
return null; | |
} | |
/** | |
* Count the number of children that are typically specified as | |
* `props.children`. | |
* | |
* See https://facebook.github.io/react/docs/top-level-api.html#react.children.count | |
* | |
* @param {?*} children Children tree container. | |
* @return {number} The number of children. | |
*/ | |
function countChildren(children, context) { | |
return traverseAllChildren(children, forEachSingleChildDummy, null); | |
} | |
/** | |
* Flatten a children object (typically specified as `props.children`) and | |
* return an array with appropriately re-keyed children. | |
* | |
* See https://facebook.github.io/react/docs/top-level-api.html#react.children.toarray | |
*/ | |
function toArray(children) { | |
var result = []; | |
mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument); | |
return result; | |
} | |
var ReactChildren = { | |
forEach: forEachChildren, | |
map: mapChildren, | |
mapIntoWithKeyPrefixInternal: mapIntoWithKeyPrefixInternal, | |
count: countChildren, | |
toArray: toArray | |
}; | |
module.exports = ReactChildren; | |
/***/ }), | |
/* 221 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/** | |
* Copyright 2014-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. | |
* | |
* | |
*/ | |
// The Symbol used to tag the ReactElement type. If there is no native Symbol | |
// nor polyfill, then a plain number is used for performance. | |
var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7; | |
module.exports = REACT_ELEMENT_TYPE; | |
/***/ }), | |
/* 222 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) {/** | |
* Copyright 2014-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. | |
* | |
*/ | |
/** | |
* ReactElementValidator provides a wrapper around a element factory | |
* which validates the props passed to the element. This is intended to be | |
* used only in DEV and could be replaced by a static type checker for languages | |
* that support it. | |
*/ | |
var ReactCurrentOwner = __webpack_require__(31); | |
var ReactComponentTreeHook = __webpack_require__(21); | |
var ReactElement = __webpack_require__(40); | |
var checkReactTypeSpec = __webpack_require__(531); | |
var canDefineProperty = __webpack_require__(140); | |
var getIteratorFn = __webpack_require__(141); | |
var warning = __webpack_require__(10); | |
function getDeclarationErrorAddendum() { | |
if (ReactCurrentOwner.current) { | |
var name = ReactCurrentOwner.current.getName(); | |
if (name) { | |
return ' Check the render method of `' + name + '`.'; | |
} | |
} | |
return ''; | |
} | |
/** | |
* Warn if there's no key explicitly set on dynamic arrays of children or | |
* object keys are not valid. This allows us to keep track of children between | |
* updates. | |
*/ | |
var ownerHasKeyUseWarning = {}; | |
function getCurrentComponentErrorInfo(parentType) { | |
var info = getDeclarationErrorAddendum(); | |
if (!info) { | |
var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name; | |
if (parentName) { | |
info = ' Check the top-level render call using <' + parentName + '>.'; | |
} | |
} | |
return info; | |
} | |
/** | |
* Warn if the element doesn't have an explicit key assigned to it. | |
* This element is in an array. The array could grow and shrink or be | |
* reordered. All children that haven't already been validated are required to | |
* have a "key" property assigned to it. Error statuses are cached so a warning | |
* will only be shown once. | |
* | |
* @internal | |
* @param {ReactElement} element Element that requires a key. | |
* @param {*} parentType element's parent's type. | |
*/ | |
function validateExplicitKey(element, parentType) { | |
if (!element._store || element._store.validated || element.key != null) { | |
return; | |
} | |
element._store.validated = true; | |
var memoizer = ownerHasKeyUseWarning.uniqueKey || (ownerHasKeyUseWarning.uniqueKey = {}); | |
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType); | |
if (memoizer[currentComponentErrorInfo]) { | |
return; | |
} | |
memoizer[currentComponentErrorInfo] = true; | |
// Usually the current owner is the offender, but if it accepts children as a | |
// property, it may be the creator of the child that's responsible for | |
// assigning it a key. | |
var childOwner = ''; | |
if (element && element._owner && element._owner !== ReactCurrentOwner.current) { | |
// Give the component that originally created this child. | |
childOwner = ' It was passed a child from ' + element._owner.getName() + '.'; | |
} | |
process.env.NODE_ENV !== 'production' ? warning(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.%s', currentComponentErrorInfo, childOwner, ReactComponentTreeHook.getCurrentStackAddendum(element)) : void 0; | |
} | |
/** | |
* Ensure that every element either is passed in a static location, in an | |
* array with an explicit keys property defined, or in an object literal | |
* with valid key property. | |
* | |
* @internal | |
* @param {ReactNode} node Statically passed child of any type. | |
* @param {*} parentType node's parent's type. | |
*/ | |
function validateChildKeys(node, parentType) { | |
if (typeof node !== 'object') { | |
return; | |
} | |
if (Array.isArray(node)) { | |
for (var i = 0; i < node.length; i++) { | |
var child = node[i]; | |
if (ReactElement.isValidElement(child)) { | |
validateExplicitKey(child, parentType); | |
} | |
} | |
} else if (ReactElement.isValidElement(node)) { | |
// This element was passed in a valid location. | |
if (node._store) { | |
node._store.validated = true; | |
} | |
} else if (node) { | |
var iteratorFn = getIteratorFn(node); | |
// Entry iterators provide implicit keys. | |
if (iteratorFn) { | |
if (iteratorFn !== node.entries) { | |
var iterator = iteratorFn.call(node); | |
var step; | |
while (!(step = iterator.next()).done) { | |
if (ReactElement.isValidElement(step.value)) { | |
validateExplicitKey(step.value, parentType); | |
} | |
} | |
} | |
} | |
} | |
} | |
/** | |
* Given an element, validate that its props follow the propTypes definition, | |
* provided by the type. | |
* | |
* @param {ReactElement} element | |
*/ | |
function validatePropTypes(element) { | |
var componentClass = element.type; | |
if (typeof componentClass !== 'function') { | |
return; | |
} | |
var name = componentClass.displayName || componentClass.name; | |
if (componentClass.propTypes) { | |
checkReactTypeSpec(componentClass.propTypes, element.props, 'prop', name, element, null); | |
} | |
if (typeof componentClass.getDefaultProps === 'function') { | |
process.env.NODE_ENV !== 'production' ? warning(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0; | |
} | |
} | |
var ReactElementValidator = { | |
createElement: function (type, props, children) { | |
var validType = typeof type === 'string' || typeof type === 'function'; | |
// We warn in this case but don't throw. We expect the element creation to | |
// succeed and there will likely be errors in render. | |
if (!validType) { | |
if (typeof type !== 'function' && typeof type !== 'string') { | |
var info = ''; | |
if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) { | |
info += ' You likely forgot to export your component from the file ' + 'it\'s defined in.'; | |
} | |
info += getDeclarationErrorAddendum(); | |
process.env.NODE_ENV !== 'production' ? warning(false, 'React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', type == null ? type : typeof type, info) : void 0; | |
} | |
} | |
var element = ReactElement.createElement.apply(this, arguments); | |
// The result can be nullish if a mock or a custom function is used. | |
// TODO: Drop this when these are no longer allowed as the type argument. | |
if (element == null) { | |
return element; | |
} | |
// Skip key warning if the type isn't valid since our key validation logic | |
// doesn't expect a non-string/function type and can throw confusing errors. | |
// We don't want exception behavior to differ between dev and prod. | |
// (Rendering will throw with a helpful message and as soon as the type is | |
// fixed, the key warnings will appear.) | |
if (validType) { | |
for (var i = 2; i < arguments.length; i++) { | |
validateChildKeys(arguments[i], type); | |
} | |
} | |
validatePropTypes(element); | |
return element; | |
}, | |
createFactory: function (type) { | |
var validatedFactory = ReactElementValidator.createElement.bind(null, type); | |
// Legacy hook TODO: Warn if this is accessed | |
validatedFactory.type = type; | |
if (process.env.NODE_ENV !== 'production') { | |
if (canDefineProperty) { | |
Object.defineProperty(validatedFactory, 'type', { | |
enumerable: false, | |
get: function () { | |
process.env.NODE_ENV !== 'production' ? warning(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.') : void 0; | |
Object.defineProperty(this, 'type', { | |
value: type | |
}); | |
return type; | |
} | |
}); | |
} | |
} | |
return validatedFactory; | |
}, | |
cloneElement: function (element, props, children) { | |
var newElement = ReactElement.cloneElement.apply(this, arguments); | |
for (var i = 2; i < arguments.length; i++) { | |
validateChildKeys(arguments[i], newElement.type); | |
} | |
validatePropTypes(newElement); | |
return newElement; | |
} | |
}; | |
module.exports = ReactElementValidator; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 223 */ | |
/***/ (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 ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; | |
module.exports = ReactPropTypesSecret; | |
/***/ }), | |
/* 224 */ | |
/***/ (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 _prodInvariant = __webpack_require__(41); | |
var ReactCurrentOwner = __webpack_require__(31); | |
var REACT_ELEMENT_TYPE = __webpack_require__(221); | |
var getIteratorFn = __webpack_require__(141); | |
var invariant = __webpack_require__(11); | |
var KeyEscapeUtils = __webpack_require__(219); | |
var warning = __webpack_require__(10); | |
var SEPARATOR = '.'; | |
var SUBSEPARATOR = ':'; | |
/** | |
* This is inlined from ReactElement since this file is shared between | |
* isomorphic and renderers. We could extract this to a | |
* | |
*/ | |
/** | |
* TODO: Test that a single child and an array with one item have the same key | |
* pattern. | |
*/ | |
var didWarnAboutMaps = false; | |
/** | |
* Generate a key string that identifies a component within a set. | |
* | |
* @param {*} component A component that could contain a manual key. | |
* @param {number} index Index that is used if a manual key is not provided. | |
* @return {string} | |
*/ | |
function getComponentKey(component, index) { | |
// Do some typechecking here since we call this blindly. We want to ensure | |
// that we don't block potential future ES APIs. | |
if (component && typeof component === 'object' && component.key != null) { | |
// Explicit key | |
return KeyEscapeUtils.escape(component.key); | |
} | |
// Implicit key determined by the index in the set | |
return index.toString(36); | |
} | |
/** | |
* @param {?*} children Children tree container. | |
* @param {!string} nameSoFar Name of the key path so far. | |
* @param {!function} callback Callback to invoke with each child found. | |
* @param {?*} traverseContext Used to pass information throughout the traversal | |
* process. | |
* @return {!number} The number of children in this subtree. | |
*/ | |
function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) { | |
var type = typeof children; | |
if (type === 'undefined' || type === 'boolean') { | |
// All of the above are perceived as null. | |
children = null; | |
} | |
if (children === null || type === 'string' || type === 'number' || | |
// The following is inlined from ReactElement. This means we can optimize | |
// some checks. React Fiber also inlines this logic for similar purposes. | |
type === 'object' && children.$$typeof === REACT_ELEMENT_TYPE) { | |
callback(traverseContext, children, | |
// If it's the only child, treat the name as if it was wrapped in an array | |
// so that it's consistent if the number of children grows. | |
nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar); | |
return 1; | |
} | |
var child; | |
var nextName; | |
var subtreeCount = 0; // Count of children found in the current subtree. | |
var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR; | |
if (Array.isArray(children)) { | |
for (var i = 0; i < children.length; i++) { | |
child = children[i]; | |
nextName = nextNamePrefix + getComponentKey(child, i); | |
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); | |
} | |
} else { | |
var iteratorFn = getIteratorFn(children); | |
if (iteratorFn) { | |
var iterator = iteratorFn.call(children); | |
var step; | |
if (iteratorFn !== children.entries) { | |
var ii = 0; | |
while (!(step = iterator.next()).done) { | |
child = step.value; | |
nextName = nextNamePrefix + getComponentKey(child, ii++); | |
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); | |
} | |
} else { | |
if (process.env.NODE_ENV !== 'production') { | |
var mapsAsChildrenAddendum = ''; | |
if (ReactCurrentOwner.current) { | |
var mapsAsChildrenOwnerName = ReactCurrentOwner.current.getName(); | |
if (mapsAsChildrenOwnerName) { | |
mapsAsChildrenAddendum = ' Check the render method of `' + mapsAsChildrenOwnerName + '`.'; | |
} | |
} | |
process.env.NODE_ENV !== 'production' ? warning(didWarnAboutMaps, 'Using Maps as children is not yet fully supported. It is an ' + 'experimental feature that might be removed. Convert it to a ' + 'sequence / iterable of keyed ReactElements instead.%s', mapsAsChildrenAddendum) : void 0; | |
didWarnAboutMaps = true; | |
} | |
// Iterator will provide entry [k,v] tuples rather than values. | |
while (!(step = iterator.next()).done) { | |
var entry = step.value; | |
if (entry) { | |
child = entry[1]; | |
nextName = nextNamePrefix + KeyEscapeUtils.escape(entry[0]) + SUBSEPARATOR + getComponentKey(child, 0); | |
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); | |
} | |
} | |
} | |
} else if (type === 'object') { | |
var addendum = ''; | |
if (process.env.NODE_ENV !== 'production') { | |
addendum = ' If you meant to render a collection of children, use an array ' + 'instead or wrap the object using createFragment(object) from the ' + 'React add-ons.'; | |
if (children._isReactElement) { | |
addendum = ' It looks like you\'re using an element created by a different ' + 'version of React. Make sure to use only one copy of React.'; | |
} | |
if (ReactCurrentOwner.current) { | |
var name = ReactCurrentOwner.current.getName(); | |
if (name) { | |
addendum += ' Check the render method of `' + name + '`.'; | |
} | |
} | |
} | |
var childrenString = String(children); | |
true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : _prodInvariant('31', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : void 0; | |
} | |
} | |
return subtreeCount; | |
} | |
/** | |
* Traverses children that are typically specified as `props.children`, but | |
* might also be specified through attributes: | |
* | |
* - `traverseAllChildren(this.props.children, ...)` | |
* - `traverseAllChildren(this.props.leftPanelChildren, ...)` | |
* | |
* The `traverseContext` is an optional argument that is passed through the | |
* entire traversal. It can be used to store accumulations or anything else that | |
* the callback might find relevant. | |
* | |
* @param {?*} children Children tree object. | |
* @param {!function} callback To invoke upon traversing each child. | |
* @param {?*} traverseContext Context for traversal. | |
* @return {!number} The number of children in this subtree. | |
*/ | |
function traverseAllChildren(children, callback, traverseContext) { | |
if (children == null) { | |
return 0; | |
} | |
return traverseAllChildrenImpl(children, '', callback, traverseContext); | |
} | |
module.exports = traverseAllChildren; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 225 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
exports.__esModule = true; | |
var createHelper = function createHelper(func, helperName) { | |
var setDisplayName = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; | |
var noArgs = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; | |
if (process.env.NODE_ENV !== 'production' && setDisplayName) { | |
var _ret = function () { | |
/* eslint-disable global-require */ | |
var wrapDisplayName = __webpack_require__(542).default; | |
/* eslint-enable global-require */ | |
if (noArgs) { | |
return { | |
v: function v(BaseComponent) { | |
var Component = func(BaseComponent); | |
Component.displayName = wrapDisplayName(BaseComponent, helperName); | |
return Component; | |
} | |
}; | |
} | |
return { | |
v: function v() { | |
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | |
args[_key] = arguments[_key]; | |
} | |
return function (BaseComponent) { | |
var Component = func.apply(undefined, args)(BaseComponent); | |
Component.displayName = wrapDisplayName(BaseComponent, helperName); | |
return Component; | |
}; | |
} | |
}; | |
}(); | |
if (typeof _ret === "object") return _ret.v; | |
} | |
return func; | |
}; | |
exports.default = createHelper; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 226 */ | |
/***/ (function(module, exports) { | |
var g; | |
// This works in non-strict mode | |
g = (function() { | |
return this; | |
})(); | |
try { | |
// This works if eval is allowed (see CSP) | |
g = g || Function("return this")() || (1,eval)("this"); | |
} catch(e) { | |
// This works if the window reference is available | |
if(typeof window === "object") | |
g = window; | |
} | |
// g can still be undefined, but nothing to do about it... | |
// We return undefined, instead of nothing here, so it's | |
// easier to handle this case. if(!global) { ...} | |
module.exports = g; | |
/***/ }), | |
/* 227 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = undefined; | |
var _AppBar = __webpack_require__(351); | |
var _AppBar2 = _interopRequireDefault(_AppBar); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.default = _AppBar2.default; | |
/***/ }), | |
/* 228 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = undefined; | |
var _AutoComplete = __webpack_require__(352); | |
var _AutoComplete2 = _interopRequireDefault(_AutoComplete); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.default = _AutoComplete2.default; | |
/***/ }), | |
/* 229 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = undefined; | |
var _Badge = __webpack_require__(354); | |
var _Badge2 = _interopRequireDefault(_Badge); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.default = _Badge2.default; | |
/***/ }), | |
/* 230 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = exports.BottomNavigationItem = exports.BottomNavigation = undefined; | |
var _BottomNavigation2 = __webpack_require__(355); | |
var _BottomNavigation3 = _interopRequireDefault(_BottomNavigation2); | |
var _BottomNavigationItem2 = __webpack_require__(143); | |
var _BottomNavigationItem3 = _interopRequireDefault(_BottomNavigationItem2); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.BottomNavigation = _BottomNavigation3.default; | |
exports.BottomNavigationItem = _BottomNavigationItem3.default; | |
exports.default = _BottomNavigation3.default; | |
/***/ }), | |
/* 231 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = exports.CardExpandable = exports.CardActions = exports.CardText = exports.CardMedia = exports.CardTitle = exports.CardHeader = exports.Card = undefined; | |
var _Card2 = __webpack_require__(356); | |
var _Card3 = _interopRequireDefault(_Card2); | |
var _CardHeader2 = __webpack_require__(145); | |
var _CardHeader3 = _interopRequireDefault(_CardHeader2); | |
var _CardTitle2 = __webpack_require__(148); | |
var _CardTitle3 = _interopRequireDefault(_CardTitle2); | |
var _CardMedia2 = __webpack_require__(146); | |
var _CardMedia3 = _interopRequireDefault(_CardMedia2); | |
var _CardText2 = __webpack_require__(147); | |
var _CardText3 = _interopRequireDefault(_CardText2); | |
var _CardActions2 = __webpack_require__(144); | |
var _CardActions3 = _interopRequireDefault(_CardActions2); | |
var _CardExpandable2 = __webpack_require__(189); | |
var _CardExpandable3 = _interopRequireDefault(_CardExpandable2); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.Card = _Card3.default; | |
exports.CardHeader = _CardHeader3.default; | |
exports.CardTitle = _CardTitle3.default; | |
exports.CardMedia = _CardMedia3.default; | |
exports.CardText = _CardText3.default; | |
exports.CardActions = _CardActions3.default; | |
exports.CardExpandable = _CardExpandable3.default; | |
exports.default = _Card3.default; | |
/***/ }), | |
/* 232 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = undefined; | |
var _Chip = __webpack_require__(358); | |
var _Chip2 = _interopRequireDefault(_Chip); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.default = _Chip2.default; | |
/***/ }), | |
/* 233 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = undefined; | |
var _CircularProgress = __webpack_require__(359); | |
var _CircularProgress2 = _interopRequireDefault(_CircularProgress); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.default = _CircularProgress2.default; | |
/***/ }), | |
/* 234 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = undefined; | |
var _DatePicker = __webpack_require__(366); | |
var _DatePicker2 = _interopRequireDefault(_DatePicker); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.default = _DatePicker2.default; | |
/***/ }), | |
/* 235 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = undefined; | |
var _Drawer = __webpack_require__(372); | |
var _Drawer2 = _interopRequireDefault(_Drawer); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.default = _Drawer2.default; | |
/***/ }), | |
/* 236 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = undefined; | |
var _FloatingActionButton = __webpack_require__(376); | |
var _FloatingActionButton2 = _interopRequireDefault(_FloatingActionButton); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.default = _FloatingActionButton2.default; | |
/***/ }), | |
/* 237 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = exports.GridTile = exports.GridList = undefined; | |
var _GridList2 = __webpack_require__(378); | |
var _GridList3 = _interopRequireDefault(_GridList2); | |
var _GridTile2 = __webpack_require__(151); | |
var _GridTile3 = _interopRequireDefault(_GridTile2); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.GridList = _GridList3.default; | |
exports.GridTile = _GridTile3.default; | |
exports.default = _GridList3.default; | |
/***/ }), | |
/* 238 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = exports.MenuItem = exports.IconMenu = undefined; | |
var _IconMenu2 = __webpack_require__(380); | |
var _IconMenu3 = _interopRequireDefault(_IconMenu2); | |
var _MenuItem2 = __webpack_require__(115); | |
var _MenuItem3 = _interopRequireDefault(_MenuItem2); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.IconMenu = _IconMenu3.default; | |
exports.MenuItem = _MenuItem3.default; | |
exports.default = _IconMenu3.default; | |
/***/ }), | |
/* 239 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = undefined; | |
var _LinearProgress = __webpack_require__(381); | |
var _LinearProgress2 = _interopRequireDefault(_LinearProgress); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.default = _LinearProgress2.default; | |
/***/ }), | |
/* 240 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = exports.makeSelectable = exports.ListItem = exports.List = undefined; | |
var _List2 = __webpack_require__(114); | |
var _List3 = _interopRequireDefault(_List2); | |
var _ListItem2 = __webpack_require__(91); | |
var _ListItem3 = _interopRequireDefault(_ListItem2); | |
var _makeSelectable2 = __webpack_require__(152); | |
var _makeSelectable3 = _interopRequireDefault(_makeSelectable2); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.List = _List3.default; | |
exports.ListItem = _ListItem3.default; | |
exports.makeSelectable = _makeSelectable3.default; | |
exports.default = _List3.default; | |
/***/ }), | |
/* 241 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = exports.PopoverAnimationVertical = exports.Popover = undefined; | |
var _Popover2 = __webpack_require__(57); | |
var _Popover3 = _interopRequireDefault(_Popover2); | |
var _PopoverAnimationVertical2 = __webpack_require__(116); | |
var _PopoverAnimationVertical3 = _interopRequireDefault(_PopoverAnimationVertical2); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.Popover = _Popover3.default; | |
exports.PopoverAnimationVertical = _PopoverAnimationVertical3.default; | |
exports.default = _Popover3.default; | |
/***/ }), | |
/* 242 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = exports.RadioButtonGroup = exports.RadioButton = undefined; | |
var _RadioButton2 = __webpack_require__(190); | |
var _RadioButton3 = _interopRequireDefault(_RadioButton2); | |
var _RadioButtonGroup2 = __webpack_require__(154); | |
var _RadioButtonGroup3 = _interopRequireDefault(_RadioButtonGroup2); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.RadioButton = _RadioButton3.default; | |
exports.RadioButtonGroup = _RadioButtonGroup3.default; | |
exports.default = _RadioButton3.default; | |
/***/ }), | |
/* 243 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = undefined; | |
var _RaisedButton = __webpack_require__(386); | |
var _RaisedButton2 = _interopRequireDefault(_RaisedButton); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.default = _RaisedButton2.default; | |
/***/ }), | |
/* 244 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = undefined; | |
var _RefreshIndicator = __webpack_require__(387); | |
var _RefreshIndicator2 = _interopRequireDefault(_RefreshIndicator); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.default = _RefreshIndicator2.default; | |
/***/ }), | |
/* 245 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = undefined; | |
var _SelectField = __webpack_require__(388); | |
var _SelectField2 = _interopRequireDefault(_SelectField); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.default = _SelectField2.default; | |
/***/ }), | |
/* 246 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = undefined; | |
var _Slider = __webpack_require__(389); | |
var _Slider2 = _interopRequireDefault(_Slider); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.default = _Slider2.default; | |
/***/ }), | |
/* 247 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = undefined; | |
var _Snackbar = __webpack_require__(390); | |
var _Snackbar2 = _interopRequireDefault(_Snackbar); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.default = _Snackbar2.default; | |
/***/ }), | |
/* 248 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _extends2 = __webpack_require__(8); | |
var _extends3 = _interopRequireDefault(_extends2); | |
var _objectWithoutProperties2 = __webpack_require__(9); | |
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | |
var _getPrototypeOf = __webpack_require__(4); | |
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | |
var _classCallCheck2 = __webpack_require__(2); | |
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | |
var _createClass2 = __webpack_require__(3); | |
var _createClass3 = _interopRequireDefault(_createClass2); | |
var _possibleConstructorReturn2 = __webpack_require__(6); | |
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | |
var _inherits2 = __webpack_require__(5); | |
var _inherits3 = _interopRequireDefault(_inherits2); | |
var _simpleAssign = __webpack_require__(7); | |
var _simpleAssign2 = _interopRequireDefault(_simpleAssign); | |
var _react = __webpack_require__(1); | |
var _react2 = _interopRequireDefault(_react); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
var getStyles = function getStyles(_ref, _ref2) { | |
var index = _ref.index; | |
var stepper = _ref2.stepper; | |
var orientation = stepper.orientation; | |
var styles = { | |
root: { | |
flex: '0 0 auto' | |
} | |
}; | |
if (index > 0) { | |
if (orientation === 'horizontal') { | |
styles.root.marginLeft = -6; | |
} else if (orientation === 'vertical') { | |
styles.root.marginTop = -14; | |
} | |
} | |
return styles; | |
}; | |
var Step = function (_Component) { | |
(0, _inherits3.default)(Step, _Component); | |
function Step() { | |
var _ref3; | |
var _temp, _this, _ret; | |
(0, _classCallCheck3.default)(this, Step); | |
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | |
args[_key] = arguments[_key]; | |
} | |
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref3 = Step.__proto__ || (0, _getPrototypeOf2.default)(Step)).call.apply(_ref3, [this].concat(args))), _this), _this.renderChild = function (child) { | |
var _this$props = _this.props, | |
active = _this$props.active, | |
completed = _this$props.completed, | |
disabled = _this$props.disabled, | |
index = _this$props.index, | |
last = _this$props.last; | |
var icon = index + 1; | |
return _react2.default.cloneElement(child, (0, _simpleAssign2.default)({ active: active, completed: completed, disabled: disabled, icon: icon, last: last }, child.props)); | |
}, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); | |
} | |
(0, _createClass3.default)(Step, [{ | |
key: 'render', | |
value: function render() { | |
var _props = this.props, | |
active = _props.active, | |
completed = _props.completed, | |
disabled = _props.disabled, | |
index = _props.index, | |
last = _props.last, | |
children = _props.children, | |
style = _props.style, | |
other = (0, _objectWithoutProperties3.default)(_props, ['active', 'completed', 'disabled', 'index', 'last', 'children', 'style']); | |
var prepareStyles = this.context.muiTheme.prepareStyles; | |
var styles = getStyles(this.props, this.context); | |
return _react2.default.createElement( | |
'div', | |
(0, _extends3.default)({ style: prepareStyles((0, _simpleAssign2.default)(styles.root, style)) }, other), | |
_react2.default.Children.map(children, this.renderChild) | |
); | |
} | |
}]); | |
return Step; | |
}(_react.Component); | |
Step.contextTypes = { | |
muiTheme: _react.PropTypes.object.isRequired, | |
stepper: _react.PropTypes.object | |
}; | |
process.env.NODE_ENV !== "production" ? Step.propTypes = { | |
/** | |
* Sets the step as active. Is passed to child components. | |
*/ | |
active: _react.PropTypes.bool, | |
/** | |
* Should be `Step` sub-components such as `StepLabel`. | |
*/ | |
children: _react.PropTypes.node, | |
/** | |
* Mark the step as completed. Is passed to child components. | |
*/ | |
completed: _react.PropTypes.bool, | |
/** | |
* Mark the step as disabled, will also disable the button if | |
* `StepButton` is a child of `Step`. Is passed to child components. | |
*/ | |
disabled: _react.PropTypes.bool, | |
/** | |
* @ignore | |
* Used internally for numbering. | |
*/ | |
index: _react.PropTypes.number, | |
/** | |
* @ignore | |
*/ | |
last: _react.PropTypes.bool, | |
/** | |
* Override the inline-style of the root element. | |
*/ | |
style: _react.PropTypes.object | |
} : void 0; | |
exports.default = Step; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 249 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _extends2 = __webpack_require__(8); | |
var _extends3 = _interopRequireDefault(_extends2); | |
var _objectWithoutProperties2 = __webpack_require__(9); | |
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | |
var _getPrototypeOf = __webpack_require__(4); | |
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | |
var _classCallCheck2 = __webpack_require__(2); | |
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | |
var _createClass2 = __webpack_require__(3); | |
var _createClass3 = _interopRequireDefault(_createClass2); | |
var _possibleConstructorReturn2 = __webpack_require__(6); | |
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | |
var _inherits2 = __webpack_require__(5); | |
var _inherits3 = _interopRequireDefault(_inherits2); | |
var _simpleAssign = __webpack_require__(7); | |
var _simpleAssign2 = _interopRequireDefault(_simpleAssign); | |
var _react = __webpack_require__(1); | |
var _react2 = _interopRequireDefault(_react); | |
var _transitions = __webpack_require__(12); | |
var _transitions2 = _interopRequireDefault(_transitions); | |
var _EnhancedButton = __webpack_require__(28); | |
var _EnhancedButton2 = _interopRequireDefault(_EnhancedButton); | |
var _StepLabel = __webpack_require__(155); | |
var _StepLabel2 = _interopRequireDefault(_StepLabel); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
var isLabel = function isLabel(child) { | |
return child && child.type && child.type.muiName === 'StepLabel'; | |
}; | |
var getStyles = function getStyles(props, context, state) { | |
var hovered = state.hovered; | |
var _context$muiTheme$ste = context.muiTheme.stepper, | |
backgroundColor = _context$muiTheme$ste.backgroundColor, | |
hoverBackgroundColor = _context$muiTheme$ste.hoverBackgroundColor; | |
var styles = { | |
root: { | |
padding: 0, | |
backgroundColor: hovered ? hoverBackgroundColor : backgroundColor, | |
transition: _transitions2.default.easeOut() | |
} | |
}; | |
if (context.stepper.orientation === 'vertical') { | |
styles.root.width = '100%'; | |
} | |
return styles; | |
}; | |
var StepButton = function (_Component) { | |
(0, _inherits3.default)(StepButton, _Component); | |
function StepButton() { | |
var _ref; | |
var _temp, _this, _ret; | |
(0, _classCallCheck3.default)(this, StepButton); | |
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | |
args[_key] = arguments[_key]; | |
} | |
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = StepButton.__proto__ || (0, _getPrototypeOf2.default)(StepButton)).call.apply(_ref, [this].concat(args))), _this), _this.state = { | |
hovered: false, | |
touched: false | |
}, _this.handleMouseEnter = function (event) { | |
var onMouseEnter = _this.props.onMouseEnter; | |
// Cancel hover styles for touch devices | |
if (!_this.state.touched) { | |
_this.setState({ hovered: true }); | |
} | |
if (typeof onMouseEnter === 'function') { | |
onMouseEnter(event); | |
} | |
}, _this.handleMouseLeave = function (event) { | |
var onMouseLeave = _this.props.onMouseLeave; | |
_this.setState({ hovered: false }); | |
if (typeof onMouseLeave === 'function') { | |
onMouseLeave(event); | |
} | |
}, _this.handleTouchStart = function (event) { | |
var onTouchStart = _this.props.onTouchStart; | |
if (!_this.state.touched) { | |
_this.setState({ touched: true }); | |
} | |
if (typeof onTouchStart === 'function') { | |
onTouchStart(event); | |
} | |
}, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); | |
} | |
(0, _createClass3.default)(StepButton, [{ | |
key: 'render', | |
value: function render() { | |
var _props = this.props, | |
active = _props.active, | |
children = _props.children, | |
completed = _props.completed, | |
disabled = _props.disabled, | |
icon = _props.icon, | |
iconContainerStyle = _props.iconContainerStyle, | |
last = _props.last, | |
onMouseEnter = _props.onMouseEnter, | |
onMouseLeave = _props.onMouseLeave, | |
onTouchStart = _props.onTouchStart, | |
style = _props.style, | |
other = (0, _objectWithoutProperties3.default)(_props, ['active', 'children', 'completed', 'disabled', 'icon', 'iconContainerStyle', 'last', 'onMouseEnter', 'onMouseLeave', 'onTouchStart', 'style']); | |
var styles = getStyles(this.props, this.context, this.state); | |
var child = isLabel(children) ? children : _react2.default.createElement( | |
_StepLabel2.default, | |
null, | |
children | |
); | |
return _react2.default.createElement( | |
_EnhancedButton2.default, | |
(0, _extends3.default)({ | |
disabled: disabled, | |
style: (0, _simpleAssign2.default)(styles.root, style), | |
onMouseEnter: this.handleMouseEnter, | |
onMouseLeave: this.handleMouseLeave, | |
onTouchStart: this.handleTouchStart | |
}, other), | |
_react2.default.cloneElement(child, { active: active, completed: completed, disabled: disabled, icon: icon, iconContainerStyle: iconContainerStyle }) | |
); | |
} | |
}]); | |
return StepButton; | |
}(_react.Component); | |
StepButton.contextTypes = { | |
muiTheme: _react.PropTypes.object.isRequired, | |
stepper: _react.PropTypes.object | |
}; | |
process.env.NODE_ENV !== "production" ? StepButton.propTypes = { | |
/** | |
* Passed from `Step` Is passed to StepLabel. | |
*/ | |
active: _react.PropTypes.bool, | |
/** | |
* Can be a `StepLabel` or a node to place inside `StepLabel` as children. | |
*/ | |
children: _react.PropTypes.node, | |
/** | |
* Sets completed styling. Is passed to StepLabel. | |
*/ | |
completed: _react.PropTypes.bool, | |
/** | |
* Disables the button and sets disabled styling. Is passed to StepLabel. | |
*/ | |
disabled: _react.PropTypes.bool, | |
/** | |
* The icon displayed by the step label. | |
*/ | |
icon: _react.PropTypes.oneOfType([_react.PropTypes.element, _react.PropTypes.string, _react.PropTypes.number]), | |
/** | |
* Override the inline-styles of the icon container element. | |
*/ | |
iconContainerStyle: _react.PropTypes.object, | |
/** @ignore */ | |
last: _react.PropTypes.bool, | |
/** @ignore */ | |
onMouseEnter: _react.PropTypes.func, | |
/** @ignore */ | |
onMouseLeave: _react.PropTypes.func, | |
/** @ignore */ | |
onTouchStart: _react.PropTypes.func, | |
/** | |
* Override the inline-style of the root element. | |
*/ | |
style: _react.PropTypes.object | |
} : void 0; | |
exports.default = StepButton; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 250 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _extends2 = __webpack_require__(8); | |
var _extends3 = _interopRequireDefault(_extends2); | |
var _objectWithoutProperties2 = __webpack_require__(9); | |
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | |
var _getPrototypeOf = __webpack_require__(4); | |
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | |
var _classCallCheck2 = __webpack_require__(2); | |
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | |
var _createClass2 = __webpack_require__(3); | |
var _createClass3 = _interopRequireDefault(_createClass2); | |
var _possibleConstructorReturn2 = __webpack_require__(6); | |
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | |
var _inherits2 = __webpack_require__(5); | |
var _inherits3 = _interopRequireDefault(_inherits2); | |
var _simpleAssign = __webpack_require__(7); | |
var _simpleAssign2 = _interopRequireDefault(_simpleAssign); | |
var _react = __webpack_require__(1); | |
var _react2 = _interopRequireDefault(_react); | |
var _ExpandTransition = __webpack_require__(416); | |
var _ExpandTransition2 = _interopRequireDefault(_ExpandTransition); | |
var _warning = __webpack_require__(20); | |
var _warning2 = _interopRequireDefault(_warning); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
function ExpandTransition(props) { | |
return _react2.default.createElement(_ExpandTransition2.default, props); | |
} | |
var getStyles = function getStyles(props, context) { | |
var styles = { | |
root: { | |
marginTop: -14, | |
marginLeft: 14 + 11, // padding + 1/2 icon | |
paddingLeft: 24 - 11 + 8, | |
paddingRight: 16, | |
overflow: 'hidden' | |
} | |
}; | |
if (!props.last) { | |
styles.root.borderLeft = '1px solid ' + context.muiTheme.stepper.connectorLineColor; | |
} | |
return styles; | |
}; | |
var StepContent = function (_Component) { | |
(0, _inherits3.default)(StepContent, _Component); | |
function StepContent() { | |
(0, _classCallCheck3.default)(this, StepContent); | |
return (0, _possibleConstructorReturn3.default)(this, (StepContent.__proto__ || (0, _getPrototypeOf2.default)(StepContent)).apply(this, arguments)); | |
} | |
(0, _createClass3.default)(StepContent, [{ | |
key: 'render', | |
value: function render() { | |
var _props = this.props, | |
active = _props.active, | |
children = _props.children, | |
completed = _props.completed, | |
last = _props.last, | |
style = _props.style, | |
transition = _props.transition, | |
transitionDuration = _props.transitionDuration, | |
other = (0, _objectWithoutProperties3.default)(_props, ['active', 'children', 'completed', 'last', 'style', 'transition', 'transitionDuration']); | |
var _context = this.context, | |
stepper = _context.stepper, | |
prepareStyles = _context.muiTheme.prepareStyles; | |
if (stepper.orientation !== 'vertical') { | |
process.env.NODE_ENV !== "production" ? (0, _warning2.default)(false, 'Material-UI: <StepContent /> is only designed for use with the vertical stepper.') : void 0; | |
return null; | |
} | |
var styles = getStyles(this.props, this.context); | |
var transitionProps = { | |
enterDelay: transitionDuration, | |
transitionDuration: transitionDuration, | |
open: active | |
}; | |
return _react2.default.createElement( | |
'div', | |
(0, _extends3.default)({ style: prepareStyles((0, _simpleAssign2.default)(styles.root, style)) }, other), | |
_react2.default.createElement(transition, transitionProps, _react2.default.createElement( | |
'div', | |
{ style: { overflow: 'hidden' } }, | |
children | |
)) | |
); | |
} | |
}]); | |
return StepContent; | |
}(_react.Component); | |
StepContent.defaultProps = { | |
transition: ExpandTransition, | |
transitionDuration: 450 | |
}; | |
StepContent.contextTypes = { | |
muiTheme: _react.PropTypes.object.isRequired, | |
stepper: _react.PropTypes.object | |
}; | |
process.env.NODE_ENV !== "production" ? StepContent.propTypes = { | |
/** | |
* Expands the content | |
*/ | |
active: _react.PropTypes.bool, | |
/** | |
* Step content | |
*/ | |
children: _react.PropTypes.node, | |
/** | |
* @ignore | |
*/ | |
completed: _react.PropTypes.bool, | |
/** | |
* @ignore | |
*/ | |
last: _react.PropTypes.bool, | |
/** | |
* Override the inline-style of the root element. | |
*/ | |
style: _react.PropTypes.object, | |
/** | |
* ReactTransitionGroup component. | |
*/ | |
transition: _react.PropTypes.func, | |
/** | |
* Adjust the duration of the content expand transition. Passed as a prop to the transition component. | |
*/ | |
transitionDuration: _react.PropTypes.number | |
} : void 0; | |
exports.default = StepContent; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 251 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _getPrototypeOf = __webpack_require__(4); | |
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | |
var _classCallCheck2 = __webpack_require__(2); | |
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | |
var _createClass2 = __webpack_require__(3); | |
var _createClass3 = _interopRequireDefault(_createClass2); | |
var _possibleConstructorReturn2 = __webpack_require__(6); | |
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | |
var _inherits2 = __webpack_require__(5); | |
var _inherits3 = _interopRequireDefault(_inherits2); | |
var _simpleAssign = __webpack_require__(7); | |
var _simpleAssign2 = _interopRequireDefault(_simpleAssign); | |
var _react = __webpack_require__(1); | |
var _react2 = _interopRequireDefault(_react); | |
var _StepConnector = __webpack_require__(392); | |
var _StepConnector2 = _interopRequireDefault(_StepConnector); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
var getStyles = function getStyles(props) { | |
var orientation = props.orientation; | |
return { | |
root: { | |
display: 'flex', | |
flexDirection: orientation === 'horizontal' ? 'row' : 'column', | |
alignContent: 'center', | |
alignItems: orientation === 'horizontal' ? 'center' : 'stretch', | |
justifyContent: 'space-between' | |
} | |
}; | |
}; | |
var Stepper = function (_Component) { | |
(0, _inherits3.default)(Stepper, _Component); | |
function Stepper() { | |
(0, _classCallCheck3.default)(this, Stepper); | |
return (0, _possibleConstructorReturn3.default)(this, (Stepper.__proto__ || (0, _getPrototypeOf2.default)(Stepper)).apply(this, arguments)); | |
} | |
(0, _createClass3.default)(Stepper, [{ | |
key: 'getChildContext', | |
value: function getChildContext() { | |
var orientation = this.props.orientation; | |
return { stepper: { orientation: orientation } }; | |
} | |
}, { | |
key: 'render', | |
value: function render() { | |
var _props = this.props, | |
activeStep = _props.activeStep, | |
children = _props.children, | |
connector = _props.connector, | |
linear = _props.linear, | |
style = _props.style; | |
var prepareStyles = this.context.muiTheme.prepareStyles; | |
var styles = getStyles(this.props, this.context); | |
/** | |
* One day, we may be able to use real CSS tools | |
* For now, we need to create our own "pseudo" elements | |
* and nth child selectors, etc | |
* That's what some of this garbage is for :) | |
*/ | |
var numChildren = _react.Children.count(children); | |
var steps = _react.Children.map(children, function (step, index) { | |
var controlProps = { index: index }; | |
if (activeStep === index) { | |
controlProps.active = true; | |
} else if (linear && activeStep > index) { | |
controlProps.completed = true; | |
} else if (linear && activeStep < index) { | |
controlProps.disabled = true; | |
} | |
if (index + 1 === numChildren) { | |
controlProps.last = true; | |
} | |
return [index > 0 && connector, _react2.default.cloneElement(step, (0, _simpleAssign2.default)(controlProps, step.props))]; | |
}); | |
return _react2.default.createElement( | |
'div', | |
{ style: prepareStyles((0, _simpleAssign2.default)(styles.root, style)) }, | |
steps | |
); | |
} | |
}]); | |
return Stepper; | |
}(_react.Component); | |
Stepper.defaultProps = { | |
connector: _react2.default.createElement(_StepConnector2.default, null), | |
orientation: 'horizontal', | |
linear: true | |
}; | |
Stepper.contextTypes = { muiTheme: _react.PropTypes.object.isRequired }; | |
Stepper.childContextTypes = { stepper: _react.PropTypes.object }; | |
process.env.NODE_ENV !== "production" ? Stepper.propTypes = { | |
/** | |
* Set the active step (zero based index). This will enable `Step` control helpers. | |
*/ | |
activeStep: _react.PropTypes.number, | |
/** | |
* Should be two or more `<Step />` components | |
*/ | |
children: _react.PropTypes.arrayOf(_react.PropTypes.node), | |
/** | |
* A component to be placed between each step. | |
*/ | |
connector: _react.PropTypes.node, | |
/** | |
* If set to `true`, the `Stepper` will assist in controlling steps for linear flow | |
*/ | |
linear: _react.PropTypes.bool, | |
/** | |
* The stepper orientation (layout flow direction) | |
*/ | |
orientation: _react.PropTypes.oneOf(['horizontal', 'vertical']), | |
/** | |
* Override the inline-style of the root element. | |
*/ | |
style: _react.PropTypes.object | |
} : void 0; | |
exports.default = Stepper; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 252 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = exports.TableRowColumn = exports.TableRow = exports.TableHeaderColumn = exports.TableHeader = exports.TableFooter = exports.TableBody = exports.Table = undefined; | |
var _Table2 = __webpack_require__(395); | |
var _Table3 = _interopRequireDefault(_Table2); | |
var _TableBody2 = __webpack_require__(157); | |
var _TableBody3 = _interopRequireDefault(_TableBody2); | |
var _TableFooter2 = __webpack_require__(158); | |
var _TableFooter3 = _interopRequireDefault(_TableFooter2); | |
var _TableHeader2 = __webpack_require__(159); | |
var _TableHeader3 = _interopRequireDefault(_TableHeader2); | |
var _TableHeaderColumn2 = __webpack_require__(93); | |
var _TableHeaderColumn3 = _interopRequireDefault(_TableHeaderColumn2); | |
var _TableRow2 = __webpack_require__(160); | |
var _TableRow3 = _interopRequireDefault(_TableRow2); | |
var _TableRowColumn2 = __webpack_require__(75); | |
var _TableRowColumn3 = _interopRequireDefault(_TableRowColumn2); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.Table = _Table3.default; | |
exports.TableBody = _TableBody3.default; | |
exports.TableFooter = _TableFooter3.default; | |
exports.TableHeader = _TableHeader3.default; | |
exports.TableHeaderColumn = _TableHeaderColumn3.default; | |
exports.TableRow = _TableRow3.default; | |
exports.TableRowColumn = _TableRowColumn3.default; | |
exports.default = _Table3.default; | |
/***/ }), | |
/* 253 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = exports.Tabs = exports.Tab = undefined; | |
var _Tab2 = __webpack_require__(161); | |
var _Tab3 = _interopRequireDefault(_Tab2); | |
var _Tabs2 = __webpack_require__(398); | |
var _Tabs3 = _interopRequireDefault(_Tabs2); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.Tab = _Tab3.default; | |
exports.Tabs = _Tabs3.default; | |
exports.default = _Tabs3.default; | |
/***/ }), | |
/* 254 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = undefined; | |
var _TimePicker = __webpack_require__(408); | |
var _TimePicker2 = _interopRequireDefault(_TimePicker); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.default = _TimePicker2.default; | |
/***/ }), | |
/* 255 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = undefined; | |
var _Toggle = __webpack_require__(410); | |
var _Toggle2 = _interopRequireDefault(_Toggle); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.default = _Toggle2.default; | |
/***/ }), | |
/* 256 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = exports.ToolbarTitle = exports.ToolbarSeparator = exports.ToolbarGroup = exports.Toolbar = undefined; | |
var _Toolbar2 = __webpack_require__(411); | |
var _Toolbar3 = _interopRequireDefault(_Toolbar2); | |
var _ToolbarGroup2 = __webpack_require__(162); | |
var _ToolbarGroup3 = _interopRequireDefault(_ToolbarGroup2); | |
var _ToolbarSeparator2 = __webpack_require__(163); | |
var _ToolbarSeparator3 = _interopRequireDefault(_ToolbarSeparator2); | |
var _ToolbarTitle2 = __webpack_require__(164); | |
var _ToolbarTitle3 = _interopRequireDefault(_ToolbarTitle2); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
exports.Toolbar = _Toolbar3.default; | |
exports.ToolbarGroup = _ToolbarGroup3.default; | |
exports.ToolbarSeparator = _ToolbarSeparator3.default; | |
exports.ToolbarTitle = _ToolbarTitle3.default; | |
exports.default = _Toolbar3.default; | |
/***/ }), | |
/* 257 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
/* WEBPACK VAR INJECTION */(function(process) { | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _getPrototypeOf = __webpack_require__(4); | |
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | |
var _classCallCheck2 = __webpack_require__(2); | |
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | |
var _createClass2 = __webpack_require__(3); | |
var _createClass3 = _interopRequireDefault(_createClass2); | |
var _possibleConstructorReturn2 = __webpack_require__(6); | |
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | |
var _inherits2 = __webpack_require__(5); | |
var _inherits3 = _interopRequireDefault(_inherits2); | |
var _react = __webpack_require__(1); | |
var _getMuiTheme = __webpack_require__(422); | |
var _getMuiTheme2 = _interopRequireDefault(_getMuiTheme); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
var MuiThemeProvider = function (_Component) { | |
(0, _inherits3.default)(MuiThemeProvider, _Component); | |
function MuiThemeProvider() { | |
(0, _classCallCheck3.default)(this, MuiThemeProvider); | |
return (0, _possibleConstructorReturn3.default)(this, (MuiThemeProvider.__proto__ || (0, _getPrototypeOf2.default)(MuiThemeProvider)).apply(this, arguments)); | |
} | |
(0, _createClass3.default)(MuiThemeProvider, [{ | |
key: 'getChildContext', | |
value: function getChildContext() { | |
return { | |
muiTheme: this.props.muiTheme || (0, _getMuiTheme2.default)() | |
}; | |
} | |
}, { | |
key: 'render', | |
value: function render() { | |
return this.props.children; | |
} | |
}]); | |
return MuiThemeProvider; | |
}(_react.Component); | |
MuiThemeProvider.childContextTypes = { | |
muiTheme: _react.PropTypes.object.isRequired | |
}; | |
process.env.NODE_ENV !== "production" ? MuiThemeProvider.propTypes = { | |
children: _react.PropTypes.element, | |
muiTheme: _react.PropTypes.object | |
} : void 0; | |
exports.default = MuiThemeProvider; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 258 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
module.exports = { "default": __webpack_require__(266), __esModule: true }; | |
/***/ }), | |
/* 259 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
module.exports = { "default": __webpack_require__(268), __esModule: true }; | |
/***/ }), | |
/* 260 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
module.exports = { "default": __webpack_require__(272), __esModule: true }; | |
/***/ }), | |
/* 261 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
module.exports = { "default": __webpack_require__(273), __esModule: true }; | |
/***/ }), | |
/* 262 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
module.exports = { "default": __webpack_require__(274), __esModule: true }; | |
/***/ }), | |
/* 263 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
/*! | |
* Bowser - a browser detector | |
* https://github.com/ded/bowser | |
* MIT License | (c) Dustin Diaz 2015 | |
*/ | |
!function (root, name, definition) { | |
if (typeof module != 'undefined' && module.exports) module.exports = definition() | |
else if (true) __webpack_require__(543)(name, definition) | |
else root[name] = definition() | |
}(this, 'bowser', function () { | |
/** | |
* See useragents.js for examples of navigator.userAgent | |
*/ | |
var t = true | |
function detect(ua) { | |
function getFirstMatch(regex) { | |
var match = ua.match(regex); | |
return (match && match.length > 1 && match[1]) || ''; | |
} | |
function getSecondMatch(regex) { | |
var match = ua.match(regex); | |
return (match && match.length > 1 && match[2]) || ''; | |
} | |
var iosdevice = getFirstMatch(/(ipod|iphone|ipad)/i).toLowerCase() | |
, likeAndroid = /like android/i.test(ua) | |
, android = !likeAndroid && /android/i.test(ua) | |
, nexusMobile = /nexus\s*[0-6]\s*/i.test(ua) | |
, nexusTablet = !nexusMobile && /nexus\s*[0-9]+/i.test(ua) | |
, chromeos = /CrOS/.test(ua) | |
, silk = /silk/i.test(ua) | |
, sailfish = /sailfish/i.test(ua) | |
, tizen = /tizen/i.test(ua) | |
, webos = /(web|hpw)os/i.test(ua) | |
, windowsphone = /windows phone/i.test(ua) | |
, samsungBrowser = /SamsungBrowser/i.test(ua) | |
, windows = !windowsphone && /windows/i.test(ua) | |
, mac = !iosdevice && !silk && /macintosh/i.test(ua) | |
, linux = !android && !sailfish && !tizen && !webos && /linux/i.test(ua) | |
, edgeVersion = getFirstMatch(/edge\/(\d+(\.\d+)?)/i) | |
, versionIdentifier = getFirstMatch(/version\/(\d+(\.\d+)?)/i) | |
, tablet = /tablet/i.test(ua) | |
, mobile = !tablet && /[^-]mobi/i.test(ua) | |
, xbox = /xbox/i.test(ua) | |
, result | |
if (/opera/i.test(ua)) { | |
// an old Opera | |
result = { | |
name: 'Opera' | |
, opera: t | |
, version: versionIdentifier || getFirstMatch(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i) | |
} | |
} else if (/opr|opios/i.test(ua)) { | |
// a new Opera | |
result = { | |
name: 'Opera' | |
, opera: t | |
, version: getFirstMatch(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i) || versionIdentifier | |
} | |
} | |
else if (/SamsungBrowser/i.test(ua)) { | |
result = { | |
name: 'Samsung Internet for Android' | |
, samsungBrowser: t | |
, version: versionIdentifier || getFirstMatch(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i) | |
} | |
} | |
else if (/coast/i.test(ua)) { | |
result = { | |
name: 'Opera Coast' | |
, coast: t | |
, version: versionIdentifier || getFirstMatch(/(?:coast)[\s\/](\d+(\.\d+)?)/i) | |
} | |
} | |
else if (/yabrowser/i.test(ua)) { | |
result = { | |
name: 'Yandex Browser' | |
, yandexbrowser: t | |
, version: versionIdentifier || getFirstMatch(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i) | |
} | |
} | |
else if (/ucbrowser/i.test(ua)) { | |
result = { | |
name: 'UC Browser' | |
, ucbrowser: t | |
, version: getFirstMatch(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i) | |
} | |
} | |
else if (/mxios/i.test(ua)) { | |
result = { | |
name: 'Maxthon' | |
, maxthon: t | |
, version: getFirstMatch(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i) | |
} | |
} | |
else if (/epiphany/i.test(ua)) { | |
result = { | |
name: 'Epiphany' | |
, epiphany: t | |
, version: getFirstMatch(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i) | |
} | |
} | |
else if (/puffin/i.test(ua)) { | |
result = { | |
name: 'Puffin' | |
, puffin: t | |
, version: getFirstMatch(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i) | |
} | |
} | |
else if (/sleipnir/i.test(ua)) { | |
result = { | |
name: 'Sleipnir' | |
, sleipnir: t | |
, version: getFirstMatch(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i) | |
} | |
} | |
else if (/k-meleon/i.test(ua)) { | |
result = { | |
name: 'K-Meleon' | |
, kMeleon: t | |
, version: getFirstMatch(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i) | |
} | |
} | |
else if (windowsphone) { | |
result = { | |
name: 'Windows Phone' | |
, windowsphone: t | |
} | |
if (edgeVersion) { | |
result.msedge = t | |
result.version = edgeVersion | |
} | |
else { | |
result.msie = t | |
result.version = getFirstMatch(/iemobile\/(\d+(\.\d+)?)/i) | |
} | |
} | |
else if (/msie|trident/i.test(ua)) { | |
result = { | |
name: 'Internet Explorer' | |
, msie: t | |
, version: getFirstMatch(/(?:msie |rv:)(\d+(\.\d+)?)/i) | |
} | |
} else if (chromeos) { | |
result = { | |
name: 'Chrome' | |
, chromeos: t | |
, chromeBook: t | |
, chrome: t | |
, version: getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i) | |
} | |
} else if (/chrome.+? edge/i.test(ua)) { | |
result = { | |
name: 'Microsoft Edge' | |
, msedge: t | |
, version: edgeVersion | |
} | |
} | |
else if (/vivaldi/i.test(ua)) { | |
result = { | |
name: 'Vivaldi' | |
, vivaldi: t | |
, version: getFirstMatch(/vivaldi\/(\d+(\.\d+)?)/i) || versionIdentifier | |
} | |
} | |
else if (sailfish) { | |
result = { | |
name: 'Sailfish' | |
, sailfish: t | |
, version: getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i) | |
} | |
} | |
else if (/seamonkey\//i.test(ua)) { | |
result = { | |
name: 'SeaMonkey' | |
, seamonkey: t | |
, version: getFirstMatch(/seamonkey\/(\d+(\.\d+)?)/i) | |
} | |
} | |
else if (/firefox|iceweasel|fxios/i.test(ua)) { | |
result = { | |
name: 'Firefox' | |
, firefox: t | |
, version: getFirstMatch(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i) | |
} | |
if (/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(ua)) { | |
result.firefoxos = t | |
} | |
} | |
else if (silk) { | |
result = { | |
name: 'Amazon Silk' | |
, silk: t | |
, version : getFirstMatch(/silk\/(\d+(\.\d+)?)/i) | |
} | |
} | |
else if (/phantom/i.test(ua)) { | |
result = { | |
name: 'PhantomJS' | |
, phantom: t | |
, version: getFirstMatch(/phantomjs\/(\d+(\.\d+)?)/i) | |
} | |
} | |
else if (/slimerjs/i.test(ua)) { | |
result = { | |
name: 'SlimerJS' | |
, slimer: t | |
, version: getFirstMatch(/slimerjs\/(\d+(\.\d+)?)/i) | |
} | |
} | |
else if (/blackberry|\bbb\d+/i.test(ua) || /rim\stablet/i.test(ua)) { | |
result = { | |
name: 'BlackBerry' | |
, blackberry: t | |
, version: versionIdentifier || getFirstMatch(/blackberry[\d]+\/(\d+(\.\d+)?)/i) | |
} | |
} | |
else if (webos) { | |
result = { | |
name: 'WebOS' | |
, webos: t | |
, version: versionIdentifier || getFirstMatch(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i) | |
}; | |
/touchpad\//i.test(ua) && (result.touchpad = t) | |
} | |
else if (/bada/i.test(ua)) { | |
result = { | |
name: 'Bada' | |
, bada: t | |
, version: getFirstMatch(/dolfin\/(\d+(\.\d+)?)/i) | |
}; | |
} | |
else if (tizen) { | |
result = { | |
name: 'Tizen' | |
, tizen: t | |
, version: getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i) || versionIdentifier | |
}; | |
} | |
else if (/qupzilla/i.test(ua)) { | |
result = { | |
name: 'QupZilla' | |
, qupzilla: t | |
, version: getFirstMatch(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i) || versionIdentifier | |
} | |
} | |
else if (/chromium/i.test(ua)) { | |
result = { | |
name: 'Chromium' | |
, chromium: t | |
, version: getFirstMatch(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i) || versionIdentifier | |
} | |
} | |
else if (/chrome|crios|crmo/i.test(ua)) { | |
result = { | |
name: 'Chrome' | |
, chrome: t | |
, version: getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i) | |
} | |
} | |
else if (android) { | |
result = { | |
name: 'Android' | |
, version: versionIdentifier | |
} | |
} | |
else if (/safari|applewebkit/i.test(ua)) { | |
result = { | |
name: 'Safari' | |
, safari: t | |
} | |
if (versionIdentifier) { | |
result.version = versionIdentifier | |
} | |
} | |
else if (iosdevice) { | |
result = { | |
name : iosdevice == 'iphone' ? 'iPhone' : iosdevice == 'ipad' ? 'iPad' : 'iPod' | |
} | |
// WTF: version is not part of user agent in web apps | |
if (versionIdentifier) { | |
result.version = versionIdentifier | |
} | |
} | |
else if(/googlebot/i.test(ua)) { | |
result = { | |
name: 'Googlebot' | |
, googlebot: t | |
, version: getFirstMatch(/googlebot\/(\d+(\.\d+))/i) || versionIdentifier | |
} | |
} | |
else { | |
result = { | |
name: getFirstMatch(/^(.*)\/(.*) /), | |
version: getSecondMatch(/^(.*)\/(.*) /) | |
}; | |
} | |
// set webkit or gecko flag for browsers based on these engines | |
if (!result.msedge && /(apple)?webkit/i.test(ua)) { | |
if (/(apple)?webkit\/537\.36/i.test(ua)) { | |
result.name = result.name || "Blink" | |
result.blink = t | |
} else { | |
result.name = result.name || "Webkit" | |
result.webkit = t | |
} | |
if (!result.version && versionIdentifier) { | |
result.version = versionIdentifier | |
} | |
} else if (!result.opera && /gecko\//i.test(ua)) { | |
result.name = result.name || "Gecko" | |
result.gecko = t | |
result.version = result.version || getFirstMatch(/gecko\/(\d+(\.\d+)?)/i) | |
} | |
// set OS flags for platforms that have multiple browsers | |
if (!result.windowsphone && !result.msedge && (android || result.silk)) { | |
result.android = t | |
} else if (!result.windowsphone && !result.msedge && iosdevice) { | |
result[iosdevice] = t | |
result.ios = t | |
} else if (mac) { | |
result.mac = t | |
} else if (xbox) { | |
result.xbox = t | |
} else if (windows) { | |
result.windows = t | |
} else if (linux) { | |
result.linux = t | |
} | |
// OS version extraction | |
var osVersion = ''; | |
if (result.windowsphone) { | |
osVersion = getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i); | |
} else if (iosdevice) { | |
osVersion = getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i); | |
osVersion = osVersion.replace(/[_\s]/g, '.'); | |
} else if (android) { | |
osVersion = getFirstMatch(/android[ \/-](\d+(\.\d+)*)/i); | |
} else if (result.webos) { | |
osVersion = getFirstMatch(/(?:web|hpw)os\/(\d+(\.\d+)*)/i); | |
} else if (result.blackberry) { | |
osVersion = getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i); | |
} else if (result.bada) { | |
osVersion = getFirstMatch(/bada\/(\d+(\.\d+)*)/i); | |
} else if (result.tizen) { | |
osVersion = getFirstMatch(/tizen[\/\s](\d+(\.\d+)*)/i); | |
} | |
if (osVersion) { | |
result.osversion = osVersion; | |
} | |
// device type extraction | |
var osMajorVersion = osVersion.split('.')[0]; | |
if ( | |
tablet | |
|| nexusTablet | |
|| iosdevice == 'ipad' | |
|| (android && (osMajorVersion == 3 || (osMajorVersion >= 4 && !mobile))) | |
|| result.silk | |
) { | |
result.tablet = t | |
} else if ( | |
mobile | |
|| iosdevice == 'iphone' | |
|| iosdevice == 'ipod' | |
|| android | |
|| nexusMobile | |
|| result.blackberry | |
|| result.webos | |
|| result.bada | |
) { | |
result.mobile = t | |
} | |
// Graded Browser Support | |
// http://developer.yahoo.com/yui/articles/gbs | |
if (result.msedge || | |
(result.msie && result.version >= 10) || | |
(result.yandexbrowser && result.version >= 15) || | |
(result.vivaldi && result.version >= 1.0) || | |
(result.chrome && result.version >= 20) || | |
(result.samsungBrowser && result.version >= 4) || | |
(result.firefox && result.version >= 20.0) || | |
(result.safari && result.version >= 6) || | |
(result.opera && result.version >= 10.0) || | |
(result.ios && result.osversion && result.osversion.split(".")[0] >= 6) || | |
(result.blackberry && result.version >= 10.1) | |
|| (result.chromium && result.version >= 20) | |
) { | |
result.a = t; | |
} | |
else if ((result.msie && result.version < 10) || | |
(result.chrome && result.version < 20) || | |
(result.firefox && result.version < 20.0) || | |
(result.safari && result.version < 6) || | |
(result.opera && result.version < 10.0) || | |
(result.ios && result.osversion && result.osversion.split(".")[0] < 6) | |
|| (result.chromium && result.version < 20) | |
) { | |
result.c = t | |
} else result.x = t | |
return result | |
} | |
var bowser = detect(typeof navigator !== 'undefined' ? navigator.userAgent || '' : '') | |
bowser.test = function (browserList) { | |
for (var i = 0; i < browserList.length; ++i) { | |
var browserItem = browserList[i]; | |
if (typeof browserItem=== 'string') { | |
if (browserItem in bowser) { | |
return true; | |
} | |
} | |
} | |
return false; | |
} | |
/** | |
* Get version precisions count | |
* | |
* @example | |
* getVersionPrecision("1.10.3") // 3 | |
* | |
* @param {string} version | |
* @return {number} | |
*/ | |
function getVersionPrecision(version) { | |
return version.split(".").length; | |
} | |
/** | |
* Array::map polyfill | |
* | |
* @param {Array} arr | |
* @param {Function} iterator | |
* @return {Array} | |
*/ | |
function map(arr, iterator) { | |
var result = [], i; | |
if (Array.prototype.map) { | |
return Array.prototype.map.call(arr, iterator); | |
} | |
for (i = 0; i < arr.length; i++) { | |
result.push(iterator(arr[i])); | |
} | |
return result; | |
} | |
/** | |
* Calculate browser version weight | |
* | |
* @example | |
* compareVersions(['1.10.2.1', '1.8.2.1.90']) // 1 | |
* compareVersions(['1.010.2.1', '1.09.2.1.90']); // 1 | |
* compareVersions(['1.10.2.1', '1.10.2.1']); // 0 | |
* compareVersions(['1.10.2.1', '1.0800.2']); // -1 | |
* | |
* @param {Array<String>} versions versions to compare | |
* @return {Number} comparison result | |
*/ | |
function compareVersions(versions) { | |
// 1) get common precision for both versions, for example for "10.0" and "9" it should be 2 | |
var precision = Math.max(getVersionPrecision(versions[0]), getVersionPrecision(versions[1])); | |
var chunks = map(versions, function (version) { | |
var delta = precision - getVersionPrecision(version); | |
// 2) "9" -> "9.0" (for precision = 2) | |
version = version + new Array(delta + 1).join(".0"); | |
// 3) "9.0" -> ["000000000"", "000000009"] | |
return map(version.split("."), function (chunk) { | |
return new Array(20 - chunk.length).join("0") + chunk; | |
}).reverse(); | |
}); | |
// iterate in reverse order by reversed chunks array | |
while (--precision >= 0) { | |
// 4) compare: "000000009" > "000000010" = false (but "9" > "10" = true) | |
if (chunks[0][precision] > chunks[1][precision]) { | |
return 1; | |
} | |
else if (chunks[0][precision] === chunks[1][precision]) { | |
if (precision === 0) { | |
// all version chunks are same | |
return 0; | |
} | |
} | |
else { | |
return -1; | |
} | |
} | |
} | |
/** | |
* Check if browser is unsupported | |
* | |
* @example | |
* bowser.isUnsupportedBrowser({ | |
* msie: "10", | |
* firefox: "23", | |
* chrome: "29", | |
* safari: "5.1", | |
* opera: "16", | |
* phantom: "534" | |
* }); | |
* | |
* @param {Object} minVersions map of minimal version to browser | |
* @param {Boolean} [strictMode = false] flag to return false if browser wasn't found in map | |
* @param {String} [ua] user agent string | |
* @return {Boolean} | |
*/ | |
function isUnsupportedBrowser(minVersions, strictMode, ua) { | |
var _bowser = bowser; | |
// make strictMode param optional with ua param usage | |
if (typeof strictMode === 'string') { | |
ua = strictMode; | |
strictMode = void(0); | |
} | |
if (strictMode === void(0)) { | |
strictMode = false; | |
} | |
if (ua) { | |
_bowser = detect(ua); | |
} | |
var version = "" + _bowser.version; | |
for (var browser in minVersions) { | |
if (minVersions.hasOwnProperty(browser)) { | |
if (_bowser[browser]) { | |
if (typeof minVersions[browser] !== 'string') { | |
throw new Error('Browser version in the minVersion map should be a string: ' + browser + ': ' + String(minVersions)); | |
} | |
// browser version and min supported version. | |
return compareVersions([version, minVersions[browser]]) < 0; | |
} | |
} | |
} | |
return strictMode; // not found | |
} | |
/** | |
* Check if browser is supported | |
* | |
* @param {Object} minVersions map of minimal version to browser | |
* @param {Boolean} [strictMode = false] flag to return false if browser wasn't found in map | |
* @param {String} [ua] user agent string | |
* @return {Boolean} | |
*/ | |
function check(minVersions, strictMode, ua) { | |
return !isUnsupportedBrowser(minVersions, strictMode, ua); | |
} | |
bowser.isUnsupportedBrowser = isUnsupportedBrowser; | |
bowser.compareVersions = compareVersions; | |
bowser.check = check; | |
/* | |
* Set our detect method to the main bowser object so we can | |
* reuse it to test other user agents. | |
* This is needed to implement future tests. | |
*/ | |
bowser._detect = detect; | |
return bowser | |
}); | |
/***/ }), | |
/* 264 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
__webpack_require__(78); | |
__webpack_require__(297); | |
module.exports = __webpack_require__(22).Array.from; | |
/***/ }), | |
/* 265 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
__webpack_require__(111); | |
__webpack_require__(78); | |
module.exports = __webpack_require__(295); | |
/***/ }), | |
/* 266 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
__webpack_require__(111); | |
__webpack_require__(78); | |
module.exports = __webpack_require__(296); | |
/***/ }), | |
/* 267 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
__webpack_require__(299); | |
module.exports = __webpack_require__(22).Object.assign; | |
/***/ }), | |
/* 268 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
__webpack_require__(300); | |
var $Object = __webpack_require__(22).Object; | |
module.exports = function create(P, D){ | |
return $Object.create(P, D); | |
}; | |
/***/ }), | |
/* 269 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
__webpack_require__(301); | |
var $Object = __webpack_require__(22).Object; | |
module.exports = function defineProperty(it, key, desc){ | |
return $Object.defineProperty(it, key, desc); | |
}; | |
/***/ }), | |
/* 270 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
__webpack_require__(302); | |
module.exports = __webpack_require__(22).Object.getPrototypeOf; | |
/***/ }), | |
/* 271 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
__webpack_require__(303); | |
module.exports = __webpack_require__(22).Object.keys; | |
/***/ }), | |
/* 272 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
__webpack_require__(304); | |
module.exports = __webpack_require__(22).Object.setPrototypeOf; | |
/***/ }), | |
/* 273 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
__webpack_require__(306); | |
__webpack_require__(305); | |
__webpack_require__(307); | |
__webpack_require__(308); | |
module.exports = __webpack_require__(22).Symbol; | |
/***/ }), | |
/* 274 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
__webpack_require__(78); | |
__webpack_require__(111); | |
module.exports = __webpack_require__(110).f('iterator'); | |
/***/ }), | |
/* 275 */ | |
/***/ (function(module, exports) { | |
module.exports = function(it){ | |
if(typeof it != 'function')throw TypeError(it + ' is not a function!'); | |
return it; | |
}; | |
/***/ }), | |
/* 276 */ | |
/***/ (function(module, exports) { | |
module.exports = function(){ /* empty */ }; | |
/***/ }), | |
/* 277 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
// false -> Array#indexOf | |
// true -> Array#includes | |
var toIObject = __webpack_require__(46) | |
, toLength = __webpack_require__(181) | |
, toIndex = __webpack_require__(294); | |
module.exports = function(IS_INCLUDES){ | |
return function($this, el, fromIndex){ | |
var O = toIObject($this) | |
, length = toLength(O.length) | |
, index = toIndex(fromIndex, length) | |
, value; | |
// Array#includes uses SameValueZero equality algorithm | |
if(IS_INCLUDES && el != el)while(length > index){ | |
value = O[index++]; | |
if(value != value)return true; | |
// Array#toIndex ignores holes, Array#includes - not | |
} else for(;length > index; index++)if(IS_INCLUDES || index in O){ | |
if(O[index] === el)return IS_INCLUDES || index || 0; | |
} return !IS_INCLUDES && -1; | |
}; | |
}; | |
/***/ }), | |
/* 278 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
var $defineProperty = __webpack_require__(37) | |
, createDesc = __webpack_require__(63); | |
module.exports = function(object, index, value){ | |
if(index in object)$defineProperty.f(object, index, createDesc(0, value)); | |
else object[index] = value; | |
}; | |
/***/ }), | |
/* 279 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
// all enumerable object keys, includes symbols | |
var getKeys = __webpack_require__(55) | |
, gOPS = __webpack_require__(103) | |
, pIE = __webpack_require__(76); | |
module.exports = function(it){ | |
var result = getKeys(it) | |
, getSymbols = gOPS.f; | |
if(getSymbols){ | |
var symbols = getSymbols(it) | |
, isEnum = pIE.f | |
, i = 0 | |
, key; | |
while(symbols.length > i)if(isEnum.call(it, key = symbols[i++]))result.push(key); | |
} return result; | |
}; | |
/***/ }), | |
/* 280 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
module.exports = __webpack_require__(36).document && document.documentElement; | |
/***/ }), | |
/* 281 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
// check on default Array iterator | |
var Iterators = __webpack_require__(54) | |
, ITERATOR = __webpack_require__(27)('iterator') | |
, ArrayProto = Array.prototype; | |
module.exports = function(it){ | |
return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); | |
}; | |
/***/ }), | |
/* 282 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
// 7.2.2 IsArray(argument) | |
var cof = __webpack_require__(97); | |
module.exports = Array.isArray || function isArray(arg){ | |
return cof(arg) == 'Array'; | |
}; | |
/***/ }), | |
/* 283 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
// call something on iterator step with safe closing on error | |
var anObject = __webpack_require__(43); | |
module.exports = function(iterator, fn, value, entries){ | |
try { | |
return entries ? fn(anObject(value)[0], value[1]) : fn(value); | |
// 7.4.6 IteratorClose(iterator, completion) | |
} catch(e){ | |
var ret = iterator['return']; | |
if(ret !== undefined)anObject(ret.call(iterator)); | |
throw e; | |
} | |
}; | |
/***/ }), | |
/* 284 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
var create = __webpack_require__(102) | |
, descriptor = __webpack_require__(63) | |
, setToStringTag = __webpack_require__(104) | |
, IteratorPrototype = {}; | |
// 25.1.2.1.1 %IteratorPrototype%[@@iterator]() | |
__webpack_require__(53)(IteratorPrototype, __webpack_require__(27)('iterator'), function(){ return this; }); | |
module.exports = function(Constructor, NAME, next){ | |
Constructor.prototype = create(IteratorPrototype, {next: descriptor(1, next)}); | |
setToStringTag(Constructor, NAME + ' Iterator'); | |
}; | |
/***/ }), | |
/* 285 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
var ITERATOR = __webpack_require__(27)('iterator') | |
, SAFE_CLOSING = false; | |
try { | |
var riter = [7][ITERATOR](); | |
riter['return'] = function(){ SAFE_CLOSING = true; }; | |
Array.from(riter, function(){ throw 2; }); | |
} catch(e){ /* empty */ } | |
module.exports = function(exec, skipClosing){ | |
if(!skipClosing && !SAFE_CLOSING)return false; | |
var safe = false; | |
try { | |
var arr = [7] | |
, iter = arr[ITERATOR](); | |
iter.next = function(){ return {done: safe = true}; }; | |
arr[ITERATOR] = function(){ return iter; }; | |
exec(arr); | |
} catch(e){ /* empty */ } | |
return safe; | |
}; | |
/***/ }), | |
/* 286 */ | |
/***/ (function(module, exports) { | |
module.exports = function(done, value){ | |
return {value: value, done: !!done}; | |
}; | |
/***/ }), | |
/* 287 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
var getKeys = __webpack_require__(55) | |
, toIObject = __webpack_require__(46); | |
module.exports = function(object, el){ | |
var O = toIObject(object) | |
, keys = getKeys(O) | |
, length = keys.length | |
, index = 0 | |
, key; | |
while(length > index)if(O[key = keys[index++]] === el)return key; | |
}; | |
/***/ }), | |
/* 288 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
var META = __webpack_require__(77)('meta') | |
, isObject = __webpack_require__(62) | |
, has = __webpack_require__(45) | |
, setDesc = __webpack_require__(37).f | |
, id = 0; | |
var isExtensible = Object.isExtensible || function(){ | |
return true; | |
}; | |
var FREEZE = !__webpack_require__(52)(function(){ | |
return isExtensible(Object.preventExtensions({})); | |
}); | |
var setMeta = function(it){ | |
setDesc(it, META, {value: { | |
i: 'O' + ++id, // object ID | |
w: {} // weak collections IDs | |
}}); | |
}; | |
var fastKey = function(it, create){ | |
// return primitive with prefix | |
if(!isObject(it))return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; | |
if(!has(it, META)){ | |
// can't set metadata to uncaught frozen object | |
if(!isExtensible(it))return 'F'; | |
// not necessary to add metadata | |
if(!create)return 'E'; | |
// add missing metadata | |
setMeta(it); | |
// return object ID | |
} return it[META].i; | |
}; | |
var getWeak = function(it, create){ | |
if(!has(it, META)){ | |
// can't set metadata to uncaught frozen object | |
if(!isExtensible(it))return true; | |
// not necessary to add metadata | |
if(!create)return false; | |
// add missing metadata | |
setMeta(it); | |
// return hash weak collections IDs | |
} return it[META].w; | |
}; | |
// add metadata on freeze-family methods calling | |
var onFreeze = function(it){ | |
if(FREEZE && meta.NEED && isExtensible(it) && !has(it, META))setMeta(it); | |
return it; | |
}; | |
var meta = module.exports = { | |
KEY: META, | |
NEED: false, | |
fastKey: fastKey, | |
getWeak: getWeak, | |
onFreeze: onFreeze | |
}; | |
/***/ }), | |
/* 289 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
// 19.1.2.1 Object.assign(target, source, ...) | |
var getKeys = __webpack_require__(55) | |
, gOPS = __webpack_require__(103) | |
, pIE = __webpack_require__(76) | |
, toObject = __webpack_require__(64) | |
, IObject = __webpack_require__(173) | |
, $assign = Object.assign; | |
// should work with symbols and should have deterministic property order (V8 bug) | |
module.exports = !$assign || __webpack_require__(52)(function(){ | |
var A = {} | |
, B = {} | |
, S = Symbol() | |
, K = 'abcdefghijklmnopqrst'; | |
A[S] = 7; | |
K.split('').forEach(function(k){ B[k] = k; }); | |
return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K; | |
}) ? function assign(target, source){ // eslint-disable-line no-unused-vars | |
var T = toObject(target) | |
, aLen = arguments.length | |
, index = 1 | |
, getSymbols = gOPS.f | |
, isEnum = pIE.f; | |
while(aLen > index){ | |
var S = IObject(arguments[index++]) | |
, keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S) | |
, length = keys.length | |
, j = 0 | |
, key; | |
while(length > j)if(isEnum.call(S, key = keys[j++]))T[key] = S[key]; | |
} return T; | |
} : $assign; | |
/***/ }), | |
/* 290 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
var dP = __webpack_require__(37) | |
, anObject = __webpack_require__(43) | |
, getKeys = __webpack_require__(55); | |
module.exports = __webpack_require__(44) ? Object.defineProperties : function defineProperties(O, Properties){ | |
anObject(O); | |
var keys = getKeys(Properties) | |
, length = keys.length | |
, i = 0 | |
, P; | |
while(length > i)dP.f(O, P = keys[i++], Properties[P]); | |
return O; | |
}; | |
/***/ }), | |
/* 291 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window | |
var toIObject = __webpack_require__(46) | |
, gOPN = __webpack_require__(176).f | |
, toString = {}.toString; | |
var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames | |
? Object.getOwnPropertyNames(window) : []; | |
var getWindowNames = function(it){ | |
try { | |
return gOPN(it); | |
} catch(e){ | |
return windowNames.slice(); | |
} | |
}; | |
module.exports.f = function getOwnPropertyNames(it){ | |
return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it)); | |
}; | |
/***/ }), | |
/* 292 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
// Works with __proto__ only. Old v8 can't work with null proto objects. | |
/* eslint-disable no-proto */ | |
var isObject = __webpack_require__(62) | |
, anObject = __webpack_require__(43); | |
var check = function(O, proto){ | |
anObject(O); | |
if(!isObject(proto) && proto !== null)throw TypeError(proto + ": can't set as prototype!"); | |
}; | |
module.exports = { | |
set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line | |
function(test, buggy, set){ | |
try { | |
set = __webpack_require__(98)(Function.call, __webpack_require__(175).f(Object.prototype, '__proto__').set, 2); | |
set(test, []); | |
buggy = !(test instanceof Array); | |
} catch(e){ buggy = true; } | |
return function setPrototypeOf(O, proto){ | |
check(O, proto); | |
if(buggy)O.__proto__ = proto; | |
else set(O, proto); | |
return O; | |
}; | |
}({}, false) : undefined), | |
check: check | |
}; | |
/***/ }), | |
/* 293 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
var toInteger = __webpack_require__(107) | |
, defined = __webpack_require__(99); | |
// true -> String#at | |
// false -> String#codePointAt | |
module.exports = function(TO_STRING){ | |
return function(that, pos){ | |
var s = String(defined(that)) | |
, i = toInteger(pos) | |
, l = s.length | |
, a, b; | |
if(i < 0 || i >= l)return TO_STRING ? '' : undefined; | |
a = s.charCodeAt(i); | |
return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff | |
? TO_STRING ? s.charAt(i) : a | |
: TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; | |
}; | |
}; | |
/***/ }), | |
/* 294 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
var toInteger = __webpack_require__(107) | |
, max = Math.max | |
, min = Math.min; | |
module.exports = function(index, length){ | |
index = toInteger(index); | |
return index < 0 ? max(index + length, 0) : min(index, length); | |
}; | |
/***/ }), | |
/* 295 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
var anObject = __webpack_require__(43) | |
, get = __webpack_require__(182); | |
module.exports = __webpack_require__(22).getIterator = function(it){ | |
var iterFn = get(it); | |
if(typeof iterFn != 'function')throw TypeError(it + ' is not iterable!'); | |
return anObject(iterFn.call(it)); | |
}; | |
/***/ }), | |
/* 296 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
var classof = __webpack_require__(170) | |
, ITERATOR = __webpack_require__(27)('iterator') | |
, Iterators = __webpack_require__(54); | |
module.exports = __webpack_require__(22).isIterable = function(it){ | |
var O = Object(it); | |
return O[ITERATOR] !== undefined | |
|| '@@iterator' in O | |
|| Iterators.hasOwnProperty(classof(O)); | |
}; | |
/***/ }), | |
/* 297 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
var ctx = __webpack_require__(98) | |
, $export = __webpack_require__(35) | |
, toObject = __webpack_require__(64) | |
, call = __webpack_require__(283) | |
, isArrayIter = __webpack_require__(281) | |
, toLength = __webpack_require__(181) | |
, createProperty = __webpack_require__(278) | |
, getIterFn = __webpack_require__(182); | |
$export($export.S + $export.F * !__webpack_require__(285)(function(iter){ Array.from(iter); }), 'Array', { | |
// 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined) | |
from: function from(arrayLike/*, mapfn = undefined, thisArg = undefined*/){ | |
var O = toObject(arrayLike) | |
, C = typeof this == 'function' ? this : Array | |
, aLen = arguments.length | |
, mapfn = aLen > 1 ? arguments[1] : undefined | |
, mapping = mapfn !== undefined | |
, index = 0 | |
, iterFn = getIterFn(O) | |
, length, result, step, iterator; | |
if(mapping)mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2); | |
// if object isn't iterable or it's array with default iterator - use simple case | |
if(iterFn != undefined && !(C == Array && isArrayIter(iterFn))){ | |
for(iterator = iterFn.call(O), result = new C; !(step = iterator.next()).done; index++){ | |
createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value); | |
} | |
} else { | |
length = toLength(O.length); | |
for(result = new C(length); length > index; index++){ | |
createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]); | |
} | |
} | |
result.length = index; | |
return result; | |
} | |
}); | |
/***/ }), | |
/* 298 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
var addToUnscopables = __webpack_require__(276) | |
, step = __webpack_require__(286) | |
, Iterators = __webpack_require__(54) | |
, toIObject = __webpack_require__(46); | |
// 22.1.3.4 Array.prototype.entries() | |
// 22.1.3.13 Array.prototype.keys() | |
// 22.1.3.29 Array.prototype.values() | |
// 22.1.3.30 Array.prototype[@@iterator]() | |
module.exports = __webpack_require__(174)(Array, 'Array', function(iterated, kind){ | |
this._t = toIObject(iterated); // target | |
this._i = 0; // next index | |
this._k = kind; // kind | |
// 22.1.5.2.1 %ArrayIteratorPrototype%.next() | |
}, function(){ | |
var O = this._t | |
, kind = this._k | |
, index = this._i++; | |
if(!O || index >= O.length){ | |
this._t = undefined; | |
return step(1); | |
} | |
if(kind == 'keys' )return step(0, index); | |
if(kind == 'values')return step(0, O[index]); | |
return step(0, [index, O[index]]); | |
}, 'values'); | |
// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) | |
Iterators.Arguments = Iterators.Array; | |
addToUnscopables('keys'); | |
addToUnscopables('values'); | |
addToUnscopables('entries'); | |
/***/ }), | |
/* 299 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
// 19.1.3.1 Object.assign(target, source) | |
var $export = __webpack_require__(35); | |
$export($export.S + $export.F, 'Object', {assign: __webpack_require__(289)}); | |
/***/ }), | |
/* 300 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
var $export = __webpack_require__(35) | |
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) | |
$export($export.S, 'Object', {create: __webpack_require__(102)}); | |
/***/ }), | |
/* 301 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
var $export = __webpack_require__(35); | |
// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) | |
$export($export.S + $export.F * !__webpack_require__(44), 'Object', {defineProperty: __webpack_require__(37).f}); | |
/***/ }), | |
/* 302 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
// 19.1.2.9 Object.getPrototypeOf(O) | |
var toObject = __webpack_require__(64) | |
, $getPrototypeOf = __webpack_require__(177); | |
__webpack_require__(179)('getPrototypeOf', function(){ | |
return function getPrototypeOf(it){ | |
return $getPrototypeOf(toObject(it)); | |
}; | |
}); | |
/***/ }), | |
/* 303 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
// 19.1.2.14 Object.keys(O) | |
var toObject = __webpack_require__(64) | |
, $keys = __webpack_require__(55); | |
__webpack_require__(179)('keys', function(){ | |
return function keys(it){ | |
return $keys(toObject(it)); | |
}; | |
}); | |
/***/ }), | |
/* 304 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
// 19.1.3.19 Object.setPrototypeOf(O, proto) | |
var $export = __webpack_require__(35); | |
$export($export.S, 'Object', {setPrototypeOf: __webpack_require__(292).set}); | |
/***/ }), | |
/* 305 */ | |
/***/ (function(module, exports) { | |
/***/ }), | |
/* 306 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
// ECMAScript 6 symbols shim | |
var global = __webpack_require__(36) | |
, has = __webpack_require__(45) | |
, DESCRIPTORS = __webpack_require__(44) | |
, $export = __webpack_require__(35) | |
, redefine = __webpack_require__(180) | |
, META = __webpack_require__(288).KEY | |
, $fails = __webpack_require__(52) | |
, shared = __webpack_require__(106) | |
, setToStringTag = __webpack_require__(104) | |
, uid = __webpack_require__(77) | |
, wks = __webpack_require__(27) | |
, wksExt = __webpack_require__(110) | |
, wksDefine = __webpack_require__(109) | |
, keyOf = __webpack_require__(287) | |
, enumKeys = __webpack_require__(279) | |
, isArray = __webpack_require__(282) | |
, anObject = __webpack_require__(43) | |
, toIObject = __webpack_require__(46) | |
, toPrimitive = __webpack_require__(108) | |
, createDesc = __webpack_require__(63) | |
, _create = __webpack_require__(102) | |
, gOPNExt = __webpack_require__(291) | |
, $GOPD = __webpack_require__(175) | |
, $DP = __webpack_require__(37) | |
, $keys = __webpack_require__(55) | |
, gOPD = $GOPD.f | |
, dP = $DP.f | |
, gOPN = gOPNExt.f | |
, $Symbol = global.Symbol | |
, $JSON = global.JSON | |
, _stringify = $JSON && $JSON.stringify | |
, PROTOTYPE = 'prototype' | |
, HIDDEN = wks('_hidden') | |
, TO_PRIMITIVE = wks('toPrimitive') | |
, isEnum = {}.propertyIsEnumerable | |
, SymbolRegistry = shared('symbol-registry') | |
, AllSymbols = shared('symbols') | |
, OPSymbols = shared('op-symbols') | |
, ObjectProto = Object[PROTOTYPE] | |
, USE_NATIVE = typeof $Symbol == 'function' | |
, QObject = global.QObject; | |
// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 | |
var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; | |
// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 | |
var setSymbolDesc = DESCRIPTORS && $fails(function(){ | |
return _create(dP({}, 'a', { | |
get: function(){ return dP(this, 'a', {value: 7}).a; } | |
})).a != 7; | |
}) ? function(it, key, D){ | |
var protoDesc = gOPD(ObjectProto, key); | |
if(protoDesc)delete ObjectProto[key]; | |
dP(it, key, D); | |
if(protoDesc && it !== ObjectProto)dP(ObjectProto, key, protoDesc); | |
} : dP; | |
var wrap = function(tag){ | |
var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]); | |
sym._k = tag; | |
return sym; | |
}; | |
var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function(it){ | |
return typeof it == 'symbol'; | |
} : function(it){ | |
return it instanceof $Symbol; | |
}; | |
var $defineProperty = function defineProperty(it, key, D){ | |
if(it === ObjectProto)$defineProperty(OPSymbols, key, D); | |
anObject(it); | |
key = toPrimitive(key, true); | |
anObject(D); | |
if(has(AllSymbols, key)){ | |
if(!D.enumerable){ | |
if(!has(it, HIDDEN))dP(it, HIDDEN, createDesc(1, {})); | |
it[HIDDEN][key] = true; | |
} else { | |
if(has(it, HIDDEN) && it[HIDDEN][key])it[HIDDEN][key] = false; | |
D = _create(D, {enumerable: createDesc(0, false)}); | |
} return setSymbolDesc(it, key, D); | |
} return dP(it, key, D); | |
}; | |
var $defineProperties = function defineProperties(it, P){ | |
anObject(it); | |
var keys = enumKeys(P = toIObject(P)) | |
, i = 0 | |
, l = keys.length | |
, key; | |
while(l > i)$defineProperty(it, key = keys[i++], P[key]); | |
return it; | |
}; | |
var $create = function create(it, P){ | |
return P === undefined ? _create(it) : $defineProperties(_create(it), P); | |
}; | |
var $propertyIsEnumerable = function propertyIsEnumerable(key){ | |
var E = isEnum.call(this, key = toPrimitive(key, true)); | |
if(this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return false; | |
return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true; | |
}; | |
var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key){ | |
it = toIObject(it); | |
key = toPrimitive(key, true); | |
if(it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return; | |
var D = gOPD(it, key); | |
if(D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key]))D.enumerable = true; | |
return D; | |
}; | |
var $getOwnPropertyNames = function getOwnPropertyNames(it){ | |
var names = gOPN(toIObject(it)) | |
, result = [] | |
, i = 0 | |
, key; | |
while(names.length > i){ | |
if(!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META)result.push(key); | |
} return result; | |
}; | |
var $getOwnPropertySymbols = function getOwnPropertySymbols(it){ | |
var IS_OP = it === ObjectProto | |
, names = gOPN(IS_OP ? OPSymbols : toIObject(it)) | |
, result = [] | |
, i = 0 | |
, key; | |
while(names.length > i){ | |
if(has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true))result.push(AllSymbols[key]); | |
} return result; | |
}; | |
// 19.4.1.1 Symbol([description]) | |
if(!USE_NATIVE){ | |
$Symbol = function Symbol(){ | |
if(this instanceof $Symbol)throw TypeError('Symbol is not a constructor!'); | |
var tag = uid(arguments.length > 0 ? arguments[0] : undefined); | |
var $set = function(value){ | |
if(this === ObjectProto)$set.call(OPSymbols, value); | |
if(has(this, HIDDEN) && has(this[HIDDEN], tag))this[HIDDEN][tag] = false; | |
setSymbolDesc(this, tag, createDesc(1, value)); | |
}; | |
if(DESCRIPTORS && setter)setSymbolDesc(ObjectProto, tag, {configurable: true, set: $set}); | |
return wrap(tag); | |
}; | |
redefine($Symbol[PROTOTYPE], 'toString', function toString(){ | |
return this._k; | |
}); | |
$GOPD.f = $getOwnPropertyDescriptor; | |
$DP.f = $defineProperty; | |
__webpack_require__(176).f = gOPNExt.f = $getOwnPropertyNames; | |
__webpack_require__(76).f = $propertyIsEnumerable; | |
__webpack_require__(103).f = $getOwnPropertySymbols; | |
if(DESCRIPTORS && !__webpack_require__(101)){ | |
redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true); | |
} | |
wksExt.f = function(name){ | |
return wrap(wks(name)); | |
} | |
} | |
$export($export.G + $export.W + $export.F * !USE_NATIVE, {Symbol: $Symbol}); | |
for(var symbols = ( | |
// 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14 | |
'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables' | |
).split(','), i = 0; symbols.length > i; )wks(symbols[i++]); | |
for(var symbols = $keys(wks.store), i = 0; symbols.length > i; )wksDefine(symbols[i++]); | |
$export($export.S + $export.F * !USE_NATIVE, 'Symbol', { | |
// 19.4.2.1 Symbol.for(key) | |
'for': function(key){ | |
return has(SymbolRegistry, key += '') | |
? SymbolRegistry[key] | |
: SymbolRegistry[key] = $Symbol(key); | |
}, | |
// 19.4.2.5 Symbol.keyFor(sym) | |
keyFor: function keyFor(key){ | |
if(isSymbol(key))return keyOf(SymbolRegistry, key); | |
throw TypeError(key + ' is not a symbol!'); | |
}, | |
useSetter: function(){ setter = true; }, | |
useSimple: function(){ setter = false; } | |
}); | |
$export($export.S + $export.F * !USE_NATIVE, 'Object', { | |
// 19.1.2.2 Object.create(O [, Properties]) | |
create: $create, | |
// 19.1.2.4 Object.defineProperty(O, P, Attributes) | |
defineProperty: $defineProperty, | |
// 19.1.2.3 Object.defineProperties(O, Properties) | |
defineProperties: $defineProperties, | |
// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) | |
getOwnPropertyDescriptor: $getOwnPropertyDescriptor, | |
// 19.1.2.7 Object.getOwnPropertyNames(O) | |
getOwnPropertyNames: $getOwnPropertyNames, | |
// 19.1.2.8 Object.getOwnPropertySymbols(O) | |
getOwnPropertySymbols: $getOwnPropertySymbols | |
}); | |
// 24.3.2 JSON.stringify(value [, replacer [, space]]) | |
$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function(){ | |
var S = $Symbol(); | |
// MS Edge converts symbol values to JSON as {} | |
// WebKit converts symbol values to JSON as null | |
// V8 throws on boxed symbols | |
return _stringify([S]) != '[null]' || _stringify({a: S}) != '{}' || _stringify(Object(S)) != '{}'; | |
})), 'JSON', { | |
stringify: function stringify(it){ | |
if(it === undefined || isSymbol(it))return; // IE8 returns string on undefined | |
var args = [it] | |
, i = 1 | |
, replacer, $replacer; | |
while(arguments.length > i)args.push(arguments[i++]); | |
replacer = args[1]; | |
if(typeof replacer == 'function')$replacer = replacer; | |
if($replacer || !isArray(replacer))replacer = function(key, value){ | |
if($replacer)value = $replacer.call(this, key, value); | |
if(!isSymbol(value))return value; | |
}; | |
args[1] = replacer; | |
return _stringify.apply($JSON, args); | |
} | |
}); | |
// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint) | |
$Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(53)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf); | |
// 19.4.3.5 Symbol.prototype[@@toStringTag] | |
setToStringTag($Symbol, 'Symbol'); | |
// 20.2.1.9 Math[@@toStringTag] | |
setToStringTag(Math, 'Math', true); | |
// 24.3.3 JSON[@@toStringTag] | |
setToStringTag(global.JSON, 'JSON', true); | |
/***/ }), | |
/* 307 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
__webpack_require__(109)('asyncIterator'); | |
/***/ }), | |
/* 308 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
__webpack_require__(109)('observable'); | |
/***/ }), | |
/* 309 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"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. | |
* | |
* @typechecks | |
*/ | |
var _hyphenPattern = /-(.)/g; | |
/** | |
* Camelcases a hyphenated string, for example: | |
* | |
* > camelize('background-color') | |
* < "backgroundColor" | |
* | |
* @param {string} string | |
* @return {string} | |
*/ | |
function camelize(string) { | |
return string.replace(_hyphenPattern, function (_, character) { | |
return character.toUpperCase(); | |
}); | |
} | |
module.exports = camelize; | |
/***/ }), | |
/* 310 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"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. | |
* | |
* @typechecks | |
*/ | |
var camelize = __webpack_require__(309); | |
var msPattern = /^-ms-/; | |
/** | |
* Camelcases a hyphenated CSS property name, for example: | |
* | |
* > camelizeStyleName('background-color') | |
* < "backgroundColor" | |
* > camelizeStyleName('-moz-transition') | |
* < "MozTransition" | |
* > camelizeStyleName('-ms-transition') | |
* < "msTransition" | |
* | |
* As Andi Smith suggests | |
* (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix | |
* is converted to lowercase `ms`. | |
* | |
* @param {string} string | |
* @return {string} | |
*/ | |
function camelizeStyleName(string) { | |
return camelize(string.replace(msPattern, 'ms-')); | |
} | |
module.exports = camelizeStyleName; | |
/***/ }), | |
/* 311 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"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 isTextNode = __webpack_require__(319); | |
/*eslint-disable no-bitwise */ | |
/** | |
* 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; | |
} | |
} | |
module.exports = containsNode; | |
/***/ }), | |
/* 312 */ | |
/***/ (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. | |
* | |
* @typechecks | |
*/ | |
var invariant = __webpack_require__(11); | |
/** | |
* Convert array-like objects to arrays. | |
* | |
* This API assumes the caller knows the contents of the data type. For less | |
* well defined inputs use createArrayFromMixed. | |
* | |
* @param {object|function|filelist} obj | |
* @return {array} | |
*/ | |
function toArray(obj) { | |
var length = obj.length; | |
// Some browsers builtin objects can report typeof 'function' (e.g. NodeList | |
// in old versions of Safari). | |
!(!Array.isArray(obj) && (typeof obj === 'object' || typeof obj === 'function')) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Array-like object expected') : invariant(false) : void 0; | |
!(typeof length === 'number') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object needs a length property') : invariant(false) : void 0; | |
!(length === 0 || length - 1 in obj) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object should have keys for indices') : invariant(false) : void 0; | |
!(typeof obj.callee !== 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object can\'t be `arguments`. Use rest params ' + '(function(...args) {}) or Array.from() instead.') : invariant(false) : void 0; | |
// Old IE doesn't give collections access to hasOwnProperty. Assume inputs | |
// without method will throw during the slice call and skip straight to the | |
// fallback. | |
if (obj.hasOwnProperty) { | |
try { | |
return Array.prototype.slice.call(obj); | |
} catch (e) { | |
// IE < 9 does not support Array#slice on collections objects | |
} | |
} | |
// Fall back to copying key by key. This assumes all keys have a value, | |
// so will not preserve sparsely populated inputs. | |
var ret = Array(length); | |
for (var ii = 0; ii < length; ii++) { | |
ret[ii] = obj[ii]; | |
} | |
return ret; | |
} | |
/** | |
* Perform a heuristic test to determine if an object is "array-like". | |
* | |
* A monk asked Joshu, a Zen master, "Has a dog Buddha nature?" | |
* Joshu replied: "Mu." | |
* | |
* This function determines if its argument has "array nature": it returns | |
* true if the argument is an actual array, an `arguments' object, or an | |
* HTMLCollection (e.g. node.childNodes or node.getElementsByTagName()). | |
* | |
* It will return false for other array-like objects like Filelist. | |
* | |
* @param {*} obj | |
* @return {boolean} | |
*/ | |
function hasArrayNature(obj) { | |
return ( | |
// not null/false | |
!!obj && ( | |
// arrays are objects, NodeLists are functions in Safari | |
typeof obj == 'object' || typeof obj == 'function') && | |
// quacks like an array | |
'length' in obj && | |
// not window | |
!('setInterval' in obj) && | |
// no DOM node should be considered an array-like | |
// a 'select' element has 'length' and 'item' properties on IE8 | |
typeof obj.nodeType != 'number' && ( | |
// a real array | |
Array.isArray(obj) || | |
// arguments | |
'callee' in obj || | |
// HTMLCollection/NodeList | |
'item' in obj) | |
); | |
} | |
/** | |
* Ensure that the argument is an array by wrapping it in an array if it is not. | |
* Creates a copy of the argument if it is already an array. | |
* | |
* This is mostly useful idiomatically: | |
* | |
* var createArrayFromMixed = require('createArrayFromMixed'); | |
* | |
* function takesOneOrMoreThings(things) { | |
* things = createArrayFromMixed(things); | |
* ... | |
* } | |
* | |
* This allows you to treat `things' as an array, but accept scalars in the API. | |
* | |
* If you need to convert an array-like object, like `arguments`, into an array | |
* use toArray instead. | |
* | |
* @param {*} obj | |
* @return {array} | |
*/ | |
function createArrayFromMixed(obj) { | |
if (!hasArrayNature(obj)) { | |
return [obj]; | |
} else if (Array.isArray(obj)) { | |
return obj.slice(); | |
} else { | |
return toArray(obj); | |
} | |
} | |
module.exports = createArrayFromMixed; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 313 */ | |
/***/ (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. | |
* | |
* @typechecks | |
*/ | |
/*eslint-disable fb-www/unsafe-html*/ | |
var ExecutionEnvironment = __webpack_require__(18); | |
var createArrayFromMixed = __webpack_require__(312); | |
var getMarkupWrap = __webpack_require__(314); | |
var invariant = __webpack_require__(11); | |
/** | |
* Dummy container used to render all markup. | |
*/ | |
var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null; | |
/** | |
* Pattern used by `getNodeName`. | |
*/ | |
var nodeNamePattern = /^\s*<(\w+)/; | |
/** | |
* Extracts the `nodeName` of the first element in a string of markup. | |
* | |
* @param {string} markup String of markup. | |
* @return {?string} Node name of the supplied markup. | |
*/ | |
function getNodeName(markup) { | |
var nodeNameMatch = markup.match(nodeNamePattern); | |
return nodeNameMatch && nodeNameMatch[1].toLowerCase(); | |
} | |
/** | |
* Creates an array containing the nodes rendered from the supplied markup. The | |
* optionally supplied `handleScript` function will be invoked once for each | |
* <script> element that is rendered. If no `handleScript` function is supplied, | |
* an exception is thrown if any <script> elements are rendered. | |
* | |
* @param {string} markup A string of valid HTML markup. | |
* @param {?function} handleScript Invoked once for each rendered <script>. | |
* @return {array<DOMElement|DOMTextNode>} An array of rendered nodes. | |
*/ | |
function createNodesFromMarkup(markup, handleScript) { | |
var node = dummyNode; | |
!!!dummyNode ? process.env.NODE_ENV !== 'production' ? invariant(false, 'createNodesFromMarkup dummy not initialized') : invariant(false) : void 0; | |
var nodeName = getNodeName(markup); | |
var wrap = nodeName && getMarkupWrap(nodeName); | |
if (wrap) { | |
node.innerHTML = wrap[1] + markup + wrap[2]; | |
var wrapDepth = wrap[0]; | |
while (wrapDepth--) { | |
node = node.lastChild; | |
} | |
} else { | |
node.innerHTML = markup; | |
} | |
var scripts = node.getElementsByTagName('script'); | |
if (scripts.length) { | |
!handleScript ? process.env.NODE_ENV !== 'production' ? invariant(false, 'createNodesFromMarkup(...): Unexpected <script> element rendered.') : invariant(false) : void 0; | |
createArrayFromMixed(scripts).forEach(handleScript); | |
} | |
var nodes = Array.from(node.childNodes); | |
while (node.lastChild) { | |
node.removeChild(node.lastChild); | |
} | |
return nodes; | |
} | |
module.exports = createNodesFromMarkup; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 314 */ | |
/***/ (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. | |
* | |
*/ | |
/*eslint-disable fb-www/unsafe-html */ | |
var ExecutionEnvironment = __webpack_require__(18); | |
var invariant = __webpack_require__(11); | |
/** | |
* Dummy container used to detect which wraps are necessary. | |
*/ | |
var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null; | |
/** | |
* Some browsers cannot use `innerHTML` to render certain elements standalone, | |
* so we wrap them, render the wrapped nodes, then extract the desired node. | |
* | |
* In IE8, certain elements cannot render alone, so wrap all elements ('*'). | |
*/ | |
var shouldWrap = {}; | |
var selectWrap = [1, '<select multiple="true">', '</select>']; | |
var tableWrap = [1, '<table>', '</table>']; | |
var trWrap = [3, '<table><tbody><tr>', '</tr></tbody></table>']; | |
var svgWrap = [1, '<svg xmlns="http://www.w3.org/2000/svg">', '</svg>']; | |
var markupWrap = { | |
'*': [1, '?<div>', '</div>'], | |
'area': [1, '<map>', '</map>'], | |
'col': [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'], | |
'legend': [1, '<fieldset>', '</fieldset>'], | |
'param': [1, '<object>', '</object>'], | |
'tr': [2, '<table><tbody>', '</tbody></table>'], | |
'optgroup': selectWrap, | |
'option': selectWrap, | |
'caption': tableWrap, | |
'colgroup': tableWrap, | |
'tbody': tableWrap, | |
'tfoot': tableWrap, | |
'thead': tableWrap, | |
'td': trWrap, | |
'th': trWrap | |
}; | |
// Initialize the SVG elements since we know they'll always need to be wrapped | |
// consistently. If they are created inside a <div> they will be initialized in | |
// the wrong namespace (and will not display). | |
var svgElements = ['circle', 'clipPath', 'defs', 'ellipse', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'text', 'tspan']; | |
svgElements.forEach(function (nodeName) { | |
markupWrap[nodeName] = svgWrap; | |
shouldWrap[nodeName] = true; | |
}); | |
/** | |
* Gets the markup wrap configuration for the supplied `nodeName`. | |
* | |
* NOTE: This lazily detects which wraps are necessary for the current browser. | |
* | |
* @param {string} nodeName Lowercase `nodeName`. | |
* @return {?array} Markup wrap configuration, if applicable. | |
*/ | |
function getMarkupWrap(nodeName) { | |
!!!dummyNode ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Markup wrapping node not initialized') : invariant(false) : void 0; | |
if (!markupWrap.hasOwnProperty(nodeName)) { | |
nodeName = '*'; | |
} | |
if (!shouldWrap.hasOwnProperty(nodeName)) { | |
if (nodeName === '*') { | |
dummyNode.innerHTML = '<link />'; | |
} else { | |
dummyNode.innerHTML = '<' + nodeName + '></' + nodeName + '>'; | |
} | |
shouldWrap[nodeName] = !dummyNode.firstChild; | |
} | |
return shouldWrap[nodeName] ? markupWrap[nodeName] : null; | |
} | |
module.exports = getMarkupWrap; | |
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) | |
/***/ }), | |
/* 315 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"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. | |
* | |
* @typechecks | |
*/ | |
/** | |
* Gets the scroll position of the supplied element or window. | |
* | |
* The return values are unbounded, unlike `getScrollPosition`. This means they | |
* may be negative or exceed the element boundaries (which is possible using | |
* inertial scrolling). | |
* | |
* @param {DOMWindow|DOMElement} scrollable | |
* @return {object} Map with `x` and `y` keys. | |
*/ | |
function getUnboundedScrollPosition(scrollable) { | |
if (scrollable === window) { | |
return { | |
x: window.pageXOffset || document.documentElement.scrollLeft, | |
y: window.pageYOffset || document.documentElement.scrollTop | |
}; | |
} | |
return { | |
x: scrollable.scrollLeft, | |
y: scrollable.scrollTop | |
}; | |
} | |
module.exports = getUnboundedScrollPosition; | |
/***/ }), | |
/* 316 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"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. | |
* | |
* @typechecks | |
*/ | |
var _uppercasePattern = /([A-Z])/g; | |
/** | |
* Hyphenates a camelcased string, for example: | |
* | |
* > hyphenate('backgroundColor') | |
* < "background-color" | |
* | |
* For CSS style names, use `hyphenateStyleName` instead which works properly | |
* with all vendor prefixes, including `ms`. | |
* | |
* @param {string} string | |
* @return {string} | |
*/ | |
function hyphenate(string) { | |
return string.replace(_uppercasePattern, '-$1').toLowerCase(); | |
} | |
module.exports = hyphenate; | |
/***/ }), | |
/* 317 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"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. | |
* | |
* @typechecks | |
*/ | |
var hyphenate = __webpack_require__(316); | |
var msPattern = /^ms-/; | |
/** | |
* Hyphenates a camelcased CSS property name, for example: | |
* | |
* > hyphenateStyleName('backgroundColor') | |
* < "background-color" | |
* > hyphenateStyleName('MozTransition') | |
* < "-moz-transition" | |
* > hyphenateStyleName('msTransition') | |
* < "-ms-transition" | |
* | |
* As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix | |
* is converted to `-ms-`. | |
* | |
* @param {string} string | |
* @return {string} | |
*/ | |
function hyphenateStyleName(string) { | |
return hyphenate(string).replace(msPattern, '-ms-'); | |
} | |
module.exports = hyphenateStyleName; | |
/***/ }), | |
/* 318 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"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. | |
* | |
* @typechecks | |
*/ | |
/** | |
* @param {*} object The object to check. | |
* @return {boolean} Whether or not the object is a DOM node. | |
*/ | |
function isNode(object) { | |
return !!(object && (typeof Node === 'function' ? object instanceof Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string')); | |
} | |
module.exports = isNode; | |
/***/ }), | |
/* 319 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"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. | |
* | |
* @typechecks | |
*/ | |
var isNode = __webpack_require__(318); | |
/** | |
* @param {*} object The object to check. | |
* @return {boolean} Whether or not the object is a DOM text node. | |
*/ | |
function isTextNode(object) { | |
return isNode(object) && object.nodeType == 3; | |
} | |
module.exports = isTextNode; | |
/***/ }), | |
/* 320 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"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. | |
* | |
* | |
* @typechecks static-only | |
*/ | |
/** | |
* Memoizes the return value of a function that accepts one string argument. | |
*/ | |
function memoizeStringOnly(callback) { | |
var cache = {}; | |
return function (string) { | |
if (!cache.hasOwnProperty(string)) { | |
cache[string] = callback.call(this, string); | |
} | |
return cache[string]; | |
}; | |
} | |
module.exports = memoizeStringOnly; | |
/***/ }), | |
/* 321 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"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. | |
* | |
* @typechecks | |
*/ | |
var ExecutionEnvironment = __webpack_require__(18); | |
var performance; | |
if (ExecutionEnvironment.canUseDOM) { | |
performance = window.performance || window.msPerformance || window.webkitPerformance; | |
} | |
module.exports = performance || {}; | |
/***/ }), | |
/* 322 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"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. | |
* | |
* @typechecks | |
*/ | |
var performance = __webpack_require__(321); | |
var performanceNow; | |
/** | |
* Detect if we can use `window.performance.now()` and gracefully fallback to | |
* `Date.now()` if it doesn't exist. We need to support Firefox < 15 for now | |
* because of Facebook's testing infrastructure. | |
*/ | |
if (performance.now) { | |
performanceNow = function performanceNow() { | |
return performance.now(); | |
}; | |
} else { | |
performanceNow = function performanceNow() { | |
return Date.now(); | |
}; | |
} | |
module.exports = performanceNow; | |
/***/ }), | |
/* 323 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | |
// special flexbox specifications | |
var _prefixAll2 = __webpack_require__(344); | |
var _prefixAll3 = _interopRequireDefault(_prefixAll2); | |
var _getBrowserInformation = __webpack_require__(345); | |
var _getBrowserInformation2 = _interopRequireDefault(_getBrowserInformation); | |
var _getPrefixedKeyframes = __webpack_require__(346); | |
var _getPrefixedKeyframes2 = _interopRequireDefault(_getPrefixedKeyframes); | |
var _capitalizeString = __webpack_require__(112); | |
var _capitalizeString2 = _interopRequireDefault(_capitalizeString); | |
var _sortPrefixedStyle = __webpack_require__(188); | |
var _sortPrefixedStyle2 = _interopRequireDefault(_sortPrefixedStyle); | |
var _prefixProps = __webpack_require__(334); | |
var _prefixProps2 = _interopRequireDefault(_prefixProps); | |
var _position = __webpack_require__(330); | |
var _position2 = _interopRequireDefault(_position); | |
var _calc = __webpack_require__(324); | |
var _calc2 = _interopRequireDefault(_calc); | |
var _zoomCursor = __webpack_require__(333); | |
var _zoomCursor2 = _interopRequireDefault(_zoomCursor); | |
var _grabCursor = __webpack_require__(328); | |
var _grabCursor2 = _interopRequireDefault(_grabCursor); | |
var _flex = __webpack_require__(325); | |
var _flex2 = _interopRequireDefault(_flex); | |
var _sizing = __webpack_require__(331); | |
var _sizing2 = _interopRequireDefault(_sizing); | |
var _gradient = __webpack_require__(329); | |
var _gradient2 = _interopRequireDefault(_gradient); | |
var _transition = __webpack_require__(332); | |
var _transition2 = _interopRequireDefault(_transition); | |
var _flexboxIE = __webpack_require__(326); | |
var _flexboxIE2 = _interopRequireDefault(_flexboxIE); | |
var _flexboxOld = __webpack_require__(327); | |
var _flexboxOld2 = _interopRequireDefault(_flexboxOld); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | |
var plugins = [_position2.default, _calc2.default, _zoomCursor2.default, _grabCursor2.default, _sizing2.default, _gradient2.default, _transition2.default, _flexboxIE2.default, _flexboxOld2.default, | |
// this must be run AFTER the flexbox specs | |
_flex2.default]; | |
var Prefixer = function () { | |
/** | |
* Instantiante a new prefixer | |
* @param {string} userAgent - userAgent to gather prefix information according to caniuse.com | |
* @param {string} keepUnprefixed - keeps unprefixed properties and values | |
*/ | |
function Prefixer() { | |
var _this = this; | |
var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; | |
_classCallCheck(this, Prefixer); | |
var defaultUserAgent = typeof navigator !== 'undefined' ? navigator.userAgent : undefined; | |
this._userAgent = options.userAgent || defaultUserAgent; | |
this._keepUnprefixed = options.keepUnprefixed || false; | |
this._browserInfo = (0, _getBrowserInformation2.default)(this._userAgent); | |
// Checks if the userAgent was resolved correctly | |
if (this._browserInfo && this._browserInfo.prefix) { | |
// set additional prefix information | |
this.cssPrefix = this._browserInfo.prefix.css; | |
this.jsPrefix = this._browserInfo.prefix.inline; | |
this.prefixedKeyframes = (0, _getPrefixedKeyframes2.default)(this._browserInfo); | |
} else { | |
this._usePrefixAllFallback = true; | |
return false; | |
} | |
var data = this._browserInfo.browser && _prefixProps2.default[this._browserInfo.browser]; | |
if (data) { | |
this._requiresPrefix = Object.keys(data).filter(function (key) { | |
return data[key] >= _this._browserInfo.version; | |
}).reduce(function (result, name) { | |
result[name] = true; | |
return result; | |
}, {}); | |
this._hasPropsRequiringPrefix = Object.keys(this._requiresPrefix).length > 0; | |
} else { | |
this._usePrefixAllFallback = true; | |
} | |
} | |
/** | |
* Returns a prefixed version of the style object | |
* @param {Object} styles - Style object that gets prefixed properties added | |
* @returns {Object} - Style object with prefixed properties and values | |
*/ | |
_createClass(Prefixer, [{ | |
key: 'prefix', | |
value: function prefix(styles) { | |
var _this2 = this; | |
// use prefixAll as fallback if userAgent can not be resolved | |
if (this._usePrefixAllFallback) { | |
return (0, _prefixAll3.default)(styles); | |
} | |
// only add prefixes if needed | |
if (!this._hasPropsRequiringPrefix) { | |
return styles; | |
} | |
Object.keys(styles).forEach(function (property) { | |
var value = styles[property]; | |
if (value instanceof Object && !Array.isArray(value)) { | |
// recurse through nested style objects | |
styles[property] = _this2.prefix(value); | |
} else { | |
// add prefixes if needed | |
if (_this2._requiresPrefix[property]) { | |
styles[_this2.jsPrefix + (0, _capitalizeString2.default)(property)] = value; | |
if (!_this2._keepUnprefixed) { | |
delete styles[property]; | |
} | |
} | |
} | |
}); | |
Object.keys(styles).forEach(function (property) { | |
[].concat(styles[property]).forEach(function (value) { | |
// resolve plugins | |
plugins.forEach(function (plugin) { | |
// generates a new plugin interface with current data | |
assignStyles(styles, plugin({ | |
property: property, | |
value: value, | |
styles: styles, | |
browserInfo: _this2._browserInfo, | |
prefix: { | |
js: _this2.jsPrefix, | |
css: _this2.cssPrefix, | |
keyframes: _this2.prefixedKeyframes | |
}, | |
keepUnprefixed: _this2._keepUnprefixed, | |
requiresPrefix: _this2._requiresPrefix | |
}), value, _this2._keepUnprefixed); | |
}); | |
}); | |
}); | |
return (0, _sortPrefixedStyle2.default)(styles); | |
} | |
/** | |
* Returns a prefixed version of the style object using all vendor prefixes | |
* @param {Object} styles - Style object that gets prefixed properties added | |
* @returns {Object} - Style object with prefixed properties and values | |
*/ | |
}], [{ | |
key: 'prefixAll', | |
value: function prefixAll(styles) { | |
return (0, _prefixAll3.default)(styles); | |
} | |
}]); | |
return Prefixer; | |
}(); | |
exports.default = Prefixer; | |
function assignStyles(base) { | |
var extend = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; | |
var value = arguments[2]; | |
var keepUnprefixed = arguments[3]; | |
Object.keys(extend).forEach(function (property) { | |
var baseValue = base[property]; | |
if (Array.isArray(baseValue)) { | |
[].concat(extend[property]).forEach(function (val) { | |
if (base[property].indexOf(val) === -1) { | |
base[property].splice(baseValue.indexOf(value), keepUnprefixed ? 0 : 1, val); | |
} | |
}); | |
} else { | |
base[property] = extend[property]; | |
} | |
}); | |
} | |
module.exports = exports['default']; | |
/***/ }), | |
/* 324 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = calc; | |
var _getPrefixedValue = __webpack_require__(32); | |
var _getPrefixedValue2 = _interopRequireDefault(_getPrefixedValue); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | |
function calc(_ref) { | |
var property = _ref.property; | |
var value = _ref.value; | |
var _ref$browserInfo = _ref.browserInfo; | |
var browser = _ref$browserInfo.browser; | |
var version = _ref$browserInfo.version; | |
var css = _ref.prefix.css; | |
var keepUnprefixed = _ref.keepUnprefixed; | |
if (typeof value === 'string' && value.indexOf('calc(') > -1 && (browser === 'firefox' && version < 15 || browser === 'chrome' && version < 25 || browser === 'safari' && version < 6.1 || browser === 'ios_saf' && version < 7)) { | |
return _defineProperty({}, property, (0, _getPrefixedValue2.default)(value.replace(/calc\(/g, css + 'calc('), value, keepUnprefixed)); | |
} | |
} | |
module.exports = exports['default']; | |
/***/ }), | |
/* 325 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = flex; | |
var _getPrefixedValue = __webpack_require__(32); | |
var _getPrefixedValue2 = _interopRequireDefault(_getPrefixedValue); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
var values = { flex: true, 'inline-flex': true }; | |
function flex(_ref) { | |
var property = _ref.property; | |
var value = _ref.value; | |
var _ref$browserInfo = _ref.browserInfo; | |
var browser = _ref$browserInfo.browser; | |
var version = _ref$browserInfo.version; | |
var css = _ref.prefix.css; | |
var keepUnprefixed = _ref.keepUnprefixed; | |
if (property === 'display' && values[value] && (browser === 'chrome' && version < 29 && version > 20 || (browser === 'safari' || browser === 'ios_saf') && version < 9 && version > 6 || browser === 'opera' && (version == 15 || version == 16))) { | |
return { | |
display: (0, _getPrefixedValue2.default)(css + value, value, keepUnprefixed) | |
}; | |
} | |
} | |
module.exports = exports['default']; | |
/***/ }), | |
/* 326 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = flexboxIE; | |
var _getPrefixedValue = __webpack_require__(32); | |
var _getPrefixedValue2 = _interopRequireDefault(_getPrefixedValue); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | |
var alternativeValues = { | |
'space-around': 'distribute', | |
'space-between': 'justify', | |
'flex-start': 'start', | |
'flex-end': 'end', | |
flex: 'flexbox', | |
'inline-flex': 'inline-flexbox' | |
}; | |
var alternativeProps = { | |
alignContent: 'msFlexLinePack', | |
alignSelf: 'msFlexItemAlign', | |
alignItems: 'msFlexAlign', | |
justifyContent: 'msFlexPack', | |
order: 'msFlexOrder', | |
flexGrow: 'msFlexPositive', | |
flexShrink: 'msFlexNegative', | |
flexBasis: 'msPreferredSize' | |
}; | |
function flexboxIE(_ref) { | |
var property = _ref.property; | |
var value = _ref.value; | |
var styles = _ref.styles; | |
var _ref$browserInfo = _ref.browserInfo; | |
var browser = _ref$browserInfo.browser; | |
var version = _ref$browserInfo.version; | |
var css = _ref.prefix.css; | |
var keepUnprefixed = _ref.keepUnprefixed; | |
if ((alternativeProps[property] || property === 'display' && typeof value === 'string' && value.indexOf('flex') > -1) && (browser === 'ie_mob' || browser === 'ie') && version == 10) { | |
if (!keepUnprefixed && !Array.isArray(styles[property])) { | |
delete styles[property]; | |
} | |
if (property === 'display' && alternativeValues[value]) { | |
return { | |
display: (0, _getPrefixedValue2.default)(css + alternativeValues[value], value, keepUnprefixed) | |
}; | |
} | |
if (alternativeProps[property]) { | |
return _defineProperty({}, alternativeProps[property], alternativeValues[value] || value); | |
} | |
} | |
} | |
module.exports = exports['default']; | |
/***/ }), | |
/* 327 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = flexboxOld; | |
var _getPrefixedValue = __webpack_require__(32); | |
var _getPrefixedValue2 = _interopRequireDefault(_getPrefixedValue); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | |
var alternativeValues = { | |
'space-around': 'justify', | |
'space-between': 'justify', | |
'flex-start': 'start', | |
'flex-end': 'end', | |
'wrap-reverse': 'multiple', | |
wrap: 'multiple', | |
flex: 'box', | |
'inline-flex': 'inline-box' | |
}; | |
var alternativeProps = { | |
alignItems: 'WebkitBoxAlign', | |
justifyContent: 'WebkitBoxPack', | |
flexWrap: 'WebkitBoxLines' | |
}; | |
var otherProps = ['alignContent', 'alignSelf', 'order', 'flexGrow', 'flexShrink', 'flexBasis', 'flexDirection']; | |
var properties = Object.keys(alternativeProps).concat(otherProps); | |
function flexboxOld(_ref) { | |
var property = _ref.property; | |
var value = _ref.value; | |
var styles = _ref.styles; | |
var _ref$browserInfo = _ref.browserInfo; | |
var browser = _ref$browserInfo.browser; | |
var version = _ref$browserInfo.version; | |
var css = _ref.prefix.css; | |
var keepUnprefixed = _ref.keepUnprefixed; | |
if ((properties.indexOf(property) > -1 || property === 'display' && typeof value === 'string' && value.indexOf('flex') > -1) && (browser === 'firefox' && version < 22 || browser === 'chrome' && version < 21 || (browser === 'safari' || browser === 'ios_saf') && version <= 6.1 || browser === 'android' && version < 4.4 || browser === 'and_uc')) { | |
if (!keepUnprefixed && !Array.isArray(styles[property])) { | |
delete styles[property]; | |
} | |
if (property === 'flexDirection' && typeof value === 'string') { | |
return { | |
WebkitBoxOrient: value.indexOf('column') > -1 ? 'vertical' : 'horizontal', | |
WebkitBoxDirection: value.indexOf('reverse') > -1 ? 'reverse' : 'normal' | |
}; | |
} | |
if (property === 'display' && alternativeValues[value]) { | |
return { | |
display: (0, _getPrefixedValue2.default)(css + alternativeValues[value], value, keepUnprefixed) | |
}; | |
} | |
if (alternativeProps[property]) { | |
return _defineProperty({}, alternativeProps[property], alternativeValues[value] || value); | |
} | |
} | |
} | |
module.exports = exports['default']; | |
/***/ }), | |
/* 328 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = grabCursor; | |
var _getPrefixedValue = __webpack_require__(32); | |
var _getPrefixedValue2 = _interopRequireDefault(_getPrefixedValue); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
var values = { grab: true, grabbing: true }; | |
function grabCursor(_ref) { | |
var property = _ref.property; | |
var value = _ref.value; | |
var browser = _ref.browserInfo.browser; | |
var css = _ref.prefix.css; | |
var keepUnprefixed = _ref.keepUnprefixed; | |
// adds prefixes for firefox, chrome, safari, and opera regardless of version until a reliable brwoser support info can be found (see: https://github.com/rofrischmann/inline-style-prefixer/issues/79) | |
if (property === 'cursor' && values[value] && (browser === 'firefox' || browser === 'chrome' || browser === 'safari' || browser === 'opera')) { | |
return { | |
cursor: (0, _getPrefixedValue2.default)(css + value, value, keepUnprefixed) | |
}; | |
} | |
} | |
module.exports = exports['default']; | |
/***/ }), | |
/* 329 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = gradient; | |
var _getPrefixedValue = __webpack_require__(32); | |
var _getPrefixedValue2 = _interopRequireDefault(_getPrefixedValue); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | |
var values = /linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient/; | |
function gradient(_ref) { | |
var property = _ref.property; | |
var value = _ref.value; | |
var _ref$browserInfo = _ref.browserInfo; | |
var browser = _ref$browserInfo.browser; | |
var version = _ref$browserInfo.version; | |
var css = _ref.prefix.css; | |
var keepUnprefixed = _ref.keepUnprefixed; | |
if (typeof value === 'string' && value.match(values) !== null && (browser === 'firefox' && version < 16 || browser === 'chrome' && version < 26 || (browser === 'safari' || browser === 'ios_saf') && version < 7 || (browser === 'opera' || browser === 'op_mini') && version < 12.1 || browser === 'android' && version < 4.4 || browser === 'and_uc')) { | |
return _defineProperty({}, property, (0, _getPrefixedValue2.default)(css + value, value, keepUnprefixed)); | |
} | |
} | |
module.exports = exports['default']; | |
/***/ }), | |
/* 330 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = position; | |
var _getPrefixedValue = __webpack_require__(32); | |
var _getPrefixedValue2 = _interopRequireDefault(_getPrefixedValue); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | |
function position(_ref) { | |
var property = _ref.property; | |
var value = _ref.value; | |
var browser = _ref.browserInfo.browser; | |
var css = _ref.prefix.css; | |
var keepUnprefixed = _ref.keepUnprefixed; | |
if (property === 'position' && value === 'sticky' && (browser === 'safari' || browser === 'ios_saf')) { | |
return _defineProperty({}, property, (0, _getPrefixedValue2.default)(css + value, value, keepUnprefixed)); | |
} | |
} | |
module.exports = exports['default']; | |
/***/ }), | |
/* 331 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = sizing; | |
var _getPrefixedValue = __webpack_require__(32); | |
var _getPrefixedValue2 = _interopRequireDefault(_getPrefixedValue); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | |
var properties = { | |
maxHeight: true, | |
maxWidth: true, | |
width: true, | |
height: true, | |
columnWidth: true, | |
minWidth: true, | |
minHeight: true | |
}; | |
var values = { | |
'min-content': true, | |
'max-content': true, | |
'fill-available': true, | |
'fit-content': true, | |
'contain-floats': true | |
}; | |
function sizing(_ref) { | |
var property = _ref.property; | |
var value = _ref.value; | |
var css = _ref.prefix.css; | |
var keepUnprefixed = _ref.keepUnprefixed; | |
// This might change in the future | |
// Keep an eye on it | |
if (properties[property] && values[value]) { | |
return _defineProperty({}, property, (0, _getPrefixedValue2.default)(css + value, value, keepUnprefixed)); | |
} | |
} | |
module.exports = exports['default']; | |
/***/ }), | |
/* 332 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; | |
exports.default = transition; | |
var _hyphenateStyleName = __webpack_require__(186); | |
var _hyphenateStyleName2 = _interopRequireDefault(_hyphenateStyleName); | |
var _unprefixProperty = __webpack_require__(348); | |
var _unprefixProperty2 = _interopRequireDefault(_unprefixProperty); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | |
var properties = { transition: true, transitionProperty: true }; | |
function transition(_ref) { | |
var property = _ref.property; | |
var value = _ref.value; | |
var css = _ref.prefix.css; | |
var requiresPrefix = _ref.requiresPrefix; | |
var keepUnprefixed = _ref.keepUnprefixed; | |
// also check for already prefixed transitions | |
var unprefixedProperty = (0, _unprefixProperty2.default)(property); | |
if (typeof value === 'string' && properties[unprefixedProperty]) { | |
var _ret = function () { | |
// TODO: memoize this array | |
var requiresPrefixDashCased = Object.keys(requiresPrefix).map(function (prop) { | |
return (0, _hyphenateStyleName2.default)(prop); | |
}); | |
// only split multi values, not cubic beziers | |
var multipleValues = value.split(/,(?![^()]*(?:\([^()]*\))?\))/g); | |
requiresPrefixDashCased.forEach(function (prop) { | |
multipleValues.forEach(function (val, index) { | |
if (val.indexOf(prop) > -1 && prop !== 'order') { | |
multipleValues[index] = val.replace(prop, css + prop) + (keepUnprefixed ? ',' + val : ''); | |
} | |
}); | |
}); | |
return { | |
v: _defineProperty({}, property, multipleValues.join(',')) | |
}; | |
}(); | |
if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === "object") return _ret.v; | |
} | |
} | |
module.exports = exports['default']; | |
/***/ }), | |
/* 333 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = zoomCursor; | |
var _getPrefixedValue = __webpack_require__(32); | |
var _getPrefixedValue2 = _interopRequireDefault(_getPrefixedValue); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
var values = { 'zoom-in': true, 'zoom-out': true }; | |
function zoomCursor(_ref) { | |
var property = _ref.property; | |
var value = _ref.value; | |
var _ref$browserInfo = _ref.browserInfo; | |
var browser = _ref$browserInfo.browser; | |
var version = _ref$browserInfo.version; | |
var css = _ref.prefix.css; | |
var keepUnprefixed = _ref.keepUnprefixed; | |
if (property === 'cursor' && values[value] && (browser === 'firefox' && version < 24 || browser === 'chrome' && version < 37 || browser === 'safari' && version < 9 || browser === 'opera' && version < 24)) { | |
return { | |
cursor: (0, _getPrefixedValue2.default)(css + value, value, keepUnprefixed) | |
}; | |
} | |
} | |
module.exports = exports['default']; | |
/***/ }), | |
/* 334 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = { "chrome": { "transform": 35, "transformOrigin": 35, "transformOriginX": 35, "transformOriginY": 35, "backfaceVisibility": 35, "perspective": 35, "perspectiveOrigin": 35, "transformStyle": 35, "transformOriginZ": 35, "animation": 42, "animationDelay": 42, "animationDirection": 42, "animationFillMode": 42, "animationDuration": 42, "animationIterationCount": 42, "animationName": 42, "animationPlayState": 42, "animationTimingFunction": 42, "appearance": 55, "userSelect": 55, "fontKerning": 32, "textEmphasisPosition": 55, "textEmphasis": 55, "textEmphasisStyle": 55, "textEmphasisColor": 55, "boxDecorationBreak": 55, "clipPath": 55, "maskImage": 55, "maskMode": 55, "maskRepeat": 55, "maskPosition": 55, "maskClip": 55, "maskOrigin": 55, "maskSize": 55, "maskComposite": 55, "mask": 55, "maskBorderSource": 55, "maskBorderMode": 55, "maskBorderSlice": 55, "maskBorderWidth": 55, "maskBorderOutset": 55, "maskBorderRepeat": 55, "maskBorder": 55, "maskType": 55, "textDecorationStyle": 55, "textDecorationSkip": 55, "textDecorationLine": 55, "textDecorationColor": 55, "filter": 52, "fontFeatureSettings": 47, "breakAfter": 49, "breakBefore": 49, "breakInside": 49, "columnCount": 49, "columnFill": 49, "columnGap": 49, "columnRule": 49, "columnRuleColor": 49, "columnRuleStyle": 49, "columnRuleWidth": 49, "columns": 49, "columnSpan": 49, "columnWidth": 49 }, "safari": { "flex": 8, "flexBasis": 8, "flexDirection": 8, "flexGrow": 8, "flexFlow": 8, "flexShrink": 8, "flexWrap": 8, "alignContent": 8, "alignItems": 8, "alignSelf": 8, "justifyContent": 8, "order": 8, "transition": 6, "transitionDelay": 6, "transitionDuration": 6, "transitionProperty": 6, "transitionTimingFunction": 6, "transform": 8, "transformOrigin": 8, "transformOriginX": 8, "transformOriginY": 8, "backfaceVisibility": 8, "perspective": 8, "perspectiveOrigin": 8, "transformStyle": 8, "transformOriginZ": 8, "animation": 8, "animationDelay": 8, "animationDirection": 8, "animationFillMode": 8, "animationDuration": 8, "animationIterationCount": 8, "animationName": 8, "animationPlayState": 8, "animationTimingFunction": 8, "appearance": 10, "userSelect": 10, "backdropFilter": 10, "fontKerning": 9, "scrollSnapType": 10, "scrollSnapPointsX": 10, "scrollSnapPointsY": 10, "scrollSnapDestination": 10, "scrollSnapCoordinate": 10, "textEmphasisPosition": 7, "textEmphasis": 7, "textEmphasisStyle": 7, "textEmphasisColor": 7, "boxDecorationBreak": 10, "clipPath": 10, "maskImage": 10, "maskMode": 10, "maskRepeat": 10, "maskPosition": 10, "maskClip": 10, "maskOrigin": 10, "maskSize": 10, "maskComposite": 10, "mask": 10, "maskBorderSource": 10, "maskBorderMode": 10, "maskBorderSlice": 10, "maskBorderWidth": 10, "maskBorderOutset": 10, "maskBorderRepeat": 10, "maskBorder": 10, "maskType": 10, "textDecorationStyle": 10, "textDecorationSkip": 10, "textDecorationLine": 10, "textDecorationColor": 10, "shapeImageThreshold": 10, "shapeImageMargin": 10, "shapeImageOutside": 10, "filter": 9, "hyphens": 10, "flowInto": 10, "flowFrom": 10, "breakBefore": 8, "breakAfter": 8, "breakInside": 8, "regionFragment": 10, "columnCount": 8, "columnFill": 8, "columnGap": 8, "columnRule": 8, "columnRuleColor": 8, "columnRuleStyle": 8, "columnRuleWidth": 8, "columns": 8, "columnSpan": 8, "columnWidth": 8 }, "firefox": { "appearance": 51, "userSelect": 51, "boxSizing": 28, "textAlignLast": 48, "textDecorationStyle": 35, "textDecorationSkip": 35, "textDecorationLine": 35, "textDecorationColor": 35, "tabSize": 51, "hyphens": 42, "fontFeatureSettings": 33, "breakAfter": 51, "breakBefore": 51, "breakInside": 51, "columnCount": 51, "columnFill": 51, "columnGap": 51, "columnRule": 51, "columnRuleColor": 51, "columnRuleStyle": 51, "columnRuleWidth": 51, "columns": 51, "columnSpan": 51, "columnWidth": 51 }, "opera": { "flex": 16, "flexBasis": 16, "flexDirection": 16, "flexGrow": 16, "flexFlow": 16, "flexShrink": 16, "flexWrap": 16, "alignContent": 16, "alignItems": 16, "alignSelf": 16, "justifyContent": 16, "order": 16, "transform": 22, "transformOrigin": 22, "transformOriginX": 22, "transformOriginY": 22, "backfaceVisibility": 22, "perspective": 22, "perspectiveOrigin": 22, "transformStyle": 22, "transformOriginZ": 22, "animation": 29, "animationDelay": 29, "animationDirection": 29, "animationFillMode": 29, "animationDuration": 29, "animationIterationCount": 29, "animationName": 29, "animationPlayState": 29, "animationTimingFunction": 29, "appearance": 41, "userSelect": 41, "fontKerning": 19, "textEmphasisPosition": 41, "textEmphasis": 41, "textEmphasisStyle": 41, "textEmphasisColor": 41, "boxDecorationBreak": 41, "clipPath": 41, "maskImage": 41, "maskMode": 41, "maskRepeat": 41, "maskPosition": 41, "maskClip": 41, "maskOrigin": 41, "maskSize": 41, "maskComposite": 41, "mask": 41, "maskBorderSource": 41, "maskBorderMode": 41, "maskBorderSlice": 41, "maskBorderWidth": 41, "maskBorderOutset": 41, "maskBorderRepeat": 41, "maskBorder": 41, "maskType": 41, "textDecorationStyle": 41, "textDecorationSkip": 41, "textDecorationLine": 41, "textDecorationColor": 41, "filter": 39, "fontFeatureSettings": 34, "breakAfter": 36, "breakBefore": 36, "breakInside": 36, "columnCount": 36, "columnFill": 36, "columnGap": 36, "columnRule": 36, "columnRuleColor": 36, "columnRuleStyle": 36, "columnRuleWidth": 36, "columns": 36, "columnSpan": 36, "columnWidth": 36 }, "ie": { "flex": 10, "flexDirection": 10, "flexFlow": 10, "flexWrap": 10, "transform": 9, "transformOrigin": 9, "transformOriginX": 9, "transformOriginY": 9, "userSelect": 11, "wrapFlow": 11, "wrapThrough": 11, "wrapMargin": 11, "scrollSnapType": 11, "scrollSnapPointsX": 11, "scrollSnapPointsY": 11, "scrollSnapDestination": 11, "scrollSnapCoordinate": 11, "touchAction": 10, "hyphens": 11, "flowInto": 11, "flowFrom": 11, "breakBefore": 11, "breakAfter": 11, "breakInside": 11, "regionFragment": 11, "gridTemplateColumns": 11, "gridTemplateRows": 11, "gridTemplateAreas": 11, "gridTemplate": 11, "gridAutoColumns": 11, "gridAutoRows": 11, "gridAutoFlow": 11, "grid": 11, "gridRowStart": 11, "gridColumnStart": 11, "gridRowEnd": 11, "gridRow": 11, "gridColumn": 11, "gridColumnEnd": 11, "gridColumnGap": 11, "gridRowGap": 11, "gridArea": 11, "gridGap": 11, "textSizeAdjust": 11 }, "edge": { "userSelect": 14, "wrapFlow": 14, "wrapThrough": 14, "wrapMargin": 14, "scrollSnapType": 14, "scrollSnapPointsX": 14, "scrollSnapPointsY": 14, "scrollSnapDestination": 14, "scrollSnapCoordinate": 14, "hyphens": 14, "flowInto": 14, "flowFrom": 14, "breakBefore": 14, "breakAfter": 14, "breakInside": 14, "regionFragment": 14, "gridTemplateColumns": 14, "gridTemplateRows": 14, "gridTemplateAreas": 14, "gridTemplate": 14, "gridAutoColumns": 14, "gridAutoRows": 14, "gridAutoFlow": 14, "grid": 14, "gridRowStart": 14, "gridColumnStart": 14, "gridRowEnd": 14, "gridRow": 14, "gridColumn": 14, "gridColumnEnd": 14, "gridColumnGap": 14, "gridRowGap": 14, "gridArea": 14, "gridGap": 14 }, "ios_saf": { "flex": 8.1, "flexBasis": 8.1, "flexDirection": 8.1, "flexGrow": 8.1, "flexFlow": 8.1, "flexShrink": 8.1, "flexWrap": 8.1, "alignContent": 8.1, "alignItems": 8.1, "alignSelf": 8.1, "justifyContent": 8.1, "order": 8.1, "transition": 6, "transitionDelay": 6, "transitionDuration": 6, "transitionProperty": 6, "transitionTimingFunction": 6, "transform": 8.1, "transformOrigin": 8.1, "transformOriginX": 8.1, "transformOriginY": 8.1, "backfaceVisibility": 8.1, "perspective": 8.1, "perspectiveOrigin": 8.1, "transformStyle": 8.1, "transformOriginZ": 8.1, "animation": 8.1, "animationDelay": 8.1, "animationDirection": 8.1, "animationFillMode": 8.1, "animationDuration": 8.1, "animationIterationCount": 8.1, "animationName": 8.1, "animationPlayState": 8.1, "animationTimingFunction": 8.1, "appearance": 9.3, "userSelect": 9.3, "backdropFilter": 9.3, "fontKerning": 9.3, "scrollSnapType": 9.3, "scrollSnapPointsX": 9.3, "scrollSnapPointsY": 9.3, "scrollSnapDestination": 9.3, "scrollSnapCoordinate": 9.3, "boxDecorationBreak": 9.3, "clipPath": 9.3, "maskImage": 9.3, "maskMode": 9.3, "maskRepeat": 9.3, "maskPosition": 9.3, "maskClip": 9.3, "maskOrigin": 9.3, "maskSize": 9.3, "maskComposite": 9.3, "mask": 9.3, "maskBorderSource": 9.3, "maskBorderMode": 9.3, "maskBorderSlice": 9.3, "maskBorderWidth": 9.3, "maskBorderOutset": 9.3, "maskBorderRepeat": 9.3, "maskBorder": 9.3, "maskType": 9.3, "textSizeAdjust": 9.3, "textDecorationStyle": 9.3, "textDecorationSkip": 9.3, "textDecorationLine": 9.3, "textDecorationColor": 9.3, "shapeImageThreshold": 9.3, "shapeImageMargin": 9.3, "shapeImageOutside": 9.3, "filter": 9, "hyphens": 9.3, "flowInto": 9.3, "flowFrom": 9.3, "breakBefore": 8.1, "breakAfter": 8.1, "breakInside": 8.1, "regionFragment": 9.3, "columnCount": 8.1, "columnFill": 8.1, "columnGap": 8.1, "columnRule": 8.1, "columnRuleColor": 8.1, "columnRuleStyle": 8.1, "columnRuleWidth": 8.1, "columns": 8.1, "columnSpan": 8.1, "columnWidth": 8.1 }, "android": { "flex": 4.2, "flexBasis": 4.2, "flexDirection": 4.2, "flexGrow": 4.2, "flexFlow": 4.2, "flexShrink": 4.2, "flexWrap": 4.2, "alignContent": 4.2, "alignItems": 4.2, "alignSelf": 4.2, "justifyContent": 4.2, "order": 4.2, "transition": 4.2, "transitionDelay": 4.2, "transitionDuration": 4.2, "transitionProperty": 4.2, "transitionTimingFunction": 4.2, "transform": 4.4, "transformOrigin": 4.4, "transformOriginX": 4.4, "transformOriginY": 4.4, "backfaceVisibility": 4.4, "perspective": 4.4, "perspectiveOrigin": 4.4, "transformStyle": 4.4, "transformOriginZ": 4.4, "animation": 4.4, "animationDelay": 4.4, "animationDirection": 4.4, "animationFillMode": 4.4, "animationDuration": 4.4, "animationIterationCount": 4.4, "animationName": 4.4, "animationPlayState": 4.4, "animationTimingFunction": 4.4, "appearance": 51, "userSelect": 51, "fontKerning": 4.4, "textEmphasisPosition": 51, "textEmphasis": 51, "textEmphasisStyle": 51, "textEmphasisColor": 51, "boxDecorationBreak": 51, "clipPath": 51, "maskImage": 51, "maskMode": 51, "maskRepeat": 51, "maskPosition": 51, "maskClip": 51, "maskOrigin": 51, "maskSize": 51, "maskComposite": 51, "mask": 51, "maskBorderSource": 51, "maskBorderMode": 51, "maskBorderSlice": 51, "maskBorderWidth": 51, "maskBorderOutset": 51, "maskBorderRepeat": 51, "maskBorder": 51, "maskType": 51, "filter": 51, "fontFeatureSettings": 4.4, "breakAfter": 51, "breakBefore": 51, "breakInside": 51, "columnCount": 51, "columnFill": 51, "columnGap": 51, "columnRule": 51, "columnRuleColor": 51, "columnRuleStyle": 51, "columnRuleWidth": 51, "columns": 51, "columnSpan": 51, "columnWidth": 51 }, "and_chr": { "appearance": 51, "userSelect": 51, "textEmphasisPosition": 51, "textEmphasis": 51, "textEmphasisStyle": 51, "textEmphasisColor": 51, "boxDecorationBreak": 51, "clipPath": 51, "maskImage": 51, "maskMode": 51, "maskRepeat": 51, "maskPosition": 51, "maskClip": 51, "maskOrigin": 51, "maskSize": 51, "maskComposite": 51, "mask": 51, "maskBorderSource": 51, "maskBorderMode": 51, "maskBorderSlice": 51, "maskBorderWidth": 51, "maskBorderOutset": 51, "maskBorderRepeat": 51, "maskBorder": 51, "maskType": 51, "textDecorationStyle": 51, "textDecorationSkip": 51, "textDecorationLine": 51, "textDecorationColor": 51, "filter": 51 }, "and_uc": { "flex": 9.9, "flexBasis": 9.9, "flexDirection": 9.9, "flexGrow": 9.9, "flexFlow": 9.9, "flexShrink": 9.9, "flexWrap": 9.9, "alignContent": 9.9, "alignItems": 9.9, "alignSelf": 9.9, "justifyContent": 9.9, "order": 9.9, "transition": 9.9, "transitionDelay": 9.9, "transitionDuration": 9.9, "transitionProperty": 9.9, "transitionTimingFunction": 9.9, "transform": 9.9, "transformOrigin": 9.9, "transformOriginX": 9.9, "transformOriginY": 9.9, "backfaceVisibility": 9.9, "perspective": 9.9, "perspectiveOrigin": 9.9, "transformStyle": 9.9, "transformOriginZ": 9.9, "animation": 9.9, "animationDelay": 9.9, "animationDirection": 9.9, "animationFillMode": 9.9, "animationDuration": 9.9, "animationIterationCount": 9.9, "animationName": 9.9, "animationPlayState": 9.9, "animationTimingFunction": 9.9, "appearance": 9.9, "userSelect": 9.9, "fontKerning": 9.9, "textEmphasisPosition": 9.9, "textEmphasis": 9.9, "textEmphasisStyle": 9.9, "textEmphasisColor": 9.9, "maskImage": 9.9, "maskMode": 9.9, "maskRepeat": 9.9, "maskPosition": 9.9, "maskClip": 9.9, "maskOrigin": 9.9, "maskSize": 9.9, "maskComposite": 9.9, "mask": 9.9, "maskBorderSource": 9.9, "maskBorderMode": 9.9, "maskBorderSlice": 9.9, "maskBorderWidth": 9.9, "maskBorderOutset": 9.9, "maskBorderRepeat": 9.9, "maskBorder": 9.9, "maskType": 9.9, "textSizeAdjust": 9.9, "filter": 9.9, "hyphens": 9.9, "flowInto": 9.9, "flowFrom": 9.9, "breakBefore": 9.9, "breakAfter": 9.9, "breakInside": 9.9, "regionFragment": 9.9, "fontFeatureSettings": 9.9, "columnCount": 9.9, "columnFill": 9.9, "columnGap": 9.9, "columnRule": 9.9, "columnRuleColor": 9.9, "columnRuleStyle": 9.9, "columnRuleWidth": 9.9, "columns": 9.9, "columnSpan": 9.9, "columnWidth": 9.9 }, "op_mini": {} }; | |
module.exports = exports["default"]; | |
/***/ }), | |
/* 335 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = calc; | |
var _joinPrefixedValue = __webpack_require__(79); | |
var _joinPrefixedValue2 = _interopRequireDefault(_joinPrefixedValue); | |
var _isPrefixedValue = __webpack_require__(113); | |
var _isPrefixedValue2 = _interopRequireDefault(_isPrefixedValue); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
function calc(property, value) { | |
if (typeof value === 'string' && !(0, _isPrefixedValue2.default)(value) && value.indexOf('calc(') > -1) { | |
return (0, _joinPrefixedValue2.default)(property, value, function (prefix, value) { | |
return value.replace(/calc\(/g, prefix + 'calc('); | |
}); | |
} | |
} | |
module.exports = exports['default']; | |
/***/ }), | |
/* 336 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = cursor; | |
var _joinPrefixedValue = __webpack_require__(79); | |
var _joinPrefixedValue2 = _interopRequireDefault(_joinPrefixedValue); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
var values = { | |
'zoom-in': true, | |
'zoom-out': true, | |
grab: true, | |
grabbing: true | |
}; | |
function cursor(property, value) { | |
if (property === 'cursor' && values[value]) { | |
return (0, _joinPrefixedValue2.default)(property, value); | |
} | |
} | |
module.exports = exports['default']; | |
/***/ }), | |
/* 337 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = flex; | |
var values = { flex: true, 'inline-flex': true }; | |
function flex(property, value) { | |
if (property === 'display' && values[value]) { | |
return { | |
display: ['-webkit-box', '-moz-box', '-ms-' + value + 'box', '-webkit-' + value, value] | |
}; | |
} | |
} | |
module.exports = exports['default']; | |
/***/ }), | |
/* 338 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = flexboxIE; | |
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | |
var alternativeValues = { | |
'space-around': 'distribute', | |
'space-between': 'justify', | |
'flex-start': 'start', | |
'flex-end': 'end' | |
}; | |
var alternativeProps = { | |
alignContent: 'msFlexLinePack', | |
alignSelf: 'msFlexItemAlign', | |
alignItems: 'msFlexAlign', | |
justifyContent: 'msFlexPack', | |
order: 'msFlexOrder', | |
flexGrow: 'msFlexPositive', | |
flexShrink: 'msFlexNegative', | |
flexBasis: 'msPreferredSize' | |
}; | |
function flexboxIE(property, value) { | |
if (alternativeProps[property]) { | |
return _defineProperty({}, alternativeProps[property], alternativeValues[value] || value); | |
} | |
} | |
module.exports = exports['default']; | |
/***/ }), | |
/* 339 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = flexboxOld; | |
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | |
var alternativeValues = { | |
'space-around': 'justify', | |
'space-between': 'justify', | |
'flex-start': 'start', | |
'flex-end': 'end', | |
'wrap-reverse': 'multiple', | |
wrap: 'multiple' | |
}; | |
var alternativeProps = { | |
alignItems: 'WebkitBoxAlign', | |
justifyContent: 'WebkitBoxPack', | |
flexWrap: 'WebkitBoxLines' | |
}; | |
function flexboxOld(property, value) { | |
if (property === 'flexDirection' && typeof value === 'string') { | |
return { | |
WebkitBoxOrient: value.indexOf('column') > -1 ? 'vertical' : 'horizontal', | |
WebkitBoxDirection: value.indexOf('reverse') > -1 ? 'reverse' : 'normal' | |
}; | |
} | |
if (alternativeProps[property]) { | |
return _defineProperty({}, alternativeProps[property], alternativeValues[value] || value); | |
} | |
} | |
module.exports = exports['default']; | |
/***/ }), | |
/* 340 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = gradient; | |
var _joinPrefixedValue = __webpack_require__(79); | |
var _joinPrefixedValue2 = _interopRequireDefault(_joinPrefixedValue); | |
var _isPrefixedValue = __webpack_require__(113); | |
var _isPrefixedValue2 = _interopRequireDefault(_isPrefixedValue); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
var values = /linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient/; | |
function gradient(property, value) { | |
if (typeof value === 'string' && !(0, _isPrefixedValue2.default)(value) && value.match(values) !== null) { | |
return (0, _joinPrefixedValue2.default)(property, value); | |
} | |
} | |
module.exports = exports['default']; | |
/***/ }), | |
/* 341 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = position; | |
function position(property, value) { | |
if (property === 'position' && value === 'sticky') { | |
return { position: ['-webkit-sticky', 'sticky'] }; | |
} | |
} | |
module.exports = exports['default']; | |
/***/ }), | |
/* 342 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = sizing; | |
var _joinPrefixedValue = __webpack_require__(79); | |
var _joinPrefixedValue2 = _interopRequireDefault(_joinPrefixedValue); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
var properties = { | |
maxHeight: true, | |
maxWidth: true, | |
width: true, | |
height: true, | |
columnWidth: true, | |
minWidth: true, | |
minHeight: true | |
}; | |
var values = { | |
'min-content': true, | |
'max-content': true, | |
'fill-available': true, | |
'fit-content': true, | |
'contain-floats': true | |
}; | |
function sizing(property, value) { | |
if (properties[property] && values[value]) { | |
return (0, _joinPrefixedValue2.default)(property, value); | |
} | |
} | |
module.exports = exports['default']; | |
/***/ }), | |
/* 343 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = transition; | |
var _hyphenateStyleName = __webpack_require__(186); | |
var _hyphenateStyleName2 = _interopRequireDefault(_hyphenateStyleName); | |
var _capitalizeString = __webpack_require__(112); | |
var _capitalizeString2 = _interopRequireDefault(_capitalizeString); | |
var _isPrefixedValue = __webpack_require__(113); | |
var _isPrefixedValue2 = _interopRequireDefault(_isPrefixedValue); | |
var _prefixProps = __webpack_require__(187); | |
var _prefixProps2 = _interopRequireDefault(_prefixProps); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | |
var properties = { | |
transition: true, | |
transitionProperty: true, | |
WebkitTransition: true, | |
WebkitTransitionProperty: true | |
}; | |
function transition(property, value) { | |
// also check for already prefixed transitions | |
if (typeof value === 'string' && properties[property]) { | |
var _ref2; | |
var outputValue = prefixValue(value); | |
var webkitOutput = outputValue.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function (value) { | |
return value.match(/-moz-|-ms-/) === null; | |
}).join(','); | |
// if the property is already prefixed | |
if (property.indexOf('Webkit') > -1) { | |
return _defineProperty({}, property, webkitOutput); | |
} | |
return _ref2 = {}, _defineProperty(_ref2, 'Webkit' + (0, _capitalizeString2.default)(property), webkitOutput), _defineProperty(_ref2, property, outputValue), _ref2; | |
} | |
} | |
function prefixValue(value) { | |
if ((0, _isPrefixedValue2.default)(value)) { | |
return value; | |
} | |
// only split multi values, not cubic beziers | |
var multipleValues = value.split(/,(?![^()]*(?:\([^()]*\))?\))/g); | |
// iterate each single value and check for transitioned properties | |
// that need to be prefixed as well | |
multipleValues.forEach(function (val, index) { | |
multipleValues[index] = Object.keys(_prefixProps2.default).reduce(function (out, prefix) { | |
var dashCasePrefix = '-' + prefix.toLowerCase() + '-'; | |
Object.keys(_prefixProps2.default[prefix]).forEach(function (prop) { | |
var dashCaseProperty = (0, _hyphenateStyleName2.default)(prop); | |
if (val.indexOf(dashCaseProperty) > -1 && dashCaseProperty !== 'order') { | |
// join all prefixes and create a new value | |
out = val.replace(dashCaseProperty, dashCasePrefix + dashCaseProperty) + ',' + out; | |
} | |
}); | |
return out; | |
}, val); | |
}); | |
return multipleValues.join(','); | |
} | |
module.exports = exports['default']; | |
/***/ }), | |
/* 344 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = prefixAll; | |
var _prefixProps = __webpack_require__(187); | |
var _prefixProps2 = _interopRequireDefault(_prefixProps); | |
var _capitalizeString = __webpack_require__(112); | |
var _capitalizeString2 = _interopRequireDefault(_capitalizeString); | |
var _sortPrefixedStyle = __webpack_require__(188); | |
var _sortPrefixedStyle2 = _interopRequireDefault(_sortPrefixedStyle); | |
var _position = __webpack_require__(341); | |
var _position2 = _interopRequireDefault(_position); | |
var _calc = __webpack_require__(335); | |
var _calc2 = _interopRequireDefault(_calc); | |
var _cursor = __webpack_require__(336); | |
var _cursor2 = _interopRequireDefault(_cursor); | |
var _flex = __webpack_require__(337); | |
var _flex2 = _interopRequireDefault(_flex); | |
var _sizing = __webpack_require__(342); | |
var _sizing2 = _interopRequireDefault(_sizing); | |
var _gradient = __webpack_require__(340); | |
var _gradient2 = _interopRequireDefault(_gradient); | |
var _transition = __webpack_require__(343); | |
var _transition2 = _interopRequireDefault(_transition); | |
var _flexboxIE = __webpack_require__(338); | |
var _flexboxIE2 = _interopRequireDefault(_flexboxIE); | |
var _flexboxOld = __webpack_require__(339); | |
var _flexboxOld2 = _interopRequireDefault(_flexboxOld); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
// special flexbox specifications | |
var plugins = [_position2.default, _calc2.default, _cursor2.default, _sizing2.default, _gradient2.default, _transition2.default, _flexboxIE2.default, _flexboxOld2.default, _flex2.default]; | |
/** | |
* Returns a prefixed version of the style object using all vendor prefixes | |
* @param {Object} styles - Style object that gets prefixed properties added | |
* @returns {Object} - Style object with prefixed properties and values | |
*/ | |
function prefixAll(styles) { | |
Object.keys(styles).forEach(function (property) { | |
var value = styles[property]; | |
if (value instanceof Object && !Array.isArray(value)) { | |
// recurse through nested style objects | |
styles[property] = prefixAll(value); | |
} else { | |
Object.keys(_prefixProps2.default).forEach(function (prefix) { | |
var properties = _prefixProps2.default[prefix]; | |
// add prefixes if needed | |
if (properties[property]) { | |
styles[prefix + (0, _capitalizeString2.default)(property)] = value; | |
} | |
}); | |
} | |
}); | |
Object.keys(styles).forEach(function (property) { | |
[].concat(styles[property]).forEach(function (value, index) { | |
// resolve every special plugins | |
plugins.forEach(function (plugin) { | |
return assignStyles(styles, plugin(property, value)); | |
}); | |
}); | |
}); | |
return (0, _sortPrefixedStyle2.default)(styles); | |
} | |
function assignStyles(base) { | |
var extend = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; | |
Object.keys(extend).forEach(function (property) { | |
var baseValue = base[property]; | |
if (Array.isArray(baseValue)) { | |
[].concat(extend[property]).forEach(function (value) { | |
var valueIndex = baseValue.indexOf(value); | |
if (valueIndex > -1) { | |
base[property].splice(valueIndex, 1); | |
} | |
base[property].push(value); | |
}); | |
} else { | |
base[property] = extend[property]; | |
} | |
}); | |
} | |
module.exports = exports['default']; | |
/***/ }), | |
/* 345 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _bowser = __webpack_require__(263); | |
var _bowser2 = _interopRequireDefault(_bowser); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
var vendorPrefixes = { | |
Webkit: ['chrome', 'safari', 'ios', 'android', 'phantom', 'opera', 'webos', 'blackberry', 'bada', 'tizen', 'chromium', 'vivaldi'], | |
Moz: ['firefox', 'seamonkey', 'sailfish'], | |
ms: ['msie', 'msedge'] | |
}; | |
var browsers = { | |
chrome: [['chrome'], ['chromium']], | |
safari: [['safari']], | |
firefox: [['firefox']], | |
edge: [['msedge']], | |
opera: [['opera'], ['vivaldi']], | |
ios_saf: [['ios', 'mobile'], ['ios', 'tablet']], | |
ie: [['msie']], | |
op_mini: [['opera', 'mobile'], ['opera', 'tablet']], | |
and_uc: [['android', 'mobile'], ['android', 'tablet']], | |
android: [['android', 'mobile'], ['android', 'tablet']] | |
}; | |
var browserByInfo = function browserByInfo(info) { | |
if (info.firefox) { | |
return 'firefox'; | |
} | |
var name = ''; | |
Object.keys(browsers).forEach(function (browser) { | |
browsers[browser].forEach(function (condition) { | |
var match = 0; | |
condition.forEach(function (single) { | |
if (info[single]) { | |
match += 1; | |
} | |
}); | |
if (condition.length === match) { | |
name = browser; | |
} | |
}); | |
}); | |
return name; | |
}; | |
/** | |
* Uses bowser to get default browser information such as version and name | |
* Evaluates bowser info and adds vendorPrefix information | |
* @param {string} userAgent - userAgent that gets evaluated | |
*/ | |
exports.default = function (userAgent) { | |
if (!userAgent) { | |
return false; | |
} | |
var info = _bowser2.default._detect(userAgent); | |
Object.keys(vendorPrefixes).forEach(function (prefix) { | |
vendorPrefixes[prefix].forEach(function (browser) { | |
if (info[browser]) { | |
info.prefix = { | |
inline: prefix, | |
css: '-' + prefix.toLowerCase() + '-' | |
}; | |
} | |
}); | |
}); | |
info.browser = browserByInfo(info); | |
// For cordova IOS 8 the version is missing, set truncated osversion to prevent NaN | |
info.version = info.version ? parseFloat(info.version) : parseInt(parseFloat(info.osversion), 10); | |
info.osversion = parseFloat(info.osversion); | |
// iOS forces all browsers to use Safari under the hood | |
// as the Safari version seems to match the iOS version | |
// we just explicitely use the osversion instead | |
// https://github.com/rofrischmann/inline-style-prefixer/issues/72 | |
if (info.browser === 'ios_saf' && info.version > info.osversion) { | |
info.version = info.osversion; | |
info.safari = true; | |
} | |
// seperate native android chrome | |
// https://github.com/rofrischmann/inline-style-prefixer/issues/45 | |
if (info.browser === 'android' && info.chrome && info.version > 37) { | |
info.browser = 'and_chr'; | |
} | |
// For android < 4.4 we want to check the osversion | |
// not the chrome version, see issue #26 | |
// https://github.com/rofrischmann/inline-style-prefixer/issues/26 | |
if (info.browser === 'android' && info.osversion < 5) { | |
info.version = info.osversion; | |
} | |
return info; | |
}; | |
module.exports = exports['default']; | |
/***/ }), | |
/* 346 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = function (_ref) { | |
var browser = _ref.browser; | |
var version = _ref.version; | |
var prefix = _ref.prefix; | |
var prefixedKeyframes = 'keyframes'; | |
if (browser === 'chrome' && version < 43 || (browser === 'safari' || browser === 'ios_saf') && version < 9 || browser === 'opera' && version < 30 || browser === 'android' && version <= 4.4 || browser === 'and_uc') { | |
prefixedKeyframes = prefix.css + prefixedKeyframes; | |
} | |
return prefixedKeyframes; | |
}; | |
module.exports = exports['default']; | |
/***/ }), | |
/* 347 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = function (property) { | |
return property.match(/^(Webkit|Moz|O|ms)/) !== null; | |
}; | |
module.exports = exports["default"]; | |
/***/ }), | |
/* 348 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.default = function (property) { | |
var unprefixed = property.replace(/^(ms|Webkit|Moz|O)/, ''); | |
return unprefixed.charAt(0).toLowerCase() + unprefixed.slice(1); | |
}; | |
module.exports = exports['default']; | |
/***/ }), | |
/* 349 */ | |
/***/ (function(module, exports, __webpack_require__) { | |
/* WEBPACK VAR INJECTION */(function(global, module) {/** | |
* lodash (Custom Build) <https://lodash.com/> | |
* Build: `lodash modularize exports="npm" -o ./` | |
* Copyright jQuery Foundation and other contributors <https://jquery.org/> | |
* Released under MIT license <https://lodash.com/license> | |
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> | |
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | |
*/ | |
/** Used as the size to enable large array optimizations. */ | |
var LARGE_ARRAY_SIZE = 200; | |
/** Used to stand-in for `undefined` hash values. */ | |
var HASH_UNDEFINED = '__lodash_hash_undefined__'; | |
/** Used as references for various `Number` constants. */ | |
var MAX_SAFE_INTEGER = 9007199254740991; | |
/** `Object#toString` result references. */ | |
var argsTag = '[object Arguments]', | |
arrayTag = '[object Array]', | |
boolTag = '[object Boolean]', | |
dateTag = '[object Date]', | |
errorTag = '[object Error]', | |
funcTag = '[object Function]', | |
genTag = '[object GeneratorFunction]', | |
mapTag = '[object Map]', | |
numberTag = '[object Number]', | |
objectTag = '[object Object]', | |
promiseTag = '[object Promise]', | |
regexpTag = '[object RegExp]', | |
setTag = '[object Set]', | |
stringTag = '[object String]', | |
symbolTag = '[object Symbol]', | |
weakMapTag = '[object WeakMap]'; | |
var arrayBufferTag = '[object ArrayBuffer]', | |
dataViewTag = '[object DataView]', | |
float32Tag = '[object Float32Array]', | |
float64Tag = '[object Float64Array]', | |
int8Tag = '[object Int8Array]', | |
int16Tag = '[object Int16Array]', | |
int32Tag = '[object Int32Array]', | |
uint8Tag = '[object Uint8Array]', | |
uint8ClampedTag = '[object Uint8ClampedArray]', | |
uint16Tag = '[object Uint16Array]', | |
uint32Tag = '[object Uint32Array]'; | |
/** | |
* Used to match `RegExp` | |
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). | |
*/ | |
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; | |
/** Used to match `RegExp` flags from their coerced string values. */ | |
var reFlags = /\w*$/; | |
/** Used to detect host constructors (Safari). */ | |
var reIsHostCtor = /^\[object .+?Constructor\]$/; | |
/** Used to detect unsigned integer values. */ | |
var reIsUint = /^(?:0|[1-9]\d*)$/; | |
/** Used to identify `toStringTag` values of typed arrays. */ | |
var typedArrayTags = {}; | |
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = | |
typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = | |
typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = | |
typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = | |
typedArrayTags[uint32Tag] = true; | |
typedArrayTags[argsTag] = typedArrayTags[arrayTag] = | |
typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = | |
typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = | |
typedArrayTags[errorTag] = typedArrayTags[funcTag] = | |
typedArrayTags[mapTag] = typedArrayTags[numberTag] = | |
typedArrayTags[objectTag] = typedArrayTags[regexpTag] = | |
typedArrayTags[setTag] = typedArrayTags[stringTag] = | |
typedArrayTags[weakMapTag] = false; | |
/** Used to identify `toStringTag` values supported by `_.clone`. */ | |
var cloneableTags = {}; | |
cloneableTags[argsTag] = cloneableTags[arrayTag] = | |
cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = | |
cloneableTags[boolTag] = cloneableTags[dateTag] = | |
cloneableTags[float32Tag] = cloneableTags[float64Tag] = | |
cloneableTags[int8Tag] = cloneableTags[int16Tag] = | |
cloneableTags[int32Tag] = cloneableTags[mapTag] = | |
cloneableTags[numberTag] = cloneableTags[objectTag] = | |
cloneableTags[regexpTag] = cloneableTags[setTag] = | |
cloneableTags[stringTag] = cloneableTags[symbolTag] = | |
cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = | |
cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; | |
cloneableTags[errorTag] = cloneableTags[funcTag] = | |
cloneableTags[weakMapTag] = false; | |
/** Detect free variable `global` from Node.js. */ | |
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; | |
/** 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')(); | |
/** Detect free variable `exports`. */ | |
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; | |
/** Detect free variable `module`. */ | |
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; | |
/** Detect the popular CommonJS extension `module.exports`. */ | |
var moduleExports = freeModule && freeModule.exports === freeExports; | |
/** Detect free variable `process` from Node.js. */ | |
var freeProcess = moduleExports && freeGlobal.process; | |
/** Used to access faster Node.js helpers. */ | |
var nodeUtil = (function() { | |
try { | |
return freeProcess && freeProcess.binding('util'); | |
} catch (e) {} | |
}()); | |
/* Node.js helper references. */ | |
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; | |
/** | |
* Adds the key-value `pair` to `map`. | |
* | |
* @private | |
* @param {Object} map The map to modify. | |
* @param {Array} pair The key-value pair to add. | |
* @returns {Object} Returns `map`. | |
*/ | |
function addMapEntry(map, pair) { | |
// Don't return `map.set` because it's not chainable in IE 11. | |
map.set(pair[0], pair[1]); | |
return map; | |
} | |
/** | |
* Adds `value` to `set`. | |
* | |
* @private | |
* @param {Object} set The set to modify. | |
* @param {*} value The value to add. | |
* @returns {Object} Returns `set`. | |
*/ | |
function addSetEntry(set, value) { | |
// Don't return `set.add` because it's not chainable in IE 11. | |
set.add(value); | |
return set; | |
} | |
/** | |
* A faster alternative to `Function#apply`, this function invokes `func` | |
* with the `this` binding of `thisArg` and the arguments of `args`. | |
* | |
* @private | |
* @param {Function} func The function to invoke. | |
* @param {*} thisArg The `this` binding of `func`. | |
* @param {Array} args The arguments to invoke `func` with. | |
* @returns {*} Returns the result of `func`. | |
*/ | |
function apply(func, thisArg, args) { | |
switch (args.length) { | |
case 0: return func.call(thisArg); | |
case 1: return func.call(thisArg, args[0]); | |
case 2: return func.call(thisArg, args[0], args[1]); | |
case 3: return func.call(thisArg, args[0], args[1], args[2]); | |
} | |
return func.apply(thisArg, args); | |
} | |
/** | |
* A specialized version of `_.forEach` for arrays without support for | |
* iteratee shorthands. | |
* | |
* @private | |
* @param {Array} [array] The array to iterate over. | |
* @param {Function} iteratee The function invoked per iteration. | |
* @returns {Array} Returns `array`. | |
*/ | |
function arrayEach(array, iteratee) { | |
var index = -1, | |
length = array ? array.length : 0; | |
while (++index < length) { | |
if (iteratee(array[index], index, array) === false) { | |
break; | |
} | |
} | |
return array; | |
} | |
/** | |
* Appends the elements of `values` to `array`. | |
* | |
* @private | |
* @param {Array} array The array to modify. | |
* @param {Array} values The values to append. | |
* @returns {Array} Returns `array`. | |
*/ | |
function arrayPush(array, values) { | |
var index = -1, | |
length = values.length, | |
offset = array.length; | |
while (++index < length) { | |
array[offset + index] = values[index]; | |
} | |
return array; | |
} | |
/** | |
* A specialized version of `_.reduce` for arrays without support for | |
* iteratee shorthands. | |
* | |
* @private | |
* @param {Array} [array] The array to iterate over. | |
* @param {Function} iteratee The function invoked per iteration. | |
* @param {*} [accumulator] The initial value. | |
* @param {boolean} [initAccum] Specify using the first element of `array` as | |
* the initial value. | |
* @returns {*} Returns the accumulated value. | |
*/ | |
function arrayReduce(array, iteratee, accumulator, initAccum) { | |
var index = -1, | |
length = array ? array.length : 0; | |
if (initAccum && length) { | |
accumulator = array[++index]; | |
} | |
while (++index < length) { | |
accumulator = iteratee(accumulator, array[index], index, array); | |
} | |
return accumulator; | |
} | |
/** | |
* The base implementation of `_.times` without support for iteratee shorthands | |
* or max array length checks. | |
* | |
* @private | |
* @param {number} n The number of times to invoke `iteratee`. | |
* @param {Function} iteratee The function invoked per iteration. | |
* @returns {Array} Returns the array of results. | |
*/ | |
function baseTimes(n, iteratee) { | |
var index = -1, | |
result = Array(n); | |
while (++index < n) { | |
result[index] = iteratee(index); | |
} | |
return result; | |
} | |
/** | |
* The base implementation of `_.unary` without support for storing metadata. | |
* | |
* @private | |
* @param {Function} func The function to cap arguments for. | |
* @returns {Function} Returns the new capped function. | |
*/ | |
function baseUnary(func) { | |
return function(value) { | |
return func(value); | |
}; | |
} | |
/** | |
* Gets the value at `key` of `object`. | |
* | |
* @private | |
* @param {Object} [object] The object to query. | |
* @param {string} key The key of the property to get. | |
* @returns {*} Returns the property value. | |
*/ | |
function getValue(object, key) { | |
return object == null ? undefined : object[key]; | |
} | |
/** | |
* Checks if `value` is a host object in IE < 9. | |
* | |
* @private | |
* @param {*} value The value to check. | |
* @returns {boolean} Returns `true` if `value` is a host object, else `false`. | |
*/ | |
function isHostObject(value) { | |
// Many host objects are `Object` objects that can coerce to strings | |
// despite having improperly defined `toString` methods. | |
var result = false; | |
if (value != null && typeof value.toString != 'function') { | |
try { | |
result = !!(value + ''); | |
} catch (e) {} | |
} | |
return result; | |
} | |
/** | |
* Converts `map` to its key-value pairs. | |
* | |
* @private | |
* @param {Object} map The map to convert. | |
* @returns {Array} Returns the key-value pairs. | |
*/ | |
function mapToArray(map) { | |
var index = -1, | |
result = Array(map.size); | |
map.forEach(function(value, key) { | |
result[++index] = [key, value]; | |
}); | |
return result; | |
} | |
/** | |
* Creates a unary function that invokes `func` with its argument transformed. | |
* | |
* @private | |
* @param {Function} func The function to wrap. | |
* @param {Function} transform The argument transform. | |
* @returns {Function} Returns the new function. | |
*/ | |
function overArg(func, transform) { | |
return function(arg) { | |
return func(transform(arg)); | |
}; | |
} | |
/** | |
* Converts `set` to an array of its values. | |
* | |
* @private | |
* @param {Object} set The set to convert. | |
* @returns {Array} Returns the values. | |
*/ | |
function setToArray(set) { | |
var index = -1, | |
result = Array(set.size); | |
set.forEach(function(value) { | |
result[++index] = value; | |
}); | |
return result; | |
} | |
/** Used for built-in method references. */ | |
var arrayProto = Array.prototype, | |
funcProto = Function.prototype, | |
objectProto = Object.prototype; | |
/** Used to detect overreaching core-js shims. */ | |
var coreJsData = root['__core-js_shared__']; | |
/** Used to detect methods masquerading as native. */ | |
var maskSrcKey = (function() { | |
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); | |
return uid ? ('Symbol(src)_1.' + uid) : ''; | |
}()); | |
/** Used to resolve the decompiled source of functions. */ | |
var funcToString = funcProto.toString; | |
/** Used to check objects for own properties. */ | |
var hasOwnProperty = objectProto.hasOwnProperty; | |
/** Used to infer the `Object` constructor. */ | |
var objectCtorString = funcToString.call(Object); | |
/** | |
* Used to resolve the | |
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) | |
* of values. | |
*/ | |
var objectToString = objectProto.toString; | |
/** Used to detect if a method is native. */ | |
var reIsNative = RegExp('^' + | |
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') | |
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' | |
); | |
/** Built-in value references. */ | |
var Buffer = moduleExports ? root.Buffer : undefined, | |
Symbol = root.Symbol, | |
Uint8Array = root.Uint8Array, | |
getPrototype = overArg(Object.getPrototypeOf, Object), | |
objectCreate = Object.create, | |
propertyIsEnumerable = objectProto.propertyIsEnumerable, | |
splice = arrayProto.splice; | |
/* Built-in method references for those with the same name as other `lodash` methods. */ | |
var nativeGetSymbols = Object.getOwnPropertySymbols, | |
nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, | |
nativeKeys = overArg(Object.keys, Object), | |
nativeMax = Math.max; | |
/* Built-in method references that are verified to be native. */ | |
var DataView = getNative(root, 'DataView'), | |
Map = getNative(root, 'Map'), | |
Promise = getNative(root, 'Promise'), | |
Set = getNative(root, 'Set'), | |
WeakMap = getNative(root, 'WeakMap'), | |
nativeCreate = getNative(Object, 'create'); | |
/** Used to detect maps, sets, and weakmaps. */ | |
var dataViewCtorString = toSource(DataView), | |
mapCtorString = toSource(Map), | |
promiseCtorString = toSource(Promise), | |
setCtorString = toSource(Set), | |
weakMapCtorString = toSource(WeakMap); | |
/** Used to convert symbols to primitives and strings. */ | |
var symbolProto = Symbol ? Symbol.prototype : undefined, | |
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; | |
/** | |
* Creates a hash object. | |
* | |
* @private | |
* @constructor | |
* @param {Array} [entries] The key-value pairs to cache. | |
*/ | |
function Hash(entries) { | |
var index = -1, | |
length = entries ? entries.length : 0; | |
this.clear(); | |
while (++index < length) { | |
var entry = entries[index]; | |
this.set(entry[0], entry[1]); | |
} | |
} | |
/** | |
* Removes all key-value entries from the hash. | |
* | |
* @private | |
* @name clear | |
* @memberOf Hash | |
*/ | |
function hashClear() { | |
this.__data__ = nativeCreate ? nativeCreate(null) : {}; | |
} | |
/** | |
* Removes `key` and its value from the hash. | |
* | |
* @private | |
* @name delete | |
* @memberOf Hash | |
* @param {Object} hash The hash to modify. | |
* @param {string} key The key of the value to remove. | |
* @returns {boolean} Returns `true` if the entry was removed, else `false`. | |
*/ | |
function hashDelete(key) { | |
return this.has(key) && delete this.__data__[key]; | |
} | |
/** | |
* Gets the hash value for `key`. | |
* | |
* @private | |
* @name get | |
* @memberOf Hash | |
* @param {string} key The key of the value to get. | |
* @returns {*} Returns the entry value. | |
*/ | |
function hashGet(key) { | |
var data = this.__data__; | |
if (nativeCreate) { | |
var result = data[key]; | |
return result === HASH_UNDEFINED ? undefined : result; | |
} | |
return hasOwnProperty.call(data, key) ? data[key] : undefined; | |
} | |
/** | |
* Checks if a hash value for `key` exists. | |
* | |
* @private | |
* @name has | |
* @memberOf Hash | |
* @param {string} key The key of the entry to check. | |
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. | |
*/ | |
function hashHas(key) { | |
var data = this.__data__; | |
return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); | |
} | |
/** | |
* Sets the hash `key` to `value`. | |
* | |
* @private | |
* @name set | |
* @memberOf Hash | |
* @param {string} key The key of the value to set. | |
* @param {*} value The value to set. | |
* @returns {Object} Returns the hash instance. | |
*/ | |
function hashSet(key, value) { | |
var data = this.__data__; | |
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; | |
return this; | |
} | |
// Add methods to `Hash`. | |
Hash.prototype.clear = hashClear; | |
Hash.prototype['delete'] = hashDelete; | |
Hash.prototype.get = hashGet; | |
Hash.prototype.has = hashHas; | |
Hash.prototype.set = hashSet; | |
/** | |
* Creates an list cache object. | |
* | |
* @private | |
* @constructor | |
* @param {Array} [entries] The key-value pairs to cache. | |
*/ | |
function ListCache(entries) { | |
var index = -1, | |
length = entries ? entries.length : 0; | |
this.clear(); | |
while (++index < length) { | |
var entry = entries[index]; | |
this.set(entry[0], entry[1]); | |
} | |
} | |
/** | |
* Removes all key-value entries from the list cache. | |
* | |
* @private | |
* @name clear | |
* @memberOf ListCache | |
*/ | |
function listCacheClear() { | |
this.__data__ = []; | |
} | |
/** | |
* Removes `key` and its value from the list cache. | |
* | |
* @private | |
* @name delete | |
* @memberOf ListCache | |
* @param {string} key The key of the value to remove. | |
* @returns {boolean} Returns `true` if the entry was removed, else `false`. | |
*/ | |
function listCacheDelete(key) { | |
var data = this.__data__, | |
index = assocIndexOf(data, key); | |
if (index < 0) { | |
return false; | |
} | |
var lastIndex = data.length - 1; | |
if (index == lastIndex) { | |
data.pop(); | |
} else { | |
splice.call(data, index, 1); | |
} | |
return true; | |
} | |
/** | |
* Gets the list cache value for `key`. | |
* | |
* @private | |
* @name get | |
* @memberOf ListCache | |
* @param {string} key The key of the value to get. | |
* @returns {*} Returns the entry value. | |
*/ | |
function listCacheGet(key) { | |
var data = this.__data__, | |
index = assocIndexOf(data, key); | |
return index < 0 ? undefined : data[index][1]; | |
} | |
/** | |
* Checks if a list cache value for `key` exists. | |
* | |
* @private | |
* @name has | |
* @memberOf ListCache | |
* @param {string} key The key of the entry to check. | |
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. | |
*/ | |
function listCacheHas(key) { | |
return assocIndexOf(this.__data__, key) > -1; | |
} | |
/** | |
* Sets the list cache `key` to `value`. | |
* | |
* @private | |
* @name set | |
* @memberOf ListCache | |
* @param {string} key The key of the value to set. | |
* @param {*} value The value to set. | |
* @returns {Object} Returns the list cache instance. | |
*/ | |
function listCacheSet(key, value) { | |
var data = this.__data__, | |
index = assocIndexOf(data, key); | |
if (index < 0) { | |
data.push([key, value]); | |
} else { | |
data[index][1] = value; | |
} | |
return this; | |
} | |
// Add methods to `ListCache`. | |
ListCache.prototype.clear = listCacheClear; | |
ListCache.prototype['delete'] = listCacheDelete; | |
ListCache.prototype.get = listCacheGet; | |
ListCache.prototype.has = listCacheHas; | |
ListCache.prototype.set = listCacheSet; | |
/** | |
* 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 ? entries.length : 0; | |
this.clear(); | |
while (++index < length) { | |
var entry = entries[index]; | |
this.set(entry[0], entry[1]); | |
} | |
} | |
/** | |
* Removes all key-value entries from the map. | |
* | |
* @private | |
* @name clear | |
* @memberOf MapCache | |
*/ | |
function mapCacheClear() { | |
this.__data__ = { | |
'hash': new Hash, | |
'map': new (Map || ListCache), | |
'string': new Hash | |
}; | |
} | |
/** | |
* Removes `key` and its value from the map. | |
* | |
* @private | |
* @name delete | |
* @memberOf MapCache | |
* @param {string} key The key of the value to remove. | |
* @returns {boolean} Returns `true` if the entry was removed, else `false`. | |
*/ | |
function mapCacheDelete(key) { | |
return getMapData(this, key)['delete'](key); | |
} | |
/** | |
* Gets the map value for `key`. | |
* | |
* @private | |
* @name get | |
* @memberOf MapCache | |
* @param {string} key The key of the value to get. | |
* @returns {*} Returns the entry value. | |
*/ | |
function mapCacheGet(key) { | |
return getMapData(this, key).get(key); | |
} | |
/** | |
* Checks if a map value for `key` exists. | |
* | |
* @private | |
* @name has | |
* @memberOf MapCache | |
* @param {string} key The key of the entry to check. | |
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. | |
*/ | |
function mapCacheHas(key) { | |
return getMapData(this, key).has(key); | |
} | |
/** | |
* Sets the map `key` to `value`. | |
* | |
* @private | |
* @name set | |
* @memberOf MapCache | |
* @param {string} key The key of the value to set. | |
* @param {*} value The value to set. | |
* @returns {Object} Returns the map cache instance. | |
*/ | |
function mapCacheSet(key, value) { | |
getMapData(this, key).set(key, value); | |
return this; | |
} | |
// Add methods to `MapCache`. | |
MapCache.prototype.clear = mapCacheClear; | |
MapCache.prototype['delete'] = mapCacheDelete; | |
MapCache.prototype.get = mapCacheGet; | |
MapCache.prototype.has = mapCacheHas; | |
MapCache.prototype.set = mapCacheSet; | |
/** | |
* Creates a stack cache object to store key-value pairs. | |
* | |
* @private | |
* @constructor | |
* @param {Array} [entries] The key-value pairs to cache. | |
*/ | |
function Stack(entries) { | |
this.__data__ = new ListCache(entries); | |
} | |
/** | |
* Removes all key-value entries from the stack. | |
* | |
* @private | |
* @name clear | |
* @memberOf Stack | |
*/ | |
function stackClear() { | |
this.__data__ = new ListCache; | |
} | |
/** | |
* Removes `key` and its value from the stack. | |
* | |
* @private | |
* @name delete | |
* @memberOf Stack | |
* @param {string} key The key of the value to remove. | |
* @returns {boolean} Returns `true` if the entry was removed, else `false`. | |
*/ | |
function stackDelete(key) { | |
return this.__data__['delete'](key); | |
} | |
/** | |
* Gets the stack value for `key`. | |
* | |
* @private | |
* @name get | |
* @memberOf Stack | |
* @param {string} key The key of the value to get. | |
* @returns {*} Returns the entry value. | |
*/ | |
function stackGet(key) { | |
return this.__data__.get(key); | |
} | |
/** | |
* Checks if a stack value for `key` exists. | |
* | |
* @private | |
* @name has | |
* @memberOf Stack | |
* @param {string} key The key of the entry to check. | |
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. | |
*/ | |
function stackHas(key) { | |
return this.__data__.has(key); | |
} | |
/** | |
* Sets the stack `key` to `value`. | |
* | |
* @private | |
* @name set | |
* @memberOf Stack | |
* @param {string} key The key of the value to set. | |
* @param {*} value The value to set. | |
* @returns {Object} Returns the stack cache instance. | |
*/ | |
function stackSet(key, value) { | |
var cache = this.__data__; | |
if (cache instanceof ListCache) { | |
var pairs = cache.__data__; | |
if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { | |
pairs.push([key, value]); | |
return this; | |
} | |
cache = this.__data__ = new MapCache(pairs); | |
} | |
cache.set(key, value); | |
return this; | |
} | |
// Add methods to `Stack`. | |
Stack.prototype.clear = stackClear; | |
Stack.prototype['delete'] = stackDelete; | |
Stack.prototype.get = stackGet; | |
Stack.prototype.has = stackHas; | |
Stack.prototype.set = stackSet; | |
/** | |
* Creates an array of the enumerable property names of the array-like `value`. | |
* | |
* @private | |
* @param {*} value The value to query. | |
* @param {boolean} inherited Specify returning inherited property names. | |
* @returns {Array} Returns the array of property names. | |
*/ | |
function arrayLikeKeys(value, inherited) { | |
// Safari 8.1 makes `arguments.callee` enumerable in strict mode. | |
// Safari 9 makes `arguments.length` enumerable in strict mode. | |
var result = (isArray(value) || isArguments(value)) | |
? baseTimes(value.length, String) | |
: []; | |
var length = result.length, | |
skipIndexes = !!length; | |
for (var key in value) { | |
if ((inherited || hasOwnProperty.call(value, key)) && | |
!(skipIndexes && (key == 'length' || isIndex(key, length)))) { | |
result.push(key); | |
} | |
} | |
return result; | |
} | |
/** | |
* This function is like `assignValue` except that it doesn't assign | |
* `undefined` values. | |
* | |
* @private | |
* @param {Object} object The object to modify. | |
* @param {string} key The key of the property to assign. | |
* @param {*} value The value to assign. | |
*/ | |
function assignMergeValue(object, key, value) { | |
if ((value !== undefined && !eq(object[key], value)) || | |
(typeof key == 'number' && value === undefined && !(key in object))) { | |
object[key] = value; | |
} | |
} | |
/** | |
* Assigns `value` to `key` of `object` if the existing value is not equivalent | |
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) | |
* for equality comparisons. | |
* | |
* @private | |
* @param {Object} object The object to modify. | |
* @param {string} key The key of the property to assign. | |
* @param {*} value The value to assign. | |
*/ | |
function assignValue(object, key, value) { | |
var objValue = object[key]; | |
if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || | |
(value === undefined && !(key in object))) { | |
object[key] = value; | |
} | |
} | |
/** | |
* 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`. | |
*/ | |
function assocIndexOf(array, key) { | |
var length = array.length; | |
while (length--) { | |
if (eq(array[length][0], key)) { | |
return length; | |
} | |
} | |
return -1; | |
} | |
/** | |
* The base implementation of `_.assign` without support for multiple sources | |
* or `customizer` functions. | |
* | |
* @private | |
* @param {Object} object The destination object. | |
* @param {Object} source The source object. | |
* @returns {Object} Returns `object`. | |
*/ | |
function baseAssign(object, source) { | |
return object && copyObject(source, keys(source), object); | |
} | |
/** | |
* The base implementation of `_.clone` and `_.cloneDeep` which tracks | |
* traversed objects. | |
* | |
* @private | |
* @param {*} value The value to clone. | |
* @param {boolean} [isDeep] Specify a deep clone. | |
* @param {boolean} [isFull] Specify a clone including symbols. | |
* @param {Function} [customizer] The function to customize cloning. | |
* @param {string} [key] The key of `value`. | |
* @param {Object} [object] The parent object of `value`. | |
* @param {Object} [stack] Tracks traversed objects and their clone counterparts. | |
* @returns {*} Returns the cloned value. | |
*/ | |
function baseClone(value, isDeep, isFull, customizer, key, object, stack) { | |
var result; | |
if (customizer) { | |
result = object ? customizer(value, key, object, stack) : customizer(value); | |
} | |
if (result !== undefined) { | |
return result; | |
} | |
if (!isObject(value)) { | |
return value; | |
} | |
var isArr = isArray(value); | |
if (isArr) { | |
result = initCloneArray(value); | |
if (!isDeep) { | |
return copyArray(value, result); | |
} | |
} else { | |
var tag = getTag(value), | |
isFunc = tag == funcTag || tag == genTag; | |
if (isBuffer(value)) { | |
return cloneBuffer(value, isDeep); | |
} | |
if (tag == objectTag || tag == argsTag || (isFunc && !object)) { | |
if (isHostObject(value)) { | |
return object ? value : {}; | |
} | |
result = initCloneObject(isFunc ? {} : value); | |
if (!isDeep) { | |
return copySymbols(value, baseAssign(result, value)); | |
} | |
} else { | |
if (!cloneableTags[tag]) { | |
return object ? value : {}; | |
} | |
result = initCloneByTag(value, tag, baseClone, isDeep); | |
} | |
} | |
// Check for circular references and return its corresponding clone. | |
stack || (stack = new Stack); | |
var stacked = stack.get(value); | |
if (stacked) { | |
return stacked; | |
} | |
stack.set(value, result); | |
if (!isArr) { | |
var props = isFull ? getAllKeys(value) : keys(value); | |
} | |
arrayEach(props || value, function(subValue, key) { | |
if (props) { | |
key = subValue; | |
subValue = value[key]; | |
} | |
// Recursively populate clone (susceptible to call stack limits). | |
assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack)); | |
}); | |
return result; | |
} | |
/** | |
* The base implementation of `_.create` without support for assigning | |
* properties to the created object. | |
* | |
* @private | |
* @param {Object} prototype The object to inherit from. | |
* @returns {Object} Returns the new object. | |
*/ | |
function baseCreate(proto) { | |
return isObject(proto) ? objectCreate(proto) : {}; | |
} | |
/** | |
* The base implementation of `getAllKeys` and `getAllKeysIn` which uses | |
* `keysFunc` and `symbolsFunc` to get the enumerable property names and | |
* symbols of `object`. | |
* | |
* @private | |
* @param {Object} object The object to query. | |
* @param {Function} keysFunc The function to get the keys of `object`. | |
* @param {Function} symbolsFunc The function to get the symbols of `object`. | |
* @returns {Array} Returns the array of property names and symbols. | |
*/ | |
function baseGetAllKeys(object, keysFunc, symbolsFunc) { | |
var result = keysFunc(object); | |
return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); | |
} | |
/** | |
* The base implementation of `getTag`. | |
* | |
* @private | |
* @param {*} value The value to query. | |
* @returns {string} Returns the `toStringTag`. | |
*/ | |
function baseGetTag(value) { | |
return objectToString.call(value); | |
} | |
/** | |
* The base implementation of `_.isNative` without bad shim checks. | |
* | |
* @private | |
* @param {*} value The value to check. | |
* @returns {boolean} Returns `true` if `value` is a native function, | |
* else `false`. | |
*/ | |
function baseIsNative(value) { | |
if (!isObject(value) || isMasked(value)) { | |
return false; | |
} | |
var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; | |
return pattern.test(toSource(value)); | |
} | |
/** | |
* The base implementation of `_.isTypedArray` without Node.js optimizations. | |
* | |
* @private | |
* @param {*} value The value to check. | |
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`. | |
*/ | |
function baseIsTypedArray(value) { | |
return isObjectLike(value) && | |
isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; | |
} | |
/** | |
* The base implementation of `_.keys` which doesn't treat sparse arrays as dense. | |
* | |
* @private | |
* @param {Object} object The object to query. | |
* @returns {Array} Returns the array of property names. | |
*/ | |
function baseKeys(object) { | |
if (!isPrototype(object)) { | |
return nativeKeys(object); | |
} | |
var result = []; | |
for (var key in Object(object)) { | |
if (hasOwnProperty.call(object, key) && key != 'constructor') { | |
result.push(key); | |
} | |
} | |
return result; | |
} | |
/** | |
* The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. | |
* | |
* @private | |
* @param {Object} object The object to query. | |
* @returns {Array} Returns the array of property names. | |
*/ | |
function baseKeysIn(object) { | |
if (!isObject(object)) { | |
return nativeKeysIn(object); | |
} | |
var isProto = isPrototype(object), | |
result = []; | |
for (var key in object) { | |
if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { | |
result.push(key); | |
} | |
} | |
return result; | |
} | |
/** | |
* The base implementation of `_.merge` without support for multiple sources. | |
* | |
* @private | |
* @param {Object} object The destination object. | |
* @param {Object} source The source object. | |
* @param {number} srcIndex The index of `source`. | |
* @param {Function} [customizer] The function to customize merged values. | |
* @param {Object} [stack] Tracks traversed source values and their merged | |
* counterparts. | |
*/ | |
function baseMerge(object, source, srcIndex, customizer, stack) { | |
if (object === source) { | |
return; | |
} | |
if (!(isArray(source) || isTypedArray(source))) { | |
var props = baseKeysIn(source); | |
} | |
arrayEach(props || source, function(srcValue, key) { | |
if (props) { | |
key = srcValue; | |
srcValue = source[key]; | |
} | |
if (isObject(srcValue)) { | |
stack || (stack = new Stack); | |
baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); | |
} | |
else { | |
var newValue = customizer | |
? customizer(object[key], srcValue, (key + ''), object, source, stack) | |
: undefined; | |
if (newValue === undefined) { | |
newValue = srcValue; | |
} | |
assignMergeValue(object, key, newValue); | |
} | |
}); | |
} | |
/** | |
* A specialized version of `baseMerge` for arrays and objects which performs | |
* deep merges and tracks traversed objects enabling objects with circular | |
* references to be merged. | |
* | |
* @private | |
* @param {Object} object The destination object. | |
* @param {Object} source The source object. | |
* @param {string} key The key of the value to merge. | |
* @param {number} srcIndex The index of `source`. | |
* @param {Function} mergeFunc The function to merge values. | |
* @param {Function} [customizer] The function to customize assigned values. | |
* @param {Object} [stack] Tracks traversed source values and their merged | |
* counterparts. | |
*/ | |
function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { | |
var objValue = object[key], | |
srcValue = source[key], | |
stacked = stack.get(srcValue); | |
if (stacked) { | |
assignMergeValue(object, key, stacked); | |
return; | |
} | |
var newValue = customizer | |
? customizer(objValue, srcValue, (key + ''), object, source, stack) | |
: undefined; | |
var isCommon = newValue === undefined; | |
if (isCommon) { | |
newValue = srcValue; | |
if (isArray(srcValue) || isTypedArray(srcValue)) { | |
if (isArray(objValue)) { | |
newValue = objValue; | |
} | |
else if (isArrayLikeObject(objValue)) { | |
newValue = copyArray(objValue); | |
} | |
else { | |
isCommon = false; | |
newValue = baseClone(srcValue, true); | |
} | |
} | |
else if (isPlainObject(srcValue) || isArguments(srcValue)) { | |
if (isArguments(objValue)) { | |
newValue = toPlainObject(objValue); | |
} | |
else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) { | |
isCommon = false; | |
newValue = baseClone(srcValue, true); | |
} | |
else { | |
newValue = objValue; | |
} | |
} | |
else { | |
isCommon = false; | |
} | |
} | |
if (isCommon) { | |
// Recursively merge objects and arrays (susceptible to call stack limits). | |
stack.set(srcValue, newValue); | |
mergeFunc(newValue, srcValue, srcIndex, customizer, stack); | |
stack['delete'](srcValue); | |
} | |
assignMergeValue(object, key, newValue); | |
} | |
/** | |
* The base implementation of `_.rest` which doesn't validate or coerce arguments. | |
* | |
* @private | |
* @param {Function} func The function to apply a rest parameter to. | |
* @param {number} [start=func.length-1] The start position of the rest parameter. | |
* @returns {Function} Returns the new function. | |
*/ | |
function baseRest(func, start) { | |
start = nativeMax(start === undefined ? (func.length - 1) : start, 0); | |
return function() { | |
var args = arguments, | |
index = -1, | |
length = nativeMax(args.length - start, 0), | |
array = Array(length); | |
while (++index < length) { | |
array[index] = args[start + index]; | |
} | |
index = -1; | |
var otherArgs = Array(start + 1); | |
while (++index < start) { | |
otherArgs[index] = args[index]; | |
} | |
otherArgs[start] = array; | |
return apply(func, this, otherArgs); | |
}; | |
} | |
/** | |
* Creates a clone of `buffer`. | |
* | |
* @private | |
* @param {Buffer} buffer The buffer to clone. | |
* @param {boolean} [isDeep] Specify a deep clone. | |
* @returns {Buffer} Returns the cloned buffer. | |
*/ | |
function cloneBuffer(buffer, isDeep) { | |
if (isDeep) { | |
return buffer.slice(); | |
} | |
var result = new buffer.constructor(buffer.length); | |
buffer.copy(result); | |
return result; | |
} | |
/** | |
* Creates a clone of `arrayBuffer`. | |
* | |
* @private | |
* @param {ArrayBuffer} arrayBuffer The array buffer to clone. | |
* @returns {ArrayBuffer} Returns the cloned array buffer. | |
*/ | |
function cloneArrayBuffer(arrayBuffer) { | |
var result = new arrayBuffer.constructor(arrayBuffer.byteLength); | |
new Uint8Array(result).set(new Uint8Array(arrayBuffer)); | |
return result; | |
} | |
/** | |
* Creates a clone of `dataView`. | |
* | |
* @private | |
* @param {Object} dataView The data view to clone. | |
* @param {boolean} [isDeep] Specify a deep clone. | |
* @returns {Object} Returns the cloned data view. | |
*/ | |
function cloneDataView(dataView, isDeep) { | |
var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; | |
return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); | |
} | |
/** | |
* Creates a clone of `map`. | |
* | |
* @private | |
* @param {Object} map The map to clone. | |
* @param {Function} cloneFunc The function to clone values. | |
* @param {boolean} [isDeep] Specify a deep clone. | |
* @returns {Object} Returns the cloned map. | |
*/ | |
function cloneMap(map, isDeep, cloneFunc) { | |
var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map); | |
return arrayReduce(array, addMapEntry, new map.constructor); | |
} | |
/** | |
* Creates a clone of `regexp`. | |
* | |
* @private | |
* @param {Object} regexp The regexp to clone. | |
* @returns {Object} Returns the cloned regexp. | |
*/ | |
function cloneRegExp(regexp) { | |
var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); | |
result.lastIndex = regexp.lastIndex; | |
return result; | |
} | |
/** | |
* Creates a clone of `set`. | |
* | |
* @private | |
* @param {Object} set The set to clone. | |
* @param {Function} cloneFunc The function to clone values. | |
* @param {boolean} [isDeep] Specify a deep clone. | |
* @returns {Object} Returns the cloned set. | |
*/ | |
function cloneSet(set, isDeep, cloneFunc) { | |
var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set); | |
return arrayReduce(array, addSetEntry, new set.constructor); | |
} | |
/** | |
* Creates a clone of the `symbol` object. | |
* | |
* @private | |
* @param {Object} symbol The symbol object to clone. | |
* @returns {Object} Returns the cloned symbol object. | |
*/ | |
function cloneSymbol(symbol) { | |
return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; | |
} | |
/** | |
* Creates a clone of `typedArray`. | |
* | |
* @private | |
* @param {Object} typedArray The typed array to clone. | |
* @param {boolean} [isDeep] Specify a deep clone. | |
* @returns {Object} Returns the cloned typed array. | |
*/ | |
function cloneTypedArray(typedArray, isDeep) { | |
var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; | |
return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); | |
} | |
/** | |
* Copies the values of `source` to `array`. | |
* | |
* @private | |
* @param {Array} source The array to copy values from. | |
* @param {Array} [array=[]] The array to copy values to. | |
* @returns {Array} Returns `array`. | |
*/ | |
function copyArray(source, array) { | |
var index = -1, | |
length = source.length; | |
array || (array = Array(length)); | |
while (++index < length) { | |
array[index] = source[index]; | |
} | |
return array; | |
} | |
/** | |
* Copies properties of `source` to `object`. | |
* | |
* @private | |
* @param {Object} source The object to copy properties from. | |
* @param {Array} props The property identifiers to copy. | |
* @param {Object} [object={}] The object to copy properties to. | |
* @param {Function} [customizer] The function to customize copied values. | |
* @returns {Object} Returns `object`. | |
*/ | |
function copyObject(source, props, object, customizer) { | |
object || (object = {}); | |
var index = -1, | |
length = props.length; | |
while (++index < length) { | |
var key = props[index]; | |
var newValue = customizer | |
? customizer(object[key], source[key], key, object, source) | |
: undefined; | |
assignValue(object, key, newValue === undefined ? source[key] : newValue); | |
} | |
return object; | |
} | |
/** | |
* Copies own symbol properties of `source` to `object`. | |
* | |
* @private | |
* @param {Object} source The object to copy symbols from. | |
* @param {Object} [object={}] The object to copy symbols to. | |
* @returns {Object} Returns `object`. | |
*/ | |
function copySymbols(source, object) { | |
return copyObject(source, getSymbols(source), object); | |
} | |
/** | |
* Creates a function like `_.assign`. | |
* | |
* @private | |
* @param {Function} assigner The function to assign values. | |
* @returns {Function} Returns the new assigner function. | |
*/ | |
function createAssigner(assigner) { | |
return baseRest(function(object, sources) { | |
var index = -1, | |
length = sources.length, | |
customizer = length > 1 ? sources[length - 1] : undefined, | |
guard = length > 2 ? sources[2] : undefined; | |
customizer = (assigner.length > 3 && typeof customizer == 'function') | |
? (length--, customizer) | |
: undefined; | |
if (guard && isIterateeCall(sources[0], sources[1], guard)) { | |
customizer = length < 3 ? undefined : customizer; | |
length = 1; | |
} | |
object = Object(object); | |
while (++index < length) { | |
var source = sources[index]; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment