You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

11682 lines
384 KiB

  1. (function webpackUniversalModuleDefinition(root, factory) {
  2. if(typeof exports === 'object' && typeof module === 'object')
  3. module.exports = factory(require("react"), require("react-dom"));
  4. else if(typeof define === 'function' && define.amd)
  5. define(["react", "react-dom"], factory);
  6. else if(typeof exports === 'object')
  7. exports["rc-slider"] = factory(require("react"), require("react-dom"));
  8. else
  9. root["rc-slider"] = factory(root["React"], root["ReactDOM"]);
  10. })(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_0__, __WEBPACK_EXTERNAL_MODULE_14__) {
  11. return /******/ (function(modules) { // webpackBootstrap
  12. /******/ // The module cache
  13. /******/ var installedModules = {};
  14. /******/
  15. /******/ // The require function
  16. /******/ function __webpack_require__(moduleId) {
  17. /******/
  18. /******/ // Check if module is in cache
  19. /******/ if(installedModules[moduleId]) {
  20. /******/ return installedModules[moduleId].exports;
  21. /******/ }
  22. /******/ // Create a new module (and put it into the cache)
  23. /******/ var module = installedModules[moduleId] = {
  24. /******/ i: moduleId,
  25. /******/ l: false,
  26. /******/ exports: {}
  27. /******/ };
  28. /******/
  29. /******/ // Execute the module function
  30. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  31. /******/
  32. /******/ // Flag the module as loaded
  33. /******/ module.l = true;
  34. /******/
  35. /******/ // Return the exports of the module
  36. /******/ return module.exports;
  37. /******/ }
  38. /******/
  39. /******/
  40. /******/ // expose the modules object (__webpack_modules__)
  41. /******/ __webpack_require__.m = modules;
  42. /******/
  43. /******/ // expose the module cache
  44. /******/ __webpack_require__.c = installedModules;
  45. /******/
  46. /******/ // define getter function for harmony exports
  47. /******/ __webpack_require__.d = function(exports, name, getter) {
  48. /******/ if(!__webpack_require__.o(exports, name)) {
  49. /******/ Object.defineProperty(exports, name, {
  50. /******/ configurable: false,
  51. /******/ enumerable: true,
  52. /******/ get: getter
  53. /******/ });
  54. /******/ }
  55. /******/ };
  56. /******/
  57. /******/ // getDefaultExport function for compatibility with non-harmony modules
  58. /******/ __webpack_require__.n = function(module) {
  59. /******/ var getter = module && module.__esModule ?
  60. /******/ function getDefault() { return module['default']; } :
  61. /******/ function getModuleExports() { return module; };
  62. /******/ __webpack_require__.d(getter, 'a', getter);
  63. /******/ return getter;
  64. /******/ };
  65. /******/
  66. /******/ // Object.prototype.hasOwnProperty.call
  67. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  68. /******/
  69. /******/ // __webpack_public_path__
  70. /******/ __webpack_require__.p = "";
  71. /******/
  72. /******/ // Load entry module and return exports
  73. /******/ return __webpack_require__(__webpack_require__.s = 74);
  74. /******/ })
  75. /************************************************************************/
  76. /******/ ([
  77. /* 0 */
  78. /***/ (function(module, exports) {
  79. module.exports = __WEBPACK_EXTERNAL_MODULE_0__;
  80. /***/ }),
  81. /* 1 */
  82. /***/ (function(module, exports, __webpack_require__) {
  83. /* WEBPACK VAR INJECTION */(function(process) {/**
  84. * Copyright (c) 2013-present, Facebook, Inc.
  85. *
  86. * This source code is licensed under the MIT license found in the
  87. * LICENSE file in the root directory of this source tree.
  88. */
  89. if (process.env.NODE_ENV !== 'production') {
  90. var ReactIs = __webpack_require__(62);
  91. // By explicitly using `prop-types` you are opting into new development behavior.
  92. // http://fb.me/prop-types-in-prod
  93. var throwOnDirectAccess = true;
  94. module.exports = __webpack_require__(116)(ReactIs.isElement, throwOnDirectAccess);
  95. } else {
  96. // By explicitly using `prop-types` you are opting into new production behavior.
  97. // http://fb.me/prop-types-in-prod
  98. module.exports = __webpack_require__(118)();
  99. }
  100. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(21)))
  101. /***/ }),
  102. /* 2 */
  103. /***/ (function(module, exports, __webpack_require__) {
  104. "use strict";
  105. exports.__esModule = true;
  106. exports.default = function (instance, Constructor) {
  107. if (!(instance instanceof Constructor)) {
  108. throw new TypeError("Cannot call a class as a function");
  109. }
  110. };
  111. /***/ }),
  112. /* 3 */
  113. /***/ (function(module, exports, __webpack_require__) {
  114. "use strict";
  115. exports.__esModule = true;
  116. var _typeof2 = __webpack_require__(41);
  117. var _typeof3 = _interopRequireDefault(_typeof2);
  118. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  119. exports.default = function (self, call) {
  120. if (!self) {
  121. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  122. }
  123. return call && ((typeof call === "undefined" ? "undefined" : (0, _typeof3.default)(call)) === "object" || typeof call === "function") ? call : self;
  124. };
  125. /***/ }),
  126. /* 4 */
  127. /***/ (function(module, exports, __webpack_require__) {
  128. "use strict";
  129. exports.__esModule = true;
  130. var _setPrototypeOf = __webpack_require__(107);
  131. var _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf);
  132. var _create = __webpack_require__(111);
  133. var _create2 = _interopRequireDefault(_create);
  134. var _typeof2 = __webpack_require__(41);
  135. var _typeof3 = _interopRequireDefault(_typeof2);
  136. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  137. exports.default = function (subClass, superClass) {
  138. if (typeof superClass !== "function" && superClass !== null) {
  139. throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : (0, _typeof3.default)(superClass)));
  140. }
  141. subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, {
  142. constructor: {
  143. value: subClass,
  144. enumerable: false,
  145. writable: true,
  146. configurable: true
  147. }
  148. });
  149. if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass;
  150. };
  151. /***/ }),
  152. /* 5 */
  153. /***/ (function(module, exports, __webpack_require__) {
  154. "use strict";
  155. exports.__esModule = true;
  156. var _assign = __webpack_require__(78);
  157. var _assign2 = _interopRequireDefault(_assign);
  158. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  159. exports.default = _assign2.default || function (target) {
  160. for (var i = 1; i < arguments.length; i++) {
  161. var source = arguments[i];
  162. for (var key in source) {
  163. if (Object.prototype.hasOwnProperty.call(source, key)) {
  164. target[key] = source[key];
  165. }
  166. }
  167. }
  168. return target;
  169. };
  170. /***/ }),
  171. /* 6 */
  172. /***/ (function(module, exports) {
  173. var core = module.exports = { version: '2.6.9' };
  174. if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
  175. /***/ }),
  176. /* 7 */
  177. /***/ (function(module, exports, __webpack_require__) {
  178. var store = __webpack_require__(38)('wks');
  179. var uid = __webpack_require__(29);
  180. var Symbol = __webpack_require__(9).Symbol;
  181. var USE_SYMBOL = typeof Symbol == 'function';
  182. var $exports = module.exports = function (name) {
  183. return store[name] || (store[name] =
  184. USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
  185. };
  186. $exports.store = store;
  187. /***/ }),
  188. /* 8 */
  189. /***/ (function(module, exports, __webpack_require__) {
  190. var global = __webpack_require__(9);
  191. var core = __webpack_require__(6);
  192. var ctx = __webpack_require__(32);
  193. var hide = __webpack_require__(17);
  194. var has = __webpack_require__(15);
  195. var PROTOTYPE = 'prototype';
  196. var $export = function (type, name, source) {
  197. var IS_FORCED = type & $export.F;
  198. var IS_GLOBAL = type & $export.G;
  199. var IS_STATIC = type & $export.S;
  200. var IS_PROTO = type & $export.P;
  201. var IS_BIND = type & $export.B;
  202. var IS_WRAP = type & $export.W;
  203. var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
  204. var expProto = exports[PROTOTYPE];
  205. var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];
  206. var key, own, out;
  207. if (IS_GLOBAL) source = name;
  208. for (key in source) {
  209. // contains in native
  210. own = !IS_FORCED && target && target[key] !== undefined;
  211. if (own && has(exports, key)) continue;
  212. // export native or passed
  213. out = own ? target[key] : source[key];
  214. // prevent global pollution for namespaces
  215. exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
  216. // bind timers to global for call from export context
  217. : IS_BIND && own ? ctx(out, global)
  218. // wrap global constructors for prevent change them in library
  219. : IS_WRAP && target[key] == out ? (function (C) {
  220. var F = function (a, b, c) {
  221. if (this instanceof C) {
  222. switch (arguments.length) {
  223. case 0: return new C();
  224. case 1: return new C(a);
  225. case 2: return new C(a, b);
  226. } return new C(a, b, c);
  227. } return C.apply(this, arguments);
  228. };
  229. F[PROTOTYPE] = C[PROTOTYPE];
  230. return F;
  231. // make static versions for prototype methods
  232. })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
  233. // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%
  234. if (IS_PROTO) {
  235. (exports.virtual || (exports.virtual = {}))[key] = out;
  236. // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%
  237. if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);
  238. }
  239. }
  240. };
  241. // type bitmap
  242. $export.F = 1; // forced
  243. $export.G = 2; // global
  244. $export.S = 4; // static
  245. $export.P = 8; // proto
  246. $export.B = 16; // bind
  247. $export.W = 32; // wrap
  248. $export.U = 64; // safe
  249. $export.R = 128; // real proto method for `library`
  250. module.exports = $export;
  251. /***/ }),
  252. /* 9 */
  253. /***/ (function(module, exports) {
  254. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  255. var global = module.exports = typeof window != 'undefined' && window.Math == Math
  256. ? window : typeof self != 'undefined' && self.Math == Math ? self
  257. // eslint-disable-next-line no-new-func
  258. : Function('return this')();
  259. if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
  260. /***/ }),
  261. /* 10 */
  262. /***/ (function(module, exports, __webpack_require__) {
  263. var anObject = __webpack_require__(18);
  264. var IE8_DOM_DEFINE = __webpack_require__(51);
  265. var toPrimitive = __webpack_require__(33);
  266. var dP = Object.defineProperty;
  267. exports.f = __webpack_require__(11) ? Object.defineProperty : function defineProperty(O, P, Attributes) {
  268. anObject(O);
  269. P = toPrimitive(P, true);
  270. anObject(Attributes);
  271. if (IE8_DOM_DEFINE) try {
  272. return dP(O, P, Attributes);
  273. } catch (e) { /* empty */ }
  274. if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
  275. if ('value' in Attributes) O[P] = Attributes.value;
  276. return O;
  277. };
  278. /***/ }),
  279. /* 11 */
  280. /***/ (function(module, exports, __webpack_require__) {
  281. // Thank's IE8 for his funny defineProperty
  282. module.exports = !__webpack_require__(20)(function () {
  283. return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
  284. });
  285. /***/ }),
  286. /* 12 */
  287. /***/ (function(module, exports, __webpack_require__) {
  288. "use strict";
  289. exports.__esModule = true;
  290. var _defineProperty = __webpack_require__(56);
  291. var _defineProperty2 = _interopRequireDefault(_defineProperty);
  292. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  293. exports.default = function () {
  294. function defineProperties(target, props) {
  295. for (var i = 0; i < props.length; i++) {
  296. var descriptor = props[i];
  297. descriptor.enumerable = descriptor.enumerable || false;
  298. descriptor.configurable = true;
  299. if ("value" in descriptor) descriptor.writable = true;
  300. (0, _defineProperty2.default)(target, descriptor.key, descriptor);
  301. }
  302. }
  303. return function (Constructor, protoProps, staticProps) {
  304. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  305. if (staticProps) defineProperties(Constructor, staticProps);
  306. return Constructor;
  307. };
  308. }();
  309. /***/ }),
  310. /* 13 */
  311. /***/ (function(module, exports, __webpack_require__) {
  312. "use strict";
  313. exports.__esModule = true;
  314. var _defineProperty = __webpack_require__(56);
  315. var _defineProperty2 = _interopRequireDefault(_defineProperty);
  316. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  317. exports.default = function (obj, key, value) {
  318. if (key in obj) {
  319. (0, _defineProperty2.default)(obj, key, {
  320. value: value,
  321. enumerable: true,
  322. configurable: true,
  323. writable: true
  324. });
  325. } else {
  326. obj[key] = value;
  327. }
  328. return obj;
  329. };
  330. /***/ }),
  331. /* 14 */
  332. /***/ (function(module, exports) {
  333. module.exports = __WEBPACK_EXTERNAL_MODULE_14__;
  334. /***/ }),
  335. /* 15 */
  336. /***/ (function(module, exports) {
  337. var hasOwnProperty = {}.hasOwnProperty;
  338. module.exports = function (it, key) {
  339. return hasOwnProperty.call(it, key);
  340. };
  341. /***/ }),
  342. /* 16 */
  343. /***/ (function(module, exports, __webpack_require__) {
  344. // to indexed object, toObject with fallback for non-array-like ES3 strings
  345. var IObject = __webpack_require__(54);
  346. var defined = __webpack_require__(35);
  347. module.exports = function (it) {
  348. return IObject(defined(it));
  349. };
  350. /***/ }),
  351. /* 17 */
  352. /***/ (function(module, exports, __webpack_require__) {
  353. var dP = __webpack_require__(10);
  354. var createDesc = __webpack_require__(23);
  355. module.exports = __webpack_require__(11) ? function (object, key, value) {
  356. return dP.f(object, key, createDesc(1, value));
  357. } : function (object, key, value) {
  358. object[key] = value;
  359. return object;
  360. };
  361. /***/ }),
  362. /* 18 */
  363. /***/ (function(module, exports, __webpack_require__) {
  364. var isObject = __webpack_require__(19);
  365. module.exports = function (it) {
  366. if (!isObject(it)) throw TypeError(it + ' is not an object!');
  367. return it;
  368. };
  369. /***/ }),
  370. /* 19 */
  371. /***/ (function(module, exports) {
  372. module.exports = function (it) {
  373. return typeof it === 'object' ? it !== null : typeof it === 'function';
  374. };
  375. /***/ }),
  376. /* 20 */
  377. /***/ (function(module, exports) {
  378. module.exports = function (exec) {
  379. try {
  380. return !!exec();
  381. } catch (e) {
  382. return true;
  383. }
  384. };
  385. /***/ }),
  386. /* 21 */
  387. /***/ (function(module, exports) {
  388. // shim for using process in browser
  389. var process = module.exports = {};
  390. // cached from whatever global is present so that test runners that stub it
  391. // don't break things. But we need to wrap it in a try catch in case it is
  392. // wrapped in strict mode code which doesn't define any globals. It's inside a
  393. // function because try/catches deoptimize in certain engines.
  394. var cachedSetTimeout;
  395. var cachedClearTimeout;
  396. function defaultSetTimout() {
  397. throw new Error('setTimeout has not been defined');
  398. }
  399. function defaultClearTimeout () {
  400. throw new Error('clearTimeout has not been defined');
  401. }
  402. (function () {
  403. try {
  404. if (typeof setTimeout === 'function') {
  405. cachedSetTimeout = setTimeout;
  406. } else {
  407. cachedSetTimeout = defaultSetTimout;
  408. }
  409. } catch (e) {
  410. cachedSetTimeout = defaultSetTimout;
  411. }
  412. try {
  413. if (typeof clearTimeout === 'function') {
  414. cachedClearTimeout = clearTimeout;
  415. } else {
  416. cachedClearTimeout = defaultClearTimeout;
  417. }
  418. } catch (e) {
  419. cachedClearTimeout = defaultClearTimeout;
  420. }
  421. } ())
  422. function runTimeout(fun) {
  423. if (cachedSetTimeout === setTimeout) {
  424. //normal enviroments in sane situations
  425. return setTimeout(fun, 0);
  426. }
  427. // if setTimeout wasn't available but was latter defined
  428. if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  429. cachedSetTimeout = setTimeout;
  430. return setTimeout(fun, 0);
  431. }
  432. try {
  433. // when when somebody has screwed with setTimeout but no I.E. maddness
  434. return cachedSetTimeout(fun, 0);
  435. } catch(e){
  436. try {
  437. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  438. return cachedSetTimeout.call(null, fun, 0);
  439. } catch(e){
  440. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
  441. return cachedSetTimeout.call(this, fun, 0);
  442. }
  443. }
  444. }
  445. function runClearTimeout(marker) {
  446. if (cachedClearTimeout === clearTimeout) {
  447. //normal enviroments in sane situations
  448. return clearTimeout(marker);
  449. }
  450. // if clearTimeout wasn't available but was latter defined
  451. if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
  452. cachedClearTimeout = clearTimeout;
  453. return clearTimeout(marker);
  454. }
  455. try {
  456. // when when somebody has screwed with setTimeout but no I.E. maddness
  457. return cachedClearTimeout(marker);
  458. } catch (e){
  459. try {
  460. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  461. return cachedClearTimeout.call(null, marker);
  462. } catch (e){
  463. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
  464. // Some versions of I.E. have different rules for clearTimeout vs setTimeout
  465. return cachedClearTimeout.call(this, marker);
  466. }
  467. }
  468. }
  469. var queue = [];
  470. var draining = false;
  471. var currentQueue;
  472. var queueIndex = -1;
  473. function cleanUpNextTick() {
  474. if (!draining || !currentQueue) {
  475. return;
  476. }
  477. draining = false;
  478. if (currentQueue.length) {
  479. queue = currentQueue.concat(queue);
  480. } else {
  481. queueIndex = -1;
  482. }
  483. if (queue.length) {
  484. drainQueue();
  485. }
  486. }
  487. function drainQueue() {
  488. if (draining) {
  489. return;
  490. }
  491. var timeout = runTimeout(cleanUpNextTick);
  492. draining = true;
  493. var len = queue.length;
  494. while(len) {
  495. currentQueue = queue;
  496. queue = [];
  497. while (++queueIndex < len) {
  498. if (currentQueue) {
  499. currentQueue[queueIndex].run();
  500. }
  501. }
  502. queueIndex = -1;
  503. len = queue.length;
  504. }
  505. currentQueue = null;
  506. draining = false;
  507. runClearTimeout(timeout);
  508. }
  509. process.nextTick = function (fun) {
  510. var args = new Array(arguments.length - 1);
  511. if (arguments.length > 1) {
  512. for (var i = 1; i < arguments.length; i++) {
  513. args[i - 1] = arguments[i];
  514. }
  515. }
  516. queue.push(new Item(fun, args));
  517. if (queue.length === 1 && !draining) {
  518. runTimeout(drainQueue);
  519. }
  520. };
  521. // v8 likes predictible objects
  522. function Item(fun, array) {
  523. this.fun = fun;
  524. this.array = array;
  525. }
  526. Item.prototype.run = function () {
  527. this.fun.apply(null, this.array);
  528. };
  529. process.title = 'browser';
  530. process.browser = true;
  531. process.env = {};
  532. process.argv = [];
  533. process.version = ''; // empty string to avoid regexp issues
  534. process.versions = {};
  535. function noop() {}
  536. process.on = noop;
  537. process.addListener = noop;
  538. process.once = noop;
  539. process.off = noop;
  540. process.removeListener = noop;
  541. process.removeAllListeners = noop;
  542. process.emit = noop;
  543. process.prependListener = noop;
  544. process.prependOnceListener = noop;
  545. process.listeners = function (name) { return [] }
  546. process.binding = function (name) {
  547. throw new Error('process.binding is not supported');
  548. };
  549. process.cwd = function () { return '/' };
  550. process.chdir = function (dir) {
  551. throw new Error('process.chdir is not supported');
  552. };
  553. process.umask = function() { return 0; };
  554. /***/ }),
  555. /* 22 */
  556. /***/ (function(module, exports, __webpack_require__) {
  557. var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
  558. Copyright (c) 2017 Jed Watson.
  559. Licensed under the MIT License (MIT), see
  560. http://jedwatson.github.io/classnames
  561. */
  562. /* global define */
  563. (function () {
  564. 'use strict';
  565. var hasOwn = {}.hasOwnProperty;
  566. function classNames () {
  567. var classes = [];
  568. for (var i = 0; i < arguments.length; i++) {
  569. var arg = arguments[i];
  570. if (!arg) continue;
  571. var argType = typeof arg;
  572. if (argType === 'string' || argType === 'number') {
  573. classes.push(arg);
  574. } else if (Array.isArray(arg) && arg.length) {
  575. var inner = classNames.apply(null, arg);
  576. if (inner) {
  577. classes.push(inner);
  578. }
  579. } else if (argType === 'object') {
  580. for (var key in arg) {
  581. if (hasOwn.call(arg, key) && arg[key]) {
  582. classes.push(key);
  583. }
  584. }
  585. }
  586. }
  587. return classes.join(' ');
  588. }
  589. if (typeof module !== 'undefined' && module.exports) {
  590. classNames.default = classNames;
  591. module.exports = classNames;
  592. } else if (true) {
  593. // register as 'classnames', consistent with npm package name
  594. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
  595. return classNames;
  596. }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
  597. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  598. } else {
  599. window.classNames = classNames;
  600. }
  601. }());
  602. /***/ }),
  603. /* 23 */
  604. /***/ (function(module, exports) {
  605. module.exports = function (bitmap, value) {
  606. return {
  607. enumerable: !(bitmap & 1),
  608. configurable: !(bitmap & 2),
  609. writable: !(bitmap & 4),
  610. value: value
  611. };
  612. };
  613. /***/ }),
  614. /* 24 */
  615. /***/ (function(module, exports, __webpack_require__) {
  616. // 7.1.13 ToObject(argument)
  617. var defined = __webpack_require__(35);
  618. module.exports = function (it) {
  619. return Object(defined(it));
  620. };
  621. /***/ }),
  622. /* 25 */
  623. /***/ (function(module, exports) {
  624. module.exports = {};
  625. /***/ }),
  626. /* 26 */
  627. /***/ (function(module, exports, __webpack_require__) {
  628. "use strict";
  629. exports.__esModule = true;
  630. exports.default = function (obj, keys) {
  631. var target = {};
  632. for (var i in obj) {
  633. if (keys.indexOf(i) >= 0) continue;
  634. if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;
  635. target[i] = obj[i];
  636. }
  637. return target;
  638. };
  639. /***/ }),
  640. /* 27 */
  641. /***/ (function(module, exports, __webpack_require__) {
  642. // 19.1.2.14 / 15.2.3.14 Object.keys(O)
  643. var $keys = __webpack_require__(53);
  644. var enumBugKeys = __webpack_require__(39);
  645. module.exports = Object.keys || function keys(O) {
  646. return $keys(O, enumBugKeys);
  647. };
  648. /***/ }),
  649. /* 28 */
  650. /***/ (function(module, exports) {
  651. module.exports = true;
  652. /***/ }),
  653. /* 29 */
  654. /***/ (function(module, exports) {
  655. var id = 0;
  656. var px = Math.random();
  657. module.exports = function (key) {
  658. return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
  659. };
  660. /***/ }),
  661. /* 30 */
  662. /***/ (function(module, exports) {
  663. exports.f = {}.propertyIsEnumerable;
  664. /***/ }),
  665. /* 31 */
  666. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  667. "use strict";
  668. /* harmony export (immutable) */ __webpack_exports__["a"] = addEventListenerWrap;
  669. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_add_dom_event_listener__ = __webpack_require__(126);
  670. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_add_dom_event_listener___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_add_dom_event_listener__);
  671. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react_dom__ = __webpack_require__(14);
  672. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react_dom___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_react_dom__);
  673. function addEventListenerWrap(target, eventType, cb, option) {
  674. /* eslint camelcase: 2 */
  675. var callback = __WEBPACK_IMPORTED_MODULE_1_react_dom___default.a.unstable_batchedUpdates ? function run(e) {
  676. __WEBPACK_IMPORTED_MODULE_1_react_dom___default.a.unstable_batchedUpdates(cb, e);
  677. } : cb;
  678. return __WEBPACK_IMPORTED_MODULE_0_add_dom_event_listener___default()(target, eventType, callback, option);
  679. }
  680. /***/ }),
  681. /* 32 */
  682. /***/ (function(module, exports, __webpack_require__) {
  683. // optional / simple context binding
  684. var aFunction = __webpack_require__(81);
  685. module.exports = function (fn, that, length) {
  686. aFunction(fn);
  687. if (that === undefined) return fn;
  688. switch (length) {
  689. case 1: return function (a) {
  690. return fn.call(that, a);
  691. };
  692. case 2: return function (a, b) {
  693. return fn.call(that, a, b);
  694. };
  695. case 3: return function (a, b, c) {
  696. return fn.call(that, a, b, c);
  697. };
  698. }
  699. return function (/* ...args */) {
  700. return fn.apply(that, arguments);
  701. };
  702. };
  703. /***/ }),
  704. /* 33 */
  705. /***/ (function(module, exports, __webpack_require__) {
  706. // 7.1.1 ToPrimitive(input [, PreferredType])
  707. var isObject = __webpack_require__(19);
  708. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  709. // and the second argument - flag - preferred type is a string
  710. module.exports = function (it, S) {
  711. if (!isObject(it)) return it;
  712. var fn, val;
  713. if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
  714. if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
  715. if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
  716. throw TypeError("Can't convert object to primitive value");
  717. };
  718. /***/ }),
  719. /* 34 */
  720. /***/ (function(module, exports) {
  721. var toString = {}.toString;
  722. module.exports = function (it) {
  723. return toString.call(it).slice(8, -1);
  724. };
  725. /***/ }),
  726. /* 35 */
  727. /***/ (function(module, exports) {
  728. // 7.2.1 RequireObjectCoercible(argument)
  729. module.exports = function (it) {
  730. if (it == undefined) throw TypeError("Can't call method on " + it);
  731. return it;
  732. };
  733. /***/ }),
  734. /* 36 */
  735. /***/ (function(module, exports) {
  736. // 7.1.4 ToInteger
  737. var ceil = Math.ceil;
  738. var floor = Math.floor;
  739. module.exports = function (it) {
  740. return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
  741. };
  742. /***/ }),
  743. /* 37 */
  744. /***/ (function(module, exports, __webpack_require__) {
  745. var shared = __webpack_require__(38)('keys');
  746. var uid = __webpack_require__(29);
  747. module.exports = function (key) {
  748. return shared[key] || (shared[key] = uid(key));
  749. };
  750. /***/ }),
  751. /* 38 */
  752. /***/ (function(module, exports, __webpack_require__) {
  753. var core = __webpack_require__(6);
  754. var global = __webpack_require__(9);
  755. var SHARED = '__core-js_shared__';
  756. var store = global[SHARED] || (global[SHARED] = {});
  757. (module.exports = function (key, value) {
  758. return store[key] || (store[key] = value !== undefined ? value : {});
  759. })('versions', []).push({
  760. version: core.version,
  761. mode: __webpack_require__(28) ? 'pure' : 'global',
  762. copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
  763. });
  764. /***/ }),
  765. /* 39 */
  766. /***/ (function(module, exports) {
  767. // IE 8- don't enum bug keys
  768. module.exports = (
  769. 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
  770. ).split(',');
  771. /***/ }),
  772. /* 40 */
  773. /***/ (function(module, exports) {
  774. exports.f = Object.getOwnPropertySymbols;
  775. /***/ }),
  776. /* 41 */
  777. /***/ (function(module, exports, __webpack_require__) {
  778. "use strict";
  779. exports.__esModule = true;
  780. var _iterator = __webpack_require__(87);
  781. var _iterator2 = _interopRequireDefault(_iterator);
  782. var _symbol = __webpack_require__(97);
  783. var _symbol2 = _interopRequireDefault(_symbol);
  784. var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; };
  785. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  786. exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) {
  787. return typeof obj === "undefined" ? "undefined" : _typeof(obj);
  788. } : function (obj) {
  789. return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj);
  790. };
  791. /***/ }),
  792. /* 42 */
  793. /***/ (function(module, exports, __webpack_require__) {
  794. // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
  795. var anObject = __webpack_require__(18);
  796. var dPs = __webpack_require__(91);
  797. var enumBugKeys = __webpack_require__(39);
  798. var IE_PROTO = __webpack_require__(37)('IE_PROTO');
  799. var Empty = function () { /* empty */ };
  800. var PROTOTYPE = 'prototype';
  801. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  802. var createDict = function () {
  803. // Thrash, waste and sodomy: IE GC bug
  804. var iframe = __webpack_require__(52)('iframe');
  805. var i = enumBugKeys.length;
  806. var lt = '<';
  807. var gt = '>';
  808. var iframeDocument;
  809. iframe.style.display = 'none';
  810. __webpack_require__(92).appendChild(iframe);
  811. iframe.src = 'javascript:'; // eslint-disable-line no-script-url
  812. // createDict = iframe.contentWindow.Object;
  813. // html.removeChild(iframe);
  814. iframeDocument = iframe.contentWindow.document;
  815. iframeDocument.open();
  816. iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
  817. iframeDocument.close();
  818. createDict = iframeDocument.F;
  819. while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
  820. return createDict();
  821. };
  822. module.exports = Object.create || function create(O, Properties) {
  823. var result;
  824. if (O !== null) {
  825. Empty[PROTOTYPE] = anObject(O);
  826. result = new Empty();
  827. Empty[PROTOTYPE] = null;
  828. // add "__proto__" for Object.getPrototypeOf polyfill
  829. result[IE_PROTO] = O;
  830. } else result = createDict();
  831. return Properties === undefined ? result : dPs(result, Properties);
  832. };
  833. /***/ }),
  834. /* 43 */
  835. /***/ (function(module, exports, __webpack_require__) {
  836. var def = __webpack_require__(10).f;
  837. var has = __webpack_require__(15);
  838. var TAG = __webpack_require__(7)('toStringTag');
  839. module.exports = function (it, tag, stat) {
  840. if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
  841. };
  842. /***/ }),
  843. /* 44 */
  844. /***/ (function(module, exports, __webpack_require__) {
  845. exports.f = __webpack_require__(7);
  846. /***/ }),
  847. /* 45 */
  848. /***/ (function(module, exports, __webpack_require__) {
  849. var global = __webpack_require__(9);
  850. var core = __webpack_require__(6);
  851. var LIBRARY = __webpack_require__(28);
  852. var wksExt = __webpack_require__(44);
  853. var defineProperty = __webpack_require__(10).f;
  854. module.exports = function (name) {
  855. var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});
  856. if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });
  857. };
  858. /***/ }),
  859. /* 46 */
  860. /***/ (function(module, exports, __webpack_require__) {
  861. var pIE = __webpack_require__(30);
  862. var createDesc = __webpack_require__(23);
  863. var toIObject = __webpack_require__(16);
  864. var toPrimitive = __webpack_require__(33);
  865. var has = __webpack_require__(15);
  866. var IE8_DOM_DEFINE = __webpack_require__(51);
  867. var gOPD = Object.getOwnPropertyDescriptor;
  868. exports.f = __webpack_require__(11) ? gOPD : function getOwnPropertyDescriptor(O, P) {
  869. O = toIObject(O);
  870. P = toPrimitive(P, true);
  871. if (IE8_DOM_DEFINE) try {
  872. return gOPD(O, P);
  873. } catch (e) { /* empty */ }
  874. if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);
  875. };
  876. /***/ }),
  877. /* 47 */
  878. /***/ (function(module, exports, __webpack_require__) {
  879. "use strict";
  880. /**
  881. * Copyright (c) 2013-present, Facebook, Inc.
  882. *
  883. * This source code is licensed under the MIT license found in the
  884. * LICENSE file in the root directory of this source tree.
  885. */
  886. var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
  887. module.exports = ReactPropTypesSecret;
  888. /***/ }),
  889. /* 48 */
  890. /***/ (function(module, exports, __webpack_require__) {
  891. "use strict";
  892. /* WEBPACK VAR INJECTION */(function(process) {/**
  893. * Copyright (c) 2014-present, Facebook, Inc.
  894. *
  895. * This source code is licensed under the MIT license found in the
  896. * LICENSE file in the root directory of this source tree.
  897. */
  898. /**
  899. * Similar to invariant but only logs a warning if the condition is not met.
  900. * This can be used to log issues in development environments in critical
  901. * paths. Removing the logging code for production environments will keep the
  902. * same logic and follow the same code paths.
  903. */
  904. var __DEV__ = process.env.NODE_ENV !== 'production';
  905. var warning = function() {};
  906. if (__DEV__) {
  907. var printWarning = function printWarning(format, args) {
  908. var len = arguments.length;
  909. args = new Array(len > 1 ? len - 1 : 0);
  910. for (var key = 1; key < len; key++) {
  911. args[key - 1] = arguments[key];
  912. }
  913. var argIndex = 0;
  914. var message = 'Warning: ' +
  915. format.replace(/%s/g, function() {
  916. return args[argIndex++];
  917. });
  918. if (typeof console !== 'undefined') {
  919. console.error(message);
  920. }
  921. try {
  922. // --- Welcome to debugging React ---
  923. // This error was thrown as a convenience so that you can use this stack
  924. // to find the callsite that caused this warning to fire.
  925. throw new Error(message);
  926. } catch (x) {}
  927. }
  928. warning = function(condition, format, args) {
  929. var len = arguments.length;
  930. args = new Array(len > 2 ? len - 2 : 0);
  931. for (var key = 2; key < len; key++) {
  932. args[key - 2] = arguments[key];
  933. }
  934. if (format === undefined) {
  935. throw new Error(
  936. '`warning(condition, format, ...args)` requires a warning ' +
  937. 'message argument'
  938. );
  939. }
  940. if (!condition) {
  941. printWarning.apply(null, [format].concat(args));
  942. }
  943. };
  944. }
  945. module.exports = warning;
  946. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(21)))
  947. /***/ }),
  948. /* 49 */
  949. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  950. "use strict";
  951. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(5);
  952. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__);
  953. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty__ = __webpack_require__(13);
  954. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty__);
  955. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_objectWithoutProperties__ = __webpack_require__(26);
  956. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_objectWithoutProperties___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_objectWithoutProperties__);
  957. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_classCallCheck__ = __webpack_require__(2);
  958. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_classCallCheck__);
  959. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_createClass__ = __webpack_require__(12);
  960. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_createClass___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_createClass__);
  961. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(3);
  962. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_babel_runtime_helpers_possibleConstructorReturn__);
  963. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_babel_runtime_helpers_inherits__ = __webpack_require__(4);
  964. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_babel_runtime_helpers_inherits__);
  965. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_react__ = __webpack_require__(0);
  966. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_react__);
  967. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_prop_types__ = __webpack_require__(1);
  968. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_prop_types__);
  969. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_classnames__ = __webpack_require__(22);
  970. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_classnames__);
  971. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_rc_util_es_Dom_addEventListener__ = __webpack_require__(31);
  972. var Handle = function (_React$Component) {
  973. __WEBPACK_IMPORTED_MODULE_6_babel_runtime_helpers_inherits___default()(Handle, _React$Component);
  974. function Handle() {
  975. var _ref;
  976. var _temp, _this, _ret;
  977. __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_classCallCheck___default()(this, Handle);
  978. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  979. args[_key] = arguments[_key];
  980. }
  981. return _ret = (_temp = (_this = __WEBPACK_IMPORTED_MODULE_5_babel_runtime_helpers_possibleConstructorReturn___default()(this, (_ref = Handle.__proto__ || Object.getPrototypeOf(Handle)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
  982. clickFocused: false
  983. }, _this.setHandleRef = function (node) {
  984. _this.handle = node;
  985. }, _this.handleMouseUp = function () {
  986. if (document.activeElement === _this.handle) {
  987. _this.setClickFocus(true);
  988. }
  989. }, _this.handleMouseDown = function () {
  990. // fix https://github.com/ant-design/ant-design/issues/15324
  991. _this.focus();
  992. }, _this.handleBlur = function () {
  993. _this.setClickFocus(false);
  994. }, _this.handleKeyDown = function () {
  995. _this.setClickFocus(false);
  996. }, _temp), __WEBPACK_IMPORTED_MODULE_5_babel_runtime_helpers_possibleConstructorReturn___default()(_this, _ret);
  997. }
  998. __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_createClass___default()(Handle, [{
  999. key: 'componentDidMount',
  1000. value: function componentDidMount() {
  1001. // mouseup won't trigger if mouse moved out of handle,
  1002. // so we listen on document here.
  1003. this.onMouseUpListener = Object(__WEBPACK_IMPORTED_MODULE_10_rc_util_es_Dom_addEventListener__["a" /* default */])(document, 'mouseup', this.handleMouseUp);
  1004. }
  1005. }, {
  1006. key: 'componentWillUnmount',
  1007. value: function componentWillUnmount() {
  1008. if (this.onMouseUpListener) {
  1009. this.onMouseUpListener.remove();
  1010. }
  1011. }
  1012. }, {
  1013. key: 'setClickFocus',
  1014. value: function setClickFocus(focused) {
  1015. this.setState({ clickFocused: focused });
  1016. }
  1017. }, {
  1018. key: 'clickFocus',
  1019. value: function clickFocus() {
  1020. this.setClickFocus(true);
  1021. this.focus();
  1022. }
  1023. }, {
  1024. key: 'focus',
  1025. value: function focus() {
  1026. this.handle.focus();
  1027. }
  1028. }, {
  1029. key: 'blur',
  1030. value: function blur() {
  1031. this.handle.blur();
  1032. }
  1033. }, {
  1034. key: 'render',
  1035. value: function render() {
  1036. var _ref2, _ref3;
  1037. var _props = this.props,
  1038. prefixCls = _props.prefixCls,
  1039. vertical = _props.vertical,
  1040. reverse = _props.reverse,
  1041. offset = _props.offset,
  1042. style = _props.style,
  1043. disabled = _props.disabled,
  1044. min = _props.min,
  1045. max = _props.max,
  1046. value = _props.value,
  1047. tabIndex = _props.tabIndex,
  1048. restProps = __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_objectWithoutProperties___default()(_props, ['prefixCls', 'vertical', 'reverse', 'offset', 'style', 'disabled', 'min', 'max', 'value', 'tabIndex']);
  1049. var className = __WEBPACK_IMPORTED_MODULE_9_classnames___default()(this.props.className, __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty___default()({}, prefixCls + '-handle-click-focused', this.state.clickFocused));
  1050. var positionStyle = vertical ? (_ref2 = {}, __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty___default()(_ref2, reverse ? 'top' : 'bottom', offset + '%'), __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty___default()(_ref2, reverse ? 'bottom' : 'top', 'auto'), __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty___default()(_ref2, 'transform', 'translateY(+50%)'), _ref2) : (_ref3 = {}, __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty___default()(_ref3, reverse ? 'right' : 'left', offset + '%'), __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty___default()(_ref3, reverse ? 'left' : 'right', 'auto'), __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty___default()(_ref3, 'transform', 'translateX(' + (reverse ? '+' : '-') + '50%)'), _ref3);
  1051. var elStyle = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, style, positionStyle);
  1052. var _tabIndex = tabIndex || 0;
  1053. if (disabled || tabIndex === null) {
  1054. _tabIndex = null;
  1055. }
  1056. return __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement('div', __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({
  1057. ref: this.setHandleRef,
  1058. tabIndex: _tabIndex
  1059. }, restProps, {
  1060. className: className,
  1061. style: elStyle,
  1062. onBlur: this.handleBlur,
  1063. onKeyDown: this.handleKeyDown,
  1064. onMouseDown: this.handleMouseDown
  1065. // aria attribute
  1066. , role: 'slider',
  1067. 'aria-valuemin': min,
  1068. 'aria-valuemax': max,
  1069. 'aria-valuenow': value,
  1070. 'aria-disabled': !!disabled
  1071. }));
  1072. }
  1073. }]);
  1074. return Handle;
  1075. }(__WEBPACK_IMPORTED_MODULE_7_react___default.a.Component);
  1076. /* harmony default export */ __webpack_exports__["a"] = (Handle);
  1077. Handle.propTypes = {
  1078. prefixCls: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.string,
  1079. className: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.string,
  1080. vertical: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.bool,
  1081. offset: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.number,
  1082. style: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.object,
  1083. disabled: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.bool,
  1084. min: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.number,
  1085. max: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.number,
  1086. value: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.number,
  1087. tabIndex: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.number,
  1088. reverse: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.bool
  1089. };
  1090. /***/ }),
  1091. /* 50 */
  1092. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1093. "use strict";
  1094. /* harmony export (immutable) */ __webpack_exports__["g"] = isEventFromHandle;
  1095. /* harmony export (immutable) */ __webpack_exports__["i"] = isValueOutOfRange;
  1096. /* harmony export (immutable) */ __webpack_exports__["h"] = isNotTouchEvent;
  1097. /* unused harmony export getClosestPoint */
  1098. /* unused harmony export getPrecision */
  1099. /* harmony export (immutable) */ __webpack_exports__["e"] = getMousePosition;
  1100. /* harmony export (immutable) */ __webpack_exports__["f"] = getTouchPosition;
  1101. /* harmony export (immutable) */ __webpack_exports__["c"] = getHandleCenterPosition;
  1102. /* harmony export (immutable) */ __webpack_exports__["a"] = ensureValueInRange;
  1103. /* harmony export (immutable) */ __webpack_exports__["b"] = ensureValuePrecision;
  1104. /* harmony export (immutable) */ __webpack_exports__["j"] = pauseEvent;
  1105. /* unused harmony export calculateNextValue */
  1106. /* harmony export (immutable) */ __webpack_exports__["d"] = getKeyboardValueMutator;
  1107. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_toConsumableArray__ = __webpack_require__(67);
  1108. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_toConsumableArray___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_toConsumableArray__);
  1109. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react_dom__ = __webpack_require__(14);
  1110. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react_dom___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_react_dom__);
  1111. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rc_util_es_KeyCode__ = __webpack_require__(140);
  1112. function isEventFromHandle(e, handles) {
  1113. try {
  1114. return Object.keys(handles).some(function (key) {
  1115. return e.target === Object(__WEBPACK_IMPORTED_MODULE_1_react_dom__["findDOMNode"])(handles[key]);
  1116. });
  1117. } catch (error) {
  1118. return false;
  1119. }
  1120. }
  1121. function isValueOutOfRange(value, _ref) {
  1122. var min = _ref.min,
  1123. max = _ref.max;
  1124. return value < min || value > max;
  1125. }
  1126. function isNotTouchEvent(e) {
  1127. return e.touches.length > 1 || e.type.toLowerCase() === 'touchend' && e.touches.length > 0;
  1128. }
  1129. function getClosestPoint(val, _ref2) {
  1130. var marks = _ref2.marks,
  1131. step = _ref2.step,
  1132. min = _ref2.min,
  1133. max = _ref2.max;
  1134. var points = Object.keys(marks).map(parseFloat);
  1135. if (step !== null) {
  1136. var maxSteps = Math.floor((max - min) / step);
  1137. var steps = Math.min((val - min) / step, maxSteps);
  1138. var closestStep = Math.round(steps) * step + min;
  1139. points.push(closestStep);
  1140. }
  1141. var diffs = points.map(function (point) {
  1142. return Math.abs(val - point);
  1143. });
  1144. return points[diffs.indexOf(Math.min.apply(Math, __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_toConsumableArray___default()(diffs)))];
  1145. }
  1146. function getPrecision(step) {
  1147. var stepString = step.toString();
  1148. var precision = 0;
  1149. if (stepString.indexOf('.') >= 0) {
  1150. precision = stepString.length - stepString.indexOf('.') - 1;
  1151. }
  1152. return precision;
  1153. }
  1154. function getMousePosition(vertical, e) {
  1155. return vertical ? e.clientY : e.pageX;
  1156. }
  1157. function getTouchPosition(vertical, e) {
  1158. return vertical ? e.touches[0].clientY : e.touches[0].pageX;
  1159. }
  1160. function getHandleCenterPosition(vertical, handle) {
  1161. var coords = handle.getBoundingClientRect();
  1162. return vertical ? coords.top + coords.height * 0.5 : window.pageXOffset + coords.left + coords.width * 0.5;
  1163. }
  1164. function ensureValueInRange(val, _ref3) {
  1165. var max = _ref3.max,
  1166. min = _ref3.min;
  1167. if (val <= min) {
  1168. return min;
  1169. }
  1170. if (val >= max) {
  1171. return max;
  1172. }
  1173. return val;
  1174. }
  1175. function ensureValuePrecision(val, props) {
  1176. var step = props.step;
  1177. var closestPoint = isFinite(getClosestPoint(val, props)) ? getClosestPoint(val, props) : 0; // eslint-disable-line
  1178. return step === null ? closestPoint : parseFloat(closestPoint.toFixed(getPrecision(step)));
  1179. }
  1180. function pauseEvent(e) {
  1181. e.stopPropagation();
  1182. e.preventDefault();
  1183. }
  1184. function calculateNextValue(func, value, props) {
  1185. var operations = {
  1186. increase: function increase(a, b) {
  1187. return a + b;
  1188. },
  1189. decrease: function decrease(a, b) {
  1190. return a - b;
  1191. }
  1192. };
  1193. var indexToGet = operations[func](Object.keys(props.marks).indexOf(JSON.stringify(value)), 1);
  1194. var keyToGet = Object.keys(props.marks)[indexToGet];
  1195. if (props.step) {
  1196. return operations[func](value, props.step);
  1197. } else if (!!Object.keys(props.marks).length && !!props.marks[keyToGet]) {
  1198. return props.marks[keyToGet];
  1199. }
  1200. return value;
  1201. }
  1202. function getKeyboardValueMutator(e, vertical, reverse) {
  1203. var increase = 'increase';
  1204. var decrease = 'decrease';
  1205. var method = increase;
  1206. switch (e.keyCode) {
  1207. case __WEBPACK_IMPORTED_MODULE_2_rc_util_es_KeyCode__["a" /* default */].UP:
  1208. method = vertical && reverse ? decrease : increase;break;
  1209. case __WEBPACK_IMPORTED_MODULE_2_rc_util_es_KeyCode__["a" /* default */].RIGHT:
  1210. method = !vertical && reverse ? decrease : increase;break;
  1211. case __WEBPACK_IMPORTED_MODULE_2_rc_util_es_KeyCode__["a" /* default */].DOWN:
  1212. method = vertical && reverse ? increase : decrease;break;
  1213. case __WEBPACK_IMPORTED_MODULE_2_rc_util_es_KeyCode__["a" /* default */].LEFT:
  1214. method = !vertical && reverse ? increase : decrease;break;
  1215. case __WEBPACK_IMPORTED_MODULE_2_rc_util_es_KeyCode__["a" /* default */].END:
  1216. return function (value, props) {
  1217. return props.max;
  1218. };
  1219. case __WEBPACK_IMPORTED_MODULE_2_rc_util_es_KeyCode__["a" /* default */].HOME:
  1220. return function (value, props) {
  1221. return props.min;
  1222. };
  1223. case __WEBPACK_IMPORTED_MODULE_2_rc_util_es_KeyCode__["a" /* default */].PAGE_UP:
  1224. return function (value, props) {
  1225. return value + props.step * 2;
  1226. };
  1227. case __WEBPACK_IMPORTED_MODULE_2_rc_util_es_KeyCode__["a" /* default */].PAGE_DOWN:
  1228. return function (value, props) {
  1229. return value - props.step * 2;
  1230. };
  1231. default:
  1232. return undefined;
  1233. }
  1234. return function (value, props) {
  1235. return calculateNextValue(method, value, props);
  1236. };
  1237. }
  1238. /***/ }),
  1239. /* 51 */
  1240. /***/ (function(module, exports, __webpack_require__) {
  1241. module.exports = !__webpack_require__(11) && !__webpack_require__(20)(function () {
  1242. return Object.defineProperty(__webpack_require__(52)('div'), 'a', { get: function () { return 7; } }).a != 7;
  1243. });
  1244. /***/ }),
  1245. /* 52 */
  1246. /***/ (function(module, exports, __webpack_require__) {
  1247. var isObject = __webpack_require__(19);
  1248. var document = __webpack_require__(9).document;
  1249. // typeof document.createElement is 'object' in old IE
  1250. var is = isObject(document) && isObject(document.createElement);
  1251. module.exports = function (it) {
  1252. return is ? document.createElement(it) : {};
  1253. };
  1254. /***/ }),
  1255. /* 53 */
  1256. /***/ (function(module, exports, __webpack_require__) {
  1257. var has = __webpack_require__(15);
  1258. var toIObject = __webpack_require__(16);
  1259. var arrayIndexOf = __webpack_require__(83)(false);
  1260. var IE_PROTO = __webpack_require__(37)('IE_PROTO');
  1261. module.exports = function (object, names) {
  1262. var O = toIObject(object);
  1263. var i = 0;
  1264. var result = [];
  1265. var key;
  1266. for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
  1267. // Don't enum bug & hidden keys
  1268. while (names.length > i) if (has(O, key = names[i++])) {
  1269. ~arrayIndexOf(result, key) || result.push(key);
  1270. }
  1271. return result;
  1272. };
  1273. /***/ }),
  1274. /* 54 */
  1275. /***/ (function(module, exports, __webpack_require__) {
  1276. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  1277. var cof = __webpack_require__(34);
  1278. // eslint-disable-next-line no-prototype-builtins
  1279. module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
  1280. return cof(it) == 'String' ? it.split('') : Object(it);
  1281. };
  1282. /***/ }),
  1283. /* 55 */
  1284. /***/ (function(module, exports, __webpack_require__) {
  1285. // 7.1.15 ToLength
  1286. var toInteger = __webpack_require__(36);
  1287. var min = Math.min;
  1288. module.exports = function (it) {
  1289. return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
  1290. };
  1291. /***/ }),
  1292. /* 56 */
  1293. /***/ (function(module, exports, __webpack_require__) {
  1294. module.exports = { "default": __webpack_require__(85), __esModule: true };
  1295. /***/ }),
  1296. /* 57 */
  1297. /***/ (function(module, exports, __webpack_require__) {
  1298. "use strict";
  1299. var $at = __webpack_require__(89)(true);
  1300. // 21.1.3.27 String.prototype[@@iterator]()
  1301. __webpack_require__(58)(String, 'String', function (iterated) {
  1302. this._t = String(iterated); // target
  1303. this._i = 0; // next index
  1304. // 21.1.5.2.1 %StringIteratorPrototype%.next()
  1305. }, function () {
  1306. var O = this._t;
  1307. var index = this._i;
  1308. var point;
  1309. if (index >= O.length) return { value: undefined, done: true };
  1310. point = $at(O, index);
  1311. this._i += point.length;
  1312. return { value: point, done: false };
  1313. });
  1314. /***/ }),
  1315. /* 58 */
  1316. /***/ (function(module, exports, __webpack_require__) {
  1317. "use strict";
  1318. var LIBRARY = __webpack_require__(28);
  1319. var $export = __webpack_require__(8);
  1320. var redefine = __webpack_require__(59);
  1321. var hide = __webpack_require__(17);
  1322. var Iterators = __webpack_require__(25);
  1323. var $iterCreate = __webpack_require__(90);
  1324. var setToStringTag = __webpack_require__(43);
  1325. var getPrototypeOf = __webpack_require__(60);
  1326. var ITERATOR = __webpack_require__(7)('iterator');
  1327. var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`
  1328. var FF_ITERATOR = '@@iterator';
  1329. var KEYS = 'keys';
  1330. var VALUES = 'values';
  1331. var returnThis = function () { return this; };
  1332. module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
  1333. $iterCreate(Constructor, NAME, next);
  1334. var getMethod = function (kind) {
  1335. if (!BUGGY && kind in proto) return proto[kind];
  1336. switch (kind) {
  1337. case KEYS: return function keys() { return new Constructor(this, kind); };
  1338. case VALUES: return function values() { return new Constructor(this, kind); };
  1339. } return function entries() { return new Constructor(this, kind); };
  1340. };
  1341. var TAG = NAME + ' Iterator';
  1342. var DEF_VALUES = DEFAULT == VALUES;
  1343. var VALUES_BUG = false;
  1344. var proto = Base.prototype;
  1345. var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
  1346. var $default = $native || getMethod(DEFAULT);
  1347. var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
  1348. var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
  1349. var methods, key, IteratorPrototype;
  1350. // Fix native
  1351. if ($anyNative) {
  1352. IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));
  1353. if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
  1354. // Set @@toStringTag to native iterators
  1355. setToStringTag(IteratorPrototype, TAG, true);
  1356. // fix for some old engines
  1357. if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);
  1358. }
  1359. }
  1360. // fix Array#{values, @@iterator}.name in V8 / FF
  1361. if (DEF_VALUES && $native && $native.name !== VALUES) {
  1362. VALUES_BUG = true;
  1363. $default = function values() { return $native.call(this); };
  1364. }
  1365. // Define iterator
  1366. if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
  1367. hide(proto, ITERATOR, $default);
  1368. }
  1369. // Plug for library
  1370. Iterators[NAME] = $default;
  1371. Iterators[TAG] = returnThis;
  1372. if (DEFAULT) {
  1373. methods = {
  1374. values: DEF_VALUES ? $default : getMethod(VALUES),
  1375. keys: IS_SET ? $default : getMethod(KEYS),
  1376. entries: $entries
  1377. };
  1378. if (FORCED) for (key in methods) {
  1379. if (!(key in proto)) redefine(proto, key, methods[key]);
  1380. } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
  1381. }
  1382. return methods;
  1383. };
  1384. /***/ }),
  1385. /* 59 */
  1386. /***/ (function(module, exports, __webpack_require__) {
  1387. module.exports = __webpack_require__(17);
  1388. /***/ }),
  1389. /* 60 */
  1390. /***/ (function(module, exports, __webpack_require__) {
  1391. // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
  1392. var has = __webpack_require__(15);
  1393. var toObject = __webpack_require__(24);
  1394. var IE_PROTO = __webpack_require__(37)('IE_PROTO');
  1395. var ObjectProto = Object.prototype;
  1396. module.exports = Object.getPrototypeOf || function (O) {
  1397. O = toObject(O);
  1398. if (has(O, IE_PROTO)) return O[IE_PROTO];
  1399. if (typeof O.constructor == 'function' && O instanceof O.constructor) {
  1400. return O.constructor.prototype;
  1401. } return O instanceof Object ? ObjectProto : null;
  1402. };
  1403. /***/ }),
  1404. /* 61 */
  1405. /***/ (function(module, exports, __webpack_require__) {
  1406. // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
  1407. var $keys = __webpack_require__(53);
  1408. var hiddenKeys = __webpack_require__(39).concat('length', 'prototype');
  1409. exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  1410. return $keys(O, hiddenKeys);
  1411. };
  1412. /***/ }),
  1413. /* 62 */
  1414. /***/ (function(module, exports, __webpack_require__) {
  1415. "use strict";
  1416. /* WEBPACK VAR INJECTION */(function(process) {
  1417. if (process.env.NODE_ENV === 'production') {
  1418. module.exports = __webpack_require__(114);
  1419. } else {
  1420. module.exports = __webpack_require__(115);
  1421. }
  1422. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(21)))
  1423. /***/ }),
  1424. /* 63 */
  1425. /***/ (function(module, exports, __webpack_require__) {
  1426. "use strict";
  1427. /*
  1428. object-assign
  1429. (c) Sindre Sorhus
  1430. @license MIT
  1431. */
  1432. /* eslint-disable no-unused-vars */
  1433. var getOwnPropertySymbols = Object.getOwnPropertySymbols;
  1434. var hasOwnProperty = Object.prototype.hasOwnProperty;
  1435. var propIsEnumerable = Object.prototype.propertyIsEnumerable;
  1436. function toObject(val) {
  1437. if (val === null || val === undefined) {
  1438. throw new TypeError('Object.assign cannot be called with null or undefined');
  1439. }
  1440. return Object(val);
  1441. }
  1442. function shouldUseNative() {
  1443. try {
  1444. if (!Object.assign) {
  1445. return false;
  1446. }
  1447. // Detect buggy property enumeration order in older V8 versions.
  1448. // https://bugs.chromium.org/p/v8/issues/detail?id=4118
  1449. var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
  1450. test1[5] = 'de';
  1451. if (Object.getOwnPropertyNames(test1)[0] === '5') {
  1452. return false;
  1453. }
  1454. // https://bugs.chromium.org/p/v8/issues/detail?id=3056
  1455. var test2 = {};
  1456. for (var i = 0; i < 10; i++) {
  1457. test2['_' + String.fromCharCode(i)] = i;
  1458. }
  1459. var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
  1460. return test2[n];
  1461. });
  1462. if (order2.join('') !== '0123456789') {
  1463. return false;
  1464. }
  1465. // https://bugs.chromium.org/p/v8/issues/detail?id=3056
  1466. var test3 = {};
  1467. 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
  1468. test3[letter] = letter;
  1469. });
  1470. if (Object.keys(Object.assign({}, test3)).join('') !==
  1471. 'abcdefghijklmnopqrst') {
  1472. return false;
  1473. }
  1474. return true;
  1475. } catch (err) {
  1476. // We don't expect any of the above to throw, but better to be safe.
  1477. return false;
  1478. }
  1479. }
  1480. module.exports = shouldUseNative() ? Object.assign : function (target, source) {
  1481. var from;
  1482. var to = toObject(target);
  1483. var symbols;
  1484. for (var s = 1; s < arguments.length; s++) {
  1485. from = Object(arguments[s]);
  1486. for (var key in from) {
  1487. if (hasOwnProperty.call(from, key)) {
  1488. to[key] = from[key];
  1489. }
  1490. }
  1491. if (getOwnPropertySymbols) {
  1492. symbols = getOwnPropertySymbols(from);
  1493. for (var i = 0; i < symbols.length; i++) {
  1494. if (propIsEnumerable.call(from, symbols[i])) {
  1495. to[symbols[i]] = from[symbols[i]];
  1496. }
  1497. }
  1498. }
  1499. }
  1500. return to;
  1501. };
  1502. /***/ }),
  1503. /* 64 */
  1504. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1505. "use strict";
  1506. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(5);
  1507. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__);
  1508. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty__ = __webpack_require__(13);
  1509. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty__);
  1510. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react__ = __webpack_require__(0);
  1511. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_react__);
  1512. /* eslint-disable react/prop-types */
  1513. var Track = function Track(props) {
  1514. var _ref, _ref2;
  1515. var className = props.className,
  1516. included = props.included,
  1517. vertical = props.vertical,
  1518. offset = props.offset,
  1519. length = props.length,
  1520. style = props.style,
  1521. reverse = props.reverse;
  1522. var positonStyle = vertical ? (_ref = {}, __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty___default()(_ref, reverse ? 'top' : 'bottom', offset + '%'), __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty___default()(_ref, reverse ? 'bottom' : 'top', 'auto'), __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty___default()(_ref, 'height', length + '%'), _ref) : (_ref2 = {}, __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty___default()(_ref2, reverse ? 'right' : 'left', offset + '%'), __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty___default()(_ref2, reverse ? 'left' : 'right', 'auto'), __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty___default()(_ref2, 'width', length + '%'), _ref2);
  1523. var elStyle = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, style, positonStyle);
  1524. return included ? __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement('div', { className: className, style: elStyle }) : null;
  1525. };
  1526. /* harmony default export */ __webpack_exports__["a"] = (Track);
  1527. /***/ }),
  1528. /* 65 */
  1529. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1530. "use strict";
  1531. /* harmony export (immutable) */ __webpack_exports__["a"] = createSlider;
  1532. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_objectWithoutProperties__ = __webpack_require__(26);
  1533. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_objectWithoutProperties___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_objectWithoutProperties__);
  1534. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends__ = __webpack_require__(5);
  1535. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends__);
  1536. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_defineProperty__ = __webpack_require__(13);
  1537. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_defineProperty___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_defineProperty__);
  1538. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_classCallCheck__ = __webpack_require__(2);
  1539. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_classCallCheck__);
  1540. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_createClass__ = __webpack_require__(12);
  1541. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_createClass___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_createClass__);
  1542. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(3);
  1543. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_babel_runtime_helpers_possibleConstructorReturn__);
  1544. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_babel_runtime_helpers_get__ = __webpack_require__(119);
  1545. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_babel_runtime_helpers_get___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_babel_runtime_helpers_get__);
  1546. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_babel_runtime_helpers_inherits__ = __webpack_require__(4);
  1547. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_babel_runtime_helpers_inherits__);
  1548. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_react__ = __webpack_require__(0);
  1549. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_react__);
  1550. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_prop_types__ = __webpack_require__(1);
  1551. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_prop_types__);
  1552. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_rc_util_es_Dom_addEventListener__ = __webpack_require__(31);
  1553. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_classnames__ = __webpack_require__(22);
  1554. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_11_classnames__);
  1555. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12_warning__ = __webpack_require__(48);
  1556. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12_warning___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_12_warning__);
  1557. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__Steps__ = __webpack_require__(129);
  1558. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__Marks__ = __webpack_require__(130);
  1559. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__Handle__ = __webpack_require__(49);
  1560. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__utils__ = __webpack_require__(50);
  1561. function noop() {}
  1562. function createSlider(Component) {
  1563. var _class, _temp;
  1564. return _temp = _class = function (_Component) {
  1565. __WEBPACK_IMPORTED_MODULE_7_babel_runtime_helpers_inherits___default()(ComponentEnhancer, _Component);
  1566. function ComponentEnhancer(props) {
  1567. __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_classCallCheck___default()(this, ComponentEnhancer);
  1568. var _this = __WEBPACK_IMPORTED_MODULE_5_babel_runtime_helpers_possibleConstructorReturn___default()(this, (ComponentEnhancer.__proto__ || Object.getPrototypeOf(ComponentEnhancer)).call(this, props));
  1569. _this.onMouseDown = function (e) {
  1570. if (e.button !== 0) {
  1571. return;
  1572. }
  1573. var isVertical = _this.props.vertical;
  1574. var position = __WEBPACK_IMPORTED_MODULE_16__utils__["e" /* getMousePosition */](isVertical, e);
  1575. if (!__WEBPACK_IMPORTED_MODULE_16__utils__["g" /* isEventFromHandle */](e, _this.handlesRefs)) {
  1576. _this.dragOffset = 0;
  1577. } else {
  1578. var handlePosition = __WEBPACK_IMPORTED_MODULE_16__utils__["c" /* getHandleCenterPosition */](isVertical, e.target);
  1579. _this.dragOffset = position - handlePosition;
  1580. position = handlePosition;
  1581. }
  1582. _this.removeDocumentEvents();
  1583. _this.onStart(position);
  1584. _this.addDocumentMouseEvents();
  1585. };
  1586. _this.onTouchStart = function (e) {
  1587. if (__WEBPACK_IMPORTED_MODULE_16__utils__["h" /* isNotTouchEvent */](e)) return;
  1588. var isVertical = _this.props.vertical;
  1589. var position = __WEBPACK_IMPORTED_MODULE_16__utils__["f" /* getTouchPosition */](isVertical, e);
  1590. if (!__WEBPACK_IMPORTED_MODULE_16__utils__["g" /* isEventFromHandle */](e, _this.handlesRefs)) {
  1591. _this.dragOffset = 0;
  1592. } else {
  1593. var handlePosition = __WEBPACK_IMPORTED_MODULE_16__utils__["c" /* getHandleCenterPosition */](isVertical, e.target);
  1594. _this.dragOffset = position - handlePosition;
  1595. position = handlePosition;
  1596. }
  1597. _this.onStart(position);
  1598. _this.addDocumentTouchEvents();
  1599. __WEBPACK_IMPORTED_MODULE_16__utils__["j" /* pauseEvent */](e);
  1600. };
  1601. _this.onFocus = function (e) {
  1602. var _this$props = _this.props,
  1603. onFocus = _this$props.onFocus,
  1604. vertical = _this$props.vertical;
  1605. if (__WEBPACK_IMPORTED_MODULE_16__utils__["g" /* isEventFromHandle */](e, _this.handlesRefs)) {
  1606. var handlePosition = __WEBPACK_IMPORTED_MODULE_16__utils__["c" /* getHandleCenterPosition */](vertical, e.target);
  1607. _this.dragOffset = 0;
  1608. _this.onStart(handlePosition);
  1609. __WEBPACK_IMPORTED_MODULE_16__utils__["j" /* pauseEvent */](e);
  1610. if (onFocus) {
  1611. onFocus(e);
  1612. }
  1613. }
  1614. };
  1615. _this.onBlur = function (e) {
  1616. var onBlur = _this.props.onBlur;
  1617. _this.onEnd();
  1618. if (onBlur) {
  1619. onBlur(e);
  1620. }
  1621. };
  1622. _this.onMouseUp = function () {
  1623. if (_this.handlesRefs[_this.prevMovedHandleIndex]) {
  1624. _this.handlesRefs[_this.prevMovedHandleIndex].clickFocus();
  1625. }
  1626. };
  1627. _this.onMouseMove = function (e) {
  1628. if (!_this.sliderRef) {
  1629. _this.onEnd();
  1630. return;
  1631. }
  1632. var position = __WEBPACK_IMPORTED_MODULE_16__utils__["e" /* getMousePosition */](_this.props.vertical, e);
  1633. _this.onMove(e, position - _this.dragOffset);
  1634. };
  1635. _this.onTouchMove = function (e) {
  1636. if (__WEBPACK_IMPORTED_MODULE_16__utils__["h" /* isNotTouchEvent */](e) || !_this.sliderRef) {
  1637. _this.onEnd();
  1638. return;
  1639. }
  1640. var position = __WEBPACK_IMPORTED_MODULE_16__utils__["f" /* getTouchPosition */](_this.props.vertical, e);
  1641. _this.onMove(e, position - _this.dragOffset);
  1642. };
  1643. _this.onKeyDown = function (e) {
  1644. if (_this.sliderRef && __WEBPACK_IMPORTED_MODULE_16__utils__["g" /* isEventFromHandle */](e, _this.handlesRefs)) {
  1645. _this.onKeyboard(e);
  1646. }
  1647. };
  1648. _this.onClickMarkLabel = function (e, value) {
  1649. e.stopPropagation();
  1650. _this.onChange({ value: value });
  1651. _this.setState({ value: value }, function () {
  1652. return _this.onEnd(true);
  1653. });
  1654. };
  1655. _this.saveSlider = function (slider) {
  1656. _this.sliderRef = slider;
  1657. };
  1658. var step = props.step,
  1659. max = props.max,
  1660. min = props.min;
  1661. var isPointDiffEven = isFinite(max - min) ? (max - min) % step === 0 : true; // eslint-disable-line
  1662. __WEBPACK_IMPORTED_MODULE_12_warning___default()(step && Math.floor(step) === step ? isPointDiffEven : true, 'Slider[max] - Slider[min] (%s) should be a multiple of Slider[step] (%s)', max - min, step);
  1663. _this.handlesRefs = {};
  1664. return _this;
  1665. }
  1666. __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_createClass___default()(ComponentEnhancer, [{
  1667. key: 'componentDidMount',
  1668. value: function componentDidMount() {
  1669. // Snapshot testing cannot handle refs, so be sure to null-check this.
  1670. this.document = this.sliderRef && this.sliderRef.ownerDocument;
  1671. var _props = this.props,
  1672. autoFocus = _props.autoFocus,
  1673. disabled = _props.disabled;
  1674. if (autoFocus && !disabled) {
  1675. this.focus();
  1676. }
  1677. }
  1678. }, {
  1679. key: 'componentWillUnmount',
  1680. value: function componentWillUnmount() {
  1681. if (__WEBPACK_IMPORTED_MODULE_6_babel_runtime_helpers_get___default()(ComponentEnhancer.prototype.__proto__ || Object.getPrototypeOf(ComponentEnhancer.prototype), 'componentWillUnmount', this)) __WEBPACK_IMPORTED_MODULE_6_babel_runtime_helpers_get___default()(ComponentEnhancer.prototype.__proto__ || Object.getPrototypeOf(ComponentEnhancer.prototype), 'componentWillUnmount', this).call(this);
  1682. this.removeDocumentEvents();
  1683. }
  1684. }, {
  1685. key: 'getSliderStart',
  1686. value: function getSliderStart() {
  1687. var slider = this.sliderRef;
  1688. var _props2 = this.props,
  1689. vertical = _props2.vertical,
  1690. reverse = _props2.reverse;
  1691. var rect = slider.getBoundingClientRect();
  1692. if (vertical) {
  1693. return reverse ? rect.bottom : rect.top;
  1694. }
  1695. return window.pageXOffset + (reverse ? rect.right : rect.left);
  1696. }
  1697. }, {
  1698. key: 'getSliderLength',
  1699. value: function getSliderLength() {
  1700. var slider = this.sliderRef;
  1701. if (!slider) {
  1702. return 0;
  1703. }
  1704. var coords = slider.getBoundingClientRect();
  1705. return this.props.vertical ? coords.height : coords.width;
  1706. }
  1707. }, {
  1708. key: 'addDocumentTouchEvents',
  1709. value: function addDocumentTouchEvents() {
  1710. // just work for Chrome iOS Safari and Android Browser
  1711. this.onTouchMoveListener = Object(__WEBPACK_IMPORTED_MODULE_10_rc_util_es_Dom_addEventListener__["a" /* default */])(this.document, 'touchmove', this.onTouchMove);
  1712. this.onTouchUpListener = Object(__WEBPACK_IMPORTED_MODULE_10_rc_util_es_Dom_addEventListener__["a" /* default */])(this.document, 'touchend', this.onEnd);
  1713. }
  1714. }, {
  1715. key: 'addDocumentMouseEvents',
  1716. value: function addDocumentMouseEvents() {
  1717. this.onMouseMoveListener = Object(__WEBPACK_IMPORTED_MODULE_10_rc_util_es_Dom_addEventListener__["a" /* default */])(this.document, 'mousemove', this.onMouseMove);
  1718. this.onMouseUpListener = Object(__WEBPACK_IMPORTED_MODULE_10_rc_util_es_Dom_addEventListener__["a" /* default */])(this.document, 'mouseup', this.onEnd);
  1719. }
  1720. }, {
  1721. key: 'removeDocumentEvents',
  1722. value: function removeDocumentEvents() {
  1723. /* eslint-disable no-unused-expressions */
  1724. this.onTouchMoveListener && this.onTouchMoveListener.remove();
  1725. this.onTouchUpListener && this.onTouchUpListener.remove();
  1726. this.onMouseMoveListener && this.onMouseMoveListener.remove();
  1727. this.onMouseUpListener && this.onMouseUpListener.remove();
  1728. /* eslint-enable no-unused-expressions */
  1729. }
  1730. }, {
  1731. key: 'focus',
  1732. value: function focus() {
  1733. if (!this.props.disabled) {
  1734. this.handlesRefs[0].focus();
  1735. }
  1736. }
  1737. }, {
  1738. key: 'blur',
  1739. value: function blur() {
  1740. var _this2 = this;
  1741. if (!this.props.disabled) {
  1742. Object.keys(this.handlesRefs).forEach(function (key) {
  1743. if (_this2.handlesRefs[key] && _this2.handlesRefs[key].blur) {
  1744. _this2.handlesRefs[key].blur();
  1745. }
  1746. });
  1747. }
  1748. }
  1749. }, {
  1750. key: 'calcValue',
  1751. value: function calcValue(offset) {
  1752. var _props3 = this.props,
  1753. vertical = _props3.vertical,
  1754. min = _props3.min,
  1755. max = _props3.max;
  1756. var ratio = Math.abs(Math.max(offset, 0) / this.getSliderLength());
  1757. var value = vertical ? (1 - ratio) * (max - min) + min : ratio * (max - min) + min;
  1758. return value;
  1759. }
  1760. }, {
  1761. key: 'calcValueByPos',
  1762. value: function calcValueByPos(position) {
  1763. var sign = this.props.reverse ? -1 : +1;
  1764. var pixelOffset = sign * (position - this.getSliderStart());
  1765. var nextValue = this.trimAlignValue(this.calcValue(pixelOffset));
  1766. return nextValue;
  1767. }
  1768. }, {
  1769. key: 'calcOffset',
  1770. value: function calcOffset(value) {
  1771. var _props4 = this.props,
  1772. min = _props4.min,
  1773. max = _props4.max;
  1774. var ratio = (value - min) / (max - min);
  1775. return ratio * 100;
  1776. }
  1777. }, {
  1778. key: 'saveHandle',
  1779. value: function saveHandle(index, handle) {
  1780. this.handlesRefs[index] = handle;
  1781. }
  1782. }, {
  1783. key: 'render',
  1784. value: function render() {
  1785. var _classNames;
  1786. var _props5 = this.props,
  1787. prefixCls = _props5.prefixCls,
  1788. className = _props5.className,
  1789. marks = _props5.marks,
  1790. dots = _props5.dots,
  1791. step = _props5.step,
  1792. included = _props5.included,
  1793. disabled = _props5.disabled,
  1794. vertical = _props5.vertical,
  1795. reverse = _props5.reverse,
  1796. min = _props5.min,
  1797. max = _props5.max,
  1798. children = _props5.children,
  1799. maximumTrackStyle = _props5.maximumTrackStyle,
  1800. style = _props5.style,
  1801. railStyle = _props5.railStyle,
  1802. dotStyle = _props5.dotStyle,
  1803. activeDotStyle = _props5.activeDotStyle;
  1804. var _get$call = __WEBPACK_IMPORTED_MODULE_6_babel_runtime_helpers_get___default()(ComponentEnhancer.prototype.__proto__ || Object.getPrototypeOf(ComponentEnhancer.prototype), 'render', this).call(this),
  1805. tracks = _get$call.tracks,
  1806. handles = _get$call.handles;
  1807. var sliderClassName = __WEBPACK_IMPORTED_MODULE_11_classnames___default()(prefixCls, (_classNames = {}, __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_defineProperty___default()(_classNames, prefixCls + '-with-marks', Object.keys(marks).length), __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_defineProperty___default()(_classNames, prefixCls + '-disabled', disabled), __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_defineProperty___default()(_classNames, prefixCls + '-vertical', vertical), __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_defineProperty___default()(_classNames, className, className), _classNames));
  1808. return __WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(
  1809. 'div',
  1810. {
  1811. ref: this.saveSlider,
  1812. className: sliderClassName,
  1813. onTouchStart: disabled ? noop : this.onTouchStart,
  1814. onMouseDown: disabled ? noop : this.onMouseDown,
  1815. onMouseUp: disabled ? noop : this.onMouseUp,
  1816. onKeyDown: disabled ? noop : this.onKeyDown,
  1817. onFocus: disabled ? noop : this.onFocus,
  1818. onBlur: disabled ? noop : this.onBlur,
  1819. style: style
  1820. },
  1821. __WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement('div', {
  1822. className: prefixCls + '-rail',
  1823. style: __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default()({}, maximumTrackStyle, railStyle)
  1824. }),
  1825. tracks,
  1826. __WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_13__Steps__["a" /* default */], {
  1827. prefixCls: prefixCls,
  1828. vertical: vertical,
  1829. reverse: reverse,
  1830. marks: marks,
  1831. dots: dots,
  1832. step: step,
  1833. included: included,
  1834. lowerBound: this.getLowerBound(),
  1835. upperBound: this.getUpperBound(),
  1836. max: max,
  1837. min: min,
  1838. dotStyle: dotStyle,
  1839. activeDotStyle: activeDotStyle
  1840. }),
  1841. handles,
  1842. __WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_14__Marks__["a" /* default */], {
  1843. className: prefixCls + '-mark',
  1844. onClickLabel: disabled ? noop : this.onClickMarkLabel,
  1845. vertical: vertical,
  1846. marks: marks,
  1847. included: included,
  1848. lowerBound: this.getLowerBound(),
  1849. upperBound: this.getUpperBound(),
  1850. max: max,
  1851. min: min,
  1852. reverse: reverse
  1853. }),
  1854. children
  1855. );
  1856. }
  1857. }]);
  1858. return ComponentEnhancer;
  1859. }(Component), _class.displayName = 'ComponentEnhancer(' + Component.displayName + ')', _class.propTypes = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default()({}, Component.propTypes, {
  1860. min: __WEBPACK_IMPORTED_MODULE_9_prop_types___default.a.number,
  1861. max: __WEBPACK_IMPORTED_MODULE_9_prop_types___default.a.number,
  1862. step: __WEBPACK_IMPORTED_MODULE_9_prop_types___default.a.number,
  1863. marks: __WEBPACK_IMPORTED_MODULE_9_prop_types___default.a.object,
  1864. included: __WEBPACK_IMPORTED_MODULE_9_prop_types___default.a.bool,
  1865. className: __WEBPACK_IMPORTED_MODULE_9_prop_types___default.a.string,
  1866. prefixCls: __WEBPACK_IMPORTED_MODULE_9_prop_types___default.a.string,
  1867. disabled: __WEBPACK_IMPORTED_MODULE_9_prop_types___default.a.bool,
  1868. children: __WEBPACK_IMPORTED_MODULE_9_prop_types___default.a.any,
  1869. onBeforeChange: __WEBPACK_IMPORTED_MODULE_9_prop_types___default.a.func,
  1870. onChange: __WEBPACK_IMPORTED_MODULE_9_prop_types___default.a.func,
  1871. onAfterChange: __WEBPACK_IMPORTED_MODULE_9_prop_types___default.a.func,
  1872. handle: __WEBPACK_IMPORTED_MODULE_9_prop_types___default.a.func,
  1873. dots: __WEBPACK_IMPORTED_MODULE_9_prop_types___default.a.bool,
  1874. vertical: __WEBPACK_IMPORTED_MODULE_9_prop_types___default.a.bool,
  1875. style: __WEBPACK_IMPORTED_MODULE_9_prop_types___default.a.object,
  1876. reverse: __WEBPACK_IMPORTED_MODULE_9_prop_types___default.a.bool,
  1877. minimumTrackStyle: __WEBPACK_IMPORTED_MODULE_9_prop_types___default.a.object, // just for compatibility, will be deperecate
  1878. maximumTrackStyle: __WEBPACK_IMPORTED_MODULE_9_prop_types___default.a.object, // just for compatibility, will be deperecate
  1879. handleStyle: __WEBPACK_IMPORTED_MODULE_9_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_9_prop_types___default.a.object, __WEBPACK_IMPORTED_MODULE_9_prop_types___default.a.arrayOf(__WEBPACK_IMPORTED_MODULE_9_prop_types___default.a.object)]),
  1880. trackStyle: __WEBPACK_IMPORTED_MODULE_9_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_9_prop_types___default.a.object, __WEBPACK_IMPORTED_MODULE_9_prop_types___default.a.arrayOf(__WEBPACK_IMPORTED_MODULE_9_prop_types___default.a.object)]),
  1881. railStyle: __WEBPACK_IMPORTED_MODULE_9_prop_types___default.a.object,
  1882. dotStyle: __WEBPACK_IMPORTED_MODULE_9_prop_types___default.a.object,
  1883. activeDotStyle: __WEBPACK_IMPORTED_MODULE_9_prop_types___default.a.object,
  1884. autoFocus: __WEBPACK_IMPORTED_MODULE_9_prop_types___default.a.bool,
  1885. onFocus: __WEBPACK_IMPORTED_MODULE_9_prop_types___default.a.func,
  1886. onBlur: __WEBPACK_IMPORTED_MODULE_9_prop_types___default.a.func
  1887. }), _class.defaultProps = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default()({}, Component.defaultProps, {
  1888. prefixCls: 'rc-slider',
  1889. className: '',
  1890. min: 0,
  1891. max: 100,
  1892. step: 1,
  1893. marks: {},
  1894. handle: function handle(_ref) {
  1895. var index = _ref.index,
  1896. restProps = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_objectWithoutProperties___default()(_ref, ['index']);
  1897. delete restProps.dragging;
  1898. if (restProps.value === null) {
  1899. return null;
  1900. }
  1901. return __WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_15__Handle__["a" /* default */], __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default()({}, restProps, { key: index }));
  1902. },
  1903. onBeforeChange: noop,
  1904. onChange: noop,
  1905. onAfterChange: noop,
  1906. included: true,
  1907. disabled: false,
  1908. dots: false,
  1909. vertical: false,
  1910. reverse: false,
  1911. trackStyle: [{}],
  1912. handleStyle: [{}],
  1913. railStyle: {},
  1914. dotStyle: {},
  1915. activeDotStyle: {}
  1916. }), _temp;
  1917. }
  1918. /***/ }),
  1919. /* 66 */
  1920. /***/ (function(module, exports, __webpack_require__) {
  1921. // most Object methods by ES6 should accept primitives
  1922. var $export = __webpack_require__(8);
  1923. var core = __webpack_require__(6);
  1924. var fails = __webpack_require__(20);
  1925. module.exports = function (KEY, exec) {
  1926. var fn = (core.Object || {})[KEY] || Object[KEY];
  1927. var exp = {};
  1928. exp[KEY] = exec(fn);
  1929. $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);
  1930. };
  1931. /***/ }),
  1932. /* 67 */
  1933. /***/ (function(module, exports, __webpack_require__) {
  1934. "use strict";
  1935. exports.__esModule = true;
  1936. var _from = __webpack_require__(131);
  1937. var _from2 = _interopRequireDefault(_from);
  1938. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  1939. exports.default = function (arr) {
  1940. if (Array.isArray(arr)) {
  1941. for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {
  1942. arr2[i] = arr[i];
  1943. }
  1944. return arr2;
  1945. } else {
  1946. return (0, _from2.default)(arr);
  1947. }
  1948. };
  1949. /***/ }),
  1950. /* 68 */
  1951. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1952. "use strict";
  1953. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return polyfill; });
  1954. /**
  1955. * Copyright (c) 2013-present, Facebook, Inc.
  1956. *
  1957. * This source code is licensed under the MIT license found in the
  1958. * LICENSE file in the root directory of this source tree.
  1959. */
  1960. function componentWillMount() {
  1961. // Call this.constructor.gDSFP to support sub-classes.
  1962. var state = this.constructor.getDerivedStateFromProps(this.props, this.state);
  1963. if (state !== null && state !== undefined) {
  1964. this.setState(state);
  1965. }
  1966. }
  1967. function componentWillReceiveProps(nextProps) {
  1968. // Call this.constructor.gDSFP to support sub-classes.
  1969. // Use the setState() updater to ensure state isn't stale in certain edge cases.
  1970. function updater(prevState) {
  1971. var state = this.constructor.getDerivedStateFromProps(nextProps, prevState);
  1972. return state !== null && state !== undefined ? state : null;
  1973. }
  1974. // Binding "this" is important for shallow renderer support.
  1975. this.setState(updater.bind(this));
  1976. }
  1977. function componentWillUpdate(nextProps, nextState) {
  1978. try {
  1979. var prevProps = this.props;
  1980. var prevState = this.state;
  1981. this.props = nextProps;
  1982. this.state = nextState;
  1983. this.__reactInternalSnapshotFlag = true;
  1984. this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate(
  1985. prevProps,
  1986. prevState
  1987. );
  1988. } finally {
  1989. this.props = prevProps;
  1990. this.state = prevState;
  1991. }
  1992. }
  1993. // React may warn about cWM/cWRP/cWU methods being deprecated.
  1994. // Add a flag to suppress these warnings for this special case.
  1995. componentWillMount.__suppressDeprecationWarning = true;
  1996. componentWillReceiveProps.__suppressDeprecationWarning = true;
  1997. componentWillUpdate.__suppressDeprecationWarning = true;
  1998. function polyfill(Component) {
  1999. var prototype = Component.prototype;
  2000. if (!prototype || !prototype.isReactComponent) {
  2001. throw new Error('Can only polyfill class components');
  2002. }
  2003. if (
  2004. typeof Component.getDerivedStateFromProps !== 'function' &&
  2005. typeof prototype.getSnapshotBeforeUpdate !== 'function'
  2006. ) {
  2007. return Component;
  2008. }
  2009. // If new component APIs are defined, "unsafe" lifecycles won't be called.
  2010. // Error if any of these lifecycles are present,
  2011. // Because they would work differently between older and newer (16.3+) versions of React.
  2012. var foundWillMountName = null;
  2013. var foundWillReceivePropsName = null;
  2014. var foundWillUpdateName = null;
  2015. if (typeof prototype.componentWillMount === 'function') {
  2016. foundWillMountName = 'componentWillMount';
  2017. } else if (typeof prototype.UNSAFE_componentWillMount === 'function') {
  2018. foundWillMountName = 'UNSAFE_componentWillMount';
  2019. }
  2020. if (typeof prototype.componentWillReceiveProps === 'function') {
  2021. foundWillReceivePropsName = 'componentWillReceiveProps';
  2022. } else if (typeof prototype.UNSAFE_componentWillReceiveProps === 'function') {
  2023. foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';
  2024. }
  2025. if (typeof prototype.componentWillUpdate === 'function') {
  2026. foundWillUpdateName = 'componentWillUpdate';
  2027. } else if (typeof prototype.UNSAFE_componentWillUpdate === 'function') {
  2028. foundWillUpdateName = 'UNSAFE_componentWillUpdate';
  2029. }
  2030. if (
  2031. foundWillMountName !== null ||
  2032. foundWillReceivePropsName !== null ||
  2033. foundWillUpdateName !== null
  2034. ) {
  2035. var componentName = Component.displayName || Component.name;
  2036. var newApiName =
  2037. typeof Component.getDerivedStateFromProps === 'function'
  2038. ? 'getDerivedStateFromProps()'
  2039. : 'getSnapshotBeforeUpdate()';
  2040. throw Error(
  2041. 'Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n' +
  2042. componentName +
  2043. ' uses ' +
  2044. newApiName +
  2045. ' but also contains the following legacy lifecycles:' +
  2046. (foundWillMountName !== null ? '\n ' + foundWillMountName : '') +
  2047. (foundWillReceivePropsName !== null
  2048. ? '\n ' + foundWillReceivePropsName
  2049. : '') +
  2050. (foundWillUpdateName !== null ? '\n ' + foundWillUpdateName : '') +
  2051. '\n\nThe above lifecycles should be removed. Learn more about this warning here:\n' +
  2052. 'https://fb.me/react-async-component-lifecycle-hooks'
  2053. );
  2054. }
  2055. // React <= 16.2 does not support static getDerivedStateFromProps.
  2056. // As a workaround, use cWM and cWRP to invoke the new static lifecycle.
  2057. // Newer versions of React will ignore these lifecycles if gDSFP exists.
  2058. if (typeof Component.getDerivedStateFromProps === 'function') {
  2059. prototype.componentWillMount = componentWillMount;
  2060. prototype.componentWillReceiveProps = componentWillReceiveProps;
  2061. }
  2062. // React <= 16.2 does not support getSnapshotBeforeUpdate.
  2063. // As a workaround, use cWU to invoke the new lifecycle.
  2064. // Newer versions of React will ignore that lifecycle if gSBU exists.
  2065. if (typeof prototype.getSnapshotBeforeUpdate === 'function') {
  2066. if (typeof prototype.componentDidUpdate !== 'function') {
  2067. throw new Error(
  2068. 'Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype'
  2069. );
  2070. }
  2071. prototype.componentWillUpdate = componentWillUpdate;
  2072. var componentDidUpdate = prototype.componentDidUpdate;
  2073. prototype.componentDidUpdate = function componentDidUpdatePolyfill(
  2074. prevProps,
  2075. prevState,
  2076. maybeSnapshot
  2077. ) {
  2078. // 16.3+ will not execute our will-update method;
  2079. // It will pass a snapshot value to did-update though.
  2080. // Older versions will require our polyfilled will-update value.
  2081. // We need to handle both cases, but can't just check for the presence of "maybeSnapshot",
  2082. // Because for <= 15.x versions this might be a "prevContext" object.
  2083. // We also can't just check "__reactInternalSnapshot",
  2084. // Because get-snapshot might return a falsy value.
  2085. // So check for the explicit __reactInternalSnapshotFlag flag to determine behavior.
  2086. var snapshot = this.__reactInternalSnapshotFlag
  2087. ? this.__reactInternalSnapshot
  2088. : maybeSnapshot;
  2089. componentDidUpdate.call(this, prevProps, prevState, snapshot);
  2090. };
  2091. }
  2092. return Component;
  2093. }
  2094. /***/ }),
  2095. /* 69 */
  2096. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2097. "use strict";
  2098. /* harmony export (immutable) */ __webpack_exports__["a"] = contains;
  2099. function contains(root, n) {
  2100. var node = n;
  2101. while (node) {
  2102. if (node === root) {
  2103. return true;
  2104. }
  2105. node = node.parentNode;
  2106. }
  2107. return false;
  2108. }
  2109. /***/ }),
  2110. /* 70 */
  2111. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2112. "use strict";
  2113. /* harmony export (immutable) */ __webpack_exports__["a"] = getAlignFromPlacement;
  2114. /* harmony export (immutable) */ __webpack_exports__["b"] = getAlignPopupClassName;
  2115. /* harmony export (immutable) */ __webpack_exports__["c"] = saveRef;
  2116. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(5);
  2117. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__);
  2118. function isPointsEq(a1, a2, isAlignPoint) {
  2119. if (isAlignPoint) {
  2120. return a1[0] === a2[0];
  2121. }
  2122. return a1[0] === a2[0] && a1[1] === a2[1];
  2123. }
  2124. function getAlignFromPlacement(builtinPlacements, placementStr, align) {
  2125. var baseAlign = builtinPlacements[placementStr] || {};
  2126. return __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, baseAlign, align);
  2127. }
  2128. function getAlignPopupClassName(builtinPlacements, prefixCls, align, isAlignPoint) {
  2129. var points = align.points;
  2130. for (var placement in builtinPlacements) {
  2131. if (builtinPlacements.hasOwnProperty(placement)) {
  2132. if (isPointsEq(builtinPlacements[placement].points, points, isAlignPoint)) {
  2133. return prefixCls + '-placement-' + placement;
  2134. }
  2135. }
  2136. }
  2137. return '';
  2138. }
  2139. function saveRef(name, component) {
  2140. this[name] = component;
  2141. }
  2142. /***/ }),
  2143. /* 71 */
  2144. /***/ (function(module, exports) {
  2145. module.exports = function(arr, obj){
  2146. if (arr.indexOf) return arr.indexOf(obj);
  2147. for (var i = 0; i < arr.length; ++i) {
  2148. if (arr[i] === obj) return i;
  2149. }
  2150. return -1;
  2151. };
  2152. /***/ }),
  2153. /* 72 */
  2154. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2155. "use strict";
  2156. var util = {
  2157. isAppearSupported: function isAppearSupported(props) {
  2158. return props.transitionName && props.transitionAppear || props.animation.appear;
  2159. },
  2160. isEnterSupported: function isEnterSupported(props) {
  2161. return props.transitionName && props.transitionEnter || props.animation.enter;
  2162. },
  2163. isLeaveSupported: function isLeaveSupported(props) {
  2164. return props.transitionName && props.transitionLeave || props.animation.leave;
  2165. },
  2166. allowAppearCallback: function allowAppearCallback(props) {
  2167. return props.transitionAppear || props.animation.appear;
  2168. },
  2169. allowEnterCallback: function allowEnterCallback(props) {
  2170. return props.transitionEnter || props.animation.enter;
  2171. },
  2172. allowLeaveCallback: function allowLeaveCallback(props) {
  2173. return props.transitionLeave || props.animation.leave;
  2174. }
  2175. };
  2176. /* harmony default export */ __webpack_exports__["a"] = (util);
  2177. /***/ }),
  2178. /* 73 */
  2179. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2180. "use strict";
  2181. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_objectWithoutProperties__ = __webpack_require__(26);
  2182. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_objectWithoutProperties___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_objectWithoutProperties__);
  2183. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck__ = __webpack_require__(2);
  2184. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck__);
  2185. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(3);
  2186. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn__);
  2187. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits__ = __webpack_require__(4);
  2188. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits__);
  2189. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_react__ = __webpack_require__(0);
  2190. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_react__);
  2191. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_prop_types__ = __webpack_require__(1);
  2192. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_prop_types__);
  2193. var LazyRenderBox = function (_Component) {
  2194. __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits___default()(LazyRenderBox, _Component);
  2195. function LazyRenderBox() {
  2196. __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck___default()(this, LazyRenderBox);
  2197. return __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn___default()(this, _Component.apply(this, arguments));
  2198. }
  2199. LazyRenderBox.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {
  2200. return nextProps.hiddenClassName || nextProps.visible;
  2201. };
  2202. LazyRenderBox.prototype.render = function render() {
  2203. var _props = this.props,
  2204. hiddenClassName = _props.hiddenClassName,
  2205. visible = _props.visible,
  2206. props = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_objectWithoutProperties___default()(_props, ['hiddenClassName', 'visible']);
  2207. if (hiddenClassName || __WEBPACK_IMPORTED_MODULE_4_react___default.a.Children.count(props.children) > 1) {
  2208. if (!visible && hiddenClassName) {
  2209. props.className += ' ' + hiddenClassName;
  2210. }
  2211. return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('div', props);
  2212. }
  2213. return __WEBPACK_IMPORTED_MODULE_4_react___default.a.Children.only(props.children);
  2214. };
  2215. return LazyRenderBox;
  2216. }(__WEBPACK_IMPORTED_MODULE_4_react__["Component"]);
  2217. LazyRenderBox.propTypes = {
  2218. children: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.any,
  2219. className: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string,
  2220. visible: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.bool,
  2221. hiddenClassName: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string
  2222. };
  2223. /* harmony default export */ __webpack_exports__["a"] = (LazyRenderBox);
  2224. /***/ }),
  2225. /* 74 */
  2226. /***/ (function(module, exports, __webpack_require__) {
  2227. __webpack_require__(75);
  2228. module.exports = __webpack_require__(76);
  2229. /***/ }),
  2230. /* 75 */
  2231. /***/ (function(module, exports) {
  2232. // removed by extract-text-webpack-plugin
  2233. /***/ }),
  2234. /* 76 */
  2235. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2236. "use strict";
  2237. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  2238. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Slider__ = __webpack_require__(77);
  2239. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Range__ = __webpack_require__(141);
  2240. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Handle__ = __webpack_require__(49);
  2241. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__createSliderWithTooltip__ = __webpack_require__(143);
  2242. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Range", function() { return __WEBPACK_IMPORTED_MODULE_1__Range__["a"]; });
  2243. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Handle", function() { return __WEBPACK_IMPORTED_MODULE_2__Handle__["a"]; });
  2244. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "createSliderWithTooltip", function() { return __WEBPACK_IMPORTED_MODULE_3__createSliderWithTooltip__["a"]; });
  2245. __WEBPACK_IMPORTED_MODULE_0__Slider__["a" /* default */].Range = __WEBPACK_IMPORTED_MODULE_1__Range__["a" /* default */];
  2246. __WEBPACK_IMPORTED_MODULE_0__Slider__["a" /* default */].Handle = __WEBPACK_IMPORTED_MODULE_2__Handle__["a" /* default */];
  2247. __WEBPACK_IMPORTED_MODULE_0__Slider__["a" /* default */].createSliderWithTooltip = __WEBPACK_IMPORTED_MODULE_3__createSliderWithTooltip__["a" /* default */];
  2248. /* harmony default export */ __webpack_exports__["default"] = (__WEBPACK_IMPORTED_MODULE_0__Slider__["a" /* default */]);
  2249. /***/ }),
  2250. /* 77 */
  2251. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2252. "use strict";
  2253. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(5);
  2254. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__);
  2255. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck__ = __webpack_require__(2);
  2256. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck__);
  2257. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_createClass__ = __webpack_require__(12);
  2258. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_createClass___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_createClass__);
  2259. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(3);
  2260. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__);
  2261. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__ = __webpack_require__(4);
  2262. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__);
  2263. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react__ = __webpack_require__(0);
  2264. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_react__);
  2265. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_prop_types__ = __webpack_require__(1);
  2266. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_prop_types__);
  2267. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_warning__ = __webpack_require__(48);
  2268. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_warning___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_warning__);
  2269. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__common_Track__ = __webpack_require__(64);
  2270. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__common_createSlider__ = __webpack_require__(65);
  2271. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__utils__ = __webpack_require__(50);
  2272. /* eslint-disable react/prop-types */
  2273. var Slider = function (_React$Component) {
  2274. __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default()(Slider, _React$Component);
  2275. function Slider(props) {
  2276. __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck___default()(this, Slider);
  2277. var _this = __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default()(this, (Slider.__proto__ || Object.getPrototypeOf(Slider)).call(this, props));
  2278. _this.onEnd = function (force) {
  2279. var dragging = _this.state.dragging;
  2280. _this.removeDocumentEvents();
  2281. if (dragging || force) {
  2282. _this.props.onAfterChange(_this.getValue());
  2283. }
  2284. _this.setState({ dragging: false });
  2285. };
  2286. var defaultValue = props.defaultValue !== undefined ? props.defaultValue : props.min;
  2287. var value = props.value !== undefined ? props.value : defaultValue;
  2288. _this.state = {
  2289. value: _this.trimAlignValue(value),
  2290. dragging: false
  2291. };
  2292. __WEBPACK_IMPORTED_MODULE_7_warning___default()(!('minimumTrackStyle' in props), 'minimumTrackStyle will be deprecated, please use trackStyle instead.');
  2293. __WEBPACK_IMPORTED_MODULE_7_warning___default()(!('maximumTrackStyle' in props), 'maximumTrackStyle will be deprecated, please use railStyle instead.');
  2294. return _this;
  2295. }
  2296. __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_createClass___default()(Slider, [{
  2297. key: 'componentDidUpdate',
  2298. value: function componentDidUpdate(prevProps, prevState) {
  2299. if (!('value' in this.props || 'min' in this.props || 'max' in this.props)) {
  2300. return;
  2301. }
  2302. var _props = this.props,
  2303. value = _props.value,
  2304. onChange = _props.onChange;
  2305. var theValue = value !== undefined ? value : prevState.value;
  2306. var nextValue = this.trimAlignValue(theValue, this.props);
  2307. if (nextValue !== prevState.value) {
  2308. // eslint-disable-next-line
  2309. this.setState({ value: nextValue });
  2310. if (__WEBPACK_IMPORTED_MODULE_10__utils__["i" /* isValueOutOfRange */](theValue, this.props)) {
  2311. onChange(nextValue);
  2312. }
  2313. }
  2314. }
  2315. }, {
  2316. key: 'onChange',
  2317. value: function onChange(state) {
  2318. var props = this.props;
  2319. var isNotControlled = !('value' in props);
  2320. var nextState = state.value > this.props.max ? __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, state, { value: this.props.max }) : state;
  2321. if (isNotControlled) {
  2322. this.setState(nextState);
  2323. }
  2324. var changedValue = nextState.value;
  2325. props.onChange(changedValue);
  2326. }
  2327. }, {
  2328. key: 'onStart',
  2329. value: function onStart(position) {
  2330. this.setState({ dragging: true });
  2331. var props = this.props;
  2332. var prevValue = this.getValue();
  2333. props.onBeforeChange(prevValue);
  2334. var value = this.calcValueByPos(position);
  2335. this.startValue = value;
  2336. this.startPosition = position;
  2337. if (value === prevValue) return;
  2338. this.prevMovedHandleIndex = 0;
  2339. this.onChange({ value: value });
  2340. }
  2341. }, {
  2342. key: 'onMove',
  2343. value: function onMove(e, position) {
  2344. __WEBPACK_IMPORTED_MODULE_10__utils__["j" /* pauseEvent */](e);
  2345. var oldValue = this.state.value;
  2346. var value = this.calcValueByPos(position);
  2347. if (value === oldValue) return;
  2348. this.onChange({ value: value });
  2349. }
  2350. }, {
  2351. key: 'onKeyboard',
  2352. value: function onKeyboard(e) {
  2353. var _props2 = this.props,
  2354. reverse = _props2.reverse,
  2355. vertical = _props2.vertical;
  2356. var valueMutator = __WEBPACK_IMPORTED_MODULE_10__utils__["d" /* getKeyboardValueMutator */](e, vertical, reverse);
  2357. if (valueMutator) {
  2358. __WEBPACK_IMPORTED_MODULE_10__utils__["j" /* pauseEvent */](e);
  2359. var state = this.state;
  2360. var oldValue = state.value;
  2361. var mutatedValue = valueMutator(oldValue, this.props);
  2362. var value = this.trimAlignValue(mutatedValue);
  2363. if (value === oldValue) return;
  2364. this.onChange({ value: value });
  2365. this.props.onAfterChange(value);
  2366. this.onEnd();
  2367. }
  2368. }
  2369. }, {
  2370. key: 'getValue',
  2371. value: function getValue() {
  2372. return this.state.value;
  2373. }
  2374. }, {
  2375. key: 'getLowerBound',
  2376. value: function getLowerBound() {
  2377. return this.props.min;
  2378. }
  2379. }, {
  2380. key: 'getUpperBound',
  2381. value: function getUpperBound() {
  2382. return this.state.value;
  2383. }
  2384. }, {
  2385. key: 'trimAlignValue',
  2386. value: function trimAlignValue(v) {
  2387. var nextProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  2388. if (v === null) {
  2389. return null;
  2390. }
  2391. var mergedProps = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, this.props, nextProps);
  2392. var val = __WEBPACK_IMPORTED_MODULE_10__utils__["a" /* ensureValueInRange */](v, mergedProps);
  2393. return __WEBPACK_IMPORTED_MODULE_10__utils__["b" /* ensureValuePrecision */](val, mergedProps);
  2394. }
  2395. }, {
  2396. key: 'render',
  2397. value: function render() {
  2398. var _this2 = this;
  2399. var _props3 = this.props,
  2400. prefixCls = _props3.prefixCls,
  2401. vertical = _props3.vertical,
  2402. included = _props3.included,
  2403. disabled = _props3.disabled,
  2404. minimumTrackStyle = _props3.minimumTrackStyle,
  2405. trackStyle = _props3.trackStyle,
  2406. handleStyle = _props3.handleStyle,
  2407. tabIndex = _props3.tabIndex,
  2408. min = _props3.min,
  2409. max = _props3.max,
  2410. reverse = _props3.reverse,
  2411. handleGenerator = _props3.handle;
  2412. var _state = this.state,
  2413. value = _state.value,
  2414. dragging = _state.dragging;
  2415. var offset = this.calcOffset(value);
  2416. var handle = handleGenerator({
  2417. className: prefixCls + '-handle',
  2418. prefixCls: prefixCls,
  2419. vertical: vertical,
  2420. offset: offset,
  2421. value: value,
  2422. dragging: dragging,
  2423. disabled: disabled,
  2424. min: min,
  2425. max: max,
  2426. reverse: reverse,
  2427. index: 0,
  2428. tabIndex: tabIndex,
  2429. style: handleStyle[0] || handleStyle,
  2430. ref: function ref(h) {
  2431. return _this2.saveHandle(0, h);
  2432. }
  2433. });
  2434. var _trackStyle = trackStyle[0] || trackStyle;
  2435. var track = __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_8__common_Track__["a" /* default */], {
  2436. className: prefixCls + '-track',
  2437. vertical: vertical,
  2438. included: included,
  2439. offset: 0,
  2440. reverse: reverse,
  2441. length: offset,
  2442. style: __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, minimumTrackStyle, _trackStyle)
  2443. });
  2444. return { tracks: track, handles: handle };
  2445. }
  2446. }]);
  2447. return Slider;
  2448. }(__WEBPACK_IMPORTED_MODULE_5_react___default.a.Component);
  2449. Slider.propTypes = {
  2450. defaultValue: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.number,
  2451. value: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.number,
  2452. disabled: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool,
  2453. autoFocus: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool,
  2454. tabIndex: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.number,
  2455. reverse: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool,
  2456. min: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.number,
  2457. max: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.number
  2458. };
  2459. /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_9__common_createSlider__["a" /* default */])(Slider));
  2460. /***/ }),
  2461. /* 78 */
  2462. /***/ (function(module, exports, __webpack_require__) {
  2463. module.exports = { "default": __webpack_require__(79), __esModule: true };
  2464. /***/ }),
  2465. /* 79 */
  2466. /***/ (function(module, exports, __webpack_require__) {
  2467. __webpack_require__(80);
  2468. module.exports = __webpack_require__(6).Object.assign;
  2469. /***/ }),
  2470. /* 80 */
  2471. /***/ (function(module, exports, __webpack_require__) {
  2472. // 19.1.3.1 Object.assign(target, source)
  2473. var $export = __webpack_require__(8);
  2474. $export($export.S + $export.F, 'Object', { assign: __webpack_require__(82) });
  2475. /***/ }),
  2476. /* 81 */
  2477. /***/ (function(module, exports) {
  2478. module.exports = function (it) {
  2479. if (typeof it != 'function') throw TypeError(it + ' is not a function!');
  2480. return it;
  2481. };
  2482. /***/ }),
  2483. /* 82 */
  2484. /***/ (function(module, exports, __webpack_require__) {
  2485. "use strict";
  2486. // 19.1.2.1 Object.assign(target, source, ...)
  2487. var DESCRIPTORS = __webpack_require__(11);
  2488. var getKeys = __webpack_require__(27);
  2489. var gOPS = __webpack_require__(40);
  2490. var pIE = __webpack_require__(30);
  2491. var toObject = __webpack_require__(24);
  2492. var IObject = __webpack_require__(54);
  2493. var $assign = Object.assign;
  2494. // should work with symbols and should have deterministic property order (V8 bug)
  2495. module.exports = !$assign || __webpack_require__(20)(function () {
  2496. var A = {};
  2497. var B = {};
  2498. // eslint-disable-next-line no-undef
  2499. var S = Symbol();
  2500. var K = 'abcdefghijklmnopqrst';
  2501. A[S] = 7;
  2502. K.split('').forEach(function (k) { B[k] = k; });
  2503. return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
  2504. }) ? function assign(target, source) { // eslint-disable-line no-unused-vars
  2505. var T = toObject(target);
  2506. var aLen = arguments.length;
  2507. var index = 1;
  2508. var getSymbols = gOPS.f;
  2509. var isEnum = pIE.f;
  2510. while (aLen > index) {
  2511. var S = IObject(arguments[index++]);
  2512. var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);
  2513. var length = keys.length;
  2514. var j = 0;
  2515. var key;
  2516. while (length > j) {
  2517. key = keys[j++];
  2518. if (!DESCRIPTORS || isEnum.call(S, key)) T[key] = S[key];
  2519. }
  2520. } return T;
  2521. } : $assign;
  2522. /***/ }),
  2523. /* 83 */
  2524. /***/ (function(module, exports, __webpack_require__) {
  2525. // false -> Array#indexOf
  2526. // true -> Array#includes
  2527. var toIObject = __webpack_require__(16);
  2528. var toLength = __webpack_require__(55);
  2529. var toAbsoluteIndex = __webpack_require__(84);
  2530. module.exports = function (IS_INCLUDES) {
  2531. return function ($this, el, fromIndex) {
  2532. var O = toIObject($this);
  2533. var length = toLength(O.length);
  2534. var index = toAbsoluteIndex(fromIndex, length);
  2535. var value;
  2536. // Array#includes uses SameValueZero equality algorithm
  2537. // eslint-disable-next-line no-self-compare
  2538. if (IS_INCLUDES && el != el) while (length > index) {
  2539. value = O[index++];
  2540. // eslint-disable-next-line no-self-compare
  2541. if (value != value) return true;
  2542. // Array#indexOf ignores holes, Array#includes - not
  2543. } else for (;length > index; index++) if (IS_INCLUDES || index in O) {
  2544. if (O[index] === el) return IS_INCLUDES || index || 0;
  2545. } return !IS_INCLUDES && -1;
  2546. };
  2547. };
  2548. /***/ }),
  2549. /* 84 */
  2550. /***/ (function(module, exports, __webpack_require__) {
  2551. var toInteger = __webpack_require__(36);
  2552. var max = Math.max;
  2553. var min = Math.min;
  2554. module.exports = function (index, length) {
  2555. index = toInteger(index);
  2556. return index < 0 ? max(index + length, 0) : min(index, length);
  2557. };
  2558. /***/ }),
  2559. /* 85 */
  2560. /***/ (function(module, exports, __webpack_require__) {
  2561. __webpack_require__(86);
  2562. var $Object = __webpack_require__(6).Object;
  2563. module.exports = function defineProperty(it, key, desc) {
  2564. return $Object.defineProperty(it, key, desc);
  2565. };
  2566. /***/ }),
  2567. /* 86 */
  2568. /***/ (function(module, exports, __webpack_require__) {
  2569. var $export = __webpack_require__(8);
  2570. // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)
  2571. $export($export.S + $export.F * !__webpack_require__(11), 'Object', { defineProperty: __webpack_require__(10).f });
  2572. /***/ }),
  2573. /* 87 */
  2574. /***/ (function(module, exports, __webpack_require__) {
  2575. module.exports = { "default": __webpack_require__(88), __esModule: true };
  2576. /***/ }),
  2577. /* 88 */
  2578. /***/ (function(module, exports, __webpack_require__) {
  2579. __webpack_require__(57);
  2580. __webpack_require__(93);
  2581. module.exports = __webpack_require__(44).f('iterator');
  2582. /***/ }),
  2583. /* 89 */
  2584. /***/ (function(module, exports, __webpack_require__) {
  2585. var toInteger = __webpack_require__(36);
  2586. var defined = __webpack_require__(35);
  2587. // true -> String#at
  2588. // false -> String#codePointAt
  2589. module.exports = function (TO_STRING) {
  2590. return function (that, pos) {
  2591. var s = String(defined(that));
  2592. var i = toInteger(pos);
  2593. var l = s.length;
  2594. var a, b;
  2595. if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
  2596. a = s.charCodeAt(i);
  2597. return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
  2598. ? TO_STRING ? s.charAt(i) : a
  2599. : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
  2600. };
  2601. };
  2602. /***/ }),
  2603. /* 90 */
  2604. /***/ (function(module, exports, __webpack_require__) {
  2605. "use strict";
  2606. var create = __webpack_require__(42);
  2607. var descriptor = __webpack_require__(23);
  2608. var setToStringTag = __webpack_require__(43);
  2609. var IteratorPrototype = {};
  2610. // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
  2611. __webpack_require__(17)(IteratorPrototype, __webpack_require__(7)('iterator'), function () { return this; });
  2612. module.exports = function (Constructor, NAME, next) {
  2613. Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });
  2614. setToStringTag(Constructor, NAME + ' Iterator');
  2615. };
  2616. /***/ }),
  2617. /* 91 */
  2618. /***/ (function(module, exports, __webpack_require__) {
  2619. var dP = __webpack_require__(10);
  2620. var anObject = __webpack_require__(18);
  2621. var getKeys = __webpack_require__(27);
  2622. module.exports = __webpack_require__(11) ? Object.defineProperties : function defineProperties(O, Properties) {
  2623. anObject(O);
  2624. var keys = getKeys(Properties);
  2625. var length = keys.length;
  2626. var i = 0;
  2627. var P;
  2628. while (length > i) dP.f(O, P = keys[i++], Properties[P]);
  2629. return O;
  2630. };
  2631. /***/ }),
  2632. /* 92 */
  2633. /***/ (function(module, exports, __webpack_require__) {
  2634. var document = __webpack_require__(9).document;
  2635. module.exports = document && document.documentElement;
  2636. /***/ }),
  2637. /* 93 */
  2638. /***/ (function(module, exports, __webpack_require__) {
  2639. __webpack_require__(94);
  2640. var global = __webpack_require__(9);
  2641. var hide = __webpack_require__(17);
  2642. var Iterators = __webpack_require__(25);
  2643. var TO_STRING_TAG = __webpack_require__(7)('toStringTag');
  2644. var DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' +
  2645. 'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' +
  2646. 'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' +
  2647. 'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' +
  2648. 'TextTrackList,TouchList').split(',');
  2649. for (var i = 0; i < DOMIterables.length; i++) {
  2650. var NAME = DOMIterables[i];
  2651. var Collection = global[NAME];
  2652. var proto = Collection && Collection.prototype;
  2653. if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);
  2654. Iterators[NAME] = Iterators.Array;
  2655. }
  2656. /***/ }),
  2657. /* 94 */
  2658. /***/ (function(module, exports, __webpack_require__) {
  2659. "use strict";
  2660. var addToUnscopables = __webpack_require__(95);
  2661. var step = __webpack_require__(96);
  2662. var Iterators = __webpack_require__(25);
  2663. var toIObject = __webpack_require__(16);
  2664. // 22.1.3.4 Array.prototype.entries()
  2665. // 22.1.3.13 Array.prototype.keys()
  2666. // 22.1.3.29 Array.prototype.values()
  2667. // 22.1.3.30 Array.prototype[@@iterator]()
  2668. module.exports = __webpack_require__(58)(Array, 'Array', function (iterated, kind) {
  2669. this._t = toIObject(iterated); // target
  2670. this._i = 0; // next index
  2671. this._k = kind; // kind
  2672. // 22.1.5.2.1 %ArrayIteratorPrototype%.next()
  2673. }, function () {
  2674. var O = this._t;
  2675. var kind = this._k;
  2676. var index = this._i++;
  2677. if (!O || index >= O.length) {
  2678. this._t = undefined;
  2679. return step(1);
  2680. }
  2681. if (kind == 'keys') return step(0, index);
  2682. if (kind == 'values') return step(0, O[index]);
  2683. return step(0, [index, O[index]]);
  2684. }, 'values');
  2685. // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
  2686. Iterators.Arguments = Iterators.Array;
  2687. addToUnscopables('keys');
  2688. addToUnscopables('values');
  2689. addToUnscopables('entries');
  2690. /***/ }),
  2691. /* 95 */
  2692. /***/ (function(module, exports) {
  2693. module.exports = function () { /* empty */ };
  2694. /***/ }),
  2695. /* 96 */
  2696. /***/ (function(module, exports) {
  2697. module.exports = function (done, value) {
  2698. return { value: value, done: !!done };
  2699. };
  2700. /***/ }),
  2701. /* 97 */
  2702. /***/ (function(module, exports, __webpack_require__) {
  2703. module.exports = { "default": __webpack_require__(98), __esModule: true };
  2704. /***/ }),
  2705. /* 98 */
  2706. /***/ (function(module, exports, __webpack_require__) {
  2707. __webpack_require__(99);
  2708. __webpack_require__(104);
  2709. __webpack_require__(105);
  2710. __webpack_require__(106);
  2711. module.exports = __webpack_require__(6).Symbol;
  2712. /***/ }),
  2713. /* 99 */
  2714. /***/ (function(module, exports, __webpack_require__) {
  2715. "use strict";
  2716. // ECMAScript 6 symbols shim
  2717. var global = __webpack_require__(9);
  2718. var has = __webpack_require__(15);
  2719. var DESCRIPTORS = __webpack_require__(11);
  2720. var $export = __webpack_require__(8);
  2721. var redefine = __webpack_require__(59);
  2722. var META = __webpack_require__(100).KEY;
  2723. var $fails = __webpack_require__(20);
  2724. var shared = __webpack_require__(38);
  2725. var setToStringTag = __webpack_require__(43);
  2726. var uid = __webpack_require__(29);
  2727. var wks = __webpack_require__(7);
  2728. var wksExt = __webpack_require__(44);
  2729. var wksDefine = __webpack_require__(45);
  2730. var enumKeys = __webpack_require__(101);
  2731. var isArray = __webpack_require__(102);
  2732. var anObject = __webpack_require__(18);
  2733. var isObject = __webpack_require__(19);
  2734. var toObject = __webpack_require__(24);
  2735. var toIObject = __webpack_require__(16);
  2736. var toPrimitive = __webpack_require__(33);
  2737. var createDesc = __webpack_require__(23);
  2738. var _create = __webpack_require__(42);
  2739. var gOPNExt = __webpack_require__(103);
  2740. var $GOPD = __webpack_require__(46);
  2741. var $GOPS = __webpack_require__(40);
  2742. var $DP = __webpack_require__(10);
  2743. var $keys = __webpack_require__(27);
  2744. var gOPD = $GOPD.f;
  2745. var dP = $DP.f;
  2746. var gOPN = gOPNExt.f;
  2747. var $Symbol = global.Symbol;
  2748. var $JSON = global.JSON;
  2749. var _stringify = $JSON && $JSON.stringify;
  2750. var PROTOTYPE = 'prototype';
  2751. var HIDDEN = wks('_hidden');
  2752. var TO_PRIMITIVE = wks('toPrimitive');
  2753. var isEnum = {}.propertyIsEnumerable;
  2754. var SymbolRegistry = shared('symbol-registry');
  2755. var AllSymbols = shared('symbols');
  2756. var OPSymbols = shared('op-symbols');
  2757. var ObjectProto = Object[PROTOTYPE];
  2758. var USE_NATIVE = typeof $Symbol == 'function' && !!$GOPS.f;
  2759. var QObject = global.QObject;
  2760. // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
  2761. var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
  2762. // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
  2763. var setSymbolDesc = DESCRIPTORS && $fails(function () {
  2764. return _create(dP({}, 'a', {
  2765. get: function () { return dP(this, 'a', { value: 7 }).a; }
  2766. })).a != 7;
  2767. }) ? function (it, key, D) {
  2768. var protoDesc = gOPD(ObjectProto, key);
  2769. if (protoDesc) delete ObjectProto[key];
  2770. dP(it, key, D);
  2771. if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);
  2772. } : dP;
  2773. var wrap = function (tag) {
  2774. var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);
  2775. sym._k = tag;
  2776. return sym;
  2777. };
  2778. var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {
  2779. return typeof it == 'symbol';
  2780. } : function (it) {
  2781. return it instanceof $Symbol;
  2782. };
  2783. var $defineProperty = function defineProperty(it, key, D) {
  2784. if (it === ObjectProto) $defineProperty(OPSymbols, key, D);
  2785. anObject(it);
  2786. key = toPrimitive(key, true);
  2787. anObject(D);
  2788. if (has(AllSymbols, key)) {
  2789. if (!D.enumerable) {
  2790. if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));
  2791. it[HIDDEN][key] = true;
  2792. } else {
  2793. if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;
  2794. D = _create(D, { enumerable: createDesc(0, false) });
  2795. } return setSymbolDesc(it, key, D);
  2796. } return dP(it, key, D);
  2797. };
  2798. var $defineProperties = function defineProperties(it, P) {
  2799. anObject(it);
  2800. var keys = enumKeys(P = toIObject(P));
  2801. var i = 0;
  2802. var l = keys.length;
  2803. var key;
  2804. while (l > i) $defineProperty(it, key = keys[i++], P[key]);
  2805. return it;
  2806. };
  2807. var $create = function create(it, P) {
  2808. return P === undefined ? _create(it) : $defineProperties(_create(it), P);
  2809. };
  2810. var $propertyIsEnumerable = function propertyIsEnumerable(key) {
  2811. var E = isEnum.call(this, key = toPrimitive(key, true));
  2812. if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;
  2813. return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
  2814. };
  2815. var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {
  2816. it = toIObject(it);
  2817. key = toPrimitive(key, true);
  2818. if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;
  2819. var D = gOPD(it, key);
  2820. if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;
  2821. return D;
  2822. };
  2823. var $getOwnPropertyNames = function getOwnPropertyNames(it) {
  2824. var names = gOPN(toIObject(it));
  2825. var result = [];
  2826. var i = 0;
  2827. var key;
  2828. while (names.length > i) {
  2829. if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);
  2830. } return result;
  2831. };
  2832. var $getOwnPropertySymbols = function getOwnPropertySymbols(it) {
  2833. var IS_OP = it === ObjectProto;
  2834. var names = gOPN(IS_OP ? OPSymbols : toIObject(it));
  2835. var result = [];
  2836. var i = 0;
  2837. var key;
  2838. while (names.length > i) {
  2839. if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);
  2840. } return result;
  2841. };
  2842. // 19.4.1.1 Symbol([description])
  2843. if (!USE_NATIVE) {
  2844. $Symbol = function Symbol() {
  2845. if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');
  2846. var tag = uid(arguments.length > 0 ? arguments[0] : undefined);
  2847. var $set = function (value) {
  2848. if (this === ObjectProto) $set.call(OPSymbols, value);
  2849. if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
  2850. setSymbolDesc(this, tag, createDesc(1, value));
  2851. };
  2852. if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });
  2853. return wrap(tag);
  2854. };
  2855. redefine($Symbol[PROTOTYPE], 'toString', function toString() {
  2856. return this._k;
  2857. });
  2858. $GOPD.f = $getOwnPropertyDescriptor;
  2859. $DP.f = $defineProperty;
  2860. __webpack_require__(61).f = gOPNExt.f = $getOwnPropertyNames;
  2861. __webpack_require__(30).f = $propertyIsEnumerable;
  2862. $GOPS.f = $getOwnPropertySymbols;
  2863. if (DESCRIPTORS && !__webpack_require__(28)) {
  2864. redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);
  2865. }
  2866. wksExt.f = function (name) {
  2867. return wrap(wks(name));
  2868. };
  2869. }
  2870. $export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });
  2871. for (var es6Symbols = (
  2872. // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14
  2873. 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'
  2874. ).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);
  2875. for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);
  2876. $export($export.S + $export.F * !USE_NATIVE, 'Symbol', {
  2877. // 19.4.2.1 Symbol.for(key)
  2878. 'for': function (key) {
  2879. return has(SymbolRegistry, key += '')
  2880. ? SymbolRegistry[key]
  2881. : SymbolRegistry[key] = $Symbol(key);
  2882. },
  2883. // 19.4.2.5 Symbol.keyFor(sym)
  2884. keyFor: function keyFor(sym) {
  2885. if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');
  2886. for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;
  2887. },
  2888. useSetter: function () { setter = true; },
  2889. useSimple: function () { setter = false; }
  2890. });
  2891. $export($export.S + $export.F * !USE_NATIVE, 'Object', {
  2892. // 19.1.2.2 Object.create(O [, Properties])
  2893. create: $create,
  2894. // 19.1.2.4 Object.defineProperty(O, P, Attributes)
  2895. defineProperty: $defineProperty,
  2896. // 19.1.2.3 Object.defineProperties(O, Properties)
  2897. defineProperties: $defineProperties,
  2898. // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
  2899. getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
  2900. // 19.1.2.7 Object.getOwnPropertyNames(O)
  2901. getOwnPropertyNames: $getOwnPropertyNames,
  2902. // 19.1.2.8 Object.getOwnPropertySymbols(O)
  2903. getOwnPropertySymbols: $getOwnPropertySymbols
  2904. });
  2905. // Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives
  2906. // https://bugs.chromium.org/p/v8/issues/detail?id=3443
  2907. var FAILS_ON_PRIMITIVES = $fails(function () { $GOPS.f(1); });
  2908. $export($export.S + $export.F * FAILS_ON_PRIMITIVES, 'Object', {
  2909. getOwnPropertySymbols: function getOwnPropertySymbols(it) {
  2910. return $GOPS.f(toObject(it));
  2911. }
  2912. });
  2913. // 24.3.2 JSON.stringify(value [, replacer [, space]])
  2914. $JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {
  2915. var S = $Symbol();
  2916. // MS Edge converts symbol values to JSON as {}
  2917. // WebKit converts symbol values to JSON as null
  2918. // V8 throws on boxed symbols
  2919. return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';
  2920. })), 'JSON', {
  2921. stringify: function stringify(it) {
  2922. var args = [it];
  2923. var i = 1;
  2924. var replacer, $replacer;
  2925. while (arguments.length > i) args.push(arguments[i++]);
  2926. $replacer = replacer = args[1];
  2927. if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
  2928. if (!isArray(replacer)) replacer = function (key, value) {
  2929. if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
  2930. if (!isSymbol(value)) return value;
  2931. };
  2932. args[1] = replacer;
  2933. return _stringify.apply($JSON, args);
  2934. }
  2935. });
  2936. // 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)
  2937. $Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(17)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
  2938. // 19.4.3.5 Symbol.prototype[@@toStringTag]
  2939. setToStringTag($Symbol, 'Symbol');
  2940. // 20.2.1.9 Math[@@toStringTag]
  2941. setToStringTag(Math, 'Math', true);
  2942. // 24.3.3 JSON[@@toStringTag]
  2943. setToStringTag(global.JSON, 'JSON', true);
  2944. /***/ }),
  2945. /* 100 */
  2946. /***/ (function(module, exports, __webpack_require__) {
  2947. var META = __webpack_require__(29)('meta');
  2948. var isObject = __webpack_require__(19);
  2949. var has = __webpack_require__(15);
  2950. var setDesc = __webpack_require__(10).f;
  2951. var id = 0;
  2952. var isExtensible = Object.isExtensible || function () {
  2953. return true;
  2954. };
  2955. var FREEZE = !__webpack_require__(20)(function () {
  2956. return isExtensible(Object.preventExtensions({}));
  2957. });
  2958. var setMeta = function (it) {
  2959. setDesc(it, META, { value: {
  2960. i: 'O' + ++id, // object ID
  2961. w: {} // weak collections IDs
  2962. } });
  2963. };
  2964. var fastKey = function (it, create) {
  2965. // return primitive with prefix
  2966. if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
  2967. if (!has(it, META)) {
  2968. // can't set metadata to uncaught frozen object
  2969. if (!isExtensible(it)) return 'F';
  2970. // not necessary to add metadata
  2971. if (!create) return 'E';
  2972. // add missing metadata
  2973. setMeta(it);
  2974. // return object ID
  2975. } return it[META].i;
  2976. };
  2977. var getWeak = function (it, create) {
  2978. if (!has(it, META)) {
  2979. // can't set metadata to uncaught frozen object
  2980. if (!isExtensible(it)) return true;
  2981. // not necessary to add metadata
  2982. if (!create) return false;
  2983. // add missing metadata
  2984. setMeta(it);
  2985. // return hash weak collections IDs
  2986. } return it[META].w;
  2987. };
  2988. // add metadata on freeze-family methods calling
  2989. var onFreeze = function (it) {
  2990. if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);
  2991. return it;
  2992. };
  2993. var meta = module.exports = {
  2994. KEY: META,
  2995. NEED: false,
  2996. fastKey: fastKey,
  2997. getWeak: getWeak,
  2998. onFreeze: onFreeze
  2999. };
  3000. /***/ }),
  3001. /* 101 */
  3002. /***/ (function(module, exports, __webpack_require__) {
  3003. // all enumerable object keys, includes symbols
  3004. var getKeys = __webpack_require__(27);
  3005. var gOPS = __webpack_require__(40);
  3006. var pIE = __webpack_require__(30);
  3007. module.exports = function (it) {
  3008. var result = getKeys(it);
  3009. var getSymbols = gOPS.f;
  3010. if (getSymbols) {
  3011. var symbols = getSymbols(it);
  3012. var isEnum = pIE.f;
  3013. var i = 0;
  3014. var key;
  3015. while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);
  3016. } return result;
  3017. };
  3018. /***/ }),
  3019. /* 102 */
  3020. /***/ (function(module, exports, __webpack_require__) {
  3021. // 7.2.2 IsArray(argument)
  3022. var cof = __webpack_require__(34);
  3023. module.exports = Array.isArray || function isArray(arg) {
  3024. return cof(arg) == 'Array';
  3025. };
  3026. /***/ }),
  3027. /* 103 */
  3028. /***/ (function(module, exports, __webpack_require__) {
  3029. // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
  3030. var toIObject = __webpack_require__(16);
  3031. var gOPN = __webpack_require__(61).f;
  3032. var toString = {}.toString;
  3033. var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
  3034. ? Object.getOwnPropertyNames(window) : [];
  3035. var getWindowNames = function (it) {
  3036. try {
  3037. return gOPN(it);
  3038. } catch (e) {
  3039. return windowNames.slice();
  3040. }
  3041. };
  3042. module.exports.f = function getOwnPropertyNames(it) {
  3043. return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));
  3044. };
  3045. /***/ }),
  3046. /* 104 */
  3047. /***/ (function(module, exports) {
  3048. /***/ }),
  3049. /* 105 */
  3050. /***/ (function(module, exports, __webpack_require__) {
  3051. __webpack_require__(45)('asyncIterator');
  3052. /***/ }),
  3053. /* 106 */
  3054. /***/ (function(module, exports, __webpack_require__) {
  3055. __webpack_require__(45)('observable');
  3056. /***/ }),
  3057. /* 107 */
  3058. /***/ (function(module, exports, __webpack_require__) {
  3059. module.exports = { "default": __webpack_require__(108), __esModule: true };
  3060. /***/ }),
  3061. /* 108 */
  3062. /***/ (function(module, exports, __webpack_require__) {
  3063. __webpack_require__(109);
  3064. module.exports = __webpack_require__(6).Object.setPrototypeOf;
  3065. /***/ }),
  3066. /* 109 */
  3067. /***/ (function(module, exports, __webpack_require__) {
  3068. // 19.1.3.19 Object.setPrototypeOf(O, proto)
  3069. var $export = __webpack_require__(8);
  3070. $export($export.S, 'Object', { setPrototypeOf: __webpack_require__(110).set });
  3071. /***/ }),
  3072. /* 110 */
  3073. /***/ (function(module, exports, __webpack_require__) {
  3074. // Works with __proto__ only. Old v8 can't work with null proto objects.
  3075. /* eslint-disable no-proto */
  3076. var isObject = __webpack_require__(19);
  3077. var anObject = __webpack_require__(18);
  3078. var check = function (O, proto) {
  3079. anObject(O);
  3080. if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!");
  3081. };
  3082. module.exports = {
  3083. set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line
  3084. function (test, buggy, set) {
  3085. try {
  3086. set = __webpack_require__(32)(Function.call, __webpack_require__(46).f(Object.prototype, '__proto__').set, 2);
  3087. set(test, []);
  3088. buggy = !(test instanceof Array);
  3089. } catch (e) { buggy = true; }
  3090. return function setPrototypeOf(O, proto) {
  3091. check(O, proto);
  3092. if (buggy) O.__proto__ = proto;
  3093. else set(O, proto);
  3094. return O;
  3095. };
  3096. }({}, false) : undefined),
  3097. check: check
  3098. };
  3099. /***/ }),
  3100. /* 111 */
  3101. /***/ (function(module, exports, __webpack_require__) {
  3102. module.exports = { "default": __webpack_require__(112), __esModule: true };
  3103. /***/ }),
  3104. /* 112 */
  3105. /***/ (function(module, exports, __webpack_require__) {
  3106. __webpack_require__(113);
  3107. var $Object = __webpack_require__(6).Object;
  3108. module.exports = function create(P, D) {
  3109. return $Object.create(P, D);
  3110. };
  3111. /***/ }),
  3112. /* 113 */
  3113. /***/ (function(module, exports, __webpack_require__) {
  3114. var $export = __webpack_require__(8);
  3115. // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
  3116. $export($export.S, 'Object', { create: __webpack_require__(42) });
  3117. /***/ }),
  3118. /* 114 */
  3119. /***/ (function(module, exports, __webpack_require__) {
  3120. "use strict";
  3121. /** @license React v16.9.0
  3122. * react-is.production.min.js
  3123. *
  3124. * Copyright (c) Facebook, Inc. and its affiliates.
  3125. *
  3126. * This source code is licensed under the MIT license found in the
  3127. * LICENSE file in the root directory of this source tree.
  3128. */
  3129. Object.defineProperty(exports,"__esModule",{value:!0});
  3130. var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?Symbol.for("react.suspense_list"):
  3131. 60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.fundamental"):60117,w=b?Symbol.for("react.responder"):60118;function x(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case h:return a;default:return u}}case t:case r:case d:return u}}}function y(a){return x(a)===m}exports.typeOf=x;exports.AsyncMode=l;
  3132. exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;
  3133. exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===v||a.$$typeof===w)};exports.isAsyncMode=function(a){return y(a)||x(a)===l};exports.isConcurrentMode=y;exports.isContextConsumer=function(a){return x(a)===k};exports.isContextProvider=function(a){return x(a)===h};
  3134. exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return x(a)===n};exports.isFragment=function(a){return x(a)===e};exports.isLazy=function(a){return x(a)===t};exports.isMemo=function(a){return x(a)===r};exports.isPortal=function(a){return x(a)===d};exports.isProfiler=function(a){return x(a)===g};exports.isStrictMode=function(a){return x(a)===f};exports.isSuspense=function(a){return x(a)===p};
  3135. /***/ }),
  3136. /* 115 */
  3137. /***/ (function(module, exports, __webpack_require__) {
  3138. "use strict";
  3139. /* WEBPACK VAR INJECTION */(function(process) {/** @license React v16.9.0
  3140. * react-is.development.js
  3141. *
  3142. * Copyright (c) Facebook, Inc. and its affiliates.
  3143. *
  3144. * This source code is licensed under the MIT license found in the
  3145. * LICENSE file in the root directory of this source tree.
  3146. */
  3147. if (process.env.NODE_ENV !== "production") {
  3148. (function() {
  3149. 'use strict';
  3150. Object.defineProperty(exports, '__esModule', { value: true });
  3151. // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
  3152. // nor polyfill, then a plain number is used for performance.
  3153. var hasSymbol = typeof Symbol === 'function' && Symbol.for;
  3154. var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
  3155. var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
  3156. var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
  3157. var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
  3158. var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
  3159. var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
  3160. var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
  3161. // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
  3162. // (unstable) APIs that have been removed. Can we remove the symbols?
  3163. var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
  3164. var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
  3165. var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
  3166. var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
  3167. var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
  3168. var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
  3169. var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
  3170. var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
  3171. var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
  3172. function isValidElementType(type) {
  3173. return typeof type === 'string' || typeof type === 'function' ||
  3174. // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
  3175. type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE);
  3176. }
  3177. /**
  3178. * Forked from fbjs/warning:
  3179. * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
  3180. *
  3181. * Only change is we use console.warn instead of console.error,
  3182. * and do nothing when 'console' is not supported.
  3183. * This really simplifies the code.
  3184. * ---
  3185. * Similar to invariant but only logs a warning if the condition is not met.
  3186. * This can be used to log issues in development environments in critical
  3187. * paths. Removing the logging code for production environments will keep the
  3188. * same logic and follow the same code paths.
  3189. */
  3190. var lowPriorityWarning = function () {};
  3191. {
  3192. var printWarning = function (format) {
  3193. for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  3194. args[_key - 1] = arguments[_key];
  3195. }
  3196. var argIndex = 0;
  3197. var message = 'Warning: ' + format.replace(/%s/g, function () {
  3198. return args[argIndex++];
  3199. });
  3200. if (typeof console !== 'undefined') {
  3201. console.warn(message);
  3202. }
  3203. try {
  3204. // --- Welcome to debugging React ---
  3205. // This error was thrown as a convenience so that you can use this stack
  3206. // to find the callsite that caused this warning to fire.
  3207. throw new Error(message);
  3208. } catch (x) {}
  3209. };
  3210. lowPriorityWarning = function (condition, format) {
  3211. if (format === undefined) {
  3212. throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument');
  3213. }
  3214. if (!condition) {
  3215. for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
  3216. args[_key2 - 2] = arguments[_key2];
  3217. }
  3218. printWarning.apply(undefined, [format].concat(args));
  3219. }
  3220. };
  3221. }
  3222. var lowPriorityWarning$1 = lowPriorityWarning;
  3223. function typeOf(object) {
  3224. if (typeof object === 'object' && object !== null) {
  3225. var $$typeof = object.$$typeof;
  3226. switch ($$typeof) {
  3227. case REACT_ELEMENT_TYPE:
  3228. var type = object.type;
  3229. switch (type) {
  3230. case REACT_ASYNC_MODE_TYPE:
  3231. case REACT_CONCURRENT_MODE_TYPE:
  3232. case REACT_FRAGMENT_TYPE:
  3233. case REACT_PROFILER_TYPE:
  3234. case REACT_STRICT_MODE_TYPE:
  3235. case REACT_SUSPENSE_TYPE:
  3236. return type;
  3237. default:
  3238. var $$typeofType = type && type.$$typeof;
  3239. switch ($$typeofType) {
  3240. case REACT_CONTEXT_TYPE:
  3241. case REACT_FORWARD_REF_TYPE:
  3242. case REACT_PROVIDER_TYPE:
  3243. return $$typeofType;
  3244. default:
  3245. return $$typeof;
  3246. }
  3247. }
  3248. case REACT_LAZY_TYPE:
  3249. case REACT_MEMO_TYPE:
  3250. case REACT_PORTAL_TYPE:
  3251. return $$typeof;
  3252. }
  3253. }
  3254. return undefined;
  3255. }
  3256. // AsyncMode is deprecated along with isAsyncMode
  3257. var AsyncMode = REACT_ASYNC_MODE_TYPE;
  3258. var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
  3259. var ContextConsumer = REACT_CONTEXT_TYPE;
  3260. var ContextProvider = REACT_PROVIDER_TYPE;
  3261. var Element = REACT_ELEMENT_TYPE;
  3262. var ForwardRef = REACT_FORWARD_REF_TYPE;
  3263. var Fragment = REACT_FRAGMENT_TYPE;
  3264. var Lazy = REACT_LAZY_TYPE;
  3265. var Memo = REACT_MEMO_TYPE;
  3266. var Portal = REACT_PORTAL_TYPE;
  3267. var Profiler = REACT_PROFILER_TYPE;
  3268. var StrictMode = REACT_STRICT_MODE_TYPE;
  3269. var Suspense = REACT_SUSPENSE_TYPE;
  3270. var hasWarnedAboutDeprecatedIsAsyncMode = false;
  3271. // AsyncMode should be deprecated
  3272. function isAsyncMode(object) {
  3273. {
  3274. if (!hasWarnedAboutDeprecatedIsAsyncMode) {
  3275. hasWarnedAboutDeprecatedIsAsyncMode = true;
  3276. lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
  3277. }
  3278. }
  3279. return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
  3280. }
  3281. function isConcurrentMode(object) {
  3282. return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
  3283. }
  3284. function isContextConsumer(object) {
  3285. return typeOf(object) === REACT_CONTEXT_TYPE;
  3286. }
  3287. function isContextProvider(object) {
  3288. return typeOf(object) === REACT_PROVIDER_TYPE;
  3289. }
  3290. function isElement(object) {
  3291. return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
  3292. }
  3293. function isForwardRef(object) {
  3294. return typeOf(object) === REACT_FORWARD_REF_TYPE;
  3295. }
  3296. function isFragment(object) {
  3297. return typeOf(object) === REACT_FRAGMENT_TYPE;
  3298. }
  3299. function isLazy(object) {
  3300. return typeOf(object) === REACT_LAZY_TYPE;
  3301. }
  3302. function isMemo(object) {
  3303. return typeOf(object) === REACT_MEMO_TYPE;
  3304. }
  3305. function isPortal(object) {
  3306. return typeOf(object) === REACT_PORTAL_TYPE;
  3307. }
  3308. function isProfiler(object) {
  3309. return typeOf(object) === REACT_PROFILER_TYPE;
  3310. }
  3311. function isStrictMode(object) {
  3312. return typeOf(object) === REACT_STRICT_MODE_TYPE;
  3313. }
  3314. function isSuspense(object) {
  3315. return typeOf(object) === REACT_SUSPENSE_TYPE;
  3316. }
  3317. exports.typeOf = typeOf;
  3318. exports.AsyncMode = AsyncMode;
  3319. exports.ConcurrentMode = ConcurrentMode;
  3320. exports.ContextConsumer = ContextConsumer;
  3321. exports.ContextProvider = ContextProvider;
  3322. exports.Element = Element;
  3323. exports.ForwardRef = ForwardRef;
  3324. exports.Fragment = Fragment;
  3325. exports.Lazy = Lazy;
  3326. exports.Memo = Memo;
  3327. exports.Portal = Portal;
  3328. exports.Profiler = Profiler;
  3329. exports.StrictMode = StrictMode;
  3330. exports.Suspense = Suspense;
  3331. exports.isValidElementType = isValidElementType;
  3332. exports.isAsyncMode = isAsyncMode;
  3333. exports.isConcurrentMode = isConcurrentMode;
  3334. exports.isContextConsumer = isContextConsumer;
  3335. exports.isContextProvider = isContextProvider;
  3336. exports.isElement = isElement;
  3337. exports.isForwardRef = isForwardRef;
  3338. exports.isFragment = isFragment;
  3339. exports.isLazy = isLazy;
  3340. exports.isMemo = isMemo;
  3341. exports.isPortal = isPortal;
  3342. exports.isProfiler = isProfiler;
  3343. exports.isStrictMode = isStrictMode;
  3344. exports.isSuspense = isSuspense;
  3345. })();
  3346. }
  3347. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(21)))
  3348. /***/ }),
  3349. /* 116 */
  3350. /***/ (function(module, exports, __webpack_require__) {
  3351. "use strict";
  3352. /* WEBPACK VAR INJECTION */(function(process) {/**
  3353. * Copyright (c) 2013-present, Facebook, Inc.
  3354. *
  3355. * This source code is licensed under the MIT license found in the
  3356. * LICENSE file in the root directory of this source tree.
  3357. */
  3358. var ReactIs = __webpack_require__(62);
  3359. var assign = __webpack_require__(63);
  3360. var ReactPropTypesSecret = __webpack_require__(47);
  3361. var checkPropTypes = __webpack_require__(117);
  3362. var has = Function.call.bind(Object.prototype.hasOwnProperty);
  3363. var printWarning = function() {};
  3364. if (process.env.NODE_ENV !== 'production') {
  3365. printWarning = function(text) {
  3366. var message = 'Warning: ' + text;
  3367. if (typeof console !== 'undefined') {
  3368. console.error(message);
  3369. }
  3370. try {
  3371. // --- Welcome to debugging React ---
  3372. // This error was thrown as a convenience so that you can use this stack
  3373. // to find the callsite that caused this warning to fire.
  3374. throw new Error(message);
  3375. } catch (x) {}
  3376. };
  3377. }
  3378. function emptyFunctionThatReturnsNull() {
  3379. return null;
  3380. }
  3381. module.exports = function(isValidElement, throwOnDirectAccess) {
  3382. /* global Symbol */
  3383. var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
  3384. var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
  3385. /**
  3386. * Returns the iterator method function contained on the iterable object.
  3387. *
  3388. * Be sure to invoke the function with the iterable as context:
  3389. *
  3390. * var iteratorFn = getIteratorFn(myIterable);
  3391. * if (iteratorFn) {
  3392. * var iterator = iteratorFn.call(myIterable);
  3393. * ...
  3394. * }
  3395. *
  3396. * @param {?object} maybeIterable
  3397. * @return {?function}
  3398. */
  3399. function getIteratorFn(maybeIterable) {
  3400. var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
  3401. if (typeof iteratorFn === 'function') {
  3402. return iteratorFn;
  3403. }
  3404. }
  3405. /**
  3406. * Collection of methods that allow declaration and validation of props that are
  3407. * supplied to React components. Example usage:
  3408. *
  3409. * var Props = require('ReactPropTypes');
  3410. * var MyArticle = React.createClass({
  3411. * propTypes: {
  3412. * // An optional string prop named "description".
  3413. * description: Props.string,
  3414. *
  3415. * // A required enum prop named "category".
  3416. * category: Props.oneOf(['News','Photos']).isRequired,
  3417. *
  3418. * // A prop named "dialog" that requires an instance of Dialog.
  3419. * dialog: Props.instanceOf(Dialog).isRequired
  3420. * },
  3421. * render: function() { ... }
  3422. * });
  3423. *
  3424. * A more formal specification of how these methods are used:
  3425. *
  3426. * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
  3427. * decl := ReactPropTypes.{type}(.isRequired)?
  3428. *
  3429. * Each and every declaration produces a function with the same signature. This
  3430. * allows the creation of custom validation functions. For example:
  3431. *
  3432. * var MyLink = React.createClass({
  3433. * propTypes: {
  3434. * // An optional string or URI prop named "href".
  3435. * href: function(props, propName, componentName) {
  3436. * var propValue = props[propName];
  3437. * if (propValue != null && typeof propValue !== 'string' &&
  3438. * !(propValue instanceof URI)) {
  3439. * return new Error(
  3440. * 'Expected a string or an URI for ' + propName + ' in ' +
  3441. * componentName
  3442. * );
  3443. * }
  3444. * }
  3445. * },
  3446. * render: function() {...}
  3447. * });
  3448. *
  3449. * @internal
  3450. */
  3451. var ANONYMOUS = '<<anonymous>>';
  3452. // Important!
  3453. // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
  3454. var ReactPropTypes = {
  3455. array: createPrimitiveTypeChecker('array'),
  3456. bool: createPrimitiveTypeChecker('boolean'),
  3457. func: createPrimitiveTypeChecker('function'),
  3458. number: createPrimitiveTypeChecker('number'),
  3459. object: createPrimitiveTypeChecker('object'),
  3460. string: createPrimitiveTypeChecker('string'),
  3461. symbol: createPrimitiveTypeChecker('symbol'),
  3462. any: createAnyTypeChecker(),
  3463. arrayOf: createArrayOfTypeChecker,
  3464. element: createElementTypeChecker(),
  3465. elementType: createElementTypeTypeChecker(),
  3466. instanceOf: createInstanceTypeChecker,
  3467. node: createNodeChecker(),
  3468. objectOf: createObjectOfTypeChecker,
  3469. oneOf: createEnumTypeChecker,
  3470. oneOfType: createUnionTypeChecker,
  3471. shape: createShapeTypeChecker,
  3472. exact: createStrictShapeTypeChecker,
  3473. };
  3474. /**
  3475. * inlined Object.is polyfill to avoid requiring consumers ship their own
  3476. * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
  3477. */
  3478. /*eslint-disable no-self-compare*/
  3479. function is(x, y) {
  3480. // SameValue algorithm
  3481. if (x === y) {
  3482. // Steps 1-5, 7-10
  3483. // Steps 6.b-6.e: +0 != -0
  3484. return x !== 0 || 1 / x === 1 / y;
  3485. } else {
  3486. // Step 6.a: NaN == NaN
  3487. return x !== x && y !== y;
  3488. }
  3489. }
  3490. /*eslint-enable no-self-compare*/
  3491. /**
  3492. * We use an Error-like object for backward compatibility as people may call
  3493. * PropTypes directly and inspect their output. However, we don't use real
  3494. * Errors anymore. We don't inspect their stack anyway, and creating them
  3495. * is prohibitively expensive if they are created too often, such as what
  3496. * happens in oneOfType() for any type before the one that matched.
  3497. */
  3498. function PropTypeError(message) {
  3499. this.message = message;
  3500. this.stack = '';
  3501. }
  3502. // Make `instanceof Error` still work for returned errors.
  3503. PropTypeError.prototype = Error.prototype;
  3504. function createChainableTypeChecker(validate) {
  3505. if (process.env.NODE_ENV !== 'production') {
  3506. var manualPropTypeCallCache = {};
  3507. var manualPropTypeWarningCount = 0;
  3508. }
  3509. function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
  3510. componentName = componentName || ANONYMOUS;
  3511. propFullName = propFullName || propName;
  3512. if (secret !== ReactPropTypesSecret) {
  3513. if (throwOnDirectAccess) {
  3514. // New behavior only for users of `prop-types` package
  3515. var err = new Error(
  3516. 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
  3517. 'Use `PropTypes.checkPropTypes()` to call them. ' +
  3518. 'Read more at http://fb.me/use-check-prop-types'
  3519. );
  3520. err.name = 'Invariant Violation';
  3521. throw err;
  3522. } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
  3523. // Old behavior for people using React.PropTypes
  3524. var cacheKey = componentName + ':' + propName;
  3525. if (
  3526. !manualPropTypeCallCache[cacheKey] &&
  3527. // Avoid spamming the console because they are often not actionable except for lib authors
  3528. manualPropTypeWarningCount < 3
  3529. ) {
  3530. printWarning(
  3531. 'You are manually calling a React.PropTypes validation ' +
  3532. 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
  3533. 'and will throw in the standalone `prop-types` package. ' +
  3534. 'You may be seeing this warning due to a third-party PropTypes ' +
  3535. 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
  3536. );
  3537. manualPropTypeCallCache[cacheKey] = true;
  3538. manualPropTypeWarningCount++;
  3539. }
  3540. }
  3541. }
  3542. if (props[propName] == null) {
  3543. if (isRequired) {
  3544. if (props[propName] === null) {
  3545. return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
  3546. }
  3547. return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
  3548. }
  3549. return null;
  3550. } else {
  3551. return validate(props, propName, componentName, location, propFullName);
  3552. }
  3553. }
  3554. var chainedCheckType = checkType.bind(null, false);
  3555. chainedCheckType.isRequired = checkType.bind(null, true);
  3556. return chainedCheckType;
  3557. }
  3558. function createPrimitiveTypeChecker(expectedType) {
  3559. function validate(props, propName, componentName, location, propFullName, secret) {
  3560. var propValue = props[propName];
  3561. var propType = getPropType(propValue);
  3562. if (propType !== expectedType) {
  3563. // `propValue` being instance of, say, date/regexp, pass the 'object'
  3564. // check, but we can offer a more precise error message here rather than
  3565. // 'of type `object`'.
  3566. var preciseType = getPreciseType(propValue);
  3567. return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
  3568. }
  3569. return null;
  3570. }
  3571. return createChainableTypeChecker(validate);
  3572. }
  3573. function createAnyTypeChecker() {
  3574. return createChainableTypeChecker(emptyFunctionThatReturnsNull);
  3575. }
  3576. function createArrayOfTypeChecker(typeChecker) {
  3577. function validate(props, propName, componentName, location, propFullName) {
  3578. if (typeof typeChecker !== 'function') {
  3579. return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
  3580. }
  3581. var propValue = props[propName];
  3582. if (!Array.isArray(propValue)) {
  3583. var propType = getPropType(propValue);
  3584. return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
  3585. }
  3586. for (var i = 0; i < propValue.length; i++) {
  3587. var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
  3588. if (error instanceof Error) {
  3589. return error;
  3590. }
  3591. }
  3592. return null;
  3593. }
  3594. return createChainableTypeChecker(validate);
  3595. }
  3596. function createElementTypeChecker() {
  3597. function validate(props, propName, componentName, location, propFullName) {
  3598. var propValue = props[propName];
  3599. if (!isValidElement(propValue)) {
  3600. var propType = getPropType(propValue);
  3601. return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
  3602. }
  3603. return null;
  3604. }
  3605. return createChainableTypeChecker(validate);
  3606. }
  3607. function createElementTypeTypeChecker() {
  3608. function validate(props, propName, componentName, location, propFullName) {
  3609. var propValue = props[propName];
  3610. if (!ReactIs.isValidElementType(propValue)) {
  3611. var propType = getPropType(propValue);
  3612. return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
  3613. }
  3614. return null;
  3615. }
  3616. return createChainableTypeChecker(validate);
  3617. }
  3618. function createInstanceTypeChecker(expectedClass) {
  3619. function validate(props, propName, componentName, location, propFullName) {
  3620. if (!(props[propName] instanceof expectedClass)) {
  3621. var expectedClassName = expectedClass.name || ANONYMOUS;
  3622. var actualClassName = getClassName(props[propName]);
  3623. return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
  3624. }
  3625. return null;
  3626. }
  3627. return createChainableTypeChecker(validate);
  3628. }
  3629. function createEnumTypeChecker(expectedValues) {
  3630. if (!Array.isArray(expectedValues)) {
  3631. if (process.env.NODE_ENV !== 'production') {
  3632. if (arguments.length > 1) {
  3633. printWarning(
  3634. 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
  3635. 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
  3636. );
  3637. } else {
  3638. printWarning('Invalid argument supplied to oneOf, expected an array.');
  3639. }
  3640. }
  3641. return emptyFunctionThatReturnsNull;
  3642. }
  3643. function validate(props, propName, componentName, location, propFullName) {
  3644. var propValue = props[propName];
  3645. for (var i = 0; i < expectedValues.length; i++) {
  3646. if (is(propValue, expectedValues[i])) {
  3647. return null;
  3648. }
  3649. }
  3650. var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
  3651. var type = getPreciseType(value);
  3652. if (type === 'symbol') {
  3653. return String(value);
  3654. }
  3655. return value;
  3656. });
  3657. return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
  3658. }
  3659. return createChainableTypeChecker(validate);
  3660. }
  3661. function createObjectOfTypeChecker(typeChecker) {
  3662. function validate(props, propName, componentName, location, propFullName) {
  3663. if (typeof typeChecker !== 'function') {
  3664. return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
  3665. }
  3666. var propValue = props[propName];
  3667. var propType = getPropType(propValue);
  3668. if (propType !== 'object') {
  3669. return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
  3670. }
  3671. for (var key in propValue) {
  3672. if (has(propValue, key)) {
  3673. var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
  3674. if (error instanceof Error) {
  3675. return error;
  3676. }
  3677. }
  3678. }
  3679. return null;
  3680. }
  3681. return createChainableTypeChecker(validate);
  3682. }
  3683. function createUnionTypeChecker(arrayOfTypeCheckers) {
  3684. if (!Array.isArray(arrayOfTypeCheckers)) {
  3685. process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
  3686. return emptyFunctionThatReturnsNull;
  3687. }
  3688. for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
  3689. var checker = arrayOfTypeCheckers[i];
  3690. if (typeof checker !== 'function') {
  3691. printWarning(
  3692. 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
  3693. 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
  3694. );
  3695. return emptyFunctionThatReturnsNull;
  3696. }
  3697. }
  3698. function validate(props, propName, componentName, location, propFullName) {
  3699. for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
  3700. var checker = arrayOfTypeCheckers[i];
  3701. if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {
  3702. return null;
  3703. }
  3704. }
  3705. return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
  3706. }
  3707. return createChainableTypeChecker(validate);
  3708. }
  3709. function createNodeChecker() {
  3710. function validate(props, propName, componentName, location, propFullName) {
  3711. if (!isNode(props[propName])) {
  3712. return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
  3713. }
  3714. return null;
  3715. }
  3716. return createChainableTypeChecker(validate);
  3717. }
  3718. function createShapeTypeChecker(shapeTypes) {
  3719. function validate(props, propName, componentName, location, propFullName) {
  3720. var propValue = props[propName];
  3721. var propType = getPropType(propValue);
  3722. if (propType !== 'object') {
  3723. return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
  3724. }
  3725. for (var key in shapeTypes) {
  3726. var checker = shapeTypes[key];
  3727. if (!checker) {
  3728. continue;
  3729. }
  3730. var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
  3731. if (error) {
  3732. return error;
  3733. }
  3734. }
  3735. return null;
  3736. }
  3737. return createChainableTypeChecker(validate);
  3738. }
  3739. function createStrictShapeTypeChecker(shapeTypes) {
  3740. function validate(props, propName, componentName, location, propFullName) {
  3741. var propValue = props[propName];
  3742. var propType = getPropType(propValue);
  3743. if (propType !== 'object') {
  3744. return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
  3745. }
  3746. // We need to check all keys in case some are required but missing from
  3747. // props.
  3748. var allKeys = assign({}, props[propName], shapeTypes);
  3749. for (var key in allKeys) {
  3750. var checker = shapeTypes[key];
  3751. if (!checker) {
  3752. return new PropTypeError(
  3753. 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
  3754. '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
  3755. '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
  3756. );
  3757. }
  3758. var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
  3759. if (error) {
  3760. return error;
  3761. }
  3762. }
  3763. return null;
  3764. }
  3765. return createChainableTypeChecker(validate);
  3766. }
  3767. function isNode(propValue) {
  3768. switch (typeof propValue) {
  3769. case 'number':
  3770. case 'string':
  3771. case 'undefined':
  3772. return true;
  3773. case 'boolean':
  3774. return !propValue;
  3775. case 'object':
  3776. if (Array.isArray(propValue)) {
  3777. return propValue.every(isNode);
  3778. }
  3779. if (propValue === null || isValidElement(propValue)) {
  3780. return true;
  3781. }
  3782. var iteratorFn = getIteratorFn(propValue);
  3783. if (iteratorFn) {
  3784. var iterator = iteratorFn.call(propValue);
  3785. var step;
  3786. if (iteratorFn !== propValue.entries) {
  3787. while (!(step = iterator.next()).done) {
  3788. if (!isNode(step.value)) {
  3789. return false;
  3790. }
  3791. }
  3792. } else {
  3793. // Iterator will provide entry [k,v] tuples rather than values.
  3794. while (!(step = iterator.next()).done) {
  3795. var entry = step.value;
  3796. if (entry) {
  3797. if (!isNode(entry[1])) {
  3798. return false;
  3799. }
  3800. }
  3801. }
  3802. }
  3803. } else {
  3804. return false;
  3805. }
  3806. return true;
  3807. default:
  3808. return false;
  3809. }
  3810. }
  3811. function isSymbol(propType, propValue) {
  3812. // Native Symbol.
  3813. if (propType === 'symbol') {
  3814. return true;
  3815. }
  3816. // falsy value can't be a Symbol
  3817. if (!propValue) {
  3818. return false;
  3819. }
  3820. // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
  3821. if (propValue['@@toStringTag'] === 'Symbol') {
  3822. return true;
  3823. }
  3824. // Fallback for non-spec compliant Symbols which are polyfilled.
  3825. if (typeof Symbol === 'function' && propValue instanceof Symbol) {
  3826. return true;
  3827. }
  3828. return false;
  3829. }
  3830. // Equivalent of `typeof` but with special handling for array and regexp.
  3831. function getPropType(propValue) {
  3832. var propType = typeof propValue;
  3833. if (Array.isArray(propValue)) {
  3834. return 'array';
  3835. }
  3836. if (propValue instanceof RegExp) {
  3837. // Old webkits (at least until Android 4.0) return 'function' rather than
  3838. // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
  3839. // passes PropTypes.object.
  3840. return 'object';
  3841. }
  3842. if (isSymbol(propType, propValue)) {
  3843. return 'symbol';
  3844. }
  3845. return propType;
  3846. }
  3847. // This handles more types than `getPropType`. Only used for error messages.
  3848. // See `createPrimitiveTypeChecker`.
  3849. function getPreciseType(propValue) {
  3850. if (typeof propValue === 'undefined' || propValue === null) {
  3851. return '' + propValue;
  3852. }
  3853. var propType = getPropType(propValue);
  3854. if (propType === 'object') {
  3855. if (propValue instanceof Date) {
  3856. return 'date';
  3857. } else if (propValue instanceof RegExp) {
  3858. return 'regexp';
  3859. }
  3860. }
  3861. return propType;
  3862. }
  3863. // Returns a string that is postfixed to a warning about an invalid type.
  3864. // For example, "undefined" or "of type array"
  3865. function getPostfixForTypeWarning(value) {
  3866. var type = getPreciseType(value);
  3867. switch (type) {
  3868. case 'array':
  3869. case 'object':
  3870. return 'an ' + type;
  3871. case 'boolean':
  3872. case 'date':
  3873. case 'regexp':
  3874. return 'a ' + type;
  3875. default:
  3876. return type;
  3877. }
  3878. }
  3879. // Returns class name of the object, if any.
  3880. function getClassName(propValue) {
  3881. if (!propValue.constructor || !propValue.constructor.name) {
  3882. return ANONYMOUS;
  3883. }
  3884. return propValue.constructor.name;
  3885. }
  3886. ReactPropTypes.checkPropTypes = checkPropTypes;
  3887. ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
  3888. ReactPropTypes.PropTypes = ReactPropTypes;
  3889. return ReactPropTypes;
  3890. };
  3891. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(21)))
  3892. /***/ }),
  3893. /* 117 */
  3894. /***/ (function(module, exports, __webpack_require__) {
  3895. "use strict";
  3896. /* WEBPACK VAR INJECTION */(function(process) {/**
  3897. * Copyright (c) 2013-present, Facebook, Inc.
  3898. *
  3899. * This source code is licensed under the MIT license found in the
  3900. * LICENSE file in the root directory of this source tree.
  3901. */
  3902. var printWarning = function() {};
  3903. if (process.env.NODE_ENV !== 'production') {
  3904. var ReactPropTypesSecret = __webpack_require__(47);
  3905. var loggedTypeFailures = {};
  3906. var has = Function.call.bind(Object.prototype.hasOwnProperty);
  3907. printWarning = function(text) {
  3908. var message = 'Warning: ' + text;
  3909. if (typeof console !== 'undefined') {
  3910. console.error(message);
  3911. }
  3912. try {
  3913. // --- Welcome to debugging React ---
  3914. // This error was thrown as a convenience so that you can use this stack
  3915. // to find the callsite that caused this warning to fire.
  3916. throw new Error(message);
  3917. } catch (x) {}
  3918. };
  3919. }
  3920. /**
  3921. * Assert that the values match with the type specs.
  3922. * Error messages are memorized and will only be shown once.
  3923. *
  3924. * @param {object} typeSpecs Map of name to a ReactPropType
  3925. * @param {object} values Runtime values that need to be type-checked
  3926. * @param {string} location e.g. "prop", "context", "child context"
  3927. * @param {string} componentName Name of the component for error messages.
  3928. * @param {?Function} getStack Returns the component stack.
  3929. * @private
  3930. */
  3931. function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
  3932. if (process.env.NODE_ENV !== 'production') {
  3933. for (var typeSpecName in typeSpecs) {
  3934. if (has(typeSpecs, typeSpecName)) {
  3935. var error;
  3936. // Prop type validation may throw. In case they do, we don't want to
  3937. // fail the render phase where it didn't fail before. So we log it.
  3938. // After these have been cleaned up, we'll let them throw.
  3939. try {
  3940. // This is intentionally an invariant that gets caught. It's the same
  3941. // behavior as without this statement except with a better message.
  3942. if (typeof typeSpecs[typeSpecName] !== 'function') {
  3943. var err = Error(
  3944. (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
  3945. 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
  3946. );
  3947. err.name = 'Invariant Violation';
  3948. throw err;
  3949. }
  3950. error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
  3951. } catch (ex) {
  3952. error = ex;
  3953. }
  3954. if (error && !(error instanceof Error)) {
  3955. printWarning(
  3956. (componentName || 'React class') + ': type specification of ' +
  3957. location + ' `' + typeSpecName + '` is invalid; the type checker ' +
  3958. 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
  3959. 'You may have forgotten to pass an argument to the type checker ' +
  3960. 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
  3961. 'shape all require an argument).'
  3962. );
  3963. }
  3964. if (error instanceof Error && !(error.message in loggedTypeFailures)) {
  3965. // Only monitor this failure once because there tends to be a lot of the
  3966. // same error.
  3967. loggedTypeFailures[error.message] = true;
  3968. var stack = getStack ? getStack() : '';
  3969. printWarning(
  3970. 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
  3971. );
  3972. }
  3973. }
  3974. }
  3975. }
  3976. }
  3977. /**
  3978. * Resets warning cache when testing.
  3979. *
  3980. * @private
  3981. */
  3982. checkPropTypes.resetWarningCache = function() {
  3983. if (process.env.NODE_ENV !== 'production') {
  3984. loggedTypeFailures = {};
  3985. }
  3986. }
  3987. module.exports = checkPropTypes;
  3988. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(21)))
  3989. /***/ }),
  3990. /* 118 */
  3991. /***/ (function(module, exports, __webpack_require__) {
  3992. "use strict";
  3993. /**
  3994. * Copyright (c) 2013-present, Facebook, Inc.
  3995. *
  3996. * This source code is licensed under the MIT license found in the
  3997. * LICENSE file in the root directory of this source tree.
  3998. */
  3999. var ReactPropTypesSecret = __webpack_require__(47);
  4000. function emptyFunction() {}
  4001. function emptyFunctionWithReset() {}
  4002. emptyFunctionWithReset.resetWarningCache = emptyFunction;
  4003. module.exports = function() {
  4004. function shim(props, propName, componentName, location, propFullName, secret) {
  4005. if (secret === ReactPropTypesSecret) {
  4006. // It is still safe when called from React.
  4007. return;
  4008. }
  4009. var err = new Error(
  4010. 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
  4011. 'Use PropTypes.checkPropTypes() to call them. ' +
  4012. 'Read more at http://fb.me/use-check-prop-types'
  4013. );
  4014. err.name = 'Invariant Violation';
  4015. throw err;
  4016. };
  4017. shim.isRequired = shim;
  4018. function getShim() {
  4019. return shim;
  4020. };
  4021. // Important!
  4022. // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
  4023. var ReactPropTypes = {
  4024. array: shim,
  4025. bool: shim,
  4026. func: shim,
  4027. number: shim,
  4028. object: shim,
  4029. string: shim,
  4030. symbol: shim,
  4031. any: shim,
  4032. arrayOf: getShim,
  4033. element: shim,
  4034. elementType: shim,
  4035. instanceOf: getShim,
  4036. node: shim,
  4037. objectOf: getShim,
  4038. oneOf: getShim,
  4039. oneOfType: getShim,
  4040. shape: getShim,
  4041. exact: getShim,
  4042. checkPropTypes: emptyFunctionWithReset,
  4043. resetWarningCache: emptyFunction
  4044. };
  4045. ReactPropTypes.PropTypes = ReactPropTypes;
  4046. return ReactPropTypes;
  4047. };
  4048. /***/ }),
  4049. /* 119 */
  4050. /***/ (function(module, exports, __webpack_require__) {
  4051. "use strict";
  4052. exports.__esModule = true;
  4053. var _getPrototypeOf = __webpack_require__(120);
  4054. var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
  4055. var _getOwnPropertyDescriptor = __webpack_require__(123);
  4056. var _getOwnPropertyDescriptor2 = _interopRequireDefault(_getOwnPropertyDescriptor);
  4057. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4058. exports.default = function get(object, property, receiver) {
  4059. if (object === null) object = Function.prototype;
  4060. var desc = (0, _getOwnPropertyDescriptor2.default)(object, property);
  4061. if (desc === undefined) {
  4062. var parent = (0, _getPrototypeOf2.default)(object);
  4063. if (parent === null) {
  4064. return undefined;
  4065. } else {
  4066. return get(parent, property, receiver);
  4067. }
  4068. } else if ("value" in desc) {
  4069. return desc.value;
  4070. } else {
  4071. var getter = desc.get;
  4072. if (getter === undefined) {
  4073. return undefined;
  4074. }
  4075. return getter.call(receiver);
  4076. }
  4077. };
  4078. /***/ }),
  4079. /* 120 */
  4080. /***/ (function(module, exports, __webpack_require__) {
  4081. module.exports = { "default": __webpack_require__(121), __esModule: true };
  4082. /***/ }),
  4083. /* 121 */
  4084. /***/ (function(module, exports, __webpack_require__) {
  4085. __webpack_require__(122);
  4086. module.exports = __webpack_require__(6).Object.getPrototypeOf;
  4087. /***/ }),
  4088. /* 122 */
  4089. /***/ (function(module, exports, __webpack_require__) {
  4090. // 19.1.2.9 Object.getPrototypeOf(O)
  4091. var toObject = __webpack_require__(24);
  4092. var $getPrototypeOf = __webpack_require__(60);
  4093. __webpack_require__(66)('getPrototypeOf', function () {
  4094. return function getPrototypeOf(it) {
  4095. return $getPrototypeOf(toObject(it));
  4096. };
  4097. });
  4098. /***/ }),
  4099. /* 123 */
  4100. /***/ (function(module, exports, __webpack_require__) {
  4101. module.exports = { "default": __webpack_require__(124), __esModule: true };
  4102. /***/ }),
  4103. /* 124 */
  4104. /***/ (function(module, exports, __webpack_require__) {
  4105. __webpack_require__(125);
  4106. var $Object = __webpack_require__(6).Object;
  4107. module.exports = function getOwnPropertyDescriptor(it, key) {
  4108. return $Object.getOwnPropertyDescriptor(it, key);
  4109. };
  4110. /***/ }),
  4111. /* 125 */
  4112. /***/ (function(module, exports, __webpack_require__) {
  4113. // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
  4114. var toIObject = __webpack_require__(16);
  4115. var $getOwnPropertyDescriptor = __webpack_require__(46).f;
  4116. __webpack_require__(66)('getOwnPropertyDescriptor', function () {
  4117. return function getOwnPropertyDescriptor(it, key) {
  4118. return $getOwnPropertyDescriptor(toIObject(it), key);
  4119. };
  4120. });
  4121. /***/ }),
  4122. /* 126 */
  4123. /***/ (function(module, exports, __webpack_require__) {
  4124. "use strict";
  4125. Object.defineProperty(exports, '__esModule', {
  4126. value: true
  4127. });
  4128. exports['default'] = addEventListener;
  4129. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  4130. var _EventObject = __webpack_require__(127);
  4131. var _EventObject2 = _interopRequireDefault(_EventObject);
  4132. function addEventListener(target, eventType, callback, option) {
  4133. function wrapCallback(e) {
  4134. var ne = new _EventObject2['default'](e);
  4135. callback.call(target, ne);
  4136. }
  4137. if (target.addEventListener) {
  4138. var _ret = (function () {
  4139. var useCapture = false;
  4140. if (typeof option === 'object') {
  4141. useCapture = option.capture || false;
  4142. } else if (typeof option === 'boolean') {
  4143. useCapture = option;
  4144. }
  4145. target.addEventListener(eventType, wrapCallback, option || false);
  4146. return {
  4147. v: {
  4148. remove: function remove() {
  4149. target.removeEventListener(eventType, wrapCallback, useCapture);
  4150. }
  4151. }
  4152. };
  4153. })();
  4154. if (typeof _ret === 'object') return _ret.v;
  4155. } else if (target.attachEvent) {
  4156. target.attachEvent('on' + eventType, wrapCallback);
  4157. return {
  4158. remove: function remove() {
  4159. target.detachEvent('on' + eventType, wrapCallback);
  4160. }
  4161. };
  4162. }
  4163. }
  4164. module.exports = exports['default'];
  4165. /***/ }),
  4166. /* 127 */
  4167. /***/ (function(module, exports, __webpack_require__) {
  4168. "use strict";
  4169. /**
  4170. * @ignore
  4171. * event object for dom
  4172. * @author yiminghe@gmail.com
  4173. */
  4174. Object.defineProperty(exports, '__esModule', {
  4175. value: true
  4176. });
  4177. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  4178. var _EventBaseObject = __webpack_require__(128);
  4179. var _EventBaseObject2 = _interopRequireDefault(_EventBaseObject);
  4180. var _objectAssign = __webpack_require__(63);
  4181. var _objectAssign2 = _interopRequireDefault(_objectAssign);
  4182. var TRUE = true;
  4183. var FALSE = false;
  4184. var commonProps = ['altKey', 'bubbles', 'cancelable', 'ctrlKey', 'currentTarget', 'eventPhase', 'metaKey', 'shiftKey', 'target', 'timeStamp', 'view', 'type'];
  4185. function isNullOrUndefined(w) {
  4186. return w === null || w === undefined;
  4187. }
  4188. var eventNormalizers = [{
  4189. reg: /^key/,
  4190. props: ['char', 'charCode', 'key', 'keyCode', 'which'],
  4191. fix: function fix(event, nativeEvent) {
  4192. if (isNullOrUndefined(event.which)) {
  4193. event.which = !isNullOrUndefined(nativeEvent.charCode) ? nativeEvent.charCode : nativeEvent.keyCode;
  4194. }
  4195. // add metaKey to non-Mac browsers (use ctrl for PC 's and Meta for Macs)
  4196. if (event.metaKey === undefined) {
  4197. event.metaKey = event.ctrlKey;
  4198. }
  4199. }
  4200. }, {
  4201. reg: /^touch/,
  4202. props: ['touches', 'changedTouches', 'targetTouches']
  4203. }, {
  4204. reg: /^hashchange$/,
  4205. props: ['newURL', 'oldURL']
  4206. }, {
  4207. reg: /^gesturechange$/i,
  4208. props: ['rotation', 'scale']
  4209. }, {
  4210. reg: /^(mousewheel|DOMMouseScroll)$/,
  4211. props: [],
  4212. fix: function fix(event, nativeEvent) {
  4213. var deltaX = undefined;
  4214. var deltaY = undefined;
  4215. var delta = undefined;
  4216. var wheelDelta = nativeEvent.wheelDelta;
  4217. var axis = nativeEvent.axis;
  4218. var wheelDeltaY = nativeEvent.wheelDeltaY;
  4219. var wheelDeltaX = nativeEvent.wheelDeltaX;
  4220. var detail = nativeEvent.detail;
  4221. // ie/webkit
  4222. if (wheelDelta) {
  4223. delta = wheelDelta / 120;
  4224. }
  4225. // gecko
  4226. if (detail) {
  4227. // press control e.detail == 1 else e.detail == 3
  4228. delta = 0 - (detail % 3 === 0 ? detail / 3 : detail);
  4229. }
  4230. // Gecko
  4231. if (axis !== undefined) {
  4232. if (axis === event.HORIZONTAL_AXIS) {
  4233. deltaY = 0;
  4234. deltaX = 0 - delta;
  4235. } else if (axis === event.VERTICAL_AXIS) {
  4236. deltaX = 0;
  4237. deltaY = delta;
  4238. }
  4239. }
  4240. // Webkit
  4241. if (wheelDeltaY !== undefined) {
  4242. deltaY = wheelDeltaY / 120;
  4243. }
  4244. if (wheelDeltaX !== undefined) {
  4245. deltaX = -1 * wheelDeltaX / 120;
  4246. }
  4247. // 默认 deltaY (ie)
  4248. if (!deltaX && !deltaY) {
  4249. deltaY = delta;
  4250. }
  4251. if (deltaX !== undefined) {
  4252. /**
  4253. * deltaX of mousewheel event
  4254. * @property deltaX
  4255. * @member Event.DomEvent.Object
  4256. */
  4257. event.deltaX = deltaX;
  4258. }
  4259. if (deltaY !== undefined) {
  4260. /**
  4261. * deltaY of mousewheel event
  4262. * @property deltaY
  4263. * @member Event.DomEvent.Object
  4264. */
  4265. event.deltaY = deltaY;
  4266. }
  4267. if (delta !== undefined) {
  4268. /**
  4269. * delta of mousewheel event
  4270. * @property delta
  4271. * @member Event.DomEvent.Object
  4272. */
  4273. event.delta = delta;
  4274. }
  4275. }
  4276. }, {
  4277. reg: /^mouse|contextmenu|click|mspointer|(^DOMMouseScroll$)/i,
  4278. props: ['buttons', 'clientX', 'clientY', 'button', 'offsetX', 'relatedTarget', 'which', 'fromElement', 'toElement', 'offsetY', 'pageX', 'pageY', 'screenX', 'screenY'],
  4279. fix: function fix(event, nativeEvent) {
  4280. var eventDoc = undefined;
  4281. var doc = undefined;
  4282. var body = undefined;
  4283. var target = event.target;
  4284. var button = nativeEvent.button;
  4285. // Calculate pageX/Y if missing and clientX/Y available
  4286. if (target && isNullOrUndefined(event.pageX) && !isNullOrUndefined(nativeEvent.clientX)) {
  4287. eventDoc = target.ownerDocument || document;
  4288. doc = eventDoc.documentElement;
  4289. body = eventDoc.body;
  4290. event.pageX = nativeEvent.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
  4291. event.pageY = nativeEvent.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
  4292. }
  4293. // which for click: 1 === left; 2 === middle; 3 === right
  4294. // do not use button
  4295. if (!event.which && button !== undefined) {
  4296. if (button & 1) {
  4297. event.which = 1;
  4298. } else if (button & 2) {
  4299. event.which = 3;
  4300. } else if (button & 4) {
  4301. event.which = 2;
  4302. } else {
  4303. event.which = 0;
  4304. }
  4305. }
  4306. // add relatedTarget, if necessary
  4307. if (!event.relatedTarget && event.fromElement) {
  4308. event.relatedTarget = event.fromElement === target ? event.toElement : event.fromElement;
  4309. }
  4310. return event;
  4311. }
  4312. }];
  4313. function retTrue() {
  4314. return TRUE;
  4315. }
  4316. function retFalse() {
  4317. return FALSE;
  4318. }
  4319. function DomEventObject(nativeEvent) {
  4320. var type = nativeEvent.type;
  4321. var isNative = typeof nativeEvent.stopPropagation === 'function' || typeof nativeEvent.cancelBubble === 'boolean';
  4322. _EventBaseObject2['default'].call(this);
  4323. this.nativeEvent = nativeEvent;
  4324. // in case dom event has been mark as default prevented by lower dom node
  4325. var isDefaultPrevented = retFalse;
  4326. if ('defaultPrevented' in nativeEvent) {
  4327. isDefaultPrevented = nativeEvent.defaultPrevented ? retTrue : retFalse;
  4328. } else if ('getPreventDefault' in nativeEvent) {
  4329. // https://bugzilla.mozilla.org/show_bug.cgi?id=691151
  4330. isDefaultPrevented = nativeEvent.getPreventDefault() ? retTrue : retFalse;
  4331. } else if ('returnValue' in nativeEvent) {
  4332. isDefaultPrevented = nativeEvent.returnValue === FALSE ? retTrue : retFalse;
  4333. }
  4334. this.isDefaultPrevented = isDefaultPrevented;
  4335. var fixFns = [];
  4336. var fixFn = undefined;
  4337. var l = undefined;
  4338. var prop = undefined;
  4339. var props = commonProps.concat();
  4340. eventNormalizers.forEach(function (normalizer) {
  4341. if (type.match(normalizer.reg)) {
  4342. props = props.concat(normalizer.props);
  4343. if (normalizer.fix) {
  4344. fixFns.push(normalizer.fix);
  4345. }
  4346. }
  4347. });
  4348. l = props.length;
  4349. // clone properties of the original event object
  4350. while (l) {
  4351. prop = props[--l];
  4352. this[prop] = nativeEvent[prop];
  4353. }
  4354. // fix target property, if necessary
  4355. if (!this.target && isNative) {
  4356. this.target = nativeEvent.srcElement || document; // srcElement might not be defined either
  4357. }
  4358. // check if target is a text node (safari)
  4359. if (this.target && this.target.nodeType === 3) {
  4360. this.target = this.target.parentNode;
  4361. }
  4362. l = fixFns.length;
  4363. while (l) {
  4364. fixFn = fixFns[--l];
  4365. fixFn(this, nativeEvent);
  4366. }
  4367. this.timeStamp = nativeEvent.timeStamp || Date.now();
  4368. }
  4369. var EventBaseObjectProto = _EventBaseObject2['default'].prototype;
  4370. (0, _objectAssign2['default'])(DomEventObject.prototype, EventBaseObjectProto, {
  4371. constructor: DomEventObject,
  4372. preventDefault: function preventDefault() {
  4373. var e = this.nativeEvent;
  4374. // if preventDefault exists run it on the original event
  4375. if (e.preventDefault) {
  4376. e.preventDefault();
  4377. } else {
  4378. // otherwise set the returnValue property of the original event to FALSE (IE)
  4379. e.returnValue = FALSE;
  4380. }
  4381. EventBaseObjectProto.preventDefault.call(this);
  4382. },
  4383. stopPropagation: function stopPropagation() {
  4384. var e = this.nativeEvent;
  4385. // if stopPropagation exists run it on the original event
  4386. if (e.stopPropagation) {
  4387. e.stopPropagation();
  4388. } else {
  4389. // otherwise set the cancelBubble property of the original event to TRUE (IE)
  4390. e.cancelBubble = TRUE;
  4391. }
  4392. EventBaseObjectProto.stopPropagation.call(this);
  4393. }
  4394. });
  4395. exports['default'] = DomEventObject;
  4396. module.exports = exports['default'];
  4397. /***/ }),
  4398. /* 128 */
  4399. /***/ (function(module, exports, __webpack_require__) {
  4400. "use strict";
  4401. /**
  4402. * @ignore
  4403. * base event object for custom and dom event.
  4404. * @author yiminghe@gmail.com
  4405. */
  4406. Object.defineProperty(exports, "__esModule", {
  4407. value: true
  4408. });
  4409. function returnFalse() {
  4410. return false;
  4411. }
  4412. function returnTrue() {
  4413. return true;
  4414. }
  4415. function EventBaseObject() {
  4416. this.timeStamp = Date.now();
  4417. this.target = undefined;
  4418. this.currentTarget = undefined;
  4419. }
  4420. EventBaseObject.prototype = {
  4421. isEventObject: 1,
  4422. constructor: EventBaseObject,
  4423. isDefaultPrevented: returnFalse,
  4424. isPropagationStopped: returnFalse,
  4425. isImmediatePropagationStopped: returnFalse,
  4426. preventDefault: function preventDefault() {
  4427. this.isDefaultPrevented = returnTrue;
  4428. },
  4429. stopPropagation: function stopPropagation() {
  4430. this.isPropagationStopped = returnTrue;
  4431. },
  4432. stopImmediatePropagation: function stopImmediatePropagation() {
  4433. this.isImmediatePropagationStopped = returnTrue;
  4434. // fixed 1.2
  4435. // call stopPropagation implicitly
  4436. this.stopPropagation();
  4437. },
  4438. halt: function halt(immediate) {
  4439. if (immediate) {
  4440. this.stopImmediatePropagation();
  4441. } else {
  4442. this.stopPropagation();
  4443. }
  4444. this.preventDefault();
  4445. }
  4446. };
  4447. exports["default"] = EventBaseObject;
  4448. module.exports = exports["default"];
  4449. /***/ }),
  4450. /* 129 */
  4451. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4452. "use strict";
  4453. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_defineProperty__ = __webpack_require__(13);
  4454. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_defineProperty___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_defineProperty__);
  4455. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends__ = __webpack_require__(5);
  4456. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends__);
  4457. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react__ = __webpack_require__(0);
  4458. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_react__);
  4459. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_prop_types__ = __webpack_require__(1);
  4460. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_prop_types__);
  4461. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_classnames__ = __webpack_require__(22);
  4462. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_classnames__);
  4463. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_warning__ = __webpack_require__(48);
  4464. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_warning___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_warning__);
  4465. var calcPoints = function calcPoints(vertical, marks, dots, step, min, max) {
  4466. __WEBPACK_IMPORTED_MODULE_5_warning___default()(dots ? step > 0 : true, '`Slider[step]` should be a positive number in order to make Slider[dots] work.');
  4467. var points = Object.keys(marks).map(parseFloat).sort(function (a, b) {
  4468. return a - b;
  4469. });
  4470. if (dots && step) {
  4471. for (var i = min; i <= max; i += step) {
  4472. if (points.indexOf(i) === -1) {
  4473. points.push(i);
  4474. }
  4475. }
  4476. }
  4477. return points;
  4478. };
  4479. var Steps = function Steps(_ref) {
  4480. var prefixCls = _ref.prefixCls,
  4481. vertical = _ref.vertical,
  4482. reverse = _ref.reverse,
  4483. marks = _ref.marks,
  4484. dots = _ref.dots,
  4485. step = _ref.step,
  4486. included = _ref.included,
  4487. lowerBound = _ref.lowerBound,
  4488. upperBound = _ref.upperBound,
  4489. max = _ref.max,
  4490. min = _ref.min,
  4491. dotStyle = _ref.dotStyle,
  4492. activeDotStyle = _ref.activeDotStyle;
  4493. var range = max - min;
  4494. var elements = calcPoints(vertical, marks, dots, step, min, max).map(function (point) {
  4495. var _classNames;
  4496. var offset = Math.abs(point - min) / range * 100 + '%';
  4497. var isActived = !included && point === upperBound || included && point <= upperBound && point >= lowerBound;
  4498. var style = vertical ? __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default()({}, dotStyle, __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_defineProperty___default()({}, reverse ? 'top' : 'bottom', offset)) : __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default()({}, dotStyle, __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_defineProperty___default()({}, reverse ? 'right' : 'left', offset));
  4499. if (isActived) {
  4500. style = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default()({}, style, activeDotStyle);
  4501. }
  4502. var pointClassName = __WEBPACK_IMPORTED_MODULE_4_classnames___default()((_classNames = {}, __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_defineProperty___default()(_classNames, prefixCls + '-dot', true), __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_defineProperty___default()(_classNames, prefixCls + '-dot-active', isActived), __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_defineProperty___default()(_classNames, prefixCls + '-dot-reverse', reverse), _classNames));
  4503. return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement('span', { className: pointClassName, style: style, key: point });
  4504. });
  4505. return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(
  4506. 'div',
  4507. { className: prefixCls + '-step' },
  4508. elements
  4509. );
  4510. };
  4511. Steps.propTypes = {
  4512. prefixCls: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.string,
  4513. activeDotStyle: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object,
  4514. dotStyle: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object,
  4515. min: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.number,
  4516. max: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.number,
  4517. upperBound: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.number,
  4518. lowerBound: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.number,
  4519. included: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.bool,
  4520. dots: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.bool,
  4521. step: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.number,
  4522. marks: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object,
  4523. vertical: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.bool,
  4524. reverse: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.bool
  4525. };
  4526. /* harmony default export */ __webpack_exports__["a"] = (Steps);
  4527. /***/ }),
  4528. /* 130 */
  4529. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4530. "use strict";
  4531. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(5);
  4532. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__);
  4533. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty__ = __webpack_require__(13);
  4534. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty__);
  4535. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react__ = __webpack_require__(0);
  4536. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_react__);
  4537. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_prop_types__ = __webpack_require__(1);
  4538. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_prop_types__);
  4539. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_classnames__ = __webpack_require__(22);
  4540. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_classnames__);
  4541. var Marks = function Marks(_ref) {
  4542. var className = _ref.className,
  4543. vertical = _ref.vertical,
  4544. reverse = _ref.reverse,
  4545. marks = _ref.marks,
  4546. included = _ref.included,
  4547. upperBound = _ref.upperBound,
  4548. lowerBound = _ref.lowerBound,
  4549. max = _ref.max,
  4550. min = _ref.min,
  4551. onClickLabel = _ref.onClickLabel;
  4552. var marksKeys = Object.keys(marks);
  4553. var range = max - min;
  4554. var elements = marksKeys.map(parseFloat).sort(function (a, b) {
  4555. return a - b;
  4556. }).map(function (point) {
  4557. var _classNames;
  4558. var markPoint = marks[point];
  4559. var markPointIsObject = typeof markPoint === 'object' && !__WEBPACK_IMPORTED_MODULE_2_react___default.a.isValidElement(markPoint);
  4560. var markLabel = markPointIsObject ? markPoint.label : markPoint;
  4561. if (!markLabel && markLabel !== 0) {
  4562. return null;
  4563. }
  4564. var isActive = !included && point === upperBound || included && point <= upperBound && point >= lowerBound;
  4565. var markClassName = __WEBPACK_IMPORTED_MODULE_4_classnames___default()((_classNames = {}, __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty___default()(_classNames, className + '-text', true), __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty___default()(_classNames, className + '-text-active', isActive), _classNames));
  4566. var bottomStyle = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty___default()({
  4567. marginBottom: '-50%'
  4568. }, reverse ? 'top' : 'bottom', (point - min) / range * 100 + '%');
  4569. var leftStyle = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty___default()({
  4570. transform: 'translateX(-50%)',
  4571. msTransform: 'translateX(-50%)'
  4572. }, reverse ? 'right' : 'left', reverse ? (point - min / 4) / range * 100 + '%' : (point - min) / range * 100 + '%');
  4573. var style = vertical ? bottomStyle : leftStyle;
  4574. var markStyle = markPointIsObject ? __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, style, markPoint.style) : style;
  4575. return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(
  4576. 'span',
  4577. {
  4578. className: markClassName,
  4579. style: markStyle,
  4580. key: point,
  4581. onMouseDown: function onMouseDown(e) {
  4582. return onClickLabel(e, point);
  4583. },
  4584. onTouchStart: function onTouchStart(e) {
  4585. return onClickLabel(e, point);
  4586. }
  4587. },
  4588. markLabel
  4589. );
  4590. });
  4591. return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(
  4592. 'div',
  4593. { className: className },
  4594. elements
  4595. );
  4596. };
  4597. Marks.propTypes = {
  4598. className: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.string,
  4599. vertical: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.bool,
  4600. reverse: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.bool,
  4601. marks: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object,
  4602. included: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.bool,
  4603. upperBound: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.number,
  4604. lowerBound: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.number,
  4605. max: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.number,
  4606. min: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.number,
  4607. onClickLabel: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.func
  4608. };
  4609. /* harmony default export */ __webpack_exports__["a"] = (Marks);
  4610. /***/ }),
  4611. /* 131 */
  4612. /***/ (function(module, exports, __webpack_require__) {
  4613. module.exports = { "default": __webpack_require__(132), __esModule: true };
  4614. /***/ }),
  4615. /* 132 */
  4616. /***/ (function(module, exports, __webpack_require__) {
  4617. __webpack_require__(57);
  4618. __webpack_require__(133);
  4619. module.exports = __webpack_require__(6).Array.from;
  4620. /***/ }),
  4621. /* 133 */
  4622. /***/ (function(module, exports, __webpack_require__) {
  4623. "use strict";
  4624. var ctx = __webpack_require__(32);
  4625. var $export = __webpack_require__(8);
  4626. var toObject = __webpack_require__(24);
  4627. var call = __webpack_require__(134);
  4628. var isArrayIter = __webpack_require__(135);
  4629. var toLength = __webpack_require__(55);
  4630. var createProperty = __webpack_require__(136);
  4631. var getIterFn = __webpack_require__(137);
  4632. $export($export.S + $export.F * !__webpack_require__(139)(function (iter) { Array.from(iter); }), 'Array', {
  4633. // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
  4634. from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
  4635. var O = toObject(arrayLike);
  4636. var C = typeof this == 'function' ? this : Array;
  4637. var aLen = arguments.length;
  4638. var mapfn = aLen > 1 ? arguments[1] : undefined;
  4639. var mapping = mapfn !== undefined;
  4640. var index = 0;
  4641. var iterFn = getIterFn(O);
  4642. var length, result, step, iterator;
  4643. if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);
  4644. // if object isn't iterable or it's array with default iterator - use simple case
  4645. if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) {
  4646. for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) {
  4647. createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);
  4648. }
  4649. } else {
  4650. length = toLength(O.length);
  4651. for (result = new C(length); length > index; index++) {
  4652. createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);
  4653. }
  4654. }
  4655. result.length = index;
  4656. return result;
  4657. }
  4658. });
  4659. /***/ }),
  4660. /* 134 */
  4661. /***/ (function(module, exports, __webpack_require__) {
  4662. // call something on iterator step with safe closing on error
  4663. var anObject = __webpack_require__(18);
  4664. module.exports = function (iterator, fn, value, entries) {
  4665. try {
  4666. return entries ? fn(anObject(value)[0], value[1]) : fn(value);
  4667. // 7.4.6 IteratorClose(iterator, completion)
  4668. } catch (e) {
  4669. var ret = iterator['return'];
  4670. if (ret !== undefined) anObject(ret.call(iterator));
  4671. throw e;
  4672. }
  4673. };
  4674. /***/ }),
  4675. /* 135 */
  4676. /***/ (function(module, exports, __webpack_require__) {
  4677. // check on default Array iterator
  4678. var Iterators = __webpack_require__(25);
  4679. var ITERATOR = __webpack_require__(7)('iterator');
  4680. var ArrayProto = Array.prototype;
  4681. module.exports = function (it) {
  4682. return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
  4683. };
  4684. /***/ }),
  4685. /* 136 */
  4686. /***/ (function(module, exports, __webpack_require__) {
  4687. "use strict";
  4688. var $defineProperty = __webpack_require__(10);
  4689. var createDesc = __webpack_require__(23);
  4690. module.exports = function (object, index, value) {
  4691. if (index in object) $defineProperty.f(object, index, createDesc(0, value));
  4692. else object[index] = value;
  4693. };
  4694. /***/ }),
  4695. /* 137 */
  4696. /***/ (function(module, exports, __webpack_require__) {
  4697. var classof = __webpack_require__(138);
  4698. var ITERATOR = __webpack_require__(7)('iterator');
  4699. var Iterators = __webpack_require__(25);
  4700. module.exports = __webpack_require__(6).getIteratorMethod = function (it) {
  4701. if (it != undefined) return it[ITERATOR]
  4702. || it['@@iterator']
  4703. || Iterators[classof(it)];
  4704. };
  4705. /***/ }),
  4706. /* 138 */
  4707. /***/ (function(module, exports, __webpack_require__) {
  4708. // getting tag from 19.1.3.6 Object.prototype.toString()
  4709. var cof = __webpack_require__(34);
  4710. var TAG = __webpack_require__(7)('toStringTag');
  4711. // ES3 wrong here
  4712. var ARG = cof(function () { return arguments; }()) == 'Arguments';
  4713. // fallback for IE11 Script Access Denied error
  4714. var tryGet = function (it, key) {
  4715. try {
  4716. return it[key];
  4717. } catch (e) { /* empty */ }
  4718. };
  4719. module.exports = function (it) {
  4720. var O, T, B;
  4721. return it === undefined ? 'Undefined' : it === null ? 'Null'
  4722. // @@toStringTag case
  4723. : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
  4724. // builtinTag case
  4725. : ARG ? cof(O)
  4726. // ES3 arguments fallback
  4727. : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
  4728. };
  4729. /***/ }),
  4730. /* 139 */
  4731. /***/ (function(module, exports, __webpack_require__) {
  4732. var ITERATOR = __webpack_require__(7)('iterator');
  4733. var SAFE_CLOSING = false;
  4734. try {
  4735. var riter = [7][ITERATOR]();
  4736. riter['return'] = function () { SAFE_CLOSING = true; };
  4737. // eslint-disable-next-line no-throw-literal
  4738. Array.from(riter, function () { throw 2; });
  4739. } catch (e) { /* empty */ }
  4740. module.exports = function (exec, skipClosing) {
  4741. if (!skipClosing && !SAFE_CLOSING) return false;
  4742. var safe = false;
  4743. try {
  4744. var arr = [7];
  4745. var iter = arr[ITERATOR]();
  4746. iter.next = function () { return { done: safe = true }; };
  4747. arr[ITERATOR] = function () { return iter; };
  4748. exec(arr);
  4749. } catch (e) { /* empty */ }
  4750. return safe;
  4751. };
  4752. /***/ }),
  4753. /* 140 */
  4754. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4755. "use strict";
  4756. /**
  4757. * @ignore
  4758. * some key-codes definition and utils from closure-library
  4759. * @author yiminghe@gmail.com
  4760. */
  4761. var KeyCode = {
  4762. /**
  4763. * MAC_ENTER
  4764. */
  4765. MAC_ENTER: 3,
  4766. /**
  4767. * BACKSPACE
  4768. */
  4769. BACKSPACE: 8,
  4770. /**
  4771. * TAB
  4772. */
  4773. TAB: 9,
  4774. /**
  4775. * NUMLOCK on FF/Safari Mac
  4776. */
  4777. NUM_CENTER: 12,
  4778. // NUMLOCK on FF/Safari Mac
  4779. /**
  4780. * ENTER
  4781. */
  4782. ENTER: 13,
  4783. /**
  4784. * SHIFT
  4785. */
  4786. SHIFT: 16,
  4787. /**
  4788. * CTRL
  4789. */
  4790. CTRL: 17,
  4791. /**
  4792. * ALT
  4793. */
  4794. ALT: 18,
  4795. /**
  4796. * PAUSE
  4797. */
  4798. PAUSE: 19,
  4799. /**
  4800. * CAPS_LOCK
  4801. */
  4802. CAPS_LOCK: 20,
  4803. /**
  4804. * ESC
  4805. */
  4806. ESC: 27,
  4807. /**
  4808. * SPACE
  4809. */
  4810. SPACE: 32,
  4811. /**
  4812. * PAGE_UP
  4813. */
  4814. PAGE_UP: 33,
  4815. // also NUM_NORTH_EAST
  4816. /**
  4817. * PAGE_DOWN
  4818. */
  4819. PAGE_DOWN: 34,
  4820. // also NUM_SOUTH_EAST
  4821. /**
  4822. * END
  4823. */
  4824. END: 35,
  4825. // also NUM_SOUTH_WEST
  4826. /**
  4827. * HOME
  4828. */
  4829. HOME: 36,
  4830. // also NUM_NORTH_WEST
  4831. /**
  4832. * LEFT
  4833. */
  4834. LEFT: 37,
  4835. // also NUM_WEST
  4836. /**
  4837. * UP
  4838. */
  4839. UP: 38,
  4840. // also NUM_NORTH
  4841. /**
  4842. * RIGHT
  4843. */
  4844. RIGHT: 39,
  4845. // also NUM_EAST
  4846. /**
  4847. * DOWN
  4848. */
  4849. DOWN: 40,
  4850. // also NUM_SOUTH
  4851. /**
  4852. * PRINT_SCREEN
  4853. */
  4854. PRINT_SCREEN: 44,
  4855. /**
  4856. * INSERT
  4857. */
  4858. INSERT: 45,
  4859. // also NUM_INSERT
  4860. /**
  4861. * DELETE
  4862. */
  4863. DELETE: 46,
  4864. // also NUM_DELETE
  4865. /**
  4866. * ZERO
  4867. */
  4868. ZERO: 48,
  4869. /**
  4870. * ONE
  4871. */
  4872. ONE: 49,
  4873. /**
  4874. * TWO
  4875. */
  4876. TWO: 50,
  4877. /**
  4878. * THREE
  4879. */
  4880. THREE: 51,
  4881. /**
  4882. * FOUR
  4883. */
  4884. FOUR: 52,
  4885. /**
  4886. * FIVE
  4887. */
  4888. FIVE: 53,
  4889. /**
  4890. * SIX
  4891. */
  4892. SIX: 54,
  4893. /**
  4894. * SEVEN
  4895. */
  4896. SEVEN: 55,
  4897. /**
  4898. * EIGHT
  4899. */
  4900. EIGHT: 56,
  4901. /**
  4902. * NINE
  4903. */
  4904. NINE: 57,
  4905. /**
  4906. * QUESTION_MARK
  4907. */
  4908. QUESTION_MARK: 63,
  4909. // needs localization
  4910. /**
  4911. * A
  4912. */
  4913. A: 65,
  4914. /**
  4915. * B
  4916. */
  4917. B: 66,
  4918. /**
  4919. * C
  4920. */
  4921. C: 67,
  4922. /**
  4923. * D
  4924. */
  4925. D: 68,
  4926. /**
  4927. * E
  4928. */
  4929. E: 69,
  4930. /**
  4931. * F
  4932. */
  4933. F: 70,
  4934. /**
  4935. * G
  4936. */
  4937. G: 71,
  4938. /**
  4939. * H
  4940. */
  4941. H: 72,
  4942. /**
  4943. * I
  4944. */
  4945. I: 73,
  4946. /**
  4947. * J
  4948. */
  4949. J: 74,
  4950. /**
  4951. * K
  4952. */
  4953. K: 75,
  4954. /**
  4955. * L
  4956. */
  4957. L: 76,
  4958. /**
  4959. * M
  4960. */
  4961. M: 77,
  4962. /**
  4963. * N
  4964. */
  4965. N: 78,
  4966. /**
  4967. * O
  4968. */
  4969. O: 79,
  4970. /**
  4971. * P
  4972. */
  4973. P: 80,
  4974. /**
  4975. * Q
  4976. */
  4977. Q: 81,
  4978. /**
  4979. * R
  4980. */
  4981. R: 82,
  4982. /**
  4983. * S
  4984. */
  4985. S: 83,
  4986. /**
  4987. * T
  4988. */
  4989. T: 84,
  4990. /**
  4991. * U
  4992. */
  4993. U: 85,
  4994. /**
  4995. * V
  4996. */
  4997. V: 86,
  4998. /**
  4999. * W
  5000. */
  5001. W: 87,
  5002. /**
  5003. * X
  5004. */
  5005. X: 88,
  5006. /**
  5007. * Y
  5008. */
  5009. Y: 89,
  5010. /**
  5011. * Z
  5012. */
  5013. Z: 90,
  5014. /**
  5015. * META
  5016. */
  5017. META: 91,
  5018. // WIN_KEY_LEFT
  5019. /**
  5020. * WIN_KEY_RIGHT
  5021. */
  5022. WIN_KEY_RIGHT: 92,
  5023. /**
  5024. * CONTEXT_MENU
  5025. */
  5026. CONTEXT_MENU: 93,
  5027. /**
  5028. * NUM_ZERO
  5029. */
  5030. NUM_ZERO: 96,
  5031. /**
  5032. * NUM_ONE
  5033. */
  5034. NUM_ONE: 97,
  5035. /**
  5036. * NUM_TWO
  5037. */
  5038. NUM_TWO: 98,
  5039. /**
  5040. * NUM_THREE
  5041. */
  5042. NUM_THREE: 99,
  5043. /**
  5044. * NUM_FOUR
  5045. */
  5046. NUM_FOUR: 100,
  5047. /**
  5048. * NUM_FIVE
  5049. */
  5050. NUM_FIVE: 101,
  5051. /**
  5052. * NUM_SIX
  5053. */
  5054. NUM_SIX: 102,
  5055. /**
  5056. * NUM_SEVEN
  5057. */
  5058. NUM_SEVEN: 103,
  5059. /**
  5060. * NUM_EIGHT
  5061. */
  5062. NUM_EIGHT: 104,
  5063. /**
  5064. * NUM_NINE
  5065. */
  5066. NUM_NINE: 105,
  5067. /**
  5068. * NUM_MULTIPLY
  5069. */
  5070. NUM_MULTIPLY: 106,
  5071. /**
  5072. * NUM_PLUS
  5073. */
  5074. NUM_PLUS: 107,
  5075. /**
  5076. * NUM_MINUS
  5077. */
  5078. NUM_MINUS: 109,
  5079. /**
  5080. * NUM_PERIOD
  5081. */
  5082. NUM_PERIOD: 110,
  5083. /**
  5084. * NUM_DIVISION
  5085. */
  5086. NUM_DIVISION: 111,
  5087. /**
  5088. * F1
  5089. */
  5090. F1: 112,
  5091. /**
  5092. * F2
  5093. */
  5094. F2: 113,
  5095. /**
  5096. * F3
  5097. */
  5098. F3: 114,
  5099. /**
  5100. * F4
  5101. */
  5102. F4: 115,
  5103. /**
  5104. * F5
  5105. */
  5106. F5: 116,
  5107. /**
  5108. * F6
  5109. */
  5110. F6: 117,
  5111. /**
  5112. * F7
  5113. */
  5114. F7: 118,
  5115. /**
  5116. * F8
  5117. */
  5118. F8: 119,
  5119. /**
  5120. * F9
  5121. */
  5122. F9: 120,
  5123. /**
  5124. * F10
  5125. */
  5126. F10: 121,
  5127. /**
  5128. * F11
  5129. */
  5130. F11: 122,
  5131. /**
  5132. * F12
  5133. */
  5134. F12: 123,
  5135. /**
  5136. * NUMLOCK
  5137. */
  5138. NUMLOCK: 144,
  5139. /**
  5140. * SEMICOLON
  5141. */
  5142. SEMICOLON: 186,
  5143. // needs localization
  5144. /**
  5145. * DASH
  5146. */
  5147. DASH: 189,
  5148. // needs localization
  5149. /**
  5150. * EQUALS
  5151. */
  5152. EQUALS: 187,
  5153. // needs localization
  5154. /**
  5155. * COMMA
  5156. */
  5157. COMMA: 188,
  5158. // needs localization
  5159. /**
  5160. * PERIOD
  5161. */
  5162. PERIOD: 190,
  5163. // needs localization
  5164. /**
  5165. * SLASH
  5166. */
  5167. SLASH: 191,
  5168. // needs localization
  5169. /**
  5170. * APOSTROPHE
  5171. */
  5172. APOSTROPHE: 192,
  5173. // needs localization
  5174. /**
  5175. * SINGLE_QUOTE
  5176. */
  5177. SINGLE_QUOTE: 222,
  5178. // needs localization
  5179. /**
  5180. * OPEN_SQUARE_BRACKET
  5181. */
  5182. OPEN_SQUARE_BRACKET: 219,
  5183. // needs localization
  5184. /**
  5185. * BACKSLASH
  5186. */
  5187. BACKSLASH: 220,
  5188. // needs localization
  5189. /**
  5190. * CLOSE_SQUARE_BRACKET
  5191. */
  5192. CLOSE_SQUARE_BRACKET: 221,
  5193. // needs localization
  5194. /**
  5195. * WIN_KEY
  5196. */
  5197. WIN_KEY: 224,
  5198. /**
  5199. * MAC_FF_META
  5200. */
  5201. MAC_FF_META: 224,
  5202. // Firefox (Gecko) fires this for the meta key instead of 91
  5203. /**
  5204. * WIN_IME
  5205. */
  5206. WIN_IME: 229
  5207. };
  5208. /*
  5209. whether text and modified key is entered at the same time.
  5210. */
  5211. KeyCode.isTextModifyingKeyEvent = function isTextModifyingKeyEvent(e) {
  5212. var keyCode = e.keyCode;
  5213. if (e.altKey && !e.ctrlKey || e.metaKey || // Function keys don't generate text
  5214. keyCode >= KeyCode.F1 && keyCode <= KeyCode.F12) {
  5215. return false;
  5216. } // The following keys are quite harmless, even in combination with
  5217. // CTRL, ALT or SHIFT.
  5218. switch (keyCode) {
  5219. case KeyCode.ALT:
  5220. case KeyCode.CAPS_LOCK:
  5221. case KeyCode.CONTEXT_MENU:
  5222. case KeyCode.CTRL:
  5223. case KeyCode.DOWN:
  5224. case KeyCode.END:
  5225. case KeyCode.ESC:
  5226. case KeyCode.HOME:
  5227. case KeyCode.INSERT:
  5228. case KeyCode.LEFT:
  5229. case KeyCode.MAC_FF_META:
  5230. case KeyCode.META:
  5231. case KeyCode.NUMLOCK:
  5232. case KeyCode.NUM_CENTER:
  5233. case KeyCode.PAGE_DOWN:
  5234. case KeyCode.PAGE_UP:
  5235. case KeyCode.PAUSE:
  5236. case KeyCode.PRINT_SCREEN:
  5237. case KeyCode.RIGHT:
  5238. case KeyCode.SHIFT:
  5239. case KeyCode.UP:
  5240. case KeyCode.WIN_KEY:
  5241. case KeyCode.WIN_KEY_RIGHT:
  5242. return false;
  5243. default:
  5244. return true;
  5245. }
  5246. };
  5247. /*
  5248. whether character is entered.
  5249. */
  5250. KeyCode.isCharacterKey = function isCharacterKey(keyCode) {
  5251. if (keyCode >= KeyCode.ZERO && keyCode <= KeyCode.NINE) {
  5252. return true;
  5253. }
  5254. if (keyCode >= KeyCode.NUM_ZERO && keyCode <= KeyCode.NUM_MULTIPLY) {
  5255. return true;
  5256. }
  5257. if (keyCode >= KeyCode.A && keyCode <= KeyCode.Z) {
  5258. return true;
  5259. } // Safari sends zero key code for non-latin characters.
  5260. if (window.navigation.userAgent.indexOf('WebKit') !== -1 && keyCode === 0) {
  5261. return true;
  5262. }
  5263. switch (keyCode) {
  5264. case KeyCode.SPACE:
  5265. case KeyCode.QUESTION_MARK:
  5266. case KeyCode.NUM_PLUS:
  5267. case KeyCode.NUM_MINUS:
  5268. case KeyCode.NUM_PERIOD:
  5269. case KeyCode.NUM_DIVISION:
  5270. case KeyCode.SEMICOLON:
  5271. case KeyCode.DASH:
  5272. case KeyCode.EQUALS:
  5273. case KeyCode.COMMA:
  5274. case KeyCode.PERIOD:
  5275. case KeyCode.SLASH:
  5276. case KeyCode.APOSTROPHE:
  5277. case KeyCode.SINGLE_QUOTE:
  5278. case KeyCode.OPEN_SQUARE_BRACKET:
  5279. case KeyCode.BACKSLASH:
  5280. case KeyCode.CLOSE_SQUARE_BRACKET:
  5281. return true;
  5282. default:
  5283. return false;
  5284. }
  5285. };
  5286. /* harmony default export */ __webpack_exports__["a"] = (KeyCode);
  5287. /***/ }),
  5288. /* 141 */
  5289. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5290. "use strict";
  5291. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_defineProperty__ = __webpack_require__(13);
  5292. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_defineProperty___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_defineProperty__);
  5293. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends__ = __webpack_require__(5);
  5294. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends__);
  5295. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_toConsumableArray__ = __webpack_require__(67);
  5296. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_toConsumableArray___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_toConsumableArray__);
  5297. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_classCallCheck__ = __webpack_require__(2);
  5298. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_classCallCheck__);
  5299. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_createClass__ = __webpack_require__(12);
  5300. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_createClass___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_createClass__);
  5301. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(3);
  5302. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_babel_runtime_helpers_possibleConstructorReturn__);
  5303. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_babel_runtime_helpers_inherits__ = __webpack_require__(4);
  5304. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_babel_runtime_helpers_inherits__);
  5305. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_react__ = __webpack_require__(0);
  5306. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_react__);
  5307. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_prop_types__ = __webpack_require__(1);
  5308. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_prop_types__);
  5309. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_classnames__ = __webpack_require__(22);
  5310. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_classnames__);
  5311. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_react_lifecycles_compat__ = __webpack_require__(68);
  5312. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_shallowequal__ = __webpack_require__(142);
  5313. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_shallowequal___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_11_shallowequal__);
  5314. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__common_Track__ = __webpack_require__(64);
  5315. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__common_createSlider__ = __webpack_require__(65);
  5316. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__utils__ = __webpack_require__(50);
  5317. /* eslint-disable react/prop-types */
  5318. var _trimAlignValue = function _trimAlignValue(_ref) {
  5319. var value = _ref.value,
  5320. handle = _ref.handle,
  5321. bounds = _ref.bounds,
  5322. props = _ref.props;
  5323. var allowCross = props.allowCross,
  5324. pushable = props.pushable;
  5325. var thershold = Number(pushable);
  5326. var valInRange = __WEBPACK_IMPORTED_MODULE_14__utils__["a" /* ensureValueInRange */](value, props);
  5327. var valNotConflict = valInRange;
  5328. if (!allowCross && handle != null && bounds !== undefined) {
  5329. if (handle > 0 && valInRange <= bounds[handle - 1] + thershold) {
  5330. valNotConflict = bounds[handle - 1] + thershold;
  5331. }
  5332. if (handle < bounds.length - 1 && valInRange >= bounds[handle + 1] - thershold) {
  5333. valNotConflict = bounds[handle + 1] - thershold;
  5334. }
  5335. }
  5336. return __WEBPACK_IMPORTED_MODULE_14__utils__["b" /* ensureValuePrecision */](valNotConflict, props);
  5337. };
  5338. var Range = function (_React$Component) {
  5339. __WEBPACK_IMPORTED_MODULE_6_babel_runtime_helpers_inherits___default()(Range, _React$Component);
  5340. function Range(props) {
  5341. __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_classCallCheck___default()(this, Range);
  5342. var _this = __WEBPACK_IMPORTED_MODULE_5_babel_runtime_helpers_possibleConstructorReturn___default()(this, (Range.__proto__ || Object.getPrototypeOf(Range)).call(this, props));
  5343. _this.onEnd = function (force) {
  5344. var handle = _this.state.handle;
  5345. _this.removeDocumentEvents();
  5346. if (handle !== null || force) {
  5347. _this.props.onAfterChange(_this.getValue());
  5348. }
  5349. _this.setState({
  5350. handle: null
  5351. });
  5352. };
  5353. var count = props.count,
  5354. min = props.min,
  5355. max = props.max;
  5356. var initialValue = Array.apply(undefined, __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_toConsumableArray___default()(Array(count + 1))).map(function () {
  5357. return min;
  5358. });
  5359. var defaultValue = 'defaultValue' in props ? props.defaultValue : initialValue;
  5360. var value = props.value !== undefined ? props.value : defaultValue;
  5361. var bounds = value.map(function (v, i) {
  5362. return _trimAlignValue({
  5363. value: v,
  5364. handle: i,
  5365. props: props
  5366. });
  5367. });
  5368. var recent = bounds[0] === max ? 0 : bounds.length - 1;
  5369. _this.state = {
  5370. handle: null,
  5371. recent: recent,
  5372. bounds: bounds
  5373. };
  5374. return _this;
  5375. }
  5376. __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_createClass___default()(Range, [{
  5377. key: 'componentDidUpdate',
  5378. value: function componentDidUpdate(prevProps, prevState) {
  5379. var _this2 = this;
  5380. if (!('value' in this.props || 'min' in this.props || 'max' in this.props)) {
  5381. return;
  5382. }
  5383. if (this.props.min === prevProps.min && this.props.max === prevProps.max && __WEBPACK_IMPORTED_MODULE_11_shallowequal___default()(this.props.value, prevProps.value)) {
  5384. return;
  5385. }
  5386. var _props = this.props,
  5387. onChange = _props.onChange,
  5388. value = _props.value;
  5389. var currentValue = value || prevState.bounds;
  5390. if (currentValue.some(function (v) {
  5391. return __WEBPACK_IMPORTED_MODULE_14__utils__["i" /* isValueOutOfRange */](v, _this2.props);
  5392. })) {
  5393. var newValues = currentValue.map(function (v) {
  5394. return __WEBPACK_IMPORTED_MODULE_14__utils__["a" /* ensureValueInRange */](v, _this2.props);
  5395. });
  5396. onChange(newValues);
  5397. }
  5398. }
  5399. }, {
  5400. key: 'onChange',
  5401. value: function onChange(state) {
  5402. var props = this.props;
  5403. var isNotControlled = !('value' in props);
  5404. if (isNotControlled) {
  5405. this.setState(state);
  5406. } else {
  5407. var controlledState = {};
  5408. ['handle', 'recent'].forEach(function (item) {
  5409. if (state[item] !== undefined) {
  5410. controlledState[item] = state[item];
  5411. }
  5412. });
  5413. if (Object.keys(controlledState).length) {
  5414. this.setState(controlledState);
  5415. }
  5416. }
  5417. var data = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default()({}, this.state, state);
  5418. var changedValue = data.bounds;
  5419. props.onChange(changedValue);
  5420. }
  5421. }, {
  5422. key: 'onStart',
  5423. value: function onStart(position) {
  5424. var props = this.props;
  5425. var state = this.state;
  5426. var bounds = this.getValue();
  5427. props.onBeforeChange(bounds);
  5428. var value = this.calcValueByPos(position);
  5429. this.startValue = value;
  5430. this.startPosition = position;
  5431. var closestBound = this.getClosestBound(value);
  5432. this.prevMovedHandleIndex = this.getBoundNeedMoving(value, closestBound);
  5433. this.setState({
  5434. handle: this.prevMovedHandleIndex,
  5435. recent: this.prevMovedHandleIndex
  5436. });
  5437. var prevValue = bounds[this.prevMovedHandleIndex];
  5438. if (value === prevValue) return;
  5439. var nextBounds = [].concat(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_toConsumableArray___default()(state.bounds));
  5440. nextBounds[this.prevMovedHandleIndex] = value;
  5441. this.onChange({ bounds: nextBounds });
  5442. }
  5443. }, {
  5444. key: 'onMove',
  5445. value: function onMove(e, position) {
  5446. __WEBPACK_IMPORTED_MODULE_14__utils__["j" /* pauseEvent */](e);
  5447. var state = this.state;
  5448. var value = this.calcValueByPos(position);
  5449. var oldValue = state.bounds[state.handle];
  5450. if (value === oldValue) return;
  5451. this.moveTo(value);
  5452. }
  5453. }, {
  5454. key: 'onKeyboard',
  5455. value: function onKeyboard(e) {
  5456. var _props2 = this.props,
  5457. reverse = _props2.reverse,
  5458. vertical = _props2.vertical;
  5459. var valueMutator = __WEBPACK_IMPORTED_MODULE_14__utils__["d" /* getKeyboardValueMutator */](e, vertical, reverse);
  5460. if (valueMutator) {
  5461. __WEBPACK_IMPORTED_MODULE_14__utils__["j" /* pauseEvent */](e);
  5462. var state = this.state,
  5463. props = this.props;
  5464. var bounds = state.bounds,
  5465. handle = state.handle;
  5466. var oldValue = bounds[handle === null ? state.recent : handle];
  5467. var mutatedValue = valueMutator(oldValue, props);
  5468. var value = _trimAlignValue({
  5469. value: mutatedValue,
  5470. handle: handle,
  5471. bounds: state.bounds,
  5472. props: props
  5473. });
  5474. if (value === oldValue) return;
  5475. var isFromKeyboardEvent = true;
  5476. this.moveTo(value, isFromKeyboardEvent);
  5477. }
  5478. }
  5479. }, {
  5480. key: 'getValue',
  5481. value: function getValue() {
  5482. return this.state.bounds;
  5483. }
  5484. }, {
  5485. key: 'getClosestBound',
  5486. value: function getClosestBound(value) {
  5487. var bounds = this.state.bounds;
  5488. var closestBound = 0;
  5489. for (var i = 1; i < bounds.length - 1; ++i) {
  5490. if (value >= bounds[i]) {
  5491. closestBound = i;
  5492. }
  5493. }
  5494. if (Math.abs(bounds[closestBound + 1] - value) < Math.abs(bounds[closestBound] - value)) {
  5495. closestBound += 1;
  5496. }
  5497. return closestBound;
  5498. }
  5499. }, {
  5500. key: 'getBoundNeedMoving',
  5501. value: function getBoundNeedMoving(value, closestBound) {
  5502. var _state = this.state,
  5503. bounds = _state.bounds,
  5504. recent = _state.recent;
  5505. var boundNeedMoving = closestBound;
  5506. var isAtTheSamePoint = bounds[closestBound + 1] === bounds[closestBound];
  5507. if (isAtTheSamePoint && bounds[recent] === bounds[closestBound]) {
  5508. boundNeedMoving = recent;
  5509. }
  5510. if (isAtTheSamePoint && value !== bounds[closestBound + 1]) {
  5511. boundNeedMoving = value < bounds[closestBound + 1] ? closestBound : closestBound + 1;
  5512. }
  5513. return boundNeedMoving;
  5514. }
  5515. }, {
  5516. key: 'getLowerBound',
  5517. value: function getLowerBound() {
  5518. return this.state.bounds[0];
  5519. }
  5520. }, {
  5521. key: 'getUpperBound',
  5522. value: function getUpperBound() {
  5523. var bounds = this.state.bounds;
  5524. return bounds[bounds.length - 1];
  5525. }
  5526. /**
  5527. * Returns an array of possible slider points, taking into account both
  5528. * `marks` and `step`. The result is cached.
  5529. */
  5530. }, {
  5531. key: 'getPoints',
  5532. value: function getPoints() {
  5533. var _props3 = this.props,
  5534. marks = _props3.marks,
  5535. step = _props3.step,
  5536. min = _props3.min,
  5537. max = _props3.max;
  5538. var cache = this._getPointsCache;
  5539. if (!cache || cache.marks !== marks || cache.step !== step) {
  5540. var pointsObject = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default()({}, marks);
  5541. if (step !== null) {
  5542. for (var point = min; point <= max; point += step) {
  5543. pointsObject[point] = point;
  5544. }
  5545. }
  5546. var points = Object.keys(pointsObject).map(parseFloat);
  5547. points.sort(function (a, b) {
  5548. return a - b;
  5549. });
  5550. this._getPointsCache = { marks: marks, step: step, points: points };
  5551. }
  5552. return this._getPointsCache.points;
  5553. }
  5554. }, {
  5555. key: 'moveTo',
  5556. value: function moveTo(value, isFromKeyboardEvent) {
  5557. var _this3 = this;
  5558. var state = this.state,
  5559. props = this.props;
  5560. var nextBounds = [].concat(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_toConsumableArray___default()(state.bounds));
  5561. var handle = state.handle === null ? state.recent : state.handle;
  5562. nextBounds[handle] = value;
  5563. var nextHandle = handle;
  5564. if (props.pushable !== false) {
  5565. this.pushSurroundingHandles(nextBounds, nextHandle);
  5566. } else if (props.allowCross) {
  5567. nextBounds.sort(function (a, b) {
  5568. return a - b;
  5569. });
  5570. nextHandle = nextBounds.indexOf(value);
  5571. }
  5572. this.onChange({
  5573. recent: nextHandle,
  5574. handle: nextHandle,
  5575. bounds: nextBounds
  5576. });
  5577. if (isFromKeyboardEvent) {
  5578. // known problem: because setState is async,
  5579. // so trigger focus will invoke handler's onEnd and another handler's onStart too early,
  5580. // cause onBeforeChange and onAfterChange receive wrong value.
  5581. // here use setState callback to hack,but not elegant
  5582. this.props.onAfterChange(nextBounds);
  5583. this.setState({}, function () {
  5584. _this3.handlesRefs[nextHandle].focus();
  5585. });
  5586. this.onEnd();
  5587. }
  5588. }
  5589. }, {
  5590. key: 'pushSurroundingHandles',
  5591. value: function pushSurroundingHandles(bounds, handle) {
  5592. var value = bounds[handle];
  5593. var threshold = this.props.pushable;
  5594. threshold = Number(threshold);
  5595. var direction = 0;
  5596. if (bounds[handle + 1] - value < threshold) {
  5597. direction = +1; // push to right
  5598. }
  5599. if (value - bounds[handle - 1] < threshold) {
  5600. direction = -1; // push to left
  5601. }
  5602. if (direction === 0) {
  5603. return;
  5604. }
  5605. var nextHandle = handle + direction;
  5606. var diffToNext = direction * (bounds[nextHandle] - value);
  5607. if (!this.pushHandle(bounds, nextHandle, direction, threshold - diffToNext)) {
  5608. // revert to original value if pushing is impossible
  5609. bounds[handle] = bounds[nextHandle] - direction * threshold;
  5610. }
  5611. }
  5612. }, {
  5613. key: 'pushHandle',
  5614. value: function pushHandle(bounds, handle, direction, amount) {
  5615. var originalValue = bounds[handle];
  5616. var currentValue = bounds[handle];
  5617. while (direction * (currentValue - originalValue) < amount) {
  5618. if (!this.pushHandleOnePoint(bounds, handle, direction)) {
  5619. // can't push handle enough to create the needed `amount` gap, so we
  5620. // revert its position to the original value
  5621. bounds[handle] = originalValue;
  5622. return false;
  5623. }
  5624. currentValue = bounds[handle];
  5625. }
  5626. // the handle was pushed enough to create the needed `amount` gap
  5627. return true;
  5628. }
  5629. }, {
  5630. key: 'pushHandleOnePoint',
  5631. value: function pushHandleOnePoint(bounds, handle, direction) {
  5632. var points = this.getPoints();
  5633. var pointIndex = points.indexOf(bounds[handle]);
  5634. var nextPointIndex = pointIndex + direction;
  5635. if (nextPointIndex >= points.length || nextPointIndex < 0) {
  5636. // reached the minimum or maximum available point, can't push anymore
  5637. return false;
  5638. }
  5639. var nextHandle = handle + direction;
  5640. var nextValue = points[nextPointIndex];
  5641. var threshold = this.props.pushable;
  5642. var diffToNext = direction * (bounds[nextHandle] - nextValue);
  5643. if (!this.pushHandle(bounds, nextHandle, direction, threshold - diffToNext)) {
  5644. // couldn't push next handle, so we won't push this one either
  5645. return false;
  5646. }
  5647. // push the handle
  5648. bounds[handle] = nextValue;
  5649. return true;
  5650. }
  5651. }, {
  5652. key: 'trimAlignValue',
  5653. value: function trimAlignValue(value) {
  5654. var _state2 = this.state,
  5655. handle = _state2.handle,
  5656. bounds = _state2.bounds;
  5657. return _trimAlignValue({
  5658. value: value,
  5659. handle: handle,
  5660. bounds: bounds,
  5661. props: this.props
  5662. });
  5663. }
  5664. }, {
  5665. key: 'render',
  5666. value: function render() {
  5667. var _this4 = this;
  5668. var _state3 = this.state,
  5669. handle = _state3.handle,
  5670. bounds = _state3.bounds;
  5671. var _props4 = this.props,
  5672. prefixCls = _props4.prefixCls,
  5673. vertical = _props4.vertical,
  5674. included = _props4.included,
  5675. disabled = _props4.disabled,
  5676. min = _props4.min,
  5677. max = _props4.max,
  5678. reverse = _props4.reverse,
  5679. handleGenerator = _props4.handle,
  5680. trackStyle = _props4.trackStyle,
  5681. handleStyle = _props4.handleStyle,
  5682. tabIndex = _props4.tabIndex;
  5683. var offsets = bounds.map(function (v) {
  5684. return _this4.calcOffset(v);
  5685. });
  5686. var handleClassName = prefixCls + '-handle';
  5687. var handles = bounds.map(function (v, i) {
  5688. var _classNames;
  5689. var _tabIndex = tabIndex[i] || 0;
  5690. if (disabled || tabIndex[i] === null) {
  5691. _tabIndex = null;
  5692. }
  5693. return handleGenerator({
  5694. className: __WEBPACK_IMPORTED_MODULE_9_classnames___default()((_classNames = {}, __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_defineProperty___default()(_classNames, handleClassName, true), __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_defineProperty___default()(_classNames, handleClassName + '-' + (i + 1), true), _classNames)),
  5695. prefixCls: prefixCls,
  5696. vertical: vertical,
  5697. offset: offsets[i],
  5698. value: v,
  5699. dragging: handle === i,
  5700. index: i,
  5701. tabIndex: _tabIndex,
  5702. min: min,
  5703. max: max,
  5704. reverse: reverse,
  5705. disabled: disabled,
  5706. style: handleStyle[i],
  5707. ref: function ref(h) {
  5708. return _this4.saveHandle(i, h);
  5709. }
  5710. });
  5711. });
  5712. var tracks = bounds.slice(0, -1).map(function (_, index) {
  5713. var _classNames2;
  5714. var i = index + 1;
  5715. var trackClassName = __WEBPACK_IMPORTED_MODULE_9_classnames___default()((_classNames2 = {}, __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_defineProperty___default()(_classNames2, prefixCls + '-track', true), __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_defineProperty___default()(_classNames2, prefixCls + '-track-' + i, true), _classNames2));
  5716. return __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_12__common_Track__["a" /* default */], {
  5717. className: trackClassName,
  5718. vertical: vertical,
  5719. reverse: reverse,
  5720. included: included,
  5721. offset: offsets[i - 1],
  5722. length: offsets[i] - offsets[i - 1],
  5723. style: trackStyle[index],
  5724. key: i
  5725. });
  5726. });
  5727. return { tracks: tracks, handles: handles };
  5728. }
  5729. }], [{
  5730. key: 'getDerivedStateFromProps',
  5731. value: function getDerivedStateFromProps(props, state) {
  5732. if ('value' in props || 'min' in props || 'max' in props) {
  5733. var value = props.value || state.bounds;
  5734. var nextBounds = value.map(function (v, i) {
  5735. return _trimAlignValue({
  5736. value: v,
  5737. handle: i,
  5738. bounds: state.bounds,
  5739. props: props
  5740. });
  5741. });
  5742. if (nextBounds.length === state.bounds.length && nextBounds.every(function (v, i) {
  5743. return v === state.bounds[i];
  5744. })) {
  5745. return null;
  5746. }
  5747. return __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default()({}, state, {
  5748. bounds: nextBounds
  5749. });
  5750. }
  5751. return null;
  5752. }
  5753. }]);
  5754. return Range;
  5755. }(__WEBPACK_IMPORTED_MODULE_7_react___default.a.Component);
  5756. Range.displayName = 'Range';
  5757. Range.propTypes = {
  5758. autoFocus: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.bool,
  5759. defaultValue: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.arrayOf(__WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.number),
  5760. value: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.arrayOf(__WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.number),
  5761. count: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.number,
  5762. pushable: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.bool, __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.number]),
  5763. allowCross: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.bool,
  5764. disabled: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.bool,
  5765. reverse: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.bool,
  5766. tabIndex: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.arrayOf(__WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.number),
  5767. min: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.number,
  5768. max: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.number
  5769. };
  5770. Range.defaultProps = {
  5771. count: 1,
  5772. allowCross: true,
  5773. pushable: false,
  5774. tabIndex: []
  5775. };
  5776. Object(__WEBPACK_IMPORTED_MODULE_10_react_lifecycles_compat__["a" /* polyfill */])(Range);
  5777. /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_13__common_createSlider__["a" /* default */])(Range));
  5778. /***/ }),
  5779. /* 142 */
  5780. /***/ (function(module, exports) {
  5781. //
  5782. module.exports = function shallowEqual(objA, objB, compare, compareContext) {
  5783. var ret = compare ? compare.call(compareContext, objA, objB) : void 0;
  5784. if (ret !== void 0) {
  5785. return !!ret;
  5786. }
  5787. if (objA === objB) {
  5788. return true;
  5789. }
  5790. if (typeof objA !== "object" || !objA || typeof objB !== "object" || !objB) {
  5791. return false;
  5792. }
  5793. var keysA = Object.keys(objA);
  5794. var keysB = Object.keys(objB);
  5795. if (keysA.length !== keysB.length) {
  5796. return false;
  5797. }
  5798. var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB);
  5799. // Test for A's keys different from B.
  5800. for (var idx = 0; idx < keysA.length; idx++) {
  5801. var key = keysA[idx];
  5802. if (!bHasOwnProperty(key)) {
  5803. return false;
  5804. }
  5805. var valueA = objA[key];
  5806. var valueB = objB[key];
  5807. ret = compare ? compare.call(compareContext, valueA, valueB, key) : void 0;
  5808. if (ret === false || (ret === void 0 && valueA !== valueB)) {
  5809. return false;
  5810. }
  5811. }
  5812. return true;
  5813. };
  5814. /***/ }),
  5815. /* 143 */
  5816. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5817. "use strict";
  5818. /* harmony export (immutable) */ __webpack_exports__["a"] = createSliderWithTooltip;
  5819. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_objectWithoutProperties__ = __webpack_require__(26);
  5820. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_objectWithoutProperties___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_objectWithoutProperties__);
  5821. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty__ = __webpack_require__(13);
  5822. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty__);
  5823. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_extends__ = __webpack_require__(5);
  5824. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_extends__);
  5825. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_classCallCheck__ = __webpack_require__(2);
  5826. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_classCallCheck__);
  5827. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_createClass__ = __webpack_require__(12);
  5828. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_createClass___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_createClass__);
  5829. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(3);
  5830. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_babel_runtime_helpers_possibleConstructorReturn__);
  5831. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_babel_runtime_helpers_inherits__ = __webpack_require__(4);
  5832. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_babel_runtime_helpers_inherits__);
  5833. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_react__ = __webpack_require__(0);
  5834. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_react__);
  5835. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_prop_types__ = __webpack_require__(1);
  5836. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_prop_types__);
  5837. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_rc_tooltip__ = __webpack_require__(144);
  5838. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__Handle__ = __webpack_require__(49);
  5839. function createSliderWithTooltip(Component) {
  5840. var _class, _temp2;
  5841. return _temp2 = _class = function (_React$Component) {
  5842. __WEBPACK_IMPORTED_MODULE_6_babel_runtime_helpers_inherits___default()(ComponentWrapper, _React$Component);
  5843. function ComponentWrapper() {
  5844. var _ref;
  5845. var _temp, _this, _ret;
  5846. __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_classCallCheck___default()(this, ComponentWrapper);
  5847. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  5848. args[_key] = arguments[_key];
  5849. }
  5850. return _ret = (_temp = (_this = __WEBPACK_IMPORTED_MODULE_5_babel_runtime_helpers_possibleConstructorReturn___default()(this, (_ref = ComponentWrapper.__proto__ || Object.getPrototypeOf(ComponentWrapper)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
  5851. visibles: {}
  5852. }, _this.handleTooltipVisibleChange = function (index, visible) {
  5853. _this.setState(function (prevState) {
  5854. return {
  5855. visibles: __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_extends___default()({}, prevState.visibles, __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty___default()({}, index, visible))
  5856. };
  5857. });
  5858. }, _this.handleWithTooltip = function (_ref2) {
  5859. var value = _ref2.value,
  5860. dragging = _ref2.dragging,
  5861. index = _ref2.index,
  5862. disabled = _ref2.disabled,
  5863. restProps = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_objectWithoutProperties___default()(_ref2, ['value', 'dragging', 'index', 'disabled']);
  5864. var _this$props = _this.props,
  5865. tipFormatter = _this$props.tipFormatter,
  5866. tipProps = _this$props.tipProps,
  5867. handleStyle = _this$props.handleStyle;
  5868. var _tipProps$prefixCls = tipProps.prefixCls,
  5869. prefixCls = _tipProps$prefixCls === undefined ? 'rc-slider-tooltip' : _tipProps$prefixCls,
  5870. _tipProps$overlay = tipProps.overlay,
  5871. overlay = _tipProps$overlay === undefined ? tipFormatter(value) : _tipProps$overlay,
  5872. _tipProps$placement = tipProps.placement,
  5873. placement = _tipProps$placement === undefined ? 'top' : _tipProps$placement,
  5874. _tipProps$visible = tipProps.visible,
  5875. visible = _tipProps$visible === undefined ? false : _tipProps$visible,
  5876. restTooltipProps = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_objectWithoutProperties___default()(tipProps, ['prefixCls', 'overlay', 'placement', 'visible']);
  5877. var handleStyleWithIndex = void 0;
  5878. if (Array.isArray(handleStyle)) {
  5879. handleStyleWithIndex = handleStyle[index] || handleStyle[0];
  5880. } else {
  5881. handleStyleWithIndex = handleStyle;
  5882. }
  5883. return __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement(
  5884. __WEBPACK_IMPORTED_MODULE_9_rc_tooltip__["a" /* default */],
  5885. __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_extends___default()({}, restTooltipProps, {
  5886. prefixCls: prefixCls,
  5887. overlay: overlay,
  5888. placement: placement,
  5889. visible: !disabled && (_this.state.visibles[index] || dragging) || visible,
  5890. key: index
  5891. }),
  5892. __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_10__Handle__["a" /* default */], __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_extends___default()({}, restProps, {
  5893. style: __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_extends___default()({}, handleStyleWithIndex),
  5894. value: value,
  5895. onMouseEnter: function onMouseEnter() {
  5896. return _this.handleTooltipVisibleChange(index, true);
  5897. },
  5898. onMouseLeave: function onMouseLeave() {
  5899. return _this.handleTooltipVisibleChange(index, false);
  5900. }
  5901. }))
  5902. );
  5903. }, _temp), __WEBPACK_IMPORTED_MODULE_5_babel_runtime_helpers_possibleConstructorReturn___default()(_this, _ret);
  5904. }
  5905. __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_createClass___default()(ComponentWrapper, [{
  5906. key: 'render',
  5907. value: function render() {
  5908. return __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement(Component, __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_extends___default()({}, this.props, { handle: this.handleWithTooltip }));
  5909. }
  5910. }]);
  5911. return ComponentWrapper;
  5912. }(__WEBPACK_IMPORTED_MODULE_7_react___default.a.Component), _class.propTypes = {
  5913. tipFormatter: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.func,
  5914. handleStyle: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.object, __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.arrayOf(__WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.object)]),
  5915. tipProps: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.object
  5916. }, _class.defaultProps = {
  5917. tipFormatter: function tipFormatter(value) {
  5918. return value;
  5919. },
  5920. handleStyle: [{}],
  5921. tipProps: {}
  5922. }, _temp2;
  5923. }
  5924. /***/ }),
  5925. /* 144 */
  5926. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5927. "use strict";
  5928. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Tooltip__ = __webpack_require__(145);
  5929. /* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0__Tooltip__["a" /* default */]);
  5930. /***/ }),
  5931. /* 145 */
  5932. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5933. "use strict";
  5934. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(5);
  5935. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__);
  5936. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties__ = __webpack_require__(26);
  5937. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties__);
  5938. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck__ = __webpack_require__(2);
  5939. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck__);
  5940. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(3);
  5941. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__);
  5942. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__ = __webpack_require__(4);
  5943. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__);
  5944. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react__ = __webpack_require__(0);
  5945. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_react__);
  5946. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_prop_types__ = __webpack_require__(1);
  5947. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_prop_types__);
  5948. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_rc_trigger__ = __webpack_require__(146);
  5949. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__placements__ = __webpack_require__(161);
  5950. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__Content__ = __webpack_require__(162);
  5951. var Tooltip = function (_Component) {
  5952. __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default()(Tooltip, _Component);
  5953. function Tooltip() {
  5954. var _temp, _this, _ret;
  5955. __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default()(this, Tooltip);
  5956. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  5957. args[_key] = arguments[_key];
  5958. }
  5959. return _ret = (_temp = (_this = __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default()(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.getPopupElement = function () {
  5960. var _this$props = _this.props,
  5961. arrowContent = _this$props.arrowContent,
  5962. overlay = _this$props.overlay,
  5963. prefixCls = _this$props.prefixCls,
  5964. id = _this$props.id;
  5965. return [__WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(
  5966. 'div',
  5967. { className: prefixCls + '-arrow', key: 'arrow' },
  5968. arrowContent
  5969. ), __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_9__Content__["a" /* default */], {
  5970. key: 'content',
  5971. trigger: _this.trigger,
  5972. prefixCls: prefixCls,
  5973. id: id,
  5974. overlay: overlay
  5975. })];
  5976. }, _this.saveTrigger = function (node) {
  5977. _this.trigger = node;
  5978. }, _temp), __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default()(_this, _ret);
  5979. }
  5980. Tooltip.prototype.getPopupDomNode = function getPopupDomNode() {
  5981. return this.trigger.getPopupDomNode();
  5982. };
  5983. Tooltip.prototype.render = function render() {
  5984. var _props = this.props,
  5985. overlayClassName = _props.overlayClassName,
  5986. trigger = _props.trigger,
  5987. mouseEnterDelay = _props.mouseEnterDelay,
  5988. mouseLeaveDelay = _props.mouseLeaveDelay,
  5989. overlayStyle = _props.overlayStyle,
  5990. prefixCls = _props.prefixCls,
  5991. children = _props.children,
  5992. onVisibleChange = _props.onVisibleChange,
  5993. afterVisibleChange = _props.afterVisibleChange,
  5994. transitionName = _props.transitionName,
  5995. animation = _props.animation,
  5996. placement = _props.placement,
  5997. align = _props.align,
  5998. destroyTooltipOnHide = _props.destroyTooltipOnHide,
  5999. defaultVisible = _props.defaultVisible,
  6000. getTooltipContainer = _props.getTooltipContainer,
  6001. restProps = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties___default()(_props, ['overlayClassName', 'trigger', 'mouseEnterDelay', 'mouseLeaveDelay', 'overlayStyle', 'prefixCls', 'children', 'onVisibleChange', 'afterVisibleChange', 'transitionName', 'animation', 'placement', 'align', 'destroyTooltipOnHide', 'defaultVisible', 'getTooltipContainer']);
  6002. var extraProps = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, restProps);
  6003. if ('visible' in this.props) {
  6004. extraProps.popupVisible = this.props.visible;
  6005. }
  6006. return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(
  6007. __WEBPACK_IMPORTED_MODULE_7_rc_trigger__["a" /* default */],
  6008. __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({
  6009. popupClassName: overlayClassName,
  6010. ref: this.saveTrigger,
  6011. prefixCls: prefixCls,
  6012. popup: this.getPopupElement,
  6013. action: trigger,
  6014. builtinPlacements: __WEBPACK_IMPORTED_MODULE_8__placements__["a" /* placements */],
  6015. popupPlacement: placement,
  6016. popupAlign: align,
  6017. getPopupContainer: getTooltipContainer,
  6018. onPopupVisibleChange: onVisibleChange,
  6019. afterPopupVisibleChange: afterVisibleChange,
  6020. popupTransitionName: transitionName,
  6021. popupAnimation: animation,
  6022. defaultPopupVisible: defaultVisible,
  6023. destroyPopupOnHide: destroyTooltipOnHide,
  6024. mouseLeaveDelay: mouseLeaveDelay,
  6025. popupStyle: overlayStyle,
  6026. mouseEnterDelay: mouseEnterDelay
  6027. }, extraProps),
  6028. children
  6029. );
  6030. };
  6031. return Tooltip;
  6032. }(__WEBPACK_IMPORTED_MODULE_5_react__["Component"]);
  6033. Tooltip.propTypes = {
  6034. trigger: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.any,
  6035. children: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.any,
  6036. defaultVisible: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool,
  6037. visible: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool,
  6038. placement: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.string,
  6039. transitionName: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.object]),
  6040. animation: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.any,
  6041. onVisibleChange: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.func,
  6042. afterVisibleChange: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.func,
  6043. overlay: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.node, __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.func]).isRequired,
  6044. overlayStyle: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.object,
  6045. overlayClassName: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.string,
  6046. prefixCls: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.string,
  6047. mouseEnterDelay: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.number,
  6048. mouseLeaveDelay: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.number,
  6049. getTooltipContainer: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.func,
  6050. destroyTooltipOnHide: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool,
  6051. align: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.object,
  6052. arrowContent: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.any,
  6053. id: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.string
  6054. };
  6055. Tooltip.defaultProps = {
  6056. prefixCls: 'rc-tooltip',
  6057. mouseEnterDelay: 0,
  6058. destroyTooltipOnHide: false,
  6059. mouseLeaveDelay: 0.1,
  6060. align: {},
  6061. placement: 'right',
  6062. trigger: ['hover'],
  6063. arrowContent: null
  6064. };
  6065. /* harmony default export */ __webpack_exports__["a"] = (Tooltip);
  6066. /***/ }),
  6067. /* 146 */
  6068. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6069. "use strict";
  6070. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(5);
  6071. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__);
  6072. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck__ = __webpack_require__(2);
  6073. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck__);
  6074. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(3);
  6075. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn__);
  6076. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits__ = __webpack_require__(4);
  6077. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits__);
  6078. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_react__ = __webpack_require__(0);
  6079. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_react__);
  6080. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_prop_types__ = __webpack_require__(1);
  6081. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_prop_types__);
  6082. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react_dom__ = __webpack_require__(14);
  6083. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react_dom___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_react_dom__);
  6084. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_react_lifecycles_compat__ = __webpack_require__(68);
  6085. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_rc_util_es_Dom_contains__ = __webpack_require__(69);
  6086. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_rc_util_es_Dom_addEventListener__ = __webpack_require__(31);
  6087. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_rc_util_es_ContainerRender__ = __webpack_require__(147);
  6088. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_rc_util_es_Portal__ = __webpack_require__(148);
  6089. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12_classnames__ = __webpack_require__(22);
  6090. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_12_classnames__);
  6091. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__utils__ = __webpack_require__(70);
  6092. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__Popup__ = __webpack_require__(149);
  6093. function noop() {}
  6094. function returnEmptyString() {
  6095. return '';
  6096. }
  6097. function returnDocument() {
  6098. return window.document;
  6099. }
  6100. var ALL_HANDLERS = ['onClick', 'onMouseDown', 'onTouchStart', 'onMouseEnter', 'onMouseLeave', 'onFocus', 'onBlur', 'onContextMenu'];
  6101. var IS_REACT_16 = !!__WEBPACK_IMPORTED_MODULE_6_react_dom__["createPortal"];
  6102. var contextTypes = {
  6103. rcTrigger: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.shape({
  6104. onPopupMouseDown: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func
  6105. })
  6106. };
  6107. var Trigger = function (_React$Component) {
  6108. __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits___default()(Trigger, _React$Component);
  6109. function Trigger(props) {
  6110. __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck___default()(this, Trigger);
  6111. var _this = __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn___default()(this, _React$Component.call(this, props));
  6112. _initialiseProps.call(_this);
  6113. var popupVisible = void 0;
  6114. if ('popupVisible' in props) {
  6115. popupVisible = !!props.popupVisible;
  6116. } else {
  6117. popupVisible = !!props.defaultPopupVisible;
  6118. }
  6119. _this.state = {
  6120. prevPopupVisible: popupVisible,
  6121. popupVisible: popupVisible
  6122. };
  6123. ALL_HANDLERS.forEach(function (h) {
  6124. _this['fire' + h] = function (e) {
  6125. _this.fireEvents(h, e);
  6126. };
  6127. });
  6128. return _this;
  6129. }
  6130. Trigger.prototype.getChildContext = function getChildContext() {
  6131. return {
  6132. rcTrigger: {
  6133. onPopupMouseDown: this.onPopupMouseDown
  6134. }
  6135. };
  6136. };
  6137. Trigger.prototype.componentDidMount = function componentDidMount() {
  6138. this.componentDidUpdate({}, {
  6139. popupVisible: this.state.popupVisible
  6140. });
  6141. };
  6142. Trigger.prototype.componentDidUpdate = function componentDidUpdate(_, prevState) {
  6143. var props = this.props;
  6144. var state = this.state;
  6145. var triggerAfterPopupVisibleChange = function triggerAfterPopupVisibleChange() {
  6146. if (prevState.popupVisible !== state.popupVisible) {
  6147. props.afterPopupVisibleChange(state.popupVisible);
  6148. }
  6149. };
  6150. if (!IS_REACT_16) {
  6151. this.renderComponent(null, triggerAfterPopupVisibleChange);
  6152. }
  6153. // We must listen to `mousedown` or `touchstart`, edge case:
  6154. // https://github.com/ant-design/ant-design/issues/5804
  6155. // https://github.com/react-component/calendar/issues/250
  6156. // https://github.com/react-component/trigger/issues/50
  6157. if (state.popupVisible) {
  6158. var currentDocument = void 0;
  6159. if (!this.clickOutsideHandler && (this.isClickToHide() || this.isContextMenuToShow())) {
  6160. currentDocument = props.getDocument();
  6161. this.clickOutsideHandler = Object(__WEBPACK_IMPORTED_MODULE_9_rc_util_es_Dom_addEventListener__["a" /* default */])(currentDocument, 'mousedown', this.onDocumentClick);
  6162. }
  6163. // always hide on mobile
  6164. if (!this.touchOutsideHandler) {
  6165. currentDocument = currentDocument || props.getDocument();
  6166. this.touchOutsideHandler = Object(__WEBPACK_IMPORTED_MODULE_9_rc_util_es_Dom_addEventListener__["a" /* default */])(currentDocument, 'touchstart', this.onDocumentClick);
  6167. }
  6168. // close popup when trigger type contains 'onContextMenu' and document is scrolling.
  6169. if (!this.contextMenuOutsideHandler1 && this.isContextMenuToShow()) {
  6170. currentDocument = currentDocument || props.getDocument();
  6171. this.contextMenuOutsideHandler1 = Object(__WEBPACK_IMPORTED_MODULE_9_rc_util_es_Dom_addEventListener__["a" /* default */])(currentDocument, 'scroll', this.onContextMenuClose);
  6172. }
  6173. // close popup when trigger type contains 'onContextMenu' and window is blur.
  6174. if (!this.contextMenuOutsideHandler2 && this.isContextMenuToShow()) {
  6175. this.contextMenuOutsideHandler2 = Object(__WEBPACK_IMPORTED_MODULE_9_rc_util_es_Dom_addEventListener__["a" /* default */])(window, 'blur', this.onContextMenuClose);
  6176. }
  6177. return;
  6178. }
  6179. this.clearOutsideHandler();
  6180. };
  6181. Trigger.prototype.componentWillUnmount = function componentWillUnmount() {
  6182. this.clearDelayTimer();
  6183. this.clearOutsideHandler();
  6184. clearTimeout(this.mouseDownTimeout);
  6185. };
  6186. Trigger.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {
  6187. var popupVisible = _ref.popupVisible;
  6188. var newState = {};
  6189. if (popupVisible !== undefined && prevState.popupVisible !== popupVisible) {
  6190. newState.popupVisible = popupVisible;
  6191. newState.prevPopupVisible = prevState.popupVisible;
  6192. }
  6193. return newState;
  6194. };
  6195. Trigger.prototype.getPopupDomNode = function getPopupDomNode() {
  6196. // for test
  6197. if (this._component && this._component.getPopupDomNode) {
  6198. return this._component.getPopupDomNode();
  6199. }
  6200. return null;
  6201. };
  6202. Trigger.prototype.getPopupAlign = function getPopupAlign() {
  6203. var props = this.props;
  6204. var popupPlacement = props.popupPlacement,
  6205. popupAlign = props.popupAlign,
  6206. builtinPlacements = props.builtinPlacements;
  6207. if (popupPlacement && builtinPlacements) {
  6208. return Object(__WEBPACK_IMPORTED_MODULE_13__utils__["a" /* getAlignFromPlacement */])(builtinPlacements, popupPlacement, popupAlign);
  6209. }
  6210. return popupAlign;
  6211. };
  6212. /**
  6213. * @param popupVisible Show or not the popup element
  6214. * @param event SyntheticEvent, used for `pointAlign`
  6215. */
  6216. Trigger.prototype.setPopupVisible = function setPopupVisible(popupVisible, event) {
  6217. var alignPoint = this.props.alignPoint;
  6218. var prevPopupVisible = this.state.popupVisible;
  6219. this.clearDelayTimer();
  6220. if (prevPopupVisible !== popupVisible) {
  6221. if (!('popupVisible' in this.props)) {
  6222. this.setState({ popupVisible: popupVisible, prevPopupVisible: prevPopupVisible });
  6223. }
  6224. this.props.onPopupVisibleChange(popupVisible);
  6225. }
  6226. // Always record the point position since mouseEnterDelay will delay the show
  6227. if (alignPoint && event) {
  6228. this.setPoint(event);
  6229. }
  6230. };
  6231. Trigger.prototype.delaySetPopupVisible = function delaySetPopupVisible(visible, delayS, event) {
  6232. var _this2 = this;
  6233. var delay = delayS * 1000;
  6234. this.clearDelayTimer();
  6235. if (delay) {
  6236. var point = event ? { pageX: event.pageX, pageY: event.pageY } : null;
  6237. this.delayTimer = setTimeout(function () {
  6238. _this2.setPopupVisible(visible, point);
  6239. _this2.clearDelayTimer();
  6240. }, delay);
  6241. } else {
  6242. this.setPopupVisible(visible, event);
  6243. }
  6244. };
  6245. Trigger.prototype.clearDelayTimer = function clearDelayTimer() {
  6246. if (this.delayTimer) {
  6247. clearTimeout(this.delayTimer);
  6248. this.delayTimer = null;
  6249. }
  6250. };
  6251. Trigger.prototype.clearOutsideHandler = function clearOutsideHandler() {
  6252. if (this.clickOutsideHandler) {
  6253. this.clickOutsideHandler.remove();
  6254. this.clickOutsideHandler = null;
  6255. }
  6256. if (this.contextMenuOutsideHandler1) {
  6257. this.contextMenuOutsideHandler1.remove();
  6258. this.contextMenuOutsideHandler1 = null;
  6259. }
  6260. if (this.contextMenuOutsideHandler2) {
  6261. this.contextMenuOutsideHandler2.remove();
  6262. this.contextMenuOutsideHandler2 = null;
  6263. }
  6264. if (this.touchOutsideHandler) {
  6265. this.touchOutsideHandler.remove();
  6266. this.touchOutsideHandler = null;
  6267. }
  6268. };
  6269. Trigger.prototype.createTwoChains = function createTwoChains(event) {
  6270. var childPros = this.props.children.props;
  6271. var props = this.props;
  6272. if (childPros[event] && props[event]) {
  6273. return this['fire' + event];
  6274. }
  6275. return childPros[event] || props[event];
  6276. };
  6277. Trigger.prototype.isClickToShow = function isClickToShow() {
  6278. var _props = this.props,
  6279. action = _props.action,
  6280. showAction = _props.showAction;
  6281. return action.indexOf('click') !== -1 || showAction.indexOf('click') !== -1;
  6282. };
  6283. Trigger.prototype.isContextMenuToShow = function isContextMenuToShow() {
  6284. var _props2 = this.props,
  6285. action = _props2.action,
  6286. showAction = _props2.showAction;
  6287. return action.indexOf('contextMenu') !== -1 || showAction.indexOf('contextMenu') !== -1;
  6288. };
  6289. Trigger.prototype.isClickToHide = function isClickToHide() {
  6290. var _props3 = this.props,
  6291. action = _props3.action,
  6292. hideAction = _props3.hideAction;
  6293. return action.indexOf('click') !== -1 || hideAction.indexOf('click') !== -1;
  6294. };
  6295. Trigger.prototype.isMouseEnterToShow = function isMouseEnterToShow() {
  6296. var _props4 = this.props,
  6297. action = _props4.action,
  6298. showAction = _props4.showAction;
  6299. return action.indexOf('hover') !== -1 || showAction.indexOf('mouseEnter') !== -1;
  6300. };
  6301. Trigger.prototype.isMouseLeaveToHide = function isMouseLeaveToHide() {
  6302. var _props5 = this.props,
  6303. action = _props5.action,
  6304. hideAction = _props5.hideAction;
  6305. return action.indexOf('hover') !== -1 || hideAction.indexOf('mouseLeave') !== -1;
  6306. };
  6307. Trigger.prototype.isFocusToShow = function isFocusToShow() {
  6308. var _props6 = this.props,
  6309. action = _props6.action,
  6310. showAction = _props6.showAction;
  6311. return action.indexOf('focus') !== -1 || showAction.indexOf('focus') !== -1;
  6312. };
  6313. Trigger.prototype.isBlurToHide = function isBlurToHide() {
  6314. var _props7 = this.props,
  6315. action = _props7.action,
  6316. hideAction = _props7.hideAction;
  6317. return action.indexOf('focus') !== -1 || hideAction.indexOf('blur') !== -1;
  6318. };
  6319. Trigger.prototype.forcePopupAlign = function forcePopupAlign() {
  6320. if (this.state.popupVisible && this._component && this._component.alignInstance) {
  6321. this._component.alignInstance.forceAlign();
  6322. }
  6323. };
  6324. Trigger.prototype.fireEvents = function fireEvents(type, e) {
  6325. var childCallback = this.props.children.props[type];
  6326. if (childCallback) {
  6327. childCallback(e);
  6328. }
  6329. var callback = this.props[type];
  6330. if (callback) {
  6331. callback(e);
  6332. }
  6333. };
  6334. Trigger.prototype.close = function close() {
  6335. this.setPopupVisible(false);
  6336. };
  6337. Trigger.prototype.render = function render() {
  6338. var _this3 = this;
  6339. var popupVisible = this.state.popupVisible;
  6340. var _props8 = this.props,
  6341. children = _props8.children,
  6342. forceRender = _props8.forceRender,
  6343. alignPoint = _props8.alignPoint,
  6344. className = _props8.className;
  6345. var child = __WEBPACK_IMPORTED_MODULE_4_react___default.a.Children.only(children);
  6346. var newChildProps = { key: 'trigger' };
  6347. if (this.isContextMenuToShow()) {
  6348. newChildProps.onContextMenu = this.onContextMenu;
  6349. } else {
  6350. newChildProps.onContextMenu = this.createTwoChains('onContextMenu');
  6351. }
  6352. if (this.isClickToHide() || this.isClickToShow()) {
  6353. newChildProps.onClick = this.onClick;
  6354. newChildProps.onMouseDown = this.onMouseDown;
  6355. newChildProps.onTouchStart = this.onTouchStart;
  6356. } else {
  6357. newChildProps.onClick = this.createTwoChains('onClick');
  6358. newChildProps.onMouseDown = this.createTwoChains('onMouseDown');
  6359. newChildProps.onTouchStart = this.createTwoChains('onTouchStart');
  6360. }
  6361. if (this.isMouseEnterToShow()) {
  6362. newChildProps.onMouseEnter = this.onMouseEnter;
  6363. if (alignPoint) {
  6364. newChildProps.onMouseMove = this.onMouseMove;
  6365. }
  6366. } else {
  6367. newChildProps.onMouseEnter = this.createTwoChains('onMouseEnter');
  6368. }
  6369. if (this.isMouseLeaveToHide()) {
  6370. newChildProps.onMouseLeave = this.onMouseLeave;
  6371. } else {
  6372. newChildProps.onMouseLeave = this.createTwoChains('onMouseLeave');
  6373. }
  6374. if (this.isFocusToShow() || this.isBlurToHide()) {
  6375. newChildProps.onFocus = this.onFocus;
  6376. newChildProps.onBlur = this.onBlur;
  6377. } else {
  6378. newChildProps.onFocus = this.createTwoChains('onFocus');
  6379. newChildProps.onBlur = this.createTwoChains('onBlur');
  6380. }
  6381. var childrenClassName = __WEBPACK_IMPORTED_MODULE_12_classnames___default()(child && child.props && child.props.className, className);
  6382. if (childrenClassName) {
  6383. newChildProps.className = childrenClassName;
  6384. }
  6385. var trigger = __WEBPACK_IMPORTED_MODULE_4_react___default.a.cloneElement(child, newChildProps);
  6386. if (!IS_REACT_16) {
  6387. return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(
  6388. __WEBPACK_IMPORTED_MODULE_10_rc_util_es_ContainerRender__["a" /* default */],
  6389. {
  6390. parent: this,
  6391. visible: popupVisible,
  6392. autoMount: false,
  6393. forceRender: forceRender,
  6394. getComponent: this.getComponent,
  6395. getContainer: this.getContainer
  6396. },
  6397. function (_ref2) {
  6398. var renderComponent = _ref2.renderComponent;
  6399. _this3.renderComponent = renderComponent;
  6400. return trigger;
  6401. }
  6402. );
  6403. }
  6404. var portal = void 0;
  6405. // prevent unmounting after it's rendered
  6406. if (popupVisible || this._component || forceRender) {
  6407. portal = __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(
  6408. __WEBPACK_IMPORTED_MODULE_11_rc_util_es_Portal__["a" /* default */],
  6409. { key: 'portal', getContainer: this.getContainer, didUpdate: this.handlePortalUpdate },
  6410. this.getComponent()
  6411. );
  6412. }
  6413. return [trigger, portal];
  6414. };
  6415. return Trigger;
  6416. }(__WEBPACK_IMPORTED_MODULE_4_react___default.a.Component);
  6417. Trigger.propTypes = {
  6418. children: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.any,
  6419. action: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.arrayOf(__WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string)]),
  6420. showAction: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.any,
  6421. hideAction: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.any,
  6422. getPopupClassNameFromAlign: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.any,
  6423. onPopupVisibleChange: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func,
  6424. afterPopupVisibleChange: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func,
  6425. popup: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.node, __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func]).isRequired,
  6426. popupStyle: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.object,
  6427. prefixCls: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string,
  6428. popupClassName: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string,
  6429. className: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string,
  6430. popupPlacement: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string,
  6431. builtinPlacements: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.object,
  6432. popupTransitionName: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.object]),
  6433. popupAnimation: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.any,
  6434. mouseEnterDelay: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.number,
  6435. mouseLeaveDelay: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.number,
  6436. zIndex: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.number,
  6437. focusDelay: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.number,
  6438. blurDelay: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.number,
  6439. getPopupContainer: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func,
  6440. getDocument: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func,
  6441. forceRender: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.bool,
  6442. destroyPopupOnHide: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.bool,
  6443. mask: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.bool,
  6444. maskClosable: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.bool,
  6445. onPopupAlign: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func,
  6446. popupAlign: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.object,
  6447. popupVisible: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.bool,
  6448. defaultPopupVisible: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.bool,
  6449. maskTransitionName: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.object]),
  6450. maskAnimation: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string,
  6451. stretch: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string,
  6452. alignPoint: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.bool // Maybe we can support user pass position in the future
  6453. };
  6454. Trigger.contextTypes = contextTypes;
  6455. Trigger.childContextTypes = contextTypes;
  6456. Trigger.defaultProps = {
  6457. prefixCls: 'rc-trigger-popup',
  6458. getPopupClassNameFromAlign: returnEmptyString,
  6459. getDocument: returnDocument,
  6460. onPopupVisibleChange: noop,
  6461. afterPopupVisibleChange: noop,
  6462. onPopupAlign: noop,
  6463. popupClassName: '',
  6464. mouseEnterDelay: 0,
  6465. mouseLeaveDelay: 0.1,
  6466. focusDelay: 0,
  6467. blurDelay: 0.15,
  6468. popupStyle: {},
  6469. destroyPopupOnHide: false,
  6470. popupAlign: {},
  6471. defaultPopupVisible: false,
  6472. mask: false,
  6473. maskClosable: true,
  6474. action: [],
  6475. showAction: [],
  6476. hideAction: []
  6477. };
  6478. var _initialiseProps = function _initialiseProps() {
  6479. var _this4 = this;
  6480. this.onMouseEnter = function (e) {
  6481. var mouseEnterDelay = _this4.props.mouseEnterDelay;
  6482. _this4.fireEvents('onMouseEnter', e);
  6483. _this4.delaySetPopupVisible(true, mouseEnterDelay, mouseEnterDelay ? null : e);
  6484. };
  6485. this.onMouseMove = function (e) {
  6486. _this4.fireEvents('onMouseMove', e);
  6487. _this4.setPoint(e);
  6488. };
  6489. this.onMouseLeave = function (e) {
  6490. _this4.fireEvents('onMouseLeave', e);
  6491. _this4.delaySetPopupVisible(false, _this4.props.mouseLeaveDelay);
  6492. };
  6493. this.onPopupMouseEnter = function () {
  6494. _this4.clearDelayTimer();
  6495. };
  6496. this.onPopupMouseLeave = function (e) {
  6497. // https://github.com/react-component/trigger/pull/13
  6498. // react bug?
  6499. if (e.relatedTarget && !e.relatedTarget.setTimeout && _this4._component && _this4._component.getPopupDomNode && Object(__WEBPACK_IMPORTED_MODULE_8_rc_util_es_Dom_contains__["a" /* default */])(_this4._component.getPopupDomNode(), e.relatedTarget)) {
  6500. return;
  6501. }
  6502. _this4.delaySetPopupVisible(false, _this4.props.mouseLeaveDelay);
  6503. };
  6504. this.onFocus = function (e) {
  6505. _this4.fireEvents('onFocus', e);
  6506. // incase focusin and focusout
  6507. _this4.clearDelayTimer();
  6508. if (_this4.isFocusToShow()) {
  6509. _this4.focusTime = Date.now();
  6510. _this4.delaySetPopupVisible(true, _this4.props.focusDelay);
  6511. }
  6512. };
  6513. this.onMouseDown = function (e) {
  6514. _this4.fireEvents('onMouseDown', e);
  6515. _this4.preClickTime = Date.now();
  6516. };
  6517. this.onTouchStart = function (e) {
  6518. _this4.fireEvents('onTouchStart', e);
  6519. _this4.preTouchTime = Date.now();
  6520. };
  6521. this.onBlur = function (e) {
  6522. _this4.fireEvents('onBlur', e);
  6523. _this4.clearDelayTimer();
  6524. if (_this4.isBlurToHide()) {
  6525. _this4.delaySetPopupVisible(false, _this4.props.blurDelay);
  6526. }
  6527. };
  6528. this.onContextMenu = function (e) {
  6529. e.preventDefault();
  6530. _this4.fireEvents('onContextMenu', e);
  6531. _this4.setPopupVisible(true, e);
  6532. };
  6533. this.onContextMenuClose = function () {
  6534. if (_this4.isContextMenuToShow()) {
  6535. _this4.close();
  6536. }
  6537. };
  6538. this.onClick = function (event) {
  6539. _this4.fireEvents('onClick', event);
  6540. // focus will trigger click
  6541. if (_this4.focusTime) {
  6542. var preTime = void 0;
  6543. if (_this4.preClickTime && _this4.preTouchTime) {
  6544. preTime = Math.min(_this4.preClickTime, _this4.preTouchTime);
  6545. } else if (_this4.preClickTime) {
  6546. preTime = _this4.preClickTime;
  6547. } else if (_this4.preTouchTime) {
  6548. preTime = _this4.preTouchTime;
  6549. }
  6550. if (Math.abs(preTime - _this4.focusTime) < 20) {
  6551. return;
  6552. }
  6553. _this4.focusTime = 0;
  6554. }
  6555. _this4.preClickTime = 0;
  6556. _this4.preTouchTime = 0;
  6557. // Only prevent default when all the action is click.
  6558. // https://github.com/ant-design/ant-design/issues/17043
  6559. // https://github.com/ant-design/ant-design/issues/17291
  6560. if (_this4.isClickToShow() && (_this4.isClickToHide() || _this4.isBlurToHide()) && event && event.preventDefault) {
  6561. event.preventDefault();
  6562. }
  6563. var nextVisible = !_this4.state.popupVisible;
  6564. if (_this4.isClickToHide() && !nextVisible || nextVisible && _this4.isClickToShow()) {
  6565. _this4.setPopupVisible(!_this4.state.popupVisible, event);
  6566. }
  6567. };
  6568. this.onPopupMouseDown = function () {
  6569. var _context$rcTrigger = _this4.context.rcTrigger,
  6570. rcTrigger = _context$rcTrigger === undefined ? {} : _context$rcTrigger;
  6571. _this4.hasPopupMouseDown = true;
  6572. clearTimeout(_this4.mouseDownTimeout);
  6573. _this4.mouseDownTimeout = setTimeout(function () {
  6574. _this4.hasPopupMouseDown = false;
  6575. }, 0);
  6576. if (rcTrigger.onPopupMouseDown) {
  6577. rcTrigger.onPopupMouseDown.apply(rcTrigger, arguments);
  6578. }
  6579. };
  6580. this.onDocumentClick = function (event) {
  6581. if (_this4.props.mask && !_this4.props.maskClosable) {
  6582. return;
  6583. }
  6584. var target = event.target;
  6585. var root = Object(__WEBPACK_IMPORTED_MODULE_6_react_dom__["findDOMNode"])(_this4);
  6586. if (!Object(__WEBPACK_IMPORTED_MODULE_8_rc_util_es_Dom_contains__["a" /* default */])(root, target) && !_this4.hasPopupMouseDown) {
  6587. _this4.close();
  6588. }
  6589. };
  6590. this.getRootDomNode = function () {
  6591. return Object(__WEBPACK_IMPORTED_MODULE_6_react_dom__["findDOMNode"])(_this4);
  6592. };
  6593. this.getPopupClassNameFromAlign = function (align) {
  6594. var className = [];
  6595. var _props9 = _this4.props,
  6596. popupPlacement = _props9.popupPlacement,
  6597. builtinPlacements = _props9.builtinPlacements,
  6598. prefixCls = _props9.prefixCls,
  6599. alignPoint = _props9.alignPoint,
  6600. getPopupClassNameFromAlign = _props9.getPopupClassNameFromAlign;
  6601. if (popupPlacement && builtinPlacements) {
  6602. className.push(Object(__WEBPACK_IMPORTED_MODULE_13__utils__["b" /* getAlignPopupClassName */])(builtinPlacements, prefixCls, align, alignPoint));
  6603. }
  6604. if (getPopupClassNameFromAlign) {
  6605. className.push(getPopupClassNameFromAlign(align));
  6606. }
  6607. return className.join(' ');
  6608. };
  6609. this.getComponent = function () {
  6610. var _props10 = _this4.props,
  6611. prefixCls = _props10.prefixCls,
  6612. destroyPopupOnHide = _props10.destroyPopupOnHide,
  6613. popupClassName = _props10.popupClassName,
  6614. action = _props10.action,
  6615. onPopupAlign = _props10.onPopupAlign,
  6616. popupAnimation = _props10.popupAnimation,
  6617. popupTransitionName = _props10.popupTransitionName,
  6618. popupStyle = _props10.popupStyle,
  6619. mask = _props10.mask,
  6620. maskAnimation = _props10.maskAnimation,
  6621. maskTransitionName = _props10.maskTransitionName,
  6622. zIndex = _props10.zIndex,
  6623. popup = _props10.popup,
  6624. stretch = _props10.stretch,
  6625. alignPoint = _props10.alignPoint;
  6626. var _state = _this4.state,
  6627. popupVisible = _state.popupVisible,
  6628. point = _state.point;
  6629. var align = _this4.getPopupAlign();
  6630. var mouseProps = {};
  6631. if (_this4.isMouseEnterToShow()) {
  6632. mouseProps.onMouseEnter = _this4.onPopupMouseEnter;
  6633. }
  6634. if (_this4.isMouseLeaveToHide()) {
  6635. mouseProps.onMouseLeave = _this4.onPopupMouseLeave;
  6636. }
  6637. mouseProps.onMouseDown = _this4.onPopupMouseDown;
  6638. mouseProps.onTouchStart = _this4.onPopupMouseDown;
  6639. return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(
  6640. __WEBPACK_IMPORTED_MODULE_14__Popup__["a" /* default */],
  6641. __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({
  6642. prefixCls: prefixCls,
  6643. destroyPopupOnHide: destroyPopupOnHide,
  6644. visible: popupVisible,
  6645. point: alignPoint && point,
  6646. className: popupClassName,
  6647. action: action,
  6648. align: align,
  6649. onAlign: onPopupAlign,
  6650. animation: popupAnimation,
  6651. getClassNameFromAlign: _this4.getPopupClassNameFromAlign
  6652. }, mouseProps, {
  6653. stretch: stretch,
  6654. getRootDomNode: _this4.getRootDomNode,
  6655. style: popupStyle,
  6656. mask: mask,
  6657. zIndex: zIndex,
  6658. transitionName: popupTransitionName,
  6659. maskAnimation: maskAnimation,
  6660. maskTransitionName: maskTransitionName,
  6661. ref: _this4.savePopup
  6662. }),
  6663. typeof popup === 'function' ? popup() : popup
  6664. );
  6665. };
  6666. this.getContainer = function () {
  6667. var props = _this4.props;
  6668. var popupContainer = document.createElement('div');
  6669. // Make sure default popup container will never cause scrollbar appearing
  6670. // https://github.com/react-component/trigger/issues/41
  6671. popupContainer.style.position = 'absolute';
  6672. popupContainer.style.top = '0';
  6673. popupContainer.style.left = '0';
  6674. popupContainer.style.width = '100%';
  6675. var mountNode = props.getPopupContainer ? props.getPopupContainer(Object(__WEBPACK_IMPORTED_MODULE_6_react_dom__["findDOMNode"])(_this4)) : props.getDocument().body;
  6676. mountNode.appendChild(popupContainer);
  6677. return popupContainer;
  6678. };
  6679. this.setPoint = function (point) {
  6680. var alignPoint = _this4.props.alignPoint;
  6681. if (!alignPoint || !point) return;
  6682. _this4.setState({
  6683. point: {
  6684. pageX: point.pageX,
  6685. pageY: point.pageY
  6686. }
  6687. });
  6688. };
  6689. this.handlePortalUpdate = function () {
  6690. if (_this4.state.prevPopupVisible !== _this4.state.popupVisible) {
  6691. _this4.props.afterPopupVisibleChange(_this4.state.popupVisible);
  6692. }
  6693. };
  6694. this.savePopup = function (node) {
  6695. _this4._component = node;
  6696. };
  6697. };
  6698. Object(__WEBPACK_IMPORTED_MODULE_7_react_lifecycles_compat__["a" /* polyfill */])(Trigger);
  6699. /* harmony default export */ __webpack_exports__["a"] = (Trigger);
  6700. /***/ }),
  6701. /* 147 */
  6702. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6703. "use strict";
  6704. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ContainerRender; });
  6705. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
  6706. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
  6707. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react_dom__ = __webpack_require__(14);
  6708. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react_dom___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_react_dom__);
  6709. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types__ = __webpack_require__(1);
  6710. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_prop_types__);
  6711. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  6712. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6713. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  6714. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  6715. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  6716. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  6717. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  6718. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  6719. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  6720. var ContainerRender =
  6721. /*#__PURE__*/
  6722. function (_React$Component) {
  6723. _inherits(ContainerRender, _React$Component);
  6724. function ContainerRender() {
  6725. var _getPrototypeOf2;
  6726. var _this;
  6727. _classCallCheck(this, ContainerRender);
  6728. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  6729. args[_key] = arguments[_key];
  6730. }
  6731. _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(ContainerRender)).call.apply(_getPrototypeOf2, [this].concat(args)));
  6732. _this.removeContainer = function () {
  6733. if (_this.container) {
  6734. __WEBPACK_IMPORTED_MODULE_1_react_dom___default.a.unmountComponentAtNode(_this.container);
  6735. _this.container.parentNode.removeChild(_this.container);
  6736. _this.container = null;
  6737. }
  6738. };
  6739. _this.renderComponent = function (props, ready) {
  6740. var _this$props = _this.props,
  6741. visible = _this$props.visible,
  6742. getComponent = _this$props.getComponent,
  6743. forceRender = _this$props.forceRender,
  6744. getContainer = _this$props.getContainer,
  6745. parent = _this$props.parent;
  6746. if (visible || parent._component || forceRender) {
  6747. if (!_this.container) {
  6748. _this.container = getContainer();
  6749. }
  6750. __WEBPACK_IMPORTED_MODULE_1_react_dom___default.a.unstable_renderSubtreeIntoContainer(parent, getComponent(props), _this.container, function callback() {
  6751. if (ready) {
  6752. ready.call(this);
  6753. }
  6754. });
  6755. }
  6756. };
  6757. return _this;
  6758. }
  6759. _createClass(ContainerRender, [{
  6760. key: "componentDidMount",
  6761. value: function componentDidMount() {
  6762. if (this.props.autoMount) {
  6763. this.renderComponent();
  6764. }
  6765. }
  6766. }, {
  6767. key: "componentDidUpdate",
  6768. value: function componentDidUpdate() {
  6769. if (this.props.autoMount) {
  6770. this.renderComponent();
  6771. }
  6772. }
  6773. }, {
  6774. key: "componentWillUnmount",
  6775. value: function componentWillUnmount() {
  6776. if (this.props.autoDestroy) {
  6777. this.removeContainer();
  6778. }
  6779. }
  6780. }, {
  6781. key: "render",
  6782. value: function render() {
  6783. return this.props.children({
  6784. renderComponent: this.renderComponent,
  6785. removeContainer: this.removeContainer
  6786. });
  6787. }
  6788. }]);
  6789. return ContainerRender;
  6790. }(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component);
  6791. ContainerRender.propTypes = {
  6792. autoMount: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.bool,
  6793. autoDestroy: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.bool,
  6794. visible: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.bool,
  6795. forceRender: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.bool,
  6796. parent: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.any,
  6797. getComponent: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.func.isRequired,
  6798. getContainer: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.func.isRequired,
  6799. children: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.func.isRequired
  6800. };
  6801. ContainerRender.defaultProps = {
  6802. autoMount: true,
  6803. autoDestroy: true,
  6804. forceRender: false
  6805. };
  6806. /***/ }),
  6807. /* 148 */
  6808. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6809. "use strict";
  6810. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Portal; });
  6811. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
  6812. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
  6813. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react_dom__ = __webpack_require__(14);
  6814. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react_dom___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_react_dom__);
  6815. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types__ = __webpack_require__(1);
  6816. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_prop_types__);
  6817. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  6818. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6819. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  6820. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  6821. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  6822. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  6823. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  6824. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  6825. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  6826. var Portal =
  6827. /*#__PURE__*/
  6828. function (_React$Component) {
  6829. _inherits(Portal, _React$Component);
  6830. function Portal() {
  6831. _classCallCheck(this, Portal);
  6832. return _possibleConstructorReturn(this, _getPrototypeOf(Portal).apply(this, arguments));
  6833. }
  6834. _createClass(Portal, [{
  6835. key: "componentDidMount",
  6836. value: function componentDidMount() {
  6837. this.createContainer();
  6838. }
  6839. }, {
  6840. key: "componentDidUpdate",
  6841. value: function componentDidUpdate(prevProps) {
  6842. var didUpdate = this.props.didUpdate;
  6843. if (didUpdate) {
  6844. didUpdate(prevProps);
  6845. }
  6846. }
  6847. }, {
  6848. key: "componentWillUnmount",
  6849. value: function componentWillUnmount() {
  6850. this.removeContainer();
  6851. }
  6852. }, {
  6853. key: "createContainer",
  6854. value: function createContainer() {
  6855. this._container = this.props.getContainer();
  6856. this.forceUpdate();
  6857. }
  6858. }, {
  6859. key: "removeContainer",
  6860. value: function removeContainer() {
  6861. if (this._container) {
  6862. this._container.parentNode.removeChild(this._container);
  6863. }
  6864. }
  6865. }, {
  6866. key: "render",
  6867. value: function render() {
  6868. if (this._container) {
  6869. return __WEBPACK_IMPORTED_MODULE_1_react_dom___default.a.createPortal(this.props.children, this._container);
  6870. }
  6871. return null;
  6872. }
  6873. }]);
  6874. return Portal;
  6875. }(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component);
  6876. Portal.propTypes = {
  6877. getContainer: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.func.isRequired,
  6878. children: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.node.isRequired,
  6879. didUpdate: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.func
  6880. };
  6881. /***/ }),
  6882. /* 149 */
  6883. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6884. "use strict";
  6885. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(5);
  6886. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__);
  6887. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck__ = __webpack_require__(2);
  6888. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck__);
  6889. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(3);
  6890. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn__);
  6891. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits__ = __webpack_require__(4);
  6892. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits__);
  6893. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_react__ = __webpack_require__(0);
  6894. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_react__);
  6895. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_prop_types__ = __webpack_require__(1);
  6896. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_prop_types__);
  6897. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react_dom__ = __webpack_require__(14);
  6898. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react_dom___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_react_dom__);
  6899. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_rc_align__ = __webpack_require__(150);
  6900. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_rc_animate__ = __webpack_require__(154);
  6901. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__PopupInner__ = __webpack_require__(160);
  6902. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__LazyRenderBox__ = __webpack_require__(73);
  6903. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__utils__ = __webpack_require__(70);
  6904. var Popup = function (_Component) {
  6905. __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits___default()(Popup, _Component);
  6906. function Popup(props) {
  6907. __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck___default()(this, Popup);
  6908. var _this = __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn___default()(this, _Component.call(this, props));
  6909. _initialiseProps.call(_this);
  6910. _this.state = {
  6911. // Used for stretch
  6912. stretchChecked: false,
  6913. targetWidth: undefined,
  6914. targetHeight: undefined
  6915. };
  6916. _this.savePopupRef = __WEBPACK_IMPORTED_MODULE_11__utils__["c" /* saveRef */].bind(_this, 'popupInstance');
  6917. _this.saveAlignRef = __WEBPACK_IMPORTED_MODULE_11__utils__["c" /* saveRef */].bind(_this, 'alignInstance');
  6918. return _this;
  6919. }
  6920. Popup.prototype.componentDidMount = function componentDidMount() {
  6921. this.rootNode = this.getPopupDomNode();
  6922. this.setStretchSize();
  6923. };
  6924. Popup.prototype.componentDidUpdate = function componentDidUpdate() {
  6925. this.setStretchSize();
  6926. };
  6927. // Record size if stretch needed
  6928. Popup.prototype.getPopupDomNode = function getPopupDomNode() {
  6929. return __WEBPACK_IMPORTED_MODULE_6_react_dom___default.a.findDOMNode(this.popupInstance);
  6930. };
  6931. // `target` on `rc-align` can accept as a function to get the bind element or a point.
  6932. // ref: https://www.npmjs.com/package/rc-align
  6933. Popup.prototype.getMaskTransitionName = function getMaskTransitionName() {
  6934. var props = this.props;
  6935. var transitionName = props.maskTransitionName;
  6936. var animation = props.maskAnimation;
  6937. if (!transitionName && animation) {
  6938. transitionName = props.prefixCls + '-' + animation;
  6939. }
  6940. return transitionName;
  6941. };
  6942. Popup.prototype.getTransitionName = function getTransitionName() {
  6943. var props = this.props;
  6944. var transitionName = props.transitionName;
  6945. if (!transitionName && props.animation) {
  6946. transitionName = props.prefixCls + '-' + props.animation;
  6947. }
  6948. return transitionName;
  6949. };
  6950. Popup.prototype.getClassName = function getClassName(currentAlignClassName) {
  6951. return this.props.prefixCls + ' ' + this.props.className + ' ' + currentAlignClassName;
  6952. };
  6953. Popup.prototype.getPopupElement = function getPopupElement() {
  6954. var _this2 = this;
  6955. var savePopupRef = this.savePopupRef;
  6956. var _state = this.state,
  6957. stretchChecked = _state.stretchChecked,
  6958. targetHeight = _state.targetHeight,
  6959. targetWidth = _state.targetWidth;
  6960. var _props = this.props,
  6961. align = _props.align,
  6962. visible = _props.visible,
  6963. prefixCls = _props.prefixCls,
  6964. style = _props.style,
  6965. getClassNameFromAlign = _props.getClassNameFromAlign,
  6966. destroyPopupOnHide = _props.destroyPopupOnHide,
  6967. stretch = _props.stretch,
  6968. children = _props.children,
  6969. onMouseEnter = _props.onMouseEnter,
  6970. onMouseLeave = _props.onMouseLeave,
  6971. onMouseDown = _props.onMouseDown,
  6972. onTouchStart = _props.onTouchStart;
  6973. var className = this.getClassName(this.currentAlignClassName || getClassNameFromAlign(align));
  6974. var hiddenClassName = prefixCls + '-hidden';
  6975. if (!visible) {
  6976. this.currentAlignClassName = null;
  6977. }
  6978. var sizeStyle = {};
  6979. if (stretch) {
  6980. // Stretch with target
  6981. if (stretch.indexOf('height') !== -1) {
  6982. sizeStyle.height = targetHeight;
  6983. } else if (stretch.indexOf('minHeight') !== -1) {
  6984. sizeStyle.minHeight = targetHeight;
  6985. }
  6986. if (stretch.indexOf('width') !== -1) {
  6987. sizeStyle.width = targetWidth;
  6988. } else if (stretch.indexOf('minWidth') !== -1) {
  6989. sizeStyle.minWidth = targetWidth;
  6990. }
  6991. // Delay force align to makes ui smooth
  6992. if (!stretchChecked) {
  6993. sizeStyle.visibility = 'hidden';
  6994. setTimeout(function () {
  6995. if (_this2.alignInstance) {
  6996. _this2.alignInstance.forceAlign();
  6997. }
  6998. }, 0);
  6999. }
  7000. }
  7001. var newStyle = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, sizeStyle, style, this.getZIndexStyle());
  7002. var popupInnerProps = {
  7003. className: className,
  7004. prefixCls: prefixCls,
  7005. ref: savePopupRef,
  7006. onMouseEnter: onMouseEnter,
  7007. onMouseLeave: onMouseLeave,
  7008. onMouseDown: onMouseDown,
  7009. onTouchStart: onTouchStart,
  7010. style: newStyle
  7011. };
  7012. if (destroyPopupOnHide) {
  7013. return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(
  7014. __WEBPACK_IMPORTED_MODULE_8_rc_animate__["a" /* default */],
  7015. {
  7016. component: '',
  7017. exclusive: true,
  7018. transitionAppear: true,
  7019. transitionName: this.getTransitionName()
  7020. },
  7021. visible ? __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(
  7022. __WEBPACK_IMPORTED_MODULE_7_rc_align__["a" /* default */],
  7023. {
  7024. target: this.getAlignTarget(),
  7025. key: 'popup',
  7026. ref: this.saveAlignRef,
  7027. monitorWindowResize: true,
  7028. align: align,
  7029. onAlign: this.onAlign
  7030. },
  7031. __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(
  7032. __WEBPACK_IMPORTED_MODULE_9__PopupInner__["a" /* default */],
  7033. __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({
  7034. visible: true
  7035. }, popupInnerProps),
  7036. children
  7037. )
  7038. ) : null
  7039. );
  7040. }
  7041. return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(
  7042. __WEBPACK_IMPORTED_MODULE_8_rc_animate__["a" /* default */],
  7043. {
  7044. component: '',
  7045. exclusive: true,
  7046. transitionAppear: true,
  7047. transitionName: this.getTransitionName(),
  7048. showProp: 'xVisible'
  7049. },
  7050. __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(
  7051. __WEBPACK_IMPORTED_MODULE_7_rc_align__["a" /* default */],
  7052. {
  7053. target: this.getAlignTarget(),
  7054. key: 'popup',
  7055. ref: this.saveAlignRef,
  7056. monitorWindowResize: true,
  7057. xVisible: visible,
  7058. childrenProps: { visible: 'xVisible' },
  7059. disabled: !visible,
  7060. align: align,
  7061. onAlign: this.onAlign
  7062. },
  7063. __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(
  7064. __WEBPACK_IMPORTED_MODULE_9__PopupInner__["a" /* default */],
  7065. __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({
  7066. hiddenClassName: hiddenClassName
  7067. }, popupInnerProps),
  7068. children
  7069. )
  7070. )
  7071. );
  7072. };
  7073. Popup.prototype.getZIndexStyle = function getZIndexStyle() {
  7074. var style = {};
  7075. var props = this.props;
  7076. if (props.zIndex !== undefined) {
  7077. style.zIndex = props.zIndex;
  7078. }
  7079. return style;
  7080. };
  7081. Popup.prototype.getMaskElement = function getMaskElement() {
  7082. var props = this.props;
  7083. var maskElement = void 0;
  7084. if (props.mask) {
  7085. var maskTransition = this.getMaskTransitionName();
  7086. maskElement = __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_10__LazyRenderBox__["a" /* default */], {
  7087. style: this.getZIndexStyle(),
  7088. key: 'mask',
  7089. className: props.prefixCls + '-mask',
  7090. hiddenClassName: props.prefixCls + '-mask-hidden',
  7091. visible: props.visible
  7092. });
  7093. if (maskTransition) {
  7094. maskElement = __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(
  7095. __WEBPACK_IMPORTED_MODULE_8_rc_animate__["a" /* default */],
  7096. {
  7097. key: 'mask',
  7098. showProp: 'visible',
  7099. transitionAppear: true,
  7100. component: '',
  7101. transitionName: maskTransition
  7102. },
  7103. maskElement
  7104. );
  7105. }
  7106. }
  7107. return maskElement;
  7108. };
  7109. Popup.prototype.render = function render() {
  7110. return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(
  7111. 'div',
  7112. null,
  7113. this.getMaskElement(),
  7114. this.getPopupElement()
  7115. );
  7116. };
  7117. return Popup;
  7118. }(__WEBPACK_IMPORTED_MODULE_4_react__["Component"]);
  7119. Popup.propTypes = {
  7120. visible: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.bool,
  7121. style: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.object,
  7122. getClassNameFromAlign: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func,
  7123. onAlign: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func,
  7124. getRootDomNode: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func,
  7125. align: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.any,
  7126. destroyPopupOnHide: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.bool,
  7127. className: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string,
  7128. prefixCls: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string,
  7129. onMouseEnter: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func,
  7130. onMouseLeave: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func,
  7131. onMouseDown: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func,
  7132. onTouchStart: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func,
  7133. stretch: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string,
  7134. children: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.node,
  7135. point: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.shape({
  7136. pageX: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.number,
  7137. pageY: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.number
  7138. })
  7139. };
  7140. var _initialiseProps = function _initialiseProps() {
  7141. var _this3 = this;
  7142. this.onAlign = function (popupDomNode, align) {
  7143. var props = _this3.props;
  7144. var currentAlignClassName = props.getClassNameFromAlign(align);
  7145. // FIX: https://github.com/react-component/trigger/issues/56
  7146. // FIX: https://github.com/react-component/tooltip/issues/79
  7147. if (_this3.currentAlignClassName !== currentAlignClassName) {
  7148. _this3.currentAlignClassName = currentAlignClassName;
  7149. popupDomNode.className = _this3.getClassName(currentAlignClassName);
  7150. }
  7151. props.onAlign(popupDomNode, align);
  7152. };
  7153. this.setStretchSize = function () {
  7154. var _props2 = _this3.props,
  7155. stretch = _props2.stretch,
  7156. getRootDomNode = _props2.getRootDomNode,
  7157. visible = _props2.visible;
  7158. var _state2 = _this3.state,
  7159. stretchChecked = _state2.stretchChecked,
  7160. targetHeight = _state2.targetHeight,
  7161. targetWidth = _state2.targetWidth;
  7162. if (!stretch || !visible) {
  7163. if (stretchChecked) {
  7164. _this3.setState({ stretchChecked: false });
  7165. }
  7166. return;
  7167. }
  7168. var $ele = getRootDomNode();
  7169. if (!$ele) return;
  7170. var height = $ele.offsetHeight;
  7171. var width = $ele.offsetWidth;
  7172. if (targetHeight !== height || targetWidth !== width || !stretchChecked) {
  7173. _this3.setState({
  7174. stretchChecked: true,
  7175. targetHeight: height,
  7176. targetWidth: width
  7177. });
  7178. }
  7179. };
  7180. this.getTargetElement = function () {
  7181. return _this3.props.getRootDomNode();
  7182. };
  7183. this.getAlignTarget = function () {
  7184. var point = _this3.props.point;
  7185. if (point) {
  7186. return point;
  7187. }
  7188. return _this3.getTargetElement;
  7189. };
  7190. };
  7191. /* harmony default export */ __webpack_exports__["a"] = (Popup);
  7192. /***/ }),
  7193. /* 150 */
  7194. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7195. "use strict";
  7196. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Align__ = __webpack_require__(151);
  7197. // export this package's api
  7198. /* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0__Align__["a" /* default */]);
  7199. /***/ }),
  7200. /* 151 */
  7201. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7202. "use strict";
  7203. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__ = __webpack_require__(2);
  7204. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__);
  7205. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_createClass__ = __webpack_require__(12);
  7206. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_createClass___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_createClass__);
  7207. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(3);
  7208. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn__);
  7209. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits__ = __webpack_require__(4);
  7210. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits__);
  7211. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_react__ = __webpack_require__(0);
  7212. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_react__);
  7213. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_prop_types__ = __webpack_require__(1);
  7214. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_prop_types__);
  7215. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react_dom__ = __webpack_require__(14);
  7216. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react_dom___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_react_dom__);
  7217. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_dom_align__ = __webpack_require__(152);
  7218. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_rc_util_es_Dom_addEventListener__ = __webpack_require__(31);
  7219. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__util__ = __webpack_require__(153);
  7220. function getElement(func) {
  7221. if (typeof func !== 'function' || !func) return null;
  7222. return func();
  7223. }
  7224. function getPoint(point) {
  7225. if (typeof point !== 'object' || !point) return null;
  7226. return point;
  7227. }
  7228. var Align = function (_Component) {
  7229. __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits___default()(Align, _Component);
  7230. function Align() {
  7231. var _ref;
  7232. var _temp, _this, _ret;
  7233. __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default()(this, Align);
  7234. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  7235. args[_key] = arguments[_key];
  7236. }
  7237. return _ret = (_temp = (_this = __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn___default()(this, (_ref = Align.__proto__ || Object.getPrototypeOf(Align)).call.apply(_ref, [this].concat(args))), _this), _this.forceAlign = function () {
  7238. var _this$props = _this.props,
  7239. disabled = _this$props.disabled,
  7240. target = _this$props.target,
  7241. align = _this$props.align,
  7242. onAlign = _this$props.onAlign;
  7243. if (!disabled && target) {
  7244. var source = __WEBPACK_IMPORTED_MODULE_6_react_dom___default.a.findDOMNode(_this);
  7245. var result = void 0;
  7246. var element = getElement(target);
  7247. var point = getPoint(target);
  7248. // IE lose focus after element realign
  7249. // We should record activeElement and restore later
  7250. var activeElement = document.activeElement;
  7251. if (element) {
  7252. result = Object(__WEBPACK_IMPORTED_MODULE_7_dom_align__["a" /* alignElement */])(source, element, align);
  7253. } else if (point) {
  7254. result = Object(__WEBPACK_IMPORTED_MODULE_7_dom_align__["b" /* alignPoint */])(source, point, align);
  7255. }
  7256. Object(__WEBPACK_IMPORTED_MODULE_9__util__["e" /* restoreFocus */])(activeElement, source);
  7257. if (onAlign) {
  7258. onAlign(source, result);
  7259. }
  7260. }
  7261. }, _temp), __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn___default()(_this, _ret);
  7262. }
  7263. __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_createClass___default()(Align, [{
  7264. key: 'componentDidMount',
  7265. value: function componentDidMount() {
  7266. var props = this.props;
  7267. // if parent ref not attached .... use document.getElementById
  7268. this.forceAlign();
  7269. if (!props.disabled && props.monitorWindowResize) {
  7270. this.startMonitorWindowResize();
  7271. }
  7272. }
  7273. }, {
  7274. key: 'componentDidUpdate',
  7275. value: function componentDidUpdate(prevProps) {
  7276. var reAlign = false;
  7277. var props = this.props;
  7278. if (!props.disabled) {
  7279. var source = __WEBPACK_IMPORTED_MODULE_6_react_dom___default.a.findDOMNode(this);
  7280. var sourceRect = source ? source.getBoundingClientRect() : null;
  7281. if (prevProps.disabled) {
  7282. reAlign = true;
  7283. } else {
  7284. var lastElement = getElement(prevProps.target);
  7285. var currentElement = getElement(props.target);
  7286. var lastPoint = getPoint(prevProps.target);
  7287. var currentPoint = getPoint(props.target);
  7288. if (Object(__WEBPACK_IMPORTED_MODULE_9__util__["d" /* isWindow */])(lastElement) && Object(__WEBPACK_IMPORTED_MODULE_9__util__["d" /* isWindow */])(currentElement)) {
  7289. // Skip if is window
  7290. reAlign = false;
  7291. } else if (lastElement !== currentElement || // Element change
  7292. lastElement && !currentElement && currentPoint || // Change from element to point
  7293. lastPoint && currentPoint && currentElement || // Change from point to element
  7294. currentPoint && !Object(__WEBPACK_IMPORTED_MODULE_9__util__["b" /* isSamePoint */])(lastPoint, currentPoint)) {
  7295. reAlign = true;
  7296. }
  7297. // If source element size changed
  7298. var preRect = this.sourceRect || {};
  7299. if (!reAlign && source && (!Object(__WEBPACK_IMPORTED_MODULE_9__util__["c" /* isSimilarValue */])(preRect.width, sourceRect.width) || !Object(__WEBPACK_IMPORTED_MODULE_9__util__["c" /* isSimilarValue */])(preRect.height, sourceRect.height))) {
  7300. reAlign = true;
  7301. }
  7302. }
  7303. this.sourceRect = sourceRect;
  7304. }
  7305. if (reAlign) {
  7306. this.forceAlign();
  7307. }
  7308. if (props.monitorWindowResize && !props.disabled) {
  7309. this.startMonitorWindowResize();
  7310. } else {
  7311. this.stopMonitorWindowResize();
  7312. }
  7313. }
  7314. }, {
  7315. key: 'componentWillUnmount',
  7316. value: function componentWillUnmount() {
  7317. this.stopMonitorWindowResize();
  7318. }
  7319. }, {
  7320. key: 'startMonitorWindowResize',
  7321. value: function startMonitorWindowResize() {
  7322. if (!this.resizeHandler) {
  7323. this.bufferMonitor = Object(__WEBPACK_IMPORTED_MODULE_9__util__["a" /* buffer */])(this.forceAlign, this.props.monitorBufferTime);
  7324. this.resizeHandler = Object(__WEBPACK_IMPORTED_MODULE_8_rc_util_es_Dom_addEventListener__["a" /* default */])(window, 'resize', this.bufferMonitor);
  7325. }
  7326. }
  7327. }, {
  7328. key: 'stopMonitorWindowResize',
  7329. value: function stopMonitorWindowResize() {
  7330. if (this.resizeHandler) {
  7331. this.bufferMonitor.clear();
  7332. this.resizeHandler.remove();
  7333. this.resizeHandler = null;
  7334. }
  7335. }
  7336. }, {
  7337. key: 'render',
  7338. value: function render() {
  7339. var _this2 = this;
  7340. var _props = this.props,
  7341. childrenProps = _props.childrenProps,
  7342. children = _props.children;
  7343. var child = __WEBPACK_IMPORTED_MODULE_4_react___default.a.Children.only(children);
  7344. if (childrenProps) {
  7345. var newProps = {};
  7346. var propList = Object.keys(childrenProps);
  7347. propList.forEach(function (prop) {
  7348. newProps[prop] = _this2.props[childrenProps[prop]];
  7349. });
  7350. return __WEBPACK_IMPORTED_MODULE_4_react___default.a.cloneElement(child, newProps);
  7351. }
  7352. return child;
  7353. }
  7354. }]);
  7355. return Align;
  7356. }(__WEBPACK_IMPORTED_MODULE_4_react__["Component"]);
  7357. Align.propTypes = {
  7358. childrenProps: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.object,
  7359. align: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.object.isRequired,
  7360. target: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.shape({
  7361. clientX: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.number,
  7362. clientY: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.number,
  7363. pageX: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.number,
  7364. pageY: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.number
  7365. })]),
  7366. onAlign: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func,
  7367. monitorBufferTime: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.number,
  7368. monitorWindowResize: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.bool,
  7369. disabled: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.bool,
  7370. children: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.any
  7371. };
  7372. Align.defaultProps = {
  7373. target: function target() {
  7374. return window;
  7375. },
  7376. monitorBufferTime: 50,
  7377. monitorWindowResize: false,
  7378. disabled: false
  7379. };
  7380. /* harmony default export */ __webpack_exports__["a"] = (Align);
  7381. /***/ }),
  7382. /* 152 */
  7383. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7384. "use strict";
  7385. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return alignElement; });
  7386. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return alignPoint; });
  7387. function _typeof(obj) {
  7388. if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
  7389. _typeof = function (obj) {
  7390. return typeof obj;
  7391. };
  7392. } else {
  7393. _typeof = function (obj) {
  7394. return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  7395. };
  7396. }
  7397. return _typeof(obj);
  7398. }
  7399. function _defineProperty(obj, key, value) {
  7400. if (key in obj) {
  7401. Object.defineProperty(obj, key, {
  7402. value: value,
  7403. enumerable: true,
  7404. configurable: true,
  7405. writable: true
  7406. });
  7407. } else {
  7408. obj[key] = value;
  7409. }
  7410. return obj;
  7411. }
  7412. function ownKeys(object, enumerableOnly) {
  7413. var keys = Object.keys(object);
  7414. if (Object.getOwnPropertySymbols) {
  7415. var symbols = Object.getOwnPropertySymbols(object);
  7416. if (enumerableOnly) symbols = symbols.filter(function (sym) {
  7417. return Object.getOwnPropertyDescriptor(object, sym).enumerable;
  7418. });
  7419. keys.push.apply(keys, symbols);
  7420. }
  7421. return keys;
  7422. }
  7423. function _objectSpread2(target) {
  7424. for (var i = 1; i < arguments.length; i++) {
  7425. var source = arguments[i] != null ? arguments[i] : {};
  7426. if (i % 2) {
  7427. ownKeys(source, true).forEach(function (key) {
  7428. _defineProperty(target, key, source[key]);
  7429. });
  7430. } else if (Object.getOwnPropertyDescriptors) {
  7431. Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
  7432. } else {
  7433. ownKeys(source).forEach(function (key) {
  7434. Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
  7435. });
  7436. }
  7437. }
  7438. return target;
  7439. }
  7440. var vendorPrefix;
  7441. var jsCssMap = {
  7442. Webkit: '-webkit-',
  7443. Moz: '-moz-',
  7444. // IE did it wrong again ...
  7445. ms: '-ms-',
  7446. O: '-o-'
  7447. };
  7448. function getVendorPrefix() {
  7449. if (vendorPrefix !== undefined) {
  7450. return vendorPrefix;
  7451. }
  7452. vendorPrefix = '';
  7453. var style = document.createElement('p').style;
  7454. var testProp = 'Transform';
  7455. for (var key in jsCssMap) {
  7456. if (key + testProp in style) {
  7457. vendorPrefix = key;
  7458. }
  7459. }
  7460. return vendorPrefix;
  7461. }
  7462. function getTransitionName() {
  7463. return getVendorPrefix() ? "".concat(getVendorPrefix(), "TransitionProperty") : 'transitionProperty';
  7464. }
  7465. function getTransformName() {
  7466. return getVendorPrefix() ? "".concat(getVendorPrefix(), "Transform") : 'transform';
  7467. }
  7468. function setTransitionProperty(node, value) {
  7469. var name = getTransitionName();
  7470. if (name) {
  7471. node.style[name] = value;
  7472. if (name !== 'transitionProperty') {
  7473. node.style.transitionProperty = value;
  7474. }
  7475. }
  7476. }
  7477. function setTransform(node, value) {
  7478. var name = getTransformName();
  7479. if (name) {
  7480. node.style[name] = value;
  7481. if (name !== 'transform') {
  7482. node.style.transform = value;
  7483. }
  7484. }
  7485. }
  7486. function getTransitionProperty(node) {
  7487. return node.style.transitionProperty || node.style[getTransitionName()];
  7488. }
  7489. function getTransformXY(node) {
  7490. var style = window.getComputedStyle(node, null);
  7491. var transform = style.getPropertyValue('transform') || style.getPropertyValue(getTransformName());
  7492. if (transform && transform !== 'none') {
  7493. var matrix = transform.replace(/[^0-9\-.,]/g, '').split(',');
  7494. return {
  7495. x: parseFloat(matrix[12] || matrix[4], 0),
  7496. y: parseFloat(matrix[13] || matrix[5], 0)
  7497. };
  7498. }
  7499. return {
  7500. x: 0,
  7501. y: 0
  7502. };
  7503. }
  7504. var matrix2d = /matrix\((.*)\)/;
  7505. var matrix3d = /matrix3d\((.*)\)/;
  7506. function setTransformXY(node, xy) {
  7507. var style = window.getComputedStyle(node, null);
  7508. var transform = style.getPropertyValue('transform') || style.getPropertyValue(getTransformName());
  7509. if (transform && transform !== 'none') {
  7510. var arr;
  7511. var match2d = transform.match(matrix2d);
  7512. if (match2d) {
  7513. match2d = match2d[1];
  7514. arr = match2d.split(',').map(function (item) {
  7515. return parseFloat(item, 10);
  7516. });
  7517. arr[4] = xy.x;
  7518. arr[5] = xy.y;
  7519. setTransform(node, "matrix(".concat(arr.join(','), ")"));
  7520. } else {
  7521. var match3d = transform.match(matrix3d)[1];
  7522. arr = match3d.split(',').map(function (item) {
  7523. return parseFloat(item, 10);
  7524. });
  7525. arr[12] = xy.x;
  7526. arr[13] = xy.y;
  7527. setTransform(node, "matrix3d(".concat(arr.join(','), ")"));
  7528. }
  7529. } else {
  7530. setTransform(node, "translateX(".concat(xy.x, "px) translateY(").concat(xy.y, "px) translateZ(0)"));
  7531. }
  7532. }
  7533. var RE_NUM = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source;
  7534. var getComputedStyleX; // https://stackoverflow.com/a/3485654/3040605
  7535. function forceRelayout(elem) {
  7536. var originalStyle = elem.style.display;
  7537. elem.style.display = 'none';
  7538. elem.offsetHeight; // eslint-disable-line
  7539. elem.style.display = originalStyle;
  7540. }
  7541. function css(el, name, v) {
  7542. var value = v;
  7543. if (_typeof(name) === 'object') {
  7544. for (var i in name) {
  7545. if (name.hasOwnProperty(i)) {
  7546. css(el, i, name[i]);
  7547. }
  7548. }
  7549. return undefined;
  7550. }
  7551. if (typeof value !== 'undefined') {
  7552. if (typeof value === 'number') {
  7553. value = "".concat(value, "px");
  7554. }
  7555. el.style[name] = value;
  7556. return undefined;
  7557. }
  7558. return getComputedStyleX(el, name);
  7559. }
  7560. function getClientPosition(elem) {
  7561. var box;
  7562. var x;
  7563. var y;
  7564. var doc = elem.ownerDocument;
  7565. var body = doc.body;
  7566. var docElem = doc && doc.documentElement; // 根据 GBS 最新数据,A-Grade Browsers 都已支持 getBoundingClientRect 方法,不用再考虑传统的实现方式
  7567. box = elem.getBoundingClientRect(); // 注:jQuery 还考虑减去 docElem.clientLeft/clientTop
  7568. // 但测试发现,这样反而会导致当 html 和 body 有边距/边框样式时,获取的值不正确
  7569. // 此外,ie6 会忽略 html 的 margin 值,幸运地是没有谁会去设置 html 的 margin
  7570. x = box.left;
  7571. y = box.top; // In IE, most of the time, 2 extra pixels are added to the top and left
  7572. // due to the implicit 2-pixel inset border. In IE6/7 quirks mode and
  7573. // IE6 standards mode, this border can be overridden by setting the
  7574. // document element's border to zero -- thus, we cannot rely on the
  7575. // offset always being 2 pixels.
  7576. // In quirks mode, the offset can be determined by querying the body's
  7577. // clientLeft/clientTop, but in standards mode, it is found by querying
  7578. // the document element's clientLeft/clientTop. Since we already called
  7579. // getClientBoundingRect we have already forced a reflow, so it is not
  7580. // too expensive just to query them all.
  7581. // ie 下应该减去窗口的边框吧,毕竟默认 absolute 都是相对窗口定位的
  7582. // 窗口边框标准是设 documentElement ,quirks 时设置 body
  7583. // 最好禁止在 body 和 html 上边框 ,但 ie < 9 html 默认有 2px ,减去
  7584. // 但是非 ie 不可能设置窗口边框,body html 也不是窗口 ,ie 可以通过 html,body 设置
  7585. // 标准 ie 下 docElem.clientTop 就是 border-top
  7586. // ie7 html 即窗口边框改变不了。永远为 2
  7587. // 但标准 firefox/chrome/ie9 下 docElem.clientTop 是窗口边框,即使设了 border-top 也为 0
  7588. x -= docElem.clientLeft || body.clientLeft || 0;
  7589. y -= docElem.clientTop || body.clientTop || 0;
  7590. return {
  7591. left: x,
  7592. top: y
  7593. };
  7594. }
  7595. function getScroll(w, top) {
  7596. var ret = w["page".concat(top ? 'Y' : 'X', "Offset")];
  7597. var method = "scroll".concat(top ? 'Top' : 'Left');
  7598. if (typeof ret !== 'number') {
  7599. var d = w.document; // ie6,7,8 standard mode
  7600. ret = d.documentElement[method];
  7601. if (typeof ret !== 'number') {
  7602. // quirks mode
  7603. ret = d.body[method];
  7604. }
  7605. }
  7606. return ret;
  7607. }
  7608. function getScrollLeft(w) {
  7609. return getScroll(w);
  7610. }
  7611. function getScrollTop(w) {
  7612. return getScroll(w, true);
  7613. }
  7614. function getOffset(el) {
  7615. var pos = getClientPosition(el);
  7616. var doc = el.ownerDocument;
  7617. var w = doc.defaultView || doc.parentWindow;
  7618. pos.left += getScrollLeft(w);
  7619. pos.top += getScrollTop(w);
  7620. return pos;
  7621. }
  7622. /**
  7623. * A crude way of determining if an object is a window
  7624. * @member util
  7625. */
  7626. function isWindow(obj) {
  7627. // must use == for ie8
  7628. /* eslint eqeqeq:0 */
  7629. return obj !== null && obj !== undefined && obj == obj.window;
  7630. }
  7631. function getDocument(node) {
  7632. if (isWindow(node)) {
  7633. return node.document;
  7634. }
  7635. if (node.nodeType === 9) {
  7636. return node;
  7637. }
  7638. return node.ownerDocument;
  7639. }
  7640. function _getComputedStyle(elem, name, cs) {
  7641. var computedStyle = cs;
  7642. var val = '';
  7643. var d = getDocument(elem);
  7644. computedStyle = computedStyle || d.defaultView.getComputedStyle(elem, null); // https://github.com/kissyteam/kissy/issues/61
  7645. if (computedStyle) {
  7646. val = computedStyle.getPropertyValue(name) || computedStyle[name];
  7647. }
  7648. return val;
  7649. }
  7650. var _RE_NUM_NO_PX = new RegExp("^(".concat(RE_NUM, ")(?!px)[a-z%]+$"), 'i');
  7651. var RE_POS = /^(top|right|bottom|left)$/;
  7652. var CURRENT_STYLE = 'currentStyle';
  7653. var RUNTIME_STYLE = 'runtimeStyle';
  7654. var LEFT = 'left';
  7655. var PX = 'px';
  7656. function _getComputedStyleIE(elem, name) {
  7657. // currentStyle maybe null
  7658. // http://msdn.microsoft.com/en-us/library/ms535231.aspx
  7659. var ret = elem[CURRENT_STYLE] && elem[CURRENT_STYLE][name]; // 当 width/height 设置为百分比时,通过 pixelLeft 方式转换的 width/height 值
  7660. // 一开始就处理了! CUSTOM_STYLE.height,CUSTOM_STYLE.width ,cssHook 解决@2011-08-19
  7661. // 在 ie 下不对,需要直接用 offset 方式
  7662. // borderWidth 等值也有问题,但考虑到 borderWidth 设为百分比的概率很小,这里就不考虑了
  7663. // From the awesome hack by Dean Edwards
  7664. // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
  7665. // If we're not dealing with a regular pixel number
  7666. // but a number that has a weird ending, we need to convert it to pixels
  7667. // exclude left right for relativity
  7668. if (_RE_NUM_NO_PX.test(ret) && !RE_POS.test(name)) {
  7669. // Remember the original values
  7670. var style = elem.style;
  7671. var left = style[LEFT];
  7672. var rsLeft = elem[RUNTIME_STYLE][LEFT]; // prevent flashing of content
  7673. elem[RUNTIME_STYLE][LEFT] = elem[CURRENT_STYLE][LEFT]; // Put in the new values to get a computed value out
  7674. style[LEFT] = name === 'fontSize' ? '1em' : ret || 0;
  7675. ret = style.pixelLeft + PX; // Revert the changed values
  7676. style[LEFT] = left;
  7677. elem[RUNTIME_STYLE][LEFT] = rsLeft;
  7678. }
  7679. return ret === '' ? 'auto' : ret;
  7680. }
  7681. if (typeof window !== 'undefined') {
  7682. getComputedStyleX = window.getComputedStyle ? _getComputedStyle : _getComputedStyleIE;
  7683. }
  7684. function getOffsetDirection(dir, option) {
  7685. if (dir === 'left') {
  7686. return option.useCssRight ? 'right' : dir;
  7687. }
  7688. return option.useCssBottom ? 'bottom' : dir;
  7689. }
  7690. function oppositeOffsetDirection(dir) {
  7691. if (dir === 'left') {
  7692. return 'right';
  7693. } else if (dir === 'right') {
  7694. return 'left';
  7695. } else if (dir === 'top') {
  7696. return 'bottom';
  7697. } else if (dir === 'bottom') {
  7698. return 'top';
  7699. }
  7700. } // 设置 elem 相对 elem.ownerDocument 的坐标
  7701. function setLeftTop(elem, offset, option) {
  7702. // set position first, in-case top/left are set even on static elem
  7703. if (css(elem, 'position') === 'static') {
  7704. elem.style.position = 'relative';
  7705. }
  7706. var presetH = -999;
  7707. var presetV = -999;
  7708. var horizontalProperty = getOffsetDirection('left', option);
  7709. var verticalProperty = getOffsetDirection('top', option);
  7710. var oppositeHorizontalProperty = oppositeOffsetDirection(horizontalProperty);
  7711. var oppositeVerticalProperty = oppositeOffsetDirection(verticalProperty);
  7712. if (horizontalProperty !== 'left') {
  7713. presetH = 999;
  7714. }
  7715. if (verticalProperty !== 'top') {
  7716. presetV = 999;
  7717. }
  7718. var originalTransition = '';
  7719. var originalOffset = getOffset(elem);
  7720. if ('left' in offset || 'top' in offset) {
  7721. originalTransition = getTransitionProperty(elem) || '';
  7722. setTransitionProperty(elem, 'none');
  7723. }
  7724. if ('left' in offset) {
  7725. elem.style[oppositeHorizontalProperty] = '';
  7726. elem.style[horizontalProperty] = "".concat(presetH, "px");
  7727. }
  7728. if ('top' in offset) {
  7729. elem.style[oppositeVerticalProperty] = '';
  7730. elem.style[verticalProperty] = "".concat(presetV, "px");
  7731. } // force relayout
  7732. forceRelayout(elem);
  7733. var old = getOffset(elem);
  7734. var originalStyle = {};
  7735. for (var key in offset) {
  7736. if (offset.hasOwnProperty(key)) {
  7737. var dir = getOffsetDirection(key, option);
  7738. var preset = key === 'left' ? presetH : presetV;
  7739. var off = originalOffset[key] - old[key];
  7740. if (dir === key) {
  7741. originalStyle[dir] = preset + off;
  7742. } else {
  7743. originalStyle[dir] = preset - off;
  7744. }
  7745. }
  7746. }
  7747. css(elem, originalStyle); // force relayout
  7748. forceRelayout(elem);
  7749. if ('left' in offset || 'top' in offset) {
  7750. setTransitionProperty(elem, originalTransition);
  7751. }
  7752. var ret = {};
  7753. for (var _key in offset) {
  7754. if (offset.hasOwnProperty(_key)) {
  7755. var _dir = getOffsetDirection(_key, option);
  7756. var _off = offset[_key] - originalOffset[_key];
  7757. if (_key === _dir) {
  7758. ret[_dir] = originalStyle[_dir] + _off;
  7759. } else {
  7760. ret[_dir] = originalStyle[_dir] - _off;
  7761. }
  7762. }
  7763. }
  7764. css(elem, ret);
  7765. }
  7766. function setTransform$1(elem, offset) {
  7767. var originalOffset = getOffset(elem);
  7768. var originalXY = getTransformXY(elem);
  7769. var resultXY = {
  7770. x: originalXY.x,
  7771. y: originalXY.y
  7772. };
  7773. if ('left' in offset) {
  7774. resultXY.x = originalXY.x + offset.left - originalOffset.left;
  7775. }
  7776. if ('top' in offset) {
  7777. resultXY.y = originalXY.y + offset.top - originalOffset.top;
  7778. }
  7779. setTransformXY(elem, resultXY);
  7780. }
  7781. function setOffset(elem, offset, option) {
  7782. if (option.ignoreShake) {
  7783. var oriOffset = getOffset(elem);
  7784. var oLeft = oriOffset.left.toFixed(0);
  7785. var oTop = oriOffset.top.toFixed(0);
  7786. var tLeft = offset.left.toFixed(0);
  7787. var tTop = offset.top.toFixed(0);
  7788. if (oLeft === tLeft && oTop === tTop) {
  7789. return;
  7790. }
  7791. }
  7792. if (option.useCssRight || option.useCssBottom) {
  7793. setLeftTop(elem, offset, option);
  7794. } else if (option.useCssTransform && getTransformName() in document.body.style) {
  7795. setTransform$1(elem, offset);
  7796. } else {
  7797. setLeftTop(elem, offset, option);
  7798. }
  7799. }
  7800. function each(arr, fn) {
  7801. for (var i = 0; i < arr.length; i++) {
  7802. fn(arr[i]);
  7803. }
  7804. }
  7805. function isBorderBoxFn(elem) {
  7806. return getComputedStyleX(elem, 'boxSizing') === 'border-box';
  7807. }
  7808. var BOX_MODELS = ['margin', 'border', 'padding'];
  7809. var CONTENT_INDEX = -1;
  7810. var PADDING_INDEX = 2;
  7811. var BORDER_INDEX = 1;
  7812. var MARGIN_INDEX = 0;
  7813. function swap(elem, options, callback) {
  7814. var old = {};
  7815. var style = elem.style;
  7816. var name; // Remember the old values, and insert the new ones
  7817. for (name in options) {
  7818. if (options.hasOwnProperty(name)) {
  7819. old[name] = style[name];
  7820. style[name] = options[name];
  7821. }
  7822. }
  7823. callback.call(elem); // Revert the old values
  7824. for (name in options) {
  7825. if (options.hasOwnProperty(name)) {
  7826. style[name] = old[name];
  7827. }
  7828. }
  7829. }
  7830. function getPBMWidth(elem, props, which) {
  7831. var value = 0;
  7832. var prop;
  7833. var j;
  7834. var i;
  7835. for (j = 0; j < props.length; j++) {
  7836. prop = props[j];
  7837. if (prop) {
  7838. for (i = 0; i < which.length; i++) {
  7839. var cssProp = void 0;
  7840. if (prop === 'border') {
  7841. cssProp = "".concat(prop).concat(which[i], "Width");
  7842. } else {
  7843. cssProp = prop + which[i];
  7844. }
  7845. value += parseFloat(getComputedStyleX(elem, cssProp)) || 0;
  7846. }
  7847. }
  7848. }
  7849. return value;
  7850. }
  7851. var domUtils = {
  7852. getParent: function getParent(element) {
  7853. var parent = element;
  7854. do {
  7855. if (parent.nodeType === 11 && parent.host) {
  7856. parent = parent.host;
  7857. } else {
  7858. parent = parent.parentNode;
  7859. }
  7860. } while (parent && parent.nodeType !== 1 && parent.nodeType !== 9);
  7861. return parent;
  7862. }
  7863. };
  7864. each(['Width', 'Height'], function (name) {
  7865. domUtils["doc".concat(name)] = function (refWin) {
  7866. var d = refWin.document;
  7867. return Math.max( // firefox chrome documentElement.scrollHeight< body.scrollHeight
  7868. // ie standard mode : documentElement.scrollHeight> body.scrollHeight
  7869. d.documentElement["scroll".concat(name)], // quirks : documentElement.scrollHeight 最大等于可视窗口多一点?
  7870. d.body["scroll".concat(name)], domUtils["viewport".concat(name)](d));
  7871. };
  7872. domUtils["viewport".concat(name)] = function (win) {
  7873. // pc browser includes scrollbar in window.innerWidth
  7874. var prop = "client".concat(name);
  7875. var doc = win.document;
  7876. var body = doc.body;
  7877. var documentElement = doc.documentElement;
  7878. var documentElementProp = documentElement[prop]; // 标准模式取 documentElement
  7879. // backcompat 取 body
  7880. return doc.compatMode === 'CSS1Compat' && documentElementProp || body && body[prop] || documentElementProp;
  7881. };
  7882. });
  7883. /*
  7884. 得到元素的大小信息
  7885. @param elem
  7886. @param name
  7887. @param {String} [extra] 'padding' : (css width) + padding
  7888. 'border' : (css width) + padding + border
  7889. 'margin' : (css width) + padding + border + margin
  7890. */
  7891. function getWH(elem, name, ex) {
  7892. var extra = ex;
  7893. if (isWindow(elem)) {
  7894. return name === 'width' ? domUtils.viewportWidth(elem) : domUtils.viewportHeight(elem);
  7895. } else if (elem.nodeType === 9) {
  7896. return name === 'width' ? domUtils.docWidth(elem) : domUtils.docHeight(elem);
  7897. }
  7898. var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];
  7899. var borderBoxValue = name === 'width' ? elem.getBoundingClientRect().width : elem.getBoundingClientRect().height;
  7900. var computedStyle = getComputedStyleX(elem);
  7901. var isBorderBox = isBorderBoxFn(elem);
  7902. var cssBoxValue = 0;
  7903. if (borderBoxValue === null || borderBoxValue === undefined || borderBoxValue <= 0) {
  7904. borderBoxValue = undefined; // Fall back to computed then un computed css if necessary
  7905. cssBoxValue = getComputedStyleX(elem, name);
  7906. if (cssBoxValue === null || cssBoxValue === undefined || Number(cssBoxValue) < 0) {
  7907. cssBoxValue = elem.style[name] || 0;
  7908. } // Normalize '', auto, and prepare for extra
  7909. cssBoxValue = parseFloat(cssBoxValue) || 0;
  7910. }
  7911. if (extra === undefined) {
  7912. extra = isBorderBox ? BORDER_INDEX : CONTENT_INDEX;
  7913. }
  7914. var borderBoxValueOrIsBorderBox = borderBoxValue !== undefined || isBorderBox;
  7915. var val = borderBoxValue || cssBoxValue;
  7916. if (extra === CONTENT_INDEX) {
  7917. if (borderBoxValueOrIsBorderBox) {
  7918. return val - getPBMWidth(elem, ['border', 'padding'], which);
  7919. }
  7920. return cssBoxValue;
  7921. } else if (borderBoxValueOrIsBorderBox) {
  7922. if (extra === BORDER_INDEX) {
  7923. return val;
  7924. }
  7925. return val + (extra === PADDING_INDEX ? -getPBMWidth(elem, ['border'], which) : getPBMWidth(elem, ['margin'], which));
  7926. }
  7927. return cssBoxValue + getPBMWidth(elem, BOX_MODELS.slice(extra), which);
  7928. }
  7929. var cssShow = {
  7930. position: 'absolute',
  7931. visibility: 'hidden',
  7932. display: 'block'
  7933. }; // fix #119 : https://github.com/kissyteam/kissy/issues/119
  7934. function getWHIgnoreDisplay() {
  7935. for (var _len = arguments.length, args = new Array(_len), _key2 = 0; _key2 < _len; _key2++) {
  7936. args[_key2] = arguments[_key2];
  7937. }
  7938. var val;
  7939. var elem = args[0]; // in case elem is window
  7940. // elem.offsetWidth === undefined
  7941. if (elem.offsetWidth !== 0) {
  7942. val = getWH.apply(undefined, args);
  7943. } else {
  7944. swap(elem, cssShow, function () {
  7945. val = getWH.apply(undefined, args);
  7946. });
  7947. }
  7948. return val;
  7949. }
  7950. each(['width', 'height'], function (name) {
  7951. var first = name.charAt(0).toUpperCase() + name.slice(1);
  7952. domUtils["outer".concat(first)] = function (el, includeMargin) {
  7953. return el && getWHIgnoreDisplay(el, name, includeMargin ? MARGIN_INDEX : BORDER_INDEX);
  7954. };
  7955. var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];
  7956. domUtils[name] = function (elem, v) {
  7957. var val = v;
  7958. if (val !== undefined) {
  7959. if (elem) {
  7960. var computedStyle = getComputedStyleX(elem);
  7961. var isBorderBox = isBorderBoxFn(elem);
  7962. if (isBorderBox) {
  7963. val += getPBMWidth(elem, ['padding', 'border'], which);
  7964. }
  7965. return css(elem, name, val);
  7966. }
  7967. return undefined;
  7968. }
  7969. return elem && getWHIgnoreDisplay(elem, name, CONTENT_INDEX);
  7970. };
  7971. });
  7972. function mix(to, from) {
  7973. for (var i in from) {
  7974. if (from.hasOwnProperty(i)) {
  7975. to[i] = from[i];
  7976. }
  7977. }
  7978. return to;
  7979. }
  7980. var utils = {
  7981. getWindow: function getWindow(node) {
  7982. if (node && node.document && node.setTimeout) {
  7983. return node;
  7984. }
  7985. var doc = node.ownerDocument || node;
  7986. return doc.defaultView || doc.parentWindow;
  7987. },
  7988. getDocument: getDocument,
  7989. offset: function offset(el, value, option) {
  7990. if (typeof value !== 'undefined') {
  7991. setOffset(el, value, option || {});
  7992. } else {
  7993. return getOffset(el);
  7994. }
  7995. },
  7996. isWindow: isWindow,
  7997. each: each,
  7998. css: css,
  7999. clone: function clone(obj) {
  8000. var i;
  8001. var ret = {};
  8002. for (i in obj) {
  8003. if (obj.hasOwnProperty(i)) {
  8004. ret[i] = obj[i];
  8005. }
  8006. }
  8007. var overflow = obj.overflow;
  8008. if (overflow) {
  8009. for (i in obj) {
  8010. if (obj.hasOwnProperty(i)) {
  8011. ret.overflow[i] = obj.overflow[i];
  8012. }
  8013. }
  8014. }
  8015. return ret;
  8016. },
  8017. mix: mix,
  8018. getWindowScrollLeft: function getWindowScrollLeft(w) {
  8019. return getScrollLeft(w);
  8020. },
  8021. getWindowScrollTop: function getWindowScrollTop(w) {
  8022. return getScrollTop(w);
  8023. },
  8024. merge: function merge() {
  8025. var ret = {};
  8026. for (var i = 0; i < arguments.length; i++) {
  8027. utils.mix(ret, i < 0 || arguments.length <= i ? undefined : arguments[i]);
  8028. }
  8029. return ret;
  8030. },
  8031. viewportWidth: 0,
  8032. viewportHeight: 0
  8033. };
  8034. mix(utils, domUtils);
  8035. /**
  8036. * 得到会导致元素显示不全的祖先元素
  8037. */
  8038. var getParent = utils.getParent;
  8039. function getOffsetParent(element) {
  8040. if (utils.isWindow(element) || element.nodeType === 9) {
  8041. return null;
  8042. } // ie 这个也不是完全可行
  8043. /*
  8044. <div style="width: 50px;height: 100px;overflow: hidden">
  8045. <div style="width: 50px;height: 100px;position: relative;" id="d6">
  8046. 元素 6 高 100px 宽 50px<br/>
  8047. </div>
  8048. </div>
  8049. */
  8050. // element.offsetParent does the right thing in ie7 and below. Return parent with layout!
  8051. // In other browsers it only includes elements with position absolute, relative or
  8052. // fixed, not elements with overflow set to auto or scroll.
  8053. // if (UA.ie && ieMode < 8) {
  8054. // return element.offsetParent;
  8055. // }
  8056. // 统一的 offsetParent 方法
  8057. var doc = utils.getDocument(element);
  8058. var body = doc.body;
  8059. var parent;
  8060. var positionStyle = utils.css(element, 'position');
  8061. var skipStatic = positionStyle === 'fixed' || positionStyle === 'absolute';
  8062. if (!skipStatic) {
  8063. return element.nodeName.toLowerCase() === 'html' ? null : getParent(element);
  8064. }
  8065. for (parent = getParent(element); parent && parent !== body; parent = getParent(parent)) {
  8066. positionStyle = utils.css(parent, 'position');
  8067. if (positionStyle !== 'static') {
  8068. return parent;
  8069. }
  8070. }
  8071. return null;
  8072. }
  8073. var getParent$1 = utils.getParent;
  8074. function isAncestorFixed(element) {
  8075. if (utils.isWindow(element) || element.nodeType === 9) {
  8076. return false;
  8077. }
  8078. var doc = utils.getDocument(element);
  8079. var body = doc.body;
  8080. var parent = null;
  8081. for (parent = getParent$1(element); parent && parent !== body; parent = getParent$1(parent)) {
  8082. var positionStyle = utils.css(parent, 'position');
  8083. if (positionStyle === 'fixed') {
  8084. return true;
  8085. }
  8086. }
  8087. return false;
  8088. }
  8089. /**
  8090. * 获得元素的显示部分的区域
  8091. */
  8092. function getVisibleRectForElement(element) {
  8093. var visibleRect = {
  8094. left: 0,
  8095. right: Infinity,
  8096. top: 0,
  8097. bottom: Infinity
  8098. };
  8099. var el = getOffsetParent(element);
  8100. var doc = utils.getDocument(element);
  8101. var win = doc.defaultView || doc.parentWindow;
  8102. var body = doc.body;
  8103. var documentElement = doc.documentElement; // Determine the size of the visible rect by climbing the dom accounting for
  8104. // all scrollable containers.
  8105. while (el) {
  8106. // clientWidth is zero for inline block elements in ie.
  8107. if ((navigator.userAgent.indexOf('MSIE') === -1 || el.clientWidth !== 0) && // body may have overflow set on it, yet we still get the entire
  8108. // viewport. In some browsers, el.offsetParent may be
  8109. // document.documentElement, so check for that too.
  8110. el !== body && el !== documentElement && utils.css(el, 'overflow') !== 'visible') {
  8111. var pos = utils.offset(el); // add border
  8112. pos.left += el.clientLeft;
  8113. pos.top += el.clientTop;
  8114. visibleRect.top = Math.max(visibleRect.top, pos.top);
  8115. visibleRect.right = Math.min(visibleRect.right, // consider area without scrollBar
  8116. pos.left + el.clientWidth);
  8117. visibleRect.bottom = Math.min(visibleRect.bottom, pos.top + el.clientHeight);
  8118. visibleRect.left = Math.max(visibleRect.left, pos.left);
  8119. } else if (el === body || el === documentElement) {
  8120. break;
  8121. }
  8122. el = getOffsetParent(el);
  8123. } // Set element position to fixed
  8124. // make sure absolute element itself don't affect it's visible area
  8125. // https://github.com/ant-design/ant-design/issues/7601
  8126. var originalPosition = null;
  8127. if (!utils.isWindow(element) && element.nodeType !== 9) {
  8128. originalPosition = element.style.position;
  8129. var position = utils.css(element, 'position');
  8130. if (position === 'absolute') {
  8131. element.style.position = 'fixed';
  8132. }
  8133. }
  8134. var scrollX = utils.getWindowScrollLeft(win);
  8135. var scrollY = utils.getWindowScrollTop(win);
  8136. var viewportWidth = utils.viewportWidth(win);
  8137. var viewportHeight = utils.viewportHeight(win);
  8138. var documentWidth = documentElement.scrollWidth;
  8139. var documentHeight = documentElement.scrollHeight; // scrollXXX on html is sync with body which means overflow: hidden on body gets wrong scrollXXX.
  8140. // We should cut this ourself.
  8141. var bodyStyle = window.getComputedStyle(body);
  8142. if (bodyStyle.overflowX === 'hidden') {
  8143. documentWidth = win.innerWidth;
  8144. }
  8145. if (bodyStyle.overflowY === 'hidden') {
  8146. documentHeight = win.innerHeight;
  8147. } // Reset element position after calculate the visible area
  8148. if (element.style) {
  8149. element.style.position = originalPosition;
  8150. }
  8151. if (isAncestorFixed(element)) {
  8152. // Clip by viewport's size.
  8153. visibleRect.left = Math.max(visibleRect.left, scrollX);
  8154. visibleRect.top = Math.max(visibleRect.top, scrollY);
  8155. visibleRect.right = Math.min(visibleRect.right, scrollX + viewportWidth);
  8156. visibleRect.bottom = Math.min(visibleRect.bottom, scrollY + viewportHeight);
  8157. } else {
  8158. // Clip by document's size.
  8159. var maxVisibleWidth = Math.max(documentWidth, scrollX + viewportWidth);
  8160. visibleRect.right = Math.min(visibleRect.right, maxVisibleWidth);
  8161. var maxVisibleHeight = Math.max(documentHeight, scrollY + viewportHeight);
  8162. visibleRect.bottom = Math.min(visibleRect.bottom, maxVisibleHeight);
  8163. }
  8164. return visibleRect.top >= 0 && visibleRect.left >= 0 && visibleRect.bottom > visibleRect.top && visibleRect.right > visibleRect.left ? visibleRect : null;
  8165. }
  8166. function adjustForViewport(elFuturePos, elRegion, visibleRect, overflow) {
  8167. var pos = utils.clone(elFuturePos);
  8168. var size = {
  8169. width: elRegion.width,
  8170. height: elRegion.height
  8171. };
  8172. if (overflow.adjustX && pos.left < visibleRect.left) {
  8173. pos.left = visibleRect.left;
  8174. } // Left edge inside and right edge outside viewport, try to resize it.
  8175. if (overflow.resizeWidth && pos.left >= visibleRect.left && pos.left + size.width > visibleRect.right) {
  8176. size.width -= pos.left + size.width - visibleRect.right;
  8177. } // Right edge outside viewport, try to move it.
  8178. if (overflow.adjustX && pos.left + size.width > visibleRect.right) {
  8179. // 保证左边界和可视区域左边界对齐
  8180. pos.left = Math.max(visibleRect.right - size.width, visibleRect.left);
  8181. } // Top edge outside viewport, try to move it.
  8182. if (overflow.adjustY && pos.top < visibleRect.top) {
  8183. pos.top = visibleRect.top;
  8184. } // Top edge inside and bottom edge outside viewport, try to resize it.
  8185. if (overflow.resizeHeight && pos.top >= visibleRect.top && pos.top + size.height > visibleRect.bottom) {
  8186. size.height -= pos.top + size.height - visibleRect.bottom;
  8187. } // Bottom edge outside viewport, try to move it.
  8188. if (overflow.adjustY && pos.top + size.height > visibleRect.bottom) {
  8189. // 保证上边界和可视区域上边界对齐
  8190. pos.top = Math.max(visibleRect.bottom - size.height, visibleRect.top);
  8191. }
  8192. return utils.mix(pos, size);
  8193. }
  8194. function getRegion(node) {
  8195. var offset;
  8196. var w;
  8197. var h;
  8198. if (!utils.isWindow(node) && node.nodeType !== 9) {
  8199. offset = utils.offset(node);
  8200. w = utils.outerWidth(node);
  8201. h = utils.outerHeight(node);
  8202. } else {
  8203. var win = utils.getWindow(node);
  8204. offset = {
  8205. left: utils.getWindowScrollLeft(win),
  8206. top: utils.getWindowScrollTop(win)
  8207. };
  8208. w = utils.viewportWidth(win);
  8209. h = utils.viewportHeight(win);
  8210. }
  8211. offset.width = w;
  8212. offset.height = h;
  8213. return offset;
  8214. }
  8215. /**
  8216. * 获取 node 上的 align 对齐点 相对于页面的坐标
  8217. */
  8218. function getAlignOffset(region, align) {
  8219. var V = align.charAt(0);
  8220. var H = align.charAt(1);
  8221. var w = region.width;
  8222. var h = region.height;
  8223. var x = region.left;
  8224. var y = region.top;
  8225. if (V === 'c') {
  8226. y += h / 2;
  8227. } else if (V === 'b') {
  8228. y += h;
  8229. }
  8230. if (H === 'c') {
  8231. x += w / 2;
  8232. } else if (H === 'r') {
  8233. x += w;
  8234. }
  8235. return {
  8236. left: x,
  8237. top: y
  8238. };
  8239. }
  8240. function getElFuturePos(elRegion, refNodeRegion, points, offset, targetOffset) {
  8241. var p1 = getAlignOffset(refNodeRegion, points[1]);
  8242. var p2 = getAlignOffset(elRegion, points[0]);
  8243. var diff = [p2.left - p1.left, p2.top - p1.top];
  8244. return {
  8245. left: Math.round(elRegion.left - diff[0] + offset[0] - targetOffset[0]),
  8246. top: Math.round(elRegion.top - diff[1] + offset[1] - targetOffset[1])
  8247. };
  8248. }
  8249. /**
  8250. * align dom node flexibly
  8251. * @author yiminghe@gmail.com
  8252. */
  8253. function isFailX(elFuturePos, elRegion, visibleRect) {
  8254. return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;
  8255. }
  8256. function isFailY(elFuturePos, elRegion, visibleRect) {
  8257. return elFuturePos.top < visibleRect.top || elFuturePos.top + elRegion.height > visibleRect.bottom;
  8258. }
  8259. function isCompleteFailX(elFuturePos, elRegion, visibleRect) {
  8260. return elFuturePos.left > visibleRect.right || elFuturePos.left + elRegion.width < visibleRect.left;
  8261. }
  8262. function isCompleteFailY(elFuturePos, elRegion, visibleRect) {
  8263. return elFuturePos.top > visibleRect.bottom || elFuturePos.top + elRegion.height < visibleRect.top;
  8264. }
  8265. function flip(points, reg, map) {
  8266. var ret = [];
  8267. utils.each(points, function (p) {
  8268. ret.push(p.replace(reg, function (m) {
  8269. return map[m];
  8270. }));
  8271. });
  8272. return ret;
  8273. }
  8274. function flipOffset(offset, index) {
  8275. offset[index] = -offset[index];
  8276. return offset;
  8277. }
  8278. function convertOffset(str, offsetLen) {
  8279. var n;
  8280. if (/%$/.test(str)) {
  8281. n = parseInt(str.substring(0, str.length - 1), 10) / 100 * offsetLen;
  8282. } else {
  8283. n = parseInt(str, 10);
  8284. }
  8285. return n || 0;
  8286. }
  8287. function normalizeOffset(offset, el) {
  8288. offset[0] = convertOffset(offset[0], el.width);
  8289. offset[1] = convertOffset(offset[1], el.height);
  8290. }
  8291. /**
  8292. * @param el
  8293. * @param tgtRegion 参照节点所占的区域: { left, top, width, height }
  8294. * @param align
  8295. */
  8296. function doAlign(el, tgtRegion, align, isTgtRegionVisible) {
  8297. var points = align.points;
  8298. var offset = align.offset || [0, 0];
  8299. var targetOffset = align.targetOffset || [0, 0];
  8300. var overflow = align.overflow;
  8301. var source = align.source || el;
  8302. offset = [].concat(offset);
  8303. targetOffset = [].concat(targetOffset);
  8304. overflow = overflow || {};
  8305. var newOverflowCfg = {};
  8306. var fail = 0; // 当前节点可以被放置的显示区域
  8307. var visibleRect = getVisibleRectForElement(source); // 当前节点所占的区域, left/top/width/height
  8308. var elRegion = getRegion(source); // 将 offset 转换成数值,支持百分比
  8309. normalizeOffset(offset, elRegion);
  8310. normalizeOffset(targetOffset, tgtRegion); // 当前节点将要被放置的位置
  8311. var elFuturePos = getElFuturePos(elRegion, tgtRegion, points, offset, targetOffset); // 当前节点将要所处的区域
  8312. var newElRegion = utils.merge(elRegion, elFuturePos); // 如果可视区域不能完全放置当前节点时允许调整
  8313. if (visibleRect && (overflow.adjustX || overflow.adjustY) && isTgtRegionVisible) {
  8314. if (overflow.adjustX) {
  8315. // 如果横向不能放下
  8316. if (isFailX(elFuturePos, elRegion, visibleRect)) {
  8317. // 对齐位置反下
  8318. var newPoints = flip(points, /[lr]/gi, {
  8319. l: 'r',
  8320. r: 'l'
  8321. }); // 偏移量也反下
  8322. var newOffset = flipOffset(offset, 0);
  8323. var newTargetOffset = flipOffset(targetOffset, 0);
  8324. var newElFuturePos = getElFuturePos(elRegion, tgtRegion, newPoints, newOffset, newTargetOffset);
  8325. if (!isCompleteFailX(newElFuturePos, elRegion, visibleRect)) {
  8326. fail = 1;
  8327. points = newPoints;
  8328. offset = newOffset;
  8329. targetOffset = newTargetOffset;
  8330. }
  8331. }
  8332. }
  8333. if (overflow.adjustY) {
  8334. // 如果纵向不能放下
  8335. if (isFailY(elFuturePos, elRegion, visibleRect)) {
  8336. // 对齐位置反下
  8337. var _newPoints = flip(points, /[tb]/gi, {
  8338. t: 'b',
  8339. b: 't'
  8340. }); // 偏移量也反下
  8341. var _newOffset = flipOffset(offset, 1);
  8342. var _newTargetOffset = flipOffset(targetOffset, 1);
  8343. var _newElFuturePos = getElFuturePos(elRegion, tgtRegion, _newPoints, _newOffset, _newTargetOffset);
  8344. if (!isCompleteFailY(_newElFuturePos, elRegion, visibleRect)) {
  8345. fail = 1;
  8346. points = _newPoints;
  8347. offset = _newOffset;
  8348. targetOffset = _newTargetOffset;
  8349. }
  8350. }
  8351. } // 如果失败,重新计算当前节点将要被放置的位置
  8352. if (fail) {
  8353. elFuturePos = getElFuturePos(elRegion, tgtRegion, points, offset, targetOffset);
  8354. utils.mix(newElRegion, elFuturePos);
  8355. }
  8356. var isStillFailX = isFailX(elFuturePos, elRegion, visibleRect);
  8357. var isStillFailY = isFailY(elFuturePos, elRegion, visibleRect); // 检查反下后的位置是否可以放下了,如果仍然放不下:
  8358. // 1. 复原修改过的定位参数
  8359. if (isStillFailX || isStillFailY) {
  8360. points = align.points;
  8361. offset = align.offset || [0, 0];
  8362. targetOffset = align.targetOffset || [0, 0];
  8363. } // 2. 只有指定了可以调整当前方向才调整
  8364. newOverflowCfg.adjustX = overflow.adjustX && isStillFailX;
  8365. newOverflowCfg.adjustY = overflow.adjustY && isStillFailY; // 确实要调整,甚至可能会调整高度宽度
  8366. if (newOverflowCfg.adjustX || newOverflowCfg.adjustY) {
  8367. newElRegion = adjustForViewport(elFuturePos, elRegion, visibleRect, newOverflowCfg);
  8368. }
  8369. } // need judge to in case set fixed with in css on height auto element
  8370. if (newElRegion.width !== elRegion.width) {
  8371. utils.css(source, 'width', utils.width(source) + newElRegion.width - elRegion.width);
  8372. }
  8373. if (newElRegion.height !== elRegion.height) {
  8374. utils.css(source, 'height', utils.height(source) + newElRegion.height - elRegion.height);
  8375. } // https://github.com/kissyteam/kissy/issues/190
  8376. // 相对于屏幕位置没变,而 left/top 变了
  8377. // 例如 <div 'relative'><el absolute></div>
  8378. utils.offset(source, {
  8379. left: newElRegion.left,
  8380. top: newElRegion.top
  8381. }, {
  8382. useCssRight: align.useCssRight,
  8383. useCssBottom: align.useCssBottom,
  8384. useCssTransform: align.useCssTransform,
  8385. ignoreShake: align.ignoreShake
  8386. });
  8387. return {
  8388. points: points,
  8389. offset: offset,
  8390. targetOffset: targetOffset,
  8391. overflow: newOverflowCfg
  8392. };
  8393. }
  8394. /**
  8395. * 2012-04-26 yiminghe@gmail.com
  8396. * - 优化智能对齐算法
  8397. * - 慎用 resizeXX
  8398. *
  8399. * 2011-07-13 yiminghe@gmail.com note:
  8400. * - 增加智能对齐,以及大小调整选项
  8401. **/
  8402. function isOutOfVisibleRect(target) {
  8403. var visibleRect = getVisibleRectForElement(target);
  8404. var targetRegion = getRegion(target);
  8405. return !visibleRect || targetRegion.left + targetRegion.width <= visibleRect.left || targetRegion.top + targetRegion.height <= visibleRect.top || targetRegion.left >= visibleRect.right || targetRegion.top >= visibleRect.bottom;
  8406. }
  8407. function alignElement(el, refNode, align) {
  8408. var target = align.target || refNode;
  8409. var refNodeRegion = getRegion(target);
  8410. var isTargetNotOutOfVisible = !isOutOfVisibleRect(target);
  8411. return doAlign(el, refNodeRegion, align, isTargetNotOutOfVisible);
  8412. }
  8413. alignElement.__getOffsetParent = getOffsetParent;
  8414. alignElement.__getVisibleRectForElement = getVisibleRectForElement;
  8415. /**
  8416. * `tgtPoint`: { pageX, pageY } or { clientX, clientY }.
  8417. * If client position provided, will internal convert to page position.
  8418. */
  8419. function alignPoint(el, tgtPoint, align) {
  8420. var pageX;
  8421. var pageY;
  8422. var doc = utils.getDocument(el);
  8423. var win = doc.defaultView || doc.parentWindow;
  8424. var scrollX = utils.getWindowScrollLeft(win);
  8425. var scrollY = utils.getWindowScrollTop(win);
  8426. var viewportWidth = utils.viewportWidth(win);
  8427. var viewportHeight = utils.viewportHeight(win);
  8428. if ('pageX' in tgtPoint) {
  8429. pageX = tgtPoint.pageX;
  8430. } else {
  8431. pageX = scrollX + tgtPoint.clientX;
  8432. }
  8433. if ('pageY' in tgtPoint) {
  8434. pageY = tgtPoint.pageY;
  8435. } else {
  8436. pageY = scrollY + tgtPoint.clientY;
  8437. }
  8438. var tgtRegion = {
  8439. left: pageX,
  8440. top: pageY,
  8441. width: 0,
  8442. height: 0
  8443. };
  8444. var pointInView = pageX >= 0 && pageX <= scrollX + viewportWidth && pageY >= 0 && pageY <= scrollY + viewportHeight; // Provide default target point
  8445. var points = [align.points[0], 'cc'];
  8446. return doAlign(el, tgtRegion, _objectSpread2({}, align, {
  8447. points: points
  8448. }), pointInView);
  8449. }
  8450. /* unused harmony default export */ var _unused_webpack_default_export = (alignElement);
  8451. //# sourceMappingURL=index.js.map
  8452. /***/ }),
  8453. /* 153 */
  8454. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8455. "use strict";
  8456. /* harmony export (immutable) */ __webpack_exports__["a"] = buffer;
  8457. /* harmony export (immutable) */ __webpack_exports__["b"] = isSamePoint;
  8458. /* harmony export (immutable) */ __webpack_exports__["d"] = isWindow;
  8459. /* harmony export (immutable) */ __webpack_exports__["c"] = isSimilarValue;
  8460. /* harmony export (immutable) */ __webpack_exports__["e"] = restoreFocus;
  8461. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_rc_util_es_Dom_contains__ = __webpack_require__(69);
  8462. function buffer(fn, ms) {
  8463. var timer = void 0;
  8464. function clear() {
  8465. if (timer) {
  8466. clearTimeout(timer);
  8467. timer = null;
  8468. }
  8469. }
  8470. function bufferFn() {
  8471. clear();
  8472. timer = setTimeout(fn, ms);
  8473. }
  8474. bufferFn.clear = clear;
  8475. return bufferFn;
  8476. }
  8477. function isSamePoint(prev, next) {
  8478. if (prev === next) return true;
  8479. if (!prev || !next) return false;
  8480. if ('pageX' in next && 'pageY' in next) {
  8481. return prev.pageX === next.pageX && prev.pageY === next.pageY;
  8482. }
  8483. if ('clientX' in next && 'clientY' in next) {
  8484. return prev.clientX === next.clientX && prev.clientY === next.clientY;
  8485. }
  8486. return false;
  8487. }
  8488. function isWindow(obj) {
  8489. return obj && typeof obj === 'object' && obj.window === obj;
  8490. }
  8491. function isSimilarValue(val1, val2) {
  8492. var int1 = Math.floor(val1);
  8493. var int2 = Math.floor(val2);
  8494. return Math.abs(int1 - int2) <= 1;
  8495. }
  8496. function restoreFocus(activeElement, container) {
  8497. // Focus back if is in the container
  8498. if (activeElement !== document.activeElement && Object(__WEBPACK_IMPORTED_MODULE_0_rc_util_es_Dom_contains__["a" /* default */])(container, activeElement)) {
  8499. activeElement.focus();
  8500. }
  8501. }
  8502. /***/ }),
  8503. /* 154 */
  8504. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8505. "use strict";
  8506. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(5);
  8507. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__);
  8508. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty__ = __webpack_require__(13);
  8509. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty__);
  8510. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck__ = __webpack_require__(2);
  8511. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck__);
  8512. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_createClass__ = __webpack_require__(12);
  8513. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_createClass___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_createClass__);
  8514. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(3);
  8515. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_possibleConstructorReturn__);
  8516. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_babel_runtime_helpers_inherits__ = __webpack_require__(4);
  8517. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_babel_runtime_helpers_inherits__);
  8518. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react__ = __webpack_require__(0);
  8519. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_react__);
  8520. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_prop_types__ = __webpack_require__(1);
  8521. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_prop_types__);
  8522. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__ChildrenUtils__ = __webpack_require__(155);
  8523. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__AnimateChild__ = __webpack_require__(156);
  8524. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__util_animate__ = __webpack_require__(72);
  8525. var defaultKey = 'rc_animate_' + Date.now();
  8526. function getChildrenFromProps(props) {
  8527. var children = props.children;
  8528. if (__WEBPACK_IMPORTED_MODULE_6_react___default.a.isValidElement(children)) {
  8529. if (!children.key) {
  8530. return __WEBPACK_IMPORTED_MODULE_6_react___default.a.cloneElement(children, {
  8531. key: defaultKey
  8532. });
  8533. }
  8534. }
  8535. return children;
  8536. }
  8537. function noop() {}
  8538. var Animate = function (_React$Component) {
  8539. __WEBPACK_IMPORTED_MODULE_5_babel_runtime_helpers_inherits___default()(Animate, _React$Component);
  8540. // eslint-disable-line
  8541. function Animate(props) {
  8542. __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default()(this, Animate);
  8543. var _this = __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_possibleConstructorReturn___default()(this, (Animate.__proto__ || Object.getPrototypeOf(Animate)).call(this, props));
  8544. _initialiseProps.call(_this);
  8545. _this.currentlyAnimatingKeys = {};
  8546. _this.keysToEnter = [];
  8547. _this.keysToLeave = [];
  8548. _this.state = {
  8549. children: Object(__WEBPACK_IMPORTED_MODULE_8__ChildrenUtils__["e" /* toArrayChildren */])(getChildrenFromProps(props))
  8550. };
  8551. _this.childrenRefs = {};
  8552. return _this;
  8553. }
  8554. __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_createClass___default()(Animate, [{
  8555. key: 'componentDidMount',
  8556. value: function componentDidMount() {
  8557. var _this2 = this;
  8558. var showProp = this.props.showProp;
  8559. var children = this.state.children;
  8560. if (showProp) {
  8561. children = children.filter(function (child) {
  8562. return !!child.props[showProp];
  8563. });
  8564. }
  8565. children.forEach(function (child) {
  8566. if (child) {
  8567. _this2.performAppear(child.key);
  8568. }
  8569. });
  8570. }
  8571. }, {
  8572. key: 'componentWillReceiveProps',
  8573. value: function componentWillReceiveProps(nextProps) {
  8574. var _this3 = this;
  8575. this.nextProps = nextProps;
  8576. var nextChildren = Object(__WEBPACK_IMPORTED_MODULE_8__ChildrenUtils__["e" /* toArrayChildren */])(getChildrenFromProps(nextProps));
  8577. var props = this.props;
  8578. // exclusive needs immediate response
  8579. if (props.exclusive) {
  8580. Object.keys(this.currentlyAnimatingKeys).forEach(function (key) {
  8581. _this3.stop(key);
  8582. });
  8583. }
  8584. var showProp = props.showProp;
  8585. var currentlyAnimatingKeys = this.currentlyAnimatingKeys;
  8586. // last props children if exclusive
  8587. var currentChildren = props.exclusive ? Object(__WEBPACK_IMPORTED_MODULE_8__ChildrenUtils__["e" /* toArrayChildren */])(getChildrenFromProps(props)) : this.state.children;
  8588. // in case destroy in showProp mode
  8589. var newChildren = [];
  8590. if (showProp) {
  8591. currentChildren.forEach(function (currentChild) {
  8592. var nextChild = currentChild && Object(__WEBPACK_IMPORTED_MODULE_8__ChildrenUtils__["a" /* findChildInChildrenByKey */])(nextChildren, currentChild.key);
  8593. var newChild = void 0;
  8594. if ((!nextChild || !nextChild.props[showProp]) && currentChild.props[showProp]) {
  8595. newChild = __WEBPACK_IMPORTED_MODULE_6_react___default.a.cloneElement(nextChild || currentChild, __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_defineProperty___default()({}, showProp, true));
  8596. } else {
  8597. newChild = nextChild;
  8598. }
  8599. if (newChild) {
  8600. newChildren.push(newChild);
  8601. }
  8602. });
  8603. nextChildren.forEach(function (nextChild) {
  8604. if (!nextChild || !Object(__WEBPACK_IMPORTED_MODULE_8__ChildrenUtils__["a" /* findChildInChildrenByKey */])(currentChildren, nextChild.key)) {
  8605. newChildren.push(nextChild);
  8606. }
  8607. });
  8608. } else {
  8609. newChildren = Object(__WEBPACK_IMPORTED_MODULE_8__ChildrenUtils__["d" /* mergeChildren */])(currentChildren, nextChildren);
  8610. }
  8611. // need render to avoid update
  8612. this.setState({
  8613. children: newChildren
  8614. });
  8615. nextChildren.forEach(function (child) {
  8616. var key = child && child.key;
  8617. if (child && currentlyAnimatingKeys[key]) {
  8618. return;
  8619. }
  8620. var hasPrev = child && Object(__WEBPACK_IMPORTED_MODULE_8__ChildrenUtils__["a" /* findChildInChildrenByKey */])(currentChildren, key);
  8621. if (showProp) {
  8622. var showInNext = child.props[showProp];
  8623. if (hasPrev) {
  8624. var showInNow = Object(__WEBPACK_IMPORTED_MODULE_8__ChildrenUtils__["b" /* findShownChildInChildrenByKey */])(currentChildren, key, showProp);
  8625. if (!showInNow && showInNext) {
  8626. _this3.keysToEnter.push(key);
  8627. }
  8628. } else if (showInNext) {
  8629. _this3.keysToEnter.push(key);
  8630. }
  8631. } else if (!hasPrev) {
  8632. _this3.keysToEnter.push(key);
  8633. }
  8634. });
  8635. currentChildren.forEach(function (child) {
  8636. var key = child && child.key;
  8637. if (child && currentlyAnimatingKeys[key]) {
  8638. return;
  8639. }
  8640. var hasNext = child && Object(__WEBPACK_IMPORTED_MODULE_8__ChildrenUtils__["a" /* findChildInChildrenByKey */])(nextChildren, key);
  8641. if (showProp) {
  8642. var showInNow = child.props[showProp];
  8643. if (hasNext) {
  8644. var showInNext = Object(__WEBPACK_IMPORTED_MODULE_8__ChildrenUtils__["b" /* findShownChildInChildrenByKey */])(nextChildren, key, showProp);
  8645. if (!showInNext && showInNow) {
  8646. _this3.keysToLeave.push(key);
  8647. }
  8648. } else if (showInNow) {
  8649. _this3.keysToLeave.push(key);
  8650. }
  8651. } else if (!hasNext) {
  8652. _this3.keysToLeave.push(key);
  8653. }
  8654. });
  8655. }
  8656. }, {
  8657. key: 'componentDidUpdate',
  8658. value: function componentDidUpdate() {
  8659. var keysToEnter = this.keysToEnter;
  8660. this.keysToEnter = [];
  8661. keysToEnter.forEach(this.performEnter);
  8662. var keysToLeave = this.keysToLeave;
  8663. this.keysToLeave = [];
  8664. keysToLeave.forEach(this.performLeave);
  8665. }
  8666. }, {
  8667. key: 'isValidChildByKey',
  8668. value: function isValidChildByKey(currentChildren, key) {
  8669. var showProp = this.props.showProp;
  8670. if (showProp) {
  8671. return Object(__WEBPACK_IMPORTED_MODULE_8__ChildrenUtils__["b" /* findShownChildInChildrenByKey */])(currentChildren, key, showProp);
  8672. }
  8673. return Object(__WEBPACK_IMPORTED_MODULE_8__ChildrenUtils__["a" /* findChildInChildrenByKey */])(currentChildren, key);
  8674. }
  8675. }, {
  8676. key: 'stop',
  8677. value: function stop(key) {
  8678. delete this.currentlyAnimatingKeys[key];
  8679. var component = this.childrenRefs[key];
  8680. if (component) {
  8681. component.stop();
  8682. }
  8683. }
  8684. }, {
  8685. key: 'render',
  8686. value: function render() {
  8687. var _this4 = this;
  8688. var props = this.props;
  8689. this.nextProps = props;
  8690. var stateChildren = this.state.children;
  8691. var children = null;
  8692. if (stateChildren) {
  8693. children = stateChildren.map(function (child) {
  8694. if (child === null || child === undefined) {
  8695. return child;
  8696. }
  8697. if (!child.key) {
  8698. throw new Error('must set key for <rc-animate> children');
  8699. }
  8700. return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(
  8701. __WEBPACK_IMPORTED_MODULE_9__AnimateChild__["a" /* default */],
  8702. {
  8703. key: child.key,
  8704. ref: function ref(node) {
  8705. _this4.childrenRefs[child.key] = node;
  8706. },
  8707. animation: props.animation,
  8708. transitionName: props.transitionName,
  8709. transitionEnter: props.transitionEnter,
  8710. transitionAppear: props.transitionAppear,
  8711. transitionLeave: props.transitionLeave
  8712. },
  8713. child
  8714. );
  8715. });
  8716. }
  8717. var Component = props.component;
  8718. if (Component) {
  8719. var passedProps = props;
  8720. if (typeof Component === 'string') {
  8721. passedProps = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({
  8722. className: props.className,
  8723. style: props.style
  8724. }, props.componentProps);
  8725. }
  8726. return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(
  8727. Component,
  8728. passedProps,
  8729. children
  8730. );
  8731. }
  8732. return children[0] || null;
  8733. }
  8734. }]);
  8735. return Animate;
  8736. }(__WEBPACK_IMPORTED_MODULE_6_react___default.a.Component);
  8737. Animate.isAnimate = true;
  8738. Animate.propTypes = {
  8739. className: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.string,
  8740. style: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.object,
  8741. component: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.any,
  8742. componentProps: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.object,
  8743. animation: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.object,
  8744. transitionName: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.object]),
  8745. transitionEnter: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool,
  8746. transitionAppear: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool,
  8747. exclusive: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool,
  8748. transitionLeave: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool,
  8749. onEnd: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func,
  8750. onEnter: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func,
  8751. onLeave: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func,
  8752. onAppear: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func,
  8753. showProp: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.string,
  8754. children: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.node
  8755. };
  8756. Animate.defaultProps = {
  8757. animation: {},
  8758. component: 'span',
  8759. componentProps: {},
  8760. transitionEnter: true,
  8761. transitionLeave: true,
  8762. transitionAppear: false,
  8763. onEnd: noop,
  8764. onEnter: noop,
  8765. onLeave: noop,
  8766. onAppear: noop
  8767. };
  8768. var _initialiseProps = function _initialiseProps() {
  8769. var _this5 = this;
  8770. this.performEnter = function (key) {
  8771. // may already remove by exclusive
  8772. if (_this5.childrenRefs[key]) {
  8773. _this5.currentlyAnimatingKeys[key] = true;
  8774. _this5.childrenRefs[key].componentWillEnter(_this5.handleDoneAdding.bind(_this5, key, 'enter'));
  8775. }
  8776. };
  8777. this.performAppear = function (key) {
  8778. if (_this5.childrenRefs[key]) {
  8779. _this5.currentlyAnimatingKeys[key] = true;
  8780. _this5.childrenRefs[key].componentWillAppear(_this5.handleDoneAdding.bind(_this5, key, 'appear'));
  8781. }
  8782. };
  8783. this.handleDoneAdding = function (key, type) {
  8784. var props = _this5.props;
  8785. delete _this5.currentlyAnimatingKeys[key];
  8786. // if update on exclusive mode, skip check
  8787. if (props.exclusive && props !== _this5.nextProps) {
  8788. return;
  8789. }
  8790. var currentChildren = Object(__WEBPACK_IMPORTED_MODULE_8__ChildrenUtils__["e" /* toArrayChildren */])(getChildrenFromProps(props));
  8791. if (!_this5.isValidChildByKey(currentChildren, key)) {
  8792. // exclusive will not need this
  8793. _this5.performLeave(key);
  8794. } else if (type === 'appear') {
  8795. if (__WEBPACK_IMPORTED_MODULE_10__util_animate__["a" /* default */].allowAppearCallback(props)) {
  8796. props.onAppear(key);
  8797. props.onEnd(key, true);
  8798. }
  8799. } else if (__WEBPACK_IMPORTED_MODULE_10__util_animate__["a" /* default */].allowEnterCallback(props)) {
  8800. props.onEnter(key);
  8801. props.onEnd(key, true);
  8802. }
  8803. };
  8804. this.performLeave = function (key) {
  8805. // may already remove by exclusive
  8806. if (_this5.childrenRefs[key]) {
  8807. _this5.currentlyAnimatingKeys[key] = true;
  8808. _this5.childrenRefs[key].componentWillLeave(_this5.handleDoneLeaving.bind(_this5, key));
  8809. }
  8810. };
  8811. this.handleDoneLeaving = function (key) {
  8812. var props = _this5.props;
  8813. delete _this5.currentlyAnimatingKeys[key];
  8814. // if update on exclusive mode, skip check
  8815. if (props.exclusive && props !== _this5.nextProps) {
  8816. return;
  8817. }
  8818. var currentChildren = Object(__WEBPACK_IMPORTED_MODULE_8__ChildrenUtils__["e" /* toArrayChildren */])(getChildrenFromProps(props));
  8819. // in case state change is too fast
  8820. if (_this5.isValidChildByKey(currentChildren, key)) {
  8821. _this5.performEnter(key);
  8822. } else {
  8823. var end = function end() {
  8824. if (__WEBPACK_IMPORTED_MODULE_10__util_animate__["a" /* default */].allowLeaveCallback(props)) {
  8825. props.onLeave(key);
  8826. props.onEnd(key, false);
  8827. }
  8828. };
  8829. if (!Object(__WEBPACK_IMPORTED_MODULE_8__ChildrenUtils__["c" /* isSameChildren */])(_this5.state.children, currentChildren, props.showProp)) {
  8830. _this5.setState({
  8831. children: currentChildren
  8832. }, end);
  8833. } else {
  8834. end();
  8835. }
  8836. }
  8837. };
  8838. };
  8839. /* harmony default export */ __webpack_exports__["a"] = (Animate);
  8840. /***/ }),
  8841. /* 155 */
  8842. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8843. "use strict";
  8844. /* harmony export (immutable) */ __webpack_exports__["e"] = toArrayChildren;
  8845. /* harmony export (immutable) */ __webpack_exports__["a"] = findChildInChildrenByKey;
  8846. /* harmony export (immutable) */ __webpack_exports__["b"] = findShownChildInChildrenByKey;
  8847. /* unused harmony export findHiddenChildInChildrenByKey */
  8848. /* harmony export (immutable) */ __webpack_exports__["c"] = isSameChildren;
  8849. /* harmony export (immutable) */ __webpack_exports__["d"] = mergeChildren;
  8850. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
  8851. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
  8852. function toArrayChildren(children) {
  8853. var ret = [];
  8854. __WEBPACK_IMPORTED_MODULE_0_react___default.a.Children.forEach(children, function (child) {
  8855. ret.push(child);
  8856. });
  8857. return ret;
  8858. }
  8859. function findChildInChildrenByKey(children, key) {
  8860. var ret = null;
  8861. if (children) {
  8862. children.forEach(function (child) {
  8863. if (ret) {
  8864. return;
  8865. }
  8866. if (child && child.key === key) {
  8867. ret = child;
  8868. }
  8869. });
  8870. }
  8871. return ret;
  8872. }
  8873. function findShownChildInChildrenByKey(children, key, showProp) {
  8874. var ret = null;
  8875. if (children) {
  8876. children.forEach(function (child) {
  8877. if (child && child.key === key && child.props[showProp]) {
  8878. if (ret) {
  8879. throw new Error('two child with same key for <rc-animate> children');
  8880. }
  8881. ret = child;
  8882. }
  8883. });
  8884. }
  8885. return ret;
  8886. }
  8887. function findHiddenChildInChildrenByKey(children, key, showProp) {
  8888. var found = 0;
  8889. if (children) {
  8890. children.forEach(function (child) {
  8891. if (found) {
  8892. return;
  8893. }
  8894. found = child && child.key === key && !child.props[showProp];
  8895. });
  8896. }
  8897. return found;
  8898. }
  8899. function isSameChildren(c1, c2, showProp) {
  8900. var same = c1.length === c2.length;
  8901. if (same) {
  8902. c1.forEach(function (child, index) {
  8903. var child2 = c2[index];
  8904. if (child && child2) {
  8905. if (child && !child2 || !child && child2) {
  8906. same = false;
  8907. } else if (child.key !== child2.key) {
  8908. same = false;
  8909. } else if (showProp && child.props[showProp] !== child2.props[showProp]) {
  8910. same = false;
  8911. }
  8912. }
  8913. });
  8914. }
  8915. return same;
  8916. }
  8917. function mergeChildren(prev, next) {
  8918. var ret = [];
  8919. // For each key of `next`, the list of keys to insert before that key in
  8920. // the combined list
  8921. var nextChildrenPending = {};
  8922. var pendingChildren = [];
  8923. prev.forEach(function (child) {
  8924. if (child && findChildInChildrenByKey(next, child.key)) {
  8925. if (pendingChildren.length) {
  8926. nextChildrenPending[child.key] = pendingChildren;
  8927. pendingChildren = [];
  8928. }
  8929. } else {
  8930. pendingChildren.push(child);
  8931. }
  8932. });
  8933. next.forEach(function (child) {
  8934. if (child && Object.prototype.hasOwnProperty.call(nextChildrenPending, child.key)) {
  8935. ret = ret.concat(nextChildrenPending[child.key]);
  8936. }
  8937. ret.push(child);
  8938. });
  8939. ret = ret.concat(pendingChildren);
  8940. return ret;
  8941. }
  8942. /***/ }),
  8943. /* 156 */
  8944. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8945. "use strict";
  8946. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__ = __webpack_require__(2);
  8947. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__);
  8948. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_createClass__ = __webpack_require__(12);
  8949. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_createClass___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_createClass__);
  8950. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(3);
  8951. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn__);
  8952. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits__ = __webpack_require__(4);
  8953. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits__);
  8954. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_react__ = __webpack_require__(0);
  8955. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_react__);
  8956. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react_dom__ = __webpack_require__(14);
  8957. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react_dom___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_react_dom__);
  8958. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_prop_types__ = __webpack_require__(1);
  8959. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_prop_types__);
  8960. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_css_animation__ = __webpack_require__(157);
  8961. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__util_animate__ = __webpack_require__(72);
  8962. var transitionMap = {
  8963. enter: 'transitionEnter',
  8964. appear: 'transitionAppear',
  8965. leave: 'transitionLeave'
  8966. };
  8967. var AnimateChild = function (_React$Component) {
  8968. __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits___default()(AnimateChild, _React$Component);
  8969. function AnimateChild() {
  8970. __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default()(this, AnimateChild);
  8971. return __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn___default()(this, (AnimateChild.__proto__ || Object.getPrototypeOf(AnimateChild)).apply(this, arguments));
  8972. }
  8973. __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_createClass___default()(AnimateChild, [{
  8974. key: 'componentWillUnmount',
  8975. value: function componentWillUnmount() {
  8976. this.stop();
  8977. }
  8978. }, {
  8979. key: 'componentWillEnter',
  8980. value: function componentWillEnter(done) {
  8981. if (__WEBPACK_IMPORTED_MODULE_8__util_animate__["a" /* default */].isEnterSupported(this.props)) {
  8982. this.transition('enter', done);
  8983. } else {
  8984. done();
  8985. }
  8986. }
  8987. }, {
  8988. key: 'componentWillAppear',
  8989. value: function componentWillAppear(done) {
  8990. if (__WEBPACK_IMPORTED_MODULE_8__util_animate__["a" /* default */].isAppearSupported(this.props)) {
  8991. this.transition('appear', done);
  8992. } else {
  8993. done();
  8994. }
  8995. }
  8996. }, {
  8997. key: 'componentWillLeave',
  8998. value: function componentWillLeave(done) {
  8999. if (__WEBPACK_IMPORTED_MODULE_8__util_animate__["a" /* default */].isLeaveSupported(this.props)) {
  9000. this.transition('leave', done);
  9001. } else {
  9002. // always sync, do not interupt with react component life cycle
  9003. // update hidden -> animate hidden ->
  9004. // didUpdate -> animate leave -> unmount (if animate is none)
  9005. done();
  9006. }
  9007. }
  9008. }, {
  9009. key: 'transition',
  9010. value: function transition(animationType, finishCallback) {
  9011. var _this2 = this;
  9012. var node = __WEBPACK_IMPORTED_MODULE_5_react_dom___default.a.findDOMNode(this);
  9013. var props = this.props;
  9014. var transitionName = props.transitionName;
  9015. var nameIsObj = typeof transitionName === 'object';
  9016. this.stop();
  9017. var end = function end() {
  9018. _this2.stopper = null;
  9019. finishCallback();
  9020. };
  9021. if ((__WEBPACK_IMPORTED_MODULE_7_css_animation__["b" /* isCssAnimationSupported */] || !props.animation[animationType]) && transitionName && props[transitionMap[animationType]]) {
  9022. var name = nameIsObj ? transitionName[animationType] : transitionName + '-' + animationType;
  9023. var activeName = name + '-active';
  9024. if (nameIsObj && transitionName[animationType + 'Active']) {
  9025. activeName = transitionName[animationType + 'Active'];
  9026. }
  9027. this.stopper = Object(__WEBPACK_IMPORTED_MODULE_7_css_animation__["a" /* default */])(node, {
  9028. name: name,
  9029. active: activeName
  9030. }, end);
  9031. } else {
  9032. this.stopper = props.animation[animationType](node, end);
  9033. }
  9034. }
  9035. }, {
  9036. key: 'stop',
  9037. value: function stop() {
  9038. var stopper = this.stopper;
  9039. if (stopper) {
  9040. this.stopper = null;
  9041. stopper.stop();
  9042. }
  9043. }
  9044. }, {
  9045. key: 'render',
  9046. value: function render() {
  9047. return this.props.children;
  9048. }
  9049. }]);
  9050. return AnimateChild;
  9051. }(__WEBPACK_IMPORTED_MODULE_4_react___default.a.Component);
  9052. AnimateChild.propTypes = {
  9053. children: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.any,
  9054. animation: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.any,
  9055. transitionName: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.any
  9056. };
  9057. /* harmony default export */ __webpack_exports__["a"] = (AnimateChild);
  9058. /***/ }),
  9059. /* 157 */
  9060. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9061. "use strict";
  9062. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isCssAnimationSupported; });
  9063. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof__ = __webpack_require__(41);
  9064. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof__);
  9065. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Event__ = __webpack_require__(158);
  9066. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_component_classes__ = __webpack_require__(159);
  9067. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_component_classes___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_component_classes__);
  9068. var isCssAnimationSupported = __WEBPACK_IMPORTED_MODULE_1__Event__["a" /* default */].endEvents.length !== 0;
  9069. var capitalPrefixes = ['Webkit', 'Moz', 'O',
  9070. // ms is special .... !
  9071. 'ms'];
  9072. var prefixes = ['-webkit-', '-moz-', '-o-', 'ms-', ''];
  9073. function getStyleProperty(node, name) {
  9074. // old ff need null, https://developer.mozilla.org/en-US/docs/Web/API/Window/getComputedStyle
  9075. var style = window.getComputedStyle(node, null);
  9076. var ret = '';
  9077. for (var i = 0; i < prefixes.length; i++) {
  9078. ret = style.getPropertyValue(prefixes[i] + name);
  9079. if (ret) {
  9080. break;
  9081. }
  9082. }
  9083. return ret;
  9084. }
  9085. function fixBrowserByTimeout(node) {
  9086. if (isCssAnimationSupported) {
  9087. var transitionDelay = parseFloat(getStyleProperty(node, 'transition-delay')) || 0;
  9088. var transitionDuration = parseFloat(getStyleProperty(node, 'transition-duration')) || 0;
  9089. var animationDelay = parseFloat(getStyleProperty(node, 'animation-delay')) || 0;
  9090. var animationDuration = parseFloat(getStyleProperty(node, 'animation-duration')) || 0;
  9091. var time = Math.max(transitionDuration + transitionDelay, animationDuration + animationDelay);
  9092. // sometimes, browser bug
  9093. node.rcEndAnimTimeout = setTimeout(function () {
  9094. node.rcEndAnimTimeout = null;
  9095. if (node.rcEndListener) {
  9096. node.rcEndListener();
  9097. }
  9098. }, time * 1000 + 200);
  9099. }
  9100. }
  9101. function clearBrowserBugTimeout(node) {
  9102. if (node.rcEndAnimTimeout) {
  9103. clearTimeout(node.rcEndAnimTimeout);
  9104. node.rcEndAnimTimeout = null;
  9105. }
  9106. }
  9107. var cssAnimation = function cssAnimation(node, transitionName, endCallback) {
  9108. var nameIsObj = (typeof transitionName === 'undefined' ? 'undefined' : __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default()(transitionName)) === 'object';
  9109. var className = nameIsObj ? transitionName.name : transitionName;
  9110. var activeClassName = nameIsObj ? transitionName.active : transitionName + '-active';
  9111. var end = endCallback;
  9112. var start = void 0;
  9113. var active = void 0;
  9114. var nodeClasses = __WEBPACK_IMPORTED_MODULE_2_component_classes___default()(node);
  9115. if (endCallback && Object.prototype.toString.call(endCallback) === '[object Object]') {
  9116. end = endCallback.end;
  9117. start = endCallback.start;
  9118. active = endCallback.active;
  9119. }
  9120. if (node.rcEndListener) {
  9121. node.rcEndListener();
  9122. }
  9123. node.rcEndListener = function (e) {
  9124. if (e && e.target !== node) {
  9125. return;
  9126. }
  9127. if (node.rcAnimTimeout) {
  9128. clearTimeout(node.rcAnimTimeout);
  9129. node.rcAnimTimeout = null;
  9130. }
  9131. clearBrowserBugTimeout(node);
  9132. nodeClasses.remove(className);
  9133. nodeClasses.remove(activeClassName);
  9134. __WEBPACK_IMPORTED_MODULE_1__Event__["a" /* default */].removeEndEventListener(node, node.rcEndListener);
  9135. node.rcEndListener = null;
  9136. // Usually this optional end is used for informing an owner of
  9137. // a leave animation and telling it to remove the child.
  9138. if (end) {
  9139. end();
  9140. }
  9141. };
  9142. __WEBPACK_IMPORTED_MODULE_1__Event__["a" /* default */].addEndEventListener(node, node.rcEndListener);
  9143. if (start) {
  9144. start();
  9145. }
  9146. nodeClasses.add(className);
  9147. node.rcAnimTimeout = setTimeout(function () {
  9148. node.rcAnimTimeout = null;
  9149. nodeClasses.add(activeClassName);
  9150. if (active) {
  9151. setTimeout(active, 0);
  9152. }
  9153. fixBrowserByTimeout(node);
  9154. // 30ms for firefox
  9155. }, 30);
  9156. return {
  9157. stop: function stop() {
  9158. if (node.rcEndListener) {
  9159. node.rcEndListener();
  9160. }
  9161. }
  9162. };
  9163. };
  9164. cssAnimation.style = function (node, style, callback) {
  9165. if (node.rcEndListener) {
  9166. node.rcEndListener();
  9167. }
  9168. node.rcEndListener = function (e) {
  9169. if (e && e.target !== node) {
  9170. return;
  9171. }
  9172. if (node.rcAnimTimeout) {
  9173. clearTimeout(node.rcAnimTimeout);
  9174. node.rcAnimTimeout = null;
  9175. }
  9176. clearBrowserBugTimeout(node);
  9177. __WEBPACK_IMPORTED_MODULE_1__Event__["a" /* default */].removeEndEventListener(node, node.rcEndListener);
  9178. node.rcEndListener = null;
  9179. // Usually this optional callback is used for informing an owner of
  9180. // a leave animation and telling it to remove the child.
  9181. if (callback) {
  9182. callback();
  9183. }
  9184. };
  9185. __WEBPACK_IMPORTED_MODULE_1__Event__["a" /* default */].addEndEventListener(node, node.rcEndListener);
  9186. node.rcAnimTimeout = setTimeout(function () {
  9187. for (var s in style) {
  9188. if (style.hasOwnProperty(s)) {
  9189. node.style[s] = style[s];
  9190. }
  9191. }
  9192. node.rcAnimTimeout = null;
  9193. fixBrowserByTimeout(node);
  9194. }, 0);
  9195. };
  9196. cssAnimation.setTransition = function (node, p, value) {
  9197. var property = p;
  9198. var v = value;
  9199. if (value === undefined) {
  9200. v = property;
  9201. property = '';
  9202. }
  9203. property = property || '';
  9204. capitalPrefixes.forEach(function (prefix) {
  9205. node.style[prefix + 'Transition' + property] = v;
  9206. });
  9207. };
  9208. cssAnimation.isCssAnimationSupported = isCssAnimationSupported;
  9209. /* harmony default export */ __webpack_exports__["a"] = (cssAnimation);
  9210. /***/ }),
  9211. /* 158 */
  9212. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9213. "use strict";
  9214. var START_EVENT_NAME_MAP = {
  9215. transitionstart: {
  9216. transition: 'transitionstart',
  9217. WebkitTransition: 'webkitTransitionStart',
  9218. MozTransition: 'mozTransitionStart',
  9219. OTransition: 'oTransitionStart',
  9220. msTransition: 'MSTransitionStart'
  9221. },
  9222. animationstart: {
  9223. animation: 'animationstart',
  9224. WebkitAnimation: 'webkitAnimationStart',
  9225. MozAnimation: 'mozAnimationStart',
  9226. OAnimation: 'oAnimationStart',
  9227. msAnimation: 'MSAnimationStart'
  9228. }
  9229. };
  9230. var END_EVENT_NAME_MAP = {
  9231. transitionend: {
  9232. transition: 'transitionend',
  9233. WebkitTransition: 'webkitTransitionEnd',
  9234. MozTransition: 'mozTransitionEnd',
  9235. OTransition: 'oTransitionEnd',
  9236. msTransition: 'MSTransitionEnd'
  9237. },
  9238. animationend: {
  9239. animation: 'animationend',
  9240. WebkitAnimation: 'webkitAnimationEnd',
  9241. MozAnimation: 'mozAnimationEnd',
  9242. OAnimation: 'oAnimationEnd',
  9243. msAnimation: 'MSAnimationEnd'
  9244. }
  9245. };
  9246. var startEvents = [];
  9247. var endEvents = [];
  9248. function detectEvents() {
  9249. var testEl = document.createElement('div');
  9250. var style = testEl.style;
  9251. if (!('AnimationEvent' in window)) {
  9252. delete START_EVENT_NAME_MAP.animationstart.animation;
  9253. delete END_EVENT_NAME_MAP.animationend.animation;
  9254. }
  9255. if (!('TransitionEvent' in window)) {
  9256. delete START_EVENT_NAME_MAP.transitionstart.transition;
  9257. delete END_EVENT_NAME_MAP.transitionend.transition;
  9258. }
  9259. function process(EVENT_NAME_MAP, events) {
  9260. for (var baseEventName in EVENT_NAME_MAP) {
  9261. if (EVENT_NAME_MAP.hasOwnProperty(baseEventName)) {
  9262. var baseEvents = EVENT_NAME_MAP[baseEventName];
  9263. for (var styleName in baseEvents) {
  9264. if (styleName in style) {
  9265. events.push(baseEvents[styleName]);
  9266. break;
  9267. }
  9268. }
  9269. }
  9270. }
  9271. }
  9272. process(START_EVENT_NAME_MAP, startEvents);
  9273. process(END_EVENT_NAME_MAP, endEvents);
  9274. }
  9275. if (typeof window !== 'undefined' && typeof document !== 'undefined') {
  9276. detectEvents();
  9277. }
  9278. function addEventListener(node, eventName, eventListener) {
  9279. node.addEventListener(eventName, eventListener, false);
  9280. }
  9281. function removeEventListener(node, eventName, eventListener) {
  9282. node.removeEventListener(eventName, eventListener, false);
  9283. }
  9284. var TransitionEvents = {
  9285. // Start events
  9286. startEvents: startEvents,
  9287. addStartEventListener: function addStartEventListener(node, eventListener) {
  9288. if (startEvents.length === 0) {
  9289. window.setTimeout(eventListener, 0);
  9290. return;
  9291. }
  9292. startEvents.forEach(function (startEvent) {
  9293. addEventListener(node, startEvent, eventListener);
  9294. });
  9295. },
  9296. removeStartEventListener: function removeStartEventListener(node, eventListener) {
  9297. if (startEvents.length === 0) {
  9298. return;
  9299. }
  9300. startEvents.forEach(function (startEvent) {
  9301. removeEventListener(node, startEvent, eventListener);
  9302. });
  9303. },
  9304. // End events
  9305. endEvents: endEvents,
  9306. addEndEventListener: function addEndEventListener(node, eventListener) {
  9307. if (endEvents.length === 0) {
  9308. window.setTimeout(eventListener, 0);
  9309. return;
  9310. }
  9311. endEvents.forEach(function (endEvent) {
  9312. addEventListener(node, endEvent, eventListener);
  9313. });
  9314. },
  9315. removeEndEventListener: function removeEndEventListener(node, eventListener) {
  9316. if (endEvents.length === 0) {
  9317. return;
  9318. }
  9319. endEvents.forEach(function (endEvent) {
  9320. removeEventListener(node, endEvent, eventListener);
  9321. });
  9322. }
  9323. };
  9324. /* harmony default export */ __webpack_exports__["a"] = (TransitionEvents);
  9325. /***/ }),
  9326. /* 159 */
  9327. /***/ (function(module, exports, __webpack_require__) {
  9328. /**
  9329. * Module dependencies.
  9330. */
  9331. try {
  9332. var index = __webpack_require__(71);
  9333. } catch (err) {
  9334. var index = __webpack_require__(71);
  9335. }
  9336. /**
  9337. * Whitespace regexp.
  9338. */
  9339. var re = /\s+/;
  9340. /**
  9341. * toString reference.
  9342. */
  9343. var toString = Object.prototype.toString;
  9344. /**
  9345. * Wrap `el` in a `ClassList`.
  9346. *
  9347. * @param {Element} el
  9348. * @return {ClassList}
  9349. * @api public
  9350. */
  9351. module.exports = function(el){
  9352. return new ClassList(el);
  9353. };
  9354. /**
  9355. * Initialize a new ClassList for `el`.
  9356. *
  9357. * @param {Element} el
  9358. * @api private
  9359. */
  9360. function ClassList(el) {
  9361. if (!el || !el.nodeType) {
  9362. throw new Error('A DOM element reference is required');
  9363. }
  9364. this.el = el;
  9365. this.list = el.classList;
  9366. }
  9367. /**
  9368. * Add class `name` if not already present.
  9369. *
  9370. * @param {String} name
  9371. * @return {ClassList}
  9372. * @api public
  9373. */
  9374. ClassList.prototype.add = function(name){
  9375. // classList
  9376. if (this.list) {
  9377. this.list.add(name);
  9378. return this;
  9379. }
  9380. // fallback
  9381. var arr = this.array();
  9382. var i = index(arr, name);
  9383. if (!~i) arr.push(name);
  9384. this.el.className = arr.join(' ');
  9385. return this;
  9386. };
  9387. /**
  9388. * Remove class `name` when present, or
  9389. * pass a regular expression to remove
  9390. * any which match.
  9391. *
  9392. * @param {String|RegExp} name
  9393. * @return {ClassList}
  9394. * @api public
  9395. */
  9396. ClassList.prototype.remove = function(name){
  9397. if ('[object RegExp]' == toString.call(name)) {
  9398. return this.removeMatching(name);
  9399. }
  9400. // classList
  9401. if (this.list) {
  9402. this.list.remove(name);
  9403. return this;
  9404. }
  9405. // fallback
  9406. var arr = this.array();
  9407. var i = index(arr, name);
  9408. if (~i) arr.splice(i, 1);
  9409. this.el.className = arr.join(' ');
  9410. return this;
  9411. };
  9412. /**
  9413. * Remove all classes matching `re`.
  9414. *
  9415. * @param {RegExp} re
  9416. * @return {ClassList}
  9417. * @api private
  9418. */
  9419. ClassList.prototype.removeMatching = function(re){
  9420. var arr = this.array();
  9421. for (var i = 0; i < arr.length; i++) {
  9422. if (re.test(arr[i])) {
  9423. this.remove(arr[i]);
  9424. }
  9425. }
  9426. return this;
  9427. };
  9428. /**
  9429. * Toggle class `name`, can force state via `force`.
  9430. *
  9431. * For browsers that support classList, but do not support `force` yet,
  9432. * the mistake will be detected and corrected.
  9433. *
  9434. * @param {String} name
  9435. * @param {Boolean} force
  9436. * @return {ClassList}
  9437. * @api public
  9438. */
  9439. ClassList.prototype.toggle = function(name, force){
  9440. // classList
  9441. if (this.list) {
  9442. if ("undefined" !== typeof force) {
  9443. if (force !== this.list.toggle(name, force)) {
  9444. this.list.toggle(name); // toggle again to correct
  9445. }
  9446. } else {
  9447. this.list.toggle(name);
  9448. }
  9449. return this;
  9450. }
  9451. // fallback
  9452. if ("undefined" !== typeof force) {
  9453. if (!force) {
  9454. this.remove(name);
  9455. } else {
  9456. this.add(name);
  9457. }
  9458. } else {
  9459. if (this.has(name)) {
  9460. this.remove(name);
  9461. } else {
  9462. this.add(name);
  9463. }
  9464. }
  9465. return this;
  9466. };
  9467. /**
  9468. * Return an array of classes.
  9469. *
  9470. * @return {Array}
  9471. * @api public
  9472. */
  9473. ClassList.prototype.array = function(){
  9474. var className = this.el.getAttribute('class') || '';
  9475. var str = className.replace(/^\s+|\s+$/g, '');
  9476. var arr = str.split(re);
  9477. if ('' === arr[0]) arr.shift();
  9478. return arr;
  9479. };
  9480. /**
  9481. * Check if class `name` is present.
  9482. *
  9483. * @param {String} name
  9484. * @return {ClassList}
  9485. * @api public
  9486. */
  9487. ClassList.prototype.has =
  9488. ClassList.prototype.contains = function(name){
  9489. return this.list
  9490. ? this.list.contains(name)
  9491. : !! ~index(this.array(), name);
  9492. };
  9493. /***/ }),
  9494. /* 160 */
  9495. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9496. "use strict";
  9497. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__ = __webpack_require__(2);
  9498. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__);
  9499. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(3);
  9500. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn__);
  9501. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits__ = __webpack_require__(4);
  9502. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits__);
  9503. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react__ = __webpack_require__(0);
  9504. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_react__);
  9505. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_prop_types__ = __webpack_require__(1);
  9506. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_prop_types__);
  9507. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__LazyRenderBox__ = __webpack_require__(73);
  9508. var PopupInner = function (_Component) {
  9509. __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits___default()(PopupInner, _Component);
  9510. function PopupInner() {
  9511. __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default()(this, PopupInner);
  9512. return __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn___default()(this, _Component.apply(this, arguments));
  9513. }
  9514. PopupInner.prototype.render = function render() {
  9515. var props = this.props;
  9516. var className = props.className;
  9517. if (!props.visible) {
  9518. className += ' ' + props.hiddenClassName;
  9519. }
  9520. return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
  9521. 'div',
  9522. {
  9523. className: className,
  9524. onMouseEnter: props.onMouseEnter,
  9525. onMouseLeave: props.onMouseLeave,
  9526. onMouseDown: props.onMouseDown,
  9527. onTouchStart: props.onTouchStart,
  9528. style: props.style
  9529. },
  9530. __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
  9531. __WEBPACK_IMPORTED_MODULE_5__LazyRenderBox__["a" /* default */],
  9532. { className: props.prefixCls + '-content', visible: props.visible },
  9533. props.children
  9534. )
  9535. );
  9536. };
  9537. return PopupInner;
  9538. }(__WEBPACK_IMPORTED_MODULE_3_react__["Component"]);
  9539. PopupInner.propTypes = {
  9540. hiddenClassName: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.string,
  9541. className: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.string,
  9542. prefixCls: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.string,
  9543. onMouseEnter: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func,
  9544. onMouseLeave: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func,
  9545. onMouseDown: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func,
  9546. onTouchStart: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func,
  9547. children: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.any
  9548. };
  9549. /* harmony default export */ __webpack_exports__["a"] = (PopupInner);
  9550. /***/ }),
  9551. /* 161 */
  9552. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9553. "use strict";
  9554. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return placements; });
  9555. var autoAdjustOverflow = {
  9556. adjustX: 1,
  9557. adjustY: 1
  9558. };
  9559. var targetOffset = [0, 0];
  9560. var placements = {
  9561. left: {
  9562. points: ['cr', 'cl'],
  9563. overflow: autoAdjustOverflow,
  9564. offset: [-4, 0],
  9565. targetOffset: targetOffset
  9566. },
  9567. right: {
  9568. points: ['cl', 'cr'],
  9569. overflow: autoAdjustOverflow,
  9570. offset: [4, 0],
  9571. targetOffset: targetOffset
  9572. },
  9573. top: {
  9574. points: ['bc', 'tc'],
  9575. overflow: autoAdjustOverflow,
  9576. offset: [0, -4],
  9577. targetOffset: targetOffset
  9578. },
  9579. bottom: {
  9580. points: ['tc', 'bc'],
  9581. overflow: autoAdjustOverflow,
  9582. offset: [0, 4],
  9583. targetOffset: targetOffset
  9584. },
  9585. topLeft: {
  9586. points: ['bl', 'tl'],
  9587. overflow: autoAdjustOverflow,
  9588. offset: [0, -4],
  9589. targetOffset: targetOffset
  9590. },
  9591. leftTop: {
  9592. points: ['tr', 'tl'],
  9593. overflow: autoAdjustOverflow,
  9594. offset: [-4, 0],
  9595. targetOffset: targetOffset
  9596. },
  9597. topRight: {
  9598. points: ['br', 'tr'],
  9599. overflow: autoAdjustOverflow,
  9600. offset: [0, -4],
  9601. targetOffset: targetOffset
  9602. },
  9603. rightTop: {
  9604. points: ['tl', 'tr'],
  9605. overflow: autoAdjustOverflow,
  9606. offset: [4, 0],
  9607. targetOffset: targetOffset
  9608. },
  9609. bottomRight: {
  9610. points: ['tr', 'br'],
  9611. overflow: autoAdjustOverflow,
  9612. offset: [0, 4],
  9613. targetOffset: targetOffset
  9614. },
  9615. rightBottom: {
  9616. points: ['bl', 'br'],
  9617. overflow: autoAdjustOverflow,
  9618. offset: [4, 0],
  9619. targetOffset: targetOffset
  9620. },
  9621. bottomLeft: {
  9622. points: ['tl', 'bl'],
  9623. overflow: autoAdjustOverflow,
  9624. offset: [0, 4],
  9625. targetOffset: targetOffset
  9626. },
  9627. leftBottom: {
  9628. points: ['br', 'bl'],
  9629. overflow: autoAdjustOverflow,
  9630. offset: [-4, 0],
  9631. targetOffset: targetOffset
  9632. }
  9633. };
  9634. /* unused harmony default export */ var _unused_webpack_default_export = (placements);
  9635. /***/ }),
  9636. /* 162 */
  9637. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9638. "use strict";
  9639. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__ = __webpack_require__(2);
  9640. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__);
  9641. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(3);
  9642. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn__);
  9643. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits__ = __webpack_require__(4);
  9644. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits__);
  9645. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react__ = __webpack_require__(0);
  9646. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_react__);
  9647. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_prop_types__ = __webpack_require__(1);
  9648. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_prop_types__);
  9649. var Content = function (_React$Component) {
  9650. __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits___default()(Content, _React$Component);
  9651. function Content() {
  9652. __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default()(this, Content);
  9653. return __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn___default()(this, _React$Component.apply(this, arguments));
  9654. }
  9655. Content.prototype.componentDidUpdate = function componentDidUpdate() {
  9656. var trigger = this.props.trigger;
  9657. if (trigger) {
  9658. trigger.forcePopupAlign();
  9659. }
  9660. };
  9661. Content.prototype.render = function render() {
  9662. var _props = this.props,
  9663. overlay = _props.overlay,
  9664. prefixCls = _props.prefixCls,
  9665. id = _props.id;
  9666. return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
  9667. 'div',
  9668. { className: prefixCls + '-inner', id: id, role: 'tooltip' },
  9669. typeof overlay === 'function' ? overlay() : overlay
  9670. );
  9671. };
  9672. return Content;
  9673. }(__WEBPACK_IMPORTED_MODULE_3_react___default.a.Component);
  9674. Content.propTypes = {
  9675. prefixCls: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.string,
  9676. overlay: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.node, __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func]).isRequired,
  9677. id: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.string,
  9678. trigger: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.any
  9679. };
  9680. /* harmony default export */ __webpack_exports__["a"] = (Content);
  9681. /***/ })
  9682. /******/ ])["default"];
  9683. });
  9684. //# sourceMappingURL=rc-slider.js.map