From 1d3201835c3785b7d9814fdb10693a8504fe6840 Mon Sep 17 00:00:00 2001 From: Wei Zhu Date: Thu, 8 Feb 2018 16:52:09 +0800 Subject: Updates --- common.js | 2435 +++++++++++++++++----------------- common.js.map | 2 +- examples/12hours.html | 5 +- examples/12hours.js | 3 +- examples/12hours.js.map | 2 +- examples/disabled.html | 4 +- examples/format.html | 4 +- examples/hidden.html | 4 +- examples/open.html | 4 +- examples/open.js | 6 +- examples/pick-time.html | 4 +- examples/step.html | 4 +- examples/value-and-defaultValue.html | 4 +- examples/value-and-defaultValue.js | 6 +- index.html | 10 +- 15 files changed, 1271 insertions(+), 1226 deletions(-) diff --git a/common.js b/common.js index 7ee2506..8d230d4 100644 --- a/common.js +++ b/common.js @@ -163,7 +163,7 @@ if (process.env.NODE_ENV === 'production') { module.exports = __webpack_require__(169); } -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) /***/ }), /* 1 */ @@ -209,7 +209,7 @@ if (process.env.NODE_ENV === 'production') { module.exports = __webpack_require__(167); } -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) /***/ }), /* 2 */ @@ -233,39 +233,6 @@ exports.default = function (instance, Constructor) { "use strict"; -exports.__esModule = true; - -var _defineProperty = __webpack_require__(51); - -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__) { - -"use strict"; - - exports.__esModule = true; var _setPrototypeOf = __webpack_require__(96); @@ -299,7 +266,7 @@ exports.default = function (subClass, superClass) { }; /***/ }), -/* 5 */ +/* 4 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -322,7 +289,7 @@ exports.default = function (self, call) { }; /***/ }), -/* 6 */ +/* 5 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -354,10 +321,10 @@ if (process.env.NODE_ENV !== 'production') { module.exports = __webpack_require__(153)(); } -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) /***/ }), -/* 7 */ +/* 6 */ /***/ (function(module, exports) { // shim for using process in browser @@ -546,12 +513,45 @@ process.chdir = function (dir) { process.umask = function() { return 0; }; +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _defineProperty = __webpack_require__(51); + +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; + }; +}(); + /***/ }), /* 8 */ /***/ (function(module, exports) { //! moment.js -//! version : 2.19.2 +//! version : 2.20.1 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! momentjs.com @@ -1211,7 +1211,7 @@ var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123 // any word (or two) characters or numbers including two/three word month in arabic. // includes scottish gaelic two word and hyphenated months -var matchWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i; +var matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i; var regexes = {}; @@ -2581,7 +2581,7 @@ function currentDateArray(config) { // note: all values past the year are optional and will default to the lowest possible value. // [year, month, day , hour, minute, second, millisecond] function configFromArray (config) { - var i, date, input = [], currentDate, yearToUse; + var i, date, input = [], currentDate, expectedWeekday, yearToUse; if (config._d) { return; @@ -2631,6 +2631,8 @@ function configFromArray (config) { } config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input); + expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay(); + // Apply timezone offset from input. The actual utcOffset can be changed // with parseZone. if (config._tzm != null) { @@ -2642,7 +2644,7 @@ function configFromArray (config) { } // check for mismatching day of week - if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== config._d.getDay()) { + if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== expectedWeekday) { getParsingFlags(config).weekdayMismatch = true; } } @@ -3850,19 +3852,24 @@ function toString () { return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ'); } -function toISOString() { +function toISOString(keepOffset) { if (!this.isValid()) { return null; } - var m = this.clone().utc(); + var utc = keepOffset !== true; + var m = utc ? this.clone().utc() : this; if (m.year() < 0 || m.year() > 9999) { - return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]'); + return formatMoment(m, utc ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ'); } if (isFunction(Date.prototype.toISOString)) { // native implementation is ~50x faster, use it when we can - return this.toDate().toISOString(); + if (utc) { + return this.toDate().toISOString(); + } else { + return new Date(this._d.valueOf()).toISOString().replace('Z', formatMoment(m, 'Z')); + } } - return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]'); + return formatMoment(m, utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ'); } /** @@ -4218,7 +4225,7 @@ addRegexToken('Do', function (isStrict, locale) { addParseToken(['D', 'DD'], DATE); addParseToken('Do', function (input, array) { - array[DATE] = toInt(input.match(match1to2)[0], 10); + array[DATE] = toInt(input.match(match1to2)[0]); }); // MOMENTS @@ -5030,7 +5037,7 @@ addParseToken('x', function (input, array, config) { // Side effect imports -hooks.version = '2.19.2'; +hooks.version = '2.20.1'; setHookCallback(createLocal); @@ -5062,6 +5069,19 @@ hooks.relativeTimeThreshold = getSetRelativeTimeThreshold; hooks.calendarFormat = getCalendarFormat; hooks.prototype = proto; +// currently HTML5 input type only supports 24-hour formats +hooks.HTML5_FMT = { + DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm', // + DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss', // + DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS', // + DATE: 'YYYY-MM-DD', // + TIME: 'HH:mm', // + TIME_SECONDS: 'HH:mm:ss', // + TIME_MS: 'HH:mm:ss.SSS', // + WEEK: 'YYYY-[W]WW', // + MONTH: 'YYYY-MM' // +}; + return hooks; }))); @@ -5140,7 +5160,7 @@ module.exports = emptyFunction; /* 13 */ /***/ (function(module, exports) { -var core = module.exports = { version: '2.5.1' }; +var core = module.exports = { version: '2.5.3' }; if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef @@ -5149,7 +5169,7 @@ if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef /***/ (function(module, exports, __webpack_require__) { // Thank's IE8 for his funny defineProperty -module.exports = !__webpack_require__(26)(function () { +module.exports = !__webpack_require__(27)(function () { return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; }); @@ -5168,7 +5188,7 @@ module.exports = function (it, key) { /* 16 */ /***/ (function(module, exports, __webpack_require__) { -var anObject = __webpack_require__(25); +var anObject = __webpack_require__(26); var IE8_DOM_DEFINE = __webpack_require__(57); var toPrimitive = __webpack_require__(46); var dP = Object.defineProperty; @@ -5366,6 +5386,15 @@ module.exports = __webpack_require__(14) ? function (object, key, value) { /***/ }), /* 20 */ +/***/ (function(module, exports) { + +module.exports = function (it) { + return typeof it === 'object' ? it !== null : typeof it === 'function'; +}; + + +/***/ }), +/* 21 */ /***/ (function(module, exports, __webpack_require__) { // to indexed object, toObject with fallback for non-array-like ES3 strings @@ -5377,7 +5406,7 @@ module.exports = function (it) { /***/ }), -/* 21 */ +/* 22 */ /***/ (function(module, exports, __webpack_require__) { var store = __webpack_require__(44)('wks'); @@ -5394,7 +5423,7 @@ $exports.store = store; /***/ }), -/* 22 */ +/* 23 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -5407,8 +5436,12 @@ var RE_NUM = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source; var getComputedStyleX = void 0; -function force(x, y) { - return x + y; +// https://stackoverflow.com/a/3485654/3040605 +function forceRelayout(elem) { + var originalStyle = elem.style.display; + elem.style.display = 'none'; + elem.offsetHeight; // eslint-disable-line + elem.style.display = originalStyle; } function css(el, name, v) { @@ -5643,6 +5676,8 @@ function setLeftTop(elem, offset, option) { elem.style[oppositeVerticalProperty] = ''; elem.style[verticalProperty] = presetV + 'px'; } + // force relayout + forceRelayout(elem); var old = getOffset(elem); var originalStyle = {}; for (var key in offset) { @@ -5659,7 +5694,7 @@ function setLeftTop(elem, offset, option) { } css(elem, originalStyle); // force relayout - force(elem.offsetTop, elem.offsetLeft); + forceRelayout(elem); if ('left' in offset || 'top' in offset) { __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__propertyUtils__["b" /* setTransitionProperty */])(elem, originalTransition); } @@ -5965,7 +6000,7 @@ mix(utils, domUtils); /* harmony default export */ __webpack_exports__["a"] = (utils); /***/ }), -/* 23 */ +/* 24 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6022,10 +6057,10 @@ function invariant(condition, format, a, b, c, d, e, f) { } module.exports = invariant; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) /***/ }), -/* 24 */ +/* 25 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6054,10 +6089,10 @@ exports.default = _assign2.default || function (target) { }; /***/ }), -/* 25 */ +/* 26 */ /***/ (function(module, exports, __webpack_require__) { -var isObject = __webpack_require__(27); +var isObject = __webpack_require__(20); module.exports = function (it) { if (!isObject(it)) throw TypeError(it + ' is not an object!'); return it; @@ -6065,7 +6100,7 @@ module.exports = function (it) { /***/ }), -/* 26 */ +/* 27 */ /***/ (function(module, exports) { module.exports = function (exec) { @@ -6077,15 +6112,6 @@ module.exports = function (exec) { }; -/***/ }), -/* 27 */ -/***/ (function(module, exports) { - -module.exports = function (it) { - return typeof it === 'object' ? it !== null : typeof it === 'function'; -}; - - /***/ }), /* 28 */ /***/ (function(module, exports, __webpack_require__) { @@ -6108,7 +6134,7 @@ if (process.env.NODE_ENV !== 'production') { } module.exports = emptyObject; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) /***/ }), /* 29 */ @@ -6177,7 +6203,7 @@ if (process.env.NODE_ENV !== 'production') { } module.exports = warning; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) /***/ }), /* 30 */ @@ -6321,7 +6347,7 @@ module.exports = true; /***/ (function(module, exports, __webpack_require__) { // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) -var anObject = __webpack_require__(25); +var anObject = __webpack_require__(26); var dPs = __webpack_require__(117); var enumBugKeys = __webpack_require__(37); var IE_PROTO = __webpack_require__(43)('IE_PROTO'); @@ -6376,7 +6402,7 @@ exports.f = Object.getOwnPropertySymbols; var def = __webpack_require__(16).f; var has = __webpack_require__(15); -var TAG = __webpack_require__(21)('toStringTag'); +var TAG = __webpack_require__(22)('toStringTag'); module.exports = function (it, tag, stat) { if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag }); @@ -6423,7 +6449,7 @@ module.exports = function (it) { /***/ (function(module, exports, __webpack_require__) { // 7.1.1 ToPrimitive(input [, PreferredType]) -var isObject = __webpack_require__(27); +var isObject = __webpack_require__(20); // 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) { @@ -6455,7 +6481,7 @@ module.exports = function (name) { /* 48 */ /***/ (function(module, exports, __webpack_require__) { -exports.f = __webpack_require__(21); +exports.f = __webpack_require__(22); /***/ }), @@ -6473,7 +6499,7 @@ exports.f = __webpack_require__(21); if (process.env.NODE_ENV !== 'production') { - var invariant = __webpack_require__(23); + var invariant = __webpack_require__(24); var warning = __webpack_require__(29); var ReactPropTypesSecret = __webpack_require__(50); var loggedTypeFailures = {}; @@ -6523,7 +6549,7 @@ function checkPropTypes(typeSpecs, values, location, componentName, getStack) { module.exports = checkPropTypes; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) /***/ }), /* 50 */ @@ -6658,7 +6684,7 @@ module.exports = function (fn, that, length) { /* 56 */ /***/ (function(module, exports, __webpack_require__) { -var isObject = __webpack_require__(27); +var isObject = __webpack_require__(20); var document = __webpack_require__(10).document; // typeof document.createElement is 'object' in old IE var is = isObject(document) && isObject(document.createElement); @@ -6671,7 +6697,7 @@ module.exports = function (it) { /* 57 */ /***/ (function(module, exports, __webpack_require__) { -module.exports = !__webpack_require__(14) && !__webpack_require__(26)(function () { +module.exports = !__webpack_require__(14) && !__webpack_require__(27)(function () { return Object.defineProperty(__webpack_require__(56)('div'), 'a', { get: function () { return 7; } }).a != 7; }); @@ -6703,7 +6729,7 @@ var Iterators = __webpack_require__(38); var $iterCreate = __webpack_require__(113); var setToStringTag = __webpack_require__(42); var getPrototypeOf = __webpack_require__(119); -var ITERATOR = __webpack_require__(21)('iterator'); +var ITERATOR = __webpack_require__(22)('iterator'); var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next` var FF_ITERATOR = '@@iterator'; var KEYS = 'keys'; @@ -6725,7 +6751,7 @@ module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCE var VALUES_BUG = false; var proto = Base.prototype; var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]; - var $default = $native || getMethod(DEFAULT); + var $default = (!BUGGY && $native) || getMethod(DEFAULT); var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined; var $anyNative = NAME == 'Array' ? proto.entries || $native : $native; var methods, key, IteratorPrototype; @@ -6771,7 +6797,7 @@ module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCE var pIE = __webpack_require__(32); var createDesc = __webpack_require__(33); -var toIObject = __webpack_require__(20); +var toIObject = __webpack_require__(21); var toPrimitive = __webpack_require__(46); var has = __webpack_require__(15); var IE8_DOM_DEFINE = __webpack_require__(57); @@ -6805,7 +6831,7 @@ exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { /***/ (function(module, exports, __webpack_require__) { var has = __webpack_require__(15); -var toIObject = __webpack_require__(20); +var toIObject = __webpack_require__(21); var arrayIndexOf = __webpack_require__(109)(false); var IE_PROTO = __webpack_require__(43)('IE_PROTO'); @@ -6846,7 +6872,7 @@ module.exports = function (it) { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(22); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(23); /** @@ -6972,7 +6998,7 @@ var EventListener = { }; module.exports = EventListener; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) /***/ }), /* 67 */ @@ -7235,17 +7261,14 @@ var util = { /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_objectWithoutProperties___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_objectWithoutProperties__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_createClass__ = __webpack_require__(3); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_createClass___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_createClass__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(5); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__ = __webpack_require__(4); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_react__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_prop_types__ = __webpack_require__(6); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_prop_types__); - +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(4); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits__ = __webpack_require__(3); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_react__ = __webpack_require__(0); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_react__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_prop_types__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_prop_types__); @@ -7254,46 +7277,42 @@ var util = { var LazyRenderBox = function (_Component) { - __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default()(LazyRenderBox, _Component); + __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits___default()(LazyRenderBox, _Component); function LazyRenderBox() { __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck___default()(this, LazyRenderBox); - return __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default()(this, (LazyRenderBox.__proto__ || Object.getPrototypeOf(LazyRenderBox)).apply(this, arguments)); + return __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn___default()(this, _Component.apply(this, arguments)); } - __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_createClass___default()(LazyRenderBox, [{ - key: 'shouldComponentUpdate', - value: function shouldComponentUpdate(nextProps) { - return nextProps.hiddenClassName || nextProps.visible; - } - }, { - key: 'render', - value: function render() { - var _props = this.props, - hiddenClassName = _props.hiddenClassName, - visible = _props.visible, - props = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_objectWithoutProperties___default()(_props, ['hiddenClassName', 'visible']); + LazyRenderBox.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) { + return nextProps.hiddenClassName || nextProps.visible; + }; - if (hiddenClassName || __WEBPACK_IMPORTED_MODULE_5_react___default.a.Children.count(props.children) > 1) { - if (!visible && hiddenClassName) { - props.className += ' ' + hiddenClassName; - } - return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement('div', props); - } + LazyRenderBox.prototype.render = function render() { + var _props = this.props, + hiddenClassName = _props.hiddenClassName, + visible = _props.visible, + props = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_objectWithoutProperties___default()(_props, ['hiddenClassName', 'visible']); - return __WEBPACK_IMPORTED_MODULE_5_react___default.a.Children.only(props.children); + if (hiddenClassName || __WEBPACK_IMPORTED_MODULE_4_react___default.a.Children.count(props.children) > 1) { + if (!visible && hiddenClassName) { + props.className += ' ' + hiddenClassName; + } + return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('div', props); } - }]); + + return __WEBPACK_IMPORTED_MODULE_4_react___default.a.Children.only(props.children); + }; return LazyRenderBox; -}(__WEBPACK_IMPORTED_MODULE_5_react__["Component"]); +}(__WEBPACK_IMPORTED_MODULE_4_react__["Component"]); LazyRenderBox.propTypes = { - children: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.any, - className: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.string, - visible: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool, - hiddenClassName: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.string + children: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.any, + className: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string, + visible: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.bool, + hiddenClassName: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string }; @@ -7307,7 +7326,7 @@ LazyRenderBox.propTypes = { /* harmony export (immutable) */ __webpack_exports__["b"] = getAlignFromPlacement; /* harmony export (immutable) */ __webpack_exports__["a"] = getPopupClassNameFromAlign; /* harmony export (immutable) */ __webpack_exports__["c"] = saveRef; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(24); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(25); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__); function isPointsEq(a1, a2) { @@ -7337,34 +7356,24 @@ function saveRef(name, component) { /***/ }), /* 75 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = addEventListenerWrap; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_add_dom_event_listener__ = __webpack_require__(86); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_add_dom_event_listener___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_add_dom_event_listener__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react_dom__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react_dom___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_react_dom__); -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports['default'] = addEventListenerWrap; - -var _addDomEventListener = __webpack_require__(86); - -var _addDomEventListener2 = _interopRequireDefault(_addDomEventListener); - -var _reactDom = __webpack_require__(1); - -var _reactDom2 = _interopRequireDefault(_reactDom); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function addEventListenerWrap(target, eventType, cb) { /* eslint camelcase: 2 */ - var callback = _reactDom2['default'].unstable_batchedUpdates ? function run(e) { - _reactDom2['default'].unstable_batchedUpdates(cb, e); + var callback = __WEBPACK_IMPORTED_MODULE_1_react_dom___default.a.unstable_batchedUpdates ? function run(e) { + __WEBPACK_IMPORTED_MODULE_1_react_dom___default.a.unstable_batchedUpdates(cb, e); } : cb; - return (0, _addDomEventListener2['default'])(target, eventType, callback); + return __WEBPACK_IMPORTED_MODULE_0_add_dom_event_listener___default()(target, eventType, callback); } -module.exports = exports['default']; /***/ }), /* 76 */, @@ -7772,15 +7781,15 @@ module.exports = exports['default']; "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_createClass__ = __webpack_require__(3); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_createClass__ = __webpack_require__(7); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_createClass___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_createClass__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(4); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits__ = __webpack_require__(4); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_react__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_react__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_prop_types__ = __webpack_require__(6); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_prop_types__ = __webpack_require__(5); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_prop_types__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__Select__ = __webpack_require__(90); @@ -8042,15 +8051,15 @@ Combobox.propTypes = { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_createClass__ = __webpack_require__(3); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_createClass__ = __webpack_require__(7); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_createClass___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_createClass__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(4); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits__ = __webpack_require__(4); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_react__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_react__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_prop_types__ = __webpack_require__(6); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_prop_types__ = __webpack_require__(5); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_prop_types__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_moment__ = __webpack_require__(8); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_moment___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_moment__); @@ -8134,7 +8143,8 @@ var Header = function (_Component) { value: function getInput() { var _props2 = this.props, prefixCls = _props2.prefixCls, - placeholder = _props2.placeholder; + placeholder = _props2.placeholder, + inputReadOnly = _props2.inputReadOnly; var _state = this.state, invalid = _state.invalid, str = _state.str; @@ -8146,7 +8156,8 @@ var Header = function (_Component) { onKeyDown: this.onKeyDown, value: str, placeholder: placeholder, - onChange: this.onInputChange + onChange: this.onInputChange, + readOnly: !!inputReadOnly }); } }, { @@ -8173,6 +8184,7 @@ Header.propTypes = { placeholder: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string, clearText: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string, value: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.object, + inputReadOnly: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.bool, hourOptions: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.array, minuteOptions: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.array, secondOptions: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.array, @@ -8188,6 +8200,9 @@ Header.propTypes = { focusOnOpen: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.bool, onKeyDown: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func }; +Header.defaultProps = { + inputReadOnly: false +}; var _initialiseProps = function _initialiseProps() { var _this3 = this; @@ -8295,15 +8310,15 @@ var _initialiseProps = function _initialiseProps() { /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_defineProperty___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_defineProperty__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_createClass__ = __webpack_require__(3); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_createClass__ = __webpack_require__(7); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_createClass___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_createClass__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(4); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__ = __webpack_require__(4); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_react__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_prop_types__ = __webpack_require__(6); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_prop_types__ = __webpack_require__(5); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_prop_types__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__Header__ = __webpack_require__(88); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__Combobox__ = __webpack_require__(87); @@ -8407,7 +8422,8 @@ var Panel = function (_Component) { onKeyDown = _props.onKeyDown, hourStep = _props.hourStep, minuteStep = _props.minuteStep, - secondStep = _props.secondStep; + secondStep = _props.secondStep, + inputReadOnly = _props.inputReadOnly; var _state = this.state, value = _state.value, currentSelectPanel = _state.currentSelectPanel; @@ -8441,7 +8457,8 @@ var Panel = function (_Component) { onClear: onClear, allowEmpty: allowEmpty, focusOnOpen: focusOnOpen, - onKeyDown: onKeyDown + onKeyDown: onKeyDown, + inputReadOnly: inputReadOnly }), __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_8__Combobox__["a" /* default */], { prefixCls: prefixCls, @@ -8477,6 +8494,7 @@ Panel.propTypes = { value: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.object, placeholder: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.string, format: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.string, + inputReadOnly: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool, disabledHours: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.func, disabledMinutes: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.func, disabledSeconds: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.func, @@ -8506,7 +8524,8 @@ Panel.defaultProps = { defaultOpenValue: __WEBPACK_IMPORTED_MODULE_9_moment___default()(), use12Hours: false, addon: noop, - onKeyDown: noop + onKeyDown: noop, + inputReadOnly: false }; @@ -8521,15 +8540,15 @@ Panel.defaultProps = { /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_defineProperty___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_defineProperty__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_createClass__ = __webpack_require__(3); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_createClass__ = __webpack_require__(7); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_createClass___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_createClass__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(4); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__ = __webpack_require__(4); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_react__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_prop_types__ = __webpack_require__(6); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_prop_types__ = __webpack_require__(5); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_prop_types__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_react_dom__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_react_dom___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_react_dom__); @@ -8708,15 +8727,15 @@ Select.propTypes = { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_createClass__ = __webpack_require__(3); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_createClass__ = __webpack_require__(7); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_createClass___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_createClass__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(4); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits__ = __webpack_require__(4); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_react__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_react__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_prop_types__ = __webpack_require__(6); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_prop_types__ = __webpack_require__(5); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_prop_types__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_rc_trigger__ = __webpack_require__(163); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__Panel__ = __webpack_require__(89); @@ -8827,6 +8846,7 @@ var Picker = function (_Component) { disabledMinutes = _props2.disabledMinutes, disabledSeconds = _props2.disabledSeconds, hideDisabledOptions = _props2.hideDisabledOptions, + inputReadOnly = _props2.inputReadOnly, allowEmpty = _props2.allowEmpty, showHour = _props2.showHour, showMinute = _props2.showMinute, @@ -8846,6 +8866,7 @@ var Picker = function (_Component) { prefixCls: prefixCls + '-panel', ref: this.savePanelRef, value: this.state.value, + inputReadOnly: inputReadOnly, onChange: this.onPanelChange, onClear: this.onPanelClear, defaultOpenValue: defaultOpenValue, @@ -8999,6 +9020,7 @@ Picker.propTypes = { clearText: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string, value: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.object, defaultOpenValue: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.object, + inputReadOnly: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.bool, disabled: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.bool, allowEmpty: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.bool, defaultValue: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.object, @@ -9040,6 +9062,7 @@ Picker.defaultProps = { clearText: 'clear', prefixCls: 'rc-time-picker', defaultOpen: false, + inputReadOnly: false, style: {}, className: '', popupClassName: '', @@ -9474,7 +9497,7 @@ module.exports = function () { /* empty */ }; // false -> Array#indexOf // true -> Array#includes -var toIObject = __webpack_require__(20); +var toIObject = __webpack_require__(21); var toLength = __webpack_require__(123); var toAbsoluteIndex = __webpack_require__(122); module.exports = function (IS_INCLUDES) { @@ -9549,7 +9572,7 @@ var setToStringTag = __webpack_require__(42); var IteratorPrototype = {}; // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() -__webpack_require__(19)(IteratorPrototype, __webpack_require__(21)('iterator'), function () { return this; }); +__webpack_require__(19)(IteratorPrototype, __webpack_require__(22)('iterator'), function () { return this; }); module.exports = function (Constructor, NAME, next) { Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) }); @@ -9571,14 +9594,14 @@ module.exports = function (done, value) { /***/ (function(module, exports, __webpack_require__) { var META = __webpack_require__(34)('meta'); -var isObject = __webpack_require__(27); +var isObject = __webpack_require__(20); var has = __webpack_require__(15); var setDesc = __webpack_require__(16).f; var id = 0; var isExtensible = Object.isExtensible || function () { return true; }; -var FREEZE = !__webpack_require__(26)(function () { +var FREEZE = !__webpack_require__(27)(function () { return isExtensible(Object.preventExtensions({})); }); var setMeta = function (it) { @@ -9640,7 +9663,7 @@ var IObject = __webpack_require__(58); var $assign = Object.assign; // should work with symbols and should have deterministic property order (V8 bug) -module.exports = !$assign || __webpack_require__(26)(function () { +module.exports = !$assign || __webpack_require__(27)(function () { var A = {}; var B = {}; // eslint-disable-next-line no-undef @@ -9671,7 +9694,7 @@ module.exports = !$assign || __webpack_require__(26)(function () { /***/ (function(module, exports, __webpack_require__) { var dP = __webpack_require__(16); -var anObject = __webpack_require__(25); +var anObject = __webpack_require__(26); var getKeys = __webpack_require__(31); module.exports = __webpack_require__(14) ? Object.defineProperties : function defineProperties(O, Properties) { @@ -9690,7 +9713,7 @@ module.exports = __webpack_require__(14) ? Object.defineProperties : function de /***/ (function(module, exports, __webpack_require__) { // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window -var toIObject = __webpack_require__(20); +var toIObject = __webpack_require__(21); var gOPN = __webpack_require__(61).f; var toString = {}.toString; @@ -9735,8 +9758,8 @@ module.exports = Object.getPrototypeOf || function (O) { // Works with __proto__ only. Old v8 can't work with null proto objects. /* eslint-disable no-proto */ -var isObject = __webpack_require__(27); -var anObject = __webpack_require__(25); +var isObject = __webpack_require__(20); +var anObject = __webpack_require__(26); var check = function (O, proto) { anObject(O); if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!"); @@ -9817,7 +9840,7 @@ module.exports = function (it) { var addToUnscopables = __webpack_require__(108); var step = __webpack_require__(114); var Iterators = __webpack_require__(38); -var toIObject = __webpack_require__(20); +var toIObject = __webpack_require__(21); // 22.1.3.4 Array.prototype.entries() // 22.1.3.13 Array.prototype.keys() @@ -9929,17 +9952,18 @@ var DESCRIPTORS = __webpack_require__(14); var $export = __webpack_require__(18); var redefine = __webpack_require__(63); var META = __webpack_require__(115).KEY; -var $fails = __webpack_require__(26); +var $fails = __webpack_require__(27); var shared = __webpack_require__(44); var setToStringTag = __webpack_require__(42); var uid = __webpack_require__(34); -var wks = __webpack_require__(21); +var wks = __webpack_require__(22); var wksExt = __webpack_require__(48); var wksDefine = __webpack_require__(47); var enumKeys = __webpack_require__(110); var isArray = __webpack_require__(112); -var anObject = __webpack_require__(25); -var toIObject = __webpack_require__(20); +var anObject = __webpack_require__(26); +var isObject = __webpack_require__(20); +var toIObject = __webpack_require__(21); var toPrimitive = __webpack_require__(46); var createDesc = __webpack_require__(33); var _create = __webpack_require__(40); @@ -10131,15 +10155,14 @@ $JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () { 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]; var i = 1; var 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); + $replacer = replacer = args[1]; + if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined + if (!isArray(replacer)) replacer = function (key, value) { + if (typeof $replacer == 'function') value = $replacer.call(this, key, value); if (!isSymbol(value)) return value; }; args[1] = replacer; @@ -10179,7 +10202,7 @@ __webpack_require__(124); var global = __webpack_require__(10); var hide = __webpack_require__(19); var Iterators = __webpack_require__(38); -var TO_STRING_TAG = __webpack_require__(21)('toStringTag'); +var TO_STRING_TAG = __webpack_require__(22)('toStringTag'); var DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' + 'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' + @@ -10214,7 +10237,7 @@ for (var i = 0; i < DOMIterables.length; i++) { var _assign = __webpack_require__(17); var emptyObject = __webpack_require__(28); -var _invariant = __webpack_require__(23); +var _invariant = __webpack_require__(24); if (process.env.NODE_ENV !== 'production') { var warning = __webpack_require__(29); @@ -10473,6 +10496,27 @@ function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) { */ componentWillUnmount: 'DEFINE_MANY', + /** + * Replacement for (deprecated) `componentWillMount`. + * + * @optional + */ + UNSAFE_componentWillMount: 'DEFINE_MANY', + + /** + * Replacement for (deprecated) `componentWillReceiveProps`. + * + * @optional + */ + UNSAFE_componentWillReceiveProps: 'DEFINE_MANY', + + /** + * Replacement for (deprecated) `componentWillUpdate`. + * + * @optional + */ + UNSAFE_componentWillUpdate: 'DEFINE_MANY', + // ==== Advanced methods ==== /** @@ -10488,6 +10532,23 @@ function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) { updateComponent: 'OVERRIDE_BASE' }; + /** + * Similar to ReactClassInterface but for static methods. + */ + var ReactClassStaticInterface = { + /** + * This method is invoked after a component is instantiated and when it + * receives new props. Return an object to update state in response to + * prop changes. Return null to indicate no change to state. + * + * If an object is returned, its keys will be merged into the existing state. + * + * @return {object || null} + * @optional + */ + getDerivedStateFromProps: 'DEFINE_MANY_MERGED' + }; + /** * Mapping from class specification keys to special processing functions. * @@ -10722,6 +10783,7 @@ function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) { if (!statics) { return; } + for (var name in statics) { var property = statics[name]; if (!statics.hasOwnProperty(name)) { @@ -10738,14 +10800,25 @@ function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) { name ); - var isInherited = name in Constructor; - _invariant( - !isInherited, - 'ReactClass: You are attempting to define ' + - '`%s` on your component more than once. This conflict may be ' + - 'due to a mixin.', - name - ); + var isAlreadyDefined = name in Constructor; + if (isAlreadyDefined) { + var specPolicy = ReactClassStaticInterface.hasOwnProperty(name) + ? ReactClassStaticInterface[name] + : null; + + _invariant( + specPolicy === 'DEFINE_MANY_MERGED', + 'ReactClass: You are attempting to define ' + + '`%s` on your component more than once. This conflict may be ' + + 'due to a mixin.', + name + ); + + Constructor[name] = createMergedResultFunction(Constructor[name], property); + + return; + } + Constructor[name] = property; } } @@ -11055,6 +11128,12 @@ function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) { 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', spec.displayName || 'A component' ); + warning( + !Constructor.prototype.UNSAFE_componentWillRecieveProps, + '%s has a method called UNSAFE_componentWillRecieveProps(). ' + + 'Did you mean UNSAFE_componentWillReceiveProps()?', + spec.displayName || 'A component' + ); } // Reduce time spent doing lookups by setting these on the prototype. @@ -11072,7 +11151,7 @@ function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) { module.exports = factory; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) /***/ }), /* 136 */ @@ -11389,7 +11468,7 @@ cssAnimation.isCssAnimationSupported = isCssAnimationSupported; /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(22); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(23); function adjustForViewport(elFuturePos, elRegion, visibleRect, overflow) { @@ -11499,7 +11578,7 @@ function getElFuturePos(elRegion, refNodeRegion, points, offset, targetOffset) { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(22); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(23); function getRegion(node) { @@ -11531,7 +11610,7 @@ function getRegion(node) { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(22); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(23); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getOffsetParent__ = __webpack_require__(65); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isAncestorFixed__ = __webpack_require__(145); @@ -11628,8 +11707,7 @@ function getVisibleRectForElement(element) { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(22); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(23); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getOffsetParent__ = __webpack_require__(65); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__getVisibleRectForElement__ = __webpack_require__(143); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__adjustForViewport__ = __webpack_require__(139); @@ -11781,12 +11859,18 @@ function domAlign(el, refNode, align) { elFuturePos = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__getElFuturePos__["a" /* default */])(elRegion, refNodeRegion, points, offset, targetOffset); __WEBPACK_IMPORTED_MODULE_0__utils__["a" /* default */].mix(newElRegion, elFuturePos); } - - // 检查反下后的位置是否可以放下了 - // 如果仍然放不下只有指定了可以调整当前方向才调整 - newOverflowCfg.adjustX = overflow.adjustX && isFailX(elFuturePos, elRegion, visibleRect); - - newOverflowCfg.adjustY = overflow.adjustY && isFailY(elFuturePos, elRegion, visibleRect); + var isStillFailX = isFailX(elFuturePos, elRegion, visibleRect); + var isStillFailY = isFailY(elFuturePos, elRegion, visibleRect); + // 检查反下后的位置是否可以放下了,如果仍然放不下: + // 1. 复原修改过的定位参数 + if (isStillFailX || isStillFailY) { + points = align.points; + offset = align.offset || [0, 0]; + targetOffset = align.targetOffset || [0, 0]; + } + // 2. 只有指定了可以调整当前方向才调整 + newOverflowCfg.adjustX = overflow.adjustX && isStillFailX; + newOverflowCfg.adjustY = overflow.adjustY && isStillFailY; // 确实要调整,甚至可能会调整高度宽度 if (newOverflowCfg.adjustX || newOverflowCfg.adjustY) { @@ -11827,7 +11911,7 @@ domAlign.__getOffsetParent = __WEBPACK_IMPORTED_MODULE_1__getOffsetParent__["a" domAlign.__getVisibleRectForElement = __WEBPACK_IMPORTED_MODULE_2__getVisibleRectForElement__["a" /* default */]; -/* harmony default export */ __webpack_exports__["default"] = (domAlign); +/* harmony default export */ __webpack_exports__["a"] = (domAlign); /** * 2012-04-26 yiminghe@gmail.com * - 优化智能对齐算法 @@ -11843,7 +11927,7 @@ domAlign.__getVisibleRectForElement = __WEBPACK_IMPORTED_MODULE_2__getVisibleRec "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = isAncestorFixed; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(22); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(23); function isAncestorFixed(element) { @@ -12201,7 +12285,7 @@ module.exports = isTextNode; var emptyFunction = __webpack_require__(12); -var invariant = __webpack_require__(23); +var invariant = __webpack_require__(24); var ReactPropTypesSecret = __webpack_require__(50); module.exports = function() { @@ -12266,7 +12350,7 @@ module.exports = function() { var emptyFunction = __webpack_require__(12); -var invariant = __webpack_require__(23); +var invariant = __webpack_require__(24); var warning = __webpack_require__(29); var assign = __webpack_require__(17); @@ -12799,52 +12883,37 @@ module.exports = function(isValidElement, throwOnDirectAccess) { return ReactPropTypes; }; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) /***/ }), /* 155 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__ = __webpack_require__(2); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(4); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits__ = __webpack_require__(3); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react__ = __webpack_require__(0); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_react__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_prop_types__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_prop_types__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react_dom__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react_dom___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_react_dom__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_dom_align__ = __webpack_require__(144); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_rc_util_es_Dom_addEventListener__ = __webpack_require__(75); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__isWindow__ = __webpack_require__(157); -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(6); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _reactDom = __webpack_require__(1); - -var _reactDom2 = _interopRequireDefault(_reactDom); - -var _domAlign = __webpack_require__(144); - -var _domAlign2 = _interopRequireDefault(_domAlign); - -var _addEventListener = __webpack_require__(75); - -var _addEventListener2 = _interopRequireDefault(_addEventListener); -var _isWindow = __webpack_require__(157); -var _isWindow2 = _interopRequireDefault(_isWindow); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } function buffer(fn, ms) { var timer = void 0; @@ -12867,24 +12936,24 @@ function buffer(fn, ms) { } var Align = function (_Component) { - _inherits(Align, _Component); + __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits___default()(Align, _Component); function Align() { var _temp, _this, _ret; - _classCallCheck(this, Align); + __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default()(this, Align); for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } - return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.forceAlign = function () { + return _ret = (_temp = (_this = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn___default()(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.forceAlign = function () { var props = _this.props; if (!props.disabled) { - var source = _reactDom2["default"].findDOMNode(_this); - props.onAlign(source, (0, _domAlign2["default"])(source, props.target(), props.align)); + var source = __WEBPACK_IMPORTED_MODULE_5_react_dom___default.a.findDOMNode(_this); + props.onAlign(source, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_dom_align__["a" /* default */])(source, props.target(), props.align)); } - }, _temp), _possibleConstructorReturn(_this, _ret); + }, _temp), __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn___default()(_this, _ret); } Align.prototype.componentDidMount = function componentDidMount() { @@ -12906,7 +12975,7 @@ var Align = function (_Component) { } else { var lastTarget = prevProps.target(); var currentTarget = props.target(); - if ((0, _isWindow2["default"])(lastTarget) && (0, _isWindow2["default"])(currentTarget)) { + if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__isWindow__["a" /* default */])(lastTarget) && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__isWindow__["a" /* default */])(currentTarget)) { reAlign = false; } else if (lastTarget !== currentTarget) { reAlign = true; @@ -12932,7 +13001,7 @@ var Align = function (_Component) { Align.prototype.startMonitorWindowResize = function startMonitorWindowResize() { if (!this.resizeHandler) { this.bufferMonitor = buffer(this.forceAlign, this.props.monitorBufferTime); - this.resizeHandler = (0, _addEventListener2["default"])(window, 'resize', this.bufferMonitor); + this.resizeHandler = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7_rc_util_es_Dom_addEventListener__["a" /* default */])(window, 'resize', this.bufferMonitor); } }; @@ -12949,7 +13018,7 @@ var Align = function (_Component) { childrenProps = _props.childrenProps, children = _props.children; - var child = _react2["default"].Children.only(children); + var child = __WEBPACK_IMPORTED_MODULE_3_react___default.a.Children.only(children); if (childrenProps) { var newProps = {}; for (var prop in childrenProps) { @@ -12957,23 +13026,23 @@ var Align = function (_Component) { newProps[prop] = this.props[childrenProps[prop]]; } } - return _react2["default"].cloneElement(child, newProps); + return __WEBPACK_IMPORTED_MODULE_3_react___default.a.cloneElement(child, newProps); } return child; }; return Align; -}(_react.Component); +}(__WEBPACK_IMPORTED_MODULE_3_react__["Component"]); Align.propTypes = { - childrenProps: _propTypes2["default"].object, - align: _propTypes2["default"].object.isRequired, - target: _propTypes2["default"].func, - onAlign: _propTypes2["default"].func, - monitorBufferTime: _propTypes2["default"].number, - monitorWindowResize: _propTypes2["default"].bool, - disabled: _propTypes2["default"].bool, - children: _propTypes2["default"].any + childrenProps: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.object, + align: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.object.isRequired, + target: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func, + onAlign: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func, + monitorBufferTime: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.number, + monitorWindowResize: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.bool, + disabled: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.bool, + children: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.any }; Align.defaultProps = { target: function target() { @@ -12984,68 +13053,52 @@ Align.defaultProps = { monitorWindowResize: false, disabled: false }; -exports["default"] = Align; -module.exports = exports['default']; + + +/* harmony default export */ __webpack_exports__["a"] = (Align); /***/ }), /* 156 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Align__ = __webpack_require__(155); +// export this package's api - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _Align = __webpack_require__(155); - -var _Align2 = _interopRequireDefault(_Align); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -exports["default"] = _Align2["default"]; // export this package's api - -module.exports = exports['default']; +/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0__Align__["a" /* default */]); /***/ }), /* 157 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports["default"] = isWindow; +/* harmony export (immutable) */ __webpack_exports__["a"] = isWindow; function isWindow(obj) { /* eslint no-eq-null: 0 */ /* eslint eqeqeq: 0 */ return obj != null && obj == obj.window; } -module.exports = exports['default']; /***/ }), /* 158 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(24); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(25); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty__ = __webpack_require__(35); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_createClass__ = __webpack_require__(3); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_createClass__ = __webpack_require__(7); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_createClass___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_createClass__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(4); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_possibleConstructorReturn__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_babel_runtime_helpers_inherits__ = __webpack_require__(4); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_babel_runtime_helpers_inherits__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_babel_runtime_helpers_inherits__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_react__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_prop_types__ = __webpack_require__(6); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_prop_types__ = __webpack_require__(5); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_prop_types__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__ChildrenUtils__ = __webpack_require__(160); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__AnimateChild__ = __webpack_require__(159); @@ -13080,6 +13133,8 @@ function noop() {} var Animate = function (_React$Component) { __WEBPACK_IMPORTED_MODULE_5_babel_runtime_helpers_inherits___default()(Animate, _React$Component); + // eslint-disable-line + function Animate(props) { __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default()(this, Animate); @@ -13092,7 +13147,7 @@ var Animate = function (_React$Component) { _this.keysToLeave = []; _this.state = { - children: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__ChildrenUtils__["a" /* toArrayChildren */])(getChildrenFromProps(_this.props)) + children: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__ChildrenUtils__["a" /* toArrayChildren */])(getChildrenFromProps(props)) }; _this.childrenRefs = {}; @@ -13290,6 +13345,7 @@ var Animate = function (_React$Component) { return Animate; }(__WEBPACK_IMPORTED_MODULE_6_react___default.a.Component); +Animate.isAnimate = true; Animate.propTypes = { component: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.any, componentProps: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.object, @@ -13410,17 +13466,17 @@ var _initialiseProps = function _initialiseProps() { /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_createClass__ = __webpack_require__(3); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_createClass__ = __webpack_require__(7); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_createClass___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_createClass__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(4); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__ = __webpack_require__(4); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_react__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react_dom__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react_dom___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_react_dom__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_prop_types__ = __webpack_require__(6); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_prop_types__ = __webpack_require__(5); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_prop_types__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_css_animation__ = __webpack_require__(138); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__util__ = __webpack_require__(72); @@ -13657,29 +13713,25 @@ function mergeChildren(prev, next) { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(24); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(25); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_createClass__ = __webpack_require__(3); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_createClass___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_createClass__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(5); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__ = __webpack_require__(4); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_react__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_prop_types__ = __webpack_require__(6); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_prop_types__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_react_dom__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_react_dom___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_react_dom__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_rc_align__ = __webpack_require__(156); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_rc_align___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_rc_align__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_rc_animate__ = __webpack_require__(158); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__PopupInner__ = __webpack_require__(162); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__LazyRenderBox__ = __webpack_require__(73); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__utils__ = __webpack_require__(74); - +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(4); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits__ = __webpack_require__(3); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_react__ = __webpack_require__(0); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_react__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_prop_types__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_prop_types__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react_dom__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react_dom___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_react_dom__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_rc_align__ = __webpack_require__(156); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_rc_animate__ = __webpack_require__(158); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__PopupInner__ = __webpack_require__(162); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__LazyRenderBox__ = __webpack_require__(73); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__utils__ = __webpack_require__(74); @@ -13694,209 +13746,198 @@ function mergeChildren(prev, next) { var Popup = function (_Component) { - __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default()(Popup, _Component); + __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits___default()(Popup, _Component); function Popup(props) { __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck___default()(this, Popup); - var _this = __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default()(this, (Popup.__proto__ || Object.getPrototypeOf(Popup)).call(this, props)); + var _this = __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn___default()(this, _Component.call(this, props)); _initialiseProps.call(_this); - _this.savePopupRef = __WEBPACK_IMPORTED_MODULE_12__utils__["c" /* saveRef */].bind(_this, 'popupInstance'); - _this.saveAlignRef = __WEBPACK_IMPORTED_MODULE_12__utils__["c" /* saveRef */].bind(_this, 'alignInstance'); + _this.savePopupRef = __WEBPACK_IMPORTED_MODULE_11__utils__["c" /* saveRef */].bind(_this, 'popupInstance'); + _this.saveAlignRef = __WEBPACK_IMPORTED_MODULE_11__utils__["c" /* saveRef */].bind(_this, 'alignInstance'); return _this; } - __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_createClass___default()(Popup, [{ - key: 'componentDidMount', - value: function componentDidMount() { - this.rootNode = this.getPopupDomNode(); - } - }, { - key: 'getPopupDomNode', - value: function getPopupDomNode() { - return __WEBPACK_IMPORTED_MODULE_7_react_dom___default.a.findDOMNode(this.popupInstance); - } - }, { - key: 'getMaskTransitionName', - value: function getMaskTransitionName() { - var props = this.props; - var transitionName = props.maskTransitionName; - var animation = props.maskAnimation; - if (!transitionName && animation) { - transitionName = props.prefixCls + '-' + animation; - } - return transitionName; - } - }, { - key: 'getTransitionName', - value: function getTransitionName() { - var props = this.props; - var transitionName = props.transitionName; - if (!transitionName && props.animation) { - transitionName = props.prefixCls + '-' + props.animation; - } - return transitionName; + Popup.prototype.componentDidMount = function componentDidMount() { + this.rootNode = this.getPopupDomNode(); + }; + + Popup.prototype.getPopupDomNode = function getPopupDomNode() { + return __WEBPACK_IMPORTED_MODULE_6_react_dom___default.a.findDOMNode(this.popupInstance); + }; + + Popup.prototype.getMaskTransitionName = function getMaskTransitionName() { + var props = this.props; + var transitionName = props.maskTransitionName; + var animation = props.maskAnimation; + if (!transitionName && animation) { + transitionName = props.prefixCls + '-' + animation; } - }, { - key: 'getClassName', - value: function getClassName(currentAlignClassName) { - return this.props.prefixCls + ' ' + this.props.className + ' ' + currentAlignClassName; + return transitionName; + }; + + Popup.prototype.getTransitionName = function getTransitionName() { + var props = this.props; + var transitionName = props.transitionName; + if (!transitionName && props.animation) { + transitionName = props.prefixCls + '-' + props.animation; } - }, { - key: 'getPopupElement', - value: function getPopupElement() { - var savePopupRef = this.savePopupRef, - props = this.props; - var align = props.align, - style = props.style, - visible = props.visible, - prefixCls = props.prefixCls, - destroyPopupOnHide = props.destroyPopupOnHide; - - var className = this.getClassName(this.currentAlignClassName || props.getClassNameFromAlign(align)); - var hiddenClassName = prefixCls + '-hidden'; - if (!visible) { - this.currentAlignClassName = null; - } - var newStyle = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, style, this.getZIndexStyle()); - var popupInnerProps = { - className: className, - prefixCls: prefixCls, - ref: savePopupRef, - onMouseEnter: props.onMouseEnter, - onMouseLeave: props.onMouseLeave, - style: newStyle - }; - if (destroyPopupOnHide) { - return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement( - __WEBPACK_IMPORTED_MODULE_9_rc_animate__["a" /* default */], - { - component: '', - exclusive: true, - transitionAppear: true, - transitionName: this.getTransitionName() - }, - visible ? __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement( - __WEBPACK_IMPORTED_MODULE_8_rc_align___default.a, - { - target: this.getTarget, - key: 'popup', - ref: this.saveAlignRef, - monitorWindowResize: true, - align: align, - onAlign: this.onAlign - }, - __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement( - __WEBPACK_IMPORTED_MODULE_10__PopupInner__["a" /* default */], - __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({ - visible: true - }, popupInnerProps), - props.children - ) - ) : null - ); - } - return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement( - __WEBPACK_IMPORTED_MODULE_9_rc_animate__["a" /* default */], + return transitionName; + }; + + Popup.prototype.getClassName = function getClassName(currentAlignClassName) { + return this.props.prefixCls + ' ' + this.props.className + ' ' + currentAlignClassName; + }; + + Popup.prototype.getPopupElement = function getPopupElement() { + var savePopupRef = this.savePopupRef, + props = this.props; + var align = props.align, + style = props.style, + visible = props.visible, + prefixCls = props.prefixCls, + destroyPopupOnHide = props.destroyPopupOnHide; + + var className = this.getClassName(this.currentAlignClassName || props.getClassNameFromAlign(align)); + var hiddenClassName = prefixCls + '-hidden'; + if (!visible) { + this.currentAlignClassName = null; + } + var newStyle = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, style, this.getZIndexStyle()); + var popupInnerProps = { + className: className, + prefixCls: prefixCls, + ref: savePopupRef, + onMouseEnter: props.onMouseEnter, + onMouseLeave: props.onMouseLeave, + style: newStyle + }; + if (destroyPopupOnHide) { + return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement( + __WEBPACK_IMPORTED_MODULE_8_rc_animate__["a" /* default */], { component: '', exclusive: true, transitionAppear: true, - transitionName: this.getTransitionName(), - showProp: 'xVisible' + transitionName: this.getTransitionName() }, - __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement( - __WEBPACK_IMPORTED_MODULE_8_rc_align___default.a, + visible ? __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement( + __WEBPACK_IMPORTED_MODULE_7_rc_align__["a" /* default */], { target: this.getTarget, key: 'popup', ref: this.saveAlignRef, monitorWindowResize: true, - xVisible: visible, - childrenProps: { visible: 'xVisible' }, - disabled: !visible, align: align, onAlign: this.onAlign }, - __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement( - __WEBPACK_IMPORTED_MODULE_10__PopupInner__["a" /* default */], + __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement( + __WEBPACK_IMPORTED_MODULE_9__PopupInner__["a" /* default */], __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({ - hiddenClassName: hiddenClassName + visible: true }, popupInnerProps), props.children ) - ) + ) : null ); } - }, { - key: 'getZIndexStyle', - value: function getZIndexStyle() { - var style = {}; - var props = this.props; - if (props.zIndex !== undefined) { - style.zIndex = props.zIndex; - } - return style; + return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement( + __WEBPACK_IMPORTED_MODULE_8_rc_animate__["a" /* default */], + { + component: '', + exclusive: true, + transitionAppear: true, + transitionName: this.getTransitionName(), + showProp: 'xVisible' + }, + __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement( + __WEBPACK_IMPORTED_MODULE_7_rc_align__["a" /* default */], + { + target: this.getTarget, + key: 'popup', + ref: this.saveAlignRef, + monitorWindowResize: true, + xVisible: visible, + childrenProps: { visible: 'xVisible' }, + disabled: !visible, + align: align, + onAlign: this.onAlign + }, + __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement( + __WEBPACK_IMPORTED_MODULE_9__PopupInner__["a" /* default */], + __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({ + hiddenClassName: hiddenClassName + }, popupInnerProps), + props.children + ) + ) + ); + }; + + Popup.prototype.getZIndexStyle = function getZIndexStyle() { + var style = {}; + var props = this.props; + if (props.zIndex !== undefined) { + style.zIndex = props.zIndex; } - }, { - key: 'getMaskElement', - value: function getMaskElement() { - var props = this.props; - var maskElement = void 0; - if (props.mask) { - var maskTransition = this.getMaskTransitionName(); - maskElement = __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_11__LazyRenderBox__["a" /* default */], { - style: this.getZIndexStyle(), - key: 'mask', - className: props.prefixCls + '-mask', - hiddenClassName: props.prefixCls + '-mask-hidden', - visible: props.visible - }); - if (maskTransition) { - maskElement = __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement( - __WEBPACK_IMPORTED_MODULE_9_rc_animate__["a" /* default */], - { - key: 'mask', - showProp: 'visible', - transitionAppear: true, - component: '', - transitionName: maskTransition - }, - maskElement - ); - } + return style; + }; + + Popup.prototype.getMaskElement = function getMaskElement() { + var props = this.props; + var maskElement = void 0; + if (props.mask) { + var maskTransition = this.getMaskTransitionName(); + maskElement = __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_10__LazyRenderBox__["a" /* default */], { + style: this.getZIndexStyle(), + key: 'mask', + className: props.prefixCls + '-mask', + hiddenClassName: props.prefixCls + '-mask-hidden', + visible: props.visible + }); + if (maskTransition) { + maskElement = __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement( + __WEBPACK_IMPORTED_MODULE_8_rc_animate__["a" /* default */], + { + key: 'mask', + showProp: 'visible', + transitionAppear: true, + component: '', + transitionName: maskTransition + }, + maskElement + ); } - return maskElement; } - }, { - key: 'render', - value: function render() { - return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement( - 'div', - null, - this.getMaskElement(), - this.getPopupElement() - ); - } - }]); + return maskElement; + }; + + Popup.prototype.render = function render() { + return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement( + 'div', + null, + this.getMaskElement(), + this.getPopupElement() + ); + }; return Popup; -}(__WEBPACK_IMPORTED_MODULE_5_react__["Component"]); +}(__WEBPACK_IMPORTED_MODULE_4_react__["Component"]); Popup.propTypes = { - visible: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool, - style: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.object, - getClassNameFromAlign: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.func, - onAlign: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.func, - getRootDomNode: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.func, - onMouseEnter: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.func, - align: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.any, - destroyPopupOnHide: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool, - className: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.string, - prefixCls: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.string, - onMouseLeave: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.func + visible: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.bool, + style: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.object, + getClassNameFromAlign: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func, + onAlign: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func, + getRootDomNode: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func, + onMouseEnter: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func, + align: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.any, + destroyPopupOnHide: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.bool, + className: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string, + prefixCls: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string, + onMouseLeave: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func }; var _initialiseProps = function _initialiseProps() { @@ -13928,18 +13969,15 @@ var _initialiseProps = function _initialiseProps() { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_createClass__ = __webpack_require__(3); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_createClass___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_createClass__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(5); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits__ = __webpack_require__(4); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_react__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_react__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_prop_types__ = __webpack_require__(6); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_prop_types__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__LazyRenderBox__ = __webpack_require__(73); - +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(4); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits__ = __webpack_require__(3); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react__ = __webpack_require__(0); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_react__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_prop_types__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_prop_types__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__LazyRenderBox__ = __webpack_require__(73); @@ -13948,49 +13986,46 @@ var _initialiseProps = function _initialiseProps() { var PopupInner = function (_Component) { - __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits___default()(PopupInner, _Component); + __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits___default()(PopupInner, _Component); function PopupInner() { __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default()(this, PopupInner); - return __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn___default()(this, (PopupInner.__proto__ || Object.getPrototypeOf(PopupInner)).apply(this, arguments)); + return __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn___default()(this, _Component.apply(this, arguments)); } - __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_createClass___default()(PopupInner, [{ - key: 'render', - value: function render() { - var props = this.props; - var className = props.className; - if (!props.visible) { - className += ' ' + props.hiddenClassName; - } - return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement( - 'div', - { - className: className, - onMouseEnter: props.onMouseEnter, - onMouseLeave: props.onMouseLeave, - style: props.style - }, - __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement( - __WEBPACK_IMPORTED_MODULE_6__LazyRenderBox__["a" /* default */], - { className: props.prefixCls + '-content', visible: props.visible }, - props.children - ) - ); + PopupInner.prototype.render = function render() { + var props = this.props; + var className = props.className; + if (!props.visible) { + className += ' ' + props.hiddenClassName; } - }]); + return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement( + 'div', + { + className: className, + onMouseEnter: props.onMouseEnter, + onMouseLeave: props.onMouseLeave, + style: props.style + }, + __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement( + __WEBPACK_IMPORTED_MODULE_5__LazyRenderBox__["a" /* default */], + { className: props.prefixCls + '-content', visible: props.visible }, + props.children + ) + ); + }; return PopupInner; -}(__WEBPACK_IMPORTED_MODULE_4_react__["Component"]); +}(__WEBPACK_IMPORTED_MODULE_3_react__["Component"]); PopupInner.propTypes = { - hiddenClassName: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string, - className: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string, - prefixCls: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string, - onMouseEnter: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func, - onMouseLeave: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func, - children: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.any + hiddenClassName: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.string, + className: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.string, + prefixCls: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.string, + onMouseEnter: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func, + onMouseLeave: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func, + children: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.any }; @@ -14001,25 +14036,22 @@ PopupInner.propTypes = { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(24); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(25); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_react__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types__ = __webpack_require__(6); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types__ = __webpack_require__(5); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_prop_types__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react_dom__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react_dom___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_react_dom__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_create_react_class__ = __webpack_require__(136); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_create_react_class___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_create_react_class__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rc_util_es_Dom_contains__ = __webpack_require__(164); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_rc_util_lib_Dom_addEventListener__ = __webpack_require__(75); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_rc_util_lib_Dom_addEventListener___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_rc_util_lib_Dom_addEventListener__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_rc_util_es_Dom_addEventListener__ = __webpack_require__(75); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__Popup__ = __webpack_require__(161); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__utils__ = __webpack_require__(74); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_rc_util_lib_getContainerRenderMixin__ = __webpack_require__(166); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_rc_util_lib_getContainerRenderMixin___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_rc_util_lib_getContainerRenderMixin__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_rc_util_lib_Portal__ = __webpack_require__(165); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_rc_util_lib_Portal___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_10_rc_util_lib_Portal__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_rc_util_es_getContainerRenderMixin__ = __webpack_require__(166); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_rc_util_es_Portal__ = __webpack_require__(165); @@ -14046,17 +14078,18 @@ var ALL_HANDLERS = ['onClick', 'onMouseDown', 'onTouchStart', 'onMouseEnter', 'o var IS_REACT_16 = !!__WEBPACK_IMPORTED_MODULE_3_react_dom__["createPortal"]; -var isMobile = typeof navigator !== 'undefined' && !!navigator.userAgent.match(/(Android|iPhone|iPad|iPod|iOS|UCWEB)/i); - var mixins = []; if (!IS_REACT_16) { - mixins.push(__WEBPACK_IMPORTED_MODULE_9_rc_util_lib_getContainerRenderMixin___default()({ + mixins.push(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_9_rc_util_es_getContainerRenderMixin__["a" /* default */])({ autoMount: false, isVisible: function isVisible(instance) { return instance.state.popupVisible; }, + isForceRender: function isForceRender(instance) { + return instance.props.forceRender; + }, getContainer: function getContainer(instance) { return instance.getContainer(); } @@ -14088,6 +14121,7 @@ var Trigger = __WEBPACK_IMPORTED_MODULE_4_create_react_class___default()({ blurDelay: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.number, getPopupContainer: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.func, getDocument: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.func, + forceRender: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.bool, destroyPopupOnHide: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.bool, mask: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.bool, maskClosable: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.bool, @@ -14176,22 +14210,29 @@ var Trigger = __WEBPACK_IMPORTED_MODULE_4_create_react_class___default()({ this.prevPopupVisible = prevState.popupVisible; - if (state.popupVisible) { + // We must listen to `mousedown` or `touchstart`, edge case: + // https://github.com/ant-design/ant-design/issues/5804 + // https://github.com/react-component/calendar/issues/250 + // https://github.com/react-component/trigger/issues/50 + if (state.popupVisible) { var currentDocument = void 0; if (!this.clickOutsideHandler && (this.isClickToHide() || this.isContextMenuToShow())) { currentDocument = props.getDocument(); - this.clickOutsideHandler = __WEBPACK_IMPORTED_MODULE_6_rc_util_lib_Dom_addEventListener___default()(currentDocument, 'mousedown', this.onDocumentClick); + this.clickOutsideHandler = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_rc_util_es_Dom_addEventListener__["a" /* default */])(currentDocument, 'mousedown', this.onDocumentClick); } - if (!this.touchOutsideHandler && isMobile) { + // always hide on mobile + if (!this.touchOutsideHandler) { currentDocument = currentDocument || props.getDocument(); - this.touchOutsideHandler = __WEBPACK_IMPORTED_MODULE_6_rc_util_lib_Dom_addEventListener___default()(currentDocument, 'click', this.onDocumentClick); + this.touchOutsideHandler = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_rc_util_es_Dom_addEventListener__["a" /* default */])(currentDocument, 'touchstart', this.onDocumentClick); } - if (!this.contextMenuOutsideHandler1 && this.isContextMenuToShow()) { + // close popup when trigger type contains 'onContextMenu' and document is scrolling. + if (!this.contextMenuOutsideHandler1 && this.isContextMenuToShow()) { currentDocument = currentDocument || props.getDocument(); - this.contextMenuOutsideHandler1 = __WEBPACK_IMPORTED_MODULE_6_rc_util_lib_Dom_addEventListener___default()(currentDocument, 'scroll', this.onContextMenuClose); + this.contextMenuOutsideHandler1 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_rc_util_es_Dom_addEventListener__["a" /* default */])(currentDocument, 'scroll', this.onContextMenuClose); } - if (!this.contextMenuOutsideHandler2 && this.isContextMenuToShow()) { - this.contextMenuOutsideHandler2 = __WEBPACK_IMPORTED_MODULE_6_rc_util_lib_Dom_addEventListener___default()(window, 'blur', this.onContextMenuClose); + // close popup when trigger type contains 'onContextMenu' and window is blur. + if (!this.contextMenuOutsideHandler2 && this.isContextMenuToShow()) { + this.contextMenuOutsideHandler2 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_rc_util_es_Dom_addEventListener__["a" /* default */])(window, 'blur', this.onContextMenuClose); } return; } @@ -14214,14 +14255,17 @@ var Trigger = __WEBPACK_IMPORTED_MODULE_4_create_react_class___default()({ this.clearDelayTimer(); }, onPopupMouseLeave: function onPopupMouseLeave(e) { - if (e.relatedTarget && !e.relatedTarget.setTimeout && this._component && this._component.getPopupDomNode && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5_rc_util_es_Dom_contains__["a" /* default */])(this._component.getPopupDomNode(), e.relatedTarget)) { + // https://github.com/react-component/trigger/pull/13 + // react bug? + if (e.relatedTarget && !e.relatedTarget.setTimeout && this._component && this._component.getPopupDomNode && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5_rc_util_es_Dom_contains__["a" /* default */])(this._component.getPopupDomNode(), e.relatedTarget)) { return; } this.delaySetPopupVisible(false, this.props.mouseLeaveDelay); }, onFocus: function onFocus(e) { this.fireEvents('onFocus', e); - this.clearDelayTimer(); + // incase focusin and focusout + this.clearDelayTimer(); if (this.isFocusToShow()) { this.focusTime = Date.now(); this.delaySetPopupVisible(true, this.props.focusDelay); @@ -14254,7 +14298,8 @@ var Trigger = __WEBPACK_IMPORTED_MODULE_4_create_react_class___default()({ }, onClick: function onClick(event) { this.fireEvents('onClick', event); - if (this.focusTime) { + // focus will trigger click + if (this.focusTime) { var preTime = void 0; if (this.preClickTime && this.preTouchTime) { preTime = Math.min(this.preClickTime, this.preTouchTime); @@ -14293,7 +14338,8 @@ var Trigger = __WEBPACK_IMPORTED_MODULE_4_create_react_class___default()({ } }, getPopupDomNode: function getPopupDomNode() { - if (this._component && this._component.getPopupDomNode) { + // for test + if (this._component && this._component.getPopupDomNode) { return this._component.getPopupDomNode(); } return null; @@ -14367,7 +14413,9 @@ var Trigger = __WEBPACK_IMPORTED_MODULE_4_create_react_class___default()({ var props = this.props; var popupContainer = document.createElement('div'); - popupContainer.style.position = 'absolute'; + // Make sure default popup container will never cause scrollbar appearing + // https://github.com/react-component/trigger/issues/41 + popupContainer.style.position = 'absolute'; popupContainer.style.top = '0'; popupContainer.style.left = '0'; popupContainer.style.width = '100%'; @@ -14555,9 +14603,10 @@ var Trigger = __WEBPACK_IMPORTED_MODULE_4_create_react_class___default()({ } var portal = void 0; - if (popupVisible || this._component) { + // prevent unmounting after it's rendered + if (popupVisible || this._component || props.forceRender) { portal = __WEBPACK_IMPORTED_MODULE_1_react___default.a.createElement( - __WEBPACK_IMPORTED_MODULE_10_rc_util_lib_Portal___default.a, + __WEBPACK_IMPORTED_MODULE_10_rc_util_es_Portal__["a" /* default */], { key: 'portal', getContainer: this.getContainer, @@ -14593,52 +14642,41 @@ function contains(root, n) { /***/ }), /* 165 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__ = __webpack_require__(2); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_createClass__ = __webpack_require__(7); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_createClass___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_createClass__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(4); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits__ = __webpack_require__(3); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_react__ = __webpack_require__(0); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_react__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react_dom__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react_dom___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_react_dom__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_prop_types__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_prop_types__); -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _classCallCheck2 = __webpack_require__(2); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = __webpack_require__(3); - -var _createClass3 = _interopRequireDefault(_createClass2); - -var _possibleConstructorReturn2 = __webpack_require__(5); - -var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - -var _inherits2 = __webpack_require__(4); - -var _inherits3 = _interopRequireDefault(_inherits2); - -var _react = __webpack_require__(0); -var _react2 = _interopRequireDefault(_react); -var _propTypes = __webpack_require__(6); -var _propTypes2 = _interopRequireDefault(_propTypes); -var _reactDom = __webpack_require__(1); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var Portal = function (_React$Component) { - (0, _inherits3['default'])(Portal, _React$Component); + __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits___default()(Portal, _React$Component); function Portal() { - (0, _classCallCheck3['default'])(this, Portal); - return (0, _possibleConstructorReturn3['default'])(this, (Portal.__proto__ || Object.getPrototypeOf(Portal)).apply(this, arguments)); + __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default()(this, Portal); + + return __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn___default()(this, (Portal.__proto__ || Object.getPrototypeOf(Portal)).apply(this, arguments)); } - (0, _createClass3['default'])(Portal, [{ + __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_createClass___default()(Portal, [{ key: 'componentDidMount', value: function componentDidMount() { this.createContainer(); @@ -14674,44 +14712,34 @@ var Portal = function (_React$Component) { key: 'render', value: function render() { if (this._container) { - return (0, _reactDom.createPortal)(this.props.children, this._container); + return __WEBPACK_IMPORTED_MODULE_5_react_dom___default.a.createPortal(this.props.children, this._container); } return null; } }]); + return Portal; -}(_react2['default'].Component); +}(__WEBPACK_IMPORTED_MODULE_4_react___default.a.Component); Portal.propTypes = { - getContainer: _propTypes2['default'].func.isRequired, - children: _propTypes2['default'].node.isRequired, - didUpdate: _propTypes2['default'].func + getContainer: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.func.isRequired, + children: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.node.isRequired, + didUpdate: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.func }; -exports['default'] = Portal; -module.exports = exports['default']; +/* harmony default export */ __webpack_exports__["a"] = (Portal); /***/ }), /* 166 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = getContainerRenderMixin; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(25); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react_dom__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react_dom___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_react_dom__); -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends2 = __webpack_require__(24); - -var _extends3 = _interopRequireDefault(_extends2); - -exports['default'] = getContainerRenderMixin; - -var _reactDom = __webpack_require__(1); - -var _reactDom2 = _interopRequireDefault(_reactDom); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function defaultGetContainer() { var container = document.createElement('div'); @@ -14725,6 +14753,7 @@ function getContainerRenderMixin(config) { _config$autoDestroy = config.autoDestroy, autoDestroy = _config$autoDestroy === undefined ? true : _config$autoDestroy, isVisible = config.isVisible, + isForceRender = config.isForceRender, getComponent = config.getComponent, _config$getContainer = config.getContainer, getContainer = _config$getContainer === undefined ? defaultGetContainer : _config$getContainer; @@ -14733,7 +14762,7 @@ function getContainerRenderMixin(config) { var mixin = void 0; function _renderComponent(instance, componentArg, ready) { - if (!isVisible || instance._component || isVisible(instance)) { + if (!isVisible || instance._component || isVisible(instance) || isForceRender && isForceRender(instance)) { if (!instance._container) { instance._container = getContainer(instance); } @@ -14743,7 +14772,7 @@ function getContainerRenderMixin(config) { } else { component = getComponent(instance, componentArg); } - _reactDom2['default'].unstable_renderSubtreeIntoContainer(instance, component, instance._container, function callback() { + __WEBPACK_IMPORTED_MODULE_1_react_dom___default.a.unstable_renderSubtreeIntoContainer(instance, component, instance._container, function callback() { instance._component = this; if (ready) { ready.call(this); @@ -14753,7 +14782,7 @@ function getContainerRenderMixin(config) { } if (autoMount) { - mixin = (0, _extends3['default'])({}, mixin, { + mixin = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, mixin, { componentDidMount: function componentDidMount() { _renderComponent(this); }, @@ -14764,7 +14793,7 @@ function getContainerRenderMixin(config) { } if (!autoMount || !autoDestroy) { - mixin = (0, _extends3['default'])({}, mixin, { + mixin = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, mixin, { renderComponent: function renderComponent(componentArg, ready) { _renderComponent(this, componentArg, ready); } @@ -14774,20 +14803,20 @@ function getContainerRenderMixin(config) { function _removeContainer(instance) { if (instance._container) { var container = instance._container; - _reactDom2['default'].unmountComponentAtNode(container); + __WEBPACK_IMPORTED_MODULE_1_react_dom___default.a.unmountComponentAtNode(container); container.parentNode.removeChild(container); instance._container = null; } } if (autoDestroy) { - mixin = (0, _extends3['default'])({}, mixin, { + mixin = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, mixin, { componentWillUnmount: function componentWillUnmount() { _removeContainer(this); } }); } else { - mixin = (0, _extends3['default'])({}, mixin, { + mixin = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, mixin, { removeContainer: function removeContainer() { _removeContainer(this); } @@ -14796,14 +14825,13 @@ function getContainerRenderMixin(config) { return mixin; } -module.exports = exports['default']; /***/ }), /* 167 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/** @license React v16.1.1 +/* WEBPACK VAR INJECTION */(function(process) {/** @license React v16.2.0 * react-dom.development.js * * Copyright (c) 2013-present, Facebook, Inc. @@ -14814,16 +14842,18 @@ module.exports = exports['default']; + + if (process.env.NODE_ENV !== "production") { (function() { 'use strict'; var React = __webpack_require__(0); -var invariant = __webpack_require__(23); +var invariant = __webpack_require__(24); var warning = __webpack_require__(29); var ExecutionEnvironment = __webpack_require__(67); var _assign = __webpack_require__(17); -var emptyFunction$1 = __webpack_require__(12); +var emptyFunction = __webpack_require__(12); var EventListener = __webpack_require__(66); var getActiveElement = __webpack_require__(70); var shallowEqual = __webpack_require__(71); @@ -15904,6 +15934,11 @@ function processEventQueue(simulated) { // events get enqueued while processing. var processingEventQueue = eventQueue; eventQueue = null; + + if (!processingEventQueue) { + return; + } + if (simulated) { forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated); } else { @@ -16365,7 +16400,7 @@ var EventInterface = { type: null, target: null, // currentTarget is set when dispatching; no use in copying it here - currentTarget: emptyFunction$1.thatReturnsNull, + currentTarget: emptyFunction.thatReturnsNull, eventPhase: null, bubbles: null, cancelable: null, @@ -16428,11 +16463,11 @@ function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarg var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false; if (defaultPrevented) { - this.isDefaultPrevented = emptyFunction$1.thatReturnsTrue; + this.isDefaultPrevented = emptyFunction.thatReturnsTrue; } else { - this.isDefaultPrevented = emptyFunction$1.thatReturnsFalse; + this.isDefaultPrevented = emptyFunction.thatReturnsFalse; } - this.isPropagationStopped = emptyFunction$1.thatReturnsFalse; + this.isPropagationStopped = emptyFunction.thatReturnsFalse; return this; } @@ -16449,7 +16484,7 @@ _assign(SyntheticEvent.prototype, { } else if (typeof event.returnValue !== 'unknown') { event.returnValue = false; } - this.isDefaultPrevented = emptyFunction$1.thatReturnsTrue; + this.isDefaultPrevented = emptyFunction.thatReturnsTrue; }, stopPropagation: function () { @@ -16469,7 +16504,7 @@ _assign(SyntheticEvent.prototype, { event.cancelBubble = true; } - this.isPropagationStopped = emptyFunction$1.thatReturnsTrue; + this.isPropagationStopped = emptyFunction.thatReturnsTrue; }, /** @@ -16478,7 +16513,7 @@ _assign(SyntheticEvent.prototype, { * won't be added back into the pool. */ persist: function () { - this.isPersistent = emptyFunction$1.thatReturnsTrue; + this.isPersistent = emptyFunction.thatReturnsTrue; }, /** @@ -16486,7 +16521,7 @@ _assign(SyntheticEvent.prototype, { * * @return {boolean} True if this should not be released, false otherwise. */ - isPersistent: emptyFunction$1.thatReturnsFalse, + isPersistent: emptyFunction.thatReturnsFalse, /** * `PooledClass` looks for `destructor` on each instance it releases. @@ -16503,8 +16538,8 @@ _assign(SyntheticEvent.prototype, { } { Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null)); - Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', emptyFunction$1)); - Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', emptyFunction$1)); + Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', emptyFunction)); + Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', emptyFunction)); } } }); @@ -18519,17 +18554,7 @@ function listenTo(registrationName, contentDocumentHandle) { for (var i = 0; i < dependencies.length; i++) { var dependency = dependencies[i]; if (!(isListening.hasOwnProperty(dependency) && isListening[dependency])) { - if (dependency === 'topWheel') { - if (isEventSupported('wheel')) { - trapBubbledEvent('topWheel', 'wheel', mountAt); - } else if (isEventSupported('mousewheel')) { - trapBubbledEvent('topWheel', 'mousewheel', mountAt); - } else { - // Firefox needs to capture a different mouse scroll event. - // @see http://www.quirksmode.org/dom/events/tests/scroll.html - trapBubbledEvent('topWheel', 'DOMMouseScroll', mountAt); - } - } else if (dependency === 'topScroll') { + if (dependency === 'topScroll') { trapCapturedEvent('topScroll', 'scroll', mountAt); } else if (dependency === 'topFocus' || dependency === 'topBlur') { trapCapturedEvent('topFocus', 'focus', mountAt); @@ -18639,10 +18664,10 @@ function getOffsets(outerNode) { return null; } - var anchorNode = selection.anchorNode; - var anchorOffset = selection.anchorOffset; - var focusNode$$1 = selection.focusNode; - var focusOffset = selection.focusOffset; + var anchorNode = selection.anchorNode, + anchorOffset = selection.anchorOffset, + focusNode$$1 = selection.focusNode, + focusOffset = selection.focusOffset; // In Firefox, anchorNode and focusNode can be "anonymous divs", e.g. the // up/down buttons on an . Anonymous divs do not seem to @@ -18651,6 +18676,7 @@ function getOffsets(outerNode) { // is to access a property that typically works for non-anonymous divs and // catch any error that may otherwise arise. See // https://bugzilla.mozilla.org/show_bug.cgi?id=208427 + try { /* eslint-disable no-unused-expressions */ anchorNode.nodeType; @@ -19569,8 +19595,6 @@ injection$1.injectEventPluginsByName({ var enableAsyncSubtreeAPI = true; var enableAsyncSchedulingByDefaultInReactDOM = false; -// Exports React.Fragment -var enableReactFragment = false; // Exports ReactDOM.createRoot var enableCreateRoot = false; var enableUserTimingAPI = true; @@ -19582,6 +19606,9 @@ var enableNoopReconciler = false; // Experimental persistent mode (CS): var enablePersistentReconciler = false; +// Helps identify side effects in begin-phase lifecycle hooks and setState reducers: +var debugRenderPhaseSideEffects = false; + // Only used in www builds. var valueStack = []; @@ -20362,6 +20389,10 @@ function msToExpirationTime(ms) { return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET; } +function expirationTimeToMs(expirationTime) { + return (expirationTime - MAGIC_NUMBER_OFFSET) * UNIT_SIZE; +} + function ceiling(num, precision) { return ((num / precision | 0) + 1) * precision; } @@ -20378,8 +20409,7 @@ var AsyncUpdates = 1; try { var nonExtensibleObject = Object.preventExtensions({}); /* eslint-disable no-new */ - new Map([[nonExtensibleObject, null]]); - new Set([nonExtensibleObject]); + /* eslint-enable no-new */ } catch (e) { // TODO: Consider warning about bad polyfills @@ -20816,6 +20846,12 @@ function getStateFromUpdate(update, instance, prevState, props) { var partialState = update.partialState; if (typeof partialState === 'function') { var updateFn = partialState; + + // Invoke setState callback an extra time to help detect side-effects. + if (debugRenderPhaseSideEffects) { + updateFn.call(instance, prevState, props); + } + return updateFn.call(instance, prevState, props); } else { return partialState; @@ -21061,6 +21097,11 @@ var ReactFiberClassComponent = function (scheduleWork, computeExpirationForFiber var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, newContext); stopPhaseTimer(); + // Simulate an async bailout/interruption by invoking lifecycle twice. + if (debugRenderPhaseSideEffects) { + instance.shouldComponentUpdate(newProps, newState, newContext); + } + { warning(shouldUpdate !== undefined, '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', getComponentName(workInProgress) || 'Unknown'); } @@ -21117,10 +21158,10 @@ var ReactFiberClassComponent = function (scheduleWork, computeExpirationForFiber var state = instance.state; if (state && (typeof state !== 'object' || isArray(state))) { - invariant(false, '%s.state: must be set to an object or null', getComponentName(workInProgress)); + warning(false, '%s.state: must be set to an object or null', getComponentName(workInProgress)); } if (typeof instance.getChildContext === 'function') { - !(typeof workInProgress.type.childContextTypes === 'object') ? invariant(false, '%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().', getComponentName(workInProgress)) : void 0; + warning(typeof workInProgress.type.childContextTypes === 'object', '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', getComponentName(workInProgress)); } } @@ -21160,9 +21201,13 @@ var ReactFiberClassComponent = function (scheduleWork, computeExpirationForFiber startPhaseTimer(workInProgress, 'componentWillMount'); var oldState = instance.state; instance.componentWillMount(); - stopPhaseTimer(); + // Simulate an async bailout/interruption by invoking lifecycle twice. + if (debugRenderPhaseSideEffects) { + instance.componentWillMount(); + } + if (oldState !== instance.state) { { warning(false, '%s.componentWillMount(): Assigning directly to this.state is ' + "deprecated (except inside a component's " + 'constructor). Use setState instead.', getComponentName(workInProgress)); @@ -21177,6 +21222,11 @@ var ReactFiberClassComponent = function (scheduleWork, computeExpirationForFiber instance.componentWillReceiveProps(newProps, newContext); stopPhaseTimer(); + // Simulate an async bailout/interruption by invoking lifecycle twice. + if (debugRenderPhaseSideEffects) { + instance.componentWillReceiveProps(newProps, newContext); + } + if (instance.state !== oldState) { { var componentName = getComponentName(workInProgress) || 'Component'; @@ -21386,6 +21436,11 @@ var ReactFiberClassComponent = function (scheduleWork, computeExpirationForFiber startPhaseTimer(workInProgress, 'componentWillUpdate'); instance.componentWillUpdate(newProps, newState, newContext); stopPhaseTimer(); + + // Simulate an async bailout/interruption by invoking lifecycle twice. + if (debugRenderPhaseSideEffects) { + instance.componentWillUpdate(newProps, newState, newContext); + } } if (typeof instance.componentDidUpdate === 'function') { workInProgress.effectTag |= Update; @@ -21423,23 +21478,28 @@ var ReactFiberClassComponent = function (scheduleWork, computeExpirationForFiber }; }; -// The Symbol used to tag the special React types. If there is no native Symbol +// The Symbol used to tag the ReactElement-like types. If there is no native Symbol // nor polyfill, then a plain number is used for performance. -var REACT_PORTAL_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.portal') || 0xeaca; +var hasSymbol = typeof Symbol === 'function' && Symbol['for']; -function createPortal$1(children, containerInfo, -// TODO: figure out the API for cross-renderer implementation. -implementation) { - var key = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; +var REACT_ELEMENT_TYPE = hasSymbol ? Symbol['for']('react.element') : 0xeac7; +var REACT_CALL_TYPE = hasSymbol ? Symbol['for']('react.call') : 0xeac8; +var REACT_RETURN_TYPE = hasSymbol ? Symbol['for']('react.return') : 0xeac9; +var REACT_PORTAL_TYPE = hasSymbol ? Symbol['for']('react.portal') : 0xeaca; +var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol['for']('react.fragment') : 0xeacb; - return { - // This tag allow us to uniquely identify this as a React Portal - $$typeof: REACT_PORTAL_TYPE, - key: key == null ? null : '' + key, - children: children, - containerInfo: containerInfo, - implementation: implementation - }; +var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; +var FAUX_ITERATOR_SYMBOL = '@@iterator'; + +function getIteratorFn(maybeIterable) { + if (maybeIterable === null || typeof maybeIterable === 'undefined') { + return null; + } + var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; + if (typeof maybeIterator === 'function') { + return maybeIterator; + } + return null; } var getCurrentFiberStackAddendum$1 = ReactDebugCurrentFiber.getCurrentFiberStackAddendum; @@ -21477,38 +21537,6 @@ var getCurrentFiberStackAddendum$1 = ReactDebugCurrentFiber.getCurrentFiberStack var isArray$1 = Array.isArray; -var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; -var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. - -// The Symbol used to tag the ReactElement-like types. If there is no native Symbol -// nor polyfill, then a plain number is used for performance. -var REACT_ELEMENT_TYPE; -var REACT_CALL_TYPE; -var REACT_RETURN_TYPE; -var REACT_FRAGMENT_TYPE; -if (typeof Symbol === 'function' && Symbol['for']) { - REACT_ELEMENT_TYPE = Symbol['for']('react.element'); - REACT_CALL_TYPE = Symbol['for']('react.call'); - REACT_RETURN_TYPE = Symbol['for']('react.return'); - REACT_FRAGMENT_TYPE = Symbol['for']('react.fragment'); -} else { - REACT_ELEMENT_TYPE = 0xeac7; - REACT_CALL_TYPE = 0xeac8; - REACT_RETURN_TYPE = 0xeac9; - REACT_FRAGMENT_TYPE = 0xeacb; -} - -function getIteratorFn(maybeIterable) { - if (maybeIterable === null || typeof maybeIterable === 'undefined') { - return null; - } - var iteratorFn = ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; - if (typeof iteratorFn === 'function') { - return iteratorFn; - } - return null; -} - function coerceRef(current, element) { var mixedRef = element.ref; if (mixedRef !== null && typeof mixedRef !== 'function') { @@ -21569,21 +21597,12 @@ function warnOnFunctionType() { // to be able to optimize each path individually by branching early. This needs // a compiler or we can do it manually. Helpers that don't need this branching // live outside of this function. -function ChildReconciler(shouldClone, shouldTrackSideEffects) { +function ChildReconciler(shouldTrackSideEffects) { function deleteChild(returnFiber, childToDelete) { if (!shouldTrackSideEffects) { // Noop. return; } - if (!shouldClone) { - // When we're reconciling in place we have a work in progress copy. We - // actually want the current copy. If there is no current copy, then we - // don't need to track deletion side-effects. - if (childToDelete.alternate === null) { - return; - } - childToDelete = childToDelete.alternate; - } // Deletions are added in reversed order so we add it to the front. // At this point, the return fiber's effect list is empty except for // deletions, so we can just append the deletion to the list. The remaining @@ -21636,22 +21655,10 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) { function useFiber(fiber, pendingProps, expirationTime) { // We currently set sibling to null and index to 0 here because it is easy // to forget to do before returning it. E.g. for the single child case. - if (shouldClone) { - var clone = createWorkInProgress(fiber, pendingProps, expirationTime); - clone.index = 0; - clone.sibling = null; - return clone; - } else { - // We override the expiration time even if it is earlier, because if - // we're reconciling at a later time that means that this was - // down-prioritized. - fiber.expirationTime = expirationTime; - fiber.effectTag = NoEffect; - fiber.index = 0; - fiber.sibling = null; - fiber.pendingProps = pendingProps; - return fiber; - } + var clone = createWorkInProgress(fiber, pendingProps, expirationTime); + clone.index = 0; + clone.sibling = null; + return clone; } function placeChild(newFiber, lastPlacedIndex, newIndex) { @@ -22448,7 +22455,7 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) { // Handle top level unkeyed fragments as if they were arrays. // This leads to an ambiguity between <>{[...]} and <>.... // We treat the ambiguous cases above the same. - if (enableReactFragment && typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null) { + if (typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null) { newChild = newChild.props.children; } @@ -22523,11 +22530,8 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) { return reconcileChildFibers; } -var reconcileChildFibers = ChildReconciler(true, true); - -var reconcileChildFibersInPlace = ChildReconciler(false, true); - -var mountChildFibersInPlace = ChildReconciler(false, false); +var reconcileChildFibers = ChildReconciler(true); +var mountChildFibers = ChildReconciler(false); function cloneChildFibers(current, workInProgress) { !(current === null || workInProgress.child === current.child) ? invariant(false, 'Resuming work not yet implemented.') : void 0; @@ -22582,20 +22586,15 @@ var ReactFiberBeginWork = function (config, hostContext, hydrationContext, sched // won't update its child set by applying minimal side-effects. Instead, // we will add them all to the child before it gets rendered. That means // we can optimize this reconciliation pass by not tracking side-effects. - workInProgress.child = mountChildFibersInPlace(workInProgress, workInProgress.child, nextChildren, renderExpirationTime); - } else if (current.child === workInProgress.child) { + workInProgress.child = mountChildFibers(workInProgress, null, nextChildren, renderExpirationTime); + } else { // If the current child is the same as the work in progress, it means that // we haven't yet started any work on these children. Therefore, we use // the clone algorithm to create a copy of all the current children. // If we had any progressed work already, that is invalid at this point so // let's throw it out. - workInProgress.child = reconcileChildFibers(workInProgress, workInProgress.child, nextChildren, renderExpirationTime); - } else { - // If, on the other hand, it is already using a clone, that means we've - // already begun some work on this tree and we can continue where we left - // off by reconciling against the existing children. - workInProgress.child = reconcileChildFibersInPlace(workInProgress, workInProgress.child, nextChildren, renderExpirationTime); + workInProgress.child = reconcileChildFibers(workInProgress, current.child, nextChildren, renderExpirationTime); } } @@ -22705,6 +22704,9 @@ var ReactFiberBeginWork = function (config, hostContext, hydrationContext, sched { ReactDebugCurrentFiber.setCurrentPhase('render'); nextChildren = instance.render(); + if (debugRenderPhaseSideEffects) { + instance.render(); + } ReactDebugCurrentFiber.setCurrentPhase(null); } // React DevTools reads this flag. @@ -22763,7 +22765,7 @@ var ReactFiberBeginWork = function (config, hostContext, hydrationContext, sched // Ensure that children mount into this root without tracking // side-effects. This ensures that we don't store Placement effects on // nodes that will be hydrated. - workInProgress.child = mountChildFibersInPlace(workInProgress, workInProgress.child, element, renderExpirationTime); + workInProgress.child = mountChildFibers(workInProgress, null, element, renderExpirationTime); } else { // Otherwise reset hydration state in case we aborted and resumed another // root. @@ -22930,11 +22932,9 @@ var ReactFiberBeginWork = function (config, hostContext, hydrationContext, sched // The following is a fork of reconcileChildrenAtExpirationTime but using // stateNode to store the child. if (current === null) { - workInProgress.stateNode = mountChildFibersInPlace(workInProgress, workInProgress.stateNode, nextChildren, renderExpirationTime); - } else if (current.child === workInProgress.child) { - workInProgress.stateNode = reconcileChildFibers(workInProgress, workInProgress.stateNode, nextChildren, renderExpirationTime); + workInProgress.stateNode = mountChildFibers(workInProgress, workInProgress.stateNode, nextChildren, renderExpirationTime); } else { - workInProgress.stateNode = reconcileChildFibersInPlace(workInProgress, workInProgress.stateNode, nextChildren, renderExpirationTime); + workInProgress.stateNode = reconcileChildFibers(workInProgress, workInProgress.stateNode, nextChildren, renderExpirationTime); } memoizeProps(workInProgress, nextCall); @@ -22963,7 +22963,7 @@ var ReactFiberBeginWork = function (config, hostContext, hydrationContext, sched // flow doesn't do during mount. This doesn't happen at the root because // the root always starts with a "current" with a null child. // TODO: Consider unifying this with how the root works. - workInProgress.child = reconcileChildFibersInPlace(workInProgress, workInProgress.child, nextChildren, renderExpirationTime); + workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderExpirationTime); memoizeProps(workInProgress, nextChildren); } else { reconcileChildren(current, workInProgress, nextChildren); @@ -24544,6 +24544,12 @@ function logCapturedError(capturedError) { return; } + var error = capturedError.error; + var suppressLogging = error && error.suppressReactErrorLogging; + if (suppressLogging) { + return; + } + { var componentName = capturedError.componentName, componentStack = capturedError.componentStack, @@ -24639,6 +24645,7 @@ var ReactFiberScheduler = function (config) { var now = config.now, scheduleDeferredCallback = config.scheduleDeferredCallback, + cancelDeferredCallback = config.cancelDeferredCallback, useSyncScheduling = config.useSyncScheduling, prepareForCommit = config.prepareForCommit, resetAfterCommit = config.resetAfterCommit; @@ -25046,6 +25053,7 @@ var ReactFiberScheduler = function (config) { { ReactDebugCurrentFiber.setCurrentFiber(workInProgress); } + var next = beginWork(current, workInProgress, nextRenderExpirationTime); { ReactDebugCurrentFiber.resetCurrentFiber(); @@ -25366,7 +25374,10 @@ var ReactFiberScheduler = function (config) { } catch (e) { // Prevent cycle if logCapturedError() throws. // A cycle may still occur if logCapturedError renders a component that throws. - console.error(e); + var suppressLogging = e && e.suppressReactErrorLogging; + if (!suppressLogging) { + console.error(e); + } } // If we're in the commit phase, defer scheduling an update on the @@ -25511,6 +25522,19 @@ var ReactFiberScheduler = function (config) { return scheduleWorkImpl(fiber, expirationTime, false); } + function checkRootNeedsClearing(root, fiber, expirationTime) { + if (!isWorking && root === nextRoot && expirationTime < nextRenderExpirationTime) { + // Restart the root from the top. + if (nextUnitOfWork !== null) { + // This is an interruption. (Used for performance tracking.) + interruptedBy = fiber; + } + nextRoot = null; + nextUnitOfWork = null; + nextRenderExpirationTime = NoWork; + } + } + function scheduleWorkImpl(fiber, expirationTime, isErrorRecovery) { recordScheduleUpdate(); @@ -25536,17 +25560,10 @@ var ReactFiberScheduler = function (config) { if (node['return'] === null) { if (node.tag === HostRoot) { var root = node.stateNode; - if (!isWorking && root === nextRoot && expirationTime <= nextRenderExpirationTime) { - // Restart the root from the top. - if (nextUnitOfWork !== null) { - // This is an interruption. (Used for performance tracking.) - interruptedBy = fiber; - } - nextRoot = null; - nextUnitOfWork = null; - nextRenderExpirationTime = NoWork; - } + + checkRootNeedsClearing(root, fiber, expirationTime); requestWork(root, expirationTime); + checkRootNeedsClearing(root, fiber, expirationTime); } else { { if (!isErrorRecovery && fiber.tag === ClassComponent) { @@ -25598,7 +25615,8 @@ var ReactFiberScheduler = function (config) { var firstScheduledRoot = null; var lastScheduledRoot = null; - var isCallbackScheduled = false; + var callbackExpirationTime = NoWork; + var callbackID = -1; var isRendering = false; var nextFlushedRoot = null; var nextFlushedExpirationTime = NoWork; @@ -25616,6 +25634,31 @@ var ReactFiberScheduler = function (config) { var timeHeuristicForUnitOfWork = 1; + function scheduleCallbackWithExpiration(expirationTime) { + if (callbackExpirationTime !== NoWork) { + // A callback is already scheduled. Check its expiration time (timeout). + if (expirationTime > callbackExpirationTime) { + // Existing callback has sufficient timeout. Exit. + return; + } else { + // Existing callback has insufficient timeout. Cancel and schedule a + // new one. + cancelDeferredCallback(callbackID); + } + // The request callback timer is already running. Don't start a new one. + } else { + startRequestCallbackTimer(); + } + + // Compute a timeout for the given expiration time. + var currentMs = now() - startTime; + var expirationMs = expirationTimeToMs(expirationTime); + var timeout = expirationMs - currentMs; + + callbackExpirationTime = expirationTime; + callbackID = scheduleDeferredCallback(performAsyncWork, { timeout: timeout }); + } + // requestWork is called by the scheduler whenever a root receives an update. // It's up to the renderer to call renderRoot at some point in the future. function requestWork(root, expirationTime) { @@ -25656,7 +25699,9 @@ var ReactFiberScheduler = function (config) { if (isUnbatchingUpdates) { // ...unless we're inside unbatchedUpdates, in which case we should // flush it now. - performWorkOnRoot(root, Sync); + nextFlushedRoot = root; + nextFlushedExpirationTime = Sync; + performWorkOnRoot(nextFlushedRoot, nextFlushedExpirationTime); } return; } @@ -25664,10 +25709,8 @@ var ReactFiberScheduler = function (config) { // TODO: Get rid of Sync and use current time? if (expirationTime === Sync) { performWork(Sync, null); - } else if (!isCallbackScheduled) { - isCallbackScheduled = true; - startRequestCallbackTimer(); - scheduleDeferredCallback(performAsyncWork); + } else { + scheduleCallbackWithExpiration(expirationTime); } } @@ -25764,13 +25807,12 @@ var ReactFiberScheduler = function (config) { // If we're inside a callback, set this to false since we just completed it. if (deadline !== null) { - isCallbackScheduled = false; + callbackExpirationTime = NoWork; + callbackID = -1; } // If there's work left over, schedule a new callback. - if (nextFlushedRoot !== null && !isCallbackScheduled) { - isCallbackScheduled = true; - startRequestCallbackTimer(); - scheduleDeferredCallback(performAsyncWork); + if (nextFlushedExpirationTime !== NoWork) { + scheduleCallbackWithExpiration(nextFlushedExpirationTime); } // Clean-up. @@ -25843,6 +25885,8 @@ var ReactFiberScheduler = function (config) { return false; } if (deadline.timeRemaining() > timeHeuristicForUnitOfWork) { + // Disregard deadline.didTimeout. Only expired work should be flushed + // during a timeout. This path is only hit for non-expired work. return false; } deadlineDidExpire = true; @@ -26085,9 +26129,24 @@ var ReactFiberReconciler$3 = ( ReactFiberReconciler$2 && ReactFiberReconciler$1 // This is hacky but makes it work with both Rollup and Jest. var reactReconciler = ReactFiberReconciler$3['default'] ? ReactFiberReconciler$3['default'] : ReactFiberReconciler$3; +function createPortal$1(children, containerInfo, +// TODO: figure out the API for cross-renderer implementation. +implementation) { + var key = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; + + return { + // This tag allow us to uniquely identify this as a React Portal + $$typeof: REACT_PORTAL_TYPE, + key: key == null ? null : '' + key, + children: children, + containerInfo: containerInfo, + implementation: implementation + }; +} + // TODO: this is special because it gets imported during build. -var ReactVersion = '16.1.1'; +var ReactVersion = '16.2.0'; // a requestAnimationFrame, storing the time for the start of the frame, then // scheduling a postMessage which gets scheduled after paint. Within the @@ -26117,24 +26176,28 @@ if (hasNativePerformanceNow) { // TODO: There's no way to cancel, because Fiber doesn't atm. var rIC = void 0; +var cIC = void 0; if (!ExecutionEnvironment.canUseDOM) { rIC = function (frameCallback) { - setTimeout(function () { + return setTimeout(function () { frameCallback({ timeRemaining: function () { return Infinity; } }); }); - return 0; }; -} else if (typeof requestIdleCallback !== 'function') { - // Polyfill requestIdleCallback. + cIC = function (timeoutID) { + clearTimeout(timeoutID); + }; +} else if (typeof requestIdleCallback !== 'function' || typeof cancelIdleCallback !== 'function') { + // Polyfill requestIdleCallback and cancelIdleCallback var scheduledRICCallback = null; - var isIdleScheduled = false; + var timeoutTime = -1; + var isAnimationFrameScheduled = false; var frameDeadline = 0; @@ -26147,17 +26210,21 @@ if (!ExecutionEnvironment.canUseDOM) { var frameDeadlineObject; if (hasNativePerformanceNow) { frameDeadlineObject = { + didTimeout: false, timeRemaining: function () { // We assume that if we have a performance timer that the rAF callback // gets a performance timer value. Not sure if this is always true. - return frameDeadline - performance.now(); + var remaining = frameDeadline - performance.now(); + return remaining > 0 ? remaining : 0; } }; } else { frameDeadlineObject = { + didTimeout: false, timeRemaining: function () { // Fallback to Date.now() - return frameDeadline - Date.now(); + var remaining = frameDeadline - Date.now(); + return remaining > 0 ? remaining : 0; } }; } @@ -26168,7 +26235,33 @@ if (!ExecutionEnvironment.canUseDOM) { if (event.source !== window || event.data !== messageKey) { return; } + isIdleScheduled = false; + + var currentTime = now(); + if (frameDeadline - currentTime <= 0) { + // There's no time left in this idle period. Check if the callback has + // a timeout and whether it's been exceeded. + if (timeoutTime !== -1 && timeoutTime <= currentTime) { + // Exceeded the timeout. Invoke the callback even though there's no + // time left. + frameDeadlineObject.didTimeout = true; + } else { + // No timeout. + if (!isAnimationFrameScheduled) { + // Schedule another animation callback so we retry later. + isAnimationFrameScheduled = true; + requestAnimationFrame(animationTick); + } + // Exit without invoking the callback. + return; + } + } else { + // There's still time left in this idle period. + frameDeadlineObject.didTimeout = false; + } + + timeoutTime = -1; var callback = scheduledRICCallback; scheduledRICCallback = null; if (callback !== null) { @@ -26206,10 +26299,13 @@ if (!ExecutionEnvironment.canUseDOM) { } }; - rIC = function (callback) { + rIC = function (callback, options) { // This assumes that we only schedule one callback at a time because that's // how Fiber uses it. scheduledRICCallback = callback; + if (options != null && typeof options.timeout === 'number') { + timeoutTime = now() + options.timeout; + } if (!isAnimationFrameScheduled) { // If rAF didn't already schedule one, we need to schedule a frame. // TODO: If this rAF doesn't materialize because the browser throttles, we @@ -26220,8 +26316,15 @@ if (!ExecutionEnvironment.canUseDOM) { } return 0; }; + + cIC = function () { + scheduledRICCallback = null; + isIdleScheduled = false; + timeoutTime = -1; + }; } else { - rIC = requestIdleCallback; + rIC = window.requestIdleCallback; + cIC = window.cancelIdleCallback; } /** @@ -26611,6 +26714,14 @@ function initWrapperState(element, props) { }; } +function updateChecked(element, props) { + var node = element; + var checked = props.checked; + if (checked != null) { + setValueForProperty(node, 'checked', checked); + } +} + function updateWrapper(element, props) { var node = element; { @@ -26626,10 +26737,7 @@ function updateWrapper(element, props) { } } - var checked = props.checked; - if (checked != null) { - setValueForProperty(node, 'checked', checked || false); - } + updateChecked(element, props); var value = props.value; if (value != null) { @@ -26755,6 +26863,11 @@ function updateNamedCousins(rootNode, props) { // mixing React radio buttons with non-React ones. var otherProps = getFiberCurrentPropsFromNode$1(otherNode); !otherProps ? invariant(false, 'ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.') : void 0; + + // We need update the tracked value on the named cousin since the value + // was changed but the input saw no event or value set + updateValueIfChanged(otherNode); + // If this is a controlled radio button group, forcing the input that // was previously checked to update will cause it to be come re-checked // as appropriate. @@ -26802,7 +26915,6 @@ function postMountWrapper$1(element, props) { function getHostProps$1(element, props) { var hostProps = _assign({ children: undefined }, props); - var content = flattenChildren(props.children); if (content) { @@ -27028,11 +27140,10 @@ function initWrapperState$2(element, props) { } } - var value = props.value; - var initialValue = value; + var initialValue = props.value; // Only bother fetching default value if we're going to use it - if (value == null) { + if (initialValue == null) { var defaultValue = props.defaultValue; // TODO (yungsters): Remove support for children content in