diff options
Diffstat (limited to 'examples/common.js')
-rw-r--r-- | examples/common.js | 3094 |
1 files changed, 2006 insertions, 1088 deletions
diff --git a/examples/common.js b/examples/common.js index 74b6347..364f7d1 100644 --- a/examples/common.js +++ b/examples/common.js | |||
@@ -258,40 +258,12 @@ | |||
258 | // shim for using process in browser | 258 | // shim for using process in browser |
259 | 259 | ||
260 | var process = module.exports = {}; | 260 | var process = module.exports = {}; |
261 | |||
262 | // cached from whatever global is present so that test runners that stub it | ||
263 | // don't break things. But we need to wrap it in a try catch in case it is | ||
264 | // wrapped in strict mode code which doesn't define any globals. It's inside a | ||
265 | // function because try/catches deoptimize in certain engines. | ||
266 | |||
267 | var cachedSetTimeout; | ||
268 | var cachedClearTimeout; | ||
269 | |||
270 | (function () { | ||
271 | try { | ||
272 | cachedSetTimeout = setTimeout; | ||
273 | } catch (e) { | ||
274 | cachedSetTimeout = function () { | ||
275 | throw new Error('setTimeout is not defined'); | ||
276 | } | ||
277 | } | ||
278 | try { | ||
279 | cachedClearTimeout = clearTimeout; | ||
280 | } catch (e) { | ||
281 | cachedClearTimeout = function () { | ||
282 | throw new Error('clearTimeout is not defined'); | ||
283 | } | ||
284 | } | ||
285 | } ()) | ||
286 | var queue = []; | 261 | var queue = []; |
287 | var draining = false; | 262 | var draining = false; |
288 | var currentQueue; | 263 | var currentQueue; |
289 | var queueIndex = -1; | 264 | var queueIndex = -1; |
290 | 265 | ||
291 | function cleanUpNextTick() { | 266 | function cleanUpNextTick() { |
292 | if (!draining || !currentQueue) { | ||
293 | return; | ||
294 | } | ||
295 | draining = false; | 267 | draining = false; |
296 | if (currentQueue.length) { | 268 | if (currentQueue.length) { |
297 | queue = currentQueue.concat(queue); | 269 | queue = currentQueue.concat(queue); |
@@ -307,7 +279,7 @@ | |||
307 | if (draining) { | 279 | if (draining) { |
308 | return; | 280 | return; |
309 | } | 281 | } |
310 | var timeout = cachedSetTimeout(cleanUpNextTick); | 282 | var timeout = setTimeout(cleanUpNextTick); |
311 | draining = true; | 283 | draining = true; |
312 | 284 | ||
313 | var len = queue.length; | 285 | var len = queue.length; |
@@ -324,7 +296,7 @@ | |||
324 | } | 296 | } |
325 | currentQueue = null; | 297 | currentQueue = null; |
326 | draining = false; | 298 | draining = false; |
327 | cachedClearTimeout(timeout); | 299 | clearTimeout(timeout); |
328 | } | 300 | } |
329 | 301 | ||
330 | process.nextTick = function (fun) { | 302 | process.nextTick = function (fun) { |
@@ -336,7 +308,7 @@ | |||
336 | } | 308 | } |
337 | queue.push(new Item(fun, args)); | 309 | queue.push(new Item(fun, args)); |
338 | if (queue.length === 1 && !draining) { | 310 | if (queue.length === 1 && !draining) { |
339 | cachedSetTimeout(drainQueue, 0); | 311 | setTimeout(drainQueue, 0); |
340 | } | 312 | } |
341 | }; | 313 | }; |
342 | 314 | ||
@@ -1142,7 +1114,7 @@ | |||
1142 | * will remain to ensure logic does not differ in production. | 1114 | * will remain to ensure logic does not differ in production. |
1143 | */ | 1115 | */ |
1144 | 1116 | ||
1145 | function invariant(condition, format, a, b, c, d, e, f) { | 1117 | var invariant = function (condition, format, a, b, c, d, e, f) { |
1146 | if (process.env.NODE_ENV !== 'production') { | 1118 | if (process.env.NODE_ENV !== 'production') { |
1147 | if (format === undefined) { | 1119 | if (format === undefined) { |
1148 | throw new Error('invariant requires an error message argument'); | 1120 | throw new Error('invariant requires an error message argument'); |
@@ -1156,16 +1128,15 @@ | |||
1156 | } else { | 1128 | } else { |
1157 | var args = [a, b, c, d, e, f]; | 1129 | var args = [a, b, c, d, e, f]; |
1158 | var argIndex = 0; | 1130 | var argIndex = 0; |
1159 | error = new Error(format.replace(/%s/g, function () { | 1131 | error = new Error('Invariant Violation: ' + format.replace(/%s/g, function () { |
1160 | return args[argIndex++]; | 1132 | return args[argIndex++]; |
1161 | })); | 1133 | })); |
1162 | error.name = 'Invariant Violation'; | ||
1163 | } | 1134 | } |
1164 | 1135 | ||
1165 | error.framesToPop = 1; // we don't care about invariant's own frame | 1136 | error.framesToPop = 1; // we don't care about invariant's own frame |
1166 | throw error; | 1137 | throw error; |
1167 | } | 1138 | } |
1168 | } | 1139 | }; |
1169 | 1140 | ||
1170 | module.exports = invariant; | 1141 | module.exports = invariant; |
1171 | /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) | 1142 | /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) |
@@ -8026,10 +7997,6 @@ | |||
8026 | } | 7997 | } |
8027 | }; | 7998 | }; |
8028 | 7999 | ||
8029 | function registerNullComponentID() { | ||
8030 | ReactEmptyComponentRegistry.registerNullComponentID(this._rootNodeID); | ||
8031 | } | ||
8032 | |||
8033 | var ReactEmptyComponent = function (instantiate) { | 8000 | var ReactEmptyComponent = function (instantiate) { |
8034 | this._currentElement = null; | 8001 | this._currentElement = null; |
8035 | this._rootNodeID = null; | 8002 | this._rootNodeID = null; |
@@ -8038,7 +8005,7 @@ | |||
8038 | assign(ReactEmptyComponent.prototype, { | 8005 | assign(ReactEmptyComponent.prototype, { |
8039 | construct: function (element) {}, | 8006 | construct: function (element) {}, |
8040 | mountComponent: function (rootID, transaction, context) { | 8007 | mountComponent: function (rootID, transaction, context) { |
8041 | transaction.getReactMountReady().enqueue(registerNullComponentID, this); | 8008 | ReactEmptyComponentRegistry.registerNullComponentID(rootID); |
8042 | this._rootNodeID = rootID; | 8009 | this._rootNodeID = rootID; |
8043 | return ReactReconciler.mountComponent(this._renderedComponent, rootID, transaction, context); | 8010 | return ReactReconciler.mountComponent(this._renderedComponent, rootID, transaction, context); |
8044 | }, | 8011 | }, |
@@ -9388,7 +9355,6 @@ | |||
9388 | */ | 9355 | */ |
9389 | var EventInterface = { | 9356 | var EventInterface = { |
9390 | type: null, | 9357 | type: null, |
9391 | target: null, | ||
9392 | // currentTarget is set when dispatching; no use in copying it here | 9358 | // currentTarget is set when dispatching; no use in copying it here |
9393 | currentTarget: emptyFunction.thatReturnsNull, | 9359 | currentTarget: emptyFunction.thatReturnsNull, |
9394 | eventPhase: null, | 9360 | eventPhase: null, |
@@ -9422,6 +9388,8 @@ | |||
9422 | this.dispatchConfig = dispatchConfig; | 9388 | this.dispatchConfig = dispatchConfig; |
9423 | this.dispatchMarker = dispatchMarker; | 9389 | this.dispatchMarker = dispatchMarker; |
9424 | this.nativeEvent = nativeEvent; | 9390 | this.nativeEvent = nativeEvent; |
9391 | this.target = nativeEventTarget; | ||
9392 | this.currentTarget = nativeEventTarget; | ||
9425 | 9393 | ||
9426 | var Interface = this.constructor.Interface; | 9394 | var Interface = this.constructor.Interface; |
9427 | for (var propName in Interface) { | 9395 | for (var propName in Interface) { |
@@ -9432,11 +9400,7 @@ | |||
9432 | if (normalize) { | 9400 | if (normalize) { |
9433 | this[propName] = normalize(nativeEvent); | 9401 | this[propName] = normalize(nativeEvent); |
9434 | } else { | 9402 | } else { |
9435 | if (propName === 'target') { | 9403 | this[propName] = nativeEvent[propName]; |
9436 | this.target = nativeEventTarget; | ||
9437 | } else { | ||
9438 | this[propName] = nativeEvent[propName]; | ||
9439 | } | ||
9440 | } | 9404 | } |
9441 | } | 9405 | } |
9442 | 9406 | ||
@@ -10599,8 +10563,8 @@ | |||
10599 | */ | 10563 | */ |
10600 | // autoCapitalize and autoCorrect are supported in Mobile Safari for | 10564 | // autoCapitalize and autoCorrect are supported in Mobile Safari for |
10601 | // keyboard hints. | 10565 | // keyboard hints. |
10602 | autoCapitalize: MUST_USE_ATTRIBUTE, | 10566 | autoCapitalize: null, |
10603 | autoCorrect: MUST_USE_ATTRIBUTE, | 10567 | autoCorrect: null, |
10604 | // autoSave allows WebKit/Blink to persist values of input fields on page reloads | 10568 | // autoSave allows WebKit/Blink to persist values of input fields on page reloads |
10605 | autoSave: null, | 10569 | autoSave: null, |
10606 | // color is for Safari mask-icon link | 10570 | // color is for Safari mask-icon link |
@@ -10631,7 +10595,9 @@ | |||
10631 | httpEquiv: 'http-equiv' | 10595 | httpEquiv: 'http-equiv' |
10632 | }, | 10596 | }, |
10633 | DOMPropertyNames: { | 10597 | DOMPropertyNames: { |
10598 | autoCapitalize: 'autocapitalize', | ||
10634 | autoComplete: 'autocomplete', | 10599 | autoComplete: 'autocomplete', |
10600 | autoCorrect: 'autocorrect', | ||
10635 | autoFocus: 'autofocus', | 10601 | autoFocus: 'autofocus', |
10636 | autoPlay: 'autoplay', | 10602 | autoPlay: 'autoplay', |
10637 | autoSave: 'autosave', | 10603 | autoSave: 'autosave', |
@@ -13285,10 +13251,7 @@ | |||
13285 | } | 13251 | } |
13286 | }); | 13252 | }); |
13287 | 13253 | ||
13288 | if (content) { | 13254 | nativeProps.children = content; |
13289 | nativeProps.children = content; | ||
13290 | } | ||
13291 | |||
13292 | return nativeProps; | 13255 | return nativeProps; |
13293 | } | 13256 | } |
13294 | 13257 | ||
@@ -13713,7 +13676,7 @@ | |||
13713 | var value = LinkedValueUtils.getValue(props); | 13676 | var value = LinkedValueUtils.getValue(props); |
13714 | 13677 | ||
13715 | if (value != null) { | 13678 | if (value != null) { |
13716 | updateOptions(this, Boolean(props.multiple), value); | 13679 | updateOptions(this, props, value); |
13717 | } | 13680 | } |
13718 | } | 13681 | } |
13719 | } | 13682 | } |
@@ -16748,14 +16711,11 @@ | |||
16748 | * @typechecks | 16711 | * @typechecks |
16749 | */ | 16712 | */ |
16750 | 16713 | ||
16751 | /* eslint-disable fb-www/typeof-undefined */ | ||
16752 | |||
16753 | /** | 16714 | /** |
16754 | * Same as document.activeElement but wraps in a try-catch block. In IE it is | 16715 | * Same as document.activeElement but wraps in a try-catch block. In IE it is |
16755 | * not safe to call document.activeElement if there is nothing focused. | 16716 | * not safe to call document.activeElement if there is nothing focused. |
16756 | * | 16717 | * |
16757 | * The activeElement will be null only if the document or document body is not | 16718 | * The activeElement will be null only if the document or document body is not yet defined. |
16758 | * yet defined. | ||
16759 | */ | 16719 | */ |
16760 | 'use strict'; | 16720 | 'use strict'; |
16761 | 16721 | ||
@@ -16763,6 +16723,7 @@ | |||
16763 | if (typeof document === 'undefined') { | 16723 | if (typeof document === 'undefined') { |
16764 | return null; | 16724 | return null; |
16765 | } | 16725 | } |
16726 | |||
16766 | try { | 16727 | try { |
16767 | return document.activeElement || document.body; | 16728 | return document.activeElement || document.body; |
16768 | } catch (e) { | 16729 | } catch (e) { |
@@ -18502,9 +18463,7 @@ | |||
18502 | 'setValueForProperty': 'update attribute', | 18463 | 'setValueForProperty': 'update attribute', |
18503 | 'setValueForAttribute': 'update attribute', | 18464 | 'setValueForAttribute': 'update attribute', |
18504 | 'deleteValueForProperty': 'remove attribute', | 18465 | 'deleteValueForProperty': 'remove attribute', |
18505 | 'setValueForStyles': 'update styles', | 18466 | 'dangerouslyReplaceNodeWithMarkupByID': 'replace' |
18506 | 'replaceNodeWithMarkup': 'replace', | ||
18507 | 'updateTextContent': 'set textContent' | ||
18508 | }; | 18467 | }; |
18509 | 18468 | ||
18510 | function getTotalTime(measurements) { | 18469 | function getTotalTime(measurements) { |
@@ -18696,24 +18655,19 @@ | |||
18696 | 'use strict'; | 18655 | 'use strict'; |
18697 | 18656 | ||
18698 | var performance = __webpack_require__(147); | 18657 | var performance = __webpack_require__(147); |
18699 | 18658 | var curPerformance = performance; | |
18700 | var performanceNow; | ||
18701 | 18659 | ||
18702 | /** | 18660 | /** |
18703 | * Detect if we can use `window.performance.now()` and gracefully fallback to | 18661 | * Detect if we can use `window.performance.now()` and gracefully fallback to |
18704 | * `Date.now()` if it doesn't exist. We need to support Firefox < 15 for now | 18662 | * `Date.now()` if it doesn't exist. We need to support Firefox < 15 for now |
18705 | * because of Facebook's testing infrastructure. | 18663 | * because of Facebook's testing infrastructure. |
18706 | */ | 18664 | */ |
18707 | if (performance.now) { | 18665 | if (!curPerformance || !curPerformance.now) { |
18708 | performanceNow = function () { | 18666 | curPerformance = Date; |
18709 | return performance.now(); | ||
18710 | }; | ||
18711 | } else { | ||
18712 | performanceNow = function () { | ||
18713 | return Date.now(); | ||
18714 | }; | ||
18715 | } | 18667 | } |
18716 | 18668 | ||
18669 | var performanceNow = curPerformance.now.bind(curPerformance); | ||
18670 | |||
18717 | module.exports = performanceNow; | 18671 | module.exports = performanceNow; |
18718 | 18672 | ||
18719 | /***/ }, | 18673 | /***/ }, |
@@ -18761,7 +18715,7 @@ | |||
18761 | 18715 | ||
18762 | 'use strict'; | 18716 | 'use strict'; |
18763 | 18717 | ||
18764 | module.exports = '0.14.8'; | 18718 | module.exports = '0.14.3'; |
18765 | 18719 | ||
18766 | /***/ }, | 18720 | /***/ }, |
18767 | /* 149 */ | 18721 | /* 149 */ |
@@ -21006,22 +20960,6 @@ | |||
21006 | return this.getTime() === obj.getTime() && this.firstDayOfWeek === obj.firstDayOfWeek && this.timezoneOffset === obj.timezoneOffset && this.minimalDaysInFirstWeek === obj.minimalDaysInFirstWeek; | 20960 | return this.getTime() === obj.getTime() && this.firstDayOfWeek === obj.firstDayOfWeek && this.timezoneOffset === obj.timezoneOffset && this.minimalDaysInFirstWeek === obj.minimalDaysInFirstWeek; |
21007 | }, | 20961 | }, |
21008 | 20962 | ||
21009 | compareToDay: function compareToDay(d2) { | ||
21010 | var d1Year = this.getYear(); | ||
21011 | var d2Year = d2.getYear(); | ||
21012 | var d1Month = this.getMonth(); | ||
21013 | var d2Month = d2.getMonth(); | ||
21014 | var d1Day = this.getDayOfMonth(); | ||
21015 | var d2Day = d2.getDayOfMonth(); | ||
21016 | if (d1Year !== d2Year) { | ||
21017 | return d1Year - d2Year; | ||
21018 | } | ||
21019 | if (d1Month !== d2Month) { | ||
21020 | return d1Month - d2Month; | ||
21021 | } | ||
21022 | return d1Day - d2Day; | ||
21023 | }, | ||
21024 | |||
21025 | /* | 20963 | /* |
21026 | * Sets all the calendar field values or specified field and the time value | 20964 | * Sets all the calendar field values or specified field and the time value |
21027 | * (millisecond offset from the Epoch) of this Calendar undefined. | 20965 | * (millisecond offset from the Epoch) of this Calendar undefined. |
@@ -21037,12 +20975,6 @@ | |||
21037 | } | 20975 | } |
21038 | this.time = undefined; | 20976 | this.time = undefined; |
21039 | this.fieldsComputed = false; | 20977 | this.fieldsComputed = false; |
21040 | }, | ||
21041 | |||
21042 | toString: function toString() { | ||
21043 | // for debug | ||
21044 | var v = this; | ||
21045 | return '[GregorianCalendar]: ' + v.getYear() + '/' + v.getMonth() + '/' + v.getDayOfMonth() + ' ' + v.getHourOfDay() + ':' + v.getMinutes() + ':' + v.getSeconds(); | ||
21046 | } | 20978 | } |
21047 | }; | 20979 | }; |
21048 | 20980 | ||
@@ -21414,7 +21346,6 @@ | |||
21414 | Letter Date or Time Component Presentation Examples | 21346 | Letter Date or Time Component Presentation Examples |
21415 | G Era designator Text AD | 21347 | G Era designator Text AD |
21416 | y Year Year 1996; 96 | 21348 | y Year Year 1996; 96 |
21417 | Y WeekYear WeekYear 1996; 96 | ||
21418 | M Month in year Month July; Jul; 07 | 21349 | M Month in year Month July; Jul; 07 |
21419 | w Week in year Number 27 | 21350 | w Week in year Number 27 |
21420 | W Week in month Number 2 | 21351 | W Week in month Number 2 |
@@ -21451,17 +21382,14 @@ | |||
21451 | patternChars[GregorianCalendar.WEEK_OF_MONTH] = 'W'; | 21382 | patternChars[GregorianCalendar.WEEK_OF_MONTH] = 'W'; |
21452 | patternChars[GregorianCalendar.DAY_OF_YEAR] = 'D'; | 21383 | patternChars[GregorianCalendar.DAY_OF_YEAR] = 'D'; |
21453 | patternChars[GregorianCalendar.DAY_OF_WEEK_IN_MONTH] = 'F'; | 21384 | patternChars[GregorianCalendar.DAY_OF_WEEK_IN_MONTH] = 'F'; |
21454 | patternChars.push('Y'); | ||
21455 | 21385 | ||
21456 | patternChars.forEach(function (v, key) { | 21386 | (function init() { |
21457 | var k = key; | 21387 | for (var index in patternChars) { |
21458 | if (v === 'Y') { | 21388 | if (patternChars.hasOwnProperty(index)) { |
21459 | k = GregorianCalendar.YEAR; | 21389 | calendarIndexMap[patternChars[index]] = index; |
21460 | } | 21390 | } |
21461 | if (v) { | ||
21462 | calendarIndexMap[v] = k; | ||
21463 | } | 21391 | } |
21464 | }); | 21392 | })(); |
21465 | 21393 | ||
21466 | function mix(t, s) { | 21394 | function mix(t, s) { |
21467 | for (var p in s) { | 21395 | for (var p in s) { |
@@ -21766,13 +21694,6 @@ | |||
21766 | value = calendar.getYear() > 0 ? 1 : 0; | 21694 | value = calendar.getYear() > 0 ? 1 : 0; |
21767 | current = locale.eras[value]; | 21695 | current = locale.eras[value]; |
21768 | break; | 21696 | break; |
21769 | case 'Y': | ||
21770 | value = calendar.getWeekYear(); | ||
21771 | if (value <= 0) { | ||
21772 | value = 1 - value; | ||
21773 | } | ||
21774 | current = zeroPaddingNumber(value, 2, count !== 2 ? MAX_VALUE : 2); | ||
21775 | break; | ||
21776 | case 'y': | 21697 | case 'y': |
21777 | value = calendar.getYear(); | 21698 | value = calendar.getYear(); |
21778 | if (value <= 0) { | 21699 | if (value <= 0) { |
@@ -22354,19 +22275,19 @@ | |||
22354 | 22275 | ||
22355 | var _rcTrigger2 = _interopRequireDefault(_rcTrigger); | 22276 | var _rcTrigger2 = _interopRequireDefault(_rcTrigger); |
22356 | 22277 | ||
22357 | var _modulePanel = __webpack_require__(204); | 22278 | var _modulePanel = __webpack_require__(218); |
22358 | 22279 | ||
22359 | var _modulePanel2 = _interopRequireDefault(_modulePanel); | 22280 | var _modulePanel2 = _interopRequireDefault(_modulePanel); |
22360 | 22281 | ||
22361 | var _utilPlacements = __webpack_require__(212); | 22282 | var _utilPlacements = __webpack_require__(225); |
22362 | 22283 | ||
22363 | var _utilPlacements2 = _interopRequireDefault(_utilPlacements); | 22284 | var _utilPlacements2 = _interopRequireDefault(_utilPlacements); |
22364 | 22285 | ||
22365 | var _mixinCommonMixin = __webpack_require__(205); | 22286 | var _mixinCommonMixin = __webpack_require__(219); |
22366 | 22287 | ||
22367 | var _mixinCommonMixin2 = _interopRequireDefault(_mixinCommonMixin); | 22288 | var _mixinCommonMixin2 = _interopRequireDefault(_mixinCommonMixin); |
22368 | 22289 | ||
22369 | var _utilIndex = __webpack_require__(213); | 22290 | var _utilIndex = __webpack_require__(226); |
22370 | 22291 | ||
22371 | function noop() {} | 22292 | function noop() {} |
22372 | 22293 | ||
@@ -22409,6 +22330,7 @@ | |||
22409 | 22330 | ||
22410 | getDefaultProps: function getDefaultProps() { | 22331 | getDefaultProps: function getDefaultProps() { |
22411 | return { | 22332 | return { |
22333 | prefixCls: 'rc-time-picker', | ||
22412 | defaultOpen: false, | 22334 | defaultOpen: false, |
22413 | style: {}, | 22335 | style: {}, |
22414 | className: '', | 22336 | className: '', |
@@ -22645,13 +22567,13 @@ | |||
22645 | 22567 | ||
22646 | 'use strict'; | 22568 | 'use strict'; |
22647 | 22569 | ||
22648 | Object.defineProperty(exports, "__esModule", { | 22570 | Object.defineProperty(exports, '__esModule', { |
22649 | value: true | 22571 | value: true |
22650 | }); | 22572 | }); |
22651 | 22573 | ||
22652 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | 22574 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; |
22653 | 22575 | ||
22654 | var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; | 22576 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } |
22655 | 22577 | ||
22656 | var _react = __webpack_require__(3); | 22578 | var _react = __webpack_require__(3); |
22657 | 22579 | ||
@@ -22661,25 +22583,13 @@ | |||
22661 | 22583 | ||
22662 | var _reactDom2 = _interopRequireDefault(_reactDom); | 22584 | var _reactDom2 = _interopRequireDefault(_reactDom); |
22663 | 22585 | ||
22664 | var _createChainedFunction = __webpack_require__(173); | 22586 | var _rcUtil = __webpack_require__(173); |
22665 | |||
22666 | var _createChainedFunction2 = _interopRequireDefault(_createChainedFunction); | ||
22667 | |||
22668 | var _contains = __webpack_require__(174); | ||
22669 | |||
22670 | var _contains2 = _interopRequireDefault(_contains); | ||
22671 | 22587 | ||
22672 | var _addEventListener = __webpack_require__(175); | 22588 | var _Popup = __webpack_require__(196); |
22673 | |||
22674 | var _addEventListener2 = _interopRequireDefault(_addEventListener); | ||
22675 | |||
22676 | var _Popup = __webpack_require__(180); | ||
22677 | 22589 | ||
22678 | var _Popup2 = _interopRequireDefault(_Popup); | 22590 | var _Popup2 = _interopRequireDefault(_Popup); |
22679 | 22591 | ||
22680 | var _utils = __webpack_require__(203); | 22592 | var _utils = __webpack_require__(217); |
22681 | |||
22682 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
22683 | 22593 | ||
22684 | function noop() {} | 22594 | function noop() {} |
22685 | 22595 | ||
@@ -22687,21 +22597,16 @@ | |||
22687 | return ''; | 22597 | return ''; |
22688 | } | 22598 | } |
22689 | 22599 | ||
22690 | var ALL_HANDLERS = ['onClick', 'onMouseDown', 'onTouchStart', 'onMouseEnter', 'onMouseLeave', 'onFocus', 'onBlur']; | 22600 | var Trigger = _react2['default'].createClass({ |
22691 | |||
22692 | var Trigger = _react2["default"].createClass({ | ||
22693 | displayName: 'Trigger', | 22601 | displayName: 'Trigger', |
22694 | 22602 | ||
22695 | propTypes: { | 22603 | propTypes: { |
22696 | action: _react.PropTypes.any, | 22604 | action: _react.PropTypes.any, |
22697 | showAction: _react.PropTypes.any, | ||
22698 | hideAction: _react.PropTypes.any, | ||
22699 | getPopupClassNameFromAlign: _react.PropTypes.any, | 22605 | getPopupClassNameFromAlign: _react.PropTypes.any, |
22700 | onPopupVisibleChange: _react.PropTypes.func, | 22606 | onPopupVisibleChange: _react.PropTypes.func, |
22701 | afterPopupVisibleChange: _react.PropTypes.func, | 22607 | afterPopupVisibleChange: _react.PropTypes.func, |
22702 | popup: _react.PropTypes.node.isRequired, | 22608 | popup: _react.PropTypes.node.isRequired, |
22703 | popupStyle: _react.PropTypes.object, | 22609 | popupStyle: _react.PropTypes.object, |
22704 | prefixCls: _react.PropTypes.string, | ||
22705 | popupClassName: _react.PropTypes.string, | 22610 | popupClassName: _react.PropTypes.string, |
22706 | popupPlacement: _react.PropTypes.string, | 22611 | popupPlacement: _react.PropTypes.string, |
22707 | builtinPlacements: _react.PropTypes.object, | 22612 | builtinPlacements: _react.PropTypes.object, |
@@ -22709,17 +22614,10 @@ | |||
22709 | popupAnimation: _react.PropTypes.any, | 22614 | popupAnimation: _react.PropTypes.any, |
22710 | mouseEnterDelay: _react.PropTypes.number, | 22615 | mouseEnterDelay: _react.PropTypes.number, |
22711 | mouseLeaveDelay: _react.PropTypes.number, | 22616 | mouseLeaveDelay: _react.PropTypes.number, |
22712 | zIndex: _react.PropTypes.number, | ||
22713 | focusDelay: _react.PropTypes.number, | ||
22714 | blurDelay: _react.PropTypes.number, | ||
22715 | getPopupContainer: _react.PropTypes.func, | 22617 | getPopupContainer: _react.PropTypes.func, |
22716 | destroyPopupOnHide: _react.PropTypes.bool, | 22618 | destroyPopupOnHide: _react.PropTypes.bool, |
22717 | mask: _react.PropTypes.bool, | ||
22718 | onPopupAlign: _react.PropTypes.func, | ||
22719 | popupAlign: _react.PropTypes.object, | 22619 | popupAlign: _react.PropTypes.object, |
22720 | popupVisible: _react.PropTypes.bool, | 22620 | popupVisible: _react.PropTypes.bool |
22721 | maskTransitionName: _react.PropTypes.string, | ||
22722 | maskAnimation: _react.PropTypes.string | ||
22723 | }, | 22621 | }, |
22724 | 22622 | ||
22725 | getDefaultProps: function getDefaultProps() { | 22623 | getDefaultProps: function getDefaultProps() { |
@@ -22728,39 +22626,34 @@ | |||
22728 | getPopupClassNameFromAlign: returnEmptyString, | 22626 | getPopupClassNameFromAlign: returnEmptyString, |
22729 | onPopupVisibleChange: noop, | 22627 | onPopupVisibleChange: noop, |
22730 | afterPopupVisibleChange: noop, | 22628 | afterPopupVisibleChange: noop, |
22731 | onPopupAlign: noop, | ||
22732 | popupClassName: '', | 22629 | popupClassName: '', |
22733 | mouseEnterDelay: 0, | 22630 | mouseEnterDelay: 0, |
22734 | mouseLeaveDelay: 0.1, | 22631 | mouseLeaveDelay: 0.1, |
22735 | focusDelay: 0, | ||
22736 | blurDelay: 0.15, | ||
22737 | popupStyle: {}, | 22632 | popupStyle: {}, |
22738 | destroyPopupOnHide: false, | 22633 | destroyPopupOnHide: false, |
22739 | popupAlign: {}, | 22634 | popupAlign: {}, |
22740 | defaultPopupVisible: false, | 22635 | defaultPopupVisible: false, |
22741 | mask: false, | 22636 | action: [] |
22742 | action: [], | ||
22743 | showAction: [], | ||
22744 | hideAction: [] | ||
22745 | }; | 22637 | }; |
22746 | }, | 22638 | }, |
22639 | |||
22747 | getInitialState: function getInitialState() { | 22640 | getInitialState: function getInitialState() { |
22748 | var props = this.props; | 22641 | var props = this.props; |
22749 | var popupVisible = void 0; | 22642 | var popupVisible = undefined; |
22750 | if ('popupVisible' in props) { | 22643 | if ('popupVisible' in props) { |
22751 | popupVisible = !!props.popupVisible; | 22644 | popupVisible = !!props.popupVisible; |
22752 | } else { | 22645 | } else { |
22753 | popupVisible = !!props.defaultPopupVisible; | 22646 | popupVisible = !!props.defaultPopupVisible; |
22754 | } | 22647 | } |
22755 | return { | 22648 | return { popupVisible: popupVisible }; |
22756 | popupVisible: popupVisible | ||
22757 | }; | ||
22758 | }, | 22649 | }, |
22650 | |||
22759 | componentDidMount: function componentDidMount() { | 22651 | componentDidMount: function componentDidMount() { |
22760 | this.componentDidUpdate({}, { | 22652 | this.componentDidUpdate({}, { |
22761 | popupVisible: this.state.popupVisible | 22653 | popupVisible: this.state.popupVisible |
22762 | }); | 22654 | }); |
22763 | }, | 22655 | }, |
22656 | |||
22764 | componentWillReceiveProps: function componentWillReceiveProps(nextProps) { | 22657 | componentWillReceiveProps: function componentWillReceiveProps(nextProps) { |
22765 | if ('popupVisible' in nextProps) { | 22658 | if ('popupVisible' in nextProps) { |
22766 | this.setState({ | 22659 | this.setState({ |
@@ -22768,18 +22661,18 @@ | |||
22768 | }); | 22661 | }); |
22769 | } | 22662 | } |
22770 | }, | 22663 | }, |
22664 | |||
22771 | componentDidUpdate: function componentDidUpdate(prevProps, prevState) { | 22665 | componentDidUpdate: function componentDidUpdate(prevProps, prevState) { |
22772 | var _this = this; | 22666 | var _this = this; |
22773 | 22667 | ||
22774 | var props = this.props; | 22668 | var props = this.props; |
22775 | var state = this.state; | 22669 | var state = this.state; |
22776 | if (this.popupRendered) { | 22670 | if (this.popupRendered) { |
22777 | var _ret = function () { | 22671 | var _ret = (function () { |
22778 | var self = _this; | 22672 | var self = _this; |
22779 | self.popupInstance = _reactDom2["default"].unstable_renderSubtreeIntoContainer(_this, _this.getPopupElement(), _this.getPopupContainer(), function renderPopup() { | 22673 | _reactDom2['default'].unstable_renderSubtreeIntoContainer(_this, _this.getPopupElement(), _this.getPopupContainer(), function renderPopup() { |
22780 | /* eslint react/no-is-mounted:0 */ | ||
22781 | if (this.isMounted()) { | 22674 | if (this.isMounted()) { |
22782 | self.popupDomNode = this.getPopupDomNode(); | 22675 | self.popupDomNode = _reactDom2['default'].findDOMNode(this); |
22783 | } else { | 22676 | } else { |
22784 | self.popupDomNode = null; | 22677 | self.popupDomNode = null; |
22785 | } | 22678 | } |
@@ -22787,14 +22680,14 @@ | |||
22787 | props.afterPopupVisibleChange(state.popupVisible); | 22680 | props.afterPopupVisibleChange(state.popupVisible); |
22788 | } | 22681 | } |
22789 | }); | 22682 | }); |
22790 | if (_this.isClickToHide()) { | 22683 | if (props.action.indexOf('click') !== -1) { |
22791 | if (state.popupVisible) { | 22684 | if (state.popupVisible) { |
22792 | if (!_this.clickOutsideHandler) { | 22685 | if (!_this.clickOutsideHandler) { |
22793 | _this.clickOutsideHandler = (0, _addEventListener2["default"])(document, 'mousedown', _this.onDocumentClick); | 22686 | _this.clickOutsideHandler = _rcUtil.Dom.addEventListener(document, 'mousedown', _this.onDocumentClick); |
22794 | _this.touchOutsideHandler = (0, _addEventListener2["default"])(document, 'touchstart', _this.onDocumentClick); | 22687 | _this.touchOutsideHandler = _rcUtil.Dom.addEventListener(document, 'touchstart', _this.onDocumentClick); |
22795 | } | 22688 | } |
22796 | return { | 22689 | return { |
22797 | v: void 0 | 22690 | v: undefined |
22798 | }; | 22691 | }; |
22799 | } | 22692 | } |
22800 | } | 22693 | } |
@@ -22804,19 +22697,28 @@ | |||
22804 | _this.clickOutsideHandler = null; | 22697 | _this.clickOutsideHandler = null; |
22805 | _this.touchOutsideHandler = null; | 22698 | _this.touchOutsideHandler = null; |
22806 | } | 22699 | } |
22807 | }(); | 22700 | })(); |
22808 | 22701 | ||
22809 | if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === "object") return _ret.v; | 22702 | if (typeof _ret === 'object') return _ret.v; |
22810 | } | 22703 | } |
22811 | }, | 22704 | }, |
22705 | |||
22812 | componentWillUnmount: function componentWillUnmount() { | 22706 | componentWillUnmount: function componentWillUnmount() { |
22813 | var popupContainer = this.popupContainer; | 22707 | var popupContainer = this.popupContainer; |
22814 | if (popupContainer) { | 22708 | if (popupContainer) { |
22815 | _reactDom2["default"].unmountComponentAtNode(popupContainer); | 22709 | _reactDom2['default'].unmountComponentAtNode(popupContainer); |
22816 | popupContainer.parentNode.removeChild(popupContainer); | 22710 | if (this.props.getPopupContainer) { |
22711 | var mountNode = this.props.getPopupContainer(); | ||
22712 | mountNode.removeChild(popupContainer); | ||
22713 | } else { | ||
22714 | document.body.removeChild(popupContainer); | ||
22715 | } | ||
22817 | this.popupContainer = null; | 22716 | this.popupContainer = null; |
22818 | } | 22717 | } |
22819 | this.clearDelayTimer(); | 22718 | if (this.delayTimer) { |
22719 | clearTimeout(this.delayTimer); | ||
22720 | this.delayTimer = null; | ||
22721 | } | ||
22820 | if (this.clickOutsideHandler) { | 22722 | if (this.clickOutsideHandler) { |
22821 | this.clickOutsideHandler.remove(); | 22723 | this.clickOutsideHandler.remove(); |
22822 | this.touchOutsideHandler.remove(); | 22724 | this.touchOutsideHandler.remove(); |
@@ -22824,41 +22726,36 @@ | |||
22824 | this.touchOutsideHandler = null; | 22726 | this.touchOutsideHandler = null; |
22825 | } | 22727 | } |
22826 | }, | 22728 | }, |
22729 | |||
22827 | onMouseEnter: function onMouseEnter() { | 22730 | onMouseEnter: function onMouseEnter() { |
22828 | this.delaySetPopupVisible(true, this.props.mouseEnterDelay); | 22731 | this.delaySetPopupVisible(true, this.props.mouseEnterDelay); |
22829 | }, | 22732 | }, |
22830 | onMouseLeave: function onMouseLeave(e) { | 22733 | |
22831 | // https://github.com/react-component/trigger/pull/13 | 22734 | onMouseLeave: function onMouseLeave() { |
22832 | // react bug? | ||
22833 | if (e.relatedTarget && !e.relatedTarget.setTimeout && (0, _contains2["default"])(this.popupContainer, e.relatedTarget)) { | ||
22834 | return; | ||
22835 | } | ||
22836 | this.delaySetPopupVisible(false, this.props.mouseLeaveDelay); | 22735 | this.delaySetPopupVisible(false, this.props.mouseLeaveDelay); |
22837 | }, | 22736 | }, |
22737 | |||
22838 | onFocus: function onFocus() { | 22738 | onFocus: function onFocus() { |
22839 | // incase focusin and focusout | 22739 | this.focusTime = Date.now(); |
22840 | this.clearDelayTimer(); | 22740 | this.setPopupVisible(true); |
22841 | if (this.isFocusToShow()) { | ||
22842 | this.focusTime = Date.now(); | ||
22843 | this.delaySetPopupVisible(true, this.props.focusDelay); | ||
22844 | } | ||
22845 | }, | 22741 | }, |
22742 | |||
22846 | onMouseDown: function onMouseDown() { | 22743 | onMouseDown: function onMouseDown() { |
22847 | this.preClickTime = Date.now(); | 22744 | this.preClickTime = Date.now(); |
22848 | }, | 22745 | }, |
22746 | |||
22849 | onTouchStart: function onTouchStart() { | 22747 | onTouchStart: function onTouchStart() { |
22850 | this.preTouchTime = Date.now(); | 22748 | this.preTouchTime = Date.now(); |
22851 | }, | 22749 | }, |
22750 | |||
22852 | onBlur: function onBlur() { | 22751 | onBlur: function onBlur() { |
22853 | this.clearDelayTimer(); | 22752 | this.setPopupVisible(false); |
22854 | if (this.isBlurToHide()) { | ||
22855 | this.delaySetPopupVisible(false, this.props.blurDelay); | ||
22856 | } | ||
22857 | }, | 22753 | }, |
22754 | |||
22858 | onClick: function onClick(event) { | 22755 | onClick: function onClick(event) { |
22859 | // focus will trigger click | 22756 | // focus will trigger click |
22860 | if (this.focusTime) { | 22757 | if (this.focusTime) { |
22861 | var preTime = void 0; | 22758 | var preTime = undefined; |
22862 | if (this.preClickTime && this.preTouchTime) { | 22759 | if (this.preClickTime && this.preTouchTime) { |
22863 | preTime = Math.min(this.preClickTime, this.preTouchTime); | 22760 | preTime = Math.min(this.preClickTime, this.preTouchTime); |
22864 | } else if (this.preClickTime) { | 22761 | } else if (this.preClickTime) { |
@@ -22874,34 +22771,36 @@ | |||
22874 | this.preClickTime = 0; | 22771 | this.preClickTime = 0; |
22875 | this.preTouchTime = 0; | 22772 | this.preTouchTime = 0; |
22876 | event.preventDefault(); | 22773 | event.preventDefault(); |
22877 | var nextVisible = !this.state.popupVisible; | 22774 | this.setPopupVisible(!this.state.popupVisible); |
22878 | if (this.isClickToHide() && !nextVisible || nextVisible && this.isClickToShow()) { | ||
22879 | this.setPopupVisible(!this.state.popupVisible); | ||
22880 | } | ||
22881 | }, | 22775 | }, |
22776 | |||
22882 | onDocumentClick: function onDocumentClick(event) { | 22777 | onDocumentClick: function onDocumentClick(event) { |
22883 | var target = event.target; | 22778 | var target = event.target; |
22884 | var root = (0, _reactDom.findDOMNode)(this); | 22779 | var root = _reactDom2['default'].findDOMNode(this); |
22885 | var popupNode = this.getPopupDomNode(); | 22780 | var popupNode = this.getPopupDomNode(); |
22886 | if (!(0, _contains2["default"])(root, target) && !(0, _contains2["default"])(popupNode, target)) { | 22781 | if (!_rcUtil.Dom.contains(root, target) && !_rcUtil.Dom.contains(popupNode, target)) { |
22887 | this.setPopupVisible(false); | 22782 | this.setPopupVisible(false); |
22888 | } | 22783 | } |
22889 | }, | 22784 | }, |
22785 | |||
22890 | getPopupDomNode: function getPopupDomNode() { | 22786 | getPopupDomNode: function getPopupDomNode() { |
22891 | // for test | 22787 | // for test |
22892 | return this.popupDomNode; | 22788 | return this.popupDomNode; |
22893 | }, | 22789 | }, |
22894 | getRootDomNode: function getRootDomNode() { | 22790 | |
22895 | return _reactDom2["default"].findDOMNode(this); | ||
22896 | }, | ||
22897 | getPopupContainer: function getPopupContainer() { | 22791 | getPopupContainer: function getPopupContainer() { |
22898 | if (!this.popupContainer) { | 22792 | if (!this.popupContainer) { |
22899 | this.popupContainer = document.createElement('div'); | 22793 | this.popupContainer = document.createElement('div'); |
22900 | var mountNode = this.props.getPopupContainer ? this.props.getPopupContainer((0, _reactDom.findDOMNode)(this)) : document.body; | 22794 | if (this.props.getPopupContainer) { |
22901 | mountNode.appendChild(this.popupContainer); | 22795 | var mountNode = this.props.getPopupContainer(); |
22796 | mountNode.appendChild(this.popupContainer); | ||
22797 | } else { | ||
22798 | document.body.appendChild(this.popupContainer); | ||
22799 | } | ||
22902 | } | 22800 | } |
22903 | return this.popupContainer; | 22801 | return this.popupContainer; |
22904 | }, | 22802 | }, |
22803 | |||
22905 | getPopupClassNameFromAlign: function getPopupClassNameFromAlign(align) { | 22804 | getPopupClassNameFromAlign: function getPopupClassNameFromAlign(align) { |
22906 | var className = []; | 22805 | var className = []; |
22907 | var props = this.props; | 22806 | var props = this.props; |
@@ -22917,6 +22816,7 @@ | |||
22917 | } | 22816 | } |
22918 | return className.join(' '); | 22817 | return className.join(' '); |
22919 | }, | 22818 | }, |
22819 | |||
22920 | getPopupAlign: function getPopupAlign() { | 22820 | getPopupAlign: function getPopupAlign() { |
22921 | var props = this.props; | 22821 | var props = this.props; |
22922 | var popupPlacement = props.popupPlacement; | 22822 | var popupPlacement = props.popupPlacement; |
@@ -22928,43 +22828,34 @@ | |||
22928 | } | 22828 | } |
22929 | return popupAlign; | 22829 | return popupAlign; |
22930 | }, | 22830 | }, |
22831 | |||
22931 | getPopupElement: function getPopupElement() { | 22832 | getPopupElement: function getPopupElement() { |
22932 | var props = this.props; | 22833 | var props = this.props; |
22933 | var state = this.state; | 22834 | var state = this.state; |
22934 | |||
22935 | var mouseProps = {}; | 22835 | var mouseProps = {}; |
22936 | if (this.isMouseEnterToShow()) { | 22836 | if (props.action.indexOf('hover') !== -1) { |
22937 | mouseProps.onMouseEnter = this.onMouseEnter; | 22837 | mouseProps.onMouseEnter = this.onMouseEnter; |
22938 | } | ||
22939 | if (this.isMouseLeaveToHide()) { | ||
22940 | mouseProps.onMouseLeave = this.onMouseLeave; | 22838 | mouseProps.onMouseLeave = this.onMouseLeave; |
22941 | } | 22839 | } |
22942 | return _react2["default"].createElement( | 22840 | return _react2['default'].createElement( |
22943 | _Popup2["default"], | 22841 | _Popup2['default'], |
22944 | _extends({ | 22842 | _extends({ prefixCls: props.prefixCls, |
22945 | prefixCls: props.prefixCls, | ||
22946 | destroyPopupOnHide: props.destroyPopupOnHide, | 22843 | destroyPopupOnHide: props.destroyPopupOnHide, |
22947 | visible: state.popupVisible, | 22844 | visible: state.popupVisible, |
22948 | className: props.popupClassName, | 22845 | className: props.popupClassName, |
22949 | action: props.action, | 22846 | action: props.action, |
22950 | align: this.getPopupAlign(), | 22847 | align: this.getPopupAlign(), |
22951 | onAlign: props.onPopupAlign, | ||
22952 | animation: props.popupAnimation, | 22848 | animation: props.popupAnimation, |
22953 | getClassNameFromAlign: this.getPopupClassNameFromAlign | 22849 | getClassNameFromAlign: this.getPopupClassNameFromAlign |
22954 | }, mouseProps, { | 22850 | }, mouseProps, { |
22955 | getRootDomNode: this.getRootDomNode, | 22851 | wrap: this, |
22956 | style: props.popupStyle, | 22852 | style: props.popupStyle, |
22957 | mask: props.mask, | 22853 | transitionName: props.popupTransitionName }), |
22958 | zIndex: props.zIndex, | ||
22959 | transitionName: props.popupTransitionName, | ||
22960 | maskAnimation: props.maskAnimation, | ||
22961 | maskTransitionName: props.maskTransitionName | ||
22962 | }), | ||
22963 | props.popup | 22854 | props.popup |
22964 | ); | 22855 | ); |
22965 | }, | 22856 | }, |
22857 | |||
22966 | setPopupVisible: function setPopupVisible(popupVisible) { | 22858 | setPopupVisible: function setPopupVisible(popupVisible) { |
22967 | this.clearDelayTimer(); | ||
22968 | if (this.state.popupVisible !== popupVisible) { | 22859 | if (this.state.popupVisible !== popupVisible) { |
22969 | if (!('popupVisible' in this.props)) { | 22860 | if (!('popupVisible' in this.props)) { |
22970 | this.setState({ | 22861 | this.setState({ |
@@ -22974,118 +22865,1552 @@ | |||
22974 | this.props.onPopupVisibleChange(popupVisible); | 22865 | this.props.onPopupVisibleChange(popupVisible); |
22975 | } | 22866 | } |
22976 | }, | 22867 | }, |
22868 | |||
22977 | delaySetPopupVisible: function delaySetPopupVisible(visible, delayS) { | 22869 | delaySetPopupVisible: function delaySetPopupVisible(visible, delayS) { |
22978 | var _this2 = this; | 22870 | var _this2 = this; |
22979 | 22871 | ||
22980 | var delay = delayS * 1000; | 22872 | var delay = delayS * 1000; |
22981 | this.clearDelayTimer(); | 22873 | if (this.delayTimer) { |
22874 | clearTimeout(this.delayTimer); | ||
22875 | this.delayTimer = null; | ||
22876 | } | ||
22982 | if (delay) { | 22877 | if (delay) { |
22983 | this.delayTimer = setTimeout(function () { | 22878 | this.delayTimer = setTimeout(function () { |
22984 | _this2.setPopupVisible(visible); | 22879 | _this2.setPopupVisible(visible); |
22985 | _this2.clearDelayTimer(); | 22880 | _this2.delayTimer = null; |
22986 | }, delay); | 22881 | }, delay); |
22987 | } else { | 22882 | } else { |
22988 | this.setPopupVisible(visible); | 22883 | this.setPopupVisible(visible); |
22989 | } | 22884 | } |
22990 | }, | 22885 | }, |
22991 | clearDelayTimer: function clearDelayTimer() { | 22886 | |
22992 | if (this.delayTimer) { | 22887 | render: function render() { |
22993 | clearTimeout(this.delayTimer); | 22888 | this.popupRendered = this.popupRendered || this.state.popupVisible; |
22994 | this.delayTimer = null; | 22889 | var props = this.props; |
22890 | var children = props.children; | ||
22891 | var child = _react2['default'].Children.only(children); | ||
22892 | var childProps = child.props || {}; | ||
22893 | var newChildProps = {}; | ||
22894 | var trigger = props.action; | ||
22895 | if (trigger.indexOf('click') !== -1) { | ||
22896 | newChildProps.onClick = (0, _rcUtil.createChainedFunction)(this.onClick, childProps.onClick); | ||
22897 | newChildProps.onMouseDown = (0, _rcUtil.createChainedFunction)(this.onMouseDown, childProps.onMouseDown); | ||
22898 | newChildProps.onTouchStart = (0, _rcUtil.createChainedFunction)(this.onTouchStart, childProps.onTouchStart); | ||
22899 | } | ||
22900 | if (trigger.indexOf('hover') !== -1) { | ||
22901 | newChildProps.onMouseEnter = (0, _rcUtil.createChainedFunction)(this.onMouseEnter, childProps.onMouseEnter); | ||
22902 | newChildProps.onMouseLeave = (0, _rcUtil.createChainedFunction)(this.onMouseLeave, childProps.onMouseLeave); | ||
22903 | } | ||
22904 | if (trigger.indexOf('focus') !== -1) { | ||
22905 | newChildProps.onFocus = (0, _rcUtil.createChainedFunction)(this.onFocus, childProps.onFocus); | ||
22906 | newChildProps.onBlur = (0, _rcUtil.createChainedFunction)(this.onBlur, childProps.onBlur); | ||
22995 | } | 22907 | } |
22996 | }, | ||
22997 | isClickToShow: function isClickToShow() { | ||
22998 | var _props = this.props; | ||
22999 | var action = _props.action; | ||
23000 | var showAction = _props.showAction; | ||
23001 | 22908 | ||
23002 | return action.indexOf('click') !== -1 || showAction.indexOf('click') !== -1; | 22909 | return _react2['default'].cloneElement(child, newChildProps); |
23003 | }, | 22910 | } |
23004 | isClickToHide: function isClickToHide() { | 22911 | }); |
23005 | var _props2 = this.props; | ||
23006 | var action = _props2.action; | ||
23007 | var hideAction = _props2.hideAction; | ||
23008 | 22912 | ||
23009 | return action.indexOf('click') !== -1 || hideAction.indexOf('click') !== -1; | 22913 | exports['default'] = Trigger; |
23010 | }, | 22914 | module.exports = exports['default']; |
23011 | isMouseEnterToShow: function isMouseEnterToShow() { | 22915 | |
23012 | var _props3 = this.props; | 22916 | /***/ }, |
23013 | var action = _props3.action; | 22917 | /* 173 */ |
23014 | var showAction = _props3.showAction; | 22918 | /***/ function(module, exports, __webpack_require__) { |
22919 | |||
22920 | 'use strict'; | ||
23015 | 22921 | ||
23016 | return action.indexOf('hover') !== -1 || showAction.indexOf('mouseEnter') !== -1; | 22922 | module.exports = { |
22923 | guid: __webpack_require__(174), | ||
22924 | classSet: __webpack_require__(175), | ||
22925 | joinClasses: __webpack_require__(178), | ||
22926 | KeyCode: __webpack_require__(179), | ||
22927 | PureRenderMixin: __webpack_require__(180), | ||
22928 | shallowEqual: __webpack_require__(181), | ||
22929 | createChainedFunction: __webpack_require__(187), | ||
22930 | Dom: { | ||
22931 | addEventListener: __webpack_require__(188), | ||
22932 | contains: __webpack_require__(193) | ||
23017 | }, | 22933 | }, |
23018 | isMouseLeaveToHide: function isMouseLeaveToHide() { | 22934 | Children: { |
23019 | var _props4 = this.props; | 22935 | toArray: __webpack_require__(194), |
23020 | var action = _props4.action; | 22936 | mapSelf: __webpack_require__(195) |
23021 | var hideAction = _props4.hideAction; | 22937 | } |
22938 | }; | ||
22939 | |||
22940 | /***/ }, | ||
22941 | /* 174 */ | ||
22942 | /***/ function(module, exports) { | ||
22943 | |||
22944 | 'use strict'; | ||
23022 | 22945 | ||
23023 | return action.indexOf('hover') !== -1 || hideAction.indexOf('mouseLeave') !== -1; | 22946 | var seed = 0; |
23024 | }, | 22947 | module.exports = function guid() { |
23025 | isFocusToShow: function isFocusToShow() { | 22948 | return Date.now() + '_' + seed++; |
23026 | var _props5 = this.props; | 22949 | }; |
23027 | var action = _props5.action; | 22950 | |
23028 | var showAction = _props5.showAction; | 22951 | /***/ }, |
22952 | /* 175 */ | ||
22953 | /***/ function(module, exports, __webpack_require__) { | ||
22954 | |||
22955 | 'use strict'; | ||
23029 | 22956 | ||
23030 | return action.indexOf('focus') !== -1 || showAction.indexOf('focus') !== -1; | 22957 | var deprecate = __webpack_require__(176); |
23031 | }, | 22958 | var classNames = __webpack_require__(177); |
23032 | isBlurToHide: function isBlurToHide() { | ||
23033 | var _props6 = this.props; | ||
23034 | var action = _props6.action; | ||
23035 | var hideAction = _props6.hideAction; | ||
23036 | 22959 | ||
23037 | return action.indexOf('focus') !== -1 || hideAction.indexOf('blur') !== -1; | 22960 | module.exports = deprecate(classNames, '`rcUtil.classSet()` is deprecated, use `classNames()` by `require(\'classnames\')` instead'); |
23038 | }, | 22961 | |
23039 | forcePopupAlign: function forcePopupAlign() { | 22962 | /***/ }, |
23040 | if (this.state.popupVisible && this.popupInstance && this.popupInstance.alignInstance) { | 22963 | /* 176 */ |
23041 | this.popupInstance.alignInstance.forceAlign(); | 22964 | /***/ function(module, exports) { |
22965 | |||
22966 | /* WEBPACK VAR INJECTION */(function(global) { | ||
22967 | /** | ||
22968 | * Module exports. | ||
22969 | */ | ||
22970 | |||
22971 | module.exports = deprecate; | ||
22972 | |||
22973 | /** | ||
22974 | * Mark that a method should not be used. | ||
22975 | * Returns a modified function which warns once by default. | ||
22976 | * | ||
22977 | * If `localStorage.noDeprecation = true` is set, then it is a no-op. | ||
22978 | * | ||
22979 | * If `localStorage.throwDeprecation = true` is set, then deprecated functions | ||
22980 | * will throw an Error when invoked. | ||
22981 | * | ||
22982 | * If `localStorage.traceDeprecation = true` is set, then deprecated functions | ||
22983 | * will invoke `console.trace()` instead of `console.error()`. | ||
22984 | * | ||
22985 | * @param {Function} fn - the function to deprecate | ||
22986 | * @param {String} msg - the string to print to the console when `fn` is invoked | ||
22987 | * @returns {Function} a new "deprecated" version of `fn` | ||
22988 | * @api public | ||
22989 | */ | ||
22990 | |||
22991 | function deprecate (fn, msg) { | ||
22992 | if (config('noDeprecation')) { | ||
22993 | return fn; | ||
22994 | } | ||
22995 | |||
22996 | var warned = false; | ||
22997 | function deprecated() { | ||
22998 | if (!warned) { | ||
22999 | if (config('throwDeprecation')) { | ||
23000 | throw new Error(msg); | ||
23001 | } else if (config('traceDeprecation')) { | ||
23002 | console.trace(msg); | ||
23003 | } else { | ||
23004 | console.warn(msg); | ||
23005 | } | ||
23006 | warned = true; | ||
23042 | } | 23007 | } |
23043 | }, | 23008 | return fn.apply(this, arguments); |
23044 | render: function render() { | 23009 | } |
23045 | this.popupRendered = this.popupRendered || this.state.popupVisible; | 23010 | |
23046 | var props = this.props; | 23011 | return deprecated; |
23047 | var children = props.children; | 23012 | } |
23048 | var child = _react2["default"].Children.only(children); | 23013 | |
23049 | var childProps = child.props || {}; | 23014 | /** |
23050 | var newChildProps = {}; | 23015 | * Checks `localStorage` for boolean values for the given `name`. |
23016 | * | ||
23017 | * @param {String} name | ||
23018 | * @returns {Boolean} | ||
23019 | * @api private | ||
23020 | */ | ||
23021 | |||
23022 | function config (name) { | ||
23023 | // accessing global.localStorage can trigger a DOMException in sandboxed iframes | ||
23024 | try { | ||
23025 | if (!global.localStorage) return false; | ||
23026 | } catch (_) { | ||
23027 | return false; | ||
23028 | } | ||
23029 | var val = global.localStorage[name]; | ||
23030 | if (null == val) return false; | ||
23031 | return String(val).toLowerCase() === 'true'; | ||
23032 | } | ||
23033 | |||
23034 | /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) | ||
23035 | |||
23036 | /***/ }, | ||
23037 | /* 177 */ | ||
23038 | /***/ function(module, exports, __webpack_require__) { | ||
23039 | |||
23040 | var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! | ||
23041 | Copyright (c) 2015 Jed Watson. | ||
23042 | Licensed under the MIT License (MIT), see | ||
23043 | http://jedwatson.github.io/classnames | ||
23044 | */ | ||
23045 | /* global define */ | ||
23046 | |||
23047 | (function () { | ||
23048 | 'use strict'; | ||
23049 | |||
23050 | var hasOwn = {}.hasOwnProperty; | ||
23051 | |||
23052 | function classNames () { | ||
23053 | var classes = ''; | ||
23054 | |||
23055 | for (var i = 0; i < arguments.length; i++) { | ||
23056 | var arg = arguments[i]; | ||
23057 | if (!arg) continue; | ||
23058 | |||
23059 | var argType = typeof arg; | ||
23060 | |||
23061 | if (argType === 'string' || argType === 'number') { | ||
23062 | classes += ' ' + arg; | ||
23063 | } else if (Array.isArray(arg)) { | ||
23064 | classes += ' ' + classNames.apply(null, arg); | ||
23065 | } else if (argType === 'object') { | ||
23066 | for (var key in arg) { | ||
23067 | if (hasOwn.call(arg, key) && arg[key]) { | ||
23068 | classes += ' ' + key; | ||
23069 | } | ||
23070 | } | ||
23071 | } | ||
23072 | } | ||
23073 | |||
23074 | return classes.substr(1); | ||
23075 | } | ||
23076 | |||
23077 | if (typeof module !== 'undefined' && module.exports) { | ||
23078 | module.exports = classNames; | ||
23079 | } else if (true) { | ||
23080 | // register as 'classnames', consistent with npm package name | ||
23081 | !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function () { | ||
23082 | return classNames; | ||
23083 | }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); | ||
23084 | } else { | ||
23085 | window.classNames = classNames; | ||
23086 | } | ||
23087 | }()); | ||
23088 | |||
23089 | |||
23090 | /***/ }, | ||
23091 | /* 178 */ | ||
23092 | /***/ function(module, exports, __webpack_require__) { | ||
23093 | |||
23094 | 'use strict'; | ||
23095 | |||
23096 | var deprecate = __webpack_require__(176); | ||
23097 | var classNames = __webpack_require__(177); | ||
23098 | |||
23099 | module.exports = deprecate(classNames, '`rcUtil.joinClasses()` is deprecated, use `classNames()` by `require(\'classnames\')` instead'); | ||
23100 | |||
23101 | /***/ }, | ||
23102 | /* 179 */ | ||
23103 | /***/ function(module, exports) { | ||
23104 | |||
23105 | /** | ||
23106 | * @ignore | ||
23107 | * some key-codes definition and utils from closure-library | ||
23108 | * @author yiminghe@gmail.com | ||
23109 | */ | ||
23110 | |||
23111 | 'use strict'; | ||
23051 | 23112 | ||
23052 | if (this.isClickToHide() || this.isClickToShow()) { | 23113 | var KeyCode = { |
23053 | newChildProps.onClick = (0, _createChainedFunction2["default"])(this.onClick, childProps.onClick); | 23114 | /** |
23054 | newChildProps.onMouseDown = (0, _createChainedFunction2["default"])(this.onMouseDown, childProps.onMouseDown); | 23115 | * MAC_ENTER |
23055 | newChildProps.onTouchStart = (0, _createChainedFunction2["default"])(this.onTouchStart, childProps.onTouchStart); | 23116 | */ |
23117 | MAC_ENTER: 3, | ||
23118 | /** | ||
23119 | * BACKSPACE | ||
23120 | */ | ||
23121 | BACKSPACE: 8, | ||
23122 | /** | ||
23123 | * TAB | ||
23124 | */ | ||
23125 | TAB: 9, | ||
23126 | /** | ||
23127 | * NUMLOCK on FF/Safari Mac | ||
23128 | */ | ||
23129 | NUM_CENTER: 12, // NUMLOCK on FF/Safari Mac | ||
23130 | /** | ||
23131 | * ENTER | ||
23132 | */ | ||
23133 | ENTER: 13, | ||
23134 | /** | ||
23135 | * SHIFT | ||
23136 | */ | ||
23137 | SHIFT: 16, | ||
23138 | /** | ||
23139 | * CTRL | ||
23140 | */ | ||
23141 | CTRL: 17, | ||
23142 | /** | ||
23143 | * ALT | ||
23144 | */ | ||
23145 | ALT: 18, | ||
23146 | /** | ||
23147 | * PAUSE | ||
23148 | */ | ||
23149 | PAUSE: 19, | ||
23150 | /** | ||
23151 | * CAPS_LOCK | ||
23152 | */ | ||
23153 | CAPS_LOCK: 20, | ||
23154 | /** | ||
23155 | * ESC | ||
23156 | */ | ||
23157 | ESC: 27, | ||
23158 | /** | ||
23159 | * SPACE | ||
23160 | */ | ||
23161 | SPACE: 32, | ||
23162 | /** | ||
23163 | * PAGE_UP | ||
23164 | */ | ||
23165 | PAGE_UP: 33, // also NUM_NORTH_EAST | ||
23166 | /** | ||
23167 | * PAGE_DOWN | ||
23168 | */ | ||
23169 | PAGE_DOWN: 34, // also NUM_SOUTH_EAST | ||
23170 | /** | ||
23171 | * END | ||
23172 | */ | ||
23173 | END: 35, // also NUM_SOUTH_WEST | ||
23174 | /** | ||
23175 | * HOME | ||
23176 | */ | ||
23177 | HOME: 36, // also NUM_NORTH_WEST | ||
23178 | /** | ||
23179 | * LEFT | ||
23180 | */ | ||
23181 | LEFT: 37, // also NUM_WEST | ||
23182 | /** | ||
23183 | * UP | ||
23184 | */ | ||
23185 | UP: 38, // also NUM_NORTH | ||
23186 | /** | ||
23187 | * RIGHT | ||
23188 | */ | ||
23189 | RIGHT: 39, // also NUM_EAST | ||
23190 | /** | ||
23191 | * DOWN | ||
23192 | */ | ||
23193 | DOWN: 40, // also NUM_SOUTH | ||
23194 | /** | ||
23195 | * PRINT_SCREEN | ||
23196 | */ | ||
23197 | PRINT_SCREEN: 44, | ||
23198 | /** | ||
23199 | * INSERT | ||
23200 | */ | ||
23201 | INSERT: 45, // also NUM_INSERT | ||
23202 | /** | ||
23203 | * DELETE | ||
23204 | */ | ||
23205 | DELETE: 46, // also NUM_DELETE | ||
23206 | /** | ||
23207 | * ZERO | ||
23208 | */ | ||
23209 | ZERO: 48, | ||
23210 | /** | ||
23211 | * ONE | ||
23212 | */ | ||
23213 | ONE: 49, | ||
23214 | /** | ||
23215 | * TWO | ||
23216 | */ | ||
23217 | TWO: 50, | ||
23218 | /** | ||
23219 | * THREE | ||
23220 | */ | ||
23221 | THREE: 51, | ||
23222 | /** | ||
23223 | * FOUR | ||
23224 | */ | ||
23225 | FOUR: 52, | ||
23226 | /** | ||
23227 | * FIVE | ||
23228 | */ | ||
23229 | FIVE: 53, | ||
23230 | /** | ||
23231 | * SIX | ||
23232 | */ | ||
23233 | SIX: 54, | ||
23234 | /** | ||
23235 | * SEVEN | ||
23236 | */ | ||
23237 | SEVEN: 55, | ||
23238 | /** | ||
23239 | * EIGHT | ||
23240 | */ | ||
23241 | EIGHT: 56, | ||
23242 | /** | ||
23243 | * NINE | ||
23244 | */ | ||
23245 | NINE: 57, | ||
23246 | /** | ||
23247 | * QUESTION_MARK | ||
23248 | */ | ||
23249 | QUESTION_MARK: 63, // needs localization | ||
23250 | /** | ||
23251 | * A | ||
23252 | */ | ||
23253 | A: 65, | ||
23254 | /** | ||
23255 | * B | ||
23256 | */ | ||
23257 | B: 66, | ||
23258 | /** | ||
23259 | * C | ||
23260 | */ | ||
23261 | C: 67, | ||
23262 | /** | ||
23263 | * D | ||
23264 | */ | ||
23265 | D: 68, | ||
23266 | /** | ||
23267 | * E | ||
23268 | */ | ||
23269 | E: 69, | ||
23270 | /** | ||
23271 | * F | ||
23272 | */ | ||
23273 | F: 70, | ||
23274 | /** | ||
23275 | * G | ||
23276 | */ | ||
23277 | G: 71, | ||
23278 | /** | ||
23279 | * H | ||
23280 | */ | ||
23281 | H: 72, | ||
23282 | /** | ||
23283 | * I | ||
23284 | */ | ||
23285 | I: 73, | ||
23286 | /** | ||
23287 | * J | ||
23288 | */ | ||
23289 | J: 74, | ||
23290 | /** | ||
23291 | * K | ||
23292 | */ | ||
23293 | K: 75, | ||
23294 | /** | ||
23295 | * L | ||
23296 | */ | ||
23297 | L: 76, | ||
23298 | /** | ||
23299 | * M | ||
23300 | */ | ||
23301 | M: 77, | ||
23302 | /** | ||
23303 | * N | ||
23304 | */ | ||
23305 | N: 78, | ||
23306 | /** | ||
23307 | * O | ||
23308 | */ | ||
23309 | O: 79, | ||
23310 | /** | ||
23311 | * P | ||
23312 | */ | ||
23313 | P: 80, | ||
23314 | /** | ||
23315 | * Q | ||
23316 | */ | ||
23317 | Q: 81, | ||
23318 | /** | ||
23319 | * R | ||
23320 | */ | ||
23321 | R: 82, | ||
23322 | /** | ||
23323 | * S | ||
23324 | */ | ||
23325 | S: 83, | ||
23326 | /** | ||
23327 | * T | ||
23328 | */ | ||
23329 | T: 84, | ||
23330 | /** | ||
23331 | * U | ||
23332 | */ | ||
23333 | U: 85, | ||
23334 | /** | ||
23335 | * V | ||
23336 | */ | ||
23337 | V: 86, | ||
23338 | /** | ||
23339 | * W | ||
23340 | */ | ||
23341 | W: 87, | ||
23342 | /** | ||
23343 | * X | ||
23344 | */ | ||
23345 | X: 88, | ||
23346 | /** | ||
23347 | * Y | ||
23348 | */ | ||
23349 | Y: 89, | ||
23350 | /** | ||
23351 | * Z | ||
23352 | */ | ||
23353 | Z: 90, | ||
23354 | /** | ||
23355 | * META | ||
23356 | */ | ||
23357 | META: 91, // WIN_KEY_LEFT | ||
23358 | /** | ||
23359 | * WIN_KEY_RIGHT | ||
23360 | */ | ||
23361 | WIN_KEY_RIGHT: 92, | ||
23362 | /** | ||
23363 | * CONTEXT_MENU | ||
23364 | */ | ||
23365 | CONTEXT_MENU: 93, | ||
23366 | /** | ||
23367 | * NUM_ZERO | ||
23368 | */ | ||
23369 | NUM_ZERO: 96, | ||
23370 | /** | ||
23371 | * NUM_ONE | ||
23372 | */ | ||
23373 | NUM_ONE: 97, | ||
23374 | /** | ||
23375 | * NUM_TWO | ||
23376 | */ | ||
23377 | NUM_TWO: 98, | ||
23378 | /** | ||
23379 | * NUM_THREE | ||
23380 | */ | ||
23381 | NUM_THREE: 99, | ||
23382 | /** | ||
23383 | * NUM_FOUR | ||
23384 | */ | ||
23385 | NUM_FOUR: 100, | ||
23386 | /** | ||
23387 | * NUM_FIVE | ||
23388 | */ | ||
23389 | NUM_FIVE: 101, | ||
23390 | /** | ||
23391 | * NUM_SIX | ||
23392 | */ | ||
23393 | NUM_SIX: 102, | ||
23394 | /** | ||
23395 | * NUM_SEVEN | ||
23396 | */ | ||
23397 | NUM_SEVEN: 103, | ||
23398 | /** | ||
23399 | * NUM_EIGHT | ||
23400 | */ | ||
23401 | NUM_EIGHT: 104, | ||
23402 | /** | ||
23403 | * NUM_NINE | ||
23404 | */ | ||
23405 | NUM_NINE: 105, | ||
23406 | /** | ||
23407 | * NUM_MULTIPLY | ||
23408 | */ | ||
23409 | NUM_MULTIPLY: 106, | ||
23410 | /** | ||
23411 | * NUM_PLUS | ||
23412 | */ | ||
23413 | NUM_PLUS: 107, | ||
23414 | /** | ||
23415 | * NUM_MINUS | ||
23416 | */ | ||
23417 | NUM_MINUS: 109, | ||
23418 | /** | ||
23419 | * NUM_PERIOD | ||
23420 | */ | ||
23421 | NUM_PERIOD: 110, | ||
23422 | /** | ||
23423 | * NUM_DIVISION | ||
23424 | */ | ||
23425 | NUM_DIVISION: 111, | ||
23426 | /** | ||
23427 | * F1 | ||
23428 | */ | ||
23429 | F1: 112, | ||
23430 | /** | ||
23431 | * F2 | ||
23432 | */ | ||
23433 | F2: 113, | ||
23434 | /** | ||
23435 | * F3 | ||
23436 | */ | ||
23437 | F3: 114, | ||
23438 | /** | ||
23439 | * F4 | ||
23440 | */ | ||
23441 | F4: 115, | ||
23442 | /** | ||
23443 | * F5 | ||
23444 | */ | ||
23445 | F5: 116, | ||
23446 | /** | ||
23447 | * F6 | ||
23448 | */ | ||
23449 | F6: 117, | ||
23450 | /** | ||
23451 | * F7 | ||
23452 | */ | ||
23453 | F7: 118, | ||
23454 | /** | ||
23455 | * F8 | ||
23456 | */ | ||
23457 | F8: 119, | ||
23458 | /** | ||
23459 | * F9 | ||
23460 | */ | ||
23461 | F9: 120, | ||
23462 | /** | ||
23463 | * F10 | ||
23464 | */ | ||
23465 | F10: 121, | ||
23466 | /** | ||
23467 | * F11 | ||
23468 | */ | ||
23469 | F11: 122, | ||
23470 | /** | ||
23471 | * F12 | ||
23472 | */ | ||
23473 | F12: 123, | ||
23474 | /** | ||
23475 | * NUMLOCK | ||
23476 | */ | ||
23477 | NUMLOCK: 144, | ||
23478 | /** | ||
23479 | * SEMICOLON | ||
23480 | */ | ||
23481 | SEMICOLON: 186, // needs localization | ||
23482 | /** | ||
23483 | * DASH | ||
23484 | */ | ||
23485 | DASH: 189, // needs localization | ||
23486 | /** | ||
23487 | * EQUALS | ||
23488 | */ | ||
23489 | EQUALS: 187, // needs localization | ||
23490 | /** | ||
23491 | * COMMA | ||
23492 | */ | ||
23493 | COMMA: 188, // needs localization | ||
23494 | /** | ||
23495 | * PERIOD | ||
23496 | */ | ||
23497 | PERIOD: 190, // needs localization | ||
23498 | /** | ||
23499 | * SLASH | ||
23500 | */ | ||
23501 | SLASH: 191, // needs localization | ||
23502 | /** | ||
23503 | * APOSTROPHE | ||
23504 | */ | ||
23505 | APOSTROPHE: 192, // needs localization | ||
23506 | /** | ||
23507 | * SINGLE_QUOTE | ||
23508 | */ | ||
23509 | SINGLE_QUOTE: 222, // needs localization | ||
23510 | /** | ||
23511 | * OPEN_SQUARE_BRACKET | ||
23512 | */ | ||
23513 | OPEN_SQUARE_BRACKET: 219, // needs localization | ||
23514 | /** | ||
23515 | * BACKSLASH | ||
23516 | */ | ||
23517 | BACKSLASH: 220, // needs localization | ||
23518 | /** | ||
23519 | * CLOSE_SQUARE_BRACKET | ||
23520 | */ | ||
23521 | CLOSE_SQUARE_BRACKET: 221, // needs localization | ||
23522 | /** | ||
23523 | * WIN_KEY | ||
23524 | */ | ||
23525 | WIN_KEY: 224, | ||
23526 | /** | ||
23527 | * MAC_FF_META | ||
23528 | */ | ||
23529 | MAC_FF_META: 224, // Firefox (Gecko) fires this for the meta key instead of 91 | ||
23530 | /** | ||
23531 | * WIN_IME | ||
23532 | */ | ||
23533 | WIN_IME: 229 | ||
23534 | }; | ||
23535 | |||
23536 | /* | ||
23537 | whether text and modified key is entered at the same time. | ||
23538 | */ | ||
23539 | KeyCode.isTextModifyingKeyEvent = function isTextModifyingKeyEvent(e) { | ||
23540 | var keyCode = e.keyCode; | ||
23541 | if (e.altKey && !e.ctrlKey || e.metaKey || | ||
23542 | // Function keys don't generate text | ||
23543 | keyCode >= KeyCode.F1 && keyCode <= KeyCode.F12) { | ||
23544 | return false; | ||
23545 | } | ||
23546 | |||
23547 | // The following keys are quite harmless, even in combination with | ||
23548 | // CTRL, ALT or SHIFT. | ||
23549 | switch (keyCode) { | ||
23550 | case KeyCode.ALT: | ||
23551 | case KeyCode.CAPS_LOCK: | ||
23552 | case KeyCode.CONTEXT_MENU: | ||
23553 | case KeyCode.CTRL: | ||
23554 | case KeyCode.DOWN: | ||
23555 | case KeyCode.END: | ||
23556 | case KeyCode.ESC: | ||
23557 | case KeyCode.HOME: | ||
23558 | case KeyCode.INSERT: | ||
23559 | case KeyCode.LEFT: | ||
23560 | case KeyCode.MAC_FF_META: | ||
23561 | case KeyCode.META: | ||
23562 | case KeyCode.NUMLOCK: | ||
23563 | case KeyCode.NUM_CENTER: | ||
23564 | case KeyCode.PAGE_DOWN: | ||
23565 | case KeyCode.PAGE_UP: | ||
23566 | case KeyCode.PAUSE: | ||
23567 | case KeyCode.PRINT_SCREEN: | ||
23568 | case KeyCode.RIGHT: | ||
23569 | case KeyCode.SHIFT: | ||
23570 | case KeyCode.UP: | ||
23571 | case KeyCode.WIN_KEY: | ||
23572 | case KeyCode.WIN_KEY_RIGHT: | ||
23573 | return false; | ||
23574 | default: | ||
23575 | return true; | ||
23576 | } | ||
23577 | }; | ||
23578 | |||
23579 | /* | ||
23580 | whether character is entered. | ||
23581 | */ | ||
23582 | KeyCode.isCharacterKey = function isCharacterKey(keyCode) { | ||
23583 | if (keyCode >= KeyCode.ZERO && keyCode <= KeyCode.NINE) { | ||
23584 | return true; | ||
23585 | } | ||
23586 | |||
23587 | if (keyCode >= KeyCode.NUM_ZERO && keyCode <= KeyCode.NUM_MULTIPLY) { | ||
23588 | return true; | ||
23589 | } | ||
23590 | |||
23591 | if (keyCode >= KeyCode.A && keyCode <= KeyCode.Z) { | ||
23592 | return true; | ||
23593 | } | ||
23594 | |||
23595 | // Safari sends zero key code for non-latin characters. | ||
23596 | if (window.navigation.userAgent.indexOf('WebKit') !== -1 && keyCode === 0) { | ||
23597 | return true; | ||
23598 | } | ||
23599 | |||
23600 | switch (keyCode) { | ||
23601 | case KeyCode.SPACE: | ||
23602 | case KeyCode.QUESTION_MARK: | ||
23603 | case KeyCode.NUM_PLUS: | ||
23604 | case KeyCode.NUM_MINUS: | ||
23605 | case KeyCode.NUM_PERIOD: | ||
23606 | case KeyCode.NUM_DIVISION: | ||
23607 | case KeyCode.SEMICOLON: | ||
23608 | case KeyCode.DASH: | ||
23609 | case KeyCode.EQUALS: | ||
23610 | case KeyCode.COMMA: | ||
23611 | case KeyCode.PERIOD: | ||
23612 | case KeyCode.SLASH: | ||
23613 | case KeyCode.APOSTROPHE: | ||
23614 | case KeyCode.SINGLE_QUOTE: | ||
23615 | case KeyCode.OPEN_SQUARE_BRACKET: | ||
23616 | case KeyCode.BACKSLASH: | ||
23617 | case KeyCode.CLOSE_SQUARE_BRACKET: | ||
23618 | return true; | ||
23619 | default: | ||
23620 | return false; | ||
23621 | } | ||
23622 | }; | ||
23623 | |||
23624 | module.exports = KeyCode; | ||
23625 | |||
23626 | /***/ }, | ||
23627 | /* 180 */ | ||
23628 | /***/ function(module, exports, __webpack_require__) { | ||
23629 | |||
23630 | 'use strict'; | ||
23631 | |||
23632 | var shallowEqual = __webpack_require__(181); | ||
23633 | |||
23634 | /** | ||
23635 | * If your React component's render function is "pure", e.g. it will render the | ||
23636 | * same result given the same props and state, provide this Mixin for a | ||
23637 | * considerable performance boost. | ||
23638 | * | ||
23639 | * Most React components have pure render functions. | ||
23640 | * | ||
23641 | * Example: | ||
23642 | * | ||
23643 | * const ReactComponentWithPureRenderMixin = | ||
23644 | * require('ReactComponentWithPureRenderMixin'); | ||
23645 | * React.createClass({ | ||
23646 | * mixins: [ReactComponentWithPureRenderMixin], | ||
23647 | * | ||
23648 | * render: function() { | ||
23649 | * return <div className={this.props.className}>foo</div>; | ||
23650 | * } | ||
23651 | * }); | ||
23652 | * | ||
23653 | * Note: This only checks shallow equality for props and state. If these contain | ||
23654 | * complex data structures this mixin may have false-negatives for deeper | ||
23655 | * differences. Only mixin to components which have simple props and state, or | ||
23656 | * use `forceUpdate()` when you know deep data structures have changed. | ||
23657 | */ | ||
23658 | var ReactComponentWithPureRenderMixin = { | ||
23659 | shouldComponentUpdate: function shouldComponentUpdate(nextProps, nextState) { | ||
23660 | return !shallowEqual(this.props, nextProps) || !shallowEqual(this.state, nextState); | ||
23661 | } | ||
23662 | }; | ||
23663 | |||
23664 | module.exports = ReactComponentWithPureRenderMixin; | ||
23665 | |||
23666 | /***/ }, | ||
23667 | /* 181 */ | ||
23668 | /***/ function(module, exports, __webpack_require__) { | ||
23669 | |||
23670 | 'use strict'; | ||
23671 | |||
23672 | var shallowEqual = __webpack_require__(182); | ||
23673 | |||
23674 | module.exports = shallowEqual; | ||
23675 | |||
23676 | /***/ }, | ||
23677 | /* 182 */ | ||
23678 | /***/ function(module, exports, __webpack_require__) { | ||
23679 | |||
23680 | 'use strict'; | ||
23681 | |||
23682 | var fetchKeys = __webpack_require__(183); | ||
23683 | |||
23684 | module.exports = function shallowEqual(objA, objB, compare, compareContext) { | ||
23685 | |||
23686 | var ret = compare ? compare.call(compareContext, objA, objB) : void 0; | ||
23687 | |||
23688 | if (ret !== void 0) { | ||
23689 | return !!ret; | ||
23056 | } | 23690 | } |
23057 | if (this.isMouseEnterToShow()) { | 23691 | |
23058 | newChildProps.onMouseEnter = (0, _createChainedFunction2["default"])(this.onMouseEnter, childProps.onMouseEnter); | 23692 | if (objA === objB) { |
23693 | return true; | ||
23059 | } | 23694 | } |
23060 | if (this.isMouseLeaveToHide()) { | 23695 | |
23061 | newChildProps.onMouseLeave = (0, _createChainedFunction2["default"])(this.onMouseLeave, childProps.onMouseLeave); | 23696 | if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) { |
23697 | return false; | ||
23062 | } | 23698 | } |
23063 | if (this.isFocusToShow() || this.isBlurToHide()) { | 23699 | |
23064 | newChildProps.onFocus = (0, _createChainedFunction2["default"])(this.onFocus, childProps.onFocus); | 23700 | var keysA = fetchKeys(objA); |
23065 | newChildProps.onBlur = (0, _createChainedFunction2["default"])(this.onBlur, childProps.onBlur); | 23701 | var keysB = fetchKeys(objB); |
23702 | |||
23703 | var len = keysA.length; | ||
23704 | if (len !== keysB.length) { | ||
23705 | return false; | ||
23066 | } | 23706 | } |
23067 | 23707 | ||
23068 | ALL_HANDLERS.forEach(function (handler) { | 23708 | compareContext = compareContext || null; |
23069 | var newFn = void 0; | 23709 | |
23070 | if (props[handler] && newChildProps[handler]) { | 23710 | // Test for A's keys different from B. |
23071 | newFn = (0, _createChainedFunction2["default"])(props[handler], newChildProps[handler]); | 23711 | var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB); |
23072 | } else { | 23712 | for (var i = 0; i < len; i++) { |
23073 | newFn = props[handler] || newChildProps[handler]; | 23713 | var key = keysA[i]; |
23074 | } | 23714 | if (!bHasOwnProperty(key)) { |
23075 | if (newFn) { | 23715 | return false; |
23076 | newChildProps[handler] = newFn; | 23716 | } |
23077 | } | 23717 | var valueA = objA[key]; |
23078 | }); | 23718 | var valueB = objB[key]; |
23719 | |||
23720 | var _ret = compare ? compare.call(compareContext, valueA, valueB, key) : void 0; | ||
23721 | if (_ret === false || _ret === void 0 && valueA !== valueB) { | ||
23722 | return false; | ||
23723 | } | ||
23724 | } | ||
23725 | |||
23726 | return true; | ||
23727 | }; | ||
23728 | |||
23729 | /***/ }, | ||
23730 | /* 183 */ | ||
23731 | /***/ function(module, exports, __webpack_require__) { | ||
23732 | |||
23733 | /** | ||
23734 | * lodash 3.1.2 (Custom Build) <https://lodash.com/> | ||
23735 | * Build: `lodash modern modularize exports="npm" -o ./` | ||
23736 | * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> | ||
23737 | * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> | ||
23738 | * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
23739 | * Available under MIT license <https://lodash.com/license> | ||
23740 | */ | ||
23741 | var getNative = __webpack_require__(184), | ||
23742 | isArguments = __webpack_require__(185), | ||
23743 | isArray = __webpack_require__(186); | ||
23744 | |||
23745 | /** Used to detect unsigned integer values. */ | ||
23746 | var reIsUint = /^\d+$/; | ||
23747 | |||
23748 | /** Used for native method references. */ | ||
23749 | var objectProto = Object.prototype; | ||
23750 | |||
23751 | /** Used to check objects for own properties. */ | ||
23752 | var hasOwnProperty = objectProto.hasOwnProperty; | ||
23753 | |||
23754 | /* Native method references for those with the same name as other `lodash` methods. */ | ||
23755 | var nativeKeys = getNative(Object, 'keys'); | ||
23756 | |||
23757 | /** | ||
23758 | * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer) | ||
23759 | * of an array-like value. | ||
23760 | */ | ||
23761 | var MAX_SAFE_INTEGER = 9007199254740991; | ||
23762 | |||
23763 | /** | ||
23764 | * The base implementation of `_.property` without support for deep paths. | ||
23765 | * | ||
23766 | * @private | ||
23767 | * @param {string} key The key of the property to get. | ||
23768 | * @returns {Function} Returns the new function. | ||
23769 | */ | ||
23770 | function baseProperty(key) { | ||
23771 | return function(object) { | ||
23772 | return object == null ? undefined : object[key]; | ||
23773 | }; | ||
23774 | } | ||
23079 | 23775 | ||
23080 | return _react2["default"].cloneElement(child, newChildProps); | 23776 | /** |
23777 | * Gets the "length" property value of `object`. | ||
23778 | * | ||
23779 | * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) | ||
23780 | * that affects Safari on at least iOS 8.1-8.3 ARM64. | ||
23781 | * | ||
23782 | * @private | ||
23783 | * @param {Object} object The object to query. | ||
23784 | * @returns {*} Returns the "length" value. | ||
23785 | */ | ||
23786 | var getLength = baseProperty('length'); | ||
23787 | |||
23788 | /** | ||
23789 | * Checks if `value` is array-like. | ||
23790 | * | ||
23791 | * @private | ||
23792 | * @param {*} value The value to check. | ||
23793 | * @returns {boolean} Returns `true` if `value` is array-like, else `false`. | ||
23794 | */ | ||
23795 | function isArrayLike(value) { | ||
23796 | return value != null && isLength(getLength(value)); | ||
23797 | } | ||
23798 | |||
23799 | /** | ||
23800 | * Checks if `value` is a valid array-like index. | ||
23801 | * | ||
23802 | * @private | ||
23803 | * @param {*} value The value to check. | ||
23804 | * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. | ||
23805 | * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. | ||
23806 | */ | ||
23807 | function isIndex(value, length) { | ||
23808 | value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; | ||
23809 | length = length == null ? MAX_SAFE_INTEGER : length; | ||
23810 | return value > -1 && value % 1 == 0 && value < length; | ||
23811 | } | ||
23812 | |||
23813 | /** | ||
23814 | * Checks if `value` is a valid array-like length. | ||
23815 | * | ||
23816 | * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). | ||
23817 | * | ||
23818 | * @private | ||
23819 | * @param {*} value The value to check. | ||
23820 | * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. | ||
23821 | */ | ||
23822 | function isLength(value) { | ||
23823 | return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; | ||
23824 | } | ||
23825 | |||
23826 | /** | ||
23827 | * A fallback implementation of `Object.keys` which creates an array of the | ||
23828 | * own enumerable property names of `object`. | ||
23829 | * | ||
23830 | * @private | ||
23831 | * @param {Object} object The object to query. | ||
23832 | * @returns {Array} Returns the array of property names. | ||
23833 | */ | ||
23834 | function shimKeys(object) { | ||
23835 | var props = keysIn(object), | ||
23836 | propsLength = props.length, | ||
23837 | length = propsLength && object.length; | ||
23838 | |||
23839 | var allowIndexes = !!length && isLength(length) && | ||
23840 | (isArray(object) || isArguments(object)); | ||
23841 | |||
23842 | var index = -1, | ||
23843 | result = []; | ||
23844 | |||
23845 | while (++index < propsLength) { | ||
23846 | var key = props[index]; | ||
23847 | if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) { | ||
23848 | result.push(key); | ||
23849 | } | ||
23081 | } | 23850 | } |
23082 | }); | 23851 | return result; |
23852 | } | ||
23083 | 23853 | ||
23084 | exports["default"] = Trigger; | 23854 | /** |
23085 | module.exports = exports['default']; | 23855 | * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. |
23856 | * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) | ||
23857 | * | ||
23858 | * @static | ||
23859 | * @memberOf _ | ||
23860 | * @category Lang | ||
23861 | * @param {*} value The value to check. | ||
23862 | * @returns {boolean} Returns `true` if `value` is an object, else `false`. | ||
23863 | * @example | ||
23864 | * | ||
23865 | * _.isObject({}); | ||
23866 | * // => true | ||
23867 | * | ||
23868 | * _.isObject([1, 2, 3]); | ||
23869 | * // => true | ||
23870 | * | ||
23871 | * _.isObject(1); | ||
23872 | * // => false | ||
23873 | */ | ||
23874 | function isObject(value) { | ||
23875 | // Avoid a V8 JIT bug in Chrome 19-20. | ||
23876 | // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. | ||
23877 | var type = typeof value; | ||
23878 | return !!value && (type == 'object' || type == 'function'); | ||
23879 | } | ||
23880 | |||
23881 | /** | ||
23882 | * Creates an array of the own enumerable property names of `object`. | ||
23883 | * | ||
23884 | * **Note:** Non-object values are coerced to objects. See the | ||
23885 | * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) | ||
23886 | * for more details. | ||
23887 | * | ||
23888 | * @static | ||
23889 | * @memberOf _ | ||
23890 | * @category Object | ||
23891 | * @param {Object} object The object to query. | ||
23892 | * @returns {Array} Returns the array of property names. | ||
23893 | * @example | ||
23894 | * | ||
23895 | * function Foo() { | ||
23896 | * this.a = 1; | ||
23897 | * this.b = 2; | ||
23898 | * } | ||
23899 | * | ||
23900 | * Foo.prototype.c = 3; | ||
23901 | * | ||
23902 | * _.keys(new Foo); | ||
23903 | * // => ['a', 'b'] (iteration order is not guaranteed) | ||
23904 | * | ||
23905 | * _.keys('hi'); | ||
23906 | * // => ['0', '1'] | ||
23907 | */ | ||
23908 | var keys = !nativeKeys ? shimKeys : function(object) { | ||
23909 | var Ctor = object == null ? undefined : object.constructor; | ||
23910 | if ((typeof Ctor == 'function' && Ctor.prototype === object) || | ||
23911 | (typeof object != 'function' && isArrayLike(object))) { | ||
23912 | return shimKeys(object); | ||
23913 | } | ||
23914 | return isObject(object) ? nativeKeys(object) : []; | ||
23915 | }; | ||
23916 | |||
23917 | /** | ||
23918 | * Creates an array of the own and inherited enumerable property names of `object`. | ||
23919 | * | ||
23920 | * **Note:** Non-object values are coerced to objects. | ||
23921 | * | ||
23922 | * @static | ||
23923 | * @memberOf _ | ||
23924 | * @category Object | ||
23925 | * @param {Object} object The object to query. | ||
23926 | * @returns {Array} Returns the array of property names. | ||
23927 | * @example | ||
23928 | * | ||
23929 | * function Foo() { | ||
23930 | * this.a = 1; | ||
23931 | * this.b = 2; | ||
23932 | * } | ||
23933 | * | ||
23934 | * Foo.prototype.c = 3; | ||
23935 | * | ||
23936 | * _.keysIn(new Foo); | ||
23937 | * // => ['a', 'b', 'c'] (iteration order is not guaranteed) | ||
23938 | */ | ||
23939 | function keysIn(object) { | ||
23940 | if (object == null) { | ||
23941 | return []; | ||
23942 | } | ||
23943 | if (!isObject(object)) { | ||
23944 | object = Object(object); | ||
23945 | } | ||
23946 | var length = object.length; | ||
23947 | length = (length && isLength(length) && | ||
23948 | (isArray(object) || isArguments(object)) && length) || 0; | ||
23949 | |||
23950 | var Ctor = object.constructor, | ||
23951 | index = -1, | ||
23952 | isProto = typeof Ctor == 'function' && Ctor.prototype === object, | ||
23953 | result = Array(length), | ||
23954 | skipIndexes = length > 0; | ||
23955 | |||
23956 | while (++index < length) { | ||
23957 | result[index] = (index + ''); | ||
23958 | } | ||
23959 | for (var key in object) { | ||
23960 | if (!(skipIndexes && isIndex(key, length)) && | ||
23961 | !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { | ||
23962 | result.push(key); | ||
23963 | } | ||
23964 | } | ||
23965 | return result; | ||
23966 | } | ||
23967 | |||
23968 | module.exports = keys; | ||
23969 | |||
23086 | 23970 | ||
23087 | /***/ }, | 23971 | /***/ }, |
23088 | /* 173 */ | 23972 | /* 184 */ |
23973 | /***/ function(module, exports) { | ||
23974 | |||
23975 | /** | ||
23976 | * lodash 3.9.1 (Custom Build) <https://lodash.com/> | ||
23977 | * Build: `lodash modern modularize exports="npm" -o ./` | ||
23978 | * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> | ||
23979 | * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> | ||
23980 | * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
23981 | * Available under MIT license <https://lodash.com/license> | ||
23982 | */ | ||
23983 | |||
23984 | /** `Object#toString` result references. */ | ||
23985 | var funcTag = '[object Function]'; | ||
23986 | |||
23987 | /** Used to detect host constructors (Safari > 5). */ | ||
23988 | var reIsHostCtor = /^\[object .+?Constructor\]$/; | ||
23989 | |||
23990 | /** | ||
23991 | * Checks if `value` is object-like. | ||
23992 | * | ||
23993 | * @private | ||
23994 | * @param {*} value The value to check. | ||
23995 | * @returns {boolean} Returns `true` if `value` is object-like, else `false`. | ||
23996 | */ | ||
23997 | function isObjectLike(value) { | ||
23998 | return !!value && typeof value == 'object'; | ||
23999 | } | ||
24000 | |||
24001 | /** Used for native method references. */ | ||
24002 | var objectProto = Object.prototype; | ||
24003 | |||
24004 | /** Used to resolve the decompiled source of functions. */ | ||
24005 | var fnToString = Function.prototype.toString; | ||
24006 | |||
24007 | /** Used to check objects for own properties. */ | ||
24008 | var hasOwnProperty = objectProto.hasOwnProperty; | ||
24009 | |||
24010 | /** | ||
24011 | * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) | ||
24012 | * of values. | ||
24013 | */ | ||
24014 | var objToString = objectProto.toString; | ||
24015 | |||
24016 | /** Used to detect if a method is native. */ | ||
24017 | var reIsNative = RegExp('^' + | ||
24018 | fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&') | ||
24019 | .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' | ||
24020 | ); | ||
24021 | |||
24022 | /** | ||
24023 | * Gets the native function at `key` of `object`. | ||
24024 | * | ||
24025 | * @private | ||
24026 | * @param {Object} object The object to query. | ||
24027 | * @param {string} key The key of the method to get. | ||
24028 | * @returns {*} Returns the function if it's native, else `undefined`. | ||
24029 | */ | ||
24030 | function getNative(object, key) { | ||
24031 | var value = object == null ? undefined : object[key]; | ||
24032 | return isNative(value) ? value : undefined; | ||
24033 | } | ||
24034 | |||
24035 | /** | ||
24036 | * Checks if `value` is classified as a `Function` object. | ||
24037 | * | ||
24038 | * @static | ||
24039 | * @memberOf _ | ||
24040 | * @category Lang | ||
24041 | * @param {*} value The value to check. | ||
24042 | * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. | ||
24043 | * @example | ||
24044 | * | ||
24045 | * _.isFunction(_); | ||
24046 | * // => true | ||
24047 | * | ||
24048 | * _.isFunction(/abc/); | ||
24049 | * // => false | ||
24050 | */ | ||
24051 | function isFunction(value) { | ||
24052 | // The use of `Object#toString` avoids issues with the `typeof` operator | ||
24053 | // in older versions of Chrome and Safari which return 'function' for regexes | ||
24054 | // and Safari 8 equivalents which return 'object' for typed array constructors. | ||
24055 | return isObject(value) && objToString.call(value) == funcTag; | ||
24056 | } | ||
24057 | |||
24058 | /** | ||
24059 | * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. | ||
24060 | * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) | ||
24061 | * | ||
24062 | * @static | ||
24063 | * @memberOf _ | ||
24064 | * @category Lang | ||
24065 | * @param {*} value The value to check. | ||
24066 | * @returns {boolean} Returns `true` if `value` is an object, else `false`. | ||
24067 | * @example | ||
24068 | * | ||
24069 | * _.isObject({}); | ||
24070 | * // => true | ||
24071 | * | ||
24072 | * _.isObject([1, 2, 3]); | ||
24073 | * // => true | ||
24074 | * | ||
24075 | * _.isObject(1); | ||
24076 | * // => false | ||
24077 | */ | ||
24078 | function isObject(value) { | ||
24079 | // Avoid a V8 JIT bug in Chrome 19-20. | ||
24080 | // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. | ||
24081 | var type = typeof value; | ||
24082 | return !!value && (type == 'object' || type == 'function'); | ||
24083 | } | ||
24084 | |||
24085 | /** | ||
24086 | * Checks if `value` is a native function. | ||
24087 | * | ||
24088 | * @static | ||
24089 | * @memberOf _ | ||
24090 | * @category Lang | ||
24091 | * @param {*} value The value to check. | ||
24092 | * @returns {boolean} Returns `true` if `value` is a native function, else `false`. | ||
24093 | * @example | ||
24094 | * | ||
24095 | * _.isNative(Array.prototype.push); | ||
24096 | * // => true | ||
24097 | * | ||
24098 | * _.isNative(_); | ||
24099 | * // => false | ||
24100 | */ | ||
24101 | function isNative(value) { | ||
24102 | if (value == null) { | ||
24103 | return false; | ||
24104 | } | ||
24105 | if (isFunction(value)) { | ||
24106 | return reIsNative.test(fnToString.call(value)); | ||
24107 | } | ||
24108 | return isObjectLike(value) && reIsHostCtor.test(value); | ||
24109 | } | ||
24110 | |||
24111 | module.exports = getNative; | ||
24112 | |||
24113 | |||
24114 | /***/ }, | ||
24115 | /* 185 */ | ||
24116 | /***/ function(module, exports) { | ||
24117 | |||
24118 | /** | ||
24119 | * lodash 3.0.4 (Custom Build) <https://lodash.com/> | ||
24120 | * Build: `lodash modern modularize exports="npm" -o ./` | ||
24121 | * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> | ||
24122 | * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> | ||
24123 | * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
24124 | * Available under MIT license <https://lodash.com/license> | ||
24125 | */ | ||
24126 | |||
24127 | /** | ||
24128 | * Checks if `value` is object-like. | ||
24129 | * | ||
24130 | * @private | ||
24131 | * @param {*} value The value to check. | ||
24132 | * @returns {boolean} Returns `true` if `value` is object-like, else `false`. | ||
24133 | */ | ||
24134 | function isObjectLike(value) { | ||
24135 | return !!value && typeof value == 'object'; | ||
24136 | } | ||
24137 | |||
24138 | /** Used for native method references. */ | ||
24139 | var objectProto = Object.prototype; | ||
24140 | |||
24141 | /** Used to check objects for own properties. */ | ||
24142 | var hasOwnProperty = objectProto.hasOwnProperty; | ||
24143 | |||
24144 | /** Native method references. */ | ||
24145 | var propertyIsEnumerable = objectProto.propertyIsEnumerable; | ||
24146 | |||
24147 | /** | ||
24148 | * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer) | ||
24149 | * of an array-like value. | ||
24150 | */ | ||
24151 | var MAX_SAFE_INTEGER = 9007199254740991; | ||
24152 | |||
24153 | /** | ||
24154 | * The base implementation of `_.property` without support for deep paths. | ||
24155 | * | ||
24156 | * @private | ||
24157 | * @param {string} key The key of the property to get. | ||
24158 | * @returns {Function} Returns the new function. | ||
24159 | */ | ||
24160 | function baseProperty(key) { | ||
24161 | return function(object) { | ||
24162 | return object == null ? undefined : object[key]; | ||
24163 | }; | ||
24164 | } | ||
24165 | |||
24166 | /** | ||
24167 | * Gets the "length" property value of `object`. | ||
24168 | * | ||
24169 | * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) | ||
24170 | * that affects Safari on at least iOS 8.1-8.3 ARM64. | ||
24171 | * | ||
24172 | * @private | ||
24173 | * @param {Object} object The object to query. | ||
24174 | * @returns {*} Returns the "length" value. | ||
24175 | */ | ||
24176 | var getLength = baseProperty('length'); | ||
24177 | |||
24178 | /** | ||
24179 | * Checks if `value` is array-like. | ||
24180 | * | ||
24181 | * @private | ||
24182 | * @param {*} value The value to check. | ||
24183 | * @returns {boolean} Returns `true` if `value` is array-like, else `false`. | ||
24184 | */ | ||
24185 | function isArrayLike(value) { | ||
24186 | return value != null && isLength(getLength(value)); | ||
24187 | } | ||
24188 | |||
24189 | /** | ||
24190 | * Checks if `value` is a valid array-like length. | ||
24191 | * | ||
24192 | * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). | ||
24193 | * | ||
24194 | * @private | ||
24195 | * @param {*} value The value to check. | ||
24196 | * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. | ||
24197 | */ | ||
24198 | function isLength(value) { | ||
24199 | return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; | ||
24200 | } | ||
24201 | |||
24202 | /** | ||
24203 | * Checks if `value` is classified as an `arguments` object. | ||
24204 | * | ||
24205 | * @static | ||
24206 | * @memberOf _ | ||
24207 | * @category Lang | ||
24208 | * @param {*} value The value to check. | ||
24209 | * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. | ||
24210 | * @example | ||
24211 | * | ||
24212 | * _.isArguments(function() { return arguments; }()); | ||
24213 | * // => true | ||
24214 | * | ||
24215 | * _.isArguments([1, 2, 3]); | ||
24216 | * // => false | ||
24217 | */ | ||
24218 | function isArguments(value) { | ||
24219 | return isObjectLike(value) && isArrayLike(value) && | ||
24220 | hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee'); | ||
24221 | } | ||
24222 | |||
24223 | module.exports = isArguments; | ||
24224 | |||
24225 | |||
24226 | /***/ }, | ||
24227 | /* 186 */ | ||
24228 | /***/ function(module, exports) { | ||
24229 | |||
24230 | /** | ||
24231 | * lodash 3.0.4 (Custom Build) <https://lodash.com/> | ||
24232 | * Build: `lodash modern modularize exports="npm" -o ./` | ||
24233 | * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> | ||
24234 | * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> | ||
24235 | * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
24236 | * Available under MIT license <https://lodash.com/license> | ||
24237 | */ | ||
24238 | |||
24239 | /** `Object#toString` result references. */ | ||
24240 | var arrayTag = '[object Array]', | ||
24241 | funcTag = '[object Function]'; | ||
24242 | |||
24243 | /** Used to detect host constructors (Safari > 5). */ | ||
24244 | var reIsHostCtor = /^\[object .+?Constructor\]$/; | ||
24245 | |||
24246 | /** | ||
24247 | * Checks if `value` is object-like. | ||
24248 | * | ||
24249 | * @private | ||
24250 | * @param {*} value The value to check. | ||
24251 | * @returns {boolean} Returns `true` if `value` is object-like, else `false`. | ||
24252 | */ | ||
24253 | function isObjectLike(value) { | ||
24254 | return !!value && typeof value == 'object'; | ||
24255 | } | ||
24256 | |||
24257 | /** Used for native method references. */ | ||
24258 | var objectProto = Object.prototype; | ||
24259 | |||
24260 | /** Used to resolve the decompiled source of functions. */ | ||
24261 | var fnToString = Function.prototype.toString; | ||
24262 | |||
24263 | /** Used to check objects for own properties. */ | ||
24264 | var hasOwnProperty = objectProto.hasOwnProperty; | ||
24265 | |||
24266 | /** | ||
24267 | * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) | ||
24268 | * of values. | ||
24269 | */ | ||
24270 | var objToString = objectProto.toString; | ||
24271 | |||
24272 | /** Used to detect if a method is native. */ | ||
24273 | var reIsNative = RegExp('^' + | ||
24274 | fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&') | ||
24275 | .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' | ||
24276 | ); | ||
24277 | |||
24278 | /* Native method references for those with the same name as other `lodash` methods. */ | ||
24279 | var nativeIsArray = getNative(Array, 'isArray'); | ||
24280 | |||
24281 | /** | ||
24282 | * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer) | ||
24283 | * of an array-like value. | ||
24284 | */ | ||
24285 | var MAX_SAFE_INTEGER = 9007199254740991; | ||
24286 | |||
24287 | /** | ||
24288 | * Gets the native function at `key` of `object`. | ||
24289 | * | ||
24290 | * @private | ||
24291 | * @param {Object} object The object to query. | ||
24292 | * @param {string} key The key of the method to get. | ||
24293 | * @returns {*} Returns the function if it's native, else `undefined`. | ||
24294 | */ | ||
24295 | function getNative(object, key) { | ||
24296 | var value = object == null ? undefined : object[key]; | ||
24297 | return isNative(value) ? value : undefined; | ||
24298 | } | ||
24299 | |||
24300 | /** | ||
24301 | * Checks if `value` is a valid array-like length. | ||
24302 | * | ||
24303 | * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). | ||
24304 | * | ||
24305 | * @private | ||
24306 | * @param {*} value The value to check. | ||
24307 | * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. | ||
24308 | */ | ||
24309 | function isLength(value) { | ||
24310 | return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; | ||
24311 | } | ||
24312 | |||
24313 | /** | ||
24314 | * Checks if `value` is classified as an `Array` object. | ||
24315 | * | ||
24316 | * @static | ||
24317 | * @memberOf _ | ||
24318 | * @category Lang | ||
24319 | * @param {*} value The value to check. | ||
24320 | * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. | ||
24321 | * @example | ||
24322 | * | ||
24323 | * _.isArray([1, 2, 3]); | ||
24324 | * // => true | ||
24325 | * | ||
24326 | * _.isArray(function() { return arguments; }()); | ||
24327 | * // => false | ||
24328 | */ | ||
24329 | var isArray = nativeIsArray || function(value) { | ||
24330 | return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag; | ||
24331 | }; | ||
24332 | |||
24333 | /** | ||
24334 | * Checks if `value` is classified as a `Function` object. | ||
24335 | * | ||
24336 | * @static | ||
24337 | * @memberOf _ | ||
24338 | * @category Lang | ||
24339 | * @param {*} value The value to check. | ||
24340 | * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. | ||
24341 | * @example | ||
24342 | * | ||
24343 | * _.isFunction(_); | ||
24344 | * // => true | ||
24345 | * | ||
24346 | * _.isFunction(/abc/); | ||
24347 | * // => false | ||
24348 | */ | ||
24349 | function isFunction(value) { | ||
24350 | // The use of `Object#toString` avoids issues with the `typeof` operator | ||
24351 | // in older versions of Chrome and Safari which return 'function' for regexes | ||
24352 | // and Safari 8 equivalents which return 'object' for typed array constructors. | ||
24353 | return isObject(value) && objToString.call(value) == funcTag; | ||
24354 | } | ||
24355 | |||
24356 | /** | ||
24357 | * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. | ||
24358 | * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) | ||
24359 | * | ||
24360 | * @static | ||
24361 | * @memberOf _ | ||
24362 | * @category Lang | ||
24363 | * @param {*} value The value to check. | ||
24364 | * @returns {boolean} Returns `true` if `value` is an object, else `false`. | ||
24365 | * @example | ||
24366 | * | ||
24367 | * _.isObject({}); | ||
24368 | * // => true | ||
24369 | * | ||
24370 | * _.isObject([1, 2, 3]); | ||
24371 | * // => true | ||
24372 | * | ||
24373 | * _.isObject(1); | ||
24374 | * // => false | ||
24375 | */ | ||
24376 | function isObject(value) { | ||
24377 | // Avoid a V8 JIT bug in Chrome 19-20. | ||
24378 | // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. | ||
24379 | var type = typeof value; | ||
24380 | return !!value && (type == 'object' || type == 'function'); | ||
24381 | } | ||
24382 | |||
24383 | /** | ||
24384 | * Checks if `value` is a native function. | ||
24385 | * | ||
24386 | * @static | ||
24387 | * @memberOf _ | ||
24388 | * @category Lang | ||
24389 | * @param {*} value The value to check. | ||
24390 | * @returns {boolean} Returns `true` if `value` is a native function, else `false`. | ||
24391 | * @example | ||
24392 | * | ||
24393 | * _.isNative(Array.prototype.push); | ||
24394 | * // => true | ||
24395 | * | ||
24396 | * _.isNative(_); | ||
24397 | * // => false | ||
24398 | */ | ||
24399 | function isNative(value) { | ||
24400 | if (value == null) { | ||
24401 | return false; | ||
24402 | } | ||
24403 | if (isFunction(value)) { | ||
24404 | return reIsNative.test(fnToString.call(value)); | ||
24405 | } | ||
24406 | return isObjectLike(value) && reIsHostCtor.test(value); | ||
24407 | } | ||
24408 | |||
24409 | module.exports = isArray; | ||
24410 | |||
24411 | |||
24412 | /***/ }, | ||
24413 | /* 187 */ | ||
23089 | /***/ function(module, exports) { | 24414 | /***/ function(module, exports) { |
23090 | 24415 | ||
23091 | /** | 24416 | /** |
@@ -23112,25 +24437,7 @@ | |||
23112 | module.exports = createChainedFunction; | 24437 | module.exports = createChainedFunction; |
23113 | 24438 | ||
23114 | /***/ }, | 24439 | /***/ }, |
23115 | /* 174 */ | 24440 | /* 188 */ |
23116 | /***/ function(module, exports) { | ||
23117 | |||
23118 | "use strict"; | ||
23119 | |||
23120 | module.exports = function contains(root, n) { | ||
23121 | var node = n; | ||
23122 | while (node) { | ||
23123 | if (node === root) { | ||
23124 | return true; | ||
23125 | } | ||
23126 | node = node.parentNode; | ||
23127 | } | ||
23128 | |||
23129 | return false; | ||
23130 | }; | ||
23131 | |||
23132 | /***/ }, | ||
23133 | /* 175 */ | ||
23134 | /***/ function(module, exports, __webpack_require__) { | 24441 | /***/ function(module, exports, __webpack_require__) { |
23135 | 24442 | ||
23136 | 'use strict'; | 24443 | 'use strict'; |
@@ -23142,7 +24449,7 @@ | |||
23142 | 24449 | ||
23143 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | 24450 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } |
23144 | 24451 | ||
23145 | var _addDomEventListener = __webpack_require__(176); | 24452 | var _addDomEventListener = __webpack_require__(189); |
23146 | 24453 | ||
23147 | var _addDomEventListener2 = _interopRequireDefault(_addDomEventListener); | 24454 | var _addDomEventListener2 = _interopRequireDefault(_addDomEventListener); |
23148 | 24455 | ||
@@ -23161,7 +24468,7 @@ | |||
23161 | module.exports = exports['default']; | 24468 | module.exports = exports['default']; |
23162 | 24469 | ||
23163 | /***/ }, | 24470 | /***/ }, |
23164 | /* 176 */ | 24471 | /* 189 */ |
23165 | /***/ function(module, exports, __webpack_require__) { | 24472 | /***/ function(module, exports, __webpack_require__) { |
23166 | 24473 | ||
23167 | 'use strict'; | 24474 | 'use strict'; |
@@ -23173,7 +24480,7 @@ | |||
23173 | 24480 | ||
23174 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | 24481 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } |
23175 | 24482 | ||
23176 | var _EventObject = __webpack_require__(177); | 24483 | var _EventObject = __webpack_require__(190); |
23177 | 24484 | ||
23178 | var _EventObject2 = _interopRequireDefault(_EventObject); | 24485 | var _EventObject2 = _interopRequireDefault(_EventObject); |
23179 | 24486 | ||
@@ -23203,7 +24510,7 @@ | |||
23203 | module.exports = exports['default']; | 24510 | module.exports = exports['default']; |
23204 | 24511 | ||
23205 | /***/ }, | 24512 | /***/ }, |
23206 | /* 177 */ | 24513 | /* 190 */ |
23207 | /***/ function(module, exports, __webpack_require__) { | 24514 | /***/ function(module, exports, __webpack_require__) { |
23208 | 24515 | ||
23209 | /** | 24516 | /** |
@@ -23220,11 +24527,11 @@ | |||
23220 | 24527 | ||
23221 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | 24528 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } |
23222 | 24529 | ||
23223 | var _EventBaseObject = __webpack_require__(178); | 24530 | var _EventBaseObject = __webpack_require__(191); |
23224 | 24531 | ||
23225 | var _EventBaseObject2 = _interopRequireDefault(_EventBaseObject); | 24532 | var _EventBaseObject2 = _interopRequireDefault(_EventBaseObject); |
23226 | 24533 | ||
23227 | var _objectAssign = __webpack_require__(179); | 24534 | var _objectAssign = __webpack_require__(192); |
23228 | 24535 | ||
23229 | var _objectAssign2 = _interopRequireDefault(_objectAssign); | 24536 | var _objectAssign2 = _interopRequireDefault(_objectAssign); |
23230 | 24537 | ||
@@ -23486,7 +24793,7 @@ | |||
23486 | module.exports = exports['default']; | 24793 | module.exports = exports['default']; |
23487 | 24794 | ||
23488 | /***/ }, | 24795 | /***/ }, |
23489 | /* 178 */ | 24796 | /* 191 */ |
23490 | /***/ function(module, exports) { | 24797 | /***/ function(module, exports) { |
23491 | 24798 | ||
23492 | /** | 24799 | /** |
@@ -23554,11 +24861,11 @@ | |||
23554 | module.exports = exports["default"]; | 24861 | module.exports = exports["default"]; |
23555 | 24862 | ||
23556 | /***/ }, | 24863 | /***/ }, |
23557 | /* 179 */ | 24864 | /* 192 */ |
23558 | /***/ function(module, exports) { | 24865 | /***/ function(module, exports) { |
23559 | 24866 | ||
23560 | 'use strict'; | ||
23561 | /* eslint-disable no-unused-vars */ | 24867 | /* eslint-disable no-unused-vars */ |
24868 | 'use strict'; | ||
23562 | var hasOwnProperty = Object.prototype.hasOwnProperty; | 24869 | var hasOwnProperty = Object.prototype.hasOwnProperty; |
23563 | var propIsEnumerable = Object.prototype.propertyIsEnumerable; | 24870 | var propIsEnumerable = Object.prototype.propertyIsEnumerable; |
23564 | 24871 | ||
@@ -23570,51 +24877,7 @@ | |||
23570 | return Object(val); | 24877 | return Object(val); |
23571 | } | 24878 | } |
23572 | 24879 | ||
23573 | function shouldUseNative() { | 24880 | module.exports = Object.assign || function (target, source) { |
23574 | try { | ||
23575 | if (!Object.assign) { | ||
23576 | return false; | ||
23577 | } | ||
23578 | |||
23579 | // Detect buggy property enumeration order in older V8 versions. | ||
23580 | |||
23581 | // https://bugs.chromium.org/p/v8/issues/detail?id=4118 | ||
23582 | var test1 = new String('abc'); // eslint-disable-line | ||
23583 | test1[5] = 'de'; | ||
23584 | if (Object.getOwnPropertyNames(test1)[0] === '5') { | ||
23585 | return false; | ||
23586 | } | ||
23587 | |||
23588 | // https://bugs.chromium.org/p/v8/issues/detail?id=3056 | ||
23589 | var test2 = {}; | ||
23590 | for (var i = 0; i < 10; i++) { | ||
23591 | test2['_' + String.fromCharCode(i)] = i; | ||
23592 | } | ||
23593 | var order2 = Object.getOwnPropertyNames(test2).map(function (n) { | ||
23594 | return test2[n]; | ||
23595 | }); | ||
23596 | if (order2.join('') !== '0123456789') { | ||
23597 | return false; | ||
23598 | } | ||
23599 | |||
23600 | // https://bugs.chromium.org/p/v8/issues/detail?id=3056 | ||
23601 | var test3 = {}; | ||
23602 | 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { | ||
23603 | test3[letter] = letter; | ||
23604 | }); | ||
23605 | if (Object.keys(Object.assign({}, test3)).join('') !== | ||
23606 | 'abcdefghijklmnopqrst') { | ||
23607 | return false; | ||
23608 | } | ||
23609 | |||
23610 | return true; | ||
23611 | } catch (e) { | ||
23612 | // We don't expect any of the above to throw, but better to be safe. | ||
23613 | return false; | ||
23614 | } | ||
23615 | } | ||
23616 | |||
23617 | module.exports = shouldUseNative() ? Object.assign : function (target, source) { | ||
23618 | var from; | 24881 | var from; |
23619 | var to = toObject(target); | 24882 | var to = toObject(target); |
23620 | var symbols; | 24883 | var symbols; |
@@ -23643,16 +24906,67 @@ | |||
23643 | 24906 | ||
23644 | 24907 | ||
23645 | /***/ }, | 24908 | /***/ }, |
23646 | /* 180 */ | 24909 | /* 193 */ |
24910 | /***/ function(module, exports) { | ||
24911 | |||
24912 | "use strict"; | ||
24913 | |||
24914 | module.exports = function contains(root, n) { | ||
24915 | var node = n; | ||
24916 | while (node) { | ||
24917 | if (node === root) { | ||
24918 | return true; | ||
24919 | } | ||
24920 | node = node.parentNode; | ||
24921 | } | ||
24922 | |||
24923 | return false; | ||
24924 | }; | ||
24925 | |||
24926 | /***/ }, | ||
24927 | /* 194 */ | ||
23647 | /***/ function(module, exports, __webpack_require__) { | 24928 | /***/ function(module, exports, __webpack_require__) { |
23648 | 24929 | ||
23649 | 'use strict'; | 24930 | 'use strict'; |
23650 | 24931 | ||
23651 | Object.defineProperty(exports, "__esModule", { | 24932 | var React = __webpack_require__(3); |
24933 | |||
24934 | module.exports = function toArray(children) { | ||
24935 | var ret = []; | ||
24936 | React.Children.forEach(children, function each(c) { | ||
24937 | ret.push(c); | ||
24938 | }); | ||
24939 | return ret; | ||
24940 | }; | ||
24941 | |||
24942 | /***/ }, | ||
24943 | /* 195 */ | ||
24944 | /***/ function(module, exports, __webpack_require__) { | ||
24945 | |||
24946 | 'use strict'; | ||
24947 | |||
24948 | var React = __webpack_require__(3); | ||
24949 | |||
24950 | function mirror(o) { | ||
24951 | return o; | ||
24952 | } | ||
24953 | |||
24954 | module.exports = function mapSelf(children) { | ||
24955 | // return ReactFragment | ||
24956 | return React.Children.map(children, mirror); | ||
24957 | }; | ||
24958 | |||
24959 | /***/ }, | ||
24960 | /* 196 */ | ||
24961 | /***/ function(module, exports, __webpack_require__) { | ||
24962 | |||
24963 | 'use strict'; | ||
24964 | |||
24965 | Object.defineProperty(exports, '__esModule', { | ||
23652 | value: true | 24966 | value: true |
23653 | }); | 24967 | }); |
23654 | 24968 | ||
23655 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | 24969 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } |
23656 | 24970 | ||
23657 | var _react = __webpack_require__(3); | 24971 | var _react = __webpack_require__(3); |
23658 | 24972 | ||
@@ -23662,44 +24976,35 @@ | |||
23662 | 24976 | ||
23663 | var _reactDom2 = _interopRequireDefault(_reactDom); | 24977 | var _reactDom2 = _interopRequireDefault(_reactDom); |
23664 | 24978 | ||
23665 | var _rcAlign = __webpack_require__(181); | 24979 | var _rcAlign = __webpack_require__(197); |
23666 | 24980 | ||
23667 | var _rcAlign2 = _interopRequireDefault(_rcAlign); | 24981 | var _rcAlign2 = _interopRequireDefault(_rcAlign); |
23668 | 24982 | ||
23669 | var _rcAnimate = __webpack_require__(192); | 24983 | var _rcAnimate = __webpack_require__(208); |
23670 | 24984 | ||
23671 | var _rcAnimate2 = _interopRequireDefault(_rcAnimate); | 24985 | var _rcAnimate2 = _interopRequireDefault(_rcAnimate); |
23672 | 24986 | ||
23673 | var _PopupInner = __webpack_require__(201); | 24987 | var _PopupInner = __webpack_require__(216); |
23674 | 24988 | ||
23675 | var _PopupInner2 = _interopRequireDefault(_PopupInner); | 24989 | var _PopupInner2 = _interopRequireDefault(_PopupInner); |
23676 | 24990 | ||
23677 | var _LazyRenderBox = __webpack_require__(202); | 24991 | var Popup = _react2['default'].createClass({ |
23678 | |||
23679 | var _LazyRenderBox2 = _interopRequireDefault(_LazyRenderBox); | ||
23680 | |||
23681 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
23682 | |||
23683 | var Popup = _react2["default"].createClass({ | ||
23684 | displayName: 'Popup', | 24992 | displayName: 'Popup', |
23685 | 24993 | ||
23686 | propTypes: { | 24994 | propTypes: { |
23687 | visible: _react.PropTypes.bool, | 24995 | visible: _react.PropTypes.bool, |
24996 | wrap: _react.PropTypes.object, | ||
23688 | style: _react.PropTypes.object, | 24997 | style: _react.PropTypes.object, |
23689 | getClassNameFromAlign: _react.PropTypes.func, | 24998 | getClassNameFromAlign: _react.PropTypes.func, |
23690 | onAlign: _react.PropTypes.func, | ||
23691 | getRootDomNode: _react.PropTypes.func, | ||
23692 | onMouseEnter: _react.PropTypes.func, | 24999 | onMouseEnter: _react.PropTypes.func, |
23693 | align: _react.PropTypes.any, | ||
23694 | destroyPopupOnHide: _react.PropTypes.bool, | ||
23695 | className: _react.PropTypes.string, | 25000 | className: _react.PropTypes.string, |
23696 | prefixCls: _react.PropTypes.string, | ||
23697 | onMouseLeave: _react.PropTypes.func | 25001 | onMouseLeave: _react.PropTypes.func |
23698 | }, | 25002 | }, |
23699 | 25003 | ||
23700 | componentDidMount: function componentDidMount() { | 25004 | componentDidMount: function componentDidMount() { |
23701 | this.rootNode = this.getPopupDomNode(); | 25005 | this.rootNode = this.getPopupDomNode(); |
23702 | }, | 25006 | }, |
25007 | |||
23703 | onAlign: function onAlign(popupDomNode, align) { | 25008 | onAlign: function onAlign(popupDomNode, align) { |
23704 | var props = this.props; | 25009 | var props = this.props; |
23705 | var alignClassName = props.getClassNameFromAlign(props.align); | 25010 | var alignClassName = props.getClassNameFromAlign(props.align); |
@@ -23708,23 +25013,16 @@ | |||
23708 | this.currentAlignClassName = currentAlignClassName; | 25013 | this.currentAlignClassName = currentAlignClassName; |
23709 | popupDomNode.className = this.getClassName(currentAlignClassName); | 25014 | popupDomNode.className = this.getClassName(currentAlignClassName); |
23710 | } | 25015 | } |
23711 | props.onAlign(popupDomNode, align); | ||
23712 | }, | 25016 | }, |
25017 | |||
23713 | getPopupDomNode: function getPopupDomNode() { | 25018 | getPopupDomNode: function getPopupDomNode() { |
23714 | return _reactDom2["default"].findDOMNode(this.refs.popup); | 25019 | return _reactDom2['default'].findDOMNode(this); |
23715 | }, | 25020 | }, |
25021 | |||
23716 | getTarget: function getTarget() { | 25022 | getTarget: function getTarget() { |
23717 | return this.props.getRootDomNode(); | 25023 | return _reactDom2['default'].findDOMNode(this.props.wrap); |
23718 | }, | ||
23719 | getMaskTransitionName: function getMaskTransitionName() { | ||
23720 | var props = this.props; | ||
23721 | var transitionName = props.maskTransitionName; | ||
23722 | var animation = props.maskAnimation; | ||
23723 | if (!transitionName && animation) { | ||
23724 | transitionName = props.prefixCls + '-' + animation; | ||
23725 | } | ||
23726 | return transitionName; | ||
23727 | }, | 25024 | }, |
25025 | |||
23728 | getTransitionName: function getTransitionName() { | 25026 | getTransitionName: function getTransitionName() { |
23729 | var props = this.props; | 25027 | var props = this.props; |
23730 | var transitionName = props.transitionName; | 25028 | var transitionName = props.transitionName; |
@@ -23733,10 +25031,17 @@ | |||
23733 | } | 25031 | } |
23734 | return transitionName; | 25032 | return transitionName; |
23735 | }, | 25033 | }, |
25034 | |||
23736 | getClassName: function getClassName(currentAlignClassName) { | 25035 | getClassName: function getClassName(currentAlignClassName) { |
23737 | return this.props.prefixCls + ' ' + this.props.className + ' ' + currentAlignClassName; | 25036 | var props = this.props; |
25037 | var prefixCls = props.prefixCls; | ||
25038 | |||
25039 | var className = prefixCls + ' ' + props.className + ' '; | ||
25040 | className += currentAlignClassName; | ||
25041 | return className; | ||
23738 | }, | 25042 | }, |
23739 | getPopupElement: function getPopupElement() { | 25043 | |
25044 | render: function render() { | ||
23740 | var props = this.props; | 25045 | var props = this.props; |
23741 | var align = props.align; | 25046 | var align = props.align; |
23742 | var style = props.style; | 25047 | var style = props.style; |
@@ -23749,158 +25054,100 @@ | |||
23749 | if (!visible) { | 25054 | if (!visible) { |
23750 | this.currentAlignClassName = null; | 25055 | this.currentAlignClassName = null; |
23751 | } | 25056 | } |
23752 | var newStyle = _extends({}, style, this.getZIndexStyle()); | ||
23753 | var popupInnerProps = { | ||
23754 | className: className, | ||
23755 | prefixCls: prefixCls, | ||
23756 | ref: 'popup', | ||
23757 | onMouseEnter: props.onMouseEnter, | ||
23758 | onMouseLeave: props.onMouseLeave, | ||
23759 | style: newStyle | ||
23760 | }; | ||
23761 | if (destroyPopupOnHide) { | 25057 | if (destroyPopupOnHide) { |
23762 | return _react2["default"].createElement( | 25058 | return _react2['default'].createElement( |
23763 | _rcAnimate2["default"], | 25059 | _rcAnimate2['default'], |
23764 | { | 25060 | { component: '', |
23765 | component: '', | ||
23766 | exclusive: true, | 25061 | exclusive: true, |
23767 | transitionAppear: true, | 25062 | transitionAppear: true, |
23768 | transitionName: this.getTransitionName() | 25063 | transitionName: this.getTransitionName() }, |
23769 | }, | 25064 | visible ? _react2['default'].createElement( |
23770 | visible ? _react2["default"].createElement( | 25065 | _rcAlign2['default'], |
23771 | _rcAlign2["default"], | 25066 | { target: this.getTarget, |
23772 | { | ||
23773 | target: this.getTarget, | ||
23774 | key: 'popup', | 25067 | key: 'popup', |
23775 | ref: this.saveAlign, | ||
23776 | monitorWindowResize: true, | 25068 | monitorWindowResize: true, |
23777 | align: align, | 25069 | align: align, |
23778 | onAlign: this.onAlign | 25070 | onAlign: this.onAlign }, |
23779 | }, | 25071 | _react2['default'].createElement( |
23780 | _react2["default"].createElement( | 25072 | _PopupInner2['default'], |
23781 | _PopupInner2["default"], | 25073 | { className: className, |
23782 | _extends({ | 25074 | visible: true, |
23783 | visible: true | 25075 | onMouseEnter: props.onMouseEnter, |
23784 | }, popupInnerProps), | 25076 | onMouseLeave: props.onMouseLeave, |
25077 | style: style }, | ||
23785 | props.children | 25078 | props.children |
23786 | ) | 25079 | ) |
23787 | ) : null | 25080 | ) : null |
23788 | ); | 25081 | ); |
23789 | } | 25082 | } |
23790 | return _react2["default"].createElement( | 25083 | return _react2['default'].createElement( |
23791 | _rcAnimate2["default"], | 25084 | _rcAnimate2['default'], |
23792 | { | 25085 | { component: '', |
23793 | component: '', | ||
23794 | exclusive: true, | 25086 | exclusive: true, |
23795 | transitionAppear: true, | 25087 | transitionAppear: true, |
23796 | transitionName: this.getTransitionName(), | 25088 | transitionName: this.getTransitionName(), |
23797 | showProp: 'xVisible' | 25089 | showProp: 'xVisible' }, |
23798 | }, | 25090 | _react2['default'].createElement( |
23799 | _react2["default"].createElement( | 25091 | _rcAlign2['default'], |
23800 | _rcAlign2["default"], | 25092 | { target: this.getTarget, |
23801 | { | ||
23802 | target: this.getTarget, | ||
23803 | key: 'popup', | 25093 | key: 'popup', |
23804 | ref: this.saveAlign, | ||
23805 | monitorWindowResize: true, | 25094 | monitorWindowResize: true, |
23806 | xVisible: visible, | 25095 | xVisible: visible, |
23807 | childrenProps: { visible: 'xVisible' }, | 25096 | childrenProps: { |
25097 | visible: 'xVisible' | ||
25098 | }, | ||
23808 | disabled: !visible, | 25099 | disabled: !visible, |
23809 | align: align, | 25100 | align: align, |
23810 | onAlign: this.onAlign | 25101 | onAlign: this.onAlign }, |
23811 | }, | 25102 | _react2['default'].createElement( |
23812 | _react2["default"].createElement( | 25103 | _PopupInner2['default'], |
23813 | _PopupInner2["default"], | 25104 | { className: className, |
23814 | _extends({ | 25105 | hiddenClassName: hiddenClassName, |
23815 | hiddenClassName: hiddenClassName | 25106 | onMouseEnter: props.onMouseEnter, |
23816 | }, popupInnerProps), | 25107 | onMouseLeave: props.onMouseLeave, |
25108 | style: style }, | ||
23817 | props.children | 25109 | props.children |
23818 | ) | 25110 | ) |
23819 | ) | 25111 | ) |
23820 | ); | 25112 | ); |
23821 | }, | ||
23822 | getZIndexStyle: function getZIndexStyle() { | ||
23823 | var style = {}; | ||
23824 | var props = this.props; | ||
23825 | if (props.zIndex !== undefined) { | ||
23826 | style.zIndex = props.zIndex; | ||
23827 | } | ||
23828 | return style; | ||
23829 | }, | ||
23830 | getMaskElement: function getMaskElement() { | ||
23831 | var props = this.props; | ||
23832 | var maskElement = void 0; | ||
23833 | if (props.mask) { | ||
23834 | var maskTransition = this.getMaskTransitionName(); | ||
23835 | maskElement = _react2["default"].createElement(_LazyRenderBox2["default"], { | ||
23836 | style: this.getZIndexStyle(), | ||
23837 | key: 'mask', | ||
23838 | className: props.prefixCls + '-mask', | ||
23839 | hiddenClassName: props.prefixCls + '-mask-hidden', | ||
23840 | visible: props.visible | ||
23841 | }); | ||
23842 | if (maskTransition) { | ||
23843 | maskElement = _react2["default"].createElement( | ||
23844 | _rcAnimate2["default"], | ||
23845 | { | ||
23846 | key: 'mask', | ||
23847 | showProp: 'visible', | ||
23848 | transitionAppear: true, | ||
23849 | component: '', | ||
23850 | transitionName: maskTransition | ||
23851 | }, | ||
23852 | maskElement | ||
23853 | ); | ||
23854 | } | ||
23855 | } | ||
23856 | return maskElement; | ||
23857 | }, | ||
23858 | saveAlign: function saveAlign(align) { | ||
23859 | this.alignInstance = align; | ||
23860 | }, | ||
23861 | render: function render() { | ||
23862 | return _react2["default"].createElement( | ||
23863 | 'div', | ||
23864 | null, | ||
23865 | this.getMaskElement(), | ||
23866 | this.getPopupElement() | ||
23867 | ); | ||
23868 | } | 25113 | } |
23869 | }); | 25114 | }); |
23870 | 25115 | ||
23871 | exports["default"] = Popup; | 25116 | exports['default'] = Popup; |
23872 | module.exports = exports['default']; | 25117 | module.exports = exports['default']; |
23873 | 25118 | ||
23874 | /***/ }, | 25119 | /***/ }, |
23875 | /* 181 */ | 25120 | /* 197 */ |
23876 | /***/ function(module, exports, __webpack_require__) { | 25121 | /***/ function(module, exports, __webpack_require__) { |
23877 | 25122 | ||
25123 | // export this package's api | ||
23878 | 'use strict'; | 25124 | 'use strict'; |
23879 | 25125 | ||
23880 | Object.defineProperty(exports, "__esModule", { | 25126 | Object.defineProperty(exports, '__esModule', { |
23881 | value: true | 25127 | value: true |
23882 | }); | 25128 | }); |
23883 | 25129 | ||
23884 | var _Align = __webpack_require__(182); | 25130 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } |
23885 | |||
23886 | var _Align2 = _interopRequireDefault(_Align); | ||
23887 | 25131 | ||
23888 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | 25132 | var _Align = __webpack_require__(198); |
23889 | 25133 | ||
23890 | exports["default"] = _Align2["default"]; // export this package's api | 25134 | var _Align2 = _interopRequireDefault(_Align); |
23891 | 25135 | ||
25136 | exports['default'] = _Align2['default']; | ||
23892 | module.exports = exports['default']; | 25137 | module.exports = exports['default']; |
23893 | 25138 | ||
23894 | /***/ }, | 25139 | /***/ }, |
23895 | /* 182 */ | 25140 | /* 198 */ |
23896 | /***/ function(module, exports, __webpack_require__) { | 25141 | /***/ function(module, exports, __webpack_require__) { |
23897 | 25142 | ||
23898 | 'use strict'; | 25143 | 'use strict'; |
23899 | 25144 | ||
23900 | Object.defineProperty(exports, "__esModule", { | 25145 | Object.defineProperty(exports, '__esModule', { |
23901 | value: true | 25146 | value: true |
23902 | }); | 25147 | }); |
23903 | 25148 | ||
25149 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
25150 | |||
23904 | var _react = __webpack_require__(3); | 25151 | var _react = __webpack_require__(3); |
23905 | 25152 | ||
23906 | var _react2 = _interopRequireDefault(_react); | 25153 | var _react2 = _interopRequireDefault(_react); |
@@ -23909,22 +25156,18 @@ | |||
23909 | 25156 | ||
23910 | var _reactDom2 = _interopRequireDefault(_reactDom); | 25157 | var _reactDom2 = _interopRequireDefault(_reactDom); |
23911 | 25158 | ||
23912 | var _domAlign = __webpack_require__(183); | 25159 | var _domAlign = __webpack_require__(199); |
23913 | 25160 | ||
23914 | var _domAlign2 = _interopRequireDefault(_domAlign); | 25161 | var _domAlign2 = _interopRequireDefault(_domAlign); |
23915 | 25162 | ||
23916 | var _addEventListener = __webpack_require__(175); | 25163 | var _rcUtil = __webpack_require__(173); |
23917 | 25164 | ||
23918 | var _addEventListener2 = _interopRequireDefault(_addEventListener); | 25165 | var _isWindow = __webpack_require__(207); |
23919 | |||
23920 | var _isWindow = __webpack_require__(191); | ||
23921 | 25166 | ||
23922 | var _isWindow2 = _interopRequireDefault(_isWindow); | 25167 | var _isWindow2 = _interopRequireDefault(_isWindow); |
23923 | 25168 | ||
23924 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
23925 | |||
23926 | function buffer(fn, ms) { | 25169 | function buffer(fn, ms) { |
23927 | var timer = void 0; | 25170 | var timer = undefined; |
23928 | return function bufferFn() { | 25171 | return function bufferFn() { |
23929 | if (timer) { | 25172 | if (timer) { |
23930 | clearTimeout(timer); | 25173 | clearTimeout(timer); |
@@ -23933,7 +25176,7 @@ | |||
23933 | }; | 25176 | }; |
23934 | } | 25177 | } |
23935 | 25178 | ||
23936 | var Align = _react2["default"].createClass({ | 25179 | var Align = _react2['default'].createClass({ |
23937 | displayName: 'Align', | 25180 | displayName: 'Align', |
23938 | 25181 | ||
23939 | propTypes: { | 25182 | propTypes: { |
@@ -23953,31 +25196,37 @@ | |||
23953 | return window; | 25196 | return window; |
23954 | }, | 25197 | }, |
23955 | onAlign: function onAlign() {}, | 25198 | onAlign: function onAlign() {}, |
23956 | |||
23957 | monitorBufferTime: 50, | 25199 | monitorBufferTime: 50, |
23958 | monitorWindowResize: false, | 25200 | monitorWindowResize: false, |
23959 | disabled: false | 25201 | disabled: false |
23960 | }; | 25202 | }; |
23961 | }, | 25203 | }, |
25204 | |||
23962 | componentDidMount: function componentDidMount() { | 25205 | componentDidMount: function componentDidMount() { |
23963 | var props = this.props; | 25206 | var props = this.props; |
23964 | // if parent ref not attached .... use document.getElementById | 25207 | // if parent ref not attached .... use document.getElementById |
23965 | this.forceAlign(); | 25208 | if (!props.disabled) { |
23966 | if (!props.disabled && props.monitorWindowResize) { | 25209 | var source = _reactDom2['default'].findDOMNode(this); |
23967 | this.startMonitorWindowResize(); | 25210 | props.onAlign(source, (0, _domAlign2['default'])(source, props.target(), props.align)); |
25211 | if (props.monitorWindowResize) { | ||
25212 | this.startMonitorWindowResize(); | ||
25213 | } | ||
23968 | } | 25214 | } |
23969 | }, | 25215 | }, |
25216 | |||
23970 | componentDidUpdate: function componentDidUpdate(prevProps) { | 25217 | componentDidUpdate: function componentDidUpdate(prevProps) { |
23971 | var reAlign = false; | 25218 | var reAlign = false; |
23972 | var props = this.props; | 25219 | var props = this.props; |
25220 | var currentTarget = undefined; | ||
23973 | 25221 | ||
23974 | if (!props.disabled) { | 25222 | if (!props.disabled) { |
23975 | if (prevProps.disabled || prevProps.align !== props.align) { | 25223 | if (prevProps.disabled || prevProps.align !== props.align) { |
23976 | reAlign = true; | 25224 | reAlign = true; |
25225 | currentTarget = props.target(); | ||
23977 | } else { | 25226 | } else { |
23978 | var lastTarget = prevProps.target(); | 25227 | var lastTarget = prevProps.target(); |
23979 | var currentTarget = props.target(); | 25228 | currentTarget = props.target(); |
23980 | if ((0, _isWindow2["default"])(lastTarget) && (0, _isWindow2["default"])(currentTarget)) { | 25229 | if ((0, _isWindow2['default'])(lastTarget) && (0, _isWindow2['default'])(currentTarget)) { |
23981 | reAlign = false; | 25230 | reAlign = false; |
23982 | } else if (lastTarget !== currentTarget) { | 25231 | } else if (lastTarget !== currentTarget) { |
23983 | reAlign = true; | 25232 | reAlign = true; |
@@ -23986,7 +25235,8 @@ | |||
23986 | } | 25235 | } |
23987 | 25236 | ||
23988 | if (reAlign) { | 25237 | if (reAlign) { |
23989 | this.forceAlign(); | 25238 | var source = _reactDom2['default'].findDOMNode(this); |
25239 | props.onAlign(source, (0, _domAlign2['default'])(source, currentTarget, props.align)); | ||
23990 | } | 25240 | } |
23991 | 25241 | ||
23992 | if (props.monitorWindowResize && !props.disabled) { | 25242 | if (props.monitorWindowResize && !props.disabled) { |
@@ -23995,33 +25245,38 @@ | |||
23995 | this.stopMonitorWindowResize(); | 25245 | this.stopMonitorWindowResize(); |
23996 | } | 25246 | } |
23997 | }, | 25247 | }, |
25248 | |||
23998 | componentWillUnmount: function componentWillUnmount() { | 25249 | componentWillUnmount: function componentWillUnmount() { |
23999 | this.stopMonitorWindowResize(); | 25250 | this.stopMonitorWindowResize(); |
24000 | }, | 25251 | }, |
25252 | |||
25253 | onWindowResize: function onWindowResize() { | ||
25254 | var props = this.props; | ||
25255 | if (!props.disabled) { | ||
25256 | var source = _reactDom2['default'].findDOMNode(this); | ||
25257 | props.onAlign(source, (0, _domAlign2['default'])(source, props.target(), props.align)); | ||
25258 | } | ||
25259 | }, | ||
25260 | |||
24001 | startMonitorWindowResize: function startMonitorWindowResize() { | 25261 | startMonitorWindowResize: function startMonitorWindowResize() { |
24002 | if (!this.resizeHandler) { | 25262 | if (!this.resizeHandler) { |
24003 | this.resizeHandler = (0, _addEventListener2["default"])(window, 'resize', buffer(this.forceAlign, this.props.monitorBufferTime)); | 25263 | this.resizeHandler = _rcUtil.Dom.addEventListener(window, 'resize', buffer(this.onWindowResize, this.props.monitorBufferTime)); |
24004 | } | 25264 | } |
24005 | }, | 25265 | }, |
25266 | |||
24006 | stopMonitorWindowResize: function stopMonitorWindowResize() { | 25267 | stopMonitorWindowResize: function stopMonitorWindowResize() { |
24007 | if (this.resizeHandler) { | 25268 | if (this.resizeHandler) { |
24008 | this.resizeHandler.remove(); | 25269 | this.resizeHandler.remove(); |
24009 | this.resizeHandler = null; | 25270 | this.resizeHandler = null; |
24010 | } | 25271 | } |
24011 | }, | 25272 | }, |
24012 | forceAlign: function forceAlign() { | 25273 | |
24013 | var props = this.props; | ||
24014 | if (!props.disabled) { | ||
24015 | var source = _reactDom2["default"].findDOMNode(this); | ||
24016 | props.onAlign(source, (0, _domAlign2["default"])(source, props.target(), props.align)); | ||
24017 | } | ||
24018 | }, | ||
24019 | render: function render() { | 25274 | render: function render() { |
24020 | var _props = this.props; | 25275 | var _props = this.props; |
24021 | var childrenProps = _props.childrenProps; | 25276 | var childrenProps = _props.childrenProps; |
24022 | var children = _props.children; | 25277 | var children = _props.children; |
24023 | 25278 | ||
24024 | var child = _react2["default"].Children.only(children); | 25279 | var child = _react2['default'].Children.only(children); |
24025 | if (childrenProps) { | 25280 | if (childrenProps) { |
24026 | var newProps = {}; | 25281 | var newProps = {}; |
24027 | for (var prop in childrenProps) { | 25282 | for (var prop in childrenProps) { |
@@ -24029,17 +25284,17 @@ | |||
24029 | newProps[prop] = this.props[childrenProps[prop]]; | 25284 | newProps[prop] = this.props[childrenProps[prop]]; |
24030 | } | 25285 | } |
24031 | } | 25286 | } |
24032 | return _react2["default"].cloneElement(child, newProps); | 25287 | return _react2['default'].cloneElement(child, newProps); |
24033 | } | 25288 | } |
24034 | return child; | 25289 | return child; |
24035 | } | 25290 | } |
24036 | }); | 25291 | }); |
24037 | 25292 | ||
24038 | exports["default"] = Align; | 25293 | exports['default'] = Align; |
24039 | module.exports = exports['default']; | 25294 | module.exports = exports['default']; |
24040 | 25295 | ||
24041 | /***/ }, | 25296 | /***/ }, |
24042 | /* 183 */ | 25297 | /* 199 */ |
24043 | /***/ function(module, exports, __webpack_require__) { | 25298 | /***/ function(module, exports, __webpack_require__) { |
24044 | 25299 | ||
24045 | /** | 25300 | /** |
@@ -24055,27 +25310,27 @@ | |||
24055 | 25310 | ||
24056 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | 25311 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } |
24057 | 25312 | ||
24058 | var _utils = __webpack_require__(184); | 25313 | var _utils = __webpack_require__(200); |
24059 | 25314 | ||
24060 | var _utils2 = _interopRequireDefault(_utils); | 25315 | var _utils2 = _interopRequireDefault(_utils); |
24061 | 25316 | ||
24062 | var _getOffsetParent = __webpack_require__(185); | 25317 | var _getOffsetParent = __webpack_require__(201); |
24063 | 25318 | ||
24064 | var _getOffsetParent2 = _interopRequireDefault(_getOffsetParent); | 25319 | var _getOffsetParent2 = _interopRequireDefault(_getOffsetParent); |
24065 | 25320 | ||
24066 | var _getVisibleRectForElement = __webpack_require__(186); | 25321 | var _getVisibleRectForElement = __webpack_require__(202); |
24067 | 25322 | ||
24068 | var _getVisibleRectForElement2 = _interopRequireDefault(_getVisibleRectForElement); | 25323 | var _getVisibleRectForElement2 = _interopRequireDefault(_getVisibleRectForElement); |
24069 | 25324 | ||
24070 | var _adjustForViewport = __webpack_require__(187); | 25325 | var _adjustForViewport = __webpack_require__(203); |
24071 | 25326 | ||
24072 | var _adjustForViewport2 = _interopRequireDefault(_adjustForViewport); | 25327 | var _adjustForViewport2 = _interopRequireDefault(_adjustForViewport); |
24073 | 25328 | ||
24074 | var _getRegion = __webpack_require__(188); | 25329 | var _getRegion = __webpack_require__(204); |
24075 | 25330 | ||
24076 | var _getRegion2 = _interopRequireDefault(_getRegion); | 25331 | var _getRegion2 = _interopRequireDefault(_getRegion); |
24077 | 25332 | ||
24078 | var _getElFuturePos = __webpack_require__(189); | 25333 | var _getElFuturePos = __webpack_require__(205); |
24079 | 25334 | ||
24080 | var _getElFuturePos2 = _interopRequireDefault(_getElFuturePos); | 25335 | var _getElFuturePos2 = _interopRequireDefault(_getElFuturePos); |
24081 | 25336 | ||
@@ -24089,14 +25344,6 @@ | |||
24089 | return elFuturePos.top < visibleRect.top || elFuturePos.top + elRegion.height > visibleRect.bottom; | 25344 | return elFuturePos.top < visibleRect.top || elFuturePos.top + elRegion.height > visibleRect.bottom; |
24090 | } | 25345 | } |
24091 | 25346 | ||
24092 | function isCompleteFailX(elFuturePos, elRegion, visibleRect) { | ||
24093 | return elFuturePos.left > visibleRect.right || elFuturePos.left + elRegion.width < visibleRect.left; | ||
24094 | } | ||
24095 | |||
24096 | function isCompleteFailY(elFuturePos, elRegion, visibleRect) { | ||
24097 | return elFuturePos.top > visibleRect.bottom || elFuturePos.top + elRegion.height < visibleRect.top; | ||
24098 | } | ||
24099 | |||
24100 | function flip(points, reg, map) { | 25347 | function flip(points, reg, map) { |
24101 | var ret = []; | 25348 | var ret = []; |
24102 | _utils2['default'].each(points, function (p) { | 25349 | _utils2['default'].each(points, function (p) { |
@@ -24159,42 +25406,30 @@ | |||
24159 | if (overflow.adjustX) { | 25406 | if (overflow.adjustX) { |
24160 | // 如果横向不能放下 | 25407 | // 如果横向不能放下 |
24161 | if (isFailX(elFuturePos, elRegion, visibleRect)) { | 25408 | if (isFailX(elFuturePos, elRegion, visibleRect)) { |
25409 | fail = 1; | ||
24162 | // 对齐位置反下 | 25410 | // 对齐位置反下 |
24163 | var newPoints = flip(points, /[lr]/ig, { | 25411 | points = flip(points, /[lr]/ig, { |
24164 | l: 'r', | 25412 | l: 'r', |
24165 | r: 'l' | 25413 | r: 'l' |
24166 | }); | 25414 | }); |
24167 | // 偏移量也反下 | 25415 | // 偏移量也反下 |
24168 | var newOffset = flipOffset(offset, 0); | 25416 | offset = flipOffset(offset, 0); |
24169 | var newTargetOffset = flipOffset(targetOffset, 0); | 25417 | targetOffset = flipOffset(targetOffset, 0); |
24170 | var newElFuturePos = (0, _getElFuturePos2['default'])(elRegion, refNodeRegion, newPoints, newOffset, newTargetOffset); | ||
24171 | if (!isCompleteFailX(newElFuturePos, elRegion, visibleRect)) { | ||
24172 | fail = 1; | ||
24173 | points = newPoints; | ||
24174 | offset = newOffset; | ||
24175 | targetOffset = newTargetOffset; | ||
24176 | } | ||
24177 | } | 25418 | } |
24178 | } | 25419 | } |
24179 | 25420 | ||
24180 | if (overflow.adjustY) { | 25421 | if (overflow.adjustY) { |
24181 | // 如果纵向不能放下 | 25422 | // 如果纵向不能放下 |
24182 | if (isFailY(elFuturePos, elRegion, visibleRect)) { | 25423 | if (isFailY(elFuturePos, elRegion, visibleRect)) { |
25424 | fail = 1; | ||
24183 | // 对齐位置反下 | 25425 | // 对齐位置反下 |
24184 | var newPoints = flip(points, /[tb]/ig, { | 25426 | points = flip(points, /[tb]/ig, { |
24185 | t: 'b', | 25427 | t: 'b', |
24186 | b: 't' | 25428 | b: 't' |
24187 | }); | 25429 | }); |
24188 | // 偏移量也反下 | 25430 | // 偏移量也反下 |
24189 | var newOffset = flipOffset(offset, 1); | 25431 | offset = flipOffset(offset, 1); |
24190 | var newTargetOffset = flipOffset(targetOffset, 1); | 25432 | targetOffset = flipOffset(targetOffset, 1); |
24191 | var newElFuturePos = (0, _getElFuturePos2['default'])(elRegion, refNodeRegion, newPoints, newOffset, newTargetOffset); | ||
24192 | if (!isCompleteFailY(newElFuturePos, elRegion, visibleRect)) { | ||
24193 | fail = 1; | ||
24194 | points = newPoints; | ||
24195 | offset = newOffset; | ||
24196 | targetOffset = newTargetOffset; | ||
24197 | } | ||
24198 | } | 25433 | } |
24199 | } | 25434 | } |
24200 | 25435 | ||
@@ -24262,7 +25497,7 @@ | |||
24262 | module.exports = exports['default']; | 25497 | module.exports = exports['default']; |
24263 | 25498 | ||
24264 | /***/ }, | 25499 | /***/ }, |
24265 | /* 184 */ | 25500 | /* 200 */ |
24266 | /***/ function(module, exports) { | 25501 | /***/ function(module, exports) { |
24267 | 25502 | ||
24268 | 'use strict'; | 25503 | 'use strict'; |
@@ -24760,7 +25995,7 @@ | |||
24760 | module.exports = exports['default']; | 25995 | module.exports = exports['default']; |
24761 | 25996 | ||
24762 | /***/ }, | 25997 | /***/ }, |
24763 | /* 185 */ | 25998 | /* 201 */ |
24764 | /***/ function(module, exports, __webpack_require__) { | 25999 | /***/ function(module, exports, __webpack_require__) { |
24765 | 26000 | ||
24766 | 'use strict'; | 26001 | 'use strict'; |
@@ -24771,7 +26006,7 @@ | |||
24771 | 26006 | ||
24772 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | 26007 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } |
24773 | 26008 | ||
24774 | var _utils = __webpack_require__(184); | 26009 | var _utils = __webpack_require__(200); |
24775 | 26010 | ||
24776 | var _utils2 = _interopRequireDefault(_utils); | 26011 | var _utils2 = _interopRequireDefault(_utils); |
24777 | 26012 | ||
@@ -24818,7 +26053,7 @@ | |||
24818 | module.exports = exports['default']; | 26053 | module.exports = exports['default']; |
24819 | 26054 | ||
24820 | /***/ }, | 26055 | /***/ }, |
24821 | /* 186 */ | 26056 | /* 202 */ |
24822 | /***/ function(module, exports, __webpack_require__) { | 26057 | /***/ function(module, exports, __webpack_require__) { |
24823 | 26058 | ||
24824 | 'use strict'; | 26059 | 'use strict'; |
@@ -24829,11 +26064,11 @@ | |||
24829 | 26064 | ||
24830 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | 26065 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } |
24831 | 26066 | ||
24832 | var _utils = __webpack_require__(184); | 26067 | var _utils = __webpack_require__(200); |
24833 | 26068 | ||
24834 | var _utils2 = _interopRequireDefault(_utils); | 26069 | var _utils2 = _interopRequireDefault(_utils); |
24835 | 26070 | ||
24836 | var _getOffsetParent = __webpack_require__(185); | 26071 | var _getOffsetParent = __webpack_require__(201); |
24837 | 26072 | ||
24838 | var _getOffsetParent2 = _interopRequireDefault(_getOffsetParent); | 26073 | var _getOffsetParent2 = _interopRequireDefault(_getOffsetParent); |
24839 | 26074 | ||
@@ -24899,7 +26134,7 @@ | |||
24899 | module.exports = exports['default']; | 26134 | module.exports = exports['default']; |
24900 | 26135 | ||
24901 | /***/ }, | 26136 | /***/ }, |
24902 | /* 187 */ | 26137 | /* 203 */ |
24903 | /***/ function(module, exports, __webpack_require__) { | 26138 | /***/ function(module, exports, __webpack_require__) { |
24904 | 26139 | ||
24905 | 'use strict'; | 26140 | 'use strict'; |
@@ -24910,7 +26145,7 @@ | |||
24910 | 26145 | ||
24911 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | 26146 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } |
24912 | 26147 | ||
24913 | var _utils = __webpack_require__(184); | 26148 | var _utils = __webpack_require__(200); |
24914 | 26149 | ||
24915 | var _utils2 = _interopRequireDefault(_utils); | 26150 | var _utils2 = _interopRequireDefault(_utils); |
24916 | 26151 | ||
@@ -24959,7 +26194,7 @@ | |||
24959 | module.exports = exports['default']; | 26194 | module.exports = exports['default']; |
24960 | 26195 | ||
24961 | /***/ }, | 26196 | /***/ }, |
24962 | /* 188 */ | 26197 | /* 204 */ |
24963 | /***/ function(module, exports, __webpack_require__) { | 26198 | /***/ function(module, exports, __webpack_require__) { |
24964 | 26199 | ||
24965 | 'use strict'; | 26200 | 'use strict'; |
@@ -24970,7 +26205,7 @@ | |||
24970 | 26205 | ||
24971 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | 26206 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } |
24972 | 26207 | ||
24973 | var _utils = __webpack_require__(184); | 26208 | var _utils = __webpack_require__(200); |
24974 | 26209 | ||
24975 | var _utils2 = _interopRequireDefault(_utils); | 26210 | var _utils2 = _interopRequireDefault(_utils); |
24976 | 26211 | ||
@@ -25000,7 +26235,7 @@ | |||
25000 | module.exports = exports['default']; | 26235 | module.exports = exports['default']; |
25001 | 26236 | ||
25002 | /***/ }, | 26237 | /***/ }, |
25003 | /* 189 */ | 26238 | /* 205 */ |
25004 | /***/ function(module, exports, __webpack_require__) { | 26239 | /***/ function(module, exports, __webpack_require__) { |
25005 | 26240 | ||
25006 | 'use strict'; | 26241 | 'use strict'; |
@@ -25011,7 +26246,7 @@ | |||
25011 | 26246 | ||
25012 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | 26247 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } |
25013 | 26248 | ||
25014 | var _getAlignOffset = __webpack_require__(190); | 26249 | var _getAlignOffset = __webpack_require__(206); |
25015 | 26250 | ||
25016 | var _getAlignOffset2 = _interopRequireDefault(_getAlignOffset); | 26251 | var _getAlignOffset2 = _interopRequireDefault(_getAlignOffset); |
25017 | 26252 | ||
@@ -25041,7 +26276,7 @@ | |||
25041 | module.exports = exports['default']; | 26276 | module.exports = exports['default']; |
25042 | 26277 | ||
25043 | /***/ }, | 26278 | /***/ }, |
25044 | /* 190 */ | 26279 | /* 206 */ |
25045 | /***/ function(module, exports) { | 26280 | /***/ function(module, exports) { |
25046 | 26281 | ||
25047 | /** | 26282 | /** |
@@ -25086,7 +26321,7 @@ | |||
25086 | module.exports = exports['default']; | 26321 | module.exports = exports['default']; |
25087 | 26322 | ||
25088 | /***/ }, | 26323 | /***/ }, |
25089 | /* 191 */ | 26324 | /* 207 */ |
25090 | /***/ function(module, exports) { | 26325 | /***/ function(module, exports) { |
25091 | 26326 | ||
25092 | "use strict"; | 26327 | "use strict"; |
@@ -25095,58 +26330,59 @@ | |||
25095 | value: true | 26330 | value: true |
25096 | }); | 26331 | }); |
25097 | exports["default"] = isWindow; | 26332 | exports["default"] = isWindow; |
26333 | |||
25098 | function isWindow(obj) { | 26334 | function isWindow(obj) { |
25099 | /* eslint no-eq-null: 0 */ | 26335 | /* eslint no-eq-null: 0 */ |
25100 | /* eslint eqeqeq: 0 */ | 26336 | /* eslint eqeqeq: 0 */ |
25101 | return obj != null && obj == obj.window; | 26337 | return obj != null && obj == obj.window; |
25102 | } | 26338 | } |
25103 | module.exports = exports['default']; | 26339 | |
26340 | module.exports = exports["default"]; | ||
25104 | 26341 | ||
25105 | /***/ }, | 26342 | /***/ }, |
25106 | /* 192 */ | 26343 | /* 208 */ |
25107 | /***/ function(module, exports, __webpack_require__) { | 26344 | /***/ function(module, exports, __webpack_require__) { |
25108 | 26345 | ||
26346 | // export this package's api | ||
25109 | 'use strict'; | 26347 | 'use strict'; |
25110 | 26348 | ||
25111 | // export this package's api | 26349 | module.exports = __webpack_require__(209); |
25112 | module.exports = __webpack_require__(193); | ||
25113 | 26350 | ||
25114 | /***/ }, | 26351 | /***/ }, |
25115 | /* 193 */ | 26352 | /* 209 */ |
25116 | /***/ function(module, exports, __webpack_require__) { | 26353 | /***/ function(module, exports, __webpack_require__) { |
25117 | 26354 | ||
25118 | 'use strict'; | 26355 | 'use strict'; |
25119 | 26356 | ||
25120 | Object.defineProperty(exports, "__esModule", { | 26357 | Object.defineProperty(exports, '__esModule', { |
25121 | value: true | 26358 | value: true |
25122 | }); | 26359 | }); |
25123 | 26360 | ||
26361 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
26362 | |||
26363 | function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
26364 | |||
25124 | var _react = __webpack_require__(3); | 26365 | var _react = __webpack_require__(3); |
25125 | 26366 | ||
25126 | var _react2 = _interopRequireDefault(_react); | 26367 | var _react2 = _interopRequireDefault(_react); |
25127 | 26368 | ||
25128 | var _ChildrenUtils = __webpack_require__(194); | 26369 | var _ChildrenUtils = __webpack_require__(210); |
25129 | 26370 | ||
25130 | var _AnimateChild = __webpack_require__(195); | 26371 | var _AnimateChild = __webpack_require__(211); |
25131 | 26372 | ||
25132 | var _AnimateChild2 = _interopRequireDefault(_AnimateChild); | 26373 | var _AnimateChild2 = _interopRequireDefault(_AnimateChild); |
25133 | 26374 | ||
25134 | var _util = __webpack_require__(200); | 26375 | var _util = __webpack_require__(215); |
25135 | 26376 | ||
25136 | var _util2 = _interopRequireDefault(_util); | 26377 | var _util2 = _interopRequireDefault(_util); |
25137 | 26378 | ||
25138 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
25139 | |||
25140 | function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
25141 | |||
25142 | var defaultKey = 'rc_animate_' + Date.now(); | 26379 | var defaultKey = 'rc_animate_' + Date.now(); |
25143 | 26380 | ||
25144 | |||
25145 | function getChildrenFromProps(props) { | 26381 | function getChildrenFromProps(props) { |
25146 | var children = props.children; | 26382 | var children = props.children; |
25147 | if (_react2["default"].isValidElement(children)) { | 26383 | if (_react2['default'].isValidElement(children)) { |
25148 | if (!children.key) { | 26384 | if (!children.key) { |
25149 | return _react2["default"].cloneElement(children, { | 26385 | return _react2['default'].cloneElement(children, { |
25150 | key: defaultKey | 26386 | key: defaultKey |
25151 | }); | 26387 | }); |
25152 | } | 26388 | } |
@@ -25156,22 +26392,22 @@ | |||
25156 | 26392 | ||
25157 | function noop() {} | 26393 | function noop() {} |
25158 | 26394 | ||
25159 | var Animate = _react2["default"].createClass({ | 26395 | var Animate = _react2['default'].createClass({ |
25160 | displayName: 'Animate', | 26396 | displayName: 'Animate', |
25161 | 26397 | ||
25162 | propTypes: { | 26398 | propTypes: { |
25163 | component: _react2["default"].PropTypes.any, | 26399 | component: _react2['default'].PropTypes.any, |
25164 | animation: _react2["default"].PropTypes.object, | 26400 | animation: _react2['default'].PropTypes.object, |
25165 | transitionName: _react2["default"].PropTypes.string, | 26401 | transitionName: _react2['default'].PropTypes.string, |
25166 | transitionEnter: _react2["default"].PropTypes.bool, | 26402 | transitionEnter: _react2['default'].PropTypes.bool, |
25167 | transitionAppear: _react2["default"].PropTypes.bool, | 26403 | transitionAppear: _react2['default'].PropTypes.bool, |
25168 | exclusive: _react2["default"].PropTypes.bool, | 26404 | exclusive: _react2['default'].PropTypes.bool, |
25169 | transitionLeave: _react2["default"].PropTypes.bool, | 26405 | transitionLeave: _react2['default'].PropTypes.bool, |
25170 | onEnd: _react2["default"].PropTypes.func, | 26406 | onEnd: _react2['default'].PropTypes.func, |
25171 | onEnter: _react2["default"].PropTypes.func, | 26407 | onEnter: _react2['default'].PropTypes.func, |
25172 | onLeave: _react2["default"].PropTypes.func, | 26408 | onLeave: _react2['default'].PropTypes.func, |
25173 | onAppear: _react2["default"].PropTypes.func, | 26409 | onAppear: _react2['default'].PropTypes.func, |
25174 | showProp: _react2["default"].PropTypes.string | 26410 | showProp: _react2['default'].PropTypes.string |
25175 | }, | 26411 | }, |
25176 | 26412 | ||
25177 | getDefaultProps: function getDefaultProps() { | 26413 | getDefaultProps: function getDefaultProps() { |
@@ -25187,6 +26423,7 @@ | |||
25187 | onAppear: noop | 26423 | onAppear: noop |
25188 | }; | 26424 | }; |
25189 | }, | 26425 | }, |
26426 | |||
25190 | getInitialState: function getInitialState() { | 26427 | getInitialState: function getInitialState() { |
25191 | this.currentlyAnimatingKeys = {}; | 26428 | this.currentlyAnimatingKeys = {}; |
25192 | this.keysToEnter = []; | 26429 | this.keysToEnter = []; |
@@ -25195,6 +26432,7 @@ | |||
25195 | children: (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(this.props)) | 26432 | children: (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(this.props)) |
25196 | }; | 26433 | }; |
25197 | }, | 26434 | }, |
26435 | |||
25198 | componentDidMount: function componentDidMount() { | 26436 | componentDidMount: function componentDidMount() { |
25199 | var _this = this; | 26437 | var _this = this; |
25200 | 26438 | ||
@@ -25209,30 +26447,25 @@ | |||
25209 | _this.performAppear(child.key); | 26447 | _this.performAppear(child.key); |
25210 | }); | 26448 | }); |
25211 | }, | 26449 | }, |
26450 | |||
25212 | componentWillReceiveProps: function componentWillReceiveProps(nextProps) { | 26451 | componentWillReceiveProps: function componentWillReceiveProps(nextProps) { |
25213 | var _this2 = this; | 26452 | var _this2 = this; |
25214 | 26453 | ||
25215 | this.nextProps = nextProps; | ||
25216 | var nextChildren = (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(nextProps)); | 26454 | var nextChildren = (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(nextProps)); |
25217 | var props = this.props; | 26455 | var props = this.props; |
25218 | // exclusive needs immediate response | ||
25219 | if (props.exclusive) { | ||
25220 | Object.keys(this.currentlyAnimatingKeys).forEach(function (key) { | ||
25221 | _this2.stop(key); | ||
25222 | }); | ||
25223 | } | ||
25224 | var showProp = props.showProp; | 26456 | var showProp = props.showProp; |
25225 | var currentlyAnimatingKeys = this.currentlyAnimatingKeys; | 26457 | var currentlyAnimatingKeys = this.currentlyAnimatingKeys; |
25226 | // last props children if exclusive | 26458 | // last props children if exclusive |
25227 | var currentChildren = props.exclusive ? (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(props)) : this.state.children; | 26459 | // exclusive needs immediate response |
26460 | var currentChildren = this.state.children; | ||
25228 | // in case destroy in showProp mode | 26461 | // in case destroy in showProp mode |
25229 | var newChildren = []; | 26462 | var newChildren = []; |
25230 | if (showProp) { | 26463 | if (showProp) { |
25231 | currentChildren.forEach(function (currentChild) { | 26464 | currentChildren.forEach(function (currentChild) { |
25232 | var nextChild = (0, _ChildrenUtils.findChildInChildrenByKey)(nextChildren, currentChild.key); | 26465 | var nextChild = (0, _ChildrenUtils.findChildInChildrenByKey)(nextChildren, currentChild.key); |
25233 | var newChild = void 0; | 26466 | var newChild = undefined; |
25234 | if ((!nextChild || !nextChild.props[showProp]) && currentChild.props[showProp]) { | 26467 | if ((!nextChild || !nextChild.props[showProp]) && currentChild.props[showProp]) { |
25235 | newChild = _react2["default"].cloneElement(nextChild || currentChild, _defineProperty({}, showProp, true)); | 26468 | newChild = _react2['default'].cloneElement(nextChild || currentChild, _defineProperty({}, showProp, true)); |
25236 | } else { | 26469 | } else { |
25237 | newChild = nextChild; | 26470 | newChild = nextChild; |
25238 | } | 26471 | } |
@@ -25296,14 +26529,26 @@ | |||
25296 | } | 26529 | } |
25297 | }); | 26530 | }); |
25298 | }, | 26531 | }, |
25299 | componentDidUpdate: function componentDidUpdate() { | 26532 | |
25300 | var keysToEnter = this.keysToEnter; | 26533 | componentDidUpdate: function componentDidUpdate(prevProps) { |
25301 | this.keysToEnter = []; | 26534 | var _this3 = this; |
25302 | keysToEnter.forEach(this.performEnter); | 26535 | |
25303 | var keysToLeave = this.keysToLeave; | 26536 | // exclusive needs immediate response |
25304 | this.keysToLeave = []; | 26537 | if (this.props.exclusive && this.props !== prevProps) { |
25305 | keysToLeave.forEach(this.performLeave); | 26538 | Object.keys(this.currentlyAnimatingKeys).forEach(function (key) { |
26539 | _this3.stop(key); | ||
26540 | }); | ||
26541 | } | ||
26542 | if (this.isMounted()) { | ||
26543 | var keysToEnter = this.keysToEnter; | ||
26544 | this.keysToEnter = []; | ||
26545 | keysToEnter.forEach(this.performEnter); | ||
26546 | var keysToLeave = this.keysToLeave; | ||
26547 | this.keysToLeave = []; | ||
26548 | keysToLeave.forEach(this.performLeave); | ||
26549 | } | ||
25306 | }, | 26550 | }, |
26551 | |||
25307 | performEnter: function performEnter(key) { | 26552 | performEnter: function performEnter(key) { |
25308 | // may already remove by exclusive | 26553 | // may already remove by exclusive |
25309 | if (this.refs[key]) { | 26554 | if (this.refs[key]) { |
@@ -25311,37 +26556,36 @@ | |||
25311 | this.refs[key].componentWillEnter(this.handleDoneAdding.bind(this, key, 'enter')); | 26556 | this.refs[key].componentWillEnter(this.handleDoneAdding.bind(this, key, 'enter')); |
25312 | } | 26557 | } |
25313 | }, | 26558 | }, |
26559 | |||
25314 | performAppear: function performAppear(key) { | 26560 | performAppear: function performAppear(key) { |
25315 | if (this.refs[key]) { | 26561 | if (this.refs[key]) { |
25316 | this.currentlyAnimatingKeys[key] = true; | 26562 | this.currentlyAnimatingKeys[key] = true; |
25317 | this.refs[key].componentWillAppear(this.handleDoneAdding.bind(this, key, 'appear')); | 26563 | this.refs[key].componentWillAppear(this.handleDoneAdding.bind(this, key, 'appear')); |
25318 | } | 26564 | } |
25319 | }, | 26565 | }, |
26566 | |||
25320 | handleDoneAdding: function handleDoneAdding(key, type) { | 26567 | handleDoneAdding: function handleDoneAdding(key, type) { |
25321 | var props = this.props; | 26568 | var props = this.props; |
25322 | delete this.currentlyAnimatingKeys[key]; | 26569 | delete this.currentlyAnimatingKeys[key]; |
25323 | // if update on exclusive mode, skip check | ||
25324 | if (props.exclusive && props !== this.nextProps) { | ||
25325 | return; | ||
25326 | } | ||
25327 | var currentChildren = (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(props)); | 26570 | var currentChildren = (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(props)); |
25328 | if (!this.isValidChildByKey(currentChildren, key)) { | 26571 | if (!this.isValidChildByKey(currentChildren, key)) { |
25329 | // exclusive will not need this | 26572 | // exclusive will not need this |
25330 | this.performLeave(key); | 26573 | this.performLeave(key); |
25331 | } else { | 26574 | } else { |
25332 | if (type === 'appear') { | 26575 | if (type === 'appear') { |
25333 | if (_util2["default"].allowAppearCallback(props)) { | 26576 | if (_util2['default'].allowAppearCallback(props)) { |
25334 | props.onAppear(key); | 26577 | props.onAppear(key); |
25335 | props.onEnd(key, true); | 26578 | props.onEnd(key, true); |
25336 | } | 26579 | } |
25337 | } else { | 26580 | } else { |
25338 | if (_util2["default"].allowEnterCallback(props)) { | 26581 | if (_util2['default'].allowEnterCallback(props)) { |
25339 | props.onEnter(key); | 26582 | props.onEnter(key); |
25340 | props.onEnd(key, true); | 26583 | props.onEnd(key, true); |
25341 | } | 26584 | } |
25342 | } | 26585 | } |
25343 | } | 26586 | } |
25344 | }, | 26587 | }, |
26588 | |||
25345 | performLeave: function performLeave(key) { | 26589 | performLeave: function performLeave(key) { |
25346 | // may already remove by exclusive | 26590 | // may already remove by exclusive |
25347 | if (this.refs[key]) { | 26591 | if (this.refs[key]) { |
@@ -25349,30 +26593,27 @@ | |||
25349 | this.refs[key].componentWillLeave(this.handleDoneLeaving.bind(this, key)); | 26593 | this.refs[key].componentWillLeave(this.handleDoneLeaving.bind(this, key)); |
25350 | } | 26594 | } |
25351 | }, | 26595 | }, |
26596 | |||
25352 | handleDoneLeaving: function handleDoneLeaving(key) { | 26597 | handleDoneLeaving: function handleDoneLeaving(key) { |
25353 | var props = this.props; | 26598 | var props = this.props; |
25354 | delete this.currentlyAnimatingKeys[key]; | 26599 | delete this.currentlyAnimatingKeys[key]; |
25355 | // if update on exclusive mode, skip check | ||
25356 | if (props.exclusive && props !== this.nextProps) { | ||
25357 | return; | ||
25358 | } | ||
25359 | var currentChildren = (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(props)); | 26600 | var currentChildren = (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(props)); |
25360 | // in case state change is too fast | 26601 | // in case state change is too fast |
25361 | if (this.isValidChildByKey(currentChildren, key)) { | 26602 | if (this.isValidChildByKey(currentChildren, key)) { |
25362 | this.performEnter(key); | 26603 | this.performEnter(key); |
25363 | } else { | 26604 | } else { |
25364 | /* eslint react/no-is-mounted:0 */ | 26605 | if (_util2['default'].allowLeaveCallback(props)) { |
26606 | props.onLeave(key); | ||
26607 | props.onEnd(key, false); | ||
26608 | } | ||
25365 | if (this.isMounted() && !(0, _ChildrenUtils.isSameChildren)(this.state.children, currentChildren, props.showProp)) { | 26609 | if (this.isMounted() && !(0, _ChildrenUtils.isSameChildren)(this.state.children, currentChildren, props.showProp)) { |
25366 | this.setState({ | 26610 | this.setState({ |
25367 | children: currentChildren | 26611 | children: currentChildren |
25368 | }); | 26612 | }); |
25369 | } | 26613 | } |
25370 | if (_util2["default"].allowLeaveCallback(props)) { | ||
25371 | props.onLeave(key); | ||
25372 | props.onEnd(key, false); | ||
25373 | } | ||
25374 | } | 26614 | } |
25375 | }, | 26615 | }, |
26616 | |||
25376 | isValidChildByKey: function isValidChildByKey(currentChildren, key) { | 26617 | isValidChildByKey: function isValidChildByKey(currentChildren, key) { |
25377 | var showProp = this.props.showProp; | 26618 | var showProp = this.props.showProp; |
25378 | if (showProp) { | 26619 | if (showProp) { |
@@ -25380,6 +26621,7 @@ | |||
25380 | } | 26621 | } |
25381 | return (0, _ChildrenUtils.findChildInChildrenByKey)(currentChildren, key); | 26622 | return (0, _ChildrenUtils.findChildInChildrenByKey)(currentChildren, key); |
25382 | }, | 26623 | }, |
26624 | |||
25383 | stop: function stop(key) { | 26625 | stop: function stop(key) { |
25384 | delete this.currentlyAnimatingKeys[key]; | 26626 | delete this.currentlyAnimatingKeys[key]; |
25385 | var component = this.refs[key]; | 26627 | var component = this.refs[key]; |
@@ -25387,21 +26629,18 @@ | |||
25387 | component.stop(); | 26629 | component.stop(); |
25388 | } | 26630 | } |
25389 | }, | 26631 | }, |
26632 | |||
25390 | render: function render() { | 26633 | render: function render() { |
25391 | var props = this.props; | 26634 | var props = this.props; |
25392 | this.nextProps = props; | ||
25393 | var stateChildren = this.state.children; | 26635 | var stateChildren = this.state.children; |
25394 | var children = null; | 26636 | var children = null; |
25395 | if (stateChildren) { | 26637 | if (stateChildren) { |
25396 | children = stateChildren.map(function (child) { | 26638 | children = stateChildren.map(function (child) { |
25397 | if (child === null) { | ||
25398 | return child; | ||
25399 | } | ||
25400 | if (!child.key) { | 26639 | if (!child.key) { |
25401 | throw new Error('must set key for <rc-animate> children'); | 26640 | throw new Error('must set key for <rc-animate> children'); |
25402 | } | 26641 | } |
25403 | return _react2["default"].createElement( | 26642 | return _react2['default'].createElement( |
25404 | _AnimateChild2["default"], | 26643 | _AnimateChild2['default'], |
25405 | { | 26644 | { |
25406 | key: child.key, | 26645 | key: child.key, |
25407 | ref: child.key, | 26646 | ref: child.key, |
@@ -25409,15 +26648,14 @@ | |||
25409 | transitionName: props.transitionName, | 26648 | transitionName: props.transitionName, |
25410 | transitionEnter: props.transitionEnter, | 26649 | transitionEnter: props.transitionEnter, |
25411 | transitionAppear: props.transitionAppear, | 26650 | transitionAppear: props.transitionAppear, |
25412 | transitionLeave: props.transitionLeave | 26651 | transitionLeave: props.transitionLeave }, |
25413 | }, | ||
25414 | child | 26652 | child |
25415 | ); | 26653 | ); |
25416 | }); | 26654 | }); |
25417 | } | 26655 | } |
25418 | var Component = props.component; | 26656 | var Component = props.component; |
25419 | if (Component) { | 26657 | if (Component) { |
25420 | return _react2["default"].createElement( | 26658 | return _react2['default'].createElement( |
25421 | Component, | 26659 | Component, |
25422 | this.props, | 26660 | this.props, |
25423 | children | 26661 | children |
@@ -25427,16 +26665,16 @@ | |||
25427 | } | 26665 | } |
25428 | }); | 26666 | }); |
25429 | 26667 | ||
25430 | exports["default"] = Animate; | 26668 | exports['default'] = Animate; |
25431 | module.exports = exports['default']; | 26669 | module.exports = exports['default']; |
25432 | 26670 | ||
25433 | /***/ }, | 26671 | /***/ }, |
25434 | /* 194 */ | 26672 | /* 210 */ |
25435 | /***/ function(module, exports, __webpack_require__) { | 26673 | /***/ function(module, exports, __webpack_require__) { |
25436 | 26674 | ||
25437 | 'use strict'; | 26675 | 'use strict'; |
25438 | 26676 | ||
25439 | Object.defineProperty(exports, "__esModule", { | 26677 | Object.defineProperty(exports, '__esModule', { |
25440 | value: true | 26678 | value: true |
25441 | }); | 26679 | }); |
25442 | exports.toArrayChildren = toArrayChildren; | 26680 | exports.toArrayChildren = toArrayChildren; |
@@ -25446,15 +26684,15 @@ | |||
25446 | exports.isSameChildren = isSameChildren; | 26684 | exports.isSameChildren = isSameChildren; |
25447 | exports.mergeChildren = mergeChildren; | 26685 | exports.mergeChildren = mergeChildren; |
25448 | 26686 | ||
26687 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
26688 | |||
25449 | var _react = __webpack_require__(3); | 26689 | var _react = __webpack_require__(3); |
25450 | 26690 | ||
25451 | var _react2 = _interopRequireDefault(_react); | 26691 | var _react2 = _interopRequireDefault(_react); |
25452 | 26692 | ||
25453 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
25454 | |||
25455 | function toArrayChildren(children) { | 26693 | function toArrayChildren(children) { |
25456 | var ret = []; | 26694 | var ret = []; |
25457 | _react2["default"].Children.forEach(children, function (child) { | 26695 | _react2['default'].Children.forEach(children, function (child) { |
25458 | ret.push(child); | 26696 | ret.push(child); |
25459 | }); | 26697 | }); |
25460 | return ret; | 26698 | return ret; |
@@ -25549,15 +26787,17 @@ | |||
25549 | } | 26787 | } |
25550 | 26788 | ||
25551 | /***/ }, | 26789 | /***/ }, |
25552 | /* 195 */ | 26790 | /* 211 */ |
25553 | /***/ function(module, exports, __webpack_require__) { | 26791 | /***/ function(module, exports, __webpack_require__) { |
25554 | 26792 | ||
25555 | 'use strict'; | 26793 | 'use strict'; |
25556 | 26794 | ||
25557 | Object.defineProperty(exports, "__esModule", { | 26795 | Object.defineProperty(exports, '__esModule', { |
25558 | value: true | 26796 | value: true |
25559 | }); | 26797 | }); |
25560 | 26798 | ||
26799 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
26800 | |||
25561 | var _react = __webpack_require__(3); | 26801 | var _react = __webpack_require__(3); |
25562 | 26802 | ||
25563 | var _react2 = _interopRequireDefault(_react); | 26803 | var _react2 = _interopRequireDefault(_react); |
@@ -25566,60 +26806,59 @@ | |||
25566 | 26806 | ||
25567 | var _reactDom2 = _interopRequireDefault(_reactDom); | 26807 | var _reactDom2 = _interopRequireDefault(_reactDom); |
25568 | 26808 | ||
25569 | var _cssAnimation = __webpack_require__(196); | 26809 | var _cssAnimation = __webpack_require__(212); |
25570 | 26810 | ||
25571 | var _cssAnimation2 = _interopRequireDefault(_cssAnimation); | 26811 | var _cssAnimation2 = _interopRequireDefault(_cssAnimation); |
25572 | 26812 | ||
25573 | var _util = __webpack_require__(200); | 26813 | var _util = __webpack_require__(215); |
25574 | 26814 | ||
25575 | var _util2 = _interopRequireDefault(_util); | 26815 | var _util2 = _interopRequireDefault(_util); |
25576 | 26816 | ||
25577 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
25578 | |||
25579 | var transitionMap = { | 26817 | var transitionMap = { |
25580 | enter: 'transitionEnter', | 26818 | enter: 'transitionEnter', |
25581 | appear: 'transitionAppear', | 26819 | appear: 'transitionAppear', |
25582 | leave: 'transitionLeave' | 26820 | leave: 'transitionLeave' |
25583 | }; | 26821 | }; |
25584 | 26822 | ||
25585 | var AnimateChild = _react2["default"].createClass({ | 26823 | var AnimateChild = _react2['default'].createClass({ |
25586 | displayName: 'AnimateChild', | 26824 | displayName: 'AnimateChild', |
25587 | 26825 | ||
25588 | propTypes: { | 26826 | propTypes: { |
25589 | children: _react2["default"].PropTypes.any | 26827 | children: _react2['default'].PropTypes.any |
25590 | }, | 26828 | }, |
25591 | 26829 | ||
25592 | componentWillUnmount: function componentWillUnmount() { | 26830 | componentWillUnmount: function componentWillUnmount() { |
25593 | this.stop(); | 26831 | this.stop(); |
25594 | }, | 26832 | }, |
26833 | |||
25595 | componentWillEnter: function componentWillEnter(done) { | 26834 | componentWillEnter: function componentWillEnter(done) { |
25596 | if (_util2["default"].isEnterSupported(this.props)) { | 26835 | if (_util2['default'].isEnterSupported(this.props)) { |
25597 | this.transition('enter', done); | 26836 | this.transition('enter', done); |
25598 | } else { | 26837 | } else { |
25599 | setTimeout(done, 0); | 26838 | done(); |
25600 | } | 26839 | } |
25601 | }, | 26840 | }, |
26841 | |||
25602 | componentWillAppear: function componentWillAppear(done) { | 26842 | componentWillAppear: function componentWillAppear(done) { |
25603 | if (_util2["default"].isAppearSupported(this.props)) { | 26843 | if (_util2['default'].isAppearSupported(this.props)) { |
25604 | this.transition('appear', done); | 26844 | this.transition('appear', done); |
25605 | } else { | 26845 | } else { |
25606 | setTimeout(done, 0); | 26846 | done(); |
25607 | } | 26847 | } |
25608 | }, | 26848 | }, |
26849 | |||
25609 | componentWillLeave: function componentWillLeave(done) { | 26850 | componentWillLeave: function componentWillLeave(done) { |
25610 | if (_util2["default"].isLeaveSupported(this.props)) { | 26851 | if (_util2['default'].isLeaveSupported(this.props)) { |
25611 | this.transition('leave', done); | 26852 | this.transition('leave', done); |
25612 | } else { | 26853 | } else { |
25613 | // always sync, do not interupt with react component life cycle | 26854 | done(); |
25614 | // update hidden -> animate hidden -> | ||
25615 | // didUpdate -> animate leave -> unmount (if animate is none) | ||
25616 | setTimeout(done, 0); | ||
25617 | } | 26855 | } |
25618 | }, | 26856 | }, |
26857 | |||
25619 | transition: function transition(animationType, finishCallback) { | 26858 | transition: function transition(animationType, finishCallback) { |
25620 | var _this = this; | 26859 | var _this = this; |
25621 | 26860 | ||
25622 | var node = _reactDom2["default"].findDOMNode(this); | 26861 | var node = _reactDom2['default'].findDOMNode(this); |
25623 | var props = this.props; | 26862 | var props = this.props; |
25624 | var transitionName = props.transitionName; | 26863 | var transitionName = props.transitionName; |
25625 | this.stop(); | 26864 | this.stop(); |
@@ -25628,11 +26867,12 @@ | |||
25628 | finishCallback(); | 26867 | finishCallback(); |
25629 | }; | 26868 | }; |
25630 | if ((_cssAnimation.isCssAnimationSupported || !props.animation[animationType]) && transitionName && props[transitionMap[animationType]]) { | 26869 | if ((_cssAnimation.isCssAnimationSupported || !props.animation[animationType]) && transitionName && props[transitionMap[animationType]]) { |
25631 | this.stopper = (0, _cssAnimation2["default"])(node, transitionName + '-' + animationType, end); | 26870 | this.stopper = (0, _cssAnimation2['default'])(node, transitionName + '-' + animationType, end); |
25632 | } else { | 26871 | } else { |
25633 | this.stopper = props.animation[animationType](node, end); | 26872 | this.stopper = props.animation[animationType](node, end); |
25634 | } | 26873 | } |
25635 | }, | 26874 | }, |
26875 | |||
25636 | stop: function stop() { | 26876 | stop: function stop() { |
25637 | var stopper = this.stopper; | 26877 | var stopper = this.stopper; |
25638 | if (stopper) { | 26878 | if (stopper) { |
@@ -25640,45 +26880,28 @@ | |||
25640 | stopper.stop(); | 26880 | stopper.stop(); |
25641 | } | 26881 | } |
25642 | }, | 26882 | }, |
26883 | |||
25643 | render: function render() { | 26884 | render: function render() { |
25644 | return this.props.children; | 26885 | return this.props.children; |
25645 | } | 26886 | } |
25646 | }); | 26887 | }); |
25647 | 26888 | ||
25648 | exports["default"] = AnimateChild; | 26889 | exports['default'] = AnimateChild; |
25649 | module.exports = exports['default']; | 26890 | module.exports = exports['default']; |
25650 | 26891 | ||
25651 | /***/ }, | 26892 | /***/ }, |
25652 | /* 196 */ | 26893 | /* 212 */ |
25653 | /***/ function(module, exports, __webpack_require__) { | 26894 | /***/ function(module, exports, __webpack_require__) { |
25654 | 26895 | ||
25655 | 'use strict'; | 26896 | 'use strict'; |
25656 | 26897 | ||
25657 | Object.defineProperty(exports, "__esModule", { | 26898 | var Event = __webpack_require__(213); |
25658 | value: true | 26899 | var Css = __webpack_require__(214); |
25659 | }); | 26900 | var isCssAnimationSupported = Event.endEvents.length !== 0; |
25660 | |||
25661 | var _Event = __webpack_require__(197); | ||
25662 | |||
25663 | var _Event2 = _interopRequireDefault(_Event); | ||
25664 | |||
25665 | var _componentClasses = __webpack_require__(198); | ||
25666 | |||
25667 | var _componentClasses2 = _interopRequireDefault(_componentClasses); | ||
25668 | |||
25669 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
25670 | |||
25671 | var isCssAnimationSupported = _Event2["default"].endEvents.length !== 0; | ||
25672 | |||
25673 | |||
25674 | var capitalPrefixes = ['Webkit', 'Moz', 'O', | ||
25675 | // ms is special .... ! | ||
25676 | 'ms']; | ||
25677 | var prefixes = ['-webkit-', '-moz-', '-o-', 'ms-', '']; | ||
25678 | 26901 | ||
25679 | function getDuration(node, name) { | 26902 | function getDuration(node, name) { |
25680 | var style = window.getComputedStyle(node); | 26903 | var style = window.getComputedStyle(node); |
25681 | 26904 | var prefixes = ['-webkit-', '-moz-', '-o-', 'ms-', '']; | |
25682 | var ret = ''; | 26905 | var ret = ''; |
25683 | for (var i = 0; i < prefixes.length; i++) { | 26906 | for (var i = 0; i < prefixes.length; i++) { |
25684 | ret = style.getPropertyValue(prefixes[i] + name); | 26907 | ret = style.getPropertyValue(prefixes[i] + name); |
@@ -25711,19 +26934,9 @@ | |||
25711 | } | 26934 | } |
25712 | } | 26935 | } |
25713 | 26936 | ||
25714 | var cssAnimation = function cssAnimation(node, transitionName, endCallback) { | 26937 | var cssAnimation = function cssAnimation(node, transitionName, callback) { |
25715 | var className = transitionName; | 26938 | var className = transitionName; |
25716 | var activeClassName = className + '-active'; | 26939 | var activeClassName = className + '-active'; |
25717 | var end = endCallback; | ||
25718 | var start = void 0; | ||
25719 | var active = void 0; | ||
25720 | var nodeClasses = (0, _componentClasses2["default"])(node); | ||
25721 | |||
25722 | if (endCallback && Object.prototype.toString.call(endCallback) === '[object Object]') { | ||
25723 | end = endCallback.end; | ||
25724 | start = endCallback.start; | ||
25725 | active = endCallback.active; | ||
25726 | } | ||
25727 | 26940 | ||
25728 | if (node.rcEndListener) { | 26941 | if (node.rcEndListener) { |
25729 | node.rcEndListener(); | 26942 | node.rcEndListener(); |
@@ -25741,35 +26954,28 @@ | |||
25741 | 26954 | ||
25742 | clearBrowserBugTimeout(node); | 26955 | clearBrowserBugTimeout(node); |
25743 | 26956 | ||
25744 | nodeClasses.remove(className); | 26957 | Css.removeClass(node, className); |
25745 | nodeClasses.remove(activeClassName); | 26958 | Css.removeClass(node, activeClassName); |
25746 | 26959 | ||
25747 | _Event2["default"].removeEndEventListener(node, node.rcEndListener); | 26960 | Event.removeEndEventListener(node, node.rcEndListener); |
25748 | node.rcEndListener = null; | 26961 | node.rcEndListener = null; |
25749 | 26962 | ||
25750 | // Usually this optional end is used for informing an owner of | 26963 | // Usually this optional callback is used for informing an owner of |
25751 | // a leave animation and telling it to remove the child. | 26964 | // a leave animation and telling it to remove the child. |
25752 | if (end) { | 26965 | if (callback) { |
25753 | end(); | 26966 | callback(); |
25754 | } | 26967 | } |
25755 | }; | 26968 | }; |
25756 | 26969 | ||
25757 | _Event2["default"].addEndEventListener(node, node.rcEndListener); | 26970 | Event.addEndEventListener(node, node.rcEndListener); |
25758 | 26971 | ||
25759 | if (start) { | 26972 | Css.addClass(node, className); |
25760 | start(); | ||
25761 | } | ||
25762 | nodeClasses.add(className); | ||
25763 | 26973 | ||
25764 | node.rcAnimTimeout = setTimeout(function () { | 26974 | node.rcAnimTimeout = setTimeout(function () { |
25765 | node.rcAnimTimeout = null; | 26975 | node.rcAnimTimeout = null; |
25766 | nodeClasses.add(activeClassName); | 26976 | Css.addClass(node, activeClassName); |
25767 | if (active) { | ||
25768 | setTimeout(active, 0); | ||
25769 | } | ||
25770 | fixBrowserByTimeout(node); | 26977 | fixBrowserByTimeout(node); |
25771 | // 30ms for firefox | 26978 | }, 0); |
25772 | }, 30); | ||
25773 | 26979 | ||
25774 | return { | 26980 | return { |
25775 | stop: function stop() { | 26981 | stop: function stop() { |
@@ -25797,7 +27003,7 @@ | |||
25797 | 27003 | ||
25798 | clearBrowserBugTimeout(node); | 27004 | clearBrowserBugTimeout(node); |
25799 | 27005 | ||
25800 | _Event2["default"].removeEndEventListener(node, node.rcEndListener); | 27006 | Event.removeEndEventListener(node, node.rcEndListener); |
25801 | node.rcEndListener = null; | 27007 | node.rcEndListener = null; |
25802 | 27008 | ||
25803 | // Usually this optional callback is used for informing an owner of | 27009 | // Usually this optional callback is used for informing an owner of |
@@ -25807,7 +27013,7 @@ | |||
25807 | } | 27013 | } |
25808 | }; | 27014 | }; |
25809 | 27015 | ||
25810 | _Event2["default"].addEndEventListener(node, node.rcEndListener); | 27016 | Event.addEndEventListener(node, node.rcEndListener); |
25811 | 27017 | ||
25812 | node.rcAnimTimeout = setTimeout(function () { | 27018 | node.rcAnimTimeout = setTimeout(function () { |
25813 | for (var s in style) { | 27019 | for (var s in style) { |
@@ -25828,25 +27034,25 @@ | |||
25828 | property = ''; | 27034 | property = ''; |
25829 | } | 27035 | } |
25830 | property = property || ''; | 27036 | property = property || ''; |
25831 | capitalPrefixes.forEach(function (prefix) { | 27037 | ['Webkit', 'Moz', 'O', |
27038 | // ms is special .... ! | ||
27039 | 'ms'].forEach(function (prefix) { | ||
25832 | node.style[prefix + 'Transition' + property] = v; | 27040 | node.style[prefix + 'Transition' + property] = v; |
25833 | }); | 27041 | }); |
25834 | }; | 27042 | }; |
25835 | 27043 | ||
27044 | cssAnimation.addClass = Css.addClass; | ||
27045 | cssAnimation.removeClass = Css.removeClass; | ||
25836 | cssAnimation.isCssAnimationSupported = isCssAnimationSupported; | 27046 | cssAnimation.isCssAnimationSupported = isCssAnimationSupported; |
25837 | 27047 | ||
25838 | exports["default"] = cssAnimation; | 27048 | module.exports = cssAnimation; |
25839 | module.exports = exports['default']; | ||
25840 | 27049 | ||
25841 | /***/ }, | 27050 | /***/ }, |
25842 | /* 197 */ | 27051 | /* 213 */ |
25843 | /***/ function(module, exports) { | 27052 | /***/ function(module, exports) { |
25844 | 27053 | ||
25845 | 'use strict'; | 27054 | 'use strict'; |
25846 | 27055 | ||
25847 | Object.defineProperty(exports, "__esModule", { | ||
25848 | value: true | ||
25849 | }); | ||
25850 | var EVENT_NAME_MAP = { | 27056 | var EVENT_NAME_MAP = { |
25851 | transitionend: { | 27057 | transitionend: { |
25852 | transition: 'transitionend', | 27058 | transition: 'transitionend', |
@@ -25892,7 +27098,7 @@ | |||
25892 | } | 27098 | } |
25893 | } | 27099 | } |
25894 | 27100 | ||
25895 | if (typeof window !== 'undefined' && typeof document !== 'undefined') { | 27101 | if (typeof window !== 'undefined') { |
25896 | detectEvents(); | 27102 | detectEvents(); |
25897 | } | 27103 | } |
25898 | 27104 | ||
@@ -25915,7 +27121,6 @@ | |||
25915 | }); | 27121 | }); |
25916 | }, | 27122 | }, |
25917 | 27123 | ||
25918 | |||
25919 | endEvents: endEvents, | 27124 | endEvents: endEvents, |
25920 | 27125 | ||
25921 | removeEndEventListener: function removeEndEventListener(node, eventListener) { | 27126 | removeEndEventListener: function removeEndEventListener(node, eventListener) { |
@@ -25928,220 +27133,41 @@ | |||
25928 | } | 27133 | } |
25929 | }; | 27134 | }; |
25930 | 27135 | ||
25931 | exports["default"] = TransitionEvents; | 27136 | module.exports = TransitionEvents; |
25932 | module.exports = exports['default']; | ||
25933 | 27137 | ||
25934 | /***/ }, | 27138 | /***/ }, |
25935 | /* 198 */ | 27139 | /* 214 */ |
25936 | /***/ function(module, exports, __webpack_require__) { | 27140 | /***/ function(module, exports) { |
25937 | 27141 | ||
25938 | /** | 27142 | 'use strict'; |
25939 | * Module dependencies. | ||
25940 | */ | ||
25941 | |||
25942 | try { | ||
25943 | var index = __webpack_require__(199); | ||
25944 | } catch (err) { | ||
25945 | var index = __webpack_require__(199); | ||
25946 | } | ||
25947 | |||
25948 | /** | ||
25949 | * Whitespace regexp. | ||
25950 | */ | ||
25951 | |||
25952 | var re = /\s+/; | ||
25953 | |||
25954 | /** | ||
25955 | * toString reference. | ||
25956 | */ | ||
25957 | |||
25958 | var toString = Object.prototype.toString; | ||
25959 | |||
25960 | /** | ||
25961 | * Wrap `el` in a `ClassList`. | ||
25962 | * | ||
25963 | * @param {Element} el | ||
25964 | * @return {ClassList} | ||
25965 | * @api public | ||
25966 | */ | ||
25967 | |||
25968 | module.exports = function(el){ | ||
25969 | return new ClassList(el); | ||
25970 | }; | ||
25971 | 27143 | ||
25972 | /** | 27144 | var SPACE = ' '; |
25973 | * Initialize a new ClassList for `el`. | 27145 | var RE_CLASS = /[\n\t\r]/g; |
25974 | * | ||
25975 | * @param {Element} el | ||
25976 | * @api private | ||
25977 | */ | ||
25978 | 27146 | ||
25979 | function ClassList(el) { | 27147 | function norm(elemClass) { |
25980 | if (!el || !el.nodeType) { | 27148 | return (SPACE + elemClass + SPACE).replace(RE_CLASS, SPACE); |
25981 | throw new Error('A DOM element reference is required'); | ||
25982 | } | ||
25983 | this.el = el; | ||
25984 | this.list = el.classList; | ||
25985 | } | 27149 | } |
25986 | 27150 | ||
25987 | /** | 27151 | module.exports = { |
25988 | * Add class `name` if not already present. | 27152 | addClass: function addClass(elem, className) { |
25989 | * | 27153 | elem.className += ' ' + className; |
25990 | * @param {String} name | 27154 | }, |
25991 | * @return {ClassList} | ||
25992 | * @api public | ||
25993 | */ | ||
25994 | |||
25995 | ClassList.prototype.add = function(name){ | ||
25996 | // classList | ||
25997 | if (this.list) { | ||
25998 | this.list.add(name); | ||
25999 | return this; | ||
26000 | } | ||
26001 | |||
26002 | // fallback | ||
26003 | var arr = this.array(); | ||
26004 | var i = index(arr, name); | ||
26005 | if (!~i) arr.push(name); | ||
26006 | this.el.className = arr.join(' '); | ||
26007 | return this; | ||
26008 | }; | ||
26009 | |||
26010 | /** | ||
26011 | * Remove class `name` when present, or | ||
26012 | * pass a regular expression to remove | ||
26013 | * any which match. | ||
26014 | * | ||
26015 | * @param {String|RegExp} name | ||
26016 | * @return {ClassList} | ||
26017 | * @api public | ||
26018 | */ | ||
26019 | |||
26020 | ClassList.prototype.remove = function(name){ | ||
26021 | if ('[object RegExp]' == toString.call(name)) { | ||
26022 | return this.removeMatching(name); | ||
26023 | } | ||
26024 | |||
26025 | // classList | ||
26026 | if (this.list) { | ||
26027 | this.list.remove(name); | ||
26028 | return this; | ||
26029 | } | ||
26030 | |||
26031 | // fallback | ||
26032 | var arr = this.array(); | ||
26033 | var i = index(arr, name); | ||
26034 | if (~i) arr.splice(i, 1); | ||
26035 | this.el.className = arr.join(' '); | ||
26036 | return this; | ||
26037 | }; | ||
26038 | |||
26039 | /** | ||
26040 | * Remove all classes matching `re`. | ||
26041 | * | ||
26042 | * @param {RegExp} re | ||
26043 | * @return {ClassList} | ||
26044 | * @api private | ||
26045 | */ | ||
26046 | |||
26047 | ClassList.prototype.removeMatching = function(re){ | ||
26048 | var arr = this.array(); | ||
26049 | for (var i = 0; i < arr.length; i++) { | ||
26050 | if (re.test(arr[i])) { | ||
26051 | this.remove(arr[i]); | ||
26052 | } | ||
26053 | } | ||
26054 | return this; | ||
26055 | }; | ||
26056 | |||
26057 | /** | ||
26058 | * Toggle class `name`, can force state via `force`. | ||
26059 | * | ||
26060 | * For browsers that support classList, but do not support `force` yet, | ||
26061 | * the mistake will be detected and corrected. | ||
26062 | * | ||
26063 | * @param {String} name | ||
26064 | * @param {Boolean} force | ||
26065 | * @return {ClassList} | ||
26066 | * @api public | ||
26067 | */ | ||
26068 | |||
26069 | ClassList.prototype.toggle = function(name, force){ | ||
26070 | // classList | ||
26071 | if (this.list) { | ||
26072 | if ("undefined" !== typeof force) { | ||
26073 | if (force !== this.list.toggle(name, force)) { | ||
26074 | this.list.toggle(name); // toggle again to correct | ||
26075 | } | ||
26076 | } else { | ||
26077 | this.list.toggle(name); | ||
26078 | } | ||
26079 | return this; | ||
26080 | } | ||
26081 | 27155 | ||
26082 | // fallback | 27156 | removeClass: function removeClass(elem, n) { |
26083 | if ("undefined" !== typeof force) { | 27157 | var elemClass = elem.className.trim(); |
26084 | if (!force) { | 27158 | var className = norm(elemClass); |
26085 | this.remove(name); | 27159 | var needle = n.trim(); |
26086 | } else { | 27160 | needle = SPACE + needle + SPACE; |
26087 | this.add(name); | 27161 | // 一个 cls 有可能多次出现:'link link2 link link3 link' |
27162 | while (className.indexOf(needle) >= 0) { | ||
27163 | className = className.replace(needle, SPACE); | ||
26088 | } | 27164 | } |
26089 | } else { | 27165 | elem.className = className.trim(); |
26090 | if (this.has(name)) { | ||
26091 | this.remove(name); | ||
26092 | } else { | ||
26093 | this.add(name); | ||
26094 | } | ||
26095 | } | ||
26096 | |||
26097 | return this; | ||
26098 | }; | ||
26099 | |||
26100 | /** | ||
26101 | * Return an array of classes. | ||
26102 | * | ||
26103 | * @return {Array} | ||
26104 | * @api public | ||
26105 | */ | ||
26106 | |||
26107 | ClassList.prototype.array = function(){ | ||
26108 | var className = this.el.getAttribute('class') || ''; | ||
26109 | var str = className.replace(/^\s+|\s+$/g, ''); | ||
26110 | var arr = str.split(re); | ||
26111 | if ('' === arr[0]) arr.shift(); | ||
26112 | return arr; | ||
26113 | }; | ||
26114 | |||
26115 | /** | ||
26116 | * Check if class `name` is present. | ||
26117 | * | ||
26118 | * @param {String} name | ||
26119 | * @return {ClassList} | ||
26120 | * @api public | ||
26121 | */ | ||
26122 | |||
26123 | ClassList.prototype.has = | ||
26124 | ClassList.prototype.contains = function(name){ | ||
26125 | return this.list | ||
26126 | ? this.list.contains(name) | ||
26127 | : !! ~index(this.array(), name); | ||
26128 | }; | ||
26129 | |||
26130 | |||
26131 | /***/ }, | ||
26132 | /* 199 */ | ||
26133 | /***/ function(module, exports) { | ||
26134 | |||
26135 | module.exports = function(arr, obj){ | ||
26136 | if (arr.indexOf) return arr.indexOf(obj); | ||
26137 | for (var i = 0; i < arr.length; ++i) { | ||
26138 | if (arr[i] === obj) return i; | ||
26139 | } | 27166 | } |
26140 | return -1; | ||
26141 | }; | 27167 | }; |
26142 | 27168 | ||
26143 | /***/ }, | 27169 | /***/ }, |
26144 | /* 200 */ | 27170 | /* 215 */ |
26145 | /***/ function(module, exports) { | 27171 | /***/ function(module, exports) { |
26146 | 27172 | ||
26147 | "use strict"; | 27173 | "use strict"; |
@@ -26159,6 +27185,7 @@ | |||
26159 | isLeaveSupported: function isLeaveSupported(props) { | 27185 | isLeaveSupported: function isLeaveSupported(props) { |
26160 | return props.transitionName && props.transitionLeave || props.animation.leave; | 27186 | return props.transitionName && props.transitionLeave || props.animation.leave; |
26161 | }, | 27187 | }, |
27188 | |||
26162 | allowAppearCallback: function allowAppearCallback(props) { | 27189 | allowAppearCallback: function allowAppearCallback(props) { |
26163 | return props.transitionAppear || props.animation.appear; | 27190 | return props.transitionAppear || props.animation.appear; |
26164 | }, | 27191 | }, |
@@ -26170,35 +27197,30 @@ | |||
26170 | } | 27197 | } |
26171 | }; | 27198 | }; |
26172 | exports["default"] = util; | 27199 | exports["default"] = util; |
26173 | module.exports = exports['default']; | 27200 | module.exports = exports["default"]; |
26174 | 27201 | ||
26175 | /***/ }, | 27202 | /***/ }, |
26176 | /* 201 */ | 27203 | /* 216 */ |
26177 | /***/ function(module, exports, __webpack_require__) { | 27204 | /***/ function(module, exports, __webpack_require__) { |
26178 | 27205 | ||
26179 | 'use strict'; | 27206 | 'use strict'; |
26180 | 27207 | ||
26181 | Object.defineProperty(exports, "__esModule", { | 27208 | Object.defineProperty(exports, '__esModule', { |
26182 | value: true | 27209 | value: true |
26183 | }); | 27210 | }); |
26184 | 27211 | ||
27212 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
27213 | |||
26185 | var _react = __webpack_require__(3); | 27214 | var _react = __webpack_require__(3); |
26186 | 27215 | ||
26187 | var _react2 = _interopRequireDefault(_react); | 27216 | var _react2 = _interopRequireDefault(_react); |
26188 | 27217 | ||
26189 | var _LazyRenderBox = __webpack_require__(202); | 27218 | var PopupInner = _react2['default'].createClass({ |
26190 | |||
26191 | var _LazyRenderBox2 = _interopRequireDefault(_LazyRenderBox); | ||
26192 | |||
26193 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
26194 | |||
26195 | var PopupInner = _react2["default"].createClass({ | ||
26196 | displayName: 'PopupInner', | 27219 | displayName: 'PopupInner', |
26197 | 27220 | ||
26198 | propTypes: { | 27221 | propTypes: { |
26199 | hiddenClassName: _react.PropTypes.string, | 27222 | hiddenClassName: _react.PropTypes.string, |
26200 | className: _react.PropTypes.string, | 27223 | className: _react.PropTypes.string, |
26201 | prefixCls: _react.PropTypes.string, | ||
26202 | onMouseEnter: _react.PropTypes.func, | 27224 | onMouseEnter: _react.PropTypes.func, |
26203 | onMouseLeave: _react.PropTypes.func, | 27225 | onMouseLeave: _react.PropTypes.func, |
26204 | children: _react.PropTypes.any | 27226 | children: _react.PropTypes.any |
@@ -26209,95 +27231,45 @@ | |||
26209 | if (!props.visible) { | 27231 | if (!props.visible) { |
26210 | className += ' ' + props.hiddenClassName; | 27232 | className += ' ' + props.hiddenClassName; |
26211 | } | 27233 | } |
26212 | return _react2["default"].createElement( | 27234 | return _react2['default'].createElement( |
26213 | 'div', | 27235 | 'div', |
26214 | { | 27236 | { className: className, |
26215 | className: className, | ||
26216 | onMouseEnter: props.onMouseEnter, | 27237 | onMouseEnter: props.onMouseEnter, |
26217 | onMouseLeave: props.onMouseLeave, | 27238 | onMouseLeave: props.onMouseLeave, |
26218 | style: props.style | 27239 | style: props.style }, |
26219 | }, | 27240 | props.children |
26220 | _react2["default"].createElement( | ||
26221 | _LazyRenderBox2["default"], | ||
26222 | { className: props.prefixCls + '-content', visible: props.visible }, | ||
26223 | props.children | ||
26224 | ) | ||
26225 | ); | 27241 | ); |
26226 | } | 27242 | } |
26227 | }); | 27243 | }); |
26228 | 27244 | ||
26229 | exports["default"] = PopupInner; | 27245 | exports['default'] = PopupInner; |
26230 | module.exports = exports['default']; | 27246 | module.exports = exports['default']; |
26231 | 27247 | ||
26232 | /***/ }, | 27248 | /***/ }, |
26233 | /* 202 */ | 27249 | /* 217 */ |
26234 | /***/ function(module, exports, __webpack_require__) { | 27250 | /***/ function(module, exports, __webpack_require__) { |
26235 | 27251 | ||
26236 | 'use strict'; | 27252 | 'use strict'; |
26237 | 27253 | ||
26238 | Object.defineProperty(exports, "__esModule", { | 27254 | Object.defineProperty(exports, '__esModule', { |
26239 | value: true | 27255 | value: true |
26240 | }); | 27256 | }); |
27257 | exports.getAlignFromPlacement = getAlignFromPlacement; | ||
27258 | exports.getPopupClassNameFromAlign = getPopupClassNameFromAlign; | ||
26241 | 27259 | ||
26242 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | 27260 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } |
26243 | |||
26244 | var _react = __webpack_require__(3); | ||
26245 | |||
26246 | var _react2 = _interopRequireDefault(_react); | ||
26247 | |||
26248 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
26249 | |||
26250 | var LazyRenderBox = _react2["default"].createClass({ | ||
26251 | displayName: 'LazyRenderBox', | ||
26252 | |||
26253 | propTypes: { | ||
26254 | children: _react.PropTypes.any, | ||
26255 | className: _react.PropTypes.string, | ||
26256 | visible: _react.PropTypes.bool, | ||
26257 | hiddenClassName: _react.PropTypes.string | ||
26258 | }, | ||
26259 | shouldComponentUpdate: function shouldComponentUpdate(nextProps) { | ||
26260 | return nextProps.hiddenClassName || nextProps.visible; | ||
26261 | }, | ||
26262 | render: function render() { | ||
26263 | if (this.props.hiddenClassName) { | ||
26264 | var className = this.props.className; | ||
26265 | if (!this.props.visible) { | ||
26266 | className += ' ' + this.props.hiddenClassName; | ||
26267 | } | ||
26268 | return _react2["default"].createElement('div', _extends({}, this.props, { className: className })); | ||
26269 | } | ||
26270 | if (_react2["default"].Children.count(this.props.children) > 1) { | ||
26271 | return _react2["default"].createElement('div', this.props); | ||
26272 | } | ||
26273 | return _react2["default"].Children.only(this.props.children); | ||
26274 | } | ||
26275 | }); | ||
26276 | |||
26277 | exports["default"] = LazyRenderBox; | ||
26278 | module.exports = exports['default']; | ||
26279 | |||
26280 | /***/ }, | ||
26281 | /* 203 */ | ||
26282 | /***/ function(module, exports) { | ||
26283 | |||
26284 | 'use strict'; | ||
26285 | 27261 | ||
26286 | Object.defineProperty(exports, "__esModule", { | 27262 | var _objectAssign = __webpack_require__(192); |
26287 | value: true | ||
26288 | }); | ||
26289 | 27263 | ||
26290 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | 27264 | var _objectAssign2 = _interopRequireDefault(_objectAssign); |
26291 | 27265 | ||
26292 | exports.getAlignFromPlacement = getAlignFromPlacement; | ||
26293 | exports.getPopupClassNameFromAlign = getPopupClassNameFromAlign; | ||
26294 | function isPointsEq(a1, a2) { | 27266 | function isPointsEq(a1, a2) { |
26295 | return a1[0] === a2[0] && a1[1] === a2[1]; | 27267 | return a1[0] === a2[0] && a1[1] === a2[1]; |
26296 | } | 27268 | } |
26297 | 27269 | ||
26298 | function getAlignFromPlacement(builtinPlacements, placementStr, align) { | 27270 | function getAlignFromPlacement(builtinPlacements, placementStr, align) { |
26299 | var baseAlign = builtinPlacements[placementStr] || {}; | 27271 | var baseAlign = builtinPlacements[placementStr] || {}; |
26300 | return _extends({}, baseAlign, align); | 27272 | return (0, _objectAssign2['default'])({}, baseAlign, align); |
26301 | } | 27273 | } |
26302 | 27274 | ||
26303 | function getPopupClassNameFromAlign(builtinPlacements, prefixCls, align) { | 27275 | function getPopupClassNameFromAlign(builtinPlacements, prefixCls, align) { |
@@ -26313,7 +27285,7 @@ | |||
26313 | } | 27285 | } |
26314 | 27286 | ||
26315 | /***/ }, | 27287 | /***/ }, |
26316 | /* 204 */ | 27288 | /* 218 */ |
26317 | /***/ function(module, exports, __webpack_require__) { | 27289 | /***/ function(module, exports, __webpack_require__) { |
26318 | 27290 | ||
26319 | 'use strict'; | 27291 | 'use strict'; |
@@ -26328,15 +27300,15 @@ | |||
26328 | 27300 | ||
26329 | var _react2 = _interopRequireDefault(_react); | 27301 | var _react2 = _interopRequireDefault(_react); |
26330 | 27302 | ||
26331 | var _mixinCommonMixin = __webpack_require__(205); | 27303 | var _mixinCommonMixin = __webpack_require__(219); |
26332 | 27304 | ||
26333 | var _mixinCommonMixin2 = _interopRequireDefault(_mixinCommonMixin); | 27305 | var _mixinCommonMixin2 = _interopRequireDefault(_mixinCommonMixin); |
26334 | 27306 | ||
26335 | var _Header = __webpack_require__(207); | 27307 | var _Header = __webpack_require__(221); |
26336 | 27308 | ||
26337 | var _Header2 = _interopRequireDefault(_Header); | 27309 | var _Header2 = _interopRequireDefault(_Header); |
26338 | 27310 | ||
26339 | var _Combobox = __webpack_require__(209); | 27311 | var _Combobox = __webpack_require__(223); |
26340 | 27312 | ||
26341 | var _Combobox2 = _interopRequireDefault(_Combobox); | 27313 | var _Combobox2 = _interopRequireDefault(_Combobox); |
26342 | 27314 | ||
@@ -26378,6 +27350,7 @@ | |||
26378 | 27350 | ||
26379 | getDefaultProps: function getDefaultProps() { | 27351 | getDefaultProps: function getDefaultProps() { |
26380 | return { | 27352 | return { |
27353 | prefixCls: 'rc-time-picker-panel', | ||
26381 | onChange: noop, | 27354 | onChange: noop, |
26382 | onClear: noop | 27355 | onClear: noop |
26383 | }; | 27356 | }; |
@@ -26481,7 +27454,7 @@ | |||
26481 | module.exports = exports['default']; | 27454 | module.exports = exports['default']; |
26482 | 27455 | ||
26483 | /***/ }, | 27456 | /***/ }, |
26484 | /* 205 */ | 27457 | /* 219 */ |
26485 | /***/ function(module, exports, __webpack_require__) { | 27458 | /***/ function(module, exports, __webpack_require__) { |
26486 | 27459 | ||
26487 | 'use strict'; | 27460 | 'use strict'; |
@@ -26494,7 +27467,7 @@ | |||
26494 | 27467 | ||
26495 | var _react = __webpack_require__(3); | 27468 | var _react = __webpack_require__(3); |
26496 | 27469 | ||
26497 | var _localeEn_US = __webpack_require__(206); | 27470 | var _localeEn_US = __webpack_require__(220); |
26498 | 27471 | ||
26499 | var _localeEn_US2 = _interopRequireDefault(_localeEn_US); | 27472 | var _localeEn_US2 = _interopRequireDefault(_localeEn_US); |
26500 | 27473 | ||
@@ -26506,7 +27479,6 @@ | |||
26506 | 27479 | ||
26507 | getDefaultProps: function getDefaultProps() { | 27480 | getDefaultProps: function getDefaultProps() { |
26508 | return { | 27481 | return { |
26509 | prefixCls: 'rc-time-picker', | ||
26510 | locale: _localeEn_US2['default'] | 27482 | locale: _localeEn_US2['default'] |
26511 | }; | 27483 | }; |
26512 | } | 27484 | } |
@@ -26514,7 +27486,7 @@ | |||
26514 | module.exports = exports['default']; | 27486 | module.exports = exports['default']; |
26515 | 27487 | ||
26516 | /***/ }, | 27488 | /***/ }, |
26517 | /* 206 */ | 27489 | /* 220 */ |
26518 | /***/ function(module, exports, __webpack_require__) { | 27490 | /***/ function(module, exports, __webpack_require__) { |
26519 | 27491 | ||
26520 | 'use strict'; | 27492 | 'use strict'; |
@@ -26541,7 +27513,7 @@ | |||
26541 | module.exports = exports['default']; | 27513 | module.exports = exports['default']; |
26542 | 27514 | ||
26543 | /***/ }, | 27515 | /***/ }, |
26544 | /* 207 */ | 27516 | /* 221 */ |
26545 | /***/ function(module, exports, __webpack_require__) { | 27517 | /***/ function(module, exports, __webpack_require__) { |
26546 | 27518 | ||
26547 | 'use strict'; | 27519 | 'use strict'; |
@@ -26556,7 +27528,7 @@ | |||
26556 | 27528 | ||
26557 | var _react2 = _interopRequireDefault(_react); | 27529 | var _react2 = _interopRequireDefault(_react); |
26558 | 27530 | ||
26559 | var _utilSelection = __webpack_require__(208); | 27531 | var _utilSelection = __webpack_require__(222); |
26560 | 27532 | ||
26561 | var _utilSelection2 = _interopRequireDefault(_utilSelection); | 27533 | var _utilSelection2 = _interopRequireDefault(_utilSelection); |
26562 | 27534 | ||
@@ -26738,7 +27710,7 @@ | |||
26738 | }, | 27710 | }, |
26739 | 27711 | ||
26740 | selectRange: function selectRange() { | 27712 | selectRange: function selectRange() { |
26741 | this.refs.input.select(); | 27713 | this.refs.input.focus(); |
26742 | if (this.props.currentSelectPanel && this.refs.input.value) { | 27714 | if (this.props.currentSelectPanel && this.refs.input.value) { |
26743 | var selectionRangeStart = 0; | 27715 | var selectionRangeStart = 0; |
26744 | var selectionRangeEnd = 0; | 27716 | var selectionRangeEnd = 0; |
@@ -26774,7 +27746,7 @@ | |||
26774 | module.exports = exports['default']; | 27746 | module.exports = exports['default']; |
26775 | 27747 | ||
26776 | /***/ }, | 27748 | /***/ }, |
26777 | /* 208 */ | 27749 | /* 222 */ |
26778 | /***/ function(module, exports) { | 27750 | /***/ function(module, exports) { |
26779 | 27751 | ||
26780 | 'use strict'; | 27752 | 'use strict'; |
@@ -26805,7 +27777,7 @@ | |||
26805 | module.exports = exports['default']; | 27777 | module.exports = exports['default']; |
26806 | 27778 | ||
26807 | /***/ }, | 27779 | /***/ }, |
26808 | /* 209 */ | 27780 | /* 223 */ |
26809 | /***/ function(module, exports, __webpack_require__) { | 27781 | /***/ function(module, exports, __webpack_require__) { |
26810 | 27782 | ||
26811 | 'use strict'; | 27783 | 'use strict'; |
@@ -26820,7 +27792,7 @@ | |||
26820 | 27792 | ||
26821 | var _react2 = _interopRequireDefault(_react); | 27793 | var _react2 = _interopRequireDefault(_react); |
26822 | 27794 | ||
26823 | var _Select = __webpack_require__(210); | 27795 | var _Select = __webpack_require__(224); |
26824 | 27796 | ||
26825 | var _Select2 = _interopRequireDefault(_Select); | 27797 | var _Select2 = _interopRequireDefault(_Select); |
26826 | 27798 | ||
@@ -26986,7 +27958,7 @@ | |||
26986 | module.exports = exports['default']; | 27958 | module.exports = exports['default']; |
26987 | 27959 | ||
26988 | /***/ }, | 27960 | /***/ }, |
26989 | /* 210 */ | 27961 | /* 224 */ |
26990 | /***/ function(module, exports, __webpack_require__) { | 27962 | /***/ function(module, exports, __webpack_require__) { |
26991 | 27963 | ||
26992 | 'use strict'; | 27964 | 'use strict'; |
@@ -27007,7 +27979,7 @@ | |||
27007 | 27979 | ||
27008 | var _reactDom2 = _interopRequireDefault(_reactDom); | 27980 | var _reactDom2 = _interopRequireDefault(_reactDom); |
27009 | 27981 | ||
27010 | var _classnames2 = __webpack_require__(211); | 27982 | var _classnames2 = __webpack_require__(177); |
27011 | 27983 | ||
27012 | var _classnames3 = _interopRequireDefault(_classnames2); | 27984 | var _classnames3 = _interopRequireDefault(_classnames2); |
27013 | 27985 | ||
@@ -27124,61 +28096,7 @@ | |||
27124 | module.exports = exports['default']; | 28096 | module.exports = exports['default']; |
27125 | 28097 | ||
27126 | /***/ }, | 28098 | /***/ }, |
27127 | /* 211 */ | 28099 | /* 225 */ |
27128 | /***/ function(module, exports, __webpack_require__) { | ||
27129 | |||
27130 | var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! | ||
27131 | Copyright (c) 2016 Jed Watson. | ||
27132 | Licensed under the MIT License (MIT), see | ||
27133 | http://jedwatson.github.io/classnames | ||
27134 | */ | ||
27135 | /* global define */ | ||
27136 | |||
27137 | (function () { | ||
27138 | 'use strict'; | ||
27139 | |||
27140 | var hasOwn = {}.hasOwnProperty; | ||
27141 | |||
27142 | function classNames () { | ||
27143 | var classes = []; | ||
27144 | |||
27145 | for (var i = 0; i < arguments.length; i++) { | ||
27146 | var arg = arguments[i]; | ||
27147 | if (!arg) continue; | ||
27148 | |||
27149 | var argType = typeof arg; | ||
27150 | |||
27151 | if (argType === 'string' || argType === 'number') { | ||
27152 | classes.push(arg); | ||
27153 | } else if (Array.isArray(arg)) { | ||
27154 | classes.push(classNames.apply(null, arg)); | ||
27155 | } else if (argType === 'object') { | ||
27156 | for (var key in arg) { | ||
27157 | if (hasOwn.call(arg, key) && arg[key]) { | ||
27158 | classes.push(key); | ||
27159 | } | ||
27160 | } | ||
27161 | } | ||
27162 | } | ||
27163 | |||
27164 | return classes.join(' '); | ||
27165 | } | ||
27166 | |||
27167 | if (typeof module !== 'undefined' && module.exports) { | ||
27168 | module.exports = classNames; | ||
27169 | } else if (true) { | ||
27170 | // register as 'classnames', consistent with npm package name | ||
27171 | !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function () { | ||
27172 | return classNames; | ||
27173 | }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); | ||
27174 | } else { | ||
27175 | window.classNames = classNames; | ||
27176 | } | ||
27177 | }()); | ||
27178 | |||
27179 | |||
27180 | /***/ }, | ||
27181 | /* 212 */ | ||
27182 | /***/ function(module, exports) { | 28100 | /***/ function(module, exports) { |
27183 | 28101 | ||
27184 | 'use strict'; | 28102 | 'use strict'; |
@@ -27224,7 +28142,7 @@ | |||
27224 | module.exports = exports['default']; | 28142 | module.exports = exports['default']; |
27225 | 28143 | ||
27226 | /***/ }, | 28144 | /***/ }, |
27227 | /* 213 */ | 28145 | /* 226 */ |
27228 | /***/ function(module, exports, __webpack_require__) { | 28146 | /***/ function(module, exports, __webpack_require__) { |
27229 | 28147 | ||
27230 | 'use strict'; | 28148 | 'use strict'; |
@@ -27248,7 +28166,7 @@ | |||
27248 | } | 28166 | } |
27249 | 28167 | ||
27250 | /***/ }, | 28168 | /***/ }, |
27251 | /* 214 */ | 28169 | /* 227 */ |
27252 | /***/ function(module, exports, __webpack_require__) { | 28170 | /***/ function(module, exports, __webpack_require__) { |
27253 | 28171 | ||
27254 | 'use strict'; | 28172 | 'use strict'; |
@@ -27259,11 +28177,11 @@ | |||
27259 | 28177 | ||
27260 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | 28178 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } |
27261 | 28179 | ||
27262 | var _gregorianCalendarFormatLibLocaleZh_CN = __webpack_require__(215); | 28180 | var _gregorianCalendarFormatLibLocaleZh_CN = __webpack_require__(228); |
27263 | 28181 | ||
27264 | var _gregorianCalendarFormatLibLocaleZh_CN2 = _interopRequireDefault(_gregorianCalendarFormatLibLocaleZh_CN); | 28182 | var _gregorianCalendarFormatLibLocaleZh_CN2 = _interopRequireDefault(_gregorianCalendarFormatLibLocaleZh_CN); |
27265 | 28183 | ||
27266 | var _gregorianCalendarLibLocaleZh_CN = __webpack_require__(216); | 28184 | var _gregorianCalendarLibLocaleZh_CN = __webpack_require__(229); |
27267 | 28185 | ||
27268 | var _gregorianCalendarLibLocaleZh_CN2 = _interopRequireDefault(_gregorianCalendarLibLocaleZh_CN); | 28186 | var _gregorianCalendarLibLocaleZh_CN2 = _interopRequireDefault(_gregorianCalendarLibLocaleZh_CN); |
27269 | 28187 | ||
@@ -27275,7 +28193,7 @@ | |||
27275 | module.exports = exports['default']; | 28193 | module.exports = exports['default']; |
27276 | 28194 | ||
27277 | /***/ }, | 28195 | /***/ }, |
27278 | /* 215 */ | 28196 | /* 228 */ |
27279 | /***/ function(module, exports) { | 28197 | /***/ function(module, exports) { |
27280 | 28198 | ||
27281 | 'use strict'; | 28199 | 'use strict'; |
@@ -27294,7 +28212,7 @@ | |||
27294 | }; | 28212 | }; |
27295 | 28213 | ||
27296 | /***/ }, | 28214 | /***/ }, |
27297 | /* 216 */ | 28215 | /* 229 */ |
27298 | /***/ function(module, exports) { | 28216 | /***/ function(module, exports) { |
27299 | 28217 | ||
27300 | /* | 28218 | /* |